Skip to content

Commit

Permalink
UIIN-2910 *BREAKING* Added a new stripes-inventory-components depen…
Browse files Browse the repository at this point in the history
…dency. Move some utils to that module.
  • Loading branch information
BogdanDenis committed May 20, 2024
1 parent 23c2402 commit fbc5a0a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 20 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Change history for ui-inventory

## [11.1.0] (IN PROGRESS)
## [12.0.0] (IN PROGRESS)

* Remove unused code related to auto-open record detail view. Refs UIIN-2819.
* Keyboard shortcuts modal: Add quickMARC shortcuts to modal. Refs UIIN-2795.
Expand All @@ -21,6 +21,7 @@
* Add callout noting user's active affiliation when it changes after selecting holding or item. Refs UIIN-2831, UIIN-2872.
* Jest/RTL: Cover LocationSelectionWithCheck components with unit tests. Refs UIIN-2670.
* Populate Acquisitions accordion on instance when central ordering is active. Refs UIIN-2793.
* *BREAKING* Added a new `stripes-inventory-components` dependency. Move some utils to that module. Refs UIIN-2910.

## [11.0.4](https://github.com/folio-org/ui-inventory/tree/v11.0.4) (2024-04-30)
[Full Changelog](https://github.com/folio-org/ui-inventory/compare/v11.0.3...v11.0.4)
Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -895,6 +895,7 @@
"@folio/stripes-components": "^12.1.2",
"@folio/stripes-connect": "^9.1.0",
"@folio/stripes-core": "^10.1.1",
"@folio/stripes-inventory-components": "^1.0.0",
"@folio/stripes-marc-components": "^1.0.1",
"@folio/stripes-smart-components": "^9.1.1",
"@folio/stripes-testing": "^4.6.0",
Expand Down Expand Up @@ -938,6 +939,7 @@
},
"peerDependencies": {
"@folio/stripes": "^9.1.2",
"@folio/stripes-inventory-components": "^1.0.0",
"@folio/stripes-marc-components": "^1.0.1",
"react": "^18.2.0",
"react-intl": "^6.4.4",
Expand Down
21 changes: 2 additions & 19 deletions src/components/InstancesList/InstancesList.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ import {
TextLink,
DefaultMCLRowFormatter,
} from '@folio/stripes/components';
import { advancedSearchQueryBuilder } from '@folio/stripes-inventory-components';

import { withSingleRecordImport } from '..';
import FilterNavigation from '../FilterNavigation';
Expand Down Expand Up @@ -274,6 +275,7 @@ class InstancesList extends React.Component {
}

const searchParams = new URLSearchParams(location.search);

const filters = searchParams.get('filters');

const staffSuppressFalse = `${FACETS.STAFF_SUPPRESS}.false`;
Expand Down Expand Up @@ -1234,25 +1236,6 @@ class InstancesList extends React.Component {

const advancedSearchOptions = advancedSearchIndexes[segment].map(this.formatSearchableIndex);

const advancedSearchQueryBuilder = (rows) => {
const formatRowCondition = (row) => {
// use default row formatter, but wrap each search term with parentheses

const query = `${row.searchOption} ${row.match} ${row.query}`;
return query;
};

return rows.reduce((formattedQuery, row, index) => {
const rowCondition = formatRowCondition(row);

if (index === 0) {
return rowCondition;
}

return `${formattedQuery} ${row.bool} ${rowCondition}`;
}, '');
};

const shortcuts = [
{
name: 'new',
Expand Down

0 comments on commit fbc5a0a

Please sign in to comment.