1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-10 21:33:27 +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:
Jason Ng
2025-05-05 11:59:25 -04:00
committed by GitHub
parent 28f00e5533
commit 60bafc1311
7 changed files with 90 additions and 26 deletions

View File

@@ -5276,8 +5276,20 @@
"newLoginNudgeTitle": { "newLoginNudgeTitle": {
"message": "Save time with autofill" "message": "Save time with autofill"
}, },
"newLoginNudgeBody": { "newLoginNudgeBodyOne": {
"message": "Include a Website so this login appears as an autofill suggestion." "message": "Include a",
"description": "This is in multiple parts to allow for bold text in the middle of the sentence.",
"example": "Include a Website so this login appears as an autofill suggestion."
},
"newLoginNudgeBodyBold": {
"message": "Website",
"description": "This is in multiple parts to allow for bold text in the middle of the sentence.",
"example": "Include a Website so this login appears as an autofill suggestion."
},
"newLoginNudgeBodyTwo": {
"message": "so this login appears as an autofill suggestion.",
"description": "This is in multiple parts to allow for bold text in the middle of the sentence.",
"example": "Include a Website so this login appears as an autofill suggestion."
}, },
"newCardNudgeTitle": { "newCardNudgeTitle": {
"message": "Seamless online checkout" "message": "Seamless online checkout"
@@ -5300,7 +5312,14 @@
"newSshNudgeTitle": { "newSshNudgeTitle": {
"message": "Developer-friendly SSH access" "message": "Developer-friendly SSH access"
}, },
"newSshNudgeBody": { "newSshNudgeBodyOne": {
"message": "Store your keys and connect with the SSH agent for fast, encrypted authentication." "message": "Store your keys and connect with the SSH agent for fast, encrypted authentication.",
"description": "Two part message",
"example": "Store your keys and connect with the SSH agent for fast, encrypted authentication. Learn more about SSH agent"
},
"newSshNudgeBodyTwo": {
"message": "Learn more about SSH agent",
"description": "Two part message",
"example": "Store your keys and connect with the SSH agent for fast, encrypted authentication. Learn more about SSH agent"
} }
} }

View File

@@ -3755,8 +3755,20 @@
"newLoginNudgeTitle": { "newLoginNudgeTitle": {
"message": "Save time with autofill" "message": "Save time with autofill"
}, },
"newLoginNudgeBody": { "newLoginNudgeBodyOne": {
"message": "Include a Website so this login appears as an autofill suggestion." "message": "Include a",
"description": "This is in multiple parts to allow for bold text in the middle of the sentence.",
"example": "Include a Website so this login appears as an autofill suggestion."
},
"newLoginNudgeBodyBold": {
"message": "Website",
"description": "This is in multiple parts to allow for bold text in the middle of the sentence.",
"example": "Include a Website so this login appears as an autofill suggestion."
},
"newLoginNudgeBodyTwo": {
"message": "so this login appears as an autofill suggestion.",
"description": "This is in multiple parts to allow for bold text in the middle of the sentence.",
"example": "Include a Website so this login appears as an autofill suggestion."
}, },
"newCardNudgeTitle": { "newCardNudgeTitle": {
"message": "Seamless online checkout" "message": "Seamless online checkout"
@@ -3779,7 +3791,14 @@
"newSshNudgeTitle": { "newSshNudgeTitle": {
"message": "Developer-friendly SSH access" "message": "Developer-friendly SSH access"
}, },
"newSshNudgeBody": { "newSshNudgeBodyOne": {
"message": "Store your keys and connect with the SSH agent for fast, encrypted authentication." "message": "Store your keys and connect with the SSH agent for fast, encrypted authentication.",
"description": "Two part message",
"example": "Store your keys and connect with the SSH agent for fast, encrypted authentication. Learn more about SSH agent"
},
"newSshNudgeBodyTwo": {
"message": "Learn more about SSH agent",
"description": "Two part message",
"example": "Store your keys and connect with the SSH agent for fast, encrypted authentication. Learn more about SSH agent"
} }
} }

View File

