Skip to content

Commit 6bd9ac0

Browse files
Merge pull request #12 from OpenSignLabs/staging
Update
2 parents d42e11c + d4be4ae commit 6bd9ac0

File tree

15 files changed

+197
-56
lines changed

15 files changed

+197
-56
lines changed

.env.example

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,3 +47,6 @@ [email protected]
4747

4848
# Base64 encoded PFX or p12 document signing certificate file *********************************************************************************************************************
4949
PFX_BASE64=
50+
51+
# Provide Pass pharse of above PFX or p12 document
52+
PASS_PHRASE=

.env.local_dev

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,3 +51,6 @@ [email protected]
5151

5252
# Base64 encoded PFX or p12 document signing certificate file *********************************************************************************************************************
5353
PFX_BASE64=
54+
55+
# Provide Pass pharse of above PFX or p12 document
56+
PASS_PHRASE=

apps/OpenSign/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@
4040
"web-vitals": "^2.1.4"
4141
},
4242
"scripts": {
43-
"start": "mf-cra start",
44-
"start-prod": "serve -s build",
43+
"start": "serve -s build",
44+
"start-dev": "mf-cra start",
4545
"build": "rm -rf public/mfbuild && npm run micro && CI=false && mf-cra build",
4646
"micro": "cd ../../microfrontends/SignDocuments && npm install && npm run build",
4747
"test": "react-scripts test",

apps/OpenSign/src/App.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import PageNotFound from "./routes/PageNotFound";
1414
import ForgetPassword from "./routes/ForgetPassword";
1515
import ChangePassword from "./routes/ChangePassword";
1616
import ReportMicroapp from "./components/ReportMicroapp";
17+
import LoadMf from "./routes/LoadMf";
1718

1819
function App() {
1920
const [isloading, setIsLoading] = useState(true);
@@ -59,6 +60,7 @@ function App() {
5960
<Routes>
6061
<Route exact path="/" element={<Login />} />
6162
<Route exact path="/signup" element={<Signup />} />
63+
<Route exact path="/loadmf/:remoteApp/*" element={<LoadMf />} />
6264
<Route exact path="/forgetpassword" element={<ForgetPassword />} />
6365
{process.env.REACT_APP_ENABLE_SUBSCRIPTION && (
6466
<>

apps/OpenSign/src/primitives/GetReportDisplay.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ const ReportTable = ({
9393
{List?.length > 0 ? (
9494
<>
9595
{currentLists.map((item, index) => (
96-
<tr className="border-t-[1px]" key={index}>
96+
<tr className="border-y-[1px]" key={index}>
9797
<td className="px-4 py-2">{index + 1}</td>
9898
<td className="px-4 py-2 font-semibold">{item?.Name} </td>
9999
<td className="px-4 py-2">{item?.Note || "-"}</td>
@@ -153,7 +153,7 @@ const ReportTable = ({
153153
)}
154154
</tbody>
155155
</table>
156-
<div className="flex flex-wrap items-center gap-2 p-2 border-t-[1px]">
156+
<div className="flex flex-wrap items-center gap-2 p-2 ">
157157
{List.length > 10 && (
158158
<>
159159
{currentPage > 1 && (

apps/OpenSign/src/routes/LoadMf.js

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
import { Suspense } from "react";
2+
import { useParams } from "react-router-dom";
3+
import useFederatedComponent from "mf-cra";
4+
import React from "react";
5+
import Title from "../components/Title";
6+
function RemoteApp({ app }) {
7+
// console.log("app ", app);
8+
const { Component: RemoteComponent } = useFederatedComponent(app);
9+
// console.log("RemoteComponent ", RemoteComponent);
10+
return (
11+
<>
12+
<Title title={app.remoteName} />
13+
<Suspense
14+
fallback={
15+
<div style={{ height: "300px" }}>
16+
<div
17+
style={{
18+
marginLeft: "45%",
19+
marginTop: "150px",
20+
fontSize: "45px",
21+
color: "#3dd3e0"
22+
}}
23+
className="loader-37"
24+
></div>
25+
</div>
26+
}
27+
>
28+
<div
29+
style={{
30+
boxShadow: "0 1px 3px 0 rgba(0, 0, 0, 0.33)",
31+
backgroundColor: "#ffffff",
32+
width: "100%",
33+
overflow: "hidden",
34+
borderRadius: 3,
35+
minHeight: "70vh"
36+
}}
37+
>
38+
{RemoteComponent && <RemoteComponent />}
39+
</div>
40+
</Suspense>
41+
</>
42+
);
43+
}
44+
function checkObjectProperties(obj) {
45+
// Check if all three properties exist in the object
46+
if (
47+
obj &&
48+
obj.remoteName !== undefined &&
49+
obj.remoteUrl !== undefined &&
50+
obj.moduleToLoad !== undefined
51+
) {
52+
return true; // All properties are present
53+
} else {
54+
return false; // At least one property is missing
55+
}
56+
}
57+
export default function RemoteAppContainer() {
58+
const { remoteApp } = useParams();
59+
60+
const obj = {
61+
remoteUrl: window.location.origin + "/mfbuild/remoteEntry.js",
62+
moduleToLoad: "./AppRoutes",
63+
remoteName: remoteApp
64+
};
65+
// console.log("obj ", obj);
66+
const isMf = checkObjectProperties(obj);
67+
if (isMf) {
68+
const appToLoad = obj;
69+
return <RemoteApp app={appToLoad} />;
70+
} else {
71+
return (
72+
<div className="flex items-center justify-center h-screen w-full bg-white rounded">
73+
<div className="text-center">
74+
<h1 className="text-[60px] lg:text-[120px] font-semibold text-black">
75+
404
76+
</h1>
77+
<p className="text-[30px] lg:text-[50px] text-black">
78+
Page Not Found
79+
</p>
80+
</div>
81+
</div>
82+
);
83+
}
84+
}

apps/OpenSign/src/routes/Login.js

Lines changed: 46 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -744,7 +744,7 @@ function Login(props) {
744744
};
745745

746746
const GetLoginData = async () => {
747-
setState({...state, loading: true})
747+
setState({ ...state, loading: true })
748748
try {
749749
Parse.serverURL = localStorage.getItem("baseUrl");
750750
Parse.initialize(localStorage.getItem("parseAppId"));
@@ -925,6 +925,7 @@ function Login(props) {
925925
<Title title={"Login Page"} />
926926
{state.loading && (
927927
<div
928+
aria-live="assertive"
928929
style={{
929930
position: "fixed",
930931
width: "100vw",
@@ -936,63 +937,66 @@ function Login(props) {
936937
}}
937938
>
938939
<div
940+
role="status"
939941
style={{
940942
position: "fixed",
941943
fontSize: "50px",
942944
color: "#3ac9d6",
943945
top: "50%",
944-
left: "45%"
946+
left: "50%",
947+
transform: 'translate(-50%, -50%)'
945948
}}
946949
className="loader-37"
947-
></div>
950+
>
951+
<span className="sr-only">Loading...</span>
952+
</div>
948953
</div>
949954
)}
950955
{props.isloginVisible && props.isloginVisible ? (
951-
<div>
956+
<div aria-labelledby="loginHeading" role="region">
952957
<div className="md:m-10 lg:m-16 md:p-4 lg:p-10 p-5 bg-[#ffffff] md:border-[1px] md:border-gray-400 ">
953958
<div className="w-[250px] h-[66px] inline-block">
954959
{state.hideNav ? (
955-
<img src={image} width="100%" alt="" />
960+
<img src={image} width="100%" alt="The image displays the OpenSign logo with a stylized blue square with an open corner, accompanied by the tagline Seal the Deal, Openly." />
956961
) : (
957-
<img src={image} width="100%" alt="" />
962+
<img src={image} width="100%" alt="The image displays the OpenSign logo with a stylized blue square with an open corner, accompanied by the tagline Seal the Deal, Openly." />
958963
)}
959964
</div>
960965
<div className="grid grid-cols-1 md:grid-cols-2 gap-x-2">
961-
<div className="">
966+
<div>
962967
<div>
963-
<form onSubmit={handleSubmit}>
964-
<h2 className="text-[30px] mt-6">Welcome Back !</h2>
965-
<span className="text-[12px] text-[#878787]">
966-
Login to your account
967-
</span>
968-
<div className="shadow-md rounded my-4">
968+
<form onSubmit={handleSubmit} aria-label="Login Form">
969+
<h1 className="text-[30px] mt-6">Welcome Back!</h1>
970+
<fieldset className="outline outline-1 outline-slate-300/50 my-4">
971+
<legend className="text-xs font-bold px-6 mt-4">Login to your account</legend>
969972
<div className="px-6 py-4">
970-
<label className="block text-xs">Username</label>
973+
<label className="block text-xs" htmlFor="email">Username</label>
971974
<input
975+
id="email"
972976
type="text"
973-
className="px-3 py-2 w-full border-[1px] border-gray-300 rounded focus:outline-none text-xs"
977+
className="px-3 py-2 w-full border-[1px] border-gray-300 rounded text-xs"
974978
name="email"
975979
value={state.email}
976980
onChange={handleChange}
977981
required
978982
/>
979983
<hr className="my-2 border-none" />
980-
<label className="block text-xs">Password</label>
984+
<label className="block text-xs" htmlFor="password">Password</label>
981985
<div className="relative">
982986
<input
987+
id="password"
983988
type={state.passwordVisible ? "text" : "password"}
984-
className="px-3 py-2 w-full border-[1px] border-gray-300 rounded focus:outline-none text-xs"
989+
className="px-3 py-2 w-full border-[1px] border-gray-300 rounded text-xs"
985990
name="password"
986991
value={state.password}
987992
onChange={handleChange}
988993
required
989994
/>
990995
<span
991-
className={`absolute top-[50%] right-[10px] -translate-y-[50%] cursor-pointer ${
992-
state.passwordVisible
993-
? "text-[#007bff]"
994-
: "text-black"
995-
}`}
996+
className={`absolute top-[50%] right-[10px] -translate-y-[50%] cursor-pointer ${state.passwordVisible
997+
? "text-[#007bff]"
998+
: "text-black"
999+
}`}
9961000
onClick={togglePasswordVisibility}
9971001
>
9981002
{state.passwordVisible ? (
@@ -1003,32 +1007,32 @@ function Login(props) {
10031007
</span>
10041008
</div>
10051009
</div>
1006-
</div>
1007-
<div className="flex flex-row justify-between items-center text-xs px-4 py-2">
1010+
</fieldset>
1011+
<div className="flex flex-row justify-between items-center px-4 py-2">
10081012
<div>
1009-
<label className="form-check-label">
1013+
<label className="form-check-label inline-block cursor-pointer" htmlFor="rememberpassword">
10101014
<input
10111015
type="checkbox"
1012-
className="form-check-input"
1016+
className="form-check-input mr-2"
10131017
value=""
1018+
id="rememberpassword"
10141019
/>
1015-
<span className="text-center pl-1">
1016-
Remember Password
1017-
</span>
1020+
<span className="text-[13px] pl-1">Remember Password</span>
10181021
</label>
10191022
</div>
10201023
<div>
1021-
<span className="text-[13px]">
1022-
<NavLink to={`/forgetpassword`}>
1023-
Forgot Password ?
1024-
</NavLink>
1025-
</span>
1024+
<NavLink
1025+
to="/forgetpassword"
1026+
className="text-[13px] underline focus:outline-none focus:ring-2 focus:ring-blue-600"
1027+
>
1028+
Forgot Password?
1029+
</NavLink>
10261030
</div>
10271031
</div>
10281032
<div className="flex flex-col md:flex-row justify-between items-stretch gap-8 text-center text-xs font-bold mt-2">
10291033
<button
10301034
type="submit"
1031-
className="rounded-sm bg-[#3ac9d6] text-white w-full py-3 shadow uppercase"
1035+
className="rounded-sm bg-[#3ac9d6] text-white w-full py-3 shadow outline-none uppercase focus:ring-2 focus:ring-blue-600"
10321036
disabled={state.loading}
10331037
>
10341038
{state.loading ? "Loading..." : "Login"}
@@ -1093,7 +1097,7 @@ function Login(props) {
10931097
}}
10941098
>
10951099
{props.appInfo.googleClietId &&
1096-
props.appInfo.googleClietId !== "" ? (
1100+
props.appInfo.googleClietId !== "" ? (
10971101
<GoogleSignInBtn
10981102
GoogleCred={props.appInfo.googleClietId}
10991103
thirdpartyLoginfn={thirdpartyLoginfn}
@@ -1107,14 +1111,18 @@ function Login(props) {
11071111
{!state.hideNav && (
11081112
<div className="self-center">
11091113
<div className="mx-auto md:w-[300px] lg:w-[500px]">
1110-
<img src={login_img} alt="bisec" width="100%" />
1114+
<img src={login_img} alt="The image illustrates a person from behind, seated at a desk with a four-monitor computer setup, in an environment with a light blue and white color scheme, featuring a potted plant to the right." width="100%" />
11111115
</div>
11121116
</div>
11131117
)}
11141118
</div>
11151119
</div>
11161120

1117-
<div id="snackbar" style={{ backgroundColor: state.toastColor }}>
1121+
<div
1122+
id="snackbar"
1123+
role="alert"
1124+
style={{ backgroundColor: state.toastColor }}
1125+
>
11181126
{state.toastDescription}
11191127
</div>
11201128
</div>

apps/OpenSign/src/routes/PlanSubscriptions.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ const PlanSubscriptions = () => {
6464
style={{
6565
backgroundColor: "white",
6666
overflowY: "auto",
67-
maxHeight: "600px",
67+
maxHeight: "100%",
6868
"--theme-color": "#7952b3",
6969
"--plan-width": 30
7070
}}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
const signer=require("node-signpdf").default;class SignPDF{constructor(e,t){this.pdfDoc=e,this.certificate=t}async signPDF(){return signer.sign(this.pdfDoc,this.certificate,{passphrase:"emudhra"})}static unit8ToBuffer(e){var t=Buffer.alloc(e.byteLength),r=new Uint8Array(e);for(let e=0;e<t.length;++e)t[e]=r[e];return t}}module.exports=SignPDF;
1+
const signer=require("node-signpdf").default;class SignPDF{constructor(e,t){this.pdfDoc=e,this.certificate=t}async signPDF(){return signer.sign(this.pdfDoc,this.certificate, process.env.PASS_PHRASE ? {passphrase : process.env.PASS_PHRASE}: null)}static unit8ToBuffer(e){var t=Buffer.alloc(e.byteLength),r=new Uint8Array(e);for(let e=0;e<t.length;++e)t[e]=r[e];return t}}module.exports=SignPDF;
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import React from "react";
2+
3+
const PageNotFound = () => {
4+
return (
5+
<div className="flex items-center justify-center h-screen w-full bg-white rounded">
6+
<div className="text-center">
7+
<h1 className="text-[60px] lg:text-[120px] font-semibold text-black">
8+
404
9+
</h1>
10+
<p className="text-[30px] lg:text-[50px] text-black">Page Not Found</p>
11+
</div>
12+
</div>
13+
);
14+
};
15+
16+
export default PageNotFound;

0 commit comments

Comments
 (0)