From 8787dc23d01d1f508361b4ecabd626f73904404b Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Sat, 20 Feb 2021 19:59:24 +0100 Subject: [PATCH] web: fix linting errors --- tests/e2e/test_flows_enroll.py | 6 +-- .../identification/IdentificationStage.ts | 40 +++++++++++-------- web/src/pages/generic/FlowExecutor.ts | 3 +- 3 files changed, 28 insertions(+), 21 deletions(-) diff --git a/tests/e2e/test_flows_enroll.py b/tests/e2e/test_flows_enroll.py index 553c7a05c..99e6ca26f 100644 --- a/tests/e2e/test_flows_enroll.py +++ b/tests/e2e/test_flows_enroll.py @@ -88,9 +88,9 @@ class TestFlowsEnroll(SeleniumTestCase): self.driver.get(self.live_server_url) self.wait.until( - ec.presence_of_element_located((By.CSS_SELECTOR, "[role=enroll]")) + ec.presence_of_element_located((By.CSS_SELECTOR, "#enroll")) ) - self.driver.find_element(By.CSS_SELECTOR, "[role=enroll]").click() + self.driver.find_element(By.CSS_SELECTOR, "#enroll").click() self.wait.until(ec.presence_of_element_located((By.ID, "id_username"))) self.driver.find_element(By.ID, "id_username").send_keys("foo") @@ -169,7 +169,7 @@ class TestFlowsEnroll(SeleniumTestCase): FlowStageBinding.objects.create(target=flow, stage=user_login, order=4) self.driver.get(self.live_server_url) - self.driver.find_element(By.CSS_SELECTOR, "[role=enroll]").click() + self.driver.find_element(By.CSS_SELECTOR, "#enroll").click() self.driver.find_element(By.ID, "id_username").send_keys("foo") self.driver.find_element(By.ID, "id_password").send_keys(USER().username) self.driver.find_element(By.ID, "id_password_repeat").send_keys(USER().username) diff --git a/web/src/elements/stages/identification/IdentificationStage.ts b/web/src/elements/stages/identification/IdentificationStage.ts index 2c49ad8de..6b7a5d1c8 100644 --- a/web/src/elements/stages/identification/IdentificationStage.ts +++ b/web/src/elements/stages/identification/IdentificationStage.ts @@ -11,6 +11,9 @@ export interface IdentificationStageArgs { application_pre?: string; + enroll_url?: string; + recovery_url?: string; + } export interface UILoginButton { @@ -47,6 +50,24 @@ export class IdentificationStage extends BaseStage { `; } + renderFooter(): TemplateResult { + if (!(this.args?.enroll_url && this.args.recovery_url)) { + return html``; + } + return html``; + } + render(): TemplateResult { if (!this.args) { return html``; @@ -57,7 +78,7 @@ export class IdentificationStage extends BaseStage {
-
{this.submit(e)}}> + {this.submit(e);}}> ${this.args.application_pre ? html`

${gettext(`Login to continue to ${this.args.application_pre}.`)} @@ -85,22 +106,7 @@ export class IdentificationStage extends BaseStage { return this.renderSource(source); })} - - + ${this.renderFooter()} `; } diff --git a/web/src/pages/generic/FlowExecutor.ts b/web/src/pages/generic/FlowExecutor.ts index 634b74d1e..bee03f428 100644 --- a/web/src/pages/generic/FlowExecutor.ts +++ b/web/src/pages/generic/FlowExecutor.ts @@ -14,7 +14,8 @@ enum ChallengeTypes { interface Challenge { type: ChallengeTypes; - args: { [key: string]: string }; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + args: any; component?: string; title?: string; }