mirror of
https://github.com/bitwarden/browser
synced 2025-12-18 17:23:37 +00:00
[AC-1139] Moved override logic from syncService to organizationService
This commit is contained in:
@@ -9,6 +9,8 @@ import { Organization } from "@bitwarden/common/admin-console/models/domain/orga
|
||||
import { SecretsManagerSubscribeRequest } from "@bitwarden/common/billing/models/request/sm-subscribe.request";
|
||||
import { BillingCustomerDiscount } from "@bitwarden/common/billing/models/response/organization-subscription.response";
|
||||
import { PlanResponse } from "@bitwarden/common/billing/models/response/plan.response";
|
||||
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";
|
||||
|
||||
@@ -32,7 +34,8 @@ export class SecretsManagerSubscribeStandaloneComponent {
|
||||
private platformUtilsService: PlatformUtilsService,
|
||||
private i18nService: I18nService,
|
||||
private organizationApiService: OrganizationApiServiceAbstraction,
|
||||
private organizationService: InternalOrganizationServiceAbstraction
|
||||
private organizationService: InternalOrganizationServiceAbstraction,
|
||||
private configService: ConfigServiceAbstraction,
|
||||
) {}
|
||||
|
||||
submit = async () => {
|
||||
@@ -46,13 +49,17 @@ export class SecretsManagerSubscribeStandaloneComponent {
|
||||
|
||||
const profileOrganization = await this.organizationApiService.subscribeToSecretsManager(
|
||||
this.organization.id,
|
||||
request
|
||||
request,
|
||||
);
|
||||
const organizationData = new OrganizationData(profileOrganization, {
|
||||
isMember: this.organization.isMember,
|
||||
isProviderUser: this.organization.isProviderUser,
|
||||
});
|
||||
await this.organizationService.upsert(organizationData);
|
||||
const flexibleCollectionsEnabled = await this.configService.getFeatureFlag(
|
||||
FeatureFlag.FlexibleCollections,
|
||||
false,
|
||||
);
|
||||
await this.organizationService.upsert(organizationData, flexibleCollectionsEnabled);
|
||||
|
||||
/*
|
||||
Because subscribing to Secrets Manager automatically provides access to Secrets Manager for the
|
||||
@@ -63,7 +70,7 @@ export class SecretsManagerSubscribeStandaloneComponent {
|
||||
this.platformUtilsService.showToast(
|
||||
"success",
|
||||
null,
|
||||
this.i18nService.t("subscribedToSecretsManager")
|
||||
this.i18nService.t("subscribedToSecretsManager"),
|
||||
);
|
||||
|
||||
this.onSubscribe.emit();
|
||||
|
||||
Reference in New Issue
Block a user