@zeniai/client-epic-state 5.0.21-betaRR01 → 5.0.21-betaRR3

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.
Files changed (28) hide show
  1. package/lib/commonStateTypes/fiscalYearHelpers/formatZeniDateFY.d.ts +1 -0
  2. package/lib/commonStateTypes/fiscalYearHelpers/formatZeniDateFY.js +2 -1
  3. package/lib/entity/task/taskState.d.ts +1 -1
  4. package/lib/entity/tenant/clearAllEpic.d.ts +2 -1
  5. package/lib/entity/tenant/clearAllEpic.js +2 -0
  6. package/lib/esm/commonStateTypes/fiscalYearHelpers/formatZeniDateFY.js +1 -0
  7. package/lib/esm/entity/tenant/clearAllEpic.js +2 -0
  8. package/lib/esm/view/taskManager/cannedResponsesView/cannedResponsesReducer.js +4 -1
  9. package/lib/esm/view/taskManager/cannedResponsesView/epics/deleteCannedResponseEpic.js +2 -2
  10. package/lib/esm/view/taskManager/taskDetailView/epics/snoozeTaskEpic.js +2 -1
  11. package/lib/esm/view/taskManager/taskDetailView/epics/unsnoozeTaskEpic.js +2 -1
  12. package/lib/esm/view/taskManager/taskDetailView/taskDetailReducer.js +9 -6
  13. package/lib/esm/view/taskManager/taskListView/epics/fetchTaskListEpic.js +0 -1
  14. package/lib/esm/view/taskManager/taskListView/taskListReducer.js +15 -1
  15. package/lib/esm/view/taskManager/taskListView/taskListSelector.js +32 -6
  16. package/lib/tsconfig.typecheck.tsbuildinfo +1 -1
  17. package/lib/view/taskManager/cannedResponsesView/cannedResponsesReducer.d.ts +1 -1
  18. package/lib/view/taskManager/cannedResponsesView/cannedResponsesReducer.js +5 -2
  19. package/lib/view/taskManager/cannedResponsesView/epics/deleteCannedResponseEpic.js +1 -1
  20. package/lib/view/taskManager/taskDetailView/epics/snoozeTaskEpic.js +2 -1
  21. package/lib/view/taskManager/taskDetailView/epics/unsnoozeTaskEpic.d.ts +2 -2
  22. package/lib/view/taskManager/taskDetailView/epics/unsnoozeTaskEpic.js +1 -0
  23. package/lib/view/taskManager/taskDetailView/taskDetailReducer.js +9 -6
  24. package/lib/view/taskManager/taskListView/epics/fetchTaskListEpic.js +0 -1
  25. package/lib/view/taskManager/taskListView/taskListReducer.d.ts +1 -2
  26. package/lib/view/taskManager/taskListView/taskListReducer.js +15 -1
  27. package/lib/view/taskManager/taskListView/taskListSelector.js +32 -6
  28. package/package.json +1 -1
@@ -7,6 +7,7 @@ export declare const DEFAULT_DATE_FORMAT = "YYYY-MM-DD";
7
7
  export declare const DAY_MONTH_YEAR_FORMAT = "DDMMYYYY";
8
8
  export declare const MONTH_FORMAT = "MMMM";
9
9
  export declare const MM_YYYY_FORMAT = "MM-YYYY";
