-
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
Feat/add on click to update applied on date #81
base: main
Are you sure you want to change the base?
Conversation
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.
Overall, code looks clean and well written.
@@ -47,6 +47,8 @@ function JobApplication() { | |||
const [jobDescription, setJobDescription] = useState(''); | |||
const [applicationURL, setApplicationURL] = useState(''); | |||
const [companyId, setCompanyId] = useState(''); | |||
const [isEditing, setIsEditing] = useState(false); |
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.
Could this be editing and setEditing instead of isEditing and setIsEditing?
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 agree with you that editing and setEditing read better, but I was trying to maintain consistency with other boolean state syntax in showJobApplication.tsx. For example, modal state is managed through "isModalOpen, setIsModalOpen", and edit model state is managed through "isEditModelOpen, setIsEditModelOpen."
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 like the consistency that Danielle applied. It might be good to add an issue/ticket to refactor all of the "is" parts in the code into simply "set".
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.
Pulling this down and testing locally shows that this doesn't actually save the change when you navigate away from the page. Is there another issue to implement that save?
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.
See comments for edits to handleSave function and a possible cypress test to ensure the backend is saving the modified user input
@@ -536,6 +536,10 @@ FORMAT: lastname, firstname | |||
- [Github](https://github.com/stefanjbloom) | |||
- [LinkedIn](https://www.linkedin.com/in/stefanjbloom/) | |||
|
|||
**Cardona, Danielle** | |||
- [Github](https://github.com/dcardona23) | |||
- [LinkedIn](https://github.com/dcardona23) |
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 looks like you accidentally listed your Github twice instead of adding the LinkedIn link.
@@ -72,6 +75,11 @@ function JobApplication() { | |||
} | |||
}, [jobAppId]); | |||
|
|||
const handleSave = () => { | |||
setIsEditing(false) | |||
setEditedDate(editedDate) |
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.
Because editedDate is already the current value in state, this code on line 80, setEditedDate(editedDate)
may not be doing anything. It can likely be removed.
*Note: editedDate is updated with the user types a new date into the input field and set via the onChange event setEditedDate(e.target.value)
@@ -47,6 +47,8 @@ function JobApplication() { | |||
const [jobDescription, setJobDescription] = useState(''); | |||
const [applicationURL, setApplicationURL] = useState(''); | |||
const [companyId, setCompanyId] = useState(''); | |||
const [isEditing, setIsEditing] = useState(false); |
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 like the consistency that Danielle applied. It might be good to add an issue/ticket to refactor all of the "is" parts in the code into simply "set".
@@ -72,6 +75,11 @@ function JobApplication() { | |||
} | |||
}, [jobAppId]); | |||
|
|||
const 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.
I don't believe that the handleSave()
function is updating the back end. If you call updateJobApplication()
inside of the handleSave function, it would trigger the updateJobApplication()
function so that the changes persist in the backend database.
You could add a cypress test to verify that the data is saving in the back end.
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 could add a cypress test to verify that the data is saving in the back end (see the handleSave() function notes for additional context.
Type of Change
Description
This PR adds on-click functionality to edit an application date by clicking the applied on date on an application show page. It also adds a Cypress test to confirm functionality.
Motivation and Context
This change allows a user to change an application date from the application show page without clicking on the "Edit" button to edit the application.
Closes issue #96.
Related Tickets
Screenshots (if appropriate):
Added Test?
Checklist: