@zeniai/client-epic-state 4.13.99 → 4.14.0

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.
@@ -5,7 +5,7 @@ import { FilterCategoryValueType } from '../helpers/cockpitHelpers';
5
5
  import { CockpitDownloadTabsID, CockpitTabsFileType } from './cockpitTabsID';
6
6
  export declare const toPortfolioSortKeyType: (v: string) => "expenses" | "runway" | "cashBalance" | "netIncome" | "companyName" | "revenues";
7
7
  export declare const toManagementSortKeyType: (v: string) => "status" | "group" | "bookCloseDate" | "controller" | "preparer" | "reviewer" | "companyName" | "monthlyRecurringRevenue" | "annualRecurringRevenue" | "taxStatus" | "notes" | "plans" | "customerSuccessManager" | "task" | "apAnalyst" | "reportSent" | "taxLead" | "satisfaction";
8
- export declare const toOnboardingSortKeyType: (v: string) => "companyName" | "notes" | "bankAccountLinked" | "qboLinked" | "identityVerified" | "businessVerified" | "groupCreated" | "customerCreated" | "enroller" | "invite";
8
+ export declare const toOnboardingSortKeyType: (v: string) => "companyName" | "notes" | "bankAccountLinked" | "qboLinked" | "identityVerified" | "businessVerified" | "groupCreated" | "customerCreated" | "enroller" | "invite" | "latestCreated";
9
9
  export declare const toHealthSortKeyType: (v: string) => "group" | "runway" | "controller" | "companyName" | "monthlyRecurringRevenue" | "customerSatisfactionScore" | "netPromoterScore" | "customerSuccessManager" | "lastReportSent" | "externalProductServiceExposure" | "finOpsEngagementFrequency" | "companyEngagementMetricsUpdatedAt" | "issues" | "productVerticals" | "churnProbability" | "subscriptionDate" | "renewalDate";
10
10
  export declare const toTaskManagerSortKeyType: (v: string) => "priority" | "name" | "status" | "dueDate" | "taskName" | "assignee" | "tags" | "createdBy";
11
11
  export declare type PortfolioViewSortKey = ReturnType<typeof toPortfolioSortKeyType>;
@@ -41,6 +41,7 @@ const ALL_ONBOARDING_SORT_KEYS = [
41
41
  'enroller',
42
42
  'notes',
43
43
  'invite',
44
+ 'latestCreated',
44
45
  ];
45
46
  const ALL_HEALTH_SORT_KEYS = [
46
47
  'companyName',
@@ -36,7 +36,7 @@ exports.initialState = {
36
36
  selectedCompanyId: '',
37
37
  selectedStep: '',
38
38
  filterText: '',
39
- sortKey: 'companyName',
39
+ sortKey: 'latestCreated',
40
40
  sortOrder: 'ascending',
41
41
  },
42
42
  updateStatus: {
@@ -133,6 +133,7 @@ const getSortedOnboardingCustomers = (onboardingCustomers, sortKey, sortOrder, u
133
133
  var _a;
134
134
  switch (sortKey) {
135
135
  case 'companyName':
136
+ case 'latestCreated':
136
137
  case 'groupCreated':
137
138
  case 'customerCreated':
138
139
  case 'bankAccountLinked':
@@ -161,9 +162,19 @@ const getSortedOnboardingCustomers = (onboardingCustomers, sortKey, sortOrder, u
161
162
  break;
162
163
  }
163
164
  });
165
+ const appliedSortOrder = () => {
166
+ if (sortKey === 'latestCreated') {
167
+ return 'desc';
168
+ }
169
+ else {
170
+ return sortOrder === 'ascending' ? 'asc' : 'desc';
171
+ }
172
+ };
164
173
  const sortedCompaniesWithSortKeyValue = (0, orderBy_1.default)(companiesWithSortKeyValue, (company) => {
165
174
  var _a, _b, _c, _d, _e, _f;
166
175
  switch (sortKey) {
176
+ case 'latestCreated':
177
+ return company.company.company.companyInfo.createTime;
167
178
  case 'companyName':
168
179
  return Boolean(company.company.company.companyInfo.name) === true
169
180
  ? company.company.company.companyInfo.name.toLowerCase()
@@ -185,7 +196,7 @@ const getSortedOnboardingCustomers = (onboardingCustomers, sortKey, sortOrder, u
185
196
  default:
186
197
  return (_f = company.company.company.managementInfo.companyGroupId) === null || _f === void 0 ? void 0 : _f.toLowerCase();
187
198
  }
188
- }, sortOrder === 'ascending' ? 'asc' : 'desc');
199
+ }, appliedSortOrder());
189
200
  return [...sortedCompaniesWithSortKeyValue, ...companiesWithNoSortKeyValue];
190
201
  };
191
202
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zeniai/client-epic-state",
3
- "version": "4.13.99",
3
+ "version": "4.14.0",
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",