10
+ export declare const SNOOZED_DISPLAY_FORMAT = "MMM D, h:mm A";
10
11
  /**
11
12
  * Format date according to the `format` and `firstMonthOfFY`
12
13
  * see: https://sharing.clickup.com/10555925/t/h/1xju71j/ZJWTNROIRRKCB41
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.MM_YYYY_FORMAT = exports.MONTH_FORMAT = exports.DAY_MONTH_YEAR_FORMAT = exports.DEFAULT_DATE_FORMAT = exports.YEAR_MONTH_FORMAT = exports.MONTH_YEAR_FORMAT = exports.FULL_MONTH_FULL_YEAR_FORMAT = void 0;
3
+ exports.SNOOZED_DISPLAY_FORMAT = exports.MM_YYYY_FORMAT = exports.MONTH_FORMAT = exports.DAY_MONTH_YEAR_FORMAT = exports.DEFAULT_DATE_FORMAT = exports.YEAR_MONTH_FORMAT = exports.MONTH_YEAR_FORMAT = exports.FULL_MONTH_FULL_YEAR_FORMAT = void 0;
4
4
  exports.formatZeniDateFY = formatZeniDateFY;
5
5
  const stringToUnion_1 = require("../stringToUnion");
6
6
  const getFYQuarterAndYear_1 = require("./getFYQuarterAndYear");
@@ -11,6 +11,7 @@ exports.DEFAULT_DATE_FORMAT = 'YYYY-MM-DD';
11
11
  exports.DAY_MONTH_YEAR_FORMAT = 'DDMMYYYY';
12
12
  exports.MONTH_FORMAT = 'MMMM';
13
13
  exports.MM_YYYY_FORMAT = 'MM-YYYY';
14
+ exports.SNOOZED_DISPLAY_FORMAT = 'MMM D, h:mm A';
14
15
  const ALL_FISCAL_YEAR_SUPPORTED_DATE_FORMATS = [
15
16
  'YY',
16
17
  'YYYY',
@@ -11,6 +11,7 @@ export interface Task {
11
11
  id: ID;
12
12
  isArchived: boolean;
13
13
  isDeleted: boolean;
14
+ isPrivate: boolean;
14
15
  name: string;
15
16
  priority: TaskPriority;
16
17
  status: TaskStatus;
@@ -21,7 +22,6 @@ export interface Task {
21
22
  type: TaskType;
22
23
  companyId?: ID;
23
24
  dueDate?: ZeniDate;
24
- isPrivate?: boolean;
25
25
  recurringEndDate?: ZeniDate;
26
26
  recurringFrequency?: RecurringFrequencyType;
27
27
  recurringSourceTaskId?: ID;
@@ -8,6 +8,7 @@ import { clearAllNotifications } from '../../entity/notification/notificationRed
8
8
  import { clearAllSectionsClassesViewV2 } from '../../entity/sectionClassesViewV2/sectionClassesViewReducer';
9
9
  import { clearAllSectionsProjectView } from '../../entity/sectionProjectView/sectionProjectViewReducer';
10
10
  import { clearAllTaskGroups } from '../../entity/taskGroup/taskGroupReducer';
11
+ import { clearCannedResponses } from '../../view/taskManager/cannedResponsesView/cannedResponsesReducer';
11
12
  import { clearAllToastNotifications } from '../../entity/toastNotification/toastNotificationReducer';
12
13
  import { clearAccountList } from '../../view/accountList/accountListReducer';
13
14
  import { clearAccountMappingView } from '../../view/accountMappingView/accountMappingReducer';
@@ -204,7 +205,7 @@ import { clearAllVendors } from '../vendor/vendorReducer';
204
205
  import { clearAllVendorExpenseTrends } from '../vendorExpense/vendorExpenseReducer';
205
206
  import { clearAll } from './tenantReducer';
206
207
  type clearActionTypeForViews = ReturnType<typeof clearAccountList> | ReturnType<typeof clearAccountMappingView> | ReturnType<typeof clearActivityHistory> | ReturnType<typeof clearActivityRealTimeApproval> | ReturnType<typeof clearAddressView> | ReturnType<typeof clearAiAccountantView> | ReturnType<typeof clearAllAiAccountantCustomers> | ReturnType<typeof clearAiCfoView> | ReturnType<typeof clearAllClasses> | ReturnType<typeof clearAllProjects> | ReturnType<typeof clearAllMonthEndCloseChecksView> | ReturnType<typeof clearApAging> | ReturnType<typeof clearApAgingDetail> | ReturnType<typeof clearArAging> | ReturnType<typeof clearArAgingDetail> | ReturnType<typeof clearAuthenticationView> | ReturnType<typeof clearAutoTransferRules> | ReturnType<typeof clearBalanceSheet> | ReturnType<typeof clearBankAccountView> | ReturnType<typeof clearBillDetailView> | ReturnType<typeof clearBillList> | ReturnType<typeof clearBillPayBulkActionView> | ReturnType<typeof clearBillPayCard> | ReturnType<typeof clearBillPayConfig> | ReturnType<typeof clearBillPayReview> | ReturnType<typeof clearBillPaySetupApproverView> | ReturnType<typeof clearBillPaySetupView> | ReturnType<typeof clearCardBalance> | ReturnType<typeof clearCardPaymentView> | ReturnType<typeof clearCardUserOnboarding> | ReturnType<typeof clearCashbackDetail> | ReturnType<typeof clearCashBalance> | ReturnType<typeof clearCashFlow> | ReturnType<typeof clearCashInCashOut> | ReturnType<typeof clearCashPosition> | ReturnType<typeof clearChargeCardConfig> | ReturnType<typeof clearChargeCardDetail> | ReturnType<typeof clearChargeCardList> | ReturnType<typeof clearChargeCardRepaymentDetail> | ReturnType<typeof clearChargeCardSetupView> | ReturnType<typeof clearChargeCardStatementList> | ReturnType<typeof clearCheckDeposit> | ReturnType<typeof clearCompanyConfigView> | ReturnType<typeof clearCompanyHealthMetric> | ReturnType<typeof clearCompanyHealthMetricView> | ReturnType<typeof clearCompanyMonthEndReportView> | ReturnType<typeof clearCompanyTaskManagerView> | ReturnType<typeof clearCompanyView> | ReturnType<typeof clearDashboard> | ReturnType<typeof clearDashboardLayout> | ReturnType<typeof clearDepositAccountDetail> | ReturnType<typeof clearDepositAccountList> | ReturnType<typeof clearDepositAccountTransactionList> | ReturnType<typeof clearEditBillViewDetail> | ReturnType<typeof clearEditRemiViewDetail> | ReturnType<typeof clearAllEntityAutoCompleteResults> | ReturnType<typeof clearExpenseAutomationFluxAnalysisView> | ReturnType<typeof clearExpenseAutomationJESchedulesView> | ReturnType<typeof clearExpenseAutomationMissingReceiptsView> | ReturnType<typeof clearExpenseAutomationReconciliationView> | ReturnType<typeof clearExpenseAutomationTransactionsView> | ReturnType<typeof clearExpenseAutomationView> | ReturnType<typeof clearExpressPayView> | ReturnType<typeof clearFileViewList> | ReturnType<typeof clearFinanceStatement> | ReturnType<typeof clearForecastList> | ReturnType<typeof clearGlobalMerchantAutoCompleteResults> | ReturnType<typeof clearGlobalMerchantView> | ReturnType<typeof clearInsightsCard> | ReturnType<typeof clearInternationalWire> | ReturnType<typeof clearInternationalVerificationView> | ReturnType<typeof clearIssueChargeCard> | ReturnType<typeof clearMerchantList> | ReturnType<typeof clearNetBurnOrIncome> | ReturnType<typeof clearNetBurnOrIncomeClassesView> | ReturnType<typeof clearNetBurnOrIncomeStoryCard> | ReturnType<typeof clearNotificationView> | ReturnType<typeof clearOnboardingCockpitView> | ReturnType<typeof clearOnboardingCustomerView> | ReturnType<typeof clearOpEx> | ReturnType<typeof clearOpExByVendor> | ReturnType<typeof clearOpExClassesView> | ReturnType<typeof clearOwnerList> | ReturnType<typeof clearPaymentAccountList> | ReturnType<typeof clearPeople> | ReturnType<typeof clearAggregatedReport> | ReturnType<typeof clearPreviousBills> | ReturnType<typeof clearProfitAndLoss> | ReturnType<typeof clearProfitAndLossClassesView> | ReturnType<typeof clearProfitAndLossProjectView> | ReturnType<typeof clearRecommendation> | ReturnType<typeof clearReferrals> | ReturnType<typeof clearReimbursementCard> | ReturnType<typeof clearReimbursementConfig> | ReturnType<typeof clearRemiBulkActionView> | ReturnType<typeof clearRemiDetailView> | ReturnType<typeof clearRemiList> | ReturnType<typeof clearRemiSetupApproverView> | ReturnType<typeof clearRemiSetupView> | ReturnType<typeof clearReportUIOption> | ReturnType<typeof clearRevenue> | ReturnType<typeof clearRevenueClassesView> | ReturnType<typeof clearReviewCompany> | ReturnType<typeof clearScheduleDetailView> | ReturnType<typeof clearScheduleAccruedDetailView> | ReturnType<typeof clearScheduleList> | ReturnType<typeof clearSettingsView> | ReturnType<typeof clearSetupView> | ReturnType<typeof clearPlaidAccountView> | ReturnType<typeof clearSubscriptionView> | ReturnType<typeof clearTagView> | ReturnType<typeof clearTaskDetail> | ReturnType<typeof clearTaskGroupTemplatesView> | ReturnType<typeof clearTaskGroupView> | ReturnType<typeof clearTaskList> | ReturnType<typeof clearTasksCard> | ReturnType<typeof clearTopEx> | ReturnType<typeof clearTransactionDetail> | ReturnType<typeof clearTransactionList> | ReturnType<typeof clearTransferDetail> | ReturnType<typeof clearTreasuryOverviewDetail> | ReturnType<typeof clearTreasurySetupView> | ReturnType<typeof clearTreasuryStatementList> | ReturnType<typeof clearTreasuryTaxLetterList> | ReturnType<typeof clearTreasuryTransferMoney> | ReturnType<typeof clearTrendData> | ReturnType<typeof clearTrendWithTransactions> | ReturnType<typeof clearTwoFactorAuthentication> | ReturnType<typeof clearUserFinancialAccount> | ReturnType<typeof clearUserListView> | ReturnType<typeof clearUserRoleConfigView> | ReturnType<typeof clearVendorGlobalReviewView> | ReturnType<typeof clearVendorReviewView> | ReturnType<typeof clearVendorTypeList> | ReturnType<typeof clearVendor1099TypeList> | ReturnType<typeof clearVendorView> | ReturnType<typeof clearVendorsFiling1099List> | ReturnType<typeof clearVendorsList> | ReturnType<typeof clearVendorsTabVendorView> | ReturnType<typeof clearWiseRedirectStatus> | ReturnType<typeof clearZeniAccStatementList> | ReturnType<typeof clearZeniAccountList> | ReturnType<typeof clearZeniAccountSetupView> | ReturnType<typeof clearZeniAccountsConfig> | ReturnType<typeof clearZeniAccountsPromoCard>;
207
- type clearActionTypeForEntities = ReturnType<typeof clearAiCfo> | ReturnType<typeof clearAllAccountGroups> | ReturnType<typeof clearAllAccountRecon> | ReturnType<typeof clearAllAccountingSummary> | ReturnType<typeof clearAllAccounts> | ReturnType<typeof clearAllAddresses> | ReturnType<typeof clearAllApprovalRules> | ReturnType<typeof clearAllBankAccounts> | ReturnType<typeof clearAllBillTransactions> | ReturnType<typeof clearAllCardPayments> | ReturnType<typeof clearAllChargeCardRepayments> | ReturnType<typeof clearAllChargeCardTransactions> | ReturnType<typeof clearAllChargeCards> | ReturnType<typeof clearAllCompanies> | ReturnType<typeof clearAllConnectedAccounts> | ReturnType<typeof clearAllCurrencies> | ReturnType<typeof clearAllCustomerIncomeTrend> | ReturnType<typeof clearAllCustomers> | ReturnType<typeof clearAllDepositAccounts> | ReturnType<typeof clearAllEntities> | ReturnType<typeof clearAllEntityApprovalStatus> | ReturnType<typeof clearAllFiles> | ReturnType<typeof clearAllForecasts> | ReturnType<typeof clearAllGlobalMerchants> | ReturnType<typeof clearAllInsights> | ReturnType<typeof clearAllAccruedJESchedules> | ReturnType<typeof clearAllJEScheduleTransactions> | ReturnType<typeof clearAllMerchants> | ReturnType<typeof clearAllMonthEndCloseChecks> | ReturnType<typeof clearAllNotifications> | ReturnType<typeof clearAllOnboardingCustomersInfo> | ReturnType<typeof clearAllPaymentAccounts> | ReturnType<typeof clearAllPaymentInstruments> | ReturnType<typeof clearAllRecurringBills> | ReturnType<typeof clearAllReimbursements> | ReturnType<typeof clearAllSectionsAccountsView> | ReturnType<typeof clearAllSectionsClassesViewV2> | ReturnType<typeof clearAllSectionsProjectView> | ReturnType<typeof clearAllSubscriptionAddOns> | ReturnType<typeof clearAllSubscriptionCoupons> | ReturnType<typeof clearAllSubscriptionPlans> | ReturnType<typeof clearAllSubscriptionSummary> | ReturnType<typeof clearAllSubscriptions> | ReturnType<typeof clearAllTags> | ReturnType<typeof clearAllTaskGroups> | ReturnType<typeof clearAllTaskGroupTemplates> | ReturnType<typeof clearAllTaskSummary> | ReturnType<typeof clearAllTasks> | ReturnType<typeof clearAllToastNotifications> | ReturnType<typeof clearAllTransactions> | ReturnType<typeof clearAllUserRoles> | ReturnType<typeof clearAllUsers> | ReturnType<typeof clearAllVendorExpenseTrends> | ReturnType<typeof clearAllVendors> | ReturnType<typeof clearClassList> | ReturnType<typeof clearContacts> | ReturnType<typeof clearCountryList> | ReturnType<typeof clearDepositAccountTransaction> | ReturnType<typeof clearSnackbar>;
208
+ type clearActionTypeForEntities = ReturnType<typeof clearAiCfo> | ReturnType<typeof clearAllAccountGroups> | ReturnType<typeof clearAllAccountRecon> | ReturnType<typeof clearAllAccountingSummary> | ReturnType<typeof clearAllAccounts> | ReturnType<typeof clearAllAddresses> | ReturnType<typeof clearAllApprovalRules> | ReturnType<typeof clearAllBankAccounts> | ReturnType<typeof clearAllBillTransactions> | ReturnType<typeof clearAllCardPayments> | ReturnType<typeof clearAllChargeCardRepayments> | ReturnType<typeof clearAllChargeCardTransactions> | ReturnType<typeof clearAllChargeCards> | ReturnType<typeof clearAllCompanies> | ReturnType<typeof clearAllConnectedAccounts> | ReturnType<typeof clearAllCurrencies> | ReturnType<typeof clearAllCustomerIncomeTrend> | ReturnType<typeof clearAllCustomers> | ReturnType<typeof clearAllDepositAccounts> | ReturnType<typeof clearAllEntities> | ReturnType<typeof clearAllEntityApprovalStatus> | ReturnType<typeof clearAllFiles> | ReturnType<typeof clearAllForecasts> | ReturnType<typeof clearAllGlobalMerchants> | ReturnType<typeof clearAllInsights> | ReturnType<typeof clearAllAccruedJESchedules> | ReturnType<typeof clearAllJEScheduleTransactions> | ReturnType<typeof clearAllMerchants> | ReturnType<typeof clearAllMonthEndCloseChecks> | ReturnType<typeof clearAllNotifications> | ReturnType<typeof clearAllOnboardingCustomersInfo> | ReturnType<typeof clearAllPaymentAccounts> | ReturnType<typeof clearAllPaymentInstruments> | ReturnType<typeof clearAllRecurringBills> | ReturnType<typeof clearAllReimbursements> | ReturnType<typeof clearAllSectionsAccountsView> | ReturnType<typeof clearAllSectionsClassesViewV2> | ReturnType<typeof clearAllSectionsProjectView> | ReturnType<typeof clearAllSubscriptionAddOns> | ReturnType<typeof clearAllSubscriptionCoupons> | ReturnType<typeof clearAllSubscriptionPlans> | ReturnType<typeof clearAllSubscriptionSummary> | ReturnType<typeof clearAllSubscriptions> | ReturnType<typeof clearAllTags> | ReturnType<typeof clearAllTaskGroups> | ReturnType<typeof clearCannedResponses> | ReturnType<typeof clearAllTaskGroupTemplates> | ReturnType<typeof clearAllTaskSummary> | ReturnType<typeof clearAllTasks> | ReturnType<typeof clearAllToastNotifications> | ReturnType<typeof clearAllTransactions> | ReturnType<typeof clearAllUserRoles> | ReturnType<typeof clearAllUsers> | ReturnType<typeof clearAllVendorExpenseTrends> | ReturnType<typeof clearAllVendors> | ReturnType<typeof clearClassList> | ReturnType<typeof clearContacts> | ReturnType<typeof clearCountryList> | ReturnType<typeof clearDepositAccountTransaction> | ReturnType<typeof clearSnackbar>;
208
209
  export type ActionType = clearActionTypeForViews | clearActionTypeForEntities | ReturnType<typeof clearAll>;
209
210
  export declare const clearAllEpic: (actions$: ActionsObservable<ActionType>) => import("rxjs").Observable<ActionType>;
210
211
  export {};
@@ -12,6 +12,7 @@ const notificationReducer_1 = require("../../entity/notification/notificationRed
12
12
  const sectionClassesViewReducer_1 = require("../../entity/sectionClassesViewV2/sectionClassesViewReducer");
13
13
  const sectionProjectViewReducer_1 = require("../../entity/sectionProjectView/sectionProjectViewReducer");
14
14
  const taskGroupReducer_1 = require("../../entity/taskGroup/taskGroupReducer");
15
+ const cannedResponsesReducer_1 = require("../../view/taskManager/cannedResponsesView/cannedResponsesReducer");
15
16
  const toastNotificationReducer_1 = require("../../entity/toastNotification/toastNotificationReducer");
16
17
  const accountListReducer_1 = require("../../view/accountList/accountListReducer");
17
18
  const accountMappingReducer_1 = require("../../view/accountMappingView/accountMappingReducer");
@@ -404,6 +405,7 @@ const clearAllEpic = (actions$) => actions$.pipe((0, operators_1.filter)(tenantR
404
405
  (0, subscriptionReducer_1.clearAllSubscriptions)(),
405
406
  (0, tagReducer_1.clearAllTags)(),
406
407
  (0, taskGroupReducer_1.clearAllTaskGroups)(),
408
+ (0, cannedResponsesReducer_1.clearCannedResponses)(),
407
409
  (0, taskGroupTemplateReducer_1.clearAllTaskGroupTemplates)(),
408
410
  (0, taskReducer_1.clearAllTasks)(),
409
411
  (0, taskSummaryReducer_1.clearAllTaskSummary)(),
@@ -7,6 +7,7 @@ export const DEFAULT_DATE_FORMAT = 'YYYY-MM-DD';
7
7
  export const DAY_MONTH_YEAR_FORMAT = 'DDMMYYYY';
8
8
  export const MONTH_FORMAT = 'MMMM';
9
9
  export const MM_YYYY_FORMAT = 'MM-YYYY';
10
+ export const SNOOZED_DISPLAY_FORMAT = 'MMM D, h:mm A';
10
11
  const ALL_FISCAL_YEAR_SUPPORTED_DATE_FORMATS = [
11
12
  'YY',
12
13
  'YYYY',
@@ -9,6 +9,7 @@ import { clearAllNotifications } from '../../entity/notification/notificationRed
9
9
  import { clearAllSectionsClassesViewV2 } from '../../entity/sectionClassesViewV2/sectionClassesViewReducer';
10
10
  import { clearAllSectionsProjectView } from '../../entity/sectionProjectView/sectionProjectViewReducer';
11
11
  import { clearAllTaskGroups } from '../../entity/taskGroup/taskGroupReducer';
12
+ import { clearCannedResponses } from '../../view/taskManager/cannedResponsesView/cannedResponsesReducer';
12
13
  import { clearAllToastNotifications } from '../../entity/toastNotification/toastNotificationReducer';
13
14
  import { clearAccountList } from '../../view/accountList/accountListReducer';
14
15
  import { clearAccountMappingView } from '../../view/accountMappingView/accountMappingReducer';
@@ -401,6 +402,7 @@ export const clearAllEpic = (actions$) => actions$.pipe(filter(clearAll.match),
401
402
  clearAllSubscriptions(),
402
403
  clearAllTags(),
403
404
  clearAllTaskGroups(),
405
+ clearCannedResponses(),
404
406
  clearAllTaskGroupTemplates(),
405
407
  clearAllTasks(),
406
408
  clearAllTaskSummary(),
@@ -55,7 +55,10 @@ const cannedResponsesView = createSlice({
55
55
  draft.deleteFetchState = 'Error';
56
56
  draft.error = action.payload.error;
57
57
  },
58
+ clearCannedResponses() {
59
+ return initialState;
60
+ },
58
61
  },
59
62
  });
60
- export const { fetchCannedResponses, updateCannedResponses, updateCannedResponsesFetchStatus, saveCannedResponse, saveCannedResponseSuccess, saveCannedResponseFailure, deleteCannedResponse, deleteCannedResponseSuccess, deleteCannedResponseFailure, } = cannedResponsesView.actions;
63
+ export const { fetchCannedResponses, updateCannedResponses, updateCannedResponsesFetchStatus, saveCannedResponse, saveCannedResponseSuccess, saveCannedResponseFailure, deleteCannedResponse, deleteCannedResponseSuccess, deleteCannedResponseFailure, clearCannedResponses, } = cannedResponsesView.actions;
61
64
  export default cannedResponsesView.reducer;
@@ -1,8 +1,8 @@
1
1
  import { of } from 'rxjs';
2
- import { catchError, filter, switchMap, mergeMap } from 'rxjs/operators';
2
+ import { catchError, filter, mergeMap } from 'rxjs/operators';
3
3
  import { createZeniAPIStatus, isSuccessResponse, } from '../../../../responsePayload';
4
4
  import { deleteCannedResponse, deleteCannedResponseFailure, deleteCannedResponseSuccess, } from '../cannedResponsesReducer';
5
- export const deleteCannedResponseEpic = (actions$, _state$, zeniAPI) => actions$.pipe(filter(deleteCannedResponse.match), switchMap((action) => {
5
+ export const deleteCannedResponseEpic = (actions$, _state$, zeniAPI) => actions$.pipe(filter(deleteCannedResponse.match), mergeMap((action) => {
6
6
  const { cannedResponseId } = action.payload;
7
7
  return zeniAPI
8
8
  .deleteAndGetJSON(`${zeniAPI.apiEndPoints.taskMicroServiceBaseUrl}/1.0/task-manager/canned-responses/${cannedResponseId}`)
@@ -1,5 +1,6 @@
1
1
  import { from, of } from 'rxjs';
2
2
  import { catchError, filter, mergeMap } from 'rxjs/operators';
3
+ import { SNOOZED_DISPLAY_FORMAT } from '../../../../commonStateTypes/fiscalYearHelpers/formatZeniDateFY';
3
4
  import { openSnackbar } from '../../../../entity/snackbar/snackbarReducer';
4
5
  import { updateTasks } from '../../../../entity/task/taskReducer';
5
6
  import { createZeniAPIStatus, isSuccessResponse, } from '../../../../responsePayload';
@@ -7,7 +8,7 @@ import { date } from '../../../../zeniDayJS';
7
8
  import { fetchTaskList, removeTaskFromList, } from '../../taskListView/taskListReducer';
8
9
  import { snoozeTask, snoozeTaskSuccessOrFailure } from '../taskDetailReducer';
9
10
  export const snoozeTaskEpic = (actions$, _state$, zeniAPI) => actions$.pipe(filter(snoozeTask.match), mergeMap((action) => handleSnoozeTask(action.payload.taskId, action.payload.snoozedUntil, zeniAPI)));
10
- const formatSnoozedUntilForDisplay = (snoozedUntil) => date(snoozedUntil).format('MMM D, h:mm A');
11
+ const formatSnoozedUntilForDisplay = (snoozedUntil) => date(snoozedUntil).format(SNOOZED_DISPLAY_FORMAT);
11
12
  const handleSnoozeTask = (taskId, snoozedUntil, zeniAPI) => {
12
13
  const snoozeTaskApi$ = zeniAPI.postAndGetJSON(`${zeniAPI.apiEndPoints.taskMicroServiceBaseUrl}/1.0/task-manager/tasks/${taskId}/snooze`, { snoozed_until: snoozedUntil });
13
14
  return snoozeTaskApi$.pipe(mergeMap((response) => handleApiResponse(response, taskId, snoozedUntil)), catchError((error) => of(snoozeTaskSuccessOrFailure({
@@ -3,7 +3,7 @@ import { catchError, filter, mergeMap } from 'rxjs/operators';
3
3
  import { openSnackbar } from '../../../../entity/snackbar/snackbarReducer';
4
4
  import { updateTasks } from '../../../../entity/task/taskReducer';
5
5
  import { createZeniAPIStatus, isSuccessResponse, } from '../../../../responsePayload';
6
- import { fetchTaskList } from '../../taskListView/taskListReducer';
6
+ import { fetchTaskList, removeTaskFromList, } from '../../taskListView/taskListReducer';
7
7
  import { snoozeTaskSuccessOrFailure, unsnoozeTask, } from '../taskDetailReducer';
8
8
  export const unsnoozeTaskEpic = (actions$, _state$, zeniAPI) => actions$.pipe(filter(unsnoozeTask.match), mergeMap((action) => handleUnsnoozeTask(action.payload.taskId, zeniAPI)));
9
9
  const handleUnsnoozeTask = (taskId, zeniAPI) => {
@@ -20,6 +20,7 @@ const handleApiResponse = (response, taskId) => {
20
20
  response.data.tasks.length > 0) {
21
21
  const fetchActions = [
22
22
  updateTasks(response.data.tasks),
23
+ removeTaskFromList(taskId),
23
24
  fetchTaskList(),
24
25
  snoozeTaskSuccessOrFailure({
25
26
  fetchState: 'Completed',
@@ -149,11 +149,11 @@ const taskDetailView = createSlice({
149
149
  },
150
150
  saveTaskSuccessOrFailure(draft, action) {
151
151
  const { taskId, fetchState, error, newTaskId } = action.payload;
152
- if (taskId != null) {
152
+ if (taskId != null && draft.editTaskStateById[taskId] != null) {
153
153
  draft.editTaskStateById[taskId].saveStatus.fetchState = fetchState;
154
154
  draft.editTaskStateById[taskId].saveStatus.error = error;
155
155
  }
156
- else {
156
+ else if (taskId == null) {
157
157
  if (newTaskId != null) {
158
158
  draft.newTaskState.taskId = newTaskId;
159
159
  }
@@ -182,8 +182,10 @@ const taskDetailView = createSlice({
182
182
  },
183
183
  archiveTaskSuccessOrFailure(draft, action) {
184
184
  const { taskId, fetchState, error } = action.payload;
185
- draft.editTaskStateById[taskId].archiveStatus.fetchState = fetchState;
186
- draft.editTaskStateById[taskId].archiveStatus.error = error;
185
+ if (draft.editTaskStateById[taskId] != null) {
186
+ draft.editTaskStateById[taskId].archiveStatus.fetchState = fetchState;
187
+ draft.editTaskStateById[taskId].archiveStatus.error = error;
188
+ }
187
189
  },
188
190
  deleteTask: {
189
191
  reducer(draft, action) {
@@ -216,14 +218,15 @@ const taskDetailView = createSlice({
216
218
  },
217
219
  },
218
220
  deleteTaskSuccessOrFailure(draft, action) {
219
- if (action.payload.taskId != null) {
221
+ if (action.payload.taskId != null &&
222
+ draft.editTaskStateById[action.payload.taskId] != null) {
220
223
  const { taskId } = action.payload;
221
224
  draft.editTaskStateById[taskId].deleteTaskStatus.fetchState =
222
225
  action.payload.fetchState;
223
226
  draft.editTaskStateById[taskId].deleteTaskStatus.error =
224
227
  action.payload.error;
225
228
  }
226
- else {
229
+ else if (action.payload.taskId == null) {
227
230
  draft.newTaskState.deleteTaskStatus.fetchState =
228
231
  action.payload.fetchState;
229
232
  draft.newTaskState.deleteTaskStatus.error = action.payload.error;
@@ -21,7 +21,6 @@ export const fetchTaskListEpic = (actions$, _state$, zeniAPI) => actions$.pipe(f
21
21
  deleted: deleted ?? [],
22
22
  archived: archived ?? [],
23
23
  snoozed: snoozed ?? [],
24
- updateType: 'replace',
25
24
  }), updateTags(allTasks.map((task) => task.tags).flat()));
26
25
  }
27
26
  else {
@@ -330,6 +330,7 @@ const taskList = createSlice({
330
330
  }
331
331
  delete draft.taskIdsByGroupsIds[taskGroupId];
332
332
  delete draft.localData.existingTaskGroupNamesByGroupId[taskGroupId];
333
+ syncTopLevelToActiveTab(draft);
333
334
  },
334
335
  updateTaskListOnNewTaskCreationSuccess(draft, action) {
335
336
  const { task, taskGroupId, currentTaskState } = action.payload;
@@ -364,6 +365,7 @@ const taskList = createSlice({
364
365
  doUpdateTaskList(draft, task, taskGroupId);
365
366
  }
366
367
  });
368
+ syncTopLevelToActiveTab(draft);
367
369
  },
368
370
  updateTaskListOnTaskGroupNameUpdate(draft, action) {
369
371
  const { taskGroupName, taskGroupId } = action.payload;
@@ -427,6 +429,7 @@ const taskList = createSlice({
427
429
  };
428
430
  }
429
431
  }
432
+ syncTopLevelToActiveTab(draft);
430
433
  },
431
434
  updateTasksListOnUpdateTaskSuccess(draft) {
432
435
  draft.updateTasksFetchState.fetchState = 'Completed';
@@ -532,6 +535,16 @@ const toTabData = (grouped) => ({
532
535
  taskIdsByStatus: grouped.taskIdsGroupedByStatus,
533
536
  taskIdsByTags: grouped.taskIdsByTags,
534
537
  });
538
+ const syncTopLevelToActiveTab = (draft) => {
539
+ const tabData = draft.byTab[draft.currentTab];
540
+ tabData.taskIds = draft.taskIds;
541
+ tabData.taskIdsByGroupsIds = draft.taskIdsByGroupsIds;
542
+ tabData.taskIdsByPriority = draft.taskIdsByPriority;
543
+ tabData.taskIdsByStatus = draft.taskIdsByStatus;
544
+ tabData.taskIdsByAssignees = draft.taskIdsByAssignees;
545
+ tabData.taskIdsByDueDate = draft.taskIdsByDueDate;
546
+ tabData.taskIdsByTags = draft.taskIdsByTags;
547
+ };
535
548
  const copyTabDataToTopLevel = (draft, tabData) => {
536
549
  draft.taskIds = tabData.taskIds;
537
550
  draft.taskIdsByGroupsIds = tabData.taskIdsByGroupsIds;
@@ -542,7 +555,8 @@ const copyTabDataToTopLevel = (draft, tabData) => {
542
555
  draft.taskIdsByTags = tabData.taskIdsByTags;
543
556
  };
544
557
  const removeIdsFromTabData = (tabData, taskIds) => {
545
- const isRemoved = (id) => taskIds.includes(id);
558
+ const removedSet = new Set(taskIds);
559
+ const isRemoved = (id) => removedSet.has(id);
546
560
  tabData.taskIds = tabData.taskIds.filter((id) => !isRemoved(id));
547
561
  Object.keys(tabData.taskIdsByGroupsIds).forEach((gId) => {
548
562
  tabData.taskIdsByGroupsIds[gId] = tabData.taskIdsByGroupsIds[gId].filter((id) => !isRemoved(id));
@@ -1,4 +1,5 @@
1
1
  import { createSelector } from '@reduxjs/toolkit';
2
+ import isEqual from 'lodash/isEqual';
2
3
  import orderBy from 'lodash/orderBy';
3
4
  import { getSortOrder, } from '../../../commonPayloadTypes/sortOrderPayload';
4
5
  import { reduceAnyFetchState } from '../../../commonStateTypes/reduceFetchState';
@@ -14,6 +15,13 @@ import { getUserGroupList } from '../../userGroupListView/userGroupListViewSelec
14
15
  import { getUserList, } from '../../userListView/userListViewSelector';
15
16
  import { allTaskPriority, allTaskStatus, } from '../taskDetailView/taskDetailSelector';
16
17
  import { DUE_DATE_GROUP_KEYS, } from './taskList';
18
+ import { initialState } from './taskListReducer';
19
+ const isDefaultFilters = (taskListState) => {
20
+ return (isEqual(taskListState.filters, initialState.filters) &&
21
+ initialState.uiState.searchText === taskListState.uiState.searchText);
22
+ };
23
+ const shouldFilterEmptyGroups = (taskListState) => taskListState.currentTab !== 'live' ||
24
+ isDefaultFilters(taskListState) === false;
17
25
  const sortTasksList = (tagState, tasksList, sortKey, sortOrder) => {
18
26
  const tasksInOrder = orderBy(tasksList, (task) => {
19
27
  const tagsByIds = getTagsByIds(tagState, task.tagIds);
@@ -111,7 +119,10 @@ const getTaskListGroupedByGroupName = ({ taskListState, taskState, taskGroupStat
111
119
  if (defaultTaskGroup != null) {
112
120
  sortedTaskGroupsWithTasksList.push(defaultTaskGroup);
113
121
  }
114
- return sortedTaskGroupsWithTasksList.filter((group) => group.tasks.length > 0);
122
+ if (shouldFilterEmptyGroups(taskListState)) {
123
+ return sortedTaskGroupsWithTasksList.filter((group) => group.tasks.length > 0);
124
+ }
125
+ return sortedTaskGroupsWithTasksList;
115
126
  };
116
127
  export const getTaskListGroupedByAssignees = ({ taskListState, taskState, userState, userRoleState, addressState, tagState, userGroupsState, }) => {
117
128
  const assigneeGroups = Object.keys(taskListState.taskIdsByAssignees);
@@ -141,7 +152,10 @@ export const getTaskListGroupedByAssignees = ({ taskListState, taskState, userSt
141
152
  tasks: tasksWithUserDetails,
142
153
  };
143
154
  });
144
- return taskGroupsWithTasksList.filter((group) => group.tasks.length > 0);
155
+ if (shouldFilterEmptyGroups(taskListState)) {
156
+ return taskGroupsWithTasksList.filter((group) => group.tasks.length > 0);
157
+ }
158
+ return taskGroupsWithTasksList;
145
159
  };
146
160
  export const getTaskListGroupedByPriority = ({ taskListState, taskState, userState, userRoleState, addressState, tagState, userGroupsState, }) => {
147
161
  const taskGroupsWithTasksList = ALL_PRIORITY_CODE.map((groupKey) => {
@@ -164,7 +178,10 @@ export const getTaskListGroupedByPriority = ({ taskListState, taskState, userSta
164
178
  tasks: tasksWithUserDetails,
165
179
  };
166
180
  });
167
- return taskGroupsWithTasksList.filter((group) => group.tasks.length > 0);
181
+ if (shouldFilterEmptyGroups(taskListState)) {
182
+ return taskGroupsWithTasksList.filter((group) => group.tasks.length > 0);
183
+ }
184
+ return taskGroupsWithTasksList;
168
185
  };
169
186
  const getTaskListGroupedByStatus = ({ taskListState, taskState, userState, userRoleState, addressState, tagState, userGroupsState, }) => {
170
187
  const taskGroupsWithTasksList = ALL_TASK_STATUS_CODE.map((groupKey) => {
@@ -187,7 +204,10 @@ const getTaskListGroupedByStatus = ({ taskListState, taskState, userState, userR
187
204
  tasks: tasksWithUserDetails,
188
205
  };
189
206
  });
190
- return taskGroupsWithTasksList.filter((group) => group.tasks.length > 0);
207
+ if (shouldFilterEmptyGroups(taskListState)) {
208
+ return taskGroupsWithTasksList.filter((group) => group.tasks.length > 0);
209
+ }
210
+ return taskGroupsWithTasksList;
191
211
  };
192
212
  const getTaskListGroupedByTags = ({ taskListState, taskState, userState, userRoleState, addressState, tagState, userGroupsState, }) => {
193
213
  const tagGroups = Object.keys(taskListState.taskIdsByTags);
@@ -216,7 +236,10 @@ const getTaskListGroupedByTags = ({ taskListState, taskState, userState, userRol
216
236
  tasks: tasksWithUserDetails,
217
237
  };
218
238
  });
219
- return taskGroupsWithTasksList.filter((group) => group.tasks.length > 0);
239
+ if (shouldFilterEmptyGroups(taskListState)) {
240
+ return taskGroupsWithTasksList.filter((group) => group.tasks.length > 0);
241
+ }
242
+ return taskGroupsWithTasksList;
220
243
  };
221
244
  const getTaskListGroupedByDueDate = ({ taskListState, taskState, userState, userRoleState, addressState, tagState, userGroupsState, }) => {
222
245
  const taskGroupsWithTasksList = DUE_DATE_GROUP_KEYS.map((groupKey) => {
@@ -238,7 +261,10 @@ const getTaskListGroupedByDueDate = ({ taskListState, taskState, userState, user
238
261
  tasks: tasksWithUserDetails,
239
262
  };
240
263
  });
241
- return taskGroupsWithTasksList.filter((group) => group.tasks.length > 0);
264
+ if (shouldFilterEmptyGroups(taskListState)) {
265
+ return taskGroupsWithTasksList.filter((group) => group.tasks.length > 0);
266
+ }
267
+ return taskGroupsWithTasksList;
242
268
  };
243
269
  const getTaskGroupsWithTaskList = ({ taskListState, taskState, userState, userRoleState, addressState, taskGroupState, taskGroupViewState, tagState, userGroupsState, }) => {
244
270
  const { groupByKey } = taskListState.uiState;