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
44866b0f
Commit
44866b0f
authored
6 years ago
by
Chif Gergő
Browse files
Options
Downloads
Patches
Plain Diff
Add TraineeDetail page
parent
81123aa9
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/actions/statistics.js
+15
-0
15 additions, 0 deletions
src/actions/statistics.js
src/components/Main.js
+2
-0
2 additions, 0 deletions
src/components/Main.js
src/components/pages/TraineeDetail.js
+57
-0
57 additions, 0 deletions
src/components/pages/TraineeDetail.js
with
74 additions
and
0 deletions
src/actions/statistics.js
+
15
−
0
View file @
44866b0f
...
...
@@ -8,6 +8,7 @@ import {
WRITE_EVENT
,
ADD_EVENT
,
DELETE_EVENT
,
GET_TRAINEE_BY_ID
,
}
from
'
./types
'
;
export
const
getEvents
=
()
=>
(
...
...
@@ -38,6 +39,20 @@ export const getEventById = id => (
}
);
export
const
getTraineeById
=
id
=>
(
async
(
dispatch
)
=>
{
try
{
const
response
=
await
axios
.
get
(
`/api/v1/profiles/
${
id
}
`
);
dispatch
({
type
:
GET_TRAINEE_BY_ID
,
payload
:
response
.
data
,
});
}
catch
(
e
)
{
console
.
log
(
e
);
}
}
);
export
const
getTrainees
=
()
=>
(
async
(
dispatch
)
=>
{
try
{
...
...
This diff is collapsed.
Click to expand it.
src/components/Main.js
+
2
−
0
View file @
44866b0f
...
...
@@ -10,6 +10,7 @@ import Statistics from './pages/Statistics';
import
Groups
from
'
./pages/Groups
'
;
import
News
from
'
./pages/News
'
;
import
EventDetail
from
'
./pages/EventDetail
'
;
import
TraineeDetail
from
'
./pages/TraineeDetail
'
;
const
Main
=
()
=>
(
<
Switch
>
...
...
@@ -22,6 +23,7 @@ const Main = () => (
<
Route
path
=
'
/statistics
'
component
=
{
Statistics
}
/
>
<
Route
path
=
'
/groups
'
component
=
{
Groups
}
/
>
<
Route
path
=
'
/events/:id
'
component
=
{
EventDetail
}
/
>
<
Route
path
=
'
/trainees/:id
'
component
=
{
TraineeDetail
}
/
>
<
Route
component
=
{
NotFound
}
/
>
<
/Switch
>
);
...
...
This diff is collapsed.
Click to expand it.
src/components/pages/TraineeDetail.js
0 → 100644
+
57
−
0
View file @
44866b0f
import
React
,
{
Component
}
from
'
react
'
;
import
{
Container
,
Item
,
Button
,
Comment
,
Form
,
Header
,
Table
,
Icon
,
Checkbox
,
}
from
'
semantic-ui-react
'
;
import
{
connect
}
from
'
react-redux
'
;
import
moment
from
'
moment
'
;
import
{
getEvents
,
getTraineeById
}
from
'
../../actions/statistics
'
;
class
TraineeDetail
extends
Component
{
componentWillMount
()
{
this
.
props
.
getTraineeById
(
this
.
props
.
match
.
params
.
id
);
//this.props.getNotesByTrainee(this.props.match.params.id);
this
.
props
.
getEvents
();
}
renderTrainee
()
{
const
{
full_name
,
nick
}
=
this
.
props
.
selectedTrainee
;
return
(
<
Item
>
<
Item
.
Header
as
=
'
h2
'
>
{
full_name
}
<
/Item.Header
>
<
Item
.
Header
as
=
'
h3
'
>
{
nick
}
<
/Item.Header
>
<
/Item
>
);
}
render
()
{
return
(
<
Container
>
<
Container
textAlign
=
'
center
'
>
{
this
.
props
.
selectedTrainee
?
this
.
renderTrainee
()
:
''
}
<
/Container
>
<
Container
style
=
{{
padding
:
'
80px
'
,
}}
/
>
<
/Container
>
);
}
}
const
mapStateToProps
=
({
events
:
{
events
},
trainees
:
{
selectedTrainee
}
})
=>
(
{
events
,
selectedTrainee
});
export
default
connect
(
mapStateToProps
,
{
getEvents
,
getTraineeById
})(
TraineeDetail
);
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