From d8d52ab08004aee2b820ac24ec1dcbd840bcab0b Mon Sep 17 00:00:00 2001 From: Rishab <33950743+rishabjasrotia@users.noreply.github.com> Date: Tue, 31 Oct 2023 16:05:12 +0530 Subject: [PATCH 01/31] Update docker-compose.yml --- docker-compose.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 5a03008dd..890ec2e9c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -5,7 +5,7 @@ services: build: context: ./apps/OpenSignServer dockerfile: Dockerfile - image: OpenSignServer-image + image: opensignserver-image container_name: OpenSignServer-container command: /usr/src/app/node_modules/.bin/nodemon server.js volumes: @@ -15,7 +15,7 @@ services: - "5000:5000" depends_on: - mongo - env_file: ./OpenSignServer/.env + env_file: .env environment: - NODE_ENV=development networks: @@ -32,7 +32,7 @@ services: build: context: ./apps/OpenSign dockerfile: Dockerfile - image: OpenSign-image + image: opensign-image container_name: OpenSign-container command: npm start volumes: @@ -53,4 +53,4 @@ volumes: data-volume: node_modules: web-root: -      driver: local + driver: local From f5e164cb3c45b7f644611e23804c3a10bc03935c Mon Sep 17 00:00:00 2001 From: Rishab <33950743+rishabjasrotia@users.noreply.github.com> Date: Tue, 31 Oct 2023 16:05:42 +0530 Subject: [PATCH 02/31] Update Dockerfile --- apps/OpenSign/Dockerfile | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/apps/OpenSign/Dockerfile b/apps/OpenSign/Dockerfile index 49067d236..172fc969d 100644 --- a/apps/OpenSign/Dockerfile +++ b/apps/OpenSign/Dockerfile @@ -5,14 +5,16 @@ FROM node:16 WORKDIR /usr/src/app # Copy package.json and package-lock.json first to leverage Docker cache -COPY apps/OpenSign/package*.json ./ +COPY ./package*.json ./ # Install application dependencies RUN npm install # Copy the current directory contents into the container -COPY apps/OpenSign/ . -COPY apps/OpenSign/.husky . +COPY ./ . +COPY ./.husky . + +RUN npm run build # Make port 3000 available to the world outside this container EXPOSE 3000 From 4d18aea6921f570c4876e181797232837ae720f8 Mon Sep 17 00:00:00 2001 From: Rishab <33950743+rishabjasrotia@users.noreply.github.com> Date: Tue, 31 Oct 2023 16:06:06 +0530 Subject: [PATCH 03/31] Update Dockerfile --- apps/OpenSignServer/Dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/OpenSignServer/Dockerfile b/apps/OpenSignServer/Dockerfile index c71c551e2..9e2bfbe6c 100644 --- a/apps/OpenSignServer/Dockerfile +++ b/apps/OpenSignServer/Dockerfile @@ -5,7 +5,7 @@ FROM node:16 WORKDIR /usr/src/app # Copy package.json and package-lock.json first to leverage Docker cache -COPY apps/OpenSignServer/package*.json ./ +COPY ./package*.json ./ # Install application dependencies RUN npm install @@ -14,7 +14,7 @@ RUN npm install # RUN apk add --no-cache make gcc g++ python3 # Copy the current directory contents into the container -COPY apps/OpenSignServer/ . +COPY ./ . # Make port 8080 available to the world outside this container EXPOSE 8080 @@ -24,4 +24,4 @@ EXPOSE 8080 # ENV DATABASE_URL mongodb://db:27017 # Run the application -CMD ["npm", "start"] \ No newline at end of file +CMD ["npm", "start"] From 91e691630cd36e5faca9362cdd3e98ac6cba22c2 Mon Sep 17 00:00:00 2001 From: Rishab <33950743+rishabjasrotia@users.noreply.github.com> Date: Tue, 31 Oct 2023 16:53:39 +0530 Subject: [PATCH 04/31] Removed npm run build Removed npm run build --- apps/OpenSign/Dockerfile | 2 -- 1 file changed, 2 deletions(-) diff --git a/apps/OpenSign/Dockerfile b/apps/OpenSign/Dockerfile index 172fc969d..7d8542bf6 100644 --- a/apps/OpenSign/Dockerfile +++ b/apps/OpenSign/Dockerfile @@ -14,8 +14,6 @@ RUN npm install COPY ./ . COPY ./.husky . -RUN npm run build - # Make port 3000 available to the world outside this container EXPOSE 3000 From 22e121d0940f34f4d7007693c66bf7efadd40455 Mon Sep 17 00:00:00 2001 From: Andrew <148278535+andrew-opensignlabs@users.noreply.github.com> Date: Tue, 31 Oct 2023 17:24:49 +0530 Subject: [PATCH 05/31] fix: change port no to 5001 for Mac compatibility Apple uses port 5000 for AirPlay Receiver. It will be better if we use port 5001 instead. --- docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index 890ec2e9c..90754579e 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -12,7 +12,7 @@ services: - ./apps/OpenSignServer/:/usr/src/app - /usr/src/app/node_modules ports: - - "5000:5000" + - "5001:5001" depends_on: - mongo env_file: .env From ef9697b9d60580dab1a43b3df5909676b2a06fb5 Mon Sep 17 00:00:00 2001 From: rishabjasrotia Date: Tue, 31 Oct 2023 18:40:32 +0530 Subject: [PATCH 06/31] Usage of MakeFile to build project --- INSTALLATION.md | 6 ++++++ Makefile | 3 +++ 2 files changed, 9 insertions(+) create mode 100644 Makefile diff --git a/INSTALLATION.md b/INSTALLATION.md index 78dbcf142..9456f924b 100644 --- a/INSTALLATION.md +++ b/INSTALLATION.md @@ -83,3 +83,9 @@ You can install all 3 components on digital ocean using the button below - Visit below link if you face any issues while following the above instructions - - https://repost.aws/knowledge-center/create-access-key + + +## Localhost(Docker) + +Below are the steps to follow - +- Execute `make build` \ No newline at end of file diff --git a/Makefile b/Makefile new file mode 100644 index 000000000..219e4842b --- /dev/null +++ b/Makefile @@ -0,0 +1,3 @@ +build: + cp .env.example .env + docker compose up -d \ No newline at end of file From 5533cfe8316aee5b005d144ba3b75fdb7501aa0b Mon Sep 17 00:00:00 2001 From: rishabjasrotia Date: Tue, 31 Oct 2023 18:41:19 +0530 Subject: [PATCH 07/31] Update Documentation --- INSTALLATION.md | 1 + 1 file changed, 1 insertion(+) diff --git a/INSTALLATION.md b/INSTALLATION.md index 9456f924b..e10a73caa 100644 --- a/INSTALLATION.md +++ b/INSTALLATION.md @@ -7,6 +7,7 @@ or follow below instructions to install it on your own infrastructure. - Localhost(Frontend only) - Digital Ocean +- Localhost(Docker) ## Localhost(Frontend only) From 37ec427ed57ac56d4edc98ff030d9acdbe9fb30d Mon Sep 17 00:00:00 2001 From: rishabjasrotia Date: Tue, 31 Oct 2023 18:44:52 +0530 Subject: [PATCH 08/31] Front End .env --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 219e4842b..726b589ea 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,3 @@ build: - cp .env.example .env + cp .env.frontend_dev .env docker compose up -d \ No newline at end of file From fbe8701f87ef76f8c13b494bf054cd4c1fa0bb30 Mon Sep 17 00:00:00 2001 From: rishabjasrotia Date: Wed, 1 Nov 2023 14:56:40 +0530 Subject: [PATCH 09/31] Fix local Development problem --- apps/OpenSignServer/package-lock.json | 593 +++++++++++++++----------- apps/OpenSignServer/package.json | 4 +- 2 files changed, 355 insertions(+), 242 deletions(-) diff --git a/apps/OpenSignServer/package-lock.json b/apps/OpenSignServer/package-lock.json index b93d0f545..6b692e824 100644 --- a/apps/OpenSignServer/package-lock.json +++ b/apps/OpenSignServer/package-lock.json @@ -25,8 +25,8 @@ "node-forge": "^1.3.1", "node-signpdf": "^1.5.1", "openai": "^4.8.0", - "parse": "4.0.1", - "parse-server": "6.0.0", + "parse": "4.1.0", + "parse-server": "6.3.1", "parse-server-api-mail-adapter": "^3.0.0", "parse-server-s3-adapter": "^1.2.0", "pdf-lib": "^1.16.0", @@ -301,9 +301,9 @@ } }, "node_modules/@babel/runtime": { - "version": "7.18.0", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.18.0.tgz", - "integrity": "sha512-YMQvx/6nKEaucl0MY56mwIG483xk8SDNdlUwb2Ts6FUpr7fm85DxEmsY18LXBNhcTz6tO6JwZV8w1W06v8UKeg==", + "version": "7.15.4", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.15.4.tgz", + "integrity": "sha512-99catp6bHCaxr4sJ/DbTGgHS4+Rs2RVd2g7iOap6SLGPDknRK9ztKNsE/Fg6QhSeh1FGE5f6gHGQmvvn3I3xhw==", "dependencies": { "regenerator-runtime": "^0.13.4" }, @@ -312,12 +312,12 @@ } }, "node_modules/@babel/runtime-corejs3": { - "version": "7.17.8", - "resolved": "https://registry.npmjs.org/@babel/runtime-corejs3/-/runtime-corejs3-7.17.8.tgz", - "integrity": "sha512-ZbYSUvoSF6dXZmMl/CYTMOvzIFnbGfv4W3SEHYgMvNsFTeLaF2gkGAF4K2ddmtSK4Emej+0aYcnSC6N5dPCXUQ==", + "version": "7.21.0", + "resolved": "https://registry.npmjs.org/@babel/runtime-corejs3/-/runtime-corejs3-7.21.0.tgz", + "integrity": "sha512-TDD4UJzos3JJtM+tHX+w2Uc+KWj7GV+VKKFdMVd2Rx8sdA19hcc3P3AHFYd5LVOw+pYuSd5lICC3gm52B6Rwxw==", "dependencies": { - "core-js-pure": "^3.20.2", - "regenerator-runtime": "^0.13.4" + "core-js-pure": "^3.25.1", + "regenerator-runtime": "^0.13.11" }, "engines": { "node": ">=6.9.0" @@ -888,65 +888,6 @@ "eslint-scope": "5.1.1" } }, - "node_modules/@node-redis/bloom": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@node-redis/bloom/-/bloom-1.0.1.tgz", - "integrity": "sha512-mXEBvEIgF4tUzdIN89LiYsbi6//EdpFA7L8M+DHCvePXg+bfHWi+ct5VI6nHUFQE5+ohm/9wmgihCH3HSkeKsw==", - "peerDependencies": { - "@node-redis/client": "^1.0.0" - } - }, - "node_modules/@node-redis/client": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/@node-redis/client/-/client-1.0.5.tgz", - "integrity": "sha512-ESZ3bd1f+od62h4MaBLKum+klVJfA4wAeLHcVQBkoXa1l0viFesOWnakLQqKg+UyrlJhZmXJWtu0Y9v7iTMrig==", - "dependencies": { - "cluster-key-slot": "1.1.0", - "generic-pool": "3.8.2", - "redis-parser": "3.0.0", - "yallist": "4.0.0" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/@node-redis/client/node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" - }, - "node_modules/@node-redis/graph": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@node-redis/graph/-/graph-1.0.0.tgz", - "integrity": "sha512-mRSo8jEGC0cf+Rm7q8mWMKKKqkn6EAnA9IA2S3JvUv/gaWW/73vil7GLNwion2ihTptAm05I9LkepzfIXUKX5g==", - "peerDependencies": { - "@node-redis/client": "^1.0.0" - } - }, - "node_modules/@node-redis/json": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@node-redis/json/-/json-1.0.2.tgz", - "integrity": "sha512-qVRgn8WfG46QQ08CghSbY4VhHFgaTY71WjpwRBGEuqGPfWwfRcIf3OqSpR7Q/45X+v3xd8mvYjywqh0wqJ8T+g==", - "peerDependencies": { - "@node-redis/client": "^1.0.0" - } - }, - "node_modules/@node-redis/search": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/@node-redis/search/-/search-1.0.5.tgz", - "integrity": "sha512-MCOL8iCKq4v+3HgEQv8zGlSkZyXSXtERgrAJ4TSryIG/eLFy84b57KmNNa/V7M1Q2Wd2hgn2nPCGNcQtk1R1OQ==", - "peerDependencies": { - "@node-redis/client": "^1.0.0" - } - }, - "node_modules/@node-redis/time-series": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@node-redis/time-series/-/time-series-1.0.2.tgz", - "integrity": "sha512-HGQ8YooJ8Mx7l28tD7XjtB3ImLEjlUxG1wC1PAjxu6hPJqjPshUZxAICzDqDjtIbhDTf48WXXUcx8TQJB1XTKA==", - "peerDependencies": { - "@node-redis/client": "^1.0.0" - } - }, "node_modules/@node-rs/bcrypt": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@node-rs/bcrypt/-/bcrypt-1.1.0.tgz", @@ -1193,6 +1134,27 @@ } } }, + "node_modules/@parse/node-apn/node_modules/jsonwebtoken": { + "version": "8.5.1", + "resolved": "https://registry.npmjs.org/jsonwebtoken/-/jsonwebtoken-8.5.1.tgz", + "integrity": "sha512-XjwVfRS6jTMsqYs0EsuJ4LGxXV14zQybNd4L2r0UvbVnSF9Af8x7p5MzbJ90Ioz/9TI41/hTCvznF/loiSzn8w==", + "dependencies": { + "jws": "^3.2.2", + "lodash.includes": "^4.3.0", + "lodash.isboolean": "^3.0.3", + "lodash.isinteger": "^4.0.4", + "lodash.isnumber": "^3.0.3", + "lodash.isplainobject": "^4.0.6", + "lodash.isstring": "^4.0.1", + "lodash.once": "^4.0.0", + "ms": "^2.1.1", + "semver": "^5.6.0" + }, + "engines": { + "node": ">=4", + "npm": ">=1.4.28" + } + }, "node_modules/@parse/node-apn/node_modules/node-forge": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/node-forge/-/node-forge-1.3.0.tgz", @@ -1201,6 +1163,14 @@ "node": ">= 6.13.0" } }, + "node_modules/@parse/node-apn/node_modules/semver": { + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", + "bin": { + "semver": "bin/semver" + } + }, "node_modules/@parse/node-gcm": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/@parse/node-gcm/-/node-gcm-1.0.2.tgz", @@ -1301,9 +1271,9 @@ } }, "node_modules/@parse/push-adapter": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/@parse/push-adapter/-/push-adapter-4.1.2.tgz", - "integrity": "sha512-034vZTlAzgdfefIY4+Q4j8DHS/VwUAIVoh1JeRkHNfyQmUQ++uKbQbUQdJ/nf11HHS69kwLENs13BmhlHMpyHQ==", + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/@parse/push-adapter/-/push-adapter-4.1.3.tgz", + "integrity": "sha512-Oy53ag7DpUva5dUWwP6tNEsrxv2xU9QIk+rb84q1DIm1qVgo2yl4oXcZ3FPG2Ks/NYURbv4w+z9oaSgVfyBRfQ==", "dependencies": { "@parse/node-apn": "5.1.3", "@parse/node-gcm": "1.0.2", @@ -1314,17 +1284,6 @@ "node": ">= 12" } }, - "node_modules/@parse/push-adapter/node_modules/@babel/runtime": { - "version": "7.15.4", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.15.4.tgz", - "integrity": "sha512-99catp6bHCaxr4sJ/DbTGgHS4+Rs2RVd2g7iOap6SLGPDknRK9ztKNsE/Fg6QhSeh1FGE5f6gHGQmvvn3I3xhw==", - "dependencies": { - "regenerator-runtime": "^0.13.4" - }, - "engines": { - "node": ">=6.9.0" - } - }, "node_modules/@parse/push-adapter/node_modules/@babel/runtime-corejs3": { "version": "7.14.7", "resolved": "https://registry.npmjs.org/@babel/runtime-corejs3/-/runtime-corejs3-7.14.7.tgz", @@ -1473,6 +1432,64 @@ "pako": "^1.0.10" } }, + "node_modules/@redis/bloom": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@redis/bloom/-/bloom-1.2.0.tgz", + "integrity": "sha512-HG2DFjYKbpNmVXsa0keLHp/3leGJz1mjh09f2RLGGLQZzSHpkmZWuwJbAvo3QcRY8p80m5+ZdXZdYOSBLlp7Cg==", + "peerDependencies": { + "@redis/client": "^1.0.0" + } + }, + "node_modules/@redis/client": { + "version": "1.5.7", + "resolved": "https://registry.npmjs.org/@redis/client/-/client-1.5.7.tgz", + "integrity": "sha512-gaOBOuJPjK5fGtxSseaKgSvjiZXQCdLlGg9WYQst+/GRUjmXaiB5kVkeQMRtPc7Q2t93XZcJfBMSwzs/XS9UZw==", + "dependencies": { + "cluster-key-slot": "1.1.2", + "generic-pool": "3.9.0", + "yallist": "4.0.0" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/@redis/client/node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" + }, + "node_modules/@redis/graph": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@redis/graph/-/graph-1.1.0.tgz", + "integrity": "sha512-16yZWngxyXPd+MJxeSr0dqh2AIOi8j9yXKcKCwVaKDbH3HTuETpDVPcLujhFYVPtYrngSco31BUcSa9TH31Gqg==", + "peerDependencies": { + "@redis/client": "^1.0.0" + } + }, + "node_modules/@redis/json": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@redis/json/-/json-1.0.4.tgz", + "integrity": "sha512-LUZE2Gdrhg0Rx7AN+cZkb1e6HjoSKaeeW8rYnt89Tly13GBI5eP4CwDVr+MY8BAYfCg4/N15OUrtLoona9uSgw==", + "peerDependencies": { + "@redis/client": "^1.0.0" + } + }, + "node_modules/@redis/search": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@redis/search/-/search-1.1.2.tgz", + "integrity": "sha512-/cMfstG/fOh/SsE+4/BQGeuH/JJloeWuH+qJzM8dbxuWvdWibWAOAHHCZTMPhV3xIlH4/cUEIA8OV5QnYpaVoA==", + "peerDependencies": { + "@redis/client": "^1.0.0" + } + }, + "node_modules/@redis/time-series": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@redis/time-series/-/time-series-1.0.4.tgz", + "integrity": "sha512-ThUIgo2U/g7cCuZavucQTQzA9g9JbDDY2f64u3AbAoz/8vE2lt2U37LamDUVChhaDA3IRT9R6VvJwqnUfTJzng==", + "peerDependencies": { + "@redis/client": "^1.0.0" + } + }, "node_modules/@repeaterjs/repeater": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/@repeaterjs/repeater/-/repeater-3.0.4.tgz", @@ -1889,11 +1906,11 @@ } }, "node_modules/assert-options": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/assert-options/-/assert-options-0.7.0.tgz", - "integrity": "sha512-7q9uNH/Dh8gFgpIIb9ja8PJEWA5AQy3xnBC8jtKs8K/gNVCr1K6kIvlm59HUyYgvM7oEDoLzGgPcGd9FqhtXEQ==", + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/assert-options/-/assert-options-0.8.1.tgz", + "integrity": "sha512-5lNGRB5g5i2bGIzb+J1QQE1iKU/WEMVBReFIc5pPDWjcPj23otPL0eI6PB2v7QPi0qU6Mhym5D3y0ZiSIOf3GA==", "engines": { - "node": ">=8.0.0" + "node": ">=10.0.0" } }, "node_modules/assert-plus": { @@ -2506,9 +2523,9 @@ } }, "node_modules/cluster-key-slot": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/cluster-key-slot/-/cluster-key-slot-1.1.0.tgz", - "integrity": "sha512-2Nii8p3RwAPiFwsnZvukotvow2rIHM+yQ6ZcBXGHdniadkYGZYiGmkHJIbZPIV9nfv7m/U1IPMVVcAhoWFeklw==", + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/cluster-key-slot/-/cluster-key-slot-1.1.2.tgz", + "integrity": "sha512-RMr0FhtfXemyinomL4hrWcYJxmX6deFdCxpJzhDttxgO1+bcCnkk+9drydLVDmAMG7NE6aN/fl4F7ucU/90gAA==", "engines": { "node": ">=0.10.0" } @@ -2573,11 +2590,11 @@ } }, "node_modules/commander": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-5.1.0.tgz", - "integrity": "sha512-P0CysNDQ7rtVw4QIQtm+MRxV66vKFSvlsQvGYXZWR3qFU0jlMKHZZZgw8e+8DSah4UDKMqnknRDQz+xuQXQ/Zg==", + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-10.0.1.tgz", + "integrity": "sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug==", "engines": { - "node": ">= 6" + "node": ">=14" } }, "node_modules/commondir": { @@ -2664,9 +2681,9 @@ "integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==" }, "node_modules/core-js-pure": { - "version": "3.30.2", - "resolved": "https://registry.npmjs.org/core-js-pure/-/core-js-pure-3.30.2.tgz", - "integrity": "sha512-p/npFUJXXBkCCTIlEGBdghofn00jWG6ZOtdoIXSJmAu2QBvN0IqpZXWweOytcwE6cfx8ZvVUy1vw8zxhe4Y2vg==", + "version": "3.33.2", + "resolved": "https://registry.npmjs.org/core-js-pure/-/core-js-pure-3.33.2.tgz", + "integrity": "sha512-a8zeCdyVk7uF2elKIGz67AjcXOxjRbwOLz8SbklEso1V+2DoW4OkAMZN9S9GBgvZIaqQi/OemFX4OiSoQEmg1Q==", "hasInstallScript": true, "funding": { "type": "opencollective", @@ -3804,9 +3821,9 @@ } }, "node_modules/express-rate-limit": { - "version": "6.6.0", - "resolved": "https://registry.npmjs.org/express-rate-limit/-/express-rate-limit-6.6.0.tgz", - "integrity": "sha512-HFN2+4ZGdkQOS8Qli4z6knmJFnw6lZed67o6b7RGplWeb1Z0s8VXaj3dUgPIdm9hrhZXTRpCTHXA0/2Eqex0vA==", + "version": "6.7.0", + "resolved": "https://registry.npmjs.org/express-rate-limit/-/express-rate-limit-6.7.0.tgz", + "integrity": "sha512-vhwIdRoqcYB/72TK3tRZI+0ttS8Ytrk24GfmsxDXK9o9IhHNO5bXRiXQSExPQ4GbaE5tvIS7j1SGrxsuWs+sGA==", "engines": { "node": ">= 12.9.0" }, @@ -4299,9 +4316,9 @@ } }, "node_modules/generic-pool": { - "version": "3.8.2", - "resolved": "https://registry.npmjs.org/generic-pool/-/generic-pool-3.8.2.tgz", - "integrity": "sha512-nGToKy6p3PAbYQ7p1UlWl6vSPwfwU6TMSWK7TTu+WUY4ZjyZQGniGGt2oNVvyNSpyZYSB43zMXVLcBm08MTMkg==", + "version": "3.9.0", + "resolved": "https://registry.npmjs.org/generic-pool/-/generic-pool-3.9.0.tgz", + "integrity": "sha512-hymDOu5B53XvN4QT9dBmZxPX4CWhBPPLguTZ9MMFeFa/Kg0xWVfylOVNlJji/E7yTZWFd/q9GO5TxDLq156D7g==", "engines": { "node": ">= 4" } @@ -4764,9 +4781,9 @@ } }, "node_modules/idb-keyval": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/idb-keyval/-/idb-keyval-6.0.3.tgz", - "integrity": "sha512-yh8V7CnE6EQMu9YDwQXhRxwZh4nv+8xm/HV4ZqK4IiYFJBWYGjJuykADJbSP+F/GDXUBwCSSNn/14IpGL81TuA==", + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/idb-keyval/-/idb-keyval-6.2.0.tgz", + "integrity": "sha512-uw+MIyQn2jl3+hroD7hF8J7PUviBU7BPKWw4f/ISf32D4LoGu98yHjrzWWJDASu9QNrX10tCJqk9YY0ClWm8Ng==", "dependencies": { "safari-14-idb-fix": "^3.0.0" } @@ -5559,34 +5576,50 @@ } }, "node_modules/jsonwebtoken": { - "version": "8.5.1", - "resolved": "https://registry.npmjs.org/jsonwebtoken/-/jsonwebtoken-8.5.1.tgz", - "integrity": "sha512-XjwVfRS6jTMsqYs0EsuJ4LGxXV14zQybNd4L2r0UvbVnSF9Af8x7p5MzbJ90Ioz/9TI41/hTCvznF/loiSzn8w==", + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/jsonwebtoken/-/jsonwebtoken-9.0.0.tgz", + "integrity": "sha512-tuGfYXxkQGDPnLJ7SibiQgVgeDgfbPq2k2ICcbgqW8WxWLBAxKQM/ZCu/IT8SOSwmaYl4dpTFCW5xZv7YbbWUw==", "dependencies": { "jws": "^3.2.2", - "lodash.includes": "^4.3.0", - "lodash.isboolean": "^3.0.3", - "lodash.isinteger": "^4.0.4", - "lodash.isnumber": "^3.0.3", - "lodash.isplainobject": "^4.0.6", - "lodash.isstring": "^4.0.1", - "lodash.once": "^4.0.0", + "lodash": "^4.17.21", "ms": "^2.1.1", - "semver": "^5.6.0" + "semver": "^7.3.8" }, "engines": { - "node": ">=4", - "npm": ">=1.4.28" + "node": ">=12", + "npm": ">=6" + } + }, + "node_modules/jsonwebtoken/node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" } }, "node_modules/jsonwebtoken/node_modules/semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "dependencies": { + "lru-cache": "^6.0.0" + }, "bin": { - "semver": "bin/semver" + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" } }, + "node_modules/jsonwebtoken/node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" + }, "node_modules/jsprim": { "version": "1.4.2", "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.2.tgz", @@ -7277,45 +7310,44 @@ } }, "node_modules/parse": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/parse/-/parse-4.0.1.tgz", - "integrity": "sha512-ctv7zaVKlQIBSbarorB7TH3yacDzCvgWBP4ccpLKxlpe21QlaY88kv9V7ca7JdG/Txb3qWug4MwepQoPogXB6Q==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/parse/-/parse-4.1.0.tgz", + "integrity": "sha512-s0Ti+nWrKWj9DlFcmkEE05fGwa/K5ycZSdqCz01F8YL7Hevqv4WLXAmYGOwzq5UJSZ005seKgb20KwVwLdy/Zg==", "dependencies": { - "@babel/runtime": "7.18.0", - "@babel/runtime-corejs3": "7.17.8", - "idb-keyval": "6.0.3", + "@babel/runtime-corejs3": "7.21.0", + "idb-keyval": "6.2.0", "react-native-crypto-js": "1.0.0", - "uuid": "3.4.0", - "ws": "8.6.0", + "uuid": "9.0.0", + "ws": "8.12.0", "xmlhttprequest": "1.8.0" }, "engines": { - "node": ">=14.21.0 <17 || >=18 <19" + "node": ">=14.21.0 <17 || >=18 <20" }, "optionalDependencies": { "crypto-js": "4.1.1" } }, "node_modules/parse-server": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/parse-server/-/parse-server-6.0.0.tgz", - "integrity": "sha512-Ma7TP3ONqd4ja3KcEO4tnO55YiZ5w5ihtucQoAbeJwbKXqwZ3A0E9t4o4ilPqDKO+qxo+cA9yoNKej2cGVVVTg==", + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/parse-server/-/parse-server-6.3.1.tgz", + "integrity": "sha512-Dhf6mCqRlvPNbeuGl71d+FpBakXFSIEw2ayhnDee8L99WYZTCiP8x4RDs/xIdXVsUIgRWR1xvkEtRHuyll75OA==", "hasInstallScript": true, "dependencies": { - "@babel/eslint-parser": "7.19.1", - "@graphql-tools/merge": "8.3.6", + "@babel/eslint-parser": "7.21.8", + "@graphql-tools/merge": "8.4.1", "@graphql-tools/schema": "9.0.4", "@graphql-tools/utils": "8.12.0", "@graphql-yoga/node": "2.6.0", "@parse/fs-files-adapter": "1.2.2", - "@parse/push-adapter": "4.1.2", + "@parse/push-adapter": "4.1.3", "bcryptjs": "2.4.3", - "body-parser": "1.20.1", - "commander": "5.1.0", + "body-parser": "1.20.2", + "commander": "10.0.1", "cors": "2.8.5", "deepcopy": "2.1.0", "express": "4.18.2", - "express-rate-limit": "6.6.0", + "express-rate-limit": "6.7.0", "follow-redirects": "1.15.2", "graphql": "16.6.0", "graphql-list-fields": "2.0.2", @@ -7323,27 +7355,28 @@ "graphql-tag": "2.12.6", "intersect": "1.0.1", "ip-range-check": "0.2.0", - "jsonwebtoken": "8.5.1", + "jsonwebtoken": "9.0.0", "jwks-rsa": "2.1.5", "ldapjs": "2.3.3", "lodash": "4.17.21", - "lru-cache": "7.12.0", + "lru-cache": "9.1.1", "mime": "3.0.0", "mongodb": "4.10.0", "mustache": "4.2.0", - "parse": "4.0.1", - "path-to-regexp": "0.1.7", - "pg-monitor": "1.5.0", - "pg-promise": "10.12.1", + "parse": "4.1.0", + "path-to-regexp": "6.2.1", + "pg-monitor": "2.0.0", + "pg-promise": "11.5.0", "pluralize": "8.0.0", - "redis": "4.0.6", - "semver": "7.3.8", + "rate-limit-redis": "3.0.2", + "redis": "4.6.6", + "semver": "7.5.2", "subscriptions-transport-ws": "0.11.0", "tv4": "1.3.0", "uuid": "9.0.0", - "winston": "3.8.1", + "winston": "3.8.2", "winston-daily-rotate-file": "4.7.1", - "ws": "8.9.0" + "ws": "8.13.0" }, "bin": { "parse-server": "bin/parse-server" @@ -7380,9 +7413,9 @@ } }, "node_modules/parse-server/node_modules/@babel/eslint-parser": { - "version": "7.19.1", - "resolved": "https://registry.npmjs.org/@babel/eslint-parser/-/eslint-parser-7.19.1.tgz", - "integrity": "sha512-AqNf2QWt1rtu2/1rLswy6CDP7H9Oh3mMhk177Y67Rg8d7RD9WfOLLv8CGn6tisFvS2htm86yIe1yLF6I1UDaGQ==", + "version": "7.21.8", + "resolved": "https://registry.npmjs.org/@babel/eslint-parser/-/eslint-parser-7.21.8.tgz", + "integrity": "sha512-HLhI+2q+BP3sf78mFUZNCGc10KEmoUqtUT1OCdMZsN+qr4qFeLUod62/zAnF3jNQstwyasDkZnVXwfK2Bml7MQ==", "dependencies": { "@nicolo-ribaudo/eslint-scope-5-internals": "5.1.1-v1", "eslint-visitor-keys": "^2.1.0", @@ -7397,13 +7430,60 @@ } }, "node_modules/parse-server/node_modules/@babel/eslint-parser/node_modules/semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "bin": { "semver": "bin/semver.js" } }, + "node_modules/parse-server/node_modules/@graphql-tools/merge": { + "version": "8.4.1", + "resolved": "https://registry.npmjs.org/@graphql-tools/merge/-/merge-8.4.1.tgz", + "integrity": "sha512-hssnPpZ818mxgl5+GfyOOSnnflAxiaTn1A1AojZcIbh4J52sS1Q0gSuBR5VrnUDjuxiqoCotpXdAQl+K+U6KLQ==", + "dependencies": { + "@graphql-tools/utils": "^9.2.1", + "tslib": "^2.4.0" + }, + "peerDependencies": { + "graphql": "^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0" + } + }, + "node_modules/parse-server/node_modules/@graphql-tools/merge/node_modules/@graphql-tools/utils": { + "version": "9.2.1", + "resolved": "https://registry.npmjs.org/@graphql-tools/utils/-/utils-9.2.1.tgz", + "integrity": "sha512-WUw506Ql6xzmOORlriNrD6Ugx+HjVgYxt9KCXD9mHAak+eaXSwuGGPyE60hy9xaDEoXKBsG7SkG69ybitaVl6A==", + "dependencies": { + "@graphql-typed-document-node/core": "^3.1.1", + "tslib": "^2.4.0" + }, + "peerDependencies": { + "graphql": "^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0" + } + }, + "node_modules/parse-server/node_modules/body-parser": { + "version": "1.20.2", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.2.tgz", + "integrity": "sha512-ml9pReCu3M61kGlqoTm2umSXTlRTuGTx0bfYj+uIUKKYycG5NtSbeetV3faSU6R7ajOPw0g/J1PvK4qNy7s5bA==", + "dependencies": { + "bytes": "3.1.2", + "content-type": "~1.0.5", + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "1.2.0", + "http-errors": "2.0.0", + "iconv-lite": "0.4.24", + "on-finished": "2.4.1", + "qs": "6.11.0", + "raw-body": "2.5.2", + "type-is": "~1.6.18", + "unpipe": "1.0.0" + }, + "engines": { + "node": ">= 0.8", + "npm": "1.2.8000 || >= 1.4.16" + } + }, "node_modules/parse-server/node_modules/bson": { "version": "4.7.2", "resolved": "https://registry.npmjs.org/bson/-/bson-4.7.2.tgz", @@ -7415,6 +7495,14 @@ "node": ">=6.9.0" } }, + "node_modules/parse-server/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dependencies": { + "ms": "2.0.0" + } + }, "node_modules/parse-server/node_modules/denque": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/denque/-/denque-2.1.0.tgz", @@ -7424,11 +7512,11 @@ } }, "node_modules/parse-server/node_modules/lru-cache": { - "version": "7.12.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.12.0.tgz", - "integrity": "sha512-OIP3DwzRZDfLg9B9VP/huWBlpvbkmbfiBy8xmsXp4RPmE4A3MhwNozc5ZJ3fWnSg8fDcdlE/neRTPG2ycEKliw==", + "version": "9.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-9.1.1.tgz", + "integrity": "sha512-65/Jky17UwSb0BuB9V+MyDpsOtXKmYwzhyl+cOa9XUiI4uV2Ouy/2voFP3+al0BjZbJgMBD8FojMpAf+Z+qn4A==", "engines": { - "node": ">=12" + "node": "14 || >=16.14" } }, "node_modules/parse-server/node_modules/mongodb": { @@ -7448,10 +7536,34 @@ "saslprep": "^1.0.3" } }, + "node_modules/parse-server/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" + }, + "node_modules/parse-server/node_modules/path-to-regexp": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-6.2.1.tgz", + "integrity": "sha512-JLyh7xT1kizaEvcaXOQwOc2/Yhw6KZOvPf1S8401UyLk86CU79LN3vl7ztXGm/pZ+YjoyAJ4rxmHwbkBXJX+yw==" + }, + "node_modules/parse-server/node_modules/raw-body": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.2.tgz", + "integrity": "sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA==", + "dependencies": { + "bytes": "3.1.2", + "http-errors": "2.0.0", + "iconv-lite": "0.4.24", + "unpipe": "1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, "node_modules/parse-server/node_modules/semver": { - "version": "7.3.8", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz", - "integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==", + "version": "7.5.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.2.tgz", + "integrity": "sha512-SoftuTROv/cRjCze/scjGyiDtcUyxw1rgYQSZY7XTmtR5hX+dm76iDbTH8TkLPHCQmlbQVSSbNZCPM2hb0knnQ==", "dependencies": { "lru-cache": "^6.0.0" }, @@ -7482,15 +7594,15 @@ } }, "node_modules/parse-server/node_modules/ws": { - "version": "8.9.0", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.9.0.tgz", - "integrity": "sha512-Ja7nszREasGaYUYCI2k4lCKIRTt+y7XuqVoHR44YpI49TtryyqbqvDMn5eqfW7e6HzTukDRIsXqzVHScqRcafg==", + "version": "8.13.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.13.0.tgz", + "integrity": "sha512-x9vcZYTrFPC7aSIbj7sRCYo7L/Xb8Iy+pW0ng0wt2vCJv7M9HOMy0UoN3rr+IFC7hb7vXoqS+P9ktyLLLhO+LA==", "engines": { "node": ">=10.0.0" }, "peerDependencies": { "bufferutil": "^4.0.1", - "utf-8-validate": "^5.0.2" + "utf-8-validate": ">=5.0.2" }, "peerDependenciesMeta": { "bufferutil": { @@ -7507,12 +7619,11 @@ "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" }, "node_modules/parse/node_modules/uuid": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", - "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", - "deprecated": "Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.", + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.0.tgz", + "integrity": "sha512-MXcSTerfPa4uqyzStbRoTgt5XIe3x5+42+q1sDuy3R5MDk66URdLMOZe5aPX/SQd+kuYAh0FdP/pO28IkQyTeg==", "bin": { - "uuid": "bin/uuid" + "uuid": "dist/bin/uuid" } }, "node_modules/parseurl": { @@ -7591,21 +7702,24 @@ "integrity": "sha512-7EAHlyLHI56VEIdK57uwHdHKIaAGbnXPiw0yWbarQZOKaKpvUIgW0jWRVLiatnM+XXlSwsanIBH/hzGMJulMow==" }, "node_modules/pg": { - "version": "8.8.0", - "resolved": "https://registry.npmjs.org/pg/-/pg-8.8.0.tgz", - "integrity": "sha512-UXYN0ziKj+AeNNP7VDMwrehpACThH7LUl/p8TDFpEUuSejCUIwGSfxpHsPvtM6/WXFy6SU4E5RG4IJV/TZAGjw==", + "version": "8.11.0", + "resolved": "https://registry.npmjs.org/pg/-/pg-8.11.0.tgz", + "integrity": "sha512-meLUVPn2TWgJyLmy7el3fQQVwft4gU5NGyvV0XbD41iU9Jbg8lCH4zexhIkihDzVHJStlt6r088G6/fWeNjhXA==", "dependencies": { "buffer-writer": "2.0.0", "packet-reader": "1.0.0", - "pg-connection-string": "^2.5.0", - "pg-pool": "^3.5.2", - "pg-protocol": "^1.5.0", + "pg-connection-string": "^2.6.0", + "pg-pool": "^3.6.0", + "pg-protocol": "^1.6.0", "pg-types": "^2.1.0", "pgpass": "1.x" }, "engines": { "node": ">= 8.0.0" }, + "optionalDependencies": { + "pg-cloudflare": "^1.1.0" + }, "peerDependencies": { "pg-native": ">=3.0.1" }, @@ -7615,10 +7729,16 @@ } } }, + "node_modules/pg-cloudflare": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/pg-cloudflare/-/pg-cloudflare-1.1.1.tgz", + "integrity": "sha512-xWPagP/4B6BgFO+EKz3JONXv3YDgvkbVrGw2mTo3D6tVDQRh1e7cqVGvyR3BE+eQgAvx1XhW/iEASj4/jCWl3Q==", + "optional": true + }, "node_modules/pg-connection-string": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/pg-connection-string/-/pg-connection-string-2.6.0.tgz", - "integrity": "sha512-x14ibktcwlHKoHxx9X3uTVW9zIGR41ZB6QNhHb21OPNdCCO3NaRnpJuwKIQSR4u+Yqjx4HCvy7Hh7VSy1U4dGg==" + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/pg-connection-string/-/pg-connection-string-2.6.2.tgz", + "integrity": "sha512-ch6OwaeaPYcova4kKZ15sbJ2hKb/VP48ZD2gE7i1J+L4MspCtBMAx8nMgz7bksc7IojCIIWuEhHibSMFH8m8oA==" }, "node_modules/pg-int8": { "version": "1.0.1", @@ -7629,22 +7749,22 @@ } }, "node_modules/pg-minify": { - "version": "1.6.2", - "resolved": "https://registry.npmjs.org/pg-minify/-/pg-minify-1.6.2.tgz", - "integrity": "sha512-1KdmFGGTP6jplJoI8MfvRlfvMiyBivMRP7/ffh4a11RUFJ7kC2J0ZHlipoKiH/1hz+DVgceon9U2qbaHpPeyPg==", + "version": "1.6.3", + "resolved": "https://registry.npmjs.org/pg-minify/-/pg-minify-1.6.3.tgz", + "integrity": "sha512-NoSsPqXxbkD8RIe+peQCqiea4QzXgosdTKY8p7PsbbGsh2F8TifDj/vJxfuR8qJwNYrijdSs7uf0tAe6WOyCsQ==", "engines": { - "node": ">=8.0" + "node": ">=12.0.0" } }, "node_modules/pg-monitor": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/pg-monitor/-/pg-monitor-1.5.0.tgz", - "integrity": "sha512-Zg5RpoYaz0zyRwAQWKrRxUZgzZ+/r4McMP4vEvg+qE8765SHAB1wHZL58uAjocG4WSK/NLP/zZhUuoyurw4l6Q==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/pg-monitor/-/pg-monitor-2.0.0.tgz", + "integrity": "sha512-UqjhroM701sRrJHhXeF1OwNBGxkN9R0YgkVU8A46wWn3RwK/K7QDylChMoDxo8TmGp86CBP4ZSf+RK9vD8XyVA==", "dependencies": { "cli-color": "2.0.3" }, "engines": { - "node": ">=7.6" + "node": ">=14" } }, "node_modules/pg-monitor/node_modules/cli-color": { @@ -7703,25 +7823,25 @@ "integrity": "sha512-+5nt5AAniqsCnu2cEQQdpzCAh33kVx8n0VoFidKpB1dVVLAN/F+bgVOqOJqOnEnrhp222clB5p3vUlD+1QAnfg==" }, "node_modules/pg-pool": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/pg-pool/-/pg-pool-3.6.0.tgz", - "integrity": "sha512-clFRf2ksqd+F497kWFyM21tMjeikn60oGDmqMT8UBrynEwVEX/5R5xd2sdvdo1cZCFlguORNpVuqxIj+aK4cfQ==", + "version": "3.6.1", + "resolved": "https://registry.npmjs.org/pg-pool/-/pg-pool-3.6.1.tgz", + "integrity": "sha512-jizsIzhkIitxCGfPRzJn1ZdcosIt3pz9Sh3V01fm1vZnbnCMgmGl5wvGGdNN2EL9Rmb0EcFoCkixH4Pu+sP9Og==", "peerDependencies": { "pg": ">=8.0" } }, "node_modules/pg-promise": { - "version": "10.12.1", - "resolved": "https://registry.npmjs.org/pg-promise/-/pg-promise-10.12.1.tgz", - "integrity": "sha512-SiJkBUDGq7PNfJFJbWferodsSH+vLrhte0Q0kVgQbwlNYeKmp9Hhkr+357+5DWEuBGOHhSu1UQffSSf5HVqRtA==", + "version": "11.5.0", + "resolved": "https://registry.npmjs.org/pg-promise/-/pg-promise-11.5.0.tgz", + "integrity": "sha512-ZfhntV6Yoc3S0hQWOlEodk5fEmF9ADxKl0vNvBnZgzvLt73uY29wVaNBz2AZK2J0gVmm/zhO51RXPtI4MgKkSQ==", "dependencies": { - "assert-options": "0.7.0", - "pg": "8.8.0", - "pg-minify": "1.6.2", - "spex": "3.2.0" + "assert-options": "0.8.1", + "pg": "8.11.0", + "pg-minify": "1.6.3", + "spex": "3.3.0" }, "engines": { - "node": ">=12.0" + "node": ">=14.0" } }, "node_modules/pg-protocol": { @@ -8082,6 +8202,17 @@ "node": ">= 0.6" } }, + "node_modules/rate-limit-redis": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rate-limit-redis/-/rate-limit-redis-3.0.2.tgz", + "integrity": "sha512-4SBK6AzIr9PKkCF4HmSDcJH2O2KKMF3fZEcsbNMXyaL5I9d6X71uOreUldFRiyrRyP+qkQrTxzJ38ZKKN+sScw==", + "engines": { + "node": ">= 14.5.0" + }, + "peerDependencies": { + "express-rate-limit": "^6" + } + }, "node_modules/raw-body": { "version": "2.5.1", "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.1.tgz", @@ -8145,35 +8276,16 @@ } }, "node_modules/redis": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/redis/-/redis-4.0.6.tgz", - "integrity": "sha512-IaPAxgF5dV0jx+A9l6yd6R9/PAChZIoAskDVRzUODeLDNhsMlq7OLLTmu0AwAr0xjrJ1bibW5xdpRwqIQ8Q0Xg==", + "version": "4.6.6", + "resolved": "https://registry.npmjs.org/redis/-/redis-4.6.6.tgz", + "integrity": "sha512-aLs2fuBFV/VJ28oLBqYykfnhGGkFxvx0HdCEBYdJ99FFbSEMZ7c1nVKwR6ZRv+7bb7JnC0mmCzaqu8frgOYhpA==", "dependencies": { - "@node-redis/bloom": "1.0.1", - "@node-redis/client": "1.0.5", - "@node-redis/graph": "1.0.0", - "@node-redis/json": "1.0.2", - "@node-redis/search": "1.0.5", - "@node-redis/time-series": "1.0.2" - } - }, - "node_modules/redis-errors": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/redis-errors/-/redis-errors-1.2.0.tgz", - "integrity": "sha512-1qny3OExCf0UvUV/5wpYKf2YwPcOqXzkwKKSmKHiE6ZMQs5heeE/c8eXK+PNllPvmjgAbfnsbpkGZWy8cBpn9w==", - "engines": { - "node": ">=4" - } - }, - "node_modules/redis-parser": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/redis-parser/-/redis-parser-3.0.0.tgz", - "integrity": "sha512-DJnGAeenTdpMEH6uAJRK/uiyEIH9WVsUmoLwzudwGJUwZPp80PDBWPHXSAGNPwNvIXAbe7MSUB1zQFugFml66A==", - "dependencies": { - "redis-errors": "^1.0.0" - }, - "engines": { - "node": ">=4" + "@redis/bloom": "1.2.0", + "@redis/client": "1.5.7", + "@redis/graph": "1.1.0", + "@redis/json": "1.0.4", + "@redis/search": "1.1.2", + "@redis/time-series": "1.0.4" } }, "node_modules/regenerator-runtime": { @@ -8737,11 +8849,11 @@ } }, "node_modules/spex": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/spex/-/spex-3.2.0.tgz", - "integrity": "sha512-9srjJM7NaymrpwMHvSmpDeIK5GoRMX/Tq0E8aOlDPS54dDnDUIp30DrP9SphMPEETDLzEM9+4qo+KipmbtPecg==", + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/spex/-/spex-3.3.0.tgz", + "integrity": "sha512-VNiXjFp6R4ldPbVRYbpxlD35yRHceecVXlct1J4/X80KuuPnW2AXMq3sGwhnJOhKkUsOxAT6nRGfGE5pocVw5w==", "engines": { - "node": ">=4.5" + "node": ">=10.0.0" } }, "node_modules/split2": { @@ -9629,10 +9741,11 @@ } }, "node_modules/winston": { - "version": "3.8.1", - "resolved": "https://registry.npmjs.org/winston/-/winston-3.8.1.tgz", - "integrity": "sha512-r+6YAiCR4uI3N8eQNOg8k3P3PqwAm20cLKlzVD9E66Ch39+LZC+VH1UKf9JemQj2B3QoUHfKD7Poewn0Pr3Y1w==", + "version": "3.8.2", + "resolved": "https://registry.npmjs.org/winston/-/winston-3.8.2.tgz", + "integrity": "sha512-MsE1gRx1m5jdTTO9Ld/vND4krP2To+lgDoMEHGGa4HIlAUyXJtfc7CxQcGXVyz2IBpw5hbFkj2b/AtUdQwyRew==", "dependencies": { + "@colors/colors": "1.5.0", "@dabh/diagnostics": "^2.0.2", "async": "^3.2.3", "is-stream": "^2.0.0", @@ -9788,15 +9901,15 @@ } }, "node_modules/ws": { - "version": "8.6.0", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.6.0.tgz", - "integrity": "sha512-AzmM3aH3gk0aX7/rZLYvjdvZooofDu3fFOzGqcSnQ1tOcTWwhM/o+q++E8mAyVVIyUdajrkzWUGftaVSDLn1bw==", + "version": "8.12.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.12.0.tgz", + "integrity": "sha512-kU62emKIdKVeEIOIKVegvqpXMSTAMLJozpHZaJNDYqBjzlSYXQGviYwN1osDLJ9av68qHd4a2oSjd7yD4pacig==", "engines": { "node": ">=10.0.0" }, "peerDependencies": { "bufferutil": "^4.0.1", - "utf-8-validate": "^5.0.2" + "utf-8-validate": ">=5.0.2" }, "peerDependenciesMeta": { "bufferutil": { diff --git a/apps/OpenSignServer/package.json b/apps/OpenSignServer/package.json index 2f79c8e68..8422240ba 100644 --- a/apps/OpenSignServer/package.json +++ b/apps/OpenSignServer/package.json @@ -34,8 +34,8 @@ "node-forge": "^1.3.1", "node-signpdf": "^1.5.1", "openai": "^4.8.0", - "parse": "4.0.1", - "parse-server": "6.0.0", + "parse": "4.1.0", + "parse-server": "6.3.1", "parse-server-api-mail-adapter": "^3.0.0", "parse-server-s3-adapter": "^1.2.0", "pdf-lib": "^1.16.0", From 0a08b742fb7eabadd7e2a79429648df98e055b10 Mon Sep 17 00:00:00 2001 From: rishabjasrotia Date: Wed, 1 Nov 2023 14:57:09 +0530 Subject: [PATCH 10/31] Local Environment and localstack added --- .env.local_dev | 51 ++++++++++++++++++++++++++++++++++++++++++++ Makefile | 2 +- docker-compose.yml | 13 ++++++++++- localstack-script.sh | 6 ++++++ 4 files changed, 70 insertions(+), 2 deletions(-) create mode 100644 .env.local_dev create mode 100644 localstack-script.sh diff --git a/.env.local_dev b/.env.local_dev new file mode 100644 index 000000000..a673c8f0c --- /dev/null +++ b/.env.local_dev @@ -0,0 +1,51 @@ +# Clone the repo and rename this file to .env if you want to run the frontend react app locally for some quick contributions to the project. +# When used as it is, this env config will connect to our hosted UAT backend +# Note that any data in staging will get cleared from time to time and you may have to sign up again and again + +# Set CI to false while running the app locally +CI=false +# Set it to the URL form where the app home page will be accessed +PUBLIC_URL=http://localhost:3000 +# Set it to true if you want to generate the Sourcemap for debugging +GENERATE_SOURCEMAP=false +# Set it to the URL from where APIs will be accessible, for local development it should be localhost:3000/api/app (use your local port number instead) +REACT_APP_SERVERURL=http://localhost:8080/app +# A 12 character long random app identifier. The value of this should be same as APP_ID which is a variable used by backend API. +REACT_APP_APPID=opensignstgn + + +# Backend ExpressJS config **************************************************************************************************************************************************************************************** +# A 12 character long random app identifier. The value of this should be same as REACT_APP_APPID which is a variable used by Frontend React App. +APP_ID=opensignstgn +# Name of the app. It will be visible in the verification emails sent out. +appName=open_sign_server +# A 12 character long random secret key that allows access to all the data. It is used in Parse dashboard config to view all the data in the database. +MASTER_KEY=XnAadwKxxByMr +# Mongodb URI to connect to +MONGODB_URI=mongodb://host.docker.internal:27017 +# Path on which APIs should be mounted. Do not change this. This variable shall be removed & value hardcoded in the source code in coming versions. +PARSE_MOUNT=/app +# Set it to the URL from where APIs will be accessible to the NodeJS functions, for local development it should be localhost:3000/api/app (use your local port number instead) +SERVER_URL=http://127.0.0.1:8080/app + +# Storage config ************************************************************************************************************************************************************************************************ +# LocalStack +DO_SPACE=my-bucket +# LocalStack S3 endpoint for uploading documents +DO_ENDPOINT=s3.localhost.localstack.cloud:4566 +# LocalStack S3 base URL +DO_BASEURL=http://my-bucket.s3.localhost.localstack.cloud:4566 +# LocalStack s3 Access key ID for uploading the docs +DO_ACCESS_KEY_ID= +# LocalStack s3 secret access key for uploading the docs +DO_SECRET_ACCESS_KEY= +# LocalStack s3 region +DO_REGION=eu-central-1 + +# Email mailgun config (The app will not initialize if any of these 3 variables are not set) ********************************************************************************************************************* +MAILGUN_API_KEY=XXXXX +MAILGUN_DOMAIN=mail.yourdomain.com +MAILGUN_SENDER=postmaster@mail.yourdomain.com + +# Base64 encoded PFX or p12 document signing certificate file ********************************************************************************************************************* +PFX_BASE64= diff --git a/Makefile b/Makefile index 726b589ea..35fa55901 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,3 @@ build: - cp .env.frontend_dev .env + cp .env.local_dev .env docker compose up -d \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index 90754579e..ead3af945 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -12,7 +12,7 @@ services: - ./apps/OpenSignServer/:/usr/src/app - /usr/src/app/node_modules ports: - - "5001:5001" + - "8080:8080" depends_on: - mongo env_file: .env @@ -35,6 +35,7 @@ services: image: opensign-image container_name: OpenSign-container command: npm start + env_file: .env volumes: - ./apps/OpenSign/:/usr/app - /usr/app/node_modules @@ -44,6 +45,16 @@ services: - "3000:3000" networks: - app-network + localstack: + image: localstack/localstack:2.0 + ports: + - '4566:4566' # LocalStack endpoint + - '4510-4559:4510-4559' # external services port range + environment: + - DOCKER_HOST=unix:///var/run/docker.sock + volumes: + - ./localstack-script.sh:/etc/localstack/init/ready.d/script.sh + - '/var/run/docker.sock:/var/run/docker.sock' networks: app-network: diff --git a/localstack-script.sh b/localstack-script.sh new file mode 100644 index 000000000..0119cfb82 --- /dev/null +++ b/localstack-script.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +awslocal s3api \ +create-bucket --bucket my-bucket \ +--create-bucket-configuration LocationConstraint=eu-central-1 \ +--region eu-central-1 \ No newline at end of file From 0d82c435f92d38033de1e3d7b2ad79e3733592ac Mon Sep 17 00:00:00 2001 From: rishabjasrotia Date: Wed, 1 Nov 2023 15:10:06 +0530 Subject: [PATCH 11/31] Fix OpenSignServer start problem --- apps/OpenSignServer/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/OpenSignServer/Dockerfile b/apps/OpenSignServer/Dockerfile index 9e2bfbe6c..68962a8be 100644 --- a/apps/OpenSignServer/Dockerfile +++ b/apps/OpenSignServer/Dockerfile @@ -24,4 +24,4 @@ EXPOSE 8080 # ENV DATABASE_URL mongodb://db:27017 # Run the application -CMD ["npm", "start"] +ENTRYPOINT npm start From f3a1a0efa9550a44a5e3b361b2f4e610e33fb83d Mon Sep 17 00:00:00 2001 From: Rishab <33950743+rishabjasrotia@users.noreply.github.com> Date: Thu, 2 Nov 2023 02:28:00 +0000 Subject: [PATCH 12/31] MongoDB Init DB import logic added --- .env.local_dev | 2 +- .../localstack/localstack-script.sh | 0 apps/mongo/Dockerfile | 11 + .../mongo/default-data/legadraGCva._Role.json | 70 ++ .../default-data/legadraGCva._SCHEMA.json | 657 ++++++++++++++++++ .../default-data/legadraGCva.w_appinfo.json | 59 ++ .../default-data/legadraGCva.w_dashboard.json | 104 +++ .../default-data/legadraGCva.w_menu.json | 272 ++++++++ apps/mongo/mongo-init.sh | 17 + docker-compose.yml | 9 +- 10 files changed, 1198 insertions(+), 3 deletions(-) rename localstack-script.sh => apps/localstack/localstack-script.sh (100%) create mode 100644 apps/mongo/Dockerfile create mode 100644 apps/mongo/default-data/legadraGCva._Role.json create mode 100644 apps/mongo/default-data/legadraGCva._SCHEMA.json create mode 100644 apps/mongo/default-data/legadraGCva.w_appinfo.json create mode 100644 apps/mongo/default-data/legadraGCva.w_dashboard.json create mode 100644 apps/mongo/default-data/legadraGCva.w_menu.json create mode 100644 apps/mongo/mongo-init.sh diff --git a/.env.local_dev b/.env.local_dev index a673c8f0c..72249b836 100644 --- a/.env.local_dev +++ b/.env.local_dev @@ -22,7 +22,7 @@ appName=open_sign_server # A 12 character long random secret key that allows access to all the data. It is used in Parse dashboard config to view all the data in the database. MASTER_KEY=XnAadwKxxByMr # Mongodb URI to connect to -MONGODB_URI=mongodb://host.docker.internal:27017 +MONGODB_URI=mongodb://host.docker.internal:27017/OpenSignDB # Path on which APIs should be mounted. Do not change this. This variable shall be removed & value hardcoded in the source code in coming versions. PARSE_MOUNT=/app # Set it to the URL from where APIs will be accessible to the NodeJS functions, for local development it should be localhost:3000/api/app (use your local port number instead) diff --git a/localstack-script.sh b/apps/localstack/localstack-script.sh similarity index 100% rename from localstack-script.sh rename to apps/localstack/localstack-script.sh diff --git a/apps/mongo/Dockerfile b/apps/mongo/Dockerfile new file mode 100644 index 000000000..c8468de0e --- /dev/null +++ b/apps/mongo/Dockerfile @@ -0,0 +1,11 @@ +# Use the official MongoDB imagee +FROM mongo:latest + +# Create a directory to host initialization scripts +RUN mkdir -p /docker-entrypoint-initdb.d + +# Copy default data JSON files to the initialization directory +COPY ./default-data/*.json /docker-entrypoint-initdb.d/ + +# Execute the initialization script during container startup +CMD ["mongod"] \ No newline at end of file diff --git a/apps/mongo/default-data/legadraGCva._Role.json b/apps/mongo/default-data/legadraGCva._Role.json new file mode 100644 index 000000000..4c6406fc9 --- /dev/null +++ b/apps/mongo/default-data/legadraGCva._Role.json @@ -0,0 +1,70 @@ +[{ + "_id": "lpm8ijrwod", + "name": "contracts_Admin", + "_wperm": [ + "*" + ], + "_rperm": [ + "*" + ], + "_acl": { + "*": { + "r": true, + "w": true + } + }, + "_created_at": { + "$date": "2023-09-19T09:25:20.205Z" + }, + "_updated_at": { + "$date": "2023-09-28T09:47:03.968Z" + } + }, + { + "_id": "Bz90QJSYMw", + "name": "contracts_Guest", + "_wperm": [ + "ZhOmhqvw7S" + ], + "_rperm": [ + "*", + "ZhOmhqvw7S" + ], + "_acl": { + "ZhOmhqvw7S": { + "w": true, + "r": true + }, + "*": { + "r": true + } + }, + "_created_at": { + "$date": "2023-10-20T07:56:10.094Z" + }, + "_updated_at": { + "$date": "2023-10-20T10:50:36.229Z" + } + }, + { + "_id": "Tb14x04JK2", + "name": "contracts_User", + "_wperm": [ + "*" + ], + "_rperm": [ + "*" + ], + "_acl": { + "*": { + "r": true, + "w": true + } + }, + "_created_at": { + "$date": "2023-09-19T09:25:20.205Z" + }, + "_updated_at": { + "$date": "2023-10-20T06:54:09.836Z" + } + }] \ No newline at end of file diff --git a/apps/mongo/default-data/legadraGCva._SCHEMA.json b/apps/mongo/default-data/legadraGCva._SCHEMA.json new file mode 100644 index 000000000..a58eae1b0 --- /dev/null +++ b/apps/mongo/default-data/legadraGCva._SCHEMA.json @@ -0,0 +1,657 @@ +[{ + "_id": "_Role", + "objectId": "string", + "updatedAt": "date", + "createdAt": "date", + "name": "string", + "users": "relation<_User>", + "roles": "relation<_Role>", + "_metadata": { + "indexes": { + "name_1": { + "name": 1 + }, + "_id_": { + "_id": 1 + } + }, + "class_permissions": { + "get": { + "*": true + }, + "find": { + "*": true + }, + "count": { + "*": true + }, + "create": { + "*": true + }, + "update": { + "*": true + }, + "delete": { + "*": true + }, + "addField": {}, + "protectedFields": { + "*": [] + } + } + } + }, + { + "_id": "_Session", + "objectId": "string", + "updatedAt": "date", + "createdAt": "date", + "user": "*_User", + "installationId": "string", + "sessionToken": "string", + "expiresAt": "date", + "createdWith": "object", + "_metadata": { + "indexes": { + "_id_": { + "_id": 1 + } + } + } + }, + { + "_id": "_User", + "objectId": "string", + "updatedAt": "date", + "createdAt": "date", + "username": "string", + "email": "string", + "emailVerified": "boolean", + "authData": "object", + "_metadata": { + "indexes": { + "phone_1": { + "phone": 1 + }, + "username_1": { + "username": 1 + }, + "case_insensitive_username": { + "username": 1 + }, + "email_1": { + "email": 1 + }, + "case_insensitive_email": { + "email": 1 + }, + "_id_": { + "_id": 1 + } + }, + "class_permissions": { + "get": { + "*": true + }, + "find": { + "*": true + }, + "count": { + "*": true + }, + "create": { + "*": true + }, + "update": { + "*": true + }, + "delete": { + "*": true + }, + "addField": {}, + "protectedFields": { + "*": [ + "email" + ] + } + } + }, + "name": "string", + "phone": "string", + "ProfilePic": "string" + }, + { + "_id": "contracts_Contactbook", + "objectId": "string", + "updatedAt": "date", + "createdAt": "date", + "Phone": "string", + "Email": "string", + "Name": "string", + "UserRole": "string", + "UserId": "*_User", + "CreatedBy": "*_User", + "_metadata": { + "indexes": { + "_id_": { + "_id": 1 + } + } + }, + "TenantId": "*partners_Tenant", + "TourStatus": "array" + }, + { + "_id": "contracts_Document", + "objectId": "string", + "updatedAt": "date", + "createdAt": "date", + "_metadata": { + "fields_options": { + "EnablePhoneOTP": { + "required": "false" + }, + "IsCompleted": { + "required": "false", + "defaultValue": false + }, + "IsDeclined": { + "required": "false", + "defaultValue": false + }, + "SendinOrder": { + "required": "false", + "defaultValue": false + }, + "ExpiryDate": { + "required": "false" + }, + "Signers": { + "required": "false" + }, + "Name": { + "required": "false" + }, + "AgreementValidUntil": { + "required": "false" + }, + "URL": { + "required": "false" + }, + "RemindOnceInEvery": { + "required": "false", + "defaultValue": 5 + }, + "EnableEmailOTP": { + "required": "false" + }, + "AutomaticReminders": { + "required": "false", + "defaultValue": false + }, + "SentToOthers": { + "required": "false", + "defaultValue": false + }, + "TimeToCompleteDays": { + "required": "false", + "defaultValue": 15 + }, + "Recipients": { + "required": "false" + }, + "Type": { + "required": "false" + }, + "Description": { + "required": "false" + }, + "ExtUserPtr": { + "required": "false" + }, + "SignedUrl": { + "required": "false" + }, + "AuditTrail": { + "required": "false" + }, + "Placeholders": { + "required": "false" + }, + "Folder": { + "required": "false" + }, + "Note": { + "required": false + }, + "Clauses": { + "required": false + }, + "AgreementDelta": { + "required": false + } + }, + "indexes": { + "_id_": { + "_id": 1 + } + }, + "class_permissions": { + "get": { + "*": true + }, + "find": { + "*": true + }, + "count": { + "*": true + }, + "create": { + "*": true + }, + "update": { + "*": true + }, + "delete": { + "*": true + }, + "addField": {}, + "protectedFields": { + "*": [] + } + } + }, + "EnablePhoneOTP": "boolean", + "IsCompleted": "boolean", + "IsDeclined": "boolean", + "SendinOrder": "boolean", + "ExpiryDate": "date", + "Signers": "array", + "Name": "string", + "AgreementValidUntil": "date", + "URL": "string", + "RemindOnceInEvery": "number", + "EnableEmailOTP": "boolean", + "AutomaticReminders": "boolean", + "SentToOthers": "boolean", + "TimeToCompleteDays": "number", + "Recipients": "array", + "Type": "string", + "Description": "string", + "ExtUserPtr": "*contracts_Users", + "SignedUrl": "string", + "AuditTrail": "array", + "Placeholders": "array", + "Folder": "*contracts_Document", + "Note": "string", + "CreatedBy": "*_User", + "Clauses": "array", + "AgreementDelta": "array" + }, + { + "_id": "contracts_Signature", + "objectId": "string", + "updatedAt": "date", + "createdAt": "date", + "_metadata": { + "fields_options": { + "SignatureName": { + "required": "false" + }, + "SignText": { + "required": "false" + }, + "ImageURL": { + "required": "false" + }, + "SignTextFont": { + "required": "false" + }, + "InitialsText": { + "required": "false" + }, + "InitialsFont": { + "required": "false" + }, + "UserId": { + "required": false + } + }, + "indexes": { + "_id_": { + "_id": 1 + } + }, + "class_permissions": { + "get": { + "*": true + }, + "find": { + "*": true + }, + "count": { + "*": true + }, + "create": { + "*": true + }, + "update": { + "*": true + }, + "delete": { + "*": true + }, + "addField": {}, + "protectedFields": { + "*": [] + } + } + }, + "SignatureName": "string", + "SignText": "string", + "ImageURL": "string", + "SignTextFont": "string", + "InitialsText": "string", + "InitialsFont": "string", + "Initials": "string", + "UserId": "*_User" + }, + { + "_id": "contracts_Users", + "objectId": "string", + "updatedAt": "date", + "createdAt": "date", + "_metadata": { + "fields_options": { + "Name": { + "required": "false" + }, + "Phone": { + "required": "false" + }, + "JobTitle": { + "required": "false" + }, + "Email": { + "required": "false" + }, + "Company": { + "required": "false" + }, + "UserId": { + "required": "false" + }, + "TenantId": { + "required": "false" + }, + "TourStatus": { + "required": false + }, + "IsContactEntry": { + "required": false, + "defaultValue": false + }, + "ShareWithTeam": { + "required": false + } + }, + "indexes": { + "_id_": { + "_id": 1 + } + }, + "class_permissions": { + "get": { + "*": true + }, + "find": { + "*": true + }, + "count": { + "*": true + }, + "create": { + "*": true + }, + "update": { + "*": true + }, + "delete": { + "*": true + }, + "addField": {}, + "protectedFields": { + "*": [] + } + } + }, + "Name": "string", + "Phone": "string", + "JobTitle": "string", + "Email": "string", + "Company": "string", + "UserId": "*_User", + "TenantId": "*partners_Tenant", + "TourStatus": "array", + "Plan": "object", + "UserRole": "string", + "Next_billing_date": "date", + "Customer_id": "string", + "Subscription_id": "string", + "CreatedBy": "*_User", + "IsContactEntry": "boolean", + "ShareWithTeam": "boolean" + }, + { + "_id": "partners_DataFiles", + "objectId": "string", + "updatedAt": "date", + "createdAt": "date", + "FileSize": "number", + "FileUrl": "string", + "_metadata": { + "indexes": { + "_id_": { + "_id": 1 + } + } + } + }, + { + "_id": "partners_Subscriptions", + "objectId": "string", + "updatedAt": "date", + "createdAt": "date" + }, + { + "_id": "partners_Tenant", + "objectId": "string", + "updatedAt": "date", + "createdAt": "date", + "EmailAddress": "string", + "TenantName": "string", + "IsActive": "boolean", + "CreatedBy": "*_User", + "ContactNumber": "string", + "UserId": "*_User", + "_metadata": { + "indexes": { + "_id_": { + "_id": 1 + } + } + } + }, + { + "_id": "partners_TenantCredits", + "objectId": "string", + "updatedAt": "date", + "createdAt": "date", + "usedStorage": "number", + "PartnersTenant": "*partners_Tenant", + "_metadata": { + "indexes": { + "_id_": { + "_id": 1 + } + } + } + }, + { + "_id": "w_appinfo", + "objectId": "string", + "updatedAt": "date", + "createdAt": "date", + "orgId": "string", + "forgetpassFormId": "string", + "mainformObjId": "string", + "applogo": "string", + "fbAppId": "string", + "appname": "string", + "loginFormId": "string", + "baseurl": "string", + "org_name": "string", + "signUpFormId": "string", + "defaultmenuid": "string", + "version": "string", + "formTitle": "string", + "googleClietId": "string", + "_metadata": { + "indexes": { + "_id_": { + "_id": 1 + } + }, + "class_permissions": { + "get": { + "*": true + }, + "find": { + "*": true + }, + "count": { + "*": true + }, + "create": { + "*": true + }, + "update": { + "*": true + }, + "delete": { + "*": true + }, + "addField": { + "*": true + } + }, + "fields_options": { + "uploadUrl": { + "required": false + } + } + }, + "class": "string", + "LandingPageId": "string", + "accessType": "string", + "settings": "array", + "appTitle": "string", + "metaDescription": "string", + "branding_image": "string", + "fev_Icon": "string", + "defaultRole": "string", + "results": "array", + "loginType": "string", + "createdBy": "*_User", + "domain": "string", + "enableWebNotification": "boolean", + "allowWhiteLabel": "boolean", + "uploadUrl": "string" + }, + { + "_id": "w_dashboard", + "objectId": "string", + "updatedAt": "date", + "createdAt": "date", + "dbDescription": "string", + "dbTitle": "string", + "bgColor": "string", + "rows": "array", + "_metadata": { + "indexes": { + "_id_": { + "_id": 1 + } + } + }, + "appId": "*w_appinfo" + }, + { + "_id": "w_formV3", + "objectId": "string", + "updatedAt": "date", + "createdAt": "date", + "description": "string", + "uiSchema": "object", + "jsonSchema": "object", + "_metadata": { + "indexes": { + "_id_": { + "_id": 1 + } + } + }, + "class": "string", + "success_message": "string", + "restrict_form_entry": "object", + "send_email": "boolean", + "restrict_form_access": "object", + "email_template": "object", + "form_permission": "string", + "success_redirect": "string", + "form_buttons": "object", + "buttons": "object", + "appId": "*w_appinfo", + "rpTitle": "string", + "rpDescription": "string", + "rpType": "string", + "bgColor": "string", + "rows": "array", + "redirect_id": "string", + "formACL": "object", + "userSchema": "object", + "isRegisterForm": "boolean", + "liveValidate": "boolean", + "noValidate": "boolean", + "validFunction": "string", + "help": "object", + "name": "string", + "phone": "string", + "email": "string", + "password": "string", + "username": "string", + "role": "string", + "helpText": "object", + "helpTextForm": "object", + "hideActionsAfter": "number", + "rules": "array", + "extraActions": "object", + "persistentFields": "array" + }, + { + "_id": "w_menu", + "objectId": "string", + "updatedAt": "date", + "createdAt": "date", + "menuTitle": "string", + "menuType": "string", + "menuItems": "array", + "_metadata": { + "indexes": { + "_id_": { + "_id": 1 + } + } + }, + "appId": "*w_appinfo" + }] \ No newline at end of file diff --git a/apps/mongo/default-data/legadraGCva.w_appinfo.json b/apps/mongo/default-data/legadraGCva.w_appinfo.json new file mode 100644 index 000000000..435a02ac0 --- /dev/null +++ b/apps/mongo/default-data/legadraGCva.w_appinfo.json @@ -0,0 +1,59 @@ +[{ + "_id": "aIPmIvMzGM", + "_created_at": { + "$date": "2023-09-01T08:37:11.830Z" + }, + "_updated_at": { + "$date": "2023-10-20T07:56:08.347Z" + }, + "settings": [ + { + "role": "contracts_User", + "menuId": "H9vRfEYKhT", + "pageType": "dashboard", + "pageId": "35KBoSgoAK", + "extended_class": "contracts_Users" + }, + { + "role": "contracts_Admin", + "menuId": "VPh91h0ZHk", + "pageType": "dashboard", + "pageId": "35KBoSgoAK", + "extended_class": "contracts_Users" + }, + { + "role": "contracts_Guest" + } + ], + "_p_createdBy": "_User$jHp2HBNiNu", + "appname": "contracts", + "version": "0.1", + "googleClietId": "918704711393-thhv3re2pfqvve76tgb86ulu1tlpssrk.apps.googleusercontent.com", + "fbAppId": "1155800517950502", + "baseurl": "https://server3.qik.ai/legadranaxn", + "applogo": "data:image/png;base64,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", + "accessType": "public", + "appTitle": "contracts", + "metaDescription": "The fastest way to sign PDFs & request signatures from others.", + "branding_image": "", + "fev_Icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAAAXNSR0IArs4c6QAAALlJREFUaEPtmN0NwjAMBpNxYDKYiM1Yp90g93CKStH1NbIdfz921Dker2Pc+Js1cDF7MXAxASMGYkAigBI6vh9ZwoXP53uZoAYcvhwdA3mAVbI2aSb+9zFKU4IURB6j/HoPUIEa2G3iGIAhQQDlAUIoE2diabIklISS0NoFPebo77RF6OenEF3QntOm128he0GKrwHyACFoz2MgBqSGkpAEcHs47oHtN5AFakACqMNjQEMoE8SABFCHn4HE2zGHSLeEAAAAAElFTkSuQmCC", + "defaultRole": "contracts_User", + "loginType": "email-pass", + "_acl": { + "role:contracts_appeditor": { + "w": true, + "r": true + }, + "*": { + "r": true + } + }, + "_rperm": [ + "*", + "role:contracts_appeditor" + ], + "_wperm": [ + "role:contracts_appeditor" + ], + "uploadUrl": "https://root.qik.ai/qik_upload" + }] \ No newline at end of file diff --git a/apps/mongo/default-data/legadraGCva.w_dashboard.json b/apps/mongo/default-data/legadraGCva.w_dashboard.json new file mode 100644 index 000000000..3ca1737a5 --- /dev/null +++ b/apps/mongo/default-data/legadraGCva.w_dashboard.json @@ -0,0 +1,104 @@ +[{ + "_id": "35KBoSgoAK", + "rows": [ + { + "columns": [ + { + "colxs": "12", + "colmd": "6", + "collg": "6", + "widget": { + "type": "Card", + "icon": "fas fa-signature", + "bgColor": "#f0058e", + "label": "Need your Signature", + "description": null, + "data": { + "id": "e04ee9dc-932d-6b80-0202-703fd154eb74", + "queryType": "", + "class": "contracts_Document", + "query": "where={\"$and\":[{\"AuditTrail.UserPtr\":{\"$ne\":{\"__type\":\"Pointer\",\"className\": \"contracts_Users\",\"objectId\":\"#objectId#\"}}},{\"AuditTrail.Activity\":{\"$ne\":\"Signed\"}}],\"Signers\":{\"$in\":[{\"__type\":\"Pointer\",\"className\":\"contracts_Users\",\"objectId\":\"#objectId#\"}]},\"IsDeclined\":{\"$ne\":true},\"IsCompleted\":{\"$ne\":true},\"Type\":{\"$ne\":\"Folder\"},\"Placeholders\":{\"$ne\":null},\"ExpiryDate\":{\"#*gt\":{\"__type\":\"#Date#\",\"iso\":\"#today#\"}}}&count=1", + "key": "count", + "Redirect_type": "Report", + "Redirect_id": "4Hhwbp482K", + "tourSection": "tourcard1", + "tourMessage": "This card shows the aggregate count of documents that are awaiting your signature. Clicking on this card will seamlessly take you to the detailed list of such documents for your review and action." + } + } + }, + { + "colxs": "12", + "colmd": "6", + "collg": "6", + "widget": { + "type": "Card", + "icon": "fas fa-sign-out-alt", + "bgColor": "#g0058e", + "label": "Out for signatures", + "description": null, + "data": { + "id": "c1935cc0-28d4-3d73-b72a-8c1e3d18a17f", + "queryType": "", + "class": "contracts_Document", + "query": "where={\"CreatedBy\":{\"__type\":\"Pointer\",\"className\":\"_User\",\"objectId\":\"#UserId.objectId#\"},\"IsCompleted\":{\"$ne\":true},\"IsDeclined\":{\"$ne\":true},\"Type\":{\"$ne\":\"Folder\"},\"Placeholders\":{\"$ne\":null},\"ExpiryDate\":{\"#*gt\":{\"__type\":\"#Date#\",\"iso\":\"#today#\"}}}&count=1", + "key": "count", + "Redirect_type": "Report", + "Redirect_id": "1MwEuxLEkF", + "tourSection": "tourcard2", + "tourMessage": "This card indicates the total number of documents you've sent out for signatures. A single click on this card will navigate you to a comprehensive list of these documents, allowing you to monitor their status." + } + } + }, + { + "colxs": "12", + "colmd": "6", + "collg": "6", + "widget": { + "type": "report", + "reportId": "5Go51Q7T8r", + "data": { + "tourSection": "tourreport1", + "tourMessage": "Here lies a curated list of documents that are pending your signature. These are requests from other users that require your immediate attention for completion." + } + } + }, + { + "colxs": "12", + "colmd": "6", + "collg": "6", + "widget": { + "type": "report", + "reportId": "d9k3UfYHBc", + "data": { + "tourSection": "tourreport2", + "tourMessage": "This area displays all the documents you've dispatched for signatures from other parties. It serves as a real-time tracker for documents pending external approval." + } + } + }, + { + "colxs": "12", + "colmd": "12", + "collg": "12", + "widget": { + "type": "report", + "reportId": "kC5mfynCi4", + "data": { + "tourSection": "tourreport3", + "tourMessage": "In this section, you'll find your draft documents awaiting completion. These are the documents you've initiated but haven't yet finalized for sending." + } + } + } + ] + } + ], + "_p_appId": "w_appinfo$aIPmIvMzGM", + "dbTitle": "Dashboard", + "dbDescription": null, + "bgColor": "#ffffff", + "_created_at": { + "$date": "2023-09-04T13:17:26.707Z" + }, + "_updated_at": { + "$date": "2023-09-27T04:53:20.395Z" + } + }] \ No newline at end of file diff --git a/apps/mongo/default-data/legadraGCva.w_menu.json b/apps/mongo/default-data/legadraGCva.w_menu.json new file mode 100644 index 000000000..034bfb91e --- /dev/null +++ b/apps/mongo/default-data/legadraGCva.w_menu.json @@ -0,0 +1,272 @@ +[{ + "_id": "H9vRfEYKhT", + "_created_at": { + "$date": "2023-09-04T14:04:00.669Z" + }, + "_updated_at": { + "$date": "2023-10-20T06:27:02.314Z" + }, + "_p_appId": "w_appinfo$aIPmIvMzGM", + "menuItems": [ + { + "icon": "fas fa-tachometer-alt", + "title": "Dashboard", + "target": "", + "pageType": "dashboard", + "description": "", + "objectId": "35KBoSgoAK" + }, + { + "icon": "far fa-newspaper", + "title": "New Document", + "target": "_self", + "pageType": null, + "description": null, + "objectId": null, + "children": [ + { + "icon": "fas fa-pen-nib", + "title": "Sign yourself", + "target": "_self", + "pageType": "form", + "description": "", + "objectId": "sHAnZphf69" + }, + { + "icon": "fas fa-file-signature", + "title": "Request signatures", + "target": "_self", + "pageType": "form", + "description": "", + "objectId": "8mZzFxbG1z" + } + ] + }, + { + "icon": "fas fa-folder", + "title": "OpenSignDrive™", + "target": "_self", + "pageType": "mf", + "description": "", + "objectId": "remoteUrl=aHR0cHM6Ly9xaWstYWktb3JnLmdpdGh1Yi5pby9TaWduLU1pY3JvYXBwVjIvcmVtb3RlRW50cnkuanM=&moduleToLoad=AppRoutes&remoteName=signmicroapp/legadrive" + }, + { + "icon": "fas fa-address-card", + "title": "Reports", + "target": "_self", + "pageType": null, + "description": "", + "objectId": null, + "children": [ + { + "icon": "fas fa-signature", + "title": "Need your sign", + "target": "_self", + "pageType": "report", + "description": "", + "objectId": "4Hhwbp482K" + }, + { + "icon": "fas fa-tasks", + "title": "In Progress", + "target": "_self", + "pageType": "report", + "description": "", + "objectId": "1MwEuxLEkF" + }, + { + "icon": "fas fa-check-circle", + "title": "Completed", + "target": "_self", + "pageType": "report", + "description": "", + "objectId": "kQUoW4hUXz" + }, + { + "icon": "fas fa-edit", + "title": "Drafts", + "target": "_self", + "pageType": "report", + "description": "", + "objectId": "ByHuevtCFY" + }, + { + "icon": "fas fa-times-circle", + "title": "Declined", + "target": "_self", + "pageType": "report", + "description": "", + "objectId": "UPr2Fm5WY3" + }, + { + "icon": "fas fa-hourglass-end", + "title": "Expired", + "target": "_self", + "pageType": "report", + "description": "", + "objectId": "zNqBHXHsYH" + } + ] + }, + { + "icon": "fas fa-cog", + "title": "Settings", + "target": "_self", + "pageType": null, + "description": "", + "objectId": null, + "children": [ + { + "icon": "fas fa-pen-fancy", + "title": "My Signature", + "target": "_self", + "pageType": "mf", + "description": "", + "objectId": "remoteUrl=aHR0cHM6Ly9xaWstYWktb3JnLmdpdGh1Yi5pby9TaWduLU1pY3JvYXBwVjIvcmVtb3RlRW50cnkuanM=&moduleToLoad=AppRoutes&remoteName=signmicroapp/managesign" + } + ] + } + ], + "menuTitle": "Default Menu", + "menuType": "Side Menu" + }, + { + "_id": "VPh91h0ZHk", + "_created_at": { + "$date": "2023-09-04T14:16:15.424Z" + }, + "_updated_at": { + "$date": "2023-10-20T06:25:59.660Z" + }, + "_p_appId": "w_appinfo$aIPmIvMzGM", + "menuItems": [ + { + "icon": "fas fa-tachometer-alt", + "title": "Dashboard", + "target": "", + "pageType": "dashboard", + "description": "", + "objectId": "35KBoSgoAK" + }, + { + "icon": "far fa-newspaper", + "title": "New Document", + "target": "_self", + "pageType": null, + "description": null, + "objectId": null, + "children": [ + { + "icon": "fas fa-pen-nib", + "title": "Sign yourself", + "target": "_self", + "pageType": "form", + "description": "", + "objectId": "sHAnZphf69" + }, + { + "icon": "fas fa-file-signature", + "title": "Request signatures", + "target": "_self", + "pageType": "form", + "description": "", + "objectId": "8mZzFxbG1z" + } + ] + }, + { + "icon": "fas fa-folder", + "title": "OpenSignDrive™", + "target": "_self", + "pageType": "mf", + "description": "", + "objectId": "remoteUrl=aHR0cHM6Ly9xaWstYWktb3JnLmdpdGh1Yi5pby9TaWduLU1pY3JvYXBwVjIvcmVtb3RlRW50cnkuanM=&moduleToLoad=AppRoutes&remoteName=signmicroapp/legadrive" + }, + { + "icon": "fas fa-address-card", + "title": "Reports", + "target": "_self", + "pageType": null, + "description": "", + "objectId": null, + "children": [ + { + "icon": "fas fa-signature", + "title": "Need your sign", + "target": "_self", + "pageType": "report", + "description": "", + "objectId": "4Hhwbp482K" + }, + { + "icon": "fas fa-tasks", + "title": "In Progress", + "target": "_self", + "pageType": "report", + "description": "", + "objectId": "1MwEuxLEkF" + }, + { + "icon": "fas fa-check-circle", + "title": "Completed", + "target": "_self", + "pageType": "report", + "description": "", + "objectId": "kQUoW4hUXz" + }, + { + "icon": "fas fa-edit", + "title": "Drafts", + "target": "_self", + "pageType": "report", + "description": "", + "objectId": "ByHuevtCFY" + }, + { + "icon": "fas fa-times-circle", + "title": "Declined", + "target": "_self", + "pageType": "report", + "description": "", + "objectId": "UPr2Fm5WY3" + }, + { + "icon": "fas fa-hourglass-end", + "title": "Expired", + "target": "_self", + "pageType": "report", + "description": "", + "objectId": "zNqBHXHsYH" + } + ] + }, + { + "icon": "fas fa-cog", + "title": "Settings", + "target": "_self", + "pageType": null, + "description": "", + "objectId": null, + "children": [ + { + "icon": "fas fa-pen-fancy", + "title": "My Signature", + "target": "_self", + "pageType": "mf", + "description": "", + "objectId": "remoteUrl=aHR0cHM6Ly9xaWstYWktb3JnLmdpdGh1Yi5pby9TaWduLU1pY3JvYXBwVjIvcmVtb3RlRW50cnkuanM=&moduleToLoad=AppRoutes&remoteName=signmicroapp/managesign" + }, + { + "icon": "far fa-user", + "title": "Add User", + "target": "_self", + "pageType": "form", + "description": "", + "objectId": "lM0xRnM3iE" + } + ] + } + ], + "menuTitle": "Admin Menu", + "menuType": "Side Menu" + }] \ No newline at end of file diff --git a/apps/mongo/mongo-init.sh b/apps/mongo/mongo-init.sh new file mode 100644 index 000000000..ddb4f6d36 --- /dev/null +++ b/apps/mongo/mongo-init.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +echo "Starting MongoDB initial data import..." + +# Wait for MongoDB to fully start +sleep 10 + +# Import the data +mongoimport --host localhost --db OpenSignDB --collection _Role --type json --file /docker-entrypoint-initdb.d/legadraGCva._Role.json --jsonArray +mongoimport --host localhost --db OpenSignDB --collection _SCHEMA --type json --file /docker-entrypoint-initdb.d/legadraGCva._SCHEMA.json --jsonArray +mongoimport --host localhost --db OpenSignDB --collection w_appinfo --type json --file /docker-entrypoint-initdb.d/legadraGCva.w_appinfo.json --jsonArray +mongoimport --host localhost --db OpenSignDB --collection w_dashboard --type json --file /docker-entrypoint-initdb.d/legadraGCva.w_dashboard.json --jsonArray +mongoimport --host localhost --db OpenSignDB --collection w_menu --type json --file /docker-entrypoint-initdb.d/legadraGCva.w_menu.json --jsonArray + + + +echo "MongoDB initial data import done." \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index ead3af945..32306c89f 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -21,9 +21,14 @@ services: networks: - app-network mongo: - image: mongo + build: + context: ./apps/mongo + dockerfile: Dockerfile + container_name: mongo-container + image: opensign-mongo volumes: - data-volume:/data/db + - ./apps/mongo/mongo-init.sh:/docker-entrypoint-initdb.d/mongo-init.sh:ro ports: - "27017:27017" networks: @@ -53,7 +58,7 @@ services: environment: - DOCKER_HOST=unix:///var/run/docker.sock volumes: - - ./localstack-script.sh:/etc/localstack/init/ready.d/script.sh + - .apps/localstack/localstack-script.sh:/etc/localstack/init/ready.d/script.sh - '/var/run/docker.sock:/var/run/docker.sock' networks: From 65c277c9961fc34356195bb469c474719a854980 Mon Sep 17 00:00:00 2001 From: Rishab <33950743+rishabjasrotia@users.noreply.github.com> Date: Thu, 2 Nov 2023 08:03:03 +0530 Subject: [PATCH 13/31] Update docker-compose.yml --- docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index 32306c89f..55a0bd00d 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -58,7 +58,7 @@ services: environment: - DOCKER_HOST=unix:///var/run/docker.sock volumes: - - .apps/localstack/localstack-script.sh:/etc/localstack/init/ready.d/script.sh + - ./apps/localstack/localstack-script.sh:/etc/localstack/init/ready.d/script.sh - '/var/run/docker.sock:/var/run/docker.sock' networks: From 5ccd2bc27d01482578b8d8b3666737ebf7175125 Mon Sep 17 00:00:00 2001 From: Rishab <33950743+rishabjasrotia@users.noreply.github.com> Date: Thu, 2 Nov 2023 08:26:05 +0530 Subject: [PATCH 14/31] Update .env.local_dev --- .env.local_dev | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.env.local_dev b/.env.local_dev index 72249b836..d53a96c88 100644 --- a/.env.local_dev +++ b/.env.local_dev @@ -36,9 +36,9 @@ DO_ENDPOINT=s3.localhost.localstack.cloud:4566 # LocalStack S3 base URL DO_BASEURL=http://my-bucket.s3.localhost.localstack.cloud:4566 # LocalStack s3 Access key ID for uploading the docs -DO_ACCESS_KEY_ID= +DO_ACCESS_KEY_ID=123 # LocalStack s3 secret access key for uploading the docs -DO_SECRET_ACCESS_KEY= +DO_SECRET_ACCESS_KEY=xyz # LocalStack s3 region DO_REGION=eu-central-1 From 72af4d979f991ff34691140a70de257d823c9cc6 Mon Sep 17 00:00:00 2001 From: Rishab <33950743+rishabjasrotia@users.noreply.github.com> Date: Thu, 2 Nov 2023 12:47:42 +0000 Subject: [PATCH 15/31] LocalStack Removed due to DNS issue --- apps/OpenSignServer/index.js | 34 ++++++++++++++++++++------------ apps/OpenSignServer/package.json | 1 + docker-compose.yml | 10 ---------- 3 files changed, 22 insertions(+), 23 deletions(-) diff --git a/apps/OpenSignServer/index.js b/apps/OpenSignServer/index.js index 47f83dd38..f0d494c44 100644 --- a/apps/OpenSignServer/index.js +++ b/apps/OpenSignServer/index.js @@ -14,23 +14,31 @@ import formData from 'form-data'; import Mailgun from 'mailgun.js'; import { ApiPayloadConverter } from 'parse-server-api-mail-adapter'; import S3Adapter from 'parse-server-s3-adapter'; +import FSFilesAdapter from 'parse-server-fs-adapter'; import AWS from 'aws-sdk'; import { app as customRoute } from './cloud/customRoute/customApp.js'; const spacesEndpoint = new AWS.Endpoint(process.env.DO_ENDPOINT); // console.log("configuration ", configuration); -const s3Options = { - bucket: process.env.DO_SPACE, // globalConfig.S3FilesAdapter.bucket, - baseUrl: process.env.DO_BASEURL, - region: process.env.DO_REGION, - directAccess: true, - preserveFileName: true, - s3overrides: { - accessKeyId: process.env.DO_ACCESS_KEY_ID, - secretAccessKey: process.env.DO_SECRET_ACCESS_KEY, - endpoint: spacesEndpoint, - }, -}; +if (process.env.USE_LOCAL !== "TRUE") { + const s3Options = { + bucket: process.env.DO_SPACE, // globalConfig.S3FilesAdapter.bucket, + baseUrl: process.env.DO_BASEURL, + region: process.env.DO_REGION, + directAccess: true, + preserveFileName: true, + s3overrides: { + accessKeyId: process.env.DO_ACCESS_KEY_ID, + secretAccessKey: process.env.DO_SECRET_ACCESS_KEY, + endpoint: spacesEndpoint, + }, + }; + var fsAdapter = new S3Adapter(s3Options); +} else { + var fsAdapter = new FSFilesAdapter({ + "filesSubDirectory": "files" // optional, defaults to ./files + }); +} let mailgunClient; let mailgunDomain; @@ -85,7 +93,7 @@ export const config = { }, } : null, - filesAdapter: new S3Adapter(s3Options), + filesAdapter: fsAdapter, auth: { google: { enabled: true, diff --git a/apps/OpenSignServer/package.json b/apps/OpenSignServer/package.json index 8422240ba..50292ad43 100644 --- a/apps/OpenSignServer/package.json +++ b/apps/OpenSignServer/package.json @@ -38,6 +38,7 @@ "parse-server": "6.3.1", "parse-server-api-mail-adapter": "^3.0.0", "parse-server-s3-adapter": "^1.2.0", + "parse-server-fs-adapter": "1.0.1", "pdf-lib": "^1.16.0", "pdfkit": "^0.13.0", "razorpay": "^2.8.6", diff --git a/docker-compose.yml b/docker-compose.yml index 55a0bd00d..60f894895 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -50,16 +50,6 @@ services: - "3000:3000" networks: - app-network - localstack: - image: localstack/localstack:2.0 - ports: - - '4566:4566' # LocalStack endpoint - - '4510-4559:4510-4559' # external services port range - environment: - - DOCKER_HOST=unix:///var/run/docker.sock - volumes: - - ./apps/localstack/localstack-script.sh:/etc/localstack/init/ready.d/script.sh - - '/var/run/docker.sock:/var/run/docker.sock' networks: app-network: From 3d744bd47630ac7c9f40fb4ddc590a615d1d9057 Mon Sep 17 00:00:00 2001 From: Rishab <33950743+rishabjasrotia@users.noreply.github.com> Date: Thu, 2 Nov 2023 18:23:36 +0530 Subject: [PATCH 16/31] Update .env.local_dev --- .env.local_dev | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/.env.local_dev b/.env.local_dev index d53a96c88..7d0a4a251 100644 --- a/.env.local_dev +++ b/.env.local_dev @@ -29,18 +29,20 @@ PARSE_MOUNT=/app SERVER_URL=http://127.0.0.1:8080/app # Storage config ************************************************************************************************************************************************************************************************ -# LocalStack -DO_SPACE=my-bucket -# LocalStack S3 endpoint for uploading documents -DO_ENDPOINT=s3.localhost.localstack.cloud:4566 -# LocalStack S3 base URL -DO_BASEURL=http://my-bucket.s3.localhost.localstack.cloud:4566 -# LocalStack s3 Access key ID for uploading the docs -DO_ACCESS_KEY_ID=123 -# LocalStack s3 secret access key for uploading the docs -DO_SECRET_ACCESS_KEY=xyz -# LocalStack s3 region -DO_REGION=eu-central-1 +# Digital ocean space name or AWS S3 bucket name for uploading documents +DO_SPACE=DOSPACENAME +# Digital ocean spaces endpoint or AWS S3 endpoint for uploading documents +DO_ENDPOINT=ams3.digitaloceanspaces.com +# Digital ocean baseurl or AWS S3 base URL +DO_BASEURL=https://DOSPACENAME.ams3.digitaloceanspaces.com +# Digital ocean spaces access key ID or AWS s3 Access key ID for uploading the docs +DO_ACCESS_KEY_ID= +# Digital ocean spaces secret access key or AWS s3 secret access key for uploading the docs +DO_SECRET_ACCESS_KEY= +# Digital ocean spaces region or AWS s3 region +DO_REGION=us-west +# local storage +USE_LOCAL=TRUE # Email mailgun config (The app will not initialize if any of these 3 variables are not set) ********************************************************************************************************************* MAILGUN_API_KEY=XXXXX From 826da6cda67f73433d1e0b09e91bc05840e9fc23 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Fri, 3 Nov 2023 09:43:19 +0000 Subject: [PATCH 17/31] docs: update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 1420d4cf5..4c97acbe2 100644 --- a/README.md +++ b/README.md @@ -122,6 +122,7 @@ We would like to thank all our contributors and users for their support and feed VishakhaSainani
VishakhaSainani

💻 Andrew
Andrew

💻 + Rishab
Rishab

💻 From 8d6251538356f8b21371622233144469234919bf Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Fri, 3 Nov 2023 09:43:20 +0000 Subject: [PATCH 18/31] docs: update .all-contributorsrc --- .all-contributorsrc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.all-contributorsrc b/.all-contributorsrc index 94a854af3..8dd14ebc1 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -151,6 +151,15 @@ "contributions": [ "code" ] + }, + { + "login": "rishabjasrotia", + "name": "Rishab", + "avatar_url": "https://avatars.githubusercontent.com/u/33950743?v=4", + "profile": "https://github.com/rishabjasrotia", + "contributions": [ + "code" + ] } ] } From 1c81e9e9e81614374642e5090996d0b958bf123e Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Fri, 3 Nov 2023 11:02:10 +0000 Subject: [PATCH 19/31] docs: update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 4c97acbe2..c2a7d86ea 100644 --- a/README.md +++ b/README.md @@ -123,6 +123,7 @@ We would like to thank all our contributors and users for their support and feed VishakhaSainani
VishakhaSainani

💻 Andrew
Andrew

💻 Rishab
Rishab

💻 + Maurizio Pillitu
Maurizio Pillitu

🐛 From b5830ac7929ad83535c79d65719eab1e0711d829 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Fri, 3 Nov 2023 11:02:11 +0000 Subject: [PATCH 20/31] docs: update .all-contributorsrc --- .all-contributorsrc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.all-contributorsrc b/.all-contributorsrc index 8dd14ebc1..f1976eec6 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -160,6 +160,15 @@ "contributions": [ "code" ] + }, + { + "login": "maoo", + "name": "Maurizio Pillitu", + "avatar_url": "https://avatars.githubusercontent.com/u/327285?v=4", + "profile": "https://session.it", + "contributions": [ + "bug" + ] } ] } From c684d00bdf11038a8e7ea1a8d1ca87e2a947c5f5 Mon Sep 17 00:00:00 2001 From: prafull-opensignlabs Date: Fri, 3 Nov 2023 17:11:09 +0530 Subject: [PATCH 21/31] integrate microapp code in monorepo --- apps/OpenSign/package.json | 4 ++-- apps/OpenSign/src/components/ReportMicroapp.js | 8 +++++--- apps/OpenSign/src/routes/RemoteApp.js | 4 +++- microfrontends/SignDocuments/package.json | 2 +- 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/apps/OpenSign/package.json b/apps/OpenSign/package.json index db8651125..b66a18ca9 100644 --- a/apps/OpenSign/package.json +++ b/apps/OpenSign/package.json @@ -41,7 +41,7 @@ }, "scripts": { "start": "mf-cra start", - "build": "npm run micro && CI=false && mf-cra build", + "build": "rm -rf public/mfbuild/* && npm run micro && CI=false && mf-cra build", "micro": "cd ../../microfrontends/SignDocuments && npm install && npm run build", "test": "react-scripts test", "eject": "react-scripts eject", @@ -84,4 +84,4 @@ "pretty-quick": "^3.1.3", "tailwindcss": "^3.3.3" } -} +} \ No newline at end of file diff --git a/apps/OpenSign/src/components/ReportMicroapp.js b/apps/OpenSign/src/components/ReportMicroapp.js index b0be8c1d8..37864ca99 100644 --- a/apps/OpenSign/src/components/ReportMicroapp.js +++ b/apps/OpenSign/src/components/ReportMicroapp.js @@ -15,7 +15,9 @@ const MicroappModal = () => { // console.log("value ", key + ":" + value); if (key === "remoteUrl") { - obj = { ...obj, [key]: atob(value) }; + const url = window.location.origin + "/mfbuild/remoteEntry.js"; + // console.log("atob(value) ", atob(value)) + obj = { ...obj, [key]: url }; } else { if (key === "moduleToLoad") { obj = { ...obj, [key]: "./" + value }; @@ -45,9 +47,9 @@ const MicroappModal = () => { > Back - {localStorage.getItem('domain') && ( + {localStorage.getItem("domain") && (

- {localStorage.getItem('domain') === "contracts" ? "Document":""} + {localStorage.getItem("domain") === "contracts" ? "Document" : ""}

)} diff --git a/apps/OpenSign/src/routes/RemoteApp.js b/apps/OpenSign/src/routes/RemoteApp.js index 16d1afc71..08c2943c0 100644 --- a/apps/OpenSign/src/routes/RemoteApp.js +++ b/apps/OpenSign/src/routes/RemoteApp.js @@ -65,7 +65,9 @@ export default function RemoteAppContainer() { // console.log("value ", key + ":" + value); if (key === "remoteUrl") { - obj = { ...obj, [key]: atob(value) }; + const url = window.location.origin + "/mfbuild/remoteEntry.js"; + // console.log("atob(value) ", atob(value)) + obj = { ...obj, [key]: url }; } else { if (key === "moduleToLoad") { obj = { ...obj, [key]: "./" + value }; diff --git a/microfrontends/SignDocuments/package.json b/microfrontends/SignDocuments/package.json index a420d32b2..348d629eb 100644 --- a/microfrontends/SignDocuments/package.json +++ b/microfrontends/SignDocuments/package.json @@ -35,7 +35,7 @@ }, "scripts": { "start": "mf-cra start", - "build": "CI=false && mf-cra build && mv build ../../apps/OpenSign/public/mfbuild", + "build": "CI=false && mf-cra build && mv build/* ../../apps/OpenSign/public/mfbuild", "test": "react-scripts test", "eject": "react-scripts eject" }, From b034cfd50180e8b6220e449512f7b163cefeac6a Mon Sep 17 00:00:00 2001 From: prafull-opensignlabs Date: Fri, 3 Nov 2023 17:26:20 +0530 Subject: [PATCH 22/31] add mfbuild folder to store microapp build --- apps/OpenSign/public/mfbuild/.gitkeep | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 apps/OpenSign/public/mfbuild/.gitkeep diff --git a/apps/OpenSign/public/mfbuild/.gitkeep b/apps/OpenSign/public/mfbuild/.gitkeep new file mode 100644 index 000000000..e69de29bb From a64e4d943ada71e29c8708557ea9a3aadcb90d2a Mon Sep 17 00:00:00 2001 From: prafull-opensignlabs Date: Fri, 3 Nov 2023 19:53:12 +0530 Subject: [PATCH 23/31] change build scripts to run microfrontend properly --- apps/OpenSign/package.json | 2 +- microfrontends/SignDocuments/.gitignore | 2 +- microfrontends/SignDocuments/package.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/OpenSign/package.json b/apps/OpenSign/package.json index b66a18ca9..7d3fb2b3d 100644 --- a/apps/OpenSign/package.json +++ b/apps/OpenSign/package.json @@ -41,7 +41,7 @@ }, "scripts": { "start": "mf-cra start", - "build": "rm -rf public/mfbuild/* && npm run micro && CI=false && mf-cra build", + "build": "rm -rf public/mfbuild && npm run micro && CI=false && mf-cra build", "micro": "cd ../../microfrontends/SignDocuments && npm install && npm run build", "test": "react-scripts test", "eject": "react-scripts eject", diff --git a/microfrontends/SignDocuments/.gitignore b/microfrontends/SignDocuments/.gitignore index 4d29575de..944d54495 100644 --- a/microfrontends/SignDocuments/.gitignore +++ b/microfrontends/SignDocuments/.gitignore @@ -9,7 +9,7 @@ /coverage # production -/build +/mfbuild # misc .DS_Store diff --git a/microfrontends/SignDocuments/package.json b/microfrontends/SignDocuments/package.json index 348d629eb..3c8e28903 100644 --- a/microfrontends/SignDocuments/package.json +++ b/microfrontends/SignDocuments/package.json @@ -35,7 +35,7 @@ }, "scripts": { "start": "mf-cra start", - "build": "CI=false && mf-cra build && mv build/* ../../apps/OpenSign/public/mfbuild", + "build": "CI=false && BUILD_PATH='./mfbuild' mf-cra build && mv mfbuild ../../apps/OpenSign/public", "test": "react-scripts test", "eject": "react-scripts eject" }, From 86a4ee7f56de12d75c5c765b127e1413e633a637 Mon Sep 17 00:00:00 2001 From: prafull-opensignlabs Date: Fri, 3 Nov 2023 19:59:37 +0530 Subject: [PATCH 24/31] add start-prod to run production build --- apps/OpenSign/package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/OpenSign/package.json b/apps/OpenSign/package.json index 7d3fb2b3d..0b354b9c7 100644 --- a/apps/OpenSign/package.json +++ b/apps/OpenSign/package.json @@ -41,6 +41,7 @@ }, "scripts": { "start": "mf-cra start", + "start-prod": "serve -s build", "build": "rm -rf public/mfbuild && npm run micro && CI=false && mf-cra build", "micro": "cd ../../microfrontends/SignDocuments && npm install && npm run build", "test": "react-scripts test", From fc2eab7d73605a95d0c2384f38fecb7948deb0ce Mon Sep 17 00:00:00 2001 From: RaktimaNXG Date: Fri, 3 Nov 2023 21:46:18 +0530 Subject: [PATCH 25/31] handled placeholder from all devices, remove underline from certificate,login page style,solved reactour issue for document owner from login flow, need your sign reports finish button issue,remove commented code, delete button(cross) on email documents popup issue and solve some minor design issue --- .../src/Component/Certificate/Certificate.js | 69 +- .../src/Component/DraftDocument.js | 9 +- .../SignDocuments/src/Component/ManageSign.js | 9 +- .../src/Component/PdfRequestFiles.js | 216 ++- .../src/Component/SignYourselfPdf.js | 98 +- .../Component/component/defaultSignature.js | 56 +- .../src/Component/component/emailComponent.js | 110 +- .../Component/component/fieldsComponent.js | 13 +- .../src/Component/component/header.js | 234 +-- .../src/Component/component/renderPdf.js | 219 ++- .../SignDocuments/src/Component/login.js | 280 ++- .../src/Component/placeHolderSign.js | 146 +- .../src/Component/recipientSignPdf.js | 316 ++-- .../SignDocuments/src/css/LoginPage.css | 71 +- .../SignDocuments/src/css/signature.css | 1519 +++++++++-------- .../SignDocuments/src/utils/Utils.js | 54 +- 16 files changed, 1708 insertions(+), 1711 deletions(-) diff --git a/microfrontends/SignDocuments/src/Component/Certificate/Certificate.js b/microfrontends/SignDocuments/src/Component/Certificate/Certificate.js index 28d193793..5df07d5f5 100644 --- a/microfrontends/SignDocuments/src/Component/Certificate/Certificate.js +++ b/microfrontends/SignDocuments/src/Component/Certificate/Certificate.js @@ -33,23 +33,23 @@ function Certificate({ pdfData }) { page: { borderRadius: "5px", padding: "10px", - backgroundColor: "white", + backgroundColor: "white" }, section1: { border: "1px solid rgb(177, 174, 174)", - padding: "20px", + padding: "20px" }, textStyle: { fontWeight: "bold", fontSize: "11px", - marginBottom: "10px", + marginBottom: "10px" }, textStyle2: { fontWeight: "600", fontSize: "11px", marginBottom: "10px", - color: "gray", - }, + color: "gray" + } }); const generatedDate = () => { @@ -57,7 +57,7 @@ function Certificate({ pdfData }) { const localExpireDate = newDate.toLocaleDateString("en-US", { day: "numeric", month: "long", - year: "numeric", + year: "numeric" }); var currentOffset = newDate.getTimezoneOffset(); @@ -79,7 +79,7 @@ function Certificate({ pdfData }) { textAlign: "right", color: "gray", fontSize: "10px", - marginBottom: "30px", + marginBottom: "30px" }} > Generated On {localExpireDate} {hoursIST}:{minutesIST} IST @@ -92,7 +92,7 @@ function Certificate({ pdfData }) { const localExpireDate = newDate.toLocaleDateString("en-US", { day: "numeric", month: "long", - year: "numeric", + year: "numeric" }); var currentOffset = newDate.getTimezoneOffset(); @@ -136,7 +136,7 @@ function Certificate({ pdfData }) { ) ); }; - + return ( isLoad && ( @@ -151,7 +151,7 @@ function Certificate({ pdfData }) { fontSize: "20px", fontWeight: "bold", color: "#31bceb", - marginBottom: "10px", + marginBottom: "10px" }} > {" "} @@ -165,7 +165,7 @@ function Certificate({ pdfData }) { fontSize: "16px", fontWeight: "bold", color: "#31bceb", - margin: "10px 0px 10px 0px", + margin: "10px 0px 10px 0px" }} > Summary @@ -203,36 +203,40 @@ function Certificate({ pdfData }) { fontSize: "16px", fontWeight: "bold", color: "#31bceb", - margin: "10px 0px 10px 0px", + margin: "10px 0px 10px 0px" }} > Recipients - {multiSigner && multiSigner.map((data, ind) => { - return ( - + {multiSigner && + multiSigner.map((data, ind) => { + return ( - {signerName(data)} + > + + {signerName(data)} - - Accessed from :   - - {data.ipAddress} + + Accessed from :   + + {data.ipAddress} + - - - ); - })} + + ); + })} ) : ( @@ -242,7 +246,7 @@ function Certificate({ pdfData }) { fontSize: "16px", fontWeight: "bold", color: "#31bceb", - margin: "10px 0px 10px 0px", + margin: "10px 0px 10px 0px" }} > Recipients @@ -259,7 +263,8 @@ function Certificate({ pdfData }) { Accessed from :   - {pdfData[0].AuditTrail && pdfData[0].AuditTrail[0].ipAddress} + {pdfData[0].AuditTrail && + pdfData[0].AuditTrail[0].ipAddress} diff --git a/microfrontends/SignDocuments/src/Component/DraftDocument.js b/microfrontends/SignDocuments/src/Component/DraftDocument.js index 6534c1ddb..79806a94e 100644 --- a/microfrontends/SignDocuments/src/Component/DraftDocument.js +++ b/microfrontends/SignDocuments/src/Component/DraftDocument.js @@ -42,7 +42,7 @@ function DraftDocument() { .then((Listdata) => { const json = Listdata.data; const res = json.results; - // console.log("res", res); + if (res[0] && res.length > 0) { setPdfDetails(res); const loadObj = { @@ -74,20 +74,16 @@ function DraftDocument() { //checking document is completed and signer exist then navigate to pdfRequestFiles file if (data.IsCompleted && checkSignerExist) { - // window.location.hash = `/pdfRequestFiles`; - - navigate(`${hostUrl}pdfRequestFiles`); + navigate(`${hostUrl}pdfRequestFiles`); } //checking document is completed and signer does not exist then navigate to recipientSignPdf file else if (data.IsCompleted && !checkSignerExist) { - // window.location.hash = `/recipientSignPdf/${data.objectId}/${data.ExtUserPtr.Phone}`; navigate( `${hostUrl}signaturePdf` ); } //checking document is declined by someone then navigate to pdfRequestFiles file else if (isDecline) { - // window.location.hash = `/pdfRequestFiles`; navigate(`${hostUrl}pdfRequestFiles`); } //checking document has expired and signers exist and placeholder does not set yet then navigate to pdfRequestFiles file @@ -97,7 +93,6 @@ function DraftDocument() { checkSignerExist && !isPlaceholder ) { - // window.location.hash = `/placeHolderSign`; navigate(`${hostUrl}placeHolderSign`); } //checking document has expired and signers does not exist and document not signed yet then navigate to pdfRequestFiles file diff --git a/microfrontends/SignDocuments/src/Component/ManageSign.js b/microfrontends/SignDocuments/src/Component/ManageSign.js index 3fbd113db..e6b110f4e 100644 --- a/microfrontends/SignDocuments/src/Component/ManageSign.js +++ b/microfrontends/SignDocuments/src/Component/ManageSign.js @@ -8,7 +8,7 @@ import "../css/signature.css"; import axios from "axios"; import { toDataUrl } from "../utils/toDataUrl"; -// console.log("appName ", appName) + const ManageSign = () => { let appName; const [penColor, setPenColor] = useState("blue"); @@ -68,7 +68,6 @@ const ManageSign = () => { if (res.data.results.length > 0) { setId(res.data.results[0].objectId); setSignName(res.data.results[0].SignatureName); - // console.log(res.data.results[0].ImageURL); setImage(res.data.results[0].ImageURL); if (res.data.results[0] && res.data.results[0].Initials) { setInitials(res.data.results[0].Initials); @@ -143,7 +142,7 @@ const ManageSign = () => { if (!signName) { setNameWarning(true); - // setTimeout(() => setNameWarning(false), 1000); + } else if (!isvalue) { setWarning(true); setTimeout(() => setWarning(false), 1000); @@ -337,12 +336,8 @@ const ManageSign = () => {
diff --git a/microfrontends/SignDocuments/src/Component/PdfRequestFiles.js b/microfrontends/SignDocuments/src/Component/PdfRequestFiles.js index f9ff8662e..012f4e347 100644 --- a/microfrontends/SignDocuments/src/Component/PdfRequestFiles.js +++ b/microfrontends/SignDocuments/src/Component/PdfRequestFiles.js @@ -12,8 +12,6 @@ import { useParams } from "react-router-dom"; import SignPad from "./component/signPad"; import RenderAllPdfPage from "./component/renderAllPdfPage"; import { - contactBook, - contractUsers, getBase64FromIMG, getBase64FromUrl } from "../utils/Utils"; @@ -65,6 +63,7 @@ function PdfRequestFiles() { }); const [isSigned, setIsSigned] = useState(false); const [isExpired, setIsExpired] = useState(false); + const [alreadySign, setAlreadySign] = useState(false); const rowLevel = localStorage.getItem("rowlevel") && @@ -89,6 +88,7 @@ function PdfRequestFiles() { const clientWidth = window.innerWidth; const value = docId ? 80 : 30; const pdfWidth = clientWidth - 160 - 200 - value; + //160 is width of left side, 200 is width of right side component and 50 is space of middle compoent //pdf from left and right component setPdfNewWidth(pdfWidth); @@ -99,27 +99,6 @@ function PdfRequestFiles() { //function for get document details for perticular signer with signer'object id const getDocumentDetails = async () => { - const contractUsersRes = await contractUsers(jsonSender.objectId); - - if (contractUsersRes && contractUsersRes[0]) { - const objId = contractUsersRes[0].objectId; - - setSignerObjectId(objId); - } else if (contractUsersRes === "Error: Something went wrong!") { - const loadObj = { - isLoad: false - }; - setHandleError("Error: Something went wrong!"); - setIsLoading(loadObj); - } else if (contractUsersRes.length === 0) { - const contractContactBook = await contactBook(jsonSender.objectId); - if (contractContactBook && contractContactBook[0]) { - const objId = contractUsersRes[0].objectId; - - setSignerObjectId(objId); - } - } - await axios .get( `${localStorage.getItem("baseUrl")}classes/${localStorage.getItem( @@ -136,13 +115,24 @@ function PdfRequestFiles() { .then((Listdata) => { const json = Listdata.data; const res = json.results; - // console.log("res", res); + if (res[0] && res.length > 0) { const isCompleted = res[0].IsCompleted && res[0].IsCompleted; const expireDate = res[0].ExpiryDate.iso; const declined = res[0].IsDeclined && res[0].IsDeclined; const expireUpdateDate = new Date(expireDate).getTime(); const currDate = new Date().getTime(); + const getSigners = res[0].Signers; + const getCurrentSigner = + getSigners && + getSigners.filter( + (data) => data.UserId.objectId === jsonSender.objectId + ); + + const currUserId = getCurrentSigner[0] + ? getCurrentSigner[0].objectId + : ""; + setSignerObjectId(currUserId); if (res[0].SignedUrl) { setPdfUrl(res[0].SignedUrl); } else { @@ -154,6 +144,7 @@ function PdfRequestFiles() { isCertificate: true, isModal: true }; + setAlreadySign(true); setIsCompleted(data); } else if (declined) { const currentDecline = { @@ -173,17 +164,34 @@ function PdfRequestFiles() { (data) => data.Activity === "Signed" ); + const checkAlreadySign = + json.results[0].AuditTrail && + json.results[0].AuditTrail.length > 0 && + json.results[0].AuditTrail.filter( + (data) => + data.UserPtr.objectId === currUserId && + data.Activity === "Signed" + ); + if ( + checkAlreadySign && + checkAlreadySign[0] && + checkAlreadySign.length > 0 + ) { + setAlreadySign(true); + } + let signers = []; let unSignedSigner = []; //check document is signed or not if (checkDocIdExist && checkDocIdExist.length > 0) { + setAlreadySign(true); setIsDocId(true); const signerRes = res[0].Signers; //comparison auditTrail user details with signers user details for (let i = 0; i < signerRes.length; i++) { const signerId = signerRes[i].objectId; - // console.log("getSigner", getSigner); + let isSigned = false; for (let j = 0; j < checkDocIdExist.length; j++) { const signedExist = @@ -192,7 +200,6 @@ function PdfRequestFiles() { // if match then add signed data in signer array and break loop if (signerId === signedExist) { - // console.log("signedExist", signedExist); signers.push({ ...signerRes[i], ...signerRes[i] }); isSigned = true; break; @@ -202,8 +209,6 @@ function PdfRequestFiles() { if (!isSigned) { unSignedSigner.push({ ...signerRes[i], ...signerRes[i] }); } - - // console.log("check Signers status",signers,unSignedSigner) } setSignedSigners(signers); setUnSignedSigners(unSignedSigner); @@ -211,7 +216,6 @@ function PdfRequestFiles() { setSignerPos(res[0].Placeholders); } else { let unsigned = []; - // console.log("else condition"); for (let i = 0; i < res.length; i++) { unsigned.push(res[i].Signers); } @@ -226,7 +230,6 @@ function PdfRequestFiles() { alert("No data found!"); } } else { - // alert("No data found!"); setNoData(true); const loadObj = { isLoad: false @@ -279,7 +282,6 @@ function PdfRequestFiles() { }); }; - // console.log("signer", signerPos, unsignedSigners, isCompleted); //function for embed signature or image url in pdf async function embedImages() { const checkUser = signerPos.filter( @@ -320,7 +322,6 @@ function PdfRequestFiles() { //checking if signature is only one then send image url in jpeg formate to server if (pngUrl.length === 1 && pngUrl[0].pos.length === 1) { - // console.log("else condition"); if (isDocId) { pdfBase64 = await getBase64FromUrl(url); } else { @@ -330,7 +331,7 @@ function PdfRequestFiles() { const fontSize = 10; const textContent = documentId && `OpenSign™ DocumentId: ${documentId}`; - // console.log("textcontent", documentId); + const pages = pdfDoc.getPages(); const page = pages[i]; @@ -472,10 +473,54 @@ function PdfRequestFiles() { const imgWidth = imgUrlList[id].Width ? imgUrlList[id].Width : 150; - + const isMobile = window.innerWidth < 767; + const newWidth = window.innerWidth; + const scale = isMobile ? pdfOriginalWidth / newWidth : 1; + const xPos = (pos) => { + //checking both condition mobile and desktop view + if (isMobile) { + //if pos.isMobile false -- placeholder saved from desktop view then handle position in mobile view divided by scale + if (pos.isMobile) { + const x = pos.xPosition * (pos.scale / scale); + return x * scale + 50; + } else { + const x = pos.xPosition / scale; + return x * scale; + } + } else { + //else if pos.isMobile true -- placeholder saved from mobile or tablet view then handle position in desktop view divide by scale + if (pos.isMobile) { + const x = pos.xPosition * pos.scale + 50; + return x; + } else { + return pos.xPosition; + } + } + }; + const yPos = (pos) => { + //checking both condition mobile and desktop view + const y = pos.yPosition / scale; + if (isMobile) { + //if pos.isMobile false -- placeholder saved from desktop view then handle position in mobile view divided by scale + if (pos.isMobile) { + const y = pos.yPosition * (pos.scale / scale); + return page.getHeight() - y * scale - imgHeight; + } else { + return page.getHeight() - y * scale - imgHeight; + } + } else { + //else if pos.isMobile true -- placeholder saved from mobile or tablet view then handle position in desktop view divide by scale + if (pos.isMobile) { + const y = pos.yPosition * pos.scale; + return page.getHeight() - y - imgHeight; + } else { + return page.getHeight() - pos.yPosition - imgHeight; + } + } + }; page.drawImage(img, { - x: imgUrlList[id].xPosition, - y: page.getHeight() - imgUrlList[id].yPosition - imgHeight, + x: xPos(imgUrlList[id]), + y: yPos(imgUrlList[id]), width: imgWidth, height: imgHeight }); @@ -506,24 +551,91 @@ function PdfRequestFiles() { signerData ) => { let signgleSign; - + const isMobile = window.innerWidth < 767; + const newWidth = window.innerWidth; + const scale = isMobile ? pdfOriginalWidth / newWidth : 1; if ( signerData && signerData.length === 1 && signerData[0].pos.length === 1 ) { const height = xyPosData.Height ? xyPosData.Height : 60; - const bottomY = xyPosData.isDrag - ? xyPosData.yBottom - height - : xyPosData.yBottom - height + xyPosData.firstYPos; + + const xPos = (pos) => { + //checking both condition mobile and desktop view + if (isMobile) { + //if pos.isMobile false -- placeholder saved from desktop view then handle position in mobile view divided by scale + if (pos.isMobile) { + const x = pos.xPosition * (pos.scale / scale); + return x * scale + 50; + } else { + const x = pos.xPosition / scale; + return x * scale; + } + } else { + //else if pos.isMobile true -- placeholder saved from mobile or tablet view then handle position in desktop view divide by scale + if (pos.isMobile) { + const x = pos.xPosition * pos.scale + 50; + return x; + } else { + return pos.xPosition; + } + } + }; + + const yBottom = (pos) => { + let yPosition; + //checking both condition mobile and desktop view + + if (isMobile) { + //if pos.isMobile false -- placeholder saved from desktop view then handle position in mobile view divided by scale + if (pos.isMobile) { + const y = pos.yPosition * (pos.scale / scale); + yPosition = pos.isDrag + ? y * scale - height + : pos.firstYPos + ? y * scale - height + pos.firstYPos + : y * scale - height; + return yPosition; + } else { + const y = pos.yBottom / scale; + + yPosition = pos.isDrag + ? y * scale - height + : pos.firstYPos + ? y * scale - height + pos.firstYPos + : y * scale - height; + return yPosition; + } + } else { + //else if pos.isMobile true -- placeholder saved from mobile or tablet view then handle position in desktop view divide by scale + if (pos.isMobile) { + const y = pos.yBottom * pos.scale; + + yPosition = pos.isDrag + ? y - height + : pos.firstYPos + ? y - height + pos.firstYPos + : y - height; + return yPosition; + } else { + yPosition = pos.isDrag + ? pos.yBottom - height + : pos.firstYPos + ? pos.yBottom - height + pos.firstYPos + : pos.yBottom - height; + return yPosition; + } + } + }; + const bottomY = yBottom(xyPosData); signgleSign = { pdfFile: pdfBase64Url, docId: documentId, + userId: signerObjectId, sign: { Base64: base64Url, - Left: xyPosData.resizeXPos - ? xyPosData.resizeXPos - : xyPosData.xPosition, + Left: xPos(xyPosData), Bottom: bottomY, Width: xyPosData.Width ? xyPosData.Width : 150, Height: height, @@ -537,7 +649,8 @@ function PdfRequestFiles() { ) { signgleSign = { pdfFile: base64Url, - docId: documentId + docId: documentId, + userId: signerObjectId }; } @@ -565,7 +678,6 @@ function PdfRequestFiles() { } }) .catch((err) => { - // this.setState({ loading: false }); console.log("axois err ", err); alert("something went wrong"); }); @@ -595,17 +707,12 @@ function PdfRequestFiles() { //function for image upload or update const onImageChange = (event) => { if (event.target.files && event.target.files[0]) { - // setIsSignPad(false); - const imageType = event.target.files[0].type; - const reader = new FileReader(); reader.readAsDataURL(event.target.files[0]); - reader.onloadend = function (e) { let width, height; const image = new Image(); - image.src = e.target.result; image.onload = function () { width = image.width; @@ -783,8 +890,6 @@ function PdfRequestFiles() { return obj; }); - // currentSigner[0].placeHolder.splice(i, 1, newUpdateUrl[0]); - // console.log("currentSigner sign", currentSigner); const newUpdatePos = currentSigner.map((obj, ind) => { if (obj.signerObjId === signerObjectId) { return { ...obj, placeHolder: newUpdateUrl }; @@ -842,8 +947,6 @@ function PdfRequestFiles() { }); }; - // console.log("unsigned", unsignedSigners, signerObjectId,isExpired); - return ( {isLoading.isLoad ? ( @@ -859,7 +962,7 @@ function PdfRequestFiles() { style={{ position: "absolute", height: "100vh", - width: window.innerWidth, + width: "100%", display: "flex", justifyContent: "center", flexDirection: "column", @@ -1015,6 +1118,8 @@ function PdfRequestFiles() { setIsDecline={setIsDecline} decline={true} currentSigner={currentSigner} + pdfUrl={pdfUrl} + alreadySign={alreadySign} /> diff --git a/microfrontends/SignDocuments/src/Component/SignYourselfPdf.js b/microfrontends/SignDocuments/src/Component/SignYourselfPdf.js index 4e91eab20..92eec4b8f 100644 --- a/microfrontends/SignDocuments/src/Component/SignYourselfPdf.js +++ b/microfrontends/SignDocuments/src/Component/SignYourselfPdf.js @@ -27,8 +27,6 @@ import RenderPdf from "./component/renderPdf"; import { contractUsers, contactBook } from "../utils/Utils"; //For signYourself inProgress section signer can add sign and complete doc sign. function SignYourSelf() { - // pdfjs.GlobalWorkerOptions.workerSrc = `//cdnjs.cloudflare.com/ajax/libs/pdf.js/${pdfjs.version}/pdf.worker.js`; - const [pdfDetails, setPdfDetails] = useState([]); const [isSignPad, setIsSignPad] = useState(false); const [allPages, setAllPages] = useState(null); @@ -310,52 +308,6 @@ function SignYourSelf() { }; setIsLoading(loadObj); } - - // await axios - // .get( - // `${localStorage.getItem("baseUrl")}classes/${localStorage.getItem( - // "_appName" - // )}_Contactbook?where={"UserId": {"__type": "Pointer","className": "_User", "objectId":"${ - // jsonSender.objectId - // }"}}`, - // { - // headers: { - // "Content-Type": "application/json", - // "X-Parse-Application-Id": localStorage.getItem("parseAppId"), - // "X-Parse-Session-Token": localStorage.getItem("accesstoken"), - // }, - // } - // ) - // .then((Listdata) => { - // const json = Listdata.data; - // const res = json.results; - - // if (res[0]) { - // setSignerUserId(res[0].objectId); - // const tourstatuss = res[0].TourStatus && res[0].TourStatus; - - // if (tourstatuss && tourstatuss.length > 0) { - // setTourStatus(tourstatuss); - // const checkTourRecipients = tourstatuss.filter( - // (data) => data.signyourself - // ); - // if (checkTourRecipients && checkTourRecipients.length > 0) { - // setCheckTourStatus(checkTourRecipients[0].signyourself); - // } - // } - // } - // const loadObj = { - // isLoad: false, - // }; - // setIsLoading(loadObj); - // }) - // .catch((err) => { - // const loadObj = { - // isLoad: false, - // }; - // setHandleError("Error: Something went wrong!"); - // setIsLoading(loadObj); - // }); }; //function for setting position after drop signature button over pdf @@ -618,22 +570,33 @@ function SignYourSelf() { ? imgUrlList[id].Height : 60; const imgWidth = imgUrlList[id].Width ? imgUrlList[id].Width : 150; - const isMobile = window.innerWidth < 712; + const isMobile = window.innerWidth < 767; const newWidth = window.innerWidth; const scale = isMobile ? pdfOriginalWidth / newWidth : 1; + + const posY = () => { + if (id === 0) { + return ( + page.getHeight() - + imgUrlList[id].yPosition * scale - + imgHeight + ); + } else if (id > 0) { + return page.getHeight() - imgUrlList[id].yPosition * scale; + } + }; page.drawImage(img, { x: isMobile - ? imgUrlList[id].xPosition * scale + 50 + ? imgUrlList[id].xPosition * scale + imgWidth / 2 : imgUrlList[id].xPosition, - y: - page.getHeight() - imgUrlList[id].yPosition * scale - imgHeight, + y: posY(), width: imgWidth, height: imgHeight }); }); } const pdfBytes = await pdfDoc.saveAsBase64({ useObjectStreams: false }); - // console.log("pdfbyte", pdfBytes); + signPdfFun(pdfBytes, documentId); } setIsSignPad(false); @@ -652,10 +615,10 @@ function SignYourSelf() { pageNo ) => { let singleSign; - const isMobile = window.innerWidth < 712; + const isMobile = window.innerWidth < 767; const newWidth = window.innerWidth; const scale = isMobile ? pdfOriginalWidth / newWidth : 1; - + const imgWidth = xyPosData.Width.Width ? xyPosData.Width.Width : 150; if (xyPostion.length === 1 && xyPostion[0].pos.length === 1) { const height = xyPosData.Height ? xyPosData.Height : 60; const bottomY = xyPosData.isDrag @@ -670,7 +633,7 @@ function SignYourSelf() { sign: { Base64: base64Url, Left: isMobile - ? xyPosData.xPosition * scale + 80 + ? xyPosData.xPosition * scale + imgWidth / 2 : xyPosData.xPosition, Bottom: bottomY, Width: xyPosData.Width ? xyPosData.Width : 150, @@ -684,14 +647,13 @@ function SignYourSelf() { docId: documentId }; } - // console.log("data",singleSign) + await axios .post(`${localStorage.getItem("baseUrl")}functions/signPdf`, singleSign, { headers: { "Content-Type": "application/json", "X-Parse-Application-Id": localStorage.getItem("parseAppId"), sessionToken: localStorage.getItem("accesstoken") - // sessiontoken, } }) .then((Listdata) => { @@ -718,7 +680,6 @@ function SignYourSelf() { //function for save x and y position and show signature tab on that position const handleTabDrag = (key, e) => { - // console.log("key", key); setDragKey(key); setIsDragging(true); }; @@ -791,8 +752,6 @@ function SignYourSelf() { //function for image upload or update const onImageChange = (event) => { if (event.target.files && event.target.files[0]) { - // setIsSignPad(false); - const imageType = event.target.files[0].type; const reader = new FileReader(); @@ -825,16 +784,11 @@ function SignYourSelf() { setImage({ src: image.src, imgType: imageType }); }; - - //const imgUrl = URL.createObjectURL(event.target.files[0]); - - // const imgData = { width: newWidth, height: newHeight, src: imgUrl }; } }; //function for save button to save signature or image url const saveSign = (isDefaultSign) => { - // console.log("isDefault sign", isDefaultSign); const signatureImg = isDefaultSign ? defaultSignImg : signature; setIsSignPad(false); @@ -878,9 +832,6 @@ function SignYourSelf() { if (updateFilter.length > 0) { const getXYdata = xyPostion[index].pos; - - // const updateWidth = getXYdata[key].Width; - // const updateHeight = getXYdata[key].Height; const getPosData = getXYdata; const addSign = getPosData.map((url, ind) => { if (url.key === key) { @@ -937,7 +888,7 @@ function SignYourSelf() { let filterData = xyPostion[index].pos.filter((data) => data.key !== key); - // //delete and update block position + //delete and update block position if (filterData.length > 0) { updateResizeData.push(filterData); const newUpdatePos = xyPostion.map((obj, ind) => { @@ -949,12 +900,10 @@ function SignYourSelf() { setXyPostion(newUpdatePos); } else { - // setXyPostion([]); - const getRemainPage = xyPostion.filter( (data) => data.pageNumber !== pageNumber ); - // console.log("remainPage",getRemainPage) + if (getRemainPage && getRemainPage.length > 0) { setXyPostion(getRemainPage); } else { @@ -996,7 +945,6 @@ function SignYourSelf() { }; const tourConfig = [ { - // updateDelay: 1500, selector: '[data-tut="reactourFirst"]', content: `Drag the signature or stamp placeholder onto the PDF to choose your desired signing location.`, position: "top", @@ -1046,8 +994,6 @@ function SignYourSelf() { ) .then((Listdata) => { // const json = Listdata.data; - // const res = json.results; - // console.log("res", json); }) .catch((err) => { console.log("axois err ", err); diff --git a/microfrontends/SignDocuments/src/Component/component/defaultSignature.js b/microfrontends/SignDocuments/src/Component/component/defaultSignature.js index cd0385ac5..782133bea 100644 --- a/microfrontends/SignDocuments/src/Component/component/defaultSignature.js +++ b/microfrontends/SignDocuments/src/Component/component/defaultSignature.js @@ -5,54 +5,14 @@ function DefaultSignature({ themeColor, defaultSignImg, setShowAlreadySignDoc, - setDefaultSignImg, - userObjectId, - setIsLoading, - xyPostion, + xyPostion }) { - useEffect(() => { - getDefaultSignature(userObjectId); - }, []); - - //function for fetch default sigature added bu users - const getDefaultSignature = async (userObjectId) => { - await axios - .get( - `${localStorage.getItem("baseUrl")}classes/${localStorage.getItem( - "_appName" - )}_Signature?where={"UserId": {"__type": "Pointer","className": "_User", "objectId":"${userObjectId}"}}`, - { - headers: { - "Content-Type": "application/json", - "X-Parse-Application-Id": localStorage.getItem("parseAppId"), - "X-Parse-Session-Token": localStorage.getItem("accesstoken"), - }, - } - ) - .then((Listdata) => { - const json = Listdata.data; - const res = json.results; - - if (res[0] && res.length > 0) { - setDefaultSignImg(res[0].ImageURL); - } - const loadObj = { - isLoad: false, - }; - setIsLoading(loadObj); - }) - .catch((err) => { - // this.setState({ loading: false }); - console.log("axois err ", err); - }); - }; - const confirmToaddDefaultSign = () => { if (xyPostion.length > 0) { const alreadySign = { status: true, mssg: "Are you sure you want to sign at requested locations?", - sure: true, + sure: true }; setShowAlreadySignDoc(alreadySign); } else { @@ -67,7 +27,7 @@ function DefaultSignature({ background: themeColor(), color: "white", padding: "5px", - fontFamily: "sans-serif", + fontFamily: "sans-serif" }} > Signature @@ -78,7 +38,7 @@ function DefaultSignature({ flexDirection: "column", alignItems: "center", marginTop: "10px", - fontWeight: "600", + fontWeight: "600" }} > {defaultSignImg ? ( @@ -90,7 +50,7 @@ function DefaultSignature({ style={{ width: "100%", height: "100%", - objectFit: "contain", + objectFit: "contain" }} src={defaultSignImg} /> @@ -100,7 +60,7 @@ function DefaultSignature({ background: themeColor(), color: "white", marginTop: "20px", - cursor: "pointer", + cursor: "pointer" }} type="button" className="finishBtn finishnHover" @@ -111,7 +71,9 @@ function DefaultSignature({ ) : (
- Click a signature placeholder to start signing the document! + + Click a signature placeholder to start signing the document! +
)}
diff --git a/microfrontends/SignDocuments/src/Component/component/emailComponent.js b/microfrontends/SignDocuments/src/Component/component/emailComponent.js index 722e2582d..af6ecf0e4 100644 --- a/microfrontends/SignDocuments/src/Component/component/emailComponent.js +++ b/microfrontends/SignDocuments/src/Component/component/emailComponent.js @@ -18,7 +18,7 @@ function EmailComponent({ setSuccessEmail, signObjId, pdfName, - sender, + sender }) { const [emailCount, setEmailCount] = useState([]); const [emailValue, setEmailValue] = useState(); @@ -28,28 +28,9 @@ function EmailComponent({ setIsLoading(true); let sendMail, recipent; for (let i = 0; i < emailCount.length; i++) { - // await axios - // .get( - // `${localStorage.getItem("baseUrl")}classes/${localStorage.getItem("_appName")}_Contactbook?where={"Email":"${emailCount[i]}"}`, - // { - // headers: { - // "Content-Type": "application/json", - // "X-Parse-Application-Id": localStorage.getItem("parseAppId"), - // sessionToken: localStorage.getItem("accesstoken"), - // }, - // } - // ) - // .then((Listdata) => { - // const json = Listdata.data; - // if (json.results[0]) { - // recipent = json.results[0]; - // } - // }) - // .catch((err) => { - // console.log("axois err ", err); - // }); + try { - console.log("recipients", recipent); + const imgPng = "https://qikinnovation.ams3.digitaloceanspaces.com/logo.png"; // "https://qikinnovation.ams3.digitaloceanspaces.com/mailLogo_2023-08-18T12%3A51%3A31.573Z.png"; @@ -58,15 +39,9 @@ function EmailComponent({ const headers = { "Content-Type": "application/json", "X-Parse-Application-Id": localStorage.getItem("parseAppId"), - sessionToken: localStorage.getItem("accesstoken"), + sessionToken: localStorage.getItem("accesstoken") }; - // const serverUrl = localStorage.getItem("baseUrl"); - // const newServer = serverUrl.replaceAll("/", "%2F"); - - // const serverParams = `${newServer}&${localStorage.getItem( - // "parseAppId" - // )}&${localStorage.getItem("_appName")}`; - // let pdfUrlWeb = ` ${pdfName}`; + const themeBGcolor = themeColor(); let params = { pdfName: pdfName, @@ -83,8 +58,7 @@ function EmailComponent({ pdfName + " Standard is attached to this email. Kindly download the document from the attachment.

This is an automated email from Open Sign. For any queries regarding this email, please contact the sender " + sender.email + - " directly. If you think this email is inappropriate or spam, you may file a complaint with Open Sign here.

", - //"html":"

Digital Signature Request

" + recipent.Name + " has requested you to review and sign" +pdfName+"

Sender" + recipent.Email + "

This is an automated email from Open Sign. For any queries regarding this email, please contact the sender " + recipent.Email + " directly.If you think this email is inappropriate or spam, you may file a complaint with Open Sign here.

" + " directly. If you think this email is inappropriate or spam, you may file a complaint with Open Sign here.

" }; sendMail = await axios.post(url, params, { headers: headers }); } catch (error) { @@ -138,7 +112,6 @@ function EmailComponent({ const base64 = await getBase64FromUrl(pdfUrl); printModule({ printable: base64, type: "pdf", base64: true }); - // window.print('https://nxgcreator.s3.ap-south-1.amazonaws.com/exported_file_32_2023-08-22T04%3A59%3A13.432Z.pdf',); }; //handle download signed pdf @@ -146,6 +119,9 @@ function EmailComponent({ saveAs(pdfUrl, `${pdfName}_signed_by_OpenSign™.pdf`); }; + const isAndroid = /Android/i.test(navigator.userAgent); + + return (
{/* isEmail */} @@ -162,7 +138,7 @@ function EmailComponent({ alignItems: "center", zIndex: "20", backgroundColor: "#e6f2f2", - opacity: 0.8, + opacity: 0.8 }} >
- + className="btn btn-primary btn-sm" + > + + Print + + )} )} )} @@ -216,7 +222,7 @@ function Header({ border: "none", fontWeight: "650", fontSize: "16px", - marginRight: "10px", + marginRight: "10px" }} > Decline @@ -224,18 +230,16 @@ function Header({ )} {isPlaceholder ? (
{ if (!isMailSend) { alertSendEmail(); } }} - style={{ color: isMailSend ? "gray" : themeColor(), border: "none", fontWeight: "650", - fontSize: "16px", + fontSize: "16px" }} data-tut={dataTut4} > @@ -243,7 +247,7 @@ function Header({
) : (
{ if (!pdfUrl) { embedImages(); @@ -253,7 +257,7 @@ function Header({ color: themeColor(), border: "none", fontWeight: "650", - fontSize: "16px", + fontSize: "16px" }} > Finish @@ -277,10 +281,8 @@ function Header({ pdfUrl || isAlreadySign.mssg ? (
{pdfDetails[0] && pdfDetails.length > 0 && ( - // } fileName={`completion certificate-${ pdfDetails[0] && pdfDetails[0].Name @@ -296,7 +298,7 @@ function Header({ style={{ display: "flex", flexDirection: "row", - alignItems: "center", + alignItems: "center" }} > @@ -319,7 +321,7 @@ function Header({ style={{ display: "flex", flexDirection: "row", - alignItems: "center", + alignItems: "center" }} className="defaultBtn printBtn" > @@ -328,7 +330,7 @@ function Header({ style={{ fontSize: "15px", marginRight: "3px", - color: "white", + color: "white" }} aria-hidden="true" > @@ -340,7 +342,7 @@ function Header({ style={{ display: "flex", flexDirection: "row", - alignItems: "center", + alignItems: "center" }} className="defaultBtn downloadBtn" onClick={() => handleDownloadPdf()} @@ -350,7 +352,7 @@ function Header({ style={{ color: "white", fontSize: "15px", - marginRight: "3px", + marginRight: "3px" }} aria-hidden="true" > @@ -361,7 +363,7 @@ function Header({
) - ) : pdfUrl || (documentStatus && documentStatus.isCompleted) ? ( -
- } - fileName={`completion certificate-${ - pdfDetails[0] && pdfDetails[0].Name - }.pdf`} - > - {({ blob, url, loading, error }) => - loading ? ( - "Loading document..." - ) : ( - - ) - } - - - -
) : isPlaceholder ? ( <> {!isMailSend && @@ -502,7 +425,7 @@ function Header({ data-tut="reactourFour" style={{ background: isMailSend ? "rgb(203, 203, 203)" : "#188ae2", - color: isMailSend && "rgb(77, 75, 75)", + color: isMailSend && "rgb(77, 75, 75)" }} onClick={() => { alertSendEmail(); @@ -514,10 +437,11 @@ function Header({
) : isPdfRequestFiles ? ( - isSigned ? ( + alreadySign ? (
{isCompleted.isCertificate && ( } fileName={`completion certificate-${ pdfDetails[0] && pdfDetails[0].Name @@ -533,7 +457,7 @@ function Header({ style={{ display: "flex", flexDirection: "row", - alignItems: "center", + alignItems: "center" }} > @@ -558,7 +482,7 @@ function Header({ style={{ display: "flex", flexDirection: "row", - alignItems: "center", + alignItems: "center" }} > @@ -579,7 +503,7 @@ function Header({ style={{ display: "flex", flexDirection: "row", - alignItems: "center", + alignItems: "center" }} onClick={() => handleDownloadPdf()} > @@ -588,7 +512,7 @@ function Header({ style={{ color: "white", fontSize: "15px", - marginRight: "3px", + marginRight: "3px" }} aria-hidden="true" > @@ -610,7 +534,7 @@ function Header({ <> + ) + } + + + +
) : (
- ) : ( - - )} +
+
+ Welcome Back ! +
+ + Verification code is sent to your email + +
+
+ +
+
+ {loading ? ( + + ) : ( + + )} +
- +
) : ( -
-
-
-

Welcome Back !

- You will get a OTP via Email -
-
- - +
+
+ Welcome Back ! +
+ You will get a OTP via Email +
+
+ + -
-
-
-
- {loading ? ( - - ) : ( - - )} +
+
+ {loading ? ( + + ) : ( + + )} +
- +
)}
)} - +
); } diff --git a/microfrontends/SignDocuments/src/Component/placeHolderSign.js b/microfrontends/SignDocuments/src/Component/placeHolderSign.js index fbc366151..80ef92e27 100644 --- a/microfrontends/SignDocuments/src/Component/placeHolderSign.js +++ b/microfrontends/SignDocuments/src/Component/placeHolderSign.js @@ -17,11 +17,13 @@ import HandleError from "./component/HandleError"; import Nodata from "./component/Nodata"; import SignerListPlace from "./component/signerListPlace"; import Header from "./component/header"; -import { contactBook, contractUsers } from "../utils/Utils"; +import { contactBook, contractUsers, getHostUrl } from "../utils/Utils"; import RenderPdf from "./component/renderPdf"; import ModalComponent from "./component/modalComponent"; +import { useNavigate } from "react-router-dom"; function PlaceHolderSign() { + const navigate = useNavigate(); const [pdfDetails, setPdfDetails] = useState([]); const [isMailSend, setIsMailSend] = useState(false); const [allPages, setAllPages] = useState(null); @@ -74,7 +76,9 @@ function PlaceHolderSign() { "#66ccff", "#ffffcc" ]; - + const isMobile = window.innerWidth < 767; + const newWidth = window.innerWidth; + const scale = pdfOriginalWidth / newWidth; const [{ isOver }, drop] = useDrop({ accept: "BOX", drop: (item, monitor) => addPositionOfSignature(item, monitor), @@ -119,7 +123,7 @@ function PlaceHolderSign() { isDragSignatureSS: !!monitor.isDragging() }) }); - const isMobile = window.innerWidth < 712; + const [{ isDragStampSS }, dragStampSS] = useDrag({ type: "BOX", @@ -162,7 +166,7 @@ function PlaceHolderSign() { getDocumentDetails(); } }, []); - + //function for get document details const getDocumentDetails = async () => { await axios @@ -257,56 +261,10 @@ function PlaceHolderSign() { setIsLoading(loadObj); } } - // await axios - // .get( - // `${localStorage.getItem("baseUrl")}classes/${localStorage.getItem( - // "_appName" - // )}_Contactbook?where={"UserId": {"__type": "Pointer","className": "_User", "objectId":"${ - // jsonSender.objectId - // }"}}`, - // { - // headers: { - // "Content-Type": "application/json", - // "X-Parse-Application-Id": localStorage.getItem("parseAppId"), - // "X-Parse-Session-Token": localStorage.getItem("accesstoken"), - // }, - // } - // ) - // .then((Listdata) => { - // const json = Listdata.data; - // const res = json.results; - - // if (res[0] && res.length) { - // setSignerUserId(res[0].objectId); - // const tourstatus = res[0].TourStatus && res[0].TourStatus; - // if (tourstatus && tourstatus.length > 0) { - // setTourStatus(tourstatus); - // const checkTourRecipients = tourstatus.filter( - // (data) => data.placeholder - // ); - // if (checkTourRecipients && checkTourRecipients.length > 0) { - // setCheckTourStatus(checkTourRecipients[0].placeholder); - // } - // } - // const loadObj = { - // isLoad: false, - // }; - // setIsLoading(loadObj); - // } - // }) - // .catch((err) => { - // const loadObj = { - // isLoad: false, - // }; - // setHandleError("Error: Something went wrong!"); - // setIsLoading(loadObj); - // }); }; //function for setting position after drop signature button over pdf const addPositionOfSignature = (item, monitor) => { - const isMobile = window.innerWidth < 712; - if (isMobile) { if (selectedEmail) { getSignerPos(item, monitor); @@ -317,11 +275,8 @@ function PlaceHolderSign() { getSignerPos(item, monitor); } }; - + const getSignerPos = (item, monitor) => { - const isMobile = window.innerWidth < 712; - const newWidth = window.innerWidth; - const scale = pdfOriginalWidth / newWidth; const key = Math.floor(1000 + Math.random() * 9000); let filterSignerPos = signerPos.filter( (data) => data.signerObjId === signerObjId @@ -336,7 +291,8 @@ function PlaceHolderSign() { isStamp: monitor, key: key, isDrag: false, - scale: isMobile && scale, + scale: scale, + isMobile: isMobile, yBottom: window.innerHeight / 2 - 60 }; dropData.push(dropObj); @@ -365,7 +321,8 @@ function PlaceHolderSign() { firstXPos: signBtnPosition[0] && signBtnPosition[0].xPos, firstYPos: signBtnPosition[0] && signBtnPosition[0].yPos, yBottom: ybottom, - scale: isMobile && scale + scale: scale, + isMobile: isMobile }; dropData.push(dropObj); @@ -394,16 +351,12 @@ function PlaceHolderSign() { //add entry of position for same signer on multiple page if (getPageNumer.length > 0) { const getPos = getPageNumer[0].pos; - - //if (updateData.length > dropData.length) { const newSignPos = getPos.concat(dropData); - let xyPos = { pageNumber: pageNumber, pos: newSignPos }; updatePlace.push(xyPos); - let placeHolderPos = { blockColor: color[isSelectListId], signerObjId: signerObjId, @@ -417,7 +370,6 @@ function PlaceHolderSign() { signerPos.splice(colorIndex, 1, placeHolderPos); } else { - // const newSignPos = getPlaceHolder.push(xyPosArr[0]); const newSignPoss = getPlaceHolder.concat(xyPosArr[0]); let placeHolderPos = { @@ -444,7 +396,7 @@ function PlaceHolderSign() { blockColor: color[isSelectListId], placeHolder: xyPosArr }; - + setSignerPos((prev) => [...prev, placeHolderPos]); } }; @@ -467,17 +419,19 @@ function PlaceHolderSign() { }; //function for set and update x and y postion after drag and drop signature tab - const handleStop = (event, dragElement) => { + const handleStop = (event, dragElement, signerId, key) => { const containerRect = document .getElementById("container") .getBoundingClientRect(); - + const signId = signerId ? signerId : signerObjId; + const keyValue = key ? key : dragKey; const ybottom = containerRect.height - dragElement.y; - if (dragKey >= 0) { + if (keyValue >= 0) { const filterSignerPos = signerPos.filter( - (data) => data.signerObjId === signerObjId + (data) => data.signerObjId === signId ); + if (filterSignerPos.length > 0) { const getPlaceHolder = filterSignerPos[0].placeHolder; @@ -490,7 +444,7 @@ function PlaceHolderSign() { const getPosData = getXYdata; const addSignPos = getPosData.map((url, ind) => { - if (url.key === dragKey) { + if (url.key === keyValue) { return { ...url, xPosition: dragElement.x, @@ -509,16 +463,15 @@ function PlaceHolderSign() { return obj; }); const newUpdateSigner = signerPos.map((obj, ind) => { - if (obj.signerObjId === signerObjId) { + if (obj.signerObjId === signId) { return { ...obj, placeHolder: newUpdateSignPos }; } return obj; }); + setSignerPos(newUpdateSigner); } } - - // } } }; @@ -556,6 +509,7 @@ function PlaceHolderSign() { } return obj; }); + setSignerPos(newUpdateSigner); } else { const updateFilter = signerPos.filter( @@ -577,6 +531,7 @@ function PlaceHolderSign() { (data) => data.signerObjId !== signerId ); signerupdate.push(newUpdatePos[0]); + setSignerPos(signerupdate); } else { setSignerPos(updateFilter); @@ -621,12 +576,14 @@ function PlaceHolderSign() { } return obj; }); + const newUpdateSigner = signerPos.map((obj, ind) => { if (obj.signerObjId === signerId) { return { ...obj, placeHolder: newUpdateSignPos }; } return obj; }); + setSignerPos(newUpdateSigner); } else { const getXYdata = getPageNumer[0].pos; @@ -650,12 +607,14 @@ function PlaceHolderSign() { } return obj; }); + const newUpdateSigner = signerPos.map((obj, ind) => { if (obj.signerObjId === signerId) { return { ...obj, placeHolder: newUpdateSignPos }; } return obj; }); + setSignerPos(newUpdateSigner); } } @@ -667,11 +626,9 @@ function PlaceHolderSign() { setSignBtnPosition([]); setPageNumber((prevPageNumber) => prevPageNumber + offset); } - + //function for capture position on hover signature button const handleDivClick = (e) => { - // if (signBtnPosition.length == 0) { - const divRect = e.currentTarget.getBoundingClientRect(); const mouseX = e.clientX - divRect.left; const mouseY = e.clientY - divRect.top; @@ -721,17 +678,13 @@ function PlaceHolderSign() { month: "long", year: "numeric" }); - let sender = signersdata.ExtUserPtr.Email; - // let sender ="raktima.c@qik.ai" - const signerMail = signersdata.Signers; + const signerMail = signersdata.Signers; for (let i = 0; i < signerMail.length; i++) { try { const imgPng = "https://qikinnovation.ams3.digitaloceanspaces.com/logo.png"; - // "https://qikinnovation.ams3.digitaloceanspaces.com/mailLogo_2023-08-18T12%3A51%3A31.573Z.png"; - let url = `${localStorage.getItem("baseUrl")}functions/sendmailv3/`; const headers = { "Content-Type": "application/json", @@ -800,14 +753,12 @@ function PlaceHolderSign() { } ) .then((result) => { - // const res = result.data; setIsSend(true); setIsMailSend(true); const loadObj = { isLoad: false }; setIsLoading(loadObj); - // console.log("save res", res); }) .catch((err) => { console.log("axois err ", err); @@ -889,6 +840,12 @@ function PlaceHolderSign() { console.log("axois err ", err); }); }; + const handleRecipientSign = () => { + const hostUrl = getHostUrl(); + navigate( + `${hostUrl}recipientSignPdf/${documentId}/${currentEmail[0].objectId}` + ); + }; return ( {isLoading.isLoad ? ( @@ -993,7 +950,6 @@ function PlaceHolderSign() { style={{ background: themeColor() }} - // className="bg-danger" > Send Mail @@ -1023,21 +979,19 @@ function PlaceHolderSign() { No - { + handleRecipientSign(); + }} + style={{ + background: themeColor(), + color: "white" + }} + type="button" + className="finishBtn" > - - + Yes + ) : (
diff --git a/microfrontends/SignDocuments/src/Component/recipientSignPdf.js b/microfrontends/SignDocuments/src/Component/recipientSignPdf.js index a065132b5..a60627218 100644 --- a/microfrontends/SignDocuments/src/Component/recipientSignPdf.js +++ b/microfrontends/SignDocuments/src/Component/recipientSignPdf.js @@ -69,7 +69,7 @@ function EmbedPdfImage() { }); const docId = id && id; - //"F0hg0twSJH"; + const isMobile = window.innerWidth < 767; const index = xyPostion.findIndex((object) => { return object.pageNumber === pageNumber; }); @@ -85,12 +85,10 @@ function EmbedPdfImage() { //function for get document details for perticular signer with signer'object id const getDocumentDetails = async () => { - //aspfUo7wRl let currUserId, userObjectId; - const json = await contactBookName(contactBookId, "_Users"); - + const json = await contactBookName(contactBookId, "_Contactbook"); if (json !== "Error: Something went wrong!" && json && json.results[0]) { - setContractName("_Users"); + setContractName("_Contactbook"); if (json.results[0]) { userObjectId = json.results[0].UserId.objectId; setUserObjectID(userObjectId); @@ -123,9 +121,10 @@ function EmbedPdfImage() { setHandleError("Error: Something went wrong!"); setIsLoading(loadObj); } else { - const json = await contactBookName(contactBookId, "_Contactbook"); - if (json && json.results[0]) { - setContractName("_Contactbook"); + const json = await contactBookName(contactBookId, "_Users"); + + if (json !== "Error: Something went wrong!" && json && json.results[0]) { + setContractName("_Users"); if (json.results[0]) { userObjectId = json.results[0].UserId.objectId; setUserObjectID(userObjectId); @@ -151,57 +150,14 @@ function EmbedPdfImage() { }; setIsLoading(loadObj); } + } else if (json === "Error: Something went wrong!") { + const loadObj = { + isLoad: false + }; + setHandleError("Error: Something went wrong!"); + setIsLoading(loadObj); } } - // await axios - // .get(//m4GJ12tm87 - // `${localStorage.getItem("baseUrl")}classes/${localStorage.getItem( - // "_appName" - // )}_Contactbook?where={"Phone":"${userPhone}"}`, - // { - // headers: { - // "Content-Type": "application/json", - // "X-Parse-Application-Id": localStorage.getItem("parseAppId"), - // sessionToken: localStorage.getItem("accesstoken"), - // }, - // } - // ) - // .then((Listdata) => { - // const json = Listdata.data; - - // if (json.results[0]) { - // userObjectId = json.results[0].UserId.objectId; - // setUserObjectID(userObjectId); - // currUserId = json.results[0].objectId; - - // setSignerUserId(currUserId); - // const tourstatus = - // json.results[0].TourStatus && json.results[0].TourStatus; - - // if (tourstatus && tourstatus.length > 0) { - // setTourStatus(tourstatus); - // const checkTourRecipients = tourstatus.filter( - // (data) => data.recipientssign - // ); - // if (checkTourRecipients && checkTourRecipients.length > 0) { - // setCheckTourStatus(checkTourRecipients[0].recipientssign); - // } - // } - // } else { - // setNoData(true); - // const loadObj = { - // isLoad: false, - // }; - // setIsLoading(loadObj); - // } - // }) - // .catch((err) => { - // const loadObj = { - // isLoad: false, - // }; - // setHandleError("Error: Something went wrong!"); - // setIsLoading(loadObj); - // }); await axios .get( @@ -220,7 +176,6 @@ function EmbedPdfImage() { .then((Listdata) => { const json = Listdata.data; const res = json.results; - // console.log("res",res) if (res[0] && res.length > 0) { const declined = res[0].IsDeclined && res[0].IsDeclined; const isCompleted = res[0].IsCompleted && res[0].IsCompleted; @@ -233,16 +188,12 @@ function EmbedPdfImage() { //then show alert with completed message const alreadySign = { status: true, - mssg: "This document has already been signed!" + mssg: "This document has been successfully signed!" }; setIsAlreadySign(alreadySign); setPdfUrl(res[0].SignedUrl); setSignedPdfData(json.results); setCompletePdfData(res); - const loadObj = { - isLoad: false - }; - setIsLoading(loadObj); } else if (declined) { const currentDecline = { currnt: "another", @@ -251,11 +202,6 @@ function EmbedPdfImage() { setIsDecline(currentDecline); setSignedPdfData(json.results); - - const loadObj = { - isLoad: false - }; - setIsLoading(loadObj); } else if (currDate > expireUpdateDate) { setIsExpired(true); const checkDocIdExist = @@ -282,11 +228,6 @@ function EmbedPdfImage() { const key = currUser[0].placeHolder[0].pos[0].key; setSignKey(key); - - const loadObj = { - isLoad: false - }; - setIsLoading(loadObj); } //for show current requested signer's placeholder else { @@ -302,17 +243,7 @@ function EmbedPdfImage() { const key = currUser[0].placeHolder[0].pos[0].key; setSignKey(key); - - const loadObj = { - isLoad: false - }; - setIsLoading(loadObj); } - - const loadObj = { - isLoad: false - }; - setIsLoading(loadObj); } else { //checking document has signed by someone or not @@ -326,6 +257,7 @@ function EmbedPdfImage() { //if signed by someone than go to in if condition // and second signer could not be add documentId //for that setIsDocId true + if (checkDocIdExist && checkDocIdExist.length > 0) { setIsDocId(true); @@ -336,7 +268,7 @@ function EmbedPdfImage() { data.Activity === "Signed" ); - // if checkAlreadyBySigner has some data that current user alredy sign this document + // if checkAlreadyBySigner has some data that current user already sign this document // then show alert with message if (checkAlreadyBySigner && checkAlreadyBySigner.length > 0) { const alreadySign = { @@ -345,10 +277,7 @@ function EmbedPdfImage() { }; setIsAlreadySign(alreadySign); setPdfUrl(res[0].SignedUrl); - const loadObj = { - isLoad: false - }; - setIsLoading(loadObj); + setSignedPdfData(json.results); } //else show placeholder of current requested signer else { @@ -364,11 +293,6 @@ function EmbedPdfImage() { const key = currUser[0].placeHolder[0].pos[0].key; setSignKey(key); - - const loadObj = { - isLoad: false - }; - setIsLoading(loadObj); } } //for show current requested signer's placeholder @@ -385,19 +309,8 @@ function EmbedPdfImage() { const key = currUser[0].placeHolder[0].pos[0].key; setSignKey(key); - - const loadObj = { - isLoad: false - }; - setIsLoading(loadObj); } } - } else { - setNoData(true); - const loadObj = { - isLoad: false - }; - setIsLoading(loadObj); } }) .catch((err) => { @@ -434,8 +347,12 @@ function EmbedPdfImage() { setIsLoading(loadObj); }) .catch((err) => { - // this.setState({ loading: false }); console.log("axois err ", err); + const loadObj = { + isLoad: false + }; + setHandleError("Error: Something went wrong!"); + setIsLoading(loadObj); }); }; @@ -624,23 +541,62 @@ function EmbedPdfImage() { ? imgUrlList[id].Height : 60; const imgWidth = imgUrlList[id].Width ? imgUrlList[id].Width : 150; - const isMobile = window.innerWidth < 712; + const isMobile = window.innerWidth < 767; const newWidth = window.innerWidth; const scale = isMobile ? pdfOriginalWidth / newWidth : 1; - page.drawImage(img, { - x: isMobile - ? imgUrlList[id].xPosition * scale + 50 - : imgUrlList[id].xPosition, + const xPos = (pos) => { + //checking both condition mobile and desktop view + if (isMobile) { + //if pos.isMobile false -- placeholder saved from desktop view then handle position in mobile view divided by scale + if (pos.isMobile) { + const x = pos.xPosition * (pos.scale / scale); + return x * scale + 50; + } else { + const x = pos.xPosition / scale; + return x * scale; + } + } else { + //else if pos.isMobile true -- placeholder saved from mobile or tablet view then handle position in desktop view divide by scale + if (pos.isMobile) { + const x = pos.xPosition * pos.scale + 50; + return x; + } else { + return pos.xPosition; + } + } + }; + const yPos = (pos) => { + //checking both condition mobile and desktop view - y: - page.getHeight() - imgUrlList[id].yPosition * scale - imgHeight, + if (isMobile) { + //if pos.isMobile false -- placeholder saved from desktop view then handle position in mobile view divided by scale + if (pos.isMobile) { + const y = pos.yPosition * (pos.scale / scale); + return page.getHeight() - y * scale - imgHeight; + } else { + const y = pos.yPosition / scale; + return page.getHeight() - y * scale - imgHeight; + } + } else { + //else if pos.isMobile true -- placeholder saved from mobile or tablet view then handle position in desktop view divide by scale + if (pos.isMobile) { + const y = pos.yPosition * pos.scale; + return page.getHeight() - y - imgHeight; + } else { + return page.getHeight() - pos.yPosition - imgHeight; + } + } + }; + + page.drawImage(img, { + x: xPos(imgUrlList[id]), + y: yPos(imgUrlList[id]), width: imgWidth, height: imgHeight }); }); } const pdfBytes = await pdfDoc.saveAsBase64({ useObjectStreams: false }); - //console.log("pdfbyte", pdfBytes); signPdfFun(pdfBytes, docId); } @@ -658,29 +614,87 @@ function EmbedPdfImage() { pdfBase64Url, pageNo ) => { - let signgleSign; - const isMobile = window.innerWidth < 712; + let singleSign; + const isMobile = window.innerWidth < 767; const newWidth = window.innerWidth; const scale = isMobile ? pdfOriginalWidth / newWidth : 1; + const height = xyPosData ? xyPosData.Height : 60; + const xPos = (pos) => { + //checking both condition mobile and desktop view + if (isMobile) { + //if pos.isMobile false -- placeholder saved from desktop view then handle position in mobile view divided by scale + if (pos.isMobile) { + const x = pos.xPosition * (pos.scale / scale); + return x * scale + 50; + } else { + const x = pos.xPosition / scale; + return x * scale; + } + } else { + //else if pos.isMobile true -- placeholder saved from mobile or tablet view then handle position in desktop view divide by scale + if (pos.isMobile) { + const x = pos.xPosition * pos.scale + 50; + return x; + } else { + return pos.xPosition; + } + } + }; + + const yBottom = (pos) => { + let yPosition; + //checking both condition mobile and desktop view + + if (isMobile) { + //if pos.isMobile false -- placeholder saved from desktop view then handle position in mobile view divided by scale + if (pos.isMobile) { + const y = pos.yPosition * (pos.scale / scale); + yPosition = pos.isDrag + ? y * scale - height + : pos.firstYPos + ? y * scale - height + pos.firstYPos + : y * scale - height; + return yPosition; + } else { + const y = pos.yBottom / scale; + + yPosition = pos.isDrag + ? y * scale - height + : pos.firstYPos + ? y * scale - height + pos.firstYPos + : y * scale - height; + return yPosition; + } + } else { + //else if pos.isMobile true -- placeholder saved from mobile or tablet view then handle position in desktop view divide by scale + if (pos.isMobile) { + const y = pos.yBottom * pos.scale; + + yPosition = pos.isDrag + ? y - height + : pos.firstYPos + ? y - height + pos.firstYPos + : y - height; + return yPosition; + } else { + yPosition = pos.isDrag + ? pos.yBottom - height + : pos.firstYPos + ? pos.yBottom - height + pos.firstYPos + : pos.yBottom - height; + return yPosition; + } + } + }; if (xyPostion.length === 1 && xyPostion[0].pos.length === 1) { - const height = xyPosData.Height ? xyPosData.Height : 60; - const bottomY = xyPosData.isDrag - ? xyPosData.yBottom * scale - height - : xyPosData.firstYPos - ? xyPosData.yBottom * scale - height + xyPosData.firstYPos - : xyPosData.yBottom * scale - height; - signgleSign = { + const bottomY = yBottom(xyPosData); + singleSign = { pdfFile: pdfBase64Url, docId: docId, + userId: signerUserId, sign: { Base64: base64Url, - Left: isMobile - ? xyPosData.resizeXPos - ? xyPosData.resizeXPos * scale + 80 - : xyPosData.xPosition * scale + 80 - : xyPosData.resizeXPos - ? xyPosData.resizeXPos - : xyPosData.xPosition, + Left: xPos(xyPosData), Bottom: bottomY, Width: xyPosData.Width ? xyPosData.Width : 150, Height: height, @@ -688,33 +702,25 @@ function EmbedPdfImage() { } }; } else if (xyPostion.length > 0 && xyPostion[0].pos.length > 0) { - signgleSign = { + singleSign = { pdfFile: base64Url, - docId: docId + docId: docId, + userId: signerUserId }; } await axios - .post( - `${localStorage.getItem("baseUrl")}functions/signPdf`, - signgleSign, - { - headers: { - "Content-Type": "application/json", - "X-Parse-Application-Id": localStorage.getItem("parseAppId"), - sessionToken: localStorage.getItem("accesstoken") - } + .post(`${localStorage.getItem("baseUrl")}functions/signPdf`, singleSign, { + headers: { + "Content-Type": "application/json", + "X-Parse-Application-Id": localStorage.getItem("parseAppId"), + sessionToken: localStorage.getItem("accesstoken") } - ) + }) .then((Listdata) => { const json = Listdata.data; if (json.result.data) { - // setPdfUrl(json.result.data); - // const loadObj = { - // isLoad: false, - // }; - // setIsLoading(loadObj); getDocumentDetails(); } }) @@ -731,8 +737,6 @@ function EmbedPdfImage() { //function for image upload or update const onImageChange = (event) => { if (event.target.files && event.target.files[0]) { - // setIsSignPad(false); - const imageType = event.target.files[0].type; const reader = new FileReader(); @@ -872,7 +876,7 @@ function EmbedPdfImage() { } else { updatedTourStatus = [{ recipientssign: true }]; } - // console.log("updatedTourStatus", updatedTourStatus); + await axios .put( `${localStorage.getItem("baseUrl")}classes/${localStorage.getItem( @@ -899,7 +903,6 @@ function EmbedPdfImage() { }); }; - // console.log("is sign",isAlreadySign.status) const tourFunction = () => { const tourConfig = [ { @@ -922,16 +925,17 @@ function EmbedPdfImage() { } ]; - const stepsToShow = - !defaultSignImg && - tourConfig.filter( - (step, index) => step.selector !== '[data-tut="reactourFirst"]' + let stepsToShow = []; + if (!defaultSignImg || isMobile) { + stepsToShow = tourConfig.filter( + (step) => step.selector !== '[data-tut="reactourFirst"]' ); + } return ( 0 ? stepsToShow : tourConfig} isOpen={signTour} closeWithMask={false} rounded={5} @@ -1112,7 +1116,7 @@ function EmbedPdfImage() { />
- {!pdfUrl && !isAlreadySign.status ? ( + {!pdfUrl ? (
{/* this component is used to render default signature of user in the right side of the component */} diff --git a/microfrontends/SignDocuments/src/css/LoginPage.css b/microfrontends/SignDocuments/src/css/LoginPage.css index e77e7d4e2..bd80e9b0b 100644 --- a/microfrontends/SignDocuments/src/css/LoginPage.css +++ b/microfrontends/SignDocuments/src/css/LoginPage.css @@ -1,9 +1,46 @@ -.react-tel-input .form-control { +.loginInput{ + padding: 10px; + + border-radius: 4px; width: 100%; - height: 45px; - margin-top: 4px; + font-size: 0.75rem; + border: 1px solid #e2dddd;; + background-color: #e0e5f5; + color: black; + + padding-left: 1rem!important; + padding-right: 1rem!important; + padding-top: 0.5rem!important; + + font-family: inherit; + font-feature-settings: inherit; + font-variation-settings: inherit; + font-weight: inherit; + overflow: visible; + + } + .loginInput:focus{ + outline: none; + border: none; + } +.verifyBtn{ + box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.18); + padding: 3px 30px; + color: white; + font-weight: 500 !important; + font-size: 14px !important; + border: none; +} +.verifyBtn:focus { + border: none; + outline: none; } + +.verifyBtn:hover { + box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1), 0 2px 4px rgba(0, 0, 0, 0.18); + color: white; +} .fakeimg { height: 200px; background: #aaa; @@ -110,16 +147,17 @@ .KNLO { color: #878787; + font-size: 13px; } .form-check-label { margin-left: 17px; margin-bottom: 12px; } - -input:focus { - border-color: #ccc !important; +.welcomeText{ + font-size: 30px; } + @media only screen and (max-width: 600px) { .KLO1 { @@ -148,4 +186,25 @@ input:focus { +} +@media screen and (max-width:366px) { + + .main-logo { + width: 150px; + height: 46px; + display: inline-block; + } + .welcomeText{ + font-size: 20px; + } + .KNLO { + color: #878787; + font-size: 10px; + } + .btnContainer{ + display: flex; + justify-content: center; + align-items: center; + } + } \ No newline at end of file diff --git a/microfrontends/SignDocuments/src/css/signature.css b/microfrontends/SignDocuments/src/css/signature.css index 19ebe71b0..d3e16258a 100644 --- a/microfrontends/SignDocuments/src/css/signature.css +++ b/microfrontends/SignDocuments/src/css/signature.css @@ -4,753 +4,788 @@ margin: 0px; font-family:system-ui; } */ - .signatureCanvas { - border: 2px solid #888; - background-color: rgb(255, 255, 255); - width: 460px; - height: 184px; - } - - .penContainer { - width: 460px; - } - - .signatureBtn { - border: 1.5px solid #47a3ad; - margin-bottom: 10px; - border-radius: 3px; - display: flex; - padding: 0px; - justify-content: space-between; - background: white; - transition-duration: 0.4s; - cursor: all-scroll; - width: 150px; - height: 30px; - color: black; - /* transform: translate(); */ - - } - - /* .signatureBtn:hover { - background-color:#47a3ad; - color: white; - } */ - - .disableSign { - border: 1.5px solid #47a3ad; - margin-bottom: 10px; - border-radius: 3px; - display: flex; - padding: 0px; - justify-content: space-between; - background: white; - transition-duration: 0.4s; - cursor: all-scroll; - width: 150px; - height: 30px; - color: black; - border: 1px solid rgb(203, 203, 203); - cursor: text; - - } - - .emailInput { - padding: 10px; - border: 1.5px solid gray; - border-radius: 4px; - width: 100%; - font-size: 15px; - padding-bottom: 20px; - } - - .emailInput:focus { - outline: none; - border: 1.5px solid #47a3ad; - } - - .addEmail { - padding: "0px"; - border: 1.5px solid #47a3ad; - border-radius: 4px; - width: 100%; - font-size: 15px; - - } - - .addEmail, - .emailInput { - - outline: none; - } - - .addEmailInput { - border: none; - outline: none; - } - - .emailChip { - background-color: #47a3ad; - margin: 4px; - border-radius: 10px; - padding: 5px 10px; - } - - .addEmailInput { - padding: 10px; - - border-radius: 4px; - width: 100%; - font-size: 15px; - - - } - - .addEmailInput:focus { - outline: none; - border: none; - } - - .finishBtn { - box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.18); - padding: 3px 30px; - color: white; - font-weight: 500 !important; - font-size: 14px !important; - border: none; - margin-left: 10px; - } -.sendMail{ - box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.18); - padding: 3px 30px; - color: white; - font-weight: 500 !important; - font-size: 14px !important; - border: none; - margin-left: 10px; - /* color: rgb(77, 75, 75); */ -} + .signatureCanvas { + border: 2px solid #888; + background-color: rgb(255, 255, 255); + width: 460px; + height: 184px; + } - .finishBtn:focus { + .penContainer { + width: 460px; + } + + .signatureBtn { + border: 1.5px solid #47a3ad; + margin-bottom: 10px; + border-radius: 3px; + display: flex; + padding: 0px; + justify-content: space-between; + background: white; + transition-duration: 0.4s; + cursor: all-scroll; + width: 150px; + height: 30px; + color: black; + /* transform: translate(); */ + + } + + /* .signatureBtn:hover { + background-color:#47a3ad; + color: white; + } */ + + .disableSign { + border: 1.5px solid #47a3ad; + margin-bottom: 10px; + border-radius: 3px; + display: flex; + padding: 0px; + justify-content: space-between; + background: white; + transition-duration: 0.4s; + cursor: all-scroll; + width: 150px; + height: 30px; + color: black; + border: 1px solid rgb(203, 203, 203); + cursor: text; + + } + + .emailInput { + padding: 10px; + border: 1.5px solid gray; + border-radius: 4px; + width: 100%; + font-size: 15px; + padding-bottom: 20px; + } + + .emailInput:focus { + outline: none; + border: 1.5px solid #47a3ad; + } + + .addEmail { + padding: "0px"; + border: 1.5px solid #47a3ad; + border-radius: 4px; + width: 100%; + font-size: 15px; + + } + + .addEmail, + .emailInput { + + outline: none; + } + + .addEmailInput { + border: none; + outline: none; + } + + .emailChip { + background-color: #47a3ad; + margin: 4px; + border-radius: 10px; + padding: 5px 10px; + } + + .addEmailInput { + padding: 10px; + + border-radius: 4px; + width: 100%; + font-size: 15px; + + + } + + .addEmailInput:focus { + outline: none; + border: none; + } + + .finishBtn { + box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.18); + padding: 3px 30px; + color: white; + font-weight: 500 !important; + font-size: 14px !important; + border: none; + margin-left: 10px; + } + + .sendMail { + box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.18); + padding: 3px 30px; + color: white; + font-weight: 500 !important; + font-size: 14px !important; + border: none; + margin-left: 10px; + /* color: rgb(77, 75, 75); */ + } + + .finishBtn:focus { + border: none; + outline: none; + } + + + .finishBtn:hover { + box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1), 0 2px 4px rgba(0, 0, 0, 0.18); + color: white; + } + + .saveBtn { + padding: 3px 18px !important; + + } + + .disabledFinish { + box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.18); + padding: 3px 30px; + color: white; + font-weight: 600; + font-size: 14px; + border: none; + + margin-left: 10px; + } + + .sendHover:hover { + box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1), 0 2px 4px rgba(0, 0, 0, 0.18); + color: white; + } + + .defaultSignBox { + box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.18); + width: 180px; + height: 111px; + padding: 8px 20px; + color: white; + font-weight: 600; + font-size: 14px; + border: none; + border-radius: 2px; + margin-left: 10px; + } + + + .defaultBtn { + box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.18); + padding: 3px 26px; + + color: black; + font-weight: 500; + font-size: 14px; + border: 1px solid gray; + border-radius: 2px; + margin-left: 10px; + + } + + .backBtn { + background-color: white; + } + + .backBtn:hover { + box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1), 0 2px 4px rgba(0, 0, 0, 0.18); + + } + + .defaultBtn:focus { + border: none; + outline: none; + } + + .downloadBtn { + box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.18); + padding: 3px 15px !important; + background-color: rgb(241 79 79); + border: none !important; + color: white !important; + } + + .downloadBtn:hover { + box-shadow: 0 2px 4px rgba(154, 36, 36, 0.1), 0 2px 4px rgba(0, 0, 0, 0.18); + + } + + .printBtn { + box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.18); + padding: 3px 15px !important; + background: #188ae2; + border: none !important; + color: white !important; + } + + .printBtn:hover { + box-shadow: 0 2px 4px rgba(23, 48, 137, 0.1), 0 2px 4px rgba(0, 0, 0, 0.18); + + + } + + .certificateBtn { + box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.18); + padding: 3px 15px !important; + background: #08bc66; + border: none !important; + color: white !important; + text-decoration: none !important; + } + + .certificateBtn:hover { + box-shadow: 0 2px 4px rgba(15, 150, 87, 0.1), 0 2px 4px rgba(0, 0, 0, 0.18); + + } + + + .signerList { + overflow-y: scroll; + max-height: 180px; + + } + + .signerList::-webkit-scrollbar { + display: none; + /* for Chrome, Safari, and Opera */ + } + + .showScroll { + height: 100%; + overflow: scroll; + + } + + .showScroll::-webkit-scrollbar { + display: none; + /* for Chrome, Safari, and Opera */ + } + + .hideScroll { + height: 100%; + overflow: scroll; + } + + .signedStyle { + color: white; + padding: 5px; + font-family: sans-serif; + font-size: 15px !important; + } + + .userName { + font-size: 12px !important; + font-weight: bold !important; + color: #424242 !important; + width: 100px; + white-space: nowrap; + overflow: hidden !important; + text-overflow: ellipsis; + } + + .useEmail { + font-size: 10px; + color: #424242; + font-weight: 500; + width: 100px; + white-space: nowrap; + overflow: hidden !important; + text-overflow: ellipsis; + } + + .spanTagHead { + color: white !important; + font-size: 17px; + font-weight: 500; + } + + .pTagBody { + + font-size: 15px !important; + } + + .signTab { + cursor: pointer !important; + font-weight: 400 !important; + margin-left: 10px !important; + font-size: 15px !important; + } + + .draggable-button { + padding: 10px 20px; + background: #3498db; + color: #fff; + border: none; + cursor: grab; + transition: transform 0.2s; + } + + .draggable-button.dragging { + opacity: 0.5; + /* Reduce opacity while dragging */ + transform: scale(1.1); + /* Apply a scaling effect while dragging */ + } + + + .signatureContainer { + display: flex; + flex-direction: row; + justify-content: space-between; + background-color: #ebebeb; + /* max-height: 800px; */ + /* overflow: auto; */ + } + + .signatureHeader { + display: flex; + flex-direction: row; + justify-content: space-between; + align-items: center; + margin-top: 5px; + } + + .signerComponent { + /* box-shadow: rgba(17, 12, 46, 0.15) 0px 48px 100px 0px; */ + width: 180px; + background-color: white; + height: 100%; + } + + .modalBody { + padding: 1rem !important; + padding-top: 2rem !important; + } + + .signLayoutContainer1 { + padding: 30px; + display: flex; + flex-direction: column; + align-items: center + } + + .signLayoutContainer2 { + display: none; + } + + .preBtn1 { + display: flex; + align-items: center; + } + + .preBtn2 { + display: none; + } + + .headerBtn2 { + display: none; + } + + .uploadImgLogo { + font-size: 50px; + } + + + + .DropdownMenuContent, + .DropdownMenuSubContent { + min-width: 130px; + background-color: #887abf; + border: none; + padding: 5px; + + animation-duration: 400ms; + animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1); + will-change: transform, opacity; + z-index: 30 !important; + } + + .DropdownMenuContent[data-side='top'], + .DropdownMenuSubContent[data-side='top'] { + animation-name: slideDownAndFade; + } + + .DropdownMenuContent[data-side='right'], + .DropdownMenuSubContent[data-side='right'] { + animation-name: slideLeftAndFade; + } + + .DropdownMenuContent[data-side='bottom'], + .DropdownMenuSubContent[data-side='bottom'] { + animation-name: slideUpAndFade; + } + + .DropdownMenuContent[data-side='left'], + .DropdownMenuSubContent[data-side='left'] { + animation-name: slideRightAndFade; + } + + .DropdownMenuItem { + font-size: 13px; + line-height: 1; + color: black; + background-color: #887abf; + display: flex; + align-items: center; + height: 25px; + padding: 0 5px; + position: relative; + padding-left: 25px; + user-select: none; + outline: none; + border: none; + } + + .SelectTrigger { + display: inline-flex; + align-items: center; + justify-content: center; + border-radius: 4px; + padding: 0 70px; + font-size: 13px; + line-height: 1; + height: 35px; + gap: 5px; + border: none; + background-color: #887abf; + + width: 100px; + white-space: nowrap; + overflow: hidden !important; + text-overflow: ellipsis; + } + + .selectEmail { + + align-items: center; + justify-content: center; + border-radius: 4px; + padding: 0 15px; + font-size: 13px; + line-height: 1; + height: 35px; + gap: 5px; + border: none; + background-color: #887abf; + + width: 200px; + white-space: nowrap; + overflow: hidden !important; + text-overflow: ellipsis; + } + + option { + overflow-y: scroll; + } + + .SelectTrigger:hover { + border: none; + outline: none; + } + .selectEmail:hover{ border: none; outline: none; } - - - .finishBtn:hover { - box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1), 0 2px 4px rgba(0, 0, 0, 0.18); - color: white; - } - - .saveBtn { - padding: 3px 18px !important; - - } - - .disabledFinish { - box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.18); - padding: 3px 30px; - color: white; - font-weight: 600; - font-size: 14px; - border: none; - - margin-left: 10px; - } - - .sendHover:hover { - box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1), 0 2px 4px rgba(0, 0, 0, 0.18); - color: white; - } - - .defaultSignBox { - box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.18); - width: 180px; - height: 111px; - padding: 8px 20px; - color: white; - font-weight: 600; - font-size: 14px; - border: none; - border-radius: 2px; - margin-left: 10px; - } - - - .defaultBtn { - box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.18); - padding: 3px 26px; - - color: black; - font-weight: 500; - font-size: 14px; - border: 1px solid gray; - border-radius: 2px; - margin-left: 10px; - - } - - .backBtn { - background-color: white; - } - - .backBtn:hover { - box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1), 0 2px 4px rgba(0, 0, 0, 0.18); - - } - - .defaultBtn:focus { - border: none; - outline: none; - } - - .downloadBtn { - box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.18); - padding: 3px 15px !important; - background-color: rgb(241 79 79); - border: none !important; - color: white !important; - } - - .downloadBtn:hover { - box-shadow: 0 2px 4px rgba(154, 36, 36, 0.1), 0 2px 4px rgba(0, 0, 0, 0.18); - - } - - .printBtn { - box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.18); - padding: 3px 15px !important; - background: #188ae2; - border: none !important; - color: white !important; - } - - .printBtn:hover { - box-shadow: 0 2px 4px rgba(23, 48, 137, 0.1), 0 2px 4px rgba(0, 0, 0, 0.18); - - - } - - .certificateBtn { - box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.18); - padding: 3px 15px !important; - background: #08bc66; - border: none !important; - color: white !important; - text-decoration: none !important; - } - - .certificateBtn:hover { - box-shadow: 0 2px 4px rgba(15, 150, 87, 0.1), 0 2px 4px rgba(0, 0, 0, 0.18); - - } - - .signerList { - overflow-y: scroll; - max-height: 180px; - - } - - .signerList::-webkit-scrollbar { - display: none; - /* for Chrome, Safari, and Opera */ - } - - .showScroll { - height: 100%; - overflow: scroll; - - } - - .showScroll::-webkit-scrollbar { - display: none; - /* for Chrome, Safari, and Opera */ - } - - .hideScroll { - height: 100%; - overflow: scroll; - } - - .signedStyle { - color: white; - padding: 5px; - font-family: sans-serif; - font-size: 15px !important; - } - - .userName { - font-size: 12px !important; - font-weight: bold !important; - color: #424242 !important; - width: 100px; - white-space: nowrap; - overflow: hidden !important; - text-overflow: ellipsis; - } - - .useEmail { - font-size: 10px; - color: #424242; - font-weight: 500; - width: 100px; - white-space: nowrap; - overflow: hidden !important; - text-overflow: ellipsis; - } - - .spanTagHead { - color: white !important; - font-size: 17px; - font-weight: 500; - } - - .pTagBody { - - font-size: 15px !important; - } - - .signTab { - cursor: pointer !important; - font-weight: 400 !important; - margin-left: 10px !important; - font-size: 15px !important; - } - - .draggable-button { - padding: 10px 20px; - background: #3498db; - color: #fff; - border: none; - cursor: grab; - transition: transform 0.2s; - } - - .draggable-button.dragging { - opacity: 0.5; - /* Reduce opacity while dragging */ - transform: scale(1.1); - /* Apply a scaling effect while dragging */ - } - - - .signatureContainer { - display: flex; - flex-direction: row; - justify-content: space-between; - background-color: #ebebeb; - /* max-height: 800px; */ - /* overflow: auto; */ - } - - .signatureHeader { - display: flex; - flex-direction: row; - justify-content: space-between; - align-items: center; - margin-top: 5px; - } - - .signerComponent { - /* box-shadow: rgba(17, 12, 46, 0.15) 0px 48px 100px 0px; */ - width: 180px; - background-color: white; - height: 100%; - } - - .modalBody { - padding: 1rem !important; - padding-top: 2rem !important; - } - - .signLayoutContainer1 { - padding: 30px; - display: flex; - flex-direction: column; - align-items: center - } - - .signLayoutContainer2 { - display: none; - } - - .preBtn1 { - display: flex; - align-items: center; - } - - .preBtn2 { - display: none; - } - - .headerBtn2 { - display: none; - } - - .uploadImgLogo { - font-size: 50px; - } - - - - .DropdownMenuContent, - .DropdownMenuSubContent { - min-width: 130px; - background-color: #887abf; - border: none; - padding: 5px; - - animation-duration: 400ms; - animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1); - will-change: transform, opacity; - z-index: 30 !important; - } - - .DropdownMenuContent[data-side='top'], - .DropdownMenuSubContent[data-side='top'] { - animation-name: slideDownAndFade; - } - - .DropdownMenuContent[data-side='right'], - .DropdownMenuSubContent[data-side='right'] { - animation-name: slideLeftAndFade; - } - - .DropdownMenuContent[data-side='bottom'], - .DropdownMenuSubContent[data-side='bottom'] { - animation-name: slideUpAndFade; - } - - .DropdownMenuContent[data-side='left'], - .DropdownMenuSubContent[data-side='left'] { - animation-name: slideRightAndFade; - } - - .DropdownMenuItem { - font-size: 13px; - line-height: 1; - color: black; - background-color: #887abf; - display: flex; - align-items: center; - height: 25px; - padding: 0 5px; - position: relative; - padding-left: 25px; - user-select: none; - outline: none; - border: none; - } - - .SelectTrigger { - display: inline-flex; - align-items: center; - justify-content: center; - border-radius: 4px; - padding: 0 15px; - font-size: 13px; - line-height: 1; - height: 35px; - gap: 5px; - border: none; - background-color: #887abf; - color: black - } - - option { - overflow-y: scroll; - } - - .SelectTrigger:hover { - border: none; - outline: none; - } - - .SelectTrigger:focus { + + + .SelectTrigger:focus { + /* box-shadow: 0 0 0 2px black; */ + border: none; + outline: none; + } + .selectEmail:focus { /* box-shadow: 0 0 0 2px black; */ border: none; outline: none; } - - .SelectTrigger[data-placeholder] { - color: black; - } - - .SelectIcon { - color: Var(--violet-11); - } - - .SelectContent { - overflow: hidden; - background-color: white; - border-radius: 6px; - box-shadow: 0px 10px 38px -10px rgba(22, 23, 24, 0.35), 0px 10px 20px -15px rgba(22, 23, 24, 0.2); - } - - .SelectViewport { - padding: 5px; - } - - .SelectItem { - font-size: 13px; - line-height: 1; - color: var(--violet-11); - border-radius: 3px; - display: flex; - align-items: center; - height: 25px; - padding: 0 35px 0 25px; - position: relative; - user-select: none; - z-index: 10 !important; - } - - .SelectItem[data-disabled] { - color: var(--mauve-8); - pointer-events: none; - } - - .SelectItem[data-highlighted] { - outline: none; - background-color: var(--violet-9); - color: var(--violet-1); - } - - .SelectLabel { - padding: 0 25px; - font-size: 12px; - line-height: 25px; - color: var(--mauve-11); - } - - .SelectSeparator { - height: 1px; - background-color: var(--violet-6); - margin: 5px; - } - - .SelectItemIndicator { - position: absolute; - left: 0; - width: 25px; - display: inline-flex; - align-items: center; - justify-content: center; - } - - .SelectScrollButton { - display: flex; - align-items: center; - justify-content: center; - height: 25px; - background-color: white; - color: var(--violet-11); - cursor: default; - } - - - - @media screen and (max-width:767px) { - - .showPages { - display: none; - } - - .signatureContainer { - display: flex; - flex-direction: column; - - } - - - .signerComponent { - display: none; - - } - - .preBtn1 { - display: none; - } - - .preBtn2 { - display: flex; - align-items: center; - justify-content: space-between; - background-color: #ebebeb; - padding: 5px 10px; - } - - #navbar { - overflow: hidden; - - z-index: 10; - } - - /* Navbar links */ - #navbar a { - float: left; - display: block; - color: #f2f2f2; - text-align: center; - padding: 14px; - text-decoration: none; - } - - #navbar a.active { - background-color: #4caf50; - color: white; - } - - /* Page content */ - .content { - padding: 16px; - } - - /* The sticky class is added to the navbar - with JS when it reaches its scroll position */ - .stickyHead { - position: fixed; - top: 50px; - left: 0.9rem; - - } - - .stickyfooter { - position: fixed; - bottom: 0px; - right: 0rem; - } - - /* Add some top padding to the page content - to prevent sudden quick movement (as the - navigation bar gets a new position at the top of the - page (position:fixed and top:0) */ - .stickyHead+.content { - padding-top: 60px; - } - - - .signLayoutContainer2 { - display: flex; - flex-direction: row; - justify-content: space-around; - margin-top: 5px; - padding: 2px 5px 10px 5px; - position: sticky; - align-items: center; - - } - - .headerBtn { - display: none; - } - - .headerBtn2 { - display: flex; - flex-direction: column; - justify-content: space-between; - - margin-top: 5px; - } - - .mobileHead { - display: flex; - } - } - - @media screen and (max-width:487px) and (min-width:351px) { - .signatureCanvas { - - width: 300px; - height: 120px; - } - - .penContainer { - width: 300px; - } - - .uploadImgLogo { - font-size: 30px; - } - - .hidePdf { - display: none; - } - - .mobileHead { - display: flex; - } - - } - - @media screen and (max-width:350px) and (min-width:311px) { - .signatureCanvas { - - width: 280px; - height: 112px; - } - - .penContainer { - width: 280px; - } - - .hidePdf { - display: none; - } - - .signTab { - - font-weight: 500 !important; - - font-size: 10px !important; - } - - .uploadImgLogo { - font-size: 25px; - } - - .uploadImg { - - font-size: 10px !important; - } - - .mobileHead { - display: flex; - } - } - - @media screen and (max-width:310px) { - .signatureCanvas { - - width: 230px; - height: 92px; - } - - .penContainer { - width: 230px; - } - - .hidePdf { - display: none; - } - - .signTab { - - font-weight: 500 !important; - - font-size: 10px !important; - } - - .uploadImgLogo { - font-size: 20px; - } - - .uploadImg { - - font-size: 10px !important; - } - - .mobileHead { - display: flex; - } - } \ No newline at end of file + + .SelectTrigger[data-placeholder] { + color: black; + } + + .SelectIcon { + color: Var(--violet-11); + } + + .SelectContent { + overflow: hidden; + background-color: white; + border-radius: 6px; + box-shadow: 0px 10px 38px -10px rgba(22, 23, 24, 0.35), 0px 10px 20px -15px rgba(22, 23, 24, 0.2); + } + + .SelectViewport { + padding: 5px; + } + + .SelectItem { + font-size: 13px; + line-height: 1; + color: var(--violet-11); + border-radius: 3px; + display: flex; + align-items: center; + height: 25px; + padding: 0 35px 0 25px; + position: relative; + user-select: none; + z-index: 10 !important; + } + + .SelectItem[data-disabled] { + color: var(--mauve-8); + pointer-events: none; + } + + .SelectItem[data-highlighted] { + outline: none; + background-color: var(--violet-9); + color: var(--violet-1); + } + + .SelectLabel { + padding: 0 25px; + font-size: 12px; + line-height: 25px; + color: var(--mauve-11); + } + + .SelectSeparator { + height: 1px; + background-color: var(--violet-6); + margin: 5px; + } + + .SelectItemIndicator { + position: absolute; + left: 0; + width: 25px; + display: inline-flex; + align-items: center; + justify-content: center; + } + + .SelectScrollButton { + display: flex; + align-items: center; + justify-content: center; + height: 25px; + background-color: white; + color: var(--violet-11); + cursor: default; + } + + + + @media screen and (max-width:766px) { + + .showPages { + display: none; + } + + .signatureContainer { + display: flex; + flex-direction: column; + + } + + + .signerComponent { + display: none; + + } + + .preBtn1 { + display: none; + } + + .preBtn2 { + display: flex; + align-items: center; + justify-content: space-between; + background-color: #ebebeb; + padding: 5px 10px; + } + + #navbar { + overflow: hidden; + + z-index: 10; + } + + /* Navbar links */ + #navbar a { + float: left; + display: block; + color: #f2f2f2; + text-align: center; + padding: 14px; + text-decoration: none; + } + + #navbar a.active { + background-color: #4caf50; + color: white; + } + + /* Page content */ + .content { + padding: 16px; + } + + /* The sticky class is added to the navbar + with JS when it reaches its scroll position */ + .stickyHead { + position: fixed; + top: 50px; + left: 0.9rem; + + } + + .stickyfooter { + position: fixed; + bottom: 0px; + right: 0rem; + } + + /* Add some top padding to the page content + to prevent sudden quick movement (as the + navigation bar gets a new position at the top of the + page (position:fixed and top:0) */ + .stickyHead+.content { + padding-top: 60px; + } + + + .signLayoutContainer2 { + display: flex; + flex-direction: row; + justify-content: space-around; + margin-top: 5px; + padding: 2px 5px 10px 5px; + position: sticky; + align-items: center; + + } + + .headerBtn { + display: none; + } + + .headerBtn2 { + display: flex; + flex-direction: column; + justify-content: space-between; + + margin-top: 5px; + } + + .mobileHead { + display: flex; + } + } + + @media screen and (max-width:487px) and (min-width:351px) { + .signatureCanvas { + + width: 300px; + height: 120px; + } + + .penContainer { + width: 300px; + } + + .uploadImgLogo { + font-size: 30px; + } + + .hidePdf { + display: none; + } + + .mobileHead { + display: flex; + } + + } + + @media screen and (max-width:350px) and (min-width:311px) { + .signatureCanvas { + + width: 280px; + height: 112px; + } + + .penContainer { + width: 280px; + } + + .hidePdf { + display: none; + } + + .signTab { + + font-weight: 500 !important; + + font-size: 10px !important; + } + + .uploadImgLogo { + font-size: 25px; + } + + .uploadImg { + + font-size: 10px !important; + } + + .mobileHead { + display: flex; + } + } + + @media screen and (max-width:310px) { + .signatureCanvas { + + width: 230px; + height: 92px; + } + + .penContainer { + width: 230px; + } + + .hidePdf { + display: none; + } + + .signTab { + + font-weight: 500 !important; + + font-size: 10px !important; + } + + .uploadImgLogo { + font-size: 20px; + } + + .uploadImg { + + font-size: 10px !important; + } + + .mobileHead { + display: flex; + } + } \ No newline at end of file diff --git a/microfrontends/SignDocuments/src/utils/Utils.js b/microfrontends/SignDocuments/src/utils/Utils.js index c011fc0ec..138b22e62 100644 --- a/microfrontends/SignDocuments/src/utils/Utils.js +++ b/microfrontends/SignDocuments/src/utils/Utils.js @@ -62,6 +62,7 @@ export function onSaveImage(xyPostion, index, signKey, imgWH, image) { let newWidth, nweHeight; const aspectRatio = imgWH.width / imgWH.height; const getXYdata = xyPostion[index].pos; + if (aspectRatio === 1) { newWidth = aspectRatio * 100; nweHeight = aspectRatio * 100; @@ -78,13 +79,15 @@ export function onSaveImage(xyPostion, index, signKey, imgWH, image) { newWidth = aspectRatio * 10; nweHeight = 10; } - const getPosData = getXYdata; - const addSign = getPosData.map((url, ind) => { + + let getPosData = xyPostion[index].pos.filter((data) => data.key === signKey); + + const addSign = getXYdata.map((url, ind) => { if (url.key === signKey) { return { ...url, - Width: newWidth, - Height: nweHeight, + Width: getPosData[0].Width ? getPosData[0].Width : 150, + Height: getPosData[0].Height ? getPosData[0].Height : 60, SignUrl: image.src, ImageType: image.imgType }; @@ -103,8 +106,7 @@ export function onSaveImage(xyPostion, index, signKey, imgWH, image) { } else { const getXYdata = xyPostion[index].pos; - const getPosData = getXYdata; - + let getPosData = xyPostion[index].pos.filter((data) => data.key === signKey); const aspectRatio = imgWH.width / imgWH.height; let newWidth, newHeight; @@ -125,12 +127,12 @@ export function onSaveImage(xyPostion, index, signKey, imgWH, image) { newHeight = 10; } - const addSign = getPosData.map((url, ind) => { + const addSign = getXYdata.map((url, ind) => { if (url.key === signKey) { return { ...url, - Width: newWidth, - Height: newHeight, + Width: getPosData[0].Width ? getPosData[0].Width : 150, + Height: getPosData[0].Height ? getPosData[0].Height : 60, SignUrl: image.src, ImageType: image.imgType }; @@ -151,15 +153,10 @@ export function onSaveImage(xyPostion, index, signKey, imgWH, image) { //function for save button to save signature or image url export function onSaveSign(xyPostion, index, signKey, signatureImg) { - // const updateFilter = xyPostion[index].pos.filter( - // (data) => data.key === signKey && data.SignUrl - // ); - let getXYdata = xyPostion[index].pos; - let getPosData = getXYdata; - // if (updateFilter.length > 0) { - // updateFilter[0].SignUrl = signatureImg; - const addSign = getPosData.map((url, ind) => { + let getPosData = xyPostion[index].pos.filter((data) => data.key === signKey); + + const addSign = getXYdata.map((url, ind) => { if (url.key === signKey) { return { ...url, @@ -178,27 +175,6 @@ export function onSaveSign(xyPostion, index, signKey, signatureImg) { return obj; }); return newUpdateUrl; - // } else { - // const addSign = getPosData.map((url, ind) => { - // if (url.key === signKey) { - // return { - // ...url, - // SignUrl: signatureImg, - // Width: getPosData[0].Width ? getPosData[0].Width : 150, - // Height: getPosData[0].Height ? getPosData[0].Height : 60 - // }; - // } - // return url; - // }); - - // const newUpdateUrl = xyPostion.map((obj, ind) => { - // if (ind === index) { - // return { ...obj, pos: addSign }; - // } - // return obj; - // }); - // return newUpdateUrl; - // } } //function for getting contract_User details @@ -278,5 +254,3 @@ export const contactBookName = async (objectId, className) => { }); return result; }; - - From 540e5e29972396003bc75b29e51e761c754be120 Mon Sep 17 00:00:00 2001 From: prafull-opensignlabs Date: Fri, 3 Nov 2023 22:14:42 +0530 Subject: [PATCH 26/31] add homepage param in microfrontend --- microfrontends/SignDocuments/package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/microfrontends/SignDocuments/package.json b/microfrontends/SignDocuments/package.json index 3c8e28903..a5b1aa0fa 100644 --- a/microfrontends/SignDocuments/package.json +++ b/microfrontends/SignDocuments/package.json @@ -2,6 +2,7 @@ "name": "signmicroapp", "version": "0.1.0", "private": true, + "homepage": "mfbuild", "dependencies": { "@radix-ui/themes": "^1.1.2", "@react-pdf/renderer": "^3.1.9", From 71c5f5923ffceba852ab2a5ae619de4f52571ea9 Mon Sep 17 00:00:00 2001 From: prafull-opensignlabs Date: Fri, 3 Nov 2023 22:38:41 +0530 Subject: [PATCH 27/31] change homepage param in microfrontend --- microfrontends/SignDocuments/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/microfrontends/SignDocuments/package.json b/microfrontends/SignDocuments/package.json index a5b1aa0fa..85f724853 100644 --- a/microfrontends/SignDocuments/package.json +++ b/microfrontends/SignDocuments/package.json @@ -2,7 +2,7 @@ "name": "signmicroapp", "version": "0.1.0", "private": true, - "homepage": "mfbuild", + "homepage": "/mfbuild", "dependencies": { "@radix-ui/themes": "^1.1.2", "@react-pdf/renderer": "^3.1.9", From 184b401582914668d1d03440f2f5752485b9ae18 Mon Sep 17 00:00:00 2001 From: prafull-opensignlabs Date: Fri, 3 Nov 2023 22:52:09 +0530 Subject: [PATCH 28/31] change homepage url of microfrontend --- apps/OpenSignServer/index.js | 1 + microfrontends/SignDocuments/package.json | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/OpenSignServer/index.js b/apps/OpenSignServer/index.js index f0d494c44..814d9cf58 100644 --- a/apps/OpenSignServer/index.js +++ b/apps/OpenSignServer/index.js @@ -63,6 +63,7 @@ export const config = { publicServerURL: process.env.SERVER_URL || 'http://localhost:8080/app', // Your apps name. This will appear in the subject and body of the emails that are sent. appName: 'Open Sign', + allowClientClassCreation: false, emailAdapter: process.env.MAILGUN_API_KEY ? { module: 'parse-server-api-mail-adapter', diff --git a/microfrontends/SignDocuments/package.json b/microfrontends/SignDocuments/package.json index 85f724853..90961884f 100644 --- a/microfrontends/SignDocuments/package.json +++ b/microfrontends/SignDocuments/package.json @@ -2,7 +2,7 @@ "name": "signmicroapp", "version": "0.1.0", "private": true, - "homepage": "/mfbuild", + "homepage": "./mfbuild", "dependencies": { "@radix-ui/themes": "^1.1.2", "@react-pdf/renderer": "^3.1.9", From e8350c331d0a919ca19df01a85c100689f30462d Mon Sep 17 00:00:00 2001 From: prafull-opensignlabs Date: Fri, 3 Nov 2023 23:27:44 +0530 Subject: [PATCH 29/31] add Public_url in build scripts of microfrontend --- microfrontends/SignDocuments/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/microfrontends/SignDocuments/package.json b/microfrontends/SignDocuments/package.json index 90961884f..97970e988 100644 --- a/microfrontends/SignDocuments/package.json +++ b/microfrontends/SignDocuments/package.json @@ -36,7 +36,7 @@ }, "scripts": { "start": "mf-cra start", - "build": "CI=false && BUILD_PATH='./mfbuild' mf-cra build && mv mfbuild ../../apps/OpenSign/public", + "build": "CI=false && PUBLIC_URL=./mfbuild BUILD_PATH='./mfbuild' mf-cra build && mv mfbuild ../../apps/OpenSign/public", "test": "react-scripts test", "eject": "react-scripts eject" }, From a7d0b10c95a0874d16c1a522faecd4d626e17e23 Mon Sep 17 00:00:00 2001 From: Andrew <148278535+andrew-opensignlabs@users.noreply.github.com> Date: Sun, 5 Nov 2023 03:22:22 +0530 Subject: [PATCH 30/31] docs: Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index c2a7d86ea..d6e5a235b 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@
-The free open source alternative to DocuSign | PandaDoc | SignNow | Adobe Sign | Smartwaiver | SignRequest | HelloSign | Zoho sign. +The free and open source alternative to DocuSign [![Average time to resolve an issue](http://isitmaintained.com/badge/resolution/opensignlabs/opensign.svg)](http://isitmaintained.com/project/opensignlabs/opensign "Average time to resolve an issue") [![All Contributors](https://img.shields.io/github/all-contributors/opensignlabs/opensign?color=ee8449&style=flat-square)](#contributors) @@ -23,7 +23,7 @@ The free open source alternative to DocuSign | PandaDoc | SignNow | Adobe Sign | LinkedIn -## An Open-Source Alternative to DocuSign, PandaDoc, SignNow, Adobe Sign, Smartwaiver, SignRequest, and HelloSign +## An open-source document e-signing solution ---
From 408d84daedccb37c352f174656254fff64fe5dc2 Mon Sep 17 00:00:00 2001 From: prafull-opensignlabs Date: Sun, 5 Nov 2023 11:24:06 +0530 Subject: [PATCH 31/31] fix: file upload issue --- .../src/components/fields/FileUpload.js | 72 ++++++++----------- 1 file changed, 31 insertions(+), 41 deletions(-) diff --git a/apps/OpenSign/src/components/fields/FileUpload.js b/apps/OpenSign/src/components/fields/FileUpload.js index 2b0840276..83a37eed7 100644 --- a/apps/OpenSign/src/components/fields/FileUpload.js +++ b/apps/OpenSign/src/components/fields/FileUpload.js @@ -1,8 +1,7 @@ import React, { useState, useEffect } from "react"; import { SaveFileSize } from "../../constant/saveFileSize"; -// import Parse from "parse"; -// import sanitizeFileName from "../../primitives/sanitizeFileName"; -import axios from "axios"; +import Parse from "parse"; +import sanitizeFileName from "../../primitives/sanitizeFileName"; const FileUpload = (props) => { const [parseBaseUrl] = useState(localStorage.getItem("baseUrl")); @@ -69,53 +68,44 @@ const FileUpload = (props) => { }; const handleFileUpload = async (file) => { + Parse.serverURL = parseBaseUrl; + Parse.initialize(parseAppId); setfileload(true); - const file_url = parseBaseUrl.slice(0, -4); - const url = `${file_url}file_upload`; - const formData = new FormData(); - formData.append("file", file); - const config = { - headers: { - "content-type": "multipart/form-data", - "X-Parse-Application-Id": parseAppId - }, - onUploadProgress: function (progressEvent) { - var percentCompleted = Math.round( - (progressEvent.loaded * 100) / progressEvent.total - ); - setpercentage(percentCompleted); - } - }; + const size = file.size; + const fileName = file.name; + const name = sanitizeFileName(fileName); + const pdfFile = file; + const parseFile = new Parse.File(name, pdfFile); try { - await axios - .post(url, formData, config) - .then((res) => { - if (res.data.status === "Error") { - alert(res.data.message); + const response = await parseFile.save({ + progress: (progressValue, loaded, total, { type }) => { + if (type === "upload" && progressValue !== null) { + const percentCompleted = Math.round((loaded * 100) / total); + console.log("percentCompleted ", percentCompleted); + setpercentage(percentCompleted); } - setFileUpload(res.data.imageUrl); - props.onChange(res.data.imageUrl); - setfileload(false); - setpercentage(0); + } + }); - if (res.data.imageUrl) { - SaveFileSize(file.size, res.data.imageUrl); - return res.data.imageUrl; - } - }) - .catch((err) => { - alert(`${err.message}`); - setfileload(false); - setpercentage(0); - }); + setFileUpload(response.url()); + props.onChange(response.url()); + setfileload(false); + // The response object will contain information about the uploaded file + // console.log("File uploaded:", response); + + // You can access the URL of the uploaded file using response.url() + // console.log("File URL:", response.url()); + if (response.url()) { + SaveFileSize(size, response.url()); + return response.url(); + } } catch (error) { - alert(error.message); setfileload(false); setpercentage(0); + console.error("Error uploading file:", error); } }; - let fileView = props.formData && props.schema.uploadtype === "s3viajw" ? null : props.formData && @@ -124,7 +114,7 @@ const FileUpload = (props) => { Download