Skip to content

Commit f70e204

Browse files
Merge pull request #1367 from OpenSignLabs/raktima-patch-7
2 parents 1c4a377 + 1715b39 commit f70e204

File tree

11 files changed

+67
-32
lines changed

11 files changed

+67
-32
lines changed

apps/OpenSign/public/locales/en/translation.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -682,6 +682,8 @@
682682
"form-title-2":"Security Setting",
683683
"public-tour-message":"The template needs to be public before you can generate a shareable link.",
684684
"add-user-template": "You need to add a role before you can add fields for it.",
685-
"pdf-uncompatible": "This pdf is not compatible with opensign, please contact <[email protected]>"
685+
"pdf-uncompatible": "This pdf is not compatible with opensign, please contact <[email protected]>",
686+
"text-field-tour":"Fields of type 'Text' must be filled in advance before the document is sent. If you need the signers to provide input, use the 'Text Input' field instead.",
687+
"attach-signer-tour":"You need to attach a Signer to every role. You can do that by clicking this icon. Once you select a Signer it will be attached to all the fields associated with that role which appear in the same colour."
686688

687689
}

apps/OpenSign/public/locales/es/translation.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -682,6 +682,8 @@
682682
"p3": "Consejo: si sus firmantes están familiarizados con OpenSign y lo utilizan con frecuencia, es posible que desee desactivar la visita guiada para disfrutar de una experiencia más fluida. Elija la opción que mejor se adapte a sus necesidades de firma de documentos"
683683
},
684684
"form-title-1": "Configuración del flujo de documentos",
685-
"form-title-2": "Configuración de seguridad"
685+
"form-title-2": "Configuración de seguridad",
686+
"text-field-tour":"Los campos de tipo 'Texto' deben completarse con anticipación antes de enviar el documento. Si necesita que los firmantes proporcionen información, utilice el campo 'Entrada de texto'",
687+
"attach-signer-tour" :"Debe adjuntar un firmante a cada función. Puede hacerlo haciendo clic en este icono. Una vez que seleccione un Firmante, se adjuntará a todos los campos asociados con ese rol que aparecen en el mismo color."
686688

687689
}

apps/OpenSign/public/locales/fr/translation.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -681,7 +681,9 @@
681681
"form-title-2": "Paramètre de sécurité",
682682
"public-tour-message": "Le modèle doit être public avant que vous puissiez générer un lien partageable.",
683683
"add-user-template":"Vous devez ajouter un rôle avant de pouvoir lui ajouter des champs. ",
684-
"pdf-uncompatible":"Ce pdf n'est pas compatible avec opensign, veuillez contacter <[email protected]>"
684+
"pdf-uncompatible":"Ce pdf n'est pas compatible avec opensign, veuillez contacter <[email protected]>",
685+
"text-field-tour" :"Les champs de type 'Texte' doivent être remplis à l'avance avant l'envoi du document. Si vous avez besoin que les signataires fournissent des informations, utilisez plutôt le champ 'Saisie de texte'.",
686+
"attach-signer-tour" :"Vous devez associer un signataire à chaque rôle. Vous pouvez le faire en cliquant sur cette icône. Une fois que vous avez sélectionné un signataire, il sera attaché à tous les champs associés à ce rôle qui apparaissent dans la même couleur."
685687

686688

687689
}

