@rh-support/cases 1.0.13 → 1.0.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"useAdvanceSearchParser.d.ts","sourceRoot":"","sources":["../../../../../src/components/case-list/case-search/useAdvanceSearchParser.tsx"],"names":[],"mappings":"AAQA,MAAM,CAAC,OAAO,UAAU,sBAAsB,CAAC,EAAE,MAAM,EAAE;;CAAA;yBASzB,MAAM;6BAIF,MAAM;;EA0LzC"}
1
+ {"version":3,"file":"useAdvanceSearchParser.d.ts","sourceRoot":"","sources":["../../../../../src/components/case-list/case-search/useAdvanceSearchParser.tsx"],"names":[],"mappings":"AAQA,MAAM,CAAC,OAAO,UAAU,sBAAsB,CAAC,EAAE,MAAM,EAAE;;CAAA;yBASzB,MAAM;6BAIF,MAAM;;EA4LzC"}
@@ -35,7 +35,7 @@ export default function useAdvanceSearchParser({ onInit }) {
35
35
  return;
36
36
  const accounts = (bookmarkedGroupAccounts.data || []);
37
37
  const allAccounts = [...accounts, loggedInUsersAccount.data];
38
- const grammarStringInternal = `
38
+ const grammarStringInternal = String.raw `
39
39
  {
40
40
  function joinByOr(val) {
41
41
  return "(" + [].concat.apply([], val).filter(function(item) {return item !== ' '}).join(" OR ")+")";
@@ -72,7 +72,7 @@ export default function useAdvanceSearchParser({ onInit }) {
72
72
  / field:textFieldName ":"" "* value:value { return value; }
73
73
 
74
74
  value = range / string
75
- range = "[" from:([^" "]+) " TO " to:([^\\]]+) "]" {return "[" + from.join("") + " TO " + to.join("") + "]"; }
75
+ range = "[" from:([^" "]+) " TO " to:([^\]]+) "]" {return "[" + from.join("") + " TO " + to.join("") + "]"; }
76
76
  string = quoted_term / unquoted_term / _
77
77
 
78
78
  unquoted_term
@@ -82,7 +82,7 @@ export default function useAdvanceSearchParser({ onInit }) {
82
82
  }
83
83
 
84
84
  term_char
85
- = [^: \\t\\r\\n\\f\\{\\}()"+-/^~\\[\\]]
85
+ = [^: \t\r\n\f\{\}()"+-/^~\[\]]
86
86
 
87
87
  quoted_term
88
88
  = '"' term:[^"]+ '"'
@@ -133,10 +133,13 @@ export default function useAdvanceSearchParser({ onInit }) {
133
133
 
134
134
  groupFieldName = "group" {return "${SolrKeys.group}";}
135
135
  groupValue = string
136
- / ${(caseGroups.data || []).map((group) => `'"${group.name}"' { return '${group.groupNum}'; }`).join(' / ')}
136
+ / ${(caseGroups.data || [])
137
+ .map((group) => `'"${group.name}"' { return '{ key: ${group.name}, value: ${group.groupNum} }'; }`)
138
+ .join(' / ')}
137
139
  / groupMultipleValue / _
138
140
  groupMultipleValue = "(" val:(groupValue)+ ")" { return joinByOr(val); }
139
141
 
142
+
140
143
  caseTypeFieldName = "caseType" {return "${SolrKeys.type}";}
141
144
  caseTypeValue = string
142
145
  / ${(allCaseTypes.data || []).map((caseType) => `'"${caseType}"' { return '"${caseType}"'; }`).join(' / ')}
@@ -172,8 +175,7 @@ export default function useAdvanceSearchParser({ onInit }) {
172
175
  __ = [ ]*
173
176
 
174
177
  _ "whitespace"
175
- = [ \\t\\r\\n\\f]+
176
-
178
+ = [ \t\r\n\f]+
177
179
  EOF
178
180
  = !.
179
181
  `;
@@ -105,7 +105,7 @@ function createUserFriendlyQueryFromFilterStateAdvancedSearch(filterInfo, filter
105
105
  ? fieldNameToSolrFieldMapping[_filterKey]
106
106
  : _filterKey;
107
107
  const fieldValue = isKeyValuePair(filterInfo[_filterKey])
108
- ? filterInfo[_filterKey].map((item) => (SolrKeys.accountNumber ? item.key : item.value))
108
+ ? filterInfo[_filterKey].map((item) => (_filterKey === SolrKeys.accountNumber ? item.key : item.value))
109
109
  : filterInfo[_filterKey];
110
110
  if (_filterKey !== ProductVersionKey) {
111
111
  Array.isArray(fieldValue) && fieldValue.length > 0 && solrQuery.where(fieldLabel).in(flatMap(fieldValue));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rh-support/cases",
3
- "version": "1.0.13",
3
+ "version": "1.0.15",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "registry": "https://registry.npmjs.org"
@@ -51,11 +51,11 @@
51
51
  "@patternfly/pfe-collapse": "1.12.3",
52
52
  "@patternfly/react-core": "4.202.16",
53
53
  "@patternfly/react-table": "4.71.16",
54
- "@rh-support/components": "1.2.6",
55
- "@rh-support/react-context": "1.0.7",
54
+ "@rh-support/components": "1.2.7",
55
+ "@rh-support/react-context": "1.0.8",
56
56
  "@rh-support/types": "0.2.0",
57
- "@rh-support/user-permissions": "1.0.6",
58
- "@rh-support/utils": "1.0.4",
57
+ "@rh-support/user-permissions": "1.0.7",
58
+ "@rh-support/utils": "1.0.5",
59
59
  "i18next": "^19.0.1",
60
60
  "localforage": "^1.7.3",
61
61
  "lodash": "^4.17.21",
@@ -99,5 +99,5 @@
99
99
  "not ie <= 11",
100
100
  "not op_mini all"
101
101
  ],
102
- "gitHead": "a6141b62e73e1d74ccf4f4075134da7091b8e96e"
102
+ "gitHead": "9647d8b819bf1ccbf691c0e89909160752ea24a7"
103
103
  }