Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

signup page #262

Open
wants to merge 22 commits into
base: develop
Choose a base branch
from
Open

signup page #262

wants to merge 22 commits into from

Conversation

aakankshaagr
Copy link

@aakankshaagr aakankshaagr commented Jun 27, 2021

Description

Developed SignUp Page

Fixes #248

Type of Change:

  • Code
  • Quality Assurance
  • User Interface

Code/Quality Assurance Only

  • New feature (non-breaking change which adds functionality pre-approved by mentors)

How Has This Been Tested?

image

Checklist:

  • My PR follows the style guidelines of this project
  • I have performed a self-review of my own code or materials

Code/Quality Assurance Only

  • My changes generate no new warnings
  • New and existing unit tests pass locally with my changes

@welcome
Copy link

welcome bot commented Jun 27, 2021

Hello there!👋 Welcome to the project!💖

Thank you and congrats🎉 for opening your first pull request.✨ AnitaB.org is an inclusive community, committed to creating a safe and positive environment.🌸Please adhere to our Code of Conduct and Contribution Guidelines.🙌.We will get back to you as soon as we can.😄

Feel free to join us on AnitaB.org Open Source Zulip Community.💖 We have different streams for each active repository for discussions.✨ Hope you have a great time there!😄

@mtreacy002 mtreacy002 added Category: Coding Changes to code base or refactored code that doesn't fix a bug. Category: User Interface Improvements or additions to design. Status: Needs Review PR needs an additional review or a maintainer's review. Type: Enhancement New feature or request. labels Jun 28, 2021
Copy link
Member

@mtreacy002 mtreacy002 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@aakankshaagr , thank you for submitting the PR. I have left some feedback for you below as well as an alternative to upload the side image. Also, please don't forget to remove all the commented lines that are no longer needed. Let me know if you have any questions 😉.

<label id="password">Password :</label>
<input
aria-labelledby="password"
className="feilds"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please fix typo

className="feilds"
type={isPasswordShown ? "text" : "password"}
name="password"
placeholder="atleast 8 characters"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
placeholder="atleast 8 characters"
placeholder="at least 8 characters"

<label id="confirmPassword">Confirm Password :</label>
<input
aria-labelledby="confirmPassword"
className="feilds"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo

className="feilds"
type={isPasswordShown ? "text" : "password"}
name="confirmPassword"
placeholder="atleast 8 characters"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

although the design shows this as placehloder, IMO it makes more sense if we show re-type password here instead since this field is not to insert a totally new password.

<div className="container">
<div class="row align-items-start">
<div class="col">
<img src="src/assets/images/side_image.jpg" alt="background" />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

instead of using image path and have the image saved inside images folder, you can use the githubusercontent link of an image as it was used on the About.jsx line 12.

@mtreacy002 mtreacy002 added Status: Changes Requested Changes are required to be done by the PR author. and removed Status: Needs Review PR needs an additional review or a maintainer's review. labels Jun 28, 2021
@aakankshaagr
Copy link
Author

Thanks @mtreacy002 !! I have made changes as you suggested. About image I don't know how to get side_image in way suggested by you. Thankfully, somehow it worked and image is displayed. I have made changes in classes naming as there was lot of css getting included with those names.
Icon part is left as m facing some issues in icon display.
I didn't find any information for page layout when screen size is small so I made it as per my wish.If it's already there then please inform me, I will make changes according to that.
In media queries, I want screen to be divided in 2 rows top having image and bottom having form. I don't know why image is not showing up.Can you please point out where I am going wrong?

Waiting for your feedback :) !!

@aakankshaagr
Copy link
Author

aakankshaagr commented Jun 30, 2021

image
if Register component can too stretch like footer and navbar then it will look better.
image

@mtreacy002
Copy link
Member

mtreacy002 commented Jul 8, 2021

@aakankshaagr , is there any reason you don't make it stretch like the footer? I believe the image in Figma also shows that the container (image+form) is stretchable.
Screen Shot 2021-07-08 at 11 34 09 pm

Copy link
Member

@mtreacy002 mtreacy002 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @aakankshaagr , the build compiled with warnings. Can you try to fix this, please? Thanks
Screen Shot 2021-07-08 at 11 22 59 pm

@aakankshaagr
Copy link
Author

aakankshaagr commented Jul 12, 2021

@mtreacy002 On stretching image got doubled and that wasn't looking good. So, as I mentioned earlier ,I felt like only making form stretchable.

@aakankshaagr
Copy link
Author

@mtreacy002 route.js got autoformatted and by mistake, I pushed route.js too. While trying to fix that I somehow merged develop.I don't know how to undo this. I tried to rebase and git reset --merge but it is not working. Please suggest some other way to remove this.

Copy link
Member

@mtreacy002 mtreacy002 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@aakankshaagr , I checked your code changes and it doesn't seem to have major issues. Auto-formatting of routes.jsx seems ok and the merged of develop branch to your pr branch seems to have no impact to the code you're submitting. Although, I do have some feedback for you to work on:

  • the build is failing. Below is the screenshot

Screen Shot 2021-07-16 at 1 59 39 pm

  • the tests are also failing. see this gist for the error warnings.

Can you please fix these errors? Thanks

