mirror of
https://github.com/bitwarden/browser
synced 2025-12-14 23:33:31 +00:00
[AC-2485] Add redirects to clients components based on FF and provider status (#8839)
* Add provider clients redirects based on FF and provider status * Fixing broken test
This commit is contained in:
@@ -7,3 +7,4 @@ export * from "./provider-type.enum";
|
||||
export * from "./provider-user-status-type.enum";
|
||||
export * from "./provider-user-type.enum";
|
||||
export * from "./scim-provider-type.enum";
|
||||
export * from "./provider-status-type.enum";
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
export enum ProviderStatusType {
|
||||
Pending = 0,
|
||||
Created = 1,
|
||||
Billable = 2,
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
import { ProviderUserStatusType, ProviderUserType } from "../../enums";
|
||||
import { ProviderStatusType, ProviderUserStatusType, ProviderUserType } from "../../enums";
|
||||
import { ProfileProviderResponse } from "../response/profile-provider.response";
|
||||
|
||||
export class ProviderData {
|
||||
@@ -9,6 +9,7 @@ export class ProviderData {
|
||||
enabled: boolean;
|
||||
userId: string;
|
||||
useEvents: boolean;
|
||||
providerStatus: ProviderStatusType;
|
||||
|
||||
constructor(response: ProfileProviderResponse) {
|
||||
this.id = response.id;
|
||||
@@ -18,5 +19,6 @@ export class ProviderData {
|
||||
this.enabled = response.enabled;
|
||||
this.userId = response.userId;
|
||||
this.useEvents = response.useEvents;
|
||||
this.providerStatus = response.providerStatus;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { ProviderUserStatusType, ProviderUserType } from "../../enums";
|
||||
import { ProviderStatusType, ProviderUserStatusType, ProviderUserType } from "../../enums";
|
||||
import { ProviderData } from "../data/provider.data";
|
||||
|
||||
export class Provider {
|
||||
@@ -9,6 +9,7 @@ export class Provider {
|
||||
enabled: boolean;
|
||||
userId: string;
|
||||
useEvents: boolean;
|
||||
providerStatus: ProviderStatusType;
|
||||
|
||||
constructor(obj?: ProviderData) {
|
||||
if (obj == null) {
|
||||
@@ -22,6 +23,7 @@ export class Provider {
|
||||
this.enabled = obj.enabled;
|
||||
this.userId = obj.userId;
|
||||
this.useEvents = obj.useEvents;
|
||||
this.providerStatus = obj.providerStatus;
|
||||
}
|
||||
|
||||
get canAccess() {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { BaseResponse } from "../../../models/response/base.response";
|
||||
import { ProviderUserStatusType, ProviderUserType } from "../../enums";
|
||||
import { ProviderStatusType, ProviderUserStatusType, ProviderUserType } from "../../enums";
|
||||
import { PermissionsApi } from "../api/permissions.api";
|
||||
|
||||
export class ProfileProviderResponse extends BaseResponse {
|
||||
@@ -12,6 +12,7 @@ export class ProfileProviderResponse extends BaseResponse {
|
||||
permissions: PermissionsApi;
|
||||
userId: string;
|
||||
useEvents: boolean;
|
||||
providerStatus: ProviderStatusType;
|
||||
|
||||
constructor(response: any) {
|
||||
super(response);
|
||||
@@ -24,5 +25,6 @@ export class ProfileProviderResponse extends BaseResponse {
|
||||
this.permissions = new PermissionsApi(this.getResponseProperty("permissions"));
|
||||
this.userId = this.getResponseProperty("UserId");
|
||||
this.useEvents = this.getResponseProperty("UseEvents");
|
||||
this.providerStatus = this.getResponseProperty("ProviderStatus");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ import { FakeAccountService, FakeStateProvider, mockAccountServiceWith } from ".
|
||||
import { FakeActiveUserState, FakeSingleUserState } from "../../../spec/fake-state";
|
||||
import { Utils } from "../../platform/misc/utils";
|
||||
import { UserId } from "../../types/guid";
|
||||
import { ProviderUserStatusType, ProviderUserType } from "../enums";
|
||||
import { ProviderStatusType, ProviderUserStatusType, ProviderUserType } from "../enums";
|
||||
import { ProviderData } from "../models/data/provider.data";
|
||||
import { Provider } from "../models/domain/provider";
|
||||
|
||||
@@ -64,6 +64,7 @@ describe("PROVIDERS key definition", () => {
|
||||
enabled: true,
|
||||
userId: "string",
|
||||
useEvents: true,
|
||||
providerStatus: ProviderStatusType.Pending,
|
||||
},
|
||||
};
|
||||
const result = sut.deserializer(JSON.parse(JSON.stringify(expectedResult)));
|
||||
|
||||
Reference in New Issue
Block a user