diff options
author | Sebastian <sebasjm@gmail.com> | 2024-04-29 17:23:04 -0300 |
---|---|---|
committer | Sebastian <sebasjm@gmail.com> | 2024-04-29 17:23:04 -0300 |
commit | 22709ff4e2918a8d0e528539d11d761381920b45 (patch) | |
tree | 7e01f9115ed44e5e3875e3473eb0d31314380d5a /packages/aml-backoffice-ui/src/forms | |
parent | eeabe64b3f0ac02818561ea6fca364d619f061b7 (diff) | |
download | wallet-core-22709ff4e2918a8d0e528539d11d761381920b45.tar.xz |
use exchange api type and start using ui_fields
Diffstat (limited to 'packages/aml-backoffice-ui/src/forms')
-rw-r--r-- | packages/aml-backoffice-ui/src/forms/declaration.ts | 5 | ||||
-rw-r--r-- | packages/aml-backoffice-ui/src/forms/simplest.ts | 16 |
2 files changed, 9 insertions, 12 deletions
diff --git a/packages/aml-backoffice-ui/src/forms/declaration.ts b/packages/aml-backoffice-ui/src/forms/declaration.ts index fb7b8f334..c467f537b 100644 --- a/packages/aml-backoffice-ui/src/forms/declaration.ts +++ b/packages/aml-backoffice-ui/src/forms/declaration.ts @@ -14,12 +14,11 @@ GNU Taler; see the file COPYING. If not, see <http://www.gnu.org/licenses/> */ -import type { AmountJson, TranslatedString } from "@gnu-taler/taler-util"; +import type { AmountJson, TalerExchangeApi, TranslatedString } from "@gnu-taler/taler-util"; import type { FlexibleForm, InternationalizationAPI, } from "@gnu-taler/web-util/browser"; -import { AmlExchangeBackend } from "../utils/types.js"; /** * import entry point without hard reference. @@ -32,7 +31,7 @@ import { AmlExchangeBackend } from "../utils/types.js"; */ export interface BaseForm { - state: AmlExchangeBackend.AmlState; + state: TalerExchangeApi.AmlState; threshold: AmountJson; } diff --git a/packages/aml-backoffice-ui/src/forms/simplest.ts b/packages/aml-backoffice-ui/src/forms/simplest.ts index bd512546d..6455b6f41 100644 --- a/packages/aml-backoffice-ui/src/forms/simplest.ts +++ b/packages/aml-backoffice-ui/src/forms/simplest.ts @@ -13,13 +13,13 @@ You should have received a copy of the GNU General Public License along with GNU Taler; see the file COPYING. If not, see <http://www.gnu.org/licenses/> */ -import type { - TranslatedString +import { + TalerExchangeApi, + type TranslatedString } from "@gnu-taler/taler-util"; import type { DoubleColumnFormSection, FlexibleForm, FormState, InternationalizationAPI } from "@gnu-taler/web-util/browser"; import { amlStateConverter } from "../utils/converter.js"; -import { AmlExchangeBackend } from "../utils/types.js"; import { BaseForm } from "./declaration.js"; export const v1 = (i18n: InternationalizationAPI) => (current: BaseForm): FlexibleForm<Simplest.Form> => ({ @@ -44,10 +44,9 @@ export const v1 = (i18n: InternationalizationAPI) => (current: BaseForm): Flexib return { comment: { help: ((v.comment?.length ?? 0) > 100 ? "keep it short" : "") as TranslatedString, - }, threshold: { - disabled: v.state === AmlExchangeBackend.AmlState.frozen, + disabled: v.state === TalerExchangeApi.AmlState.frozen, }, }; }, @@ -71,18 +70,17 @@ export function resolutionSection(current: BaseForm, i18n: InternationalizationA props: { name: "state", label: i18n.str`New state`, - converter: amlStateConverter, choices: [ { - value: AmlExchangeBackend.AmlState.frozen, + value: TalerExchangeApi.AmlState.frozen, label: i18n.str`Frozen`, }, { - value: AmlExchangeBackend.AmlState.pending, + value: TalerExchangeApi.AmlState.pending, label: i18n.str`Pending`, }, { - value: AmlExchangeBackend.AmlState.normal, + value: TalerExchangeApi.AmlState.normal, label: i18n.str`Normal`, }, ], |