web/flows: only show permissions header when permissions are defined

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer 2021-06-06 12:58:55 +02:00
parent fe2e850303
commit 67470590c2
1 changed files with 8 additions and 6 deletions

View File

@ -47,12 +47,14 @@ export class ConsentStage extends BaseStage<ConsentChallenge, ConsentChallengeRe
<p id="header-text"> <p id="header-text">
${this.challenge.headerText} ${this.challenge.headerText}
</p> </p>
<p>${t`Application requires following permissions`}</p> ${this.challenge.permissions.length > 0 ? html`
<ul class="pf-c-list" id="permmissions"> <p>${t`Application requires following permissions`}</p>
${(this.challenge.permissions || []).map((permission) => { <ul class="pf-c-list" id="permmissions">
return html`<li data-permission-code="${permission.id}">${permission.name}</li>`; ${this.challenge.permissions.map((permission) => {
})} return html`<li data-permission-code="${permission.id}">${permission.name}</li>`;
</ul> })}
</ul>
` : html``}
</div> </div>
<div class="pf-c-form__group pf-m-action"> <div class="pf-c-form__group pf-m-action">