mirror of
https://github.com/bitwarden/browser
synced 2025-12-12 22:33:35 +00:00
fix copy, padding, cleanup observable logic
This commit is contained in:
@@ -38,7 +38,7 @@
|
||||
<div class="tw-flex tw-flex-col">
|
||||
@let showBadge = firstTimeDialog();
|
||||
@if (showBadge) {
|
||||
<span bitBadge variant="info" class="tw-w-28 tw-my-2"> {{ "availableNow" | i18n }}</span>
|
||||
<span bitBadge variant="info" class="tw-w-[99px] tw-my-2"> {{ "availableNow" | i18n }}</span>
|
||||
}
|
||||
<span>
|
||||
{{ (firstTimeDialog ? "autoConfirm" : "editPolicy") | i18n }}
|
||||
|
||||
@@ -47,12 +47,12 @@
|
||||
<bit-icon class="tw-w-[233px]" [icon]="autoConfirmSvg"></bit-icon>
|
||||
</div>
|
||||
<ol>
|
||||
<li>1. {{ "autoConfirmStep1" | i18n }}</li>
|
||||
<li>1. {{ "autoConfirmExtension1" | i18n }}</li>
|
||||
|
||||
<li>
|
||||
2. {{ "autoConfirmStep2a" | i18n }}
|
||||
2. {{ "autoConfirmExtension2" | i18n }}
|
||||
<strong>
|
||||
{{ "autoConfirmStep2b" | i18n }}
|
||||
{{ "autoConfirmExtension3" | i18n }}
|
||||
</strong>
|
||||
</li>
|
||||
</ol>
|
||||
|
||||
@@ -23,6 +23,7 @@ import {
|
||||
take,
|
||||
takeUntil,
|
||||
tap,
|
||||
withLatestFrom,
|
||||
} from "rxjs/operators";
|
||||
|
||||
import {
|
||||
@@ -642,25 +643,7 @@ export class VaultComponent<C extends CipherViewLike> implements OnInit, OnDestr
|
||||
);
|
||||
void this.unifiedUpgradePromptService.displayUpgradePromptConditionally();
|
||||
|
||||
zip([
|
||||
this.configService.getFeatureFlag$(FeatureFlag.AutoConfirm),
|
||||
this.userId$.pipe(switchMap((userId) => this.autoConfirmService.configuration$(userId))),
|
||||
this.organizations$.pipe(map((organizations) => organizations[0])),
|
||||
])
|
||||
.pipe(
|
||||
filter(
|
||||
([enabled, autoConfirmState, organization]) =>
|
||||
enabled &&
|
||||
autoConfirmState.showSetupDialog &&
|
||||
!!organization &&
|
||||
organization.canManageUsers,
|
||||
),
|
||||
first(),
|
||||
takeUntil(this.destroy$),
|
||||
)
|
||||
.subscribe(([enabled, autoConfirmState, organization]) =>
|
||||
this.openAutoConfirmFeatureDialog(organization),
|
||||
);
|
||||
this.setupAutoConfirm();
|
||||
}
|
||||
|
||||
ngOnDestroy() {
|
||||
@@ -1589,6 +1572,39 @@ export class VaultComponent<C extends CipherViewLike> implements OnInit, OnDestr
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
private setupAutoConfirm() {
|
||||
zip([
|
||||
this.organizations$.pipe(map((organizations) => organizations[0])),
|
||||
this.configService.getFeatureFlag$(FeatureFlag.AutoConfirm),
|
||||
this.userId$.pipe(switchMap((userId) => this.autoConfirmService.configuration$(userId))),
|
||||
this.userId$.pipe(
|
||||
switchMap((userId) => this.policyService.policies$(userId)),
|
||||
withLatestFrom(this.organizations$.pipe(map((organizations) => organizations[0]))),
|
||||
map(([policies, organization]) =>
|
||||
policies.some(
|
||||
(p) =>
|
||||
p.type === PolicyType.AutoConfirm &&
|
||||
p.enabled &&
|
||||
p.organizationId === organization.id,
|
||||
),
|
||||
),
|
||||
),
|
||||
])
|
||||
.pipe(
|
||||
filter(
|
||||
([organization, flagEnabled, autoConfirmState, policyEnabled]) =>
|
||||
flagEnabled &&
|
||||
!policyEnabled &&
|
||||
autoConfirmState.showSetupDialog &&
|
||||
!!organization &&
|
||||
organization.canManageUsers,
|
||||
),
|
||||
first(),
|
||||
takeUntil(this.destroy$),
|
||||
)
|
||||
.subscribe(([organization]) => this.openAutoConfirmFeatureDialog(organization));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -5801,16 +5801,16 @@
|
||||
"howToTurnOnAutoConfirm": {
|
||||
"message": "How to turn on automatic user confirmation"
|
||||
},
|
||||
"autoConfirmStep1": {
|
||||
"message": "Open your Bitwarden extension."
|
||||
"autoConfirmExtension1": {
|
||||
"message": "Open your Bitwarden extension"
|
||||
},
|
||||
"autoConfirmStep2a": {
|
||||
"autoConfirmExtension2": {
|
||||
"message": "Select",
|
||||
"description": "This is a fragment of a larger sencence. The whole sentence will read: 'Select Turn on.'"
|
||||
"description": "This is a fragment of a larger sencence. The whole sentence will read: 'Select Turn on'"
|
||||
},
|
||||
"autoConfirmStep2b": {
|
||||
"message": " Turn on.",
|
||||
"description": "This is a fragment of a larger sencence. The whole sentence will read: 'Select Turn on.'"
|
||||
"autoConfirmExtension3": {
|
||||
"message": " Turn on",
|
||||
"description": "This is a fragment of a larger sencence. The whole sentence will read: 'Select Turn on'"
|
||||
},
|
||||
"autoConfirmExtensionOpened": {
|
||||
"message": "Successfully opened the Bitwarden browser extension. You can now activate the automatic user confirmation setting."
|
||||
|
||||
@@ -285,6 +285,8 @@ export class DefaultPolicyService implements PolicyService {
|
||||
case PolicyType.RemoveUnlockWithPin:
|
||||
// Remove Unlock with PIN policy
|
||||
return false;
|
||||
case PolicyType.AutoConfirm:
|
||||
return false;
|
||||
case PolicyType.OrganizationDataOwnership:
|
||||
// organization data ownership policy applies to everyone except admins and owners
|
||||
return organization.isAdmin;
|
||||
|
||||
Reference in New Issue
Block a user