Skip to content

Commit 66a5675

Browse files
Merge branch 'staging' of https://github.com/OpenSignLabs/OpenSign into react-tour
2 parents 088ec55 + 63b2693 commit 66a5675

File tree

23 files changed

+259
-174
lines changed

23 files changed

+259
-174
lines changed

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

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,8 @@
132132
"View": "View",
133133
"option": "Option",
134134
"Embed": "Embed",
135-
"Copy TemplateId":"Copy TemplateId"
135+
"Copy TemplateId":"Copy TemplateId",
136+
"Copy Public URL":"Copy Public URL"
136137
},
137138
"report-heading": {
138139
"Sr.No": "Sr.No",
@@ -639,7 +640,7 @@
639640
"public-template-mssg-3" :"Need more details or examples?",
640641
"public-template-mssg-4": "Visit the",
641642
"public-template-mssg-5": " npm for the latest updates, detailed documentation, and version history.",
642-
"public-template-mssg-6" :"You need to set this template as public before you can utilize this code snippet.",
643+
"public-template-mssg-6" :"Before you can use this code snippet, you must make this template public.",
643644
"copy-code":"COPY",
644645
"copied-code":"COPIED",
645646
"Installation":"Installation",
@@ -669,11 +670,14 @@
669670
"download-pdf":"Download Pdf",
670671
"pdf-certificate":"Download Pdf + Certificate",
671672
"document-logs":"Document logs",
672-
"enable-tour":"Enable Tour",
673-
"istourenabled-help":{
674-
"p1":"This will enable a guided tour for signers, providing instructions during the signing process.",
675-
"p2":"This will disable the guided tour, ensuring a faster, uninterrupted signing experience.",
676-
"p3":"Tip: If your signers are familiar with OpenSign and frequently use it, you may want to disable the guided tour for a more seamless experience. Choose the option that best fits your document signing needs."
677-
}
673+
"server-down": "Unable to connect to the OpenSign server. If you are self-hosting OpenSign, please ensure that all the steps in the documentation have been followed correctly. If you're running OpenSign locally, you might be accessing it through an incorrect port number.",
674+
"admin-exists": "Admin already exists. Please login to the application using admin credentials in order to manage users.",
675+
"public-tour-message":"Please make template public to copy public URL",
676+
"enable-tour":"Enable Tour",
677+
"istourenabled-help":{
678+
"p1":"This will enable a guided tour for signers, providing instructions during the signing process.",
679+
"p2":"This will disable the guided tour, ensuring a faster, uninterrupted signing experience.",
680+
"p3":"Tip: If your signers are familiar with OpenSign and frequently use it, you may want to disable the guided tour for a more seamless experience. Choose the option that best fits your document signing needs."
681+
}
678682

679683
}

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

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,8 @@
152152
"View": "Voir",
153153
"option": "Option",
154154
"Embed": "Intégrer",
155-
"Copy TemplateId": "Copier l'ID du modèle"
155+
"Copy TemplateId": "Copier l'ID du modèle",
156+
"Copy Public URL":"Copier l'URL publique"
156157
},
157158
"report-help": {
158159
"Draft Documents": "Il s'agit de documents que vous avez commencés mais que vous n'avez pas finalisés pour envoi.",
@@ -638,7 +639,7 @@
638639
"public-template-mssg-3" :"Besoin de plus de détails ou d'exemples ?",
639640
"public-template-mssg-4": "Visitez le",
640641
"public-template-mssg-5": "npm pour les dernières mises à jour, une documentation détaillée et l'historique des versions.",
641-
"public-template-mssg-6":"Vous devez définir ce modèle comme public avant de pouvoir utiliser cet extrait de code.",
642+
"public-template-mssg-6":"Avant de pouvoir utiliser cet extrait de code, vous devez rendre ce modèle public.",
642643
"copy-code":"COPIE",
643644
"copied-code":"COPIÉ",
644645
"Installation":"Installation",
@@ -668,11 +669,15 @@
668669
"download-pdf" :"Télécharger le PDF",
669670
"pdf-certificate" :"Télécharger Pdf + Certificat",
670671
"document-logs":"Journaux de documents",
672+
"server-down": "Impossible de se connecter au serveur OpenSign. Si vous hébergez vous-même OpenSign, veuillez vous assurer que toutes les étapes de la documentation ont été correctement suivies. Si vous exécutez OpenSign localement, vous y accédez peut-être via un numéro de port incorrect.",
673+
"admin-exists": "L'administrateur existe déjà. Veuillez vous connecter à l'application en utilisant les informations d'identification de l'administrateur afin de gérer les utilisateurs.",
674+
"public-tour-message":"Veuillez rendre le modèle public pour copier l'URL publique",
671675
"enable-tour": "Activer la visite",
672676
"istourenabled-otp-help":{
673677
"p1": "Cela permettra une visite guidée pour les signataires, fournissant des instructions pendant le processus de signature.",
674678
"p2": "Cela désactivera la visite guidée, garantissant ainsi une expérience de signature plus rapide et ininterrompue.",
675679
"p3": "Conseil : si vos signataires connaissent OpenSign et l'utilisent fréquemment, vous souhaiterez peut-être désactiver la visite guidée pour une expérience plus fluide. Choisissez l'option qui correspond le mieux à vos besoins en matière de signature de documents."
676680
}
677681

682+
678683
}

