Skip to content

Commit f8b21e7

Browse files
Merge pull request #609 from OpenSignLabs/fix_issue
fix: opensign-drive and template report tour message
2 parents 3121f35 + 7e6df13 commit f8b21e7

File tree

7 files changed

+196
-87
lines changed

7 files changed

+196
-87
lines changed

apps/OpenSign/src/components/Header.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,14 @@ const Header = ({ showSidebar }) => {
176176
>
177177
<i className="fa-solid fa-lock"></i> Change Password
178178
</li>
179+
<li
180+
className="hover:bg-gray-100 py-1 px-2 cursor-pointer font-normal"
181+
onClick={() => {
182+
window.open("https://console.opensignlabs.com/");
183+
}}
184+
>
185+
<i className="fa-regular fa-id-card"></i> Console
186+
</li>
179187
<li
180188
className="hover:bg-gray-100 rounded-b-lg py-1 px-2 cursor-pointer font-normal"
181189
onClick={closeDropdown}

apps/OpenSign/src/constant/Utils.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -547,7 +547,6 @@ export const signPdfFun = async (
547547
userId: signerObjectId,
548548
isCustomCompletionMail: isCustomCompletionMail
549549
};
550-
551550
const response = await axios
552551
.post(`${localStorage.getItem("baseUrl")}functions/signPdf`, singleSign, {
553552
headers: {
@@ -1248,8 +1247,8 @@ export const multiSignEmbed = async (
12481247
position.type === radioButtonWidget
12491248
? 10
12501249
: position.type === "checkbox"
1251-
? 10
1252-
: newUpdateHeight;
1250+
? 10
1251+
: newUpdateHeight;
12531252
const newHeight = ind ? (ind > 0 ? widgetHeight : 0) : widgetHeight;
12541253

12551254
if (signyourself) {

apps/OpenSign/src/json/ReportJson.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,10 @@ export default function reportJson(id) {
320320
textColor: "white",
321321
btnIcon: "fa fa-plus",
322322
redirectUrl: "placeHolderSign",
323-
action: "redirect"
323+
action: "redirect",
324+
selector: "reactourSecond",
325+
message:
326+
"Click the 'Use' button to create a new document from an existing template. "
324327
},
325328
{
326329
btnId: "2234",
@@ -329,6 +332,9 @@ export default function reportJson(id) {
329332
textColor: "black",
330333
btnIcon: "fa-solid fa-ellipsis-vertical fa-lg",
331334
action: "option",
335+
selector: "reactourThird",
336+
message:
337+
"This menu reveals more options such as Edit & Delete. Use the 'Edit' button to add signer roles, modify fields, and update your template. Changes will apply to all future documents created from this template but won’t affect existing documents.Use the Delete button you can delete template. ",
332338
subaction: [
333339
{
334340
btnId: "2434",

apps/OpenSign/src/pages/Opensigndrive.js

Lines changed: 49 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -129,40 +129,6 @@ function Opensigndrive() {
129129
),
130130
position: "top",
131131
style: { fontSize: "13px" }
132-
},
133-
134-
{
135-
selector: '[data-tut="reactourFifth"]',
136-
content: () => (
137-
<TourContentWithBtn
138-
message={`The document list is displayed according to the selected sorting option. Icons next to each document indicate its current status.`}
139-
isChecked={handleDontShow}
140-
/>
141-
),
142-
position: "bottom",
143-
style: { fontSize: "13px" }
144-
},
145-
{
146-
selector: '[data-tut="reactourSixth"]',
147-
content: () => (
148-
<TourContentWithBtn
149-
message={`Right-click on a document to see options such as Download, Rename, Move, and Delete. Click on the document to open it.`}
150-
isChecked={handleDontShow}
151-
/>
152-
),
153-
position: "bottom",
154-
style: { fontSize: "13px" }
155-
},
156-
{
157-
selector: '[data-tut="reactourSeventh"]',
158-
content: () => (
159-
<TourContentWithBtn
160-
message={`Right-click on any folder to see options. Choose ‘Rename’ to change the folder’s name or click on the folder to navigate through its contents.`}
161-
isChecked={handleDontShow}
162-
/>
163-
),
164-
position: "bottom",
165-
style: { fontSize: "13px" }
166132
}
167133
];
168134
//function for get all pdf document list
@@ -177,7 +143,42 @@ function Opensigndrive() {
177143
if (driveDetails && driveDetails === "Error: Something went wrong!") {
178144
setHandleError("Error: Something went wrong!");
179145
} else if (driveDetails && driveDetails.length > 0) {
180-
let newTour = tourConfigs;
146+
const addMoreTour = [
147+
{
148+
selector: '[data-tut="reactourFifth"]',
149+
content: () => (
150+
<TourContentWithBtn
151+
message={`The document list is displayed according to the selected sorting option. Icons next to each document indicate its current status.`}
152+
isChecked={handleDontShow}
153+
/>
154+
),
155+
position: "bottom",
156+
style: { fontSize: "13px" }
157+
},
158+
{
159+
selector: '[data-tut="reactourSixth"]',
160+
content: () => (
161+
<TourContentWithBtn
162+
message={`Right-click on a document to see options such as Download, Rename, Move, and Delete. Click on the document to open it.`}
163+
isChecked={handleDontShow}
164+
/>
165+
),
166+
position: "bottom",
167+
style: { fontSize: "13px" }
168+
},
169+
{
170+
selector: '[data-tut="reactourSeventh"]',
171+
content: () => (
172+
<TourContentWithBtn
173+
message={`Right-click on any folder to see options. Choose ‘Rename’ to change the folder’s name or click on the folder to navigate through its contents.`}
174+
isChecked={handleDontShow}
175+
/>
176+
),
177+
position: "bottom",
178+
style: { fontSize: "13px" }
179+
}
180+
];
181+
let newTour = [...tourConfigs, ...addMoreTour];
181182
const isFolderExist = driveDetails.some(
182183
(data) => data.Type === "Folder"
183184
);
@@ -195,6 +196,8 @@ function Opensigndrive() {
195196
setTourData(newTour);
196197
setSkip((prevSkip) => prevSkip + limit);
197198
sortingData(null, null, driveDetails, true);
199+
} else {
200+
setTourData(tourConfigs);
198201
}
199202
if (!docId) {
200203
setFolderName([{ name: "OpenSign™ Drive", objectId: "" }]);
@@ -696,14 +699,17 @@ function Opensigndrive() {
696699
) : (
697700
<>
698701
<div className="folderContainer">
699-
<Tour
700-
onRequestClose={closeTour}
701-
steps={tourData}
702-
isOpen={isTour}
703-
closeWithMask={false}
704-
scrollOffset={-100}
705-
rounded={5}
706-
/>
702+
{tourData && (
703+
<Tour
704+
onRequestClose={closeTour}
705+
steps={tourData}
706+
isOpen={isTour}
707+
closeWithMask={false}
708+
scrollOffset={-100}
709+
rounded={5}
710+
/>
711+
)}
712+
707713
<div
708714
data-tut="reactourFirst"
709715
onMouseEnter={(e) => handleMouseEnter(e)}

apps/OpenSign/src/pages/PdfRequestFiles.js

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ function PdfRequestFiles() {
7575
isShow: false,
7676
alertMessage: ""
7777
});
78+
const [isSubscribed, setIsSubscribed] = useState(false);
7879
const [isCompleted, setIsCompleted] = useState({
7980
isCertificate: false,
8081
isModal: false
@@ -94,7 +95,7 @@ function PdfRequestFiles() {
9495
const [minRequiredCount, setminRequiredCount] = useState();
9596
const [sendInOrder, setSendInOrder] = useState(false);
9697
const [currWidgetsDetails, setCurrWidgetsDetails] = useState({});
97-
const [isSubscribed, setIsSubscribed] = useState(false);
98+
const [isSubscriptionExpired, setIsSubscriptionExpired] = useState(false);
9899
const [extUserId, setExtUserId] = useState("");
99100
const divRef = useRef(null);
100101
const isMobile = window.innerWidth < 767;
@@ -137,23 +138,24 @@ function PdfRequestFiles() {
137138

138139
async function checkIsSubscribed() {
139140
const res = await fetchSubscription();
140-
const freeplan = res.plan;
141+
const plan = res.plan;
141142
const billingDate = res.billingDate;
142-
if (freeplan === "freeplan") {
143+
if (plan === "freeplan") {
143144
return true;
144145
} else if (billingDate) {
145146
if (new Date(billingDate) > new Date()) {
147+
setIsSubscribed(true);
146148
return true;
147149
} else {
148150
if (location.pathname.includes("/load/")) {
149-
setIsSubscribed(true);
151+
setIsSubscriptionExpired(true);
150152
} else {
151153
navigate(`/subscription`);
152154
}
153155
}
154156
} else {
155157
if (location.pathname.includes("/load/")) {
156-
setIsSubscribed(true);
158+
setIsSubscriptionExpired(true);
157159
} else {
158160
navigate(`/subscription`);
159161
}
@@ -977,10 +979,10 @@ function PdfRequestFiles() {
977979
return (
978980
<DndProvider backend={HTML5Backend}>
979981
<Title title={"Request Sign"} />
980-
{isSubscribed ? (
982+
{isSubscriptionExpired ? (
981983
<ModalUi
982984
title={"Subscription Expired"}
983-
isOpen={isSubscribed}
985+
isOpen={isSubscriptionExpired}
984986
showClose={false}
985987
>
986988
<div className="flex flex-col justify-center items-center py-4 md:py-5 gap-5">

apps/OpenSign/src/pages/Report.js

Lines changed: 36 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -56,39 +56,6 @@ const Report = () => {
5656
// setIsLoader(true);
5757
const json = reportJson(id);
5858
if (json) {
59-
if (id === "6TeaPr321t") {
60-
const tourConfig = [
61-
{
62-
selector: "[data-tut=reactourFirst]",
63-
content: () => (
64-
<TourContentWithBtn
65-
message={
66-
"Click the ‘Add’ button to create a new template. Templates are reusable documents designed to quickly generate new documents with the same structure and varying signers. For example, an HR template for onboarding could have predefined roles like ‘HR Manager’ and ‘New Employee’. Each time you use the template, you can assign the ‘New Employee’ role to different incoming staff members, while the ‘HR Manager’ role remains constant, facilitating a seamless onboarding process for each recruit."
67-
}
68-
isChecked={handleDontShow}
69-
/>
70-
),
71-
position: "top",
72-
style: { fontSize: "13px" }
73-
}
74-
];
75-
json.actions.map((data) => {
76-
const newConfig = {
77-
selector: `[data-tut="${data?.selector}"]`,
78-
content: () => (
79-
<TourContentWithBtn
80-
message={data?.message}
81-
isChecked={handleDontShow}
82-
/>
83-
),
84-
position: "top",
85-
style: { fontSize: "13px" }
86-
};
87-
tourConfig.push(newConfig);
88-
});
89-
setTourData(tourConfig);
90-
}
91-
9259
setActions(json.actions);
9360
setHeading(json.heading);
9461
setReportName(json.reportName);
@@ -108,6 +75,42 @@ const Report = () => {
10875
headers: headers,
10976
signal: abortController.signal // is used to cancel fetch query
11077
});
78+
if (id === "6TeaPr321t") {
79+
const tourConfig = [
80+
{
81+
selector: "[data-tut=reactourFirst]",
82+
content: () => (
83+
<TourContentWithBtn
84+
message={
85+
"Click the 'Add' button to create a new template. Templates are reusable documents designed to quickly generate new documents with the same structure and varying signers. For example, an HR template for onboarding could have predefined roles like ‘HR Manager’ and ‘New Employee’. Each time you use the template, you can assign the ‘New Employee’ role to different incoming staff members, while the ‘HR Manager’ role remains constant, facilitating a seamless onboarding process for each recruit. "
86+
}
87+
isChecked={handleDontShow}
88+
/>
89+
),
90+
position: "top",
91+
style: { fontSize: "13px" }
92+
}
93+
];
94+
95+
if (res.data.result && res.data.result?.length > 0) {
96+
json.actions.map((data) => {
97+
const newConfig = {
98+
selector: `[data-tut="${data?.selector}"]`,
99+
content: () => (
100+
<TourContentWithBtn
101+
message={data?.message}
102+
isChecked={handleDontShow}
103+
/>
104+
),
105+
position: "top",
106+
style: { fontSize: "13px" }
107+
};
108+
tourConfig.push(newConfig);
109+
});
110+
}
111+
112+
setTourData(tourConfig);
113+
}
111114
if (id === "4Hhwbp482K") {
112115
const listData = res.data?.result.filter((x) => x.Signers.length > 0);
113116
let arr = [];

0 commit comments

Comments
 (0)