Skip to content

Commit 7faed51

Browse files
authored
Merge pull request #226 from prafull-opensignlabs/auth_user
feat:add contactbook report & updated version of app in footer
2 parents ecd3395 + 5719dcc commit 7faed51

File tree

13 files changed

+303
-98
lines changed

13 files changed

+303
-98
lines changed

apps/OpenSign/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@
4242
"scripts": {
4343
"start": "serve -s build",
4444
"start-dev": "mf-cra start",
45-
"build": "rm -rf public/mfbuild && npm run micro && CI=false && mf-cra build",
45+
"version": "curl -s https://api.github.com/repos/opensignlabs/opensign/releases/latest | grep '\"tag_name\":' | awk -F '\"' '{print $4}' > ./public/version.txt",
46+
"build": "npm run version && rm -rf public/mfbuild && npm run micro && CI=false && mf-cra build",
4647
"micro": "cd ../../microfrontends/SignDocuments && npm install && npm run build",
4748
"test": "react-scripts test",
4849
"eject": "react-scripts eject",
@@ -85,4 +86,4 @@
8586
"pretty-quick": "^3.1.3",
8687
"tailwindcss": "^3.3.3"
8788
}
88-
}
89+
}

apps/OpenSign/public/version.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
v1.0.5-beta

apps/OpenSign/src/components/Footer.js

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,20 @@
11
import React, { useEffect, useState } from "react";
22
import Package from "../../package.json";
3-
3+
import axios from "axios";
44
const Footer = () => {
55
const [showButton, setShowButton] = useState(false);
6+
const [version, setVersion] = useState("");
7+
useEffect(() => {
8+
axios
9+
.get("/version.txt")
10+
.then((response) => {
11+
setVersion(response.data); // Set the retrieved data to the state variable
12+
})
13+
.catch((error) => {
14+
console.error("Error reading the file:", error);
15+
});
16+
}, []);
17+
618
const handleScroll = () => {
719
if (window.pageYOffset >= 50) {
820
setShowButton(true);
@@ -25,16 +37,12 @@ const Footer = () => {
2537
}, []);
2638

2739
const appName = "OpenSign™";
28-
40+
2941
return (
3042
<>
3143
<div className="bg-[#222c3c] text-[#98a6ba] text-center text-[13px] py-3">
3244
All Rights Reserved &copy; {new Date().getFullYear()} &nbsp;
33-
{appName}{" "}
34-
(version:{" "}
35-
{localStorage.getItem("appVersion") &&
36-
`${Package.version}.${localStorage.getItem("appVersion")}`}
37-
)
45+
{appName} ( version: {version ? version : `${Package.version} `})
3846
</div>
3947
<button
4048
className={`${

apps/OpenSign/src/components/LoginGoogle.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,9 @@ const GoogleSignInBtn = ({
4343
});
4444
});
4545
const clearStorage = async () => {
46-
await Parse.User.logOut();
47-
46+
if (Parse.User.current()) {
47+
await Parse.User.logOut();
48+
}
4849
let baseUrl = localStorage.getItem("BaseUrl12");
4950
let appid = localStorage.getItem("AppID12");
5051
let applogo = localStorage.getItem("appLogo");
@@ -74,7 +75,6 @@ const GoogleSignInBtn = ({
7475
localStorage.setItem("userSettings", userSettings);
7576
localStorage.setItem("baseUrl", baseUrl);
7677
localStorage.setItem("parseAppId", appid);
77-
7878
};
7979
const responseGoogle = async (response) => {
8080
clearStorage();

apps/OpenSign/src/components/dashboard/DashboardReport.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ function DashboardReport(props) {
99
const [isLoader, setIsLoader] = useState(true);
1010
const [reportName, setReportName] = useState("");
1111
const [actions, setActions] = useState([]);
12+
const [heading, setHeading] = useState([]);
1213
const [isNextRecord, setIsNextRecord] = useState(false);
1314
const [isMoreDocs, setIsMoreDocs] = useState(true);
1415
const abortController = new AbortController();
@@ -43,6 +44,7 @@ function DashboardReport(props) {
4344
if (json) {
4445
setActions(json.actions);
4546
setReportName(json.reportName);
47+
setHeading(json.heading);
4648
Parse.serverURL = localStorage.getItem("BaseUrl12");
4749
Parse.initialize(localStorage.getItem("AppID12"));
4850
const currentUser = Parse.User.current().id;
@@ -140,7 +142,9 @@ function DashboardReport(props) {
140142
<ReportTable
141143
ReportName={reportName}
142144
List={List}
145+
setList={setList}
143146
actions={actions}
147+
heading={heading}
144148
setIsNextRecord={setIsNextRecord}
145149
isMoreDocs={isMoreDocs}
146150
docPerPage={docPerPage}

apps/OpenSign/src/json/ReportJson.js

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
export default function reportJson(id) {
22
// console.log("json ", json);
3-
3+
const head = ["Sr.No", "Name", "Note", "Folder", "File", "Owner", "Signers"];
4+
const contactbook = ["Sr.No", "Name", "Email", "Phone"];
45
switch (id) {
56
// draft documents report
67
case "ByHuevtCFY":
78
return {
89
reportName: "Draft Documents",
10+
heading: head,
911
actions: [
1012
{
1113
btnLabel: "sign",
@@ -21,6 +23,7 @@ export default function reportJson(id) {
2123
case "4Hhwbp482K":
2224
return {
2325
reportName: "Need your sign",
26+
heading: head,
2427
actions: [
2528
{
2629
btnLabel: "sign",
@@ -36,6 +39,7 @@ export default function reportJson(id) {
3639
case "1MwEuxLEkF":
3740
return {
3841
reportName: "In-progress documents",
42+
heading: head,
3943
actions: [
4044
{
4145
btnLabel: "View",
@@ -51,6 +55,7 @@ export default function reportJson(id) {
5155
case "kQUoW4hUXz":
5256
return {
5357
reportName: "Completed Documents",
58+
heading: head,
5459
actions: [
5560
{
5661
btnLabel: "View",
@@ -66,6 +71,7 @@ export default function reportJson(id) {
6671
case "UPr2Fm5WY3":
6772
return {
6873
reportName: "Declined Documents",
74+
heading: head,
6975
actions: [
7076
{
7177
btnLabel: "View",
@@ -81,6 +87,7 @@ export default function reportJson(id) {
8187
case "zNqBHXHsYH":
8288
return {
8389
reportName: "Expired Documents",
90+
heading: head,
8491
actions: [
8592
{
8693
btnLabel: "View",
@@ -96,6 +103,7 @@ export default function reportJson(id) {
96103
case "d9k3UfYHBc":
97104
return {
98105
reportName: "Recently sent for signatures",
106+
heading: head,
99107
actions: [
100108
{
101109
btnLabel: "View",
@@ -111,6 +119,7 @@ export default function reportJson(id) {
111119
case "5Go51Q7T8r":
112120
return {
113121
reportName: "Recent signature requests",
122+
heading: head,
114123
actions: [
115124
{
116125
btnLabel: "Sign",
@@ -126,6 +135,7 @@ export default function reportJson(id) {
126135
case "kC5mfynCi4":
127136
return {
128137
reportName: "Drafts",
138+
heading: head,
129139
actions: [
130140
{
131141
btnLabel: "sign",
@@ -137,6 +147,20 @@ export default function reportJson(id) {
137147
}
138148
]
139149
};
150+
// contactbook report
151+
case "5KhaPr482K":
152+
return {
153+
reportName: "Contactbook",
154+
heading: contactbook,
155+
actions: [
156+
{
157+
btnLabel: "",
158+
btnColor: "#f55a42",
159+
textColor: "white",
160+
btnIcon: "fa-solid fa-trash"
161+
}
162+
]
163+
};
140164
default:
141165
return null;
142166
}

0 commit comments

Comments
 (0)