diff options
Diffstat (limited to 'packages/merchant-backoffice-ui/src/paths/instance/orders/list')
4 files changed, 25 insertions, 26 deletions
diff --git a/packages/merchant-backoffice-ui/src/paths/instance/orders/list/List.stories.tsx b/packages/merchant-backoffice-ui/src/paths/instance/orders/list/List.stories.tsx index 9df006083..5c9969689 100644 --- a/packages/merchant-backoffice-ui/src/paths/instance/orders/list/List.stories.tsx +++ b/packages/merchant-backoffice-ui/src/paths/instance/orders/list/List.stories.tsx @@ -19,8 +19,9 @@ * @author Sebastian Javier Marchano (sebasjm) */ -import { h, VNode, FunctionalComponent } from "preact"; +import { FunctionalComponent, h } from "preact"; import { ListPage as TestedComponent } from "./ListPage.js"; +import { AmountString } from "@gnu-taler/taler-util"; export default { title: "Pages/Order/List", @@ -54,7 +55,7 @@ export const Example = createExample(TestedComponent, { orders: [ { id: "123", - amount: "TESTKUDOS:10", + amount: "TESTKUDOS:10" as AmountString, paid: false, refundable: true, row_id: 1, @@ -66,7 +67,7 @@ export const Example = createExample(TestedComponent, { }, { id: "234", - amount: "TESTKUDOS:12", + amount: "TESTKUDOS:12" as AmountString, paid: true, refundable: true, row_id: 2, @@ -79,7 +80,7 @@ export const Example = createExample(TestedComponent, { }, { id: "456", - amount: "TESTKUDOS:1", + amount: "TESTKUDOS:1" as AmountString, paid: false, refundable: false, row_id: 3, @@ -92,7 +93,7 @@ export const Example = createExample(TestedComponent, { }, { id: "234", - amount: "TESTKUDOS:12", + amount: "TESTKUDOS:12" as AmountString, paid: false, refundable: false, row_id: 4, diff --git a/packages/merchant-backoffice-ui/src/paths/instance/orders/list/ListPage.tsx b/packages/merchant-backoffice-ui/src/paths/instance/orders/list/ListPage.tsx index b45d468cb..7b88985dc 100644 --- a/packages/merchant-backoffice-ui/src/paths/instance/orders/list/ListPage.tsx +++ b/packages/merchant-backoffice-ui/src/paths/instance/orders/list/ListPage.tsx @@ -19,14 +19,14 @@ * @author Sebastian Javier Marchano (sebasjm) */ +import { TalerMerchantApi } from "@gnu-taler/taler-util"; import { useTranslationContext } from "@gnu-taler/web-util/browser"; import { format } from "date-fns"; -import { h, VNode, Fragment } from "preact"; +import { Fragment, VNode, h } from "preact"; import { useState } from "preact/hooks"; import { DatePicker } from "../../../../components/picker/DatePicker.js"; -import { MerchantBackend, WithId } from "../../../../declaration.js"; -import { CardTable } from "./Table.js"; import { dateFormatForSettings, usePreference } from "../../../../hooks/preference.js"; +import { CardTable } from "./Table.js"; export interface ListPageProps { onShowAll: () => void; @@ -46,14 +46,14 @@ export interface ListPageProps { jumpToDate?: Date; onSelectDate: (date?: Date) => void; - orders: (MerchantBackend.Orders.OrderHistoryEntry & WithId)[]; + orders: (TalerMerchantApi.OrderHistoryEntry & WithId)[]; onLoadMoreBefore?: () => void; hasMoreBefore?: boolean; hasMoreAfter?: boolean; onLoadMoreAfter?: () => void; - onSelectOrder: (o: MerchantBackend.Orders.OrderHistoryEntry & WithId) => void; - onRefundOrder: (o: MerchantBackend.Orders.OrderHistoryEntry & WithId) => void; + onSelectOrder: (o: TalerMerchantApi.OrderHistoryEntry & WithId) => void; + onRefundOrder: (o: TalerMerchantApi.OrderHistoryEntry & WithId) => void; onCreate: () => void; } diff --git a/packages/merchant-backoffice-ui/src/paths/instance/orders/list/Table.tsx b/packages/merchant-backoffice-ui/src/paths/instance/orders/list/Table.tsx index cebc4afe6..c3df81b87 100644 --- a/packages/merchant-backoffice-ui/src/paths/instance/orders/list/Table.tsx +++ b/packages/merchant-backoffice-ui/src/paths/instance/orders/list/Table.tsx @@ -19,13 +19,13 @@ * @author Sebastian Javier Marchano (sebasjm) */ -import { Amounts } from "@gnu-taler/taler-util"; +import { Amounts, TalerMerchantApi } from "@gnu-taler/taler-util"; import { useMerchantApiContext, useTranslationContext, } from "@gnu-taler/web-util/browser"; import { format } from "date-fns"; -import { h, VNode } from "preact"; +import { VNode, h } from "preact"; import { StateUpdater, useState } from "preact/hooks"; import { FormErrors, @@ -36,14 +36,13 @@ import { InputCurrency } from "../../../../components/form/InputCurrency.js"; import { InputGroup } from "../../../../components/form/InputGroup.js"; import { InputSelector } from "../../../../components/form/InputSelector.js"; import { ConfirmModal } from "../../../../components/modal/index.js"; -import { MerchantBackend, WithId } from "../../../../declaration.js"; -import { mergeRefunds } from "../../../../utils/amount.js"; import { datetimeFormatForSettings, usePreference, } from "../../../../hooks/preference.js"; +import { mergeRefunds } from "../../../../utils/amount.js"; -type Entity = MerchantBackend.Orders.OrderHistoryEntry & WithId; +type Entity = TalerMerchantApi.OrderHistoryEntry & WithId; interface Props { orders: Entity[]; onRefund: (value: Entity) => void; @@ -248,8 +247,8 @@ function EmptyTable(): VNode { interface RefundModalProps { onCancel: () => void; - onConfirm: (value: MerchantBackend.Orders.RefundRequest) => void; - order: MerchantBackend.Orders.MerchantOrderStatusResponse; + onConfirm: (value: TalerMerchantApi.RefundRequest) => void; + order: TalerMerchantApi.MerchantOrderStatusResponse; } export function RefundModal({ diff --git a/packages/merchant-backoffice-ui/src/paths/instance/orders/list/index.tsx b/packages/merchant-backoffice-ui/src/paths/instance/orders/list/index.tsx index 369ef8c8b..cd62685ca 100644 --- a/packages/merchant-backoffice-ui/src/paths/instance/orders/list/index.tsx +++ b/packages/merchant-backoffice-ui/src/paths/instance/orders/list/index.tsx @@ -19,16 +19,17 @@ * @author Sebastian Javier Marchano (sebasjm) */ +import { HttpStatusCode, TalerErrorDetail, TalerMerchantApi } from "@gnu-taler/taler-util"; import { ErrorType, HttpError, useTranslationContext, } from "@gnu-taler/web-util/browser"; -import { Fragment, h, VNode } from "preact"; +import { Fragment, VNode, h } from "preact"; import { useState } from "preact/hooks"; import { Loading } from "../../../../components/exception/loading.js"; +import { JumpToElementById } from "../../../../components/form/JumpToElementById.js"; import { NotificationCard } from "../../../../components/menu/index.js"; -import { MerchantBackend } from "../../../../declaration.js"; import { InstanceOrderFilter, useInstanceOrders, @@ -38,12 +39,10 @@ import { import { Notification } from "../../../../utils/types.js"; import { ListPage } from "./ListPage.js"; import { RefundModal } from "./Table.js"; -import { HttpStatusCode } from "@gnu-taler/taler-util"; -import { JumpToElementById } from "../../../../components/form/JumpToElementById.js"; interface Props { onUnauthorized: () => VNode; - onLoadError: (error: HttpError<MerchantBackend.ErrorDetail>) => VNode; + onLoadError: (error: HttpError<TalerErrorDetail>) => VNode; onNotFound: () => VNode; onSelect: (id: string) => void; onCreate: () => void; @@ -58,7 +57,7 @@ export default function OrderList({ }: Props): VNode { const [filter, setFilter] = useState<InstanceOrderFilter>({ paid: "no" }); const [orderToBeRefunded, setOrderToBeRefunded] = useState< - MerchantBackend.Orders.OrderHistoryEntry | undefined + TalerMerchantApi.OrderHistoryEntry | undefined >(undefined); const setNewDate = (date?: Date): void => @@ -186,10 +185,10 @@ export default function OrderList({ interface RefundProps { id: string; onUnauthorized: () => VNode; - onLoadError: (error: HttpError<MerchantBackend.ErrorDetail>) => VNode; + onLoadError: (error: HttpError<TalerErrorDetail>) => VNode; onNotFound: () => VNode; onCancel: () => void; - onConfirm: (m: MerchantBackend.Orders.RefundRequest) => void; + onConfirm: (m: TalerMerchantApi.RefundRequest) => void; } function RefundModalForTable({ |