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

STSMACOM-771: Use escapeCqlValueAllowAsterisk instead of escapeCqlValue to avoid escaping the asterisk. #1382

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
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 @@ -23,6 +23,7 @@
* Propagate sort fields while applying filters too. Refs. STSMACOM-770.
* Add `<AdvancedSearch>` to `<SearchAndSort>` component. Refs STSMACOM-767.
* *BREAKING* Upgrade `react` to `v18`. Refs STSMACOM-769.
* Use `escapeCqlValueAllowAsterisk` instead of `escapeCqlValue` to avoid escaping the asterisk. Refs STSMACOM-771.

## [8.0.0](https://github.com/folio-org/stripes-smart-components/tree/v8.0.0) (2023-01-30)
[Full Changelog](https://github.com/folio-org/stripes-smart-components/compare/v7.3.0...v8.0.0)
Expand Down
4 changes: 2 additions & 2 deletions lib/SearchAndSort/makeQueryFunction.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { compilePathTemplate } from '@folio/stripes-connect';
import { filters2cql } from '@folio/stripes-components';
import { escapeCqlValue } from '@folio/stripes-util';
import { escapeCqlValueAllowAsterisk } from '@folio/stripes-util';
import { get } from 'lodash';

import { removeNsKeys } from './nsQueryFunctions';
Expand Down Expand Up @@ -47,7 +47,7 @@ function makeQueryFunction(findAll, queryTemplate, sortMap, filterConfig, failOn
return null;
}

const escapeFx = config.escape ? escapeCqlValue : (s) => (s);
const escapeFx = config.escape ? escapeCqlValueAllowAsterisk : (s) => (s);
Copy link
Contributor

Choose a reason for hiding this comment

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

Please adjust the @configOrEscape comment accordingly.


let cql;
if (query && qindex) {
Expand Down