From 0d7acbb76849b7ebe3fbf42f28fcb8be7b87d7dc Mon Sep 17 00:00:00 2001 From: Federico Bernal <64086728+FedericoBernal@users.noreply.github.com> Date: Mon, 15 Nov 2021 15:51:55 -0300 Subject: [PATCH 1/3] Add message to show that json has been copied --- .../src/ui/editor/emulator/parts/inspector/inspector.tsx | 2 ++ .../editor/emulator/parts/inspector/inspectorContainer.ts | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/packages/app/client/src/ui/editor/emulator/parts/inspector/inspector.tsx b/packages/app/client/src/ui/editor/emulator/parts/inspector/inspector.tsx index 6eeb22326..36e81f08f 100644 --- a/packages/app/client/src/ui/editor/emulator/parts/inspector/inspector.tsx +++ b/packages/app/client/src/ui/editor/emulator/parts/inspector/inspector.tsx @@ -89,6 +89,7 @@ export interface InspectorProps { trackEvent?: (name: string, properties?: { [key: string]: any }) => void; setHighlightedObjects?: (documentId: string, objects: Activity[]) => void; setInspectorObjects?: (documentId: string, inspectorObjects: Activity[]) => void; + showMessage?: (title: string, message: string) => void; } interface InspectorState { @@ -398,6 +399,7 @@ export class Inspector extends React.Component { if (id == 'copyJson') { this.props.createAriaAlert('Activity JSON copied to clipboard.'); + this.props.showMessage('Copy to clipboard', 'JSON copied.'); return clipboard.writeText(JSON.stringify(this.state.inspectObj, null, 2)); } diff --git a/packages/app/client/src/ui/editor/emulator/parts/inspector/inspectorContainer.ts b/packages/app/client/src/ui/editor/emulator/parts/inspector/inspectorContainer.ts index 6165c3953..892dd271a 100644 --- a/packages/app/client/src/ui/editor/emulator/parts/inspector/inspectorContainer.ts +++ b/packages/app/client/src/ui/editor/emulator/parts/inspector/inspectorContainer.ts @@ -67,6 +67,13 @@ const mapDispatchToProps = dispatch => { dispatch(setHighlightedObjects(documentId, objects)), setInspectorObjects: (documentId: string, inspectorObjects: Activity[]) => dispatch(setInspectorObjects(documentId, inspectorObjects)), + showMessage: (title: string, message: string) => + dispatch( + executeCommand(true, SharedConstants.Commands.Electron.ShowMessageBox, null, true, { + message: message, + title: title, + }) + ), }; }; From 5cbb80aef92e199122e9b1d33062542472258b0a Mon Sep 17 00:00:00 2001 From: Federico Bernal <64086728+FedericoBernal@users.noreply.github.com> Date: Tue, 16 Nov 2021 10:06:07 -0300 Subject: [PATCH 2/3] Remove audio alert --- .../client/src/ui/editor/emulator/parts/inspector/inspector.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/app/client/src/ui/editor/emulator/parts/inspector/inspector.tsx b/packages/app/client/src/ui/editor/emulator/parts/inspector/inspector.tsx index 36e81f08f..9ff03a72f 100644 --- a/packages/app/client/src/ui/editor/emulator/parts/inspector/inspector.tsx +++ b/packages/app/client/src/ui/editor/emulator/parts/inspector/inspector.tsx @@ -398,7 +398,6 @@ export class Inspector extends React.Component { const id = event.currentTarget.name; if (id == 'copyJson') { - this.props.createAriaAlert('Activity JSON copied to clipboard.'); this.props.showMessage('Copy to clipboard', 'JSON copied.'); return clipboard.writeText(JSON.stringify(this.state.inspectObj, null, 2)); } From 5d863b8093919b48f8de8cf0861b8be49ecbedac Mon Sep 17 00:00:00 2001 From: Matias Lera <62261539+luislera@users.noreply.github.com> Date: Tue, 16 Nov 2021 13:01:44 -0300 Subject: [PATCH 3/3] Updated message box content --- .../client/src/ui/editor/emulator/parts/inspector/inspector.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/app/client/src/ui/editor/emulator/parts/inspector/inspector.tsx b/packages/app/client/src/ui/editor/emulator/parts/inspector/inspector.tsx index 9ff03a72f..6faf4ef13 100644 --- a/packages/app/client/src/ui/editor/emulator/parts/inspector/inspector.tsx +++ b/packages/app/client/src/ui/editor/emulator/parts/inspector/inspector.tsx @@ -398,7 +398,7 @@ export class Inspector extends React.Component { const id = event.currentTarget.name; if (id == 'copyJson') { - this.props.showMessage('Copy to clipboard', 'JSON copied.'); + this.props.showMessage('Copy', 'Activity JSON copied to clipboard.'); return clipboard.writeText(JSON.stringify(this.state.inspectObj, null, 2)); }