commit b5507f586d5361308cc392ca286905f809b51ac7
parent 7bfccf0739dd3b5dbba9ee1b1e6f6a91e2293e10
Author: Florian Dold <florian@dold.me>
Date: Sat, 22 Mar 2025 22:28:07 +0100
form tweaks
Diffstat:
3 files changed, 16 insertions(+), 8 deletions(-)
diff --git a/packages/web-util/src/forms/gana/VQF_902_4.stories.tsx b/packages/web-util/src/forms/gana/VQF_902_4.stories.tsx
@@ -23,13 +23,12 @@ import { i18n, setupI18n } from "@gnu-taler/taler-util";
import * as tests from "../../tests/hook.js";
import { DefaultForm as TestedComponent } from "../forms-ui.js";
import { VQF_902_4 } from "./VQF_902_4.js";
+
export default {
- title: "VQF 902 4e",
+ title: "vqf_902_4",
};
setupI18n("en", {});
-type TargetObject = {};
-const initial: TargetObject = {};
export const EmptyForm = tests.createExample(TestedComponent, {
initial: {},
diff --git a/packages/web-util/src/forms/gana/VQF_902_4.ts b/packages/web-util/src/forms/gana/VQF_902_4.ts
@@ -42,7 +42,14 @@ export function VQF_902_4(
type: "isoDateText",
placeholder: "dd/MM/yyyy",
pattern: "dd/MM/yyyy",
- required: false,
+ required: true,
+ hide(value, root) {
+ return !(
+ root[TalerFormAttributes.PEP_FOREIGN] ||
+ root[TalerFormAttributes.PEP_DOMESTIC] ||
+ root[TalerFormAttributes.PEP_INTERNATIONAL_ORGANIZATION]
+ );
+ },
},
],
},
@@ -64,7 +71,10 @@ export function VQF_902_4(
type: "isoDateText",
placeholder: "dd/MM/yyyy",
pattern: "dd/MM/yyyy",
- required: false,
+ required: true,
+ hide(value, root) {
+ return !root[TalerFormAttributes.HIGH_RISK_COUNTRY];
+ },
},
],
},
diff --git a/packages/web-util/src/forms/gana/VQF_902_5.stories.tsx b/packages/web-util/src/forms/gana/VQF_902_5.stories.tsx
@@ -23,12 +23,11 @@ import { i18n, setupI18n } from "@gnu-taler/taler-util";
import * as tests from "../../tests/hook.js";
import { DefaultForm as TestedComponent } from "../forms-ui.js";
import { VQF_902_5 } from "./VQF_902_5.js";
+
export default {
- title: "VQF 902 5e",
+ title: "vqf_902_5",
};
setupI18n("en", {});
-type TargetObject = {};
-const initial: TargetObject = {};
export const EmptyForm = tests.createExample(TestedComponent, {
initial: {},