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

fix: custom group selector reordering applied to table displayed columns #597

Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -1012,18 +1012,18 @@ describe('InteractiveDataViewComponent', () => {
it('should move item up in picklist active columns list', async () => {
const spy = jest.spyOn(CustomGroupColumnSelectorComponent.prototype, 'onSaveClick')
const expectedHeaders = [
'COLUMN_HEADER_NAME.NAME',
'COLUMN_HEADER_NAME.DESCRIPTION',
'COLUMN_HEADER_NAME.NAME',
'COLUMN_HEADER_NAME.STATUS',
'COLUMN_HEADER_NAME.RESPONSIBLE',
'Actions',
]
const expectedRowsData = [
['some name', '', 'some status', 'someone responsible'],
['example', 'example description', 'status example', ''],
['name 1', '', 'status name 1', ''],
['name 2', '', 'status name 2', ''],
['name 3', '', 'status name 3', ''],
['', 'some name', 'some status', 'someone responsible'],
['example description', 'example', 'status example', ''],
['', 'name 1', 'status name 1', ''],
['', 'name 2', 'status name 2', ''],
['', 'name 3', 'status name 3', ''],
]
await activeColumnsList[1].selectItem()
await sourceControlsButtons[0].click()
Expand All @@ -1042,17 +1042,17 @@ describe('InteractiveDataViewComponent', () => {
const spy = jest.spyOn(CustomGroupColumnSelectorComponent.prototype, 'onSaveClick')
const expectedHeaders = [
'COLUMN_HEADER_NAME.NAME',
'COLUMN_HEADER_NAME.DESCRIPTION',
'COLUMN_HEADER_NAME.STATUS',
'COLUMN_HEADER_NAME.DESCRIPTION',
'COLUMN_HEADER_NAME.RESPONSIBLE',
'Actions',
]
const expectedRowsData = [
['some name', '', 'some status', 'someone responsible'],
['example', 'example description', 'status example', ''],
['name 1', '', 'status name 1', ''],
['name 2', '', 'status name 2', ''],
['name 3', '', 'status name 3', ''],
['some name', 'some status', '', 'someone responsible'],
['example', 'status example', 'example description', ''],
['name 1', 'status name 1', '', ''],
['name 2', 'status name 2', '', ''],
['name 3', 'status name 3', '', ''],
]

await activeColumnsList[1].selectItem()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ export class InteractiveDataViewComponent implements OnInit, AfterContentInit {
.map((column) => column.id)
}
this.displayedColumns$ = this.displayedColumnKeys$.pipe(
distinctUntilChanged((prev, curr) => prev.length === curr.length && prev.every((v) => curr.includes(v))),
distinctUntilChanged((prev, curr) => prev.length === curr.length && prev.every((v, i) => curr[i] === v)),
map(
(columnKeys) =>
(columnKeys.map((key) => this.columns.find((col) => col.id === key)).filter((d) => d) as DataTableColumn[]) ??
Expand Down
Loading