1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-12 14:23:32 +00:00
Files
browser/apps/web/src/app/billing/shared/update-license-dialog.component.ts
Will Martin 76cb3fd38d [CL-623] export CDK dialog deps from libs/components (#14074)
* add cdk dialog deps to CL dialog barrel file

* find and replace cdk dialog import

* run prettier
2025-04-02 15:08:38 -04:00

54 lines
1.8 KiB
TypeScript

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 { DialogRef, DialogService, ToastService } 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,
toastService: ToastService,
) {
super(
apiService,
i18nService,
platformUtilsService,
organizationApiService,
formBuilder,
toastService,
);
}
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);
}
}