mirror of
https://github.com/OpenSignLabs/OpenSign.git
synced 2026-08-20 14:42:37 +02:00
fix: remove changes
This commit is contained in:
@@ -283,9 +283,7 @@ export default function reportJson(id) {
|
||||
textColor: "white",
|
||||
btnIcon: "fa fa-plus",
|
||||
redirectUrl: "placeHolderSign",
|
||||
action: "redirect",
|
||||
selector: "reactourSecond",
|
||||
message: "onclick use button to create document from template."
|
||||
action: "redirect"
|
||||
},
|
||||
{
|
||||
btnLabel: "Edit",
|
||||
@@ -294,9 +292,7 @@ export default function reportJson(id) {
|
||||
textColor: "white",
|
||||
btnIcon: "fa-solid fa-pen",
|
||||
redirectUrl: "template",
|
||||
action: "redirect",
|
||||
selector: "reactourThird",
|
||||
message: "onclick edit button you can edit template."
|
||||
action: "redirect"
|
||||
},
|
||||
{
|
||||
btnId: "1834",
|
||||
@@ -305,9 +301,7 @@ export default function reportJson(id) {
|
||||
textColor: "white",
|
||||
btnIcon: "fa fa-trash",
|
||||
redirectUrl: "",
|
||||
action: "delete",
|
||||
selector: "reactourForth",
|
||||
message: "onclick delete button you can delete template."
|
||||
action: "delete"
|
||||
}
|
||||
],
|
||||
helpMsg:
|
||||
|
||||
@@ -8,8 +8,6 @@ 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,
|
||||
@@ -21,9 +19,7 @@ const ReportTable = ({
|
||||
isMoreDocs,
|
||||
docPerPage,
|
||||
form,
|
||||
report_help,
|
||||
tourData,
|
||||
isDontShow
|
||||
report_help
|
||||
}) => {
|
||||
const navigate = useNavigate();
|
||||
const [currentPage, setCurrentPage] = useState(1);
|
||||
@@ -37,8 +33,6 @@ 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
|
||||
@@ -52,7 +46,6 @@ const ReportTable = ({
|
||||
}, [List, docPerPage]);
|
||||
// below useEffect reset currenpage to 1 if user change route
|
||||
useEffect(() => {
|
||||
checkTourStatus();
|
||||
return () => setCurrentPage(1);
|
||||
}, []);
|
||||
|
||||
@@ -357,80 +350,6 @@ 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 (
|
||||
<div className="relative">
|
||||
{Object.keys(actLoader)?.length > 0 && (
|
||||
@@ -443,15 +362,6 @@ const ReportTable = ({
|
||||
)}
|
||||
<div className="p-2 overflow-x-scroll w-full bg-white rounded-md">
|
||||
{isAlert && <Alert type={alertMsg.type}>{alertMsg.message}</Alert>}
|
||||
{tourData && ReportName === "Templates" && (
|
||||
<Tour
|
||||
onRequestClose={closeTour}
|
||||
steps={tourData}
|
||||
isOpen={isTour}
|
||||
// rounded={5}
|
||||
closeWithMask={false}
|
||||
/>
|
||||
)}
|
||||
<div className="flex flex-row items-center justify-between my-2 mx-3 text-[20px] md:text-[23px]">
|
||||
<div className="font-light">
|
||||
{ReportName}{" "}
|
||||
@@ -463,7 +373,6 @@ const ReportTable = ({
|
||||
</div>
|
||||
{ReportName === "Templates" && (
|
||||
<i
|
||||
data-tut="reactourFirst"
|
||||
onClick={() => navigate("/form/template")}
|
||||
className="fa-solid fa-square-plus text-sky-400 text-[25px]"
|
||||
></i>
|
||||
@@ -595,7 +504,6 @@ const ReportTable = ({
|
||||
{actions?.length > 0 &&
|
||||
actions.map((act, index) => (
|
||||
<button
|
||||
data-tut={act?.selector}
|
||||
key={index}
|
||||
onClick={() => handleActionBtn(act, item)}
|
||||
className={`w-[25px] h-[25px] flex justify-center items-center rounded shadow`}
|
||||
|
||||
Reference in New Issue
Block a user