diff options
Diffstat (limited to 'packages/aml-backoffice-ui/src/pages/Cases.tsx')
-rw-r--r-- | packages/aml-backoffice-ui/src/pages/Cases.tsx | 151 |
1 files changed, 91 insertions, 60 deletions
diff --git a/packages/aml-backoffice-ui/src/pages/Cases.tsx b/packages/aml-backoffice-ui/src/pages/Cases.tsx index c229850b1..c7191332a 100644 --- a/packages/aml-backoffice-ui/src/pages/Cases.tsx +++ b/packages/aml-backoffice-ui/src/pages/Cases.tsx @@ -21,22 +21,18 @@ import { } from "@gnu-taler/taler-util"; import { Attention, - ErrorLoading, - InputChoiceHorizontal, Loading, - UIHandlerId, - amlStateConverter, useTranslationContext, } from "@gnu-taler/web-util/browser"; import { Fragment, VNode, h } from "preact"; -import { useCurrentDecisions, useCurrentDecisionsUnderInvestigation } from "../hooks/decisions.js"; +import { + useCurrentDecisions, + useCurrentDecisionsUnderInvestigation, +} from "../hooks/decisions.js"; import { privatePages } from "../Routing.js"; -import { FormErrors, RecursivePartial, useFormState } from "../hooks/form.js"; -import { undefinedIfEmpty } from "./CreateAccount.js"; -import { Officer } from "./Officer.js"; import { ErrorLoadingWithDebug } from "../components/ErrorLoadingWithDebug.js"; -import { useState } from "preact/hooks"; +import { Officer } from "./Officer.js"; type FormType = { // state: TalerExchangeApi.AmlState; @@ -48,7 +44,7 @@ export function CasesUI({ onNext, filtered, }: { - filtered: boolean, + filtered: boolean; onFirstPage?: () => void; onNext?: () => void; records: TalerExchangeApi.AmlDecision[]; @@ -93,17 +89,20 @@ export function CasesUI({ return ( <div> <div class="sm:flex sm:items-center"> - {filtered ? + {filtered ? ( <div class="px-2 sm:flex-auto"> <h1 class="text-base font-semibold leading-6 text-gray-900"> <i18n.Translate>Cases under investigation</i18n.Translate> </h1> <p class="mt-2 text-sm text-gray-700 w-80"> <i18n.Translate> - A list of all the accounts which are waiting for a deicison to be made. + A list of all the accounts which are waiting for a deicison to + be made. </i18n.Translate> </p> - </div> : <div class="px-2 sm:flex-auto"> + </div> + ) : ( + <div class="px-2 sm:flex-auto"> <h1 class="text-base font-semibold leading-6 text-gray-900"> <i18n.Translate>Cases</i18n.Translate> </h1> @@ -113,7 +112,7 @@ export function CasesUI({ </i18n.Translate> </p> </div> - } + )} </div> <div class="mt-8 flow-root"> <div class="overflow-x-auto"> @@ -155,7 +154,11 @@ export function CasesUI({ </div> </td> <td class="whitespace-nowrap px-3 py-5 text-sm text-gray-900"> - {r.to_investigate ? <span title="require investigation"><ToInvestigateIcon /></span> : undefined} + {r.to_investigate ? ( + <span title="require investigation"> + <ToInvestigateIcon /> + </span> + ) : undefined} </td> </tr> ); @@ -189,7 +192,8 @@ export function Cases() { <Fragment> <Attention type="danger" title={i18n.str`Operation denied`}> <i18n.Translate> - This account signature is wrong, contact administrator or create a new one. + This account signature is wrong, contact administrator or create + a new one. </i18n.Translate> </Attention> <Officer /> @@ -200,27 +204,26 @@ export function Cases() { return ( <Fragment> <Attention type="danger" title={i18n.str`Operation denied`}> - <i18n.Translate> - This account is not known. - </i18n.Translate> - </Attention> - <Officer /> - </Fragment> - ); - } - case HttpStatusCode.Conflict: { - return ( - <Fragment> - <Attention type="danger" title={i18n.str`Operation denied`}> - <i18n.Translate> - This account doesn't have access. Request account activation - sending your public key. - </i18n.Translate> + <i18n.Translate>This account is not known.</i18n.Translate> </Attention> <Officer /> </Fragment> ); } + case HttpStatusCode.Conflict: + { + return ( + <Fragment> + <Attention type="danger" title={i18n.str`Operation denied`}> + <i18n.Translate> + This account doesn't have access. Request account activation + sending your public key. + </i18n.Translate> + </Attention> + <Officer /> + </Fragment> + ); + } return <Officer />; default: assertUnreachable(list); @@ -233,10 +236,10 @@ export function Cases() { records={list.body} onFirstPage={list.isFirstPage ? undefined : list.loadFirst} onNext={list.isLastPage ? undefined : list.loadNext} - // filter={stateFilter} - // onChangeFilter={(d) => { - // setStateFilter(d); - // }} + // filter={stateFilter} + // onChangeFilter={(d) => { + // setStateFilter(d); + // }} /> ); } @@ -258,7 +261,8 @@ export function CasesUnderInvestigation() { <Fragment> <Attention type="danger" title={i18n.str`Operation denied`}> <i18n.Translate> - This account signature is wrong, contact administrator or create a new one. + This account signature is wrong, contact administrator or create + a new one. </i18n.Translate> </Attention> <Officer /> @@ -269,27 +273,26 @@ export function CasesUnderInvestigation() { return ( <Fragment> <Attention type="danger" title={i18n.str`Operation denied`}> - <i18n.Translate> - This account is not known. - </i18n.Translate> - </Attention> - <Officer /> - </Fragment> - ); - } - case HttpStatusCode.Conflict: { - return ( - <Fragment> - <Attention type="danger" title={i18n.str`Operation denied`}> - <i18n.Translate> - This account doesn't have access. Request account activation - sending your public key. - </i18n.Translate> + <i18n.Translate>This account is not known.</i18n.Translate> </Attention> <Officer /> </Fragment> ); } + case HttpStatusCode.Conflict: + { + return ( + <Fragment> + <Attention type="danger" title={i18n.str`Operation denied`}> + <i18n.Translate> + This account doesn't have access. Request account activation + sending your public key. + </i18n.Translate> + </Attention> + <Officer /> + </Fragment> + ); + } return <Officer />; default: assertUnreachable(list); @@ -302,10 +305,10 @@ export function CasesUnderInvestigation() { records={list.body} onFirstPage={list.isFirstPage ? undefined : list.loadFirst} onNext={list.isLastPage ? undefined : list.loadNext} - // filter={stateFilter} - // onChangeFilter={(d) => { - // setStateFilter(d); - // }} + // filter={stateFilter} + // onChangeFilter={(d) => { + // setStateFilter(d); + // }} /> ); } @@ -316,12 +319,23 @@ export function CasesUnderInvestigation() { // </svg> // } export const ToInvestigateIcon = () => ( - <svg title="requires investigation" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-6 w-6"> - <path stroke-linecap="round" stroke-linejoin="round" d="M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126ZM12 15.75h.007v.008H12v-.008Z" /> + <svg + title="requires investigation" + xmlns="http://www.w3.org/2000/svg" + fill="none" + viewBox="0 0 24 24" + stroke-width="1.5" + stroke="currentColor" + class="size-6 w-6" + > + <path + stroke-linecap="round" + stroke-linejoin="round" + d="M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126ZM12 15.75h.007v.008H12v-.008Z" + /> </svg> ); - export const PeopleIcon = () => ( <svg xmlns="http://www.w3.org/2000/svg" @@ -356,6 +370,23 @@ export const HomeIcon = () => ( </svg> ); +export const SearchIcon = () => ( + <svg + xmlns="http://www.w3.org/2000/svg" + fill="none" + viewBox="0 0 24 24" + stroke-width="1.5" + stroke="currentColor" + class="w-6 h-6" + > + <path + stroke-linecap="round" + stroke-linejoin="round" + d="m21 21-5.197-5.197m0 0A7.5 7.5 0 1 0 5.196 5.196a7.5 7.5 0 0 0 10.607 10.607Z" + /> + </svg> +); + function Pagination({ onFirstPage, onNext, |