@zeniai/client-epic-state 5.0.36-betaRR05 → 5.0.37
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/commonStateTypes/fiscalYearHelpers/formatZeniDateFY.d.ts +0 -1
- package/lib/commonStateTypes/fiscalYearHelpers/formatZeniDateFY.js +1 -2
- package/lib/entity/file/fileState.d.ts +4 -4
- package/lib/entity/file/fileState.js +0 -4
- package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
- package/lib/entity/snackbar/snackbarTypes.js +0 -4
- package/lib/entity/task/taskPayload.d.ts +0 -4
- package/lib/entity/task/taskPayload.js +0 -10
- package/lib/entity/task/taskState.d.ts +0 -8
- package/lib/entity/task/taskState.js +1 -6
- package/lib/entity/tenant/clearAllEpic.d.ts +2 -5
- package/lib/entity/tenant/clearAllEpic.js +0 -6
- package/lib/entity/tenant/tenantPayload.d.ts +0 -1
- package/lib/entity/tenant/tenantReducer.d.ts +1 -59
- package/lib/entity/tenant/tenantReducer.js +4 -139
- package/lib/entity/tenant/tenantState.d.ts +0 -7
- package/lib/entity/transaction/stateTypes/attachment.d.ts +2 -2
- package/lib/epic.d.ts +1 -9
- package/lib/epic.js +1 -12
- package/lib/esm/commonStateTypes/fiscalYearHelpers/formatZeniDateFY.js +0 -1
- package/lib/esm/entity/file/fileState.js +0 -4
- package/lib/esm/entity/snackbar/snackbarTypes.js +0 -4
- package/lib/esm/entity/task/taskPayload.js +1 -11
- package/lib/esm/entity/task/taskState.js +0 -3
- package/lib/esm/entity/tenant/clearAllEpic.js +0 -6
- package/lib/esm/entity/tenant/tenantReducer.js +2 -135
- package/lib/esm/epic.js +1 -12
- package/lib/esm/index.js +9 -18
- package/lib/esm/init.js +16 -71
- package/lib/esm/reducer.js +0 -9
- package/lib/esm/view/common/recurringViewHelper.js +0 -17
- package/lib/esm/view/taskManager/taskDetailView/epics/archiveTaskEpic.js +0 -3
- package/lib/esm/view/taskManager/taskDetailView/epics/deleteTaskEpic.js +0 -5
- package/lib/esm/view/taskManager/taskDetailView/epics/initializeTaskToLocalStoreEpic.js +0 -3
- package/lib/esm/view/taskManager/taskDetailView/epics/saveTaskDetailEpic.js +0 -6
- package/lib/esm/view/taskManager/taskDetailView/taskDetail.js +0 -5
- package/lib/esm/view/taskManager/taskDetailView/taskDetailReducer.js +7 -60
- package/lib/esm/view/taskManager/taskDetailView/taskDetailSelector.js +0 -17
- package/lib/esm/view/taskManager/taskListView/epics/bulkUpdateTaskListEpic.js +21 -56
- package/lib/esm/view/taskManager/taskListView/epics/dragNDropTasksEpic.js +0 -1
- package/lib/esm/view/taskManager/taskListView/epics/fetchTaskListEpic.js +4 -13
- package/lib/esm/view/taskManager/taskListView/epics/updateTaskFromListViewEpic.js +2 -3
- package/lib/esm/view/taskManager/taskListView/taskList.js +0 -7
- package/lib/esm/view/taskManager/taskListView/taskListReducer.js +12 -106
- package/lib/esm/view/taskManager/taskListView/taskListSelector.js +39 -48
- package/lib/index.d.ts +9 -21
- package/lib/index.js +30 -70
- package/lib/init.d.ts +3 -5
- package/lib/init.js +16 -71
- package/lib/reducer.d.ts +0 -9
- package/lib/reducer.js +0 -9
- package/lib/tsconfig.typecheck.tsbuildinfo +1 -1
- package/lib/view/common/recurringViewHelper.d.ts +2 -3
- package/lib/view/common/recurringViewHelper.js +1 -18
- package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +1 -1
- package/lib/view/taskManager/taskDetailView/epics/archiveTaskEpic.d.ts +1 -2
- package/lib/view/taskManager/taskDetailView/epics/archiveTaskEpic.js +0 -3
- package/lib/view/taskManager/taskDetailView/epics/deleteTaskEpic.d.ts +1 -2
- package/lib/view/taskManager/taskDetailView/epics/deleteTaskEpic.js +0 -5
- package/lib/view/taskManager/taskDetailView/epics/initializeTaskToLocalStoreEpic.js +0 -3
- package/lib/view/taskManager/taskDetailView/epics/saveTaskDetailEpic.js +0 -6
- package/lib/view/taskManager/taskDetailView/taskDetail.d.ts +1 -5
- package/lib/view/taskManager/taskDetailView/taskDetail.js +0 -5
- package/lib/view/taskManager/taskDetailView/taskDetailReducer.d.ts +1 -10
- package/lib/view/taskManager/taskDetailView/taskDetailReducer.js +8 -61
- package/lib/view/taskManager/taskDetailView/taskDetailSelector.d.ts +0 -6
- package/lib/view/taskManager/taskDetailView/taskDetailSelector.js +0 -17
- package/lib/view/taskManager/taskListView/epics/bulkUpdateTaskListEpic.d.ts +7 -6
- package/lib/view/taskManager/taskListView/epics/bulkUpdateTaskListEpic.js +22 -56
- package/lib/view/taskManager/taskListView/epics/dragNDropTasksEpic.js +0 -1
- package/lib/view/taskManager/taskListView/epics/fetchTaskListEpic.js +4 -13
- package/lib/view/taskManager/taskListView/epics/updateTaskFromListViewEpic.js +2 -3
- package/lib/view/taskManager/taskListView/taskList.d.ts +1 -14
- package/lib/view/taskManager/taskListView/taskList.js +1 -8
- package/lib/view/taskManager/taskListView/taskListPayload.d.ts +0 -3
- package/lib/view/taskManager/taskListView/taskListReducer.d.ts +6 -9
- package/lib/view/taskManager/taskListView/taskListReducer.js +13 -107
- package/lib/view/taskManager/taskListView/taskListSelector.d.ts +3 -9
- package/lib/view/taskManager/taskListView/taskListSelector.js +39 -48
- package/package.json +1 -1
- package/lib/entity/tenant/epic/deleteConnectionEpic.d.ts +0 -19
- package/lib/entity/tenant/epic/deleteConnectionEpic.js +0 -29
- package/lib/entity/tenant/epic/saveAPIKeyConnectionEpic.d.ts +0 -19
- package/lib/entity/tenant/epic/saveAPIKeyConnectionEpic.js +0 -31
- package/lib/entity/tenant/epic/saveOAuthConnectionEpic.d.ts +0 -19
- package/lib/entity/tenant/epic/saveOAuthConnectionEpic.js +0 -33
- package/lib/esm/entity/tenant/epic/deleteConnectionEpic.js +0 -25
- package/lib/esm/entity/tenant/epic/saveAPIKeyConnectionEpic.js +0 -27
- package/lib/esm/entity/tenant/epic/saveOAuthConnectionEpic.js +0 -29
- package/lib/esm/view/featureNotificationView/epics/fetchRegisteredInterestsEpic.js +0 -23
- package/lib/esm/view/featureNotificationView/epics/notifyMeForFeatureEpic.js +0 -25
- package/lib/esm/view/featureNotificationView/featureNotificationViewPayload.js +0 -11
- package/lib/esm/view/featureNotificationView/featureNotificationViewReducer.js +0 -106
- package/lib/esm/view/featureNotificationView/featureNotificationViewSelector.js +0 -4
- package/lib/esm/view/featureNotificationView/featureNotificationViewState.js +0 -1
- package/lib/esm/view/taskManager/cannedResponsesView/cannedResponses.js +0 -1
- package/lib/esm/view/taskManager/cannedResponsesView/cannedResponsesPayload.js +0 -12
- package/lib/esm/view/taskManager/cannedResponsesView/cannedResponsesReducer.js +0 -64
- package/lib/esm/view/taskManager/cannedResponsesView/cannedResponsesSelector.js +0 -3
- package/lib/esm/view/taskManager/cannedResponsesView/epics/deleteCannedResponseEpic.js +0 -17
- package/lib/esm/view/taskManager/cannedResponsesView/epics/fetchCannedResponsesEpic.js +0 -21
- package/lib/esm/view/taskManager/cannedResponsesView/epics/saveCannedResponseEpic.js +0 -29
- package/lib/esm/view/taskManager/taskDetailView/epics/snoozeTaskEpic.js +0 -66
- package/lib/esm/view/taskManager/taskDetailView/epics/unsnoozeTaskEpic.js +0 -57
- package/lib/esm/view/zeniOAuthView/epics/approveOAuthConsentEpic.js +0 -65
- package/lib/esm/view/zeniOAuthView/zeniOAuthParamsParser.js +0 -41
- package/lib/esm/view/zeniOAuthView/zeniOAuthReducer.js +0 -49
- package/lib/esm/view/zeniOAuthView/zeniOAuthSelector.js +0 -3
- package/lib/esm/view/zeniOAuthView/zeniOAuthState.js +0 -1
- package/lib/view/featureNotificationView/epics/fetchRegisteredInterestsEpic.d.ts +0 -16
- package/lib/view/featureNotificationView/epics/fetchRegisteredInterestsEpic.js +0 -27
- package/lib/view/featureNotificationView/epics/notifyMeForFeatureEpic.d.ts +0 -14
- package/lib/view/featureNotificationView/epics/notifyMeForFeatureEpic.js +0 -29
- package/lib/view/featureNotificationView/featureNotificationViewPayload.d.ts +0 -23
- package/lib/view/featureNotificationView/featureNotificationViewPayload.js +0 -15
- package/lib/view/featureNotificationView/featureNotificationViewReducer.d.ts +0 -19
- package/lib/view/featureNotificationView/featureNotificationViewReducer.js +0 -110
- package/lib/view/featureNotificationView/featureNotificationViewSelector.d.ts +0 -6
- package/lib/view/featureNotificationView/featureNotificationViewSelector.js +0 -11
- package/lib/view/featureNotificationView/featureNotificationViewState.d.ts +0 -26
- package/lib/view/featureNotificationView/featureNotificationViewState.js +0 -2
- package/lib/view/taskManager/cannedResponsesView/cannedResponses.d.ts +0 -19
- package/lib/view/taskManager/cannedResponsesView/cannedResponses.js +0 -2
- package/lib/view/taskManager/cannedResponsesView/cannedResponsesPayload.d.ts +0 -21
- package/lib/view/taskManager/cannedResponsesView/cannedResponsesPayload.js +0 -15
- package/lib/view/taskManager/cannedResponsesView/cannedResponsesReducer.d.ts +0 -30
- package/lib/view/taskManager/cannedResponsesView/cannedResponsesReducer.js +0 -68
- package/lib/view/taskManager/cannedResponsesView/cannedResponsesSelector.d.ts +0 -3
- package/lib/view/taskManager/cannedResponsesView/cannedResponsesSelector.js +0 -6
- package/lib/view/taskManager/cannedResponsesView/epics/deleteCannedResponseEpic.d.ts +0 -7
- package/lib/view/taskManager/cannedResponsesView/epics/deleteCannedResponseEpic.js +0 -21
- package/lib/view/taskManager/cannedResponsesView/epics/fetchCannedResponsesEpic.d.ts +0 -7
- package/lib/view/taskManager/cannedResponsesView/epics/fetchCannedResponsesEpic.js +0 -25
- package/lib/view/taskManager/cannedResponsesView/epics/saveCannedResponseEpic.d.ts +0 -7
- package/lib/view/taskManager/cannedResponsesView/epics/saveCannedResponseEpic.js +0 -33
- package/lib/view/taskManager/taskDetailView/epics/snoozeTaskEpic.d.ts +0 -9
- package/lib/view/taskManager/taskDetailView/epics/snoozeTaskEpic.js +0 -70
- package/lib/view/taskManager/taskDetailView/epics/unsnoozeTaskEpic.d.ts +0 -9
- package/lib/view/taskManager/taskDetailView/epics/unsnoozeTaskEpic.js +0 -61
- package/lib/view/zeniOAuthView/epics/approveOAuthConsentEpic.d.ts +0 -27
- package/lib/view/zeniOAuthView/epics/approveOAuthConsentEpic.js +0 -69
- package/lib/view/zeniOAuthView/zeniOAuthParamsParser.d.ts +0 -16
- package/lib/view/zeniOAuthView/zeniOAuthParamsParser.js +0 -44
- package/lib/view/zeniOAuthView/zeniOAuthReducer.d.ts +0 -29
- package/lib/view/zeniOAuthView/zeniOAuthReducer.js +0 -53
- package/lib/view/zeniOAuthView/zeniOAuthSelector.d.ts +0 -5
- package/lib/view/zeniOAuthView/zeniOAuthSelector.js +0 -9
- package/lib/view/zeniOAuthView/zeniOAuthState.d.ts +0 -4
- package/lib/view/zeniOAuthView/zeniOAuthState.js +0 -2
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { ZeniDate } from '../../zeniDayJS';
|
|
2
|
-
export declare const toRecurringFrequency: (v: string) => "weekly" | "biweekly" | "monthly" | "quarterly" | "daily"
|
|
3
|
-
export declare const toRecurringFrequencyStrict: (v?: string) => "weekly" | "biweekly" | "monthly" | "quarterly" | "daily" |
|
|
2
|
+
export declare const toRecurringFrequency: (v: string) => "weekly" | "biweekly" | "monthly" | "quarterly" | "daily";
|
|
3
|
+
export declare const toRecurringFrequencyStrict: (v?: string) => "weekly" | "biweekly" | "monthly" | "quarterly" | "daily" | undefined;
|
|
4
4
|
export type RecurringFrequencyType = NonNullable<ReturnType<typeof toRecurringFrequency>>;
|
|
5
|
-
export declare const SEMI_WEEKLY_REQUIRED_DAYS_COUNT = 2;
|
|
6
5
|
declare const toRecurringDatePickerOptions: (v: string) => "date" | "recurringCount";
|
|
7
6
|
export type RecurringDatePickerOptions = NonNullable<ReturnType<typeof toRecurringDatePickerOptions>>;
|
|
8
7
|
export declare const getRecurringFrequencyInDays: (frequency: RecurringFrequencyType) => number;
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getMinAllowedEndDate = exports.getRecurringEndDateFromCount = exports.getRecurringFrequencyInDays = exports.
|
|
3
|
+
exports.getMinAllowedEndDate = exports.getRecurringEndDateFromCount = exports.getRecurringFrequencyInDays = exports.toRecurringFrequencyStrict = exports.toRecurringFrequency = void 0;
|
|
4
4
|
const stringToUnion_1 = require("../../commonStateTypes/stringToUnion");
|
|
5
5
|
const ALL_RECURRING_FREQUENCY = [
|
|
6
6
|
'daily',
|
|
7
7
|
'weekly',
|
|
8
8
|
'biweekly',
|
|
9
|
-
'semi_weekly',
|
|
10
9
|
'monthly',
|
|
11
10
|
'quarterly',
|
|
12
11
|
];
|
|
@@ -14,7 +13,6 @@ const toRecurringFrequency = (v) => (0, stringToUnion_1.stringToUnion)(v, ALL_RE
|
|
|
14
13
|
exports.toRecurringFrequency = toRecurringFrequency;
|
|
15
14
|
const toRecurringFrequencyStrict = (v) => (0, stringToUnion_1.stringToUnionStrict)(v ?? '', ALL_RECURRING_FREQUENCY);
|
|
16
15
|
exports.toRecurringFrequencyStrict = toRecurringFrequencyStrict;
|
|
17
|
-
exports.SEMI_WEEKLY_REQUIRED_DAYS_COUNT = 2;
|
|
18
16
|
const ALL_RECURRING_DATE_PICKER_OPTIONS = ['date', 'recurringCount'];
|
|
19
17
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
20
18
|
const toRecurringDatePickerOptions = (v) => (0, stringToUnion_1.stringToUnion)(v, ALL_RECURRING_DATE_PICKER_OPTIONS);
|
|
@@ -22,8 +20,6 @@ const getRecurringFrequencyInDays = (frequency) => {
|
|
|
22
20
|
switch (frequency) {
|
|
23
21
|
case 'daily':
|
|
24
22
|
return 1;
|
|
25
|
-
case 'semi_weekly':
|
|
26
|
-
return 3;
|
|
27
23
|
case 'weekly':
|
|
28
24
|
return 7;
|
|
29
25
|
case 'biweekly':
|
|
@@ -45,17 +41,6 @@ const getRecurringEndDateFromCount = (startDate, frequency, recurringCount) => {
|
|
|
45
41
|
case 'biweekly':
|
|
46
42
|
endDate = startDate.add((0, exports.getRecurringFrequencyInDays)(frequency) * (recurringCount - 1), 'day');
|
|
47
43
|
break;
|
|
48
|
-
case 'semi_weekly': {
|
|
49
|
-
// Two semi-weekly occurrences span exactly 7 days regardless of which
|
|
50
|
-
// two weekdays are picked (since gap1 + gap2 = 7). So odd counts are
|
|
51
|
-
// exact; even counts use the conservative half-week step (4 days).
|
|
52
|
-
const stepsRemaining = recurringCount - 1;
|
|
53
|
-
const fullWeekPairs = Math.floor(stepsRemaining / 2);
|
|
54
|
-
const hasOddTailStep = stepsRemaining % 2 === 1;
|
|
55
|
-
const days = fullWeekPairs * 7 + (hasOddTailStep ? 4 : 0);
|
|
56
|
-
endDate = startDate.add(days, 'day');
|
|
57
|
-
break;
|
|
58
|
-
}
|
|
59
44
|
case 'monthly':
|
|
60
45
|
endDate = startDate.add(recurringCount - 1, 'month');
|
|
61
46
|
break;
|
|
@@ -73,8 +58,6 @@ const getMinAllowedEndDate = (frequency, startDate) => {
|
|
|
73
58
|
switch (frequency) {
|
|
74
59
|
case 'daily':
|
|
75
60
|
return startDate.add(1, 'day');
|
|
76
|
-
case 'semi_weekly':
|
|
77
|
-
return startDate.add(3, 'day');
|
|
78
61
|
case 'weekly':
|
|
79
62
|
return startDate.add(7, 'day');
|
|
80
63
|
case 'biweekly':
|
package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts
CHANGED
|
@@ -37,7 +37,7 @@ export declare const getLineItemsByTransactionsIdsFromResponse: (transactions: S
|
|
|
37
37
|
export declare const getLineItemsByTransactionIdsFromLocalData: (transactionLocalData: TransactionReviewLocalDataSelectorView[], selectedTab: TransactionsTab) => Record<ID, string[]>;
|
|
38
38
|
export declare const mergeTabSpecificLineItems: (currentTabSpecificLineItems: TabSpecificLineItems, selectedTab: TransactionsTab, newLineItems: TabSpecificLineItems) => TabSpecificLineItems;
|
|
39
39
|
export declare const getSnackbarMessageForTransactionReview: (updatedCount: number, failedCount: number, categorizedCount: number) => {
|
|
40
|
-
messageSection: "common" | "transactionDetails_updatingPastTransactions" | "transactionDetails_transactionUpdated" | "cockpit_month_end_email_sent" | "cockpit_month_end_email_save" | "cockpit_month_end_email_attachment_upload" | "je_bill_link" | "je_posted" | "audit_score_updated" | "people_invite_people" | "people_invite_multiple_people" | "people_delete_person" | "people_update_person" | "reimbursement_updated" | "reimbursement_deleted" | "reimbursement_cancelled_deleted" | "reimbursement_cancelled" | "reimbursement_approved" | "reimbursement_rejected" | "reimbursement_sent_for_approval" | "account_added" | "business_verification_save" | "business_verification_submit" | "business_verification_from_bills_submit" | "plaid_connection" | "unlink_deposit_account" | "reimbursement_setup" | "reimbursement_approval_create" | "reimbursement_duplicate_approval_create" | "reimbursement_approval_update" | "reimbursement_duplicate_approval_update" | "reimbursement_approval_delete" | "reimbursement_create_mileage" | "reimbursement_update_mileage" | "reimbursement_accept_term" | "reimbursement_accept_employee_term" | "reimbursement_bulk_submit" | "reimbursement_bulk_processed" | "bill_pay_setup" | "zeni_accounts_setup" | "bill_pay_approval_create" | "bill_pay_duplicate_approval_create" | "bill_pay_approval_update" | "bill_pay_duplicate_approval_update" | "bill_pay_approval_delete" | "bill_pay_updated" | "bill_pay_deleted" | "bill_pay_cancelled_deleted" | "bill_pay_cancelled" | "bill_pay_approved" | "real_time_approver_added" | "bill_pay_rejected" | "bill_pay_sent_for_approval" | "bill_pay_accept_term" | "bill_pay_bulk_submit" | "bill_pay_bulk_processed" | "bill_pay_refund" | "bill_pay_retry" | "bill_pay_marked_as_paid" | "zeni_account_accept_term" | "update_vendor" | "data_refresh_update" | "delete_bank_account" | "create_bank_account" | "create_bank_account_ach" | "create_bank_account_wire" | "create_bank_account_international" | "transfer_money" | "update_zeni_account_nickname" | "create_checking_account" | "deposit_check" | "create_vendor" | "onboarding_customer_view" | "onboarding_customer_view_complete" | "onboarding_customer_identity_verification_save" | "onboarding_customer_identity_verification_submit" | "onboarding_customer_business_verification_save" | "onboarding_customer_business_verification_submit" | "retry_bank_account_connection" | "dashboard_invite_sent" | "onboarding_info_saved" | "approve_original_merchant" | "approve_global_merchant" | "reject_global_merchant" | "create_global_merchant" | "fetch_global_merchant_no_recommendation" | "save_vendor_renamed" | "save_vendor_sent_for_review" | "save_vendor_marked_as_employee" | "save_vendor_marked_as_local_contractor" | "charge_card_setup" | "charge_card_accept_term" | "charge_card_receipt_upload" | "charge_card_resend_invite" | "charge_card_revoke_invite" | "charge_card_update_limit" | "charge_cards_update_limit" | "close_charge_card" | "lock_charge_card" | "lock_charge_card_card_user" | "lock_charge_cards" | "unlock_charge_card" | "unlock_charge_card_card_user" | "unlock_charge_cards" | "close_charge_cards" | "revoke_invite_charge_cards" | "charge_card_express_interest" | "create_schedule" | "save_schedule" | "delete_schedule" | "ignore_schedule" | "save_task_detail" | "fetch_task_detail" | "delete_task" | "archive_task" | "
|
|
40
|
+
messageSection: "common" | "transactionDetails_updatingPastTransactions" | "transactionDetails_transactionUpdated" | "cockpit_month_end_email_sent" | "cockpit_month_end_email_save" | "cockpit_month_end_email_attachment_upload" | "je_bill_link" | "je_posted" | "audit_score_updated" | "people_invite_people" | "people_invite_multiple_people" | "people_delete_person" | "people_update_person" | "reimbursement_updated" | "reimbursement_deleted" | "reimbursement_cancelled_deleted" | "reimbursement_cancelled" | "reimbursement_approved" | "reimbursement_rejected" | "reimbursement_sent_for_approval" | "account_added" | "business_verification_save" | "business_verification_submit" | "business_verification_from_bills_submit" | "plaid_connection" | "unlink_deposit_account" | "reimbursement_setup" | "reimbursement_approval_create" | "reimbursement_duplicate_approval_create" | "reimbursement_approval_update" | "reimbursement_duplicate_approval_update" | "reimbursement_approval_delete" | "reimbursement_create_mileage" | "reimbursement_update_mileage" | "reimbursement_accept_term" | "reimbursement_accept_employee_term" | "reimbursement_bulk_submit" | "reimbursement_bulk_processed" | "bill_pay_setup" | "zeni_accounts_setup" | "bill_pay_approval_create" | "bill_pay_duplicate_approval_create" | "bill_pay_approval_update" | "bill_pay_duplicate_approval_update" | "bill_pay_approval_delete" | "bill_pay_updated" | "bill_pay_deleted" | "bill_pay_cancelled_deleted" | "bill_pay_cancelled" | "bill_pay_approved" | "real_time_approver_added" | "bill_pay_rejected" | "bill_pay_sent_for_approval" | "bill_pay_accept_term" | "bill_pay_bulk_submit" | "bill_pay_bulk_processed" | "bill_pay_refund" | "bill_pay_retry" | "bill_pay_marked_as_paid" | "zeni_account_accept_term" | "update_vendor" | "data_refresh_update" | "delete_bank_account" | "create_bank_account" | "create_bank_account_ach" | "create_bank_account_wire" | "create_bank_account_international" | "transfer_money" | "update_zeni_account_nickname" | "create_checking_account" | "deposit_check" | "create_vendor" | "onboarding_customer_view" | "onboarding_customer_view_complete" | "onboarding_customer_identity_verification_save" | "onboarding_customer_identity_verification_submit" | "onboarding_customer_business_verification_save" | "onboarding_customer_business_verification_submit" | "retry_bank_account_connection" | "dashboard_invite_sent" | "onboarding_info_saved" | "approve_original_merchant" | "approve_global_merchant" | "reject_global_merchant" | "create_global_merchant" | "fetch_global_merchant_no_recommendation" | "save_vendor_renamed" | "save_vendor_sent_for_review" | "save_vendor_marked_as_employee" | "save_vendor_marked_as_local_contractor" | "charge_card_setup" | "charge_card_accept_term" | "charge_card_receipt_upload" | "charge_card_resend_invite" | "charge_card_revoke_invite" | "charge_card_update_limit" | "charge_cards_update_limit" | "close_charge_card" | "lock_charge_card" | "lock_charge_card_card_user" | "lock_charge_cards" | "unlock_charge_card" | "unlock_charge_card_card_user" | "unlock_charge_cards" | "close_charge_cards" | "revoke_invite_charge_cards" | "charge_card_express_interest" | "create_schedule" | "save_schedule" | "delete_schedule" | "ignore_schedule" | "save_task_detail" | "fetch_task_detail" | "delete_task" | "archive_task" | "create_tag" | "delete_tag" | "update_charge_card" | "update_charge_card_name" | "update_charge_card_name_card_user" | "issue_charge_card" | "issue_charge_cards" | "notification_settings_saved" | "referral_invite_sent" | "notification_mark_as_read" | "mark_as_complete_schedule" | "cancel_journal_entry" | "settings_accounting_accounts_updated" | "create_card_setup" | "confirm_card_setup" | "add_card_payment_source" | "fetch_payment_sources" | "task_assigned_toast_notification" | "task_due_tomorrow_toast_notification" | "task_deleted_toast_notification" | "task_archived_toast_notification" | "task_overdue_toast_notification" | "task_overdue_toast_notification_creator" | "task_notification_count" | "task_activities_toast_notification" | "task_created_toast_notification" | "task_group_creation_success" | "task_group_deletion_success" | "task_group_update_success" | "primary_funding_account_updated" | "task_time_spent_validation" | "missing_receipts_attachment" | "flux_analysis_unreviewed" | "flux_analysis_reviewed" | "receipt_match" | "receipts_upload" | "receipts_bulk_match" | "billing_address_view" | "express_pay_submit" | "exclude_transaction" | "reconcile" | "save_reconcile_for_later" | "recon_transaction_categorize" | "recon_transaction_match" | "update_debit_card_pin_attempt" | "set_debit_card_pin" | "ai_cfo_create_session_and_submit" | "ai_cfo_chat_session_deleted" | "charge_card_auto_pay_enable" | "charge_card_auto_pay_disable" | "treasury_setup" | "treasury_accept_term" | "treasury_transfer_money" | "treasury_transfer_money_failed" | "auto_transfer_rule_create" | "auto_transfer_rule_update" | "auto_transfer_rule_delete" | "auto_transfer_rule_pause" | "auto_transfer_rule_resume" | "treasury_update_portfolio_allocation" | "send_email_magic_link_to_user" | "complete_profile_done" | "reports_resync" | "invalid_phone_number" | "transactions_categorized_updated_failed" | "transaction_categorized_updated_failed" | "transactionsCategorized_transactionsUpdated" | "transactionsCategorized_transactionUpdated" | "transactionCategorized_transactionsUpdated" | "transactionCategorized_transactionUpdated" | "transactionsCategorized_transactionsFailed" | "transactionsCategorized_transactionFailed" | "transactionCategorized_transactionsFailed" | "transactionCategorized_transactionFailed" | "transactionsUpdated_transactionsFailed" | "transactionsUpdated_transactionFailed" | "transactionUpdated_transactionsFailed" | "transactionUpdated_transactionFailed" | "transactionsCategorized_transactionsUpdated_transactionsFailed" | "transactionsCategorized_transactionsUpdated_transactionFailed" | "transactionsCategorized_transactionUpdated_transactionsFailed" | "transactionCategorized_transactionsUpdated_transactionsFailed" | "transactionsCategorized_transactionUpdated_transactionFailed" | "transactionCategorized_transactionsUpdated_transactionFailed" | "transactionCategorized_transactionUpdated_transactionsFailed" | "transactionCategorized_transactionUpdated_transactionFailed" | "accounting_classes_enabled_update" | "account_excluded_from_reconciliation" | "account_included_in_reconciliation" | "ai_accountant_trigger_job";
|
|
41
41
|
messageText: "notification" | "failed" | "success";
|
|
42
42
|
type: "error" | "success" | "info";
|
|
43
43
|
variables: {
|
|
@@ -3,7 +3,6 @@ import { openSnackbar } from '../../../../entity/snackbar/snackbarReducer';
|
|
|
3
3
|
import { updateTasks } from '../../../../entity/task/taskReducer';
|
|
4
4
|
import { RootState } from '../../../../reducer';
|
|
5
5
|
import { ZeniAPI } from '../../../../zeniAPI';
|
|
6
|
-
import { fetchTaskList, removeTaskFromList } from '../../taskListView/taskListReducer';
|
|
7
6
|
import { archiveTask, archiveTaskSuccessOrFailure } from '../taskDetailReducer';
|
|
8
|
-
export type ActionType = ReturnType<typeof archiveTask> | ReturnType<typeof updateTasks> | ReturnType<typeof openSnackbar> | ReturnType<typeof
|
|
7
|
+
export type ActionType = ReturnType<typeof archiveTask> | ReturnType<typeof updateTasks> | ReturnType<typeof openSnackbar> | ReturnType<typeof archiveTaskSuccessOrFailure>;
|
|
9
8
|
export declare const archiveTaskEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => import("rxjs").Observable<ActionType>;
|
|
@@ -7,7 +7,6 @@ const snackbarReducer_1 = require("../../../../entity/snackbar/snackbarReducer")
|
|
|
7
7
|
const taskReducer_1 = require("../../../../entity/task/taskReducer");
|
|
8
8
|
const taskSelector_1 = require("../../../../entity/task/taskSelector");
|
|
9
9
|
const responsePayload_1 = require("../../../../responsePayload");
|
|
10
|
-
const taskListReducer_1 = require("../../taskListView/taskListReducer");
|
|
11
10
|
const taskDetailReducer_1 = require("../taskDetailReducer");
|
|
12
11
|
// Epic function to handle archiving of tasks
|
|
13
12
|
const archiveTaskEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(taskDetailReducer_1.archiveTask.match), (0, operators_1.mergeMap)((action) => handleArchiveTask(action.payload.taskId, state$, zeniAPI)));
|
|
@@ -30,8 +29,6 @@ const handleApiResponse = (response, taskId) => {
|
|
|
30
29
|
response.data.tasks.length > 0) {
|
|
31
30
|
const fetchActions = [
|
|
32
31
|
(0, taskReducer_1.updateTasks)(response.data.tasks),
|
|
33
|
-
(0, taskListReducer_1.removeTaskFromList)(taskId),
|
|
34
|
-
(0, taskListReducer_1.fetchTaskList)(),
|
|
35
32
|
(0, taskDetailReducer_1.archiveTaskSuccessOrFailure)({
|
|
36
33
|
fetchState: 'Completed',
|
|
37
34
|
taskId,
|
|
@@ -2,7 +2,6 @@ import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
|
2
2
|
import { openSnackbar } from '../../../../entity/snackbar/snackbarReducer';
|
|
3
3
|
import { RootState } from '../../../../reducer';
|
|
4
4
|
import { ZeniAPI } from '../../../../zeniAPI';
|
|
5
|
-
import { fetchTaskList, removeTaskFromList } from '../../taskListView/taskListReducer';
|
|
6
5
|
import { deleteTask, deleteTaskSuccessOrFailure } from '../taskDetailReducer';
|
|
7
|
-
export type ActionType = ReturnType<typeof deleteTask> | ReturnType<typeof openSnackbar> | ReturnType<typeof
|
|
6
|
+
export type ActionType = ReturnType<typeof deleteTask> | ReturnType<typeof openSnackbar> | ReturnType<typeof deleteTaskSuccessOrFailure>;
|
|
8
7
|
export declare const deleteTaskEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => import("rxjs").Observable<ActionType>;
|
|
@@ -5,7 +5,6 @@ const rxjs_1 = require("rxjs");
|
|
|
5
5
|
const operators_1 = require("rxjs/operators");
|
|
6
6
|
const snackbarReducer_1 = require("../../../../entity/snackbar/snackbarReducer");
|
|
7
7
|
const responsePayload_1 = require("../../../../responsePayload");
|
|
8
|
-
const taskListReducer_1 = require("../../taskListView/taskListReducer");
|
|
9
8
|
const taskDetailReducer_1 = require("../taskDetailReducer");
|
|
10
9
|
const deleteTaskEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(taskDetailReducer_1.deleteTask.match), (0, operators_1.mergeMap)((action) => {
|
|
11
10
|
const { taskId } = action.payload;
|
|
@@ -14,10 +13,6 @@ const deleteTaskEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operato
|
|
|
14
13
|
.pipe((0, operators_1.mergeMap)((response) => {
|
|
15
14
|
if ((0, responsePayload_1.isSuccessStatus)(response)) {
|
|
16
15
|
const actions = [];
|
|
17
|
-
if (taskId != null) {
|
|
18
|
-
actions.push((0, taskListReducer_1.removeTaskFromList)(taskId));
|
|
19
|
-
}
|
|
20
|
-
actions.push((0, taskListReducer_1.fetchTaskList)());
|
|
21
16
|
actions.push((0, taskDetailReducer_1.deleteTaskSuccessOrFailure)({ fetchState: 'Completed', taskId }));
|
|
22
17
|
return (0, rxjs_1.from)(actions);
|
|
23
18
|
}
|
|
@@ -18,14 +18,12 @@ const initializeTaskToLocalStoreEpic = (actions$, state$) => actions$.pipe((0, o
|
|
|
18
18
|
description: task.description,
|
|
19
19
|
status: task.status.code,
|
|
20
20
|
assignee: task.assignees,
|
|
21
|
-
groupAssignees: task.groupAssignees,
|
|
22
21
|
dueDate: task.dueDate,
|
|
23
22
|
priority: task.priority.code,
|
|
24
23
|
tagIds: task.tagIds,
|
|
25
24
|
fileIds: task.fileIds,
|
|
26
25
|
type: task.type,
|
|
27
26
|
recurringFrequency: task.recurringFrequency,
|
|
28
|
-
recurringDaysOfWeek: task.recurringDaysOfWeek,
|
|
29
27
|
recurringEndDateLocalData: {
|
|
30
28
|
recurringDatePickerOptionsType: 'date', // by default, date would be selected
|
|
31
29
|
recurringEndDate: task.recurringEndDate,
|
|
@@ -33,7 +31,6 @@ const initializeTaskToLocalStoreEpic = (actions$, state$) => actions$.pipe((0, o
|
|
|
33
31
|
savedRecurringEndDate: task.recurringEndDate,
|
|
34
32
|
recurringStartDate: task.recurringStartDate,
|
|
35
33
|
timeSpent: task.timeSpent,
|
|
36
|
-
isPrivate: task.isPrivate,
|
|
37
34
|
};
|
|
38
35
|
const actions = [
|
|
39
36
|
(0, taskDetailReducer_1.saveTaskUpdatesToLocalStore)({ taskDetailLocalData, taskId }),
|
|
@@ -95,14 +95,8 @@ const prepareTaskPayload = (state, taskId, taskGroupId) => {
|
|
|
95
95
|
recurring_start_date: localData.type.code === 'recurring'
|
|
96
96
|
? (localData.recurringStartDate?.format(formatZeniDateFY_1.DEFAULT_DATE_FORMAT) ?? null)
|
|
97
97
|
: null,
|
|
98
|
-
recurring_days_of_week: localData.type.code === 'recurring' &&
|
|
99
|
-
localData.recurringFrequency === 'semi_weekly'
|
|
100
|
-
? (localData.recurringDaysOfWeek ?? [])
|
|
101
|
-
: [],
|
|
102
98
|
sync_token: syncToken,
|
|
103
99
|
task_group_ids: taskGroupId != null ? [taskGroupId] : [],
|
|
104
100
|
time_spent: (0, formatMinutesToFromHHMM_1.convertHHMMStrToMinutes)(localData.timeSpent),
|
|
105
|
-
group_assignees: localData.groupAssignees,
|
|
106
|
-
...(taskId == null ? { is_private: localData.isPrivate ?? false } : {}),
|
|
107
101
|
};
|
|
108
102
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FetchStateAndError, ID } from '../../../commonStateTypes/common';
|
|
2
|
-
import {
|
|
2
|
+
import { PriorityCodeType, TaskStatusCodeType, TaskType } from '../../../entity/task/taskState';
|
|
3
3
|
import { ZeniDate } from '../../../zeniDayJS';
|
|
4
4
|
import { RecurringDatePickerOptions, RecurringFrequencyType } from '../../common/recurringViewHelper';
|
|
5
5
|
import { CommonHistoryView } from '../../spendManagement/commonHistoryView/commonHistory';
|
|
@@ -13,7 +13,6 @@ export interface EditTaskDetail {
|
|
|
13
13
|
deleteTaskStatus: FetchStateAndError;
|
|
14
14
|
fetchTaskStatus: FetchStateAndError;
|
|
15
15
|
saveStatus: FetchStateAndError;
|
|
16
|
-
snoozeStatus: FetchStateAndError;
|
|
17
16
|
taskDetailLocalData: EditTaskLocalData;
|
|
18
17
|
taskId?: ID;
|
|
19
18
|
}
|
|
@@ -21,7 +20,6 @@ export interface EditTaskLocalData {
|
|
|
21
20
|
assignee: ID[];
|
|
22
21
|
description: string;
|
|
23
22
|
fileIds: ID[];
|
|
24
|
-
groupAssignees: ID[];
|
|
25
23
|
name: string;
|
|
26
24
|
priority: PriorityCodeType;
|
|
27
25
|
recurringEndDateLocalData: {
|
|
@@ -34,8 +32,6 @@ export interface EditTaskLocalData {
|
|
|
34
32
|
timeSpent: string;
|
|
35
33
|
type: TaskType;
|
|
36
34
|
dueDate?: ZeniDate;
|
|
37
|
-
isPrivate?: boolean;
|
|
38
|
-
recurringDaysOfWeek?: DayOfWeek[];
|
|
39
35
|
recurringFrequency?: RecurringFrequencyType;
|
|
40
36
|
recurringStartDate?: ZeniDate;
|
|
41
37
|
savedRecurringEndDate?: ZeniDate;
|
|
@@ -6,7 +6,6 @@ exports.initialTaskDetailLocalData = {
|
|
|
6
6
|
description: '',
|
|
7
7
|
status: 'todo',
|
|
8
8
|
assignee: [],
|
|
9
|
-
groupAssignees: [],
|
|
10
9
|
dueDate: undefined,
|
|
11
10
|
priority: 'medium',
|
|
12
11
|
tagIds: [],
|
|
@@ -35,9 +34,5 @@ exports.initialTaskDetail = {
|
|
|
35
34
|
fetchState: 'Not-Started',
|
|
36
35
|
error: undefined,
|
|
37
36
|
},
|
|
38
|
-
snoozeStatus: {
|
|
39
|
-
fetchState: 'Not-Started',
|
|
40
|
-
error: undefined,
|
|
41
|
-
},
|
|
42
37
|
taskDetailLocalData: exports.initialTaskDetailLocalData,
|
|
43
38
|
};
|
|
@@ -40,16 +40,7 @@ export declare const fetchTaskDetailPage: import("@reduxjs/toolkit").ActionCreat
|
|
|
40
40
|
fetchState: FetchState;
|
|
41
41
|
error?: ZeniAPIStatus;
|
|
42
42
|
taskId?: ID;
|
|
43
|
-
}, "taskDetailView/deleteTaskSuccessOrFailure">,
|
|
44
|
-
taskId: string;
|
|
45
|
-
snoozedUntil: string;
|
|
46
|
-
}, "taskDetailView/snoozeTask", never, never>, snoozeTaskSuccessOrFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
47
|
-
fetchState: FetchState;
|
|
48
|
-
taskId: ID;
|
|
49
|
-
error?: ZeniAPIStatus;
|
|
50
|
-
}, "taskDetailView/snoozeTaskSuccessOrFailure">, unsnoozeTask: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[taskId: string], {
|
|
51
|
-
taskId: string;
|
|
52
|
-
}, "taskDetailView/unsnoozeTask", never, never>, fetchTaskHistory: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[taskId: string, cacheOverride?: any], {
|
|
43
|
+
}, "taskDetailView/deleteTaskSuccessOrFailure">, fetchTaskHistory: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[taskId: string, cacheOverride?: any], {
|
|
53
44
|
taskId: string;
|
|
54
45
|
cacheOverride: any;
|
|
55
46
|
}, "taskDetailView/fetchTaskHistory", never, never>, updateTaskHistory: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
@@ -4,7 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
var _a;
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.updateDeletedTagToLocalStore = exports.updateCreatedTagToLocalStore = exports.clearTaskDetail = exports.updateTaskHistoryFetchStatus = exports.updateTaskHistory = exports.fetchTaskHistory = exports.
|
|
7
|
+
exports.updateDeletedTagToLocalStore = exports.updateCreatedTagToLocalStore = exports.clearTaskDetail = exports.updateTaskHistoryFetchStatus = exports.updateTaskHistory = exports.fetchTaskHistory = exports.deleteTaskSuccessOrFailure = exports.removeTaskDetail = exports.deleteTask = exports.saveTaskSuccessOrFailure = exports.archiveTaskSuccessOrFailure = exports.archiveTask = exports.saveTaskDetail = exports.discardTaskUpdatesInLocalStore = exports.saveTaskUpdatesToLocalStore = exports.updateEditTaskFetchStatus = exports.initializeTaskToLocalStore = exports.fetchTaskDetail = exports.fetchTaskDetailPage = exports.initialState = void 0;
|
|
8
8
|
const toolkit_1 = require("@reduxjs/toolkit");
|
|
9
9
|
const get_1 = __importDefault(require("lodash/get"));
|
|
10
10
|
const commonHistory_1 = require("../../spendManagement/commonHistoryView/commonHistory");
|
|
@@ -156,11 +156,11 @@ const taskDetailView = (0, toolkit_1.createSlice)({
|
|
|
156
156
|
},
|
|
157
157
|
saveTaskSuccessOrFailure(draft, action) {
|
|
158
158
|
const { taskId, fetchState, error, newTaskId } = action.payload;
|
|
159
|
-
if (taskId != null
|
|
159
|
+
if (taskId != null) {
|
|
160
160
|
draft.editTaskStateById[taskId].saveStatus.fetchState = fetchState;
|
|
161
161
|
draft.editTaskStateById[taskId].saveStatus.error = error;
|
|
162
162
|
}
|
|
163
|
-
else
|
|
163
|
+
else {
|
|
164
164
|
if (newTaskId != null) {
|
|
165
165
|
draft.newTaskState.taskId = newTaskId;
|
|
166
166
|
}
|
|
@@ -189,10 +189,8 @@ const taskDetailView = (0, toolkit_1.createSlice)({
|
|
|
189
189
|
},
|
|
190
190
|
archiveTaskSuccessOrFailure(draft, action) {
|
|
191
191
|
const { taskId, fetchState, error } = action.payload;
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
draft.editTaskStateById[taskId].archiveStatus.error = error;
|
|
195
|
-
}
|
|
192
|
+
draft.editTaskStateById[taskId].archiveStatus.fetchState = fetchState;
|
|
193
|
+
draft.editTaskStateById[taskId].archiveStatus.error = error;
|
|
196
194
|
},
|
|
197
195
|
deleteTask: {
|
|
198
196
|
reducer(draft, action) {
|
|
@@ -225,70 +223,19 @@ const taskDetailView = (0, toolkit_1.createSlice)({
|
|
|
225
223
|
},
|
|
226
224
|
},
|
|
227
225
|
deleteTaskSuccessOrFailure(draft, action) {
|
|
228
|
-
if (action.payload.taskId != null
|
|
229
|
-
draft.editTaskStateById[action.payload.taskId] != null) {
|
|
226
|
+
if (action.payload.taskId != null) {
|
|
230
227
|
const { taskId } = action.payload;
|
|
231
228
|
draft.editTaskStateById[taskId].deleteTaskStatus.fetchState =
|
|
232
229
|
action.payload.fetchState;
|
|
233
230
|
draft.editTaskStateById[taskId].deleteTaskStatus.error =
|
|
234
231
|
action.payload.error;
|
|
235
232
|
}
|
|
236
|
-
else
|
|
233
|
+
else {
|
|
237
234
|
draft.newTaskState.deleteTaskStatus.fetchState =
|
|
238
235
|
action.payload.fetchState;
|
|
239
236
|
draft.newTaskState.deleteTaskStatus.error = action.payload.error;
|
|
240
237
|
}
|
|
241
238
|
},
|
|
242
|
-
snoozeTask: {
|
|
243
|
-
reducer(draft, action) {
|
|
244
|
-
const { taskId } = action.payload;
|
|
245
|
-
draft.editTaskStateById[taskId] = {
|
|
246
|
-
...(draft.editTaskStateById[taskId] != null
|
|
247
|
-
? draft.editTaskStateById[taskId]
|
|
248
|
-
: taskDetail_1.initialTaskDetail),
|
|
249
|
-
snoozeStatus: {
|
|
250
|
-
fetchState: 'In-Progress',
|
|
251
|
-
error: undefined,
|
|
252
|
-
},
|
|
253
|
-
};
|
|
254
|
-
},
|
|
255
|
-
prepare(taskId, snoozedUntil) {
|
|
256
|
-
return {
|
|
257
|
-
payload: {
|
|
258
|
-
taskId,
|
|
259
|
-
snoozedUntil,
|
|
260
|
-
},
|
|
261
|
-
};
|
|
262
|
-
},
|
|
263
|
-
},
|
|
264
|
-
snoozeTaskSuccessOrFailure(draft, action) {
|
|
265
|
-
const { taskId, fetchState, error } = action.payload;
|
|
266
|
-
if (draft.editTaskStateById[taskId] != null) {
|
|
267
|
-
draft.editTaskStateById[taskId].snoozeStatus.fetchState = fetchState;
|
|
268
|
-
draft.editTaskStateById[taskId].snoozeStatus.error = error;
|
|
269
|
-
}
|
|
270
|
-
},
|
|
271
|
-
unsnoozeTask: {
|
|
272
|
-
reducer(draft, action) {
|
|
273
|
-
const { taskId } = action.payload;
|
|
274
|
-
draft.editTaskStateById[taskId] = {
|
|
275
|
-
...(draft.editTaskStateById[taskId] != null
|
|
276
|
-
? draft.editTaskStateById[taskId]
|
|
277
|
-
: taskDetail_1.initialTaskDetail),
|
|
278
|
-
snoozeStatus: {
|
|
279
|
-
fetchState: 'In-Progress',
|
|
280
|
-
error: undefined,
|
|
281
|
-
},
|
|
282
|
-
};
|
|
283
|
-
},
|
|
284
|
-
prepare(taskId) {
|
|
285
|
-
return {
|
|
286
|
-
payload: {
|
|
287
|
-
taskId,
|
|
288
|
-
},
|
|
289
|
-
};
|
|
290
|
-
},
|
|
291
|
-
},
|
|
292
239
|
fetchTaskHistory: {
|
|
293
240
|
reducer(draft, action) {
|
|
294
241
|
const { taskId, cacheOverride } = action.payload;
|
|
@@ -330,5 +277,5 @@ const taskDetailView = (0, toolkit_1.createSlice)({
|
|
|
330
277
|
},
|
|
331
278
|
},
|
|
332
279
|
});
|
|
333
|
-
_a = taskDetailView.actions, exports.fetchTaskDetailPage = _a.fetchTaskDetailPage, exports.fetchTaskDetail = _a.fetchTaskDetail, exports.initializeTaskToLocalStore = _a.initializeTaskToLocalStore, exports.updateEditTaskFetchStatus = _a.updateEditTaskFetchStatus, exports.saveTaskUpdatesToLocalStore = _a.saveTaskUpdatesToLocalStore, exports.discardTaskUpdatesInLocalStore = _a.discardTaskUpdatesInLocalStore, exports.saveTaskDetail = _a.saveTaskDetail, exports.archiveTask = _a.archiveTask, exports.archiveTaskSuccessOrFailure = _a.archiveTaskSuccessOrFailure, exports.saveTaskSuccessOrFailure = _a.saveTaskSuccessOrFailure, exports.deleteTask = _a.deleteTask, exports.removeTaskDetail = _a.removeTaskDetail, exports.deleteTaskSuccessOrFailure = _a.deleteTaskSuccessOrFailure, exports.
|
|
280
|
+
_a = taskDetailView.actions, exports.fetchTaskDetailPage = _a.fetchTaskDetailPage, exports.fetchTaskDetail = _a.fetchTaskDetail, exports.initializeTaskToLocalStore = _a.initializeTaskToLocalStore, exports.updateEditTaskFetchStatus = _a.updateEditTaskFetchStatus, exports.saveTaskUpdatesToLocalStore = _a.saveTaskUpdatesToLocalStore, exports.discardTaskUpdatesInLocalStore = _a.discardTaskUpdatesInLocalStore, exports.saveTaskDetail = _a.saveTaskDetail, exports.archiveTask = _a.archiveTask, exports.archiveTaskSuccessOrFailure = _a.archiveTaskSuccessOrFailure, exports.saveTaskSuccessOrFailure = _a.saveTaskSuccessOrFailure, exports.deleteTask = _a.deleteTask, exports.removeTaskDetail = _a.removeTaskDetail, exports.deleteTaskSuccessOrFailure = _a.deleteTaskSuccessOrFailure, exports.fetchTaskHistory = _a.fetchTaskHistory, exports.updateTaskHistory = _a.updateTaskHistory, exports.updateTaskHistoryFetchStatus = _a.updateTaskHistoryFetchStatus, exports.clearTaskDetail = _a.clearTaskDetail, exports.updateCreatedTagToLocalStore = _a.updateCreatedTagToLocalStore, exports.updateDeletedTagToLocalStore = _a.updateDeletedTagToLocalStore;
|
|
334
281
|
exports.default = taskDetailView.reducer;
|
|
@@ -4,7 +4,6 @@ import { Class } from '../../../entity/class/classState';
|
|
|
4
4
|
import { File } from '../../../entity/file/fileState';
|
|
5
5
|
import { TaskPriority, TaskStatus } from '../../../entity/task/taskState';
|
|
6
6
|
import { RootState } from '../../../reducer';
|
|
7
|
-
import { ZeniDate } from '../../../zeniDayJS';
|
|
8
7
|
import { UserAndRole } from '../../companyView/types/userAndRole';
|
|
9
8
|
import { HistoricEvent } from '../../spendManagement/commonHistoryView/commonHistory';
|
|
10
9
|
import { UserListSelectorView } from '../../userListView/userListViewSelector';
|
|
@@ -19,11 +18,6 @@ export interface TaskDetailSelectorView extends SelectorView {
|
|
|
19
18
|
updateFileStatusById: Record<ID, FetchStateAndError | undefined>;
|
|
20
19
|
userList: UserListSelectorView;
|
|
21
20
|
createdByUser?: UserAndRole;
|
|
22
|
-
isArchived?: boolean;
|
|
23
|
-
isDeleted?: boolean;
|
|
24
|
-
recurringSourceTaskId?: ID;
|
|
25
|
-
snoozedUntil?: ZeniDate | null;
|
|
26
|
-
taskGroupId?: ID;
|
|
27
21
|
}
|
|
28
22
|
export declare const getTaskDetail: (state: RootState, taskId?: ID) => TaskDetailSelectorView;
|
|
29
23
|
export declare const allTaskStatus: TaskStatus[];
|
|
@@ -28,21 +28,11 @@ const getTaskDetail = (state, taskId) => {
|
|
|
28
28
|
};
|
|
29
29
|
let taskHistory = [];
|
|
30
30
|
let createdByUser = undefined;
|
|
31
|
-
let isArchived = undefined;
|
|
32
|
-
let isDeleted = undefined;
|
|
33
|
-
let recurringSourceTaskId = undefined;
|
|
34
|
-
let snoozedUntil = undefined;
|
|
35
|
-
let taskGroupId = undefined;
|
|
36
31
|
if (taskId != null && sourceTaskDetail != null) {
|
|
37
32
|
const taskEntity = (0, taskSelector_1.getTaskById)(taskState, taskId);
|
|
38
33
|
const fileIdsInEntity = taskEntity?.fileIds ?? [];
|
|
39
34
|
if (taskEntity != null) {
|
|
40
35
|
createdByUser = (0, userAndRole_1.getUserAndUserRole)(userState, userRoleState, addressState, taskEntity.createdBy);
|
|
41
|
-
isArchived = taskEntity.isArchived;
|
|
42
|
-
isDeleted = taskEntity.isDeleted;
|
|
43
|
-
recurringSourceTaskId = taskEntity.recurringSourceTaskId;
|
|
44
|
-
snoozedUntil = taskEntity.snoozedUntil;
|
|
45
|
-
taskGroupId = taskEntity.taskGroupIds[0];
|
|
46
36
|
}
|
|
47
37
|
if (fileIdsInEntity.length > 0) {
|
|
48
38
|
fetchStatus = (0, reduceFetchState_1.reduceFetchState)([
|
|
@@ -90,12 +80,7 @@ const getTaskDetail = (state, taskId) => {
|
|
|
90
80
|
error: fetchStatus.error,
|
|
91
81
|
version: 0,
|
|
92
82
|
createdByUser,
|
|
93
|
-
isArchived,
|
|
94
|
-
isDeleted,
|
|
95
|
-
recurringSourceTaskId,
|
|
96
83
|
showTaskDetailFormFooter,
|
|
97
|
-
snoozedUntil,
|
|
98
|
-
taskGroupId,
|
|
99
84
|
};
|
|
100
85
|
};
|
|
101
86
|
exports.getTaskDetail = getTaskDetail;
|
|
@@ -150,13 +135,11 @@ const showFormFooter = (taskDetailLocalData, taskDetailInStore) => {
|
|
|
150
135
|
taskDetailLocalData.status !== taskDetailInStore.status.code ||
|
|
151
136
|
!(0, isEqual_1.default)(taskDetailInStore.tagIds, taskDetailLocalData.tagIds) ||
|
|
152
137
|
!(0, isEqual_1.default)(taskDetailLocalData.assignee, taskDetailInStore?.assignees ?? []) ||
|
|
153
|
-
!(0, isEqual_1.default)(taskDetailLocalData.groupAssignees, taskDetailInStore?.groupAssignees ?? []) ||
|
|
154
138
|
!(0, isEqual_1.default)(taskDetailLocalData.fileIds, taskDetailInStore.fileIds ?? []) ||
|
|
155
139
|
!(0, isEqual_1.default)(taskDetailLocalData.dueDate, taskDetailInStore.dueDate) ||
|
|
156
140
|
!(0, isEqual_1.default)(taskDetailLocalData.type, taskDetailInStore.type) ||
|
|
157
141
|
!(0, isEqual_1.default)(taskDetailLocalData.savedRecurringEndDate, taskDetailInStore.recurringEndDate) ||
|
|
158
142
|
!(0, isEqual_1.default)(taskDetailLocalData.recurringFrequency, taskDetailInStore.recurringFrequency) ||
|
|
159
|
-
!(0, isEqual_1.default)(taskDetailLocalData.recurringDaysOfWeek, taskDetailInStore.recurringDaysOfWeek) ||
|
|
160
143
|
!(0, isEqual_1.default)(taskDetailLocalData.recurringStartDate, taskDetailInStore.recurringStartDate) ||
|
|
161
144
|
!(0, isEqual_1.default)(taskDetailLocalData.timeSpent, taskDetailInStore.timeSpent)) {
|
|
162
145
|
return true;
|
|
@@ -5,23 +5,23 @@ import { updateTasks } from '../../../../entity/task/taskReducer';
|
|
|
5
5
|
import { Task } from '../../../../entity/task/taskState';
|
|
6
6
|
import { RootState } from '../../../../reducer';
|
|
7
7
|
import { ZeniAPI } from '../../../../zeniAPI';
|
|
8
|
-
import { bulkUpdateTaskList,
|
|
9
|
-
export type ActionType = ReturnType<typeof bulkUpdateTaskList> | ReturnType<typeof
|
|
10
|
-
export declare const bulkUpdateTaskListEpic: (actions$: ActionsObservable<ActionType>,
|
|
8
|
+
import { bulkUpdateTaskList, updateTasksListOnBulkUpdateTasksFailure, updateTasksListOnBulkUpdateTasksSuccess } from '../taskListReducer';
|
|
9
|
+
export type ActionType = ReturnType<typeof bulkUpdateTaskList> | ReturnType<typeof updateTasks> | ReturnType<typeof updateTasksListOnBulkUpdateTasksFailure> | ReturnType<typeof updateTasksListOnBulkUpdateTasksSuccess>;
|
|
10
|
+
export declare const bulkUpdateTaskListEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
11
|
+
/**
|
|
12
|
+
* Helpers
|
|
13
|
+
*/
|
|
11
14
|
interface UpdateTaskPayload {
|
|
12
15
|
assignees: string[];
|
|
13
16
|
description: string;
|
|
14
17
|
due_date: string | null;
|
|
15
18
|
file_ids: ID[];
|
|
16
19
|
group_assignees: string[];
|
|
17
|
-
is_archived: boolean;
|
|
18
|
-
is_deleted: boolean;
|
|
19
20
|
name: string;
|
|
20
21
|
priority: string;
|
|
21
22
|
recurring_end_date: string | null;
|
|
22
23
|
recurring_frequency: string | null;
|
|
23
24
|
recurring_start_date: string | null;
|
|
24
|
-
snoozed_until: string | null;
|
|
25
25
|
status: string;
|
|
26
26
|
tags: string[];
|
|
27
27
|
task_group_ids: string[];
|
|
@@ -29,5 +29,6 @@ interface UpdateTaskPayload {
|
|
|
29
29
|
time_spent: number;
|
|
30
30
|
type: string;
|
|
31
31
|
}
|
|
32
|
+
export declare const getTasksListPayload: (state: RootState, taskIds: ID[], updates: Partial<Task>) => UpdateTaskPayload[];
|
|
32
33
|
export declare const getTaskPayload: (state: RootState, taskId: ID, updates: Partial<Task>) => UpdateTaskPayload;
|
|
33
34
|
export {};
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.getTaskPayload = exports.bulkUpdateTaskListEpic = void 0;
|
|
6
|
+
exports.getTaskPayload = exports.getTasksListPayload = exports.bulkUpdateTaskListEpic = void 0;
|
|
7
7
|
const get_1 = __importDefault(require("lodash/get"));
|
|
8
8
|
const rxjs_1 = require("rxjs");
|
|
9
9
|
const operators_1 = require("rxjs/operators");
|
|
@@ -12,25 +12,20 @@ const formatZeniDateFY_1 = require("../../../../commonStateTypes/fiscalYearHelpe
|
|
|
12
12
|
const taskReducer_1 = require("../../../../entity/task/taskReducer");
|
|
13
13
|
const responsePayload_1 = require("../../../../responsePayload");
|
|
14
14
|
const taskListReducer_1 = require("../taskListReducer");
|
|
15
|
-
const bulkUpdateTaskListEpic = (actions$,
|
|
15
|
+
const bulkUpdateTaskListEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(taskListReducer_1.bulkUpdateTaskList.match), (0, operators_1.switchMap)((action) => {
|
|
16
|
+
const state = state$.value;
|
|
16
17
|
const { taskIds, updates, groupId } = action.payload;
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}
|
|
21
|
-
const payload = { task_ids: taskIds, updates: bulkUpdates };
|
|
18
|
+
const payload = {
|
|
19
|
+
tasks: (0, exports.getTasksListPayload)(state, taskIds, updates),
|
|
20
|
+
};
|
|
22
21
|
return zeniAPI
|
|
23
|
-
.putAndGetJSON(`${zeniAPI.apiEndPoints.taskMicroServiceBaseUrl}/1.0/task-manager/tasks
|
|
22
|
+
.putAndGetJSON(`${zeniAPI.apiEndPoints.taskMicroServiceBaseUrl}/1.0/task-manager/tasks`, payload)
|
|
24
23
|
.pipe((0, operators_1.mergeMap)((response) => {
|
|
25
24
|
if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
|
|
26
|
-
const removeFromList = updates.isArchived === true ||
|
|
27
|
-
updates.isDeleted === true ||
|
|
28
|
-
('snoozedUntil' in updates && updates.snoozedUntil == null);
|
|
29
25
|
return (0, rxjs_1.of)((0, taskReducer_1.updateTasks)(response.data.tasks), (0, taskListReducer_1.updateTasksListOnBulkUpdateTasksSuccess)({
|
|
30
26
|
taskIds,
|
|
31
27
|
groupId,
|
|
32
|
-
|
|
33
|
-
}), (0, taskListReducer_1.fetchTaskList)());
|
|
28
|
+
}));
|
|
34
29
|
}
|
|
35
30
|
else {
|
|
36
31
|
return (0, rxjs_1.of)((0, taskListReducer_1.updateTasksListOnBulkUpdateTasksFailure)({
|
|
@@ -45,47 +40,21 @@ const bulkUpdateTaskListEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0,
|
|
|
45
40
|
}));
|
|
46
41
|
}));
|
|
47
42
|
exports.bulkUpdateTaskListEpic = bulkUpdateTaskListEpic;
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
}
|
|
62
|
-
if (updates.groupAssignees != null) {
|
|
63
|
-
payload.group_assignees = updates.groupAssignees;
|
|
64
|
-
}
|
|
65
|
-
if (updates.dueDate != null) {
|
|
66
|
-
payload.due_date = updates.dueDate.format(formatZeniDateFY_1.DEFAULT_DATE_FORMAT);
|
|
67
|
-
}
|
|
68
|
-
if (updates.tagIds != null) {
|
|
69
|
-
payload.tags = updates.tagIds;
|
|
70
|
-
}
|
|
71
|
-
if (updates.timeSpent != null) {
|
|
72
|
-
payload.time_spent = (0, formatMinutesToFromHHMM_1.convertHHMMStrToMinutes)(updates.timeSpent.replace(/\D/g, ''));
|
|
73
|
-
}
|
|
74
|
-
if (updates.isArchived != null) {
|
|
75
|
-
payload.is_archived = updates.isArchived;
|
|
76
|
-
}
|
|
77
|
-
if (updates.isDeleted != null) {
|
|
78
|
-
payload.is_deleted = updates.isDeleted;
|
|
79
|
-
}
|
|
80
|
-
// Bulk snooze is not supported — only bulk unsnooze (clear all snooze fields)
|
|
81
|
-
if ('snoozedUntil' in updates) {
|
|
82
|
-
payload.snoozed_until = null;
|
|
83
|
-
payload.snoozed_by = null;
|
|
84
|
-
payload.snoozed_at = null;
|
|
85
|
-
payload.is_snooze_notification_sent = false;
|
|
86
|
-
}
|
|
87
|
-
return payload;
|
|
43
|
+
const getTasksListPayload = (state, taskIds, updates) => {
|
|
44
|
+
const { taskState } = state;
|
|
45
|
+
const tasksList = taskIds
|
|
46
|
+
.map((taskId) => {
|
|
47
|
+
const task = (0, get_1.default)(taskState.taskByID, taskId);
|
|
48
|
+
return {
|
|
49
|
+
...task,
|
|
50
|
+
...updates,
|
|
51
|
+
};
|
|
52
|
+
})
|
|
53
|
+
.filter((task) => task != null);
|
|
54
|
+
const tasksPayload = tasksList.map((task) => toTaskPayload(state, task));
|
|
55
|
+
return tasksPayload;
|
|
88
56
|
};
|
|
57
|
+
exports.getTasksListPayload = getTasksListPayload;
|
|
89
58
|
const getTaskPayload = (state, taskId, updates) => {
|
|
90
59
|
const { taskState } = state;
|
|
91
60
|
const taskData = (0, get_1.default)(taskState.taskByID, taskId);
|
|
@@ -111,9 +80,6 @@ const toTaskPayload = (state, task) => {
|
|
|
111
80
|
assignees: task.assignees,
|
|
112
81
|
description: task.description,
|
|
113
82
|
group_assignees: task.groupAssignees,
|
|
114
|
-
is_archived: task.isArchived,
|
|
115
|
-
is_deleted: task.isDeleted,
|
|
116
|
-
snoozed_until: task.snoozedUntil != null ? task.snoozedUntil.toISOString() : null,
|
|
117
83
|
due_date: task.dueDate != null ? task.dueDate.format(formatZeniDateFY_1.DEFAULT_DATE_FORMAT) : null,
|
|
118
84
|
priority: task.priority.code,
|
|
119
85
|
status: task.status.code,
|
|
@@ -14,7 +14,6 @@ const dragNDropTasksEpic = (actions$, state$) => actions$.pipe((0, operators_1.f
|
|
|
14
14
|
(0, taskListReducer_1.updateTasksListOnBulkUpdateTasksSuccess)({
|
|
15
15
|
taskIds,
|
|
16
16
|
groupId,
|
|
17
|
-
removeFromList: false,
|
|
18
17
|
}),
|
|
19
18
|
(0, taskListReducer_1.bulkUpdateTaskList)(taskIds, groupId, updates),
|
|
20
19
|
];
|