@rh-support/cases 2.6.187 → 2.6.189
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/case-list-filters/AccountsFilter.js +1 -1
- package/lib/esm/components/case-list/case-list-filters/GroupsFilter.js +1 -1
- package/lib/esm/components/case-list/case-list-filters/VersionsFilter.js +1 -1
- package/lib/esm/components/case-list/case-search/advance-search-modal/ProductVersionDrilldownSelect.js +1 -1
- package/lib/esm/enums/case.js +1 -1
- package/lib/esm/utils/caseListGraphQLUtils.js +8 -8
- package/lib/esm/utils/caseListMapper.js +1 -1
- package/lib/esm/utils/caseListVariablesBuilder.d.ts +1 -1
- package/lib/esm/utils/caseListVariablesBuilder.d.ts.map +1 -1
- package/lib/esm/utils/caseListVariablesBuilder.js +9 -9
- package/package.json +6 -6
|
@@ -83,7 +83,7 @@ export function AccountsFilter(props) {
|
|
|
83
83
|
},
|
|
84
84
|
fetchPolicy: 'network-only',
|
|
85
85
|
});
|
|
86
|
-
const edges = (_d = (_c = (_b = (_a = data === null || data === void 0 ? void 0 : data.
|
|
86
|
+
const edges = (_d = (_c = (_b = (_a = data === null || data === void 0 ? void 0 : data.redhat_support_uiapi) === null || _a === void 0 ? void 0 : _a.query) === null || _b === void 0 ? void 0 : _b.RedHatSupportAccount) === null || _c === void 0 ? void 0 : _c.edges) !== null && _d !== void 0 ? _d : [];
|
|
87
87
|
const keyValueMap = edges.map((edge) => ({
|
|
88
88
|
key: edge.node.AccountNumber.value,
|
|
89
89
|
value: edge.node.Name.value,
|
|
@@ -39,7 +39,7 @@ export function GroupsFilter({ selectedGroups: controlledSelectedGroups, onGroup
|
|
|
39
39
|
})
|
|
40
40
|
.then(({ data }) => {
|
|
41
41
|
var _a, _b, _c, _d;
|
|
42
|
-
const edges = (_d = (_c = (_b = (_a = data === null || data === void 0 ? void 0 : data.
|
|
42
|
+
const edges = (_d = (_c = (_b = (_a = data === null || data === void 0 ? void 0 : data.redhat_support_uiapi) === null || _a === void 0 ? void 0 : _a.query) === null || _b === void 0 ? void 0 : _b.RedHatSupportCaseGroup__c) === null || _c === void 0 ? void 0 : _c.edges) !== null && _d !== void 0 ? _d : [];
|
|
43
43
|
setCaseGroups(handleGraphQLCaseGroupsResponse(edges));
|
|
44
44
|
})
|
|
45
45
|
.catch((err) => {
|
|
@@ -40,7 +40,7 @@ export function VersionsFilter({ productInfo }) {
|
|
|
40
40
|
})
|
|
41
41
|
.then(({ data }) => {
|
|
42
42
|
var _a, _b, _c, _d;
|
|
43
|
-
const edges = (_d = (_c = (_b = (_a = data === null || data === void 0 ? void 0 : data.
|
|
43
|
+
const edges = (_d = (_c = (_b = (_a = data === null || data === void 0 ? void 0 : data.redhat_support_uiapi) === null || _a === void 0 ? void 0 : _a.query) === null || _b === void 0 ? void 0 : _b.RedHatSupportProduct2) === null || _c === void 0 ? void 0 : _c.edges) !== null && _d !== void 0 ? _d : [];
|
|
44
44
|
const versionData = handleGraphQLVersionsResponse(edges, productObj.name || productInfo.value);
|
|
45
45
|
setFetchedVersions(versionData);
|
|
46
46
|
})
|
|
@@ -103,7 +103,7 @@ export function ProductVersionDrilldownSelect({ products, onChange }) {
|
|
|
103
103
|
})
|
|
104
104
|
.then(({ data }) => {
|
|
105
105
|
var _a, _b, _c, _d;
|
|
106
|
-
const edges = (_d = (_c = (_b = (_a = data === null || data === void 0 ? void 0 : data.
|
|
106
|
+
const edges = (_d = (_c = (_b = (_a = data === null || data === void 0 ? void 0 : data.redhat_support_uiapi) === null || _a === void 0 ? void 0 : _a.query) === null || _b === void 0 ? void 0 : _b.RedHatSupportProduct2) === null || _c === void 0 ? void 0 : _c.edges) !== null && _d !== void 0 ? _d : [];
|
|
107
107
|
const versionData = handleGraphQLVersionsResponse(edges, product.name);
|
|
108
108
|
const sortedVersions = [...versionData].sort((versionA, versionB) => compareVersions(versionA.name, versionB.name));
|
|
109
109
|
setVersionsByProductId((previousState) => (Object.assign(Object.assign({}, previousState), { [product.productId]: sortedVersions })));
|
package/lib/esm/enums/case.js
CHANGED
|
@@ -59,7 +59,7 @@ export const caseListSortColumnIdsToSFDCMap = {
|
|
|
59
59
|
[CaseListColumnIds.type]: SFDCKeys.caseType,
|
|
60
60
|
[CaseListColumnIds.caseClosedDate]: SFDCKeys.caseClosedDate,
|
|
61
61
|
};
|
|
62
|
-
// Maps CaseListColumnIds to GraphQL
|
|
62
|
+
// Maps CaseListColumnIds to GraphQL RedHatSupportCase_OrderBy field paths
|
|
63
63
|
export const caseListSortColumnIdsToGraphQLMap = {
|
|
64
64
|
[CaseListColumnIds.caseId]: 'CaseNumber',
|
|
65
65
|
[CaseListColumnIds.summary]: 'Subject',
|
|
@@ -13,8 +13,8 @@ import { mapGraphQLResponseToCaseList } from './caseListMapper';
|
|
|
13
13
|
import { createGraphQLVariablesFromFilterState, getOwnerFederationIdsToResolve, } from './caseListVariablesBuilder';
|
|
14
14
|
const pageCursors = new Map();
|
|
15
15
|
/**
|
|
16
|
-
* Workaround step 1 for Assigned To (case OwnerId): lookup
|
|
17
|
-
*
|
|
16
|
+
* Workaround step 1 for Assigned To (case OwnerId): lookup RedHatSupportUser and
|
|
17
|
+
* RedHatSupportGroup IDs by federation ID or name. Pre-resolved here and passed into
|
|
18
18
|
* createGraphQLVariablesFromFilterState as OwnerId — do not use nested Owner filters on the case where clause.
|
|
19
19
|
*/
|
|
20
20
|
function resolveOwnerIds(searchTerms, apolloClient) {
|
|
@@ -42,7 +42,7 @@ function resolveOwnerIds(searchTerms, apolloClient) {
|
|
|
42
42
|
fetchPolicy: 'network-only',
|
|
43
43
|
}),
|
|
44
44
|
]);
|
|
45
|
-
const userEdges = ((_d = (_c = (_b = (_a = userResult.data) === null || _a === void 0 ? void 0 : _a.
|
|
45
|
+
const userEdges = ((_d = (_c = (_b = (_a = userResult.data) === null || _a === void 0 ? void 0 : _a.redhat_support_uiapi) === null || _b === void 0 ? void 0 : _b.query) === null || _c === void 0 ? void 0 : _c.RedHatSupportUser) === null || _d === void 0 ? void 0 : _d.edges) || [];
|
|
46
46
|
userEdges.forEach((edge) => {
|
|
47
47
|
var _a, _b, _c;
|
|
48
48
|
const federationId = (_b = (_a = edge.node) === null || _a === void 0 ? void 0 : _a.FederationIdentifier) === null || _b === void 0 ? void 0 : _b.value;
|
|
@@ -50,7 +50,7 @@ function resolveOwnerIds(searchTerms, apolloClient) {
|
|
|
50
50
|
ownerIds.push(edge.node.Id);
|
|
51
51
|
}
|
|
52
52
|
});
|
|
53
|
-
const groupEdges = ((_h = (_g = (_f = (_e = groupResult.data) === null || _e === void 0 ? void 0 : _e.
|
|
53
|
+
const groupEdges = ((_h = (_g = (_f = (_e = groupResult.data) === null || _e === void 0 ? void 0 : _e.redhat_support_uiapi) === null || _f === void 0 ? void 0 : _f.query) === null || _g === void 0 ? void 0 : _g.RedHatSupportGroup) === null || _h === void 0 ? void 0 : _h.edges) || [];
|
|
54
54
|
groupEdges.forEach((edge) => {
|
|
55
55
|
var _a;
|
|
56
56
|
if ((_a = edge.node) === null || _a === void 0 ? void 0 : _a.Id) {
|
|
@@ -102,7 +102,7 @@ function resolveVersionProductIds(filterState, apolloClient) {
|
|
|
102
102
|
},
|
|
103
103
|
fetchPolicy: 'cache-first',
|
|
104
104
|
});
|
|
105
|
-
const parentEdges = (_e = (_d = (_c = (_b = prodData === null || prodData === void 0 ? void 0 : prodData.
|
|
105
|
+
const parentEdges = (_e = (_d = (_c = (_b = prodData === null || prodData === void 0 ? void 0 : prodData.redhat_support_uiapi) === null || _b === void 0 ? void 0 : _b.query) === null || _c === void 0 ? void 0 : _c.RedHatSupportProduct2) === null || _d === void 0 ? void 0 : _d.edges) !== null && _e !== void 0 ? _e : [];
|
|
106
106
|
if (parentEdges.length > 0) {
|
|
107
107
|
product.productId = parentEdges[0].node.Id;
|
|
108
108
|
}
|
|
@@ -128,7 +128,7 @@ function resolveVersionProductIds(filterState, apolloClient) {
|
|
|
128
128
|
},
|
|
129
129
|
fetchPolicy: 'cache-first',
|
|
130
130
|
});
|
|
131
|
-
const edges = (_j = (_h = (_g = (_f = data === null || data === void 0 ? void 0 : data.
|
|
131
|
+
const edges = (_j = (_h = (_g = (_f = data === null || data === void 0 ? void 0 : data.redhat_support_uiapi) === null || _f === void 0 ? void 0 : _f.query) === null || _g === void 0 ? void 0 : _g.RedHatSupportProduct2) === null || _h === void 0 ? void 0 : _h.edges) !== null && _j !== void 0 ? _j : [];
|
|
132
132
|
const childProducts = edges.map((edge) => ({
|
|
133
133
|
id: edge.node.Id,
|
|
134
134
|
name: edge.node.Name.value,
|
|
@@ -188,7 +188,7 @@ export function getCaseListFromGraphQL(filterState, apolloClient, limitOverride,
|
|
|
188
188
|
fetchPolicy: 'network-only',
|
|
189
189
|
context: signal ? { fetchOptions: { signal } } : undefined,
|
|
190
190
|
});
|
|
191
|
-
const connection = (_d = (_c = data === null || data === void 0 ? void 0 : data.
|
|
191
|
+
const connection = (_d = (_c = data === null || data === void 0 ? void 0 : data.redhat_support_uiapi) === null || _c === void 0 ? void 0 : _c.query) === null || _d === void 0 ? void 0 : _d.RedHatSupportCase;
|
|
192
192
|
if (!connection) {
|
|
193
193
|
return {
|
|
194
194
|
caseListResponse: { response: { docs: [], numFound: 0, start: 0 } },
|
|
@@ -258,7 +258,7 @@ export function loadMoreCases(filterState, apolloClient, afterCursor, signal) {
|
|
|
258
258
|
fetchPolicy: 'network-only',
|
|
259
259
|
context: signal ? { fetchOptions: { signal } } : undefined,
|
|
260
260
|
});
|
|
261
|
-
const connection = (_b = (_a = data === null || data === void 0 ? void 0 : data.
|
|
261
|
+
const connection = (_b = (_a = data === null || data === void 0 ? void 0 : data.redhat_support_uiapi) === null || _a === void 0 ? void 0 : _a.query) === null || _b === void 0 ? void 0 : _b.RedHatSupportCase;
|
|
262
262
|
if (!connection) {
|
|
263
263
|
return { docs: [], hasNextPage: false, endCursor: undefined };
|
|
264
264
|
}
|
|
@@ -15,7 +15,7 @@ export function mapGraphQLCaseToCaseListItem(node) {
|
|
|
15
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
16
|
case_type: ((_o = node.Type) === null || _o === void 0 ? void 0 : _o.value) || '',
|
|
17
17
|
case_accountNumber: ((_p = node.Account_Number__c) === null || _p === void 0 ? void 0 : _p.value) || '',
|
|
18
|
-
case_contactName: ((_r = (_q = node.
|
|
18
|
+
case_contactName: ((_r = (_q = node.RedHatSupportContact) === null || _q === void 0 ? void 0 : _q.Name) === null || _r === void 0 ? void 0 : _r.value) || '',
|
|
19
19
|
case_owner: ((_t = (_s = node.Owner) === null || _s === void 0 ? void 0 : _s.Name) === null || _t === void 0 ? void 0 : _t.value) || '',
|
|
20
20
|
case_createdByName: ((_v = (_u = node.CreatedBy) === null || _u === void 0 ? void 0 : _u.Name) === null || _v === void 0 ? void 0 : _v.value) || '',
|
|
21
21
|
case_createdDate: ((_w = node.CreatedDate) === null || _w === void 0 ? void 0 : _w.value) || '',
|
|
@@ -8,7 +8,7 @@ export interface IGraphQLCaseListVariables {
|
|
|
8
8
|
orderBy?: Record<string, unknown>;
|
|
9
9
|
}
|
|
10
10
|
export interface IResolvedUserIds {
|
|
11
|
-
/** Pre-resolved OwnerId values (
|
|
11
|
+
/** Pre-resolved OwnerId values (RedHatSupportUser or RedHatSupportGroup). */
|
|
12
12
|
ownerUserIds?: string[];
|
|
13
13
|
}
|
|
14
14
|
export declare function createGraphQLVariablesFromFilterState(filterState: ICaseListFilterState, apolloClient: ApolloClient, resolvedUserIds?: IResolvedUserIds): Promise<IGraphQLCaseListVariables>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"caseListVariablesBuilder.d.ts","sourceRoot":"","sources":["../../../src/utils/caseListVariablesBuilder.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAQnD,OAAO,EAEH,oBAAoB,EAEvB,MAAM,+CAA+C,CAAC;AAMvD,wBAAgB,8BAA8B,CAAC,WAAW,EAAE,oBAAoB,GAAG,MAAM,EAAE,CAW1F;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,
|
|
1
|
+
{"version":3,"file":"caseListVariablesBuilder.d.ts","sourceRoot":"","sources":["../../../src/utils/caseListVariablesBuilder.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAQnD,OAAO,EAEH,oBAAoB,EAEvB,MAAM,+CAA+C,CAAC;AAMvD,wBAAgB,8BAA8B,CAAC,WAAW,EAAE,oBAAoB,GAAG,MAAM,EAAE,CAW1F;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,6EAA6E;IAC7E,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;CAC3B;AA0SD,wBAAsB,qCAAqC,CACvD,WAAW,EAAE,oBAAoB,EACjC,YAAY,EAAE,YAAY,EAC1B,eAAe,CAAC,EAAE,gBAAgB,GACnC,OAAO,CAAC,yBAAyB,CAAC,CA4HpC"}
|
|
@@ -127,21 +127,21 @@ function buildIdFilter(fieldName, ids, filterRequested = false) {
|
|
|
127
127
|
}
|
|
128
128
|
return { [fieldName]: { in: uniqueIds } };
|
|
129
129
|
}
|
|
130
|
-
function
|
|
130
|
+
function buildRedHatSupportUserMatch(value) {
|
|
131
131
|
return {
|
|
132
132
|
or: [{ FederationIdentifier: { eq: value } }, { Name: { like: `%${value}%` } }],
|
|
133
133
|
};
|
|
134
134
|
}
|
|
135
|
-
function
|
|
135
|
+
function buildRedHatSupportUserReferenceFilter(fieldName, values) {
|
|
136
136
|
if (!(values === null || values === void 0 ? void 0 : values.length)) {
|
|
137
137
|
return undefined;
|
|
138
138
|
}
|
|
139
139
|
if (values.length === 1) {
|
|
140
|
-
return { [fieldName]:
|
|
140
|
+
return { [fieldName]: buildRedHatSupportUserMatch(values[0]) };
|
|
141
141
|
}
|
|
142
142
|
return {
|
|
143
143
|
or: values.map((value) => ({
|
|
144
|
-
[fieldName]:
|
|
144
|
+
[fieldName]: buildRedHatSupportUserMatch(value),
|
|
145
145
|
})),
|
|
146
146
|
};
|
|
147
147
|
}
|
|
@@ -184,7 +184,7 @@ function resolveContactIdsBySearchTerms(searchTerms, apolloClient) {
|
|
|
184
184
|
},
|
|
185
185
|
fetchPolicy: 'cache-first',
|
|
186
186
|
});
|
|
187
|
-
const edges = ((_c = (_b = (_a = data === null || data === void 0 ? void 0 : data.
|
|
187
|
+
const edges = ((_c = (_b = (_a = data === null || data === void 0 ? void 0 : data.redhat_support_uiapi) === null || _a === void 0 ? void 0 : _a.query) === null || _b === void 0 ? void 0 : _b.RedHatSupportContact) === null || _c === void 0 ? void 0 : _c.edges) || [];
|
|
188
188
|
edges.forEach((edge) => {
|
|
189
189
|
var _a, _b, _c;
|
|
190
190
|
const ssoUsername = (_b = (_a = edge.node) === null || _a === void 0 ? void 0 : _a.SSOUserName__c) === null || _b === void 0 ? void 0 : _b.value;
|
|
@@ -224,7 +224,7 @@ function resolveOwnerUserIdsBySearchTerms(searchTerms, apolloClient) {
|
|
|
224
224
|
},
|
|
225
225
|
fetchPolicy: 'cache-first',
|
|
226
226
|
});
|
|
227
|
-
const edges = ((_c = (_b = (_a = data === null || data === void 0 ? void 0 : data.
|
|
227
|
+
const edges = ((_c = (_b = (_a = data === null || data === void 0 ? void 0 : data.redhat_support_uiapi) === null || _a === void 0 ? void 0 : _a.query) === null || _b === void 0 ? void 0 : _b.RedHatSupportUser) === null || _c === void 0 ? void 0 : _c.edges) || [];
|
|
228
228
|
edges.forEach((edge) => {
|
|
229
229
|
var _a, _b, _c;
|
|
230
230
|
const federationId = (_b = (_a = edge.node) === null || _a === void 0 ? void 0 : _a.FederationIdentifier) === null || _b === void 0 ? void 0 : _b.value;
|
|
@@ -263,7 +263,7 @@ function resolveOwnerGroupIdsBySearchTerms(searchTerms, apolloClient) {
|
|
|
263
263
|
},
|
|
264
264
|
fetchPolicy: 'cache-first',
|
|
265
265
|
});
|
|
266
|
-
const edges = ((_c = (_b = (_a = data === null || data === void 0 ? void 0 : data.
|
|
266
|
+
const edges = ((_c = (_b = (_a = data === null || data === void 0 ? void 0 : data.redhat_support_uiapi) === null || _a === void 0 ? void 0 : _a.query) === null || _b === void 0 ? void 0 : _b.RedHatSupportGroup) === null || _c === void 0 ? void 0 : _c.edges) || [];
|
|
267
267
|
edges.forEach((edge) => {
|
|
268
268
|
var _a;
|
|
269
269
|
if ((_a = edge.node) === null || _a === void 0 ? void 0 : _a.Id) {
|
|
@@ -343,11 +343,11 @@ export function createGraphQLVariablesFromFilterState(filterState, apolloClient,
|
|
|
343
343
|
if (ownerIdFilter) {
|
|
344
344
|
andConditions.push(ownerIdFilter);
|
|
345
345
|
}
|
|
346
|
-
const createdByFilter =
|
|
346
|
+
const createdByFilter = buildRedHatSupportUserReferenceFilter('CreatedBy', createdByValues);
|
|
347
347
|
if (createdByFilter) {
|
|
348
348
|
andConditions.push(createdByFilter);
|
|
349
349
|
}
|
|
350
|
-
const lastModifiedByFilter =
|
|
350
|
+
const lastModifiedByFilter = buildRedHatSupportUserReferenceFilter('LastModifiedBy', modifiedByValues);
|
|
351
351
|
if (lastModifiedByFilter) {
|
|
352
352
|
andConditions.push(lastModifiedByFilter);
|
|
353
353
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rh-support/cases",
|
|
3
|
-
"version": "2.6.
|
|
3
|
+
"version": "2.6.189",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public",
|
|
6
6
|
"registry": "https://registry.npmjs.org"
|
|
@@ -38,11 +38,11 @@
|
|
|
38
38
|
"@patternfly/patternfly": "6.2.1",
|
|
39
39
|
"@patternfly/react-core": "6.2.1",
|
|
40
40
|
"@patternfly/react-table": "6.2.1",
|
|
41
|
-
"@rh-support/components": "2.5.
|
|
42
|
-
"@rh-support/react-context": "2.5.
|
|
41
|
+
"@rh-support/components": "2.5.185",
|
|
42
|
+
"@rh-support/react-context": "2.5.279",
|
|
43
43
|
"@rh-support/types": "2.0.26",
|
|
44
|
-
"@rh-support/user-permissions": "2.5.
|
|
45
|
-
"@rh-support/utils": "2.5.
|
|
44
|
+
"@rh-support/user-permissions": "2.5.131",
|
|
45
|
+
"@rh-support/utils": "2.5.113",
|
|
46
46
|
"localforage": "^1.10.0",
|
|
47
47
|
"lodash": "^4.17.21",
|
|
48
48
|
"pegjs": "^0.10.0",
|
|
@@ -92,5 +92,5 @@
|
|
|
92
92
|
"defaults and supports es6-module",
|
|
93
93
|
"maintained node versions"
|
|
94
94
|
],
|
|
95
|
-
"gitHead": "
|
|
95
|
+
"gitHead": "4e6af2167e2c8cc3a0b949a41f1e82c1b7ca1d0a"
|
|
96
96
|
}
|