Skip to content

Commit 2cb4575

Browse files
add dont show button for reactour and minor bug fix in template flow
1 parent e7bcad8 commit 2cb4575

File tree

9 files changed

+474
-325
lines changed

9 files changed

+474
-325
lines changed

microfrontends/SignDocuments/src/Component/PdfRequestFiles.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ import Header from "./component/header";
3232
import RenderPdf from "./component/renderPdf";
3333
import CustomModal from "./component/CustomModal";
3434
import AlertComponent from "./component/alertComponent";
35+
import Title from "./component/Title";
3536

3637
function PdfRequestFiles() {
3738
const { docId } = useParams();
@@ -623,6 +624,7 @@ function PdfRequestFiles() {
623624

624625
return (
625626
<DndProvider backend={HTML5Backend}>
627+
<Title title={"Request Sign"}/>
626628
{isLoading.isLoad ? (
627629
<Loader isLoading={isLoading} />
628630
) : handleError ? (

microfrontends/SignDocuments/src/Component/SignYourselfPdf.js

Lines changed: 56 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ import { contractUsers, contactBook, urlValidator } from "../utils/Utils";
3939
import { modalAlign } from "../utils/Utils";
4040
import AlertComponent from "./component/alertComponent";
4141
import PlaceholderCopy from "./component/PlaceholderCopy";
42+
import TourContentWithBtn from "../premitives/TourContentWithBtn";
43+
import Title from "./component/Title";
4244

4345
//For signYourself inProgress section signer can add sign and complete doc sign.
4446
function SignYourSelf() {
@@ -91,6 +93,7 @@ function SignYourSelf() {
9193
type: "load"
9294
});
9395
const [isAlert, setIsAlert] = useState({ isShow: false, alertMessage: "" });
96+
const [isDontShow, setIsDontShow] = useState(false);
9497
const divRef = useRef(null);
9598
const nodeRef = useRef(null);
9699
const [{ isOver }, drop] = useDrop({
@@ -747,16 +750,31 @@ function SignYourSelf() {
747750
setXyPostion(getXyData);
748751
setShowAlreadySignDoc({ status: false });
749752
};
753+
754+
const handleDontShow = (isChecked) => {
755+
setIsDontShow(isChecked);
756+
};
757+
750758
const tourConfig = [
751759
{
752760
selector: '[data-tut="reactourFirst"]',
753-
content: `Drag the signature or stamp placeholder onto the PDF to choose your desired signing location.`,
761+
content: () => (
762+
<TourContentWithBtn
763+
message={`Drag the signature or stamp placeholder onto the PDF to choose your desired signing location.`}
764+
isChecked={handleDontShow}
765+
/>
766+
),
754767
position: "top",
755768
style: { fontSize: "13px" }
756769
},
757770
{
758771
selector: '[data-tut="reactourSecond"]',
759-
content: `Drag and drop anywhere in this area. You can resize and move it later.`,
772+
content: () => (
773+
<TourContentWithBtn
774+
message={`Drag and drop anywhere in this area. You can resize and move it later.`}
775+
isChecked={handleDontShow}
776+
/>
777+
),
760778
position: "top",
761779
style: { fontSize: "13px" }
762780
}
@@ -765,47 +783,49 @@ function SignYourSelf() {
765783
//function for update TourStatus
766784
const closeTour = async () => {
767785
setSignTour(false);
768-
769-
let updatedTourStatus = [];
770-
if (tourStatus.length > 0) {
771-
updatedTourStatus = [...tourStatus];
772-
const signyourselfIndex = tourStatus.findIndex(
773-
(obj) => obj["signyourself"] === false || obj["signyourself"] === true
774-
);
775-
if (signyourselfIndex !== -1) {
776-
updatedTourStatus[signyourselfIndex] = { signyourself: true };
786+
if (isDontShow) {
787+
let updatedTourStatus = [];
788+
if (tourStatus.length > 0) {
789+
updatedTourStatus = [...tourStatus];
790+
const signyourselfIndex = tourStatus.findIndex(
791+
(obj) => obj["signyourself"] === false || obj["signyourself"] === true
792+
);
793+
if (signyourselfIndex !== -1) {
794+
updatedTourStatus[signyourselfIndex] = { signyourself: true };
795+
} else {
796+
updatedTourStatus.push({ signyourself: true });
797+
}
777798
} else {
778-
updatedTourStatus.push({ signyourself: true });
799+
updatedTourStatus = [{ signyourself: true }];
779800
}
780-
} else {
781-
updatedTourStatus = [{ signyourself: true }];
782-
}
783-
await axios
784-
.put(
785-
`${localStorage.getItem("baseUrl")}classes/${localStorage.getItem(
786-
"_appName"
787-
)}${contractName}/${signerUserId}`,
788-
{
789-
TourStatus: updatedTourStatus
790-
},
791-
{
792-
headers: {
793-
"Content-Type": "application/json",
794-
"X-Parse-Application-Id": localStorage.getItem("parseAppId"),
795-
sessionToken: localStorage.getItem("accesstoken")
801+
await axios
802+
.put(
803+
`${localStorage.getItem("baseUrl")}classes/${localStorage.getItem(
804+
"_appName"
805+
)}${contractName}/${signerUserId}`,
806+
{
807+
TourStatus: updatedTourStatus
808+
},
809+
{
810+
headers: {
811+
"Content-Type": "application/json",
812+
"X-Parse-Application-Id": localStorage.getItem("parseAppId"),
813+
sessionToken: localStorage.getItem("accesstoken")
814+
}
796815
}
797-
}
798-
)
799-
.then((Listdata) => {
800-
// const json = Listdata.data;
801-
})
802-
.catch((err) => {
803-
console.log("axois err ", err);
804-
});
816+
)
817+
.then((Listdata) => {
818+
// const json = Listdata.data;
819+
})
820+
.catch((err) => {
821+
console.log("axois err ", err);
822+
});
823+
}
805824
};
806825

807826
return (
808827
<DndProvider backend={HTML5Backend}>
828+
<Title title={"Self Sign"} />
809829
{isLoading.isLoad ? (
810830
<Loader isLoading={isLoading} />
811831
) : handleError ? (

0 commit comments

Comments
 (0)