mirror of
https://github.com/bitwarden/browser
synced 2025-12-22 03:03:43 +00:00
[EC-826] Merge license sync feature branch to master (#4503)
* [EC-816] Separate cloud and selfhosted subscription components (#4383) * [EC-636] Add license sync to web vault (#4441) * [EC-1036] Show correct last license sync date (#4558) * [EC-1044] Fix: accidentally changed shared i18n string
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
import { Component } from "@angular/core";
|
||||
|
||||
import { ModalRef } from "@bitwarden/angular/components/modal/modal.ref";
|
||||
import { ModalConfig } from "@bitwarden/angular/services/modal.service";
|
||||
import { ApiService } from "@bitwarden/common/abstractions/api.service";
|
||||
import { LogService } from "@bitwarden/common/abstractions/log.service";
|
||||
import { OrganizationConnectionType } from "@bitwarden/common/enums/organizationConnectionType";
|
||||
@@ -8,6 +10,13 @@ import { BillingSyncConfigRequest } from "@bitwarden/common/models/request/billi
|
||||
import { OrganizationConnectionRequest } from "@bitwarden/common/models/request/organization-connection.request";
|
||||
import { OrganizationConnectionResponse } from "@bitwarden/common/models/response/organization-connection.response";
|
||||
|
||||
export interface BillingSyncKeyModalData {
|
||||
entityId: string;
|
||||
existingConnectionId: string;
|
||||
billingSyncKey: string;
|
||||
setParentConnection: (connection: OrganizationConnectionResponse<BillingSyncConfigApi>) => void;
|
||||
}
|
||||
|
||||
@Component({
|
||||
selector: "app-billing-sync-key",
|
||||
templateUrl: "billing-sync-key.component.html",
|
||||
@@ -20,7 +29,17 @@ export class BillingSyncKeyComponent {
|
||||
|
||||
formPromise: Promise<OrganizationConnectionResponse<BillingSyncConfigApi>> | Promise<void>;
|
||||
|
||||
constructor(private apiService: ApiService, private logService: LogService) {}
|
||||
constructor(
|
||||
private apiService: ApiService,
|
||||
private logService: LogService,
|
||||
protected modalRef: ModalRef,
|
||||
config: ModalConfig<BillingSyncKeyModalData>
|
||||
) {
|
||||
this.entityId = config.data.entityId;
|
||||
this.existingConnectionId = config.data.existingConnectionId;
|
||||
this.billingSyncKey = config.data.billingSyncKey;
|
||||
this.setParentConnection = config.data.setParentConnection;
|
||||
}
|
||||
|
||||
async submit() {
|
||||
try {
|
||||
@@ -47,6 +66,7 @@ export class BillingSyncKeyComponent {
|
||||
this.existingConnectionId = response?.id;
|
||||
this.billingSyncKey = response?.config?.billingSyncKey;
|
||||
this.setParentConnection(response);
|
||||
this.modalRef.close();
|
||||
} catch (e) {
|
||||
this.logService.error(e);
|
||||
}
|
||||
@@ -56,5 +76,6 @@ export class BillingSyncKeyComponent {
|
||||
this.formPromise = this.apiService.deleteOrganizationConnection(this.existingConnectionId);
|
||||
await this.formPromise;
|
||||
this.setParentConnection(null);
|
||||
this.modalRef.close();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
<i class="bwi bwi-spinner bwi-spin" title="{{ 'loading' | i18n }}" aria-hidden="true"></i>
|
||||
<span>{{ "submit" | i18n }}</span>
|
||||
</button>
|
||||
<button type="button" class="btn btn-outline-secondary" (click)="cancel()">
|
||||
<button *ngIf="showCancel" type="button" class="btn btn-outline-secondary" (click)="cancel()">
|
||||
{{ "cancel" | i18n }}
|
||||
</button>
|
||||
</form>
|
||||
|
||||
@@ -12,6 +12,7 @@ import { PlatformUtilsService } from "@bitwarden/common/abstractions/platformUti
|
||||
})
|
||||
export class UpdateLicenseComponent {
|
||||
@Input() organizationId: string;
|
||||
@Input() showCancel = true;
|
||||
@Output() onUpdated = new EventEmitter();
|
||||
@Output() onCanceled = new EventEmitter();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user