@rh-support/cases 1.0.41-beta.32 → 1.0.42

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":"NewCaseButton.d.ts","sourceRoot":"","sources":["../../../../src/components/case/NewCaseButton.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAEvD,OAAO,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAEhD,UAAU,MAAM;IACZ,UAAU,EAAE,mBAAmB,CAAC,oBAAoB,CAAC,CAAC;CACzD;AACD,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,eAyB1C"}
1
+ {"version":3,"file":"NewCaseButton.d.ts","sourceRoot":"","sources":["../../../../src/components/case/NewCaseButton.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAEvD,OAAO,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAEhD,UAAU,MAAM;IACZ,UAAU,EAAE,mBAAmB,CAAC,oBAAoB,CAAC,CAAC;CACzD;AACD,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,eAmB1C"}
@@ -2,9 +2,8 @@ import { Button, ButtonVariant } from '@patternfly/react-core';
2
2
  import { useCanCreateCase } from '@rh-support/react-context';
3
3
  import { getStringifiedParams } from '@rh-support/utils';
4
4
  import React from 'react';
5
- import { Trans, useTranslation } from 'react-i18next';
5
+ import { Trans } from 'react-i18next';
6
6
  export function NewCaseButton(props) {
7
- const { t } = useTranslation();
8
7
  const canCreateCase = useCanCreateCase();
9
8
  const onNew = () => {
10
9
  if (canCreateCase.alert()) {
@@ -16,6 +15,6 @@ export function NewCaseButton(props) {
16
15
  }
17
16
  };
18
17
  return (React.createElement(React.Fragment, null,
19
- React.createElement(Button, { variant: ButtonVariant.tertiary, onClick: onNew, "data-tracking-id": "get-support-new-case", "aria-label": t('Get support') },
20
- React.createElement(Trans, null, "Get support"))));
18
+ React.createElement(Button, { variant: ButtonVariant.tertiary, onClick: onNew, "data-tracking-id": "open-new-case" },
19
+ React.createElement(Trans, null, "Open a case"))));
21
20
  }
@@ -37,7 +37,7 @@ const isStatusFilterWithSFDCSupportedValues = ({ case_status = [] }) => {
37
37
  return statusLength !== 2 || (statusLength === 2 && !case_status.includes(CaseStatus.Closed));
38
38
  };
39
39
  // SFDC on most fields including case_status only accept one value
40
- // on support type field if 'closed' is selected then, we can have 2 filters selected
40
+ // on case type field if 'closed' is selected then, we can have 2 filters selected
41
41
  // because closed in SFDC passes as a seperate param
42
42
  // if closed not selected then only one filter can be selected
43
43
  const isStatusFilterWithSFDCSupported = (filterKey, filterValue) => {
@@ -1 +1 @@
1
- {"version":3,"file":"CaseListFilterChips.d.ts","sourceRoot":"","sources":["../../../../../src/components/case-list/case-list-filters/CaseListFilterChips.tsx"],"names":[],"mappings":"AAUA,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,eA+HhD"}
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"}
@@ -1,5 +1,4 @@
1
1
  import { Button, Chip, ChipGroup } from '@patternfly/react-core';
2
- import { toNewCaseTypeMapper, toOldCaseTypeSwitcher } from '@rh-support/utils';
3
2
  import flatMap from 'lodash/flatMap';
4
3
  import remove from 'lodash/remove';
5
4
  import React, { useContext } from 'react';
@@ -20,8 +19,7 @@ export function CaseListFilterChips(props) {
20
19
  removeFilterItem(dispatch, { filterKey, value });
21
20
  };
22
21
  const getChipKey = (item) => {
23
- const newCaseTypeFilterItem = toOldCaseTypeSwitcher(item);
24
- return typeof item === 'string' ? newCaseTypeFilterItem : item.key;
22
+ return typeof item === 'string' ? item : item.key;
25
23
  };
26
24
  const getChipValue = (item) => {
27
25
  return typeof item === 'string' ? item : item.value;
@@ -36,7 +34,6 @@ export function CaseListFilterChips(props) {
36
34
  return filterChips;
37
35
  };
38
36
  const getChipGroupForFilter = (filterKey, filterValues, groupName = '') => {
39
- const caseTypeFilter = filterKey === 'case_type' ? toNewCaseTypeMapper(filterValues) : filterValues;
40
37
  if (props.isSolrSearchDown && !visibleFilterChipsWhenSolrDownSfdcUp.includes(filterKey)) {
41
38
  return React.createElement(React.Fragment, null);
42
39
  }
@@ -44,7 +41,7 @@ export function CaseListFilterChips(props) {
44
41
  return (React.createElement("div", { className: "filter-chip", key: `${filterKey}-bookmarks-${groupName}` },
45
42
  React.createElement("span", { className: "filter-chip__heading" },
46
43
  React.createElement(Trans, null, groupName || filterNamesMap[filterKey] || filterKey)),
47
- React.createElement(ChipGroup, { numChips: 7, className: "pf-c-chip-group__simple" }, renderFilterValueChips(filterKey, caseTypeFilter, groupName))));
44
+ React.createElement(ChipGroup, { numChips: 7, className: "pf-c-chip-group__simple" }, renderFilterValueChips(filterKey, filterValues, groupName))));
48
45
  }
49
46
  };
