Skip to content

Commit 730a7a4

Browse files
add reactour for template
1 parent a4b4dc8 commit 730a7a4

File tree

6 files changed

+32
-23
lines changed

6 files changed

+32
-23
lines changed

apps/OpenSign/src/primitives/GetReportDisplay.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ const ReportTable = ({
7777
}
7878
);
7979

80-
console.log("templateDeatils.data ", templateDeatils.data);
80+
// console.log("templateDeatils.data ", templateDeatils.data);
8181
const templateData =
8282
templateDeatils.data && templateDeatils.data.result;
8383
if (!templateData.error) {

apps/OpenSignServer/cloud/parsefunction/GetTemplate.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ export default async function GetTemplate(request) {
1212
},
1313
});
1414
const userId = userRes.data && userRes.data.objectId;
15-
console.log("templateId ", templateId)
16-
console.log("userId ",userId)
15+
// console.log("templateId ", templateId)
16+
// console.log("userId ",userId)
1717
if (templateId && userId) {
1818
try {
1919
const template = new Parse.Query('contracts_Template');
@@ -22,9 +22,9 @@ export default async function GetTemplate(request) {
2222
template.include('Signers');
2323
template.include('CreateBy');
2424
const res = await template.first({ useMasterKey: true });
25-
console.log("res ", res)
25+
// console.log("res ", res)
2626
if (res) {
27-
console.log("res ",res)
27+
// console.log("res ",res)
2828
const acl = res.getACL();
2929
console.log("acl", acl.getReadAccess(userId))
3030
if (acl && acl.getReadAccess(userId)) {

microfrontends/SignDocuments/src/Component/TemplatePlaceholder.js

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ const TemplatePlaceholder = () => {
5858
const [handleError, setHandleError] = useState();
5959
const [currentEmail, setCurrentEmail] = useState();
6060
const [pdfNewWidth, setPdfNewWidth] = useState();
61-
const [placeholderTour, setPlaceholderTour] = useState(true);
61+
const [templateTour, setTemplateTour] = useState(true);
6262
const [checkTourStatus, setCheckTourStatus] = useState(false);
6363
const [tourStatus, setTourStatus] = useState([]);
6464
const [signerUserId, setSignerUserId] = useState();
@@ -301,10 +301,10 @@ const TemplatePlaceholder = () => {
301301
if (tourstatus && tourstatus.length > 0) {
302302
setTourStatus(tourstatus);
303303
const checkTourRecipients = tourstatus.filter(
304-
(data) => data.placeholder
304+
(data) => data.templatetour
305305
);
306306
if (checkTourRecipients && checkTourRecipients.length > 0) {
307-
setCheckTourStatus(checkTourRecipients[0].placeholder);
307+
setCheckTourStatus(checkTourRecipients[0].templatetour);
308308
}
309309
}
310310
const loadObj = {
@@ -766,12 +766,19 @@ const TemplatePlaceholder = () => {
766766
//here you can add your messages in content and selector is key of particular steps
767767

768768
const tourConfig = [
769+
{
770+
selector: '[data-tut="reactourAddbtn"]',
771+
content: `Clicking "Add" button will show you popup of Add Role, fill role name or it will take by default name and create new receipent.`,
772+
position: "top",
773+
observe: '[data-tut="reactourAddbtn--observe"]',
774+
style: { fontSize: "13px" }
775+
},
769776
{
770777
selector: '[data-tut="reactourFirst"]',
771778
content: `Select a recipient from this list to add a place-holder where he is supposed to sign.The placeholder will appear in the same colour as the recipient name once you drop it on the document.`,
772779
position: "top",
773-
774-
style: { fontSize: "13px" }
780+
style: { fontSize: "13px" },
781+
action: () => handleCloseRoleModal()
775782
},
776783
{
777784
selector: '[data-tut="reactourSecond"]',
@@ -787,29 +794,29 @@ const TemplatePlaceholder = () => {
787794
},
788795
{
789796
selector: '[data-tut="reactourFour"]',
790-
content: `Clicking "Send" button will share the document with all the recipients.It will also send out emails to everyone on the recipients list.`,
797+
content: `Clicking "Save" button will save the template and will ask you for creating new document.`,
791798
position: "top",
792799
style: { fontSize: "13px" }
793800
}
794801
];
795802

796803
//function for update TourStatus
797804
const closeTour = async () => {
798-
setPlaceholderTour(false);
805+
setTemplateTour(false);
799806
const extUserClass = localStorage.getItem("extended_class");
800807
let updatedTourStatus = [];
801808
if (tourStatus.length > 0) {
802809
updatedTourStatus = [...tourStatus];
803-
const placeholderIndex = tourStatus.findIndex(
804-
(obj) => obj["placeholder"] === false || obj["placeholder"] === true
810+
const templatetourIndex = tourStatus.findIndex(
811+
(obj) => obj["templatetour"] === false || obj["templatetour"] === true
805812
);
806-
if (placeholderIndex !== -1) {
807-
updatedTourStatus[placeholderIndex] = { placeholder: true };
813+
if (templatetourIndex !== -1) {
814+
updatedTourStatus[templatetourIndex] = { templatetour: true };
808815
} else {
809-
updatedTourStatus.push({ placeholder: true });
816+
updatedTourStatus.push({ templatetour: true });
810817
}
811818
} else {
812-
updatedTourStatus = [{ placeholder: true }];
819+
updatedTourStatus = [{ templatetour: true }];
813820
}
814821
await axios
815822
.put(
@@ -989,7 +996,7 @@ const TemplatePlaceholder = () => {
989996
<Tour
990997
onRequestClose={closeTour}
991998
steps={tourConfig}
992-
isOpen={placeholderTour}
999+
isOpen={templateTour}
9931000
rounded={5}
9941001
closeWithMask={false}
9951002
/>
@@ -1214,7 +1221,7 @@ const TemplatePlaceholder = () => {
12141221
</div>
12151222
)}
12161223
</DndProvider>
1217-
<div>
1224+
<div data-tut="reactourAddbtn--observe">
12181225
<AddRoleModal
12191226
isModalRole={isModalRole}
12201227
roleName={roleName}

microfrontends/SignDocuments/src/Component/component/AddRoleModal.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ const AddRoleModal = (props) => {
88
isOpen={props.isModalRole}
99
handleClose={props.handleCloseRoleModal}
1010
>
11-
<div className="addusercontainer">
11+
<div
12+
className="addusercontainer"
13+
>
1214
<form
1315
style={{ display: "flex", flexDirection: "column" }}
1416
onSubmit={props.handleAddRole}

microfrontends/SignDocuments/src/Component/component/fieldsComponent.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ function FieldsComponent({
2020
isDragSignatureSS,
2121
isSignYourself,
2222
addPositionOfSignature,
23-
2423
signersdata,
2524
isSelectListId,
2625
setSignerObjId,
@@ -184,6 +183,7 @@ function FieldsComponent({
184183
)}
185184
{handleAddSigner && (
186185
<div
186+
data-tut="reactourAddbtn"
187187
style={{
188188
margin: "5px 0 5px 0",
189189
backgroundColor: themeColor(),

microfrontends/SignDocuments/src/Component/component/signerListPlace.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ function SignerListPlace({
254254
</>
255255
</div>
256256
{handleAddSigner && (
257-
<div className="addSignerBtn" onClick={() => handleAddSigner()}>
257+
<div data-tut="reactourAddbtn" className="addSignerBtn" onClick={() => handleAddSigner()}>
258258
<i className="fa-solid fa-plus"></i>
259259
<span style={{ marginLeft: 2 }}>Add</span>
260260
</div>

0 commit comments

Comments
 (0)