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
JetBrains YouTrack
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
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
KSZK
DevTeam
kszkepzes
old
kszkepzes-frontend
Commits
40daca15
Commit
40daca15
authored
6 years ago
by
Chif Gergő
Browse files
Options
Downloads
Patches
Plain Diff
Staffs can add more staffs
parent
683001d8
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/actions/statistics.js
+16
-0
16 additions, 0 deletions
src/actions/statistics.js
src/actions/types.js
+1
-0
1 addition, 0 deletions
src/actions/types.js
src/components/pages/Applications.js
+13
-3
13 additions, 3 deletions
src/components/pages/Applications.js
with
30 additions
and
3 deletions
src/actions/statistics.js
+
16
−
0
View file @
40daca15
...
...
@@ -9,6 +9,7 @@ import {
DELETE_EVENT
,
GET_TRAINEE_BY_ID
,
GET_PROFILES
,
SET_STAFF
,
}
from
'
./types
'
;
export
const
getEvents
=
()
=>
(
...
...
@@ -149,3 +150,18 @@ export const getProfiles = () => (
}
}
);
export
const
setStaffStatus
=
id
=>
(
async
(
dispatch
)
=>
{
try
{
const
response
=
await
axios
.
patch
(
`/api/v1/profiles/
${
id
}
/`
,
{
signed
:
true
,
role
:
'
Staff
'
,
});
if
(
response
.
data
.
id
)
{
}
}
catch
(
e
)
{
console
.
log
(
e
);
}
}
);
This diff is collapsed.
Click to expand it.
src/actions/types.js
+
1
−
0
View file @
40daca15
...
...
@@ -28,3 +28,4 @@ export const CLEAR_NOTE = 'clear_note';
export
const
ADD_EVENT_NOTE
=
'
add_note
'
;
export
const
GET_PROFILES
=
'
get_profiles
'
;
export
const
SET_STAFF
=
'
set_staff
'
;
This diff is collapsed.
Click to expand it.
src/components/pages/Applications.js
+
13
−
3
View file @
40daca15
import
React
,
{
Component
}
from
'
react
'
;
import
moment
from
'
moment
'
;
import
{
Link
}
from
'
react-router-dom
'
;
import
{
Container
,
Table
,
Icon
}
from
'
semantic-ui-react
'
;
import
{
Container
,
Table
,
Icon
,
Button
}
from
'
semantic-ui-react
'
;
import
{
connect
}
from
'
react-redux
'
;
import
{
getProfiles
}
from
'
../../actions/statistics
'
;
import
{
getProfiles
,
setStaffStatus
}
from
'
../../actions/statistics
'
;
class
Applications
extends
Component
{
componentWillMount
()
{
...
...
@@ -29,6 +29,15 @@ class Applications extends Component {
<
Icon
color
=
'
red
'
name
=
'
cancel
'
/>
}
<
/Table.Cell
>
<
Table
.
Cell
>
<
Button
onClick
=
{()
=>
this
.
props
.
setStaffStatus
(
profile
.
id
)}
color
=
'
blue
'
size
=
'
tiny
'
>
ADD
STAFF
STATUS
<
/Button
>
<
/Table.Cell
>
<
/Table.Row
>
);
});
...
...
@@ -47,6 +56,7 @@ class Applications extends Component {
<
Table
.
Row
>
<
Table
.
HeaderCell
>
Jelentkezettek
<
/Table.HeaderCell
>
<
Table
.
HeaderCell
>
Jelentkezés
elfogadva
:
<
/Table.HeaderCell
>
<
Table
.
HeaderCell
/>
<
/Table.Row
>
<
/Table.Header
>
...
...
@@ -61,4 +71,4 @@ class Applications extends Component {
const
mapStateToProps
=
({
trainees
:
{
profiles
},
user
})
=>
({
profiles
,
user
});
export
default
connect
(
mapStateToProps
,
{
getProfiles
})(
Applications
);
export
default
connect
(
mapStateToProps
,
{
getProfiles
,
setStaffStatus
})(
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