1
0
mirror of https://github.com/bitwarden/web synced 2025-12-06 00:03:28 +00:00

download license for org

This commit is contained in:
Kyle Spearrin
2018-07-17 11:25:41 -04:00
parent 6fcda290c7
commit e4f12ed47f
4 changed files with 22 additions and 4 deletions

2
jslib

Submodule jslib updated: 9c0b4b8973...4228277d23

View File

@@ -79,8 +79,10 @@
<button type="button" class="btn btn-outline-secondary" (click)="changePlan()"> <button type="button" class="btn btn-outline-secondary" (click)="changePlan()">
{{'changeBillingPlan' | i18n}} {{'changeBillingPlan' | i18n}}
</button> </button>
<button type="button" class="btn btn-outline-secondary ml-1" (click)="downloadLicense()" *ngIf="subscription && !subscription.cancelled"> <button type="button" class="btn btn-outline-secondary btn-submit ml-1" #licenseBtn [appApiAction]="licensePromise" [disabled]="licenseBtn.loading"
{{'downloadLicense' | i18n}} (click)="downloadLicense()" *ngIf="subscription && !subscription.cancelled">
<i class="fa fa-spinner fa-spin"></i>
<span>{{'downloadLicense' | i18n}}</span>
</button> </button>
<button #cancelBtn type="button" class="btn btn-outline-danger btn-submit ml-auto" (click)="cancel()" [appApiAction]="cancelPromise" <button #cancelBtn type="button" class="btn btn-outline-danger btn-submit ml-auto" (click)="cancel()" [appApiAction]="cancelPromise"
[disabled]="cancelBtn.loading" *ngIf="subscription && !subscription.cancelled && !subscriptionMarkedForCancel"> [disabled]="cancelBtn.loading" *ngIf="subscription && !subscription.cancelled && !subscriptionMarkedForCancel">

View File

@@ -40,6 +40,7 @@ export class OrganizationBillingComponent implements OnInit {
cancelPromise: Promise<any>; cancelPromise: Promise<any>;
reinstatePromise: Promise<any>; reinstatePromise: Promise<any>;
licensePromise: Promise<any>;
constructor(private tokenService: TokenService, private apiService: ApiService, constructor(private tokenService: TokenService, private apiService: ApiService,
private platformUtilsService: PlatformUtilsService, private i18nService: I18nService, private platformUtilsService: PlatformUtilsService, private i18nService: I18nService,
@@ -113,10 +114,22 @@ export class OrganizationBillingComponent implements OnInit {
} }
} }
downloadLicense() { async downloadLicense() {
if (this.loading) { if (this.loading) {
return; return;
} }
const installationId = window.prompt(this.i18nService.t('enterInstallationId'));
if (installationId == null || installationId === '') {
return;
}
try {
this.licensePromise = this.apiService.getOrganizationLicense(this.organizationId, installationId);
const license = await this.licensePromise;
const licenseString = JSON.stringify(license, null, 2);
this.platformUtilsService.saveFile(window, licenseString, null, 'bitwarden_organization_license.json');
} catch { }
} }
updateLicense() { updateLicense() {

View File

@@ -2219,5 +2219,8 @@
}, },
"bankAccountTypeIndividual": { "bankAccountTypeIndividual": {
"message": "Individual (Personal)" "message": "Individual (Personal)"
},
"enterInstallationId": {
"message": "Enter your installation id"
} }
} }