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

feat(amazonq): Add description and github issue link to feedback form #5313

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"type" : "feature",
"description" : "feat(amazonq): Added github issue link and description to the chat answer feedback form"
}
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@
"open-user-guide" -> {
BrowserUtil.browse(node.get("userGuideLink").asText())
}
"open-form-link" -> {
dogusata marked this conversation as resolved.
Show resolved Hide resolved
BrowserUtil.browse(node.get("link").asText())

Check warning on line 61 in plugins/amazonq/chat/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/webview/BrowserConnector.kt

View check run for this annotation

Codecov / codecov/patch

plugins/amazonq/chat/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/webview/BrowserConnector.kt#L61

Added line #L61 was not covered by tests
}
"send-telemetry" -> {
val source = node.get("source")
val module = node.get("module")
Expand Down
8 changes: 4 additions & 4 deletions plugins/amazonq/mynah-ui/package-lock.json

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

2 changes: 1 addition & 1 deletion plugins/amazonq/mynah-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"lintfix": "eslint -c .eslintrc.js --fix --ext .ts ."
},
"dependencies": {
"@aws/mynah-ui-chat": "npm:@aws/mynah-ui@4.21.6",
"@aws/mynah-ui-chat": "npm:@aws/mynah-ui@4.22.0",
"@types/node": "^14.18.5",
"fs-extra": "^10.0.1",
"sanitize-html": "^2.12.1",
Expand Down
1 change: 1 addition & 0 deletions plugins/amazonq/mynah-ui/src/mynah-ui/ui/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ type MessageCommand =
| 'generate-test'
| 'start-test-gen'
| 'open-user-guide'
| 'open-form-link'
| 'send-telemetry'
| 'doc_stop_generate'
| 'updatePromptProgress'
Expand Down
7 changes: 7 additions & 0 deletions plugins/amazonq/mynah-ui/src/mynah-ui/ui/connector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,13 @@ export class Connector {
}
}

onFormLinkClick = (link: string): void => {
this.sendMessageToExtension({
command: 'open-form-link',
link,
})
}

onResponseBodyLinkClick = (tabID: string, messageId: string, link: string): void => {
switch (this.tabsStorage.getTab(tabID)?.type) {
case 'cwc':
Expand Down
6 changes: 6 additions & 0 deletions plugins/amazonq/mynah-ui/src/mynah-ui/ui/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -677,6 +677,12 @@ export const createMynahUI = (
mouseEvent?.stopImmediatePropagation()
connector.onResponseBodyLinkClick(tabId, messageId, link)
},
onFormLinkClick: (link, mouseEvent) => {
mouseEvent?.preventDefault()
mouseEvent?.stopPropagation()
mouseEvent?.stopImmediatePropagation()
connector.onFormLinkClick(link)
},
onInfoLinkClick: (tabId: string, link: string, mouseEvent?: MouseEvent) => {
mouseEvent?.preventDefault()
mouseEvent?.stopPropagation()
Expand Down
2 changes: 2 additions & 0 deletions plugins/amazonq/mynah-ui/src/mynah-ui/ui/texts/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ export const uiComponentsTexts = {
copy: 'Copy',
insertAtCursorLabel: 'Insert at cursor',
feedbackFormTitle: 'Report an issue',
feedbackFormDescription:
'_Feedback is anonymous. For issue updates, please contact us on [GitHub](https://github.com/aws/aws-toolkit-jetbrains/issues/new/choose)._',
feedbackFormOptionsLabel: 'What type of issue would you like to report?',
feedbackFormCommentLabel: 'Description of issue (optional):',
feedbackThanks: 'Thanks for your feedback!',
Expand Down
Loading