Skip to content

Commit

Permalink
#4614: Report card button fix (#4627)
Browse files Browse the repository at this point in the history
fixes #4614
  • Loading branch information
zateutsch authored Jan 25, 2024
1 parent d745d41 commit 93e17f6
Showing 1 changed file with 26 additions and 14 deletions.
40 changes: 26 additions & 14 deletions apps/pwabuilder/src/script/pages/app-report.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -2899,6 +2900,29 @@ export class AppReport extends LitElement {
}
}

renderReaddDialog() {
var dialogContent = html`
<p>Have you added your new ${this.thingToAdd} to your site?</p>
<div id="confirmationButtons">
<sl-button @click=${() => this.retest(true)}> Yes </sl-button>
<sl-button @click=${() => this.readdDenied = true}> No </sl-button>
</div>
`

if(this.retestConfirmed) {
dialogContent = html`
<p>Retesting your site now!</p>
`;
}
else if (this.readdDenied) {
dialogContent = html`
<p>Add your new ${this.thingToAdd}, and then we can retest your site. </p>
`;
}

return dialogContent;
}

render() {
return html`
<app-header .page=${"report"}></app-header>
Expand Down Expand Up @@ -3455,20 +3479,8 @@ export class AppReport extends LitElement {
</div>
<sl-dialog class="dialog" ?open=${this.showConfirmationModal} @sl-hide=${() => this.showConfirmationModal = false} noHeader>
${this.retestConfirmed ?
html`
<p>Retesting your site now!</p>
` :
html`
<p>Have you added your new ${this.thingToAdd} to your site?</p>
<div id="confirmationButtons">
<sl-button>No</sl-button>
<sl-button @click=${() => this.retest(true)}>Yes</sl-button>
</div>
`
}
<sl-dialog class="dialog" ?open=${this.showConfirmationModal} @sl-hide=${() => {this.showConfirmationModal = false; this.readdDenied = false;}} noHeader>
${this.renderReaddDialog()}
</sl-dialog>
<share-card
Expand Down

0 comments on commit 93e17f6

Please sign in to comment.