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
Conversation
There was a problem hiding this 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)); |
There was a problem hiding this comment.
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(...)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
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
Testing
The next image shows how the "Copy json" button works.
Also, this one shows the context menu enabled for the activities in default mode.