mirror of
https://github.com/bitwarden/browser
synced 2025-12-16 08:13:42 +00:00
billing updates
This commit is contained in:
@@ -63,14 +63,14 @@
|
||||
<button type="button" class="btn btn-outline-secondary" (click)="updateLicense()">
|
||||
{{'updateLicense' | i18n}}
|
||||
</button>
|
||||
<a href="https://vault.bitwarden.com/#/settings/billing" target="_blank" rel="noopener" class="btn btn-outline-secondary">
|
||||
<a href="https://vault.bitwarden.com" target="_blank" rel="noopener" class="btn btn-outline-secondary">
|
||||
{{'manageSubscription' | i18n}}
|
||||
</a>
|
||||
</div>
|
||||
<div class="card mt-3" *ngIf="showUpdateLicense">
|
||||
<div class="card-body">
|
||||
<h3 class="card-body-header">{{'updateLicense' | i18n}}</h3>
|
||||
<app-update-license [user]="false" (onUpdated)="closeUpdateLicense(true)" (onCanceled)="closeUpdateLicense(false)"></app-update-license>
|
||||
<app-update-license [organizationId]="organizationId" (onUpdated)="closeUpdateLicense(true)" (onCanceled)="closeUpdateLicense(false)"></app-update-license>
|
||||
</div>
|
||||
</div>
|
||||
</ng-container>
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
<form #form (ngSubmit)="submit()" [appApiAction]="formPromise" ngNativeValidate>
|
||||
<div class="form-group">
|
||||
<label for="file">{{'licenseFile' | i18n}}</label>
|
||||
<label for="file" class="sr-only">{{'licenseFile' | i18n}}</label>
|
||||
<input type="file" id="file" class="form-control-file" name="file" required>
|
||||
<small class="form-text text-muted">{{'licenseFileDesc' | i18n : (user ? 'bitwarden_premium_license.json' : 'bitwarden_organization_license.json')}}</small>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary btn-submit" [disabled]="form.loading">
|
||||
<i class="fa fa-spinner fa-spin"></i>
|
||||
<i class="fa fa-spinner fa-spin" title="{{'loading' | i18n}}"></i>
|
||||
<span>{{'submit' | i18n}}</span>
|
||||
</button>
|
||||
<button type="button" class="btn btn-outline-secondary" (click)="cancel()">
|
||||
|
||||
@@ -16,7 +16,7 @@ import { I18nService } from 'jslib/abstractions/i18n.service';
|
||||
templateUrl: 'update-license.component.html',
|
||||
})
|
||||
export class UpdateLicenseComponent {
|
||||
@Input() user = true;
|
||||
@Input() organizationId: string;
|
||||
@Output() onUpdated = new EventEmitter();
|
||||
@Output() onCanceled = new EventEmitter();
|
||||
|
||||
@@ -38,10 +38,10 @@ export class UpdateLicenseComponent {
|
||||
const fd = new FormData();
|
||||
fd.append('license', files[0]);
|
||||
|
||||
if (this.user) {
|
||||
if (this.organizationId == null) {
|
||||
this.formPromise = this.apiService.postAccountLicense(fd);
|
||||
} else {
|
||||
// TODO
|
||||
this.formPromise = this.apiService.postOrganizationLicenseUpdate(this.organizationId, fd);
|
||||
}
|
||||
|
||||
await this.formPromise;
|
||||
|
||||
@@ -17,6 +17,10 @@
|
||||
<span>{{'reinstateSubscription' | i18n}}</span>
|
||||
</button>
|
||||
</app-callout>
|
||||
<dl>
|
||||
<dt>{{'subscription' | i18n}}</dt>
|
||||
<dd>{{'premiumMembership' | i18n}}</dd>
|
||||
</dl>
|
||||
<dl *ngIf="selfHosted">
|
||||
<dt>{{'expiration' | i18n}}</dt>
|
||||
<dd *ngIf="billing.expiration">{{billing.expiration | date:'mediumDate'}}</dd>
|
||||
@@ -64,7 +68,7 @@
|
||||
<div class="card mt-3" *ngIf="showUpdateLicense">
|
||||
<div class="card-body">
|
||||
<h3 class="card-body-header">{{'updateLicense' | i18n}}</h3>
|
||||
<app-update-license [user]="true" (onUpdated)="closeUpdateLicense(true)" (onCanceled)="closeUpdateLicense(false)"></app-update-license>
|
||||
<app-update-license (onUpdated)="closeUpdateLicense(true)" (onCanceled)="closeUpdateLicense(false)"></app-update-license>
|
||||
</div>
|
||||
</div>
|
||||
</ng-container>
|
||||
|
||||
Reference in New Issue
Block a user