-
Notifications
You must be signed in to change notification settings - Fork 1
Migrate directory content to AGgrid #427
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
Conversation
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.
Some bugs detected
- right clicking an element twice will create multiple contextual menus
- I have a case where a study is stuck in "creation in progress" : before, the type was empty for them, now I have an untranslated "FILTER" label displayed, which causes warning in console
- editing a description now prompts this warning in console : Warning: React does not recognize the
adornmentPosition
prop on a DOM element - when using the app in french, a enormous amount of translation warning appear in console
Tests: OK
Need to check :
- alternative theme
- editing description button is now working on the whole column and can confuse user
src/components/directory-content.jsx
Outdated
const onGridReady = useCallback(({ api }) => { | ||
api?.sizeColumnsToFit(); | ||
}, []); | ||
|
||
const getRowId = useCallback((params) => params.data.elementUuid, []); | ||
const getRowStyle = useCallback((cellData) => { | ||
const style = { fontSize: '1rem' }; | ||
if ( | ||
![ElementType.CASE, ElementType.PARAMETERS].includes( | ||
cellData.data?.type | ||
) | ||
) { | ||
style.cursor = 'pointer'; | ||
} | ||
return style; | ||
}, []); | ||
|
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.
can all those methods be created out of the component instead ? It would prevent the usage of useCallback
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 externalized those in a CustomAGGgrid wrapper dedicated for the directory content, it's called DirectoryContentTable.
It reduces boilerplate code inside directory content imo, wdyt ?
setActiveElement(null); | ||
setOpenDescModificationDialog(false); | ||
}} | ||
updateElement={updateElement} |
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 don't understand, does that mean it did not work before ?
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.
Yup, wasn't supposed to be in the PR and it was fixed it the meantime
Don't forget to delete the react-virtualized dep added by this PR : #429 |
There is a bug where there are many elements in a directory |
The custom aggrid table in RHF section does not render correctly |
Inspired by this PR
Major changes :