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
Contributor

@denscollo 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
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.

tonyanziano
tonyanziano previously approved these changes Sep 4, 2019
Copy link
Contributor

@tonyanziano tonyanziano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor nitpick:

Would prefer if the import statement was:

import { clipboard } from 'electron'

and this line was:

return clipboard.writeText(...)

Copy link
Contributor

@tonyanziano tonyanziano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants