@zeniai/client-epic-state 5.0.13 → 5.0.14-betaRR01
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/coreEpics.js +2 -1
- package/lib/entity/file/fileState.d.ts +4 -4
- package/lib/entity/file/fileState.js +4 -0
- package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
- package/lib/entity/snackbar/snackbarTypes.js +2 -0
- package/lib/entity/task/taskPayload.d.ts +3 -0
- package/lib/entity/task/taskPayload.js +5 -0
- package/lib/entity/task/taskState.d.ts +3 -0
- package/lib/entity/tenant/SessionManager.d.ts +56 -0
- package/lib/entity/tenant/SessionManager.js +310 -0
- package/lib/entity/tenant/epic/sessionHeartbeatEpic.d.ts +16 -0
- package/lib/entity/tenant/epic/sessionHeartbeatEpic.js +25 -0
- package/lib/entity/tenant/sessionTypes.d.ts +26 -0
- package/lib/entity/tenant/sessionTypes.js +12 -0
- package/lib/entity/tenant/tenantReducer.d.ts +5 -1
- package/lib/entity/tenant/tenantReducer.js +23 -2
- package/lib/entity/tenant/tenantState.d.ts +1 -0
- package/lib/entity/transaction/stateTypes/attachment.d.ts +2 -2
- package/lib/epic.d.ts +9 -6
- package/lib/epic.js +9 -6
- package/lib/esm/coreEpics.js +2 -1
- package/lib/esm/entity/file/fileState.js +4 -0
- package/lib/esm/entity/snackbar/snackbarTypes.js +2 -0
- package/lib/esm/entity/task/taskPayload.js +5 -0
- package/lib/esm/entity/tenant/SessionManager.js +306 -0
- package/lib/esm/entity/tenant/epic/sessionHeartbeatEpic.js +21 -0
- package/lib/esm/entity/tenant/sessionTypes.js +9 -0
- package/lib/esm/entity/tenant/tenantReducer.js +21 -1
- package/lib/esm/epic.js +9 -6
- package/lib/esm/index.js +9 -6
- package/lib/esm/view/taskManager/taskDetailView/epics/archiveTaskEpic.js +3 -0
- package/lib/esm/view/taskManager/taskDetailView/epics/deleteTaskEpic.js +5 -0
- package/lib/esm/view/taskManager/taskDetailView/epics/initializeTaskToLocalStoreEpic.js +1 -0
- package/lib/esm/view/taskManager/taskDetailView/epics/saveTaskDetailEpic.js +1 -0
- package/lib/esm/view/taskManager/taskDetailView/epics/snoozeTaskEpic.js +65 -0
- package/lib/esm/view/taskManager/taskDetailView/epics/unsnoozeTaskEpic.js +56 -0
- package/lib/esm/view/taskManager/taskDetailView/taskDetail.js +4 -0
- package/lib/esm/view/taskManager/taskDetailView/taskDetailReducer.js +51 -1
- package/lib/esm/view/taskManager/taskDetailView/taskDetailSelector.js +15 -2
- package/lib/esm/view/taskManager/taskListView/epics/bulkUpdateTaskListEpic.js +56 -21
- package/lib/esm/view/taskManager/taskListView/epics/dragNDropTasksEpic.js +1 -0
- package/lib/esm/view/taskManager/taskListView/epics/fetchTaskListEpic.js +13 -3
- package/lib/esm/view/taskManager/taskListView/epics/updateTaskFromListViewEpic.js +3 -2
- package/lib/esm/view/taskManager/taskListView/taskList.js +7 -0
- package/lib/esm/view/taskManager/taskListView/taskListReducer.js +91 -12
- package/lib/esm/view/taskManager/taskListView/taskListSelector.js +48 -39
- package/lib/index.d.ts +9 -6
- package/lib/index.js +41 -30
- 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 +2 -1
- package/lib/view/taskManager/taskDetailView/epics/archiveTaskEpic.js +3 -0
- package/lib/view/taskManager/taskDetailView/epics/deleteTaskEpic.d.ts +2 -1
- package/lib/view/taskManager/taskDetailView/epics/deleteTaskEpic.js +5 -0
- package/lib/view/taskManager/taskDetailView/epics/initializeTaskToLocalStoreEpic.js +1 -0
- package/lib/view/taskManager/taskDetailView/epics/saveTaskDetailEpic.js +1 -0
- package/lib/view/taskManager/taskDetailView/epics/snoozeTaskEpic.d.ts +9 -0
- package/lib/view/taskManager/taskDetailView/epics/snoozeTaskEpic.js +69 -0
- package/lib/view/taskManager/taskDetailView/epics/unsnoozeTaskEpic.d.ts +9 -0
- package/lib/view/taskManager/taskDetailView/epics/unsnoozeTaskEpic.js +60 -0
- package/lib/view/taskManager/taskDetailView/taskDetail.d.ts +2 -0
- package/lib/view/taskManager/taskDetailView/taskDetail.js +4 -0
- package/lib/view/taskManager/taskDetailView/taskDetailReducer.d.ts +10 -1
- package/lib/view/taskManager/taskDetailView/taskDetailReducer.js +52 -2
- package/lib/view/taskManager/taskDetailView/taskDetailSelector.d.ts +5 -0
- package/lib/view/taskManager/taskDetailView/taskDetailSelector.js +15 -2
- package/lib/view/taskManager/taskListView/epics/bulkUpdateTaskListEpic.d.ts +6 -7
- package/lib/view/taskManager/taskListView/epics/bulkUpdateTaskListEpic.js +56 -22
- package/lib/view/taskManager/taskListView/epics/dragNDropTasksEpic.js +1 -0
- package/lib/view/taskManager/taskListView/epics/fetchTaskListEpic.js +13 -3
- package/lib/view/taskManager/taskListView/epics/updateTaskFromListViewEpic.js +3 -2
- package/lib/view/taskManager/taskListView/taskList.d.ts +14 -1
- package/lib/view/taskManager/taskListView/taskList.js +8 -1
- package/lib/view/taskManager/taskListView/taskListPayload.d.ts +3 -0
- package/lib/view/taskManager/taskListView/taskListReducer.d.ts +6 -2
- package/lib/view/taskManager/taskListView/taskListReducer.js +92 -13
- package/lib/view/taskManager/taskListView/taskListSelector.d.ts +9 -3
- package/lib/view/taskManager/taskListView/taskListSelector.js +48 -39
- package/package.json +1 -1
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" | "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";
|
|
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" | "snooze_task" | "unsnooze_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,6 +3,7 @@ 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';
|
|
6
7
|
import { archiveTask, archiveTaskSuccessOrFailure } from '../taskDetailReducer';
|
|
7
|
-
export type ActionType = ReturnType<typeof archiveTask> | ReturnType<typeof updateTasks> | ReturnType<typeof openSnackbar> | ReturnType<typeof archiveTaskSuccessOrFailure>;
|
|
8
|
+
export type ActionType = ReturnType<typeof archiveTask> | ReturnType<typeof updateTasks> | ReturnType<typeof openSnackbar> | ReturnType<typeof fetchTaskList> | ReturnType<typeof archiveTaskSuccessOrFailure> | ReturnType<typeof removeTaskFromList>;
|
|
8
9
|
export declare const archiveTaskEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => import("rxjs").Observable<ActionType>;
|
|
@@ -7,6 +7,7 @@ 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");
|
|
10
11
|
const taskDetailReducer_1 = require("../taskDetailReducer");
|
|
11
12
|
// Epic function to handle archiving of tasks
|
|
12
13
|
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)));
|
|
@@ -29,6 +30,8 @@ const handleApiResponse = (response, taskId) => {
|
|
|
29
30
|
response.data.tasks.length > 0) {
|
|
30
31
|
const fetchActions = [
|
|
31
32
|
(0, taskReducer_1.updateTasks)(response.data.tasks),
|
|
33
|
+
(0, taskListReducer_1.removeTaskFromList)(taskId),
|
|
34
|
+
(0, taskListReducer_1.fetchTaskList)(),
|
|
32
35
|
(0, taskDetailReducer_1.archiveTaskSuccessOrFailure)({
|
|
33
36
|
fetchState: 'Completed',
|
|
34
37
|
taskId,
|
|
@@ -2,6 +2,7 @@ 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';
|
|
5
6
|
import { deleteTask, deleteTaskSuccessOrFailure } from '../taskDetailReducer';
|
|
6
|
-
export type ActionType = ReturnType<typeof deleteTask> | ReturnType<typeof openSnackbar> | ReturnType<typeof deleteTaskSuccessOrFailure>;
|
|
7
|
+
export type ActionType = ReturnType<typeof deleteTask> | ReturnType<typeof openSnackbar> | ReturnType<typeof fetchTaskList> | ReturnType<typeof deleteTaskSuccessOrFailure> | ReturnType<typeof removeTaskFromList>;
|
|
7
8
|
export declare const deleteTaskEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => import("rxjs").Observable<ActionType>;
|
|
@@ -5,6 +5,7 @@ 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");
|
|
8
9
|
const taskDetailReducer_1 = require("../taskDetailReducer");
|
|
9
10
|
const deleteTaskEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(taskDetailReducer_1.deleteTask.match), (0, operators_1.mergeMap)((action) => {
|
|
10
11
|
const { taskId } = action.payload;
|
|
@@ -13,6 +14,10 @@ const deleteTaskEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operato
|
|
|
13
14
|
.pipe((0, operators_1.mergeMap)((response) => {
|
|
14
15
|
if ((0, responsePayload_1.isSuccessStatus)(response)) {
|
|
15
16
|
const actions = [];
|
|
17
|
+
if (taskId != null) {
|
|
18
|
+
actions.push((0, taskListReducer_1.removeTaskFromList)(taskId));
|
|
19
|
+
}
|
|
20
|
+
actions.push((0, taskListReducer_1.fetchTaskList)());
|
|
16
21
|
actions.push((0, taskDetailReducer_1.deleteTaskSuccessOrFailure)({ fetchState: 'Completed', taskId }));
|
|
17
22
|
return (0, rxjs_1.from)(actions);
|
|
18
23
|
}
|
|
@@ -31,6 +31,7 @@ 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,
|
|
34
35
|
};
|
|
35
36
|
const actions = [
|
|
36
37
|
(0, taskDetailReducer_1.saveTaskUpdatesToLocalStore)({ taskDetailLocalData, taskId }),
|
|
@@ -98,5 +98,6 @@ 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 } : {}),
|
|
101
102
|
};
|
|
102
103
|
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
|
+
import { openSnackbar } from '../../../../entity/snackbar/snackbarReducer';
|
|
3
|
+
import { updateTasks } from '../../../../entity/task/taskReducer';
|
|
4
|
+
import { RootState } from '../../../../reducer';
|
|
5
|
+
import { ZeniAPI } from '../../../../zeniAPI';
|
|
6
|
+
import { fetchTaskList, removeTaskFromList } from '../../taskListView/taskListReducer';
|
|
7
|
+
import { snoozeTask, snoozeTaskSuccessOrFailure } from '../taskDetailReducer';
|
|
8
|
+
export type ActionType = ReturnType<typeof snoozeTask> | ReturnType<typeof updateTasks> | ReturnType<typeof openSnackbar> | ReturnType<typeof fetchTaskList> | ReturnType<typeof snoozeTaskSuccessOrFailure> | ReturnType<typeof removeTaskFromList>;
|
|
9
|
+
export declare const snoozeTaskEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => import("rxjs").Observable<ActionType>;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.snoozeTaskEpic = void 0;
|
|
4
|
+
const rxjs_1 = require("rxjs");
|
|
5
|
+
const operators_1 = require("rxjs/operators");
|
|
6
|
+
const snackbarReducer_1 = require("../../../../entity/snackbar/snackbarReducer");
|
|
7
|
+
const taskReducer_1 = require("../../../../entity/task/taskReducer");
|
|
8
|
+
const responsePayload_1 = require("../../../../responsePayload");
|
|
9
|
+
const zeniDayJS_1 = require("../../../../zeniDayJS");
|
|
10
|
+
const taskListReducer_1 = require("../../taskListView/taskListReducer");
|
|
11
|
+
const taskDetailReducer_1 = require("../taskDetailReducer");
|
|
12
|
+
const snoozeTaskEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(taskDetailReducer_1.snoozeTask.match), (0, operators_1.mergeMap)((action) => handleSnoozeTask(action.payload.taskId, action.payload.snoozedUntil, zeniAPI)));
|
|
13
|
+
exports.snoozeTaskEpic = snoozeTaskEpic;
|
|
14
|
+
const formatSnoozedUntilForDisplay = (snoozedUntil) => (0, zeniDayJS_1.date)(snoozedUntil).format('MMM D, h:mm A');
|
|
15
|
+
const handleSnoozeTask = (taskId, snoozedUntil, zeniAPI) => {
|
|
16
|
+
const snoozeTaskApi$ = zeniAPI.postAndGetJSON(`${zeniAPI.apiEndPoints.taskMicroServiceBaseUrl}/1.0/task-manager/tasks/${taskId}/snooze`, { snoozed_until: snoozedUntil });
|
|
17
|
+
return snoozeTaskApi$.pipe((0, operators_1.mergeMap)((response) => handleApiResponse(response, taskId, snoozedUntil)), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, taskDetailReducer_1.snoozeTaskSuccessOrFailure)({
|
|
18
|
+
fetchState: 'Error',
|
|
19
|
+
taskId,
|
|
20
|
+
error: (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Snooze Task REST API call errored out: ' + JSON.stringify(error)),
|
|
21
|
+
}))));
|
|
22
|
+
};
|
|
23
|
+
const handleApiResponse = (response, taskId, snoozedUntil) => {
|
|
24
|
+
if ((0, responsePayload_1.isSuccessResponse)(response) &&
|
|
25
|
+
response.data != null &&
|
|
26
|
+
response.data.tasks.length > 0) {
|
|
27
|
+
const fetchActions = [
|
|
28
|
+
(0, taskReducer_1.updateTasks)(response.data.tasks),
|
|
29
|
+
(0, taskListReducer_1.removeTaskFromList)(taskId),
|
|
30
|
+
(0, taskListReducer_1.fetchTaskList)(),
|
|
31
|
+
(0, taskDetailReducer_1.snoozeTaskSuccessOrFailure)({
|
|
32
|
+
fetchState: 'Completed',
|
|
33
|
+
taskId,
|
|
34
|
+
}),
|
|
35
|
+
(0, snackbarReducer_1.openSnackbar)({
|
|
36
|
+
messageSection: 'snooze_task',
|
|
37
|
+
messageText: 'success',
|
|
38
|
+
type: 'success',
|
|
39
|
+
variables: [
|
|
40
|
+
{
|
|
41
|
+
variableName: '_snoozed_until_',
|
|
42
|
+
variableValue: formatSnoozedUntilForDisplay(snoozedUntil),
|
|
43
|
+
},
|
|
44
|
+
],
|
|
45
|
+
}),
|
|
46
|
+
];
|
|
47
|
+
return (0, rxjs_1.from)(fetchActions);
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
return (0, rxjs_1.from)([
|
|
51
|
+
(0, taskDetailReducer_1.snoozeTaskSuccessOrFailure)({
|
|
52
|
+
fetchState: 'Error',
|
|
53
|
+
taskId,
|
|
54
|
+
error: response.status,
|
|
55
|
+
}),
|
|
56
|
+
(0, snackbarReducer_1.openSnackbar)({
|
|
57
|
+
messageSection: 'snooze_task',
|
|
58
|
+
messageText: 'failed',
|
|
59
|
+
type: 'error',
|
|
60
|
+
variables: [
|
|
61
|
+
{
|
|
62
|
+
variableName: '_api-error_',
|
|
63
|
+
variableValue: response.status.message,
|
|
64
|
+
},
|
|
65
|
+
],
|
|
66
|
+
}),
|
|
67
|
+
]);
|
|
68
|
+
}
|
|
69
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
|
+
import { openSnackbar } from '../../../../entity/snackbar/snackbarReducer';
|
|
3
|
+
import { updateTasks } from '../../../../entity/task/taskReducer';
|
|
4
|
+
import { RootState } from '../../../../reducer';
|
|
5
|
+
import { ZeniAPI } from '../../../../zeniAPI';
|
|
6
|
+
import { fetchTaskList } from '../../taskListView/taskListReducer';
|
|
7
|
+
import { snoozeTaskSuccessOrFailure, unsnoozeTask } from '../taskDetailReducer';
|
|
8
|
+
export type ActionType = ReturnType<typeof unsnoozeTask> | ReturnType<typeof updateTasks> | ReturnType<typeof openSnackbar> | ReturnType<typeof fetchTaskList> | ReturnType<typeof snoozeTaskSuccessOrFailure>;
|
|
9
|
+
export declare const unsnoozeTaskEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => import("rxjs").Observable<ActionType>;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.unsnoozeTaskEpic = void 0;
|
|
4
|
+
const rxjs_1 = require("rxjs");
|
|
5
|
+
const operators_1 = require("rxjs/operators");
|
|
6
|
+
const snackbarReducer_1 = require("../../../../entity/snackbar/snackbarReducer");
|
|
7
|
+
const taskReducer_1 = require("../../../../entity/task/taskReducer");
|
|
8
|
+
const responsePayload_1 = require("../../../../responsePayload");
|
|
9
|
+
const taskListReducer_1 = require("../../taskListView/taskListReducer");
|
|
10
|
+
const taskDetailReducer_1 = require("../taskDetailReducer");
|
|
11
|
+
const unsnoozeTaskEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(taskDetailReducer_1.unsnoozeTask.match), (0, operators_1.mergeMap)((action) => handleUnsnoozeTask(action.payload.taskId, zeniAPI)));
|
|
12
|
+
exports.unsnoozeTaskEpic = unsnoozeTaskEpic;
|
|
13
|
+
const handleUnsnoozeTask = (taskId, zeniAPI) => {
|
|
14
|
+
const unsnoozeTaskApi$ = zeniAPI.deleteAndGetJSON(`${zeniAPI.apiEndPoints.taskMicroServiceBaseUrl}/1.0/task-manager/tasks/${taskId}/snooze`);
|
|
15
|
+
return unsnoozeTaskApi$.pipe((0, operators_1.mergeMap)((response) => handleApiResponse(response, taskId)), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, taskDetailReducer_1.snoozeTaskSuccessOrFailure)({
|
|
16
|
+
fetchState: 'Error',
|
|
17
|
+
taskId,
|
|
18
|
+
error: (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Unsnooze Task REST API call errored out: ' + JSON.stringify(error)),
|
|
19
|
+
}))));
|
|
20
|
+
};
|
|
21
|
+
const handleApiResponse = (response, taskId) => {
|
|
22
|
+
if ((0, responsePayload_1.isSuccessResponse)(response) &&
|
|
23
|
+
response.data != null &&
|
|
24
|
+
response.data.tasks.length > 0) {
|
|
25
|
+
const fetchActions = [
|
|
26
|
+
(0, taskReducer_1.updateTasks)(response.data.tasks),
|
|
27
|
+
(0, taskListReducer_1.fetchTaskList)(),
|
|
28
|
+
(0, taskDetailReducer_1.snoozeTaskSuccessOrFailure)({
|
|
29
|
+
fetchState: 'Completed',
|
|
30
|
+
taskId,
|
|
31
|
+
}),
|
|
32
|
+
(0, snackbarReducer_1.openSnackbar)({
|
|
33
|
+
messageSection: 'unsnooze_task',
|
|
34
|
+
messageText: 'success',
|
|
35
|
+
type: 'success',
|
|
36
|
+
}),
|
|
37
|
+
];
|
|
38
|
+
return (0, rxjs_1.from)(fetchActions);
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
return (0, rxjs_1.from)([
|
|
42
|
+
(0, taskDetailReducer_1.snoozeTaskSuccessOrFailure)({
|
|
43
|
+
fetchState: 'Error',
|
|
44
|
+
taskId,
|
|
45
|
+
error: response.status,
|
|
46
|
+
}),
|
|
47
|
+
(0, snackbarReducer_1.openSnackbar)({
|
|
48
|
+
messageSection: 'unsnooze_task',
|
|
49
|
+
messageText: 'failed',
|
|
50
|
+
type: 'error',
|
|
51
|
+
variables: [
|
|
52
|
+
{
|
|
53
|
+
variableName: '_api-error_',
|
|
54
|
+
variableValue: response.status.message,
|
|
55
|
+
},
|
|
56
|
+
],
|
|
57
|
+
}),
|
|
58
|
+
]);
|
|
59
|
+
}
|
|
60
|
+
};
|
|
@@ -13,6 +13,7 @@ export interface EditTaskDetail {
|
|
|
13
13
|
deleteTaskStatus: FetchStateAndError;
|
|
14
14
|
fetchTaskStatus: FetchStateAndError;
|
|
15
15
|
saveStatus: FetchStateAndError;
|
|
16
|
+
snoozeStatus: FetchStateAndError;
|
|
16
17
|
taskDetailLocalData: EditTaskLocalData;
|
|
17
18
|
taskId?: ID;
|
|
18
19
|
}
|
|
@@ -32,6 +33,7 @@ export interface EditTaskLocalData {
|
|
|
32
33
|
timeSpent: string;
|
|
33
34
|
type: TaskType;
|
|
34
35
|
dueDate?: ZeniDate;
|
|
36
|
+
isPrivate?: boolean;
|
|
35
37
|
recurringFrequency?: RecurringFrequencyType;
|
|
36
38
|
recurringStartDate?: ZeniDate;
|
|
37
39
|
savedRecurringEndDate?: ZeniDate;
|
|
@@ -40,7 +40,16 @@ export declare const fetchTaskDetailPage: import("@reduxjs/toolkit").ActionCreat
|
|
|
40
40
|
fetchState: FetchState;
|
|
41
41
|
error?: ZeniAPIStatus;
|
|
42
42
|
taskId?: ID;
|
|
43
|
-
}, "taskDetailView/deleteTaskSuccessOrFailure">,
|
|
43
|
+
}, "taskDetailView/deleteTaskSuccessOrFailure">, snoozeTask: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[taskId: string, snoozedUntil: string], {
|
|
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], {
|
|
44
53
|
taskId: string;
|
|
45
54
|
cacheOverride: any;
|
|
46
55
|
}, "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.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;
|
|
7
|
+
exports.updateDeletedTagToLocalStore = exports.updateCreatedTagToLocalStore = exports.clearTaskDetail = exports.updateTaskHistoryFetchStatus = exports.updateTaskHistory = exports.fetchTaskHistory = exports.unsnoozeTask = exports.snoozeTaskSuccessOrFailure = exports.snoozeTask = 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");
|
|
@@ -236,6 +236,56 @@ const taskDetailView = (0, toolkit_1.createSlice)({
|
|
|
236
236
|
draft.newTaskState.deleteTaskStatus.error = action.payload.error;
|
|
237
237
|
}
|
|
238
238
|
},
|
|
239
|
+
snoozeTask: {
|
|
240
|
+
reducer(draft, action) {
|
|
241
|
+
const { taskId } = action.payload;
|
|
242
|
+
draft.editTaskStateById[taskId] = {
|
|
243
|
+
...(draft.editTaskStateById[taskId] != null
|
|
244
|
+
? draft.editTaskStateById[taskId]
|
|
245
|
+
: taskDetail_1.initialTaskDetail),
|
|
246
|
+
snoozeStatus: {
|
|
247
|
+
fetchState: 'In-Progress',
|
|
248
|
+
error: undefined,
|
|
249
|
+
},
|
|
250
|
+
};
|
|
251
|
+
},
|
|
252
|
+
prepare(taskId, snoozedUntil) {
|
|
253
|
+
return {
|
|
254
|
+
payload: {
|
|
255
|
+
taskId,
|
|
256
|
+
snoozedUntil,
|
|
257
|
+
},
|
|
258
|
+
};
|
|
259
|
+
},
|
|
260
|
+
},
|
|
261
|
+
snoozeTaskSuccessOrFailure(draft, action) {
|
|
262
|
+
const { taskId, fetchState, error } = action.payload;
|
|
263
|
+
if (draft.editTaskStateById[taskId] != null) {
|
|
264
|
+
draft.editTaskStateById[taskId].snoozeStatus.fetchState = fetchState;
|
|
265
|
+
draft.editTaskStateById[taskId].snoozeStatus.error = error;
|
|
266
|
+
}
|
|
267
|
+
},
|
|
268
|
+
unsnoozeTask: {
|
|
269
|
+
reducer(draft, action) {
|
|
270
|
+
const { taskId } = action.payload;
|
|
271
|
+
draft.editTaskStateById[taskId] = {
|
|
272
|
+
...(draft.editTaskStateById[taskId] != null
|
|
273
|
+
? draft.editTaskStateById[taskId]
|
|
274
|
+
: taskDetail_1.initialTaskDetail),
|
|
275
|
+
snoozeStatus: {
|
|
276
|
+
fetchState: 'In-Progress',
|
|
277
|
+
error: undefined,
|
|
278
|
+
},
|
|
279
|
+
};
|
|
280
|
+
},
|
|
281
|
+
prepare(taskId) {
|
|
282
|
+
return {
|
|
283
|
+
payload: {
|
|
284
|
+
taskId,
|
|
285
|
+
},
|
|
286
|
+
};
|
|
287
|
+
},
|
|
288
|
+
},
|
|
239
289
|
fetchTaskHistory: {
|
|
240
290
|
reducer(draft, action) {
|
|
241
291
|
const { taskId, cacheOverride } = action.payload;
|
|
@@ -277,5 +327,5 @@ const taskDetailView = (0, toolkit_1.createSlice)({
|
|
|
277
327
|
},
|
|
278
328
|
},
|
|
279
329
|
});
|
|
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;
|
|
330
|
+
_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.snoozeTask = _a.snoozeTask, exports.snoozeTaskSuccessOrFailure = _a.snoozeTaskSuccessOrFailure, exports.unsnoozeTask = _a.unsnoozeTask, exports.fetchTaskHistory = _a.fetchTaskHistory, exports.updateTaskHistory = _a.updateTaskHistory, exports.updateTaskHistoryFetchStatus = _a.updateTaskHistoryFetchStatus, exports.clearTaskDetail = _a.clearTaskDetail, exports.updateCreatedTagToLocalStore = _a.updateCreatedTagToLocalStore, exports.updateDeletedTagToLocalStore = _a.updateDeletedTagToLocalStore;
|
|
281
331
|
exports.default = taskDetailView.reducer;
|
|
@@ -3,6 +3,7 @@ import { SelectorView } from '../../../commonStateTypes/viewAndReport/viewAndRep
|
|
|
3
3
|
import { Class } from '../../../entity/class/classState';
|
|
4
4
|
import { File } from '../../../entity/file/fileState';
|
|
5
5
|
import { TaskPriority, TaskStatus } from '../../../entity/task/taskState';
|
|
6
|
+
import { ZeniDate } from '../../../zeniDayJS';
|
|
6
7
|
import { RootState } from '../../../reducer';
|
|
7
8
|
import { UserAndRole } from '../../companyView/types/userAndRole';
|
|
8
9
|
import { HistoricEvent } from '../../spendManagement/commonHistoryView/commonHistory';
|
|
@@ -18,6 +19,10 @@ export interface TaskDetailSelectorView extends SelectorView {
|
|
|
18
19
|
updateFileStatusById: Record<ID, FetchStateAndError | undefined>;
|
|
19
20
|
userList: UserListSelectorView;
|
|
20
21
|
createdByUser?: UserAndRole;
|
|
22
|
+
isArchived?: boolean;
|
|
23
|
+
isDeleted?: boolean;
|
|
24
|
+
recurringSourceTaskId?: ID;
|
|
25
|
+
snoozedUntil?: ZeniDate | null;
|
|
21
26
|
}
|
|
22
27
|
export declare const getTaskDetail: (state: RootState, taskId?: ID) => TaskDetailSelectorView;
|
|
23
28
|
export declare const allTaskStatus: TaskStatus[];
|
|
@@ -12,13 +12,14 @@ const taskSelector_1 = require("../../../entity/task/taskSelector");
|
|
|
12
12
|
const userAndRole_1 = require("../../companyView/types/userAndRole");
|
|
13
13
|
const fileViewSelector_1 = require("../../fileView/fileViewSelector");
|
|
14
14
|
const userListViewSelector_1 = require("../../userListView/userListViewSelector");
|
|
15
|
+
const taskDetail_1 = require("./taskDetail");
|
|
15
16
|
const getTaskDetail = (state, taskId) => {
|
|
16
17
|
const { taskDetailState, classListState, classState, fileState, fileViewState, userState, userRoleState, userListViewState, addressState, taskState, } = state;
|
|
17
18
|
const deleteFileStatusById = {};
|
|
18
19
|
const updateFileStatusById = {};
|
|
19
20
|
let showTaskDetailFormFooter = false;
|
|
20
21
|
const sourceTaskDetail = taskId != null
|
|
21
|
-
? taskDetailState.editTaskStateById[taskId]
|
|
22
|
+
? (taskDetailState.editTaskStateById[taskId] ?? taskDetail_1.initialTaskDetail)
|
|
22
23
|
: taskDetailState.newTaskState;
|
|
23
24
|
const userList = (0, userListViewSelector_1.getUserList)(userState, userRoleState, userListViewState, 'taskManagerCandidate');
|
|
24
25
|
let fetchStatus = {
|
|
@@ -27,11 +28,19 @@ const getTaskDetail = (state, taskId) => {
|
|
|
27
28
|
};
|
|
28
29
|
let taskHistory = [];
|
|
29
30
|
let createdByUser = undefined;
|
|
31
|
+
let isArchived = undefined;
|
|
32
|
+
let isDeleted = undefined;
|
|
33
|
+
let recurringSourceTaskId = undefined;
|
|
34
|
+
let snoozedUntil = undefined;
|
|
30
35
|
if (taskId != null && sourceTaskDetail != null) {
|
|
31
36
|
const taskEntity = (0, taskSelector_1.getTaskById)(taskState, taskId);
|
|
32
37
|
const fileIdsInEntity = taskEntity?.fileIds ?? [];
|
|
33
38
|
if (taskEntity != null) {
|
|
34
39
|
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;
|
|
35
44
|
}
|
|
36
45
|
if (fileIdsInEntity.length > 0) {
|
|
37
46
|
fetchStatus = (0, reduceFetchState_1.reduceFetchState)([
|
|
@@ -49,7 +58,7 @@ const getTaskDetail = (state, taskId) => {
|
|
|
49
58
|
]);
|
|
50
59
|
}
|
|
51
60
|
showTaskDetailFormFooter = showFormFooter(sourceTaskDetail.taskDetailLocalData, taskEntity);
|
|
52
|
-
taskHistory = taskDetailState.taskHistoryById[taskId]
|
|
61
|
+
taskHistory = taskDetailState.taskHistoryById[taskId]?.historicEvents ?? [];
|
|
53
62
|
}
|
|
54
63
|
else if (taskId == null) {
|
|
55
64
|
fetchStatus = (0, reduceFetchState_1.reduceFetchState)([userList, classListState]);
|
|
@@ -79,7 +88,11 @@ const getTaskDetail = (state, taskId) => {
|
|
|
79
88
|
error: fetchStatus.error,
|
|
80
89
|
version: 0,
|
|
81
90
|
createdByUser,
|
|
91
|
+
isArchived,
|
|
92
|
+
isDeleted,
|
|
93
|
+
recurringSourceTaskId,
|
|
82
94
|
showTaskDetailFormFooter,
|
|
95
|
+
snoozedUntil,
|
|
83
96
|
};
|
|
84
97
|
};
|
|
85
98
|
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, 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>,
|
|
11
|
-
/**
|
|
12
|
-
* Helpers
|
|
13
|
-
*/
|
|
8
|
+
import { bulkUpdateTaskList, fetchTaskList, updateTasksListOnBulkUpdateTasksFailure, updateTasksListOnBulkUpdateTasksSuccess } from '../taskListReducer';
|
|
9
|
+
export type ActionType = ReturnType<typeof bulkUpdateTaskList> | ReturnType<typeof fetchTaskList> | ReturnType<typeof updateTasks> | ReturnType<typeof updateTasksListOnBulkUpdateTasksFailure> | ReturnType<typeof updateTasksListOnBulkUpdateTasksSuccess>;
|
|
10
|
+
export declare const bulkUpdateTaskListEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
14
11
|
interface UpdateTaskPayload {
|
|
15
12
|
assignees: string[];
|
|
16
13
|
description: string;
|
|
17
14
|
due_date: string | null;
|
|
18
15
|
file_ids: ID[];
|
|
19
16
|
group_assignees: string[];
|
|
17
|
+
is_archived: boolean;
|
|
18
|
+
is_deleted: boolean;
|
|
20
19
|
name: string;
|
|
21
20
|
priority: string;
|
|
22
21
|
recurring_end_date: string | null;
|
|
23
22
|
recurring_frequency: string | null;
|
|
24
23
|
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,6 +29,5 @@ 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[];
|
|
33
32
|
export declare const getTaskPayload: (state: RootState, taskId: ID, updates: Partial<Task>) => UpdateTaskPayload;
|
|
34
33
|
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.
|
|
6
|
+
exports.getTaskPayload = 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,20 +12,25 @@ 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$,
|
|
16
|
-
const state = state$.value;
|
|
15
|
+
const bulkUpdateTaskListEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(taskListReducer_1.bulkUpdateTaskList.match), (0, operators_1.switchMap)((action) => {
|
|
17
16
|
const { taskIds, updates, groupId } = action.payload;
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
|
|
17
|
+
const bulkUpdates = toBulkUpdatesPayload(updates);
|
|
18
|
+
if (groupId != null) {
|
|
19
|
+
bulkUpdates.task_group_ids = [groupId];
|
|
20
|
+
}
|
|
21
|
+
const payload = { task_ids: taskIds, updates: bulkUpdates };
|
|
21
22
|
return zeniAPI
|
|
22
|
-
.putAndGetJSON(`${zeniAPI.apiEndPoints.taskMicroServiceBaseUrl}/1.0/task-manager/tasks`, payload)
|
|
23
|
+
.putAndGetJSON(`${zeniAPI.apiEndPoints.taskMicroServiceBaseUrl}/1.0/task-manager/tasks/bulk-update`, payload)
|
|
23
24
|
.pipe((0, operators_1.mergeMap)((response) => {
|
|
24
25
|
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);
|
|
25
29
|
return (0, rxjs_1.of)((0, taskReducer_1.updateTasks)(response.data.tasks), (0, taskListReducer_1.updateTasksListOnBulkUpdateTasksSuccess)({
|
|
26
30
|
taskIds,
|
|
27
31
|
groupId,
|
|
28
|
-
|
|
32
|
+
removeFromList,
|
|
33
|
+
}), (0, taskListReducer_1.fetchTaskList)());
|
|
29
34
|
}
|
|
30
35
|
else {
|
|
31
36
|
return (0, rxjs_1.of)((0, taskListReducer_1.updateTasksListOnBulkUpdateTasksFailure)({
|
|
@@ -40,21 +45,47 @@ const bulkUpdateTaskListEpic = (actions$, state$, zeniAPI) => actions$.pipe((0,
|
|
|
40
45
|
}));
|
|
41
46
|
}));
|
|
42
47
|
exports.bulkUpdateTaskListEpic = bulkUpdateTaskListEpic;
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
48
|
+
/**
|
|
49
|
+
* Helpers
|
|
50
|
+
*/
|
|
51
|
+
const toBulkUpdatesPayload = (updates) => {
|
|
52
|
+
const payload = {};
|
|
53
|
+
if (updates.status != null) {
|
|
54
|
+
payload.status = updates.status.code;
|
|
55
|
+
}
|
|
56
|
+
if (updates.priority != null) {
|
|
57
|
+
payload.priority = updates.priority.code;
|
|
58
|
+
}
|
|
59
|
+
if (updates.assignees != null) {
|
|
60
|
+
payload.assignees = updates.assignees;
|
|
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;
|
|
56
88
|
};
|
|
57
|
-
exports.getTasksListPayload = getTasksListPayload;
|
|
58
89
|
const getTaskPayload = (state, taskId, updates) => {
|
|
59
90
|
const { taskState } = state;
|
|
60
91
|
const taskData = (0, get_1.default)(taskState.taskByID, taskId);
|
|
@@ -80,6 +111,9 @@ const toTaskPayload = (state, task) => {
|
|
|
80
111
|
assignees: task.assignees,
|
|
81
112
|
description: task.description,
|
|
82
113
|
group_assignees: task.groupAssignees,
|
|
114
|
+
is_archived: task.isArchived,
|
|
115
|
+
is_deleted: task.isDeleted,
|
|
116
|
+
snoozed_until: task.snoozedUntil != null ? task.snoozedUntil.toISOString() : null,
|
|
83
117
|
due_date: task.dueDate != null ? task.dueDate.format(formatZeniDateFY_1.DEFAULT_DATE_FORMAT) : null,
|
|
84
118
|
priority: task.priority.code,
|
|
85
119
|
status: task.status.code,
|