-
Notifications
You must be signed in to change notification settings - Fork 23
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
571 edit contacts #613
base: Development
Are you sure you want to change the base?
571 edit contacts #613
Conversation
… 571-EditContacts
… 571-EditContacts
…erwrites the existing record. Add notes
… 571-EditContacts
… 571-EditContacts
now doing linting errors |
… 571-EditContacts
// const Console = props => { | ||
// const contacts = props; | ||
// console.table(contacts); | ||
// return 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 think this is a temporary component used for debugging? We could remove it now that it's no longer in use.
// Planning and observations | ||
// try to add new contact to pod A, which already has a contact | ||
// -result: updates existing contact | ||
// add new contact to pod B, which doesn't have a contact | ||
// -result: adds to grid | ||
// current commit : Edit function will update contact names if webId remains the same. | ||
// If user edits the webId, a new contact will be created. | ||
|
||
// ✅ prepopulate form when editing. | ||
// ✅ if webId is different, delete current contact and add contact. Having issues with re-render | ||
// ✅ warning if webId already exists |
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 think we need the whole implementation detail in here, maybe a one line comment for where the functionality is
@@ -94,6 +106,15 @@ const ContactListTable = ({ contacts, deleteContact }) => { | |||
headerAlign: 'center', | |||
align: 'center' | |||
}, | |||
{ |
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.
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 believe there are additional changes made in this modal component so that it'll include an edit function. However, it doesn't seem to fill in the existing information of the user you wish to edit.
It'll probably be better if the form starts with values from the table row. I think it might be due to not being able to handle cases when the First Name/Last Name is null/undefined.
} | ||
const toDelete = contacts.find((item) => item.webId === originalWebId); | ||
await handleDeleteContact(toDelete); | ||
setDeleteViaEdit(true); // attempt to re-render |
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 function seems to delete the contact when editing and submitting without a username by mistake.
Screen.Recording.2024-04-16.at.6.40.45.PM.mov
Seems to be related to a validation bug we found with the modal (see Issue #614), but we probably don't want the contact to be deleted if the information is incorrect, just a warning and error stating invalid information. The modal would stay open until the user exits or enters the right information.
@leekahung Can this issue be handed off to another contributor. I am stuck on the rendering issue. |
No problem, I'll have this unassigned |
This PR:
Resolves #571
✅ prepopulate form when editing.
✅ if webId is different, delete current contact and add contact. Having issues with re-render
✅ warning if webId already exists