[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-wallet-core] branch master updated: fix #8354: show import key af
From: |
gnunet |
Subject: |
[taler-wallet-core] branch master updated: fix #8354: show import key after updating |
Date: |
Fri, 09 Feb 2024 15:11:41 +0100 |
This is an automated email from the git hooks/post-receive script.
sebasjm pushed a commit to branch master
in repository wallet-core.
The following commit(s) were added to refs/heads/master by this push:
new 8055f8834 fix #8354: show import key after updating
8055f8834 is described below
commit 8055f8834974773170f83c7013174e141ced53cb
Author: Sebastian <sebasjm@gmail.com>
AuthorDate: Fri Feb 9 11:11:34 2024 -0300
fix #8354: show import key after updating
---
.../merchant-backoffice-ui/src/declaration.d.ts | 4 ----
.../instance/orders/details/Detail.stories.tsx | 2 --
.../otp_devices/create/CreatedSuccessfully.tsx | 4 ----
.../src/paths/instance/otp_devices/list/Table.tsx | 2 +-
.../paths/instance/otp_devices/update/index.tsx | 24 +++++++++++++++++++---
5 files changed, 22 insertions(+), 14 deletions(-)
diff --git a/packages/merchant-backoffice-ui/src/declaration.d.ts
b/packages/merchant-backoffice-ui/src/declaration.d.ts
index 38ab9d254..d716fe132 100644
--- a/packages/merchant-backoffice-ui/src/declaration.d.ts
+++ b/packages/merchant-backoffice-ui/src/declaration.d.ts
@@ -912,10 +912,6 @@ export namespace MerchantBackend {
// available, otherwise empty array.
wire_details: TransactionWireTransfer[];
- // Reports about trouble obtaining wire transfer details,
- // empty array if no trouble were encountered.
- wire_reports: TransactionWireReport[];
-
// The refund details for this order. One entry per
// refunded coin; empty array if there are no refunds.
refund_details: RefundDetails[];
diff --git
a/packages/merchant-backoffice-ui/src/paths/instance/orders/details/Detail.stories.tsx
b/packages/merchant-backoffice-ui/src/paths/instance/orders/details/Detail.stories.tsx
index 6e73a01a5..8b892e122 100644
---
a/packages/merchant-backoffice-ui/src/paths/instance/orders/details/Detail.stories.tsx
+++
b/packages/merchant-backoffice-ui/src/paths/instance/orders/details/Detail.stories.tsx
@@ -91,7 +91,6 @@ export const PaidNotRefundable =
createExample(TestedComponent, {
refund_details: [],
refund_pending: false,
wire_details: [],
- wire_reports: [],
wired: false,
},
});
@@ -115,7 +114,6 @@ export const PaidRefundable =
createExample(TestedComponent, {
refund_details: [],
refund_pending: false,
wire_details: [],
- wire_reports: [],
wired: false,
},
});
diff --git
a/packages/merchant-backoffice-ui/src/paths/instance/otp_devices/create/CreatedSuccessfully.tsx
b/packages/merchant-backoffice-ui/src/paths/instance/otp_devices/create/CreatedSuccessfully.tsx
index db3842711..45939c19d 100644
---
a/packages/merchant-backoffice-ui/src/paths/instance/otp_devices/create/CreatedSuccessfully.tsx
+++
b/packages/merchant-backoffice-ui/src/paths/instance/otp_devices/create/CreatedSuccessfully.tsx
@@ -29,10 +29,6 @@ interface Props {
onConfirm: () => void;
}
-function isNotUndefined<X>(x: X | undefined): x is X {
- return !!x;
-}
-
export function CreatedSuccessfully({
entity,
onConfirm,
diff --git
a/packages/merchant-backoffice-ui/src/paths/instance/otp_devices/list/Table.tsx
b/packages/merchant-backoffice-ui/src/paths/instance/otp_devices/list/Table.tsx
index 0c28027fe..b7c22c17f 100644
---
a/packages/merchant-backoffice-ui/src/paths/instance/otp_devices/list/Table.tsx
+++
b/packages/merchant-backoffice-ui/src/paths/instance/otp_devices/list/Table.tsx
@@ -161,7 +161,7 @@ function Table({
onClick={(): void => onSelect(i)}
style={{ cursor: "pointer" }}
>
- {i.otp_device_id}
+ {i.device_description}
</td>
<td class="is-actions-cell right-sticky">
<div class="buttons is-right">
diff --git
a/packages/merchant-backoffice-ui/src/paths/instance/otp_devices/update/index.tsx
b/packages/merchant-backoffice-ui/src/paths/instance/otp_devices/update/index.tsx
index 52f6c6c29..7c7092a4e 100644
---
a/packages/merchant-backoffice-ui/src/paths/instance/otp_devices/update/index.tsx
+++
b/packages/merchant-backoffice-ui/src/paths/instance/otp_devices/update/index.tsx
@@ -33,6 +33,7 @@ import { Notification } from "../../../../utils/types.js";
import { UpdatePage } from "./UpdatePage.js";
import { HttpStatusCode } from "@gnu-taler/taler-util";
import { useOtpDeviceAPI, useOtpDeviceDetails } from
"../../../../hooks/otp.js";
+import { CreatedSuccessfully } from "../create/CreatedSuccessfully.js";
export type Entity = MerchantBackend.OTP.OtpDevicePatchDetails & WithId;
@@ -55,6 +56,7 @@ export default function UpdateValidator({
const { updateOtpDevice } = useOtpDeviceAPI();
const result = useOtpDeviceDetails(vid);
const [notif, setNotif] = useState<Notification | undefined>(undefined);
+ const [keyUpdated, setKeyUpdated] =
useState<MerchantBackend.OTP.OtpDeviceAddDetails | null>(null)
const { i18n } = useTranslationContext();
@@ -73,6 +75,10 @@ export default function UpdateValidator({
return onLoadError(result);
}
+ if (keyUpdated) {
+ return <CreatedSuccessfully entity={keyUpdated} onConfirm={onConfirm} />
+ }
+
return (
<Fragment>
<NotificationCard notification={notif} />
@@ -85,9 +91,21 @@ export default function UpdateValidator({
otp_ctr: result.data.otp_ctr
}}
onBack={onBack}
- onUpdate={(data) => {
- return updateOtpDevice(vid, data)
- .then(onConfirm)
+ onUpdate={async (newInfo) => {
+ return updateOtpDevice(vid, newInfo)
+ .then((d) => {
+ if (newInfo.otp_key) {
+ setKeyUpdated({
+ otp_algorithm: newInfo.otp_algorithm,
+ otp_device_description: newInfo.otp_device_description,
+ otp_device_id: newInfo.id,
+ otp_key: newInfo.otp_key,
+ otp_ctr: newInfo.otp_ctr,
+ })
+ } else {
+ onConfirm()
+ }
+ })
.catch((error) => {
setNotif({
message: i18n.str`could not update template`,
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [taler-wallet-core] branch master updated: fix #8354: show import key after updating,
gnunet <=