Skip to content
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

Merged
merged 6 commits into from
Dec 10, 2024

Conversation

ogermain-kronos
Copy link
Contributor

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.

@ogermain-kronos ogermain-kronos requested a review from a team as a code owner December 10, 2024 17:24
Copy link

Storybook for this build: https://ds.equisoft.io/pr-1054/

Copy link

Webapp for this build: https://ds.equisoft.io/pr-1054/webapp/

Copy link
Contributor

@pylafleur pylafleur left a 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> })
Copy link
Contributor

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?

Copy link
Contributor Author

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.

Copy link
Contributor Author

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.

Copy link
Contributor

@savutsang savutsang Dec 10, 2024

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.

@ogermain-kronos ogermain-kronos merged commit b46b8ba into master Dec 10, 2024
22 checks passed
@ogermain-kronos ogermain-kronos deleted the dev/DS-1279 branch December 10, 2024 20:16
LarryMatte pushed a commit that referenced this pull request Jan 9, 2025
…de (#1054)

* feat(table): include returning subrows when on expandable multiple mode
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants