1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-10 21:33:27 +00:00

[PM-20034] - [Vault][Browser] Display View Login button and specific banner when an At-risk password task is missing a valid website (#16206)

* add banner for at risk pw without uri

* remove unnecessary title attr. use hasUris
This commit is contained in:
Jordan Aasen
2025-09-04 15:30:39 -07:00
committed by GitHub
parent 63dfca2bba
commit e8e1a9891a
5 changed files with 40 additions and 9 deletions

View File

@@ -556,6 +556,9 @@
"view": { "view": {
"message": "View" "message": "View"
}, },
"viewLogin": {
"message": "View login"
},
"noItemsInList": { "noItemsInList": {
"message": "There are no items to list." "message": "There are no items to list."
}, },
@@ -5446,6 +5449,12 @@
"changeAtRiskPassword": { "changeAtRiskPassword": {
"message": "Change at-risk password" "message": "Change at-risk password"
}, },
"changeAtRiskPasswordAndAddWebsite": {
"message": "This login is at-risk and missing a website. Add a website and change the password for stronger security."
},
"missingWebsite": {
"message": "Missing website"
},
"settingsVaultOptions": { "settingsVaultOptions": {
"message": "Vault options" "message": "Vault options"
}, },

View File

@@ -3,7 +3,7 @@
slot="header" slot="header"
[pageTitle]="'atRiskPasswords' | i18n" [pageTitle]="'atRiskPasswords' | i18n"
showBackButton showBackButton
[backAction]="navigateToVault.bind(this)" [backAction]="navigateToVault"
> >
<ng-container slot="end"> <ng-container slot="end">
<app-pop-out></app-pop-out> <app-pop-out></app-pop-out>
@@ -13,7 +13,7 @@
<bit-callout <bit-callout
*ngIf="showAutofillCallout$ | async" *ngIf="showAutofillCallout$ | async"
type="info" type="info"
[title]="'changeAtRiskPasswordsFaster' | i18n" [appA11yTitle]="'changeAtRiskPasswordsFaster' | i18n"
data-testid="autofill-callout" data-testid="autofill-callout"
> >
<p bitTypography="body2">{{ "changeAtRiskPasswordsFasterDesc" | i18n }}</p> <p bitTypography="body2">{{ "changeAtRiskPasswordsFasterDesc" | i18n }}</p>
@@ -65,10 +65,10 @@
type="button" type="button"
bitBadge bitBadge
variant="primary" variant="primary"
*ngIf="hasLoginUri(cipher)"
appStopProp appStopProp
(click)="launchChangePassword(cipher)" (click)="launchChangePassword(cipher)"
[title]="'changeButtonTitle' | i18n: cipher.name" [appA11yTitle]="'changeButtonTitle' | i18n: cipher.name"
[attr.aria-label]="'changeButtonTitle' | i18n: cipher.name"
[disabled]="launchingCipher() == cipher" [disabled]="launchingCipher() == cipher"
> >
<ng-container *ngIf="launchingCipher() != cipher"> <ng-container *ngIf="launchingCipher() != cipher">
@@ -80,6 +80,16 @@
aria-hidden="true" aria-hidden="true"
></i> ></i>
</button> </button>
<button
type="button"
bitBadge
variant="primary"
*ngIf="!hasLoginUri(cipher)"
[appA11yTitle]="'viewItemTitle' | i18n: cipher.name"
(click)="viewCipher(cipher)"
>
{{ "viewLogin" | i18n }}
</button>
</bit-item-action> </bit-item-action>
</bit-item> </bit-item>
</bit-item-group> </bit-item-group>

View File

@@ -253,6 +253,10 @@ export class AtRiskPasswordsComponent implements OnInit {
await this.atRiskPasswordPageService.dismissCallout(userId); await this.atRiskPasswordPageService.dismissCallout(userId);
} }
protected hasLoginUri(cipher: CipherView) {
return cipher.login?.hasUris;
}
launchChangePassword = async (cipher: CipherView) => { launchChangePassword = async (cipher: CipherView) => {
try { try {
this.launchingCipher.set(cipher); this.launchingCipher.set(cipher);
@@ -273,7 +277,7 @@ export class AtRiskPasswordsComponent implements OnInit {
* which can conflict with the `PopupRouterCacheService`. This replaces the * which can conflict with the `PopupRouterCacheService`. This replaces the
* built-in back button behavior so the user always navigates to the vault. * built-in back button behavior so the user always navigates to the vault.
*/ */
protected async navigateToVault() { protected navigateToVault = async () => {
await this.router.navigate(["/tabs/vault"]); await this.router.navigate(["/tabs/vault"]);
} };
} }

View File

@@ -4,10 +4,14 @@
</bit-callout> </bit-callout>
<bit-callout <bit-callout
*ngIf="cipher?.login.uris.length > 0 && hadPendingChangePasswordTask" *ngIf="!hasLoginUri && hadPendingChangePasswordTask"
type="warning" type="warning"
[title]="''" [title]="'missingWebsite' | i18n"
> >
{{ "changeAtRiskPasswordAndAddWebsite" | i18n }}
</bit-callout>
<bit-callout *ngIf="hasLoginUri && hadPendingChangePasswordTask" type="warning" [title]="''">
<i class="bwi bwi-exclamation-triangle tw-text-warning" aria-hidden="true"></i> <i class="bwi bwi-exclamation-triangle tw-text-warning" aria-hidden="true"></i>
<a bitLink href="#" appStopClick (click)="launchChangePassword()"> <a bitLink href="#" appStopClick (click)="launchChangePassword()">
{{ "changeAtRiskPassword" | i18n }} {{ "changeAtRiskPassword" | i18n }}
@@ -39,7 +43,7 @@
*ngIf="hasLogin" *ngIf="hasLogin"
[cipher]="cipher" [cipher]="cipher"
[activeUserId]="activeUserId$ | async" [activeUserId]="activeUserId$ | async"
[hadPendingChangePasswordTask]="hadPendingChangePasswordTask" [hadPendingChangePasswordTask]="hadPendingChangePasswordTask && cipher?.login.uris.length > 0"
(handleChangePassword)="launchChangePassword()" (handleChangePassword)="launchChangePassword()"
></app-login-credentials-view> ></app-login-credentials-view>

View File

@@ -139,6 +139,10 @@ export class CipherViewComponent implements OnChanges, OnDestroy {
return !!this.cipher?.sshKey?.privateKey; return !!this.cipher?.sshKey?.privateKey;
} }
get hasLoginUri() {
return this.cipher?.login?.hasUris;
}
async loadCipherData() { async loadCipherData() {
if (!this.cipher) { if (!this.cipher) {
return; return;