Skip to content

Commit 1dc4465

Browse files
author
Jovert Lota Palonpon
committed
Resolve #37
1 parent 3051873 commit 1dc4465

File tree

4 files changed

+42
-4
lines changed

4 files changed

+42
-4
lines changed

resources/js/views/__backoffice/users/Edit.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import {
1111
withStyles,
1212
} from '@material-ui/core';
1313

14+
import * as UrlUtils from '../../../utils/URL';
1415
import * as NavigationUtils from '../../../utils/Navigation';
1516
import { User } from '../../../models';
1617
import { LinearIndeterminate } from '../../../ui/Loaders';
@@ -137,6 +138,13 @@ class Edit extends Component {
137138

138139
async componentDidMount() {
139140
const { params } = this.props.match;
141+
const { location } = this.props;
142+
143+
const queryParams = UrlUtils._queryParams(location.search);
144+
145+
if (queryParams.hasOwnProperty('step')) {
146+
this.setState({ activeStep: parseInt(queryParams.step) });
147+
}
140148

141149
await this.fetchUser(params.id);
142150
}

resources/js/views/__backoffice/users/List.js

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@ import {
88
Typography,
99
} from '@material-ui/core';
1010

11-
import { Delete as DeleteIcon, Edit as EditIcon } from '@material-ui/icons';
11+
import {
12+
Delete as DeleteIcon,
13+
Edit as EditIcon,
14+
Image as ImageIcon,
15+
} from '@material-ui/icons';
1216

1317
import * as RandomUtils from '../../../utils/Random';
1418
import * as NavigationUtils from '../../../utils/Navigation';
@@ -436,7 +440,31 @@ class List extends Component {
436440
),
437441
email: user.email,
438442
actions: (
439-
<div style={{ width: '5rem' }}>
443+
<div style={{ width: 120, flex: 'no-wrap' }}>
444+
<Tooltip
445+
title={Lang.get('resources.edit_image', {
446+
name: 'User',
447+
})}
448+
>
449+
<IconButton
450+
onClick={() =>
451+
history.push(
452+
NavigationUtils._route(
453+
'backoffice.users.edit',
454+
{
455+
id: user.id,
456+
},
457+
{
458+
step: 2,
459+
},
460+
),
461+
)
462+
}
463+
>
464+
<ImageIcon />
465+
</IconButton>
466+
</Tooltip>
467+
440468
<Tooltip
441469
title={Lang.get('resources.edit', {
442470
name: 'User',

resources/lang/en/resources.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
'show' => 'View :name',
1616
'edit' => 'Edit :name',
1717
'delete' => 'Delete :name',
18+
'edit_image' => "Edit :name's image",
1819

1920
'delete_confirmation_title' => 'You are deleting a :name',
2021
'delete_confirmation_body' => "If not undone, the :name won't be recovered anymore.",

resources/lang/fil/resources.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
'show' => 'Tingnan ang :name',
1616
'edit' => 'I-edit ang :name',
1717
'delete' => 'Burahin ang :name',
18+
'edit_image' => "I-edit ang imahe ng :name",
1819

1920
'delete_confirmation_title' => 'Ikaw ay nagbubura ng isang :name',
2021
'delete_confirmation_body' => "Kung maituloy, ang :name ay di na mare-recover pa.",
@@ -23,8 +24,8 @@
2324
'not_fetched' => 'Error sa pagkuha ng mga :name!',
2425
'created' => 'Ang :name ay matagumpay na nagawa!',
2526
'not_created' => 'Ang :name ay hindi nagawa!',
26-
'updated' => 'Ang :name ay matagumpay na na-updated!',
27-
'not_updated' => 'Ang :name ay hindi ma-updated!',
27+
'updated' => 'Ang :name ay matagumpay na na-update!',
28+
'not_updated' => 'Ang :name ay hindi ma-update!',
2829
'deleted' => 'Ang :name ay burado na!',
2930
'not_deleted' => 'Ang :name ay hindi nabura!',
3031
'restored' => 'Ang :name ay naibalik!',

0 commit comments

Comments
 (0)