aboutsummaryrefslogtreecommitdiff
path: root/packages/merchant-backoffice-ui/src/paths/instance/accounts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/merchant-backoffice-ui/src/paths/instance/accounts')
-rw-r--r--packages/merchant-backoffice-ui/src/paths/instance/accounts/create/CreatePage.tsx64
-rw-r--r--packages/merchant-backoffice-ui/src/paths/instance/accounts/update/UpdatePage.tsx16
2 files changed, 33 insertions, 47 deletions
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
index d0e7a83cd..1d08c5058 100644
--- a/packages/merchant-backoffice-ui/src/paths/instance/accounts/create/CreatePage.tsx
+++ b/packages/merchant-backoffice-ui/src/paths/instance/accounts/create/CreatePage.tsx
@@ -35,7 +35,7 @@ import { ImportingAccountModal } from "../../../../components/modal/index.js";
import { undefinedIfEmpty } from "../../../../utils/table.js";
import { safeConvertURL } from "../update/UpdatePage.js";
-type Entity = TalerMerchantApi.AccountAddDetails & { repeatPassword: string };
+type Entity = TalerMerchantApi.AccountAddDetails;
interface Props {
onCreate: (d: TalerMerchantApi.AccountAddDetails) => Promise<void>;
@@ -78,13 +78,6 @@ export function CreatePage({ onCreate, onBack }: Props): VNode {
: facadeURL.hash
? i18n.str`URL should not hash param`
: undefined,
- repeatPassword: !state.credit_facade_credentials
- ? undefined
- : state.credit_facade_credentials.type === "basic" &&
- (!state.credit_facade_credentials.password ||
- state.credit_facade_credentials.password !== state.repeatPassword)
- ? i18n.str`is not the same`
- : undefined,
};
const hasErrors = Object.keys(errors).some(
@@ -119,23 +112,35 @@ export function CreatePage({ onCreate, onBack }: Props): VNode {
};
return (
<div>
- {importing && <ImportingAccountModal onCancel={()=> {setImporting(false)}} onConfirm={(ac) => {
- state.payto_uri = ac.accountURI
- const u = new URL(ac.infoURL)
- u.password = ""
- if (u.username || u.password) {
- state.credit_facade_credentials = {
- type: "basic",
- password: u.password,
- username: u.username,
- }
- state.repeatPassword = u.password
- }
- u.password = ""
- u.username = ""
- state.credit_facade_url = u.href;
- setImporting(false)
- }} />}
+ {importing && (
+ <ImportingAccountModal
+ onCancel={() => {
+ setImporting(false);
+ }}
+ onConfirm={(ac) => {
+ state.payto_uri = ac.accountURI;
+ const u = new URL(ac.infoURL);
+ // if (u.username && ac.accesToken) {
+ // state.credit_facade_credentials = {
+ // type: "bearer",
+ // token: ac.accesToken,
+ // username: u.username,
+ // };
+ // } else
+ if (u.username || u.password) {
+ state.credit_facade_credentials = {
+ type: "basic",
+ password: u.password,
+ username: u.username,
+ };
+ }
+ u.password = "";
+ u.username = "";
+ state.credit_facade_url = u.href;
+ setImporting(false);
+ }}
+ />
+ )}
<section class="section is-main-section">
<div class="columns">
<div class="column" />
@@ -152,7 +157,7 @@ export function CreatePage({ onCreate, onBack }: Props): VNode {
<Input<Entity>
name="credit_facade_url"
label={i18n.str`Account info URL`}
- help="https://bank.com"
+ help="https://bank.demo.taler.net/accounts/_username_/taler-revenue/"
expand
tooltip={i18n.str`From where the merchant can download information about incoming wire transfers to this account`}
/>
@@ -179,11 +184,6 @@ export function CreatePage({ onCreate, onBack }: Props): VNode {
label={i18n.str`Password`}
tooltip={i18n.str`Password to access the account information.`}
/>
- <Input
- name="repeatPassword"
- inputType="password"
- label={i18n.str`Repeat password`}
- />
</Fragment>
) : undefined}
</FormProvider>
@@ -193,7 +193,7 @@ export function CreatePage({ onCreate, onBack }: Props): VNode {
class="button is-info"
data-tooltip={i18n.str`Need to complete marked fields`}
onClick={() => {
- setImporting(true)
+ setImporting(true);
}}
>
<i18n.Translate>Import from bank</i18n.Translate>
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
index 1a8e9bdc1..c4ba1f0f2 100644
--- a/packages/merchant-backoffice-ui/src/paths/instance/accounts/update/UpdatePage.tsx
+++ b/packages/merchant-backoffice-ui/src/paths/instance/accounts/update/UpdatePage.tsx
@@ -83,15 +83,6 @@ export function UpdatePage({ account, onUpdate, onBack }: Props): VNode {
? i18n.str`required`
: undefined,
- repeatPassword:
- state.credit_facade_credentials?.type !== "basic"
- ? undefined
- : !(state.credit_facade_credentials as any).repeatPassword
- ? i18n.str`required`
- : (state.credit_facade_credentials as any).repeatPassword !==
- state.credit_facade_credentials.password
- ? i18n.str`doesn't match`
- : undefined,
}),
};
@@ -158,7 +149,7 @@ export function UpdatePage({ account, onUpdate, onBack }: Props): VNode {
<Input<Entity>
name="credit_facade_url"
label={i18n.str`Account info URL`}
- help="https://bank.com"
+ help="https://bank.demo.taler.net/accounts/_username_/taler-revenue/"
expand
tooltip={i18n.str`From where the merchant can download information about incoming wire transfers to this account`}
/>
@@ -186,11 +177,6 @@ export function UpdatePage({ account, onUpdate, onBack }: Props): VNode {
label={i18n.str`Password`}
tooltip={i18n.str`Password to access the account information.`}
/>
- <Input
- name="credit_facade_credentials.repeatPassword"
- inputType="password"
- label={i18n.str`Repeat password`}
- />
</Fragment>
) : undefined}
</FormProvider>