Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ISSUE#1699] Introduce a context menu -> copy JSON in the JSON inspector #1801

Merged
merged 5 commits into from Sep 4, 2019

Conversation

@denscollo
Copy link
Collaborator

denscollo commented Aug 30, 2019

Solves #1699 #1694

Description

Allows the users to copy the activities in JSON format using the "Copy json" button placed in the inspector panel or using the context menu items for the activities in the chat session.

Changes made

  • Add "Copy json" button
  • Add test for context menu displayed for the activities in default mode
  • Enable context menu for activities in default mode
  • Add test when the "Copy json" button is clicked

Testing

The next image shows how the "Copy json" button works.
image

Also, this one shows the context menu enabled for the activities in default mode.
image

@coveralls

This comment has been minimized.

Copy link

coveralls commented Aug 30, 2019

Coverage Status

Coverage increased (+0.01%) to 65.574% when pulling 7192df8 on add/inspector-copy-json-button into 9e00b1a on master.

Copy link
Contributor

tonyanziano left a comment

One minor nitpick, but other than that, it looks good.

Nice work!

@@ -365,6 +366,11 @@ export class Inspector extends React.Component<InspectorProps, InspectorState> {

private accessoryClick = (event: MouseEvent<HTMLButtonElement>): void => {
const id = event.currentTarget.name;

if (id == 'copyJson') {
return Electron.clipboard.writeText(JSON.stringify(this.state.inspectObj, null, 2));

This comment has been minimized.

Copy link
@tonyanziano

tonyanziano Sep 4, 2019

Contributor

Minor nitpick:

Would prefer if the import statement was:

import { clipboard } from 'electron'

and this line was:

return clipboard.writeText(...)

Copy link
Contributor

tonyanziano left a comment

👍

@tonyanziano tonyanziano merged commit cc73e75 into master Sep 4, 2019
2 checks passed
2 checks passed
Emulator-CI-PR #77757 succeeded
Details
license/cla All CLA requirements met.
Details
@tonyanziano tonyanziano deleted the add/inspector-copy-json-button branch Sep 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.