taler-typescript-core

Wallet core logic and WebUIs for various components
Log | Files | Refs | Submodules | README | LICENSE

commit 388ca54e3f72472368e41833298ac75aa948f2c7
parent c4204448c46dd8f847feff6eefb3a67b1804d0ce
Author: Sebastian <sebasjm@gmail.com>
Date:   Wed, 13 Nov 2024 14:59:54 -0300

use custom measure

Diffstat:
Mpackages/aml-backoffice-ui/src/pages/CaseDetails.tsx | 221+++++++++++++++++++++++++++++++++++++++++--------------------------------------
1 file changed, 115 insertions(+), 106 deletions(-)

diff --git a/packages/aml-backoffice-ui/src/pages/CaseDetails.tsx b/packages/aml-backoffice-ui/src/pages/CaseDetails.tsx @@ -371,17 +371,26 @@ export function CaseDetails({ ), h_payto: account, keep_investigating: false, - properties: { - pepe: "text", - }, - new_measures: "ask", + properties: {}, + // the custom meaure with context + new_measures: "askMoreInfo", new_rules: { - custom_measures: {}, + custom_measures: { + ask_more_info: { + context: { + // this value is going to be overriden + form: {}, + }, + // check of type form, it will use the officer defined form + check_name: "askContext", + // after that, mark as investigate to read what the user sent + prog_name: "markInvestigate", + }, + }, expiration_time: AbsoluteTime.toProtocolTimestamp( AbsoluteTime.never(), ), rules: FREEZE_RULES(config.currency), - successor_measure: "verboten", }, }, askInformation: true, @@ -713,113 +722,113 @@ function ShowDecisionLimitInfo({ return ( <div class="overflow-hidden ring-1 ring-gray-900/5 rounded-xl"> - <Header /> - <div class="p-4 grid gap-y-4"> - {!justification ? undefined : ( - <div class=""> - <label - for="comment" - class="block text-sm font-medium leading-6 text-gray-900" - > - <i18n.Translate>AML officer justification</i18n.Translate> - </label> - <div class="mt-2"> - <textarea - rows={2} - readOnly - name="comment" - id="comment" - class="block w-full rounded-md border-0 py-1.5 text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-indigo-600 sm:text-sm sm:leading-6" - > - {justification} - </textarea> - </div> - </div> - )} - + <Header /> + <div class="p-4 grid gap-y-4"> + {!justification ? undefined : ( <div class=""> - <div class="flex mt-2 rounded-md w-fit shadow-sm border-0 ring-1 ring-inset ring-gray-300 focus:ring-2 focus:ring-inset focus:ring-indigo-600"> - <div class="whitespace-nowrap pointer-events-none bg-gray-200 inset-y-0 items-center px-3 flex"> - <i18n.Translate>Max balance</i18n.Translate> - </div> - <div class="p-2 disabled:bg-gray-200 text-right rounded-md rounded-l-none data-[left=true]:text-left py-1.5 pl-3 text-gray-900 placeholder:text-gray-400 sm:text-sm sm:leading-6"> - {!balanceLimit ? ( - <i18n.Translate>Unlimited</i18n.Translate> - ) : ( - <RenderAmount - value={Amounts.parseOrThrow(balanceLimit.threshold)} - spec={config.currency_specification} - /> - )} - </div> + <label + for="comment" + class="block text-sm font-medium leading-6 text-gray-900" + > + <i18n.Translate>AML officer justification</i18n.Translate> + </label> + <div class="mt-2"> + <textarea + rows={2} + readOnly + name="comment" + id="comment" + class="block w-full rounded-md border-0 py-1.5 text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-indigo-600 sm:text-sm sm:leading-6" + > + {justification} + </textarea> </div> </div> + )} - {!ruleSet.rules.length ? ( - <Attention - title={i18n.str`There are no rules for operations`} - type="warning" - /> - ) : ( - <div class=""> - <table class="min-w-full divide-y divide-gray-300"> - <thead class="bg-gray-50"> - <tr> - <th - scope="col" - class="py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-gray-900 sm:pl-6" - > - <i18n.Translate>Operation</i18n.Translate> - </th> - <th - scope="col" - class="px-3 py-3.5 text-left text-sm font-semibold text-gray-900" - > - <i18n.Translate>Timeframe</i18n.Translate> - </th> - <th - scope="col" - class="relative py-3.5 pl-3 pr-4 sm:pr-6 text-right" - > - <i18n.Translate>Amount</i18n.Translate> - </th> - </tr> - </thead> - <tbody class="divide-y divide-gray-200"> - {ruleSet.rules.map((r) => { - if (r.operation_type === "BALANCE") return; - return ( - <tr> - <td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm font-medium text-gray-900 sm:pl-6 text-left"> - {r.operation_type} - </td> - <td class="whitespace-nowrap px-3 py-4 text-sm text-gray-500"> - {r.timeframe.d_us === "forever" ? ( - <i18n.Translate>Forever</i18n.Translate> - ) : ( - formatDuration( - intervalToDuration({ - start: 0, - end: r.timeframe.d_us / 1000, - }), - ) - )} - </td> - <td class=" relative whitespace-nowrap py-4 pl-3 pr-4 text-right text-sm font-medium sm:pr-6 text-right"> - <RenderAmount - value={Amounts.parseOrThrow(r.threshold)} - spec={config.currency_specification} - /> - </td> - </tr> - ); - })} - </tbody> - </table> + <div class=""> + <div class="flex mt-2 rounded-md w-fit shadow-sm border-0 ring-1 ring-inset ring-gray-300 focus:ring-2 focus:ring-inset focus:ring-indigo-600"> + <div class="whitespace-nowrap pointer-events-none bg-gray-200 inset-y-0 items-center px-3 flex"> + <i18n.Translate>Max balance</i18n.Translate> + </div> + <div class="p-2 disabled:bg-gray-200 text-right rounded-md rounded-l-none data-[left=true]:text-left py-1.5 pl-3 text-gray-900 placeholder:text-gray-400 sm:text-sm sm:leading-6"> + {!balanceLimit ? ( + <i18n.Translate>Unlimited</i18n.Translate> + ) : ( + <RenderAmount + value={Amounts.parseOrThrow(balanceLimit.threshold)} + spec={config.currency_specification} + /> + )} </div> - )} + </div> </div> + + {!ruleSet.rules.length ? ( + <Attention + title={i18n.str`There are no rules for operations`} + type="warning" + /> + ) : ( + <div class=""> + <table class="min-w-full divide-y divide-gray-300"> + <thead class="bg-gray-50"> + <tr> + <th + scope="col" + class="py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-gray-900 sm:pl-6" + > + <i18n.Translate>Operation</i18n.Translate> + </th> + <th + scope="col" + class="px-3 py-3.5 text-left text-sm font-semibold text-gray-900" + > + <i18n.Translate>Timeframe</i18n.Translate> + </th> + <th + scope="col" + class="relative py-3.5 pl-3 pr-4 sm:pr-6 text-right" + > + <i18n.Translate>Amount</i18n.Translate> + </th> + </tr> + </thead> + <tbody class="divide-y divide-gray-200"> + {ruleSet.rules.map((r) => { + if (r.operation_type === "BALANCE") return; + return ( + <tr> + <td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm font-medium text-gray-900 sm:pl-6 text-left"> + {r.operation_type} + </td> + <td class="whitespace-nowrap px-3 py-4 text-sm text-gray-500"> + {r.timeframe.d_us === "forever" ? ( + <i18n.Translate>Forever</i18n.Translate> + ) : ( + formatDuration( + intervalToDuration({ + start: 0, + end: r.timeframe.d_us / 1000, + }), + ) + )} + </td> + <td class=" relative whitespace-nowrap py-4 pl-3 pr-4 text-right text-sm font-medium sm:pr-6 text-right"> + <RenderAmount + value={Amounts.parseOrThrow(r.threshold)} + spec={config.currency_specification} + /> + </td> + </tr> + ); + })} + </tbody> + </table> + </div> + )} </div> + </div> ); }