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

UIPQB-164: Columns are reset when user modifies query #202

Merged
merged 4 commits into from
Dec 27, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
* [UIPQB-141](https://folio-org.atlassian.net/browse/UIPQB-141) Modal dialog focus inconsistencies across screenreaders.
* [UIPQB-162](https://folio-org.atlassian.net/browse/UIPQB-162) Errors when query includes a modified custom field.
* [UIPQB-175](https://folio-org.atlassian.net/browse/UIPQB-175) Displays the "Smth went wrong" page, when the user clicks on "Select operator" dropdown and selects any of them, if there are deleted custom fields.
* [UIPQB-164](https://folio-org.atlassian.net/browse/UIPQB-164) Columns are reset when user modifies query.


## [1.2.6](https://github.com/folio-org/ui-plugin-query-builder/tree/v1.2.6) (2024-12-11)
Expand Down
1 change: 1 addition & 0 deletions src/QueryBuilder/ResultViewer/ResultViewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@
onPreviewShown,
defaultLimit,
forcedVisibleValues,
visibleColumns

Check failure on line 85 in src/QueryBuilder/ResultViewer/ResultViewer.js

View workflow job for this annotation

GitHub Actions / ui / Install and lint / Install and lint

Missing trailing comma

Check failure on line 85 in src/QueryBuilder/ResultViewer/ResultViewer.js

View workflow job for this annotation

GitHub Actions / ui / Install and lint / Install and lint

Missing trailing comma
UladzislauKutarkin marked this conversation as resolved.
Show resolved Hide resolved
});

// refresh functionality
Expand Down
4 changes: 2 additions & 2 deletions src/QueryBuilder/ResultViewer/ResultViewer.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ describe('ResultViewer', () => {
});

describe('Initial and visible columns setters', () => {
it.each([[], undefined])('should call both when no initial fields are provided (recordColumns=%s)', async (visibleColumns) => {
render(renderResultViewer({ visibleColumns }));
it.each([[], undefined])('should call both when no initial fields are provided (recordColumns=%s)', async () => {
render(renderResultViewer({ visibleColumns: ['user_id'] }));

await waitFor(() => {
expect(screen.queryByText('ui-plugin-query-builder.viewer.retrieving')).not.toBeInTheDocument();
Expand Down
7 changes: 6 additions & 1 deletion src/hooks/useViewerCallbacks.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,17 @@
currentRecordsCount,
onPreviewShown,
defaultLimit,
visibleColumns

Check failure on line 11 in src/hooks/useViewerCallbacks.js

View workflow job for this annotation

GitHub Actions / ui / Install and lint / Install and lint

Expected indentation of 2 spaces but found 37

Check failure on line 11 in src/hooks/useViewerCallbacks.js

View workflow job for this annotation

GitHub Actions / ui / Install and lint / Install and lint

Missing trailing comma

Check failure on line 11 in src/hooks/useViewerCallbacks.js

View workflow job for this annotation

GitHub Actions / ui / Install and lint / Install and lint

Expected indentation of 2 spaces but found 37

Check failure on line 11 in src/hooks/useViewerCallbacks.js

View workflow job for this annotation

GitHub Actions / ui / Install and lint / Install and lint

Missing trailing comma
}) => {
useEffect(() => {
if (defaultColumns.length !== 0) {
onSetDefaultColumns?.(defaultColumns);

onSetDefaultVisibleColumns?.(defaultVisibleColumns);
const uniqueVisibleColumns = Array.from(
new Set([...defaultVisibleColumns, ...visibleColumns])
);

onSetDefaultVisibleColumns?.(uniqueVisibleColumns);
}
}, [currentRecordsCount]);

Expand Down
Loading