From 44fd063dc16c44903e0aaa4b0b59ce349d66b9e9 Mon Sep 17 00:00:00 2001 From: aj-rosado <109146700+aj-rosado@users.noreply.github.com> Date: Mon, 15 May 2023 12:01:28 +0100 Subject: [PATCH] [PM-2054] Updated Password Generator History to use Component Library on Web (#5414) * [PM-2054] Updated Password Generator History to use Component Library * [PM-2054] Corrected paddings * [PM-2054] Added missing type to buttons * [PM-2054] Removed unused imports and run prettier * [PM-2054] Swap list by bit-table --- apps/web/src/app/tools/generator.component.ts | 11 +- .../password-generator-history.component.html | 104 ++++++++---------- .../password-generator-history.component.ts | 6 +- 3 files changed, 53 insertions(+), 68 deletions(-) diff --git a/apps/web/src/app/tools/generator.component.ts b/apps/web/src/app/tools/generator.component.ts index 22a99e03fa9..6587fc5d8a2 100644 --- a/apps/web/src/app/tools/generator.component.ts +++ b/apps/web/src/app/tools/generator.component.ts @@ -1,7 +1,7 @@ -import { Component, ViewChild, ViewContainerRef } from "@angular/core"; +import { Component } from "@angular/core"; import { ActivatedRoute } from "@angular/router"; -import { ModalService } from "@bitwarden/angular/services/modal.service"; +import { DialogServiceAbstraction } from "@bitwarden/angular/services/dialog"; import { GeneratorComponent as BaseGeneratorComponent } from "@bitwarden/angular/tools/generator/components/generator.component"; import { I18nService } from "@bitwarden/common/abstractions/i18n.service"; import { LogService } from "@bitwarden/common/abstractions/log.service"; @@ -17,9 +17,6 @@ import { PasswordGeneratorHistoryComponent } from "./password-generator-history. templateUrl: "generator.component.html", }) export class GeneratorComponent extends BaseGeneratorComponent { - @ViewChild("historyTemplate", { read: ViewContainerRef, static: true }) - historyModalRef: ViewContainerRef; - constructor( passwordGenerationService: PasswordGenerationServiceAbstraction, usernameGenerationService: UsernameGenerationServiceAbstraction, @@ -28,7 +25,7 @@ export class GeneratorComponent extends BaseGeneratorComponent { i18nService: I18nService, logService: LogService, route: ActivatedRoute, - private modalService: ModalService + private dialogService: DialogServiceAbstraction ) { super( passwordGenerationService, @@ -47,7 +44,7 @@ export class GeneratorComponent extends BaseGeneratorComponent { } async history() { - await this.modalService.openViewRef(PasswordGeneratorHistoryComponent, this.historyModalRef); + this.dialogService.open(PasswordGeneratorHistoryComponent); } lengthChanged() { diff --git a/apps/web/src/app/tools/password-generator-history.component.html b/apps/web/src/app/tools/password-generator-history.component.html index 93c97f7182c..a4b382c4b51 100644 --- a/apps/web/src/app/tools/password-generator-history.component.html +++ b/apps/web/src/app/tools/password-generator-history.component.html @@ -1,59 +1,47 @@ -