-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[PM-14421] Add temporary callout for at-risk tasks to browser vault view
- Loading branch information
1 parent
4b0a703
commit 5ae2ad0
Showing
5 changed files
with
63 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
...rowser/src/vault/popup/components/at-risk-callout/at-risk-password-callout.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<bit-callout *ngIf="(pendingTasks$ | async)?.length as taskCount" type="warning" [title]="''"> | ||
<i class="bwi bwi-exclamation-triangle tw-text-warning" aria-hidden="true"></i> | ||
<a bitLink [routerLink]="'/at-risk-passwords'"> | ||
{{ "reviewAndChangeAtRiskPasswords" | i18n: taskCount.toString() }} | ||
</a> | ||
</bit-callout> |
32 changes: 32 additions & 0 deletions
32
.../browser/src/vault/popup/components/at-risk-callout/at-risk-password-callout.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { CommonModule } from "@angular/common"; | ||
import { Component, inject } from "@angular/core"; | ||
import { RouterModule } from "@angular/router"; | ||
import { map, switchMap } from "rxjs"; | ||
|
||
import { AccountService } from "@bitwarden/common/auth/abstractions/account.service"; | ||
import { AnchorLinkDirective, CalloutModule } from "@bitwarden/components"; | ||
import { I18nPipe } from "@bitwarden/ui-common"; | ||
import { filterOutNullish, SecurityTaskType, TaskService } from "@bitwarden/vault"; | ||
|
||
// TODO: This component will need to be reworked to use the new EndUserNotificationService in PM-10609 | ||
|
||
@Component({ | ||
selector: "vault-at-risk-password-callout", | ||
standalone: true, | ||
imports: [CommonModule, AnchorLinkDirective, RouterModule, CalloutModule, I18nPipe], | ||
templateUrl: "./at-risk-password-callout.component.html", | ||
}) | ||
export class AtRiskPasswordCalloutComponent { | ||
private taskService = inject(TaskService); | ||
private activeAccount$ = inject(AccountService).activeAccount$.pipe(filterOutNullish()); | ||
|
||
protected pendingTasks$ = this.activeAccount$.pipe( | ||
switchMap((user) => | ||
this.taskService | ||
.pendingTasks$(user.id) | ||
.pipe( | ||
map((tasks) => tasks.filter((t) => t.type === SecurityTaskType.UpdateAtRiskCredential)), | ||
), | ||
), | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters