Skip to content

πŸ”₯ The free & Open Source DocuSign alternative

Merge branch 'staging' of https://github.com/OpenSignLabs/OpenSign into validation

prafull-opensignlabsc721580516b1
diff --cc apps/OpenSign/package-lock.json
index 4fa890657,2ad74c732..5d6c6df62
--- a/apps/OpenSign/package-lock.json
+++ b/apps/OpenSign/package-lock.json
@@@ -34,6 -37,7 +37,7 @@@
"react-dom": "^18.2.0",
"react-gtm-module": "^2.0.11",
"react-helmet": "^6.1.0",
- "react-i18next": "^15.0.0",
++ "react-i18next": "^15.0.1",
"react-konva": "^18.2.10",
"react-pdf": "^9.1.0",
"react-quill": "^2.0.0",
@@@ -20500,6 -20558,27 +20558,27 @@@
"react": ">=16.3.0"
}
},
+ "node_modules/react-i18next": {
- "version": "15.0.0",
- "resolved": "https://registry.npmjs.org/react-i18next/-/react-i18next-15.0.0.tgz",
- "integrity": "sha512-2O3IgF4zivg57Q6p6i+ChDgJ371IDcEWbuWC6gvoh5NbkDMs0Q+O7RPr4v61+Se32E0V+LmtwePAeqWZW0bi6g==",
++ "version": "15.0.1",
++ "resolved": "https://registry.npmjs.org/react-i18next/-/react-i18next-15.0.1.tgz",
++ "integrity": "sha512-NwxLqNM6CLbeGA9xPsjits0EnXdKgCRSS6cgkgOdNcPXqL+1fYNl8fBg1wmnnHvFy812Bt4IWTPE9zjoPmFj3w==",
+ "dependencies": {
+ "@babel/runtime": "^7.24.8",
+ "html-parse-stringify": "^3.0.1"
+ },
+ "peerDependencies": {
+ "i18next": ">= 23.2.3",
+ "react": ">= 16.8.0"
+ },
+ "peerDependenciesMeta": {
+ "react-dom": {
+ "optional": true
+ },
+ "react-native": {
+ "optional": true
+ }
+ }
+ },
"node_modules/react-is": {
"version": "18.3.1",
"resolved": "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz",
diff --cc apps/OpenSign/package.json
index 6f8a1c763,69cd32247..25179f799
--- a/apps/OpenSign/package.json
+++ b/apps/OpenSign/package.json
@@@ -29,6 -32,7 +32,7 @@@
"react-dom": "^18.2.0",
"react-gtm-module": "^2.0.11",
"react-helmet": "^6.1.0",
- "react-i18next": "^15.0.0",
++ "react-i18next": "^15.0.1",
"react-konva": "^18.2.10",
"react-pdf": "^9.1.0",
"react-quill": "^2.0.0",
diff --cc apps/OpenSign/src/components/AddUser.js
index c566d3fb8,4eee75af4..8530a4c80
--- a/apps/OpenSign/src/components/AddUser.js
+++ b/apps/OpenSign/src/components/AddUser.js
@@@ -2,9 -2,9 +2,10 @@@ import React, { useEffect, useState } f
import Parse from "parse";
import Title from "./Title";
import Loader from "../primitives/Loader";
-import { copytoData } from "../constant/Utils";
+import { copytoData, fetchSubscriptionInfo } from "../constant/Utils";
import { isEnableSubscription } from "../constant/const";
+import ModalUi from "../primitives/ModalUi";
+ import { useTranslation } from "react-i18next";
function generatePassword(length) {
const characters =
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
@@@ -114,11 -67,11 +116,11 @@@ const AddUser = (props) =>
e.preventDefault();
e.stopPropagation();
const localUser = JSON.parse(localStorage.getItem("Extand_Class"))?.[0];
- setIsLoader(true);
+ setIsFormLoader(true);
const res = await checkUserExist();
if (res) {
- props.setIsAlert({ type: "danger", msg: "User already exist." });
+ props.setIsAlert({ type: "danger", msg: t("user-already-exist") });
- setIsLoader(false);
+ setIsFormLoader(false);
setTimeout(() => {
props.setIsAlert({ type: "success", msg: "" });
}, 1000);
@@@ -251,8 -216,11 +253,11 @@@
}
} catch (err) {
console.log("err", err);
- setIsLoader(false);
+ setIsFormLoader(false);
- props.setIsAlert({ type: "danger", msg: "something went wrong." });
+ props.setIsAlert({
+ type: "danger",
+ msg: t("something-went-wrong-mssg")
+ });
} finally {
setTimeout(() => props.setIsAlert({ type: "success", msg: "" }), 1500);
}
@@@ -272,269 -246,167 +277,284 @@@
const copytoclipboard = (text) => {
copytoData(text);
- props.setIsAlert({ type: "success", msg: "Copied" });
+ props.setIsAlert({ type: "success", msg: t("copied") });
setTimeout(() => props.setIsAlert({ type: "success", msg: "" }), 1500); // Reset copied state after 1.5 seconds
};
+ const handlePricePerUser = (e) => {
+ const quantity = e.target.value;
+ const price = e.target?.value > 0 ? planInfo.priceperUser * quantity : 0;
+ const totalprice = price + planInfo.totalPrice;
+ setAmount((prev) => ({
+ ...prev,
+ quantity: quantity,
+ price: price,
+ totalPrice: totalprice
+ }));
+ };
+ const handleAddOnSubmit = async (e) => {
+ e.preventDefault();
+ e.stopPropagation();
+ setIsFormLoader(true);
+ const extUser =
+ localStorage.getItem("Extand_Class") &&
+ JSON.parse(localStorage.getItem("Extand_Class"))?.[0];
+ try {
+ const resAddon = await Parse.Cloud.run("buyaddon", {
+ users: amount.quantity,
+ tenantId: extUser?.TenantId?.objectId
+ });
+ if (resAddon) {
+ const _resAddon = JSON.parse(JSON.stringify(resAddon));
+ if (_resAddon.status === "success") {
+ setAllowedUser(_resAddon.addon);
+ }
+ }
+ } catch (err) {
+ console.log("Err in buy addon", err);
- props.setIsAlert({ type: "danger", msg: "something went wrong." });
++ props.setIsAlert({
++ type: "danger",
++ msg: t("something-went-wrong-mssg")
++ });
+ } finally {
+ setTimeout(() => props.setIsAlert({ type: "success", msg: "" }), 2000);
+ setIsFormLoader(false);
+ }
+ };
return (
- <div className="shadow-md rounded-box my-[1px] p-3 bg-[#ffffff]">
- <Title title={"Add User"} />
- {isLoader && (
- <div className="fixed inset-0 flex justify-center items-center bg-black bg-opacity-30 z-50 rounded-box">
- <Loader />
- </div>
- )}
- <div className="w-full mx-auto">
- <form onSubmit={handleSubmit}>
- {/* <h1 className="text-[20px] font-semibold mb-4">Add User</h1> */}
- <div className="mb-3">
- <label
- htmlFor="name"
- className="block text-xs text-gray-700 font-semibold"
- >
- {t("name")}
- <span className="text-[red] text-[13px]"> *</span>
- </label>
- <input
- type="text"
- name="name"
- value={formdata.name}
- onChange={(e) => handleChange(e)}
- onInvalid={(e) => e.target.setCustomValidity(t("input-required"))}
- onInput={(e) => e.target.setCustomValidity("")}
- required
- className="op-input op-input-bordered op-input-sm focus:outline-none hover:border-base-content w-full text-xs"
- />
- </div>
- <div className="mb-3">
- <label
- htmlFor="email"
- className="block text-xs text-gray-700 font-semibold"
- >
- {t("email")}
- <span className="text-[red] text-[13px]"> *</span>
- </label>
- <input
- type="email"
- name="email"
- value={formdata.email}
- onChange={(e) => handleChange(e)}
- onInvalid={(e) => e.target.setCustomValidity(t("input-required"))}
- onInput={(e) => e.target.setCustomValidity("")}
- required
- className="op-input op-input-bordered op-input-sm focus:outline-none hover:border-base-content w-full text-xs"
- />
- </div>
- <div className="mb-3">
- <label
- htmlFor="email"
- className="block text-xs text-gray-700 font-semibold"
- >
- {t("password")}
- </label>
- <div className="flex justify-between items-center op-input op-input-bordered op-input-sm text-base-content w-full h-full text-[13px]">
- <div className="break-all">{formdata?.password}</div>
- <i
- onClick={() => copytoclipboard(formdata?.password)}
- className="fa-light fa-copy rounded-full hover:bg-base-300 p-[8px] cursor-pointer "
- ></i>
- </div>
- <div className="text-[12px] ml-2 mb-0 text-[red] select-none">
- {t("password-generateed")}
- </div>
- </div>
- <div className="mb-3">
- <label
- htmlFor="phone"
- className="block text-xs text-gray-700 font-semibold"
- >
- {t("phone")}
- {/* <span className="text-[red] text-[13px]"> *</span> */}
- </label>
- <input
- type="text"
- name="phone"
- placeholder="optional"
- value={formdata.phone}
- onChange={(e) => handleChange(e)}
- // required
- className="op-input op-input-bordered op-input-sm focus:outline-none hover:border-base-content w-full text-xs"
- />
- </div>
- {isEnableSubscription && (
- <div className="mb-3">
- <label
- htmlFor="phone"
- className="block text-xs text-gray-700 font-semibold"
- >
- Team<span className="text-[red] text-[13px]"> *</span>
- </label>
- <select
- value={formdata.team}
- onChange={(e) => handleChange(e)}
- name="team"
- className="op-select op-select-bordered op-select-sm focus:outline-none hover:border-base-content w-full text-xs"
- onInvalid={(e) =>
- e.target.setCustomValidity(t("input-required"))
- }
- onInput={(e) => e.target.setCustomValidity("")}
- required
- >
- <option defaultValue={""} value={""}>
- select
- </option>
- {teamList.length > 0 &&
- teamList.map((x) => (
- <option key={x.objectId} value={x.objectId}>
- {x.Name}
- </option>
- ))}
- </select>
- </div>
- )}
- <div className="mb-3">
- <label
- htmlFor="phone"
- className="block text-xs text-gray-700 font-semibold"
- >
- Role<span className="text-[red] text-[13px]"> *</span>
- </label>
- <select
- value={formdata.role}
- onChange={(e) => handleChange(e)}
- name="role"
- className="op-select op-select-bordered op-select-sm focus:outline-none hover:border-base-content w-full text-xs"
- onInvalid={(e) => e.target.setCustomValidity(t("input-required"))}
- onInput={(e) => e.target.setCustomValidity("")}
- required
- >
- <option defaultValue={""} value={""}>
- select
- </option>
- {role.length > 0 &&
- role.map((x) => (
- <option key={x} value={x}>
- {x}
- </option>
- ))}
- </select>
+ <ModalUi
+ isOpen={props.isOpen}
- title={allowedUser > 0 ? "Add User" : "Add Seats"}
++ title={allowedUser > 0 ? t("add-user") : "Add Seats"}
+ handleClose={props.closePopup}
+ >
+ <div className="shadow-md rounded-box my-[1px] p-3 bg-base-100 relative">
- <Title title="Add User" />
++ <Title title={t("add-user")} />
+ {isFormLoader && (
+ <div className="absolute w-full h-full inset-0 flex justify-center items-center bg-base-content/30 z-50">
+ <Loader />
</div>
- <div className="flex items-center mt-3 gap-2 text-white">
- <button type="submit" className="op-btn op-btn-primary">
- Submit
- </button>
- <div
- type="button"
- onClick={() => handleReset()}
- className="op-btn op-btn-secondary"
- >
- Cancel
- </div>
+ )}
+ {!isLoader ? (
+ <>
+ {err ? (
+ <div className="flex justify-center items-center h-[70px] text-[18px]">
+ {err}
+ </div>
+ ) : (
+ <div className="w-full mx-auto">
+ {!isEnableSubscription || allowedUser > 0 ? (
+ <form onSubmit={handleSubmit}>
+ <p className="flex justify-center mb-1">
+ Remaining users{" "}
+ <span
+ className={`${
+ allowedUser < 2 ? "op-text-accent" : "op-text-primary"
+ } font-medium ml-1`}
+ >
+ {allowedUser} of {planInfo.totalAllowedUser}
+ </span>
+ </p>
+ <div className="mb-3">
+ <label
+ htmlFor="name"
+ className="block text-xs text-gray-700 font-semibold"
+ >
- Name
++ {t("name")}
+ <span className="text-[red] text-[13px]"> *</span>
+ </label>
+ <input
+ type="text"
+ name="name"
+ value={formdata.name}
+ onChange={(e) => handleChange(e)}
++ onInvalid={(e) =>
++ e.target.setCustomValidity(t("input-required"))
++ }
++ onInput={(e) => e.target.setCustomValidity("")}
+ required
+ className="op-input op-input-bordered op-input-sm focus:outline-none hover:border-base-content w-full text-xs"
+ />
+ </div>
+ <div className="mb-3">
+ <label
+ htmlFor="email"
+ className="block text-xs text-gray-700 font-semibold"
+ >
- Email
++ {t("email")}
+ <span className="text-[red] text-[13px]"> *</span>
+ </label>
+ <input
+ type="email"
+ name="email"
+ value={formdata.email}
+ onChange={(e) => handleChange(e)}
+ required
++ onInvalid={(e) =>
++ e.target.setCustomValidity(t("input-required"))
++ }
++ onInput={(e) => e.target.setCustomValidity("")}
+ className="op-input op-input-bordered op-input-sm focus:outline-none hover:border-base-content w-full text-xs"
+ />
+ </div>
+ <div className="mb-3">
- <label
- htmlFor="email"
- className="block text-xs text-gray-700 font-semibold"
- >
- Password
++ <label className="block text-xs text-gray-700 font-semibold">
++ {t("password")}
+ </label>
+ <div className="flex justify-between items-center op-input op-input-bordered op-input-sm text-base-content w-full h-full text-[13px]">
+ <div className="break-all">{formdata?.password}</div>
+ <i
+ onClick={() => copytoclipboard(formdata?.password)}
+ className="fa-light fa-copy rounded-full hover:bg-base-300 p-[8px] cursor-pointer "
+ ></i>
+ </div>
+ <div className="text-[12px] ml-2 mb-0 text-[red] select-none">
- Password will only be generated once; make sure to copy
- it.
++ {t("password-generateed")}
+ </div>
+ </div>
+ <div className="mb-3">
+ <label
+ htmlFor="phone"
+ className="block text-xs text-gray-700 font-semibold"
+ >
- Phone
++ {t("phone")}
+ {/* <span className="text-[red] text-[13px]"> *</span> */}
+ </label>
+ <input
+ type="text"
+ name="phone"
+ placeholder="optional"
+ value={formdata.phone}
+ onChange={(e) => handleChange(e)}
+ // required
+ className="op-input op-input-bordered op-input-sm focus:outline-none hover:border-base-content w-full text-xs"
+ />
+ </div>
+ {isEnableSubscription && (
+ <div className="mb-3">
+ <label
+ htmlFor="phone"
+ className="block text-xs text-gray-700 font-semibold"
+ >
+ Team<span className="text-[red] text-[13px]"> *</span>
+ </label>
+ <select
++ name="team"
+ value={formdata.team}
+ onChange={(e) => handleChange(e)}
- name="team"
+ className="op-select op-select-bordered op-select-sm focus:outline-none hover:border-base-content w-full text-xs"
++ onInvalid={(e) =>
++ e.target.setCustomValidity(t("input-required"))
++ }
++ onInput={(e) => e.target.setCustomValidity("")}
+ required
+ >
+ <option defaultValue={""} value={""}>
+ select
+ </option>
+ {teamList.length > 0 &&
+ teamList.map((x) => (
+ <option key={x.objectId} value={x.objectId}>
+ {x.Name}
+ </option>
+ ))}
+ </select>
+ </div>
+ )}
+ <div className="mb-3">
+ <label
+ htmlFor="phone"
+ className="block text-xs text-gray-700 font-semibold"
+ >
+ Role<span className="text-[red] text-[13px]"> *</span>
+ </label>
+ <select
+ value={formdata.role}
+ onChange={(e) => handleChange(e)}
+ name="role"
+ className="op-select op-select-bordered op-select-sm focus:outline-none hover:border-base-content w-full text-xs"
++ onInvalid={(e) =>
++ e.target.setCustomValidity(t("input-required"))
++ }
++ onInput={(e) => e.target.setCustomValidity("")}
+ required
+ >
+ <option defaultValue={""} value={""}>
+ select
+ </option>
+ {role.length > 0 &&
+ role.map((x) => (
+ <option key={x} value={x}>
+ {x}
+ </option>
+ ))}
+ </select>
+ </div>
+ <div className="flex items-center mt-3 gap-2 text-white">
+ <button type="submit" className="op-btn op-btn-primary">
+ Submit
+ </button>
+ <div
+ type="button"
+ onClick={() => handleReset()}
+ className="op-btn op-btn-secondary"
+ >
+ Cancel
+ </div>
+ </div>
+ </form>
+ ) : (
+ <form onSubmit={handleAddOnSubmit}>
+ <p className="flex justify-center text-center mx-2 mb-3 text-base op-text-accent font-medium">
+ Please purchase add-on users.
+ </p>
+ <div className="mb-3 flex justify-between">
+ <label
+ htmlFor="quantity"
+ className="block text-xs text-gray-700 font-semibold"
+ >
+ Quantity of user
+ <span className="text-[red] text-[13px]"> *</span>
+ </label>
+ <input
+ type="number"
+ name="quantity"
+ value={amount.quantity}
+ onChange={(e) => handlePricePerUser(e)}
+ className="w-1/4 op-input op-input-bordered op-input-sm focus:outline-none hover:border-base-content text-xs"
+ required
+ />
+ </div>
+ <div className="mb-3 flex justify-between">
+ <label className="block text-xs text-gray-700 font-semibold">
+ Price (1 * {planInfo.priceperUser})
+ </label>
+ <div className="w-1/4 flex justify-center items-center text-sm">
+ USD {amount.price}
+ </div>
+ </div>
+ <hr className="text-base-content mb-3" />
+ <div className=" flex justify-between">
+ <label className="block text-sm text-gray-700 font-semibold">
+ Total price for next time
+ </label>
+ <div className="w-1/4 flex justify-center items-center text-sm font-semibold">
+ USD {amount.totalPrice}
+ </div>
+ </div>
+ <button className="op-btn op-btn-primary w-full mt-2">
+ Proceed
+ </button>
+ </form>
+ )}
+ </div>
+ )}
+ </>
+ ) : (
+ <div className="w-full h-[200px] inset-0 flex justify-center items-center z-50">
+ <Loader />
</div>
- </form>
+ )}
</div>
- </div>
+ </ModalUi>
);
};
diff --cc apps/OpenSign/src/components/Header.js
index 3f518c8ea,f6e5bebac..86e4ccdca
--- a/apps/OpenSign/src/components/Header.js
+++ b/apps/OpenSign/src/components/Header.js
@@@ -4,11 -4,18 +4,18 @@@ import FullScreenButton from "./FullScr
import { useNavigate } from "react-router-dom";
import Parse from "parse";
import { useWindowSize } from "../hook/useWindowSize";
- import { checkIsSubscribed, getAppLogo, openInNewTab } from "../constant/Utils";
+ import {
+ checkIsSubscribed,
- checkIsSubscribedTeam,
+ getAppLogo,
+ openInNewTab,
+ saveLanguageInLocal
+ } from "../constant/Utils";
import { isEnableSubscription, isStaging } from "../constant/const";
+import { paidUrl, validplan } from "../json/plansArr";
+ import { useTranslation } from "react-i18next";
const Header = ({ showSidebar }) => {
+ const { t, i18n } = useTranslation();
const navigate = useNavigate();
const { width } = useWindowSize();
let username = localStorage.getItem("username");
@@@ -125,20 -127,20 +132,20 @@@
<div>
<button
className="text-xs md:text-sm shadow op-btn op-btn-outline op-btn-sm md:op-btn-md op-btn-accent"
- onClick={() => navigate("/subscription")}
+ onClick={() => handleNavigation()}
>
- Upgrade Now
+ {t("upgrade-now")}
</button>
</div>
)}
- {!isTeam && isPro && (
+ {isTeam.isValid && !validplan[isTeam.plan] && (
<div className="w-[35px] h-[35px] bg-white rounded-full ring-[1px] ring-offset-2 ring-[#002862] text-[#002862] overflow-hidden font-semibold flex items-center justify-center">
- PRO
+ {t("pro")}
</div>
)}
- {isTeam && (
+ {validplan[isTeam.plan] && (
<div className="w-[35px] h-[35px] bg-white rounded-full ring-[1px] text-[13px] ring-offset-2 ring-[#002862] text-[#002862] overflow-hidden font-semibold flex items-center justify-center">
- TEAM
+ {t("team")}
</div>
)}
<div>
diff --cc apps/OpenSign/src/layout/HomeLayout.js
index 20ff7f680,a9cb67e5e..a055f628c
--- a/apps/OpenSign/src/layout/HomeLayout.js
+++ b/apps/OpenSign/src/layout/HomeLayout.js
@@@ -11,12 -11,13 +11,14 @@@ import ModalUi from "../primitives/Moda
import { useNavigate, useLocation, Outlet } from "react-router-dom";
import { isEnableSubscription } from "../constant/const";
import { useCookies } from "react-cookie";
-import { fetchSubscription } from "../constant/Utils";
+import { fetchSubscription, openInNewTab } from "../constant/Utils";
import Loader from "../primitives/Loader";
import { showHeader } from "../redux/reducers/showHeader";
+import { paidUrl } from "../json/plansArr";
+ import { useTranslation } from "react-i18next";
const HomeLayout = () => {
+ const { t, i18n } = useTranslation();
const navigate = useNavigate();
const location = useLocation();
const dispatch = useDispatch();
diff --cc apps/OpenSign/src/pages/GenerateToken.js
index 017404731,99e7ede48..1d2b73312
--- a/apps/OpenSign/src/pages/GenerateToken.js
+++ b/apps/OpenSign/src/pages/GenerateToken.js
@@@ -9,15 -9,10 +9,11 @@@ import Tooltip from "../primitives/Tool
import Loader from "../primitives/Loader";
import SubscribeCard from "../primitives/SubscribeCard";
import Tour from "reactour";
+import { validplan } from "../json/plansArr";
- const tourSteps = [
- {
- selector: '[data-tut="apisubscribe"]',
- content: "Upgrade now to generate API token"
- }
- ];
+ import { useTranslation } from "react-i18next";
function GenerateToken() {
+ const { t } = useTranslation();
const [parseBaseUrl] = useState(localStorage.getItem("baseUrl"));
const [parseAppId] = useState(localStorage.getItem("parseAppId"));
const [apiToken, SetApiToken] = useState("");
diff --cc apps/OpenSign/src/pages/Login.js
index f1b6ce976,43f085a19..cfb8382a6
--- a/apps/OpenSign/src/pages/Login.js
+++ b/apps/OpenSign/src/pages/Login.js
@@@ -14,10 -14,18 +14,19 @@@ import Alert from "../primitives/Alert"
import { appInfo } from "../constant/appinfo";
import { fetchAppInfo } from "../redux/reducers/infoReducer";
import { showTenant } from "../redux/reducers/ShowTenant";
- import { fetchSubscription, getAppLogo, openInNewTab } from "../constant/Utils";
+ import {
+ fetchSubscription,
+ getAppLogo,
+ openInNewTab,
+ saveLanguageInLocal
+ } from "../constant/Utils";
import Loader from "../primitives/Loader";
+import { paidUrl } from "../json/plansArr";
+ import { useTranslation } from "react-i18next";
+ import SelectLanguage from "../components/pdf/SelectLanguage";
+
function Login() {
+ const { t, i18n } = useTranslation();
const navigate = useNavigate();
const location = useLocation();
const dispatch = useDispatch();
@@@ -764,11 -784,18 +792,16 @@@
)}
</div>
</div>
+ <SelectLanguage />
{state.alertMsg && (
- <Alert type={state.alertType}>
- <div className="ml-3">{state.alertMsg}</div>
- </Alert>
+ <Alert type={state.alertType}>{state.alertMsg}</Alert>
)}
</div>
- <ModalUi isOpen={isModal} title="Additional Info" showClose={false}>
+ <ModalUi
+ isOpen={isModal}
+ title={t("additional-info")}
+ showClose={false}
+ >
<form className="px-4 py-3 text-base-content">
<div className="mb-3">
<label
diff --cc apps/OpenSign/src/pages/PdfRequestFiles.js
index e421ccb78,1e77ff05a..89c5b79ee
--- a/apps/OpenSign/src/pages/PdfRequestFiles.js
+++ b/apps/OpenSign/src/pages/PdfRequestFiles.js
@@@ -47,9 -46,10 +47,11 @@@ import { useSelector } from "react-redu
import SignerListComponent from "../components/pdf/SignerListComponent";
import VerifyEmail from "../components/pdf/VerifyEmail";
import PdfZoom from "../components/pdf/PdfZoom";
+import { paidUrl } from "../json/plansArr";
+ import { useTranslation } from "react-i18next";
function PdfRequestFiles(props) {
+ const { t } = useTranslation();
const [pdfDetails, setPdfDetails] = useState([]);
const [signedSigners, setSignedSigners] = useState([]);
const [unsignedSigners, setUnSignedSigners] = useState([]);
diff --cc apps/OpenSign/src/pages/PlaceHolderSign.js
index a2019db72,04831ea19..638e746e0
--- a/apps/OpenSign/src/pages/PlaceHolderSign.js
+++ b/apps/OpenSign/src/pages/PlaceHolderSign.js
@@@ -54,9 -53,10 +54,11 @@@ import Loader from "../primitives/Loade
import { useSelector } from "react-redux";
import PdfZoom from "../components/pdf/PdfZoom";
import LottieWithLoader from "../primitives/DotLottieReact";
+import { paidUrl } from "../json/plansArr";
+ import { useTranslation } from "react-i18next";
function PlaceHolderSign() {
+ const { t } = useTranslation();
const editorRef = useRef();
const navigate = useNavigate();
const { state } = useLocation();
@@@ -1070,7 -1057,11 +1066,7 @@@
className="flex flex-row justify-between items-center mb-1"
key={ind}
>
- {copied && <Alert type="success">Copied</Alert>}
- {copied && (
- <Alert type="success">
- <div className="ml-3">{t("copied")}</div>
- </Alert>
- )}
++ {copied && <Alert type="success">{t("copied")}</Alert>}
<span className="w-[220px] md:w-[300px] whitespace-nowrap overflow-hidden text-ellipsis ">
{data.signerEmail}
</span>
diff --cc apps/OpenSign/src/pages/SSOVerify.js
index b11740da1,263367c61..80a75f116
--- a/apps/OpenSign/src/pages/SSOVerify.js
+++ b/apps/OpenSign/src/pages/SSOVerify.js
@@@ -8,9 -8,10 +8,11 @@@ import { useDispatch } from "react-redu
import { showTenant } from "../redux/reducers/ShowTenant";
import ModalUi from "../primitives/ModalUi";
import Loader from "../primitives/Loader";
+import { paidUrl } from "../json/plansArr";
+ import { useTranslation } from "react-i18next";
const SSOVerify = () => {
+ const { t } = useTranslation();
const location = useLocation();
const navigate = useNavigate();
const dispatch = useDispatch();
diff --cc apps/OpenSign/src/pages/TeamList.js
index 2d02ca340,65e7359e6..cd9ba538a
--- a/apps/OpenSign/src/pages/TeamList.js
+++ b/apps/OpenSign/src/pages/TeamList.js
@@@ -8,10 -8,10 +8,11 @@@ import ModalUi from "../primitives/Moda
import pad from "../assets/images/pad.svg";
import AddTeam from "../components/AddTeam";
import { isEnableSubscription } from "../constant/const";
-import { checkIsSubscribedTeam } from "../constant/Utils";
+import { checkIsSubscribed } from "../constant/Utils";
import SubscribeCard from "../primitives/SubscribeCard";
import Title from "../components/Title";
+import { validplan } from "../json/plansArr";
+ import { useTranslation } from "react-i18next";
const heading = ["Sr.No", "Name", "Parent Team", "Active"];
const actions = [
@@@ -227,12 -228,16 +229,12 @@@ const TeamList = () =>
<>
{isAdmin ? (
<div className="p-2 w-full bg-base-100 text-base-content op-card shadow-lg">
- {isAlert.msg && (
- <Alert type={isAlert.type}>
- <div className="ml-3">{isAlert.msg}</div>
- </Alert>
- )}
+ {isAlert.msg && <Alert type={isAlert.type}>{isAlert.msg}</Alert>}
<div className="flex flex-row items-center justify-between my-2 mx-3 text-[20px] md:text-[23px]">
<div className="font-light">
- Teams{" "}
+ {t("report-name.Teams")}
<span className="text-xs md:text-[13px] font-normal">
- <Tooltip message={"Teams"} />
+ <Tooltip message={t("report-heading.Team")} />
</span>
</div>
<div
diff --cc apps/OpenSign/src/pages/TemplatePlaceholder.js
index 32f650835,b358211de..18c350ec8
--- a/apps/OpenSign/src/pages/TemplatePlaceholder.js
+++ b/apps/OpenSign/src/pages/TemplatePlaceholder.js
@@@ -41,8 -40,9 +41,10 @@@ import DropdownWidgetOption from "../co
import Parse from "parse";
import { useSelector } from "react-redux";
import PdfZoom from "../components/pdf/PdfZoom";
+import { paidUrl } from "../json/plansArr";
+ import { useTranslation } from "react-i18next";
const TemplatePlaceholder = () => {
+ const { t } = useTranslation();
const navigate = useNavigate();
const isHeader = useSelector((state) => state.showHeader);
const { templateId } = useParams();
diff --cc apps/OpenSign/src/pages/UserList.js
index 181e4d003,3d07febe1..ef2487775
--- a/apps/OpenSign/src/pages/UserList.js
+++ b/apps/OpenSign/src/pages/UserList.js
@@@ -9,9 -9,9 +9,10 @@@ import Tooltip from "../primitives/Tool
import AddUser from "../components/AddUser";
import SubscribeCard from "../primitives/SubscribeCard";
import { isEnableSubscription } from "../constant/const";
-import { checkIsSubscribedTeam } from "../constant/Utils";
+import { checkIsSubscribed } from "../constant/Utils";
import Title from "../components/Title";
+import { validplan } from "../json/plansArr";
+ import { useTranslation } from "react-i18next";
const heading = ["Sr.No", "Name", "Email", "Phone", "Role", "Team", "Active"];
// const actions = [];
const UserList = () => {
@@@ -198,12 -200,16 +201,12 @@@
<>
{isAdmin ? (
<div className="p-2 w-full bg-base-100 text-base-content op-card shadow-lg">
- {isAlert.msg && (
- <Alert type={isAlert.type}>
- <div className="ml-3">{isAlert.msg}</div>
- </Alert>
- )}
+ {isAlert.msg && <Alert type={isAlert.type}>{isAlert.msg}</Alert>}
<div className="flex flex-row items-center justify-between my-2 mx-3 text-[20px] md:text-[23px]">
<div className="font-light">
- Users{" "}
+ {t("report-name.Users")}
<span className="text-xs md:text-[13px] font-normal">
- <Tooltip message={"users from Teams"} />
+ <Tooltip message={t("users-from-teams")} />
</span>
</div>
<div
@@@ -384,16 -390,22 +387,17 @@@
alt="img"
/>
</div>
- <div className="text-sm font-semibold">No Data Available</div>
+ <div className="text-sm font-semibold">
+ {t("no-data-avaliable")}
+ </div>
</div>
)}
-
- <ModalUi
- title={t("add-user")}
+ <AddUser
isOpen={isModal}
- handleClose={handleFormModal}
- >
- <AddUser
- setIsAlert={setIsAlert}
- handleUserData={handleUserData}
- closePopup={handleFormModal}
- />
- </ModalUi>
+ setIsAlert={setIsAlert}
+ handleUserData={handleUserData}
+ closePopup={handleFormModal}
+ />
</div>
) : (
<div className="flex items-center justify-center h-screen w-full bg-base-100 text-base-content rounded-box">
diff --cc apps/OpenSign/src/pages/UserProfile.js
index c73e831bd,1c383d840..fa7937183
--- a/apps/OpenSign/src/pages/UserProfile.js
+++ b/apps/OpenSign/src/pages/UserProfile.js
@@@ -16,7 -16,8 +16,9 @@@ import
import Upgrade from "../primitives/Upgrade";
import ModalUi from "../primitives/ModalUi";
import Loader from "../primitives/Loader";
+import { paidUrl, validplan } from "../json/plansArr";
+ import { useTranslation } from "react-i18next";
+ import SelectLanguage from "../components/pdf/SelectLanguage";
function UserProfile() {
const navigate = useNavigate();
@@@ -51,7 -53,8 +54,8 @@@
const [tagLine, setTagLine] = useState(
extendUser && extendUser?.[0]?.Tagline
);
- const [isTeam, setIsTeam] = useState(false);
+ const [isPlan, setIsPlan] = useState({ plan: "", isValid: false });
+
useEffect(() => {
getUserDetail();
}, []);
@@@ -301,14 -311,7 +311,15 @@@
setJobTitle(extendUser?.[0]?.JobTitle);
setIsDisableDocId(extendUser?.[0]?.HeaderDocId);
};
+ const handlePaidRoute = () => {
+ const route = paidUrl(isPlan.plan);
+ if (route === "/subscription") {
+ navigate(route);
+ } else {
+ openInNewTab(route, "_self");
+ }
+ };
+
return (
<React.Fragment>
<Title title={"Profile"} />
@@@ -522,12 -536,10 +544,12 @@@
<div className="flex justify-between items-center py-2">
<span
className={
- isTeam ? "font-semibold" : "font-semibold text-gray-300"
+ validplan[isPlan.plan]
+ ? "font-semibold"
+ : "font-semibold text-gray-300"
}
>
- Disable DocumentId :{" "}
+ {t("disable-documentId")} :{" "}
<Tooltip
url={
"https://docs.opensignlabs.com/docs/help/Settings/disabledocumentid"
@@@ -645,17 -657,16 +671,16 @@@
<div className="op-card op-bg-primary text-primary-content w-full shadow-lg">
<div className="op-card-body">
- <h2 className="op-card-title">Upgrade to Plan</h2>
- <p>
- To have a username less than 8 character please
- subscribe
- </p>
+ <h2 className="op-card-title">
+ {t("upgrade-to")} {t("plan")}
+ </h2>
+ <p>{t("user-name-limit-char")}</p>
<div className="op-card-actions justify-end">
<button
- onClick={() => navigate("/subscription")}
+ onClick={() => handlePaidRoute()}
className="op-btn op-btn-accent"
>
- Upgrade Now
+ {t("upgrade-now")}
</button>
</div>
</div>
diff --cc apps/OpenSign/src/pages/Webhook.js
index 52293e6d1,7d130c514..b01f95a79
--- a/apps/OpenSign/src/pages/Webhook.js
+++ b/apps/OpenSign/src/pages/Webhook.js
@@@ -10,14 -10,10 +10,11 @@@ import Tooltip from "../primitives/Tool
import Loader from "../primitives/Loader";
import SubscribeCard from "../primitives/SubscribeCard";
import Tour from "reactour";
+import { validplan } from "../json/plansArr";
- const tourSteps = [
- {
- selector: '[data-tut="webhooksubscribe"]',
- content: "Upgrade now to set webhook"
- }
- ];
+ import { useTranslation } from "react-i18next";
+
function Webhook() {
+ const { t } = useTranslation();
const [parseBaseUrl] = useState(localStorage.getItem("baseUrl"));
const [parseAppId] = useState(localStorage.getItem("parseAppId"));
const [webhook, setWebhook] = useState();
@@@ -31,11 -27,16 +28,16 @@@
fetchWebhook();
// eslint-disable-next-line
}, []);
-
+ const tourSteps = [
+ {
+ selector: '[data-tut="webhooksubscribe"]',
+ content: t("tour-mssg.webhook-1")
+ }
+ ];
const fetchWebhook = async () => {
if (isEnableSubscription) {
- const getIsSubscribe = await checkIsSubscribed();
- setIsSubscribe(getIsSubscribe);
+ const subscribe = await checkIsSubscribed();
+ setIsSubscribe(subscribe);
}
try {
const extRes = await Parse.Cloud.run("getUserDetails");
diff --cc apps/OpenSign/src/primitives/GetReportDisplay.js
index 7194a9527,ac17cb183..3bff611a0
--- a/apps/OpenSign/src/primitives/GetReportDisplay.js
+++ b/apps/OpenSign/src/primitives/GetReportDisplay.js
@@@ -27,9 -27,10 +27,11 @@@ import BulkSendUi from "../components/B
import Loader from "./Loader";
import Select from "react-select";
import SubscribeCard from "./SubscribeCard";
+import { validplan } from "../json/plansArr";
+ import { useTranslation } from "react-i18next";
const ReportTable = (props) => {
+ const { t } = useTranslation();
const navigate = useNavigate();
const location = useLocation();
const isDashboard =
@@@ -1473,124 -1469,114 +1470,120 @@@
{isShareWith[item.objectId] && (
<div className="op-modal op-modal-open">
<div className="max-h-90 bg-base-100 w-[95%] md:max-w-[500px] rounded-box relative">
- {isSubscribe && isEnableSubscription && (
- <>
- {item?.Signers?.length > 0 ? (
- <div className="h-[150px] flex justify-center items-center mx-2">
- <div
- className="op-btn op-btn-sm op-btn-circle op-btn-ghost text-base-content absolute right-2 top-2 z-40"
- onClick={() => setIsShareWith({})}
- >
- βœ•
- </div>
- <div className="text-base-content text-base text-center">
- {t("share-with-alert")}
+ {validplan[isSubscribe.plan] &&
+ isEnableSubscription && (
+ <>
+ {item?.Signers?.length > 0 ? (
+ <div className="h-[150px] flex justify-center items-center mx-2">
+ <div
+ className="op-btn op-btn-sm op-btn-circle op-btn-ghost text-base-content absolute right-2 top-2 z-40"
+ onClick={() => setIsShareWith({})}
+ >
+ βœ•
+ </div>
+ <div className="text-base-content text-base text-center">
- You cannot share a template if any
- roles already have contacts
- assigned. Please remove all contact
- assignments from the roles before
- sharing the template.
++ {t("share-with-alert")}
+ </div>
</div>
+ ) : (
+ <>
+ <h3 className="text-base-content font-bold text-lg pt-[15px] px-[20px]">
- Share with
++ {t("share-with")}
+ </h3>
+ <div
+ className="op-btn op-btn-sm op-btn-circle op-btn-ghost text-base-content absolute right-2 top-2 z-40"
+ onClick={() => setIsShareWith({})}
+ >
+ βœ•
+ </div>
+ <form
+ className="h-full w-full z-[1300] px-2 mt-3"
+ onSubmit={(e) =>
+ handleShareWith(e, item)
+ }
+ >
+ <Select
+ // onSortEnd={onSortEnd}
+ distance={4}
+ isMulti
+ options={teamList}
+ value={selectedTeam}
+ onChange={onChange}
+ closeMenuOnSelect
+ required={true}
+ noOptionsMessage={() =>
- "Team not found"
++ t("team-not-found")
+ }
+ unstyled
+ classNames={{
+ control: () =>
+ "op-input op-input-bordered op-input-sm border-gray-400 focus:outline-none hover:border-base-content w-full h-full text-[11px]",
+ valueContainer: () =>
+ "flex flex-row gap-x-[2px] gap-y-[2px] md:gap-y-0 w-full my-[2px]",
+ multiValue: () =>
+ "op-badge op-badge-primary h-full text-[11px]",
+ multiValueLabel: () =>
+ "mb-[2px]",
+ menu: () =>
+ "mt-1 shadow-md rounded-lg bg-base-200 text-base-content",
+ menuList: () =>
+ "shadow-md rounded-lg overflow-hidden",
+ option: () =>
+ "bg-base-200 text-base-content rounded-lg m-1 hover:bg-base-300 p-2",
+ noOptionsMessage: () =>
+ "p-2 bg-base-200 rounded-lg m-1 p-2"
+ }}
+ />
+ <button className="op-btn op-btn-primary ml-[10px] my-3">
- Submit
++ {t("submit")}
+ </button>
+ </form>
+ </>
+ )}
+ </>
+ )}
+ {!validplan[isSubscribe.plan] &&
+ isEnableSubscription && (
+ <>
+ <div
+ className="op-btn op-btn-sm op-btn-circle op-btn-ghost text-primary-content absolute right-2 top-2 z-40"
+ onClick={() => setIsShareWith({})}
+ >
+ βœ•
</div>
- ) : (
- <>
- <h3 className="text-base-content font-bold text-lg pt-[15px] px-[20px]">
- {t("share-with")}
- </h3>
- <div
- className="op-btn op-btn-sm op-btn-circle op-btn-ghost text-base-content absolute right-2 top-2 z-40"
- onClick={() => setIsShareWith({})}
- >
- βœ•
+ <SubscribeCard
+ plan={"TEAMS"}
+ price={"20"}
+ />
+ </>
+ )}
+ {validplan[isSubscribe.plan] &&
+ !isEnableSubscription && (
+ <>
+ <h3 className="text-base-content font-bold text-lg pt-[15px] px-[20px]">
- Share with
++ {t("share-with")}
+ </h3>
+ <div
+ className="op-btn op-btn-sm op-btn-circle op-btn-ghost text-base-content absolute right-2 top-2 z-40"
+ onClick={() => setIsShareWith({})}
+ >
+ βœ•
+ </div>
+ <div className="px-2 mt-3 w-full h-full">
+ <div className="op-input op-input-bordered op-input-sm w-full h-full text-[13px] break-all">
+ {selectedTeam?.[0]?.label}
</div>
- <form
- className="h-full w-full z-[1300] px-2 mt-3"
- onSubmit={(e) =>
- handleShareWith(e, item)
- }
- >
- <Select
- // onSortEnd={onSortEnd}
- distance={4}
- isMulti
- options={teamList}
- value={selectedTeam}
- onChange={onChange}
- closeMenuOnSelect
- required={true}
- noOptionsMessage={() =>
- t("team-not-found")
- }
- unstyled
- classNames={{
- control: () =>
- "op-input op-input-bordered op-input-sm border-gray-400 focus:outline-none hover:border-base-content w-full h-full text-[11px]",
- valueContainer: () =>
- "flex flex-row gap-x-[2px] gap-y-[2px] md:gap-y-0 w-full my-[2px]",
- multiValue: () =>
- "op-badge op-badge-primary h-full text-[11px]",
- multiValueLabel: () => "mb-[2px]",
- menu: () =>
- "mt-1 shadow-md rounded-lg bg-base-200 text-base-content",
- menuList: () =>
- "shadow-md rounded-lg overflow-hidden",
- option: () =>
- "bg-base-200 text-base-content rounded-lg m-1 hover:bg-base-300 p-2",
- noOptionsMessage: () =>
- "p-2 bg-base-200 rounded-lg m-1 p-2"
- }}
- />
- <button className="op-btn op-btn-primary ml-[10px] my-3">
- {t("submit")}
- </button>
- </form>
- </>
- )}
- </>
- )}
- {!isSubscribe && isEnableSubscription && (
- <>
- <div
- className="op-btn op-btn-sm op-btn-circle op-btn-ghost text-primary-content absolute right-2 top-2 z-40"
- onClick={() => setIsShareWith({})}
- >
- βœ•
- </div>
- <SubscribeCard
- plan={"TEAMS"}
- price={"20"}
- />
- </>
- )}
- {isSubscribe && !isEnableSubscription && (
- <>
- <h3 className="text-base-content font-bold text-lg pt-[15px] px-[20px]">
- {t("share-with")}
- </h3>
- <div
- className="op-btn op-btn-sm op-btn-circle op-btn-ghost text-base-content absolute right-2 top-2 z-40"
- onClick={() => setIsShareWith({})}
- >
- βœ•
- </div>
- <div className="px-2 mt-3 w-full h-full">
- <div className="op-input op-input-bordered op-input-sm w-full h-full text-[13px] break-all">
- {selectedTeam?.[0]?.label}
</div>
- </div>
- <button
- onClick={(e) => handleShareWith(e, item)}
- className="op-btn op-btn-primary ml-[10px] my-3"
- >
- {t("submit")}
- </button>
- </>
- )}
+ <button
+ onClick={(e) =>
+ handleShareWith(e, item)
+ }
+ className="op-btn op-btn-primary ml-[10px] my-3"
+ >
- Submit
++ {t("submit")}
+ </button>
+ </>
+ )}
</div>
</div>
)}
diff --cc apps/OpenSign/src/primitives/SubscribeCard.js
index e58b8d568,9ff6fa91d..3abf97fac
--- a/apps/OpenSign/src/primitives/SubscribeCard.js
+++ b/apps/OpenSign/src/primitives/SubscribeCard.js
@@@ -1,18 -1,10 +1,20 @@@
import React from "react";
+ import { useTranslation } from "react-i18next";
import { useNavigate } from "react-router-dom";
+import { paidUrl } from "../json/plansArr";
+import { openInNewTab } from "../constant/Utils";
-const SubscribeCard = ({ plan, price }) => {
+const SubscribeCard = ({ plan, price, plan_code }) => {
+ const { t } = useTranslation();
const navigate = useNavigate();
+ const handlePaidRoute = () => {
+ const route = paidUrl(plan_code);
+ if (route === "/subscription") {
+ navigate(route);
+ } else {
+ openInNewTab(route, "_self");
+ }
+ };
return (
<div className="op-card op-bg-primary text-primary-content w-full shadow-lg">
<div className="op-card-body">
@@@ -23,10 -16,10 +26,10 @@@
</p>
<div className="op-card-actions justify-end">
<button
- onClick={() => navigate("/subscription")}
+ onClick={() => handlePaidRoute()}
className="op-btn op-btn-accent"
>
- Upgrade Now
+ {t("upgrade-now")}
</button>
</div>
</div>