commit d2ea0d46ecee8d460499eb65c847ac6db44255e2 parent 462e1f444fac4385b9f4c3e2677b6cfc38fa5655 Author: Sebastian <sebasjm@gmail.com> Date: Fri, 14 Nov 2025 12:01:30 -0300 making buttons type submit Diffstat:
31 files changed, 234 insertions(+), 112 deletions(-)
diff --git a/packages/merchant-backoffice-ui/src/paths/admin/list/TableActive.tsx b/packages/merchant-backoffice-ui/src/paths/admin/list/TableActive.tsx @@ -99,7 +99,12 @@ export function CardTable({ class="has-tooltip-left" data-tooltip={i18n.str`Add new instance`} > - <button class="button is-info" type="button" onClick={onCreate}> + <button + class="button is-info" + type="button" + accesskey="+" + onClick={onCreate} + > <span class="icon is-small"> <i class="mdi mdi-plus mdi-36px" /> </span> diff --git a/packages/merchant-backoffice-ui/src/paths/instance/accessTokens/list/Table.tsx b/packages/merchant-backoffice-ui/src/paths/instance/accessTokens/list/Table.tsx @@ -64,7 +64,12 @@ export function CardTable({ class="has-tooltip-left" data-tooltip={i18n.str`Create access token`} > - <button class="button is-info" type="button" onClick={onCreate}> + <button + class="button is-info" + type="button" + accesskey="+" + onClick={onCreate} + > <span class="icon is-small"> <i class="mdi mdi-plus mdi-36px" /> </span> @@ -114,7 +119,8 @@ function Table({ <Fragment> <div class="table-container"> {onLoadMoreBefore && ( - <button type="button" + <button + type="button" class="button is-fullwidth" data-tooltip={i18n.str`Load more devices before the first one`} onClick={onLoadMoreBefore} @@ -201,7 +207,8 @@ function Table({ </tbody> </table> {onLoadMoreAfter && ( - <button type="button" + <button + type="button" class="button is-fullwidth" data-tooltip={i18n.str`Load more devices after the last one`} onClick={onLoadMoreAfter} diff --git a/packages/merchant-backoffice-ui/src/paths/instance/accounts/create/CreatePage.tsx b/packages/merchant-backoffice-ui/src/paths/instance/accounts/create/CreatePage.tsx @@ -33,7 +33,7 @@ import { useChallengeHandler, useCommonPreferences, useLocalNotificationBetter, - useTranslationContext + useTranslationContext, } from "@gnu-taler/web-util/browser"; import { Fragment, VNode, h } from "preact"; import { useState } from "preact/hooks"; @@ -93,17 +93,17 @@ export function CreatePage({ onCreated, onBack }: Props): VNode { !state.credit_facade_credentials || !state.credit_facade_url ? undefined : { - username: - state.credit_facade_credentials.type === "basic" && + username: + state.credit_facade_credentials.type === "basic" && !state.credit_facade_credentials.username - ? i18n.str`Required` - : undefined, - password: - state.credit_facade_credentials.type === "basic" && + ? i18n.str`Required` + : undefined, + password: + state.credit_facade_credentials.type === "basic" && !state.credit_facade_credentials.password - ? i18n.str`Required` - : undefined, - }, + ? i18n.str`Required` + : undefined, + }, ) as any, credit_facade_url: !state.credit_facade_url ? undefined @@ -130,13 +130,13 @@ export function CreatePage({ onCreated, onBack }: Props): VNode { ? undefined : state.credit_facade_credentials?.type === "basic" ? { - type: "basic", - password: state.credit_facade_credentials.password, - username: state.credit_facade_credentials.username, - } + type: "basic", + password: state.credit_facade_credentials.password, + username: state.credit_facade_credentials.username, + } : { - type: "none", - }; + type: "none", + }; const { state: session, lib } = useSessionContext(); const request: TalerMerchantApi.AccountAddDetails = { @@ -209,7 +209,8 @@ export function CreatePage({ onCreated, onBack }: Props): VNode { case PaytoParseError.COMPONENTS_LENGTH: case PaytoParseError.INVALID_TARGET_PATH: case PaytoParseError.WRONG_PREFIX: - case PaytoParseError.INCOMPLETE: return i18n.str`Unsupported type of account` + case PaytoParseError.INCOMPLETE: + return i18n.str`Unsupported type of account`; } }; @@ -326,6 +327,7 @@ export function CreatePage({ onCreated, onBack }: Props): VNode { : i18n.str`Confirm operation` } onClick={add} + type="submit" > <i18n.Translate>Confirm</i18n.Translate> </ButtonBetterBulma> @@ -345,7 +347,7 @@ export function CreatePage({ onCreated, onBack }: Props): VNode { payto_uri: Paytos.toFullString(revenuePayto), }); setRevenuePayto(undefined); - return opEmptySuccess() + return opEmptySuccess(); }, [])} formPayto={safeParsed} testPayto={revenuePayto} diff --git a/packages/merchant-backoffice-ui/src/paths/instance/accounts/list/Table.tsx b/packages/merchant-backoffice-ui/src/paths/instance/accounts/list/Table.tsx @@ -85,7 +85,12 @@ export function CardTable({ accounts, onCreate, onSelect }: Props): VNode { class="has-tooltip-left" data-tooltip={i18n.str`Add new account`} > - <button class="button is-info" type="button" onClick={onCreate}> + <button + class="button is-info" + type="button" + accesskey="+" + onClick={onCreate} + > <span class="icon is-small"> <i class="mdi mdi-plus mdi-36px" /> </span> diff --git a/packages/merchant-backoffice-ui/src/paths/instance/accounts/update/UpdatePage.tsx b/packages/merchant-backoffice-ui/src/paths/instance/accounts/update/UpdatePage.tsx @@ -27,7 +27,7 @@ import { Paytos, TalerMerchantApi, opEmptySuccess, - succeedOrThrow + succeedOrThrow, } from "@gnu-taler/taler-util"; import { ButtonBetterBulma, @@ -35,7 +35,7 @@ import { useChallengeHandler, useCommonPreferences, useLocalNotificationBetter, - useTranslationContext + useTranslationContext, } from "@gnu-taler/web-util/browser"; import { Fragment, VNode, h } from "preact"; import { useState } from "preact/hooks"; @@ -413,6 +413,7 @@ export function UpdatePage({ account, onUpdated, onBack }: Props): VNode { : i18n.str`Confirm operation` } onClick={update} + type="submit" > <i18n.Translate>Confirm</i18n.Translate> </ButtonBetterBulma> diff --git a/packages/merchant-backoffice-ui/src/paths/instance/categories/create/CreatePage.tsx b/packages/merchant-backoffice-ui/src/paths/instance/categories/create/CreatePage.tsx @@ -95,25 +95,25 @@ export function CreatePage({ onCreated, onBack }: Props): VNode { label={i18n.str`Name`} tooltip={i18n.str`Category name`} />{" "} + <div class="buttons is-right mt-5"> + {onBack && ( + <button class="button" type="button" onClick={onBack}> + <i18n.Translate>Cancel</i18n.Translate> + </button> + )} + <ButtonBetterBulma + data-tooltip={ + hasErrors + ? i18n.str`Please complete the marked fields` + : i18n.str`Confirm operation` + } + type="submit" + onClick={create} + > + <i18n.Translate>Confirm</i18n.Translate> + </ButtonBetterBulma> + </div> </FormProvider> - - <div class="buttons is-right mt-5"> - {onBack && ( - <button class="button" onClick={onBack}> - <i18n.Translate>Cancel</i18n.Translate> - </button> - )} - <ButtonBetterBulma - data-tooltip={ - hasErrors - ? i18n.str`Please complete the marked fields` - : i18n.str`Confirm operation` - } - onClick={create} - > - <i18n.Translate>Confirm</i18n.Translate> - </ButtonBetterBulma> - </div> </div> <div class="column" /> </div> diff --git a/packages/merchant-backoffice-ui/src/paths/instance/categories/list/Table.tsx b/packages/merchant-backoffice-ui/src/paths/instance/categories/list/Table.tsx @@ -83,7 +83,7 @@ export function CardTable({ class="has-tooltip-left" data-tooltip={i18n.str`Add new devices`} > - <button class="button is-info" type="button" onClick={onCreate}> + <button class="button is-info" accesskey="+" type="button" onClick={onCreate}> <span class="icon is-small"> <i class="mdi mdi-plus mdi-36px" /> </span> diff --git a/packages/merchant-backoffice-ui/src/paths/instance/orders/create/CreatePage.tsx b/packages/merchant-backoffice-ui/src/paths/instance/orders/create/CreatePage.tsx @@ -591,7 +591,8 @@ export function CreatePage({ tooltip={i18n.str`Time for the customer to pay before the offer expires. Inventory products will be reserved until this deadline. The time starts after the order is created.`} side={ <span> - <button type="button" + <button + type="button" class="button" onClick={() => { const c = { @@ -626,7 +627,8 @@ export function CreatePage({ tooltip={i18n.str`Time while the order can be refunded by the merchant. Time starts after the order is created.`} side={ <span> - <button type="button" + <button + type="button" class="button" onClick={() => { valueHandler({ @@ -661,7 +663,8 @@ export function CreatePage({ tooltip={i18n.str`Time for the exchange to make the wire transfer. Time starts after the order is created.`} side={ <span> - <button type="button" + <button + type="button" class="button" onClick={() => { valueHandler({ @@ -743,7 +746,8 @@ export function CreatePage({ label={key} tooltip={i18n.str`You must enter a value in JavaScript Object Notation (JSON).`} side={ - <button type="button" + <button + type="button" class="button" onClick={(e) => { if ( @@ -787,7 +791,8 @@ export function CreatePage({ </p> </div> </div> - <button type="button" + <button + type="button" class="button" onClick={(e) => { setNewField(""); @@ -814,7 +819,11 @@ export function CreatePage({ <i18n.Translate>Cancel</i18n.Translate> </button> )} - <ButtonBetterBulma class="button is-success" onClick={create}> + <ButtonBetterBulma + class="button is-success" + type="submit" + onClick={create} + > <i18n.Translate>Confirm</i18n.Translate> </ButtonBetterBulma> </div> diff --git a/packages/merchant-backoffice-ui/src/paths/instance/orders/list/Table.tsx b/packages/merchant-backoffice-ui/src/paths/instance/orders/list/Table.tsx @@ -90,7 +90,12 @@ export function CardTable({ <div class="card-header-icon" aria-label="more options"> <span class="has-tooltip-left" data-tooltip={i18n.str`Create order`}> - <button class="button is-info" type="button" onClick={onCreate}> + <button + class="button is-info" + type="button" + accesskey="+" + onClick={onCreate} + > <span class="icon is-small"> <i class="mdi mdi-plus mdi-36px" /> </span> @@ -241,7 +246,8 @@ function Table({ </tbody> </table> {onLoadMoreAfter && ( - <button type="button" + <button + type="button" class="button is-fullwidth" data-tooltip={i18n.str`Load more orders after the last one`} onClick={onLoadMoreAfter} diff --git a/packages/merchant-backoffice-ui/src/paths/instance/otp_devices/create/CreatePage.tsx b/packages/merchant-backoffice-ui/src/paths/instance/otp_devices/create/CreatePage.tsx @@ -25,7 +25,12 @@ import { isRfc3548Base32Charset, randomRfc3548Base32Key, } from "@gnu-taler/taler-util"; -import { ButtonBetterBulma, LocalNotificationBannerBulma, useLocalNotificationBetter, useTranslationContext } from "@gnu-taler/web-util/browser"; +import { + ButtonBetterBulma, + LocalNotificationBannerBulma, + useLocalNotificationBetter, + useTranslationContext, +} from "@gnu-taler/web-util/browser"; import { Fragment, VNode, h } from "preact"; import { useState } from "preact/hooks"; import { @@ -80,17 +85,24 @@ export function CreatePage({ onCreated, onBack }: Props): VNode { const hasErrors = errors !== undefined; - const data = hasErrors ? undefined : state as TalerMerchantApi.OtpDeviceAddDetails - const create = safeFunctionHandler(lib.instance.addOtpDevice.bind(lib.instance), !session.token || !data ? undefined : [session.token, data]) + const data = hasErrors + ? undefined + : (state as TalerMerchantApi.OtpDeviceAddDetails); + const create = safeFunctionHandler( + lib.instance.addOtpDevice.bind(lib.instance), + !session.token || !data ? undefined : [session.token, data], + ); create.onSuccess = (success, token, req) => { - onCreated(req) - } + onCreated(req); + }; create.onFail = (fail) => { switch (fail.case) { - case HttpStatusCode.Unauthorized: return i18n.str`Unauthorized` - case HttpStatusCode.NotFound: return i18n.str`Not found` + case HttpStatusCode.Unauthorized: + return i18n.str`Unauthorized`; + case HttpStatusCode.NotFound: + return i18n.str`Not found`; } - } + }; return ( <div> @@ -145,7 +157,8 @@ export function CreatePage({ onCreated, onBack }: Props): VNode { </span> } side={ - <button type="button" + <button + type="button" data-tooltip={i18n.str`Generate random secret key`} class="button is-info mr-3" onClick={(e) => { @@ -166,7 +179,7 @@ export function CreatePage({ onCreated, onBack }: Props): VNode { <div class="buttons is-right mt-5"> {onBack && ( - <button class="button" onClick={onBack}> + <button class="button" type="button" onClick={onBack}> <i18n.Translate>Cancel</i18n.Translate> </button> )} @@ -177,6 +190,7 @@ export function CreatePage({ onCreated, onBack }: Props): VNode { : i18n.str`Confirm operation` } onClick={create} + type="submit" > <i18n.Translate>Confirm</i18n.Translate> </ButtonBetterBulma> diff --git a/packages/merchant-backoffice-ui/src/paths/instance/otp_devices/list/Table.tsx b/packages/merchant-backoffice-ui/src/paths/instance/otp_devices/list/Table.tsx @@ -20,7 +20,13 @@ */ import { HttpStatusCode, TalerMerchantApi } from "@gnu-taler/taler-util"; -import { ButtonBetterBulma, LocalNotificationBannerBulma, SafeHandlerTemplate, useLocalNotificationBetter, useTranslationContext } from "@gnu-taler/web-util/browser"; +import { + ButtonBetterBulma, + LocalNotificationBannerBulma, + SafeHandlerTemplate, + useLocalNotificationBetter, + useTranslationContext, +} from "@gnu-taler/web-util/browser"; import { Fragment, h, VNode } from "preact"; import { StateUpdater, useState } from "preact/hooks"; import { useSessionContext } from "../../../../context/session.js"; @@ -48,15 +54,18 @@ export function CardTable({ const { i18n } = useTranslationContext(); - const remove = safeFunctionHandler(lib.instance.deleteOtpDevice.bind(lib.instance)) - .lambda((id: string) => !session.token ? undefined! : [session.token, id]) + const remove = safeFunctionHandler( + lib.instance.deleteOtpDevice.bind(lib.instance), + ).lambda((id: string) => (!session.token ? undefined! : [session.token, id])); remove.onFail = (fail) => { switch (fail.case) { - case HttpStatusCode.Unauthorized: return i18n.str`Unauthorized` - case HttpStatusCode.NotFound: return i18n.str`Not found` + case HttpStatusCode.Unauthorized: + return i18n.str`Unauthorized`; + case HttpStatusCode.NotFound: + return i18n.str`Not found`; } - } + }; return ( <Fragment> <LocalNotificationBannerBulma notification={notification} /> @@ -74,7 +83,12 @@ export function CardTable({ class="has-tooltip-left" data-tooltip={i18n.str`Add new devices`} > - <button class="button is-info" type="button" onClick={onCreate}> + <button + class="button is-info" + type="button" + onClick={onCreate} + accesskey="+" + > <span class="icon is-small"> <i class="mdi mdi-plus mdi-36px" /> </span> @@ -126,7 +140,8 @@ function Table({ return ( <div class="table-container"> {onLoadMoreBefore && ( - <button type="button" + <button + type="button" class="button is-fullwidth" data-tooltip={i18n.str`Load more devices before the first one`} onClick={onLoadMoreBefore} @@ -179,7 +194,8 @@ function Table({ </tbody> </table> {onLoadMoreAfter && ( - <button type="button" + <button + type="button" class="button is-fullwidth" data-tooltip={i18n.str`Load more devices after the last one`} onClick={onLoadMoreAfter} diff --git a/packages/merchant-backoffice-ui/src/paths/instance/otp_devices/update/UpdatePage.tsx b/packages/merchant-backoffice-ui/src/paths/instance/otp_devices/update/UpdatePage.tsx @@ -144,7 +144,8 @@ export function UpdatePage({ device, onUpdated, onBack }: Props): VNode { } side={ state.otp_key === undefined ? ( - <button type="button" + <button + type="button" onClick={() => { setState((s) => ({ ...s, otp_key: "" })); }} @@ -153,7 +154,8 @@ export function UpdatePage({ device, onUpdated, onBack }: Props): VNode { <i18n.Translate>Change key</i18n.Translate> </button> ) : ( - <button type="button" + <button + type="button" data-tooltip={i18n.str`Generate random secret key`} class="button is-info mr-3" onClick={() => { @@ -174,13 +176,14 @@ export function UpdatePage({ device, onUpdated, onBack }: Props): VNode { <div class="buttons is-right mt-5"> {onBack && ( - <button class="button" onClick={onBack}> + <button class="button" type="button" onClick={onBack}> <i18n.Translate>Cancel</i18n.Translate> </button> )} <ButtonBetterBulma data-tooltip={i18n.str`Confirm operation`} onClick={update} + type="submit" > <i18n.Translate>Confirm</i18n.Translate> </ButtonBetterBulma> diff --git a/packages/merchant-backoffice-ui/src/paths/instance/password/DetailPage.tsx b/packages/merchant-backoffice-ui/src/paths/instance/password/DetailPage.tsx @@ -37,7 +37,7 @@ import { HttpStatusCode } from "@gnu-taler/taler-util"; interface Props { instanceId: string; onBack?: () => void; - changePassword: SafeHandlerTemplate<[pass:string], any>; + changePassword: SafeHandlerTemplate<[pass: string], any>; } export function DetailPage({ diff --git a/packages/merchant-backoffice-ui/src/paths/instance/products/create/CreatePage.tsx b/packages/merchant-backoffice-ui/src/paths/instance/products/create/CreatePage.tsx @@ -83,6 +83,7 @@ export function CreatePage({ onCreate, onBack }: Props): VNode { ? i18n.str`Please complete the marked fields` : "confirm operation" } + type="submit" > <i18n.Translate>Confirm</i18n.Translate> </ButtonBetterBulma> diff --git a/packages/merchant-backoffice-ui/src/paths/instance/products/list/Table.tsx b/packages/merchant-backoffice-ui/src/paths/instance/products/list/Table.tsx @@ -23,7 +23,7 @@ import { AmountString, Amounts, TalerMerchantApi } from "@gnu-taler/taler-util"; import { useCommonPreferences, useLocalNotificationBetter, - useTranslationContext + useTranslationContext, } from "@gnu-taler/web-util/browser"; import { format } from "date-fns"; import { ComponentChildren, Fragment, VNode, h } from "preact"; @@ -82,7 +82,12 @@ export function CardTable({ class="has-tooltip-left" data-tooltip={i18n.str`Add product to inventory`} > - <button class="button is-info" type="button" onClick={onCreate}> + <button + class="button is-info" + type="button" + onClick={onCreate} + accessKey="+" + > <span class="icon is-small"> <i class="mdi mdi-plus mdi-36px" /> </span> @@ -350,7 +355,8 @@ function Table({ </tbody> </table> {onLoadMoreAfter && ( - <button type="button" + <button + type="button" class="button is-fullwidth" data-tooltip={i18n.str`Load more products after the last one`} onClick={onLoadMoreAfter} @@ -400,14 +406,15 @@ function FastProductWithInfiniteStockUpdateForm({ <div class="buttons is-expanded"> <div class="buttons is-right mt-5"> - <button type="button"class="button" onClick={onCancel}> + <button type="button" class="button" onClick={onCancel}> <i18n.Translate>Cancel</i18n.Translate> </button> <span class="has-tooltip-left" data-tooltip={i18n.str`Update product with new price`} > - <button type="button" + <button + type="button" class="button is-info" onClick={() => onUpdate({ @@ -479,7 +486,7 @@ function FastProductWithManagedStockUpdateForm({ </FormProvider> <div class="buttons is-right mt-5"> - <button type="button"class="button" onClick={onCancel}> + <button type="button" class="button" onClick={onCancel}> <i18n.Translate>Cancel</i18n.Translate> </button> <span @@ -490,7 +497,8 @@ function FastProductWithManagedStockUpdateForm({ : i18n.str`Update product with new stock and price` } > - <button type="button" + <button + type="button" class="button is-info" disabled={hasErrors} onClick={() => diff --git a/packages/merchant-backoffice-ui/src/paths/instance/products/update/UpdatePage.tsx b/packages/merchant-backoffice-ui/src/paths/instance/products/update/UpdatePage.tsx @@ -24,7 +24,7 @@ import { ButtonBetterBulma, LocalNotificationBannerBulma, useLocalNotificationBetter, - useTranslationContext + useTranslationContext, } from "@gnu-taler/web-util/browser"; import { h, VNode } from "preact"; import { useState } from "preact/hooks"; @@ -50,7 +50,7 @@ export function UpdatePage({ product, onBack, onConfirm }: Props): VNode { ? undefined : [session.token, product.product_id, form], ); - update.onSuccess = onConfirm + update.onSuccess = onConfirm; update.onFail = (fail) => { switch (fail.case) { case HttpStatusCode.Unauthorized: @@ -60,7 +60,7 @@ export function UpdatePage({ product, onBack, onConfirm }: Props): VNode { case HttpStatusCode.Conflict: return i18n.str`Conflict.`; } - } + }; const { i18n } = useTranslationContext(); @@ -91,7 +91,7 @@ export function UpdatePage({ product, onBack, onConfirm }: Props): VNode { <div class="buttons is-right mt-5"> {onBack && ( - <button type="button"class="button" onClick={onBack}> + <button type="button" class="button" onClick={onBack}> <i18n.Translate>Cancel</i18n.Translate> </button> )} @@ -102,6 +102,7 @@ export function UpdatePage({ product, onBack, onConfirm }: Props): VNode { ? i18n.str`Please complete the marked fields` : "confirm operation" } + type="submit" > <i18n.Translate>Confirm</i18n.Translate> </ButtonBetterBulma> diff --git a/packages/merchant-backoffice-ui/src/paths/instance/templates/create/CreatePage.tsx b/packages/merchant-backoffice-ui/src/paths/instance/templates/create/CreatePage.tsx @@ -298,7 +298,7 @@ export function CreatePage({ onCreated, onBack }: Props): VNode { <div class="buttons is-right mt-5"> {onBack && ( - <button type="button"class="button" onClick={onBack}> + <button type="button" class="button" onClick={onBack}> <i18n.Translate>Cancel</i18n.Translate> </button> )} @@ -308,6 +308,7 @@ export function CreatePage({ onCreated, onBack }: Props): VNode { ? i18n.str`Please complete the marked fields` : i18n.str`Confirm operation` } + type="submit" onClick={create} > <i18n.Translate>Confirm</i18n.Translate> diff --git a/packages/merchant-backoffice-ui/src/paths/instance/templates/list/Table.tsx b/packages/merchant-backoffice-ui/src/paths/instance/templates/list/Table.tsx @@ -65,7 +65,12 @@ export function CardTable({ class="has-tooltip-left" data-tooltip={i18n.str`Add new templates`} > - <button class="button is-info" type="button" onClick={onCreate}> + <button + class="button is-info" + type="button" + onClick={onCreate} + accesskey="+" + > <span class="icon is-small"> <i class="mdi mdi-plus mdi-36px" /> </span> @@ -122,7 +127,8 @@ function Table({ return ( <div class="table-container"> {onLoadMoreBefore && ( - <button type="button" + <button + type="button" class="button is-fullwidth" data-tooltip={i18n.str`Load more templates before the first one`} onClick={onLoadMoreBefore} @@ -160,21 +166,24 @@ function Table({ </td> <td class="is-actions-cell right-sticky"> <div class="buttons is-right"> - <button type="button" + <button + type="button" class="button is-danger is-small has-tooltip-left" data-tooltip={i18n.str`Delete selected templates from the database`} onClick={() => onDelete(i)} > <i18n.Translate>Delete</i18n.Translate> </button> - <button type="button" + <button + type="button" class="button is-info is-small has-tooltip-left" data-tooltip={i18n.str`Use template to create new order`} onClick={() => onNewOrder(i)} > <i18n.Translate>Use template</i18n.Translate> </button> - <button type="button" + <button + type="button" class="button is-info is-small has-tooltip-left" data-tooltip={i18n.str`Generate a QR code for the template.`} onClick={() => onQR(i)} @@ -189,7 +198,8 @@ function Table({ </tbody> </table> {onLoadMoreAfter && ( - <button type="button" + <button + type="button" class="button is-fullwidth" data-tooltip={i18n.str`Load more templates after the last one`} onClick={onLoadMoreAfter} diff --git a/packages/merchant-backoffice-ui/src/paths/instance/templates/update/UpdatePage.tsx b/packages/merchant-backoffice-ui/src/paths/instance/templates/update/UpdatePage.tsx @@ -366,7 +366,7 @@ export function UpdatePage({ template, onUpdated, onBack }: Props): VNode { <div class="buttons is-right mt-5"> {onBack && ( - <button type="button"class="button" onClick={onBack}> + <button type="button" class="button" onClick={onBack}> <i18n.Translate>Cancel</i18n.Translate> </button> )} @@ -376,6 +376,7 @@ export function UpdatePage({ template, onUpdated, onBack }: Props): VNode { ? i18n.str`Please complete the marked fields` : i18n.str`Confirm operation` } + type="submit" onClick={update} > <i18n.Translate>Confirm</i18n.Translate> diff --git a/packages/merchant-backoffice-ui/src/paths/instance/templates/use/UsePage.tsx b/packages/merchant-backoffice-ui/src/paths/instance/templates/use/UsePage.tsx @@ -166,7 +166,7 @@ export function UsePage({ <div class="buttons is-right mt-5"> {onBack && ( - <button type="button"class="button" onClick={onBack}> + <button type="button" class="button" onClick={onBack}> <i18n.Translate>Cancel</i18n.Translate> </button> )} @@ -176,6 +176,7 @@ export function UsePage({ ? i18n.str`Please complete the marked fields` : "confirm operation" } + type="submit" onClick={useTemplate} > <i18n.Translate>Confirm</i18n.Translate> diff --git a/packages/merchant-backoffice-ui/src/paths/instance/tokenfamilies/create/CreatePage.tsx b/packages/merchant-backoffice-ui/src/paths/instance/tokenfamilies/create/CreatePage.tsx @@ -177,6 +177,7 @@ export function CreatePage({ onCreated, onBack }: Props): VNode { ? i18n.str`Please complete the marked fields` : "confirm operation" } + type="submit" > <i18n.Translate>Confirm</i18n.Translate> </ButtonBetterBulma> diff --git a/packages/merchant-backoffice-ui/src/paths/instance/tokenfamilies/list/Table.tsx b/packages/merchant-backoffice-ui/src/paths/instance/tokenfamilies/list/Table.tsx @@ -59,7 +59,12 @@ export function CardTable({ class="has-tooltip-left" data-tooltip={i18n.str`Add token family`} > - <button class="button is-info" type="button" onClick={onCreate}> + <button + class="button is-info" + type="button" + onClick={onCreate} + accesskey="+" + > <span class="icon is-small"> <i class="mdi mdi-plus mdi-36px" /> </span> @@ -155,7 +160,10 @@ function Table({ > {i.valid_after.t_s === "never" ? i18n.str`Never` - : format(new Date(i.valid_after.t_s * 1000), "yyyy/MM/dd hh:mm:ss")} + : format( + new Date(i.valid_after.t_s * 1000), + "yyyy/MM/dd hh:mm:ss", + )} </td> <td onClick={() => @@ -165,7 +173,10 @@ function Table({ > {i.valid_before.t_s === "never" ? i18n.str`Never` - : format(new Date(i.valid_before.t_s * 1000), "yyyy/MM/dd hh:mm:ss")} + : format( + new Date(i.valid_before.t_s * 1000), + "yyyy/MM/dd hh:mm:ss", + )} </td> <td onClick={() => @@ -213,7 +224,6 @@ function Table({ ); } - function EmptyTable(): VNode { const { i18n } = useTranslationContext(); return ( @@ -225,7 +235,8 @@ function EmptyTable(): VNode { </p> <p> <i18n.Translate> - There are no token families yet, add the first one by pressing the + sign. + There are no token families yet, add the first one by pressing the + + sign. </i18n.Translate> </p> </div> diff --git a/packages/merchant-backoffice-ui/src/paths/instance/tokenfamilies/update/UpdatePage.tsx b/packages/merchant-backoffice-ui/src/paths/instance/tokenfamilies/update/UpdatePage.tsx @@ -152,6 +152,7 @@ export function UpdatePage({ onUpdated, onBack, tokenFamily }: Props) { ? i18n.str`Please complete the marked fields` : i18n.str`Confirm operation` } + type="submit" onClick={update} > <i18n.Translate>Confirm</i18n.Translate> diff --git a/packages/merchant-backoffice-ui/src/paths/instance/transfers/create/CreatePage.tsx b/packages/merchant-backoffice-ui/src/paths/instance/transfers/create/CreatePage.tsx @@ -153,6 +153,7 @@ export function CreatePage({ accounts, onCreated, onBack }: Props): VNode { ? i18n.str`Please complete the marked fields` : i18n.str`Confirm operation` } + type="submit" onClick={create} > <i18n.Translate>Confirm</i18n.Translate> diff --git a/packages/merchant-backoffice-ui/src/paths/instance/transfers/list/Table.tsx b/packages/merchant-backoffice-ui/src/paths/instance/transfers/list/Table.tsx @@ -66,7 +66,12 @@ export function CardTable({ class="has-tooltip-left" data-tooltip={i18n.str`Add new transfer`} > - <button type="button" class="button is-info" onClick={onCreate}> + <button + type="button" + class="button is-info" + onClick={onCreate} + accesskey="+" + > <span class="icon is-small"> <i class="mdi mdi-plus mdi-36px" /> </span> @@ -115,7 +120,8 @@ function Table({ return ( <div class="table-container"> {onLoadMoreBefore && ( - <button type="button" + <button + type="button" class="button is-fullwidth" data-tooltip={i18n.str`Load more wire transfers preceding the first one`} onClick={onLoadMoreBefore} @@ -164,7 +170,8 @@ function Table({ </td> <td> {i.verified !== true ? ( - <button type="button" + <button + type="button" class="button is-danger is-small has-tooltip-left" data-tooltip={i18n.str`Delete selected transfer from the database`} onClick={() => onDelete(i)} @@ -179,7 +186,8 @@ function Table({ </tbody> </table> {onLoadMoreAfter && ( - <button type="button" + <button + type="button" class="button is-fullwidth" data-tooltip={i18n.str`Load more transfers after the last one`} onClick={onLoadMoreAfter} diff --git a/packages/merchant-backoffice-ui/src/paths/instance/update/DeletePage.tsx b/packages/merchant-backoffice-ui/src/paths/instance/update/DeletePage.tsx @@ -147,7 +147,7 @@ export function DeletePage({ instanceId, onBack, onDeleted }: Props): VNode { <ButtonBetterBulma class="button is-small is-danger" - type="button" + type="submit" data-tooltip={ hasErrors ? i18n.str`Please complete the marked fields` diff --git a/packages/merchant-backoffice-ui/src/paths/instance/webhooks/create/CreatePage.tsx b/packages/merchant-backoffice-ui/src/paths/instance/webhooks/create/CreatePage.tsx @@ -276,6 +276,7 @@ export function CreatePage({ onCreate, onBack }: Props): VNode { ? i18n.str`Please complete the marked fields` : i18n.str`Confirm operation` } + type="submit" onClick={create} > <i18n.Translate>Confirm</i18n.Translate> diff --git a/packages/merchant-backoffice-ui/src/paths/instance/webhooks/list/Table.tsx b/packages/merchant-backoffice-ui/src/paths/instance/webhooks/list/Table.tsx @@ -91,7 +91,12 @@ export function CardTable({ class="has-tooltip-left" data-tooltip={i18n.str`Add new webhooks`} > - <button class="button is-info" type="button" onClick={onCreate}> + <button + class="button is-info" + type="button" + onClick={onCreate} + accesskey="+" + > <span class="icon is-small"> <i class="mdi mdi-plus mdi-36px" /> </span> @@ -143,7 +148,8 @@ function Table({ return ( <div class="table-container"> {onLoadMoreBefore && ( - <button type="button" + <button + type="button" class="button is-fullwidth" data-tooltip={i18n.str`Load more webhooks before the first one`} onClick={onLoadMoreBefore} @@ -196,7 +202,8 @@ function Table({ </tbody> </table> {onLoadMoreAfter && ( - <button type="button" + <button + type="button" class="button is-fullwidth" data-tooltip={i18n.str`Load more webhooks after the last one`} onClick={onLoadMoreAfter} diff --git a/packages/merchant-backoffice-ui/src/paths/instance/webhooks/update/UpdatePage.tsx b/packages/merchant-backoffice-ui/src/paths/instance/webhooks/update/UpdatePage.tsx @@ -210,7 +210,7 @@ export function UpdatePage({ webhook, onConfirm, onBack }: Props): VNode { <div class="buttons is-right mt-5"> {onBack && ( - <button type="button"class="button" onClick={onBack}> + <button type="button" class="button" onClick={onBack}> <i18n.Translate>Cancel</i18n.Translate> </button> )} @@ -221,6 +221,7 @@ export function UpdatePage({ webhook, onConfirm, onBack }: Props): VNode { : i18n.str`Confirm operation` } onClick={update} + type="submit" > <i18n.Translate>Confirm</i18n.Translate> </ButtonBetterBulma> diff --git a/packages/merchant-backoffice-ui/src/paths/login/index.tsx b/packages/merchant-backoffice-ui/src/paths/login/index.tsx @@ -206,7 +206,7 @@ export function LoginPage({ showCreateAccount }: Props): VNode { <i18n.Translate>Forgot password</i18n.Translate> </a> )} - <ButtonBetterBulma onClick={login}> + <ButtonBetterBulma onClick={login} type="submit"> <i18n.Translate>Confirm</i18n.Translate> </ButtonBetterBulma> </footer> diff --git a/packages/merchant-backoffice-ui/src/paths/resetAccount/index.tsx b/packages/merchant-backoffice-ui/src/paths/resetAccount/index.tsx @@ -181,10 +181,10 @@ export function ResetAccount({ borderTop: 0, }} > - <button type="button"class="button" onClick={onCancel}> + <button type="button" class="button" onClick={onCancel}> <i18n.Translate>Cancel</i18n.Translate> </button> - <ButtonBetterBulma onClick={reset}> + <ButtonBetterBulma type="submit" onClick={reset}> <i18n.Translate>Reset</i18n.Translate> </ButtonBetterBulma> </footer>