@zeniai/client-epic-state 4.10.35 → 4.10.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/entity/account/accountSelector.js +4 -2
- package/lib/entity/accountGroup/accountGroupSelector.js +2 -1
- package/lib/entity/company/companyPayload.js +2 -1
- package/lib/entity/customerIncome/customerIncomeTrend.js +2 -1
- package/lib/entity/paymentAccount/paymentAccountSelector.d.ts +1 -0
- package/lib/entity/paymentAccount/paymentAccountSelector.js +5 -1
- package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
- package/lib/entity/snackbar/snackbarTypes.js +2 -0
- package/lib/entity/tag/tagPayload.d.ts +9 -0
- package/lib/entity/tag/tagPayload.js +12 -0
- package/lib/entity/tag/tagReducer.d.ts +9 -0
- package/lib/entity/tag/tagReducer.js +39 -0
- package/lib/entity/tag/tagSelector.d.ts +4 -0
- package/lib/entity/tag/tagSelector.js +18 -0
- package/lib/entity/tag/tagState.d.ts +12 -0
- package/lib/entity/tag/tagState.js +2 -0
- package/lib/entity/task/taskPayload.d.ts +6 -2
- package/lib/entity/task/taskPayload.js +1 -6
- package/lib/entity/task/taskState.d.ts +1 -5
- package/lib/entity/tenant/clearAllEpic.d.ts +4 -2
- package/lib/entity/tenant/clearAllEpic.js +4 -0
- package/lib/entity/transaction/payloadTypes/otherTransactionPayload.js +2 -1
- package/lib/entity/user/userSelector.js +4 -2
- package/lib/entity/vendorExpense/vendorExpenseTrend.js +2 -1
- package/lib/epic.d.ts +4 -1
- package/lib/epic.js +4 -1
- package/lib/index.d.ts +8 -3
- package/lib/index.js +8 -3
- package/lib/reducer.d.ts +6 -0
- package/lib/reducer.js +6 -0
- package/lib/view/accountMappingView/saveAccountMappingViewEpic.js +2 -1
- package/lib/view/autoComplete/fetchEntityAutoCompleteEpic.js +2 -1
- package/lib/view/companyHealthMetricView/companyHealthMetricViewSelector.js +8 -4
- package/lib/view/companyView/selector/companyManagementViewSelector.js +58 -29
- package/lib/view/companyView/selector/companyPassportViewSelector.js +2 -1
- package/lib/view/companyView/selector/companyPortfolioViewSelector.js +10 -5
- package/lib/view/globalMerchantView/globalMerchantAutoCompleteView/fetchGlobalMerchantAutoCompleteViewEpic.js +2 -1
- package/lib/view/onboardingView/cockpitView/onboardingCockpitViewSelector.js +8 -4
- package/lib/view/people/changeZeniPersonRolesEpic.d.ts +1 -1
- package/lib/view/people/deletePersonEpic.d.ts +1 -1
- package/lib/view/people/invitePeopleEpic.d.ts +1 -1
- package/lib/view/people/inviteZeniPeopleEpic.d.ts +1 -1
- package/lib/view/people/resendInviteEpic.d.ts +1 -1
- package/lib/view/scheduleView/scheduleDetailView/scheduleDetailReducer.js +6 -3
- package/lib/view/settingsView/epic/saveNotificationSettingsEpic.d.ts +1 -1
- package/lib/view/spendManagement/billPay/billList/billListSelector.js +30 -15
- package/lib/view/spendManagement/commonSetup/setupViewSelector.js +2 -6
- package/lib/view/spendManagement/reimbursement/editRemiView/editRemiViewSelector.js +2 -1
- package/lib/view/spendManagement/reimbursement/editRemiView/epics/fetchCurrencyConversionValueEpic.js +2 -1
- package/lib/view/spendManagement/reimbursement/editRemiView/epics/parseReceiptsToRemiEpic.js +6 -3
- package/lib/view/spendManagement/reimbursement/remiDetailView/epics/fetchRemiDetailEpic.js +2 -1
- package/lib/view/spendManagement/reimbursement/remiListView/remiListSelector.js +26 -13
- package/lib/view/spendManagement/spendManagementFilterHelpers.js +1 -2
- package/lib/view/subscriptionView/subscriptionViewSelector.js +26 -13
- package/lib/view/tagView/epics/createTagEpic.d.ts +36 -0
- package/lib/view/tagView/epics/createTagEpic.js +69 -0
- package/lib/view/tagView/epics/deleteTagEpic.d.ts +35 -0
- package/lib/view/tagView/epics/deleteTagEpic.js +53 -0
- package/lib/view/tagView/epics/fetchAllTagsEpic.d.ts +8 -0
- package/lib/view/tagView/epics/fetchAllTagsEpic.js +33 -0
- package/lib/view/tagView/tagViewPayload.d.ts +7 -0
- package/lib/view/tagView/tagViewPayload.js +2 -0
- package/lib/view/tagView/tagViewReducer.d.ts +27 -0
- package/lib/view/tagView/tagViewReducer.js +94 -0
- package/lib/view/tagView/tagViewSelector.d.ts +10 -0
- package/lib/view/tagView/tagViewSelector.js +17 -0
- package/lib/view/tagView/tagViewState.d.ts +6 -0
- package/lib/view/tagView/tagViewState.js +2 -0
- package/lib/view/taskManager/taskDetailView/epics/fetchTaskDetailEpic.d.ts +2 -1
- package/lib/view/taskManager/taskDetailView/epics/fetchTaskDetailEpic.js +2 -0
- package/lib/view/taskManager/taskDetailView/epics/initializeTaskToLocalStoreEpic.js +1 -1
- package/lib/view/taskManager/taskDetailView/epics/saveTaskDetailEpic.js +1 -1
- package/lib/view/taskManager/taskDetailView/taskDetail.d.ts +4 -4
- package/lib/view/taskManager/taskDetailView/taskDetail.js +1 -1
- package/lib/view/taskManager/taskDetailView/taskDetailReducer.d.ts +7 -1
- package/lib/view/taskManager/taskDetailView/taskDetailReducer.js +24 -2
- package/lib/view/taskManager/taskDetailView/taskDetailSelector.d.ts +1 -2
- package/lib/view/taskManager/taskDetailView/taskDetailSelector.js +5 -47
- package/lib/view/taskManager/taskListView/fetchTaskListEpic.d.ts +2 -1
- package/lib/view/taskManager/taskListView/fetchTaskListEpic.js +2 -1
- package/lib/view/taskManager/taskListView/taskListSelector.js +5 -3
- package/lib/view/transactionDetail/epics/saveTransactionHelper.js +4 -2
- package/lib/view/transactionDetail/transactionDetailLocalDataHelper.js +4 -2
- package/package.json +1 -1
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createTagEpic = void 0;
|
|
4
|
+
const rxjs_1 = require("rxjs");
|
|
5
|
+
const operators_1 = require("rxjs/operators");
|
|
6
|
+
const responsePayload_1 = require("../../../responsePayload");
|
|
7
|
+
const tagViewReducer_1 = require("../tagViewReducer");
|
|
8
|
+
const tagReducer_1 = require("../../../entity/tag/tagReducer");
|
|
9
|
+
const snackbarReducer_1 = require("../../../entity/snackbar/snackbarReducer");
|
|
10
|
+
const taskDetailReducer_1 = require("../../taskManager/taskDetailView/taskDetailReducer");
|
|
11
|
+
const createTagEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(tagViewReducer_1.createTag.match), (0, operators_1.mergeMap)(function (action) {
|
|
12
|
+
const { tagName, taskId } = action.payload;
|
|
13
|
+
return handleCreateTag(tagName, zeniAPI, taskId);
|
|
14
|
+
}));
|
|
15
|
+
exports.createTagEpic = createTagEpic;
|
|
16
|
+
const handleCreateTag = (tagName, zeniAPI, taskId) => {
|
|
17
|
+
const payload = Object.assign({}, prepareCreateTagPayload(tagName));
|
|
18
|
+
const createTagApi$ = zeniAPI.postAndGetJSON(`${zeniAPI.apiEndPoints.taskMicroServiceBaseUrl}/1.0/task-manager/tags`, payload);
|
|
19
|
+
return createTagApi$.pipe((0, operators_1.mergeMap)((response) => handleCreateTagResponse(response, taskId)), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, tagViewReducer_1.updateTagCreateStatus)({
|
|
20
|
+
fetchState: 'Error',
|
|
21
|
+
error: (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Create Tag REST API call errored out ' + JSON.stringify(error)),
|
|
22
|
+
tagsId: [],
|
|
23
|
+
}))));
|
|
24
|
+
};
|
|
25
|
+
const handleCreateTagResponse = (response, taskId) => {
|
|
26
|
+
if ((0, responsePayload_1.isSuccessResponse)(response) &&
|
|
27
|
+
response.data != null &&
|
|
28
|
+
response.data.tags.length > 0) {
|
|
29
|
+
return (0, rxjs_1.from)([
|
|
30
|
+
(0, tagReducer_1.updateTags)(response.data.tags),
|
|
31
|
+
(0, tagViewReducer_1.updateTagCreateStatus)({
|
|
32
|
+
fetchState: 'Completed',
|
|
33
|
+
tagsId: response.data.tags.map((tag) => tag.tag_id),
|
|
34
|
+
}),
|
|
35
|
+
(0, taskDetailReducer_1.updateCreatedTagToLocalStore)({
|
|
36
|
+
tagId: response.data.tags[0].tag_id,
|
|
37
|
+
taskId: taskId,
|
|
38
|
+
}),
|
|
39
|
+
]);
|
|
40
|
+
}
|
|
41
|
+
else {
|
|
42
|
+
return (0, rxjs_1.from)([
|
|
43
|
+
(0, tagViewReducer_1.updateTagCreateStatus)({
|
|
44
|
+
fetchState: 'Error',
|
|
45
|
+
error: response.status,
|
|
46
|
+
tagsId: [],
|
|
47
|
+
}),
|
|
48
|
+
(0, snackbarReducer_1.openSnackbar)({
|
|
49
|
+
messageSection: 'create_tag',
|
|
50
|
+
messageText: 'failed',
|
|
51
|
+
type: 'error',
|
|
52
|
+
variables: [
|
|
53
|
+
{
|
|
54
|
+
variableName: '_api-error_',
|
|
55
|
+
variableValue: response.status.message,
|
|
56
|
+
},
|
|
57
|
+
],
|
|
58
|
+
}),
|
|
59
|
+
]);
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
/**
|
|
63
|
+
* Helpers
|
|
64
|
+
*/
|
|
65
|
+
const prepareCreateTagPayload = (tagName) => {
|
|
66
|
+
return {
|
|
67
|
+
name: tagName,
|
|
68
|
+
};
|
|
69
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
|
+
import { ZeniAPI } from '../../../zeniAPI';
|
|
3
|
+
import { deleteTag, updateDeleteTagStatus } from '../tagViewReducer';
|
|
4
|
+
import { RootState } from '../../../reducer';
|
|
5
|
+
import { updateTags } from '../../../entity/tag/tagReducer';
|
|
6
|
+
export declare type ActionType = ReturnType<typeof deleteTag> | ReturnType<typeof updateDeleteTagStatus> | ReturnType<typeof updateTags>;
|
|
7
|
+
export declare const deleteTagEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => import("rxjs").Observable<{
|
|
8
|
+
payload: string;
|
|
9
|
+
type: string;
|
|
10
|
+
} | {
|
|
11
|
+
payload: {
|
|
12
|
+
messageSection: "common" | "transactionDetails_updatingPastTransactions" | "transactionDetails_transactionUpdated" | "cockpit_month_end_email_sent" | "cockpit_month_end_email_save" | "cockpit_month_end_email_attachment_upload" | "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" | "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" | "zeni_account_accept_term" | "update_vendor" | "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" | "charge_card_setup" | "charge_card_accept_term" | "create_schedule" | "save_schedule" | "delete_schedule" | "save_task_detail" | "fetch_task_detail" | "delete_task" | "archive_task" | "create_tag" | "delete_tag" | "update_charge_card" | "issue_charge_card" | "notification_settings_saved" | "referral_invite_sent" | "notification_mark_as_read" | "mark_as_complete_schedule" | "settings_accounting_accounts_updated";
|
|
13
|
+
messageText: "failed" | "success";
|
|
14
|
+
type: import("../../..").SnackbarMessageType;
|
|
15
|
+
showStatusIcon?: boolean | undefined;
|
|
16
|
+
variables?: {
|
|
17
|
+
variableName: string;
|
|
18
|
+
variableValue: string;
|
|
19
|
+
}[] | undefined;
|
|
20
|
+
};
|
|
21
|
+
type: string;
|
|
22
|
+
} | {
|
|
23
|
+
payload: {
|
|
24
|
+
fetchState: import("../../..").FetchState;
|
|
25
|
+
tagId: string;
|
|
26
|
+
error?: import("../../../responsePayload").ZeniAPIStatus<Record<string, unknown>> | undefined;
|
|
27
|
+
};
|
|
28
|
+
type: string;
|
|
29
|
+
} | {
|
|
30
|
+
payload: {
|
|
31
|
+
tagId: string | undefined;
|
|
32
|
+
taskId: string | undefined;
|
|
33
|
+
};
|
|
34
|
+
type: string;
|
|
35
|
+
}>;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.deleteTagEpic = void 0;
|
|
4
|
+
const rxjs_1 = require("rxjs");
|
|
5
|
+
const operators_1 = require("rxjs/operators");
|
|
6
|
+
const tagViewReducer_1 = require("../tagViewReducer");
|
|
7
|
+
const responsePayload_1 = require("../../../responsePayload");
|
|
8
|
+
const snackbarReducer_1 = require("../../../entity/snackbar/snackbarReducer");
|
|
9
|
+
const tagReducer_1 = require("../../../entity/tag/tagReducer");
|
|
10
|
+
const taskDetailReducer_1 = require("../../taskManager/taskDetailView/taskDetailReducer");
|
|
11
|
+
const deleteTagEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(tagViewReducer_1.deleteTag.match), (0, operators_1.mergeMap)((action) => {
|
|
12
|
+
const { tagId, taskId } = action.payload;
|
|
13
|
+
return zeniAPI
|
|
14
|
+
.deleteAndGetJSON(`${zeniAPI.apiEndPoints.taskMicroServiceBaseUrl}/1.0/task-manager/tags/${tagId}`)
|
|
15
|
+
.pipe((0, operators_1.mergeMap)((response) => {
|
|
16
|
+
if ((0, responsePayload_1.isSuccessStatus)(response) && response.data != null) {
|
|
17
|
+
return (0, rxjs_1.from)([
|
|
18
|
+
(0, tagViewReducer_1.updateDeleteTagStatus)({ fetchState: 'Completed', tagId }),
|
|
19
|
+
(0, tagReducer_1.removeTag)(tagId),
|
|
20
|
+
(0, taskDetailReducer_1.updateDeletedTagToLocalStore)({
|
|
21
|
+
tagId: tagId,
|
|
22
|
+
taskId: taskId,
|
|
23
|
+
}),
|
|
24
|
+
]);
|
|
25
|
+
}
|
|
26
|
+
else {
|
|
27
|
+
return (0, rxjs_1.from)([
|
|
28
|
+
(0, tagViewReducer_1.updateDeleteTagStatus)({
|
|
29
|
+
fetchState: 'Error',
|
|
30
|
+
tagId,
|
|
31
|
+
error: response.status,
|
|
32
|
+
}),
|
|
33
|
+
(0, snackbarReducer_1.openSnackbar)({
|
|
34
|
+
messageSection: 'delete_tag',
|
|
35
|
+
messageText: 'failed',
|
|
36
|
+
type: 'error',
|
|
37
|
+
variables: [
|
|
38
|
+
{
|
|
39
|
+
variableName: '_api-error_',
|
|
40
|
+
variableValue: response.status.message,
|
|
41
|
+
},
|
|
42
|
+
],
|
|
43
|
+
}),
|
|
44
|
+
]);
|
|
45
|
+
}
|
|
46
|
+
}), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, tagViewReducer_1.updateDeleteTagStatus)({
|
|
47
|
+
fetchState: 'Error',
|
|
48
|
+
tagId,
|
|
49
|
+
error: (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Delete tag REST API call errored out ' +
|
|
50
|
+
JSON.stringify(error)),
|
|
51
|
+
}))));
|
|
52
|
+
}));
|
|
53
|
+
exports.deleteTagEpic = deleteTagEpic;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { RootState } from '../../../reducer';
|
|
4
|
+
import { ZeniAPI } from '../../../zeniAPI';
|
|
5
|
+
import { fetchTagList, updateTagList, updateTagListFetchStatus } from '../tagViewReducer';
|
|
6
|
+
import { updateTags } from '../../../entity/tag/tagReducer';
|
|
7
|
+
export declare type ActionType = ReturnType<typeof fetchTagList> | ReturnType<typeof updateTagList> | ReturnType<typeof updateTagListFetchStatus> | ReturnType<typeof updateTags>;
|
|
8
|
+
export declare const fetchAllTagsEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.fetchAllTagsEpic = void 0;
|
|
4
|
+
const rxjs_1 = require("rxjs");
|
|
5
|
+
const operators_1 = require("rxjs/operators");
|
|
6
|
+
const responsePayload_1 = require("../../../responsePayload");
|
|
7
|
+
const tagViewReducer_1 = require("../tagViewReducer");
|
|
8
|
+
const tagReducer_1 = require("../../../entity/tag/tagReducer");
|
|
9
|
+
const fetchAllTagsEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(tagViewReducer_1.fetchTagList.match), (0, operators_1.switchMap)(() => {
|
|
10
|
+
const queryParam = { filter_type: 'all' };
|
|
11
|
+
return zeniAPI
|
|
12
|
+
.getJSON(`${zeniAPI.apiEndPoints.taskMicroServiceBaseUrl}/1.0/task-manager/tags?query=${encodeURIComponent(JSON.stringify(queryParam))}`)
|
|
13
|
+
.pipe((0, operators_1.mergeMap)((response) => {
|
|
14
|
+
if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
|
|
15
|
+
return (0, rxjs_1.of)((0, tagReducer_1.updateTags)(response.data.tags), (0, tagViewReducer_1.updateTagList)({
|
|
16
|
+
data: response.data.tags,
|
|
17
|
+
}));
|
|
18
|
+
}
|
|
19
|
+
else {
|
|
20
|
+
return (0, rxjs_1.of)((0, tagViewReducer_1.updateTagListFetchStatus)({
|
|
21
|
+
fetchState: 'Error',
|
|
22
|
+
error: response.status,
|
|
23
|
+
}));
|
|
24
|
+
}
|
|
25
|
+
}), (0, operators_1.catchError)((error) => {
|
|
26
|
+
return (0, rxjs_1.of)((0, tagViewReducer_1.updateTagListFetchStatus)({
|
|
27
|
+
fetchState: 'Error',
|
|
28
|
+
error: (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Fetch Tag List REST API call errored out' +
|
|
29
|
+
JSON.stringify(error)),
|
|
30
|
+
}));
|
|
31
|
+
}));
|
|
32
|
+
}));
|
|
33
|
+
exports.fetchAllTagsEpic = fetchAllTagsEpic;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { TagPayload } from '../../entity/tag/tagPayload';
|
|
2
|
+
import { ZeniAPIResponse } from '../../responsePayload';
|
|
3
|
+
export declare type DeleteTagResponse = ZeniAPIResponse<FetchTagListPayload>;
|
|
4
|
+
export interface FetchTagListPayload {
|
|
5
|
+
tags: TagPayload[];
|
|
6
|
+
}
|
|
7
|
+
export declare type FetchTagListResponse = ZeniAPIResponse<FetchTagListPayload>;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { TagViewState } from './tagViewState';
|
|
2
|
+
import { FetchState, ID } from '../../commonStateTypes/common';
|
|
3
|
+
import { ZeniAPIStatus } from '../../responsePayload';
|
|
4
|
+
import { TagPayload } from '../../entity/tag/tagPayload';
|
|
5
|
+
export declare const initialState: TagViewState;
|
|
6
|
+
export declare const fetchTagList: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, updateTagListFetchStatus: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
7
|
+
fetchState: FetchState;
|
|
8
|
+
error?: ZeniAPIStatus<Record<string, unknown>> | undefined;
|
|
9
|
+
}, string>, updateTagList: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
10
|
+
data: TagPayload[];
|
|
11
|
+
}, string>, createTag: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[tagName: string, taskId: any], {
|
|
12
|
+
tagName: string;
|
|
13
|
+
taskId: any;
|
|
14
|
+
}, string, never, never>, updateTagCreateStatus: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
15
|
+
fetchState: FetchState;
|
|
16
|
+
tagsId: ID[];
|
|
17
|
+
error?: ZeniAPIStatus<Record<string, unknown>> | undefined;
|
|
18
|
+
}, string>, deleteTag: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[tagId: string, taskId: any], {
|
|
19
|
+
tagId: string;
|
|
20
|
+
taskId: any;
|
|
21
|
+
}, string, never, never>, updateDeleteTagStatus: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
22
|
+
fetchState: FetchState;
|
|
23
|
+
tagId: ID;
|
|
24
|
+
error?: ZeniAPIStatus<Record<string, unknown>> | undefined;
|
|
25
|
+
}, string>, clearTagView: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
|
|
26
|
+
declare const _default: import("@reduxjs/toolkit").Reducer<TagViewState, import("@reduxjs/toolkit").AnyAction>;
|
|
27
|
+
export default _default;
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var _a;
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.clearTagView = exports.updateDeleteTagStatus = exports.deleteTag = exports.updateTagCreateStatus = exports.createTag = exports.updateTagList = exports.updateTagListFetchStatus = exports.fetchTagList = exports.initialState = void 0;
|
|
5
|
+
const toolkit_1 = require("@reduxjs/toolkit");
|
|
6
|
+
exports.initialState = {
|
|
7
|
+
tagsId: [],
|
|
8
|
+
fetchState: 'Not-Started',
|
|
9
|
+
error: undefined,
|
|
10
|
+
tagDeleteStatusById: {},
|
|
11
|
+
tagCreateStatus: {
|
|
12
|
+
fetchState: 'Not-Started',
|
|
13
|
+
error: undefined,
|
|
14
|
+
},
|
|
15
|
+
hasValidState() {
|
|
16
|
+
return this.fetchState == 'Completed';
|
|
17
|
+
},
|
|
18
|
+
};
|
|
19
|
+
const tagView = (0, toolkit_1.createSlice)({
|
|
20
|
+
name: 'tagView',
|
|
21
|
+
initialState: exports.initialState,
|
|
22
|
+
reducers: {
|
|
23
|
+
fetchTagList(draft) {
|
|
24
|
+
draft.fetchState = 'In-Progress';
|
|
25
|
+
draft.error = undefined;
|
|
26
|
+
},
|
|
27
|
+
updateTagList(draft, action) {
|
|
28
|
+
const { data } = action.payload;
|
|
29
|
+
draft.error = undefined;
|
|
30
|
+
const newTags = data.map((tag) => tag.tag_id);
|
|
31
|
+
draft.tagsId = [...new Set([...draft.tagsId, ...newTags])];
|
|
32
|
+
draft.fetchState = 'Completed';
|
|
33
|
+
},
|
|
34
|
+
updateTagListFetchStatus(draft, action) {
|
|
35
|
+
draft.fetchState = action.payload.fetchState;
|
|
36
|
+
draft.error = action.payload.error;
|
|
37
|
+
},
|
|
38
|
+
createTag: {
|
|
39
|
+
reducer(draft) {
|
|
40
|
+
draft.tagCreateStatus = {
|
|
41
|
+
fetchState: 'In-Progress',
|
|
42
|
+
error: undefined,
|
|
43
|
+
};
|
|
44
|
+
},
|
|
45
|
+
prepare(tagName, taskId) {
|
|
46
|
+
return {
|
|
47
|
+
payload: {
|
|
48
|
+
tagName,
|
|
49
|
+
taskId,
|
|
50
|
+
},
|
|
51
|
+
};
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
updateTagCreateStatus(draft, action) {
|
|
55
|
+
const currentTagsList = draft.tagsId;
|
|
56
|
+
draft.tagsId = [
|
|
57
|
+
...new Set([...action.payload.tagsId, ...currentTagsList]),
|
|
58
|
+
];
|
|
59
|
+
draft.tagCreateStatus = {
|
|
60
|
+
fetchState: action.payload.fetchState,
|
|
61
|
+
error: action.payload.error,
|
|
62
|
+
};
|
|
63
|
+
},
|
|
64
|
+
deleteTag: {
|
|
65
|
+
reducer(draft, action) {
|
|
66
|
+
draft.tagDeleteStatusById[action.payload.tagId] = {
|
|
67
|
+
fetchState: 'In-Progress',
|
|
68
|
+
error: undefined,
|
|
69
|
+
};
|
|
70
|
+
},
|
|
71
|
+
prepare(tagId, taskId) {
|
|
72
|
+
return {
|
|
73
|
+
payload: {
|
|
74
|
+
tagId,
|
|
75
|
+
taskId,
|
|
76
|
+
},
|
|
77
|
+
};
|
|
78
|
+
},
|
|
79
|
+
},
|
|
80
|
+
updateDeleteTagStatus(draft, action) {
|
|
81
|
+
const { fetchState, tagId, error } = action.payload;
|
|
82
|
+
draft.tagsId = draft.tagsId.filter((tag) => tag !== tagId);
|
|
83
|
+
draft.tagDeleteStatusById[action.payload.tagId] = {
|
|
84
|
+
fetchState: fetchState,
|
|
85
|
+
error: error,
|
|
86
|
+
};
|
|
87
|
+
},
|
|
88
|
+
clearTagView(draft) {
|
|
89
|
+
Object.assign(draft, exports.initialState);
|
|
90
|
+
},
|
|
91
|
+
},
|
|
92
|
+
});
|
|
93
|
+
_a = tagView.actions, exports.fetchTagList = _a.fetchTagList, exports.updateTagListFetchStatus = _a.updateTagListFetchStatus, exports.updateTagList = _a.updateTagList, exports.createTag = _a.createTag, exports.updateTagCreateStatus = _a.updateTagCreateStatus, exports.deleteTag = _a.deleteTag, exports.updateDeleteTagStatus = _a.updateDeleteTagStatus, exports.clearTagView = _a.clearTagView;
|
|
94
|
+
exports.default = tagView.reducer;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { FetchStateAndError, ID } from '../../commonStateTypes/common';
|
|
2
|
+
import { SelectorView } from '../../commonStateTypes/viewAndReport/viewAndReport';
|
|
3
|
+
import { Tag } from '../../entity/tag/tagState';
|
|
4
|
+
import { RootState } from '../../reducer';
|
|
5
|
+
export interface TagViewSelectorView extends SelectorView {
|
|
6
|
+
tagList: Tag[];
|
|
7
|
+
tagCreateStatus: FetchStateAndError;
|
|
8
|
+
tagDeleteStatusById: Record<ID, FetchStateAndError>;
|
|
9
|
+
}
|
|
10
|
+
export declare const getAllTags: (state: RootState) => TagViewSelectorView;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getAllTags = void 0;
|
|
4
|
+
const tagSelector_1 = require("../../entity/tag/tagSelector");
|
|
5
|
+
const getAllTags = (state) => {
|
|
6
|
+
const { tagState, tagViewState } = state;
|
|
7
|
+
const tagList = (0, tagSelector_1.getTagsByIds)(tagState, tagViewState.tagsId);
|
|
8
|
+
return {
|
|
9
|
+
tagList: tagList,
|
|
10
|
+
fetchState: tagViewState.fetchState,
|
|
11
|
+
tagDeleteStatusById: tagViewState.tagDeleteStatusById,
|
|
12
|
+
tagCreateStatus: tagViewState.tagCreateStatus,
|
|
13
|
+
error: undefined,
|
|
14
|
+
version: 0,
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
exports.getAllTags = getAllTags;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
2
|
import { Observable } from 'rxjs';
|
|
3
3
|
import { fetchTaskDetail, updateEditTaskFetchStatus, removeTaskDetail, initializeTaskToLocalStore } from '../taskDetailReducer';
|
|
4
|
+
import { updateTags } from '../../../../entity/tag/tagReducer';
|
|
4
5
|
import { ZeniAPI } from '../../../../zeniAPI';
|
|
5
6
|
import { RootState } from '../../../../reducer';
|
|
6
7
|
import { updateTasks } from '../../../../entity/task/taskReducer';
|
|
7
8
|
import { fetchFileList } from '../../../fileView/fileViewReducer';
|
|
8
9
|
import { openSnackbar } from '../../../../entity/snackbar/snackbarReducer';
|
|
9
|
-
export declare type ActionType = ReturnType<typeof fetchTaskDetail> | ReturnType<typeof updateEditTaskFetchStatus> | ReturnType<typeof removeTaskDetail> | ReturnType<typeof updateTasks> | ReturnType<typeof initializeTaskToLocalStore> | ReturnType<typeof fetchFileList> | ReturnType<typeof openSnackbar>;
|
|
10
|
+
export declare type ActionType = ReturnType<typeof fetchTaskDetail> | ReturnType<typeof updateTags> | ReturnType<typeof updateEditTaskFetchStatus> | ReturnType<typeof removeTaskDetail> | ReturnType<typeof updateTasks> | ReturnType<typeof initializeTaskToLocalStore> | ReturnType<typeof fetchFileList> | ReturnType<typeof openSnackbar>;
|
|
10
11
|
export declare const fetchTaskDetailEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
@@ -8,6 +8,7 @@ const rxjs_1 = require("rxjs");
|
|
|
8
8
|
const operators_1 = require("rxjs/operators");
|
|
9
9
|
const get_1 = __importDefault(require("lodash/get"));
|
|
10
10
|
const taskDetailReducer_1 = require("../taskDetailReducer");
|
|
11
|
+
const tagReducer_1 = require("../../../../entity/tag/tagReducer");
|
|
11
12
|
const responsePayload_1 = require("../../../../responsePayload");
|
|
12
13
|
const taskReducer_1 = require("../../../../entity/task/taskReducer");
|
|
13
14
|
const fileViewReducer_1 = require("../../../fileView/fileViewReducer");
|
|
@@ -34,6 +35,7 @@ const fetchTaskDetailEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, ope
|
|
|
34
35
|
taskId,
|
|
35
36
|
fetchState: 'Completed',
|
|
36
37
|
}),
|
|
38
|
+
(0, tagReducer_1.updateTags)(response.data.tasks.map((task) => task.tags).flat()),
|
|
37
39
|
(0, taskDetailReducer_1.initializeTaskToLocalStore)(taskId),
|
|
38
40
|
];
|
|
39
41
|
const fileIds = response.data.tasks[0].file_ids;
|
|
@@ -20,7 +20,7 @@ const initializeTaskToLocalStoreEpic = (actions$, state$) => actions$.pipe((0, o
|
|
|
20
20
|
assignee: task.assignees,
|
|
21
21
|
dueDate: task.dueDate,
|
|
22
22
|
priority: task.priority.code,
|
|
23
|
-
|
|
23
|
+
tagIds: task.tagIds,
|
|
24
24
|
fileIds: task.fileIds,
|
|
25
25
|
type: task.type,
|
|
26
26
|
recurringFrequency: task.recurringFrequency,
|
|
@@ -73,7 +73,7 @@ const prepareTaskPayload = (state, taskId) => {
|
|
|
73
73
|
due_date: (_d = (_c = localData.dueDate) === null || _c === void 0 ? void 0 : _c.format('YYYY-MM-DD')) !== null && _d !== void 0 ? _d : null,
|
|
74
74
|
priority: localData.priority,
|
|
75
75
|
status: localData.status,
|
|
76
|
-
|
|
76
|
+
tags: localData.tagIds,
|
|
77
77
|
file_ids: localData.fileIds,
|
|
78
78
|
type: localData.type.code,
|
|
79
79
|
recurring_end_date: localData.type.code === 'recurring'
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FetchStateAndError, ID } from '../../../commonStateTypes/common';
|
|
2
|
-
import { TaskStatusCodeType, PriorityCodeType,
|
|
2
|
+
import { TaskStatusCodeType, PriorityCodeType, TaskType } from '../../../entity/task/taskState';
|
|
3
3
|
import { ZeniDate } from '../../../zeniDayJS';
|
|
4
4
|
import { RecurringDatePickerOptions, RecurringFrequencyType } from '../../common/recurringViewHelper';
|
|
5
5
|
import { CommonHistoryView } from '../../spendManagement/commonHistoryView/commonHistory';
|
|
@@ -21,19 +21,19 @@ export interface EditTaskLocalData {
|
|
|
21
21
|
description: string;
|
|
22
22
|
status: TaskStatusCodeType;
|
|
23
23
|
assignee: ID[];
|
|
24
|
-
|
|
24
|
+
tagIds: ID[];
|
|
25
25
|
priority: PriorityCodeType;
|
|
26
|
-
tag?: TaskTagCodeType;
|
|
27
26
|
type: TaskType;
|
|
28
27
|
recurringEndDateLocalData: {
|
|
29
28
|
recurringDatePickerOptionsType?: RecurringDatePickerOptions;
|
|
30
29
|
recurringEndDate?: ZeniDate;
|
|
31
30
|
recurringCount?: number;
|
|
32
31
|
};
|
|
32
|
+
fileIds: ID[];
|
|
33
33
|
savedRecurringEndDate?: ZeniDate;
|
|
34
34
|
savedRecurringTasksCount?: number;
|
|
35
35
|
recurringFrequency?: RecurringFrequencyType;
|
|
36
36
|
recurringStartDate?: ZeniDate;
|
|
37
|
-
|
|
37
|
+
dueDate?: ZeniDate;
|
|
38
38
|
}
|
|
39
39
|
export declare const initialTaskDetail: EditTaskDetail;
|
|
@@ -49,6 +49,12 @@ export declare const fetchTaskDetailPage: import("@reduxjs/toolkit").ActionCreat
|
|
|
49
49
|
taskId: ID;
|
|
50
50
|
fetchState: FetchState;
|
|
51
51
|
error?: ZeniAPIStatus<Record<string, unknown>> | undefined;
|
|
52
|
-
}, string>, clearTaskDetail: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string
|
|
52
|
+
}, string>, clearTaskDetail: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, updateCreatedTagToLocalStore: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
53
|
+
tagId: ID;
|
|
54
|
+
taskId?: string | undefined;
|
|
55
|
+
}, string>, updateDeletedTagToLocalStore: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
56
|
+
tagId: ID | undefined;
|
|
57
|
+
taskId: ID | undefined;
|
|
58
|
+
}, string>;
|
|
53
59
|
declare const _default: import("@reduxjs/toolkit").Reducer<TaskDetailViewState, import("@reduxjs/toolkit").AnyAction>;
|
|
54
60
|
export default _default;
|
|
@@ -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.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.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 taskDetail_1 = require("./taskDetail");
|
|
@@ -68,6 +68,28 @@ const taskDetailView = (0, toolkit_1.createSlice)({
|
|
|
68
68
|
return { payload: { taskId } };
|
|
69
69
|
},
|
|
70
70
|
},
|
|
71
|
+
updateCreatedTagToLocalStore(draft, action) {
|
|
72
|
+
const key = action.payload.taskId;
|
|
73
|
+
if (key != null) {
|
|
74
|
+
draft.editTaskStateById[key].taskDetailLocalData.tagIds = [
|
|
75
|
+
action.payload.tagId,
|
|
76
|
+
];
|
|
77
|
+
}
|
|
78
|
+
else {
|
|
79
|
+
draft.newTaskState.taskDetailLocalData.tagIds = [action.payload.tagId];
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
updateDeletedTagToLocalStore(draft, action) {
|
|
83
|
+
const { tagId, taskId } = action.payload;
|
|
84
|
+
if (taskId != null) {
|
|
85
|
+
if (draft.editTaskStateById[taskId].taskDetailLocalData.tagIds.find((tag) => tag === tagId) != null) {
|
|
86
|
+
draft.editTaskStateById[taskId].taskDetailLocalData.tagIds = [];
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
else if (draft.newTaskState.taskDetailLocalData.tagIds.find((tag) => tag === tagId) != null) {
|
|
90
|
+
draft.newTaskState.taskDetailLocalData.tagIds = [];
|
|
91
|
+
}
|
|
92
|
+
},
|
|
71
93
|
saveTaskUpdatesToLocalStore(draft, action) {
|
|
72
94
|
if (action.payload.taskId != null) {
|
|
73
95
|
const key = action.payload.taskId;
|
|
@@ -215,5 +237,5 @@ const taskDetailView = (0, toolkit_1.createSlice)({
|
|
|
215
237
|
},
|
|
216
238
|
},
|
|
217
239
|
});
|
|
218
|
-
_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;
|
|
240
|
+
_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;
|
|
219
241
|
exports.default = taskDetailView.reducer;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { FetchStateAndError, ID } from '../../../commonStateTypes/common';
|
|
2
2
|
import { SelectorView } from '../../../commonStateTypes/viewAndReport/viewAndReport';
|
|
3
3
|
import { Class } from '../../../entity/class/classState';
|
|
4
|
-
import {
|
|
4
|
+
import { TaskStatus, TaskPriority } from '../../../entity/task/taskState';
|
|
5
5
|
import { RootState } from '../../../reducer';
|
|
6
6
|
import { File } from '../../../entity/file/fileState';
|
|
7
7
|
import { UserListSelectorView } from '../../userListView/userListViewSelector';
|
|
@@ -20,6 +20,5 @@ export interface TaskDetailSelectorView extends SelectorView {
|
|
|
20
20
|
createdByUser?: UserAndRole;
|
|
21
21
|
}
|
|
22
22
|
export declare const getTaskDetail: (state: RootState, taskId?: string | undefined) => TaskDetailSelectorView;
|
|
23
|
-
export declare const allTaskTags: TaskTag[];
|
|
24
23
|
export declare const allTaskStatus: TaskStatus[];
|
|
25
24
|
export declare const allTaskPriority: TaskPriority[];
|
|
@@ -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.allTaskPriority = exports.allTaskStatus = exports.
|
|
6
|
+
exports.allTaskPriority = exports.allTaskStatus = exports.getTaskDetail = void 0;
|
|
7
7
|
const isEqual_1 = __importDefault(require("lodash/isEqual"));
|
|
8
8
|
const reduceFetchState_1 = require("../../../commonStateTypes/reduceFetchState");
|
|
9
9
|
const classSelector_1 = require("../../../entity/class/classSelector");
|
|
@@ -84,48 +84,6 @@ const getTaskDetail = (state, taskId) => {
|
|
|
84
84
|
};
|
|
85
85
|
};
|
|
86
86
|
exports.getTaskDetail = getTaskDetail;
|
|
87
|
-
exports.allTaskTags = [
|
|
88
|
-
{
|
|
89
|
-
code: 'invoices',
|
|
90
|
-
name: 'Invoices',
|
|
91
|
-
},
|
|
92
|
-
{
|
|
93
|
-
code: 'receipts',
|
|
94
|
-
name: 'Receipts',
|
|
95
|
-
},
|
|
96
|
-
{
|
|
97
|
-
code: 'tax_equity',
|
|
98
|
-
name: 'Tax',
|
|
99
|
-
},
|
|
100
|
-
{
|
|
101
|
-
code: 'payroll_statements',
|
|
102
|
-
name: 'Payroll',
|
|
103
|
-
},
|
|
104
|
-
{
|
|
105
|
-
code: 'accrual',
|
|
106
|
-
name: 'Accrual',
|
|
107
|
-
},
|
|
108
|
-
{
|
|
109
|
-
code: 'ap',
|
|
110
|
-
name: 'AP',
|
|
111
|
-
},
|
|
112
|
-
{
|
|
113
|
-
code: 'ar',
|
|
114
|
-
name: 'AR',
|
|
115
|
-
},
|
|
116
|
-
{
|
|
117
|
-
code: 'loan',
|
|
118
|
-
name: 'Loan',
|
|
119
|
-
},
|
|
120
|
-
{
|
|
121
|
-
code: 'uncategorized_transactions',
|
|
122
|
-
name: 'Uncat txns',
|
|
123
|
-
},
|
|
124
|
-
{
|
|
125
|
-
code: 'access',
|
|
126
|
-
name: 'Access',
|
|
127
|
-
},
|
|
128
|
-
];
|
|
129
87
|
exports.allTaskStatus = [
|
|
130
88
|
{
|
|
131
89
|
code: 'todo',
|
|
@@ -167,14 +125,14 @@ exports.allTaskPriority = [
|
|
|
167
125
|
},
|
|
168
126
|
];
|
|
169
127
|
const showFormFooter = (taskDetailLocalData, taskDetailInStore) => {
|
|
170
|
-
var _a, _b
|
|
128
|
+
var _a, _b;
|
|
171
129
|
if (taskDetailLocalData.name !== (taskDetailInStore === null || taskDetailInStore === void 0 ? void 0 : taskDetailInStore.name) ||
|
|
172
130
|
taskDetailLocalData.description !== taskDetailInStore.description ||
|
|
173
131
|
taskDetailLocalData.priority !== taskDetailInStore.priority.code ||
|
|
174
132
|
taskDetailLocalData.status !== taskDetailInStore.status.code ||
|
|
175
|
-
!(0, isEqual_1.default)(
|
|
176
|
-
!(0, isEqual_1.default)(taskDetailLocalData.assignee, (
|
|
177
|
-
!(0, isEqual_1.default)(taskDetailLocalData.fileIds, (
|
|
133
|
+
!(0, isEqual_1.default)(taskDetailInStore.tagIds, taskDetailLocalData.tagIds) ||
|
|
134
|
+
!(0, isEqual_1.default)(taskDetailLocalData.assignee, (_a = taskDetailInStore === null || taskDetailInStore === void 0 ? void 0 : taskDetailInStore.assignees) !== null && _a !== void 0 ? _a : []) ||
|
|
135
|
+
!(0, isEqual_1.default)(taskDetailLocalData.fileIds, (_b = taskDetailInStore.fileIds) !== null && _b !== void 0 ? _b : []) ||
|
|
178
136
|
!(0, isEqual_1.default)(taskDetailLocalData.dueDate, taskDetailInStore.dueDate) ||
|
|
179
137
|
!(0, isEqual_1.default)(taskDetailLocalData.type, taskDetailInStore.type) ||
|
|
180
138
|
!(0, isEqual_1.default)(taskDetailLocalData.savedRecurringEndDate, taskDetailInStore.recurringEndDate) ||
|