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