Skip to content

Commit 1371c2c

Browse files
fix: opensign-drive tour message error andtemplate report tour message
1 parent 6880ae3 commit 1371c2c

File tree

6 files changed

+202
-91
lines changed

6 files changed

+202
-91
lines changed

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: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,9 @@ export default function reportJson(id) {
283283
textColor: "white",
284284
btnIcon: "fa fa-plus",
285285
redirectUrl: "placeHolderSign",
286-
action: "redirect"
286+
action: "redirect",
287+
selector: "reactourSecond",
288+
message: "onclick use button to create document from template."
287289
},
288290
{
289291
btnLabel: "Edit",
@@ -292,7 +294,9 @@ export default function reportJson(id) {
292294
textColor: "white",
293295
btnIcon: "fa-solid fa-pen",
294296
redirectUrl: "template",
295-
action: "redirect"
297+
action: "redirect",
298+
selector: "reactourThird",
299+
message: "onclick edit button you can edit template."
296300
},
297301
{
298302
btnId: "1834",
@@ -301,7 +305,9 @@ export default function reportJson(id) {
301305
textColor: "white",
302306
btnIcon: "fa fa-trash",
303307
redirectUrl: "",
304-
action: "delete"
308+
action: "delete",
309+
selector: "reactourForth",
310+
message: "onclick delete button you can delete template."
305311
}
306312
],
307313
helpMsg:

apps/OpenSign/src/pages/Opensigndrive.js

Lines changed: 52 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,43 @@ 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];
182+
console.log("tournew", newTour);
181183
const isFolderExist = driveDetails.some(
182184
(data) => data.Type === "Folder"
183185
);
@@ -192,9 +194,12 @@ function Opensigndrive() {
192194
(data) => data.selector !== '[data-tut="reactourSixth"]'
193195
);
194196
}
197+
console.log("newTour", newTour);
195198
setTourData(newTour);
196199
setSkip((prevSkip) => prevSkip + limit);
197200
sortingData(null, null, driveDetails, true);
201+
} else {
202+
setTourData(tourConfigs);
198203
}
199204
if (!docId) {
200205
setFolderName([{ name: "OpenSign™ Drive", objectId: "" }]);
@@ -211,6 +216,7 @@ function Opensigndrive() {
211216
});
212217
}
213218
};
219+
console.log("tourdata", tourData);
214220

215221
//function to fetch drive details list on scroll bottom
216222
const handleScroll = () => {
@@ -696,14 +702,17 @@ function Opensigndrive() {
696702
) : (
697703
<>
698704
<div className="folderContainer">
699-
<Tour
700-
onRequestClose={closeTour}
701-
steps={tourData}
702-
isOpen={isTour}
703-
closeWithMask={false}
704-
scrollOffset={-100}
705-
rounded={5}
706-
/>
705+
{tourData && (
706+
<Tour
707+
onRequestClose={closeTour}
708+
steps={tourData}
709+
isOpen={isTour}
710+
closeWithMask={false}
711+
scrollOffset={-100}
712+
rounded={5}
713+
/>
714+
)}
715+
707716
<div
708717
data-tut="reactourFirst"
709718
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)