mirror of
https://github.com/OpenSignLabs/OpenSign.git
synced 2026-09-30 13:34:58 +02:00
Merge pull request #508 from OpenSignLabs/migrate_redux
This commit is contained in:
Generated
+30
-53
@@ -36,7 +36,7 @@
|
|||||||
"react-konva": "^18.2.10",
|
"react-konva": "^18.2.10",
|
||||||
"react-modal": "^3.16.1",
|
"react-modal": "^3.16.1",
|
||||||
"react-pdf": "^7.7.1",
|
"react-pdf": "^7.7.1",
|
||||||
"react-redux": "^8.1.3",
|
"react-redux": "^9.1.0",
|
||||||
"react-rnd": "^10.4.1",
|
"react-rnd": "^10.4.1",
|
||||||
"react-router-dom": "^6.22.3",
|
"react-router-dom": "^6.22.3",
|
||||||
"react-scripts": "5.0.1",
|
"react-scripts": "5.0.1",
|
||||||
@@ -45,8 +45,8 @@
|
|||||||
"react-signature-canvas": "^1.0.6",
|
"react-signature-canvas": "^1.0.6",
|
||||||
"react-tooltip": "^5.26.3",
|
"react-tooltip": "^5.26.3",
|
||||||
"reactour": "^1.19.2",
|
"reactour": "^1.19.2",
|
||||||
"redux": "^4.2.1",
|
"redux": "^5.0.1",
|
||||||
"redux-thunk": "^2.4.2",
|
"redux-thunk": "^3.1.0",
|
||||||
"regex-parser": "^2.3.0",
|
"regex-parser": "^2.3.0",
|
||||||
"serve": "^14.2.1",
|
"serve": "^14.2.1",
|
||||||
"styled-components": "^4.4.1",
|
"styled-components": "^4.4.1",
|
||||||
@@ -5560,19 +5560,6 @@
|
|||||||
"url": "https://opencollective.com/immer"
|
"url": "https://opencollective.com/immer"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@reduxjs/toolkit/node_modules/redux": {
|
|
||||||
"version": "5.0.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/redux/-/redux-5.0.1.tgz",
|
|
||||||
"integrity": "sha512-M9/ELqF6fy8FwmkpnF0S3YKOqMyoWJ4+CS5Efg2ct3oY9daQvd/Pc71FpGZsVsbl3Cpb+IIcjBDUnnyBdQbq4w=="
|
|
||||||
},
|
|
||||||
"node_modules/@reduxjs/toolkit/node_modules/redux-thunk": {
|
|
||||||
"version": "3.1.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/redux-thunk/-/redux-thunk-3.1.0.tgz",
|
|
||||||
"integrity": "sha512-NW2r5T6ksUKXCabzhL9z+h206HQw/NJkcLm1GPImRQ8IzfXwRGqjVhKJGauHirT0DAuyy6hjdnMZaRoAcy0Klw==",
|
|
||||||
"peerDependencies": {
|
|
||||||
"redux": "^5.0.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/@remix-run/router": {
|
"node_modules/@remix-run/router": {
|
||||||
"version": "1.15.3",
|
"version": "1.15.3",
|
||||||
"resolved": "https://registry.npmjs.org/@remix-run/router/-/router-1.15.3.tgz",
|
"resolved": "https://registry.npmjs.org/@remix-run/router/-/router-1.15.3.tgz",
|
||||||
@@ -6122,6 +6109,8 @@
|
|||||||
"version": "3.3.3",
|
"version": "3.3.3",
|
||||||
"resolved": "https://registry.npmjs.org/@types/hoist-non-react-statics/-/hoist-non-react-statics-3.3.3.tgz",
|
"resolved": "https://registry.npmjs.org/@types/hoist-non-react-statics/-/hoist-non-react-statics-3.3.3.tgz",
|
||||||
"integrity": "sha512-Wny3a2UXn5FEA1l7gc6BbpoV5mD1XijZqgkp4TRgDCDL5r3B5ieOFGUX5h3n78Tr1MEG7BfvoM8qeztdvNU0fw==",
|
"integrity": "sha512-Wny3a2UXn5FEA1l7gc6BbpoV5mD1XijZqgkp4TRgDCDL5r3B5ieOFGUX5h3n78Tr1MEG7BfvoM8qeztdvNU0fw==",
|
||||||
|
"optional": true,
|
||||||
|
"peer": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@types/react": "*",
|
"@types/react": "*",
|
||||||
"hoist-non-react-statics": "^3.3.0"
|
"hoist-non-react-statics": "^3.3.0"
|
||||||
@@ -9662,6 +9651,14 @@
|
|||||||
"redux": "^4.2.0"
|
"redux": "^4.2.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/dnd-core/node_modules/redux": {
|
||||||
|
"version": "4.2.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/redux/-/redux-4.2.1.tgz",
|
||||||
|
"integrity": "sha512-LAUYz4lc+Do8/g7aeRa8JkyDErK6ekstQaqWQrNRW//MY1TvCEpMtpTWvlQ+FPbWCx+Xixu/6SHt5N0HR+SB4w==",
|
||||||
|
"dependencies": {
|
||||||
|
"@babel/runtime": "^7.9.2"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/dnd-multi-backend": {
|
"node_modules/dnd-multi-backend": {
|
||||||
"version": "8.0.3",
|
"version": "8.0.3",
|
||||||
"resolved": "https://registry.npmjs.org/dnd-multi-backend/-/dnd-multi-backend-8.0.3.tgz",
|
"resolved": "https://registry.npmjs.org/dnd-multi-backend/-/dnd-multi-backend-8.0.3.tgz",
|
||||||
@@ -11264,9 +11261,9 @@
|
|||||||
"integrity": "sha512-bHWEmjLsTjGP9gVs7P3Hyl+oY5NlMW8aTSPdTJ+X2GKt6glDctt9fUCLbRV+d/l8NDC40+FxMjp9WlTQXaQALw=="
|
"integrity": "sha512-bHWEmjLsTjGP9gVs7P3Hyl+oY5NlMW8aTSPdTJ+X2GKt6glDctt9fUCLbRV+d/l8NDC40+FxMjp9WlTQXaQALw=="
|
||||||
},
|
},
|
||||||
"node_modules/follow-redirects": {
|
"node_modules/follow-redirects": {
|
||||||
"version": "1.15.5",
|
"version": "1.15.6",
|
||||||
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.5.tgz",
|
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.6.tgz",
|
||||||
"integrity": "sha512-vSFWUON1B+yAw1VN4xMfxgn5fTUiaOzAJCKBwIIgT/+7CuGy9+r+5gITvP62j3RmaD5Ph65UaERdOSRGUzZtgw==",
|
"integrity": "sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA==",
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
"type": "individual",
|
"type": "individual",
|
||||||
@@ -19823,35 +19820,23 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/react-redux": {
|
"node_modules/react-redux": {
|
||||||
"version": "8.1.3",
|
"version": "9.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/react-redux/-/react-redux-8.1.3.tgz",
|
"resolved": "https://registry.npmjs.org/react-redux/-/react-redux-9.1.0.tgz",
|
||||||
"integrity": "sha512-n0ZrutD7DaX/j9VscF+uTALI3oUPa/pO4Z3soOBIjuRn/FzVu6aehhysxZCLi6y7duMf52WNZGMl7CtuK5EnRw==",
|
"integrity": "sha512-6qoDzIO+gbrza8h3hjMA9aq4nwVFCKFtY2iLxCtVT38Swyy2C/dJCGBXHeHLtx6qlg/8qzc2MrhOeduf5K32wQ==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@babel/runtime": "^7.12.1",
|
|
||||||
"@types/hoist-non-react-statics": "^3.3.1",
|
|
||||||
"@types/use-sync-external-store": "^0.0.3",
|
"@types/use-sync-external-store": "^0.0.3",
|
||||||
"hoist-non-react-statics": "^3.3.2",
|
|
||||||
"react-is": "^18.0.0",
|
|
||||||
"use-sync-external-store": "^1.0.0"
|
"use-sync-external-store": "^1.0.0"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"@types/react": "^16.8 || ^17.0 || ^18.0",
|
"@types/react": "^18.2.25",
|
||||||
"@types/react-dom": "^16.8 || ^17.0 || ^18.0",
|
"react": "^18.0",
|
||||||
"react": "^16.8 || ^17.0 || ^18.0",
|
"react-native": ">=0.69",
|
||||||
"react-dom": "^16.8 || ^17.0 || ^18.0",
|
"redux": "^5.0.0"
|
||||||
"react-native": ">=0.59",
|
|
||||||
"redux": "^4 || ^5.0.0-beta.0"
|
|
||||||
},
|
},
|
||||||
"peerDependenciesMeta": {
|
"peerDependenciesMeta": {
|
||||||
"@types/react": {
|
"@types/react": {
|
||||||
"optional": true
|
"optional": true
|
||||||
},
|
},
|
||||||
"@types/react-dom": {
|
|
||||||
"optional": true
|
|
||||||
},
|
|
||||||
"react-dom": {
|
|
||||||
"optional": true
|
|
||||||
},
|
|
||||||
"react-native": {
|
"react-native": {
|
||||||
"optional": true
|
"optional": true
|
||||||
},
|
},
|
||||||
@@ -19860,11 +19845,6 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/react-redux/node_modules/react-is": {
|
|
||||||
"version": "18.2.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/react-is/-/react-is-18.2.0.tgz",
|
|
||||||
"integrity": "sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w=="
|
|
||||||
},
|
|
||||||
"node_modules/react-refresh": {
|
"node_modules/react-refresh": {
|
||||||
"version": "0.11.0",
|
"version": "0.11.0",
|
||||||
"resolved": "https://registry.npmjs.org/react-refresh/-/react-refresh-0.11.0.tgz",
|
"resolved": "https://registry.npmjs.org/react-refresh/-/react-refresh-0.11.0.tgz",
|
||||||
@@ -20271,19 +20251,16 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/redux": {
|
"node_modules/redux": {
|
||||||
"version": "4.2.1",
|
"version": "5.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/redux/-/redux-4.2.1.tgz",
|
"resolved": "https://registry.npmjs.org/redux/-/redux-5.0.1.tgz",
|
||||||
"integrity": "sha512-LAUYz4lc+Do8/g7aeRa8JkyDErK6ekstQaqWQrNRW//MY1TvCEpMtpTWvlQ+FPbWCx+Xixu/6SHt5N0HR+SB4w==",
|
"integrity": "sha512-M9/ELqF6fy8FwmkpnF0S3YKOqMyoWJ4+CS5Efg2ct3oY9daQvd/Pc71FpGZsVsbl3Cpb+IIcjBDUnnyBdQbq4w=="
|
||||||
"dependencies": {
|
|
||||||
"@babel/runtime": "^7.9.2"
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
"node_modules/redux-thunk": {
|
"node_modules/redux-thunk": {
|
||||||
"version": "2.4.2",
|
"version": "3.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/redux-thunk/-/redux-thunk-2.4.2.tgz",
|
"resolved": "https://registry.npmjs.org/redux-thunk/-/redux-thunk-3.1.0.tgz",
|
||||||
"integrity": "sha512-+P3TjtnP0k/FEjcBL5FZpoovtvrTNT/UXd4/sluaSyrURlSlhLSzEdfsTBW7WsKB6yPvgd7q/iZPICFjW4o57Q==",
|
"integrity": "sha512-NW2r5T6ksUKXCabzhL9z+h206HQw/NJkcLm1GPImRQ8IzfXwRGqjVhKJGauHirT0DAuyy6hjdnMZaRoAcy0Klw==",
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"redux": "^4"
|
"redux": "^5.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/reflect.getprototypeof": {
|
"node_modules/reflect.getprototypeof": {
|
||||||
|
|||||||
@@ -31,7 +31,7 @@
|
|||||||
"react-konva": "^18.2.10",
|
"react-konva": "^18.2.10",
|
||||||
"react-modal": "^3.16.1",
|
"react-modal": "^3.16.1",
|
||||||
"react-pdf": "^7.7.1",
|
"react-pdf": "^7.7.1",
|
||||||
"react-redux": "^8.1.3",
|
"react-redux": "^9.1.0",
|
||||||
"react-rnd": "^10.4.1",
|
"react-rnd": "^10.4.1",
|
||||||
"react-router-dom": "^6.22.3",
|
"react-router-dom": "^6.22.3",
|
||||||
"react-scripts": "5.0.1",
|
"react-scripts": "5.0.1",
|
||||||
@@ -40,8 +40,8 @@
|
|||||||
"react-signature-canvas": "^1.0.6",
|
"react-signature-canvas": "^1.0.6",
|
||||||
"react-tooltip": "^5.26.3",
|
"react-tooltip": "^5.26.3",
|
||||||
"reactour": "^1.19.2",
|
"reactour": "^1.19.2",
|
||||||
"redux": "^4.2.1",
|
"redux": "^5.0.1",
|
||||||
"redux-thunk": "^2.4.2",
|
"redux-thunk": "^3.1.0",
|
||||||
"regex-parser": "^2.3.0",
|
"regex-parser": "^2.3.0",
|
||||||
"serve": "^14.2.1",
|
"serve": "^14.2.1",
|
||||||
"styled-components": "^4.4.1",
|
"styled-components": "^4.4.1",
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ import SignYourSelf from "./pages/SignyourselfPdf";
|
|||||||
import DraftDocument from "./components/pdf/DraftDocument";
|
import DraftDocument from "./components/pdf/DraftDocument";
|
||||||
import PlaceHolderSign from "./pages/PlaceHolderSign";
|
import PlaceHolderSign from "./pages/PlaceHolderSign";
|
||||||
import PdfRequestFiles from "./pages/PdfRequestFiles";
|
import PdfRequestFiles from "./pages/PdfRequestFiles";
|
||||||
|
import Opensigndrive from "./pages/Opensigndrive";
|
||||||
const DebugPdf = lazy(() => import("./pages/DebugPdf"));
|
const DebugPdf = lazy(() => import("./pages/DebugPdf"));
|
||||||
const ForgetPassword = lazy(() => import("./pages/ForgetPassword"));
|
const ForgetPassword = lazy(() => import("./pages/ForgetPassword"));
|
||||||
const GuestLogin = lazy(() => import("./pages/GuestLogin"));
|
const GuestLogin = lazy(() => import("./pages/GuestLogin"));
|
||||||
@@ -25,7 +26,6 @@ const UserProfile = lazy(() => import("./pages/UserProfile"));
|
|||||||
const Signup = lazy(() => import("./pages/Signup"));
|
const Signup = lazy(() => import("./pages/Signup"));
|
||||||
const GenerateToken = lazy(() => import("./pages/GenerateToken"));
|
const GenerateToken = lazy(() => import("./pages/GenerateToken"));
|
||||||
const Webhook = lazy(() => import("./pages/Webhook"));
|
const Webhook = lazy(() => import("./pages/Webhook"));
|
||||||
const Opensigndrive = lazy(() => import("./pages/Opensigndrive"));
|
|
||||||
pdfjs.GlobalWorkerOptions.workerSrc = `//cdnjs.cloudflare.com/ajax/libs/pdf.js/${pdfjs.version}/pdf.worker.js`;
|
pdfjs.GlobalWorkerOptions.workerSrc = `//cdnjs.cloudflare.com/ajax/libs/pdf.js/${pdfjs.version}/pdf.worker.js`;
|
||||||
|
|
||||||
const Loader = () => {
|
const Loader = () => {
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ const Menu = ({ item, isOpen, closeSidebar }) => {
|
|||||||
? `/${item.pageType}/${item.objectId}`
|
? `/${item.pageType}/${item.objectId}`
|
||||||
: `/${item.objectId}`
|
: `/${item.objectId}`
|
||||||
}
|
}
|
||||||
className="mx-auto flex items-center hover:bg-[#eef1f5] p-3 lg:p-4 cursor-pointer"
|
className="mx-auto flex items-center hover:bg-[#eef1f5] p-3 lg:p-4 cursor-pointer focus:text-[#0056b3] focus:bg-[#eef1f5]"
|
||||||
onClick={closeSidebar}
|
onClick={closeSidebar}
|
||||||
tabIndex={isOpen ? 0 : -1}
|
tabIndex={isOpen ? 0 : -1}
|
||||||
role="menuitem"
|
role="menuitem"
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ const Submenu = ({ item, closeSidebar }) => {
|
|||||||
<li role="none">
|
<li role="none">
|
||||||
<button
|
<button
|
||||||
onClick={toggleSubmenu}
|
onClick={toggleSubmenu}
|
||||||
className="w-full flex items-center text-left text-[#444] p-3 lg:p-4 hover:bg-[#eef1f5] focus:ring-2 focus:ring-blue-600"
|
className="w-full flex items-center text-left text-[#444] p-3 lg:p-4 hover:bg-[#eef1f5] focus:outline-none focus:text-[#0056b3] focus:bg-[#eef1f5]"
|
||||||
aria-expanded={submenuOpen}
|
aria-expanded={submenuOpen}
|
||||||
aria-haspopup="true"
|
aria-haspopup="true"
|
||||||
aria-controls={`submenu-${title}`}
|
aria-controls={`submenu-${title}`}
|
||||||
@@ -39,7 +39,7 @@ const Submenu = ({ item, closeSidebar }) => {
|
|||||||
? `/${childItem.pageType}/${childItem.objectId}`
|
? `/${childItem.pageType}/${childItem.objectId}`
|
||||||
: `/${childItem.objectId}`
|
: `/${childItem.objectId}`
|
||||||
}
|
}
|
||||||
className="block pl-6 md:pl-8 py-2 text-sm text-gray-700 hover:bg-blue-500 hover:text-white cursor-pointer"
|
className="block pl-6 md:pl-8 py-2 text-sm text-gray-700 hover:bg-blue-500 hover:text-white focus:text-[#0056b3] focus:bg-[#eef1f5] cursor-pointer"
|
||||||
onClick={closeSidebar}
|
onClick={closeSidebar}
|
||||||
role="menuitem"
|
role="menuitem"
|
||||||
tabIndex={submenuOpen ? 0 : -1}
|
tabIndex={submenuOpen ? 0 : -1}
|
||||||
|
|||||||
@@ -4,10 +4,11 @@ import "../styles/loader.css";
|
|||||||
import GetDashboard from "../components/dashboard/GetDashboard";
|
import GetDashboard from "../components/dashboard/GetDashboard";
|
||||||
import { useNavigate, useParams } from "react-router-dom";
|
import { useNavigate, useParams } from "react-router-dom";
|
||||||
import Title from "../components/Title";
|
import Title from "../components/Title";
|
||||||
import { save_tourSteps } from "../redux/actions";
|
import { useDispatch } from "react-redux";
|
||||||
import { connect } from "react-redux";
|
import { saveTourSteps } from "../redux/reducers/TourStepsReducer";
|
||||||
const Dashboard = (props) => {
|
const Dashboard = () => {
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
|
const dispatch = useDispatch();
|
||||||
const { id } = useParams();
|
const { id } = useParams();
|
||||||
const [dashboard, setdashboard] = useState([]);
|
const [dashboard, setdashboard] = useState([]);
|
||||||
const [classnameArray, setclassnameArray] = useState([]);
|
const [classnameArray, setclassnameArray] = useState([]);
|
||||||
@@ -88,7 +89,7 @@ const Dashboard = (props) => {
|
|||||||
// style: { backgroundColor: "#abd4d2" },
|
// style: { backgroundColor: "#abd4d2" },
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
props.save_tourSteps(arr);
|
dispatch(saveTourSteps(arr));
|
||||||
// console.log("arr ", arr);
|
// console.log("arr ", arr);
|
||||||
setclassnameArray(classArray);
|
setclassnameArray(classArray);
|
||||||
if (localStorage.getItem("DashboardDefaultFilter")) {
|
if (localStorage.getItem("DashboardDefaultFilter")) {
|
||||||
@@ -133,6 +134,4 @@ const Dashboard = (props) => {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export default connect(null, {
|
export default Dashboard;
|
||||||
save_tourSteps
|
|
||||||
})(Dashboard);
|
|
||||||
|
|||||||
@@ -1,12 +1,15 @@
|
|||||||
import React, { useEffect, useState } 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 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";
|
||||||
import Parse from "parse";
|
import Parse from "parse";
|
||||||
import Alert from "../primitives/Alert";
|
import Alert from "../primitives/Alert";
|
||||||
function ForgotPassword(props) {
|
import { appInfo } from "../constant/appinfo";
|
||||||
|
import { useDispatch } from "react-redux";
|
||||||
|
import { fetchAppInfo } from "../redux/reducers/infoReducer";
|
||||||
|
|
||||||
|
function ForgotPassword() {
|
||||||
|
const dispatch = useDispatch();
|
||||||
const [state, setState] = useState({
|
const [state, setState] = useState({
|
||||||
email: "",
|
email: "",
|
||||||
password: "",
|
password: "",
|
||||||
@@ -27,14 +30,11 @@ function ForgotPassword(props) {
|
|||||||
|
|
||||||
const handleSubmit = async (event) => {
|
const handleSubmit = async (event) => {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
localStorage.setItem("appLogo", props.appInfo.applogo);
|
localStorage.setItem("appLogo", appInfo.applogo);
|
||||||
localStorage.setItem("appName", props.appInfo.appname);
|
localStorage.setItem("appName", appInfo.appname);
|
||||||
localStorage.setItem("defaultmenuid", props.appInfo.defaultmenuid);
|
// localStorage.setItem("defaultmenuid", props.appInfo.defaultmenuid);
|
||||||
localStorage.setItem("PageLanding", props.appInfo.LandingPageId);
|
// localStorage.setItem("PageLanding", props.appInfo.LandingPageId);
|
||||||
localStorage.setItem(
|
localStorage.setItem("userSettings", JSON.stringify(appInfo.settings));
|
||||||
"userSettings",
|
|
||||||
JSON.stringify(props.appInfo.settings)
|
|
||||||
);
|
|
||||||
if (state.email) {
|
if (state.email) {
|
||||||
const username = state.email;
|
const username = state.email;
|
||||||
try {
|
try {
|
||||||
@@ -50,14 +50,14 @@ function ForgotPassword(props) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
props.fetchAppInfo();
|
dispatch(fetchAppInfo());
|
||||||
resize();
|
resize();
|
||||||
window.addEventListener("resize", resize);
|
window.addEventListener("resize", resize);
|
||||||
return () => window.removeEventListener("resize", resize);
|
return () => window.removeEventListener("resize", resize);
|
||||||
// eslint-disable-next-line
|
// eslint-disable-next-line
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
let image = props.appInfo.applogo;
|
let image = appInfo.applogo;
|
||||||
return (
|
return (
|
||||||
<div className="bg-white">
|
<div className="bg-white">
|
||||||
<Title title="Forgot password page" />
|
<Title title="Forgot password page" />
|
||||||
@@ -129,10 +129,4 @@ function ForgotPassword(props) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
const mapStateToProps = (state) => {
|
export default ForgotPassword;
|
||||||
return { appInfo: state.appInfo, forgotPassword: state.forgotPassword };
|
|
||||||
};
|
|
||||||
|
|
||||||
export default connect(mapStateToProps, { fetchAppInfo, forgetPassword })(
|
|
||||||
ForgotPassword
|
|
||||||
);
|
|
||||||
|
|||||||
+110
-121
@@ -1,8 +1,7 @@
|
|||||||
import React, { useEffect, useState } from "react";
|
import React, { useEffect, useState } from "react";
|
||||||
import Parse from "parse";
|
import Parse from "parse";
|
||||||
import "../styles/loader.css";
|
import "../styles/loader.css";
|
||||||
import { connect } from "react-redux";
|
import { useDispatch } from "react-redux";
|
||||||
import { fetchAppInfo, showTenantName } from "../redux/actions";
|
|
||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
import Title from "../components/Title";
|
import Title from "../components/Title";
|
||||||
import GoogleSignInBtn from "../components/LoginGoogle";
|
import GoogleSignInBtn from "../components/LoginGoogle";
|
||||||
@@ -13,10 +12,13 @@ import { useWindowSize } from "../hook/useWindowSize";
|
|||||||
import ModalUi from "../primitives/ModalUi";
|
import ModalUi from "../primitives/ModalUi";
|
||||||
import { modalCancelBtnColor, modalSubmitBtnColor } from "../constant/const";
|
import { modalCancelBtnColor, modalSubmitBtnColor } from "../constant/const";
|
||||||
import Alert from "../primitives/Alert";
|
import Alert from "../primitives/Alert";
|
||||||
|
import { appInfo } from "../constant/appinfo";
|
||||||
function Login(props) {
|
import { fetchAppInfo } from "../redux/reducers/infoReducer";
|
||||||
|
import { showTenant } from "../redux/reducers/ShowTenant";
|
||||||
|
function Login() {
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
const location = useLocation();
|
const location = useLocation();
|
||||||
|
const dispatch = useDispatch();
|
||||||
const { width } = useWindowSize();
|
const { width } = useWindowSize();
|
||||||
const [state, setState] = useState({
|
const [state, setState] = useState({
|
||||||
email: "",
|
email: "",
|
||||||
@@ -37,14 +39,14 @@ function Login(props) {
|
|||||||
Destination: ""
|
Destination: ""
|
||||||
});
|
});
|
||||||
const [isModal, setIsModal] = useState(false);
|
const [isModal, setIsModal] = useState(false);
|
||||||
const image = props?.appInfo?.applogo || undefined;
|
const image = appInfo?.applogo || undefined;
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (localStorage.getItem("accesstoken")) {
|
if (localStorage.getItem("accesstoken")) {
|
||||||
setState({ ...state, loading: true });
|
setState({ ...state, loading: true });
|
||||||
GetLoginData();
|
GetLoginData();
|
||||||
}
|
}
|
||||||
props.fetchAppInfo();
|
dispatch(fetchAppInfo());
|
||||||
// eslint-disable-next-line
|
// eslint-disable-next-line
|
||||||
}, []);
|
}, []);
|
||||||
const handleChange = (event) => {
|
const handleChange = (event) => {
|
||||||
@@ -61,8 +63,8 @@ function Login(props) {
|
|||||||
setState({ ...state, loading: true });
|
setState({ ...state, loading: true });
|
||||||
let baseUrl = localStorage.getItem("baseUrl");
|
let baseUrl = localStorage.getItem("baseUrl");
|
||||||
let parseAppId = localStorage.getItem("parseAppId");
|
let parseAppId = localStorage.getItem("parseAppId");
|
||||||
localStorage.setItem("appLogo", props.appInfo.applogo);
|
localStorage.setItem("appLogo", appInfo.applogo);
|
||||||
localStorage.setItem("appName", props.appInfo.appname);
|
localStorage.setItem("appName", appInfo.appname);
|
||||||
// Pass the username and password to logIn function
|
// Pass the username and password to logIn function
|
||||||
await Parse.User.logIn(email, password)
|
await Parse.User.logIn(email, password)
|
||||||
.then(async (user) => {
|
.then(async (user) => {
|
||||||
@@ -81,8 +83,8 @@ function Login(props) {
|
|||||||
// Check extended class user role and tenentId
|
// Check extended class user role and tenentId
|
||||||
try {
|
try {
|
||||||
let userRoles = [];
|
let userRoles = [];
|
||||||
if (props.appInfo.settings) {
|
if (appInfo.settings) {
|
||||||
let userSettings = props.appInfo.settings;
|
let userSettings = appInfo.settings;
|
||||||
|
|
||||||
//Get Current user roles
|
//Get Current user roles
|
||||||
let url = `${baseUrl}functions/UserGroups`;
|
let url = `${baseUrl}functions/UserGroups`;
|
||||||
@@ -172,8 +174,10 @@ function Login(props) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
if (tenentInfo.length) {
|
if (tenentInfo.length) {
|
||||||
props.showTenantName(
|
dispatch(
|
||||||
tenentInfo[0].tenentName || ""
|
showTenant(
|
||||||
|
tenentInfo[0].tenentName || ""
|
||||||
|
)
|
||||||
);
|
);
|
||||||
localStorage.setItem(
|
localStorage.setItem(
|
||||||
"TenantName",
|
"TenantName",
|
||||||
@@ -212,8 +216,10 @@ function Login(props) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
if (tenentInfo.length) {
|
if (tenentInfo.length) {
|
||||||
props.showTenantName(
|
dispatch(
|
||||||
tenentInfo[0].tenentName || ""
|
showTenant(
|
||||||
|
tenentInfo[0].tenentName || ""
|
||||||
|
)
|
||||||
);
|
);
|
||||||
localStorage.setItem(
|
localStorage.setItem(
|
||||||
"TenantName",
|
"TenantName",
|
||||||
@@ -412,8 +418,8 @@ function Login(props) {
|
|||||||
// Check extended class user role and tenentId
|
// Check extended class user role and tenentId
|
||||||
try {
|
try {
|
||||||
let userRoles = [];
|
let userRoles = [];
|
||||||
if (props.appInfo.settings) {
|
if (appInfo.settings) {
|
||||||
let userSettings = props.appInfo.settings;
|
let userSettings = appInfo.settings;
|
||||||
|
|
||||||
//Get Current user roles
|
//Get Current user roles
|
||||||
let url = `${baseUrl}functions/UserGroups`;
|
let url = `${baseUrl}functions/UserGroups`;
|
||||||
@@ -503,8 +509,8 @@ function Login(props) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
if (tenentInfo.length) {
|
if (tenentInfo.length) {
|
||||||
props.showTenantName(
|
dispatch(
|
||||||
tenentInfo[0].tenentName || ""
|
showTenant(tenentInfo[0].tenentName || "")
|
||||||
);
|
);
|
||||||
localStorage.setItem(
|
localStorage.setItem(
|
||||||
"TenantName",
|
"TenantName",
|
||||||
@@ -543,8 +549,8 @@ function Login(props) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
if (tenentInfo.length) {
|
if (tenentInfo.length) {
|
||||||
props.showTenantName(
|
dispatch(
|
||||||
tenentInfo[0].tenentName || ""
|
showTenant(tenentInfo[0].tenentName || "")
|
||||||
);
|
);
|
||||||
localStorage.setItem(
|
localStorage.setItem(
|
||||||
"TenantName",
|
"TenantName",
|
||||||
@@ -730,94 +736,90 @@ function Login(props) {
|
|||||||
} else {
|
} else {
|
||||||
_currentRole = userRoles[0];
|
_currentRole = userRoles[0];
|
||||||
}
|
}
|
||||||
let SettingsUser = JSON.parse(userSettings);
|
if (_currentRole && _currentRole !== "contracts_Guest") {
|
||||||
SettingsUser.forEach(async (element) => {
|
let SettingsUser = JSON.parse(userSettings);
|
||||||
if (element.role === _currentRole) {
|
SettingsUser.forEach(async (item) => {
|
||||||
let _role = _currentRole.replace(
|
if (item.role === _currentRole) {
|
||||||
`${localStorage.getItem("_appName")}_`,
|
let _role = _currentRole.replace(`${appInfo.appname}_`, "");
|
||||||
""
|
localStorage.setItem("_user_role", _role);
|
||||||
);
|
// Get TenentID from Extendend Class
|
||||||
localStorage.setItem("_user_role", _role);
|
localStorage.setItem("extended_class", item.extended_class);
|
||||||
|
const currentUser = Parse.User.current();
|
||||||
// Get TenentID from Extendend Class
|
await Parse.Cloud.run("getUserDetails", {
|
||||||
localStorage.setItem(
|
email: currentUser.get("email")
|
||||||
"extended_class",
|
}).then(
|
||||||
element.extended_class
|
(result) => {
|
||||||
);
|
let tenentInfo = [];
|
||||||
|
const results = [result];
|
||||||
const currentUser = Parse.User.current();
|
if (results) {
|
||||||
await Parse.Cloud.run("getUserDetails", {
|
let extendedInfo_stringify = JSON.stringify(results);
|
||||||
email: currentUser.get("email")
|
let extendedInfo = JSON.parse(extendedInfo_stringify);
|
||||||
}).then(
|
if (extendedInfo.length > 1) {
|
||||||
(result) => {
|
extendedInfo.forEach((x) => {
|
||||||
let tenentInfo = [];
|
if (x.TenantId) {
|
||||||
const results = [result];
|
let obj = {
|
||||||
if (results) {
|
tenentId: x.TenantId.objectId,
|
||||||
let extendedInfo_stringify = JSON.stringify(results);
|
tenentName: x.TenantId.TenantName || ""
|
||||||
let extendedInfo = JSON.parse(extendedInfo_stringify);
|
};
|
||||||
if (extendedInfo.length > 1) {
|
tenentInfo.push(obj);
|
||||||
extendedInfo.forEach((x) => {
|
}
|
||||||
if (x.TenantId) {
|
});
|
||||||
let obj = {
|
localStorage.setItem("showpopup", true);
|
||||||
tenentId: x.TenantId.objectId,
|
localStorage.setItem("PageLanding", item.pageId);
|
||||||
tenentName: x.TenantId.TenantName || ""
|
localStorage.setItem("defaultmenuid", item.menuId);
|
||||||
};
|
localStorage.setItem("pageType", item.pageType);
|
||||||
tenentInfo.push(obj);
|
navigate("/");
|
||||||
}
|
} else {
|
||||||
});
|
extendedInfo.forEach((x) => {
|
||||||
|
if (x.TenantId) {
|
||||||
localStorage.setItem("showpopup", true);
|
let obj = {
|
||||||
localStorage.setItem("PageLanding", element.pageId);
|
tenentId: x.TenantId.objectId,
|
||||||
localStorage.setItem("defaultmenuid", element.menuId);
|
tenentName: x.TenantId.TenantName || ""
|
||||||
localStorage.setItem("pageType", element.pageType);
|
};
|
||||||
navigate("/");
|
localStorage.setItem(
|
||||||
|
"TenetId",
|
||||||
|
x.TenantId.objectId
|
||||||
|
);
|
||||||
|
tenentInfo.push(obj);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
localStorage.setItem("PageLanding", item.pageId);
|
||||||
|
localStorage.setItem("defaultmenuid", item.menuId);
|
||||||
|
localStorage.setItem("pageType", item.pageType);
|
||||||
|
navigate(`/${item.pageType}/${item.pageId}`);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
extendedInfo.forEach((x) => {
|
localStorage.setItem("PageLanding", item.pageId);
|
||||||
if (x.TenantId) {
|
localStorage.setItem("defaultmenuid", item.menuId);
|
||||||
let obj = {
|
localStorage.setItem("pageType", item.pageType);
|
||||||
tenentId: x.TenantId.objectId,
|
navigate(`/${item.pageType}/${item.pageId}`);
|
||||||
tenentName: x.TenantId.TenantName || ""
|
|
||||||
};
|
|
||||||
localStorage.setItem(
|
|
||||||
"TenetId",
|
|
||||||
x.TenantId.objectId
|
|
||||||
);
|
|
||||||
tenentInfo.push(obj);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
localStorage.setItem("PageLanding", element.pageId);
|
|
||||||
localStorage.setItem("defaultmenuid", element.menuId);
|
|
||||||
localStorage.setItem("pageType", element.pageType);
|
|
||||||
navigate(`/${element.pageType}/${element.pageId}`);
|
|
||||||
}
|
}
|
||||||
} else {
|
},
|
||||||
localStorage.setItem("PageLanding", element.pageId);
|
(error) => {
|
||||||
localStorage.setItem("defaultmenuid", element.menuId);
|
|
||||||
localStorage.setItem("pageType", element.pageType);
|
|
||||||
navigate(`/${element.pageType}/${element.pageId}`);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
(error) => {
|
|
||||||
setState({
|
|
||||||
...state,
|
|
||||||
loading: false,
|
|
||||||
alertType: "danger",
|
|
||||||
alertMsg: "You don`t have access to this application!"
|
|
||||||
});
|
|
||||||
setTimeout(function () {
|
|
||||||
setState({
|
setState({
|
||||||
...state,
|
...state,
|
||||||
loading: false,
|
loading: false,
|
||||||
alertType: "danger",
|
alertType: "danger",
|
||||||
alertMsg: ""
|
alertMsg: "You don`t have access to this application!"
|
||||||
});
|
});
|
||||||
}, 2000);
|
setTimeout(function () {
|
||||||
localStorage.setItem("accesstoken", null);
|
setState({
|
||||||
console.error("Error while fetching Follow", error);
|
...state,
|
||||||
}
|
loading: false,
|
||||||
);
|
alertType: "danger",
|
||||||
}
|
alertMsg: ""
|
||||||
});
|
});
|
||||||
|
}, 2000);
|
||||||
|
localStorage.setItem("accesstoken", null);
|
||||||
|
console.error("Error while fetching Follow", error);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
setState({ ...state, loading: false });
|
||||||
|
handleCloseModal();
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
console.log("User Role Not Found.");
|
console.log("User Role Not Found.");
|
||||||
}
|
}
|
||||||
@@ -943,7 +945,7 @@ function Login(props) {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
{props.isloginVisible && props.isloginVisible ? (
|
{appInfo && appInfo.appId ? (
|
||||||
<>
|
<>
|
||||||
<div aria-labelledby="loginHeading" role="region">
|
<div aria-labelledby="loginHeading" role="region">
|
||||||
<div className="md:m-10 lg:m-16 md:p-4 lg:p-10 p-4 bg-[#ffffff] md:border-[1px] md:border-gray-400 ">
|
<div className="md:m-10 lg:m-16 md:p-4 lg:p-10 p-4 bg-[#ffffff] md:border-[1px] md:border-gray-400 ">
|
||||||
@@ -1051,7 +1053,7 @@ function Login(props) {
|
|||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
<br />
|
<br />
|
||||||
{(props.appInfo.fbAppId || props.appInfo.googleClietId) && (
|
{(appInfo.fbAppId || appInfo.googleClietId) && (
|
||||||
<div
|
<div
|
||||||
style={{
|
style={{
|
||||||
display: "flex",
|
display: "flex",
|
||||||
@@ -1082,9 +1084,9 @@ function Login(props) {
|
|||||||
justifyContent: "center"
|
justifyContent: "center"
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{/* {props.appInfo.fbAppId && props.appInfo.fbAppId !== "" ? (
|
{/* {appInfo.fbAppId && appInfo.fbAppId !== "" ? (
|
||||||
<LoginFacebook
|
<LoginFacebook
|
||||||
FBCred={props.appInfo.fbAppId}
|
FBCred={appInfo.fbAppId}
|
||||||
thirdpartyLoginfn={thirdpartyLoginfn}
|
thirdpartyLoginfn={thirdpartyLoginfn}
|
||||||
thirdpartyLoader={state.thirdpartyLoader}
|
thirdpartyLoader={state.thirdpartyLoader}
|
||||||
setThirdpartyLoader={setThirdpartyLoader}
|
setThirdpartyLoader={setThirdpartyLoader}
|
||||||
@@ -1100,10 +1102,9 @@ function Login(props) {
|
|||||||
justifyContent: "center"
|
justifyContent: "center"
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{props.appInfo.googleClietId &&
|
{appInfo.googleClietId && appInfo.googleClietId !== "" ? (
|
||||||
props.appInfo.googleClietId !== "" ? (
|
|
||||||
<GoogleSignInBtn
|
<GoogleSignInBtn
|
||||||
GoogleCred={props.appInfo.googleClietId}
|
GoogleCred={appInfo.googleClietId}
|
||||||
thirdpartyLoginfn={thirdpartyLoginfn}
|
thirdpartyLoginfn={thirdpartyLoginfn}
|
||||||
thirdpartyLoader={state.thirdpartyLoader}
|
thirdpartyLoader={state.thirdpartyLoader}
|
||||||
setThirdpartyLoader={setThirdpartyLoader}
|
setThirdpartyLoader={setThirdpartyLoader}
|
||||||
@@ -1213,16 +1214,4 @@ function Login(props) {
|
|||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
export default Login;
|
||||||
const mapStateToProps = (state) => {
|
|
||||||
if (Object.keys(state.appInfo).length !== 0) {
|
|
||||||
return { appInfo: state.appInfo, isloginVisible: true };
|
|
||||||
} else {
|
|
||||||
return { appInfo: state.appInfo, isloginVisible: false };
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
export default connect(mapStateToProps, {
|
|
||||||
fetchAppInfo,
|
|
||||||
showTenantName
|
|
||||||
})(Login);
|
|
||||||
|
|||||||
@@ -1,14 +1,35 @@
|
|||||||
import React, { useEffect, useState, useRef } from "react";
|
import React, { useEffect, useState, useRef } from "react";
|
||||||
import "../styles/opensigndrive.css";
|
import "../styles/opensigndrive.css";
|
||||||
import loader from "../assets/images/loader2.gif";
|
import loader from "../assets/images/loader2.gif";
|
||||||
import DriveBody from "../components/opensigndrive/DriveBody";
|
|
||||||
import { themeColor, iconColor } from "../constant/const";
|
import { themeColor, iconColor } from "../constant/const";
|
||||||
import { getDrive } from "../constant/Utils";
|
import { getDrive } from "../constant/Utils";
|
||||||
import { useNavigate } from "react-router-dom";
|
import { useNavigate } from "react-router-dom";
|
||||||
import Title from "../components/Title";
|
import Title from "../components/Title";
|
||||||
import Parse from "parse";
|
import Parse from "parse";
|
||||||
import ModalUi from "../primitives/ModalUi";
|
import ModalUi from "../primitives/ModalUi";
|
||||||
|
const DriveBody = React.lazy(() =>
|
||||||
|
import("../components/opensigndrive/DriveBody")
|
||||||
|
);
|
||||||
|
const Loader = () => {
|
||||||
|
return (
|
||||||
|
<div
|
||||||
|
style={{
|
||||||
|
height: "100vh",
|
||||||
|
display: "flex",
|
||||||
|
alignItems: "center",
|
||||||
|
justifyContent: "center"
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
style={{
|
||||||
|
fontSize: "45px",
|
||||||
|
color: "#3dd3e0"
|
||||||
|
}}
|
||||||
|
className="loader-37"
|
||||||
|
></div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
function Opensigndrive() {
|
function Opensigndrive() {
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
const scrollRef = useRef(null);
|
const scrollRef = useRef(null);
|
||||||
@@ -734,18 +755,20 @@ function Opensigndrive() {
|
|||||||
<span style={{ fontWeight: "bold" }}>No Data Found!</span>
|
<span style={{ fontWeight: "bold" }}>No Data Found!</span>
|
||||||
</div>
|
</div>
|
||||||
) : (
|
) : (
|
||||||
<DriveBody
|
<React.Suspense fallback={<Loader />}>
|
||||||
pdfData={pdfData}
|
<DriveBody
|
||||||
setFolderName={setFolderName}
|
pdfData={pdfData}
|
||||||
setIsLoading={setIsLoading}
|
setFolderName={setFolderName}
|
||||||
setDocId={setDocId}
|
setIsLoading={setIsLoading}
|
||||||
getPdfFolderDocumentList={getPdfFolderDocumentList}
|
setDocId={setDocId}
|
||||||
getPdfDocumentList={getPdfDocumentList}
|
getPdfFolderDocumentList={getPdfFolderDocumentList}
|
||||||
isDocId={docId}
|
getPdfDocumentList={getPdfDocumentList}
|
||||||
setPdfData={setPdfData}
|
isDocId={docId}
|
||||||
isList={isList}
|
setPdfData={setPdfData}
|
||||||
setIsAlert={setIsAlert}
|
isList={isList}
|
||||||
/>
|
setIsAlert={setIsAlert}
|
||||||
|
/>
|
||||||
|
</React.Suspense>
|
||||||
)}
|
)}
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
|
|||||||
@@ -2,14 +2,17 @@ import React, { useState, useEffect } from "react";
|
|||||||
import "../styles/pgsignup.css";
|
import "../styles/pgsignup.css";
|
||||||
import Parse from "parse";
|
import Parse from "parse";
|
||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
import { fetchAppInfo, showTenantName } from "../redux/actions/index";
|
import { useDispatch } from "react-redux";
|
||||||
import { connect } from "react-redux";
|
|
||||||
import Title from "../components/Title";
|
import Title from "../components/Title";
|
||||||
import { useNavigate, useLocation } from "react-router-dom";
|
import { useNavigate, useLocation } from "react-router-dom";
|
||||||
|
import { appInfo } from "../constant/appinfo";
|
||||||
|
import { showTenant } from "../redux/reducers/ShowTenant";
|
||||||
|
import { fetchAppInfo } from "../redux/reducers/infoReducer";
|
||||||
|
|
||||||
const PgSignUp = (props) => {
|
const PgSignUp = () => {
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
const location = useLocation();
|
const location = useLocation();
|
||||||
|
const dispatch = useDispatch();
|
||||||
const [parseBaseUrl] = useState(localStorage.getItem("baseUrl"));
|
const [parseBaseUrl] = useState(localStorage.getItem("baseUrl"));
|
||||||
const [parseAppId] = useState(localStorage.getItem("parseAppId"));
|
const [parseAppId] = useState(localStorage.getItem("parseAppId"));
|
||||||
const [formData, setFormData] = useState({
|
const [formData, setFormData] = useState({
|
||||||
@@ -24,8 +27,7 @@ const PgSignUp = (props) => {
|
|||||||
|
|
||||||
// below useEffect is used to fetch App data and save to redux state
|
// below useEffect is used to fetch App data and save to redux state
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
// Parse.User.logOut()
|
dispatch(fetchAppInfo());
|
||||||
props.fetchAppInfo();
|
|
||||||
handleSignedUpUser();
|
handleSignedUpUser();
|
||||||
// eslint-disable-next-line
|
// eslint-disable-next-line
|
||||||
}, []);
|
}, []);
|
||||||
@@ -243,8 +245,8 @@ const PgSignUp = (props) => {
|
|||||||
// Check extended class user role and tenentId
|
// Check extended class user role and tenentId
|
||||||
try {
|
try {
|
||||||
let userRoles = [];
|
let userRoles = [];
|
||||||
if (props.appInfo.settings) {
|
if (appInfo.settings) {
|
||||||
let userSettings = props.appInfo.settings;
|
let userSettings = appInfo.settings;
|
||||||
|
|
||||||
//Get Current user roles
|
//Get Current user roles
|
||||||
let url = `${baseUrl}functions/UserGroups`;
|
let url = `${baseUrl}functions/UserGroups`;
|
||||||
@@ -319,8 +321,8 @@ const PgSignUp = (props) => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
if (tenentInfo.length) {
|
if (tenentInfo.length) {
|
||||||
props.showTenantName(
|
dispatch(
|
||||||
tenentInfo[0].tenentName || ""
|
showTenant(tenentInfo[0].tenentName || "")
|
||||||
);
|
);
|
||||||
localStorage.setItem(
|
localStorage.setItem(
|
||||||
"TenantName",
|
"TenantName",
|
||||||
@@ -358,8 +360,8 @@ const PgSignUp = (props) => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
if (tenentInfo.length) {
|
if (tenentInfo.length) {
|
||||||
props.showTenantName(
|
dispatch(
|
||||||
tenentInfo[0].tenentName || ""
|
showTenant(tenentInfo[0].tenentName || "")
|
||||||
);
|
);
|
||||||
localStorage.setItem(
|
localStorage.setItem(
|
||||||
"TenantName",
|
"TenantName",
|
||||||
@@ -537,15 +539,4 @@ const PgSignUp = (props) => {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
const mapStateToProps = (state) => {
|
export default PgSignUp;
|
||||||
if (Object.keys(state.appInfo).length !== 0) {
|
|
||||||
return { appInfo: state.appInfo, isloginVisible: true };
|
|
||||||
} else {
|
|
||||||
return { appInfo: state.appInfo, isloginVisible: false };
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
export default connect(mapStateToProps, {
|
|
||||||
fetchAppInfo,
|
|
||||||
showTenantName
|
|
||||||
})(PgSignUp);
|
|
||||||
|
|||||||
@@ -1,17 +1,19 @@
|
|||||||
import React, { useState, useEffect } from "react";
|
import React, { useState, useEffect } from "react";
|
||||||
import { connect } from "react-redux";
|
|
||||||
import Parse from "parse";
|
import Parse from "parse";
|
||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
import Title from "../components/Title";
|
import Title from "../components/Title";
|
||||||
import { fetchAppInfo, showTenantName } from "../redux/actions";
|
|
||||||
import { useNavigate, NavLink } from "react-router-dom";
|
import { useNavigate, NavLink } from "react-router-dom";
|
||||||
import login_img from "../assets/images/login_img.svg";
|
import login_img from "../assets/images/login_img.svg";
|
||||||
import { useWindowSize } from "../hook/useWindowSize";
|
import { useWindowSize } from "../hook/useWindowSize";
|
||||||
import Alert from "../primitives/Alert";
|
import Alert from "../primitives/Alert";
|
||||||
|
import { appInfo } from "../constant/appinfo";
|
||||||
const Signup = (props) => {
|
import { useDispatch } from "react-redux";
|
||||||
|
import { fetchAppInfo } from "../redux/reducers/infoReducer";
|
||||||
|
import { showTenant } from "../redux/reducers/ShowTenant";
|
||||||
|
const Signup = () => {
|
||||||
const { width } = useWindowSize();
|
const { width } = useWindowSize();
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
|
const dispatch = useDispatch();
|
||||||
const [name, setName] = useState("");
|
const [name, setName] = useState("");
|
||||||
const [phone, setPhone] = useState("");
|
const [phone, setPhone] = useState("");
|
||||||
const [password, setPassword] = useState("");
|
const [password, setPassword] = useState("");
|
||||||
@@ -29,7 +31,7 @@ const Signup = (props) => {
|
|||||||
const [specialCharValid, setSpecialCharValid] = useState(false);
|
const [specialCharValid, setSpecialCharValid] = useState(false);
|
||||||
|
|
||||||
const togglePasswordVisibility = () => setShowPassword(!showPassword);
|
const togglePasswordVisibility = () => setShowPassword(!showPassword);
|
||||||
const image = props.appInfo.applogo;
|
const image = appInfo.applogo;
|
||||||
|
|
||||||
const clearStorage = async () => {
|
const clearStorage = async () => {
|
||||||
if (Parse.User.current()) {
|
if (Parse.User.current()) {
|
||||||
@@ -90,7 +92,7 @@ const Signup = (props) => {
|
|||||||
res
|
res
|
||||||
.then(async (r) => {
|
.then(async (r) => {
|
||||||
if (r) {
|
if (r) {
|
||||||
let roleData = props.appInfo.settings;
|
let roleData = appInfo.settings;
|
||||||
if (roleData && roleData.length > 0) {
|
if (roleData && roleData.length > 0) {
|
||||||
const params = {
|
const params = {
|
||||||
userDetails: {
|
userDetails: {
|
||||||
@@ -99,7 +101,7 @@ const Signup = (props) => {
|
|||||||
name: name,
|
name: name,
|
||||||
email: email,
|
email: email,
|
||||||
phone: phone,
|
phone: phone,
|
||||||
role: props.appInfo.defaultRole
|
role: appInfo.defaultRole
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
try {
|
try {
|
||||||
@@ -181,8 +183,8 @@ const Signup = (props) => {
|
|||||||
// Check extended class user role and tenentId
|
// Check extended class user role and tenentId
|
||||||
try {
|
try {
|
||||||
let userRoles = [];
|
let userRoles = [];
|
||||||
if (props.appInfo.settings) {
|
if (appInfo.settings) {
|
||||||
let userSettings = props.appInfo.settings;
|
let userSettings = appInfo.settings;
|
||||||
|
|
||||||
//Get Current user roles
|
//Get Current user roles
|
||||||
let url = `${baseUrl}functions/UserGroups`;
|
let url = `${baseUrl}functions/UserGroups`;
|
||||||
@@ -256,8 +258,10 @@ const Signup = (props) => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
if (tenentInfo.length) {
|
if (tenentInfo.length) {
|
||||||
props.showTenantName(
|
dispatch(
|
||||||
tenentInfo[0].tenentName || ""
|
showTenant(
|
||||||
|
tenentInfo[0].tenentName || ""
|
||||||
|
)
|
||||||
);
|
);
|
||||||
localStorage.setItem(
|
localStorage.setItem(
|
||||||
"TenantName",
|
"TenantName",
|
||||||
@@ -300,8 +304,8 @@ const Signup = (props) => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
if (tenentInfo.length) {
|
if (tenentInfo.length) {
|
||||||
props.showTenantName(
|
dispatch(
|
||||||
tenentInfo[0].tenentName || ""
|
showTenant(tenentInfo[0].tenentName || "")
|
||||||
);
|
);
|
||||||
localStorage.setItem(
|
localStorage.setItem(
|
||||||
"TenantName",
|
"TenantName",
|
||||||
@@ -433,7 +437,7 @@ const Signup = (props) => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
props.fetchAppInfo();
|
dispatch(fetchAppInfo());
|
||||||
// eslint-disable-next-line
|
// eslint-disable-next-line
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
@@ -479,7 +483,7 @@ const Signup = (props) => {
|
|||||||
|
|
||||||
<Title title={"Signup page"} />
|
<Title title={"Signup page"} />
|
||||||
|
|
||||||
{props.isloginVisible && props.isloginVisible ? (
|
{appInfo && appInfo.applogo ? (
|
||||||
<div>
|
<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="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">
|
<div className="w-[250px] h-[66px] inline-block">
|
||||||
@@ -657,15 +661,4 @@ const Signup = (props) => {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
const mapStateToProps = (state) => {
|
export default Signup
|
||||||
if (Object.keys(state.appInfo).length !== 0) {
|
|
||||||
return { appInfo: state.appInfo, isloginVisible: true };
|
|
||||||
} else {
|
|
||||||
return { appInfo: state.appInfo, isloginVisible: false };
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
export default connect(mapStateToProps, {
|
|
||||||
fetchAppInfo,
|
|
||||||
showTenantName
|
|
||||||
})(Signup);
|
|
||||||
|
|||||||
@@ -1,200 +0,0 @@
|
|||||||
import Parse from "parse";
|
|
||||||
import axios from "axios";
|
|
||||||
import { appInfo } from "../../constant/appinfo";
|
|
||||||
|
|
||||||
//For fetching application Information
|
|
||||||
export const fetchAppInfo = () => async (dispatch) => {
|
|
||||||
localStorage.setItem("_appName", appInfo.appname);
|
|
||||||
localStorage.setItem("_app_objectId", appInfo.objectId);
|
|
||||||
localStorage.setItem("baseUrl", `${appInfo.baseUrl}/`);
|
|
||||||
localStorage.setItem("parseAppId", appInfo.appId);
|
|
||||||
localStorage.setItem("appLogo", appInfo.applogo);
|
|
||||||
localStorage.setItem("appVersion", appInfo.version);
|
|
||||||
localStorage.removeItem("userSettings");
|
|
||||||
localStorage.setItem("userSettings", JSON.stringify(appInfo.settings));
|
|
||||||
localStorage.setItem("appTitle", appInfo.appTitle);
|
|
||||||
localStorage.setItem("fev_Icon", appInfo.fev_Icon);
|
|
||||||
// console.log("response ", response);
|
|
||||||
dispatch({ type: "FATCH_APPINFO", payload: appInfo });
|
|
||||||
};
|
|
||||||
|
|
||||||
//for simple login
|
|
||||||
export const login = (username, password) => async (dispatch) => {
|
|
||||||
let res = {};
|
|
||||||
let baseUrl = localStorage.getItem("baseUrl");
|
|
||||||
let parseAppId = localStorage.getItem("parseAppId");
|
|
||||||
try {
|
|
||||||
await Parse.User.logIn(username, password).then(
|
|
||||||
async function (res1) {
|
|
||||||
var resultjson = res1.toJSON();
|
|
||||||
res = res1.toJSON();
|
|
||||||
localStorage.setItem("userEmail", username);
|
|
||||||
localStorage.setItem("username", resultjson.name);
|
|
||||||
localStorage.setItem("accesstoken", resultjson.sessionToken);
|
|
||||||
localStorage.setItem("scriptId", true);
|
|
||||||
if (resultjson.ProfilePic) {
|
|
||||||
localStorage.setItem("profileImg", resultjson.ProfilePic);
|
|
||||||
} else {
|
|
||||||
localStorage.setItem("profileImg", "");
|
|
||||||
}
|
|
||||||
let url = `${baseUrl}functions/UserGroups`;
|
|
||||||
const headers = {
|
|
||||||
"Content-Type": "application/json",
|
|
||||||
"X-Parse-Application-Id": parseAppId,
|
|
||||||
sessionToken: resultjson.sessionToken
|
|
||||||
};
|
|
||||||
|
|
||||||
let body = {
|
|
||||||
appname: localStorage.getItem("domain")
|
|
||||||
};
|
|
||||||
let userGroup = "",
|
|
||||||
userGroup1 = "";
|
|
||||||
await axios
|
|
||||||
.post(url, JSON.stringify(body), { headers: headers })
|
|
||||||
.then(async (response) => {
|
|
||||||
userGroup = response.data.result[0];
|
|
||||||
userGroup1 = response.data.result[1];
|
|
||||||
localStorage.setItem("_userGroup", userGroup);
|
|
||||||
});
|
|
||||||
|
|
||||||
let appSetings = JSON.parse(localStorage.getItem("userSettings"));
|
|
||||||
let defaultmenuid = "",
|
|
||||||
PageLanding = "",
|
|
||||||
pageType = "";
|
|
||||||
|
|
||||||
appSetings.forEach(async (element) => {
|
|
||||||
if (`${localStorage.getItem("_appName")}_appeditor` === userGroup) {
|
|
||||||
if (element.role === userGroup1) {
|
|
||||||
defaultmenuid = element.menuId;
|
|
||||||
PageLanding = element.pageId;
|
|
||||||
pageType = element.pageType;
|
|
||||||
localStorage.setItem("PageLanding", PageLanding);
|
|
||||||
localStorage.setItem("defaultmenuid", defaultmenuid);
|
|
||||||
localStorage.setItem("pageType", pageType);
|
|
||||||
let _role = userGroup1.replace(
|
|
||||||
`${localStorage.getItem("_appName")}_`,
|
|
||||||
""
|
|
||||||
);
|
|
||||||
if (userGroup1) {
|
|
||||||
localStorage.setItem("_user_role", _role);
|
|
||||||
} else {
|
|
||||||
localStorage.setItem("_user_role", _role);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else if (element.role === userGroup) {
|
|
||||||
defaultmenuid = element.menuId;
|
|
||||||
PageLanding = element.pageId;
|
|
||||||
pageType = element.pageType;
|
|
||||||
localStorage.setItem("PageLanding", PageLanding);
|
|
||||||
localStorage.setItem("defaultmenuid", defaultmenuid);
|
|
||||||
localStorage.setItem("pageType", pageType);
|
|
||||||
localStorage.setItem("extended_class", element.extended_class);
|
|
||||||
let _role = userGroup.replace(
|
|
||||||
`${localStorage.getItem("domain")}_`,
|
|
||||||
""
|
|
||||||
);
|
|
||||||
if (userGroup) {
|
|
||||||
localStorage.setItem("_user_role", _role);
|
|
||||||
} else {
|
|
||||||
localStorage.setItem("_user_role", _role);
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
const currentUser = Parse.User.current();
|
|
||||||
await Parse.Cloud.run("getUserDetails", {
|
|
||||||
email: currentUser.get("email")
|
|
||||||
}).then(
|
|
||||||
(results) => {
|
|
||||||
let userinfo = results.toJSON();
|
|
||||||
if (userinfo.TenantId) {
|
|
||||||
localStorage.setItem("TenetId", userinfo.TenantId.objectId);
|
|
||||||
}
|
|
||||||
// console.log("tour found", results);
|
|
||||||
},
|
|
||||||
(error) => {
|
|
||||||
console.error("Error while fetching tour", error);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
} catch (error) {
|
|
||||||
console.log("err ", error);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
dispatch({ type: "APP_LOGIN", payload: res });
|
|
||||||
|
|
||||||
if (pageType !== "") {
|
|
||||||
window.location = `/${pageType}/${PageLanding}`;
|
|
||||||
} else {
|
|
||||||
alert("You dont have access to this application.");
|
|
||||||
localStorage.setItem("accesstoken", null);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
function () {
|
|
||||||
alert("Invalid Login");
|
|
||||||
localStorage.setItem("accesstoken", null);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
} catch (err) {
|
|
||||||
console.log(err);
|
|
||||||
alert("You dont have access to this application.");
|
|
||||||
localStorage.setItem("accesstoken", null);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
//for reset password
|
|
||||||
export const forgetPassword = (username) => async () => {
|
|
||||||
try {
|
|
||||||
await Parse.User.requestPasswordReset(username).then(
|
|
||||||
async function (res1) {
|
|
||||||
// var resultjson = res1;
|
|
||||||
// console.log("post data", resultjson.length);
|
|
||||||
if (res1.data === undefined) {
|
|
||||||
alert("Reset password link has been sent to your email id ");
|
|
||||||
}
|
|
||||||
},
|
|
||||||
function () {
|
|
||||||
// alert("Password Reset Done")
|
|
||||||
}
|
|
||||||
);
|
|
||||||
} catch (err) {
|
|
||||||
console.log(err);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
// Role field wizard
|
|
||||||
export const fetchRoleEnum = (name) => async (dispatch) => {
|
|
||||||
let response = [];
|
|
||||||
let baseUrl = localStorage.getItem("baseUrl");
|
|
||||||
let parseAppId = localStorage.getItem("parseAppId");
|
|
||||||
try {
|
|
||||||
let url = `${baseUrl}roles?where={"name":{"$regex":"${name}","$ne":"${localStorage.getItem(
|
|
||||||
"domain"
|
|
||||||
)}_appeditor"}}`;
|
|
||||||
const headers = {
|
|
||||||
"Content-Type": "application/json",
|
|
||||||
"X-Parse-Application-Id": parseAppId
|
|
||||||
};
|
|
||||||
await axios.get(url, { headers: headers }).then((res) => {
|
|
||||||
let temp = [];
|
|
||||||
res.data.results.forEach((x) => {
|
|
||||||
temp.push(x["name"]);
|
|
||||||
});
|
|
||||||
response = temp;
|
|
||||||
});
|
|
||||||
} catch (e) {
|
|
||||||
console.error("Problem", e);
|
|
||||||
}
|
|
||||||
dispatch({ type: "FETCH_ROLE", payload: response });
|
|
||||||
};
|
|
||||||
|
|
||||||
export const showTenantName = (name) => async (dispatch) => {
|
|
||||||
dispatch({ type: "SHOW_TENANT", payload: name || null });
|
|
||||||
};
|
|
||||||
|
|
||||||
export const save_tourSteps = (steps) => async (dispatch) => {
|
|
||||||
dispatch({ type: "SAVE_TOURSTEPS", payload: steps });
|
|
||||||
};
|
|
||||||
|
|
||||||
export const remove_tourSteps = () => async (dispatch) => {
|
|
||||||
dispatch({ type: "REMOVE_TOURSTEPS", payload: [] });
|
|
||||||
};
|
|
||||||
@@ -1,9 +1,14 @@
|
|||||||
const ShowTenant = (state = "", action) => {
|
import { createSlice } from "@reduxjs/toolkit";
|
||||||
switch (action.type) {
|
|
||||||
case "SHOW_TENANT":
|
const showTenantSlice = createSlice({
|
||||||
|
name: "showTenant",
|
||||||
|
initialState: "",
|
||||||
|
reducers: {
|
||||||
|
showTenant: (state, action) => {
|
||||||
return action.payload;
|
return action.payload;
|
||||||
default:
|
},
|
||||||
return state;
|
},
|
||||||
}
|
});
|
||||||
};
|
|
||||||
export default ShowTenant;
|
export const { showTenant } = showTenantSlice.actions;
|
||||||
|
export default showTenantSlice.reducer;
|
||||||
@@ -1,11 +1,17 @@
|
|||||||
const tourStepReducer = (state = "", action) => {
|
import { createSlice } from "@reduxjs/toolkit";
|
||||||
switch (action.type) {
|
|
||||||
case "SAVE_TOURSTEPS":
|
const tourStepSlice = createSlice({
|
||||||
|
name: "tourStep",
|
||||||
|
initialState: [],
|
||||||
|
reducers: {
|
||||||
|
saveTourSteps: (state, action) => {
|
||||||
return action.payload;
|
return action.payload;
|
||||||
case "REMOVE_TOURSTEPS":
|
},
|
||||||
|
removeTourSteps: () => {
|
||||||
return [];
|
return [];
|
||||||
default:
|
}
|
||||||
return state;
|
|
||||||
}
|
}
|
||||||
};
|
});
|
||||||
export default tourStepReducer;
|
|
||||||
|
export const { saveTourSteps, removeTourSteps } = tourStepSlice.actions;
|
||||||
|
export default tourStepSlice.reducer;
|
||||||
|
|||||||
@@ -1,12 +1,10 @@
|
|||||||
import { combineReducers } from "redux";
|
import { combineReducers } from "redux";
|
||||||
import infoReducer from "./infoReducer";
|
import infoReducer from "./infoReducer";
|
||||||
import loginReducer from "./loginReducer";
|
|
||||||
import ShowTenant from "./ShowTenant";
|
import ShowTenant from "./ShowTenant";
|
||||||
import TourStepsReducer from "./TourStepsReducer";
|
import TourStepsReducer from "./TourStepsReducer";
|
||||||
|
|
||||||
export default combineReducers({
|
export default combineReducers({
|
||||||
appInfo: infoReducer,
|
appInfo: infoReducer,
|
||||||
login: loginReducer,
|
TourSteps: TourStepsReducer,
|
||||||
ShowTenant,
|
ShowTenant
|
||||||
TourSteps: TourStepsReducer
|
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,9 +1,24 @@
|
|||||||
const infoReducer = (state = {}, action) => {
|
import { createSlice } from "@reduxjs/toolkit";
|
||||||
switch (action.type) {
|
import { appInfo } from "../../constant/appinfo";
|
||||||
case "FATCH_APPINFO":
|
|
||||||
return action.payload;
|
const infoSlice = createSlice({
|
||||||
default:
|
name: "info",
|
||||||
return state;
|
initialState: {},
|
||||||
|
reducers: {
|
||||||
|
fetchAppInfo: () => {
|
||||||
|
localStorage.setItem("_appName", appInfo.appname);
|
||||||
|
localStorage.setItem("_app_objectId", appInfo.objectId);
|
||||||
|
localStorage.setItem("baseUrl", `${appInfo.baseUrl}/`);
|
||||||
|
localStorage.setItem("parseAppId", appInfo.appId);
|
||||||
|
localStorage.setItem("appLogo", appInfo.applogo);
|
||||||
|
localStorage.setItem("appVersion", appInfo.version);
|
||||||
|
localStorage.removeItem("userSettings");
|
||||||
|
localStorage.setItem("userSettings", JSON.stringify(appInfo.settings));
|
||||||
|
localStorage.setItem("appTitle", appInfo.appTitle);
|
||||||
|
localStorage.setItem("fev_Icon", appInfo.fev_Icon);
|
||||||
|
return appInfo;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
});
|
||||||
export default infoReducer;
|
export const { fetchAppInfo } = infoSlice.actions;
|
||||||
|
export default infoSlice.reducer;
|
||||||
|
|||||||
@@ -1,9 +0,0 @@
|
|||||||
const loginReducer = (state = {}, action) => {
|
|
||||||
switch (action.type) {
|
|
||||||
case "APP_LOGIN":
|
|
||||||
return action.payload;
|
|
||||||
default:
|
|
||||||
return state;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
export default loginReducer;
|
|
||||||
@@ -1,5 +1,16 @@
|
|||||||
import { createStore, applyMiddleware } from "redux";
|
// import { createStore, applyMiddleware } from "redux";
|
||||||
import thunk from "redux-thunk";
|
// import thunk from "redux-thunk";
|
||||||
import reducers from "./reducers";
|
// import reducers from "./reducers";
|
||||||
|
|
||||||
export const store = createStore(reducers, applyMiddleware(thunk));
|
// export const store = createStore(reducers, applyMiddleware(thunk));
|
||||||
|
import { configureStore } from "@reduxjs/toolkit";
|
||||||
|
import infoReducer from "./reducers/infoReducer";
|
||||||
|
import ShowTenant from "./reducers/ShowTenant";
|
||||||
|
import TourStepsReducer from "./reducers/TourStepsReducer";
|
||||||
|
export const store = configureStore({
|
||||||
|
reducer: {
|
||||||
|
appInfo: infoReducer,
|
||||||
|
TourSteps: TourStepsReducer,
|
||||||
|
ShowTenant
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|||||||
@@ -63,13 +63,12 @@ export default async function (request) {
|
|||||||
sessionToken: user.sessionToken, //localStorage.getItem("accesstoken"),
|
sessionToken: user.sessionToken, //localStorage.getItem("accesstoken"),
|
||||||
};
|
};
|
||||||
let body = {
|
let body = {
|
||||||
appName: extClass, //props.appInfo.appname,
|
appName: extClass,
|
||||||
roleName: userDetails.role, //props.appInfo.defaultRole,
|
roleName: userDetails.role,
|
||||||
userId: user.id,
|
userId: user.id,
|
||||||
};
|
};
|
||||||
let role = await axios.post(roleurl, body, { headers: headers });
|
let role = await axios.post(roleurl, body, { headers: headers });
|
||||||
// console.log("role ", role);
|
// console.log("role ", role);
|
||||||
// props.appInfo.defaultRole
|
|
||||||
const partnerCls = Parse.Object.extend("partners_Tenant");
|
const partnerCls = Parse.Object.extend("partners_Tenant");
|
||||||
const partnerQuery = new partnerCls();
|
const partnerQuery = new partnerCls();
|
||||||
partnerQuery.set("UserId", {
|
partnerQuery.set("UserId", {
|
||||||
@@ -111,7 +110,7 @@ export default async function (request) {
|
|||||||
className: "_User",
|
className: "_User",
|
||||||
objectId: user.id,
|
objectId: user.id,
|
||||||
});
|
});
|
||||||
newObj.set("UserRole", userDetails.role); // props.appInfo.defaultRole
|
newObj.set("UserRole", userDetails.role);
|
||||||
newObj.set("Email", userDetails.email);
|
newObj.set("Email", userDetails.email);
|
||||||
newObj.set("Name", userDetails.name);
|
newObj.set("Name", userDetails.name);
|
||||||
newObj.set("Phone", userDetails.phone);
|
newObj.set("Phone", userDetails.phone);
|
||||||
|
|||||||
Reference in New Issue
Block a user