Skip to content

Commit 5ffa681

Browse files
feat: add copy public URL option to copy public url
1 parent 91364db commit 5ffa681

File tree

8 files changed

+168
-120
lines changed

8 files changed

+168
-120
lines changed

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

Lines changed: 2 additions & 1 deletion
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",

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

Lines changed: 2 additions & 1 deletion
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.",

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: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -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/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/primitives/GetReportDisplay.js

Lines changed: 54 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ const ReportTable = (props) => {
7676
const [reason, setReason] = useState("");
7777
const [isDownloadModal, setIsDownloadModal] = useState(false);
7878
const [isEmbed, setIsEmbed] = useState(false);
79+
const [isPublicTour, setIsPublicTour] = useState();
7980
const Extand_Class = localStorage.getItem("Extand_Class");
8081
const extClass = Extand_Class && JSON.parse(Extand_Class);
8182
const startIndex = (currentPage - 1) * props.docPerPage;
@@ -373,6 +374,19 @@ const ReportTable = (props) => {
373374
handleEmbedFunction(item);
374375
} else if (act.action === "CopyTemplateId") {
375376
copyTemplateId(item.objectId);
377+
} else if (act.action === "CopyPublicURL") {
378+
const isPublic = item?.IsPublic;
379+
if (isPublic) {
380+
let publicUrl = "";
381+
if (isStaging) {
382+
publicUrl = `https://staging.opensign.me/publicsign?templateid=${item.objectId}`;
383+
} else {
384+
publicUrl = `https://opensign.me/publicsign?templateid=${item.objectId}`;
385+
}
386+
copyTemplateId(publicUrl);
387+
} else {
388+
setIsPublicTour({ [item.objectId]: true });
389+
}
376390
}
377391
};
378392
// Get current list
@@ -1133,6 +1147,17 @@ const ReportTable = (props) => {
11331147
setIsPublicUserName(extendUser[0]?.UserName || "");
11341148
};
11351149

