Max - Create add staff modal [skip ci]

This commit is contained in:
ivan 2016-12-08 18:37:41 -03:00
parent 5f3eb6c00f
commit 8a5474ffc4
4 changed files with 49 additions and 1 deletions

View File

@ -0,0 +1,38 @@
import React from 'react';
import i18n from 'lib-app/i18n';
import Header from 'core-components/header'
import Form from 'core-components/form';
import FormField from 'core-components/form-field';
import SubmitButton from 'core-components/submit-button';
class AddStaffModal extends React.Component {
render() {
return (
<div>
<Header title={i18n('ADD_STAFF')} description={i18n('ADD_STAFF_DESCRIPTION')} />
<Form onSubmit={this.onSubmit.bind(this)}>
<FormField name="name" label={i18n('NAME')} fieldProps={{size: 'large'}} validation="NAME" required />
<FormField name="email" label={i18n('EMAIL')} fieldProps={{size: 'large'}} validation="EMAIL" required />
<FormField name="password" label={i18n('PASSWORD')} fieldProps={{size: 'large'}} validation="PASSWORD" required />
<FormField name="level" label={i18n('LEVEL')} field="select" fieldProps={{
items: [{content: 'Level 1 - Easy'}, {content: 'Level 2 - Medium'}, {content: 'Level 3 - Hard'}],
size: 'medium'
}} />
<SubmitButton type="secondary" size="small">
{i18n('SAVE')}
</SubmitButton>
</Form>
</div>
);
}
onSubmit(form) {
console.log(form);
}
}
export default AddStaffModal;

View File

@ -5,6 +5,9 @@ import i18n from 'lib-app/i18n';
import API from 'lib-app/api-call';
import SessionStore from 'lib-app/session-store';
import PeopleList from 'app-components/people-list';
import ModalContainer from 'app-components/modal-container';
import AddStaffModal from 'app/admin/panel/staff/add-staff-modal';
import Header from 'core-components/header';
import DropDown from 'core-components/drop-down';
@ -34,7 +37,7 @@ class AdminPanelStaffMembers extends React.Component {
<Header title={i18n('STAFF_MEMBERS')} description={i18n('STAFF_MEMBERS_DESCRIPTION')} />
<div className="admin-panel-staff-members__wrapper">
<DropDown {...this.getDepartmentDropdownProps()} className="admin-panel-staff-members__dropdown" />
<Button size="medium" onClick={() => {}} type="secondary" className="admin-panel-staff-members__button">
<Button onClick={this.onAddNewStaff.bind(this)} size="medium" type="secondary" className="admin-panel-staff-members__button">
<Icon name="user-plus" className=""/> {i18n('ADD_NEW_STAFF')}
</Button>
</div>
@ -43,6 +46,10 @@ class AdminPanelStaffMembers extends React.Component {
);
}
onAddNewStaff() {
ModalContainer.openModal(<AddStaffModal />);
}
getDepartmentDropdownProps() {
return {
items: this.getDepartments(),

View File

@ -99,6 +99,8 @@ export default {
'LAST_LOGIN': 'Last login',
'STAFF_MEMBERS': 'Staff members',
'ADD_NEW_STAFF': 'Add new staff',
'ADD_STAFF': 'Add staff',
'LEVEL': 'Level',
//VIEW DESCRIPTIONS
'CREATE_TICKET_DESCRIPTION': 'This is a form for creating tickets. Fill the form and send us your issues/doubts/suggestions. Our support system will answer it as soon as possible.',
@ -122,6 +124,7 @@ export default {
'LIST_ARTICLES_DESCRIPTION': 'This is a list of articles that includes information about our services.',
'ADD_TOPIC_DESCRIPTION': 'Here you can add a topic that works as a category for articles.',
'STAFF_MEMBERS_DESCRIPTION': 'Here you can see who are your staff members.',
'ADD_STAFF_DESCRIPTION': 'Here you can add staff members to your teams',
//ERRORS
'EMAIL_OR_PASSWORD': 'Email or password invalid',