@zeniai/client-epic-state 5.0.36 → 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 -3
- package/lib/entity/task/taskPayload.js +0 -5
- package/lib/entity/task/taskState.d.ts +0 -3
- package/lib/entity/tenant/clearAllEpic.d.ts +2 -4
- package/lib/entity/tenant/clearAllEpic.js +0 -4
- package/lib/entity/transaction/stateTypes/attachment.d.ts +2 -2
- package/lib/epic.d.ts +1 -7
- package/lib/epic.js +1 -7
- 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 +0 -5
- package/lib/esm/entity/tenant/clearAllEpic.js +0 -4
- package/lib/esm/epic.js +1 -7
- package/lib/esm/index.js +4 -10
- package/lib/esm/init.js +16 -71
- package/lib/esm/reducer.js +0 -6
- 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 -1
- package/lib/esm/view/taskManager/taskDetailView/epics/saveTaskDetailEpic.js +0 -1
- package/lib/esm/view/taskManager/taskDetailView/taskDetail.js +0 -4
- package/lib/esm/view/taskManager/taskDetailView/taskDetailReducer.js +7 -60
- package/lib/esm/view/taskManager/taskDetailView/taskDetailSelector.js +0 -12
- 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 +4 -12
- package/lib/index.js +5 -28
- package/lib/init.d.ts +3 -5
- package/lib/init.js +16 -71
- package/lib/reducer.d.ts +0 -6
- package/lib/reducer.js +0 -6
- package/lib/tsconfig.typecheck.tsbuildinfo +1 -1
- 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 -1
- package/lib/view/taskManager/taskDetailView/epics/saveTaskDetailEpic.js +0 -1
- package/lib/view/taskManager/taskDetailView/taskDetail.d.ts +0 -2
- package/lib/view/taskManager/taskDetailView/taskDetail.js +0 -4
- 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 -5
- package/lib/view/taskManager/taskDetailView/taskDetailSelector.js +0 -12
- 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/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/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
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
|
}
|
|
@@ -31,7 +31,6 @@ const initializeTaskToLocalStoreEpic = (actions$, state$) => actions$.pipe((0, o
|
|
|
31
31
|
savedRecurringEndDate: task.recurringEndDate,
|
|
32
32
|
recurringStartDate: task.recurringStartDate,
|
|
33
33
|
timeSpent: task.timeSpent,
|
|
34
|
-
isPrivate: task.isPrivate,
|
|
35
34
|
};
|
|
36
35
|
const actions = [
|
|
37
36
|
(0, taskDetailReducer_1.saveTaskUpdatesToLocalStore)({ taskDetailLocalData, taskId }),
|
|
@@ -98,6 +98,5 @@ const prepareTaskPayload = (state, taskId, taskGroupId) => {
|
|
|
98
98
|
sync_token: syncToken,
|
|
99
99
|
task_group_ids: taskGroupId != null ? [taskGroupId] : [],
|
|
100
100
|
time_spent: (0, formatMinutesToFromHHMM_1.convertHHMMStrToMinutes)(localData.timeSpent),
|
|
101
|
-
...(taskId == null ? { is_private: localData.isPrivate ?? false } : {}),
|
|
102
101
|
};
|
|
103
102
|
};
|
|
@@ -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
|
}
|
|
@@ -33,7 +32,6 @@ export interface EditTaskLocalData {
|
|
|
33
32
|
timeSpent: string;
|
|
34
33
|
type: TaskType;
|
|
35
34
|
dueDate?: ZeniDate;
|
|
36
|
-
isPrivate?: boolean;
|
|
37
35
|
recurringFrequency?: RecurringFrequencyType;
|
|
38
36
|
recurringStartDate?: ZeniDate;
|
|
39
37
|
savedRecurringEndDate?: ZeniDate;
|
|
@@ -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,10 +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
21
|
}
|
|
27
22
|
export declare const getTaskDetail: (state: RootState, taskId?: ID) => TaskDetailSelectorView;
|
|
28
23
|
export declare const allTaskStatus: TaskStatus[];
|
|
@@ -28,19 +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
31
|
if (taskId != null && sourceTaskDetail != null) {
|
|
36
32
|
const taskEntity = (0, taskSelector_1.getTaskById)(taskState, taskId);
|
|
37
33
|
const fileIdsInEntity = taskEntity?.fileIds ?? [];
|
|
38
34
|
if (taskEntity != null) {
|
|
39
35
|
createdByUser = (0, userAndRole_1.getUserAndUserRole)(userState, userRoleState, addressState, taskEntity.createdBy);
|
|
40
|
-
isArchived = taskEntity.isArchived;
|
|
41
|
-
isDeleted = taskEntity.isDeleted;
|
|
42
|
-
recurringSourceTaskId = taskEntity.recurringSourceTaskId;
|
|
43
|
-
snoozedUntil = taskEntity.snoozedUntil;
|
|
44
36
|
}
|
|
45
37
|
if (fileIdsInEntity.length > 0) {
|
|
46
38
|
fetchStatus = (0, reduceFetchState_1.reduceFetchState)([
|
|
@@ -88,11 +80,7 @@ const getTaskDetail = (state, taskId) => {
|
|
|
88
80
|
error: fetchStatus.error,
|
|
89
81
|
version: 0,
|
|
90
82
|
createdByUser,
|
|
91
|
-
isArchived,
|
|
92
|
-
isDeleted,
|
|
93
|
-
recurringSourceTaskId,
|
|
94
83
|
showTaskDetailFormFooter,
|
|
95
|
-
snoozedUntil,
|
|
96
84
|
};
|
|
97
85
|
};
|
|
98
86
|
exports.getTaskDetail = getTaskDetail;
|
|
@@ -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
|
];
|
|
@@ -12,19 +12,10 @@ const fetchTaskListEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, oper
|
|
|
12
12
|
.getJSON(`${zeniAPI.apiEndPoints.taskMicroServiceBaseUrl}/1.0/task-manager/tasks?query=${encodeURIComponent(`{"task_type": "all"}`)}`)
|
|
13
13
|
.pipe((0, operators_1.mergeMap)((response) => {
|
|
14
14
|
if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
...(archived ?? []),
|
|
20
|
-
...(snoozed ?? []),
|
|
21
|
-
];
|
|
22
|
-
return (0, rxjs_1.of)((0, taskReducer_1.updateTasks)(allTasks), (0, taskListReducer_1.updateTaskList)({
|
|
23
|
-
data: tasks,
|
|
24
|
-
deleted: deleted ?? [],
|
|
25
|
-
archived: archived ?? [],
|
|
26
|
-
snoozed: snoozed ?? [],
|
|
27
|
-
}), (0, tagReducer_1.updateTags)(allTasks.map((task) => task.tags).flat()));
|
|
15
|
+
return (0, rxjs_1.of)((0, taskReducer_1.updateTasks)(response.data.tasks), (0, taskListReducer_1.updateTaskList)({
|
|
16
|
+
data: response.data.tasks,
|
|
17
|
+
updateType: 'replace',
|
|
18
|
+
}), (0, tagReducer_1.updateTags)(response.data.tasks.map((task) => task.tags).flat()));
|
|
28
19
|
}
|
|
29
20
|
else {
|
|
30
21
|
return (0, rxjs_1.of)((0, taskListReducer_1.updateTaskListFetchStatus)({
|
|
@@ -11,10 +11,9 @@ const updateTaskFromListViewEpic = (actions$, state$, zeniAPI) => actions$.pipe(
|
|
|
11
11
|
const state = state$.value;
|
|
12
12
|
const { task, updates } = action.payload;
|
|
13
13
|
const taskId = task.id;
|
|
14
|
-
|
|
15
|
-
const { snoozed_until: _snoozedUntil, ...taskData } = (0, bulkUpdateTaskListEpic_1.getTaskPayload)(state, taskId, updates);
|
|
14
|
+
const taskData = (0, bulkUpdateTaskListEpic_1.getTaskPayload)(state, taskId, updates);
|
|
16
15
|
return zeniAPI
|
|
17
|
-
.putAndGetJSON(`${zeniAPI.apiEndPoints.taskMicroServiceBaseUrl}/1.0/task-manager/tasks/${taskId}`, taskData)
|
|
16
|
+
.putAndGetJSON(`${zeniAPI.apiEndPoints.taskMicroServiceBaseUrl}/1.0/task-manager/tasks/${taskId}`, { ...taskData })
|
|
18
17
|
.pipe((0, operators_1.mergeMap)((response) => {
|
|
19
18
|
if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
|
|
20
19
|
return (0, rxjs_1.from)([
|
|
@@ -3,17 +3,6 @@ import { PriorityCodeType, TaskStatusCodeType } from '../../../entity/task/taskS
|
|
|
3
3
|
import { ZeniDate } from '../../../zeniDayJS';
|
|
4
4
|
import { SpendManagementUIState } from '../../spendManagement/billPay/billList/billListState';
|
|
5
5
|
import { CategoryCombinationOperator, FilterCategoryType } from '../../spendManagement/spendManagementFilterHelpers';
|
|
6
|
-
export declare const ALL_TASK_LIST_TABS: readonly ["live", "archived", "deleted", "snoozed"];
|
|
7
|
-
export type TaskListTab = (typeof ALL_TASK_LIST_TABS)[number];
|
|
8
|
-
export interface TaskListTabData {
|
|
9
|
-
taskIds: ID[];
|
|
10
|
-
taskIdsByAssignees: Record<ID, ID[]>;
|
|
11
|
-
taskIdsByDueDate: Record<DueDateGroupKey, ID[]>;
|
|
12
|
-
taskIdsByGroupsIds: Record<ID, ID[]>;
|
|
13
|
-
taskIdsByPriority: Record<PriorityCodeType, ID[]>;
|
|
14
|
-
taskIdsByStatus: Record<TaskStatusCodeType, ID[]>;
|
|
15
|
-
taskIdsByTags: Record<ID, ID[]>;
|
|
16
|
-
}
|
|
17
6
|
export interface TaskListLocalData {
|
|
18
7
|
defaultTaskGroupId: ID | null;
|
|
19
8
|
existingTaskGroupNamesByGroupId: Record<ID, string>;
|
|
@@ -24,8 +13,6 @@ export declare const DUE_DATE_GROUP_KEYS: readonly ["overdue", "today", "this_we
|
|
|
24
13
|
export declare const toDueDateGroupKeyType: (v: string) => "overdue" | "today" | "this_week" | "this_month" | "upcoming";
|
|
25
14
|
export declare type DueDateGroupKey = ReturnType<typeof toDueDateGroupKeyType>;
|
|
26
15
|
export interface TaskListState extends FetchedState {
|
|
27
|
-
byTab: Record<TaskListTab, TaskListTabData>;
|
|
28
|
-
currentTab: TaskListTab;
|
|
29
16
|
filters: TaskListFilters;
|
|
30
17
|
localData: TaskListLocalData;
|
|
31
18
|
taskIds: ID[];
|
|
@@ -58,7 +45,7 @@ export interface TaskListUIState extends SpendManagementUIState {
|
|
|
58
45
|
searchText: string;
|
|
59
46
|
sortKey: TaskListViewSortKey;
|
|
60
47
|
}
|
|
61
|
-
declare const toTaskListSortKeyType: (v: string) => "status" | "name" | "dueDate" | "tag" | "priority" | "timeSpent" | "assignee" | "creationDate"
|
|
48
|
+
declare const toTaskListSortKeyType: (v: string) => "status" | "name" | "dueDate" | "tag" | "priority" | "timeSpent" | "assignee" | "creationDate";
|
|
62
49
|
export declare type TaskListViewSortKey = ReturnType<typeof toTaskListSortKeyType>;
|
|
63
50
|
export declare const TASK_LIST_FILTER_CATEGORIES: TaskListFilterCategoryOption[];
|
|
64
51
|
interface TaskListFilterCategoryOption {
|
|
@@ -1,13 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TASK_LIST_GROUP_BY_CATEGORIES = exports.TASK_LIST_FILTER_CATEGORIES = exports.toTaskListGroupByKeyTypeStrict = exports.toTaskListGroupByKeyType = exports.TASK_LIST_GROUP_BY_KEYS = exports.toDueDateGroupKeyType = exports.DUE_DATE_GROUP_KEYS =
|
|
3
|
+
exports.TASK_LIST_GROUP_BY_CATEGORIES = exports.TASK_LIST_FILTER_CATEGORIES = exports.toTaskListGroupByKeyTypeStrict = exports.toTaskListGroupByKeyType = exports.TASK_LIST_GROUP_BY_KEYS = exports.toDueDateGroupKeyType = exports.DUE_DATE_GROUP_KEYS = void 0;
|
|
4
4
|
const stringToUnion_1 = require("../../../commonStateTypes/stringToUnion");
|
|
5
|
-
exports.ALL_TASK_LIST_TABS = [
|
|
6
|
-
'live',
|
|
7
|
-
'archived',
|
|
8
|
-
'deleted',
|
|
9
|
-
'snoozed',
|
|
10
|
-
];
|
|
11
5
|
exports.DUE_DATE_GROUP_KEYS = [
|
|
12
6
|
'overdue',
|
|
13
7
|
'today',
|
|
@@ -38,7 +32,6 @@ const ALL_TASK_LIST_SORT_KEYS = [
|
|
|
38
32
|
'status',
|
|
39
33
|
'priority',
|
|
40
34
|
'timeSpent',
|
|
41
|
-
'visibility',
|
|
42
35
|
];
|
|
43
36
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
44
37
|
const toTaskListSortKeyType = (v) => (0, stringToUnion_1.stringToUnion)(v, ALL_TASK_LIST_SORT_KEYS);
|
|
@@ -2,9 +2,6 @@ import { TaskPayload } from '../../../entity/task/taskPayload';
|
|
|
2
2
|
import { ZeniAPIResponse } from '../../../responsePayload';
|
|
3
3
|
interface FetchTaskListPayload {
|
|
4
4
|
tasks: TaskPayload[];
|
|
5
|
-
archived?: TaskPayload[];
|
|
6
|
-
deleted?: TaskPayload[];
|
|
7
|
-
snoozed?: TaskPayload[];
|
|
8
5
|
}
|
|
9
6
|
export type FetchTaskListResponse = ZeniAPIResponse<FetchTaskListPayload>;
|
|
10
7
|
export {};
|