50
47
  const renderAccountFilterChip = () => {
@@ -1 +1 @@
1
- {"version":3,"file":"TypeFilter.d.ts","sourceRoot":"","sources":["../../../../../src/components/case-list/case-list-filters/TypeFilter.tsx"],"names":[],"mappings":"AAUA,UAAU,MAAM;IACZ,YAAY,EAAE,MAAM,EAAE,CAAC;CAC1B;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,eAyDvC"}
1
+ {"version":3,"file":"TypeFilter.d.ts","sourceRoot":"","sources":["../../../../../src/components/case-list/case-list-filters/TypeFilter.tsx"],"names":[],"mappings":"AAUA,UAAU,MAAM;IACZ,YAAY,EAAE,MAAM,EAAE,CAAC;CAC1B;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,eAkDvC"}
@@ -1,5 +1,5 @@
1
1
  import { Select, SelectOption, SelectVariant } from '@patternfly/react-core';
2
- import { getDropdownBtnPlaceholder, toNewCaseTypeMapper, toOldCaseTypeSwitcher } from '@rh-support/utils';
2
+ import { getDropdownBtnPlaceholder } from '@rh-support/utils';
3
3
  import React, { useContext, useState } from 'react';
4
4
  import { useTranslation } from 'react-i18next';
5
5
  import { SolrKeys } from '../../../enums/filters';
@@ -13,21 +13,16 @@ export function TypeFilter(props) {
13
13
  const [isOpen, setIsOpen] = useState(false);
14
14
  const toggleIsOpen = (isExpanded) => setIsOpen(isExpanded);
15
15
  const onFilterChangeMultipleSelect = (event, selectedTypes) => {
16
- // To convert the selected type to old case type
17
- const convertedSelectedType = toOldCaseTypeSwitcher(selectedTypes);
18
- const newState = filterInfo[SolrKeys.type].includes(convertedSelectedType)
19
- ? filterInfo[SolrKeys.type].filter((item) => item !== convertedSelectedType)
20
- : [...filterInfo[SolrKeys.type], convertedSelectedType];
16
+ const newState = filterInfo[SolrKeys.type].includes(selectedTypes)
17
+ ? filterInfo[SolrKeys.type].filter((item) => item !== selectedTypes)
18
+ : [...filterInfo[SolrKeys.type], selectedTypes];
21
19
  updateFilter(dispatch, {
22
20
  filterKey: SolrKeys.type,
23
21
  values: newState,
24
22
  });
25
23
  };
26
24
  const titleId = 'case-list-type-filter';
27
- // To switch from old case type to new support type
28
- const newCaseTypesArray = toNewCaseTypeMapper(props.allCaseTypes).sort();
29
- const toNewCaseTypesFilter = toNewCaseTypeMapper(filterInfo[SolrKeys.type]);
30
25
  return (React.createElement("div", { className: "pf-c-select" },
31
26
  React.createElement("label", { htmlFor: titleId }, t(filterNamesMap[SolrKeys.type])),
32
- React.createElement(Select, { id: titleId, variant: SelectVariant.checkbox, "aria-label": t('Select a support type'), onToggle: toggleIsOpen, onSelect: onFilterChangeMultipleSelect, selections: toNewCaseTypesFilter, isOpen: isOpen, placeholderText: getDropdownBtnPlaceholder(t('Select a support type'), toNewCaseTypesFilter, ' ', props.allCaseTypes.length, t('All selected')), isCheckboxSelectionBadgeHidden: true, "aria-labelledby": titleId, "data-tracking-id": "type-filter", hasPlaceholderStyle: true }, newCaseTypesArray.map((filterValue) => (React.createElement(SelectOption, { key: filterValue, value: filterValue }))))));
27
+ React.createElement(Select, { id: titleId, variant: SelectVariant.checkbox, "aria-label": t('Select a case type'), onToggle: toggleIsOpen, onSelect: onFilterChangeMultipleSelect, selections: filterInfo[SolrKeys.type], isOpen: isOpen, placeholderText: getDropdownBtnPlaceholder(t('Select a case type'), filterInfo[SolrKeys.type], ' ', props.allCaseTypes.length, t('All selected')), isCheckboxSelectionBadgeHidden: true, "aria-labelledby": titleId, "data-tracking-id": "type-filter", hasPlaceholderStyle: true }, props.allCaseTypes.map((filterValue) => (React.createElement(SelectOption, { key: filterValue, value: filterValue }))))));
33
28
  }
