diff --git a/src/app/accounts/bug-report.component.ts b/src/app/accounts/bug-report.component.ts new file mode 100644 index 00000000..0597c69a --- /dev/null +++ b/src/app/accounts/bug-report.component.ts @@ -0,0 +1,9 @@ +import { Component } from "@angular/core"; + +import { BugReportComponent as BugReportComponentBase } from "jslib-angular/components/bug-report.component"; + +export class BugReportComponent extends BugReportComponentBase { + onSuccessfulSubmit(): Promise { + throw new Error("Method not implemented."); + } +} diff --git a/src/app/app.component.ts b/src/app/app.component.ts index dd69ae25..68ec4f01 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -39,6 +39,7 @@ import { CipherType } from "jslib-common/enums/cipherType"; import { MenuUpdateRequest } from "src/main/menu.updater"; +import { BugReportComponent } from "./accounts/bug-report.component"; import { PremiumComponent } from "./accounts/premium.component"; import { SettingsComponent } from "./accounts/settings.component"; import { ExportComponent } from "./vault/export.component"; @@ -86,6 +87,7 @@ export class AppComponent implements OnInit { folderAddEditModalRef: ViewContainerRef; @ViewChild("appPasswordGenerator", { read: ViewContainerRef, static: true }) passwordGeneratorModalRef: ViewContainerRef; + @ViewChild("bugReport", { read: ViewContainerRef, static: true }) bugReportRef: ViewContainerRef; loading = false; @@ -351,6 +353,9 @@ export class AppComponent implements OnInit { case "systemIdle": await this.checkForSystemTimeout(systemTimeoutOptions.onIdle); break; + case "openBugReport": + await this.openModal(BugReportComponent, this.bugReportRef); + break; } }); }); diff --git a/src/main/menu.help.ts b/src/main/menu.help.ts index d425da8f..7e74fa1f 100644 --- a/src/main/menu.help.ts +++ b/src/main/menu.help.ts @@ -1,6 +1,7 @@ import { shell, MenuItemConstructorOptions } from "electron"; import { I18nService } from "jslib-common/abstractions/i18n.service"; +import { MessagingService } from "jslib-common/abstractions/messaging.service"; import { isMacAppStore, isWindowsStore } from "jslib-electron/utils"; import { AboutMenu } from "./menu.about"; @@ -35,11 +36,18 @@ export class HelpMenu implements IMenubarMenu { } private readonly _i18nService: I18nService; + private readonly _messagingService; private readonly _webVaultUrl: string; private readonly _aboutMenu: AboutMenu; - constructor(i18nService: I18nService, webVaultUrl: string, aboutMenu: AboutMenu) { + constructor( + i18nService: I18nService, + messagingService: MessagingService, + webVaultUrl: string, + aboutMenu: AboutMenu + ) { this._i18nService = i18nService; + this._messagingService = messagingService; this._webVaultUrl = webVaultUrl; this._aboutMenu = aboutMenu; } @@ -64,7 +72,7 @@ export class HelpMenu implements IMenubarMenu { return { id: "fileBugReport", label: this.localize("fileBugReport"), - click: () => shell.openExternal("https://github.com/bitwarden/desktop/issues"), + click: () => this._messagingService.send("openBugReport"), }; } diff --git a/src/main/menubar.ts b/src/main/menubar.ts index c9aa0706..82cbf9bf 100644 --- a/src/main/menubar.ts +++ b/src/main/menubar.ts @@ -76,6 +76,7 @@ export class Menubar { new WindowMenu(i18nService, messagingService, windowMain), new HelpMenu( i18nService, + messagingService, webVaultUrl, new AboutMenu(i18nService, appVersion, windowMain.win, updaterMain) ),