Start work on bug report component

This commit is contained in:
Justin Baur 2022-03-20 13:10:53 -04:00
parent 81457f6c05
commit aaaf1f2fec
4 changed files with 25 additions and 2 deletions

View File

@ -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<void> {
throw new Error("Method not implemented.");
}
}

View File

@ -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>(BugReportComponent, this.bugReportRef);
break;
}
});
});

View File

@ -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"),
};
}

View File

@ -76,6 +76,7 @@ export class Menubar {
new WindowMenu(i18nService, messagingService, windowMain),
new HelpMenu(
i18nService,
messagingService,
webVaultUrl,
new AboutMenu(i18nService, appVersion, windowMain.win, updaterMain)
),