1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-11 22:03:36 +00:00

Revert "Upload license dialog not closing bug fix (#9588)" (#9602)

This reverts commit bece072086.
This commit is contained in:
Conner Turnbull
2024-06-12 11:22:46 -04:00
committed by GitHub
parent 6233100754
commit a7912ad10c
2 changed files with 17 additions and 30 deletions

View File

@@ -1,4 +1,3 @@
import { DialogRef } from "@angular/cdk/dialog";
import { Component } from "@angular/core"; import { Component } from "@angular/core";
import { FormBuilder } from "@angular/forms"; import { FormBuilder } from "@angular/forms";
@@ -24,16 +23,8 @@ export class UpdateLicenseDialogComponent extends UpdateLicenseComponent {
platformUtilsService: PlatformUtilsService, platformUtilsService: PlatformUtilsService,
organizationApiService: OrganizationApiServiceAbstraction, organizationApiService: OrganizationApiServiceAbstraction,
formBuilder: FormBuilder, formBuilder: FormBuilder,
dialogRef: DialogRef<UpdateLicenseDialogResult>, // Add this line
) { ) {
super( super(apiService, i18nService, platformUtilsService, organizationApiService, formBuilder);
apiService,
i18nService,
platformUtilsService,
organizationApiService,
formBuilder,
dialogRef,
);
} }
async submitLicense() { async submitLicense() {
await this.submit(); await this.submit();

View File

@@ -1,4 +1,3 @@
import { DialogRef } from "@angular/cdk/dialog";
import { Component, EventEmitter, Input, Output } from "@angular/core"; import { Component, EventEmitter, Input, Output } from "@angular/core";
import { FormBuilder, Validators } from "@angular/forms"; import { FormBuilder, Validators } from "@angular/forms";
@@ -7,7 +6,6 @@ import { OrganizationApiServiceAbstraction } from "@bitwarden/common/admin-conso
import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service"; import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service";
import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service"; import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service";
import { UpdateLicenseDialogResult } from "./update-license-dialog.component";
@Component({ @Component({
selector: "app-update-license", selector: "app-update-license",
templateUrl: "update-license.component.html", templateUrl: "update-license.component.html",
@@ -30,7 +28,6 @@ export class UpdateLicenseComponent {
private platformUtilsService: PlatformUtilsService, private platformUtilsService: PlatformUtilsService,
private organizationApiService: OrganizationApiServiceAbstraction, private organizationApiService: OrganizationApiServiceAbstraction,
private formBuilder: FormBuilder, private formBuilder: FormBuilder,
private dialogRef: DialogRef<UpdateLicenseDialogResult>,
) {} ) {}
protected setSelectedFile(event: Event) { protected setSelectedFile(event: Event) {
const fileInputEl = <HTMLInputElement>event.target; const fileInputEl = <HTMLInputElement>event.target;
@@ -54,25 +51,24 @@ export class UpdateLicenseComponent {
const fd = new FormData(); const fd = new FormData();
fd.append("license", files); fd.append("license", files);
// let updatePromise: Promise<void | unknown> = null; let updatePromise: Promise<void | unknown> = null;
// if (this.organizationId == null) { if (this.organizationId == null) {
// updatePromise = this.apiService.postAccountLicense(fd); updatePromise = this.apiService.postAccountLicense(fd);
// } else { } else {
// updatePromise = this.organizationApiService.updateLicense(this.organizationId, fd); updatePromise = this.organizationApiService.updateLicense(this.organizationId, fd);
// } }
// this.formPromise = updatePromise.then(() => { this.formPromise = updatePromise.then(() => {
// return this.apiService.refreshIdentityToken(); return this.apiService.refreshIdentityToken();
// }); });
// await this.formPromise; await this.formPromise;
// this.platformUtilsService.showToast( this.platformUtilsService.showToast(
// "success", "success",
// null, null,
// this.i18nService.t("licenseUploadSuccess"), this.i18nService.t("licenseUploadSuccess"),
// ); );
// this.onUpdated.emit(); this.onUpdated.emit();
this.dialogRef.close(UpdateLicenseDialogResult.Updated);
}; };
cancel = () => { cancel = () => {