mirror of
https://github.com/bitwarden/browser
synced 2025-12-12 06:13:38 +00:00
[PM-18633] Remove feature flagged logic (#14856)
* remove feature flagged logic * clean up
This commit is contained in:
@@ -23,7 +23,7 @@
|
|||||||
<input bitInput appAutofocus type="text" formControlName="name" />
|
<input bitInput appAutofocus type="text" formControlName="name" />
|
||||||
<bit-hint>{{ "characterMaximum" | i18n: 100 }}</bit-hint>
|
<bit-hint>{{ "characterMaximum" | i18n: 100 }}</bit-hint>
|
||||||
</bit-form-field>
|
</bit-form-field>
|
||||||
<bit-form-field *ngIf="isExternalIdVisible$ | async">
|
<bit-form-field *ngIf="isExternalIdVisible">
|
||||||
<bit-label>{{ "externalId" | i18n }}</bit-label>
|
<bit-label>{{ "externalId" | i18n }}</bit-label>
|
||||||
<input bitInput type="text" formControlName="externalId" />
|
<input bitInput type="text" formControlName="externalId" />
|
||||||
<bit-hint>{{ "externalIdDesc" | i18n }}</bit-hint>
|
<bit-hint>{{ "externalIdDesc" | i18n }}</bit-hint>
|
||||||
|
|||||||
@@ -28,7 +28,6 @@ import {
|
|||||||
} from "@bitwarden/common/admin-console/abstractions/organization/organization.service.abstraction";
|
} from "@bitwarden/common/admin-console/abstractions/organization/organization.service.abstraction";
|
||||||
import { Organization } from "@bitwarden/common/admin-console/models/domain/organization";
|
import { Organization } from "@bitwarden/common/admin-console/models/domain/organization";
|
||||||
import { AccountService } from "@bitwarden/common/auth/abstractions/account.service";
|
import { AccountService } from "@bitwarden/common/auth/abstractions/account.service";
|
||||||
import { FeatureFlag } from "@bitwarden/common/enums/feature-flag.enum";
|
|
||||||
import { ErrorResponse } from "@bitwarden/common/models/response/error.response";
|
import { ErrorResponse } from "@bitwarden/common/models/response/error.response";
|
||||||
import { ConfigService } from "@bitwarden/common/platform/abstractions/config/config.service";
|
import { ConfigService } from "@bitwarden/common/platform/abstractions/config/config.service";
|
||||||
import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service";
|
import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service";
|
||||||
@@ -147,6 +146,10 @@ export class GroupAddEditComponent implements OnInit, OnDestroy {
|
|||||||
return this.params.organizationId;
|
return this.params.organizationId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected get isExternalIdVisible(): boolean {
|
||||||
|
return !!this.groupForm.get("externalId")?.value;
|
||||||
|
}
|
||||||
|
|
||||||
protected get editMode(): boolean {
|
protected get editMode(): boolean {
|
||||||
return this.groupId != null;
|
return this.groupId != null;
|
||||||
}
|
}
|
||||||
@@ -227,10 +230,6 @@ export class GroupAddEditComponent implements OnInit, OnDestroy {
|
|||||||
this.groupDetails$,
|
this.groupDetails$,
|
||||||
]).pipe(map(([allowAdminAccess, groupDetails]) => !allowAdminAccess && groupDetails != null));
|
]).pipe(map(([allowAdminAccess, groupDetails]) => !allowAdminAccess && groupDetails != null));
|
||||||
|
|
||||||
protected isExternalIdVisible$ = this.configService
|
|
||||||
.getFeatureFlag$(FeatureFlag.SsoExternalIdVisibility)
|
|
||||||
.pipe(map((isEnabled) => !isEnabled || !!this.groupForm.get("externalId")?.value));
|
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
@Inject(DIALOG_DATA) private params: GroupAddEditDialogParams,
|
@Inject(DIALOG_DATA) private params: GroupAddEditDialogParams,
|
||||||
private dialogRef: DialogRef<GroupAddEditDialogResultType>,
|
private dialogRef: DialogRef<GroupAddEditDialogResultType>,
|
||||||
|
|||||||
@@ -177,13 +177,13 @@
|
|||||||
</bit-label>
|
</bit-label>
|
||||||
</bit-form-control>
|
</bit-form-control>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
<bit-form-field *ngIf="isExternalIdVisible$ | async">
|
<bit-form-field *ngIf="isExternalIdVisible">
|
||||||
<bit-label>{{ "externalId" | i18n }}</bit-label>
|
<bit-label>{{ "externalId" | i18n }}</bit-label>
|
||||||
<input bitInput type="text" formControlName="externalId" />
|
<input bitInput type="text" formControlName="externalId" />
|
||||||
<bit-hint>{{ "externalIdDesc" | i18n }}</bit-hint>
|
<bit-hint>{{ "externalIdDesc" | i18n }}</bit-hint>
|
||||||
</bit-form-field>
|
</bit-form-field>
|
||||||
|
|
||||||
<bit-form-field *ngIf="isSsoExternalIdVisible$ | async">
|
<bit-form-field *ngIf="isSsoExternalIdVisible">
|
||||||
<bit-label>{{ "ssoExternalId" | i18n }}</bit-label>
|
<bit-label>{{ "ssoExternalId" | i18n }}</bit-label>
|
||||||
<input bitInput type="text" formControlName="ssoExternalId" />
|
<input bitInput type="text" formControlName="ssoExternalId" />
|
||||||
<bit-hint>{{ "ssoExternalIdDesc" | i18n }}</bit-hint>
|
<bit-hint>{{ "ssoExternalIdDesc" | i18n }}</bit-hint>
|
||||||
|
|||||||
@@ -157,28 +157,20 @@ export class MemberDialogComponent implements OnDestroy {
|
|||||||
manageResetPassword: false,
|
manageResetPassword: false,
|
||||||
});
|
});
|
||||||
|
|
||||||
protected isExternalIdVisible$ = this.configService
|
get isExternalIdVisible(): boolean {
|
||||||
.getFeatureFlag$(FeatureFlag.SsoExternalIdVisibility)
|
return !!this.formGroup.get("externalId")?.value;
|
||||||
.pipe(
|
}
|
||||||
map((isEnabled) => {
|
|
||||||
return !isEnabled || !!this.formGroup.get("externalId")?.value;
|
|
||||||
}),
|
|
||||||
);
|
|
||||||
|
|
||||||
protected isSsoExternalIdVisible$ = this.configService
|
get isSsoExternalIdVisible(): boolean {
|
||||||
.getFeatureFlag$(FeatureFlag.SsoExternalIdVisibility)
|
return !!this.formGroup.get("ssoExternalId")?.value;
|
||||||
.pipe(
|
}
|
||||||
map((isEnabled) => {
|
|
||||||
return isEnabled && !!this.formGroup.get("ssoExternalId")?.value;
|
|
||||||
}),
|
|
||||||
);
|
|
||||||
|
|
||||||
private destroy$ = new Subject<void>();
|
|
||||||
|
|
||||||
get customUserTypeSelected(): boolean {
|
get customUserTypeSelected(): boolean {
|
||||||
return this.formGroup.value.type === OrganizationUserType.Custom;
|
return this.formGroup.value.type === OrganizationUserType.Custom;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private destroy$ = new Subject<void>();
|
||||||
|
|
||||||
isEditDialogParams(
|
isEditDialogParams(
|
||||||
params: EditMemberDialogParams | AddMemberDialogParams,
|
params: EditMemberDialogParams | AddMemberDialogParams,
|
||||||
): params is EditMemberDialogParams {
|
): params is EditMemberDialogParams {
|
||||||
|
|||||||
@@ -35,7 +35,7 @@
|
|||||||
</bit-select>
|
</bit-select>
|
||||||
</bit-form-field>
|
</bit-form-field>
|
||||||
|
|
||||||
<bit-form-field *ngIf="isExternalIdVisible$ | async">
|
<bit-form-field *ngIf="isExternalIdVisible">
|
||||||
<bit-label>{{ "externalId" | i18n }}</bit-label>
|
<bit-label>{{ "externalId" | i18n }}</bit-label>
|
||||||
<input bitInput formControlName="externalId" />
|
<input bitInput formControlName="externalId" />
|
||||||
<bit-hint>{{ "externalIdDesc" | i18n }}</bit-hint>
|
<bit-hint>{{ "externalIdDesc" | i18n }}</bit-hint>
|
||||||
|
|||||||
@@ -38,7 +38,6 @@ import { getUserId } from "@bitwarden/common/auth/services/account.service";
|
|||||||
import { FeatureFlag } from "@bitwarden/common/enums/feature-flag.enum";
|
import { FeatureFlag } from "@bitwarden/common/enums/feature-flag.enum";
|
||||||
import { ConfigService } from "@bitwarden/common/platform/abstractions/config/config.service";
|
import { ConfigService } from "@bitwarden/common/platform/abstractions/config/config.service";
|
||||||
import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service";
|
import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service";
|
||||||
import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service";
|
|
||||||
import { Utils } from "@bitwarden/common/platform/misc/utils";
|
import { Utils } from "@bitwarden/common/platform/misc/utils";
|
||||||
import {
|
import {
|
||||||
DIALOG_DATA,
|
DIALOG_DATA,
|
||||||
@@ -135,7 +134,7 @@ export class CollectionDialogComponent implements OnInit, OnDestroy {
|
|||||||
protected showOrgSelector = false;
|
protected showOrgSelector = false;
|
||||||
protected formGroup = this.formBuilder.group({
|
protected formGroup = this.formBuilder.group({
|
||||||
name: ["", [Validators.required, BitValidators.forbiddenCharacters(["/"])]],
|
name: ["", [Validators.required, BitValidators.forbiddenCharacters(["/"])]],
|
||||||
externalId: "",
|
externalId: { value: "", disabled: true },
|
||||||
parent: undefined as string | undefined,
|
parent: undefined as string | undefined,
|
||||||
access: [[] as AccessItemValue[]],
|
access: [[] as AccessItemValue[]],
|
||||||
selectedOrg: "",
|
selectedOrg: "",
|
||||||
@@ -145,16 +144,6 @@ export class CollectionDialogComponent implements OnInit, OnDestroy {
|
|||||||
protected showAddAccessWarning = false;
|
protected showAddAccessWarning = false;
|
||||||
protected collections: Collection[];
|
protected collections: Collection[];
|
||||||
protected buttonDisplayName: ButtonType = ButtonType.Save;
|
protected buttonDisplayName: ButtonType = ButtonType.Save;
|
||||||
protected isExternalIdVisible$ = this.configService
|
|
||||||
.getFeatureFlag$(FeatureFlag.SsoExternalIdVisibility)
|
|
||||||
.pipe(
|
|
||||||
map((isEnabled) => {
|
|
||||||
return (
|
|
||||||
!isEnabled ||
|
|
||||||
(!!this.params.isAdminConsoleActive && !!this.formGroup.get("externalId")?.value)
|
|
||||||
);
|
|
||||||
}),
|
|
||||||
);
|
|
||||||
private orgExceedingCollectionLimit!: Organization;
|
private orgExceedingCollectionLimit!: Organization;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
@@ -165,7 +154,6 @@ export class CollectionDialogComponent implements OnInit, OnDestroy {
|
|||||||
private groupService: GroupApiService,
|
private groupService: GroupApiService,
|
||||||
private collectionAdminService: CollectionAdminService,
|
private collectionAdminService: CollectionAdminService,
|
||||||
private i18nService: I18nService,
|
private i18nService: I18nService,
|
||||||
private platformUtilsService: PlatformUtilsService,
|
|
||||||
private organizationUserApiService: OrganizationUserApiService,
|
private organizationUserApiService: OrganizationUserApiService,
|
||||||
private dialogService: DialogService,
|
private dialogService: DialogService,
|
||||||
private changeDetectorRef: ChangeDetectorRef,
|
private changeDetectorRef: ChangeDetectorRef,
|
||||||
@@ -354,6 +342,10 @@ export class CollectionDialogComponent implements OnInit, OnDestroy {
|
|||||||
return this.formGroup.controls.selectedOrg;
|
return this.formGroup.controls.selectedOrg;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected get isExternalIdVisible(): boolean {
|
||||||
|
return this.params.isAdminConsoleActive && !!this.formGroup.get("externalId")?.value;
|
||||||
|
}
|
||||||
|
|
||||||
protected get collectionId() {
|
protected get collectionId() {
|
||||||
return this.params.collectionId;
|
return this.params.collectionId;
|
||||||
}
|
}
|
||||||
@@ -490,23 +482,10 @@ export class CollectionDialogComponent implements OnInit, OnDestroy {
|
|||||||
private handleFormGroupReadonly(readonly: boolean) {
|
private handleFormGroupReadonly(readonly: boolean) {
|
||||||
if (readonly) {
|
if (readonly) {
|
||||||
this.formGroup.controls.name.disable();
|
this.formGroup.controls.name.disable();
|
||||||
this.formGroup.controls.externalId.disable();
|
|
||||||
this.formGroup.controls.parent.disable();
|
this.formGroup.controls.parent.disable();
|
||||||
this.formGroup.controls.access.disable();
|
this.formGroup.controls.access.disable();
|
||||||
} else {
|
} else {
|
||||||
this.formGroup.controls.name.enable();
|
this.formGroup.controls.name.enable();
|
||||||
|
|
||||||
this.configService
|
|
||||||
.getFeatureFlag$(FeatureFlag.SsoExternalIdVisibility)
|
|
||||||
.pipe(takeUntil(this.destroy$))
|
|
||||||
.subscribe((isEnabled) => {
|
|
||||||
if (isEnabled) {
|
|
||||||
this.formGroup.controls.externalId.disable();
|
|
||||||
} else {
|
|
||||||
this.formGroup.controls.externalId.enable();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
this.formGroup.controls.parent.enable();
|
this.formGroup.controls.parent.enable();
|
||||||
this.formGroup.controls.access.enable();
|
this.formGroup.controls.access.enable();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,7 +12,6 @@ import { ServerConfig } from "../platform/abstractions/config/server-config";
|
|||||||
export enum FeatureFlag {
|
export enum FeatureFlag {
|
||||||
/* Admin Console Team */
|
/* Admin Console Team */
|
||||||
LimitItemDeletion = "pm-15493-restrict-item-deletion-to-can-manage-permission",
|
LimitItemDeletion = "pm-15493-restrict-item-deletion-to-can-manage-permission",
|
||||||
SsoExternalIdVisibility = "pm-18630-sso-external-id-visibility",
|
|
||||||
AccountDeprovisioningBanner = "pm-17120-account-deprovisioning-admin-console-banner",
|
AccountDeprovisioningBanner = "pm-17120-account-deprovisioning-admin-console-banner",
|
||||||
SeparateCustomRolePermissions = "pm-19917-separate-custom-role-permissions",
|
SeparateCustomRolePermissions = "pm-19917-separate-custom-role-permissions",
|
||||||
|
|
||||||
@@ -83,7 +82,6 @@ const FALSE = false as boolean;
|
|||||||
export const DefaultFeatureFlagValue = {
|
export const DefaultFeatureFlagValue = {
|
||||||
/* Admin Console Team */
|
/* Admin Console Team */
|
||||||
[FeatureFlag.LimitItemDeletion]: FALSE,
|
[FeatureFlag.LimitItemDeletion]: FALSE,
|
||||||
[FeatureFlag.SsoExternalIdVisibility]: FALSE,
|
|
||||||
[FeatureFlag.AccountDeprovisioningBanner]: FALSE,
|
[FeatureFlag.AccountDeprovisioningBanner]: FALSE,
|
||||||
[FeatureFlag.SeparateCustomRolePermissions]: FALSE,
|
[FeatureFlag.SeparateCustomRolePermissions]: FALSE,
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user