Tools/pm 4440 replace lastpass sso dialog (#7608)
* Initial implementation of simple dialog * Updating buttons and dialog type * Set the cancel text normally * Removing the lastpass sso dialog component
This commit is contained in:
parent
0bcb45ed5c
commit
ec7c3878c9
|
@ -1,3 +1,2 @@
|
|||
export { LastPassAwaitSSODialogComponent } from "./lastpass-await-sso-dialog.component";
|
||||
export { LastPassMultifactorPromptComponent } from "./lastpass-multifactor-prompt.component";
|
||||
export { LastPassPasswordPromptComponent } from "./lastpass-password-prompt.component";
|
||||
|
|
|
@ -1,14 +0,0 @@
|
|||
<bit-simple-dialog>
|
||||
<div bitDialogIcon>
|
||||
<i class="bwi bwi-key bwi-2x tw-text-warning" aria-hidden="true"></i>
|
||||
</div>
|
||||
<span bitDialogTitle>{{ "awaitingSSO" | i18n }}</span>
|
||||
<span bitDialogContent>
|
||||
{{ "awaitingSSODesc" | i18n }}
|
||||
</span>
|
||||
<ng-container bitDialogFooter>
|
||||
<button bitButton type="button" buttonType="secondary" [bitDialogClose]="true">
|
||||
{{ "cancel" | i18n }}
|
||||
</button>
|
||||
</ng-container>
|
||||
</bit-simple-dialog>
|
|
@ -1,15 +0,0 @@
|
|||
import { Component } from "@angular/core";
|
||||
|
||||
import { JslibModule } from "@bitwarden/angular/jslib.module";
|
||||
import { ButtonModule, DialogModule, DialogService } from "@bitwarden/components";
|
||||
|
||||
@Component({
|
||||
templateUrl: "lastpass-await-sso-dialog.component.html",
|
||||
standalone: true,
|
||||
imports: [JslibModule, ButtonModule, DialogModule],
|
||||
})
|
||||
export class LastPassAwaitSSODialogComponent {
|
||||
static open(dialogService: DialogService) {
|
||||
return dialogService.open<boolean>(LastPassAwaitSSODialogComponent);
|
||||
}
|
||||
}
|
|
@ -8,6 +8,7 @@ import { AppIdService } from "@bitwarden/common/platform/abstractions/app-id.ser
|
|||
import { BroadcasterService } from "@bitwarden/common/platform/abstractions/broadcaster.service";
|
||||
import { CryptoFunctionService } from "@bitwarden/common/platform/abstractions/crypto-function.service";
|
||||
import { EnvironmentService } from "@bitwarden/common/platform/abstractions/environment.service";
|
||||
import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service";
|
||||
import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service";
|
||||
import { Utils } from "@bitwarden/common/platform/misc/utils";
|
||||
import { PasswordGenerationServiceAbstraction } from "@bitwarden/common/tools/generator/password";
|
||||
|
@ -16,7 +17,6 @@ import { DialogService } from "../../../../components/src/dialog";
|
|||
import { ClientInfo, Vault } from "../../importers/lastpass/access";
|
||||
import { FederatedUserContext } from "../../importers/lastpass/access/models";
|
||||
|
||||
import { LastPassAwaitSSODialogComponent } from "./dialog/lastpass-await-sso-dialog.component";
|
||||
import { LastPassPasswordPromptComponent } from "./dialog/lastpass-password-prompt.component";
|
||||
import { LastPassDirectImportUIService } from "./lastpass-direct-import-ui.service";
|
||||
|
||||
|
@ -42,6 +42,7 @@ export class LastPassDirectImportService {
|
|||
private broadcasterService: BroadcasterService,
|
||||
private ngZone: NgZone,
|
||||
private dialogService: DialogService,
|
||||
private i18nService: I18nService,
|
||||
) {
|
||||
this.vault = new Vault(this.cryptoFunctionService, this.tokenService);
|
||||
|
||||
|
@ -96,7 +97,14 @@ export class LastPassDirectImportService {
|
|||
const request = await this.createOidcSigninRequest(email);
|
||||
this.platformUtilsService.launchUri(request.url);
|
||||
|
||||
const cancelDialogRef = LastPassAwaitSSODialogComponent.open(this.dialogService);
|
||||
const cancelDialogRef = this.dialogService.openSimpleDialogRef({
|
||||
title: this.i18nService.t("awaitingSSO"),
|
||||
content: this.i18nService.t("awaitingSSODesc"),
|
||||
type: "warning",
|
||||
icon: "bwi-key",
|
||||
acceptButtonText: this.i18nService.t("cancel"),
|
||||
cancelButtonText: null,
|
||||
});
|
||||
const cancelled = firstValueFrom(cancelDialogRef.closed).then((_didCancel) => {
|
||||
throw Error("SSO auth cancelled");
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue