mirror of
https://github.com/bitwarden/browser
synced 2026-01-16 07:23:40 +00:00
47 lines
1.7 KiB
TypeScript
47 lines
1.7 KiB
TypeScript
import { DialogRef } from "@angular/cdk/dialog";
|
|
import { Component } from "@angular/core";
|
|
import { FormBuilder } from "@angular/forms";
|
|
|
|
import { ApiService } from "@bitwarden/common/abstractions/api.service";
|
|
import { OrganizationApiServiceAbstraction } from "@bitwarden/common/admin-console/abstractions/organization/organization-api.service.abstraction";
|
|
import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service";
|
|
import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service";
|
|
import { DialogService } from "@bitwarden/components";
|
|
|
|
import { UpdateLicenseDialogResult } from "./update-license-types";
|
|
import { UpdateLicenseComponent } from "./update-license.component";
|
|
|
|
@Component({
|
|
templateUrl: "update-license-dialog.component.html",
|
|
})
|
|
export class UpdateLicenseDialogComponent extends UpdateLicenseComponent {
|
|
constructor(
|
|
private dialogRef: DialogRef,
|
|
apiService: ApiService,
|
|
i18nService: I18nService,
|
|
platformUtilsService: PlatformUtilsService,
|
|
organizationApiService: OrganizationApiServiceAbstraction,
|
|
formBuilder: FormBuilder,
|
|
) {
|
|
super(apiService, i18nService, platformUtilsService, organizationApiService, formBuilder);
|
|
}
|
|
async submitLicense() {
|
|
const result = await this.submit();
|
|
if (result === UpdateLicenseDialogResult.Updated) {
|
|
this.dialogRef.close(UpdateLicenseDialogResult.Updated);
|
|
}
|
|
}
|
|
|
|
submitLicenseDialog = async () => {
|
|
await this.submitLicense();
|
|
};
|
|
|
|
cancel = async () => {
|
|
await this.cancel();
|
|
this.dialogRef.close(UpdateLicenseDialogResult.Cancelled);
|
|
};
|
|
static open(dialogService: DialogService) {
|
|
return dialogService.open<UpdateLicenseDialogResult>(UpdateLicenseDialogComponent);
|
|
}
|
|
}
|