1150+
const publicTourConfig = [
1151+
{
1152+
selector: '[data-tut="IsPublic"]',
1153+
content: "Please make template public to copy public URL",
1154+
position: "top",
1155+
style: { fontSize: "13px" }
1156+
}
1157+
];
1158+
const closePublicTour = () => {
1159+
setIsPublicTour();
1160+
};
11361161
return (
11371162
<div className="relative">
11381163
{Object.keys(actLoader)?.length > 0 && (
@@ -1153,13 +1178,27 @@ const ReportTable = (props) => {
11531178
)}
11541179
{isAlert && <Alert type={alertMsg.type}>{alertMsg.message}</Alert>}
11551180
{props.tourData && props.ReportName === "Templates" && (
1156-
<Tour
1157-
onRequestClose={closeTour}
1158-
steps={props.tourData}
1159-
isOpen={isTour}
1160-
// rounded={5}
1161-
closeWithMask={false}
1162-
/>
1181+
<>
1182+
<Tour
1183+
onRequestClose={closeTour}
1184+
steps={props.tourData}
1185+
isOpen={isTour}
1186+
// rounded={5}
1187+
closeWithMask={false}
1188+
/>
1189+
{isPublicTour && (
1190+
<Tour
1191+
showNumber={false}
1192+
showNavigation={false}
1193+
showNavigationNumber={false}
1194+
onRequestClose={closePublicTour}
1195+
steps={publicTourConfig}
1196+
isOpen={true}
1197+
rounded={5}
1198+
closeWithMask={false}
1199+
/>
1200+
)}
1201+
</>
11631202
)}
11641203
<div className="flex flex-row items-center justify-between my-2 mx-3 text-[20px] md:text-[23px]">
11651204
<div className="font-light">
@@ -1375,13 +1414,17 @@ const ReportTable = (props) => {
13751414
isEnableSubscription && (
13761415
<td className=" pl-[20px] py-2">
13771416
{props.ReportName === "Templates" && (
1378-
<div className="flex flex-row">
1417+
<div
1418+
className="flex flex-row "
1419+
data-tut="IsPublic"
1420+
>
13791421
<label className="cursor-pointer relative inline-flex items-center mb-0">
13801422
<input
13811423
checked={props.isPublic?.[item.objectId]}
1382-
onChange={(e) =>
1383-
handlePublicChange(e, item)
1384-
}
1424+
onChange={(e) => {
1425+
setIsPublicTour();
1426+
handlePublicChange(e, item);
1427+
}}
13851428
type="checkbox"
13861429
value=""
13871430
className="sr-only peer"

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

Lines changed: 40 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
"upgrade-now": "Upgrade now",
4242
"upgrade-to": "Upgrade to",
4343
"plan": "Plan",
44-
"subscribe-card-teamplan": "Unlock the full power of collaboration! Create unlimited organizations, teams, and hierarchies. Share templates seamlessly across teams and assign custom user roles. Elevate your workflow today!",
44+
"subscribe-card-teamplan":"Unlock the full power of collaboration! Create unlimited organizations, teams, and hierarchies. Share templates seamlessly across teams and assign custom user roles. Elevate your workflow today!",
4545
"subscribe-card-plan": "Unlock premium features starting at just {{premiumPrice}}/month. Enjoy enhanced performance and only {{addonPrice}} per additional credit after your included premium credits.",
4646
"user-name-limit-char": "To have a username less than 8 character please subscribe",
4747
"tour-content": "Don't show this again",
@@ -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",
@@ -266,7 +267,7 @@
266267
"public-role": "Public role",
267268
"public-url": "Public URL",
268269
"public-url-copy": "Here’s your public URL: ",
269-
"public-url-copy-mssg": "Copy it or share it with the signer, and you will be able to see all your publicly set templates.",
270+
"public-url-copy-mssg":"Copy it or share it with the signer, and you will be able to see all your publicly set templates.",
270271
"add-public-url-alert": "Please add your public URL, and you will be able to make a public template.",
271272
"share-with-alert": "You cannot share a template if any roles already have contacts assigned. Please remove all contact assignments from the roles before sharing the template.",
272273
"share-with": "Share with",
@@ -597,7 +598,7 @@
597598
"Recently sent for signatures": "This is a list of documents you've sent to other parties for signature.",
598599
"Drafts": "This are documents you have started but have not finalized for sending.",
599600
"public-template": "This video demonstrates how to set up your personalized public profile, such as ‘https://opensign.me/your-username’. You’ll also learn how to customize your tagline and make your templates available for public signing."
600-
},
601+
},
601602
"enter-email-plaholder": "Add an email address and hit enter",
602603
"success-email-alert": "Email sent successfully!",
603604
"expired-doc-title": "Expired Document",
@@ -618,57 +619,57 @@
618619
"select-date-format": "Select a date format",
619620
"quantity-of-credits": "Quantity of premium credits",
620621
"remaining-credits": "Premium credits available:",
621-
"remaining-credits-help": "Use premium credits for API document signing, bulk sending, or embedding OpenSign integration on your website. You have {{allowedcredits}} included credits and {{addoncredits}} additional purchased credits remaining.",
622+
"remaining-credits-help":"Use premium credits for API document signing, bulk sending, or embedding OpenSign integration on your website. You have {{allowedcredits}} included credits and {{addoncredits}} additional purchased credits remaining.",
622623
"additional-credits": "Please purchase premium credits",
623624
"quota-err-quicksend": "Quota Reached, You don't have enough credits.",
624625
"buy-credits": "Buy Premium Credits",
625-
"rotate-right": "Rotate right",
626-
"rotate-left": "Rotate left",
627-
"rotate-alert-mssg": "All widgets on this page will be lost. Are you sure you want to proceed?",
628-
"templateid": "Template-Id",
629-
"bulk-send-subcription-alert": "Please upgrade to Professional or Team plan to use bulk send.",
630-
"generate-test-token": "Generate Test Token",
631-
"regenerate-test-token": "Regenerate Test Token",
632-
"help-test-token": "This token can be used to test the APIs at the https://sandbox.opensignlabs.com/api/v1 endpoint, allowing you to conduct unlimited document signatures. Please note that the sandbox API will sign your documents with self-signed certificates, which may not be recognized as valid by Adobe. Once you’ve completed your testing, you can upgrade to one of our paid plans to generate a production token.",
633-
"help-api-token": "This token can be used to access the production APIs at the {{origin}}/api/v1 endpoint. It can only be generated on one of our paid plans.",
634-
"reason": "Reason",
635-
"decline-by": "Declined/revoked by",
626+
"rotate-right":"Rotate right",
627+
"rotate-left":"Rotate left",
628+
"rotate-alert-mssg":"All widgets on this page will be lost. Are you sure you want to proceed?",
629+
"templateid":"Template-Id",
630+
"bulk-send-subcription-alert":"Please upgrade to Professional or Team plan to use bulk send.",
631+
"generate-test-token":"Generate Test Token",
632+
"regenerate-test-token":"Regenerate Test Token",
633+
"help-test-token":"This token can be used to test the APIs at the https://sandbox.opensignlabs.com/api/v1 endpoint, allowing you to conduct unlimited document signatures. Please note that the sandbox API will sign your documents with self-signed certificates, which may not be recognized as valid by Adobe. Once you’ve completed your testing, you can upgrade to one of our paid plans to generate a production token.",
634+
"help-api-token":"This token can be used to access the production APIs at the {{origin}}/api/v1 endpoint. It can only be generated on one of our paid plans.",
635+
"reason":"Reason",
636+
"decline-by":"Declined/revoked by",
636637
"document-declined": "Document declined",
637-
"public-template-mssg-1": "To integrate OpenSign into your React or Next.js project, simply run the following command:",
638-
"public-template-mssg-2": "Ensure you have npm or yarn set up in your project. If you’re using Yarn, you can replace npm install with yarn add @opensign/react.",
639-
"public-template-mssg-3": "Need more details or examples?",
638+
"public-template-mssg-1":"To integrate OpenSign into your React or Next.js project, simply run the following command:",
639+
"public-template-mssg-2" :"Ensure you have npm or yarn set up in your project. If you’re using Yarn, you can replace npm install with yarn add @opensign/react.",
640+
"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-
"copy-code": "COPY",
644-
"copied-code": "COPIED",
645-
"Installation": "Installation",
646-
"Usage": "Usage",
647-
"insufficient-credits": "Insufficient Signing Credits",
648-
"insufficient-credits-mssg": "The owner of this document currently lacks the necessary OpenSign credits for you to sign. Please reach out to the owner if you require further details.",
643+
"public-template-mssg-6" :"You need to set this template as public before you can utilize this code snippet.",
644+
"copy-code":"COPY",
645+
"copied-code":"COPIED",
646+
"Installation":"Installation",
647+
"Usage" :"Usage",
648+
"insufficient-credits":"Insufficient Signing Credits",
649+
"insufficient-credits-mssg":"The owner of this document currently lacks the necessary OpenSign credits for you to sign. Please reach out to the owner if you require further details.",
649650
"angular-npm-mssg-1": "To integrate OpenSign into your Angular project, simply run the following command:",
650-
"quota-mail-info-head": "Monthly request signatures email limit",
651+
"quota-mail-info-head":"Monthly request signatures email limit",
651652
"quota-mail-info": "You can send upto 15 signature request emails every month. Upgrade now to send unlimited signing requests directly.",
652653
"quota-mail": "You've reached your limit of 15 signature request emails for this month. Upgrade now to continue sending emails directly.",
653-
"quota-mail-tip": "Tip: You can still sign <1>unlimited documents</1> by manually sharing the signing request links.",
654-
"quota-mail-head": "Quota Reached",
655-
"unauthorized-modal": "You don't have permission to perform this action, please contact {{adminEmail}}.",
656-
"sent-this-month": "Sent this month",
657-
"available-seats": "Available seats",
658-
"buy-users": "Buy more users",
654+
"quota-mail-tip":"Tip: You can still sign <1>unlimited documents</1> by manually sharing the signing request links.",
655+
"quota-mail-head":"Quota Reached",
656+
"unauthorized-modal":"You don't have permission to perform this action, please contact {{adminEmail}}.",
657+
"sent-this-month":"Sent this month",
658+
"available-seats":"Available seats",
659+
"buy-users":"Buy more users",
659660
"isenable-otp": "Enable OTP verification",
660661
"isenable-otp-help": {
661662
"p1": "Would you like to enable the verification process using a one-time password (OTP)?",
662663
"p2": "Selecting this option will enable OTP verification. Users will receive a verification code via email, which they must enter to sign the document.",
663664
"p3": "Selecting this option will disable OTP verification, allowing users to sign the document directly without additional steps.",
664665
"p4": "Please choose the option that best suits your document signing requirements."
665666
},
666-
"advanced-options": "Advanced options",
667-
"hide-advanced-options": "Hide Advanced options",
668-
"download-files": "Download files",
669-
"download-pdf": "Download Pdf",
670-
"pdf-certificate": "Download Pdf + Certificate",
671-
"document-logs": "Document logs",
667+
"advanced-options":"Advanced options",
668+
"hide-advanced-options":"Hide Advanced options",
669+
"download-files":"Download files",
670+
"download-pdf":"Download Pdf",
671+
"pdf-certificate":"Download Pdf + Certificate",
672+
"document-logs":"Document logs",
672673
"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.",
673674
"admin-exists": "Admin already exists. Please login to the application using admin credentials in order to manage users."
674675

0 commit comments

Comments
 (0)