Skip to content

Commit

Permalink
Resolve #37
Browse files Browse the repository at this point in the history
  • Loading branch information
Jovert Lota Palonpon committed Apr 4, 2019
1 parent 3051873 commit 1dc4465
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 4 deletions.
8 changes: 8 additions & 0 deletions resources/js/views/__backoffice/users/Edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
withStyles,
} from '@material-ui/core';

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

async componentDidMount() {
const { params } = this.props.match;
const { location } = this.props;

const queryParams = UrlUtils._queryParams(location.search);

if (queryParams.hasOwnProperty('step')) {
this.setState({ activeStep: parseInt(queryParams.step) });
}

await this.fetchUser(params.id);
}
Expand Down
32 changes: 30 additions & 2 deletions resources/js/views/__backoffice/users/List.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@ import {
Typography,
} from '@material-ui/core';

import { Delete as DeleteIcon, Edit as EditIcon } from '@material-ui/icons';
import {
Delete as DeleteIcon,
Edit as EditIcon,
Image as ImageIcon,
} from '@material-ui/icons';

import * as RandomUtils from '../../../utils/Random';
import * as NavigationUtils from '../../../utils/Navigation';
Expand Down Expand Up @@ -436,7 +440,31 @@ class List extends Component {
),
email: user.email,
actions: (
<div style={{ width: '5rem' }}>
<div style={{ width: 120, flex: 'no-wrap' }}>
<Tooltip
title={Lang.get('resources.edit_image', {
name: 'User',
})}
>
<IconButton
onClick={() =>
history.push(
NavigationUtils._route(
'backoffice.users.edit',
{
id: user.id,
},
{
step: 2,
},
),
)
}
>
<ImageIcon />
</IconButton>
</Tooltip>

<Tooltip
title={Lang.get('resources.edit', {
name: 'User',
Expand Down
1 change: 1 addition & 0 deletions resources/lang/en/resources.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
'show' => 'View :name',
'edit' => 'Edit :name',
'delete' => 'Delete :name',
'edit_image' => "Edit :name's image",

'delete_confirmation_title' => 'You are deleting a :name',
'delete_confirmation_body' => "If not undone, the :name won't be recovered anymore.",
Expand Down
5 changes: 3 additions & 2 deletions resources/lang/fil/resources.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
'show' => 'Tingnan ang :name',
'edit' => 'I-edit ang :name',
'delete' => 'Burahin ang :name',
'edit_image' => "I-edit ang imahe ng :name",

'delete_confirmation_title' => 'Ikaw ay nagbubura ng isang :name',
'delete_confirmation_body' => "Kung maituloy, ang :name ay di na mare-recover pa.",
Expand All @@ -23,8 +24,8 @@
'not_fetched' => 'Error sa pagkuha ng mga :name!',
'created' => 'Ang :name ay matagumpay na nagawa!',
'not_created' => 'Ang :name ay hindi nagawa!',
'updated' => 'Ang :name ay matagumpay na na-updated!',
'not_updated' => 'Ang :name ay hindi ma-updated!',
'updated' => 'Ang :name ay matagumpay na na-update!',
'not_updated' => 'Ang :name ay hindi ma-update!',
'deleted' => 'Ang :name ay burado na!',
'not_deleted' => 'Ang :name ay hindi nabura!',
'restored' => 'Ang :name ay naibalik!',
Expand Down

0 comments on commit 1dc4465

Please sign in to comment.