@rh-support/cases 0.2.73 → 0.2.74-beta.2
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-table/ExportCaseListCSV.d.ts.map +1 -1
- package/lib/esm/components/case-list/case-list-table/ExportCaseListCSV.js +2 -1
- package/lib/esm/utils/caseListUtils.js +9 -9
- package/lib/esm/utils/caseSearchUtils.d.ts.map +1 -1
- package/lib/esm/utils/caseSearchUtils.js +0 -7
- package/package.json +9 -9
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExportCaseListCSV.d.ts","sourceRoot":"","sources":["../../../../../src/components/case-list/case-list-table/ExportCaseListCSV.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAMzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAgD7D,UAAU,MAAM;IACZ,uBAAuB,EAAE,aAAa,CAAC,iBAAiB,CAAC,CAAC;CAC7D;AAID,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"ExportCaseListCSV.d.ts","sourceRoot":"","sources":["../../../../../src/components/case-list/case-list-table/ExportCaseListCSV.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAMzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAgD7D,UAAU,MAAM;IACZ,uBAAuB,EAAE,aAAa,CAAC,iBAAiB,CAAC,CAAC;CAC7D;AAID,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,eA2E9C"}
|
|
@@ -87,9 +87,10 @@ export function ExportCaseListCSV(props) {
|
|
|
87
87
|
ToastNotification.addDangerMessage(t('Could not export CSV'));
|
|
88
88
|
}
|
|
89
89
|
});
|
|
90
|
+
const partnerSearch = loggedInUserRights.data.hasManagedAccounts();
|
|
90
91
|
const onExportCSVClick = () => __awaiter(this, void 0, void 0, function* () {
|
|
91
92
|
try {
|
|
92
|
-
const res = yield request(createQueryForCSVDownload(filterState, loggedInUserRights.data, loggedInUsersAccount.data),
|
|
93
|
+
const res = yield request(createQueryForCSVDownload(filterState, loggedInUserRights.data, loggedInUsersAccount.data), partnerSearch, null, loggedInUsersAccount.data.secureSupport);
|
|
93
94
|
const headers = isOrgAdmin ? [...csvHeadersSolr, groupHeaderSOLR] : csvHeadersSolr;
|
|
94
95
|
downloadCSV(res.response.docs, headers, 'CaseList.csv');
|
|
95
96
|
}
|
|
@@ -37,14 +37,14 @@ const throwErrorOnAbort = (message) => {
|
|
|
37
37
|
// Even though SFDC support most of the filters but another problem with SFDC is it doesnot support multiple values for a praticular filter.
|
|
38
38
|
// if user applies any filter apart from default filter we will always call solr and assume that(not safely) 10 sec scenario is not bound to happen.
|
|
39
39
|
export function getCaseList(filterState, loggedInUser, loggedInUserAccount, abortSignal) {
|
|
40
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j
|
|
40
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
41
41
|
return __awaiter(this, void 0, void 0, function* () {
|
|
42
42
|
let isSolrSearchDownSFDCUp = false;
|
|
43
43
|
let showErrorMessage = false;
|
|
44
44
|
let caseListResponse;
|
|
45
45
|
const solrFilter = createSolrQueryFromFilterState(filterState, loggedInUser);
|
|
46
|
-
const partnerSearch = loggedInUser.hasManagedAccounts()
|
|
47
|
-
const isSfdcSearchRequired = canDoSfdcSearch(filterState) && !filterState.filterQueryInfo.queryString;
|
|
46
|
+
const partnerSearch = loggedInUser.hasManagedAccounts();
|
|
47
|
+
const isSfdcSearchRequired = canDoSfdcSearch(filterState) && !filterState.filterQueryInfo.queryString && !partnerSearch;
|
|
48
48
|
let solrPromise = getCaseListFromSolr(solrFilter, partnerSearch, abortSignal, loggedInUserAccount === null || loggedInUserAccount === void 0 ? void 0 : loggedInUserAccount.secureSupport);
|
|
49
49
|
const sfdcAPICall = () => publicApi.caseList.getCaseListFromSFDC(createSFDCQueryFromFilterState(filterState, loggedInUser, loggedInUserAccount, isNoFilterApplied(filterState)), partnerSearch, loggedInUserAccount === null || loggedInUserAccount === void 0 ? void 0 : loggedInUserAccount.secureSupport, abortSignal);
|
|
50
50
|
const sfdcPromise = isSfdcSearchRequired ? sfdcAPICall() : Promise.resolve(undefined);
|
|
@@ -54,8 +54,8 @@ export function getCaseList(filterState, loggedInUser, loggedInUserAccount, abor
|
|
|
54
54
|
throwErrorOnAbort(solrResponse === null || solrResponse === void 0 ? void 0 : solrResponse.e.message);
|
|
55
55
|
if (sfdcResponse.e)
|
|
56
56
|
throwErrorOnAbort(sfdcResponse === null || sfdcResponse === void 0 ? void 0 : sfdcResponse.e.message);
|
|
57
|
-
const solrFullfilled = !!(solrResponse.status === 'fulfilled' && ((
|
|
58
|
-
let sfdcFullfilled = !!(sfdcResponse.status === 'fulfilled' && ((
|
|
57
|
+
const solrFullfilled = !!(solrResponse.status === 'fulfilled' && ((_a = solrResponse.v) === null || _a === void 0 ? void 0 : _a.response));
|
|
58
|
+
let sfdcFullfilled = !!(sfdcResponse.status === 'fulfilled' && ((_b = sfdcResponse.v) === null || _b === void 0 ? void 0 : _b.cases));
|
|
59
59
|
const sfdcCallIsMadeAndFailed = !sfdcFullfilled && isSfdcSearchRequired;
|
|
60
60
|
const sfdcCallNotMade = !sfdcFullfilled && !isSfdcSearchRequired;
|
|
61
61
|
if (!solrFullfilled && sfdcCallIsMadeAndFailed) {
|
|
@@ -65,10 +65,10 @@ export function getCaseList(filterState, loggedInUser, loggedInUserAccount, abor
|
|
|
65
65
|
// SFDC call didn't make because we had filters that SFDC doesn't support
|
|
66
66
|
try {
|
|
67
67
|
const sfdcRes = yield promiseReflection(sfdcAPICall());
|
|
68
|
-
sfdcFullfilled = !!(sfdcRes.status === 'fulfilled' && ((
|
|
68
|
+
sfdcFullfilled = !!(sfdcRes.status === 'fulfilled' && ((_c = sfdcRes.v) === null || _c === void 0 ? void 0 : _c.cases));
|
|
69
69
|
if (sfdcFullfilled) {
|
|
70
70
|
isSolrSearchDownSFDCUp = true;
|
|
71
|
-
const mappedSfdcRes = mapSFDCCaseListToSolrCaseList((
|
|
71
|
+
const mappedSfdcRes = mapSFDCCaseListToSolrCaseList((_e = (_d = sfdcRes === null || sfdcRes === void 0 ? void 0 : sfdcRes.v) === null || _d === void 0 ? void 0 : _d.cases) !== null && _e !== void 0 ? _e : []);
|
|
72
72
|
caseListResponse = {
|
|
73
73
|
response: {
|
|
74
74
|
docs: mappedSfdcRes,
|
|
@@ -85,7 +85,7 @@ export function getCaseList(filterState, loggedInUser, loggedInUserAccount, abor
|
|
|
85
85
|
}
|
|
86
86
|
else if (solrFullfilled && sfdcFullfilled) {
|
|
87
87
|
caseListResponse = Object.assign(Object.assign({}, solrResponse.v), { response: {
|
|
88
|
-
docs: mapSFDCCaseListToSolrCaseList((
|
|
88
|
+
docs: mapSFDCCaseListToSolrCaseList((_g = (_f = sfdcResponse === null || sfdcResponse === void 0 ? void 0 : sfdcResponse.v) === null || _f === void 0 ? void 0 : _f.cases) !== null && _g !== void 0 ? _g : []),
|
|
89
89
|
numFound: sfdcResponse.v.totalCount,
|
|
90
90
|
} });
|
|
91
91
|
}
|
|
@@ -93,7 +93,7 @@ export function getCaseList(filterState, loggedInUser, loggedInUserAccount, abor
|
|
|
93
93
|
isSolrSearchDownSFDCUp = true;
|
|
94
94
|
caseListResponse = {
|
|
95
95
|
response: {
|
|
96
|
-
docs: mapSFDCCaseListToSolrCaseList((
|
|
96
|
+
docs: mapSFDCCaseListToSolrCaseList((_j = (_h = sfdcResponse === null || sfdcResponse === void 0 ? void 0 : sfdcResponse.v) === null || _h === void 0 ? void 0 : _h.cases) !== null && _j !== void 0 ? _j : []),
|
|
97
97
|
numFound: sfdcResponse.v.totalCount,
|
|
98
98
|
},
|
|
99
99
|
};
|
|
@@ -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;AAWxD,OAAO,EACH,oBAAoB,EACpB,WAAW,EAId,MAAM,+CAA+C,CAAC;AAEvD,OAAO,EAEH,mBAAmB,EAEtB,MAAM,qBAAqB,CAAC;AAS7B,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAE3D,eAAO,MAAM,6BAA6B,UAAU,CAAC;AACrD,eAAO,MAAM,oCAAoC,MAAM,CAAC;AACxD,eAAO,MAAM,iCAAiC,SAAS,CAAC;AACxD,eAAO,MAAM,qBAAqB,eAAe,CAAC;AAElD,iBAAS,8BAA8B,CAAC,WAAW,EAAE,oBAAoB,EAAE,YAAY,EAAE,QAAQ,
|
|
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;AAWxD,OAAO,EACH,oBAAoB,EACpB,WAAW,EAId,MAAM,+CAA+C,CAAC;AAEvD,OAAO,EAEH,mBAAmB,EAEtB,MAAM,qBAAqB,CAAC;AAS7B,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAE3D,eAAO,MAAM,6BAA6B,UAAU,CAAC;AACrD,eAAO,MAA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A8B,EAC9B,6BAA6B,EAC7B,6BAA6B,EAC7B,6BAA6B,EAC7B,wCAAwC,EACxC,kCAAkC,GACrC,CAAC"}
|
|
@@ -32,7 +32,6 @@ function createSolrQueryFromFilterState(filterState, loggedInUser) {
|
|
|
32
32
|
const queryString = ((isAdvancedSearch ? filterQueryInfo.parsedQuery : filterQueryInfo.queryString) || '*:*').trim();
|
|
33
33
|
const isCaseNumberQuery = isValidCaseNumber(queryString);
|
|
34
34
|
const q = isCaseNumberQuery ? `${SolrKeys.caseNumber}:${queryString}` : queryString;
|
|
35
|
-
const isQuerySearch = q !== '*:*';
|
|
36
35
|
const sort = `${caseListSortColumnIdsToSolrMap[column]} ${direction}`;
|
|
37
36
|
const productVersionQuery = buildSolrQuery({ [ProductVersionKey]: filterInfo[ProductVersionKey] });
|
|
38
37
|
const filteredGroups = filterInfo[SolrKeys.group].map((item) => item.key);
|
|
@@ -43,12 +42,6 @@ function createSolrQueryFromFilterState(filterState, loggedInUser) {
|
|
|
43
42
|
let filteredAccounts = filterInfo[SolrKeys.accountNumber].reduce((acc, item) => (Array.isArray(item.key) ? [...acc, ...item.key] : [...acc, item.key]), []);
|
|
44
43
|
// dedupe - an account may be selected boths as an individual account also in a selected group
|
|
45
44
|
filteredAccounts = [...new Set(filteredAccounts)];
|
|
46
|
-
if (!isQuerySearch &&
|
|
47
|
-
filteredAccounts.length < 1 &&
|
|
48
|
-
loggedInUser.getAccountNumber() &&
|
|
49
|
-
!filteredAccounts.includes(loggedInUser.getAccountNumber())) {
|
|
50
|
-
filteredAccounts.push(loggedInUser.getAccountNumber());
|
|
51
|
-
}
|
|
52
45
|
const solrQuery = solr({
|
|
53
46
|
start,
|
|
54
47
|
rows,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rh-support/cases",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.74-beta.2",
|
|
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.
|
|
29
|
+
"@cee-eng/hydrajs": "4.10.0",
|
|
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.
|
|
50
|
+
"@cee-eng/hydrajs": "4.10.0",
|
|
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.
|
|
56
|
-
"@rh-support/components": "1.1.
|
|
57
|
-
"@rh-support/react-context": "0.2.
|
|
55
|
+
"@rh-support/api": "0.3.16-beta.2",
|
|
56
|
+
"@rh-support/components": "1.1.60-beta.2",
|
|
57
|
+
"@rh-support/react-context": "0.2.62-beta.2",
|
|
58
58
|
"@rh-support/types": "0.2.0",
|
|
59
|
-
"@rh-support/user-permissions": "0.2.
|
|
60
|
-
"@rh-support/utils": "0.2.
|
|
59
|
+
"@rh-support/user-permissions": "0.2.48-beta.2",
|
|
60
|
+
"@rh-support/utils": "0.2.37-beta.2",
|
|
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": "
|
|
104
|
+
"gitHead": "3698a59c19b70dd7c9722faa83c7d8aaf55e483c"
|
|
105
105
|
}
|