@rh-support/cases 2.6.173 → 2.6.178
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-list/CaseList.d.ts +0 -7
- package/lib/esm/components/case-list/CaseList.d.ts.map +1 -1
- package/lib/esm/components/case-list/CaseList.js +143 -108
- package/lib/esm/components/case-list/CaseListContext.d.ts.map +1 -1
- package/lib/esm/components/case-list/CaseListContext.js +5 -2
- package/lib/esm/components/case-list/CaseListFilterReducer.d.ts +6 -4
- package/lib/esm/components/case-list/CaseListFilterReducer.d.ts.map +1 -1
- package/lib/esm/components/case-list/CaseListFilterReducer.js +3 -12
- package/lib/esm/components/case-list/CaseListReducer.d.ts +22 -10
- package/lib/esm/components/case-list/CaseListReducer.d.ts.map +1 -1
- package/lib/esm/components/case-list/CaseListReducer.js +25 -7
- package/lib/esm/components/case-list/case-list-filters/AccountsFilter.d.ts.map +1 -1
- package/lib/esm/components/case-list/case-list-filters/AccountsFilter.js +18 -11
- package/lib/esm/components/case-list/case-list-filters/AdditionalFilters.d.ts.map +1 -1
- package/lib/esm/components/case-list/case-list-filters/AdditionalFilters.js +4 -2
- package/lib/esm/components/case-list/case-list-filters/CaseListFilterChips.d.ts +1 -7
- 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 +7 -15
- package/lib/esm/components/case-list/case-list-filters/CaseListFilters.d.ts +2 -5
- package/lib/esm/components/case-list/case-list-filters/CaseListFilters.d.ts.map +1 -1
- package/lib/esm/components/case-list/case-list-filters/CaseListFilters.js +14 -14
- package/lib/esm/components/case-list/case-list-filters/ProductFilterChip.d.ts +1 -3
- package/lib/esm/components/case-list/case-list-filters/ProductFilterChip.d.ts.map +1 -1
- package/lib/esm/components/case-list/case-list-filters/ProductFilterChip.js +2 -2
- package/lib/esm/components/case-list/case-list-filters/ProductsFilter.d.ts +5 -4
- package/lib/esm/components/case-list/case-list-filters/ProductsFilter.d.ts.map +1 -1
- package/lib/esm/components/case-list/case-list-filters/ProductsFilter.js +15 -54
- package/lib/esm/components/case-list/case-list-filters/SeverityFilter.d.ts +0 -3
- package/lib/esm/components/case-list/case-list-filters/SeverityFilter.d.ts.map +1 -1
- package/lib/esm/components/case-list/case-list-filters/SeverityFilter.js +18 -44
- package/lib/esm/components/case-list/case-list-filters/StatusFilter.d.ts +0 -3
- package/lib/esm/components/case-list/case-list-filters/StatusFilter.d.ts.map +1 -1
- package/lib/esm/components/case-list/case-list-filters/StatusFilter.js +14 -44
- package/lib/esm/components/case-list/case-list-filters/VersionsFilter.d.ts +1 -3
- package/lib/esm/components/case-list/case-list-filters/VersionsFilter.d.ts.map +1 -1
- package/lib/esm/components/case-list/case-list-filters/VersionsFilter.js +61 -32
- package/lib/esm/components/case-list/case-list-table/CaseListTable.d.ts +7 -3
- package/lib/esm/components/case-list/case-list-table/CaseListTable.d.ts.map +1 -1
- package/lib/esm/components/case-list/case-list-table/CaseListTable.js +69 -58
- package/lib/esm/components/case-list/case-list-table/DownloadCSVFileModal.d.ts +0 -5
- package/lib/esm/components/case-list/case-list-table/DownloadCSVFileModal.d.ts.map +1 -1
- package/lib/esm/components/case-list/case-list-table/DownloadCSVFileModal.js +38 -68
- package/lib/esm/components/case-list/case-list-table/ExportCaseListCSV.d.ts.map +1 -1
- package/lib/esm/components/case-list/case-list-table/ExportCaseListCSV.js +5 -15
- package/lib/esm/components/case-list/case-list-table/SeverityLabel.js +1 -1
- package/lib/esm/components/case-list/case-list-table/TableActionsDropdown.d.ts.map +1 -1
- package/lib/esm/components/case-list/case-list-table/TableActionsDropdown.js +2 -3
- package/lib/esm/components/case-list/case-search/BookmarkedSearchesSelector.d.ts.map +1 -1
- package/lib/esm/components/case-list/case-search/BookmarkedSearchesSelector.js +1 -0
- package/lib/esm/components/case-list/case-search/CaseSearch.d.ts.map +1 -1
- package/lib/esm/components/case-list/case-search/CaseSearch.js +6 -6
- package/lib/esm/components/case-list/case-search/useAdvanceSearchParser.d.ts.map +1 -1
- package/lib/esm/components/case-list/case-search/useAdvanceSearchParser.js +2 -1
- package/lib/esm/css/caseList.css +99 -22
- package/lib/esm/enums/case.d.ts +2 -1
- package/lib/esm/enums/case.d.ts.map +1 -1
- package/lib/esm/enums/case.js +14 -1
- package/lib/esm/hooks/useExportCaseListCSV.d.ts.map +1 -1
- package/lib/esm/hooks/useExportCaseListCSV.js +1 -9
- package/lib/esm/test-utils/mockData.js +1 -1
- package/lib/esm/utils/caseListGraphQLUtils.d.ts +28 -0
- package/lib/esm/utils/caseListGraphQLUtils.d.ts.map +1 -0
- package/lib/esm/utils/caseListGraphQLUtils.js +244 -0
- package/lib/esm/utils/caseListMapper.d.ts +6 -0
- package/lib/esm/utils/caseListMapper.d.ts.map +1 -0
- package/lib/esm/utils/caseListMapper.js +36 -0
- package/lib/esm/utils/caseListVariablesBuilder.d.ts +13 -0
- package/lib/esm/utils/caseListVariablesBuilder.d.ts.map +1 -0
- package/lib/esm/utils/caseListVariablesBuilder.js +160 -0
- package/lib/esm/utils/caseSearchUtils.d.ts.map +1 -1
- package/lib/esm/utils/caseSearchUtils.js +26 -1
- package/lib/esm/utils/constants.d.ts +2 -1
- package/lib/esm/utils/constants.d.ts.map +1 -1
- package/lib/esm/utils/constants.js +14 -3
- package/lib/esm/utils/mockSolrResponse.js +1 -1
- package/lib/esm/utils/statusUtils.d.ts +3 -0
- package/lib/esm/utils/statusUtils.d.ts.map +1 -0
- package/lib/esm/utils/statusUtils.js +22 -0
- package/package.json +6 -5
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export function mapGraphQLCaseToCaseListItem(node) {
|
|
2
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3;
|
|
3
|
+
const isEscalated = ((_a = node.IsEscalated) === null || _a === void 0 ? void 0 : _a.value) === true;
|
|
4
|
+
return {
|
|
5
|
+
id: node.Id || '',
|
|
6
|
+
case_number: ((_b = node.CaseNumber__c) === null || _b === void 0 ? void 0 : _b.value) || '',
|
|
7
|
+
case_summary: ((_c = node.Subject) === null || _c === void 0 ? void 0 : _c.value) || '',
|
|
8
|
+
case_status: ((_d = node.Status) === null || _d === void 0 ? void 0 : _d.value) || '',
|
|
9
|
+
case_severity: ((_e = node.Priority) === null || _e === void 0 ? void 0 : _e.value) || '',
|
|
10
|
+
case_product: ((_h = (_g = (_f = node.Product) === null || _f === void 0 ? void 0 : _f.ParentProduct__r) === null || _g === void 0 ? void 0 : _g.Name) === null || _h === void 0 ? void 0 : _h.value)
|
|
11
|
+
? [node.Product.ParentProduct__r.Name.value]
|
|
12
|
+
: ((_k = (_j = node.Product) === null || _j === void 0 ? void 0 : _j.Name) === null || _k === void 0 ? void 0 : _k.value)
|
|
13
|
+
? [node.Product.Name.value]
|
|
14
|
+
: [],
|
|
15
|
+
case_version: ((_m = (_l = node.Product) === null || _l === void 0 ? void 0 : _l.VersionName__c) === null || _m === void 0 ? void 0 : _m.value) || '',
|
|
16
|
+
case_type: ((_o = node.Type) === null || _o === void 0 ? void 0 : _o.value) || '',
|
|
17
|
+
case_accountNumber: ((_p = node.Account_Number__c) === null || _p === void 0 ? void 0 : _p.value) || '',
|
|
18
|
+
case_contactName: ((_r = (_q = node.Owner) === null || _q === void 0 ? void 0 : _q.Name) === null || _r === void 0 ? void 0 : _r.value) || '',
|
|
19
|
+
case_owner: ((_t = (_s = node.Owner) === null || _s === void 0 ? void 0 : _s.Name) === null || _t === void 0 ? void 0 : _t.value) || '',
|
|
20
|
+
case_createdByName: ((_v = (_u = node.CreatedBy) === null || _u === void 0 ? void 0 : _u.Name) === null || _v === void 0 ? void 0 : _v.value) || '',
|
|
21
|
+
case_createdDate: ((_w = node.CreatedDate) === null || _w === void 0 ? void 0 : _w.value) || '',
|
|
22
|
+
case_lastModifiedByName: ((_y = (_x = node.LastModifiedBy) === null || _x === void 0 ? void 0 : _x.Name) === null || _y === void 0 ? void 0 : _y.value) || '',
|
|
23
|
+
case_lastModifiedDate: ((_z = node.LastModifiedDate) === null || _z === void 0 ? void 0 : _z.value) || '',
|
|
24
|
+
case_last_public_update_by: ((_1 = (_0 = node.LastModifiedBy) === null || _0 === void 0 ? void 0 : _0.Name) === null || _1 === void 0 ? void 0 : _1.value) || '',
|
|
25
|
+
case_last_public_update_date: ((_2 = node.LastModifiedDate) === null || _2 === void 0 ? void 0 : _2.value) || '',
|
|
26
|
+
case_customer_escalation: isEscalated,
|
|
27
|
+
case_closedDate: ((_3 = node.ClosedDate) === null || _3 === void 0 ? void 0 : _3.value) || '',
|
|
28
|
+
case_folderName: '',
|
|
29
|
+
case_folderNumber: '',
|
|
30
|
+
case_alternate_id: '',
|
|
31
|
+
uri: '',
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
export function mapGraphQLResponseToCaseList(edges) {
|
|
35
|
+
return edges.map((edge) => mapGraphQLCaseToCaseListItem(edge.node));
|
|
36
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ICaseListFilterState } from '../components/case-list/CaseListFilterReducer';
|
|
2
|
+
export declare function getOwnerFederationIdsToResolve(filterState: ICaseListFilterState): string[];
|
|
3
|
+
export interface IGraphQLCaseListVariables {
|
|
4
|
+
after?: string;
|
|
5
|
+
first: number;
|
|
6
|
+
where?: Record<string, unknown>;
|
|
7
|
+
orderBy?: Record<string, unknown>;
|
|
8
|
+
}
|
|
9
|
+
export interface IResolvedUserIds {
|
|
10
|
+
ownerUserIds?: string[];
|
|
11
|
+
}
|
|
12
|
+
export declare function createGraphQLVariablesFromFilterState(filterState: ICaseListFilterState, resolvedUserIds?: IResolvedUserIds): IGraphQLCaseListVariables;
|
|
13
|
+
//# sourceMappingURL=caseListVariablesBuilder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"caseListVariablesBuilder.d.ts","sourceRoot":"","sources":["../../../src/utils/caseListVariablesBuilder.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,oBAAoB,EAAkB,MAAM,+CAA+C,CAAC;AAKrG,wBAAgB,8BAA8B,CAAC,WAAW,EAAE,oBAAoB,GAAG,MAAM,EAAE,CAQ1F;AAED,MAAM,WAAW,yBAAyB;IACtC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACrC;AAED,MAAM,WAAW,gBAAgB;IAC7B,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;CAC3B;AAkFD,wBAAgB,qCAAqC,CACjD,WAAW,EAAE,oBAAoB,EACjC,eAAe,CAAC,EAAE,gBAAgB,GACnC,yBAAyB,CAkF3B"}
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
import { getTechnicalSupportRecordTypeId } from '@rh-support/utils';
|
|
2
|
+
import { caseListSortColumnIdsToGraphQLMap } from '../enums/case';
|
|
3
|
+
import { SolrKeys, SolrPivotKeys } from '../enums/filters';
|
|
4
|
+
import { expandStatusGroupsToApiValues } from './statusUtils';
|
|
5
|
+
export function getOwnerFederationIdsToResolve(filterState) {
|
|
6
|
+
const { filterInfo } = filterState;
|
|
7
|
+
if (!filterInfo)
|
|
8
|
+
return [];
|
|
9
|
+
const ownerSso = filterInfo[SolrKeys.caseOwner];
|
|
10
|
+
const contactSso = filterInfo[SolrKeys.caseContactSSO];
|
|
11
|
+
return [...new Set([...(ownerSso || []), ...(contactSso || [])])];
|
|
12
|
+
}
|
|
13
|
+
function buildOrderByFromSortInfo(sortInfo) {
|
|
14
|
+
var _a;
|
|
15
|
+
if (!(sortInfo === null || sortInfo === void 0 ? void 0 : sortInfo.column))
|
|
16
|
+
return { LastModifiedDate: { order: 'DESC' } };
|
|
17
|
+
const gqlField = caseListSortColumnIdsToGraphQLMap[sortInfo.column];
|
|
18
|
+
if (!gqlField)
|
|
19
|
+
return { LastModifiedDate: { order: 'DESC' } };
|
|
20
|
+
return { [gqlField]: { order: ((_a = sortInfo.direction) === null || _a === void 0 ? void 0 : _a.toUpperCase()) || 'DESC' } };
|
|
21
|
+
}
|
|
22
|
+
function flattenAccountNumbers(accountFilters) {
|
|
23
|
+
const numbers = [];
|
|
24
|
+
accountFilters.forEach((item) => {
|
|
25
|
+
if (Array.isArray(item.key)) {
|
|
26
|
+
numbers.push(...item.key);
|
|
27
|
+
}
|
|
28
|
+
else if (item.key) {
|
|
29
|
+
numbers.push(item.key);
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
return [...new Set(numbers)];
|
|
33
|
+
}
|
|
34
|
+
function buildStatusFilter(statuses) {
|
|
35
|
+
if (!(statuses === null || statuses === void 0 ? void 0 : statuses.length))
|
|
36
|
+
return undefined;
|
|
37
|
+
const expandedStatuses = expandStatusGroupsToApiValues(statuses);
|
|
38
|
+
return { Status: { in: expandedStatuses } };
|
|
39
|
+
}
|
|
40
|
+
function buildProductFilter(products) {
|
|
41
|
+
const conditions = [];
|
|
42
|
+
const parentProductIds = [];
|
|
43
|
+
const childProductIds = [];
|
|
44
|
+
products.forEach((product) => {
|
|
45
|
+
const versions = product[SolrKeys.version];
|
|
46
|
+
if (versions === null || versions === void 0 ? void 0 : versions.length) {
|
|
47
|
+
let hasVersionIds = false;
|
|
48
|
+
versions.forEach((version) => {
|
|
49
|
+
if (version.productId) {
|
|
50
|
+
childProductIds.push(version.productId);
|
|
51
|
+
hasVersionIds = true;
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
// Fallback: if versions lack IDs (resolution failed), use parent product ID
|
|
55
|
+
if (!hasVersionIds && product.productId) {
|
|
56
|
+
parentProductIds.push(product.productId);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
else if (product.productId) {
|
|
60
|
+
parentProductIds.push(product.productId);
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
if (childProductIds.length) {
|
|
64
|
+
conditions.push({ ProductId: { in: childProductIds } });
|
|
65
|
+
}
|
|
66
|
+
if (parentProductIds.length) {
|
|
67
|
+
conditions.push({ Product: { ParentProduct__c: { in: parentProductIds } } });
|
|
68
|
+
}
|
|
69
|
+
return conditions;
|
|
70
|
+
}
|
|
71
|
+
function buildKeywordSearchFilter(queryString) {
|
|
72
|
+
if (!queryString)
|
|
73
|
+
return undefined;
|
|
74
|
+
const keyword = queryString.replace(/\*$/g, '').trim();
|
|
75
|
+
if (!keyword)
|
|
76
|
+
return undefined;
|
|
77
|
+
const caseNumberPattern = /^\d{8}$/;
|
|
78
|
+
if (caseNumberPattern.test(keyword)) {
|
|
79
|
+
return { CaseNumber__c: { eq: keyword } };
|
|
80
|
+
}
|
|
81
|
+
const likeValue = `%${keyword}%`;
|
|
82
|
+
return {
|
|
83
|
+
or: [{ Subject: { like: likeValue } }, { CaseNumber__c: { like: likeValue } }],
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
export function createGraphQLVariablesFromFilterState(filterState, resolvedUserIds) {
|
|
87
|
+
var _a;
|
|
88
|
+
const { paginationInfo, sortInfo, filterInfo, filterQueryInfo } = filterState;
|
|
89
|
+
const first = (paginationInfo === null || paginationInfo === void 0 ? void 0 : paginationInfo.pageSize) || 10;
|
|
90
|
+
const orderBy = buildOrderByFromSortInfo(sortInfo);
|
|
91
|
+
const andConditions = [];
|
|
92
|
+
if (filterInfo) {
|
|
93
|
+
const statusFilter = buildStatusFilter(filterInfo[SolrKeys.status]);
|
|
94
|
+
if (statusFilter)
|
|
95
|
+
andConditions.push(statusFilter);
|
|
96
|
+
const severities = filterInfo[SolrKeys.severity];
|
|
97
|
+
if (severities === null || severities === void 0 ? void 0 : severities.length) {
|
|
98
|
+
andConditions.push({ Priority: { in: severities } });
|
|
99
|
+
}
|
|
100
|
+
const accounts = filterInfo[SolrKeys.accountNumber];
|
|
101
|
+
if (accounts === null || accounts === void 0 ? void 0 : accounts.length) {
|
|
102
|
+
const accountNumbers = flattenAccountNumbers(accounts);
|
|
103
|
+
if (accountNumbers.length) {
|
|
104
|
+
andConditions.push({ Account_Number__c: { in: accountNumbers } });
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
// Product filter: uses stored parent/child Product2 IDs from filter state
|
|
108
|
+
const products = filterInfo[SolrPivotKeys.product_version];
|
|
109
|
+
if (products === null || products === void 0 ? void 0 : products.length) {
|
|
110
|
+
const productConditions = buildProductFilter(products);
|
|
111
|
+
if (productConditions.length === 1) {
|
|
112
|
+
andConditions.push(productConditions[0]);
|
|
113
|
+
}
|
|
114
|
+
else if (productConditions.length > 1) {
|
|
115
|
+
andConditions.push({ or: productConditions });
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
const types = filterInfo[SolrKeys.type];
|
|
119
|
+
if (types === null || types === void 0 ? void 0 : types.length) {
|
|
120
|
+
andConditions.push({ Type: { in: types } });
|
|
121
|
+
}
|
|
122
|
+
const createdBySso = filterInfo[SolrKeys.createdBySsoUsername];
|
|
123
|
+
const ssoOrConditions = [];
|
|
124
|
+
if ((_a = resolvedUserIds === null || resolvedUserIds === void 0 ? void 0 : resolvedUserIds.ownerUserIds) === null || _a === void 0 ? void 0 : _a.length) {
|
|
125
|
+
ssoOrConditions.push({ OwnerId: { in: resolvedUserIds.ownerUserIds } });
|
|
126
|
+
}
|
|
127
|
+
if (createdBySso === null || createdBySso === void 0 ? void 0 : createdBySso.length) {
|
|
128
|
+
ssoOrConditions.push({ CreatedBy: { FederationIdentifier: { in: createdBySso } } });
|
|
129
|
+
}
|
|
130
|
+
if (ssoOrConditions.length === 1) {
|
|
131
|
+
andConditions.push(ssoOrConditions[0]);
|
|
132
|
+
}
|
|
133
|
+
else if (ssoOrConditions.length > 1) {
|
|
134
|
+
andConditions.push({ or: ssoOrConditions });
|
|
135
|
+
}
|
|
136
|
+
// TODO: Add group filter (case_folderNumber) when GraphQL field is available
|
|
137
|
+
// TODO: Add case_alternate_id filter when GraphQL field is available
|
|
138
|
+
}
|
|
139
|
+
const escalation = filterInfo === null || filterInfo === void 0 ? void 0 : filterInfo[SolrKeys.escalation];
|
|
140
|
+
const technicalSupportId = getTechnicalSupportRecordTypeId();
|
|
141
|
+
if (technicalSupportId) {
|
|
142
|
+
andConditions.push({ RecordTypeId: { eq: technicalSupportId } });
|
|
143
|
+
}
|
|
144
|
+
if (escalation === null || escalation === void 0 ? void 0 : escalation.length) {
|
|
145
|
+
andConditions.push({ IsEscalated: { eq: true } });
|
|
146
|
+
}
|
|
147
|
+
if (filterQueryInfo === null || filterQueryInfo === void 0 ? void 0 : filterQueryInfo.queryString) {
|
|
148
|
+
const keywordFilter = buildKeywordSearchFilter(filterQueryInfo.queryString);
|
|
149
|
+
if (keywordFilter)
|
|
150
|
+
andConditions.push(keywordFilter);
|
|
151
|
+
}
|
|
152
|
+
let where;
|
|
153
|
+
if (andConditions.length === 1) {
|
|
154
|
+
where = andConditions[0];
|
|
155
|
+
}
|
|
156
|
+
else if (andConditions.length > 1) {
|
|
157
|
+
where = { and: andConditions };
|
|
158
|
+
}
|
|
159
|
+
return { first, where, orderBy };
|
|
160
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"caseSearchUtils.d.ts","sourceRoot":"","sources":["../../../src/utils/caseSearchUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,6CAA6C,CAAC;AACrG,OAAO,EAAE,QAAQ,EAAE,MAAM,wCAAwC,CAAC;AAClE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAEjE,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AAkBxD,OAAO,EACH,oBAAoB,EACpB,WAAW,EAId,MAAM,+CAA+C,CAAC;AAOvD,OAAO,EAEH,mBAAmB,EAEtB,MAAM,qBAAqB,CAAC;AAW7B,OAAO,EAA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,EAC5B,oBAAoB,KAAA,EACpB,aAAa,GAAE,MAAM,EAAO,EAC5B,UAAU,SAAI,EACd,UAAU,SAAO,OAoBpB;AAkBD,iBAAS,8BAA8B,CACnC,WAAW,EAAE,oBAAoB,EACjC,YAAY,EAAE,QAAQ,EACtB,mBAAmB,EAAE,OAAO,CAAC,QAAQ,CAAC,EACtC,aAAa,GAAE,MAAM,EAAO,GAC7B,OAAO,CAAC,eAAe,CAAC,CAkE1B;AAED,iBAAS,6BAA6B,CAAC,QAAQ,GAAE,qBAAqB,EAAO,GAAG,qBAAqB,EAAE,CAEtG;AAoBD,iBAAS,6BAA6B,CAAC,WAAW,EAAE,oBAAoB,UAUvE;AAED,iBAAS,6BAA6B,CAClC,QAAQ,EAAE,MAAM,EAChB,mBAAmB,EAAE,oBAAoB,EACzC,QAAQ,CAAC,EAAE,MAAM,EACjB,WAAW,CAAC,EAAE,MAAM,EACpB,UAAU,GAAE,mBAA+C,wBA0D9D;AAGD,iBAAS,kCAAkC,CACvC,WAAW,EAAE,MAAM,EACnB,mBAAmB,EAAE,oBAAoB,EACzC,kBAAkB,EAAE,oBAAoB,EACxC,WAAW,GAAE,MAAW,EACxB,IAAI,GAAE,mBAA+C,wBAmExD;AA0LD,OAAO,EACH,8BAA8B,EAC9B,sCAAsC,EACtC,oDAAoD,EACpD,yBAAyB,EACzB,8BAA8B,EAC9B,6BAA6B,EAC7B,6BAA6B,EAC7B,6BAA6B,EAC7B,wCAAwC,EACxC,kCAAkC,GACrC,CAAC"}
|
|
@@ -328,6 +328,7 @@ function createURLQueryFromFilterState(filterState) {
|
|
|
328
328
|
return finalQuery;
|
|
329
329
|
}
|
|
330
330
|
function createFilterStateFromUrlQuery(urlQuery, globalMetadataState, pageSize, currentPage, searchType = CaseSearchQueryType.BASIC) {
|
|
331
|
+
var _a;
|
|
331
332
|
const { paginationInfo: defaultPaginationInfo, sortInfo: defaultSortInfo, filterInfo: defaultFilterInfo, filterQueryInfo: defaultFilterQueryInfo, } = initialCaseFilterState;
|
|
332
333
|
const [filters = '', sortQuery] = (urlQuery || '').split(/orderBy/i);
|
|
333
334
|
const paginationInfoFromUrl = {
|
|
@@ -341,7 +342,7 @@ function createFilterStateFromUrlQuery(urlQuery, globalMetadataState, pageSize,
|
|
|
341
342
|
sortInfo = { column, direction: direction };
|
|
342
343
|
}
|
|
343
344
|
const filterInfo = {};
|
|
344
|
-
const
|
|
345
|
+
const _b = parseSolrQuery(filters), { keyword: queryString = [''] } = _b, restFilters = __rest(_b, ["keyword"]);
|
|
345
346
|
const filterQueryInfo = merge({}, defaultFilterQueryInfo, {
|
|
346
347
|
queryString: queryString[0].replace(/\\"/g, '"'),
|
|
347
348
|
type: searchType,
|
|
@@ -358,6 +359,9 @@ function createFilterStateFromUrlQuery(urlQuery, globalMetadataState, pageSize,
|
|
|
358
359
|
}
|
|
359
360
|
}
|
|
360
361
|
});
|
|
362
|
+
if ((_a = filterInfo[SolrPivotKeys.product_version]) === null || _a === void 0 ? void 0 : _a.length) {
|
|
363
|
+
enrichProductFilterWithIds(filterInfo[SolrPivotKeys.product_version], globalMetadataState);
|
|
364
|
+
}
|
|
361
365
|
const parsedQuery = filterQueryInfo.type === CaseSearchQueryType.ADVANCED
|
|
362
366
|
? createUserFriendlyQueryFromFilterStateAdvancedSearch(filterInfo, filterQueryInfo.queryString)
|
|
363
367
|
: '';
|
|
@@ -371,6 +375,7 @@ function createFilterStateFromUrlQuery(urlQuery, globalMetadataState, pageSize,
|
|
|
371
375
|
}
|
|
372
376
|
// advanced query
|
|
373
377
|
function createFilterStateFromAdvancedQuery(queryString, globalMetadataState, currentFilterState, parsedQuery = '', type = CaseSearchQueryType.BASIC) {
|
|
378
|
+
var _a;
|
|
374
379
|
const filterObj = parseSolrQuery(queryString);
|
|
375
380
|
const newFilterInfo = {};
|
|
376
381
|
let advanceToBasicQuery = [];
|
|
@@ -420,6 +425,9 @@ function createFilterStateFromAdvancedQuery(queryString, globalMetadataState, cu
|
|
|
420
425
|
}
|
|
421
426
|
delete newFilterInfo[SolrKeys.version];
|
|
422
427
|
}
|
|
428
|
+
if ((_a = newFilterInfo[SolrPivotKeys.product_version]) === null || _a === void 0 ? void 0 : _a.length) {
|
|
429
|
+
enrichProductFilterWithIds(newFilterInfo[SolrPivotKeys.product_version], globalMetadataState);
|
|
430
|
+
}
|
|
423
431
|
const filterState = Object.assign(Object.assign({}, currentFilterState), { filterQueryInfo: Object.assign(Object.assign({}, currentFilterState.filterQueryInfo), { queryString: advanceToBasicQuery.join(' AND '), parsedQuery,
|
|
424
432
|
type }), filterInfo: Object.assign(Object.assign({}, initialCaseFilterState.filterInfo), newFilterInfo) });
|
|
425
433
|
return filterState;
|
|
@@ -553,4 +561,21 @@ function generateProductVersionPivotValue(values) {
|
|
|
553
561
|
};
|
|
554
562
|
});
|
|
555
563
|
}
|
|
564
|
+
/**
|
|
565
|
+
* Enriches product filter objects (from URL) with their parent Product2 IDs
|
|
566
|
+
* by matching product names against the allProducts metadata loaded at startup.
|
|
567
|
+
* This allows buildProductFilter to use ParentProduct__c when version IDs aren't yet resolved.
|
|
568
|
+
*/
|
|
569
|
+
function enrichProductFilterWithIds(products, globalMetadataState) {
|
|
570
|
+
var _a, _b;
|
|
571
|
+
const allProductsList = ((_b = (_a = globalMetadataState === null || globalMetadataState === void 0 ? void 0 : globalMetadataState.allProducts) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.productsResult) || [];
|
|
572
|
+
products.forEach((prod) => {
|
|
573
|
+
if (prod.productId)
|
|
574
|
+
return;
|
|
575
|
+
const matched = allProductsList.find((p) => p.name === prod.value || p.product === prod.value);
|
|
576
|
+
if (matched === null || matched === void 0 ? void 0 : matched.productId) {
|
|
577
|
+
prod.productId = matched.productId;
|
|
578
|
+
}
|
|
579
|
+
});
|
|
580
|
+
}
|
|
556
581
|
export { createSolrQueryFromFilterState, createUserFriendlyQueryFromFilterState, createUserFriendlyQueryFromFilterStateAdvancedSearch, createQueryForCSVDownload, createSFDCQueryFromFilterState, mapSFDCCaseListToSolrCaseList, createURLQueryFromFilterState, createFilterStateFromUrlQuery, createAdvancedSearchQueryFromFilterState, createFilterStateFromAdvancedQuery, };
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
export declare const PORTAL_STATUS_GROUPS: Record<string, string[]>;
|
|
2
|
+
export declare const PORTAL_DISPLAY_STATUSES: string[];
|
|
1
3
|
export declare const filterNamesMap: {
|
|
2
4
|
readonly case_status: any;
|
|
3
5
|
readonly case_severity: any;
|
|
@@ -16,7 +18,6 @@ export declare const filterNamesMap: {
|
|
|
16
18
|
readonly case_createdby_sso_username: any;
|
|
17
19
|
readonly case_contact_sso_username: any;
|
|
18
20
|
readonly case_type: any;
|
|
19
|
-
readonly case_private: any;
|
|
20
21
|
readonly usernameFilterTitle: any;
|
|
21
22
|
};
|
|
22
23
|
export declare const UpdatedCaseDataEvent = "PCM-Next > case-list-data-background-refresh";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/utils/constants.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/utils/constants.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,oBAAoB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAYzD,CAAC;AAEF,eAAO,MAAM,uBAAuB,UAAoC,CAAC;AAIzE,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;CAuD1B,CAAC;AAEF,eAAO,MAAM,oBAAoB,iDAAiD,CAAC"}
|
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
import i18n from 'i18next';
|
|
2
2
|
import { SolrKeys } from '../enums/filters';
|
|
3
|
+
export const PORTAL_STATUS_GROUPS = {
|
|
4
|
+
'In Progress': [
|
|
5
|
+
'New',
|
|
6
|
+
'In Progress',
|
|
7
|
+
'Needs New Owner',
|
|
8
|
+
'Waiting on Collab',
|
|
9
|
+
'Waiting on Engineering',
|
|
10
|
+
'Waiting on Sales',
|
|
11
|
+
'Waiting on 3rd Party Vendor',
|
|
12
|
+
],
|
|
13
|
+
'Waiting on Customer': ['Waiting on Customer Action Required', 'Waiting on Customer Solution Delivered'],
|
|
14
|
+
Closed: ['Closed'],
|
|
15
|
+
};
|
|
16
|
+
export const PORTAL_DISPLAY_STATUSES = Object.keys(PORTAL_STATUS_GROUPS);
|
|
3
17
|
// used for adding title text for different solr fields
|
|
4
18
|
// test
|
|
5
19
|
export const filterNamesMap = {
|
|
@@ -54,9 +68,6 @@ export const filterNamesMap = {
|
|
|
54
68
|
get [SolrKeys.type]() {
|
|
55
69
|
return i18n.t('Support type');
|
|
56
70
|
},
|
|
57
|
-
get [SolrKeys.isPrivate]() {
|
|
58
|
-
return i18n.t('Private');
|
|
59
|
-
},
|
|
60
71
|
get usernameFilterTitle() {
|
|
61
72
|
return i18n.t('Username');
|
|
62
73
|
},
|
|
@@ -319,7 +319,7 @@ export const mockSolrResponse = {
|
|
|
319
319
|
'dfisher dummy test',
|
|
320
320
|
0,
|
|
321
321
|
],
|
|
322
|
-
case_severity: ['1 (Urgent)', 2335, '2 (High)', 158, '3 (
|
|
322
|
+
case_severity: ['1 (Urgent)', 2335, '2 (High)', 158, '3 (Medium)', 5984, '4 (Low)', 9338],
|
|
323
323
|
case_status: ['Closed', 6348, 'Waiting on Customer', 8, 'Waiting on Red Hat', 11459],
|
|
324
324
|
},
|
|
325
325
|
facet_ranges: {},
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"statusUtils.d.ts","sourceRoot":"","sources":["../../../src/utils/statusUtils.ts"],"names":[],"mappings":"AAEA,wBAAgB,6BAA6B,CAAC,gBAAgB,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAWlF;AAED,wBAAgB,2BAA2B,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAOtE"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { PORTAL_STATUS_GROUPS } from './constants';
|
|
2
|
+
export function expandStatusGroupsToApiValues(selectedStatuses) {
|
|
3
|
+
const expanded = [];
|
|
4
|
+
selectedStatuses.forEach((status) => {
|
|
5
|
+
const group = PORTAL_STATUS_GROUPS[status];
|
|
6
|
+
if (group) {
|
|
7
|
+
expanded.push(...group);
|
|
8
|
+
}
|
|
9
|
+
else {
|
|
10
|
+
expanded.push(status);
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
return expanded;
|
|
14
|
+
}
|
|
15
|
+
export function mapSfdcStatusToPortalStatus(sfdcStatus) {
|
|
16
|
+
for (const [portalStatus, sfdcStatuses] of Object.entries(PORTAL_STATUS_GROUPS)) {
|
|
17
|
+
if (sfdcStatuses.includes(sfdcStatus)) {
|
|
18
|
+
return portalStatus;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
return sfdcStatus;
|
|
22
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rh-support/cases",
|
|
3
|
-
"version": "2.6.
|
|
3
|
+
"version": "2.6.178",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public",
|
|
6
6
|
"registry": "https://registry.npmjs.org"
|
|
@@ -40,16 +40,17 @@
|
|
|
40
40
|
"@patternfly/react-core": "6.2.1",
|
|
41
41
|
"@patternfly/react-table": "6.2.1",
|
|
42
42
|
"@rh-support/components": "2.5.165",
|
|
43
|
-
"@rh-support/react-context": "2.5.
|
|
43
|
+
"@rh-support/react-context": "2.5.268",
|
|
44
44
|
"@rh-support/types": "2.0.26",
|
|
45
|
-
"@rh-support/user-permissions": "2.5.
|
|
46
|
-
"@rh-support/utils": "2.5.
|
|
45
|
+
"@rh-support/user-permissions": "2.5.122",
|
|
46
|
+
"@rh-support/utils": "2.5.105",
|
|
47
47
|
"localforage": "^1.10.0",
|
|
48
48
|
"lodash": "^4.17.21",
|
|
49
49
|
"pegjs": "^0.10.0",
|
|
50
50
|
"react": "18.2.0",
|
|
51
51
|
"react-dom": "18.2.0",
|
|
52
52
|
"react-i18next": "15.6.0",
|
|
53
|
+
"react-intersection-observer": "^10.0.3",
|
|
53
54
|
"react-router-dom": "^5.1.2",
|
|
54
55
|
"solr-query-builder": "1.0.1"
|
|
55
56
|
},
|
|
@@ -92,5 +93,5 @@
|
|
|
92
93
|
"defaults and supports es6-module",
|
|
93
94
|
"maintained node versions"
|
|
94
95
|
],
|
|
95
|
-
"gitHead": "
|
|
96
|
+
"gitHead": "2b2c0e7650d4c5d94856ae246c3e5a6c7ae9e75d"
|
|
96
97
|
}
|