Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
kszkepzes-frontend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Köpeczi-Bócz Gergely
kszkepzes-frontend
Commits
51658286
Commit
51658286
authored
6 years ago
by
Chif Gergő
Browse files
Options
Downloads
Patches
Plain Diff
Add more status label based on the profiles role
parent
ff083543
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/actions/statistics.js
+2
-3
2 additions, 3 deletions
src/actions/statistics.js
src/components/pages/Applications.js
+31
-13
31 additions, 13 deletions
src/components/pages/Applications.js
with
33 additions
and
16 deletions
src/actions/statistics.js
+
2
−
3
View file @
51658286
...
...
@@ -136,12 +136,11 @@ export const getProfiles = () => (
}
);
export
const
setSta
ffSta
tus
=
id
=>
(
export
const
setStatus
=
(
id
,
status
)
=>
(
async
(
dispatch
)
=>
{
try
{
const
response
=
await
axios
.
patch
(
`/api/v1/profiles/
${
id
}
/`
,
{
signed
:
true
,
role
:
'
Staff
'
,
role
:
status
,
});
if
(
response
.
data
.
id
)
{
}
...
...
This diff is collapsed.
Click to expand it.
src/components/pages/Applications.js
+
31
−
13
View file @
51658286
import
React
,
{
Component
}
from
'
react
'
;
import
{
Link
}
from
'
react-router-dom
'
;
import
{
Container
,
Table
,
Icon
,
Button
}
from
'
semantic-ui-react
'
;
import
{
Container
,
Table
,
Label
,
Button
}
from
'
semantic-ui-react
'
;
import
{
connect
}
from
'
react-redux
'
;
import
{
getProfiles
,
setSta
ffSta
tus
}
from
'
../../actions/statistics
'
;
import
{
getProfiles
,
setStatus
}
from
'
../../actions/statistics
'
;
class
Applications
extends
Component
{
componentWillMount
()
{
...
...
@@ -18,19 +18,37 @@ class Applications extends Component {
{
profile
.
full_name
}
<
/Link
>
<
/Table.Cell
>
<
Table
.
Cell
textAlign
=
'
center
'
>
{
profile
.
role
===
'
Student
'
?
<
Icon
color
=
'
green
'
name
=
'
checkmark
'
/>
:
profile
.
role
===
'
Staff
'
?
<
strong
>
Staff
<
/strong
>
{
profile
.
signed
?
<
Table
.
Cell
textAlign
=
'
center
'
>
{
profile
.
role
===
'
Student
'
?
<
Label
color
=
'
green
'
>
Elfogadva
<
/Label
>
:
<
Icon
color
=
'
red
'
name
=
'
cancel
'
/>
}
<
/Table.Cell
>
null
}
{
profile
.
role
===
'
Staff
'
?
<
Label
color
=
'
blue
'
>
Staff
<
/Label
>
:
null
}
{
profile
.
role
===
'
Apllicant
'
?
<
Label
color
=
'
yellow
'
>
Jelentkezett
<
/Label
>
:
null
}
{
profile
.
role
===
'
Denied
'
?
<
Label
color
=
'
red
'
>
Elutasítva
<
/Label
>
:
null
}
<
/Table.Cell
>
:
<
Table
.
Cell
textAlign
=
'
center
'
>
<
Label
color
=
'
red
'
>
Nem
jelentkezett
<
/Label
>
<
/Table.Cell
>
}
<
Table
.
Cell
>
<
Button
onClick
=
{()
=>
this
.
props
.
setSta
ffSta
tus
(
profile
.
id
)}
onClick
=
{()
=>
this
.
props
.
setStatus
(
profile
.
id
,
'
Staff
'
)}
color
=
'
blue
'
size
=
'
tiny
'
>
...
...
@@ -70,4 +88,4 @@ class Applications extends Component {
const
mapStateToProps
=
({
trainees
:
{
profiles
},
user
})
=>
({
profiles
,
user
});
export
default
connect
(
mapStateToProps
,
{
getProfiles
,
setSta
ffSta
tus
})(
Applications
);
export
default
connect
(
mapStateToProps
,
{
getProfiles
,
setStatus
})(
Applications
);
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment