diff --git a/.all-contributorsrc b/.all-contributorsrc index bd57935dc..d33cb394d 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -106,6 +106,24 @@ "contributions": [ "bug" ] + }, + { + "login": "pranav514", + "name": "pranav514", + "avatar_url": "https://avatars.githubusercontent.com/u/76992202?v=4", + "profile": "https://github.com/pranav514", + "contributions": [ + "code" + ] + }, + { + "login": "arianxq", + "name": "Aria", + "avatar_url": "https://avatars.githubusercontent.com/u/122199576?v=4", + "profile": "https://github.com/arianxq", + "contributions": [ + "code" + ] } ] } diff --git a/README.md b/README.md index 89a32de02..4046d997f 100644 --- a/README.md +++ b/README.md @@ -119,6 +119,8 @@ We would like to thank all our contributors and users for their support and feed Hans Fraiponts
Hans Fraiponts

📖 Monil Prajapati
Monil Prajapati

💻 Edogbanya Emmanuel
Edogbanya Emmanuel

🐛 + pranav514
pranav514

💻 + Aria
Aria

💻 diff --git a/apps/OpenSign/.eslintrc.json b/apps/OpenSign/.eslintrc.json index afdfec072..a01fc2510 100644 --- a/apps/OpenSign/.eslintrc.json +++ b/apps/OpenSign/.eslintrc.json @@ -18,8 +18,7 @@ "plugins": ["react"], "rules": { "react/prop-types": 0, - "no-unused-vars": 1, - "no-undef": 0 + "no-unused-vars": 1 }, "ignorePatterns": ["**/build/**", "**/*.config.js"], "settings": { diff --git a/apps/OpenSign/package-lock.json b/apps/OpenSign/package-lock.json index f39c8b835..4832ae0ee 100644 --- a/apps/OpenSign/package-lock.json +++ b/apps/OpenSign/package-lock.json @@ -36,7 +36,7 @@ "react-router-dom": "^6.16.0", "react-scripts": "5.0.1", "react-select": "^5.7.7", - "reactour": "^1.19.1", + "reactour": "^1.19.2", "redux": "^4.2.1", "redux-thunk": "^2.4.2", "rjsf-conditionals": "github:prafullnavkar-nxg/rjsf-conditionals", @@ -17699,9 +17699,9 @@ } }, "node_modules/reactour": { - "version": "1.19.1", - "resolved": "https://registry.npmjs.org/reactour/-/reactour-1.19.1.tgz", - "integrity": "sha512-Y6MYZeNsnPQhUxV9U3dw6CU8qWjqOTlTTs64VsEHRXhrePV4+FZEASbiukf3TPC5PmabaF308VkT5hv9SVJNng==", + "version": "1.19.2", + "resolved": "https://registry.npmjs.org/reactour/-/reactour-1.19.2.tgz", + "integrity": "sha512-gbbUiLn8LbpbDW6k+QlVySkblvOICBd3AWMGRKPQghhmuMlOHNqgjW32JrT406lZHUvVlA8+umYD/2MmCHkNOQ==", "dependencies": { "@rooks/use-mutation-observer": "4.11.2", "classnames": "2.3.1", diff --git a/apps/OpenSign/package.json b/apps/OpenSign/package.json index 1306ba59b..db8651125 100644 --- a/apps/OpenSign/package.json +++ b/apps/OpenSign/package.json @@ -31,7 +31,7 @@ "react-router-dom": "^6.16.0", "react-scripts": "5.0.1", "react-select": "^5.7.7", - "reactour": "^1.19.1", + "reactour": "^1.19.2", "redux": "^4.2.1", "redux-thunk": "^2.4.2", "rjsf-conditionals": "github:prafullnavkar-nxg/rjsf-conditionals", diff --git a/apps/OpenSign/src/components/Title.js b/apps/OpenSign/src/components/Title.js index 14fbc01c2..1fd108f55 100644 --- a/apps/OpenSign/src/components/Title.js +++ b/apps/OpenSign/src/components/Title.js @@ -4,13 +4,18 @@ import { Helmet } from "react-helmet"; function Title(props) { return ( - {`${ - localStorage.getItem("appTitle") ? localStorage.getItem("appTitle") : "" - } - ${props.title}`} + {`${props.title} - OpenSign™`} + {/* + {`${localStorage.getItem("appTitle") ? localStorage.getItem("appTitle") : ""} - ${props.title}`} + */} + {/* */} { const [parseBaseUrl] = useState(localStorage.getItem("baseUrl")); @@ -70,10 +71,11 @@ const FileUpload = (props) => { Parse.serverURL = parseBaseUrl; Parse.initialize(parseAppId); const size = file.size; - // console.log("file ", file) + const fileName = file.name; + const name = sanitizeFileName(fileName); setfileload(true); const pdfFile = file; - const parseFile = new Parse.File(pdfFile.name, pdfFile); + const parseFile = new Parse.File(name, pdfFile); try { const response = await parseFile.save(); diff --git a/apps/OpenSign/src/primitives/sanitizeFileName.js b/apps/OpenSign/src/primitives/sanitizeFileName.js new file mode 100644 index 000000000..0d0be1abc --- /dev/null +++ b/apps/OpenSign/src/primitives/sanitizeFileName.js @@ -0,0 +1,5 @@ +function sanitizeFileName(fileName) { + // Remove spaces and invalid characters + return fileName.replace(/[^a-zA-Z0-9._-]/g, ""); +} +export default sanitizeFileName; diff --git a/apps/OpenSign/src/routes/ForgetPassword.js b/apps/OpenSign/src/routes/ForgetPassword.js index 356a35952..86cb9a6a8 100644 --- a/apps/OpenSign/src/routes/ForgetPassword.js +++ b/apps/OpenSign/src/routes/ForgetPassword.js @@ -1,120 +1,114 @@ -import React, { Component } from "react"; +import React, { useEffect, useState } from "react"; import { connect } from "react-redux"; import { fetchAppInfo, forgetPassword } from "../redux/actions"; import Title from "../components/Title"; import { NavLink } from "react-router-dom"; import login_img from "../assets/images/login_img.svg"; -class forgotPassword extends Component { - constructor(props) { - super(props); - this.state = { - email: "", - password: "", - hideNav: "" - }; - } - - handleChange = (event) => { +function ForgotPassword(props) { + const [state, setState] = useState({ + email: "", + password: "", + hideNav: "" + }); + const handleChange = (event) => { const { name, value } = event.target; - this.setState({ [name]: value }); + setState({ ...state, [name]: value }); }; - resize = () => { + const resize = () => { let currentHideNav = window.innerWidth <= 760; - if (currentHideNav !== this.state.hideNav) { - this.setState({ hideNav: currentHideNav }); + if (currentHideNav !== state.hideNav) { + setState({ ...state, hideNav: currentHideNav }); } }; - handleSubmit = (event) => { + const handleSubmit = (event) => { event.preventDefault(); - - localStorage.setItem("appLogo", this.props.appInfo.applogo); - localStorage.setItem("appName", this.props.appInfo.appname); - localStorage.setItem("defaultmenuid", this.props.appInfo.defaultmenuid); - localStorage.setItem("PageLanding", this.props.appInfo.LandingPageId); + localStorage.setItem("appLogo", props.appInfo.applogo); + localStorage.setItem("appName", props.appInfo.appname); + localStorage.setItem("defaultmenuid", props.appInfo.defaultmenuid); + localStorage.setItem("PageLanding", props.appInfo.LandingPageId); localStorage.setItem( "userSettings", - JSON.stringify(this.props.appInfo.settings) + JSON.stringify(props.appInfo.settings) ); - const { email } = this.state; - if (email) { - this.props.forgetPassword(email); + + if (state.email) { + props.forgetPassword(state.email); } }; - componentDidMount() { - this.props.fetchAppInfo(localStorage.getItem("domain")); - window.addEventListener("resize", this.resize.bind(this)); - this.resize(); - } + useEffect(() => { + props.fetchAppInfo(localStorage.getItem("domain")); + resize(); + window.addEventListener("resize", resize); + return () => window.removeEventListener("resize", resize); + // eslint-disable-next-line + }, []); - render() { - const { email } = this.state; - let image = this.props.appInfo.applogo; - return ( -
- - <div> - <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 className="w-[250px] h-[66px] inline-block"> - {this.state.hideNav ? ( - <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 className=""> - <form onSubmit={this.handleSubmit}> - <h2 className="text-[30px] mt-6">Welcome Back !</h2> - <span className="text-[12px] text-[#878787]"> - Reset Your Password - </span> - <div className="shadow-md rounded my-4"> - <div className="px-6 py-4"> - <label className="block text-xs">Email</label> - <input - type="text" - className="px-3 py-2 w-full border-[1px] border-gray-300 rounded focus:outline-none text-xs" - name="email" - value={email} - onChange={this.handleChange} - required - /> - <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%" /> + let image = props.appInfo.applogo; + return ( + <div className="bg-white"> + <Title title="Forgot password page" /> + <div> + <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 className="w-[250px] h-[66px] inline-block"> + {state.hideNav ? ( + <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 className=""> + <form onSubmit={handleSubmit}> + <h2 className="text-[30px] mt-6">Welcome Back !</h2> + <span className="text-[12px] text-[#878787]"> + Reset Your Password + </span> + <div className="shadow-md rounded my-4"> + <div className="px-6 py-4"> + <label className="block text-xs">Email</label> + <input + type="text" + className="px-3 py-2 w-full border-[1px] border-gray-300 rounded focus:outline-none text-xs" + name="email" + value={state.email} + onChange={handleChange} + required + /> + <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> + {!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> + ); } const mapStateToProps = (state) => { @@ -122,5 +116,5 @@ const mapStateToProps = (state) => { }; export default connect(mapStateToProps, { fetchAppInfo, forgetPassword })( - forgotPassword + ForgotPassword ); diff --git a/apps/OpenSign/src/routes/Login.js b/apps/OpenSign/src/routes/Login.js index a29895bd0..53d361666 100644 --- a/apps/OpenSign/src/routes/Login.js +++ b/apps/OpenSign/src/routes/Login.js @@ -957,9 +957,9 @@ function Login(props) { onClick={togglePasswordVisibility} > {state.passwordVisible ? ( - <i className="fa fa-eye-slash" /> // Close eye icon + <i className="fa fa-eye-slash text-xs pb-1" /> // Close eye icon ) : ( - <i className="fa fa-eye" /> // Open eye icon + <i className="fa fa-eye text-xs pb-1 " /> // Open eye icon )} </span> </div> diff --git a/apps/OpenSign/src/routes/UserProfile.js b/apps/OpenSign/src/routes/UserProfile.js index ac64efe39..ae86ca1ba 100644 --- a/apps/OpenSign/src/routes/UserProfile.js +++ b/apps/OpenSign/src/routes/UserProfile.js @@ -4,6 +4,7 @@ import Parse from "parse"; import { SaveFileSize } from "../constant/saveFileSize"; import dp from "../assets/images/dp.png"; import Title from "../components/Title"; +import sanitizeFileName from "../primitives/sanitizeFileName"; function UserProfile() { const navigate = useNavigate(); @@ -90,7 +91,9 @@ function UserProfile() { const handleFileUpload = async (file) => { const size = file.size; 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 { const response = await parseFile.save();