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">
${this.challenge.headerText}
</p>
<p>${t`Application requires following permissions`}</p>
<ul class="pf-c-list" id="permmissions">
${(this.challenge.permissions || []).map((permission) => {
return html`<li data-permission-code="${permission.id}">${permission.name}</li>`;
})}
</ul>
${this.challenge.permissions.length > 0 ? html`
<p>${t`Application requires following permissions`}</p>
<ul class="pf-c-list" id="permmissions">
${this.challenge.permissions.map((permission) => {
return html`<li data-permission-code="${permission.id}">${permission.name}</li>`;
})}
</ul>
` : html``}
</div>
<div class="pf-c-form__group pf-m-action">