Skip to content

Commit e240468

Browse files
committed
core:Frontend:ReportMenu: Add sentry feedback
1 parent b0a2c9f commit e240468

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed

core/frontend/src/components/app/ReportMenu.vue

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,20 @@
4040
With GitHub
4141
</v-btn>
4242

43+
<v-btn
44+
v-tooltip="'Directly send us a feedback'"
45+
class="ma-2"
46+
@click="openSimpleReport"
47+
>
48+
<v-icon
49+
left
50+
size="20"
51+
>
52+
mdi-message-text
53+
</v-icon>
54+
With Simple Report
55+
</v-btn>
56+
4357
<v-btn
4458
v-tooltip="'Discuss ideas with the community'"
4559
class="ma-2"
@@ -61,6 +75,7 @@
6175
</template>
6276

6377
<script lang="ts">
78+
import * as Sentry from '@sentry/vue'
6479
import Vue from 'vue'
6580
6681
export default Vue.extend({
@@ -80,6 +95,40 @@ export default Vue.extend({
8095
openDiscuss(): void {
8196
window.open(this.discussUrl(), '_blank')
8297
},
98+
async openSimpleReport(): Promise<void> {
99+
// @ts-expect-error - Theme is not defined in the type
100+
const { isDark, currentTheme } = this.$vuetify.theme
101+
102+
const light = '#FFF'
103+
const dark = '#1E1E1E'
104+
105+
const theme = {
106+
background: isDark ? dark : light,
107+
foreground: isDark ? light : dark,
108+
accentBackground: currentTheme.br_blue,
109+
accentForeground: isDark ? dark : light,
110+
successColor: currentTheme.success,
111+
errorColor: currentTheme.error,
112+
border: `1.5px solid ${isDark ? 'rgba(235, 230, 239, 0.15)' : 'rgba(30, 30, 30, 0.15)'}`,
113+
interactiveFilter: `brightness(${isDark ? '150' : '95'}%)`,
114+
}
115+
116+
const feedback = Sentry.feedbackIntegration({
117+
colorScheme: 'system',
118+
showBranding: false,
119+
formTitle: 'Send us a Simple Report',
120+
submitButtonLabel: 'Send Report',
121+
messagePlaceholder: 'What\'s the bug? What did you expect? What feedback do you have?',
122+
themeLight: theme,
123+
themeDark: theme,
124+
})
125+
126+
const form = await feedback.createForm()
127+
form.appendToDom()
128+
129+
this.show_dialog = false
130+
form.open()
131+
},
83132
discussUrl(): string {
84133
const url = new URL('https://discuss.bluerobotics.com')
85134
url.pathname = '/new-topic'

0 commit comments

Comments
 (0)