From 93e17f6c10cc3328777df0500f2f2f210386d5dd Mon Sep 17 00:00:00 2001 From: Zach Teutsch <88554871+zateutsch@users.noreply.github.com> Date: Thu, 25 Jan 2024 09:21:11 -0800 Subject: [PATCH] #4614: Report card button fix (#4627) fixes #4614 --- .../pwabuilder/src/script/pages/app-report.ts | 40 ++++++++++++------- 1 file changed, 26 insertions(+), 14 deletions(-) diff --git a/apps/pwabuilder/src/script/pages/app-report.ts b/apps/pwabuilder/src/script/pages/app-report.ts index bd1a7bea8..6d4f3871e 100644 --- a/apps/pwabuilder/src/script/pages/app-report.ts +++ b/apps/pwabuilder/src/script/pages/app-report.ts @@ -133,6 +133,7 @@ export class AppReport extends LitElement { @state() showConfirmationModal: boolean = false; @state() thingToAdd: string = ""; @state() retestConfirmed: boolean = false; + @state() readdDenied: boolean = false; @state() createdManifest: boolean = false; @state() manifestContext: ManifestContext | undefined; @@ -2899,6 +2900,29 @@ export class AppReport extends LitElement { } } + renderReaddDialog() { + var dialogContent = html` +

Have you added your new ${this.thingToAdd} to your site?

+
+ this.retest(true)}> Yes + this.readdDenied = true}> No +
+ ` + + if(this.retestConfirmed) { + dialogContent = html` +

Retesting your site now!

+ `; + } + else if (this.readdDenied) { + dialogContent = html` +

Add your new ${this.thingToAdd}, and then we can retest your site.

+ `; + } + + return dialogContent; + } + render() { return html` @@ -3455,20 +3479,8 @@ export class AppReport extends LitElement { - this.showConfirmationModal = false} noHeader> - ${this.retestConfirmed ? - html` -

Retesting your site now!

- ` : - html` -

Have you added your new ${this.thingToAdd} to your site?

-
- No - this.retest(true)}>Yes -
- ` - } - + {this.showConfirmationModal = false; this.readdDenied = false;}} noHeader> + ${this.renderReaddDialog()}