-
-
Notifications
You must be signed in to change notification settings - Fork 34
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
Conversation
prob needs to be moved elsewhere and used as a shared def. duplicated code for now
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
inc datatable, basic delete functionality
includes refactor of activate protocol procedure
lastUploadedProtocol is stale and needs fix
ported over from feature/participant deletion
removed but needed for interview/new route
more consistent with participants dashboard
app/(dashboard)/dashboard/_components/ParticipantsTable/ParticipantsTable.tsx
Outdated
Show resolved
Hide resolved
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 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
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.
Looking good so far! See what you think about my note.
app/(dashboard)/dashboard/_components/ParticipantsTable/ParticipantsTable.tsx
Outdated
Show resolved
Hide resolved
pass actionsdropdown and optional header as simple props. let datatable handle passing row and data to the actionsdropdowns
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 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[] }>; |
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! 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} |
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.
The component API for data table is looking great now!
Features
UI:
Deleting participants which have no interview data:
Deleting participants with exported interview data:
Deleting participants with un-exported interview data