From 697d34b1eec149d373ac7a8ff1a8a95296a32b00 Mon Sep 17 00:00:00 2001 From: sbruens Date: Wed, 24 Apr 2024 12:08:43 -0400 Subject: [PATCH] Don't break the existing feedback flow. --- server_manager/web_app/app.ts | 16 +++++++++++++++- server_manager/web_app/ui_components/app-root.ts | 2 +- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/server_manager/web_app/app.ts b/server_manager/web_app/app.ts index 44b833c59c..6d3abb23de 100644 --- a/server_manager/web_app/app.ts +++ b/server_manager/web_app/app.ts @@ -237,7 +237,6 @@ export class App { manualServerEntryEl.clear(); }) .catch((e: Error) => { - console.log(e); // Remove the progress indicator. manualServerEntryEl.showConnection = false; // Display either error dialog or feedback depending on error type. @@ -267,6 +266,21 @@ export class App { this.setMetricsEnabled(false); }); + appRoot.addEventListener('SubmitFeedback', (event: CustomEvent) => { + const detail: FeedbackDetail = event.detail; + try { + Sentry.captureEvent({ + message: detail.userFeedback, + user: {email: detail.userEmail}, + tags: {category: detail.feedbackCategory, cloudProvider: detail.cloudProvider}, + }); + appRoot.showNotification(appRoot.localize('notification-feedback-thanks')); + } catch (e) { + console.error(`Failed to submit feedback: ${e}`); + appRoot.showError(appRoot.localize('error-feedback')); + } + }); + appRoot.addEventListener('SetLanguageRequested', (event: CustomEvent) => { this.setAppLanguage(event.detail.languageCode, event.detail.languageDir); }); diff --git a/server_manager/web_app/ui_components/app-root.ts b/server_manager/web_app/ui_components/app-root.ts index 42105ee443..b2c44c2d3f 100644 --- a/server_manager/web_app/ui_components/app-root.ts +++ b/server_manager/web_app/ui_components/app-root.ts @@ -706,7 +706,7 @@ export class AppRoot extends polymerElementWithLocalize { showManagerResourcesLink: {type: Boolean}, contactViewFeatureFlag: { type: Boolean, - value: true, + value: false, }, }; }