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

Feature/participant deletion #25

Merged
merged 46 commits into from
Oct 27, 2023
Merged

Feature/participant deletion #25

merged 46 commits into from
Oct 27, 2023

Conversation

buckhalt
Copy link
Member

Features

  • Adds prompt for deleting participants
  • Prompt has warning if participant has interview data
  • Prompt has more serious warning if participant has un-exported interview data
  • Refactor delete all participants functionality to use these prompts

UI:

Deleting participants which have no interview data:
Screenshot 2023-10-12 at 12 02 23 PM

Deleting participants with exported interview data:
Screenshot 2023-10-12 at 12 03 10 PM

Deleting participants with un-exported interview data
Screenshot 2023-10-12 at 12 32 25 PM

@vercel
Copy link

vercel bot commented Oct 12, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
fresco ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 26, 2023 5:00pm

@buckhalt buckhalt mentioned this pull request Oct 13, 2023
Copy link
Contributor

@mrkarimoff mrkarimoff left a comment

Choose a reason for hiding this comment

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

I found a minor duplication on ParticipantsTable. Other than that your code looks clean and well organized

…is refactor simplifies code in all instances of this component. parent

 components now just control opening the dialog and passing it the selected participants. the dialog itself handles calculating derived properties, deleting, and cancelling. this makes this logic reusable across instances and removes duplicated code
actionsdropdown manages dialog state, deleteprotocolsdialog manages actual deletion, calculating derived props, cancelling dialog
allows actionsdropdown and addparticipantbutton to use the same modal, but with separate instances and separately controlling state
Copy link
Member

@jthrilly jthrilly left a comment

Choose a reason for hiding this comment

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

Looking good so far! See what you think about my note.

pass actionsdropdown and optional header as simple props. let datatable handle passing row and data to the actionsdropdowns
Copy link
Member

@jthrilly jthrilly left a comment

Choose a reason for hiding this comment

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

Looks great to me! Hope you agree that the refactor was useful.

@@ -28,7 +29,8 @@ interface DataTableProps<TData, TValue> {
data: TData[];
filterColumnAccessorKey?: string;
handleDeleteSelected?: (data: TData[]) => Promise<void> | void;
actions?: ColumnDef<TData, TValue>[];
actions?: React.ComponentType<{ row: Row<TData>; data: TData[] }>;
Copy link
Member

Choose a reason for hiding this comment

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

Nice! Didn't know this is how you did it. This is super cool, because it also validates the data type being passed to the table!

},
},
]}
actions={ActionsDropdown}
Copy link
Member

Choose a reason for hiding this comment

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

The component API for data table is looking great now!

@jthrilly jthrilly merged commit 8978d40 into main Oct 27, 2023
3 checks passed
@jthrilly jthrilly deleted the feature/participant-deletion branch April 5, 2024 10:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants