Change 'copy' to 'duplicate' and switch to more appropriate icon (#149)
parent
2b43463fb0
commit
384e12e1ba
|
@ -55,7 +55,7 @@ export const routeResolver = new RouteResolver({
|
|||
_id: {
|
||||
_base: ':itemUid',
|
||||
edit: 'edit',
|
||||
copy: 'copy',
|
||||
duplicate: 'duplicate',
|
||||
log: 'log',
|
||||
},
|
||||
new: 'new',
|
||||
|
@ -284,7 +284,7 @@ class App extends React.PureComponent {
|
|||
|
||||
private autoRefresh() {
|
||||
if (navigator.onLine && this.props.credentials &&
|
||||
!(window.location.pathname.match(/.*\/(new|edit|copy)$/))) {
|
||||
!(window.location.pathname.match(/.*\/(new|edit|duplicate)$/))) {
|
||||
this.refresh();
|
||||
}
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@ import * as React from 'react';
|
|||
import { Route, Switch } from 'react-router';
|
||||
import Button from '@material-ui/core/Button';
|
||||
import IconEdit from '@material-ui/icons/Edit';
|
||||
import IconCopy from '@material-ui/icons/FileCopy';
|
||||
import IconDuplicate from '@material-ui/icons/FileCopy';
|
||||
import IconChangeHistory from '@material-ui/icons/ChangeHistory';
|
||||
import { withStyles } from '@material-ui/core/styles';
|
||||
|
||||
|
@ -192,7 +192,7 @@ const CollectionRoutes = withStyles(styles)(withRouter(
|
|||
/>
|
||||
{props.routePrefix === 'pim.events' &&
|
||||
<Route
|
||||
path={routeResolver.getRoute(props.routePrefix + '._id.copy')}
|
||||
path={routeResolver.getRoute(props.routePrefix + '._id.duplicate')}
|
||||
exact
|
||||
render={({ match }) => {
|
||||
const itemUid = decodeURIComponent(match.params.itemUid);
|
||||
|
@ -210,7 +210,7 @@ const CollectionRoutes = withStyles(styles)(withRouter(
|
|||
onDelete={props.onItemDelete}
|
||||
onCancel={props.onItemCancel}
|
||||
history={props.history}
|
||||
copy
|
||||
duplicate
|
||||
/>
|
||||
}
|
||||
</Container>
|
||||
|
@ -285,12 +285,12 @@ const CollectionRoutes = withStyles(styles)(withRouter(
|
|||
style={{ marginLeft: 15 }}
|
||||
onClick={() =>
|
||||
history.push(routeResolver.getRoute(
|
||||
props.routePrefix + '._id.copy',
|
||||
props.routePrefix + '._id.duplicate',
|
||||
{ itemUid: match.params.itemUid }))
|
||||
}
|
||||
>
|
||||
<IconCopy className={classes.leftIcon} />
|
||||
Copy
|
||||
<IconDuplicate className={classes.leftIcon} />
|
||||
Duplicate
|
||||
</Button>
|
||||
}
|
||||
</div>
|
||||
|
|
|
@ -50,7 +50,7 @@ interface PropsType {
|
|||
onCancel: () => void;
|
||||
location: Location;
|
||||
history: History;
|
||||
copy: boolean;
|
||||
duplicate: boolean;
|
||||
}
|
||||
|
||||
class EventEdit extends React.PureComponent<PropsType> {
|
||||
|
@ -106,7 +106,7 @@ class EventEdit extends React.PureComponent<PropsType> {
|
|||
endDate.adjust(-1, 0, 0, 0);
|
||||
}
|
||||
|
||||
if (this.props.copy) {
|
||||
if (this.props.duplicate) {
|
||||
this.state.title = event.title ? `Copy of ${event.title}` : '';
|
||||
} else {
|
||||
this.state.uid = event.uid;
|
||||
|
@ -126,7 +126,7 @@ class EventEdit extends React.PureComponent<PropsType> {
|
|||
}
|
||||
}
|
||||
}
|
||||
if (this.props.copy || this.props.item === undefined) {
|
||||
if (this.props.duplicate || this.props.item === undefined) {
|
||||
this.state.uid = uuid.v4();
|
||||
}
|
||||
|
||||
|
@ -228,7 +228,7 @@ class EventEdit extends React.PureComponent<PropsType> {
|
|||
return;
|
||||
}
|
||||
|
||||
const event = (this.props.item && !this.props.copy) ?
|
||||
const event = (this.props.item && !this.props.duplicate) ?
|
||||
this.props.item.clone()
|
||||
:
|
||||
new EventType()
|
||||
|
@ -287,7 +287,7 @@ class EventEdit extends React.PureComponent<PropsType> {
|
|||
return (
|
||||
<>
|
||||
<h2>
|
||||
{(this.props.item && !this.props.copy) ? 'Edit Event' : 'New Event'}
|
||||
{(this.props.item && !this.props.duplicate) ? 'Edit Event' : 'New Event'}
|
||||
</h2>
|
||||
{recurring && (
|
||||
<div>
|
||||
|
|
Loading…
Reference in New Issue