mirror of
https://github.com/bitwarden/browser.git
synced 2024-12-02 13:23:29 +01:00
[AC-1418] Add SM subscription adjust form and logic to hide it
This commit is contained in:
parent
202cf8614e
commit
69b65ea2a8
@ -177,6 +177,14 @@
|
|||||||
></app-adjust-storage>
|
></app-adjust-storage>
|
||||||
</div>
|
</div>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
<ng-container *ngIf="showAdjustSecretsManager">
|
||||||
|
<h3 bitTypography="h3" class="tw-mt-7">{{ "secretsManager" | i18n }}</h3>
|
||||||
|
<app-sm-adjust-subscription
|
||||||
|
[organizationId]="organizationId"
|
||||||
|
[options]="smOptions"
|
||||||
|
(onAdjusted)="subscriptionAdjusted()"
|
||||||
|
></app-sm-adjust-subscription>
|
||||||
|
</ng-container>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
|
||||||
<h2 bitTypography="h2" class="tw-mt-7">{{ "selfHostingTitle" | i18n }}</h2>
|
<h2 bitTypography="h2" class="tw-mt-7">{{ "selfHostingTitle" | i18n }}</h2>
|
||||||
|
@ -21,6 +21,7 @@ import {
|
|||||||
BillingSyncApiKeyComponent,
|
BillingSyncApiKeyComponent,
|
||||||
BillingSyncApiModalData,
|
BillingSyncApiModalData,
|
||||||
} from "./billing-sync-api-key.component";
|
} from "./billing-sync-api-key.component";
|
||||||
|
import { SecretsManagerSubscriptionOptions } from "./secrets-manager/sm-adjust-subscription.component";
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: "app-org-subscription-cloud",
|
selector: "app-org-subscription-cloud",
|
||||||
@ -36,6 +37,7 @@ export class OrganizationSubscriptionCloudComponent implements OnInit, OnDestroy
|
|||||||
adjustStorageAdd = true;
|
adjustStorageAdd = true;
|
||||||
showAdjustStorage = false;
|
showAdjustStorage = false;
|
||||||
hasBillingSyncToken: boolean;
|
hasBillingSyncToken: boolean;
|
||||||
|
showAdjustSecretsManager = false;
|
||||||
|
|
||||||
firstLoaded = false;
|
firstLoaded = false;
|
||||||
loading: boolean;
|
loading: boolean;
|
||||||
@ -105,6 +107,14 @@ export class OrganizationSubscriptionCloudComponent implements OnInit, OnDestroy
|
|||||||
(i) => i.keyType === OrganizationApiKeyType.BillingSync
|
(i) => i.keyType === OrganizationApiKeyType.BillingSync
|
||||||
);
|
);
|
||||||
|
|
||||||
|
this.showAdjustSecretsManager =
|
||||||
|
this.userOrg.canEditSubscription &&
|
||||||
|
this.userOrg.useSecretsManager &&
|
||||||
|
this.sub.secretsManagerPlan != null &&
|
||||||
|
this.sub.secretsManagerPlan.hasAdditionalSeatsOption &&
|
||||||
|
!this.subscription.cancelled &&
|
||||||
|
!this.subscriptionMarkedForCancel;
|
||||||
|
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -153,6 +163,19 @@ export class OrganizationSubscriptionCloudComponent implements OnInit, OnDestroy
|
|||||||
return this.sub.seats;
|
return this.sub.seats;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get smOptions(): SecretsManagerSubscriptionOptions {
|
||||||
|
return {
|
||||||
|
seatCount: this.sub.smSeats,
|
||||||
|
seatLimit: this.sub.maxAutoscaleSmSeats,
|
||||||
|
seatPrice: this.sub.secretsManagerPlan.seatPrice,
|
||||||
|
serviceAccountLimit: this.sub.maxAutoscaleSmServiceAccounts,
|
||||||
|
serviceAccountCount: this.sub.smServiceAccounts,
|
||||||
|
interval: this.billingInterval,
|
||||||
|
additionalServiceAccountPrice: this.sub.secretsManagerPlan.additionalPricePerServiceAccount,
|
||||||
|
baseServiceAccountCount: this.sub.secretsManagerPlan.baseServiceAccount,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
get maxAutoscaleSeats() {
|
get maxAutoscaleSeats() {
|
||||||
return this.sub.maxAutoscaleSeats;
|
return this.sub.maxAutoscaleSeats;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user