Skip to content

Commit de5b816

Browse files
fix: add embedding functionality for all template & add CopyTemplateId button in template report list options
1 parent 83df969 commit de5b816

File tree

9 files changed

+129
-115
lines changed

9 files changed

+129
-115
lines changed

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

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,8 @@
131131
"Share": "Share",
132132
"View": "View",
133133
"option": "Option",
134-
"Embed": "Embed"
134+
"Embed": "Embed",
135+
"CopyTemplateId":"CopyTemplateId"
135136
},
136137
"report-heading": {
137138
"Sr.No": "Sr.No",
@@ -263,7 +264,8 @@
263264
"make-template-private-alert": "Are you sure you want to make this template private? This will remove it from your public profile.",
264265
"public-role": "Public role",
265266
"public-url": "Public URL",
266-
"public-url-copy-mssg": " Here’s your public URL: Copy it or share it with the signer, and you will be able to see all your publicly set templates.",
267+
"public-url-copy": "Here’s your public URL: ",
268+
"public-url-copy-mssg":"Copy it or share it with the signer, and you will be able to see all your publicly set templates.",
267269
"add-public-url-alert": "Please add your public URL, and you will be able to make a public template.",
268270
"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.",
269271
"share-with": "Share with",
@@ -634,6 +636,16 @@
634636
"quotamailselfsign": "You've reached your limit of 20 emails for this month. Upgrade now to continue sending emails directly.",
635637
"quotamail": "You've reached your limit of 20 signature request emails for this month. Upgrade now to continue sending emails directly.",
636638
"quotamailTip":"Tip: You can still sign unlimited documents by manually sharing the signing request links below.",
637-
"quotamailhead":"Quota Reached"
639+
"quotamailhead":"Quota Reached",
640+
"public-template-mssg-1":"To integrate OpenSign into your React or Next.js project, simply run the following command:",
641+
"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.",
642+
"public-template-mssg-3" :"Need more details or examples?",
643+
"public-template-mssg-4": "Visit the",
644+
"public-template-mssg-5": " npm for the latest updates, detailed documentation, and version history.",
645+
"public-template-mssg-6" :"You need to set this template as public before you can utilize this code snippet.",
646+
"copy-code":"COPY",
647+
"copied-code":"COPIED",
648+
"Installation":"Installation",
649+
"Usage" :"Usage"
638650

639651
}

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

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,8 @@
150150
"Share": "Partager",
151151
"View": "Voir",
152152
"option": "Option",
153-
"Embed": "Intégrer"
153+
"Embed": "Intégrer",
154+
"CopyTemplateId": "Copier l'ID du modèle"
154155
},
155156
"report-help": {
156157
"Draft Documents": "Il s'agit de documents que vous avez commencés mais que vous n'avez pas finalisés pour envoi.",
@@ -262,7 +263,8 @@
262263
"make-template-private-alert": "Êtes-vous sûr de vouloir rendre ce modèle privé ? Cela le supprimera de votre profil public.",
263264
"public-role": "Rôle public",
264265
"public-url": "URL publique",
265-
"public-url-copy-mssg": "Voici votre URL publique : copiez-la ou partagez-le avec le signataire et vous pouvoir voir tous vos paramètres publics modèles.",
266+
"public-url-copy": "Voici votre URL publique : ",
267+
"public-url-copy-mssg": "copiez-la ou partagez-le avec le signataire et vous pouvoir voir tous vos paramètres publics modèles.",
266268
"add-public-url-alert": "Veuillez ajouter votre URL publique et vous pourra rendre public modèle.",
267269
"share-with-alert": "Vous ne pouvez pas partager un modèle si des contacts sont déjà attribués à des rôles. Veuillez supprimer toutes les attributions de contacts des rôles avant de partager le modèle.",
268270
"share-with": "Partager avec",
@@ -634,6 +636,16 @@
634636
"quotamailselfsign": "Vous avez atteint votre limite de 20 e-mails pour ce mois. Mettez à niveau maintenant pour continuer à envoyer des e-mails directement.",
635637
"quotamail": "Vous avez atteint votre limite de 20 e-mails de demande de signature pour ce mois. Mettez à niveau maintenant pour continuer à envoyer des e-mails directement.",
636638
"quotamailTip":"Astuce : Vous pouvez toujours signer un nombre illimité de documents en partageant manuellement les liens de demande de signature ci-dessous.",
637-
"quotamailhead":"Quota atteint"
638-
639+
"quotamailhead":"Quota atteint",
640+
"public-template-mssg-1" :"Pour intégrer OpenSign dans votre projet React ou Next.js, exécutez simplement la commande suivante :",
641+
"public-template-mssg-2" :"Assurez-vous que npm ou Yarn est configuré dans votre projet. Si vous utilisez Yarn, vous pouvez remplacer npm install par Yarn Add opensign-react.",
642+
"public-template-mssg-3" :"Besoin de plus de détails ou d'exemples ?",
643+
"public-template-mssg-4": "Visitez le",
644+
"public-template-mssg-5": "npm pour les dernières mises à jour, une documentation détaillée et l'historique des versions.",
645+
"public-template-mssg-6":"Vous devez définir ce modèle comme public avant de pouvoir utiliser cet extrait de code.",
646+
"copy-code":"COPIE",
647+
"copied-code":"COPIÉ",
648+
"Installation":"Installation",
649+
"Usage" :"Usage"
650+
639651
}

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

