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

UIIN-2493 Make Inventory search and browse query boxes expandable #2322

Merged
merged 4 commits into from
Oct 30, 2023
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

## [10.1.0] IN PROGRESS

* Make Inventory search and browse query boxes expandable. Refs UIIN-2493.
Copy link
Contributor

Choose a reason for hiding this comment

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

Should the Browse query box be expandable?

Copy link
Contributor Author

Choose a reason for hiding this comment

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


## [10.0.1] IN PROGRESS

Expand Down
1 change: 1 addition & 0 deletions src/components/InstancesList/InstancesList.js
Original file line number Diff line number Diff line change
Expand Up @@ -628,7 +628,7 @@
setSegmentSortBy = (sortBy) => {
const { segment } = this.props;

const segmentsSortBy = this.state.segmentsSortBy.map((key) => {

Check failure on line 631 in src/components/InstancesList/InstancesList.js

View workflow job for this annotation

GitHub Actions / github-actions-ci

Use callback in setState when referencing the previous state

Check failure on line 631 in src/components/InstancesList/InstancesList.js

View workflow job for this annotation

GitHub Actions / github-actions-ci

Use callback in setState when referencing the previous state
if (key.name === segment) {
key.sort = sortBy;
return key;
Expand Down Expand Up @@ -1178,6 +1178,7 @@
searchableIndexesPlaceholder={null}
initialResultCount={INITIAL_RESULT_COUNT}
initiallySelectedRecord={getItem(`${namespace}.${segment}.lastOpenRecord`)}
inputType="textarea"
Copy link
Contributor

Choose a reason for hiding this comment

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

Textarea looks much higher to me
image

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed
image

resultCountIncrement={RESULT_COUNT_INCREMENT}
viewRecordComponent={ViewInstanceWrapper}
editRecordComponent={InstanceForm}
Expand Down
6 changes: 3 additions & 3 deletions src/components/InstancesList/InstancesList.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -458,10 +458,10 @@ describe('InstancesList', () => {
it('should have query in search input', () => {
renderInstancesList({ segment: 'instances' });

fireEvent.change(screen.getByRole('searchbox', { name: 'Search' }), { target: { value: 'search query' } });
fireEvent.change(screen.getByRole('textbox', { name: 'Search' }), { target: { value: 'search query' } });
fireEvent.click(screen.getAllByRole('button', { name: 'Search' })[1]);

expect(screen.getByRole('searchbox', { name: 'Search' })).toHaveValue('search query');
expect(screen.getByRole('textbox', { name: 'Search' })).toHaveValue('search query');
});

describe('when the search option is changed', () => {
Expand Down Expand Up @@ -549,7 +549,7 @@ describe('InstancesList', () => {

await act(async () => fireEvent.change(screen.getByLabelText('Search field index'), { target: { value: qindex } }));

fireEvent.change(screen.getByRole('searchbox', { name: 'Search' }), { target: { value: _query } });
fireEvent.change(screen.getByRole('textbox', { name: 'Search' }), { target: { value: _query } });
fireEvent.click(screen.getAllByRole('button', { name: 'Search' })[1]);

const row = screen.getAllByText('ABA Journal')[0];
Expand Down
1 change: 1 addition & 0 deletions src/views/BrowseInventory/BrowseInventory.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ const BrowseInventory = () => {
changeSearchIndex={onChangeSearchIndex}
selectedIndex={searchIndex}
searchableIndexesPlaceholder={searchableIndexesPlaceholder}
inputType="textarea"
/>

<ResetButton
Expand Down
2 changes: 1 addition & 1 deletion src/views/BrowseInventory/BrowseInventory.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ describe('BrowseInventory', () => {
it('should call "changeSearch" when search query was changed', async () => {
const { container } = renderBrowseInventory();

await act(async () => userEvent.type(screen.getByRole('searchbox'), 'newQuery'));
await act(async () => userEvent.type(screen.getByRole('textbox'), 'newQuery'));
await act(async () => userEvent.click(container.querySelector('[data-test-single-search-form-submit="true"]')));

expect(applySearch).toHaveBeenCalled();
Expand Down
Loading