mirror of
https://github.com/bitwarden/browser.git
synced 2025-01-24 21:41:33 +01:00
Merge branch 'main' into autofill/pm-8027-inline-menu-appears-within-input-fields-that-do-not-relate-to-user-login
This commit is contained in:
commit
750fb67356
@ -1,6 +1,8 @@
|
||||
import { mock, mockReset, MockProxy } from "jest-mock-extended";
|
||||
import { BehaviorSubject, of } from "rxjs";
|
||||
|
||||
import { AuthService } from "@bitwarden/common/auth/abstractions/auth.service";
|
||||
import { AuthenticationStatus } from "@bitwarden/common/auth/enums/authentication-status";
|
||||
import { UserVerificationService } from "@bitwarden/common/auth/services/user-verification/user-verification.service";
|
||||
import { AutofillOverlayVisibility } from "@bitwarden/common/autofill/constants";
|
||||
import { AutofillSettingsService } from "@bitwarden/common/autofill/services/autofill-settings.service";
|
||||
@ -78,12 +80,17 @@ describe("AutofillService", () => {
|
||||
const userVerificationService = mock<UserVerificationService>();
|
||||
const billingAccountProfileStateService = mock<BillingAccountProfileStateService>();
|
||||
const platformUtilsService = mock<PlatformUtilsService>();
|
||||
let activeAccountStatusMock$: BehaviorSubject<AuthenticationStatus>;
|
||||
let authService: MockProxy<AuthService>;
|
||||
|
||||
beforeEach(() => {
|
||||
scriptInjectorService = new BrowserScriptInjectorService(platformUtilsService, logService);
|
||||
inlineMenuVisibilityMock$ = new BehaviorSubject(AutofillOverlayVisibility.OnFieldFocus);
|
||||
autofillSettingsService = mock<AutofillSettingsService>();
|
||||
(autofillSettingsService as any).inlineMenuVisibility$ = inlineMenuVisibilityMock$;
|
||||
activeAccountStatusMock$ = new BehaviorSubject(AuthenticationStatus.Unlocked);
|
||||
authService = mock<AuthService>();
|
||||
authService.activeAccountStatus$ = activeAccountStatusMock$;
|
||||
autofillService = new AutofillService(
|
||||
cipherService,
|
||||
autofillSettingsService,
|
||||
@ -95,6 +102,7 @@ describe("AutofillService", () => {
|
||||
billingAccountProfileStateService,
|
||||
scriptInjectorService,
|
||||
accountService,
|
||||
authService,
|
||||
);
|
||||
|
||||
domainSettingsService = new DefaultDomainSettingsService(fakeStateProvider);
|
||||
@ -287,6 +295,18 @@ describe("AutofillService", () => {
|
||||
});
|
||||
});
|
||||
|
||||
it("skips injecting the autofiller script when the user's account is not unlocked", async () => {
|
||||
activeAccountStatusMock$.next(AuthenticationStatus.Locked);
|
||||
|
||||
await autofillService.injectAutofillScripts(sender.tab, sender.frameId, true);
|
||||
|
||||
expect(BrowserApi.executeScriptInTab).not.toHaveBeenCalledWith(tabMock.id, {
|
||||
file: "content/autofiller.js",
|
||||
frameId: sender.frameId,
|
||||
...defaultExecuteScriptOptions,
|
||||
});
|
||||
});
|
||||
|
||||
it("will inject the bootstrap-autofill-overlay script if the user has the autofill overlay enabled", async () => {
|
||||
await autofillService.injectAutofillScripts(sender.tab, sender.frameId);
|
||||
|
||||
|
@ -3,7 +3,9 @@ import { pairwise } from "rxjs/operators";
|
||||
|
||||
import { EventCollectionService } from "@bitwarden/common/abstractions/event/event-collection.service";
|
||||
import { AccountService } from "@bitwarden/common/auth/abstractions/account.service";
|
||||
import { AuthService } from "@bitwarden/common/auth/abstractions/auth.service";
|
||||
import { UserVerificationService } from "@bitwarden/common/auth/abstractions/user-verification/user-verification.service.abstraction";
|
||||
import { AuthenticationStatus } from "@bitwarden/common/auth/enums/authentication-status";
|
||||
import { AutofillOverlayVisibility } from "@bitwarden/common/autofill/constants";
|
||||
import { AutofillSettingsServiceAbstraction } from "@bitwarden/common/autofill/services/autofill-settings.service";
|
||||
import { DomainSettingsService } from "@bitwarden/common/autofill/services/domain-settings.service";
|
||||
@ -61,6 +63,7 @@ export default class AutofillService implements AutofillServiceInterface {
|
||||
private billingAccountProfileStateService: BillingAccountProfileStateService,
|
||||
private scriptInjectorService: ScriptInjectorService,
|
||||
private accountService: AccountService,
|
||||
private authService: AuthService,
|
||||
) {}
|
||||
|
||||
/**
|
||||
@ -113,6 +116,8 @@ export default class AutofillService implements AutofillServiceInterface {
|
||||
// Autofill user settings loaded from state can await the active account state indefinitely
|
||||
// if not guarded by an active account check (e.g. the user is logged in)
|
||||
const activeAccount = await firstValueFrom(this.accountService.activeAccount$);
|
||||
const authStatus = await firstValueFrom(this.authService.activeAccountStatus$);
|
||||
const accountIsUnlocked = authStatus === AuthenticationStatus.Unlocked;
|
||||
let overlayVisibility: InlineMenuVisibilitySetting = AutofillOverlayVisibility.Off;
|
||||
let autoFillOnPageLoadIsEnabled = false;
|
||||
|
||||
@ -126,7 +131,7 @@ export default class AutofillService implements AutofillServiceInterface {
|
||||
|
||||
const injectedScripts = [mainAutofillScript];
|
||||
|
||||
if (activeAccount) {
|
||||
if (activeAccount && accountIsUnlocked) {
|
||||
autoFillOnPageLoadIsEnabled = await this.getAutofillOnPageLoad();
|
||||
}
|
||||
|
||||
|
@ -872,6 +872,7 @@ export default class MainBackground {
|
||||
this.billingAccountProfileStateService,
|
||||
this.scriptInjectorService,
|
||||
this.accountService,
|
||||
this.authService,
|
||||
);
|
||||
this.auditService = new AuditService(this.cryptoFunctionService, this.apiService);
|
||||
|
||||
@ -1332,7 +1333,7 @@ export default class MainBackground {
|
||||
]);
|
||||
|
||||
//Needs to be checked before state is cleaned
|
||||
const needStorageReseed = await this.needsStorageReseed(userId);
|
||||
const needStorageReseed = await this.needsStorageReseed(userBeingLoggedOut);
|
||||
|
||||
await this.stateService.clean({ userId: userBeingLoggedOut });
|
||||
await this.accountService.clean(userBeingLoggedOut);
|
||||
|
@ -341,6 +341,7 @@ const safeProviders: SafeProvider[] = [
|
||||
BillingAccountProfileStateService,
|
||||
ScriptInjectorService,
|
||||
AccountServiceAbstraction,
|
||||
AuthService,
|
||||
],
|
||||
}),
|
||||
safeProvider({
|
||||
|
@ -1,34 +1,51 @@
|
||||
<h1 class="tw-text-3xl !tw-text-alt2">The Password Manager Trusted by Millions</h1>
|
||||
<div class="tw-pt-32">
|
||||
<h2 class="tw-text-2xl">Everything enterprises need out of a password manager:</h2>
|
||||
<h1 class="tw-text-3xl !tw-text-alt2">Start your 7-day free trial of Bitwarden</h1>
|
||||
<div class="tw-pt-20">
|
||||
<h2 class="tw-text-2xl">
|
||||
Strengthen business security with the password manager designed for seamless administration and
|
||||
employee usability.
|
||||
</h2>
|
||||
</div>
|
||||
<ul class="tw-mt-12 tw-flex tw-flex-col tw-gap-10 tw-text-2xl tw-text-main tw-list-none tw-pl-0">
|
||||
<li><i class="bwi bwi-lg bwi-check-circle tw-mr-4"></i>Secure password sharing</li>
|
||||
<li>
|
||||
<i class="bwi bwi-lg bwi-check-circle tw-mr-4"></i>Easy, flexible SSO and SCIM integrations
|
||||
<li class="tw-flex tw-items-center">
|
||||
<i class="bwi bwi-lg bwi-check-circle tw-mr-4 tw-flex-none"></i
|
||||
><span class="tw-flex-auto"
|
||||
>Instantly and securely share credentials with the groups and individuals who need them</span
|
||||
>
|
||||
</li>
|
||||
<li class="tw-flex tw-items-center">
|
||||
<i class="bwi bwi-lg bwi-check-circle tw-mr-4 tw-flex-none"></i
|
||||
><span class="tw-flex-auto"
|
||||
>Strengthen employee security practices through centralized administrative control and
|
||||
policies</span
|
||||
>
|
||||
</li>
|
||||
<li class="tw-flex tw-items-center">
|
||||
<i class="bwi bwi-lg bwi-check-circle tw-mr-4 tw-flex-none"></i
|
||||
><span class="tw-flex-auto"
|
||||
>Streamline user onboarding and automate account provisioning with turnkey SSO and SCIM
|
||||
integrations</span
|
||||
>
|
||||
</li>
|
||||
<li class="tw-flex tw-items-center">
|
||||
<i class="bwi bwi-lg bwi-check-circle tw-mr-4 tw-flex-none"></i
|
||||
><span class="tw-flex-auto"
|
||||
>Migrate to Bitwarden in minutes with comprehensive import options</span
|
||||
>
|
||||
</li>
|
||||
<li class="tw-flex tw-items-center">
|
||||
<i class="bwi bwi-lg bwi-check-circle tw-mr-4 tw-flex-none"></i
|
||||
><span class="tw-flex-auto"
|
||||
>Save time and increase productivity with autofill and instant device syncing</span
|
||||
>
|
||||
</li>
|
||||
<li class="tw-flex tw-items-center">
|
||||
<i class="bwi bwi-lg bwi-check-circle tw-mr-4 tw-flex-none"></i
|
||||
><span class="tw-flex-auto"
|
||||
>Empower employees to secure their digital life at home, at work, and on the go by offering a
|
||||
free Families plan to all Enterprise users</span
|
||||
>
|
||||
</li>
|
||||
<li><i class="bwi bwi-lg bwi-check-circle tw-mr-4"></i>Free families plan for users</li>
|
||||
<li><i class="bwi bwi-lg bwi-check-circle tw-mr-4"></i>Quick import and migration tools</li>
|
||||
<li><i class="bwi bwi-lg bwi-check-circle tw-mr-4"></i>Simple, streamlined user experience</li>
|
||||
<li><i class="bwi bwi-lg bwi-check-circle tw-mr-4"></i>Priority support and trainers</li>
|
||||
</ul>
|
||||
<div class="tw-mt-28 tw-flex tw-flex-col tw-items-center tw-gap-5">
|
||||
<app-logo-cnet-5-stars></app-logo-cnet-5-stars>
|
||||
<div class="tw-flex tw-items-end tw-gap-8">
|
||||
<review-logo
|
||||
logoClass="tw-w-8"
|
||||
logoSrc="../../images/register-layout/g2-logo.svg"
|
||||
logoAlt="G2 Logo"
|
||||
></review-logo>
|
||||
<review-logo
|
||||
logoClass="tw-w-28"
|
||||
logoSrc="../../images/register-layout/capterra-logo.svg"
|
||||
logoAlt="Capterra Logo"
|
||||
></review-logo>
|
||||
<review-logo
|
||||
logoClass="tw-w-28"
|
||||
logoSrc="../../images/register-layout/get-app-logo.svg"
|
||||
logoAlt="Get App Logo"
|
||||
></review-logo>
|
||||
</div>
|
||||
<app-logo-badges></app-logo-badges>
|
||||
</div>
|
||||
|
@ -0,0 +1,11 @@
|
||||
<figure>
|
||||
<figcaption>
|
||||
<cite>
|
||||
<img
|
||||
src="../../images/register-layout/vault-signup-badges.png"
|
||||
class="tw-mx-auto tw-block tw-w-full"
|
||||
alt="third party awards"
|
||||
/>
|
||||
</cite>
|
||||
</figcaption>
|
||||
</figure>
|
@ -0,0 +1,7 @@
|
||||
import { Component } from "@angular/core";
|
||||
|
||||
@Component({
|
||||
selector: "app-logo-badges",
|
||||
templateUrl: "logo-badges.component.html",
|
||||
})
|
||||
export class LogoBadgesComponent {}
|
@ -1,21 +1,36 @@
|
||||
<h1 class="tw-text-4xl !tw-text-alt2">Start Your Teams Free Trial Now</h1>
|
||||
<div class="tw-flex tw-flex-col tw-items-center tw-justify-center tw-pt-16">
|
||||
<div class="tw-text-2xl">$4 per month / per user</div>
|
||||
<div class="tw-text-xl">Annual subscription</div>
|
||||
</div>
|
||||
<h1 class="tw-text-4xl !tw-text-alt2">Start your 7-day free trial for Teams</h1>
|
||||
<div class="tw-flex tw-flex-col tw-items-center tw-justify-center tw-pt-16"></div>
|
||||
<div class="tw-pt-10">
|
||||
<h2 class="tw-text-2xl">
|
||||
Millions of individuals, teams, and organizations worldwide trust Bitwarden for secure password
|
||||
storage and sharing.
|
||||
Strengthen business security with an easy-to-use password manager your team will love.
|
||||
</h2>
|
||||
</div>
|
||||
<ul class="tw-mt-12 tw-flex tw-flex-col tw-gap-10 tw-text-2xl tw-text-main">
|
||||
<li>Collaborate and share securely</li>
|
||||
<li>Deploy and manage quickly and easily</li>
|
||||
<li>Access anywhere on any device</li>
|
||||
<li>Create your account to get started</li>
|
||||
<ul class="tw-mt-12 tw-flex tw-flex-col tw-gap-10 tw-text-2xl tw-text-main tw-list-none tw-pl-0">
|
||||
<li class="tw-flex tw-items-center">
|
||||
<i class="bwi bwi-lg bwi-check-circle tw-mr-4 tw-flex-none"></i
|
||||
><span class="tw-flex-auto"
|
||||
>Instantly and securely share credentials with the groups and individuals who need them</span
|
||||
>
|
||||
</li>
|
||||
<li class="tw-flex tw-items-center">
|
||||
<i class="bwi bwi-lg bwi-check-circle tw-mr-4 tw-flex-none"></i
|
||||
><span class="tw-flex-auto"
|
||||
>Migrate to Bitwarden in minutes with comprehensive import options</span
|
||||
>
|
||||
</li>
|
||||
<li class="tw-flex tw-items-center">
|
||||
<i class="bwi bwi-lg bwi-check-circle tw-mr-4 tw-flex-none"></i
|
||||
><span class="tw-flex-auto"
|
||||
>Save time and increase productivity with autofill and instant device syncing</span
|
||||
>
|
||||
</li>
|
||||
<li class="tw-flex tw-items-center">
|
||||
<i class="bwi bwi-lg bwi-check-circle tw-mr-4 tw-flex-none"></i
|
||||
><span class="tw-flex-auto"
|
||||
>Enhance security practices across your team with easy user management</span
|
||||
>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="tw-mt-28 tw-flex tw-flex-col tw-items-center tw-gap-5">
|
||||
<app-logo-forbes></app-logo-forbes>
|
||||
<app-logo-us-news></app-logo-us-news>
|
||||
<app-logo-badges></app-logo-badges>
|
||||
</div>
|
||||
|
@ -24,6 +24,7 @@ import { DefaultContentComponent } from "./content/default-content.component";
|
||||
import { EnterpriseContentComponent } from "./content/enterprise-content.component";
|
||||
import { Enterprise1ContentComponent } from "./content/enterprise1-content.component";
|
||||
import { Enterprise2ContentComponent } from "./content/enterprise2-content.component";
|
||||
import { LogoBadgesComponent } from "./content/logo-badges.component";
|
||||
import { LogoCnet5StarsComponent } from "./content/logo-cnet-5-stars.component";
|
||||
import { LogoCnetComponent } from "./content/logo-cnet.component";
|
||||
import { LogoForbesComponent } from "./content/logo-forbes.component";
|
||||
@ -69,6 +70,7 @@ import { VerticalStepperModule } from "./vertical-stepper/vertical-stepper.modul
|
||||
CnetTeamsContentComponent,
|
||||
AbmEnterpriseContentComponent,
|
||||
AbmTeamsContentComponent,
|
||||
LogoBadgesComponent,
|
||||
LogoCnet5StarsComponent,
|
||||
LogoCnetComponent,
|
||||
LogoForbesComponent,
|
||||
|
@ -1,10 +1,10 @@
|
||||
<ng-container *ngIf="!firstLoaded && loading">
|
||||
<i
|
||||
class="bwi bwi-spinner bwi-spin text-muted"
|
||||
class="bwi bwi-spinner bwi-spin tw-text-muted"
|
||||
title="{{ 'loading' | i18n }}"
|
||||
aria-hidden="true"
|
||||
></i>
|
||||
<span class="sr-only">{{ "loading" | i18n }}</span>
|
||||
<span class="tw-sr-only">{{ "loading" | i18n }}</span>
|
||||
</ng-container>
|
||||
<ng-container *ngIf="sub">
|
||||
<bit-callout
|
||||
@ -19,19 +19,17 @@
|
||||
title="{{ 'pendingCancellation' | i18n }}"
|
||||
*ngIf="subscriptionMarkedForCancel"
|
||||
>
|
||||
<p>{{ "subscriptionPendingCanceled" | i18n }}</p>
|
||||
<p bitTypography="body1">{{ "subscriptionPendingCanceled" | i18n }}</p>
|
||||
<button
|
||||
bitButton
|
||||
type="button"
|
||||
buttonType="secondary"
|
||||
#reinstateBtn
|
||||
class="btn-submit"
|
||||
(click)="reinstate()"
|
||||
[appApiAction]="reinstatePromise"
|
||||
[disabled]="$any(reinstateBtn).loading"
|
||||
>
|
||||
<i class="bwi bwi-spinner bwi-spin" title="{{ 'loading' | i18n }}" aria-hidden="true"></i>
|
||||
<span>{{ "reinstateSubscription" | i18n }}</span>
|
||||
{{ "reinstateSubscription" | i18n }}
|
||||
</button>
|
||||
</bit-callout>
|
||||
<dl *ngIf="selfHosted">
|
||||
@ -39,12 +37,12 @@
|
||||
<dd *ngIf="sub.expiration">{{ sub.expiration | date: "mediumDate" }}</dd>
|
||||
<dd *ngIf="!sub.expiration">{{ "neverExpires" | i18n }}</dd>
|
||||
</dl>
|
||||
<div class="row" *ngIf="!selfHosted">
|
||||
<div class="col-4">
|
||||
<div class="tw-flex tw-w-full" *ngIf="!selfHosted">
|
||||
<div class="tw-w-1/3">
|
||||
<dl>
|
||||
<dt>{{ "status" | i18n }}</dt>
|
||||
<dd>
|
||||
<span class="text-capitalize">{{ (subscription && subscription.status) || "-" }}</span>
|
||||
<span class="tw-capitalize">{{ (subscription && subscription.status) || "-" }}</span>
|
||||
<span bitBadge variant="warning" *ngIf="subscriptionMarkedForCancel">{{
|
||||
"pendingCancellation" | i18n
|
||||
}}</span>
|
||||
@ -61,19 +59,19 @@
|
||||
</dd>
|
||||
</dl>
|
||||
</div>
|
||||
<div class="col-8" *ngIf="subscription">
|
||||
<strong class="d-block mb-1">{{ "details" | i18n }}</strong>
|
||||
<table class="table">
|
||||
<tbody>
|
||||
<div class="tw-w-2/3" *ngIf="subscription">
|
||||
<strong class="!tw-block tw-mb-1">{{ "details" | i18n }}</strong>
|
||||
<bit-table>
|
||||
<ng-template body>
|
||||
<tr *ngFor="let i of subscription.items">
|
||||
<td>
|
||||
<td bitCell>
|
||||
{{ i.name }} {{ i.quantity > 1 ? "×" + i.quantity : "" }} @
|
||||
{{ i.amount | currency: "$" }}
|
||||
</td>
|
||||
<td>{{ i.quantity * i.amount | currency: "$" }} /{{ i.interval | i18n }}</td>
|
||||
<td bitCell>{{ i.quantity * i.amount | currency: "$" }} /{{ i.interval | i18n }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</ng-template>
|
||||
</bit-table>
|
||||
</div>
|
||||
</div>
|
||||
<ng-container *ngIf="selfHosted">
|
||||
@ -91,27 +89,9 @@
|
||||
{{ "launchCloudSubscription" | i18n }}
|
||||
</a>
|
||||
</div>
|
||||
<div class="card mt-3" *ngIf="showUpdateLicense">
|
||||
<div class="card-body">
|
||||
<button
|
||||
type="button"
|
||||
class="close"
|
||||
appA11yTitle="{{ 'cancel' | i18n }}"
|
||||
(click)="closeUpdateLicense(false)"
|
||||
>
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<h3 class="card-body-header">{{ "updateLicense" | i18n }}</h3>
|
||||
<app-update-license
|
||||
(onUpdated)="closeUpdateLicense(true)"
|
||||
(onCanceled)="closeUpdateLicense(false)"
|
||||
>
|
||||
</app-update-license>
|
||||
</div>
|
||||
</div>
|
||||
</ng-container>
|
||||
<ng-container *ngIf="!selfHosted">
|
||||
<div class="d-flex">
|
||||
<div class="tw-flex tw-justify-between">
|
||||
<button
|
||||
bitButton
|
||||
type="button"
|
||||
@ -126,43 +106,27 @@
|
||||
#cancelBtn
|
||||
type="button"
|
||||
buttonType="danger"
|
||||
class="btn-submit tw-ml-auto"
|
||||
class="tw-ml-auto"
|
||||
(click)="cancelSubscription()"
|
||||
[appApiAction]="cancelPromise"
|
||||
[disabled]="$any(cancelBtn).loading"
|
||||
*ngIf="subscription && !subscription.cancelled && !subscriptionMarkedForCancel"
|
||||
>
|
||||
<i class="bwi bwi-spinner bwi-spin" title="{{ 'loading' | i18n }}" aria-hidden="true"></i>
|
||||
<span>{{ "cancelSubscription" | i18n }}</span>
|
||||
{{ "cancelSubscription" | i18n }}
|
||||
</button>
|
||||
</div>
|
||||
<h2 class="spaced-header">{{ "storage" | i18n }}</h2>
|
||||
<p>{{ "subscriptionStorage" | i18n: sub.maxStorageGb || 0 : sub.storageName || "0 MB" }}</p>
|
||||
<div class="progress">
|
||||
<div
|
||||
class="progress-bar bg-success"
|
||||
role="progressbar"
|
||||
[ngStyle]="{ width: storageProgressWidth + '%' }"
|
||||
[attr.aria-valuenow]="storagePercentage"
|
||||
aria-valuemin="0"
|
||||
aria-valuemax="100"
|
||||
>
|
||||
{{ storagePercentage / 100 | percent }}
|
||||
</div>
|
||||
</div>
|
||||
<h3 bitTypography="h3" class="tw-mt-16">{{ "storage" | i18n }}</h3>
|
||||
<p bitTypography="body1">
|
||||
{{ "subscriptionStorage" | i18n: sub.maxStorageGb || 0 : sub.storageName || "0 MB" }}
|
||||
</p>
|
||||
<bit-progress [barWidth]="storagePercentage" bgColor="success" size="default"></bit-progress>
|
||||
<ng-container *ngIf="subscription && !subscription.cancelled && !subscriptionMarkedForCancel">
|
||||
<div class="mt-3">
|
||||
<div class="d-flex">
|
||||
<button bitButton type="button" buttonType="secondary" [bitAction]="adjustStorage(true)">
|
||||
<div class="tw-mt-3">
|
||||
<div class="tw-flex tw-gap-1">
|
||||
<button bitButton type="button" buttonType="secondary" (click)="adjustStorage(true)">
|
||||
{{ "addStorage" | i18n }}
|
||||
</button>
|
||||
<button
|
||||
bitButton
|
||||
type="button"
|
||||
buttonType="secondary"
|
||||
class="tw-ml-1"
|
||||
[bitAction]="adjustStorage(false)"
|
||||
>
|
||||
<button bitButton type="button" buttonType="secondary" (click)="adjustStorage(false)">
|
||||
{{ "removeStorage" | i18n }}
|
||||
</button>
|
||||
</div>
|
||||
|
@ -20,6 +20,10 @@ import {
|
||||
OffboardingSurveyDialogResultType,
|
||||
openOffboardingSurvey,
|
||||
} from "../shared/offboarding-survey.component";
|
||||
import {
|
||||
UpdateLicenseDialogComponent,
|
||||
UpdateLicenseDialogResult,
|
||||
} from "../shared/update-license-dialog.component";
|
||||
|
||||
@Component({
|
||||
templateUrl: "user-subscription.component.html",
|
||||
@ -131,21 +135,16 @@ export class UserSubscriptionComponent implements OnInit {
|
||||
});
|
||||
}
|
||||
|
||||
updateLicense() {
|
||||
updateLicense = async () => {
|
||||
if (this.loading) {
|
||||
return;
|
||||
}
|
||||
this.showUpdateLicense = true;
|
||||
}
|
||||
|
||||
closeUpdateLicense(load: boolean) {
|
||||
this.showUpdateLicense = false;
|
||||
if (load) {
|
||||
// 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.load();
|
||||
const dialogRef = UpdateLicenseDialogComponent.open(this.dialogService);
|
||||
const result = await lastValueFrom(dialogRef.closed);
|
||||
if (result === UpdateLicenseDialogResult.Updated) {
|
||||
await this.load();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
adjustStorage = (add: boolean) => {
|
||||
return async () => {
|
||||
|
@ -12,6 +12,7 @@ import { PaymentMethodComponent } from "./payment-method.component";
|
||||
import { PaymentComponent } from "./payment.component";
|
||||
import { SecretsManagerSubscribeComponent } from "./sm-subscribe.component";
|
||||
import { TaxInfoComponent } from "./tax-info.component";
|
||||
import { UpdateLicenseDialogComponent } from "./update-license-dialog.component";
|
||||
import { UpdateLicenseComponent } from "./update-license.component";
|
||||
|
||||
@NgModule({
|
||||
@ -24,6 +25,7 @@ import { UpdateLicenseComponent } from "./update-license.component";
|
||||
PaymentMethodComponent,
|
||||
SecretsManagerSubscribeComponent,
|
||||
UpdateLicenseComponent,
|
||||
UpdateLicenseDialogComponent,
|
||||
OffboardingSurveyComponent,
|
||||
],
|
||||
exports: [
|
||||
@ -34,6 +36,7 @@ import { UpdateLicenseComponent } from "./update-license.component";
|
||||
BillingHistoryComponent,
|
||||
SecretsManagerSubscribeComponent,
|
||||
UpdateLicenseComponent,
|
||||
UpdateLicenseDialogComponent,
|
||||
OffboardingSurveyComponent,
|
||||
],
|
||||
})
|
||||
|
@ -0,0 +1,40 @@
|
||||
<form [formGroup]="updateLicenseForm" [bitSubmit]="submitLicenseDialog">
|
||||
<bit-dialog dialogSize="default" [title]="'updateLicense' | i18n">
|
||||
<ng-container bitDialogContent>
|
||||
<bit-form-field>
|
||||
<bit-label>{{ "licenseFile" | i18n }}</bit-label>
|
||||
<div>
|
||||
<button bitButton type="button" buttonType="secondary" (click)="fileSelector.click()">
|
||||
{{ "chooseFile" | i18n }}
|
||||
</button>
|
||||
{{ licenseFile ? licenseFile.name : ("noFileChosen" | i18n) }}
|
||||
</div>
|
||||
<input
|
||||
bitInput
|
||||
#fileSelector
|
||||
type="file"
|
||||
formControlName="file"
|
||||
(change)="setSelectedFile($event)"
|
||||
hidden
|
||||
/>
|
||||
<bit-hint>{{ "licenseFileDesc" | i18n: "bitwarden_premium_license.json" }}</bit-hint>
|
||||
</bit-form-field>
|
||||
</ng-container>
|
||||
<ng-container bitDialogFooter>
|
||||
<button type="submit" buttonType="primary" bitButton bitFormButton>
|
||||
{{ "submit" | i18n }}
|
||||
</button>
|
||||
<button
|
||||
bitButton
|
||||
*ngIf="showCancel"
|
||||
bitFormButton
|
||||
buttonType="secondary"
|
||||
type="button"
|
||||
bitDialogClose
|
||||
[bitAction]="cancel"
|
||||
>
|
||||
{{ "cancel" | i18n }}
|
||||
</button>
|
||||
</ng-container>
|
||||
</bit-dialog>
|
||||
</form>
|
@ -0,0 +1,38 @@
|
||||
import { Component } from "@angular/core";
|
||||
import { FormBuilder } from "@angular/forms";
|
||||
|
||||
import { ApiService } from "@bitwarden/common/abstractions/api.service";
|
||||
import { OrganizationApiServiceAbstraction } from "@bitwarden/common/admin-console/abstractions/organization/organization-api.service.abstraction";
|
||||
import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service";
|
||||
import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service";
|
||||
import { DialogService } from "@bitwarden/components";
|
||||
|
||||
import { UpdateLicenseComponent } from "./update-license.component";
|
||||
|
||||
export enum UpdateLicenseDialogResult {
|
||||
Updated = "updated",
|
||||
Cancelled = "cancelled",
|
||||
}
|
||||
@Component({
|
||||
templateUrl: "update-license-dialog.component.html",
|
||||
})
|
||||
export class UpdateLicenseDialogComponent extends UpdateLicenseComponent {
|
||||
constructor(
|
||||
apiService: ApiService,
|
||||
i18nService: I18nService,
|
||||
platformUtilsService: PlatformUtilsService,
|
||||
organizationApiService: OrganizationApiServiceAbstraction,
|
||||
formBuilder: FormBuilder,
|
||||
) {
|
||||
super(apiService, i18nService, platformUtilsService, organizationApiService, formBuilder);
|
||||
}
|
||||
async submitLicense() {
|
||||
await this.submit();
|
||||
}
|
||||
submitLicenseDialog = async () => {
|
||||
await this.submitLicense();
|
||||
};
|
||||
static open(dialogService: DialogService) {
|
||||
return dialogService.open<UpdateLicenseDialogResult>(UpdateLicenseDialogComponent);
|
||||
}
|
||||
}
|
@ -42,4 +42,9 @@ export class ExportComponent extends BaseExportComponent {
|
||||
organizationService,
|
||||
);
|
||||
}
|
||||
|
||||
protected saved() {
|
||||
super.saved();
|
||||
this.platformUtilsService.showToast("success", null, this.i18nService.t("exportSuccess"));
|
||||
}
|
||||
}
|
||||
|
@ -62,7 +62,7 @@
|
||||
[showPremiumFeatures]="organization?.useTotp"
|
||||
[showBulkMove]="false"
|
||||
[showBulkTrashOptions]="filter.type === 'trash'"
|
||||
[useEvents]="organization?.useEvents"
|
||||
[useEvents]="organization?.canAccessEventLogs"
|
||||
[showAdminActions]="true"
|
||||
(onEvent)="onVaultItemsEvent($event)"
|
||||
[showBulkEditCollectionAccess]="organization?.flexibleCollections"
|
||||
|
BIN
apps/web/src/images/register-layout/vault-signup-badges.png
Normal file
BIN
apps/web/src/images/register-layout/vault-signup-badges.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 20 KiB |
@ -2102,7 +2102,7 @@
|
||||
"message": "Bitwarden Families plan."
|
||||
},
|
||||
"addons": {
|
||||
"message": "Addons"
|
||||
"message": "Add-ons"
|
||||
},
|
||||
"premiumAccess": {
|
||||
"message": "Premium access"
|
||||
|
Loading…
Reference in New Issue
Block a user