From da666871dd975a863709290adaaaf0f28854e79b Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Sun, 7 Aug 2022 14:50:00 +0200 Subject: [PATCH] stages/consent: simplify permission rendering Signed-off-by: Jens Langhammer --- web/src/flows/stages/consent/ConsentStage.ts | 28 +++++++++----------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/web/src/flows/stages/consent/ConsentStage.ts b/web/src/flows/stages/consent/ConsentStage.ts index 7352bdfed..7a1629163 100644 --- a/web/src/flows/stages/consent/ConsentStage.ts +++ b/web/src/flows/stages/consent/ConsentStage.ts @@ -18,7 +18,7 @@ import PFTitle from "@patternfly/patternfly/components/Title/title.css"; import PFBase from "@patternfly/patternfly/patternfly-base.css"; import PFSpacing from "@patternfly/patternfly/utilities/Spacing/spacing.css"; -import { ConsentChallenge, ConsentChallengeResponseRequest } from "@goauthentik/api"; +import { ConsentChallenge, ConsentChallengeResponseRequest, Permission } from "@goauthentik/api"; @customElement("ak-stage-consent") export class ConsentStage extends BaseStage { @@ -36,6 +36,14 @@ export class ConsentStage extends BaseStage { + return html`
  • + ${permission.name === "" ? permission.id : permission.name} +
  • `; + })}`; + } + renderNoPrevious(): TemplateResult { return html`
    @@ -46,11 +54,7 @@ export class ConsentStage extends BaseStage
      - ${this.challenge.permissions.map((permission) => { - return html`
    • - ${permission.name} -
    • `; - })} + ${this.renderPermissions(this.challenge.permissions)}
    ` : html``} @@ -68,11 +72,7 @@ export class ConsentStage extends BaseStage
      - ${this.challenge.permissions.map((permission) => { - return html`
    • - ${permission.name === "" ? permission.id : permission.name} -
    • `; - })} + ${this.renderPermissions(this.challenge.permissions)}
    ` : html``} @@ -84,11 +84,7 @@ export class ConsentStage extends BaseStage
      - ${this.challenge.additionalPermissions.map((permission) => { - return html`
    • - ${permission.name === "" ? permission.id : permission.name} -
    • `; - })} + ${this.renderPermissions(this.challenge.additionalPermissions)}
    ` : html``}