diff --git a/apps/OpenSign/Dockerfile b/apps/OpenSign/Dockerfile deleted file mode 100644 index e916c2679..000000000 --- a/apps/OpenSign/Dockerfile +++ /dev/null @@ -1,25 +0,0 @@ -# Use an official Node runtime as the base image -FROM node:18 - -# Set the working directory inside the container -WORKDIR /usr/src/app - -# Copy package.json and package-lock.json first to leverage Docker cache -COPY ./package*.json ./ - -# Install application dependencies -RUN npm install - -# Copy the current directory contents into the container -COPY ./ . -COPY ./.husky . - -# Make port 3000 available to the world outside this container -EXPOSE 3000 - -# Define environment variables if needed -# ENV NODE_ENV production - -# Run the application -ENTRYPOINT npm run start - diff --git a/apps/OpenSign/Dockerhubfile b/apps/OpenSign/Dockerhubfile index 395bad9d6..6f2d22e29 100644 --- a/apps/OpenSign/Dockerhubfile +++ b/apps/OpenSign/Dockerhubfile @@ -13,6 +13,10 @@ RUN npm install # Copy the current directory contents into the container COPY apps/OpenSign/ . COPY apps/OpenSign/.husky . +COPY apps/OpenSign/entrypoint.sh . + +# make the entrypoint.sh file executable +RUN chmod +x entrypoint.sh # Define environment variables if needed ENV NODE_ENV=production @@ -20,8 +24,13 @@ ENV GENERATE_SOURCEMAP=false # build RUN npm run build +# Inject env.js loader into index.html +RUN sed -i '/
/a\' build/index.html + # Make port 3000 available to the world outside this container EXPOSE 3000 +ENTRYPOINT ["./entrypoint.sh"] + # Run the application CMD ["npm", "start"] diff --git a/apps/OpenSign/entrypoint.sh b/apps/OpenSign/entrypoint.sh new file mode 100644 index 000000000..91553527a --- /dev/null +++ b/apps/OpenSign/entrypoint.sh @@ -0,0 +1,29 @@ +#!/bin/sh + +ENV_FILE=./build/env.js +DOTENV_FILE=./.env.prod # ✅ use .env.prod + +echo "Generating runtime env file at $ENV_FILE..." + +echo "window.RUNTIME_ENV = {" > $ENV_FILE + +# List of keys to include +RUNTIME_KEYS="REACT_APP_SERVERURL" + +for key in $RUNTIME_KEYS; do + # First check docker env (-e), fallback to .env file + value=$(printenv "$key") + + if [ -z "$value" ] && [ -f "$DOTENV_FILE" ]; then + # fallback: read from .env + value=$(grep "^$key=" "$DOTENV_FILE" | cut -d '=' -f2- | tr -d '\r\n' | sed 's/"/\\"/g') + else + value=$(echo "$value" | sed 's/"/\\"/g') + fi + + echo " $key: \"$value\"," >> $ENV_FILE +done + +echo "};" >> $ENV_FILE + +exec "$@" diff --git a/apps/OpenSign/public/locales/de/translation.json b/apps/OpenSign/public/locales/de/translation.json index 39bfb31e8..1e1f5b794 100644 --- a/apps/OpenSign/public/locales/de/translation.json +++ b/apps/OpenSign/public/locales/de/translation.json @@ -1,6 +1,7 @@ { "header-news": "Neue Funktion: Benutzer des Teams-Plans können jetzt ihre eigenen AWS S3-Buckets für die Dateispeicherung integrieren", "header-news-btn": "Jetzt einrichten", + "sandbox-news": "Dies ist eine Sandbox-Umgebung. Bitte nicht für produktive Zwecke verwenden.", "create-account": "Konto erstellen", "login": "Anmelden", "language": "Sprache", @@ -675,7 +676,7 @@ "public-template-mssg-1": "Um OpenSign in Ihr React- oder Next.js-Projekt zu integrieren, führen Sie einfach den folgenden Befehl aus:", "public-template-mssg-2": "Stellen Sie sicher, dass npm oder yarn in Ihrem Projekt eingerichtet ist. Wenn Sie Yarn verwenden, können Sie npm install durch yarn add @opensign/react ersetzen.", "public-template-mssg-3": "Benötigen Sie weitere Details oder Beispiele?", - "public-template-mssg-4": "Besuchen Sie die", + "public-template-mssg-4": "Besuchen Sie die ", "public-template-mssg-5": " npm für die neuesten Updates, detaillierte Dokumentationen und Versionshistorie.", "public-template-mssg-6": "Bevor Sie diesen Code-Schnipsel verwenden können, müssen Sie diese Vorlage öffentlich machen.", "public-template-mssg-7": "Bevor Sie einen öffentlichen Link generieren können, müssen Sie diese Vorlage öffentlich machen.", diff --git a/apps/OpenSign/public/locales/en/translation.json b/apps/OpenSign/public/locales/en/translation.json index 1f493bf0b..9b5653c6a 100644 --- a/apps/OpenSign/public/locales/en/translation.json +++ b/apps/OpenSign/public/locales/en/translation.json @@ -1,6 +1,7 @@ { "header-news": "New feature: Protect your account with Two-Factor Authentication (2FA) and enjoy the future of login with Passkeys — no passwords needed.", "header-news-btn": "Setup now", + "sandbox-news": "This is a sandbox environment. Please do not use it for production purposes.", "create-account": "Create account", "login": "Login", "language": "Language", @@ -675,7 +676,7 @@ "public-template-mssg-1": "To integrate OpenSign into your React or Next.js project, simply run the following command:", "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.", "public-template-mssg-3": "Need more details or examples?", - "public-template-mssg-4": "Visit the", + "public-template-mssg-4": "Visit the ", "public-template-mssg-5": " npm for the latest updates, detailed documentation, and version history.", "public-template-mssg-6": "Before you can use this code snippet, you must make this template public.", "public-template-mssg-7": "Before you can generate a public link you must make this template public.", diff --git a/apps/OpenSign/public/locales/es/translation.json b/apps/OpenSign/public/locales/es/translation.json index e224ef784..2759690ce 100644 --- a/apps/OpenSign/public/locales/es/translation.json +++ b/apps/OpenSign/public/locales/es/translation.json @@ -1,6 +1,7 @@ { "header-news": "Nueva característica: los usuarios del plan Teams ahora pueden integrar sus propios depósitos de AWS S3 para el almacenamiento de archivos", "header-news-btn": "Configurar ahora", + "sandbox-news": "Este es un entorno sandbox. Por favor, no lo utilice con fines de producción.", "create-account": "Crear cuenta", "login": "Iniciar sesión", "language": "Idioma", @@ -675,7 +676,7 @@ "public-template-mssg-1": "Para integrar OpenSign a tu proyecto React o Next.js, simplemente ejecuta los siguientes comandos:", "public-template-mssg-2": "Asegúrate de tener «npm» o «yarn» configurado en tu proyecto. Si estás usando «yarn», puedes reemplazar «npm install» con «yarn add @opensign/react».", "public-template-mssg-3": "¿Necesitas más detalles o ejemplos?", - "public-template-mssg-4": "Visita la", + "public-template-mssg-4": "Visita la ", "public-template-mssg-5": " «npm» para las últimas actualizaciones, documentación detallada e historial de versiones.", "public-template-mssg-6": "Antes de que puedas usar este fragmento de código, debes convertir esta plantilla en pública.", "public-template-mssg-7": "Antes de poder generar un enlace público, debes hacer que esta plantilla sea pública.", diff --git a/apps/OpenSign/public/locales/fr/translation.json b/apps/OpenSign/public/locales/fr/translation.json index a2ae43c17..354afb26b 100644 --- a/apps/OpenSign/public/locales/fr/translation.json +++ b/apps/OpenSign/public/locales/fr/translation.json @@ -1,6 +1,7 @@ { "header-news": "Nouvelle fonctionnalité : les utilisateurs du forfait Teams peuvent désormais intégrer leurs propres compartiments AWS S3 pour le stockage de fichiers", "header-news-btn": "Configurer maintenant", + "sandbox-news": "Ceci est un environnement sandbox. Veuillez ne pas l'utiliser à des fins de production.", "create-account": "Créer un compte", "login": "Se Connecter", "language": "Langue", @@ -675,7 +676,7 @@ "public-template-mssg-1": "Pour intégrer OpenSign dans votre projet React ou Next.js, exécutez simplement la commande suivante :", "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.", "public-template-mssg-3": "Besoin de plus de détails ou d'exemples ?", - "public-template-mssg-4": "Visitez le", + "public-template-mssg-4": "Visitez le ", "public-template-mssg-5": "npm pour les dernières mises à jour, une documentation détaillée et l'historique des versions.", "public-template-mssg-6": "Avant de pouvoir utiliser cet extrait de code, vous devez rendre ce modèle public.", "public-template-mssg-7": "Avant de pouvoir générer un lien public, vous devez rendre ce modèle public.", diff --git a/apps/OpenSign/public/locales/it/translation.json b/apps/OpenSign/public/locales/it/translation.json index bb44b7f33..c243af05a 100644 --- a/apps/OpenSign/public/locales/it/translation.json +++ b/apps/OpenSign/public/locales/it/translation.json @@ -1,6 +1,7 @@ { "header-news": "Nuova funzionalità: Gli utenti del piano Teams possono ora integrare i propri bucket AWS S3 per l'archiviazione dei file", "header-news-btn": "Configura Ora", + "sandbox-news": "Questo è un ambiente sandbox. Si prega di non utilizzarlo per scopi di produzione.", "create-account": "Crea Account", "login": "Accedi", "language": "Lingua", @@ -675,7 +676,7 @@ "public-template-mssg-1": "Per integrare OpenSign nel tuo progetto React o Next.js, esegui semplicemente il seguente comando:", "public-template-mssg-2": "Assicurati di avere npm o yarn configurato nel tuo progetto. Se usi Yarn, puoi sostituire npm install con yarn add @opensign/react.", "public-template-mssg-3": "Hai bisogno di maggiori dettagli o esempi?", - "public-template-mssg-4": "Visita il", + "public-template-mssg-4": "Visita il ", "public-template-mssg-5": " npm per gli aggiornamenti più recenti, documentazione dettagliata e cronologia delle versioni.", "public-template-mssg-6": "Prima di poter utilizzare questo frammento di codice, devi rendere questo modello pubblico.", "public-template-mssg-7": "Prima di poter generare un link pubblico, devi rendere questo modello pubblico.", diff --git a/apps/OpenSign/src/App.jsx b/apps/OpenSign/src/App.jsx index d9fe57668..27366832b 100644 --- a/apps/OpenSign/src/App.jsx +++ b/apps/OpenSign/src/App.jsx @@ -106,10 +106,10 @@ function App() { element={This is an automated email from " + appName + ". For any queries regarding this email, please contact the sender " + @@ -3161,3 +3166,22 @@ export const checkRegularExpress = (validateType, setValidatePlaceholder) => { setValidatePlaceholder("please enter value"); } }; + //function to use unlink signer from widgets + export const handleUnlinkSigner = (signerPos,setSignerPos,signersdata,setSignersData,uniqueId) => { + //remove existing signer's details from 'signerPos' array + const updatePlaceHolder = signerPos.map((x) => { + if (x.Id === uniqueId) { + return { ...x, signerPtr: {}, signerObjId: "" }; + } + return { ...x }; + }); + setSignerPos(updatePlaceHolder); + //remove existing signer's details from 'signersdata' array and keep role and id + const updateSigner = signersdata.map((item) => { + if (item.Id == uniqueId) { + return { Role: item.Role, Id: item.Id, blockColor: item.blockColor }; + } + return item; + }); + setSignersData(updateSigner); + }; diff --git a/apps/OpenSign/src/constant/appinfo.js b/apps/OpenSign/src/constant/appinfo.js index a41cff14c..f8e615f5b 100644 --- a/apps/OpenSign/src/constant/appinfo.js +++ b/apps/OpenSign/src/constant/appinfo.js @@ -1,9 +1,12 @@ import logo from "../assets/images/logo.png"; +import { getEnv } from "./Utils"; export function serverUrl_fn() { - let baseUrl = process.env.REACT_APP_SERVERURL - ? process.env.REACT_APP_SERVERURL - : window.location.origin + "/api/app"; + const env = getEnv(); + const serverurl = env?.REACT_APP_SERVERURL + ? env.REACT_APP_SERVERURL // env.REACT_APP_SERVERURL is used for prod + : process.env.REACT_APP_SERVERURL; // process.env.REACT_APP_SERVERURL is used for dev (locally) + let baseUrl = serverurl ? serverurl : window.location.origin + "/api/app"; return baseUrl; } export const appInfo = { diff --git a/apps/OpenSign/src/json/menuJson.js b/apps/OpenSign/src/json/menuJson.js index f6801c6b0..340e11978 100644 --- a/apps/OpenSign/src/json/menuJson.js +++ b/apps/OpenSign/src/json/menuJson.js @@ -1,3 +1,13 @@ +const userssetting = [ + { + icon: "fa-light fa-users fa-fw", + title: "Users", + target: "_self", + pageType: "", + description: "", + objectId: "users" + } +]; export const subSetting = [ { icon: "fa-light fa-sliders", @@ -7,14 +17,7 @@ export const subSetting = [ description: "", objectId: "preferences" }, - { - icon: "fa-light fa-users fa-fw", - title: "Users", - target: "_self", - pageType: "", - description: "", - objectId: "users" - } + ...userssetting ]; const sidebarList = [ @@ -65,7 +68,7 @@ const sidebarList = [ pageType: "report", description: "", objectId: "6TeaPr321t" - }, + } ] }, { diff --git a/apps/OpenSign/src/pages/Login.jsx b/apps/OpenSign/src/pages/Login.jsx index a77af3336..554033ea4 100644 --- a/apps/OpenSign/src/pages/Login.jsx +++ b/apps/OpenSign/src/pages/Login.jsx @@ -68,6 +68,7 @@ function Login() { setState({ ...state, loading: false, alertType: type, alertMsg: msg }); setTimeout(() => setState({ ...state, alertMsg: "" }), 2000); }; + const checkUserExt = async () => { const app = await getAppLogo(); if (app?.error === "invalid_json") { @@ -82,11 +83,11 @@ function Login() { } else { setImage(appInfo?.applogo || undefined); } + dispatch(fetchAppInfo()); if (localStorage.getItem("accesstoken")) { setState({ ...state, loading: true }); GetLoginData(); } - dispatch(fetchAppInfo()); }; const handleChange = (event) => { let { name, value } = event.target; @@ -96,20 +97,15 @@ function Login() { setState({ ...state, [name]: value }); }; - const handleSubmit = async (event) => { - localStorage.removeItem("accesstoken"); - event.preventDefault(); + const handleLogin = async ( + ) => { + const email = state?.email + const password = state?.password - if (!emailRegex.test(state.email)) { - alert("Please enter a valid email address."); - return; - } - - const { email, password } = state; if (!email || !password) { return; } - + localStorage.removeItem("accesstoken"); try { setState({ ...state, loading: true }); localStorage.setItem("appLogo", appInfo.applogo); @@ -132,6 +128,14 @@ function Login() { showToast("danger", "Invalid username/password or region"); } }; + const handleLoginBtn = async (event) => { + event.preventDefault(); + if (!emailRegex.test(state.email)) { + alert("Please enter a valid email address."); + return; + } + await handleLogin(); + }; const setThirdpartyLoader = (value) => { setState({ ...state, thirdpartyLoader: value }); @@ -275,7 +279,6 @@ function Login() { const userInformation = JSON.parse( localStorage.getItem("UserInformation") ); - // console.log("payload ", payload); if (payload && payload.sessionToken) { const params = { userDetails: { @@ -289,7 +292,6 @@ function Login() { } }; const userSignUp = await Parse.Cloud.run("usersignup", params); - // console.log("userSignUp ", userSignUp); if (userSignUp && userSignUp.sessionToken) { const LocalUserDetails = { name: userInformation.name, @@ -430,7 +432,7 @@ function Login() {