Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 5 additions & 3 deletions showcase/app/controllers/page-components/advanced-table.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import { deepTracked } from 'ember-deep-tracked';
import { later } from '@ember/runloop';

import type { PageComponentsAdvancedTableModel } from 'showcase/routes/page-components/advanced-table';
import type { SelectableItem } from 'showcase/mocks/selectable-item-data';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😎 nice

import type { User } from 'showcase/mocks/user-data';

import type {
HdsAdvancedTableOnSelectionChangeSignature,
Expand All @@ -25,12 +27,12 @@ const customSortingCriteriaArray = [
'pending',
];

const updateModelWithSelectAllState = <T>(
modelData: T[],
const updateModelWithSelectAllState = (
modelData: SelectableItem[] | User[],
selectAllState: boolean,
) => {
modelData.forEach((modelRow) => {
if (modelRow instanceof Object && 'isSelected' in modelRow) {
if (modelRow instanceof Object) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Note] The userData data doesn't have isSelected set, so this check was breaking the "delete row" example's "expand scope" toggle, which used the userData and this function. The type has been updated to be more specific to ensure modelRow.isSelected is available.

modelRow.isSelected = selectAllState;
}
});
Expand Down
Loading