1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-16 08:13:42 +00:00

[AC-2027] Update Flexible Collections logic to use organization property (#7445)

* Remove unused feature flag

* Replace feature flag ref with org flag

* Remove deprecated feature flag to discourage use

* Add check to org.canCreateNewCollections

* Adjust init logic of components to avoid race conditions

* Make canCreateNewCollections logic more explicit

* Resolve merge conflicts with vault changes

* Update comments

* Remove uses of old feature flag

* Remove last of old feature flag

* Clean up feature flag

* Fix linting

* Fix linting
This commit is contained in:
Thomas Rittson
2024-01-17 22:33:39 +10:00
committed by GitHub
parent 160a636fa0
commit ee4aa31444
32 changed files with 80 additions and 216 deletions

View File

@@ -1,13 +1,11 @@
import { DIALOG_DATA, DialogConfig, DialogRef } from "@angular/cdk/dialog";
import { Component, Inject, OnDestroy } from "@angular/core";
import { FormBuilder } from "@angular/forms";
import { combineLatest, of, Subject, switchMap, takeUntil } from "rxjs";
import { combineLatest, map, of, Subject, switchMap, takeUntil } from "rxjs";
import { OrganizationService } from "@bitwarden/common/admin-console/abstractions/organization/organization.service.abstraction";
import { OrganizationUserService } from "@bitwarden/common/admin-console/abstractions/organization-user/organization-user.service";
import { Organization } from "@bitwarden/common/admin-console/models/domain/organization";
import { FeatureFlag } from "@bitwarden/common/enums/feature-flag.enum";
import { ConfigServiceAbstraction } from "@bitwarden/common/platform/abstractions/config/config.service.abstraction";
import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service";
import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service";
import { CollectionView } from "@bitwarden/common/vault/models/view/collection.view";
@@ -44,10 +42,9 @@ export enum BulkCollectionsDialogResult {
standalone: true,
})
export class BulkCollectionsDialogComponent implements OnDestroy {
protected flexibleCollectionsEnabled$ = this.configService.getFeatureFlag$(
FeatureFlag.FlexibleCollections,
false,
);
protected flexibleCollectionsEnabled$ = this.organizationService
.get$(this.params.organizationId)
.pipe(map((o) => o?.flexibleCollections));
protected readonly PermissionMode = PermissionMode;
@@ -71,7 +68,6 @@ export class BulkCollectionsDialogComponent implements OnDestroy {
private platformUtilsService: PlatformUtilsService,
private i18nService: I18nService,
private collectionAdminService: CollectionAdminService,
private configService: ConfigServiceAbstraction,
) {
this.numCollections = this.params.collections.length;
const organization$ = this.organizationService.get$(this.params.organizationId);