mirror of
https://github.com/bitwarden/browser
synced 2025-12-06 00:13:28 +00:00
[PM-20040] all tasks complete banner (#16033)
* saved WIP
* created at risk password callout service to hold state for callout data. wip
* update at-risk-password-callout to use states for tracking showing and dismissing success banner
* adding spec file for new serive
* update styles to match figma
* minor wording changes
* fix undefined lint error in at risk password callout
* moved service to libs
* added another route guard so when user clears all at risk items they are directed back to the vault page
* small cleanup in at risk callout component and at risk pw guard
* clean up code in at risk password callout component
* update state to memory
* refactor for readability at risk password callout component
* move state update logic from component to at risk password callout service
* fix: bypass router cache on back() in popout
* Revert "fix: bypass router cache on back() in popout"
This reverts commit 23f9312434.
* refactor updatePendingTasksState call
* refactor at risk password callout component and service. remove signals, implement logic through observables. Completed value for tasks utilized.
* clean up completedTasks in at risk password callout service
* add updated state value to prevent banner among diff clients
* move hasInteracted call to page component to avoid looping
* remove excess call in service
* update icon null logic in banner component
* update the callout to use a new banner
* fix classes
* updating banners in at risk password callout component
* anchor tag
* move at-risk callout to above nudges
* update `showCompletedTasksBanner$` variable naming
---------
Co-authored-by: Andreas Coroiu <andreas.coroiu@gmail.com>
Co-authored-by: Nick Krantz <nick@livefront.com>
This commit is contained in:
@@ -25,6 +25,12 @@ export abstract class TaskService {
|
||||
*/
|
||||
abstract pendingTasks$(userId: UserId): Observable<SecurityTask[]>;
|
||||
|
||||
/**
|
||||
* Observable of completed tasks for a given user.
|
||||
* @param userId
|
||||
*/
|
||||
abstract completedTasks$(userId: UserId): Observable<SecurityTask[]>;
|
||||
|
||||
/**
|
||||
* Retrieves tasks from the API for a given user and updates the local state.
|
||||
* @param userId
|
||||
|
||||
@@ -80,6 +80,12 @@ export class DefaultTaskService implements TaskService {
|
||||
);
|
||||
});
|
||||
|
||||
completedTasks$ = perUserCache$((userId) => {
|
||||
return this.tasks$(userId).pipe(
|
||||
map((tasks) => tasks.filter((t) => t.status === SecurityTaskStatus.Completed)),
|
||||
);
|
||||
});
|
||||
|
||||
async refreshTasks(userId: UserId): Promise<void> {
|
||||
await this.fetchTasksFromApi(userId);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user