mirror of
https://github.com/bitwarden/browser
synced 2025-12-06 00:13:28 +00:00
[PM-18803] New Item Nudge Login Spotlight Bold Copy Text (#14589)
* updated new-item-nudge.component to include bold text for login spotlight. and link in ssh spotlight
This commit is contained in:
@@ -55,7 +55,9 @@ describe("NewItemNudgeComponent", () => {
|
||||
|
||||
expect(component.showNewItemSpotlight).toBe(true);
|
||||
expect(component.nudgeTitle).toBe("newLoginNudgeTitle");
|
||||
expect(component.nudgeBody).toBe("newLoginNudgeBody");
|
||||
expect(component.nudgeBody).toBe(
|
||||
"newLoginNudgeBodyOne <strong>newLoginNudgeBodyBold</strong> newLoginNudgeBodyTwo",
|
||||
);
|
||||
expect(component.dismissalNudgeType).toBe(VaultNudgeType.newLoginItemStatus);
|
||||
});
|
||||
|
||||
|
||||
@@ -35,12 +35,15 @@ export class NewItemNudgeComponent implements OnInit {
|
||||
this.activeUserId = await firstValueFrom(getUserId(this.accountService.activeAccount$));
|
||||
|
||||
switch (this.configType) {
|
||||
case CipherType.Login:
|
||||
case CipherType.Login: {
|
||||
const nudgeBodyOne = this.i18nService.t("newLoginNudgeBodyOne");
|
||||
const nudgeBodyBold = this.i18nService.t("newLoginNudgeBodyBold");
|
||||
const nudgeBodyTwo = this.i18nService.t("newLoginNudgeBodyTwo");
|
||||
this.dismissalNudgeType = VaultNudgeType.newLoginItemStatus;
|
||||
this.nudgeTitle = this.i18nService.t("newLoginNudgeTitle");
|
||||
this.nudgeBody = this.i18nService.t("newLoginNudgeBody");
|
||||
this.nudgeBody = `${nudgeBodyOne} <strong>${nudgeBodyBold}</strong> ${nudgeBodyTwo}`;
|
||||
break;
|
||||
|
||||
}
|
||||
case CipherType.Card:
|
||||
this.dismissalNudgeType = VaultNudgeType.newCardItemStatus;
|
||||
this.nudgeTitle = this.i18nService.t("newCardNudgeTitle");
|
||||
@@ -59,11 +62,15 @@ export class NewItemNudgeComponent implements OnInit {
|
||||
this.nudgeBody = this.i18nService.t("newNoteNudgeBody");
|
||||
break;
|
||||
|
||||
case CipherType.SshKey:
|
||||
case CipherType.SshKey: {
|
||||
const sshPartOne = this.i18nService.t("newSshNudgeBodyOne");
|
||||
const sshPartTwo = this.i18nService.t("newSshNudgeBodyTwo");
|
||||
|
||||
this.dismissalNudgeType = VaultNudgeType.newSshItemStatus;
|
||||
this.nudgeTitle = this.i18nService.t("newSshNudgeTitle");
|
||||
this.nudgeBody = this.i18nService.t("newSshNudgeBody");
|
||||
this.nudgeBody = `${sshPartOne} <a href="https://bitwarden.com/help/ssh-agent" class="tw-text-primary-600 tw-font-bold" target="_blank">${sshPartTwo}</a>`;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
throw new Error("Unsupported cipher type");
|
||||
}
|
||||
|
||||
@@ -4,9 +4,7 @@
|
||||
<div class="tw-flex tw-justify-between tw-items-start tw-flex-grow">
|
||||
<div>
|
||||
<h2 bitTypography="h4" class="tw-font-semibold !tw-mb-1">{{ title }}</h2>
|
||||
<p class="tw-text-main tw-mb-0" bitTypography="body2">
|
||||
{{ subtitle }}
|
||||
</p>
|
||||
<p class="tw-text-main tw-mb-0" bitTypography="body2" [innerHTML]="subtitle"></p>
|
||||
</div>
|
||||
<button
|
||||
type="button"
|
||||
|
||||
@@ -28,13 +28,13 @@ export class EmptyVaultNudgeService extends DefaultSingleNudgeService {
|
||||
this.collectionService.decryptedCollections$,
|
||||
]).pipe(
|
||||
switchMap(([nudgeStatus, ciphers, orgs, collections]) => {
|
||||
const emptyVault = ciphers == null || ciphers.length === 0;
|
||||
const vaultHasContents = !(ciphers == null || ciphers.length === 0);
|
||||
if (orgs == null || orgs.length === 0) {
|
||||
return nudgeStatus.hasBadgeDismissed || nudgeStatus.hasSpotlightDismissed
|
||||
? of(nudgeStatus)
|
||||
: of({
|
||||
hasSpotlightDismissed: emptyVault,
|
||||
hasBadgeDismissed: emptyVault,
|
||||
hasSpotlightDismissed: vaultHasContents,
|
||||
hasBadgeDismissed: vaultHasContents,
|
||||
});
|
||||
}
|
||||
const orgIds = new Set(orgs.map((org) => org.id));
|
||||
@@ -55,8 +55,8 @@ export class EmptyVaultNudgeService extends DefaultSingleNudgeService {
|
||||
return of(nudgeStatus);
|
||||
}
|
||||
return of({
|
||||
hasSpotlightDismissed: emptyVault,
|
||||
hasBadgeDismissed: emptyVault,
|
||||
hasSpotlightDismissed: vaultHasContents,
|
||||
hasBadgeDismissed: vaultHasContents,
|
||||
});
|
||||
}),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user