mirror of
https://github.com/OpenSignLabs/OpenSign.git
synced 2026-09-14 05:37:40 +02:00
Merge pull request #91 from prafull-opensignlabs/main
This commit is contained in:
@@ -18,8 +18,7 @@
|
|||||||
"plugins": ["react"],
|
"plugins": ["react"],
|
||||||
"rules": {
|
"rules": {
|
||||||
"react/prop-types": 0,
|
"react/prop-types": 0,
|
||||||
"no-unused-vars": 1,
|
"no-unused-vars": 1
|
||||||
"no-undef": 0
|
|
||||||
},
|
},
|
||||||
"ignorePatterns": ["**/build/**", "**/*.config.js"],
|
"ignorePatterns": ["**/build/**", "**/*.config.js"],
|
||||||
"settings": {
|
"settings": {
|
||||||
|
|||||||
Generated
+4
-4
@@ -36,7 +36,7 @@
|
|||||||
"react-router-dom": "^6.16.0",
|
"react-router-dom": "^6.16.0",
|
||||||
"react-scripts": "5.0.1",
|
"react-scripts": "5.0.1",
|
||||||
"react-select": "^5.7.7",
|
"react-select": "^5.7.7",
|
||||||
"reactour": "^1.19.1",
|
"reactour": "^1.19.2",
|
||||||
"redux": "^4.2.1",
|
"redux": "^4.2.1",
|
||||||
"redux-thunk": "^2.4.2",
|
"redux-thunk": "^2.4.2",
|
||||||
"rjsf-conditionals": "github:prafullnavkar-nxg/rjsf-conditionals",
|
"rjsf-conditionals": "github:prafullnavkar-nxg/rjsf-conditionals",
|
||||||
@@ -17699,9 +17699,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/reactour": {
|
"node_modules/reactour": {
|
||||||
"version": "1.19.1",
|
"version": "1.19.2",
|
||||||
"resolved": "https://registry.npmjs.org/reactour/-/reactour-1.19.1.tgz",
|
"resolved": "https://registry.npmjs.org/reactour/-/reactour-1.19.2.tgz",
|
||||||
"integrity": "sha512-Y6MYZeNsnPQhUxV9U3dw6CU8qWjqOTlTTs64VsEHRXhrePV4+FZEASbiukf3TPC5PmabaF308VkT5hv9SVJNng==",
|
"integrity": "sha512-gbbUiLn8LbpbDW6k+QlVySkblvOICBd3AWMGRKPQghhmuMlOHNqgjW32JrT406lZHUvVlA8+umYD/2MmCHkNOQ==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@rooks/use-mutation-observer": "4.11.2",
|
"@rooks/use-mutation-observer": "4.11.2",
|
||||||
"classnames": "2.3.1",
|
"classnames": "2.3.1",
|
||||||
|
|||||||
@@ -31,7 +31,7 @@
|
|||||||
"react-router-dom": "^6.16.0",
|
"react-router-dom": "^6.16.0",
|
||||||
"react-scripts": "5.0.1",
|
"react-scripts": "5.0.1",
|
||||||
"react-select": "^5.7.7",
|
"react-select": "^5.7.7",
|
||||||
"reactour": "^1.19.1",
|
"reactour": "^1.19.2",
|
||||||
"redux": "^4.2.1",
|
"redux": "^4.2.1",
|
||||||
"redux-thunk": "^2.4.2",
|
"redux-thunk": "^2.4.2",
|
||||||
"rjsf-conditionals": "github:prafullnavkar-nxg/rjsf-conditionals",
|
"rjsf-conditionals": "github:prafullnavkar-nxg/rjsf-conditionals",
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import React, { useState, useEffect } from "react";
|
import React, { useState, useEffect } from "react";
|
||||||
import { SaveFileSize } from "../../constant/saveFileSize";
|
import { SaveFileSize } from "../../constant/saveFileSize";
|
||||||
import Parse from "parse";
|
import Parse from "parse";
|
||||||
|
import sanitizeFileName from "../../primitives/sanitizeFileName";
|
||||||
|
|
||||||
const FileUpload = (props) => {
|
const FileUpload = (props) => {
|
||||||
const [parseBaseUrl] = useState(localStorage.getItem("baseUrl"));
|
const [parseBaseUrl] = useState(localStorage.getItem("baseUrl"));
|
||||||
@@ -70,10 +71,11 @@ const FileUpload = (props) => {
|
|||||||
Parse.serverURL = parseBaseUrl;
|
Parse.serverURL = parseBaseUrl;
|
||||||
Parse.initialize(parseAppId);
|
Parse.initialize(parseAppId);
|
||||||
const size = file.size;
|
const size = file.size;
|
||||||
// console.log("file ", file)
|
const fileName = file.name;
|
||||||
|
const name = sanitizeFileName(fileName);
|
||||||
setfileload(true);
|
setfileload(true);
|
||||||
const pdfFile = file;
|
const pdfFile = file;
|
||||||
const parseFile = new Parse.File(pdfFile.name, pdfFile);
|
const parseFile = new Parse.File(name, pdfFile);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const response = await parseFile.save();
|
const response = await parseFile.save();
|
||||||
|
|||||||
@@ -0,0 +1,5 @@
|
|||||||
|
function sanitizeFileName(fileName) {
|
||||||
|
// Remove spaces and invalid characters
|
||||||
|
return fileName.replace(/[^a-zA-Z0-9._-]/g, "");
|
||||||
|
}
|
||||||
|
export default sanitizeFileName;
|
||||||
@@ -1,120 +1,114 @@
|
|||||||
import React, { Component } from "react";
|
import React, { useEffect, useState } from "react";
|
||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
import { fetchAppInfo, forgetPassword } from "../redux/actions";
|
import { fetchAppInfo, forgetPassword } from "../redux/actions";
|
||||||
import Title from "../components/Title";
|
import Title from "../components/Title";
|
||||||
import { NavLink } from "react-router-dom";
|
import { NavLink } from "react-router-dom";
|
||||||
import login_img from "../assets/images/login_img.svg";
|
import login_img from "../assets/images/login_img.svg";
|
||||||
|
|
||||||
class forgotPassword extends Component {
|
function ForgotPassword(props) {
|
||||||
constructor(props) {
|
const [state, setState] = useState({
|
||||||
super(props);
|
email: "",
|
||||||
this.state = {
|
password: "",
|
||||||
email: "",
|
hideNav: ""
|
||||||
password: "",
|
});
|
||||||
hideNav: ""
|
const handleChange = (event) => {
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
handleChange = (event) => {
|
|
||||||
const { name, value } = event.target;
|
const { name, value } = event.target;
|
||||||
this.setState({ [name]: value });
|
setState({ ...state, [name]: value });
|
||||||
};
|
};
|
||||||
|
|
||||||
resize = () => {
|
const resize = () => {
|
||||||
let currentHideNav = window.innerWidth <= 760;
|
let currentHideNav = window.innerWidth <= 760;
|
||||||
if (currentHideNav !== this.state.hideNav) {
|
if (currentHideNav !== state.hideNav) {
|
||||||
this.setState({ hideNav: currentHideNav });
|
setState({ ...state, hideNav: currentHideNav });
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
handleSubmit = (event) => {
|
const handleSubmit = (event) => {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
localStorage.setItem("appLogo", props.appInfo.applogo);
|
||||||
localStorage.setItem("appLogo", this.props.appInfo.applogo);
|
localStorage.setItem("appName", props.appInfo.appname);
|
||||||
localStorage.setItem("appName", this.props.appInfo.appname);
|
localStorage.setItem("defaultmenuid", props.appInfo.defaultmenuid);
|
||||||
localStorage.setItem("defaultmenuid", this.props.appInfo.defaultmenuid);
|
localStorage.setItem("PageLanding", props.appInfo.LandingPageId);
|
||||||
localStorage.setItem("PageLanding", this.props.appInfo.LandingPageId);
|
|
||||||
localStorage.setItem(
|
localStorage.setItem(
|
||||||
"userSettings",
|
"userSettings",
|
||||||
JSON.stringify(this.props.appInfo.settings)
|
JSON.stringify(props.appInfo.settings)
|
||||||
);
|
);
|
||||||
const { email } = this.state;
|
|
||||||
if (email) {
|
if (state.email) {
|
||||||
this.props.forgetPassword(email);
|
props.forgetPassword(state.email);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
componentDidMount() {
|
useEffect(() => {
|
||||||
this.props.fetchAppInfo(localStorage.getItem("domain"));
|
props.fetchAppInfo(localStorage.getItem("domain"));
|
||||||
window.addEventListener("resize", this.resize.bind(this));
|
resize();
|
||||||
this.resize();
|
window.addEventListener("resize", resize);
|
||||||
}
|
return () => window.removeEventListener("resize", resize);
|
||||||
|
// eslint-disable-next-line
|
||||||
|
}, []);
|
||||||
|
|
||||||
render() {
|
let image = props.appInfo.applogo;
|
||||||
const { email } = this.state;
|
return (
|
||||||
let image = this.props.appInfo.applogo;
|
<div className="bg-white">
|
||||||
return (
|
<Title title="Forgot password page" />
|
||||||
<div className="bg-white">
|
<div>
|
||||||
<Title title="Forgot password page" />
|
<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 ">
|
||||||
<div>
|
<div className="w-[250px] h-[66px] inline-block">
|
||||||
<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 ">
|
{state.hideNav ? (
|
||||||
<div className="w-[250px] h-[66px] inline-block">
|
<img src={image} width="100%" alt="" />
|
||||||
{this.state.hideNav ? (
|
) : (
|
||||||
<img src={image} width="100%" alt="" />
|
<img src={image} width="100%" alt="" />
|
||||||
) : (
|
)}
|
||||||
<img src={image} width="100%" alt="" />
|
</div>
|
||||||
)}
|
<div className="grid grid-cols-1 md:grid-cols-2 gap-x-2">
|
||||||
</div>
|
<div className="">
|
||||||
<div className="grid grid-cols-1 md:grid-cols-2 gap-x-2">
|
<form onSubmit={handleSubmit}>
|
||||||
<div className="">
|
<h2 className="text-[30px] mt-6">Welcome Back !</h2>
|
||||||
<form onSubmit={this.handleSubmit}>
|
<span className="text-[12px] text-[#878787]">
|
||||||
<h2 className="text-[30px] mt-6">Welcome Back !</h2>
|
Reset Your Password
|
||||||
<span className="text-[12px] text-[#878787]">
|
</span>
|
||||||
Reset Your Password
|
<div className="shadow-md rounded my-4">
|
||||||
</span>
|
<div className="px-6 py-4">
|
||||||
<div className="shadow-md rounded my-4">
|
<label className="block text-xs">Email</label>
|
||||||
<div className="px-6 py-4">
|
<input
|
||||||
<label className="block text-xs">Email</label>
|
type="text"
|
||||||
<input
|
className="px-3 py-2 w-full border-[1px] border-gray-300 rounded focus:outline-none text-xs"
|
||||||
type="text"
|
name="email"
|
||||||
className="px-3 py-2 w-full border-[1px] border-gray-300 rounded focus:outline-none text-xs"
|
value={state.email}
|
||||||
name="email"
|
onChange={handleChange}
|
||||||
value={email}
|
required
|
||||||
onChange={this.handleChange}
|
/>
|
||||||
required
|
<hr className="my-2 border-none" />
|
||||||
/>
|
|
||||||
<hr className="my-2 border-none" />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div className="flex justify-between items-center px-4">
|
|
||||||
<button
|
|
||||||
type="submit"
|
|
||||||
className="rounded-sm bg-[#3ac9d6] text-white px-4 py-3 text-xs font-semibold shadow uppercase"
|
|
||||||
>
|
|
||||||
Submit
|
|
||||||
</button>
|
|
||||||
<NavLink
|
|
||||||
to="/"
|
|
||||||
className="rounded-sm bg-white border-[1px] border-[#15b4e9] text-[#15b4e9] px-4 py-3 text-xs font-semibold shadow uppercase"
|
|
||||||
>
|
|
||||||
Login
|
|
||||||
</NavLink>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
{!this.state.hideNav && (
|
|
||||||
<div className="self-center">
|
|
||||||
<div className="mx-auto md:w-[300px] lg:w-[500px]">
|
|
||||||
<img src={login_img} alt="bisec" width="100%" />
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)}
|
<div className="flex justify-between items-center px-4">
|
||||||
|
<button
|
||||||
|
type="submit"
|
||||||
|
className="rounded-sm bg-[#3ac9d6] text-white px-4 py-3 text-xs font-semibold shadow uppercase"
|
||||||
|
>
|
||||||
|
Submit
|
||||||
|
</button>
|
||||||
|
<NavLink
|
||||||
|
to="/"
|
||||||
|
className="rounded-sm bg-white border-[1px] border-[#15b4e9] text-[#15b4e9] px-4 py-3 text-xs font-semibold shadow uppercase"
|
||||||
|
>
|
||||||
|
Login
|
||||||
|
</NavLink>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
{!state.hideNav && (
|
||||||
|
<div className="self-center">
|
||||||
|
<div className="mx-auto md:w-[300px] lg:w-[500px]">
|
||||||
|
<img src={login_img} alt="bisec" width="100%" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
</div>
|
||||||
}
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
const mapStateToProps = (state) => {
|
const mapStateToProps = (state) => {
|
||||||
@@ -122,5 +116,5 @@ const mapStateToProps = (state) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export default connect(mapStateToProps, { fetchAppInfo, forgetPassword })(
|
export default connect(mapStateToProps, { fetchAppInfo, forgetPassword })(
|
||||||
forgotPassword
|
ForgotPassword
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import Parse from "parse";
|
|||||||
import { SaveFileSize } from "../constant/saveFileSize";
|
import { SaveFileSize } from "../constant/saveFileSize";
|
||||||
import dp from "../assets/images/dp.png";
|
import dp from "../assets/images/dp.png";
|
||||||
import Title from "../components/Title";
|
import Title from "../components/Title";
|
||||||
|
import sanitizeFileName from "../primitives/sanitizeFileName";
|
||||||
|
|
||||||
function UserProfile() {
|
function UserProfile() {
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
@@ -90,7 +91,9 @@ function UserProfile() {
|
|||||||
const handleFileUpload = async (file) => {
|
const handleFileUpload = async (file) => {
|
||||||
const size = file.size;
|
const size = file.size;
|
||||||
const pdfFile = file;
|
const pdfFile = file;
|
||||||
const parseFile = new Parse.File(pdfFile.name, pdfFile);
|
const fileName = file.name;
|
||||||
|
const name = sanitizeFileName(fileName);
|
||||||
|
const parseFile = new Parse.File(name, pdfFile);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const response = await parseFile.save();
|
const response = await parseFile.save();
|
||||||
|
|||||||
Reference in New Issue
Block a user