Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit f611dee

Browse files
2 parents 82ddcfe + 57ce5fe commit f611dee

File tree

3 files changed

+32
-250
lines changed

3 files changed

+32
-250
lines changed

‎src/containers/App/Backend/Access/Roles/Form.js

Lines changed: 17 additions & 238 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ class Form extends Component {
7777
const { user } = this.props;
7878
const isEditMode = user ? true : false;
7979
const { errors } = this.props;
80+
8081
if (user) {
8182
data.first_name = user.first_name;
8283
data.id = user.id;
@@ -88,7 +89,7 @@ class Form extends Component {
8889
data.assignees_roles = roleMap[user.role];
8990
}
9091
if (this.props.match.params.id && errors) {
91-
this.props.history.push('/access/user');
92+
this.props.history.push('/access/role');
9293
}
9394
return (
9495
<div className="animated fadeIn">
@@ -101,7 +102,7 @@ class Form extends Component {
101102
<Card>
102103
<CardHeader>
103104
<i className="fa fa fa-user-plus" />{' '}
104-
{isEditMode ? 'Update' : 'Create'} User
105+
{isEditMode ? 'Update' : 'Create'} Role
105106
</CardHeader>
106107
<CardBody>
107108
<Row>
@@ -111,19 +112,19 @@ class Form extends Component {
111112
<FormGroup row>
112113
<Label
113114
className="col-md-3 col-form-label"
114-
htmlFor="first_name"
115+
htmlFor="name"
115116
>
116-
First Name*
117+
Name*
117118
</Label>
118119
<Col md="9">
119120
<InputGroup>
120121
<Field
121122
className="form-control"
122123
component="input"
123124
type="text"
124-
id="first_name"
125-
name="first_name"
126-
placeholder="Enter First Name..."
125+
id="name"
126+
name="name"
127+
placeholder="Enter Role..."
127128
required
128129
/>
129130
<InputGroupAddon addonType="append">
@@ -134,227 +135,6 @@ class Form extends Component {
134135
</InputGroup>
135136
</Col>
136137
</FormGroup>
137-
<FormGroup row>
138-
<Label
139-
className="col-md-3 col-form-label"
140-
htmlFor="last_name"
141-
>
142-
Last Name*
143-
</Label>
144-
<Col md="9">
145-
<InputGroup>
146-
<Field
147-
className="form-control"
148-
component="input"
149-
type="text"
150-
id="last_name"
151-
name="last_name"
152-
placeholder="Enter Last Name..."
153-
required
154-
/>
155-
<InputGroupAddon addonType="append">
156-
<InputGroupText>
157-
<i className="fa fa-user" />
158-
</InputGroupText>
159-
</InputGroupAddon>
160-
</InputGroup>
161-
</Col>
162-
</FormGroup>
163-
<FormGroup row>
164-
<Label
165-
className="col-md-3 col-form-label"
166-
htmlFor="email"
167-
>
168-
Email*
169-
</Label>
170-
<Col md="9">
171-
<InputGroup>
172-
<Field
173-
className="form-control"
174-
component="input"
175-
type="email"
176-
id="email"
177-
name="email"
178-
placeholder="Enter Email..."
179-
required
180-
/>
181-
<InputGroupAddon addonType="append">
182-
<InputGroupText>
183-
<i className="fa fa-envelope" />
184-
</InputGroupText>
185-
</InputGroupAddon>
186-
</InputGroup>
187-
</Col>
188-
</FormGroup>
189-
{!isEditMode && (
190-
<div>
191-
<FormGroup row>
192-
<Label
193-
className="col-md-3 col-form-label"
194-
htmlFor="password"
195-
>
196-
Password*
197-
</Label>
198-
<Col md="9">
199-
<InputGroup>
200-
<Field
201-
className="form-control"
202-
component="input"
203-
type="password"
204-
id="password"
205-
name="password"
206-
placeholder="Enter Password..."
207-
required
208-
/>
209-
<InputGroupAddon addonType="append">
210-
<InputGroupText>
211-
<i className="fa fa-lock" />
212-
</InputGroupText>
213-
</InputGroupAddon>
214-
</InputGroup>
215-
</Col>
216-
</FormGroup>
217-
<FormGroup row>
218-
<Label
219-
className="col-md-3 col-form-label"
220-
htmlFor="password"
221-
>
222-
Confirm Password*
223-
</Label>
224-
<Col md="9">
225-
<InputGroup>
226-
<Field
227-
className="form-control"
228-
component="input"
229-
type="password"
230-
id="password_confirmation"
231-
name="password_confirmation"
232-
placeholder="Enter Confirm Password..."
233-
required
234-
/>
235-
<InputGroupAddon addonType="append">
236-
<InputGroupText>
237-
<i className="fa fa-lock" />
238-
</InputGroupText>
239-
</InputGroupAddon>
240-
</InputGroup>
241-
</Col>
242-
</FormGroup>
243-
</div>
244-
)}
245-
246-
<FormGroup row>
247-
<Label
248-
className="col-md-3 col-form-label"
249-
htmlFor="status"
250-
>
251-
User Active
252-
</Label>
253-
<Col md="9">
254-
<Field
255-
type="checkbox"
256-
id="status"
257-
name="status"
258-
component="input"
259-
className="centered-checkbox"
260-
/>
261-
</Col>
262-
</FormGroup>
263-
<FormGroup row>
264-
<Label
265-
className="col-md-3 col-form-label"
266-
htmlFor="confirmed"
267-
>
268-
User Confirmed
269-
</Label>
270-
<Col md="9">
271-
<Field
272-
type="checkbox"
273-
id="confirmed"
274-
name="confirmed"
275-
component="input"
276-
className="centered-checkbox"
277-
/>
278-
</Col>
279-
</FormGroup>
280-
<FormGroup row>
281-
<Label
282-
className="col-md-3 col-form-label"
283-
htmlFor="confirmation_email"
284-
>
285-
Send Confirmation
286-
</Label>
287-
<Col md="9">
288-
<Field
289-
type="checkbox"
290-
id="confirmation_email"
291-
name="confirmation_email"
292-
component="input"
293-
className="centered-checkbox"
294-
/>
295-
</Col>
296-
</FormGroup>
297-
<FormGroup row>
298-
<Col md="3">
299-
<Label>Associated Roles</Label>
300-
</Col>
301-
<Col md="9">
302-
<FormGroup check inline className="col-md-3">
303-
<Field
304-
component="input"
305-
type="radio"
306-
id="inline-radio1"
307-
name="assignees_roles"
308-
value="1"
309-
className="form-check-input"
310-
/>
311-
<Label
312-
className="form-check-label"
313-
check
314-
htmlFor="inline-radio1"
315-
>
316-
{' '}
317-
Administrator
318-
</Label>
319-
</FormGroup>
320-
<FormGroup check inline className="col-md-3">
321-
<Field
322-
component="input"
323-
type="radio"
324-
id="inline-radio2"
325-
name="assignees_roles"
326-
value="2"
327-
className="form-check-input"
328-
/>
329-
<Label
330-
className="form-check-label"
331-
check
332-
htmlFor="inline-radio2"
333-
>
334-
{' '}
335-
Executive
336-
</Label>
337-
</FormGroup>
338-
<FormGroup check inline className="col-md-3">
339-
<Field
340-
component="input"
341-
type="radio"
342-
id="inline-radio3"
343-
name="assignees_roles"
344-
value="3"
345-
className="form-check-input"
346-
/>
347-
<Label
348-
className="form-check-label"
349-
check
350-
htmlFor="inline-radio3"
351-
>
352-
{' '}
353-
User
354-
</Label>
355-
</FormGroup>
356-
</Col>
357-
</FormGroup>
358138
</Col>
359139
</Row>
360140
</CardBody>
@@ -370,7 +150,7 @@ class Form extends Component {
370150
</Button>{' '}
371151
<Button
372152
tag={Link}
373-
to={`/access/user`}
153+
to={`/access/role`}
374154
className="btn btn-outline-danger"
375155
>
376156
{' '}
@@ -391,20 +171,19 @@ const mapStateToProps = state => ({
391171
});
392172

393173
const mapDispatchToProps = dispatch => ({
394-
/*onSubmit: (values) => {
395-
if (values.id) {
396-
dispatch({type: ROLE_UPDATE, payload: userAgent.update(values)})
397-
}
398-
else {
399-
dispatch({type: ROLE_CREATE, payload: userAgent.create(values)})
400-
}
401-
},*/
174+
onSubmit: values => {
175+
if (values.id) {
176+
dispatch({ type: ROLE_UPDATE, payload: userAgent.update(values) });
177+
} else {
178+
dispatch({ type: ROLE_CREATE, payload: userAgent.create(values) });
179+
}
180+
},
402181
onLoad: payload => dispatch({ type: ROLE_FORM_PAGE_LOADED, payload }),
403182
onUnload: () => dispatch({ type: ROLE_FORM_PAGE_UNLOADED }),
404183
});
405184

406185
export default reduxForm({
407-
form: 'CreateUserForm',
186+
form: 'CreateRoleForm',
408187
initialValues: data,
409188
})(
410189
connect(

‎src/containers/App/Backend/Access/Roles/List.js

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -153,8 +153,8 @@ class List extends Component {
153153
Action
154154
</DropdownToggle>
155155
<DropdownMenu right>
156-
<DropdownItem tag={Link} to="/access/user/create">
157-
<i className="fa fa-user-plus" />Create User
156+
<DropdownItem tag={Link} to="/access/role/create">
157+
<i className="fa fa-user-plus" />Create Role
158158
</DropdownItem>
159159
</DropdownMenu>
160160
</ButtonDropdown>
@@ -242,15 +242,18 @@ class List extends Component {
242242
<i className="fa fa-edit" />
243243
</Button>
244244
&nbsp;
245-
<Button
246-
onClick={() => this.onClickDelete(row.value)}
247-
block={false}
248-
outline
249-
color="danger"
250-
size="sm"
251-
>
252-
<i className="fa fa-trash" />
253-
</Button>
245+
{row.value != 1 ? (
246+
<Button
247+
onClick={() => this.onClickDelete(row.value)}
248+
block={false}
249+
outline
250+
color="danger"
251+
size="sm"
252+
>
253+
{' '}
254+
<i className="fa fa-trash" />
255+
</Button>
256+
) : null}
254257
</span>
255258
),
256259
sortable: false,

‎src/containers/App/Backend/Home/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default class Home extends Component {
44
render() {
55
return (
66
<div>
7-
<h1> Dashboard Layoutss. </h1>
7+
<h1> Dashboard Layouts. </h1>
88
</div>
99
);
1010
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /