mirror of
https://github.com/bitwarden/browser
synced 2025-12-16 08:13:42 +00:00
[PM-24011] Add handler for new policy sync push notification (#17465)
* add handler for new policy sync push notification * fix story book build failure * move logic into policy service, fix tests * add account service * add missing service to clie
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import { Policy } from "@bitwarden/common/admin-console/models/domain/policy";
|
||||
import { NotificationViewResponse as EndUserNotificationResponse } from "@bitwarden/common/vault/notifications/models";
|
||||
|
||||
import { NotificationType, PushNotificationLogOutReasonType } from "../../enums";
|
||||
@@ -71,6 +72,9 @@ export class NotificationResponse extends BaseResponse {
|
||||
case NotificationType.ProviderBankAccountVerified:
|
||||
this.payload = new ProviderBankAccountVerifiedPushNotification(payload);
|
||||
break;
|
||||
case NotificationType.SyncPolicy:
|
||||
this.payload = new SyncPolicyNotification(payload);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -187,6 +191,15 @@ export class ProviderBankAccountVerifiedPushNotification extends BaseResponse {
|
||||
}
|
||||
}
|
||||
|
||||
export class SyncPolicyNotification extends BaseResponse {
|
||||
policy: Policy;
|
||||
|
||||
constructor(response: any) {
|
||||
super(response);
|
||||
this.policy = this.getResponseProperty("Policy");
|
||||
}
|
||||
}
|
||||
|
||||
export class LogOutNotification extends BaseResponse {
|
||||
userId: string;
|
||||
reason?: PushNotificationLogOutReasonType;
|
||||
|
||||
Reference in New Issue
Block a user