PS: I have a second thought on the form stretch. The stretching of the register form field seems odd since the fields on the form won't need that bigger input field. I think the form stretch on the bigger screen size should be maximized to up to 75% of the screen width instead to make it reasonable. Perhaps your screenshot above was made with smaller zoom range (~50 - 67%) which is probably not what most of our users would have (~75-125%). So, you can put it back to the way it was IMO 😉.
Screen Shot 2021-07-16 at 2 17 25 pm

@aakankshaagr
Copy link
Author

@mtreacy002 I have removed error warnings. It is also suggesting we should add alt text for the password icon image. What shall I keep as alt text?
Form size is dynamic, as screen size increases fields will stretch. So I think changes help in case if the user screen size is way large or else it will display like previously I showed you.

@vj-codes
Copy link
Member

@mtreacy002 hey can you please approve the workfow run in this PR?

@aakankshaagr
Copy link
Author

Tests are failing bcz placeholder texts are not matching in tests and register files. So I am changing placeholder texts. @mtreacy002 According to your earlier suggestion password placeholder values isn't suitable for adding in tests. So I am changing them to be the same as label names. Is that fine or I should do vice versa?

@aakankshaagr
Copy link
Author

aakankshaagr commented Aug 19, 2021

@mtreacy002 All test cases are passed :)
image
I hope now it passes all build tests.

@aakankshaagr
Copy link
Author

@mtreacy002 can you please approve the workflow?

@aakankshaagr
Copy link
Author

image

image

All test cases are passing along with no warnings. @mtreacy002 Can you plz approve the workflow.

@aakankshaagr
Copy link
Author

@mtreacy002 please approve the workflow. I have changed the layout when zoom<50% as suggested by you. All test cases have been passed locally.

Copy link
Member

@mtreacy002 mtreacy002 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @aakankshaagr , thank you for the pr and my apology for replying late.
Please check the below feedback.
Plus, can you please keep the Sidebar and the VideoSection from the existing code in your commits. It seems like you've deleted them by accident on this pr.

Thank you beforehand 😉

src/register/Register.jsx Show resolved Hide resolved
@aakankshaagr
Copy link
Author

Hi @aakankshaagr , thank you for the pr and my apology for replying late. Please check the below feedback. Plus, can you please keep the Sidebar and the video section from the existing code in your commits. It seems like you've deleted them by accident on this pr.

Thank you beforehand 😉

It's fine @mtreacy002 😊. Sure, I will add them again. I am sorry I thought that the VideoSection part was not related to my pr and I added them by mistake. So I removed them. Thanks to other contributors for correcting my mistake.I have added username field and updated tests cases too. Also repositioned error before signup button. Can you please check the changes once again?
Also, I found that footer is not working. Link tag is missing to attribute and this is causing a warning in the register form section. Please look into it once and tell me if there is something I can do about it.

@aakankshaagr
Copy link
Author

image
@mtreacy002 is this matching with your suggested changes? Please review this and let me know if there are some changes that need to be done.
Thank you

Copy link

@rkraeher rkraeher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice work 🙂 just a refactor suggestion: there are a lot of repeated assertions throughout the tests where the only thing that changes are the values you are passing. you could remove a lot of duplicated code by mapping these repeated values with the jest it.each method. see the docs

const [showTermsModal,setShowTermsModal] = useState(false);
const { isAuth } = useContext(AuthContext);
const [isValidUsername, setIsValidUsername] = useState(true);
const [isValidName, setIsValidName] = useState(true);
Copy link

@rkraeher rkraeher Mar 5, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if these are validators, does it make more sense for initial state to be set to false instead? 🤔 maybe they should only be true after successful validation?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rkraeher Thank you for reviewing. Values are set so when the user enters the wrong value then display an error. Apart from validating, error message is also handled by this.

<section className="register">
<h1>Welcome To Bridge In Tech</h1>
<h4>
Lets start your account setup so you can have access to a
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets is a typo. should be Let's

expect(screen.getByLabelText("Photo Url :", {selector: "input"})).toBeEmpty();
expect(screen.getByLabelText("Resume Url :", {selector: "input"})).toBeEmpty();
expect(
screen.getByLabelText("Username :", { selector: "input" })
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there is a lot of weird formatting and line breaks in this file that really decreases the readability of the tests.

import { rest } from "msw";
import { setupServer } from "msw/node";
import {
render,
Copy link

@rkraeher rkraeher Mar 5, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

something odd happened with the formatting in this file as well. this negatively affects readability like ☝️

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess it's because prettier is not working properly for me. I guess the code will be readable after running the prettier. I tried hard to correct this even done manually but after saving everything goes back to the same.So it's quite difficult to format tests.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. do you have prettier extension or any other linter enabled? it is annoying to do it manually but if you do that and have the prettier disabled it shouldn't autoformat when you save

target: { value: "My Name" },
});
act(() => {
fireEvent.change(screen.getByPlaceholderText("Username"), {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we really need to use act() in this test if none of these form input events are asynchronous except for the submit registration?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rkraeher I guess we need to use act()
image

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this warning seems to have to do with state updates happening asynchronously. this is not really how act should be used if you check out the docs.

This article also has a really useful explanation of the error and some suggestions on alternative solutions for how to deal with it effectively and eliminate the warning

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category: Coding Changes to code base or refactored code that doesn't fix a bug. Category: User Interface Improvements or additions to design. Status: Changes Requested Changes are required to be done by the PR author. Type: Enhancement New feature or request.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

UI: Develop Sign Up page
5 participants