From c850c406821064d4d69420392b32853a41cdb91e Mon Sep 17 00:00:00 2001 From: Sebastian Date: Wed, 17 May 2023 09:57:53 -0300 Subject: version id --- packages/exchange-backoffice-ui/src/Dashborad.tsx | 31 ++++++++++++++++++---- .../exchange-backoffice-ui/src/declaration.d.ts | 2 ++ .../src/handlers/FormProvider.tsx | 2 +- 3 files changed, 29 insertions(+), 6 deletions(-) create mode 100644 packages/exchange-backoffice-ui/src/declaration.d.ts (limited to 'packages/exchange-backoffice-ui') diff --git a/packages/exchange-backoffice-ui/src/Dashborad.tsx b/packages/exchange-backoffice-ui/src/Dashborad.tsx index 80df4127a..4fdb7415a 100644 --- a/packages/exchange-backoffice-ui/src/Dashborad.tsx +++ b/packages/exchange-backoffice-ui/src/Dashborad.tsx @@ -157,6 +157,9 @@ function classNames(...classes: string[]) { * * 4.- tooltip are not placed correctly: the arrow should point the question mark * and the text area should be bigger + * + * 5.- date field should have the calendar icon clickable so the user can select date without + * writing text with the correct format */ export function Dashboard({ @@ -165,19 +168,16 @@ export function Dashboard({ children?: ComponentChildren; }): VNode { const [sidebarOpen, setSidebarOpen] = useState(false); - const [selectedForm, setSelectedForm] = useState(7); + const [selectedForm, setSelectedForm] = useState(0); function changeForm(next: number) { setSelectedForm(next); } const logRef = useRef(null); const storedValue = { - fullName: "the logged fullName", + fullName: "loggedIn_user_fullname", when: { t_ms: new Date().getTime(), }, - originOfAssets: { - currency: "usd", - }, }; function showFormOnSidebar(v: any) { if (!logRef.current) return; @@ -188,6 +188,16 @@ export function Dashboard({ showFormOnSidebar(storedValue); }); + const GIT_HASH = + typeof __GIT_HASH__ !== "undefined" ? __GIT_HASH__ : undefined; + const VERSION = typeof __VERSION__ !== "undefined" ? __VERSION__ : undefined; + + const versionText = VERSION + ? GIT_HASH + ? `Version ${VERSION} (${GIT_HASH.substring(0, 8)})` + : VERSION + : ""; + const showingFrom = navigation[selectedForm]; return ( <> @@ -531,6 +541,17 @@ export function Dashboard({ + +
+
+
+

+ Copyright © 2014—2023 Taler Systems SA. + {versionText} +

+
+
+
diff --git a/packages/exchange-backoffice-ui/src/declaration.d.ts b/packages/exchange-backoffice-ui/src/declaration.d.ts new file mode 100644 index 000000000..c1e9addbc --- /dev/null +++ b/packages/exchange-backoffice-ui/src/declaration.d.ts @@ -0,0 +1,2 @@ +declare const __VERSION__: string; +declare const __GIT_HASH__: string; diff --git a/packages/exchange-backoffice-ui/src/handlers/FormProvider.tsx b/packages/exchange-backoffice-ui/src/handlers/FormProvider.tsx index 4397fc197..d8877333c 100644 --- a/packages/exchange-backoffice-ui/src/handlers/FormProvider.tsx +++ b/packages/exchange-backoffice-ui/src/handlers/FormProvider.tsx @@ -51,7 +51,7 @@ export function FormProvider({ const value = useRef(initialValue ?? {}); useEffect(() => { return function onUnload() { - value.current = {}; + value.current = initialValue ?? {}; }; }); return ( -- cgit v1.2.3