diff --git a/apps/OpenSign/src/pages/Report.js b/apps/OpenSign/src/pages/Report.js
index 7d2d0fac1..95050993c 100644
--- a/apps/OpenSign/src/pages/Report.js
+++ b/apps/OpenSign/src/pages/Report.js
@@ -56,39 +56,6 @@ const Report = () => {
// setIsLoader(true);
const json = reportJson(id);
if (json) {
- if (id === "6TeaPr321t") {
- const tourConfig = [
- {
- selector: "[data-tut=reactourFirst]",
- content: () => (
-
- ),
- position: "top",
- style: { fontSize: "13px" }
- }
- ];
- json.actions.map((data) => {
- const newConfig = {
- selector: `[data-tut="${data?.selector}"]`,
- content: () => (
-
- ),
- position: "top",
- style: { fontSize: "13px" }
- };
- tourConfig.push(newConfig);
- });
- setTourData(tourConfig);
- }
-
setActions(json.actions);
setHeading(json.heading);
setReportName(json.reportName);
@@ -108,6 +75,42 @@ const Report = () => {
headers: headers,
signal: abortController.signal // is used to cancel fetch query
});
+ if (id === "6TeaPr321t") {
+ const tourConfig = [
+ {
+ selector: "[data-tut=reactourFirst]",
+ content: () => (
+
+ ),
+ position: "top",
+ style: { fontSize: "13px" }
+ }
+ ];
+
+ if (res.data.result && res.data.result?.length > 0) {
+ json.actions.map((data) => {
+ const newConfig = {
+ selector: `[data-tut="${data?.selector}"]`,
+ content: () => (
+
+ ),
+ position: "top",
+ style: { fontSize: "13px" }
+ };
+ tourConfig.push(newConfig);
+ });
+ }
+
+ setTourData(tourConfig);
+ }
if (id === "4Hhwbp482K") {
const listData = res.data?.result.filter((x) => x.Signers.length > 0);
let arr = [];
diff --git a/apps/OpenSign/src/primitives/GetReportDisplay.js b/apps/OpenSign/src/primitives/GetReportDisplay.js
index b6bbd34ba..412e603f3 100644
--- a/apps/OpenSign/src/primitives/GetReportDisplay.js
+++ b/apps/OpenSign/src/primitives/GetReportDisplay.js
@@ -1,4 +1,4 @@
- import React, { useState, useEffect, useMemo } from "react";
+import React, { useState, useEffect, useMemo } from "react";
import pad from "../assets/images/pad.svg";
import { useNavigate } from "react-router-dom";
import axios from "axios";
@@ -8,6 +8,8 @@ import { modalSubmitBtnColor, modalCancelBtnColor } from "../constant/const";
import Alert from "./Alert";
import Tooltip from "./Tooltip";
import { RWebShare } from "react-web-share";
+import Tour from "reactour";
+import Parse from "parse";
const ReportTable = ({
ReportName,
@@ -19,7 +21,9 @@ const ReportTable = ({
isMoreDocs,
docPerPage,
form,
- report_help
+ report_help,
+ tourData,
+ isDontShow
}) => {
const navigate = useNavigate();
const [currentPage, setCurrentPage] = useState(1);
@@ -33,6 +37,8 @@ const ReportTable = ({
const [shareUrls, setShareUrls] = useState([]);
const [copied, setCopied] = useState(false);
const [alertMsg, setAlertMsg] = useState({ type: "success", message: "" });
+ const [isTour, setIsTour] = useState(false);
+ const [tourStatusArr, setTourStatusArr] = useState([]);
const startIndex = (currentPage - 1) * docPerPage;
// For loop is used to calculate page numbers visible below table
@@ -46,6 +52,7 @@ const ReportTable = ({
}, [List, docPerPage]);
// below useEffect reset currenpage to 1 if user change route
useEffect(() => {
+ checkTourStatus();
return () => setCurrentPage(1);
}, []);
@@ -350,6 +357,80 @@ const ReportTable = ({
setActLoader({});
});
};
+
+ async function checkTourStatus() {
+ const currentUser = Parse.User.current();
+ const cloudRes = await Parse.Cloud.run("getUserDetails", {
+ email: currentUser.get("email")
+ });
+ const res = { data: cloudRes.toJSON() };
+ if (res.data && res.data.TourStatus && res.data.TourStatus.length > 0) {
+ const tourStatus = res.data.TourStatus;
+ // console.log("res ", res.data.TourStatus);
+ setTourStatusArr(tourStatus);
+ const filteredtourStatus = tourStatus.filter(
+ (obj) => obj["templateReportTour"]
+ );
+ if (filteredtourStatus.length > 0) {
+ const templateReportTour = filteredtourStatus[0]["templateReportTour"];
+
+ if (templateReportTour) {
+ setIsTour(false);
+ } else {
+ setIsTour(true);
+ }
+ } else {
+ setIsTour(true);
+ }
+ } else {
+ setIsTour(true);
+ }
+ }
+
+ const closeTour = async () => {
+ // console.log("closeTour");
+ setIsTour(false);
+ if (isDontShow) {
+ const serverUrl = localStorage.getItem("baseUrl");
+ const appId = localStorage.getItem("parseAppId");
+ const extUserClass = localStorage.getItem("extended_class");
+ const json = JSON.parse(localStorage.getItem("Extand_Class"));
+ const extUserId = json && json.length > 0 && json[0].objectId;
+ // console.log("extUserId ", extUserId)
+
+ let updatedTourStatus = [];
+ if (tourStatusArr.length > 0) {
+ updatedTourStatus = [...tourStatusArr];
+ const templateReportTourIndex = tourStatusArr.findIndex(
+ (obj) =>
+ obj["templateReportTour"] === false ||
+ obj["templateReportTour"] === true
+ );
+ if (templateReportTourIndex !== -1) {
+ updatedTourStatus[templateReportTourIndex] = {
+ templateReportTour: true
+ };
+ } else {
+ updatedTourStatus.push({ templateReportTour: true });
+ }
+ } else {
+ updatedTourStatus = [{ templateReportTour: true }];
+ }
+
+ await axios.put(
+ serverUrl + "classes/" + extUserClass + "/" + extUserId,
+ {
+ TourStatus: updatedTourStatus
+ },
+ {
+ headers: {
+ "X-Parse-Application-Id": appId
+ }
+ }
+ );
+ }
+ };
+
return (
{Object.keys(actLoader)?.length > 0 && (
@@ -362,6 +443,15 @@ const ReportTable = ({
)}
{isAlert &&
{alertMsg.message}}
+ {tourData && ReportName === "Templates" && (
+
+ )}
{ReportName}{" "}
@@ -373,6 +463,7 @@ const ReportTable = ({
{ReportName === "Templates" && (
navigate("/form/template")}
className="fa-solid fa-square-plus text-sky-400 text-[25px]"
>
@@ -504,6 +595,7 @@ const ReportTable = ({
{actions?.length > 0 &&
actions.map((act, index) => (