@zeniai/client-epic-state 4.10.64 → 4.10.66
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.
|
@@ -50,7 +50,7 @@ exports.companyHealthMetricDropDownOptions = [
|
|
|
50
50
|
{ label: 'Very High', value: 'very_high' },
|
|
51
51
|
];
|
|
52
52
|
const getCompanyHealthMetricView = (state) => {
|
|
53
|
-
const { companyHealthMetricViewState, companyHealthMetricState, companyState, userState, } = state;
|
|
53
|
+
const { companyViewState, companyHealthMetricViewState, companyHealthMetricState, companyState, userState, } = state;
|
|
54
54
|
const { companyIds, companyHealthMetricUpdateStatusById, uiState, selectedCompanyId, } = companyHealthMetricViewState;
|
|
55
55
|
const { sortKey, sortOrder, filterText, filters } = uiState;
|
|
56
56
|
const companies = (0, companySelector_1.getCompanyByCompanyIds)(companyState, companyIds).map((company) => company.company);
|
|
@@ -60,8 +60,10 @@ const getCompanyHealthMetricView = (state) => {
|
|
|
60
60
|
if (selectedCompanyId != null) {
|
|
61
61
|
selectedCompanyDetail = companyDetailWithHealthMetric.find((company) => company.companyInfo.companyId === selectedCompanyId);
|
|
62
62
|
}
|
|
63
|
-
companyDetailWithHealthMetric = sortAndFilterCompanies(sortKey, sortOrder, filterText, filters, companyDetailWithHealthMetric);
|
|
64
|
-
const zeniUsers =
|
|
63
|
+
companyDetailWithHealthMetric = sortAndFilterCompanies(sortKey, sortOrder, filterText, filters, companyDetailWithHealthMetric, userState);
|
|
64
|
+
const zeniUsers = companyViewState.zeniUsers.ids
|
|
65
|
+
.map((userId) => (0, userSelector_1.getUserByUserId)(userState, userId))
|
|
66
|
+
.filter((value) => value != null);
|
|
65
67
|
const orderedZeniUsers = (0, orderBy_1.default)(zeniUsers, (user) => (0, userSelector_1.getUserName)(user), 'asc');
|
|
66
68
|
return {
|
|
67
69
|
uiState: uiState,
|
|
@@ -239,7 +241,7 @@ const applyAdvancedFiltersOnCompaniesList = (allCompanies, filters, filteredComp
|
|
|
239
241
|
? companiesWithCurrentFilter
|
|
240
242
|
: filteredCompanies, index + 1);
|
|
241
243
|
};
|
|
242
|
-
const sortAndFilterCompanies = (sortKey, sortOrder, filterText, filters, companies) => {
|
|
244
|
+
const sortAndFilterCompanies = (sortKey, sortOrder, filterText, filters, companies, userState) => {
|
|
243
245
|
const sortOrderKey = (0, sortOrderPayload_1.getSortOrder)(sortOrder);
|
|
244
246
|
let updatedCompanies = [];
|
|
245
247
|
const trimmedFilterText = filterText.trim();
|
|
@@ -321,10 +323,20 @@ const sortAndFilterCompanies = (sortKey, sortOrder, filterText, filters, compani
|
|
|
321
323
|
}
|
|
322
324
|
break;
|
|
323
325
|
case 'controller':
|
|
324
|
-
|
|
326
|
+
if (company.managegmentInfo.controllerUserIds[0] != null) {
|
|
327
|
+
companiesWithSortKeyValues.push(company);
|
|
328
|
+
}
|
|
329
|
+
else {
|
|
330
|
+
companiesWithNoSortKeyValues.push(company);
|
|
331
|
+
}
|
|
325
332
|
break;
|
|
326
333
|
case 'customerSuccessManager':
|
|
327
|
-
|
|
334
|
+
if (company.managegmentInfo.customerSuccessManagerUserIds[0] != null) {
|
|
335
|
+
companiesWithSortKeyValues.push(company);
|
|
336
|
+
}
|
|
337
|
+
else {
|
|
338
|
+
companiesWithNoSortKeyValues.push(company);
|
|
339
|
+
}
|
|
328
340
|
break;
|
|
329
341
|
case 'companyName':
|
|
330
342
|
companiesWithSortKeyValues.push(company);
|
|
@@ -359,9 +371,9 @@ const sortAndFilterCompanies = (sortKey, sortOrder, filterText, filters, compani
|
|
|
359
371
|
case 'customerSatisfactionScore':
|
|
360
372
|
return (_g = company.companyHealthMetric.customerSatisfactionScore) !== null && _g !== void 0 ? _g : 0;
|
|
361
373
|
case 'controller':
|
|
362
|
-
return company.managegmentInfo.controllerUserIds.
|
|
374
|
+
return (0, userSelector_1.getUserNameById)(userState, company.managegmentInfo.controllerUserIds[0]).toLowerCase();
|
|
363
375
|
case 'customerSuccessManager':
|
|
364
|
-
return company.managegmentInfo.customerSuccessManagerUserIds.
|
|
376
|
+
return (0, userSelector_1.getUserNameById)(userState, company.managegmentInfo.customerSuccessManagerUserIds[0]).toLowerCase();
|
|
365
377
|
default:
|
|
366
378
|
case 'companyName':
|
|
367
379
|
return company.companyInfo.name;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeniai/client-epic-state",
|
|
3
|
-
"version": "4.10.
|
|
3
|
+
"version": "4.10.66",
|
|
4
4
|
"description": "Shared module between Web & Mobile containing required abstractions for state management, async network communication. ",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|