-
Notifications
You must be signed in to change notification settings - Fork 0
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
TCES-41 urd create and update user information to be updated #21
TCES-41 urd create and update user information to be updated #21
Conversation
TCES-41 URD-Create and Update User Information - TO BE UPDATED
You will be responsible for the frontend flow of creating a new user and updating an existing user's information
Completion Requirements:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just left a few comments. Some stuff is on our end by not creating a guide for the file structure that we wanted. Otherwise, it is looking good!
client/src/App.jsx
Outdated
</a> | ||
</header> | ||
</div> | ||
<> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is an unnecessary tag
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can't render two components without a fragment, so I guess for now it may be necessary.
client/src/components/Create.jsx
Outdated
Typography, | ||
} from "@mui/material"; | ||
|
||
const styles = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you are going to use CSS styling, it would be best to use dedicated css files for these
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alternatively you could look into styled components. https://styled-components.com/. You could take a look at either Kevin or Emily's prs for a reference.
client/src/components/Edit.jsx
Outdated
Typography, | ||
} from "@mui/material"; | ||
|
||
const styles = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same styling comment from Create
client/src/App.jsx
Outdated
@@ -1,27 +1,12 @@ | |||
import logo from "./logo.svg"; | |||
import "./App.css"; | |||
import Create from "./components/Create"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be best to have these existing in a pages
directory like how was brought up in stand-up so when it comes to routing we would route to only existing pages, not components. Since these create pages will exist on a route.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For reference, please take a look at Kevin's PR.
client/src/components/Create.jsx
Outdated
marginRight: "auto", | ||
}, | ||
}; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should add a function for the Button onClick and a fake API call so when the backend gets implemented, it will be a quick edit and test to get it hooked up.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also you should probably maintain the states of the different fields in this component so that we can track what the user has inputted and attach that to the API call. This also applies in edit.jsx
client/src/components/Edit.jsx
Outdated
marginRight: "auto", | ||
}, | ||
}; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same API comment from Create
Also, be sure to get approval from Jake. This is a requirement for frontend PRs. Once that happens, you can update the PR description and add a label for Design Approved |
Is there a naming convention for the external css file? Also, will each component/page have its own css file, or is there a master css file that we are supposed to use? |
Each page would get its own CSS file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work Taha! The components look really great. There are some minor things that need to be changed, but once those are addressed, the pr should be good to merge in!
client/src/components/Create.jsx
Outdated
Typography, | ||
} from "@mui/material"; | ||
|
||
const styles = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alternatively you could look into styled components. https://styled-components.com/. You could take a look at either Kevin or Emily's prs for a reference.
client/src/App.jsx
Outdated
@@ -1,27 +1,12 @@ | |||
import logo from "./logo.svg"; | |||
import "./App.css"; | |||
import Create from "./components/Create"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For reference, please take a look at Kevin's PR.
client/src/App.jsx
Outdated
</a> | ||
</header> | ||
</div> | ||
<> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can't render two components without a fragment, so I guess for now it may be necessary.
client/src/components/Create.jsx
Outdated
marginRight: "auto", | ||
}, | ||
}; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also you should probably maintain the states of the different fields in this component so that we can track what the user has inputted and attach that to the API call. This also applies in edit.jsx
f293ff6
to
e340b7c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! Looks really good.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the changes Taha, they look great! The only things that should be changed are the names of the create and edit components, as well as the folder they are in. Something like create-user-component and edit-user-component would be better.
3ff2daf
to
5024726
Compare
I updated the folders, but do you want to update the file names too? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the changes! I just left a single comment. Otherwise the pr should be good to go!
type="submit" | ||
variant="contained" | ||
size="large" | ||
onClick={handleSave} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently, despite the form validation onClick is called on the button. Instead of assigning the button's onClick method to handleClick, instead assign the encompassing form's onSave method to it. This should be done in the create component as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I couldn't find anything about an onSave method, but I added it to onSubmit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whoops, thats what I meant to say!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the great work Taha!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Thank you for addressing mine and Daniel's comments!
Should I squash and merge? |
Yep! |
Created the edit user and create user pages.
Completed TCES-41.
Design approved by Jake.