Closed parkerdavis1 closed 1 year ago
These are good updates. One change before we merge this - could you update the role-related column defs to use accessor functions instead of accessor keys? Something like the following:
//...
{
header: 'lesson assistant',
accessorFn: (row) => {
const hasRole = row.roles.find(r => r.name == 'lessonAssistant')
return hasRole ? 'Yes' : 'No'
},
},
//...
And you can delete any attributes you see there related to sizing, I was trying things and didn't mean to have those in the commit
Sure, got it done.
Before I make the commit, just checking: Adding the accessorFn makes the cell function redundant, correct? As its currently constructed and styled, the div wrapper doesn't do anything. I could remove the extraneous divs. Not sure if you had plans for the divs that you hadn't gotten to yet.
Yes, the accessorFn makes the cell function unnecessary, and we don't need the divs
Updated logic so that checkboxes show correct initial status for the various roles on the edit user page.
Updated the role connect and disconnect logic to allow for multiple roles.
Equality operator (==) swapped for Strict equality operator (===) for slight performance gains and more predictable behavior.
accessorKeys changed to remove console errors: