commit cf34d660cae69ecc21d654c75e56fa0b55ac85af
parent 6cb78d3c8b8bfe95e153946e5d0da8114bd2039e
Author: Sebastian <sebasjm@gmail.com>
Date: Mon, 17 Mar 2025 17:37:16 -0300
upload attributes
Diffstat:
2 files changed, 37 insertions(+), 4 deletions(-)
diff --git a/packages/aml-backoffice-ui/src/pages/decision/Information.tsx b/packages/aml-backoffice-ui/src/pages/decision/Information.tsx
@@ -110,7 +110,9 @@ function FillCustomerData({
</h1>
<a
class="text-indigo-700 cursor-pointer p-2 text-sm leading-6 font-semibold"
- onClick={changeForm}
+ onClick={() => {
+ changeForm()
+ }}
>
<i18n.Translate>change form</i18n.Translate>
</a>
@@ -140,6 +142,7 @@ function SelectForm({
}): VNode {
const { i18n } = useTranslationContext();
const design = formDesign(i18n, forms);
+ const [request, _, updateRequest] = useCurrentDecisionRequest();
const form = useForm<SelectFormType>(design, {
formId: undefined,
@@ -151,6 +154,14 @@ function SelectForm({
onSelectForm(fid);
}, [fid]);
+ onComponentUnload(() => {
+ updateRequest({
+ ...request,
+ information: undefined
+ });
+ });
+
+
return (
<div>
<FormUI design={design} handler={form.handler} />
diff --git a/packages/aml-backoffice-ui/src/pages/decision/Summary.tsx b/packages/aml-backoffice-ui/src/pages/decision/Summary.tsx
@@ -66,6 +66,8 @@ export function Summary({
const INVALID_JUSTIFICATION =
decision.justification === undefined || !decision.justification;
const INVALID_ACCOUNT = !account;
+ const INVALID_INFORMATION =
+ decision.information !== undefined && decision.information.errors !== undefined;
const CANT_SUBMIT =
INVALID_ACCOUNT ||
@@ -73,7 +75,8 @@ export function Summary({
INVALID_JUSTIFICATION ||
INVALID_MEASURES ||
INVALID_PROPERTIES ||
- INVALID_RULES;
+ INVALID_RULES ||
+ INVALID_INFORMATION;
function clearUp() {
updateDecision({
@@ -112,6 +115,12 @@ export function Summary({
successor_measure: decision.onExpire_measures!.join(" "),
custom_measures: {}, // TODO: compute custom measures
},
+ attributes_expiration: decision.information?.expiration
+ ? AbsoluteTime.toProtocolTimestamp(
+ decision.information.expiration,
+ )
+ : undefined,
+ attributes: decision.information?.data,
properties: decision.properties!, // TODO: compute properites
new_measures: decision.new_measures!.join(" "),
};
@@ -223,7 +232,7 @@ export function Summary({
onClose={() => onMove("events")}
>
<i18n.Translate>
- You should specify in the properties section.
+ You should specify in the events section.
</i18n.Translate>
</Attention>
) : (
@@ -236,7 +245,20 @@ export function Summary({
onClose={() => onMove("justification")}
>
<i18n.Translate>
- You should specify in the properties section.
+ You should specify in the justification section.
+ </i18n.Translate>
+ </Attention>
+ ) : (
+ <div />
+ )}
+ {INVALID_INFORMATION ? (
+ <Attention
+ type="danger"
+ title={i18n.str`Invalid form information`}
+ onClose={() => onMove("information")}
+ >
+ <i18n.Translate>
+ You should specify in the information section.
</i18n.Translate>
</Attention>
) : (