[PM-7737] Create about-page and more-from-bitwarden page [Nav changes] (#9233)

* Move help-and-feedback to tools and rename to about-page

Moved help-and-feedback.component to ..tools
Renamed it to about-page
Changed the title to about
Changed the settings button to about
Updated routes
Updates transition animation

* Move button to open AboutDialog from settings to about-page

* Move launch web-vault to about-page

* Move rate extension from settings to about-page

* Fix no-floating-promises

* Remove icons from about-page entries

* Make about-page standalone

* Create MoreFromBitwardenPage component

Create new component
Add button to navigate to new component from about-page
Add routing for new component

* Add new speedbumps to help-center and web-app links

* Add link to Bitwarden Authenticator page

Include speedbump explaing some functionality about the the authenticator

* Add link to Secrets Manager page

Include speedbump explaining some functionality of Secrets Manager

* Add link to Passwordless.dev page

Include speedbump explaining some functionality of Passwordless.dev

* Move learnFromOrg over to more-from-bitwarden

Include speedbump that explains Bitwarden for business

* Clean-up settings.component

Some left-over clean-up from https://github.com/bitwarden/clients/pull/8840
- Removing import and export methods

* Move premium-link to more-from-bitwarden

Hide link if user already has premium

* Add popout-button to about-page

* Remove unneeded headings

* Move popout-button on setting to the right

* Add Free Bitwarden Families link

Include speedbump explaining Free Bitwarden Families

---------

Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
This commit is contained in:
Daniel James Smith 2024-05-22 19:00:40 +02:00 committed by GitHub
parent 5a29fee7e6
commit d6f78f2225
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
11 changed files with 358 additions and 220 deletions

View File

@ -166,15 +166,21 @@
"confirmIdentity": {
"message": "Confirm your identity to continue."
},
"account": {
"message": "Account"
},
"changeMasterPassword": {
"message": "Change master password"
},
"continueToWebApp": {
"message": "Continue to web app?"
},
"continueToWebAppDesc": {
"message": "Explore more features of your Bitwarden account on the web app."
},
"continueToHelpCenter": {
"message": "Continue to Help Center?"
},
"continueToHelpCenterDesc": {
"message": "Learn more about how to use Bitwarden on the Help Center."
},
"changeMasterPasswordOnWebConfirmation": {
"message": "You can change your master password on the Bitwarden web app."
},
@ -192,9 +198,45 @@
"logOut": {
"message": "Log out"
},
"aboutBitwarden": {
"message": "About Bitwarden"
},
"about": {
"message": "About"
},
"moreFromBitwarden": {
"message": "More from Bitwarden"
},
"continueToBitwardenDotCom": {
"message": "Continue to bitwarden.com?"
},
"bitwardenForBusiness": {
"message": "Bitwarden for Business"
},
"bitwardenAuthenticator": {
"message": "Bitwarden Authenticator"
},
"continueToAuthenticatorPageDesc": {
"message": "Bitwarden Authenticator allows you to store authenticator keys and generate TOTP codes for 2-step verification flows. Learn more on the bitwarden.com website"
},
"bitwardenSecretsManager": {
"message": "Bitwarden Secrets Manager"
},
"continueToSecretsManagerPageDesc": {
"message": "Securely store, manage, and share developer secrets with Bitwarden Secrets Manager. Learn more on the bitwarden.com website."
},
"passwordlessDotDev": {
"message": "Passwordless.dev"
},
"continueToPasswordlessDotDevPageDesc": {
"message": "Create smooth and secure login experiences free from traditional passwords with Passwordless.dev. Learn more on the bitwarden.com website."
},
"freeBitwardenFamilies": {
"message": "Free Bitwarden Families"
},
"freeBitwardenFamiliesPageDesc": {
"message": "You are eligible for Free Bitwarden Families. Redeem this offer today in the web app."
},
"version": {
"message": "Version"
},
@ -253,8 +295,8 @@
"passGenInfo": {
"message": "Automatically generate strong, unique passwords for your logins."
},
"bitWebVault": {
"message": "Bitwarden web vault"
"bitWebVaultApp": {
"message": "Bitwarden web app"
},
"importItems": {
"message": "Import items"
@ -779,11 +821,8 @@
"shared": {
"message": "Shared"
},
"learnOrg": {
"message": "Learn about organizations"
},
"learnOrgConfirmation": {
"message": "Bitwarden allows you to share your vault items with others by using an organization. Would you like to visit the bitwarden.com website to learn more?"
"bitwardenForBusinessPageDesc": {
"message": "Bitwarden for Business allows you to share your vault items with others by using an organization. Learn more on the bitwarden.com website."
},
"moveToOrganization": {
"message": "Move to organization"

View File

@ -208,8 +208,8 @@ export const routerTransition = trigger("routerTransition", [
transition("tabs => lock", inSlideDown),
transition("tabs => help-and-feedback", inSlideLeft),
transition("help-and-feedback => tabs", outSlideRight),
transition("tabs => about", inSlideLeft),
transition("about => tabs", outSlideRight),
transition("tabs => send-type", inSlideLeft),
transition("send-type => tabs", outSlideRight),

View File

@ -36,6 +36,8 @@ import { PasswordGeneratorHistoryComponent } from "../tools/popup/generator/pass
import { SendAddEditComponent } from "../tools/popup/send/send-add-edit.component";
import { SendGroupingsComponent } from "../tools/popup/send/send-groupings.component";
import { SendTypeComponent } from "../tools/popup/send/send-type.component";
import { AboutPageComponent } from "../tools/popup/settings/about-page/about-page.component";
import { MoreFromBitwardenPageComponent } from "../tools/popup/settings/about-page/more-from-bitwarden-page.component";
import { ExportComponent } from "../tools/popup/settings/export.component";
import { ImportBrowserComponent } from "../tools/popup/settings/import/import-browser.component";
import { SettingsV2Component } from "../tools/popup/settings/settings-v2.component";
@ -60,7 +62,6 @@ import { VaultSettingsComponent } from "../vault/popup/settings/vault-settings.c
import { extensionRefreshRedirect, extensionRefreshSwap } from "./extension-refresh-route-utils";
import { debounceNavigationGuard } from "./services/debounce-navigation.service";
import { HelpAndFeedbackComponent } from "./settings/help-and-feedback.component";
import { OptionsComponent } from "./settings/options.component";
import { TabsV2Component } from "./tabs-v2.component";
import { TabsComponent } from "./tabs.component";
@ -349,10 +350,16 @@ const routes: Routes = [
data: { state: "update-temp-password" },
},
{
path: "help-and-feedback",
component: HelpAndFeedbackComponent,
path: "about",
component: AboutPageComponent,
canActivate: [AuthGuard],
data: { state: "help-and-feedback" },
data: { state: "about" },
},
{
path: "more-from-bitwarden",
component: MoreFromBitwardenPageComponent,
canActivate: [AuthGuard],
data: { state: "moreFromBitwarden" },
},
...extensionRefreshSwap(TabsComponent, TabsV2Component, {
path: "tabs",

View File

@ -84,7 +84,6 @@ import { AppRoutingModule } from "./app-routing.module";
import { AppComponent } from "./app.component";
import { UserVerificationComponent } from "./components/user-verification.component";
import { ServicesModule } from "./services/services.module";
import { HelpAndFeedbackComponent } from "./settings/help-and-feedback.component";
import { OptionsComponent } from "./settings/options.component";
import { TabsV2Component } from "./tabs-v2.component";
import { TabsComponent } from "./tabs.component";
@ -185,7 +184,6 @@ import "../platform/popup/locales";
RemovePasswordComponent,
VaultSelectComponent,
Fido2Component,
HelpAndFeedbackComponent,
AutofillComponent,
EnvironmentSelectorComponent,
AccountSwitcherComponent,

View File

@ -1,26 +0,0 @@
import { Component } from "@angular/core";
import { BrowserApi } from "../../platform/browser/browser-api";
@Component({
selector: "app-help-and-feedback",
templateUrl: "help-and-feedback.component.html",
})
export class HelpAndFeedbackComponent {
launchHelp() {
// FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling.
// eslint-disable-next-line @typescript-eslint/no-floating-promises
BrowserApi.createNewTab("https://bitwarden.com/help/");
}
launchContactForm() {
// FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling.
// eslint-disable-next-line @typescript-eslint/no-floating-promises
BrowserApi.createNewTab("https://bitwarden.com/contact/");
}
launchForums() {
// FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling.
// eslint-disable-next-line @typescript-eslint/no-floating-promises
BrowserApi.createNewTab("https://bitwarden.com/getinvolved/");
}
}

View File

@ -6,34 +6,47 @@
</button>
</div>
<h1 class="center">
<span class="title">{{ "helpFeedback" | i18n }}</span>
<span class="title">{{ "about" | i18n }}</span>
</h1>
<div class="right"></div>
<div class="right">
<app-pop-out></app-pop-out>
</div>
</header>
<main tabindex="-1">
<div class="box list">
<div class="box-content single-line">
<button
type="button"
class="box-content-row box-content-row-flex text-default"
appStopClick
(click)="about()"
>
<div class="row-main">{{ "aboutBitwarden" | i18n }}</div>
</button>
<button
type="button"
class="box-content-row box-content-row-flex text-default"
appStopClick
(click)="launchHelp()"
>
<div class="icon">
<i class="bwi bwi-shield bwi-lg row-sub-icon" aria-hidden="true"></i>
</div>
<div class="row-main">{{ "helpCenter" | i18n }}</div>
<i class="bwi bwi-external-link bwi-lg row-sub-icon" aria-hidden="true"></i>
</button>
<button
type="button"
class="box-content-row box-content-row-flex text-default"
appStopClick
(click)="openWebVault()"
>
<div class="row-main">{{ "bitWebVaultApp" | i18n }}</div>
<i class="bwi bwi-external-link bwi-lg row-sub-icon" aria-hidden="true"></i>
</button>
<button
type="button"
class="box-content-row box-content-row-flex text-default"
appStopClick
(click)="launchForums()"
>
<div class="icon">
<i class="bwi bwi-discourse bwi-lg row-sub-icon" aria-hidden="true"></i>
</div>
<div class="row-main">{{ "communityForums" | i18n }}</div>
<i class="bwi bwi-external-link bwi-lg row-sub-icon" aria-hidden="true"></i>
</button>
@ -43,12 +56,26 @@
appStopClick
(click)="launchContactForm()"
>
<div class="icon">
<i class="bwi bwi-shield bwi-lg row-sub-icon" aria-hidden="true"></i>
</div>
<div class="row-main">{{ "contactSupport" | i18n }}</div>
<i class="bwi bwi-external-link bwi-lg row-sub-icon" aria-hidden="true"></i>
</button>
<button
type="button"
class="box-content-row box-content-row-flex text-default"
routerLink="/more-from-bitwarden"
>
<div class="row-main">{{ "moreFromBitwarden" | i18n }}</div>
<i class="bwi bwi-angle-right bwi-lg row-sub-icon" aria-hidden="true"></i>
</button>
<button
type="button"
class="box-content-row box-content-row-flex text-default"
appStopClick
(click)="rate()"
>
<div class="row-main">{{ "rateExtension" | i18n }}</div>
<i class="bwi bwi-external-link bwi-lg row-sub-icon" aria-hidden="true"></i>
</button>
</div>
</div>
</main>

View File

@ -0,0 +1,84 @@
import { CommonModule } from "@angular/common";
import { Component } from "@angular/core";
import { RouterModule } from "@angular/router";
import { firstValueFrom } from "rxjs";
import { JslibModule } from "@bitwarden/angular/jslib.module";
import { DeviceType } from "@bitwarden/common/enums";
import { EnvironmentService } from "@bitwarden/common/platform/abstractions/environment.service";
import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service";
import { DialogService } from "@bitwarden/components";
import { BrowserApi } from "../../../../platform/browser/browser-api";
import { PopOutComponent } from "../../../../platform/popup/components/pop-out.component";
import { AboutDialogComponent } from "../about-dialog/about-dialog.component";
const RateUrls = {
[DeviceType.ChromeExtension]:
"https://chromewebstore.google.com/detail/bitwarden-free-password-m/nngceckbapebfimnlniiiahkandclblb/reviews",
[DeviceType.FirefoxExtension]:
"https://addons.mozilla.org/en-US/firefox/addon/bitwarden-password-manager/#reviews",
[DeviceType.OperaExtension]:
"https://addons.opera.com/en/extensions/details/bitwarden-free-password-manager/#feedback-container",
[DeviceType.EdgeExtension]:
"https://microsoftedge.microsoft.com/addons/detail/jbkfoedolllekgbhcbcoahefnbanhhlh",
[DeviceType.VivaldiExtension]:
"https://chromewebstore.google.com/detail/bitwarden-free-password-m/nngceckbapebfimnlniiiahkandclblb/reviews",
[DeviceType.SafariExtension]: "https://apps.apple.com/app/bitwarden/id1352778147",
};
@Component({
templateUrl: "about-page.component.html",
standalone: true,
imports: [CommonModule, JslibModule, RouterModule, PopOutComponent],
})
export class AboutPageComponent {
constructor(
private dialogService: DialogService,
private environmentService: EnvironmentService,
private platformUtilsService: PlatformUtilsService,
) {}
about() {
this.dialogService.open(AboutDialogComponent);
}
async launchHelp() {
const confirmed = await this.dialogService.openSimpleDialog({
title: { key: "continueToHelpCenter" },
content: { key: "continueToHelpCenterDesc" },
type: "info",
acceptButtonText: { key: "continue" },
});
if (confirmed) {
await BrowserApi.createNewTab("https://bitwarden.com/help/");
}
}
async openWebVault() {
const confirmed = await this.dialogService.openSimpleDialog({
title: { key: "continueToWebApp" },
content: { key: "continueToWebAppDesc" },
type: "info",
acceptButtonText: { key: "continue" },
});
if (confirmed) {
const env = await firstValueFrom(this.environmentService.environment$);
const url = env.getWebVaultUrl();
await BrowserApi.createNewTab(url);
}
}
async launchContactForm() {
await BrowserApi.createNewTab("https://bitwarden.com/contact/");
}
async launchForums() {
await BrowserApi.createNewTab("https://bitwarden.com/getinvolved/");
}
async rate() {
const deviceType = this.platformUtilsService.getDevice();
await BrowserApi.createNewTab((RateUrls as any)[deviceType]);
}
}

View File

@ -0,0 +1,75 @@
<header>
<div class="left">
<button type="button" routerLink="/about">
<span class="header-icon"><i class="bwi bwi-angle-left" aria-hidden="true"></i></span>
<span>{{ "back" | i18n }}</span>
</button>
</div>
<h1 class="center">
<span class="title">{{ "moreFromBitwarden" | i18n }}</span>
</h1>
<div class="right">
<app-pop-out></app-pop-out>
</div>
</header>
<main tabindex="-1">
<div class="box list">
<div class="box-content single-line">
<div *ngIf="!(canAccessPremium$ | async)">
<button
type="button"
class="box-content-row box-content-row-flex text-default"
routerLink="/premium"
>
<div class="row-main">{{ "premiumMembership" | i18n }}</div>
<i class="bwi bwi-angle-right bwi-lg row-sub-icon" aria-hidden="true"></i>
</button>
</div>
<button
type="button"
class="box-content-row box-content-row-flex text-default"
appStopClick
(click)="openFreeBitwardenFamiliesPage()"
>
<div class="row-main">{{ "freeBitwardenFamilies" | i18n }}</div>
<i class="bwi bwi-external-link bwi-lg row-sub-icon" aria-hidden="true"></i>
</button>
<button
type="button"
class="box-content-row box-content-row-flex text-default"
appStopClick
(click)="openBitwardenForBusinessPage()"
>
<div class="row-main">{{ "bitwardenForBusiness" | i18n }}</div>
<i class="bwi bwi-external-link bwi-lg row-sub-icon" aria-hidden="true"></i>
</button>
<button
type="button"
class="box-content-row box-content-row-flex text-default"
appStopClick
(click)="openAuthenticatorPage()"
>
<div class="row-main">{{ "bitwardenAuthenticator" | i18n }}</div>
<i class="bwi bwi-external-link bwi-lg row-sub-icon" aria-hidden="true"></i>
</button>
<button
type="button"
class="box-content-row box-content-row-flex text-default"
appStopClick
(click)="openSecretsManagerPage()"
>
<div class="row-main">{{ "bitwardenSecretsManager" | i18n }}</div>
<i class="bwi bwi-external-link bwi-lg row-sub-icon" aria-hidden="true"></i>
</button>
<button
type="button"
class="box-content-row box-content-row-flex text-default"
appStopClick
(click)="openPasswordlessDotDevPage()"
>
<div class="row-main">{{ "passwordlessDotDev" | i18n }}</div>
<i class="bwi bwi-external-link bwi-lg row-sub-icon" aria-hidden="true"></i>
</button>
</div>
</div>
</main>

View File

@ -0,0 +1,91 @@
import { CommonModule } from "@angular/common";
import { Component } from "@angular/core";
import { RouterModule } from "@angular/router";
import { Observable, firstValueFrom } from "rxjs";
import { JslibModule } from "@bitwarden/angular/jslib.module";
import { BillingAccountProfileStateService } from "@bitwarden/common/billing/abstractions/account/billing-account-profile-state.service";
import { EnvironmentService } from "@bitwarden/common/platform/abstractions/environment.service";
import { DialogService } from "@bitwarden/components";
import { BrowserApi } from "../../../../platform/browser/browser-api";
import { PopOutComponent } from "../../../../platform/popup/components/pop-out.component";
@Component({
templateUrl: "more-from-bitwarden-page.component.html",
standalone: true,
imports: [CommonModule, JslibModule, RouterModule, PopOutComponent],
})
export class MoreFromBitwardenPageComponent {
canAccessPremium$: Observable<boolean>;
constructor(
private dialogService: DialogService,
private billingAccountProfileStateService: BillingAccountProfileStateService,
private environmentService: EnvironmentService,
) {
this.canAccessPremium$ = billingAccountProfileStateService.hasPremiumFromAnySource$;
}
async openFreeBitwardenFamiliesPage() {
const confirmed = await this.dialogService.openSimpleDialog({
title: { key: "continueToWebApp" },
content: { key: "freeBitwardenFamiliesPageDesc" },
type: "info",
acceptButtonText: { key: "continue" },
});
if (confirmed) {
const env = await firstValueFrom(this.environmentService.environment$);
const url = env.getWebVaultUrl();
await BrowserApi.createNewTab(url + "/#/settings/sponsored-families");
}
}
async openBitwardenForBusinessPage() {
const confirmed = await this.dialogService.openSimpleDialog({
title: { key: "continueToBitwardenDotCom" },
content: { key: "bitwardenForBusinessPageDesc" },
type: "info",
acceptButtonText: { key: "continue" },
});
if (confirmed) {
await BrowserApi.createNewTab("https://bitwarden.com/products/business/");
}
}
async openAuthenticatorPage() {
const confirmed = await this.dialogService.openSimpleDialog({
title: { key: "continueToBitwardenDotCom" },
content: { key: "continueToAuthenticatorPageDesc" },
type: "info",
acceptButtonText: { key: "continue" },
});
if (confirmed) {
await BrowserApi.createNewTab("https://bitwarden.com/products/authenticator");
}
}
async openSecretsManagerPage() {
const confirmed = await this.dialogService.openSimpleDialog({
title: { key: "continueToBitwardenDotCom" },
content: { key: "continueToSecretsManagerPageDesc" },
type: "info",
acceptButtonText: { key: "continue" },
});
if (confirmed) {
await BrowserApi.createNewTab("https://bitwarden.com/products/secrets-manager");
}
}
async openPasswordlessDotDevPage() {
const confirmed = await this.dialogService.openSimpleDialog({
title: { key: "continueToBitwardenDotCom" },
content: { key: "continueToPasswordlessDotDevPageDesc" },
type: "info",
acceptButtonText: { key: "continue" },
});
if (confirmed) {
await BrowserApi.createNewTab("https://bitwarden.com/products/passwordless");
}
}
}

View File

@ -1,15 +1,14 @@
<app-header>
<div class="left">
<app-pop-out></app-pop-out>
</div>
<div class="left"></div>
<h1 class="center">
<span class="title">{{ "settings" | i18n }}</span>
</h1>
<div class="right"></div>
<div class="right">
<app-pop-out></app-pop-out>
</div>
</app-header>
<main tabindex="-1">
<div class="box list">
<h2 class="box-header">{{ "manage" | i18n }}</h2>
<div class="box-content single-line">
<button
type="button"
@ -43,41 +42,6 @@
<div class="row-main">{{ "vault" | i18n }}</div>
<i class="bwi bwi-angle-right bwi-lg row-sub-icon" aria-hidden="true"></i>
</button>
</div>
</div>
<div class="box list">
<h2 class="box-header">{{ "account" | i18n }}</h2>
<div class="box-content single-line">
<button type="button" class="box-content-row" routerLink="/premium">
<div class="row-main">
<div class="icon text-primary">
<i class="bwi bwi-fw bwi-lg bwi-star-f" aria-hidden="true"></i>
</div>
<span class="text text-primary"
><b>{{ "premiumMembership" | i18n }}</b></span
>
</div>
<span><i class="bwi bwi-angle-right bwi-lg row-sub-icon" aria-hidden="true"></i></span>
</button>
</div>
</div>
<div class="box list">
<h2 class="box-header">{{ "tools" | i18n }}</h2>
<div class="box-content single-line">
<button
type="button"
class="box-content-row box-content-row-flex text-default"
appStopClick
(click)="webVault()"
>
<div class="row-main">{{ "bitWebVault" | i18n }}</div>
<i class="bwi bwi-angle-right bwi-lg row-sub-icon" aria-hidden="true"></i>
</button>
</div>
</div>
<div class="box list">
<h2 class="box-header">{{ "other" | i18n }}</h2>
<div class="box-content single-line">
<button
type="button"
class="box-content-row box-content-row-flex text-default"
@ -97,40 +61,11 @@
<button
type="button"
class="box-content-row box-content-row-flex text-default"
appStopClick
(click)="about()"
routerLink="/about"
>
<div class="row-main">{{ "about" | i18n }}</div>
<i class="bwi bwi-angle-right bwi-lg row-sub-icon" aria-hidden="true"></i>
</button>
<button
type="button"
class="box-content-row box-content-row-flex text-default"
appStopClick
(click)="share()"
>
<div class="row-main">{{ "learnOrg" | i18n }}</div>
<i class="bwi bwi-angle-right bwi-lg row-sub-icon" aria-hidden="true"></i>
</button>
<button
type="button"
class="box-content-row box-content-row-flex text-default"
routerLink="/help-and-feedback"
>
<div class="row-main">{{ "helpFeedback" | i18n }}</div>
<i class="bwi bwi-angle-right bwi-lg row-sub-icon" aria-hidden="true"></i>
</button>
<button
type="button"
aria-describedby="rateExtensionHelp"
class="box-content-row box-content-row-flex text-default"
appStopClick
(click)="rate()"
>
<div class="row-main">{{ "rateExtension" | i18n }}</div>
<i class="bwi bwi-angle-right bwi-lg row-sub-icon" aria-hidden="true"></i>
</button>
</div>
<div id="rateExtensionHelp" class="box-footer">{{ "rateExtensionDesc" | i18n }}</div>
</div>
</main>

View File

@ -1,101 +1,9 @@
import { Component, OnInit } from "@angular/core";
import { Router } from "@angular/router";
import { firstValueFrom, Subject } from "rxjs";
import { VaultTimeoutService } from "@bitwarden/common/abstractions/vault-timeout/vault-timeout.service";
import { DeviceType } from "@bitwarden/common/enums";
import { EnvironmentService } from "@bitwarden/common/platform/abstractions/environment.service";
import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service";
import { MessagingService } from "@bitwarden/common/platform/abstractions/messaging.service";
import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service";
import { DialogService } from "@bitwarden/components";
import { BrowserApi } from "../../../platform/browser/browser-api";
import BrowserPopupUtils from "../../../platform/popup/browser-popup-utils";
import { AboutDialogComponent } from "./about-dialog/about-dialog.component";
const RateUrls = {
[DeviceType.ChromeExtension]:
"https://chromewebstore.google.com/detail/bitwarden-free-password-m/nngceckbapebfimnlniiiahkandclblb/reviews",
[DeviceType.FirefoxExtension]:
"https://addons.mozilla.org/en-US/firefox/addon/bitwarden-password-manager/#reviews",
[DeviceType.OperaExtension]:
"https://addons.opera.com/en/extensions/details/bitwarden-free-password-manager/#feedback-container",
[DeviceType.EdgeExtension]:
"https://microsoftedge.microsoft.com/addons/detail/jbkfoedolllekgbhcbcoahefnbanhhlh",
[DeviceType.VivaldiExtension]:
"https://chromewebstore.google.com/detail/bitwarden-free-password-m/nngceckbapebfimnlniiiahkandclblb/reviews",
[DeviceType.SafariExtension]: "https://apps.apple.com/app/bitwarden/id1352778147",
};
import { Component } from "@angular/core";
@Component({
selector: "tools-settings",
templateUrl: "settings.component.html",
})
// eslint-disable-next-line rxjs-angular/prefer-takeuntil
export class SettingsComponent implements OnInit {
private destroy$ = new Subject<void>();
constructor(
private platformUtilsService: PlatformUtilsService,
private i18nService: I18nService,
private vaultTimeoutService: VaultTimeoutService,
public messagingService: MessagingService,
private router: Router,
private environmentService: EnvironmentService,
private dialogService: DialogService,
) {}
async ngOnInit() {}
async share() {
const confirmed = await this.dialogService.openSimpleDialog({
title: { key: "learnOrg" },
content: { key: "learnOrgConfirmation" },
type: "info",
});
if (confirmed) {
// FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling.
// eslint-disable-next-line @typescript-eslint/no-floating-promises
BrowserApi.createNewTab("https://bitwarden.com/help/about-organizations/");
}
}
async webVault() {
const env = await firstValueFrom(this.environmentService.environment$);
const url = env.getWebVaultUrl();
await BrowserApi.createNewTab(url);
}
async import() {
await this.router.navigate(["/import"]);
if (await BrowserApi.isPopupOpen()) {
// FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling.
// eslint-disable-next-line @typescript-eslint/no-floating-promises
BrowserPopupUtils.openCurrentPagePopout(window);
}
}
export() {
// FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling.
// eslint-disable-next-line @typescript-eslint/no-floating-promises
this.router.navigate(["/export"]);
}
about() {
this.dialogService.open(AboutDialogComponent);
}
rate() {
const deviceType = this.platformUtilsService.getDevice();
// FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling.
// eslint-disable-next-line @typescript-eslint/no-floating-promises
BrowserApi.createNewTab((RateUrls as any)[deviceType]);
}
ngOnDestroy() {
this.destroy$.next();
this.destroy$.complete();
}
export class SettingsComponent {
constructor() {}
}