diff --git a/package-lock.json b/package-lock.json index f8c42a5475..da346c440e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -46,7 +46,7 @@ "enzyme-adapter-react-16": "^1.15.7", "file-saver": "^1.3.3", "focus-trap": "^6.5.0", - "fuse.js": "^3.3.0", + "fuse.js": "^7.0.0", "graphiql": "1.11.5", "graphql": "^15.0.0", "graphql-language-service-interface": "^2.8.2", @@ -19954,11 +19954,11 @@ } }, "node_modules/fuse.js": { - "version": "3.6.1", - "resolved": "https://registry.npmjs.org/fuse.js/-/fuse.js-3.6.1.tgz", - "integrity": "sha512-hT9yh/tiinkmirKrlv4KWOjztdoZo1mx9Qh4KvWqC7isoXwdUY3PNWUxceF4/qO9R6riA2C29jdTOeQOIROjgw==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/fuse.js/-/fuse.js-7.0.0.tgz", + "integrity": "sha512-14F4hBIxqKvD4Zz/XjDc3y94mNZN6pRv3U13Udo0lNLCWRBUsrMv2xwcF/y/Z5sV6+FQW+/ow68cHpm4sunt8Q==", "engines": { - "node": ">=6" + "node": ">=10" } }, "node_modules/gauge": { @@ -53473,9 +53473,9 @@ "integrity": "sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==" }, "fuse.js": { - "version": "3.6.1", - "resolved": "https://registry.npmjs.org/fuse.js/-/fuse.js-3.6.1.tgz", - "integrity": "sha512-hT9yh/tiinkmirKrlv4KWOjztdoZo1mx9Qh4KvWqC7isoXwdUY3PNWUxceF4/qO9R6riA2C29jdTOeQOIROjgw==" + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/fuse.js/-/fuse.js-7.0.0.tgz", + "integrity": "sha512-14F4hBIxqKvD4Zz/XjDc3y94mNZN6pRv3U13Udo0lNLCWRBUsrMv2xwcF/y/Z5sV6+FQW+/ow68cHpm4sunt8Q==" }, "gauge": { "version": "3.0.2", diff --git a/package.json b/package.json index 88f69ee019..030ec8a602 100644 --- a/package.json +++ b/package.json @@ -41,7 +41,7 @@ "enzyme-adapter-react-16": "^1.15.7", "file-saver": "^1.3.3", "focus-trap": "^6.5.0", - "fuse.js": "^3.3.0", + "fuse.js": "^7.0.0", "graphiql": "1.11.5", "graphql": "^15.0.0", "graphql-language-service-interface": "^2.8.2", diff --git a/src/DataDictionary/search/DictionarySearcher/searchHelper.js b/src/DataDictionary/search/DictionarySearcher/searchHelper.js index 8aaa55e7e9..03ad729a6c 100644 --- a/src/DataDictionary/search/DictionarySearcher/searchHelper.js +++ b/src/DataDictionary/search/DictionarySearcher/searchHelper.js @@ -51,13 +51,6 @@ export const searchKeyword = (searchData, keyword) => { errorMsg: ERR_KEYWORD_TOO_SHORT, }; } - // 32 is length limitation of Fuse search library - if (keyword.length > 32) { - return { - result: [], - errorMsg: ERR_KEYWORD_TOO_LONG, - }; - } const halfLength = Math.round(keyword.length / 2); const minMatchCharLength = Math.min(Math.max(halfLength, 10), keyword.length); const options = { diff --git a/src/DataDictionary/search/DictionarySearcher/searchHelper.test.js b/src/DataDictionary/search/DictionarySearcher/searchHelper.test.js index 2fbfed8e4e..d174ba7bfa 100644 --- a/src/DataDictionary/search/DictionarySearcher/searchHelper.test.js +++ b/src/DataDictionary/search/DictionarySearcher/searchHelper.test.js @@ -3,7 +3,7 @@ import { searchKeyword, getSearchSummary, ERR_KEYWORD_TOO_SHORT, - ERR_KEYWORD_TOO_LONG, + ERR_KEYWORD_TOO_LONG, ZERO_RESULT_FOUND_MSG, } from './searchHelper'; describe('dictionary search helper', () => { @@ -78,6 +78,6 @@ describe('dictionary search helper', () => { it('can output error if keyword too long', () => { const { result, errorMsg } = searchKeyword(searchData, '1234567890123456789012345678901234567890'); expect(result).toEqual([]); - expect(errorMsg).toEqual(ERR_KEYWORD_TOO_LONG); + expect(errorMsg).toEqual(ZERO_RESULT_FOUND_MSG); }); });