From 384e12e1bad2f958656130e35b7589e3fe97e2bb Mon Sep 17 00:00:00 2001 From: ramzan <55637406+ramzan@users.noreply.github.com> Date: Mon, 20 Jul 2020 17:02:51 +0000 Subject: [PATCH] Change 'copy' to 'duplicate' and switch to more appropriate icon (#149) --- src/App.tsx | 4 ++-- src/Pim/index.tsx | 12 ++++++------ src/components/EventEdit.tsx | 10 +++++----- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index 280b130..11b5111 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -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(); } diff --git a/src/Pim/index.tsx b/src/Pim/index.tsx index 8ec43e9..e160c7f 100644 --- a/src/Pim/index.tsx +++ b/src/Pim/index.tsx @@ -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' && { 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 /> } @@ -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 })) } > - - Copy + + Duplicate } diff --git a/src/components/EventEdit.tsx b/src/components/EventEdit.tsx index cac085a..726eed7 100644 --- a/src/components/EventEdit.tsx +++ b/src/components/EventEdit.tsx @@ -50,7 +50,7 @@ interface PropsType { onCancel: () => void; location: Location; history: History; - copy: boolean; + duplicate: boolean; } class EventEdit extends React.PureComponent { @@ -106,7 +106,7 @@ class EventEdit extends React.PureComponent { 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 { } } } - 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 { 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 { return ( <>

- {(this.props.item && !this.props.copy) ? 'Edit Event' : 'New Event'} + {(this.props.item && !this.props.duplicate) ? 'Edit Event' : 'New Event'}

{recurring && (