From e96358c5554794903f451b77555382d3622a9ece Mon Sep 17 00:00:00 2001 From: Sebastian Date: Mon, 6 Jun 2022 00:54:55 -0300 Subject: eslint --- .../authMethod/AuthMethodEmailSetup.stories.tsx | 4 +-- .../pages/home/authMethod/AuthMethodEmailSetup.tsx | 8 ++--- .../authMethod/AuthMethodEmailSolve.stories.tsx | 4 +-- .../pages/home/authMethod/AuthMethodEmailSolve.tsx | 31 ++++++++++--------- .../authMethod/AuthMethodIbanSetup.stories.tsx | 4 +-- .../pages/home/authMethod/AuthMethodIbanSetup.tsx | 6 ++-- .../authMethod/AuthMethodIbanSolve.stories.tsx | 9 ++---- .../pages/home/authMethod/AuthMethodIbanSolve.tsx | 17 +++++----- .../authMethod/AuthMethodPostSetup.stories.tsx | 5 ++- .../pages/home/authMethod/AuthMethodPostSetup.tsx | 6 ++-- .../authMethod/AuthMethodPostSolve.stories.tsx | 9 ++---- .../pages/home/authMethod/AuthMethodPostSolve.tsx | 21 ++++++------- .../authMethod/AuthMethodQuestionSetup.stories.tsx | 5 ++- .../home/authMethod/AuthMethodQuestionSetup.tsx | 8 ++--- .../authMethod/AuthMethodQuestionSolve.stories.tsx | 4 +-- .../home/authMethod/AuthMethodQuestionSolve.tsx | 19 +++++------- .../home/authMethod/AuthMethodSmsSetup.stories.tsx | 5 ++- .../pages/home/authMethod/AuthMethodSmsSetup.tsx | 8 ++--- .../home/authMethod/AuthMethodSmsSolve.stories.tsx | 9 ++---- .../pages/home/authMethod/AuthMethodSmsSolve.tsx | 36 ++++++++++------------ .../authMethod/AuthMethodTotpSetup.stories.tsx | 5 ++- .../pages/home/authMethod/AuthMethodTotpSetup.tsx | 16 +++++----- .../authMethod/AuthMethodTotpSolve.stories.tsx | 9 ++---- .../pages/home/authMethod/AuthMethodTotpSolve.tsx | 19 +++++------- .../src/pages/home/authMethod/index.tsx | 24 +++++++-------- .../src/pages/home/authMethod/totp.ts | 1 - 26 files changed, 131 insertions(+), 161 deletions(-) (limited to 'packages/anastasis-webui/src/pages/home/authMethod') diff --git a/packages/anastasis-webui/src/pages/home/authMethod/AuthMethodEmailSetup.stories.tsx b/packages/anastasis-webui/src/pages/home/authMethod/AuthMethodEmailSetup.stories.tsx index 080a7ab31..2650caa31 100644 --- a/packages/anastasis-webui/src/pages/home/authMethod/AuthMethodEmailSetup.stories.tsx +++ b/packages/anastasis-webui/src/pages/home/authMethod/AuthMethodEmailSetup.stories.tsx @@ -19,8 +19,8 @@ * @author Sebastian Javier Marchano (sebasjm) */ -import { createExample, reducerStatesExample } from "../../../utils"; -import { authMethods as TestedComponent, KnownAuthMethods } from "./index"; +import { createExample, reducerStatesExample } from "../../../utils/index.js"; +import { authMethods as TestedComponent, KnownAuthMethods } from "./index.js"; export default { title: "Pages/backup/AuthorizationMethod/AuthMethods/email", diff --git a/packages/anastasis-webui/src/pages/home/authMethod/AuthMethodEmailSetup.tsx b/packages/anastasis-webui/src/pages/home/authMethod/AuthMethodEmailSetup.tsx index 80597ff8b..4cbc991c8 100644 --- a/packages/anastasis-webui/src/pages/home/authMethod/AuthMethodEmailSetup.tsx +++ b/packages/anastasis-webui/src/pages/home/authMethod/AuthMethodEmailSetup.tsx @@ -1,12 +1,12 @@ import { encodeCrock, stringToBytes } from "@gnu-taler/taler-util"; import { h, VNode } from "preact"; import { useState } from "preact/hooks"; -import { EmailInput } from "../../../components/fields/EmailInput"; -import { AnastasisClientFrame } from "../index"; -import { AuthMethodSetupProps } from "./index"; +import { EmailInput } from "../../../components/fields/EmailInput.js"; +import { AnastasisClientFrame } from "../index.js"; +import { AuthMethodSetupProps } from "./index.js"; const EMAIL_PATTERN = - /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; + /^(([^<>()[]\\.,;:\s@"]+(\.[^<>()[]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; export function AuthMethodEmailSetup({ cancel, diff --git a/packages/anastasis-webui/src/pages/home/authMethod/AuthMethodEmailSolve.stories.tsx b/packages/anastasis-webui/src/pages/home/authMethod/AuthMethodEmailSolve.stories.tsx index 295a47c46..8f0f361a7 100644 --- a/packages/anastasis-webui/src/pages/home/authMethod/AuthMethodEmailSolve.stories.tsx +++ b/packages/anastasis-webui/src/pages/home/authMethod/AuthMethodEmailSolve.stories.tsx @@ -23,8 +23,8 @@ import { ChallengeFeedbackStatus, ReducerState, } from "@gnu-taler/anastasis-core"; -import { createExample, reducerStatesExample } from "../../../utils"; -import { authMethods as TestedComponent, KnownAuthMethods } from "./index"; +import { createExample, reducerStatesExample } from "../../../utils/index.js"; +import { authMethods as TestedComponent, KnownAuthMethods } from "./index.js"; export default { title: "Pages/recovery/SolveChallenge/AuthMethods/email", diff --git a/packages/anastasis-webui/src/pages/home/authMethod/AuthMethodEmailSolve.tsx b/packages/anastasis-webui/src/pages/home/authMethod/AuthMethodEmailSolve.tsx index 2ec27b8fc..d4e034a37 100644 --- a/packages/anastasis-webui/src/pages/home/authMethod/AuthMethodEmailSolve.tsx +++ b/packages/anastasis-webui/src/pages/home/authMethod/AuthMethodEmailSolve.tsx @@ -20,14 +20,14 @@ import { ChallengeInfo } from "@gnu-taler/anastasis-core"; import { h, VNode } from "preact"; import { useState } from "preact/hooks"; -import { AsyncButton } from "../../../components/AsyncButton"; -import { TextInput } from "../../../components/fields/TextInput"; -import { useAnastasisContext } from "../../../context/anastasis"; -import { useTranslator } from "../../../i18n"; -import { AnastasisClientFrame } from "../index"; -import { SolveOverviewFeedbackDisplay } from "../SolveScreen"; -import { shouldHideConfirm } from "./helpers"; -import { AuthMethodSolveProps } from "./index"; +import { AsyncButton } from "../../../components/AsyncButton.js"; +import { TextInput } from "../../../components/fields/TextInput.js"; +import { useAnastasisContext } from "../../../context/anastasis.js"; +import { useTranslator } from "../../../i18n/index.js"; +import { AnastasisClientFrame } from "../index.js"; +import { SolveOverviewFeedbackDisplay } from "../SolveScreen.js"; +import { shouldHideConfirm } from "./helpers.js"; +import { AuthMethodSolveProps } from "./index.js"; export function AuthMethodEmailSolve({ id }: AuthMethodSolveProps): VNode { const [answer, _setAnswer] = useState("A-"); @@ -131,15 +131,16 @@ export function AuthMethodEmailSolve({ id }: AuthMethodSolveProps): VNode {

- An email has been sent to "{selectedChallenge.instructions}". The - message has and identification code and recovery code that starts with " - A-". Wait the message to arrive and the enter the recovery code - below. + An email has been sent to "{selectedChallenge.instructions} + ". The message has and identification code and recovery code that + starts with " + A-". Wait the message to arrive and the enter the recovery + code below.

{!expanded ? (

- The identification code in the email should start with " - {selectedUuid.substring(0, 10)}" + The identification code in the email should start with " + {selectedUuid.substring(0, 10)}" ) : (

- The identification code in the email is "{selectedUuid}" + The identification code in the email is "{selectedUuid}"

- An sms has been sent to "{selectedChallenge.instructions}". The - message has and identification code and recovery code that starts with " - A-". Wait the message to arrive and the enter the recovery code - below. + An sms has been sent to "{selectedChallenge.instructions} + ". The message has and identification code and recovery code that + starts with " + A-". Wait the message to arrive and the enter the recovery + code below.

{!expanded ? (

- The identification code in the SMS should start with " - {selectedUuid.substring(0, 10)}" + The identification code in the SMS should start with " + {selectedUuid.substring(0, 10)}" ) : (

- The identification code in the SMS is "{selectedUuid}" + The identification code in the SMS is "{selectedUuid}"

- We note that Google's implementation of TOTP is incomplete and will not - work. We recommend using FreeOTP+. + We note that Google's implementation of TOTP is incomplete and will + not work. We recommend using FreeOTP+.
{configured.length > 0 && ( diff --git a/packages/anastasis-webui/src/pages/home/authMethod/AuthMethodTotpSolve.stories.tsx b/packages/anastasis-webui/src/pages/home/authMethod/AuthMethodTotpSolve.stories.tsx index 0fba7872f..6bfe8a01d 100644 --- a/packages/anastasis-webui/src/pages/home/authMethod/AuthMethodTotpSolve.stories.tsx +++ b/packages/anastasis-webui/src/pages/home/authMethod/AuthMethodTotpSolve.stories.tsx @@ -19,12 +19,9 @@ * @author Sebastian Javier Marchano (sebasjm) */ -import { - ChallengeFeedbackStatus, - ReducerState, -} from "@gnu-taler/anastasis-core"; -import { createExample, reducerStatesExample } from "../../../utils"; -import { authMethods as TestedComponent, KnownAuthMethods } from "./index"; +import { ReducerState } from "@gnu-taler/anastasis-core"; +import { createExample, reducerStatesExample } from "../../../utils/index.js"; +import { authMethods as TestedComponent, KnownAuthMethods } from "./index.js"; export default { title: "Pages/recovery/SolveChallenge/AuthMethods/totp", diff --git a/packages/anastasis-webui/src/pages/home/authMethod/AuthMethodTotpSolve.tsx b/packages/anastasis-webui/src/pages/home/authMethod/AuthMethodTotpSolve.tsx index 6b98f8ece..cc70f9d56 100644 --- a/packages/anastasis-webui/src/pages/home/authMethod/AuthMethodTotpSolve.tsx +++ b/packages/anastasis-webui/src/pages/home/authMethod/AuthMethodTotpSolve.tsx @@ -1,16 +1,13 @@ -import { - ChallengeFeedbackStatus, - ChallengeInfo, -} from "@gnu-taler/anastasis-core"; +import { ChallengeInfo } from "@gnu-taler/anastasis-core"; import { h, VNode } from "preact"; import { useState } from "preact/hooks"; -import { AsyncButton } from "../../../components/AsyncButton"; -import { TextInput } from "../../../components/fields/TextInput"; -import { useAnastasisContext } from "../../../context/anastasis"; -import { AnastasisClientFrame } from "../index"; -import { SolveOverviewFeedbackDisplay } from "../SolveScreen"; -import { shouldHideConfirm } from "./helpers"; -import { AuthMethodSolveProps } from "./index"; +import { AsyncButton } from "../../../components/AsyncButton.js"; +import { TextInput } from "../../../components/fields/TextInput.js"; +import { useAnastasisContext } from "../../../context/anastasis.js"; +import { AnastasisClientFrame } from "../index.js"; +import { SolveOverviewFeedbackDisplay } from "../SolveScreen.js"; +import { shouldHideConfirm } from "./helpers.js"; +import { AuthMethodSolveProps } from "./index.js"; export function AuthMethodTotpSolve(props: AuthMethodSolveProps): VNode { const [answerCode, setAnswerCode] = useState(""); diff --git a/packages/anastasis-webui/src/pages/home/authMethod/index.tsx b/packages/anastasis-webui/src/pages/home/authMethod/index.tsx index a1ab9cd28..6a6298bc7 100644 --- a/packages/anastasis-webui/src/pages/home/authMethod/index.tsx +++ b/packages/anastasis-webui/src/pages/home/authMethod/index.tsx @@ -3,18 +3,18 @@ import { h, VNode } from "preact"; import postalIcon from "../../../assets/icons/auth_method/postal.svg"; import questionIcon from "../../../assets/icons/auth_method/question.svg"; import smsIcon from "../../../assets/icons/auth_method/sms.svg"; -import { AuthMethodEmailSetup as EmailSetup } from "./AuthMethodEmailSetup"; -import { AuthMethodEmailSolve as EmailSolve } from "./AuthMethodEmailSolve"; -import { AuthMethodIbanSetup as IbanSetup } from "./AuthMethodIbanSetup"; -import { AuthMethodIbanSolve as IbanSolve } from "./AuthMethodIbanSolve"; -import { AuthMethodPostSetup as PostalSetup } from "./AuthMethodPostSetup"; -import { AuthMethodPostSolve as PostalSolve } from "./AuthMethodPostSolve"; -import { AuthMethodQuestionSetup as QuestionSetup } from "./AuthMethodQuestionSetup"; -import { AuthMethodQuestionSolve as QuestionSolve } from "./AuthMethodQuestionSolve"; -import { AuthMethodSmsSetup as SmsSetup } from "./AuthMethodSmsSetup"; -import { AuthMethodSmsSolve as SmsSolve } from "./AuthMethodSmsSolve"; -import { AuthMethodTotpSetup as TotpSetup } from "./AuthMethodTotpSetup"; -import { AuthMethodTotpSolve as TotpSolve } from "./AuthMethodTotpSolve"; +import { AuthMethodEmailSetup as EmailSetup } from "./AuthMethodEmailSetup.js"; +import { AuthMethodEmailSolve as EmailSolve } from "./AuthMethodEmailSolve.js"; +import { AuthMethodIbanSetup as IbanSetup } from "./AuthMethodIbanSetup.js"; +import { AuthMethodIbanSolve as IbanSolve } from "./AuthMethodIbanSolve.js"; +import { AuthMethodPostSetup as PostalSetup } from "./AuthMethodPostSetup.js"; +import { AuthMethodPostSolve as PostalSolve } from "./AuthMethodPostSolve.js"; +import { AuthMethodQuestionSetup as QuestionSetup } from "./AuthMethodQuestionSetup.js"; +import { AuthMethodQuestionSolve as QuestionSolve } from "./AuthMethodQuestionSolve.js"; +import { AuthMethodSmsSetup as SmsSetup } from "./AuthMethodSmsSetup.js"; +import { AuthMethodSmsSolve as SmsSolve } from "./AuthMethodSmsSolve.js"; +import { AuthMethodTotpSetup as TotpSetup } from "./AuthMethodTotpSetup.js"; +import { AuthMethodTotpSolve as TotpSolve } from "./AuthMethodTotpSolve.js"; export type AuthMethodWithRemove = AuthMethod & { remove: () => void }; diff --git a/packages/anastasis-webui/src/pages/home/authMethod/totp.ts b/packages/anastasis-webui/src/pages/home/authMethod/totp.ts index c2288671c..9c26ddcad 100644 --- a/packages/anastasis-webui/src/pages/home/authMethod/totp.ts +++ b/packages/anastasis-webui/src/pages/home/authMethod/totp.ts @@ -1,4 +1,3 @@ -/* eslint-disable @typescript-eslint/camelcase */ import jssha from "jssha"; const SEARCH_RANGE = 16; -- cgit v1.2.3