apps/OpenSign/public/version.txt

0 Bytes
Binary file not shown.

apps/OpenSign/src/components/opensigndrive/DriveBody.js

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import React, { useState, useEffect, useRef } from "react";
22
import "../../styles/opensigndrive.css";
33
import axios from "axios";
44
import * as ContextMenu from "@radix-ui/react-context-menu";
5-
import { saveAs } from "file-saver";
65
import { useNavigate } from "react-router-dom";
76
import Table from "react-bootstrap/Table";
87
import * as HoverCard from "@radix-ui/react-hover-card";
@@ -264,12 +263,6 @@ function DriveBody(props) {
264263
setIsOpenMoveModal(false);
265264
}
266265
};
267-
268-
const sanitizeFileName = (pdfName) => {
269-
// Replace spaces with underscore
270-
return pdfName.replace(/ /g, "_");
271-
};
272-
273266
const handleEnterPress = (e, data) => {
274267
if (e.key === "Enter") {
275268
handledRenameDoc(data);

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

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export function App() {
3434
<Opensign
3535
onLoad={() => console.log("success")}
3636
onLoadError={(error) => console.log(error)}
37-
templateId= {"${props.templateId}"}
37+
templateId= "${props.templateId}"
3838
/>
3939
</div>
4040
);
@@ -63,10 +63,10 @@ import {OpensignComponent} from "@opensign/angular"
6363
selector:'app-root',
6464
standalone: true,
6565
imports: [OpensignComponent],
66-
template: '<opensign templateId={"${props.templateId}"}
66+
template:\`<opensign templateId="${props.templateId}"
6767
(onLoad)="handleLoad()"
6868
(onLoadError)="handleError($event)"
69-
></opensign>',
69+
></opensign>\`,
7070
})
7171
export class AppComponent{
7272
handleLoad() {
@@ -129,9 +129,11 @@ export class AppComponent{
129129
<p className="font-medium text-[18px]">
130130
{t(`${data.title}`)}
131131
</p>
132-
<p className="text-[13px] mt-2">
133-
{t("public-template-mssg-1")}
134-
</p>
132+
{ind === 0 && (
133+
<p className="text-[13px] mt-2">
134+
{t("public-template-mssg-1")}
135+
</p>
136+
)}
135137
<div className="relative p-1">
136138
<div
137139
onClick={() => handleCopy(data.codeString, ind)}
@@ -210,11 +212,11 @@ export class AppComponent{
210212
<p className="font-medium text-[18px]">
211213
{t(`${data.title}`)}
212214
</p>
213-
214-
<p className="text-[13px] mt-2">
215-
{t("angular-npm-mssg-1")}
216-
</p>
217-
215+
{ind === 0 && (
216+
<p className="text-[13px] mt-2">
217+
{t("angular-npm-mssg-1")}
218+
</p>
219+
)}
218220
<div className="relative p-1">
219221
<div
220222
onClick={() => handleCopy(data.codeString, ind)}

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -725,7 +725,9 @@ function Placeholder(props) {
725725
: props?.pos?.zIndex
726726
? props.pos.zIndex
727727
: "5",
728-
background: props.data ? props.data.blockColor : "rgb(203 233 237)"
728+
background: props.data
729+
? props.data?.blockColor + "b0"
730+
: "rgba(203, 233, 237, 0.69)"
729731
}}
730732
onDrag={() => {
731733
setDraggingEnabled(true);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -596,7 +596,7 @@ function SignPad({
596596
borderRadius: "2px"
597597
}
598598
}}
599-
backgroundColor="rgb(255, 255, 255)"
599+
// backgroundColor="rgb(255, 255, 255)"
600600
onEnd={() =>
601601
handleSignatureChange(canvasRef.current?.toDataURL())
602602
}

apps/OpenSign/src/constant/Utils.js

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1351,11 +1351,6 @@ export const multiSignEmbed = async (
13511351
widgetsPositionArr.map(async (url) => {
13521352
let signUrl = url.SignUrl && url.SignUrl;
13531353
if (signUrl) {
1354-
if (url.ImageType === "image/png") {
1355-
//function for convert signature png base64 url to jpeg base64
1356-
const newUrl = await convertPNGtoJPEG(signUrl);
1357-
signUrl = newUrl;
1358-
}
13591354
const res = await fetch(signUrl);
13601355
return res.arrayBuffer();
13611356
}
@@ -1365,19 +1360,14 @@ export const multiSignEmbed = async (
13651360
widgetsPositionArr.forEach(async (position, id) => {
13661361
let img;
13671362
if (["signature", "stamp", "initials", "image"].includes(position.type)) {
1368-
if (
1369-
(position.ImageType && position.ImageType === "image/png") ||
1370-
position.ImageType === "image/jpeg"
1371-
) {
1363+
if (position.ImageType && position.ImageType === "image/jpeg") {
13721364
img = await pdfDoc.embedJpg(images[id]);
13731365
} else {
13741366
img = await pdfDoc.embedPng(images[id]);
13751367
}
13761368
} else if (!position.type) {
1377-
if (
1378-
(position.ImageType && position.ImageType === "image/png") ||
1379-
position.ImageType === "image/jpeg"
1380-
) {
1369+
// to handle old widget when only stamp and signature are exists
1370+
if (position.ImageType && position.ImageType === "image/jpeg") {
13811371
img = await pdfDoc.embedJpg(images[id]);
13821372
} else {
13831373
img = await pdfDoc.embedPng(images[id]);
@@ -1937,7 +1927,11 @@ export const getAppLogo = async () => {
19371927
}
19381928
} catch (err) {
19391929
console.log("err in getlogo ", err);
1940-
return { logo: appInfo.applogo, user: "exist" };
1930+
if (err?.message?.includes("valid JSON")) {
1931+
return { logo: appInfo.applogo, user: "exist", error: "invalid_json" };
1932+
} else {
1933+
return { logo: appInfo.applogo, user: "exist" };
1934+
}
19411935
}
19421936
}
19431937
};

apps/OpenSign/src/json/ReportJson.js

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,13 @@ export default function reportJson(id) {
3939
hoverLabel: "Copy TemplateId",
4040
btnIcon: "fa-light fa-copy",
4141
action: "CopyTemplateId"
42+
},
43+
{
44+
btnId: "2434",
45+
btnLabel: "Copy Public URL",
46+
hoverLabel: "Copy Public URL",
47+
btnIcon: "fa-light fa-copy",
48+
action: "CopyPublicURL"
4249
}
4350
]
4451
: [];
@@ -405,18 +412,15 @@ export default function reportJson(id) {
405412
if (item.action === "option") {
406413
// Make a shallow copy of the item
407414
const newItem = { ...item };
408-
newItem.subaction = [
409-
{
410-
btnId: "1873",
411-
btnLabel: "Share with team",
412-
hoverLabel: "Share with team",
413-
btnIcon: "fa-light fa-share-nodes",
414-
redirectUrl: "",
415-
action: "sharewith"
416-
},
417-
...newItem.subaction
418-
];
419-
415+
//splice method used to add `Share with team` option on second index of list
416+
newItem.subaction.splice(1, 0, {
417+
btnId: "1873",
418+
btnLabel: "Share with team",
419+
hoverLabel: "Share with team",
420+
btnIcon: "fa-light fa-share-nodes",
421+
redirectUrl: "",
422+
action: "sharewith"
423+
});
420424
return newItem;
421425
}
422426
return item;

apps/OpenSign/src/pages/AddAdmin.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ const AddAdmin = () => {
4646
try {
4747
const app = await getAppLogo();
4848
if (app?.user === "exist") {
49-
setErrMsg(t("admin-already-exist"));
49+
setErrMsg(t("admin-exists"));
5050
}
5151
} catch (err) {
5252
setErrMsg(t("something-went-wrong-mssg"));

0 commit comments

Comments
 (0)