@rh-support/cases 0.2.68-alpha-0 → 0.2.70

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":"CaseList.d.ts","sourceRoot":"","sources":["../../../../src/components/case-list/CaseList.tsx"],"names":[],"mappings":"AAAA,OAAO,wBAAwB,CAAC;AAChC,OAAO,0BAA0B,CAAC;AA4BlC,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAKH,0BAA0B,EAI7B,MAAM,mBAAmB,CAAC;AAK3B,OAAO,EAAE,mBAAmB,EAAe,MAAM,cAAc,CAAC;AAEhE,OAAO,EAAE,oBAAoB,EAAE,MAAM,IAAI,CAAC;AAM1C,OAAO,EAAgB,WAAW,EAA2B,MAAM,uBAAuB,CAAC;AA2B3F,UAAU,MAAM;IACZ,UAAU,EAAE,mBAAmB,CAAC,oBAAoB,CAAC,CAAC;CACzD;AAED,MAAM,WAAW,uBAAwB,SAAQ,cAAc;IAC3D,YAAY,EAAE,cAAc,EAAE,CAAC;CAClC;AAED,oBAAY,YAAY,GAAG,0BAA0B,CAAC,WAAW,EAAE,uBAAuB,CAAC,CAAC;AAM5F,MAAM,WAAW,gBAAgB;IAC7B,CAAC,GAAG,EAAE,MAAM,GAAG,aAAa,CAAC;CAChC;AAED,MAAM,WAAW,aAAa;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,eAAe,EAAE,MAAM,CAAC;IACxB,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,MAAM,CAAC;CAC1B;AAED,wBAAgB,QAAQ,CAAC,KAAK,EAAE,MAAM,eA+brC"}
1
+ {"version":3,"file":"CaseList.d.ts","sourceRoot":"","sources":["../../../../src/components/case-list/CaseList.tsx"],"names":[],"mappings":"AAAA,OAAO,wBAAwB,CAAC;AAChC,OAAO,0BAA0B,CAAC;AA4BlC,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAKH,0BAA0B,EAI7B,MAAM,mBAAmB,CAAC;AAM3B,OAAO,EAAE,mBAAmB,EAAe,MAAM,cAAc,CAAC;AAEhE,OAAO,EAAE,oBAAoB,EAAE,MAAM,IAAI,CAAC;AAM1C,OAAO,EAAgB,WAAW,EAA2B,MAAM,uBAAuB,CAAC;AAmC3F,UAAU,MAAM;IACZ,UAAU,EAAE,mBAAmB,CAAC,oBAAoB,CAAC,CAAC;CACzD;AAED,MAAM,WAAW,uBAAwB,SAAQ,cAAc;IAC3D,YAAY,EAAE,cAAc,EAAE,CAAC;CAClC;AAED,oBAAY,YAAY,GAAG,0BAA0B,CAAC,WAAW,EAAE,uBAAuB,CAAC,CAAC;AAM5F,MAAM,WAAW,gBAAgB;IAC7B,CAAC,GAAG,EAAE,MAAM,GAAG,aAAa,CAAC;CAChC;AAED,MAAM,WAAW,aAAa;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,eAAe,EAAE,MAAM,CAAC;IACxB,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,MAAM,CAAC;CAC1B;AAED,wBAAgB,QAAQ,CAAC,KAAK,EAAE,MAAM,eA4crC"}
@@ -18,6 +18,7 @@ import { ErrorBoundary, ToastNotification, useBreakpoint, useDocumentTitle, useF
18
18
  import { fetchAllStatuses, fetchCaseGroupsForSSO, fetchCaseSeverities, fetchCaseTypes, fetchProducts, GlobalMetadataDispatchContext, GlobalMetadataStateContext, setUserPreferences, updateUserPreferences, UserPreferencesKeys, } from '@rh-support/react-context';
19
19
  import { getStringifiedParams, getUrlParsedParams, haventLoadedMetadata, haventLoadedProductsMetadata, pendoTrackEvent, solrResponseToFacetFields, solrResponseToPivotFields, } from '@rh-support/utils';
20
20
  import get from 'lodash/get';
21
+ import mapValues from 'lodash/mapValues';
21
22
  import some from 'lodash/some';
22
23
  import React, { useContext, useEffect, useRef, useState } from 'react';
23
24
  import { Trans, useTranslation } from 'react-i18next';
@@ -36,8 +37,8 @@ import { CaseListFilters } from './case-list-filters/CaseListFilters';
36
37
  import { CaseListTable } from './case-list-table/CaseListTable';
37
38
  import { CaseSearch } from './case-search/CaseSearch';
38
39
  import { useCaseListDispatchContext, useCaseListStateContext } from './CaseListContext';
39
- import { CaseListFilterDispatchContext, CaseListFilterStateContext } from './CaseListFilterContext';
40
- import { isNoFilterApplied, isOnlyDefaultFilterApplied } from './CaseListFilterHelpers';
40
+ import { CaseListFilterDispatchContext, CaseListFilterStateContext, initialCaseFilterState, } from './CaseListFilterContext';
41
+ import { eligibleSFDCFiltersMultipleValues, isNoFilterApplied, isOnlyDefaultFilterApplied, } from './CaseListFilterHelpers';
41
42
  import { updateFilterState } from './CaseListFilterReducer';
42
43
  import { setCaseList, setCurrentQuery, setFilterValuesFromFacetResponse, setIsFetching, setPivotValues, } from './CaseListReducer';
43
44
  export function CaseList(props) {
@@ -184,7 +185,19 @@ export function CaseList(props) {
184
185
  if (haventLoadedProductsMetadata(allProducts)) {
185
186
  fetchProducts(dispatchToGlobalMetadataReducer);
186
187
  }
188
+ // on sfdc fields that only one value is allowed, set filter to first item
189
+ const sfdcFilterState = mapValues(filterState.filterInfo, (value, key) => {
190
+ //@ts-ignore
191
+ if (eligibleSFDCFiltersMultipleValues.includes(key))
192
+ return value;
193
+ return value[0] ? [value[0]] : [];
194
+ });
195
+ updateFilterState(filterDispatch, {
196
+ //@ts-ignore
197
+ filterInfo: Object.assign(Object.assign({}, initialCaseFilterState.filterInfo), sfdcFilterState),
198
+ });
187
199
  }
200
+ // eslint-disable-next-line react-hooks/exhaustive-deps
188
201
  }, [
189
202
  allCaseTypes,
190
203
  allCaseSeverities,
@@ -228,7 +241,8 @@ export function CaseList(props) {
228
241
  if (bookmarkedGroupAccounts.isFetching ||
229
242
  bookmarkedAccounts.isFetching ||
230
243
  managedAccounts.isFetching ||
231
- caseGroups.isFetching)
244
+ caseGroups.isFetching ||
245
+ caseGroups.data === undefined)
232
246
  return;
233
247
  // when user manually changes url and hit enter, new result is fetched without refreshing the page
234
248
  if (!isFirstMount.current) {
@@ -1 +1 @@
1
- {"version":3,"file":"CaseListFilterChips.d.ts","sourceRoot":"","sources":["../../../../../src/components/case-list/case-list-filters/CaseListFilterChips.tsx"],"names":[],"mappings":"AASA,OAAO,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AAMtD,UAAU,MAAM;IACZ,yBAAyB,EAAE,uBAAuB,EAAE,CAAC;IACrD,gBAAgB,EAAE,OAAO,CAAC;CAC7B;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,eAsIhD"}
1
+ {"version":3,"file":"CaseListFilterChips.d.ts","sourceRoot":"","sources":["../../../../../src/components/case-list/case-list-filters/CaseListFilterChips.tsx"],"names":[],"mappings":"AASA,OAAO,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AAMtD,UAAU,MAAM;IACZ,yBAAyB,EAAE,uBAAuB,EAAE,CAAC;IACrD,gBAAgB,EAAE,OAAO,CAAC;CAC7B;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,eA6HhD"}
@@ -6,7 +6,7 @@ import { Trans } from 'react-i18next';
6
6
  import { ProductVersionKey, SolrKeys, SolrPivotKeys } from '../../../enums/filters';
7
7
  import { filterNamesMap } from '../../../utils/constants';
8
8
  import { CaseListFilterDispatchContext, CaseListFilterStateContext } from '../CaseListFilterContext';
9
- import { eligibleSFDCFiltersWithLengthOne, visibleFilterChipsWhenSolrDownSfdcUp } from '../CaseListFilterHelpers';
9
+ import { visibleFilterChipsWhenSolrDownSfdcUp } from '../CaseListFilterHelpers';
10
10
  import { clearFilters, removeFilterItem } from '../CaseListFilterReducer';
11
11
  import { CreatorSsoNameFilterChip } from './CreatorSsoNameFilterChip';
12
12
  import { ProductFilterChip } from './ProductFilterChip';
@@ -28,13 +28,6 @@ export function CaseListFilterChips(props) {
28
28
  clearFilters(dispatch);
29
29
  };
30
30
  const renderFilterValueChips = (filterKey, filterValues, chipKeySuffix = '') => {
31
- const singleValueSfdcFilterHasMultipleValues = visibleFilterChipsWhenSolrDownSfdcUp.includes(filterKey) &&
32
- eligibleSFDCFiltersWithLengthOne.includes(filterKey) &&
33
- Array.isArray(filterValues) &&
34
- filterValues[0];
35
- if (props.isSolrSearchDown && singleValueSfdcFilterHasMultipleValues) {
36
- filterValues = [filterValues[0]];
37
- }
38
31
  const filterChips = filterValues.map((chip, index) => {
39
32
  return (React.createElement(Chip, { key: `${filterKey}-${index}-${chipKeySuffix}`, onClick: deleteChip(filterKey, getChipKey(chip)) }, getChipValue(chip)));
40
33
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rh-support/cases",
3
- "version": "0.2.68-alpha-0",
3
+ "version": "0.2.70",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "registry": "https://registry.npmjs.org"
@@ -26,7 +26,7 @@
26
26
  "lib/**/*"
27
27
  ],
28
28
  "peerDependencies": {
29
- "@cee-eng/hydrajs": "4.7.22",
29
+ "@cee-eng/hydrajs": "4.8.34",
30
30
  "@patternfly/patternfly": "4.185.1",
31
31
  "@patternfly/pfe-collapse": "1.12.3",
32
32
  "@patternfly/react-core": "4.202.16",
@@ -47,17 +47,17 @@
47
47
  "solr-query-builder": "1.0.1"
48
48
  },
49
49
  "dependencies": {
50
- "@cee-eng/hydrajs": "4.7.22",
50
+ "@cee-eng/hydrajs": "4.8.34",
51
51
  "@patternfly/patternfly": "4.185.1",
52
52
  "@patternfly/pfe-collapse": "1.12.3",
53
53
  "@patternfly/react-core": "4.202.16",
54
54
  "@patternfly/react-table": "4.71.16",
55
- "@rh-support/api": "0.3.13",
56
- "@rh-support/components": "1.1.57-alpha-0",
57
- "@rh-support/react-context": "0.2.57-alpha-0",
55
+ "@rh-support/api": "0.3.14",
56
+ "@rh-support/components": "1.1.58",
57
+ "@rh-support/react-context": "0.2.58",
58
58
  "@rh-support/types": "0.2.0",
59
- "@rh-support/user-permissions": "0.2.45-alpha-0",
60
- "@rh-support/utils": "0.2.34-alpha-0",
59
+ "@rh-support/user-permissions": "0.2.46",
60
+ "@rh-support/utils": "0.2.35",
61
61
  "i18next": "^19.0.1",
62
62
  "localforage": "^1.7.3",
63
63
  "lodash": "^4.17.15",
@@ -101,5 +101,5 @@
101
101
  "not ie <= 11",
102
102
  "not op_mini all"
103
103
  ],
104
- "gitHead": "c493eace4748f428da4c41f386381e609dd39651"
104
+ "gitHead": "3fad11884fd2c38ae9c2171cc51099fb09cd5d40"
105
105
  }