-
Notifications
You must be signed in to change notification settings - Fork 8
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
Add set membership columns to the element view table #435
Conversation
✅ Deploy Preview for upset2 ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
@@ -40,10 +41,16 @@ function useColumns(columns: string[]) { | |||
* Table to display elements | |||
*/ | |||
export const ElementTable: FC = () => { | |||
const attributeColumns = useRecoilValue(attributeAtom); | |||
const attColumns = useRecoilValue(attributeAtom); |
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 prefer that this is fully spelled out. Makes things more readable (for me who never works in the code)
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.
Agree with jack here
const columns = useColumns(['_label', ...attributeColumns]); | ||
const setColumns = useRecoilValue(setColumnsSelector); | ||
let columns = useColumns(['_label', ...([...attColumns, ...setColumns].filter((col) => !col.startsWith('_')))]); | ||
// Sort set columns to the right of other columns & add a boolean type to |
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.
Does this sort? Looks like it just adds type
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 "sorting" here is really just the spread operator, putting the setColumns
at the end of the list.
@JackWilb
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.
Actually, that comment is outdated; there used to be an explicit sort function but that was removed when I started using spread instead. Comment updated.
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.
Update attribute variable name. Otherwise looks great.
@@ -40,10 +41,16 @@ function useColumns(columns: string[]) { | |||
* Table to display elements | |||
*/ | |||
export const ElementTable: FC = () => { | |||
const attributeColumns = useRecoilValue(attributeAtom); | |||
const attColumns = useRecoilValue(attributeAtom); |
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.
Agree with jack here
const columns = useColumns(['_label', ...attributeColumns]); | ||
const setColumns = useRecoilValue(setColumnsSelector); | ||
let columns = useColumns(['_label', ...([...attColumns, ...setColumns].filter((col) => !col.startsWith('_')))]); | ||
// Sort set columns to the right of other columns & add a boolean type to |
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 "sorting" here is really just the spread operator, putting the setColumns
at the end of the list.
@JackWilb
Does this PR close any open issues?
Closes #399
Give a longer description of what this PR addresses and why it's needed
Adds boolean columns (showing X or ✓) for each set to the query result table, indicating the set membership of each element.
Provide pictures/videos of the behavior before and after these changes (optional)
Before:


After:
Have you added or updated relevant tests?
Have you added or updated relevant documentation?