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

571 edit contacts #613

Draft
wants to merge 24 commits into
base: Development
Choose a base branch
from
Draft

571 edit contacts #613

wants to merge 24 commits into from

Conversation

ofu997
Copy link
Contributor

@ofu997 ofu997 commented Apr 11, 2024

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

@ofu997 ofu997 requested a review from leekahung April 11, 2024 04:04
@ofu997
Copy link
Contributor Author

ofu997 commented Apr 11, 2024

now doing linting errors

@ofu997 ofu997 marked this pull request as ready for review April 16, 2024 03:43
@ofu997 ofu997 requested a review from timbot1789 April 16, 2024 03:43
Comment on lines 196 to 200
// const Console = props => {
// const contacts = props;
// console.table(contacts);
// return false;
// }
Copy link
Contributor

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.

Comment on lines 80 to 90
// 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
Copy link
Contributor

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'
},
{
Copy link
Contributor

Choose a reason for hiding this comment

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

More of a styling thing than a functionality issue, but the new icon seems to have a different color when compared to the other ones. Would be nice to have the colors match up.

Screenshot 2024-04-16 at 6 19 31 PM

Copy link
Contributor

@leekahung leekahung Apr 17, 2024

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.

Screenshot 2024-04-16 at 6 23 22 PM

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
Copy link
Contributor

@leekahung leekahung Apr 17, 2024

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.

@ofu997
Copy link
Contributor Author

ofu997 commented May 31, 2024

@leekahung Can this issue be handed off to another contributor. I am stuck on the rendering issue.

@leekahung
Copy link
Contributor

@leekahung Can this issue be handed off to another contributor. I am stuck on the rendering issue.

No problem, I'll have this unassigned

@leekahung leekahung marked this pull request as draft June 5, 2024 00:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enhancement: Allow editing of Contacts
2 participants