Skip to content

Commit 9ca7aee

Browse files
Merge branch 'staging' of https://github.com/OpenSignLabs/OpenSign into validation
2 parents 937b306 + 69a2ab0 commit 9ca7aee

19 files changed

+930
-462
lines changed

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

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,8 @@
369369
"copy-type": {
370370
"All pages": "All pages",
371371
"All pages but last": "All pages but last",
372-
"All pages but first": "All pages but first"
372+
"All pages but first": "All pages but first",
373+
"Beside to widget":"Beside to widget"
373374
},
374375
"options": "Options",
375376
"minimun-check": "Minimun check",
@@ -612,5 +613,8 @@
612613
"additional-quicksend": "Please purchase add-on quick send",
613614
"quantityofquicksend": "Quantity of Quick send",
614615
"quotaerrquicksend": "Quota Reached, You don't have enough credits.",
615-
"buycredits": "Buy credits"
616-
}
616+
"buycredits": "Buy credits",
617+
"rotate-right":"Rotate right",
618+
"rotate-left":"Rotate left",
619+
"rotate-alert-mssg":"All widgets on this page will be lost. Are you sure you want to proceed?"
620+
}

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

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,8 @@
369369
"copy-type": {
370370
"All pages": "Toutes les pages",
371371
"All pages but last": "Toutes les pages sauf la dernière",
372-
"All pages but first": "Toutes les pages sauf la première"
372+
"All pages but first": "Toutes les pages sauf la première",
373+
"Beside to widget": "À côté du widget"
373374
},
374375
"options": "Possibilités",
375376
"minimun-check": "Vérification minimale",
@@ -612,6 +613,8 @@
612613
"additional-quicksend":"Veuillez acheter le module complémentaire quick send",
613614
"quantityofquicksend": "Quantité de Quick send",
614615
"quotaerrquicksend": "Quota atteint, vous n'avez pas assez de crédits.",
615-
"buycredits": "Acheter des crédits"
616-
617-
}
616+
"buycredits": "Acheter des crédits",
617+
"rotate-right" :"Faire pivoter à droite",
618+
"rotate-left" :"Faire pivoter à gauche",
619+
"rotate-alert-mssg" :"Tous les widgets de cette page seront perdus. Êtes-vous sûr de vouloir continuer ?"
620+
}

