@rh-support/cases 1.0.40 → 1.0.41-beta.32
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.
- package/lib/esm/components/case/NewCaseButton.d.ts.map +1 -1
- package/lib/esm/components/case/NewCaseButton.js +4 -3
- package/lib/esm/components/case-list/CaseListFilterHelpers.js +1 -1
- package/lib/esm/components/case-list/case-list-filters/CaseListFilterChips.d.ts.map +1 -1
- package/lib/esm/components/case-list/case-list-filters/CaseListFilterChips.js +5 -2
- package/lib/esm/components/case-list/case-list-filters/TypeFilter.d.ts.map +1 -1
- package/lib/esm/components/case-list/case-list-filters/TypeFilter.js +10 -5
- package/lib/esm/components/case-list/case-list-table/CaseListTable.js +3 -3
- package/lib/esm/components/case-list/case-list-table/ExportCaseListCSV.js +1 -1
- package/lib/esm/enums/case.js +1 -1
- package/lib/esm/utils/constants.js +1 -1
- package/package.json +7 -7
|
@@ -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,
|
|
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"}
|
|
@@ -2,8 +2,9 @@ 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 } from 'react-i18next';
|
|
5
|
+
import { Trans, useTranslation } from 'react-i18next';
|
|
6
6
|
export function NewCaseButton(props) {
|
|
7
|
+
const { t } = useTranslation();
|
|
7
8
|
const canCreateCase = useCanCreateCase();
|
|
8
9
|
const onNew = () => {
|
|
9
10
|
if (canCreateCase.alert()) {
|
|
@@ -15,6 +16,6 @@ export function NewCaseButton(props) {
|
|
|
15
16
|
}
|
|
16
17
|
};
|
|
17
18
|
return (React.createElement(React.Fragment, null,
|
|
18
|
-
React.createElement(Button, { variant: ButtonVariant.tertiary, onClick: onNew, "data-tracking-id": "
|
|
19
|
-
React.createElement(Trans, 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"))));
|
|
20
21
|
}
|
|
@@ -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
|
|
40
|
+
// on support 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":"
|
|
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,4 +1,5 @@
|
|
|
1
1
|
import { Button, Chip, ChipGroup } from '@patternfly/react-core';
|
|
2
|
+
import { toNewCaseTypeMapper, toOldCaseTypeSwitcher } from '@rh-support/utils';
|
|
2
3
|
import flatMap from 'lodash/flatMap';
|
|
3
4
|
import remove from 'lodash/remove';
|
|
4
5
|
import React, { useContext } from 'react';
|
|
@@ -19,7 +20,8 @@ export function CaseListFilterChips(props) {
|
|
|
19
20
|
removeFilterItem(dispatch, { filterKey, value });
|
|
20
21
|
};
|
|
21
22
|
const getChipKey = (item) => {
|
|
22
|
-
|
|
23
|
+
const newCaseTypeFilterItem = toOldCaseTypeSwitcher(item);
|
|
24
|
+
return typeof item === 'string' ? newCaseTypeFilterItem : item.key;
|
|
23
25
|
};
|
|
24
26
|
const getChipValue = (item) => {
|
|
25
27
|
return typeof item === 'string' ? item : item.value;
|
|
@@ -34,6 +36,7 @@ export function CaseListFilterChips(props) {
|
|
|
34
36
|
return filterChips;
|
|
35
37
|
};
|
|
36
38
|
const getChipGroupForFilter = (filterKey, filterValues, groupName = '') => {
|
|
39
|
+
const caseTypeFilter = filterKey === 'case_type' ? toNewCaseTypeMapper(filterValues) : filterValues;
|
|
37
40
|
if (props.isSolrSearchDown && !visibleFilterChipsWhenSolrDownSfdcUp.includes(filterKey)) {
|
|
38
41
|
return React.createElement(React.Fragment, null);
|
|
39
42
|
}
|
|
@@ -41,7 +44,7 @@ export function CaseListFilterChips(props) {
|
|
|
41
44
|
return (React.createElement("div", { className: "filter-chip", key: `${filterKey}-bookmarks-${groupName}` },
|
|
42
45
|
React.createElement("span", { className: "filter-chip__heading" },
|
|
43
46
|
React.createElement(Trans, null, groupName || filterNamesMap[filterKey] || filterKey)),
|
|
44
|
-
React.createElement(ChipGroup, { numChips: 7, className: "pf-c-chip-group__simple" }, renderFilterValueChips(filterKey,
|
|
47
|
+
React.createElement(ChipGroup, { numChips: 7, className: "pf-c-chip-group__simple" }, renderFilterValueChips(filterKey, caseTypeFilter, groupName))));
|
|
45
48
|
}
|
|
46
49
|
};
|
|
47
50
|
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,
|
|
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,5 +1,5 @@
|
|
|
1
1
|
import { Select, SelectOption, SelectVariant } from '@patternfly/react-core';
|
|
2
|
-
import { getDropdownBtnPlaceholder } from '@rh-support/utils';
|
|
2
|
+
import { getDropdownBtnPlaceholder, toNewCaseTypeMapper, toOldCaseTypeSwitcher } 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,16 +13,21 @@ 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
|
-
|
|
17
|
-
|
|
18
|
-
|
|
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];
|
|
19
21
|
updateFilter(dispatch, {
|
|
20
22
|
filterKey: SolrKeys.type,
|
|
21
23
|
values: newState,
|
|
22
24
|
});
|
|
23
25
|
};
|
|
24
26
|
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]);
|
|
25
30
|
return (React.createElement("div", { className: "pf-c-select" },
|
|
26
31
|
React.createElement("label", { htmlFor: titleId }, t(filterNamesMap[SolrKeys.type])),
|
|
27
|
-
React.createElement(Select, { id: titleId, variant: SelectVariant.checkbox, "aria-label": t('Select a
|
|
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 }))))));
|
|
28
33
|
}
|
|
@@ -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 } from '@rh-support/utils';
|
|
5
|
+
import { formatDate, scrollIntoView, toNewCaseTypeSwitcher } 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('
|
|
158
|
+
title: t('Support type'),
|
|
159
159
|
sortable: true,
|
|
160
|
-
accessor: (data) => data.case_type,
|
|
160
|
+
accessor: (data) => toNewCaseTypeSwitcher(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: '
|
|
56
|
+
{ label: 'Support 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 };
|
package/lib/esm/enums/case.js
CHANGED
|
@@ -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]: '
|
|
73
|
+
[CaseListColumnIds.type]: 'Support 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]: '
|
|
20
|
+
[SolrKeys.type]: 'Support 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.
|
|
3
|
+
"version": "1.0.41-beta.32",
|
|
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.
|
|
55
|
-
"@rh-support/react-context": "1.0.
|
|
56
|
-
"@rh-support/types": "0.2.
|
|
57
|
-
"@rh-support/user-permissions": "1.0.
|
|
58
|
-
"@rh-support/utils": "1.0.
|
|
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",
|
|
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": "
|
|
102
|
+
"gitHead": "87be4349c6ce8c1dbebefcc96d2438b8d253afb7"
|
|
103
103
|
}
|