Skip to content

Commit bfae7f2

Browse files
Merge branch 'staging' into placeholder-mobile-view2
2 parents 450a971 + fe90711 commit bfae7f2

File tree

18 files changed

+1475
-1113
lines changed

18 files changed

+1475
-1113
lines changed

.env.local_dev

Lines changed: 57 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,69 @@ DO_SECRET_ACCESS_KEY=
4242
# Digital ocean spaces region or AWS s3 region
4343
DO_REGION=us-west
4444
# local storage
45-
USE_LOCAL=TRUE
45+
USE_LOCAL=FALSE
4646

4747
# Email mailgun config (The app will not initialize if any of these 3 variables are not set) *********************************************************************************************************************
4848
MAILGUN_API_KEY=XXXXX
4949
MAILGUN_DOMAIN=mail.yourdomain.com
5050
5151

5252
# Base64 encoded PFX or p12 document signing certificate file *********************************************************************************************************************
53-
PFX_BASE64=
53+
PFX_BASE64='MIIKLwIBAzCCCeUGCSqGSIb3DQEHAaCCCdYEggnSMIIJzjCCBEIGCSqGSIb3DQEH
54+
BqCCBDMwggQvAgEAMIIEKAYJKoZIhvcNAQcBMFcGCSqGSIb3DQEFDTBKMCkGCSqG
55+
SIb3DQEFDDAcBAh6cQqVpHfTzAICCAAwDAYIKoZIhvcNAgkFADAdBglghkgBZQME
56+
ASoEEFKEIGJTTRo3voO/FvsXs7yAggPAI7rMCboTFFBfdMuuV3Y9/xfphAgdGD7P
57+
0xAN10CcmXlMtedc8cRxOaD9n3Q7zJx5iIbqEGDTc0dgp5EtdWsGl7MP76iHkSfB
58+
ZUPc13nbnRU4Nq4hNFcSj1m6NVa0lT9UobbTsG+wUkJn8aLfijzZ1OY82KLlKUoJ
59+
lqLsQ1yZkeLiLKI0aEew/2vzfiLUX9A99qnCRoryo8ZbLiWl0Vu/FEKM5mqIRFEp
60+
BKeSUsRxBfJCMZ2Ks5t4/MTCV+yrcsuhLPF/AJpzKfIinEFDhm7MxP4RXtk2LWNe
61+
+EO2GuFRjZCfsMO0oNWybFmDeNDMCHZj5TeoqL1JwAV5e1lEeqR38v4Wcr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xK1WCHe/9enY5y/C8YohL8h5tEvInAQconj
94+
lJ2r9qX8iBmIupJij5M5Ebza8HQ4aVMdHu/s05Vj9BC6K0ok3h+DFTj2gUBD24sp
95+
APHic0DmNnciUQuHuuoW/1SVb6I1HJswsgcC8CekvoXF26ygwWhJPyqw+5djip2w
96+
I/l3uOnPPUWZQHKhnBH4noZydrzBBJN1po9dkxb8LKuKZDEcnKo+tQrTnZJaFRXK
97+
pQDsAjQ0HcYi8ZqN/GPezXOqzRgvObevXeDYTJrNejr46B1HqjPw8doai+AEf//1
98+
iiM9EK4y3bGbX837oebTByRi112AOctISHTWbF0zdFMiBO9X9PML4n3i14ToqLH1
99+
EUp0WtCdKLJmrRnO9PKJUMpce3yNu6oRSBzB4EkgUMOTVx9tM66h/gcR3wr+qKJP
100+
1EABMbbCsJeYYLujhQHVh0JluqLBXYuCmr5n6o8qmonj5tEfTn9zs2gi0OvKTliH
101+
wRXWsar004alt8D8o4M/Oqu3qyVV1O8BlVEofUC1CfAMIh/T1NJBeKG/FPfAFoEz
102+
9liLLkoDvGvFVJ4Ezy4BaPtg+G3yU/SeiruwsCB3unHRD7G6VvS4jY2B8vEYl0yM
103+
Z1mLFbKK8CIEvg8+v/vbc0noYUOzd6bkwh6Y6cziR/u78y2nALYZpQK+3XiVVH/v
104+
SaVoDckZgUwAX+dMd1P4U3a487MPXBZZmLVFMHTuv3NvW6NIQCMd4l35ViRd7YcS
105+
V2QDKTnUtPN2MSUwIwYJKoZIhvcNAQkVMRYEFMSz7PlBO5VzTDqC/foidPWrMjkw
106+
MEEwMTANBglghkgBZQMEAgEFAAQgPlLuG+67SxPOEPbgFuEnVgewvY6LUzFmrprx
107+
c6yryFgECIld0S5kDk7JAgIIAA=='
54108

