diff --git a/src/components/pages/ApplicantProfile.js b/src/components/pages/ApplicantProfile.js index 535617c75f03d53c51b485bdf0578051c346a6df..a8595aa590f64c9fc5b288138d4ddc681f7dec4c 100644 --- a/src/components/pages/ApplicantProfile.js +++ b/src/components/pages/ApplicantProfile.js @@ -1,16 +1,36 @@ import React, { Component } from 'react'; -import { Container, Header, Item, Button, Label } from 'semantic-ui-react'; +import { Container, Header, Item, Button, Label, List } from 'semantic-ui-react'; import { connect } from 'react-redux'; import { getSelectedProfile, setStatus } from '../../actions/statistics'; import ConfirmModal from '../forms/ConfirmModal'; +const options = [ + { key: 'DT', text: 'DevTeam' }, + { key: 'NET', text: 'NETeam' }, + { key: 'ST', text: 'SecurITeam' }, + { key: 'SYS', text: 'SysAdmin' }, + { key: 'HAT', text: 'HallgatĂłi TudĂĄsbĂĄzis' }, +]; + class ApplicantProfile extends Component { componentWillMount() { this.props.getSelectedProfile(this.props.match.params.id); } + renderGroups() { + const { groups } = this.props.selectedProfile; + const groupNames = options.map(item => (groups.includes(item.key) ? item.text : null)); + return groupNames.map(item => ( + <List.Item> + <List.Content> + <List.Header>{item}</List.Header> + </List.Content> + </List.Item> + )); + } + render() { - const { id, signed, role, full_name, nick, motivation_about, motivation_exercise, motivation_profession } + const { id, signed, groups, role, full_name, nick, motivation_about, motivation_exercise, motivation_profession } = this.props.selectedProfile; return ( <Container style={{ padding: '60px' }}> @@ -28,6 +48,14 @@ class ApplicantProfile extends Component { <p>{motivation_profession}</p> <Header as='h3'>Feladatok megoldĂĄsa:</Header> <p>{motivation_exercise}</p> + <Header as='h3'>ĂrdeklĹdĂŠs:</Header> + { groups ? + <List horizontal> + {this.renderGroups()} + </List> + : + null + } </Container> <Container textAlign='center' style={{ padding: '20px' }}> <Header as='h3'>StĂĄtusz:</Header> diff --git a/src/components/pages/Applications.js b/src/components/pages/Applications.js index 68e6ce9ca2521880986e17a23f95da35bb155aec..934252c893eb21d80c7acb6e5de67805516bdb43 100644 --- a/src/components/pages/Applications.js +++ b/src/components/pages/Applications.js @@ -52,16 +52,19 @@ class Applications extends Component { </Table.Cell> } <Table.Cell> - <ConfirmModal - button = {<Button - color='blue' - size='tiny' - > - Staff jog adĂĄs - </Button>} - text='staff jogot adsz neki' - onAccept={() => this.props.setStatus(profile.id, 'Staff')} - /> + { profile.role !== 'Staff' ? + <ConfirmModal + button={<Button + color='blue' + size='tiny' + > + Staff jog adĂĄs + </Button>} + text='staff jogot adsz neki' + onAccept={() => this.props.setStatus(profile.id, 'Staff')} + /> + : + null } </Table.Cell> </Table.Row> );