From bbe29b7fa3eb46b5234748d35131192c746e6770 Mon Sep 17 00:00:00 2001 From: ChineseChikki Date: Fri, 27 Jan 2023 18:34:55 +0100 Subject: [PATCH 1/8] login implemented --- src/components/AuthPages/Login/index.jsx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/components/AuthPages/Login/index.jsx b/src/components/AuthPages/Login/index.jsx index bc419f2..a51ce2f 100644 --- a/src/components/AuthPages/Login/index.jsx +++ b/src/components/AuthPages/Login/index.jsx @@ -4,9 +4,9 @@ import { toast } from "react-toastify"; import googleLogo from "../../../assets/images/google-logo.svg"; // import titleShape from "../../../assets/images/shape/title-shape.svg"; import titleShape from "../../../assets/images/shape/login_straight_underline.svg"; +import usersService from "../../../services/UsersService"; import InputCom from "../../Helpers/Inputs/InputCom"; import AuthLayout from "../AuthLayout"; -import usersService from "../../../services/UsersService"; export default function Login() { const [checked, setValue] = useState(false); @@ -31,15 +31,15 @@ export default function Login() { }; const navigate = useNavigate(); const userApi = new usersService(); - const doLogin = () => { + const doLogin = async () => { if (email !== "" && password !== "") { var postData = { username: email, password: password - }; - const loginResult = userApi.logInUser(postData); // just for a test - // if (email === "support@mermsemr.com") { - if (loginResult.data.status > 0 ) { // just for a start + }; + const loginResult = await userApi.logInUser(postData); // just for a test + // if (email === "support@mermsemr.com") { + if (loginResult.data.status > 0) { // just for a start localStorage.setItem("email", `${email}`); setLoginLoading(true); setTimeout(() => { From e4b1ceae306c0ded6037dcc9605480231ea9ae29 Mon Sep 17 00:00:00 2001 From: "DESKTOP-BC3NEC6\\chiefsoft" Date: Sat, 28 Jan 2023 19:59:42 -0500 Subject: [PATCH 2/8] env update --- .env | 4 +++- src/components/AuthPages/Login/index.jsx | 5 +++-- src/services/UsersService.js | 4 ++++ 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/.env b/.env index dbc5184..4fcdc31 100644 --- a/.env +++ b/.env @@ -8,4 +8,6 @@ REACT_APP_APPSITE=" https://myfitapp.mermsemr.com" REACT_APP_AUX_ENDPOINT = "https://devapi.mermsemr.com/en/desktop/api/v2/myfit" -REACT_APP_USERS_ENDPOINT = "https://devapi.mermsemr.com/en/desktop/api/v2/myfituser" \ No newline at end of file +REACT_APP_USERS_ENDPOINT = "https://devapi.mermsemr.com/en/desktop/api/v2/myfituser" + +REACT_APP_SESSION_EXPIRE_MINUTES = 5 \ No newline at end of file diff --git a/src/components/AuthPages/Login/index.jsx b/src/components/AuthPages/Login/index.jsx index a51ce2f..2a0fc66 100644 --- a/src/components/AuthPages/Login/index.jsx +++ b/src/components/AuthPages/Login/index.jsx @@ -20,18 +20,19 @@ export default function Login() { }; // email - const [email, setMail] = useState("support@mermsemr.com"); + const [email, setMail] = useState(""); const handleEmail = (e) => { setMail(e.target.value); }; // password - const [password, setPassword] = useState("123456"); + const [password, setPassword] = useState(""); const handlePassword = (e) => { setPassword(e.target.value); }; const navigate = useNavigate(); const userApi = new usersService(); const doLogin = async () => { + // userApi.getUserReminders(); test if (email !== "" && password !== "") { var postData = { username: email, diff --git a/src/services/UsersService.js b/src/services/UsersService.js index b53a0c2..f22000b 100644 --- a/src/services/UsersService.js +++ b/src/services/UsersService.js @@ -14,12 +14,16 @@ class usersService { return this.postAuxEnd("/login", reqData); } + getUserReminders(){ + return this.getAuxEnd("/reminders", null); + } //---------------------------------------- ----- //---------------------------------------- ----- // Unified call below //---------------------------------------- ----- //---------------------------------------- ----- getAuxEnd(uri, reqData) { + debugger; const endPoint = process.env.REACT_APP_USERS_ENDPOINT + uri; return Axios.get(endPoint) .then((response) => { From 30a344970ad0c2f9ef27f9a671cc66532e1cd390 Mon Sep 17 00:00:00 2001 From: "DESKTOP-BC3NEC6\\chiefsoft" Date: Sat, 28 Jan 2023 20:41:21 -0500 Subject: [PATCH 3/8] Reminder table demo --- src/components/Reminders/ReminderTable.jsx | 844 +++------------------ 1 file changed, 113 insertions(+), 731 deletions(-) diff --git a/src/components/Reminders/ReminderTable.jsx b/src/components/Reminders/ReminderTable.jsx index b6f950c..4a2cb0a 100644 --- a/src/components/Reminders/ReminderTable.jsx +++ b/src/components/Reminders/ReminderTable.jsx @@ -6,7 +6,7 @@ import dataImage4 from "../../assets/images/data-table-user-4.png"; import SelectBox from "../Helpers/SelectBox"; export default function ReminderTable({ className }) { - const filterCategories = ["All Categories", "Explore", "Featured"]; + const filterCategories = ["All Categories", "Doctors Visit", "Medications"]; const [selectedCategory, setCategory] = useState(filterCategories[0]); return (
- All Product - Value - USD - 24H% - Bits - Time - Status + Item + Start + End + Reminder + . {selectedCategory === "All Categories" ? ( @@ -54,109 +52,32 @@ export default function ReminderTable({ className }) {

- Mullican Computer Joy + Pizza Testing Appointament

- Owned by Xoeyam + Added 10-10-2025
- - - - - - - - - - - + - 7473 ETH + 12-01-25 : 6:30 PM
- - - - - - - - - 6392.99$ + 12-01-28 : 6:30 PM
- - - -24.75 (11.5%) - - - - - 343 - - - 2 Hours 1 min 30s + 4 @@ -164,7 +85,7 @@ export default function ReminderTable({ className }) { type="button" className="text-sm text-white bg-purple px-2.5 py-1.5 rounded-full" > - Active + Edit @@ -173,242 +94,39 @@ export default function ReminderTable({ className }) {
data

- Mullican Computer Joy + Pizza Testing Appointament

- Owned by Xoeyam + Added 10-10-2025
- - - - - - - - - - - + - 7473 ETH + 12-01-25 : 6:30 PM
- - - - - - - - - 6392.99$ + 12-01-28 : 6:30 PM
- - - -24.75 (11.5%) - - - - - 343 - - - 2 Hours 1 min 30s - - - - - - - - -
-
- data -
-
-

- Mullican Computer Joy -

- - Owned by Xoeyam - -
-
- - -
- - - - - - - - - - - - - 7473 ETH - -
- - -
- - - - - - - - - - 6392.99$ - -
- - - - -24.75 (11.5%) - - - - - 343 - - - - - 2 Hours 1 min 30s + 4 @@ -416,7 +134,7 @@ export default function ReminderTable({ className }) { type="button" className="text-sm text-white bg-purple px-2.5 py-1.5 rounded-full" > - Active + Edit @@ -425,129 +143,101 @@ export default function ReminderTable({ className }) {
data

- Mullican Computer Joy + Pizza Testing Appointament

- Owned by Xoeyam + Added 10-10-2025
- - - - - - - - - - - + - 7473 ETH + 12-01-25 : 6:30 PM
- - - - - - - - - 6392.99$ + 12-01-28 : 6:30 PM
- - - -24.75 (11.5%) - - - - - 343 - - - 2 Hours 1 min 30s + 4 + + + + +
+
+ data +
+
+

+ Pizza Testing Appointament +

+ + Added 10-10-2025 + +
+
+ + +
+ + + 12-01-25 : 6:30 PM + +
+ + +
+ + 12-01-28 : 6:30 PM + +
+ + + + 4 + + + + - ) : selectedCategory === "Explore" ? ( + ) : selectedCategory === "Doctors Visit" ? ( <> @@ -561,109 +251,32 @@ export default function ReminderTable({ className }) {

- Mullican Computer Joy + Doctors Testing Appointament

- Owned by Xoeyam + Added 10-10-2025
- - - - - - - - - - - + - 7473 ETH + 12-01-25 : 6:30 PM
- - - - - - - - - 6392.99$ + 12-01-28 : 6:30 PM
- - - -24.75 (11.5%) - - - - - 343 - - - 2 Hours 1 min 30s + 4 @@ -671,7 +284,7 @@ export default function ReminderTable({ className }) { type="button" className="text-sm text-white bg-purple px-2.5 py-1.5 rounded-full" > - Active + Edit @@ -680,124 +293,47 @@ export default function ReminderTable({ className }) {
data

- Mullican Computer Joy + Hospital Testing Appointament

- Owned by Xoeyam + Added 10-10-2025
- - - - - - - - - - - + - 7473 ETH + 12-01-25 : 6:30 PM
- - - - - - - - - 6392.99$ + 12-01-28 : 6:30 PM
- - - -24.75 (11.5%) - - - - - 343 - - - 2 Hours 1 min 30s + 4 @@ -809,116 +345,39 @@ export default function ReminderTable({ className }) {
data

- Mullican Computer Joy + Pizza Testing Appointament

- Owned by Xoeyam + Added 10-10-2025
- - - - - - - - - - - + - 7473 ETH + 12-01-25 : 6:30 PM
- - - - - - - - - 6392.99$ + 12-01-28 : 6:30 PM
- - - -24.75 (11.5%) - - - - - 343 - - - 2 Hours 1 min 30s + 4 @@ -926,7 +385,7 @@ export default function ReminderTable({ className }) { type="button" className="text-sm text-white bg-purple px-2.5 py-1.5 rounded-full" > - Active + Edit @@ -935,124 +394,47 @@ export default function ReminderTable({ className }) {
data

- Mullican Computer Joy + Pizza Testing Appointament

- Owned by Xoeyam + Added 10-10-2025
- - - - - - - - - - - + - 7473 ETH + 12-01-25 : 6:30 PM
- - - - - - - - - 6392.99$ + 12-01-28 : 6:30 PM
- - - -24.75 (11.5%) - - - - - 343 - - - 2 Hours 1 min 30s + 4 From f766c19465ae9a660ca5ff6d70c6bad9918c7783 Mon Sep 17 00:00:00 2001 From: "DESKTOP-BC3NEC6\\chiefsoft" Date: Sat, 28 Jan 2023 21:25:55 -0500 Subject: [PATCH 4/8] Login hx --- .../Settings/Tabs/LoginActivityTab.jsx | 151 +++--------------- 1 file changed, 20 insertions(+), 131 deletions(-) diff --git a/src/components/Settings/Tabs/LoginActivityTab.jsx b/src/components/Settings/Tabs/LoginActivityTab.jsx index 403c12d..afd9cd1 100644 --- a/src/components/Settings/Tabs/LoginActivityTab.jsx +++ b/src/components/Settings/Tabs/LoginActivityTab.jsx @@ -8,246 +8,135 @@ export default function LoginActivityTab() { - - + + - - - - - - - - - - - - - - - - - - - - -
OSBrowserChannelDate LocationLast sessionStatus
- Windows + Desktop
- Google Chrome + 10-10-2035
- Dhaka , Bangladesh + 10.0.0.1000 - - 2 days ago - - - - active - - - -
- Mac + Desktop
- Firefox + 10-10-2035
- Tokyo,japan + 10.0.0.1000 - - 5 days ago - - - - Inactive - - - -
- App + Desktop
- App + 10-10-2035
- Barhin,Dubai + 10.0.0.1000 - - 2 days ago - - - - active - - - -
- Windows + Desktop
- Google Chrome + 10-10-2035
- Dhaka , Bangladesh + 10.0.0.1000 - - 2 days ago - - - - active - - - -
- Mac + Desktop
- Firefox + 10-10-2035
- Tokyo,japan + 10.0.0.1000 - - 5 days ago - - - - Inactive - - - -
- App + Mobile
- App + 10-10-2035
- Barhin,Dubai + 10.0.0.1000 - - 2 days ago - - - - active - - - -
From 9a269b573201d8a020da060c28c5c673f5ee353d Mon Sep 17 00:00:00 2001 From: "DESKTOP-BC3NEC6\\chiefsoft" Date: Sat, 28 Jan 2023 22:27:03 -0500 Subject: [PATCH 5/8] Addreminder --- src/components/Reminders/index.jsx | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/src/components/Reminders/index.jsx b/src/components/Reminders/index.jsx index 032df13..a36ba00 100644 --- a/src/components/Reminders/index.jsx +++ b/src/components/Reminders/index.jsx @@ -1,12 +1,29 @@ -import React from "react"; -import HistoryAnalyticsCard from "../Cards/HistoryAnalyticsCard"; -import Layout from "../Partials/Layout"; -import ReminderTable from "./ReminderTable"; +import React from 'react' +import HistoryAnalyticsCard from '../Cards/HistoryAnalyticsCard' +import Layout from '../Partials/Layout' +import ReminderTable from './ReminderTable' +import { Link } from 'react-router-dom' export default function Reminders() { return ( <> +
+
+
+
+
+ + Add Reminder + +
+
+
+
+
@@ -14,5 +31,5 @@ export default function Reminders() {
- ); + ) } From 37fa170108ddd723c586c22188fbcaa534f07555 Mon Sep 17 00:00:00 2001 From: "DESKTOP-BC3NEC6\\chiefsoft" Date: Sat, 28 Jan 2023 22:54:47 -0500 Subject: [PATCH 6/8] Headet token --- src/components/AuthPages/Login/index.jsx | 5 +++-- src/services/UsersService.js | 18 +++++++++++++----- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/src/components/AuthPages/Login/index.jsx b/src/components/AuthPages/Login/index.jsx index 2a0fc66..1e0498a 100644 --- a/src/components/AuthPages/Login/index.jsx +++ b/src/components/AuthPages/Login/index.jsx @@ -32,7 +32,6 @@ export default function Login() { const navigate = useNavigate(); const userApi = new usersService(); const doLogin = async () => { - // userApi.getUserReminders(); test if (email !== "" && password !== "") { var postData = { username: email, @@ -40,9 +39,11 @@ export default function Login() { }; const loginResult = await userApi.logInUser(postData); // just for a test // if (email === "support@mermsemr.com") { - if (loginResult.data.status > 0) { // just for a start + if (loginResult.data.status > 0 && loginResult.data.session_token !='') { // just for a start localStorage.setItem("email", `${email}`); + localStorage.setItem("session_token", `${loginResult.data.session_token}`); setLoginLoading(true); + // userApi.getUserReminders(); testing setTimeout(() => { toast.success("Login Successfully"); navigate("/", { replace: true }); diff --git a/src/services/UsersService.js b/src/services/UsersService.js index f22000b..5d78009 100644 --- a/src/services/UsersService.js +++ b/src/services/UsersService.js @@ -11,6 +11,7 @@ class usersService { /* clean up the request data here */ + localStorage.setItem("session_token", ``); return this.postAuxEnd("/login", reqData); } @@ -24,8 +25,16 @@ class usersService { //---------------------------------------- ----- getAuxEnd(uri, reqData) { debugger; + const session_token = localStorage.getItem("session_token"); + let axiosConfig = { + headers: { + 'Accept': 'application/json', + 'Content-Type': 'application/json;charset=UTF-8', + 'Authorization': `Basic ${session_token}`, + } + }; const endPoint = process.env.REACT_APP_USERS_ENDPOINT + uri; - return Axios.get(endPoint) + return Axios.get(endPoint,axiosConfig) .then((response) => { // console.log(response); // res = response; @@ -48,13 +57,12 @@ class usersService { postAuxEnd(uri, reqData) { const endPoint = process.env.REACT_APP_USERS_ENDPOINT + uri; - const token = '..your token..' + const session_token = localStorage.getItem("session_token"); let axiosConfig = { headers: { 'Accept': 'application/json', - 'Access-Control-Allow-Origin': '*', 'Content-Type': 'application/json;charset=UTF-8', - 'Authorization': `Basic ${token}`, + 'Authorization': `Basic ${session_token}`, } }; //Access-Control-Allow-Origin @@ -64,7 +72,7 @@ class usersService { }; // Axios.defaults.headers.post['Content-Type'] ='application/json;charset=utf-8'; // Axios.defaults.headers.post['Access-Control-Allow-Origin'] = '*'; //,axiosConfig - return Axios.post(endPoint, reqData) + return Axios.post(endPoint, reqData,axiosConfig) .then((response) => { console.log(response); // res = response; From 7ce87a3ee835f3b0d82191e39fe9d2bb0706dab7 Mon Sep 17 00:00:00 2001 From: "DESKTOP-BC3NEC6\\chiefsoft" Date: Sat, 28 Jan 2023 23:13:13 -0500 Subject: [PATCH 7/8] test --- src/components/AuthPages/Login/index.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/AuthPages/Login/index.jsx b/src/components/AuthPages/Login/index.jsx index 1e0498a..f3fa819 100644 --- a/src/components/AuthPages/Login/index.jsx +++ b/src/components/AuthPages/Login/index.jsx @@ -43,7 +43,7 @@ export default function Login() { localStorage.setItem("email", `${email}`); localStorage.setItem("session_token", `${loginResult.data.session_token}`); setLoginLoading(true); - // userApi.getUserReminders(); testing + // userApi.getUserReminders(); //testing setTimeout(() => { toast.success("Login Successfully"); navigate("/", { replace: true }); From 9b2145ff00e33c2aeaf4442673fcfccc8b5b1dd6 Mon Sep 17 00:00:00 2001 From: "DESKTOP-BC3NEC6\\chiefsoft" Date: Sat, 28 Jan 2023 23:52:14 -0500 Subject: [PATCH 8/8] Profile layout --- src/components/AuthPages/AuthProfile/index.jsx | 1 + src/components/Home/SellHistoryMarketVisitorAnalytic.jsx | 9 ++++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/components/AuthPages/AuthProfile/index.jsx b/src/components/AuthPages/AuthProfile/index.jsx index fc92027..4db9d25 100644 --- a/src/components/AuthPages/AuthProfile/index.jsx +++ b/src/components/AuthPages/AuthProfile/index.jsx @@ -145,6 +145,7 @@ export default function AuthProfile() {
+
diff --git a/src/components/Home/SellHistoryMarketVisitorAnalytic.jsx b/src/components/Home/SellHistoryMarketVisitorAnalytic.jsx index 2de2da2..fd42a3b 100644 --- a/src/components/Home/SellHistoryMarketVisitorAnalytic.jsx +++ b/src/components/Home/SellHistoryMarketVisitorAnalytic.jsx @@ -104,9 +104,7 @@ export default function SellHistoryMarketVisitorAnalytic({ className }) { }`} >
-
- -
+
@@ -127,6 +125,11 @@ export default function SellHistoryMarketVisitorAnalytic({ className }) {
+ +
+ +
+
);