-
Notifications
You must be signed in to change notification settings - Fork 0
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
feat(table): include returning subrows when on expandable multiple mode #1054
Conversation
Storybook for this build: https://ds.equisoft.io/pr-1054/ |
Webapp for this build: https://ds.equisoft.io/pr-1054/webapp/ |
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.
J'y ajouterait aussi un test unitaire, on en a déjà quelques-uns qui couvrent onSelectedRowsChange
const selectedRows = selectedIndexes.map((index: string) => { | ||
if (rowSelectionMode === 'multiple') { | ||
const [groupIndex, rowIndex] = index.split('.'); | ||
return (data[parseInt(groupIndex, 10)] as T & { subRows?: Array<T> }) |
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.
Si on modifiait le type de la propriété data
dans TableProps
, on aurait plus besoin de l'assertion ici:
data: TableData<T>[];
Tout passe encore, est-ce qu'il y aurait une contre-indication @savutsang?
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.
J'ai appliqué sa suggestion. Je vais regarder pour l'assertion ouère.
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.
Ça marche en castant le original
du row en T
.
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.
En fait data: T[]
est plus exacte. T represente le type utilise par data.
…de (#1054) * feat(table): include returning subrows when on expandable multiple mode
https://equisoft.atlassian.net/browse/DS-1279
La fonction
onSelectedRowsChange
retournait pas les subRows lorsque la data-table était configurée en mode multiple + expandable. Ça retournait juste des copies de la row parente du grouping.