From 636910a78e321adeab3b5ebfb90ddc622ea901da Mon Sep 17 00:00:00 2001 From: prafull-opensignlabs Date: Fri, 24 Nov 2023 17:12:38 +0530 Subject: [PATCH] feat:add contactbook report & updated version of app in footer --- apps/OpenSign/package.json | 5 +- apps/OpenSign/public/version.txt | 1 + apps/OpenSign/src/components/Footer.js | 22 +- apps/OpenSign/src/components/LoginGoogle.js | 6 +- .../components/dashboard/DashboardReport.js | 4 + apps/OpenSign/src/json/ReportJson.js | 26 +- .../src/primitives/GetReportDisplay.js | 226 +++++++++++++----- apps/OpenSign/src/routes/Dashboard.js | 30 +-- apps/OpenSign/src/routes/Report.js | 4 + apps/OpenSign/src/styles/report.css | 36 +++ .../cloud/parsefunction/getReport.js | 5 +- .../cloud/parsefunction/reportsJson.js | 14 ++ .../default-data/legadraGCva.w_menu.json | 22 +- 13 files changed, 303 insertions(+), 98 deletions(-) create mode 100644 apps/OpenSign/public/version.txt create mode 100644 apps/OpenSign/src/styles/report.css diff --git a/apps/OpenSign/package.json b/apps/OpenSign/package.json index f460f70f7..d18085126 100644 --- a/apps/OpenSign/package.json +++ b/apps/OpenSign/package.json @@ -42,7 +42,8 @@ "scripts": { "start": "serve -s build", "start-dev": "mf-cra start", - "build": "rm -rf public/mfbuild && npm run micro && CI=false && mf-cra build", + "version": "curl -s https://api.github.com/repos/opensignlabs/opensign/releases/latest | grep '\"tag_name\":' | awk -F '\"' '{print $4}' > ./public/version.txt", + "build": "npm run version && rm -rf public/mfbuild && npm run micro && CI=false && mf-cra build", "micro": "cd ../../microfrontends/SignDocuments && npm install && npm run build", "test": "react-scripts test", "eject": "react-scripts eject", @@ -85,4 +86,4 @@ "pretty-quick": "^3.1.3", "tailwindcss": "^3.3.3" } -} \ No newline at end of file +} diff --git a/apps/OpenSign/public/version.txt b/apps/OpenSign/public/version.txt new file mode 100644 index 000000000..3e82ea442 --- /dev/null +++ b/apps/OpenSign/public/version.txt @@ -0,0 +1 @@ +v1.0.5-beta diff --git a/apps/OpenSign/src/components/Footer.js b/apps/OpenSign/src/components/Footer.js index 30d0acecb..92605da90 100644 --- a/apps/OpenSign/src/components/Footer.js +++ b/apps/OpenSign/src/components/Footer.js @@ -1,8 +1,20 @@ import React, { useEffect, useState } from "react"; import Package from "../../package.json"; - +import axios from "axios"; const Footer = () => { const [showButton, setShowButton] = useState(false); + const [version, setVersion] = useState(""); + useEffect(() => { + axios + .get("/version.txt") + .then((response) => { + setVersion(response.data); // Set the retrieved data to the state variable + }) + .catch((error) => { + console.error("Error reading the file:", error); + }); + }, []); + const handleScroll = () => { if (window.pageYOffset >= 50) { setShowButton(true); @@ -25,16 +37,12 @@ const Footer = () => { }, []); const appName = "OpenSign™"; - + return ( <>
All Rights Reserved © {new Date().getFullYear()}   - {appName}{" "} - (version:{" "} - {localStorage.getItem("appVersion") && - `${Package.version}.${localStorage.getItem("appVersion")}`} - ) + {appName} ( version: {version ? version : `${Package.version} `})