Skip to content

Commit

Permalink
[BUGFIX] Always use 'paste' wording pasting clipboard elements
Browse files Browse the repository at this point in the history
The clipboard has a 'move' and a 'copy' mode. This can be
changed in the list module where the clipboard is rendered.
Using 'cut' in context menu, the state is forced to 'move',
using 'copy' in context menu, the state is forced to 'copy'.

If there is an element in the clipboard, 'paste' icons in
list and page module appear. Their title tag is always
'paste' or 'paste after' or similar.

Only the modal in page module distinguishes between copy
and paste and changes its wording 'Do you really want
to move' vs. 'Do you really want to copy', while the
modal title is always 'paste'.

This is odd from an UX point of view: Users learned they
either 'cut + paste' or 'copy + paste': The decision to
cut or paste is the first step when selecting the element,
it's then either cut-out and moved to clipboard, or a copy
in the clipboard is added. The second step is then just
'paste here'.

The patch changes the modal wording to always use 'paste'
as second step, just like the icons already do.

Resolves: #83566
Releases: master, 10.4
Change-Id: Ia7b4296bbcee1d21b2be0d0ddb9e1019c93e9b4a
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/65190
Tested-by: TYPO3com <noreply@typo3.com>
Tested-by: Oliver Bartsch <bo@cedev.de>
Tested-by: Björn Jacob <bjoern.jacob@tritum.de>
Tested-by: Andreas Fernandez <a.fernandez@scripting-base.de>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Oliver Bartsch <bo@cedev.de>
Reviewed-by: Björn Jacob <bjoern.jacob@tritum.de>
Reviewed-by: Andreas Fernandez <a.fernandez@scripting-base.de>
  • Loading branch information
lolli42 authored and andreaskienast committed Aug 7, 2020
1 parent 1623511 commit 31e5f6c
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 49 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,53 +90,30 @@ class Paste {
const $element = $(element);
const url = $element.data('url') || null;
const title = (TYPO3.lang['paste.modal.title.paste'] || 'Paste record') + ': "' + $element.data('title') + '"';
const content = TYPO3.lang['paste.modal.paste'] || 'Do you want to paste the record to this position?';
const severity = (typeof top.TYPO3.Severity[$element.data('severity')] !== 'undefined') ?
top.TYPO3.Severity[$element.data('severity')] :
top.TYPO3.Severity.info;

let content: string = '';
let buttons: Array<Button> = [];
if ($element.hasClass('t3js-paste-copy')) {
content = TYPO3.lang['paste.modal.pastecopy'] || 'Do you want to copy the record to this position?';
buttons = [
{
text: TYPO3.lang['paste.modal.button.cancel'] || 'Cancel',
active: true,
btnClass: 'btn-default',
trigger: (): void => {
Modal.currentModal.trigger('modal-dismiss');
},
buttons = [
{
text: TYPO3.lang['paste.modal.button.cancel'] || 'Cancel',
active: true,
btnClass: 'btn-default',
trigger: (): void => {
Modal.currentModal.trigger('modal-dismiss');
},
{
text: TYPO3.lang['paste.modal.button.pastecopy'] || 'Copy',
btnClass: 'btn-' + Severity.getCssClass(severity),
trigger: (): void => {
Modal.currentModal.trigger('modal-dismiss');
me.execute($element);
},
},
];
} else {
content = TYPO3.lang['paste.modal.paste'] || 'Do you want to move the record to this position?';
buttons = [
{
text: TYPO3.lang['paste.modal.button.cancel'] || 'Cancel',
active: true,
btnClass: 'btn-default',
trigger: (): void => {
Modal.currentModal.trigger('modal-dismiss');
},
},
{
text: TYPO3.lang['paste.modal.button.paste'] || 'Move',
btnClass: 'btn-' + Severity.getCssClass(severity),
trigger: (): void => {
Modal.currentModal.trigger('modal-dismiss');
me.execute($element);
},
},
{
text: TYPO3.lang['paste.modal.button.paste'] || 'Paste',
btnClass: 'btn-' + Severity.getCssClass(severity),
trigger: (): void => {
Modal.currentModal.trigger('modal-dismiss');
me.execute($element);
},
];
}
},
];
if (url !== null) {
const separator = url.contains('?') ? '&' : '?';
const params = $.param({data: $element.data()});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,20 +57,14 @@
<trans-unit id="paste.modal.title.paste" resname="paste.modal.title.paste">
<source>Paste record</source>
</trans-unit>
<trans-unit id="paste.modal.pastecopy" resname="paste.modal.pastecopy">
<source>Do you want to copy the record to this position?</source>
</trans-unit>
<trans-unit id="paste.modal.paste" resname="paste.modal.paste">
<source>Do you want to move the record to this position?</source>
<source>Do you want to paste the record to this position?</source>
</trans-unit>
<trans-unit id="paste.modal.button.cancel" resname="paste.modal.button.cancel">
<source>Cancel</source>
</trans-unit>
<trans-unit id="paste.modal.button.pastecopy" resname="paste.modal.button.pastecopy">
<source>Copy</source>
</trans-unit>
<trans-unit id="paste.modal.button.paste" resname="paste.modal.button.paste">
<source>Move</source>
<source>Paste</source>
</trans-unit>
<trans-unit id="editColumn" resname="editColumn">
<source>Edit this column</source>
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 31e5f6c

Please sign in to comment.