mirror of
https://github.com/bitwarden/browser
synced 2025-12-16 00:03:56 +00:00
[PM-18623][PM-18621][PM-18615] fix defects for new settings popover (#13572)
* fix defects for new settings popover * also check for "click items to autofill" setting
This commit is contained in:
@@ -14,7 +14,13 @@
|
|||||||
>
|
>
|
||||||
<div bitTypography="body2" (click)="goToAppearance()">
|
<div bitTypography="body2" (click)="goToAppearance()">
|
||||||
{{ "newCustomizationOptionsCalloutContent" | i18n }}
|
{{ "newCustomizationOptionsCalloutContent" | i18n }}
|
||||||
<a routerLink="/appearance">
|
<a
|
||||||
|
tabIndex="0"
|
||||||
|
bitLink
|
||||||
|
linkType="primary"
|
||||||
|
routerLink="/appearance"
|
||||||
|
(keydown.enter)="goToAppearance()"
|
||||||
|
>
|
||||||
{{ "newCustomizationOptionsCalloutLink" | i18n }}
|
{{ "newCustomizationOptionsCalloutLink" | i18n }}
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -9,8 +9,10 @@ import { AccountService } from "@bitwarden/common/auth/abstractions/account.serv
|
|||||||
import { getUserId } from "@bitwarden/common/auth/services/account.service";
|
import { getUserId } from "@bitwarden/common/auth/services/account.service";
|
||||||
import { LogService } from "@bitwarden/common/platform/abstractions/log.service";
|
import { LogService } from "@bitwarden/common/platform/abstractions/log.service";
|
||||||
import { UserId } from "@bitwarden/common/types/guid";
|
import { UserId } from "@bitwarden/common/types/guid";
|
||||||
|
import { VaultSettingsService } from "@bitwarden/common/vault/abstractions/vault-settings/vault-settings.service";
|
||||||
import { ButtonModule, PopoverModule } from "@bitwarden/components";
|
import { ButtonModule, PopoverModule } from "@bitwarden/components";
|
||||||
|
|
||||||
|
import { VaultPopupCopyButtonsService } from "../../../services/vault-popup-copy-buttons.service";
|
||||||
import { VaultPageService } from "../vault-page.service";
|
import { VaultPageService } from "../vault-page.service";
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
@@ -30,11 +32,18 @@ export class NewSettingsCalloutComponent implements OnInit, OnDestroy {
|
|||||||
private vaultPageService: VaultPageService,
|
private vaultPageService: VaultPageService,
|
||||||
private router: Router,
|
private router: Router,
|
||||||
private logService: LogService,
|
private logService: LogService,
|
||||||
|
private copyButtonService: VaultPopupCopyButtonsService,
|
||||||
|
private vaultSettingsService: VaultSettingsService,
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
async ngOnInit() {
|
async ngOnInit() {
|
||||||
this.activeUserId = await firstValueFrom(this.accountService.activeAccount$.pipe(getUserId));
|
this.activeUserId = await firstValueFrom(this.accountService.activeAccount$.pipe(getUserId));
|
||||||
|
|
||||||
|
const showQuickCopyActions = await firstValueFrom(this.copyButtonService.showQuickCopyActions$);
|
||||||
|
const clickItemsToAutofillVaultView = await firstValueFrom(
|
||||||
|
this.vaultSettingsService.clickItemsToAutofillVaultView$,
|
||||||
|
);
|
||||||
|
|
||||||
let profileCreatedDate: Date;
|
let profileCreatedDate: Date;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@@ -50,7 +59,10 @@ export class NewSettingsCalloutComponent implements OnInit, OnDestroy {
|
|||||||
);
|
);
|
||||||
|
|
||||||
this.showNewCustomizationSettingsCallout =
|
this.showNewCustomizationSettingsCallout =
|
||||||
!hasCalloutBeenDismissed && profileCreatedDate < new Date("2024-12-25");
|
!showQuickCopyActions &&
|
||||||
|
!clickItemsToAutofillVaultView &&
|
||||||
|
!hasCalloutBeenDismissed &&
|
||||||
|
profileCreatedDate < new Date("2024-12-25");
|
||||||
}
|
}
|
||||||
|
|
||||||
async goToAppearance() {
|
async goToAppearance() {
|
||||||
|
|||||||
@@ -21,12 +21,6 @@ export const NEW_CUSTOMIZATION_OPTIONS_CALLOUT_DISMISSED_KEY = new UserKeyDefini
|
|||||||
export class VaultPageService {
|
export class VaultPageService {
|
||||||
private stateProvider = inject(StateProvider);
|
private stateProvider = inject(StateProvider);
|
||||||
|
|
||||||
async unDismissCallout(userId: UserId): Promise<void> {
|
|
||||||
await this.stateProvider
|
|
||||||
.getUser(userId, NEW_CUSTOMIZATION_OPTIONS_CALLOUT_DISMISSED_KEY)
|
|
||||||
.update(() => false);
|
|
||||||
}
|
|
||||||
|
|
||||||
isCalloutDismissed(userId: UserId): Observable<boolean> {
|
isCalloutDismissed(userId: UserId): Observable<boolean> {
|
||||||
return this.stateProvider
|
return this.stateProvider
|
||||||
.getUser(userId, NEW_CUSTOMIZATION_OPTIONS_CALLOUT_DISMISSED_KEY)
|
.getUser(userId, NEW_CUSTOMIZATION_OPTIONS_CALLOUT_DISMISSED_KEY)
|
||||||
|
|||||||
Reference in New Issue
Block a user