apps/OpenSign/src/components/Header.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -227,11 +227,7 @@ const Header = ({ showSidebar }) => {
227227
<i className="fa-light fa-lock"></i> {t("change-password")}
228228
</span>
229229
</li>
230-
<li
231-
onClick={() => {
232-
handleConsoleRedirect();
233-
}}
234-
>
230+
<li onClick={() => handleConsoleRedirect()}>
235231
<span>
236232
<i className="fa-light fa-id-card"></i> Console
237233
</span>
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
import React from "react";
2+
import ModalUi from "../primitives/ModalUi";
3+
import { useTranslation } from "react-i18next";
4+
5+
function RotateAlert(props) {
6+
const { t } = useTranslation();
7+
return (
8+
<ModalUi
9+
isOpen={props.isRotate}
10+
title={t("Rotation-alert")}
11+
handleClose={() => props.setIsRotate({ status: false, degree: 0 })}
12+
>
13+
{" "}
14+
<div className="p-[20px] h-full">
15+
<p>{t("rotate-alert-mssg")}</p>
16+
<div className="h-[1px] w-full my-[15px] bg-[#9f9f9f]"></div>
17+
<div className="flex gap-1">
18+
<button
19+
onClick={() => props.setIsRotate({ status: false, degree: 0 })}
20+
type="button"
21+
className="op-btn op-btn-ghost shadow-md"
22+
>
23+
{t("no")}
24+
</button>
25+
<button
26+
onClick={() => props.handleRemoveWidgets()}
27+
type="button"
28+
className="op-btn op-btn-primary"
29+
>
30+
{t("yes")}
31+
</button>
32+
</div>
33+
</div>
34+
</ModalUi>
35+
);
36+
}
37+
38+
export default RotateAlert;

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

Lines changed: 48 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,11 @@ function Header({
3434
setIsEmail,
3535
completeBtnTitle,
3636
setIsEditTemplate,
37-
isPublicTemplate
37+
isPublicTemplate,
38+
clickOnZoomIn,
39+
clickOnZoomOut,
40+
handleRotationFun,
41+
isDisableRotate
3842
}) {
3943
const { t } = useTranslation();
4044
const filterPrefill =
@@ -73,7 +77,7 @@ function Header({
7377
allPages={allPages}
7478
changePage={changePage}
7579
/>
76-
{pdfUrl && alreadySign ? (
80+
{isCompleted && alreadySign ? (
7781
<DropdownMenu.Root>
7882
<DropdownMenu.Trigger asChild>
7983
<div className="op-link op-link-primary no-underline text-[16px] font-semibold pr-[3px] pl-[5px]">
@@ -184,13 +188,7 @@ function Header({
184188
) : (
185189
<div
186190
data-tut="reactourThird"
187-
onClick={() => {
188-
if (!pdfUrl) {
189-
embedWidgetsData();
190-
} else if (isPdfRequestFiles) {
191-
embedWidgetsData();
192-
}
193-
}}
191+
onClick={() => embedWidgetsData()}
194192
className="border-none font-[650] text-[14px] op-link op-link-primary no-underline"
195193
>
196194
{t("finish")}
@@ -207,15 +205,15 @@ function Header({
207205
</DropdownMenu.Trigger>
208206
<DropdownMenu.Portal>
209207
<DropdownMenu.Content
210-
className="bg-white shadow-md rounded-full px-3 py-2"
208+
className="bg-white shadow-md rounded-md px-3 py-2"
211209
sideOffset={5}
212210
>
213211
<DropdownMenu.Item
214212
className="flex flex-row justify-center items-center text-[13px] focus:outline-none cursor-pointer"
215213
onClick={() =>
216214
handleDownloadPdf(
217215
pdfDetails,
218-
pdfUrl,
216+
pdfDetails[0]?.URL,
219217
setIsDownloading
220218
)
221219
}
@@ -226,6 +224,43 @@ function Header({
226224
></i>
227225
<span className="font-[500]">{t("download")}</span>
228226
</DropdownMenu.Item>
227+
{!isDisableRotate && (
228+
<>
229+
<DropdownMenu.Item
230+
className="flex flex-row justify-center items-center text-[13px] focus:outline-none cursor-pointer"
231+
onClick={() => handleRotationFun(90)}
232+
>
233+
<i className="fa-light fa-rotate-right text-gray-500 2xl:text-[30px] mr-[3px]"></i>
234+
<span className="font-[500]">
235+
{t("rotate-right")}
236+
</span>
237+
</DropdownMenu.Item>
238+
<DropdownMenu.Item
239+
className="flex flex-row justify-center items-center text-[13px] focus:outline-none cursor-pointer"
240+
onClick={() => handleRotationFun(-90)}
241+
>
242+
<i className="fa-light fa-rotate-left text-gray-500 2xl:text-[30px] mr-[3px]"></i>
243+
<span className="font-[500]">
244+
{t("rotate-left")}
245+
</span>
246+
</DropdownMenu.Item>
247+
</>
248+
)}
249+
250+
<DropdownMenu.Item
251+
className="flex flex-row justify-center items-center text-[13px] focus:outline-none cursor-pointer"
252+
onClick={() => clickOnZoomIn()}
253+
>
254+
<i className="fa-light fa-magnifying-glass-plus text-gray-500 2xl:text-[30px]"></i>
255+
<span className="font-[500]">{t("zoom-in")}</span>
256+
</DropdownMenu.Item>
257+
<DropdownMenu.Item
258+
className="flex flex-row justify-center items-center text-[13px] focus:outline-none cursor-pointer"
259+
onClick={() => clickOnZoomOut()}
260+
>
261+
<i className="fa-light fa-magnifying-glass-minus text-gray-500 2xl:text-[30px]"></i>
262+
<span className="font-[500]">{t("zoom-out")}</span>
263+
</DropdownMenu.Item>
229264
</DropdownMenu.Content>
230265
</DropdownMenu.Portal>
231266
</DropdownMenu.Root>
@@ -423,9 +458,7 @@ function Header({
423458
<button
424459
type="button"
425460
className="op-btn op-btn-primary op-btn-sm shadow"
426-
onClick={() => {
427-
embedWidgetsData();
428-
}}
461+
onClick={() => embedWidgetsData()}
429462
>
430463
{t("sign-now")}
431464
</button>
@@ -442,11 +475,7 @@ function Header({
442475
<button
443476
type="button"
444477
className="op-btn op-btn-primary op-btn-sm mr-[3px]"
445-
onClick={() => {
446-
if (!pdfUrl) {
447-
embedWidgetsData();
448-
}
449-
}}
478+
onClick={() => embedWidgetsData()}
450479
>
451480
{t("finish")}
452481
</button>

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

Lines changed: 22 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -3,44 +3,37 @@ import { useTranslation } from "react-i18next";
33

44
function PdfZoom(props) {
55
const { t } = useTranslation();
6-
const onClickZoomIn = () => {
7-
props.setScale(props.scale + 0.1 * props.scale);
8-
props.setZoomPercent(props.zoomPercent + 10);
9-
};
10-
const onClickZoomOut = () => {
11-
if (props.zoomPercent > 0) {
12-
if (props.zoomPercent === 10) {
13-
props.setScale(1);
14-
} else {
15-
props.setScale(props.scale - 0.1 * props.scale);
16-
}
17-
props.setZoomPercent(props.zoomPercent - 10);
18-
}
19-
};
20-
const handleReset = () => {
21-
props.setScale(1);
22-
props.setZoomPercent(0);
23-
};
6+
247
return (
25-
// md:mt-[41px] xl:mt-[63px]mt=[]
26-
<span className="hidden md:flex flex-col gap-1 text-center md:w-[5%] mt-[50px] 2xl:mt-[63px]">
8+
<span className="hidden md:flex flex-col gap-1 text-center md:w-[5%] mt-[43px] 2xl:mt-[63px]">
279
<span
2810
className="bg-gray-50 px-[4px] 2xl:px-[15px] 2xl:py-[10px] cursor-pointer"
29-
onClick={onClickZoomIn}
11+
onClick={() => props.clickOnZoomIn()}
3012
title={t("zoom-in")}
3113
>
3214
<i className="fa-light fa-magnifying-glass-plus text-gray-500 2xl:text-[30px]"></i>
3315
</span>
34-
<span
35-
className="bg-gray-50 px-[4px] 2xl:px-[15px] 2xl:py-[10px] cursor-pointer"
36-
onClick={handleReset}
37-
title={t("reset")}
38-
>
39-
<i className="fa-light fa-magnifying-glass-arrows-rotate text-gray-500 2xl:text-[30px]"></i>
40-
</span>
16+
{!props?.isDisableRotate && (
17+
<>
18+
<span
19+
className="bg-gray-50 px-[4px] 2xl:px-[15px] 2xl:py-[10px] cursor-pointer"
20+
onClick={() => props.handleRotationFun(90)}
21+
title={t("rotate-right")}
22+
>
23+
<i className="fa-light fa-rotate-right text-gray-500 2xl:text-[30px]"></i>
24+
</span>
25+
<span
26+
className="bg-gray-50 px-[4px] 2xl:px-[15px] 2xl:py-[10px] cursor-pointer"
27+
title={t("rotate-left")}
28+
onClick={() => props.handleRotationFun(-90)}
29+
>
30+
<i className="fa-light fa-rotate-left text-gray-500 2xl:text-[30px]"></i>
31+
</span>
32+
</>
33+
)}
4134
<span
4235
className="bg-gray-50 px-[4px] 2xl:px-[15px] 2xl:py-[10px]"
43-
onClick={onClickZoomOut}
36+
onClick={() => props.clickOnZoomOut()}
4437
style={{
4538
cursor: props.zoomPercent > 0 ? "pointer" : "default"
4639
}}

0 commit comments

Comments
 (0)