From 864de50c695dcffd98ac0982ee27ed0c09524602 Mon Sep 17 00:00:00 2001 From: kushagra Shukla Date: Tue, 11 Jul 2023 01:15:47 -0400 Subject: [PATCH 1/9] changed emailRegex form so that it will except all type of email . in previous it wont accept email that having space after .com and yahoo.com --- src/components/AuthPage/ForgotPassword/index.jsx | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/components/AuthPage/ForgotPassword/index.jsx b/src/components/AuthPage/ForgotPassword/index.jsx index 9d1e72f7..57ea45e1 100644 --- a/src/components/AuthPage/ForgotPassword/index.jsx +++ b/src/components/AuthPage/ForgotPassword/index.jsx @@ -39,6 +39,7 @@ const ForgotPassword = ({ const [success, setSuccess] = useState(false); const [email, setEmail] = useState(""); const [open, setOpen] = React.useState(true); + const [isValidEmail, setIsValidEmail] = useState(false); const errorProps = useSelector(({ auth }) => auth.profile.error); const loadingProps = useSelector(({ auth }) => auth.profile.loading); const dispatch = useDispatch(); @@ -68,6 +69,13 @@ const ForgotPassword = ({ await sendPasswordResetEmail(email)(firebase, dispatch); }; + const handleChange =(e)=>{ + const enteredEmail = e.target.value; + setEmail(enteredEmail) + const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+\s*$/; + const isValid = emailRegex.test(enteredEmail); + setIsValidEmail(isValid); + } const classes = useStyles(); return ( @@ -115,7 +123,7 @@ const ForgotPassword = ({ setEmail(e.target.value)} + onChange={handleChange} className="mb-32" fullWidth height="10rem" @@ -134,7 +142,8 @@ const ForgotPassword = ({ className="mt-10" type="submit" fullWidth - data-testId="forgotPasswordButton"> + data-testId="forgotPasswordButton" + disabled={!isValidEmail}> {loading ? "Sending..." : "Send me the link"} From bbe8c57cb815d9c152a22ed604d9283e7a530145 Mon Sep 17 00:00:00 2001 From: kushagra Shukla Date: Tue, 11 Jul 2023 01:48:51 -0400 Subject: [PATCH 2/9] changed emailRegex form so that it will except all type of email . in previous it wont accept email that having space after .com and yahoo.com --- src/components/AuthPage/ForgotPassword/index.jsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/AuthPage/ForgotPassword/index.jsx b/src/components/AuthPage/ForgotPassword/index.jsx index 57ea45e1..a7827dfc 100644 --- a/src/components/AuthPage/ForgotPassword/index.jsx +++ b/src/components/AuthPage/ForgotPassword/index.jsx @@ -63,6 +63,7 @@ const ForgotPassword = ({ [dispatch] ); + const onSubmit = async (values) => { values.preventDefault(); setError(""); From 200a7209d34dd28b6ecee4fbf5df534613883741 Mon Sep 17 00:00:00 2001 From: kushagra Shukla Date: Wed, 12 Jul 2023 02:55:08 -0400 Subject: [PATCH 3/9] added line cy.should('be.disabled'). as some test cases are failed . for more info visit Validate mail pull request --- cypress/e2e/components/auth/forgotPassword/forgotpassword.cy.js | 1 + 1 file changed, 1 insertion(+) diff --git a/cypress/e2e/components/auth/forgotPassword/forgotpassword.cy.js b/cypress/e2e/components/auth/forgotPassword/forgotpassword.cy.js index f18eb690..e3d5ca09 100644 --- a/cypress/e2e/components/auth/forgotPassword/forgotpassword.cy.js +++ b/cypress/e2e/components/auth/forgotPassword/forgotpassword.cy.js @@ -24,6 +24,7 @@ describe("Forgot Password Page | CodeLabz", () => { cy.visit(`${this.base_url}forgotpassword`); cy.get("[data-testId=forgotPasswordButton]").click(); cy.contains("The email address is badly formatted."); + cy.should('be.disabled') }); it("successfull ", function () { cy.visit(`${this.base_url}forgotpassword`); From a2e8da5aceb16e61236f6cbc6438dbbde3467635 Mon Sep 17 00:00:00 2001 From: kushagra Shukla Date: Wed, 12 Jul 2023 03:09:29 -0400 Subject: [PATCH 4/9] added line cy.should('be.disabled'). as some test cases are failed . for more info visit Validate mail pull request --- cypress/e2e/components/auth/forgotPassword/forgotpassword.cy.js | 1 + 1 file changed, 1 insertion(+) diff --git a/cypress/e2e/components/auth/forgotPassword/forgotpassword.cy.js b/cypress/e2e/components/auth/forgotPassword/forgotpassword.cy.js index e3d5ca09..e285bd60 100644 --- a/cypress/e2e/components/auth/forgotPassword/forgotpassword.cy.js +++ b/cypress/e2e/components/auth/forgotPassword/forgotpassword.cy.js @@ -11,6 +11,7 @@ describe("Forgot Password Page | CodeLabz", () => { }); }); + before(function () { indexedDB.deleteDatabase("firebaseLocalStorageDb"); }); From 0c15069e3d8b3cb14600238a2f5ddec9b2c3bb4f Mon Sep 17 00:00:00 2001 From: kushagra Shukla Date: Thu, 13 Jul 2023 11:45:14 -0400 Subject: [PATCH 5/9] here i render the component on path ={/} . in previous one the component can be render on every page like on login page and sign up page . --- src/routes.jsx | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/routes.jsx b/src/routes.jsx index 39493a49..5d683c14 100644 --- a/src/routes.jsx +++ b/src/routes.jsx @@ -87,10 +87,16 @@ const Routes = () => { return ( - {/* */} - - + //HomePage + ( +
+ + +
+ ) + } /> Date: Fri, 14 Jul 2023 01:49:49 -0400 Subject: [PATCH 6/9] changes --- src/components/AuthPage/ForgotPassword/index.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/AuthPage/ForgotPassword/index.jsx b/src/components/AuthPage/ForgotPassword/index.jsx index a7827dfc..a765d283 100644 --- a/src/components/AuthPage/ForgotPassword/index.jsx +++ b/src/components/AuthPage/ForgotPassword/index.jsx @@ -63,7 +63,7 @@ const ForgotPassword = ({ [dispatch] ); - + const onSubmit = async (values) => { values.preventDefault(); setError(""); From b3e5d08a0562e904fe87107d0ccfc758864a4612 Mon Sep 17 00:00:00 2001 From: kushagra Shukla Date: Fri, 14 Jul 2023 01:52:40 -0400 Subject: [PATCH 7/9] changes to forgotpassword.cy --- .../e2e/components/auth/forgotPassword/forgotpassword.cy.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cypress/e2e/components/auth/forgotPassword/forgotpassword.cy.js b/cypress/e2e/components/auth/forgotPassword/forgotpassword.cy.js index e285bd60..a9358aaa 100644 --- a/cypress/e2e/components/auth/forgotPassword/forgotpassword.cy.js +++ b/cypress/e2e/components/auth/forgotPassword/forgotpassword.cy.js @@ -11,7 +11,7 @@ describe("Forgot Password Page | CodeLabz", () => { }); }); - + before(function () { indexedDB.deleteDatabase("firebaseLocalStorageDb"); }); @@ -23,9 +23,9 @@ describe("Forgot Password Page | CodeLabz", () => { it("empty email ", function () { cy.visit(`${this.base_url}forgotpassword`); + cy.get("[data-testId=forgotPasswordButton]").invoke('removeAttr', 'disabled'); cy.get("[data-testId=forgotPasswordButton]").click(); cy.contains("The email address is badly formatted."); - cy.should('be.disabled') }); it("successfull ", function () { cy.visit(`${this.base_url}forgotpassword`); From 8f257090ec6a59c03764a2c6b932817b1c849784 Mon Sep 17 00:00:00 2001 From: kushagra Shukla Date: Mon, 17 Jul 2023 13:38:56 -0400 Subject: [PATCH 8/9] created small changes to notification card , change its borderRadius, created and make it on top of hard right --- src/components/Notification/NotificationBox.jsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/components/Notification/NotificationBox.jsx b/src/components/Notification/NotificationBox.jsx index 36215e52..3dd33d2c 100644 --- a/src/components/Notification/NotificationBox.jsx +++ b/src/components/Notification/NotificationBox.jsx @@ -1,6 +1,6 @@ import { Grid, Card, Menu, MenuItem } from "@mui/material"; import IconButton from "@mui/material/IconButton"; -import MoreVertOutlinedIcon from "@mui/icons-material/MoreVertOutlined"; +import MoreHorizOutlinedIcon from '@mui/icons-material/MoreHorizOutlined'; import Typography from "@mui/material/Typography"; import Avatar from "@mui/material/Avatar"; import Box from "@mui/material/Box"; @@ -27,7 +27,7 @@ const NotificationBox = ({ notification }) => { <> {!notification.isRead && } { }} aria-label="share" data-testId="MoreIcon" + style={{ position: 'absolute', top: 0, right: 0 }} > - + Mark as read From c90db5ff2eabc4c42ef3665d4ca4a4d681b02e20 Mon Sep 17 00:00:00 2001 From: Kushal shukla <85934954+kushalShukla-web@users.noreply.github.com> Date: Wed, 19 Jul 2023 07:52:23 -0400 Subject: [PATCH 9/9] Update routes.jsx --- src/routes.jsx | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/routes.jsx b/src/routes.jsx index 5d683c14..b94f3c37 100644 --- a/src/routes.jsx +++ b/src/routes.jsx @@ -87,16 +87,10 @@ const Routes = () => { return ( + {/* */} - //HomePage - ( -
- - -
- ) - } /> + +