@@ -2,7 +2,7 @@ import { Bullseye, Button, EmptyState, EmptyStateBody, EmptyStateIcon, EmptyStat
2
2
  import SearchIcon from '@patternfly/react-icons/dist/js/icons/search-icon';
3
3
  import { PFTable, Table, TableColumnSelector, TablePagination, } from '@rh-support/components';
4
4
  import { GlobalMetadataDispatchContext, GlobalMetadataStateContext, updateUserPreferences, useGlobalStateContext, UserPreferencesKeys, } from '@rh-support/react-context';
5
- import { formatDate, scrollIntoView, toNewCaseTypeSwitcher } from '@rh-support/utils';
5
+ import { formatDate, scrollIntoView } from '@rh-support/utils';
6
6
  import find from 'lodash/find';
7
7
  import flatMap from 'lodash/flatMap';
8
8
  import get from 'lodash/get';
@@ -155,9 +155,9 @@ export function CaseListTable(props) {
155
155
  {
156
156
  id: CaseListColumnIds.type,
157
157
  cellWidth: 10,
158
- title: t('Support type'),
158
+ title: t('Case type'),
159
159
  sortable: true,
160
- accessor: (data) => toNewCaseTypeSwitcher(data.case_type),
160
+ accessor: (data) => data.case_type,
161
161
  show: isColumnVisible(CaseListColumnIds.type),
162
162
  },
163
163
  {
@@ -53,7 +53,7 @@ const csvHeadersSFDC = [
53
53
  { label: 'Modified date', key: SFDCKeys.lastPublicUpdateDate, transform: formatDateTime },
54
54
  { label: 'Uri', key: SFDCKeys.uri },
55
55
  { label: 'Alternate case ID', key: SFDCKeys.alternateId },
56
- { label: 'Support type', key: SFDCKeys.caseType },
56
+ { label: 'Case type', key: SFDCKeys.caseType },
57
57
  { label: 'Closed date', key: SFDCKeys.caseClosedDate, transform: formatDateTime },
58
58
  ];
59
59
  const groupHeaderSOLR = { label: 'Group', key: SolrKeys.groupName };
@@ -70,6 +70,6 @@ export const caseTableColumSortNamesMap = {
70
70
  [CaseListColumnIds.accountNumber]: 'Account number',
71
71
  [CaseListColumnIds.group]: 'Groups',
72
72
  [CaseListColumnIds.alternateCaseId]: 'Alternate case Id',
73
- [CaseListColumnIds.type]: 'Support type',
73
+ [CaseListColumnIds.type]: 'Case type',
74
74
  [CaseListColumnIds.caseClosedDate]: 'Close date',
75
75
  };
@@ -17,7 +17,7 @@ export const filterNamesMap = {
17
17
  [SolrKeys.caseNumber]: 'Case number',
18
18
  [SolrKeys.createdBySsoUsername]: 'Created by me',
19
19
  [SolrKeys.caseContactSSO]: 'Owned by me',
20
- [SolrKeys.type]: 'Support type',
20
+ [SolrKeys.type]: 'Case type',
21
21
  usernameFilterTitle: 'Username',
22
22
  };
23
23
  export const UpdatedCaseDataEvent = 'PCM-Next > case-list-data-background-refresh';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rh-support/cases",
3
- "version": "1.0.41-beta.32",
3
+ "version": "1.0.42",
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.264.0",
53
53
  "@patternfly/react-table": "4.111.33",
54
- "@rh-support/components": "1.2.22-beta.32",
55
- "@rh-support/react-context": "1.0.30-beta.32",
56
- "@rh-support/types": "0.2.1-beta.32",
57
- "@rh-support/user-permissions": "1.0.12-beta.32",
58
- "@rh-support/utils": "1.0.10-beta.32",
54
+ "@rh-support/components": "1.2.23",
55
+ "@rh-support/react-context": "1.0.31",
56
+ "@rh-support/types": "0.2.0",
57
+ "@rh-support/user-permissions": "1.0.13",
58
+ "@rh-support/utils": "1.0.11",
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": "87be4349c6ce8c1dbebefcc96d2438b8d253afb7"
102
+ "gitHead": "5a6ac6cd2418495e7fdd0f48cfaa34a7c627635a"
103
103
  }