@@ -10638,8 +10638,20 @@
"newLoginNudgeTitle": { "newLoginNudgeTitle": {
"message": "Save time with autofill" "message": "Save time with autofill"
}, },
"newLoginNudgeBody": { "newLoginNudgeBodyOne": {
"message": "Include a Website so this login appears as an autofill suggestion." "message": "Include a",
"description": "This is in multiple parts to allow for bold text in the middle of the sentence.",
"example": "Include a Website so this login appears as an autofill suggestion."
},
"newLoginNudgeBodyBold": {
"message": "Website",
"description": "This is in multiple parts to allow for bold text in the middle of the sentence.",
"example": "Include a Website so this login appears as an autofill suggestion."
},
"newLoginNudgeBodyTwo": {
"message": "so this login appears as an autofill suggestion.",
"description": "This is in multiple parts to allow for bold text in the middle of the sentence.",
"example": "Include a Website so this login appears as an autofill suggestion."
}, },
"newCardNudgeTitle": { "newCardNudgeTitle": {
"message": "Seamless online checkout" "message": "Seamless online checkout"
@@ -10662,8 +10674,15 @@
"newSshNudgeTitle": { "newSshNudgeTitle": {
"message": "Developer-friendly SSH access" "message": "Developer-friendly SSH access"
}, },
"newSshNudgeBody": { "newSshNudgeBodyOne": {
"message": "Store your keys and connect with the SSH agent for fast, encrypted authentication." "message": "Store your keys and connect with the SSH agent for fast, encrypted authentication.",
"description": "Two part message",
"example": "Store your keys and connect with the SSH agent for fast, encrypted authentication. Learn more about SSH agent"
},
"newSshNudgeBodyTwo": {
"message": "Learn more about SSH agent",
"description": "Two part message",
"example": "Store your keys and connect with the SSH agent for fast, encrypted authentication. Learn more about SSH agent"
}, },
"restart": { "restart": {
"message": "Restart" "message": "Restart"

View File

@@ -55,7 +55,9 @@ describe("NewItemNudgeComponent", () => {
expect(component.showNewItemSpotlight).toBe(true); expect(component.showNewItemSpotlight).toBe(true);
expect(component.nudgeTitle).toBe("newLoginNudgeTitle"); 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); expect(component.dismissalNudgeType).toBe(VaultNudgeType.newLoginItemStatus);
}); });

View File

@@ -35,12 +35,15 @@ export class NewItemNudgeComponent implements OnInit {
this.activeUserId = await firstValueFrom(getUserId(this.accountService.activeAccount$)); this.activeUserId = await firstValueFrom(getUserId(this.accountService.activeAccount$));
switch (this.configType) { 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.dismissalNudgeType = VaultNudgeType.newLoginItemStatus;
this.nudgeTitle = this.i18nService.t("newLoginNudgeTitle"); this.nudgeTitle = this.i18nService.t("newLoginNudgeTitle");
this.nudgeBody = this.i18nService.t("newLoginNudgeBody"); this.nudgeBody = `${nudgeBodyOne} <strong>${nudgeBodyBold}</strong> ${nudgeBodyTwo}`;
break; break;
}
case CipherType.Card: case CipherType.Card:
this.dismissalNudgeType = VaultNudgeType.newCardItemStatus; this.dismissalNudgeType = VaultNudgeType.newCardItemStatus;
this.nudgeTitle = this.i18nService.t("newCardNudgeTitle"); this.nudgeTitle = this.i18nService.t("newCardNudgeTitle");
@@ -59,11 +62,15 @@ export class NewItemNudgeComponent implements OnInit {
this.nudgeBody = this.i18nService.t("newNoteNudgeBody"); this.nudgeBody = this.i18nService.t("newNoteNudgeBody");
break; break;
case CipherType.SshKey: case CipherType.SshKey: {
const sshPartOne = this.i18nService.t("newSshNudgeBodyOne");
const sshPartTwo = this.i18nService.t("newSshNudgeBodyTwo");
this.dismissalNudgeType = VaultNudgeType.newSshItemStatus; this.dismissalNudgeType = VaultNudgeType.newSshItemStatus;
this.nudgeTitle = this.i18nService.t("newSshNudgeTitle"); 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; break;
}
default: default:
throw new Error("Unsupported cipher type"); throw new Error("Unsupported cipher type");
} }

View File

@@ -4,9 +4,7 @@
<div class="tw-flex tw-justify-between tw-items-start tw-flex-grow"> <div class="tw-flex tw-justify-between tw-items-start tw-flex-grow">
<div> <div>
<h2 bitTypography="h4" class="tw-font-semibold !tw-mb-1">{{ title }}</h2> <h2 bitTypography="h4" class="tw-font-semibold !tw-mb-1">{{ title }}</h2>
<p class="tw-text-main tw-mb-0" bitTypography="body2"> <p class="tw-text-main tw-mb-0" bitTypography="body2" [innerHTML]="subtitle"></p>
{{ subtitle }}
</p>
</div> </div>
<button <button
type="button" type="button"

View File

@@ -28,13 +28,13 @@ export class EmptyVaultNudgeService extends DefaultSingleNudgeService {
this.collectionService.decryptedCollections$, this.collectionService.decryptedCollections$,
]).pipe( ]).pipe(
switchMap(([nudgeStatus, ciphers, orgs, collections]) => { 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) { if (orgs == null || orgs.length === 0) {
return nudgeStatus.hasBadgeDismissed || nudgeStatus.hasSpotlightDismissed return nudgeStatus.hasBadgeDismissed || nudgeStatus.hasSpotlightDismissed
? of(nudgeStatus) ? of(nudgeStatus)
: of({ : of({
hasSpotlightDismissed: emptyVault, hasSpotlightDismissed: vaultHasContents,
hasBadgeDismissed: emptyVault, hasBadgeDismissed: vaultHasContents,
}); });
} }
const orgIds = new Set(orgs.map((org) => org.id)); const orgIds = new Set(orgs.map((org) => org.id));
@@ -55,8 +55,8 @@ export class EmptyVaultNudgeService extends DefaultSingleNudgeService {
return of(nudgeStatus); return of(nudgeStatus);
} }
return of({ return of({
hasSpotlightDismissed: emptyVault, hasSpotlightDismissed: vaultHasContents,
hasBadgeDismissed: emptyVault, hasBadgeDismissed: vaultHasContents,
}); });
}), }),
); );