Lines changed: 37 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@ import React, { useState } from "react";
22
import { Prism as SyntaxHighlighter } from "react-syntax-highlighter";
33
import { tomorrow } from "react-syntax-highlighter/dist/esm/styles/prism";
44
import { copytoData } from "../../constant/Utils";
5+
import { useTranslation } from "react-i18next";
56

67
function EmbedTab(props) {
8+
const { t } = useTranslation();
79
const tabName = [
8-
{ title: "React/Next", icon: "fa-brands fa-react", color: "#61dafb" },
10+
{ title: "React/Next.js", icon: "fa-brands fa-react", color: "#61dafb" },
911
{ title: "Angular", icon: "fa-brands fa-angular", color: "#ff5733" }
1012
];
1113
const [activeTab, setActiveTab] = useState(0);
@@ -14,7 +16,7 @@ function EmbedTab(props) {
1416
const codeData = [
1517
{
1618
id: 0,
17-
title: "Installation command",
19+
title: "Installation",
1820
codeString: `
1921
npm install opensign-react`
2022
},
@@ -76,15 +78,22 @@ export function App() {
7678
{codeData.map((data, ind) => {
7779
return (
7880
<div key={ind}>
79-
<p className="font-medium text-[15px]">{data.title}</p>
81+
<p className="font-medium text-[18px]">
82+
{t(`${data.title}`)}
83+
</p>
84+
{ind === 0 && (
85+
<p className="text-[13px] mt-2">
86+
{t("public-template-mssg-1")}
87+
</p>
88+
)}
8089
<div className="relative p-1">
8190
<div
8291
onClick={() => handleCopy(data.codeString, ind)}
8392
className="absolute top-[20px] right-[20px] cursor-pointer"
8493
>
85-
<i className="fa-light fa-link text-white"></i>{" "}
94+
<i className="fa-light fa-copy text-white mr-[2px]" />
8695
<span className=" text-white">
87-
{isCopied[ind] ? "COPIED" : "COPY"}
96+
{isCopied[ind] ? t("copied-code") : t("copy-code")}
8897
</span>
8998
</div>
9099
<SyntaxHighlighter
@@ -97,9 +106,32 @@ export function App() {
97106
{data.codeString}
98107
</SyntaxHighlighter>
99108
</div>
109+
{ind === 0 && (
110+
<p className="text-[13px] mb-3">
111+
{t("public-template-mssg-2")}
112+
</p>
113+
)}
100114
</div>
101115
);
102116
})}
117+
118+
<p className="font-medium text-[15px]">
119+
{t("public-template-mssg-3")}
120+
</p>
121+
<p className="my-[6px]">
122+
{" "}
123+
{t("public-template-mssg-4")}
124+
<a
125+
href="https://www.npmjs.com/package/opensign-react"
126+
target="_blank"
127+
rel="noreferrer"
128+
className="cursor-pointer text-blue-700 "
129+
>
130+
{" "}
131+
OpenSign React package{" "}
132+
</a>
133+
{t("public-template-mssg-5")}
134+
</p>
103135
</div>
104136
) : (
105137
activeTab === 1 && (

apps/OpenSign/src/json/ReportJson.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -361,6 +361,13 @@ export default function reportJson(id) {
361361
btnIcon: "fa-light fa-code",
362362
action: "Embed"
363363
},
364+
{
365+
btnId: "2434",
366+
btnLabel: "CopyTemplateId",
367+
hoverLabel: "CopyTemplateId",
368+
btnIcon: "fa-light fa-copy",
369+
action: "CopyTemplateId"
370+
},
364371
{
365372
btnId: "1834",
366373
btnLabel: "Delete",

apps/OpenSign/src/json/dashboardJson.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ const dashboardJson = [
3636
queryType: "",
3737
class: "contracts_Document",
3838
query:
39-
'where={"Type":{"#*ne":"Folder"},"Signers":{"#*exists":true,"#*ne":[]},"Placeholders":{"#*ne":null},"IsCompleted":{"#*ne":true},"IsDeclined":{"#*ne":true},"IsArchive":{"#*ne":true},"CreatedBy":{"__type":"Pointer","className":"_User","objectId":"#UserId.objectId#"},"ExpiryDate":{"#*gt":{"__type":"#Date#","iso":"#today#"}}}&count=1',
39+
'where={"Type":{"#*ne":"Folder"},"Signers":{"#*exists":true,"#*ne":[]},"Placeholders":{"#*ne":null},"IsCompleted":{"#*ne":true},"SignedUrl":{"#*ne":null},"IsDeclined":{"#*ne":true},"IsArchive":{"#*ne":true},"CreatedBy":{"__type":"Pointer","className":"_User","objectId":"#UserId.objectId#"},"ExpiryDate":{"#*gt":{"__type":"#Date#","iso":"#today#"}}}&count=1',
4040
key: "count",
4141
Redirect_type: "Report",
4242
Redirect_id: "1MwEuxLEkF",

apps/OpenSign/src/pages/PlaceHolderSign.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1047,7 +1047,7 @@ function PlaceHolderSign() {
10471047
type="button"
10481048
className="flex flex-row items-center op-link op-link-primary"
10491049
>
1050-
<i className="fa-light fa-link" aria-hidden="true"></i>
1050+
<i className="fa-light fa-copy" />
10511051
<span className=" hidden md:block ml-1 ">{t("copy-link")}</span>
10521052
</button>
10531053
<RWebShare data={{ url: data.url, title: t("sign-url") }}>

apps/OpenSign/src/pages/UserProfile.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -595,7 +595,7 @@ function UserProfile() {
595595
className="op-btn op-btn-primary op-btn-outline op-btn-xs md:op-btn-sm"
596596
onClick={() => copytoclipboard()}
597597
>
598-
<i className="fa-light fa-link"></i>{" "}
598+
<i className="fa-light fa-copy" />
599599
</button>
600600
</div>
601601
</div>

apps/OpenSign/src/primitives/Alert.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ const Alert = ({ children, type, className }) => {
2525
: "z-[1000] fixed top-20 left-1/2 transform -translate-x-1/2 text-sm"
2626
} `}
2727
>
28-
<div className={`op-alert ${textcolor}`}>
29-
<span className="ml-3">{children}</span>
28+
<div className={`op-alert ${textcolor} flex justify-center`}>
29+
<span className="px-1">{children}</span>
3030
</div>
3131
</div>
3232
)

0 commit comments

Comments
 (0)