55109
# Provide Pass pharse of above PFX or p12 document
56-
PASS_PHRASE=
110+
PASS_PHRASE=

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,5 @@
2222
npm-debug.log*
2323
yarn-debug.log*
2424
yarn-error.log*
25+
apps/OpenSign/public/mfbuild/*
26+
microfrontends/SignDocuments/build/*

INSTALLATION.md

Lines changed: 56 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,5 +88,60 @@ You can install all 3 components on digital ocean using the button below -
8888

8989
## Localhost(Docker)
9090

91+
For local Setup we need to need following prerequisite:
92+
93+
Environment Varaibles:
94+
95+
| Environment Varibale | Value | Description |
96+
| ------------- | ------------- | ------------- |
97+
| CI | false | Set CI to false while running the app locally |
98+
| PUBLIC_URL | http://localhost:3000 | Set it to the URL form where the app home page will be accessed |
99+
| GENERATE_SOURCEMAP | false | Set it to true if you want to generate the Sourcemap for debugging |
100+
| REACT_APP_SERVERURL | http://localhost:8080/app | 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) |
101+
| REACT_APP_APPID | http://localhost:3000 | Set it to the URL form where the app home page will be accessed |
102+
| PUBLIC_URL | opensignstgn | 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. |
103+
| APP_ID | opensignstgn | 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. |
104+
| appName | open_sign_server | Name of the app. It will be visible in the verification emails sent out. |
105+
| MASTER_KEY | XnAadwKxxByMr | 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. |
106+
| MONGODB_URI | mongodb://host.docker.internal:27017/OpenSignDB | Mongodb URI to connect to |
107+
| PARSE_MOUNT |/app | 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. |
108+
| SERVER_URL | http://127.0.0.1:8080/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) |
109+
| DO_SPACE | DOSPACENAME | Digital ocean space name or AWS S3 bucket name for uploading documents |
110+
| DO_ENDPOINT | ams3.digitaloceanspaces.com | Digital ocean spaces endpoint or AWS S3 endpoint for uploading documents |
111+
| DO_BASEURL |https://DOSPACENAME.ams3.digitaloceanspaces.com | Digital ocean baseurl or AWS S3 base URL |
112+
| DO_ACCESS_KEY_ID | YOUR_S3_ACCESS_ID | Digital ocean spaces access key ID or AWS s3 Access key ID for uploading the docs |
113+
| DO_SECRET_ACCESS_KEY | YOUR_S3_ACCESS_KEY | Digital ocean spaces secret access key or AWS s3 secret access key for uploading the docs |
114+
| DO_REGION | YOUR_S3_REGION | Digital ocean spaces region or AWS s3 region |
115+
| USE_LOCAL | FALSE | To use local file storage to save file |
116+
| MAILGUN_API_KEY | YOUR_MAILGUNAPI_KEY | Mailgun API Key |
117+
| MAILGUN_DOMAIN | YOUR_MAILGUNAPI_DOMAIN | Mailgun API Domain |
118+
| MAILGUN_SENDER | - | Mailgun Sender Mail ID |
119+
| PFX_BASE64 | - | Base64 encoded PFX or p12 document signing certificate file. You can generate base64 encoded self sign certificate using the passphrase `emudhra` |
120+
121+
# Steps to Generate Self Sign Certificate
122+
```
123+
# execute below command and use passphrase emudhra
124+
openssl genrsa -des3 -out ./cert/local_dev.key 2048
125+
openssl req -key ./cert/local_dev.key -new -x509 -days 365 -out ./cert/local_dev.crt
126+
openssl pkcs12 -inkey ./cert/local_dev.key -in ./cert/local_dev.crt -export -out ./cert/local_dev.pfx
127+
openssl base64 -in ./cert/local_dev.pfx -out ./cert/base64_pfx
128+
```
129+
130+
# CORS Configuration
131+
132+
As document storage is delegated to S3-compatible services that reside in a different host than the OpenSign one, document operations (loading, storing, deleting) are subject to [Cross-Origin Resource Sharing](https://en.wikipedia.org/wiki/Cross-origin_resource_sharing) restriction policies; as a consequence, OpenSign app may fail with (browser console) errors like the following:
133+
```
134+
Access to fetch at 'https://foo.nyc3.digitaloceanspaces.com/exported_file_4627_0000-00-00T00%3A45%3A43.344Z.pdf'
135+
from origin 'http://localhost:3000' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header
136+
is present on the requested resource. If an opaque response serves your needs, set the request's mode to
137+
'no-cors' to fetch the resource with CORS disabled.
138+
```
139+
140+
In order to address this, your document storage system must be instructed to accept requests from other hosts; below the relevant documentation links:
141+
- [How to Configure CORS on DigitalOcean Spaces](https://docs.digitalocean.com/products/spaces/how-to/configure-cors/)
142+
- [Configuring cross-origin resource sharing on AWS S3](https://docs.aws.amazon.com/AmazonS3/latest/userguide/enabling-cors-examples.html)
143+
144+
# Build Local Environment
145+
91146
Below are the steps to follow -
92-
- Execute `make build`
147+
- Execute `make build`

apps/OpenSign/src/components/LoginGoogle.js

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,32 @@ const GoogleSignInBtn = ({
141141
alert("Please fill required details!");
142142
}
143143
};
144+
const handleCloseModal = () => {
145+
setIsModal(false);
146+
Parse.User.logOut();
147+
148+
let appdata = localStorage.getItem("userSettings");
149+
let applogo = localStorage.getItem("appLogo");
150+
let appName = localStorage.getItem("appName");
151+
let defaultmenuid = localStorage.getItem("defaultmenuid");
152+
let PageLanding = localStorage.getItem("PageLanding");
153+
let domain = localStorage.getItem("domain");
154+
let _appName = localStorage.getItem("_appName");
155+
let baseUrl = localStorage.getItem("BaseUrl12");
156+
let appid = localStorage.getItem("AppID12");
157+
158+
localStorage.clear();
159+
160+
localStorage.setItem("appLogo", applogo);
161+
localStorage.setItem("appName", appName);
162+
localStorage.setItem("_appName", _appName);
163+
localStorage.setItem("defaultmenuid", defaultmenuid);
164+
localStorage.setItem("PageLanding", PageLanding);
165+
localStorage.setItem("domain", domain);
166+
localStorage.setItem("userSettings", appdata);
167+
localStorage.setItem("BaseUrl12", baseUrl);
168+
localStorage.setItem("AppID12", appid);
169+
};
144170
return (
145171
<div style={{ position: "relative" }}>
146172
{thirdpartyLoader && (
@@ -259,16 +285,16 @@ const GoogleSignInBtn = ({
259285
<div>
260286
<button
261287
type="button"
262-
className="btn btn-secondary"
263-
onClick={() => setIsModal(false)}
288+
className="bg-[#6c757d] p-2 text-white rounded"
289+
onClick={handleCloseModal}
264290
style={{ marginRight: 10, width: 90 }}
265291
>
266292
Cancel
267293
</button>
268294
<button
269295
type="button"
296+
className="bg-[#17a2b8] p-2 text-white rounded"
270297
onClick={() => handleSubmitbtn()}
271-
className="btn btn-info"
272298
>
273299
Sign up
274300
</button>

apps/OpenSign/src/components/ReportMicroapp.js

Lines changed: 26 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import useFederatedComponent from "mf-cra";
22
import React, { Suspense, useEffect } from "react";
3-
import { useNavigate, useParams } from "react-router-dom";
3+
import { useParams } from "react-router-dom";
44

55
const MicroappModal = () => {
66
const { remoteApp } = useParams();
@@ -28,60 +28,36 @@ const MicroappModal = () => {
2828
}
2929
// console.log("app ", remoteApp);
3030
const { Component: RemoteComponent } = useFederatedComponent(obj);
31-
const navigate = useNavigate();
3231
// console.log("RemoteComponent ", RemoteComponent);
3332
return (
3433
<div className="w-full h-full flex items-center justify-center ">
35-
{/* <!-- Modal Container --> */}
36-
<div className="bg-white rounded-lg shadow-lg w-full">
37-
{/* <!-- Modal Header --> */}
38-
<div className="flex w-full items-center border-b-2 mb-2 p-2">
39-
<button
40-
className="focus:outline-none bg-blue-500 text-white text-sm shadow px-2.5 py-1 rounded"
41-
id="closeModal"
42-
onClick={(e) => {
43-
e.preventDefault();
44-
// setIsModal(false);
45-
navigate(-1);
34+
<div className="w-full">
35+
<Suspense
36+
fallback={
37+
<div style={{ height: "300px" }}>
38+
<div
39+
style={{
40+
marginLeft: "45%",
41+
marginTop: "150px",
42+
fontSize: "45px",
43+
color: "#3dd3e0"
44+
}}
45+
className="loader-37"
46+
></div>
47+
</div>
48+
}
49+
>
50+
<div
51+
style={{
52+
backgroundColor: "#ffffff",
53+
width: "100%",
54+
overflow: "hidden",
55+
minHeight: "50vh"
4656
}}
4757
>
48-
Back
49-
</button>
50-
{localStorage.getItem("domain") && (
51-
<p className="flex-1 w-full text-sm md:text-base text-black text-center">
52-
{localStorage.getItem("domain") === "contracts" ? "Document" : ""}
53-
</p>
54-
)}
55-
</div>
56-
{/* <!-- Modal Body --> */}
57-
<div className="w-full">
58-
<Suspense
59-
fallback={
60-
<div style={{ height: "300px" }}>
61-
<div
62-
style={{
63-
marginLeft: "45%",
64-
marginTop: "150px",
65-
fontSize: "45px",
66-
color: "#3dd3e0"
67-
}}
68-
className="loader-37"
69-
></div>
70-
</div>
71-
}
72-
>
73-
<div
74-
style={{
75-
backgroundColor: "#ffffff",
76-
width: "100%",
77-
overflow: "hidden",
78-
minHeight: "50vh"
79-
}}
80-
>
81-
{RemoteComponent && <RemoteComponent />}
82-
</div>
83-
</Suspense>
84-
</div>
58+
{RemoteComponent && <RemoteComponent />}
59+
</div>
60+
</Suspense>
8561
</div>
8662
</div>
8763
);

0 commit comments

Comments
 (0)