apps/OpenSign/src/components/pdf/Placeholder.js

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -356,18 +356,13 @@ function Placeholder(props) {
356356

357357
if (props.data && props?.pos?.type !== textWidget) {
358358
props.setUniqueId(props?.data?.Id);
359-
const checkIndex = props.xyPostion.findIndex(
360-
(data) => data.Id === props.data.Id
361-
);
362-
359+
const checkIndex = props.xyPostion
360+
.filter((data) => data.Role !== "prefill")
361+
.findIndex((data) => data.Id === props.data.Id);
363362
props.setIsSelectId(checkIndex || 0);
364363
} else if (props.data && props.pos.type === textWidget) {
365364
props.setTempSignerId(props.uniqueId);
366365
props.setUniqueId(props?.data?.Id);
367-
const checkIndex = props.xyPostion.findIndex(
368-
(data) => data.Id === props.data.Id
369-
);
370-
props.setIsSelectId(checkIndex || 0);
371366
}
372367

373368
//checking widget's type and open widget copy modal for required widgets

apps/OpenSign/src/components/pdf/RenderPdf.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -361,6 +361,7 @@ function RenderPdf({
361361
fontColor={fontColor}
362362
setFontColor={setFontColor}
363363
isResize={isResize}
364+
unSignedWidgetId={unSignedWidgetId}
364365
/>
365366
</React.Fragment>
366367
);
@@ -555,6 +556,7 @@ function RenderPdf({
555556
fontColor={fontColor}
556557
setFontColor={setFontColor}
557558
isResize={isResize}
559+
unSignedWidgetId={unSignedWidgetId}
558560
/>
559561
</React.Fragment>
560562
);

apps/OpenSign/src/constant/Utils.js

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1885,12 +1885,16 @@ export const handleCopyNextToWidget = (
18851885
//get position of previous widget and create new widget next to that widget on same data except
18861886
// xPosition and key
18871887
let newposition = position;
1888-
const calculateXPosition =
1889-
parseInt(position.xPosition) +
1890-
defaultWidthHeight(widgetType).width +
1891-
resizeBorderExtraWidth();
1888+
const calculateXPosition = parseInt(position.xPosition) + 10;
1889+
const calculateYPosition = parseInt(position.yPosition) + 10;
1890+
18921891
const newId = randomId();
1893-
newposition = { ...newposition, xPosition: calculateXPosition, key: newId };
1892+
newposition = {
1893+
...newposition,
1894+
xPosition: calculateXPosition,
1895+
yPosition: calculateYPosition,
1896+
key: newId
1897+
};
18941898
//if condition to create widget in request-sign flow
18951899
if (userId) {
18961900
filterSignerPos = xyPostion.filter((data) => data.Id === userId);

apps/OpenSign/src/pages/PdfRequestFiles.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1950,7 +1950,7 @@ function PdfRequestFiles(props) {
19501950
})
19511951
}
19521952
type="button"
1953-
className="op-btn op-btn-secondary"
1953+
className="op-btn op-btn-secondary ml-1"
19541954
>
19551955
{t("close")}
19561956
</button>

apps/OpenSign/src/pages/PlaceHolderSign.js

Lines changed: 34 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ function PlaceHolderSign() {
151151
const [scale, setScale] = useState(1);
152152
const [pdfRotateBase64, setPdfRotatese64] = useState("");
153153
const [planCode, setPlanCode] = useState("");
154+
const [unSignedWidgetId, setUnSignedWidgetId] = useState("");
154155
const isMobile = window.innerWidth < 767;
155156
const [, drop] = useDrop({
156157
accept: "BOX",
@@ -844,17 +845,24 @@ function PlaceHolderSign() {
844845
};
845846
const alertSendEmail = async () => {
846847
const filterPrefill = signerPos?.filter((data) => data.Role !== "prefill");
847-
const getPrefill = signerPos?.filter((data) => data.Role === "prefill");
848+
const getPrefill = signerPos?.find((data) => data.Role === "prefill");
848849
let isLabel = false;
850+
let unfilledTextWidgetId = "";
849851
//checking all signers placeholder exist or not
850852
const isPlaceholderExist = filterPrefill.every((data) => data.placeHolder);
851-
const prefillPlaceholder = getPrefill[0]?.placeHolder;
853+
const prefillPlaceholder = getPrefill?.placeHolder;
852854
//condition is used to check text widget data is empty or have response
853-
if (getPrefill && getPrefill.length > 0) {
855+
if (getPrefill) {
854856
if (prefillPlaceholder) {
855857
prefillPlaceholder.map((data) => {
856858
if (!isLabel) {
857-
isLabel = data.pos.some((position) => !position.options.response);
859+
const unfilledTextWidgets = data.pos.find(
860+
(position) => !position.options.response
861+
);
862+
if (unfilledTextWidgets) {
863+
isLabel = true;
864+
unfilledTextWidgetId = unfilledTextWidgets.key;
865+
}
858866
}
859867
});
860868
}
@@ -882,6 +890,7 @@ function PlaceHolderSign() {
882890
}
883891
if (getPrefill && isLabel) {
884892
setIsSendAlert({ mssg: textWidget, alert: true });
893+
setUnSignedWidgetId(unfilledTextWidgetId);
885894
} else if (isSignatureExist) {
886895
if (isPlaceholderExist) {
887896
const IsSignerNotExist = filterPrefill?.filter((x) => !x.signerObjId);
@@ -1648,8 +1657,15 @@ function PlaceHolderSign() {
16481657
const signerAssignTour = [
16491658
{
16501659
selector: '[data-tut="assignSigner"]',
1651-
content:
1652-
"You need to attach a Signer to every role. You can do that by clicking this icon. Once you select a Signer it will be attached to all the fields associated with that role which appear in the same colour. ",
1660+
content: t("attach-signer-tour"),
1661+
position: "top",
1662+
style: { fontSize: "13px" }
1663+
}
1664+
];
1665+
const textFieldTour = [
1666+
{
1667+
selector: '[data-tut="IsSigned"]',
1668+
content: t("text-field-tour"),
16531669
position: "top",
16541670
style: { fontSize: "13px" }
16551671
}
@@ -1759,6 +1775,13 @@ function PlaceHolderSign() {
17591775
rounded={5}
17601776
closeWithMask={false}
17611777
/>
1778+
<Tour
1779+
onRequestClose={() => setIsSendAlert({})}
1780+
steps={textFieldTour}
1781+
isOpen={isSendAlert.mssg === textWidget}
1782+
rounded={5}
1783+
closeWithMask={false}
1784+
/>
17621785
{/* this component used to render all pdf pages in left side */}
17631786
<RenderAllPdfPage
17641787
signPdfUrl={pdfDetails[0].URL}
@@ -1779,20 +1802,18 @@ function PlaceHolderSign() {
17791802
<div className=" w-full md:w-[95%] ">
17801803
{/* this modal is used show alert set placeholder for all signers before send mail */}
17811804
<ModalUi
1782-
isOpen={isSendAlert.alert}
1805+
isOpen={
1806+
isSendAlert.alert && isSendAlert.mssg !== textWidget
1807+
}
17831808
title={
17841809
isSendAlert.mssg === "sure" ||
1785-
isSendAlert.mssg === textWidget
1786-
? t("fields-required")
1787-
: isSendAlert.mssg === "confirm" && t("send-mail")
1810+
(isSendAlert.mssg === "confirm" && t("send-mail"))
17881811
}
17891812
handleClose={() => handleCloseSendmailModal()}
17901813
>
17911814
<div className="max-h-96 overflow-y-scroll scroll-hide p-[20px] text-base-content">
17921815
{isSendAlert.mssg === "sure" ? (
17931816
<span>{t("placeholder-alert-1")}</span>
1794-
) : isSendAlert.mssg === textWidget ? (
1795-
<p>{t("placeholder-alert-2")}</p>
17961817
) : (
17971818
isSendAlert.mssg === "confirm" && (
17981819
<>
@@ -2085,6 +2106,7 @@ function PlaceHolderSign() {
20852106
setFontSize={setFontSize}
20862107
fontColor={fontColor}
20872108
setFontColor={setFontColor}
2109+
unSignedWidgetId={unSignedWidgetId}
20882110
/>
20892111
)}
20902112
</div>

apps/OpenSign/src/script/locales/en/translation.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -682,6 +682,8 @@
682682
"form-title-2": "Security Setting",
683683
"public-tour-message": "The template needs to be public before you can generate a shareable link.",
684684
"add-user-template": "You need to add a role before you can add fields for it.",
685-
"pdf-uncompatible": "This pdf is not compatible with opensign, please contact <[email protected]>"
685+
"pdf-uncompatible": "This pdf is not compatible with opensign, please contact <[email protected]>",
686+
"text-field-tour":"Fields of type 'Text' must be filled in advance before the document is sent. If you need the signers to provide input, use the 'Text Input' field instead.",
687+
"attach-signer-tour":"You need to attach a Signer to every role. You can do that by clicking this icon. Once you select a Signer it will be attached to all the fields associated with that role which appear in the same colour."
686688

687689
}

apps/OpenSign/src/script/locales/es/translation.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -682,5 +682,7 @@
682682
"p3": "Consejo: si sus firmantes están familiarizados con OpenSign y lo utilizan con frecuencia, es posible que desee desactivar la visita guiada para disfrutar de una experiencia más fluida. Elija la opción que mejor se adapte a sus necesidades de firma de documentos"
683683
},
684684
"form-title-1": "Configuración del flujo de documentos",
685-
"form-title-2": "Configuración de seguridad"
685+
"form-title-2": "Configuración de seguridad",
686+
"text-field-tour":"Los campos de tipo 'Texto' deben completarse con anticipación antes de enviar el documento. Si necesita que los firmantes proporcionen información, utilice el campo 'Entrada de texto'",
687+
"attach-signer-tour" :"Debe adjuntar un firmante a cada función. Puede hacerlo haciendo clic en este icono. Una vez que seleccione un Firmante, se adjuntará a todos los campos asociados con ese rol que aparecen en el mismo color."
686688
}

0 commit comments

Comments
 (0)