@zeniai/client-epic-state 4.11.15 → 4.11.16
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/billPay/billTransaction/billTransactionPayload.d.ts +0 -9
- package/lib/entity/billPay/billTransaction/billTransactionPayload.js +2 -15
- package/lib/entity/billPay/billTransaction/billTransactionReducer.d.ts +1 -2
- package/lib/entity/billPay/billTransaction/billTransactionReducer.js +2 -25
- package/lib/entity/billPay/billTransaction/billTransactionState.d.ts +1 -11
- package/lib/entity/billPay/billTransaction/billTransactionState.js +1 -9
- package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
- package/lib/entity/snackbar/snackbarTypes.js +0 -6
- package/lib/entity/task/taskPayload.d.ts +2 -2
- package/lib/entity/task/taskPayload.js +0 -1
- package/lib/entity/task/taskState.d.ts +2 -3
- package/lib/entity/tenant/clearAllEpic.d.ts +2 -5
- package/lib/entity/tenant/clearAllEpic.js +0 -8
- package/lib/entity/toastNotification/epic/pushToastNotificationEpic.d.ts +1 -1
- package/lib/entity/transaction/stateTypes/attachment.d.ts +0 -6
- package/lib/entity/transaction/stateTypes/transactionType.d.ts +0 -3
- package/lib/entity/transaction/stateTypes/transactionType.js +3 -7
- package/lib/entity/vendor/vendorPayload.d.ts +0 -2
- package/lib/entity/vendor/vendorPayload.js +1 -5
- package/lib/entity/vendor/vendorState.d.ts +0 -2
- package/lib/epic.d.ts +1 -12
- package/lib/epic.js +1 -12
- package/lib/index.d.ts +12 -18
- package/lib/index.js +10 -37
- package/lib/reducer.d.ts +0 -9
- package/lib/reducer.js +0 -9
- package/lib/view/companyView/selector/companyManagementViewSelector.js +7 -13
- package/lib/view/companyView/selector/companyPortfolioViewSelector.js +6 -1
- package/lib/view/fileView/fileUploadHelpers.d.ts +0 -5
- 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/reviewCompanyView/reviewCompanyViewSelector.js +9 -26
- package/lib/view/settingsView/epic/saveNotificationSettingsEpic.d.ts +1 -1
- package/lib/view/spendManagement/billPay/billList/billListReducer.d.ts +2 -3
- package/lib/view/spendManagement/billPay/billList/billListReducer.js +3 -9
- package/lib/view/spendManagement/billPay/billList/billListSelector.d.ts +2 -19
- package/lib/view/spendManagement/billPay/billList/billListSelector.js +3 -150
- package/lib/view/spendManagement/billPay/billList/billListState.d.ts +1 -1
- package/lib/view/spendManagement/billPay/billPayConfig/billPayConfigPayload.d.ts +0 -1
- package/lib/view/spendManagement/billPay/billPayConfig/billPayConfigReducer.js +0 -2
- package/lib/view/spendManagement/billPay/billPayConfig/billPayConfigState.d.ts +0 -1
- package/lib/view/spendManagement/billPay/editBillView/editBillViewSelector.d.ts +8 -9
- package/lib/view/spendManagement/billPay/editBillView/editBillViewSelector.js +4 -6
- package/lib/view/spendManagement/commonHistoryView/commonHistory.d.ts +1 -1
- package/lib/view/spendManagement/helpers.d.ts +0 -3
- package/lib/view/spendManagement/helpers.js +1 -17
- package/lib/view/spendManagement/reimbursement/remiListView/remiListReducer.d.ts +1 -1
- package/lib/view/spendManagement/reimbursement/remiListView/remiListState.d.ts +3 -3
- package/lib/view/subscriptionView/subscriptionViewSelector.js +1 -5
- package/lib/view/tagView/epics/createTagEpic.d.ts +1 -1
- package/lib/view/tagView/epics/deleteTagEpic.d.ts +1 -1
- package/lib/view/taskManager/taskDetailView/epics/saveTaskDetailEpic.d.ts +1 -2
- package/lib/view/taskManager/taskDetailView/epics/saveTaskDetailEpic.js +4 -11
- package/lib/view/taskManager/taskDetailView/taskDetailReducer.d.ts +1 -2
- package/lib/view/taskManager/taskDetailView/taskDetailReducer.js +1 -2
- package/lib/view/taskManager/taskListView/fetchTaskListPageEpic.d.ts +1 -3
- package/lib/view/taskManager/taskListView/fetchTaskListPageEpic.js +0 -12
- package/lib/view/taskManager/taskListView/taskList.d.ts +1 -14
- package/lib/view/taskManager/taskListView/taskListReducer.d.ts +2 -31
- package/lib/view/taskManager/taskListView/taskListReducer.js +9 -136
- package/lib/view/taskManager/taskListView/taskListSelector.d.ts +2 -12
- package/lib/view/taskManager/taskListView/taskListSelector.js +23 -59
- package/lib/view/transactionDetail/epics/updateTransactionDetailEpic.js +5 -22
- package/lib/view/vendorReviewView/vendorFirstReviewView/epics/fetchVendorFirstReviewViewEpic.js +0 -1
- package/lib/view/vendorReviewView/vendorFirstReviewView/epics/saveVendorFirstReviewViewEpic.js +5 -11
- package/lib/view/vendorReviewView/vendorFirstReviewView/vendorFirstReviewViewPayload.d.ts +0 -15
- package/lib/view/vendorReviewView/vendorFirstReviewView/vendorFirstReviewViewReducer.d.ts +3 -13
- package/lib/view/vendorReviewView/vendorFirstReviewView/vendorFirstReviewViewReducer.js +3 -45
- package/lib/view/vendorReviewView/vendorFirstReviewView/vendorFirstReviewViewSelector.d.ts +0 -8
- package/lib/view/vendorReviewView/vendorFirstReviewView/vendorFirstReviewViewSelector.js +2 -17
- package/lib/view/vendorReviewView/vendorFirstReviewView/vendorFirstReviewViewState.d.ts +2 -6
- package/lib/view/vendorReviewView/vendorFirstReviewView/vendorFirstReviewViewState.js +1 -2
- package/package.json +1 -1
- package/lib/entity/taskGroup/taskGroupPayload.d.ts +0 -9
- package/lib/entity/taskGroup/taskGroupPayload.js +0 -14
- package/lib/entity/taskGroup/taskGroupReducer.d.ts +0 -6
- package/lib/entity/taskGroup/taskGroupReducer.js +0 -33
- package/lib/entity/taskGroup/taskGroupSelector.d.ts +0 -4
- package/lib/entity/taskGroup/taskGroupSelector.js +0 -18
- package/lib/entity/taskGroup/taskGroupState.d.ts +0 -12
- package/lib/entity/taskGroup/taskGroupState.js +0 -2
- package/lib/view/spendManagement/billPay/billsBulkActionView/billsBulkActionViewPayload.d.ts +0 -32
- package/lib/view/spendManagement/billPay/billsBulkActionView/billsBulkActionViewPayload.js +0 -2
- package/lib/view/spendManagement/billPay/billsBulkActionView/billsBulkActionViewReducer.d.ts +0 -17
- package/lib/view/spendManagement/billPay/billsBulkActionView/billsBulkActionViewReducer.js +0 -166
- package/lib/view/spendManagement/billPay/billsBulkActionView/billsBulkActionViewSelector.d.ts +0 -24
- package/lib/view/spendManagement/billPay/billsBulkActionView/billsBulkActionViewSelector.js +0 -45
- package/lib/view/spendManagement/billPay/billsBulkActionView/billsBulkActionViewState.d.ts +0 -28
- package/lib/view/spendManagement/billPay/billsBulkActionView/billsBulkActionViewState.js +0 -7
- package/lib/view/spendManagement/billPay/billsBulkActionView/epics/approveOrRejectBillsBulkActionEpic.d.ts +0 -9
- package/lib/view/spendManagement/billPay/billsBulkActionView/epics/approveOrRejectBillsBulkActionEpic.js +0 -73
- package/lib/view/spendManagement/billPay/billsBulkActionView/epics/cancelOrDeleteBillsBulkActionEpic.d.ts +0 -8
- package/lib/view/spendManagement/billPay/billsBulkActionView/epics/cancelOrDeleteBillsBulkActionEpic.js +0 -74
- package/lib/view/spendManagement/billPay/billsBulkActionView/epics/reviewDraftBillsBulkActionEpic.ts.d.ts +0 -7
- package/lib/view/spendManagement/billPay/billsBulkActionView/epics/reviewDraftBillsBulkActionEpic.ts.js +0 -29
- package/lib/view/spendManagement/billPay/billsBulkActionView/epics/submitDraftBillsBulkActionEpic.d.ts +0 -8
- package/lib/view/spendManagement/billPay/billsBulkActionView/epics/submitDraftBillsBulkActionEpic.js +0 -62
- package/lib/view/taskManager/taskGroupView/epics/createNewTaskGroupEpic.d.ts +0 -10
- package/lib/view/taskManager/taskGroupView/epics/createNewTaskGroupEpic.js +0 -57
- package/lib/view/taskManager/taskGroupView/epics/deleteTaskGroupEpic.d.ts +0 -10
- package/lib/view/taskManager/taskGroupView/epics/deleteTaskGroupEpic.js +0 -41
- package/lib/view/taskManager/taskGroupView/epics/fetchAllTaskGroupsEpic.d.ts +0 -8
- package/lib/view/taskManager/taskGroupView/epics/fetchAllTaskGroupsEpic.js +0 -33
- package/lib/view/taskManager/taskGroupView/epics/updateTaskGroupNameEpic.d.ts +0 -10
- package/lib/view/taskManager/taskGroupView/epics/updateTaskGroupNameEpic.js +0 -51
- package/lib/view/taskManager/taskGroupView/taskGroupViewPayload.d.ts +0 -6
- package/lib/view/taskManager/taskGroupView/taskGroupViewPayload.js +0 -2
- package/lib/view/taskManager/taskGroupView/taskGroupViewReducer.d.ts +0 -34
- package/lib/view/taskManager/taskGroupView/taskGroupViewReducer.js +0 -123
- package/lib/view/taskManager/taskGroupView/taskGroupViewState.d.ts +0 -7
- package/lib/view/taskManager/taskGroupView/taskGroupViewState.js +0 -2
- package/lib/view/taskManager/taskListView/bulkUpdateTaskListEpic.d.ts +0 -8
- package/lib/view/taskManager/taskListView/bulkUpdateTaskListEpic.js +0 -88
- package/lib/view/taskManager/taskListView/dragNDropTasksEpic.d.ts +0 -6
- package/lib/view/taskManager/taskListView/dragNDropTasksEpic.js +0 -20
- package/lib/view/vendorReviewView/vendorFirstReviewView/epics/fetchVendorFirstReviewAttachmentsEpic.d.ts +0 -10
- package/lib/view/vendorReviewView/vendorFirstReviewView/epics/fetchVendorFirstReviewAttachmentsEpic.js +0 -37
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
|
-
import { ZeniAPI } from '../../../../../zeniAPI';
|
|
3
|
-
import { RootState } from '../../../../../reducer';
|
|
4
|
-
import { updateBillTransactionsWithBulkActionStatus } from '../../../../../entity/billPay/billTransaction/billTransactionReducer';
|
|
5
|
-
import { openSnackbar } from '../../../../../entity/snackbar/snackbarReducer';
|
|
6
|
-
import { cancelOrDeleteBillsBulkAction, billsBulkActionFailure, billsBulkActionSuccess } from '../billsBulkActionViewReducer';
|
|
7
|
-
export declare type ActionType = ReturnType<typeof cancelOrDeleteBillsBulkAction> | ReturnType<typeof updateBillTransactionsWithBulkActionStatus> | ReturnType<typeof openSnackbar> | ReturnType<typeof billsBulkActionFailure> | ReturnType<typeof billsBulkActionSuccess>;
|
|
8
|
-
export declare const cancelOrDeleteBillsBulkActionEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => import("rxjs").Observable<ActionType>;
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.cancelOrDeleteBillsBulkActionEpic = void 0;
|
|
4
|
-
const rxjs_1 = require("rxjs");
|
|
5
|
-
const operators_1 = require("rxjs/operators");
|
|
6
|
-
const responsePayload_1 = require("../../../../../responsePayload");
|
|
7
|
-
const billTransactionReducer_1 = require("../../../../../entity/billPay/billTransaction/billTransactionReducer");
|
|
8
|
-
const snackbarReducer_1 = require("../../../../../entity/snackbar/snackbarReducer");
|
|
9
|
-
const billsBulkActionViewReducer_1 = require("../billsBulkActionViewReducer");
|
|
10
|
-
const cancelOrDeleteBillsBulkActionEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(billsBulkActionViewReducer_1.cancelOrDeleteBillsBulkAction.match), (0, operators_1.mergeMap)((action) => {
|
|
11
|
-
const { operationType, description } = action.payload;
|
|
12
|
-
const { billsBulkActionViewState } = state$.value;
|
|
13
|
-
const transactionIds = billsBulkActionViewState.billsSelectedForBulkAction;
|
|
14
|
-
const payload = prepareBulkCancelOrDeletePayload(transactionIds, operationType, description);
|
|
15
|
-
const bulkApiUrl = `${zeniAPI.apiEndPoints.accountMicroServiceBaseUrl}/1.0/bulk/bills/transactions`;
|
|
16
|
-
const api = operationType === 'cancel'
|
|
17
|
-
? zeniAPI.putAndGetJSON(bulkApiUrl, payload)
|
|
18
|
-
: zeniAPI.deleteAndGetJSON(bulkApiUrl, payload);
|
|
19
|
-
return api.pipe((0, operators_1.mergeMap)((response) => {
|
|
20
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
21
|
-
if ((0, responsePayload_1.isSuccessStatus)(response)) {
|
|
22
|
-
const actions = [];
|
|
23
|
-
actions.push((0, billsBulkActionViewReducer_1.billsBulkActionSuccess)({
|
|
24
|
-
billsProcessing: (_b = (_a = response.data) === null || _a === void 0 ? void 0 : _a.total_operations_processing) !== null && _b !== void 0 ? _b : 0,
|
|
25
|
-
refreshTime: (_d = (_c = response.data) === null || _c === void 0 ? void 0 : _c.hard_refresh_after_sec) !== null && _d !== void 0 ? _d : 0,
|
|
26
|
-
}));
|
|
27
|
-
actions.push((0, billTransactionReducer_1.updateBillTransactionsWithBulkActionStatus)((_f = (_e = response.data) === null || _e === void 0 ? void 0 : _e.operations) !== null && _f !== void 0 ? _f : []));
|
|
28
|
-
actions.push((0, snackbarReducer_1.openSnackbar)({
|
|
29
|
-
messageSection: 'bill_pay_bulk_submit',
|
|
30
|
-
messageText: 'success',
|
|
31
|
-
type: 'success',
|
|
32
|
-
variables: [
|
|
33
|
-
{
|
|
34
|
-
variableName: '_count_',
|
|
35
|
-
variableValue: (_h = (_g = response.data) === null || _g === void 0 ? void 0 : _g.total_operations_processing.toString()) !== null && _h !== void 0 ? _h : '',
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
variableName: '_action_',
|
|
39
|
-
variableValue: operationType === 'cancel' ? 'canceled' : 'deleted',
|
|
40
|
-
},
|
|
41
|
-
],
|
|
42
|
-
}));
|
|
43
|
-
return (0, rxjs_1.from)(actions);
|
|
44
|
-
}
|
|
45
|
-
else {
|
|
46
|
-
return (0, rxjs_1.of)((0, billsBulkActionViewReducer_1.billsBulkActionFailure)(response.status), (0, snackbarReducer_1.openSnackbar)({
|
|
47
|
-
messageSection: 'bill_pay_bulk_submit',
|
|
48
|
-
messageText: 'failed',
|
|
49
|
-
type: 'error',
|
|
50
|
-
variables: [
|
|
51
|
-
{
|
|
52
|
-
variableName: '_api-error_',
|
|
53
|
-
variableValue: response.status.message,
|
|
54
|
-
},
|
|
55
|
-
],
|
|
56
|
-
}));
|
|
57
|
-
}
|
|
58
|
-
}), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, billsBulkActionViewReducer_1.billsBulkActionFailure)((0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Bill bulk action REST API call errored out ' +
|
|
59
|
-
JSON.stringify(error))))));
|
|
60
|
-
}));
|
|
61
|
-
exports.cancelOrDeleteBillsBulkActionEpic = cancelOrDeleteBillsBulkActionEpic;
|
|
62
|
-
function prepareBulkCancelOrDeletePayload(transactionIds, operationType, description) {
|
|
63
|
-
const bulkCancelOrDeleteItems = transactionIds.map((id) => ({
|
|
64
|
-
entity_id: id,
|
|
65
|
-
request_data: {
|
|
66
|
-
bill_pay_provider: 'zeni',
|
|
67
|
-
description,
|
|
68
|
-
},
|
|
69
|
-
}));
|
|
70
|
-
return {
|
|
71
|
-
operation_type: operationType,
|
|
72
|
-
operations: bulkCancelOrDeleteItems,
|
|
73
|
-
};
|
|
74
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
|
-
import { Observable } from 'rxjs';
|
|
3
|
-
import { ZeniAPI } from '../../../../../zeniAPI';
|
|
4
|
-
import { RootState } from '../../../../../reducer';
|
|
5
|
-
import { reviewDraftBillsBulkAction, reviewDraftBillsBulkActionFailure, reviewDraftBillsBulkActionSuccess } from '../billsBulkActionViewReducer';
|
|
6
|
-
export declare type ActionType = ReturnType<typeof reviewDraftBillsBulkAction> | ReturnType<typeof reviewDraftBillsBulkActionSuccess> | ReturnType<typeof reviewDraftBillsBulkActionFailure>;
|
|
7
|
-
export declare const reviewDraftBillsBulkActionEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.reviewDraftBillsBulkActionEpic = void 0;
|
|
4
|
-
const rxjs_1 = require("rxjs");
|
|
5
|
-
const operators_1 = require("rxjs/operators");
|
|
6
|
-
const responsePayload_1 = require("../../../../../responsePayload");
|
|
7
|
-
const billsBulkActionViewReducer_1 = require("../billsBulkActionViewReducer");
|
|
8
|
-
const reviewDraftBillsBulkActionEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(billsBulkActionViewReducer_1.reviewDraftBillsBulkAction.match), (0, operators_1.mergeMap)(() => {
|
|
9
|
-
const { billsBulkActionViewState } = state$.value;
|
|
10
|
-
const transactionIds = billsBulkActionViewState.billsSelectedForBulkAction;
|
|
11
|
-
const queryParam = {
|
|
12
|
-
entity_ids: transactionIds,
|
|
13
|
-
};
|
|
14
|
-
return zeniAPI
|
|
15
|
-
.getJSON(`${zeniAPI.apiEndPoints.accountMicroServiceBaseUrl}/1.0/bulk/bills//transactions/validate?query=${encodeURIComponent(JSON.stringify(queryParam))}`)
|
|
16
|
-
.pipe((0, operators_1.mergeMap)((response) => {
|
|
17
|
-
var _a, _b;
|
|
18
|
-
if ((0, responsePayload_1.isSuccessStatus)(response)) {
|
|
19
|
-
const actions = [];
|
|
20
|
-
actions.push((0, billsBulkActionViewReducer_1.reviewDraftBillsBulkActionSuccess)((_b = (_a = response.data) === null || _a === void 0 ? void 0 : _a.validation_results) !== null && _b !== void 0 ? _b : []));
|
|
21
|
-
return (0, rxjs_1.from)(actions);
|
|
22
|
-
}
|
|
23
|
-
else {
|
|
24
|
-
return (0, rxjs_1.of)((0, billsBulkActionViewReducer_1.reviewDraftBillsBulkActionFailure)(response.status));
|
|
25
|
-
}
|
|
26
|
-
}), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, billsBulkActionViewReducer_1.reviewDraftBillsBulkActionFailure)((0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Bill bulk review action REST API call errored out ' +
|
|
27
|
-
JSON.stringify(error))))));
|
|
28
|
-
}));
|
|
29
|
-
exports.reviewDraftBillsBulkActionEpic = reviewDraftBillsBulkActionEpic;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
|
-
import { ZeniAPI } from '../../../../../zeniAPI';
|
|
3
|
-
import { RootState } from '../../../../../reducer';
|
|
4
|
-
import { updateBillTransactionsWithBulkActionStatus } from '../../../../../entity/billPay/billTransaction/billTransactionReducer';
|
|
5
|
-
import { openSnackbar } from '../../../../../entity/snackbar/snackbarReducer';
|
|
6
|
-
import { billsBulkActionFailure, submitDraftBillsBulkAction, billsBulkActionSuccess } from '../billsBulkActionViewReducer';
|
|
7
|
-
export declare type ActionType = ReturnType<typeof submitDraftBillsBulkAction> | ReturnType<typeof updateBillTransactionsWithBulkActionStatus> | ReturnType<typeof openSnackbar> | ReturnType<typeof billsBulkActionFailure> | ReturnType<typeof billsBulkActionSuccess>;
|
|
8
|
-
export declare const submitDraftBillsBulkActionEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => import("rxjs").Observable<ActionType>;
|
package/lib/view/spendManagement/billPay/billsBulkActionView/epics/submitDraftBillsBulkActionEpic.js
DELETED
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.submitDraftBillsBulkActionEpic = void 0;
|
|
4
|
-
const rxjs_1 = require("rxjs");
|
|
5
|
-
const operators_1 = require("rxjs/operators");
|
|
6
|
-
const responsePayload_1 = require("../../../../../responsePayload");
|
|
7
|
-
const billTransactionReducer_1 = require("../../../../../entity/billPay/billTransaction/billTransactionReducer");
|
|
8
|
-
const snackbarReducer_1 = require("../../../../../entity/snackbar/snackbarReducer");
|
|
9
|
-
const billsBulkActionViewReducer_1 = require("../billsBulkActionViewReducer");
|
|
10
|
-
const submitDraftBillsBulkActionEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(billsBulkActionViewReducer_1.submitDraftBillsBulkAction.match), (0, operators_1.mergeMap)(() => {
|
|
11
|
-
const { billsBulkActionViewState } = state$.value;
|
|
12
|
-
const transactionIds = billsBulkActionViewState.billsSelectedForBulkAction;
|
|
13
|
-
const payload = {
|
|
14
|
-
operation_type: 'send_for_approval',
|
|
15
|
-
operations: transactionIds.map((id) => ({ entity_id: id })),
|
|
16
|
-
};
|
|
17
|
-
const bulkApiUrl = `${zeniAPI.apiEndPoints.accountMicroServiceBaseUrl}/1.0/bulk/bills/transactions`;
|
|
18
|
-
return zeniAPI
|
|
19
|
-
.putAndGetJSON(bulkApiUrl, payload)
|
|
20
|
-
.pipe((0, operators_1.mergeMap)((response) => {
|
|
21
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
22
|
-
if ((0, responsePayload_1.isSuccessStatus)(response)) {
|
|
23
|
-
const actions = [];
|
|
24
|
-
actions.push((0, billsBulkActionViewReducer_1.billsBulkActionSuccess)({
|
|
25
|
-
billsProcessing: (_b = (_a = response.data) === null || _a === void 0 ? void 0 : _a.total_operations_processing) !== null && _b !== void 0 ? _b : 0,
|
|
26
|
-
refreshTime: (_d = (_c = response.data) === null || _c === void 0 ? void 0 : _c.hard_refresh_after_sec) !== null && _d !== void 0 ? _d : 0,
|
|
27
|
-
}));
|
|
28
|
-
actions.push((0, billTransactionReducer_1.updateBillTransactionsWithBulkActionStatus)((_f = (_e = response.data) === null || _e === void 0 ? void 0 : _e.operations) !== null && _f !== void 0 ? _f : []));
|
|
29
|
-
actions.push((0, snackbarReducer_1.openSnackbar)({
|
|
30
|
-
messageSection: 'bill_pay_bulk_submit',
|
|
31
|
-
messageText: 'success',
|
|
32
|
-
type: 'success',
|
|
33
|
-
variables: [
|
|
34
|
-
{
|
|
35
|
-
variableName: '_count_',
|
|
36
|
-
variableValue: (_h = (_g = response.data) === null || _g === void 0 ? void 0 : _g.total_operations_processing.toString()) !== null && _h !== void 0 ? _h : '',
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
variableName: '_action_',
|
|
40
|
-
variableValue: 'sent for approval',
|
|
41
|
-
},
|
|
42
|
-
],
|
|
43
|
-
}));
|
|
44
|
-
return (0, rxjs_1.from)(actions);
|
|
45
|
-
}
|
|
46
|
-
else {
|
|
47
|
-
return (0, rxjs_1.of)((0, billsBulkActionViewReducer_1.billsBulkActionFailure)(response.status), (0, snackbarReducer_1.openSnackbar)({
|
|
48
|
-
messageSection: 'bill_pay_bulk_submit',
|
|
49
|
-
messageText: 'failed',
|
|
50
|
-
type: 'error',
|
|
51
|
-
variables: [
|
|
52
|
-
{
|
|
53
|
-
variableName: '_api-error_',
|
|
54
|
-
variableValue: response.status.message,
|
|
55
|
-
},
|
|
56
|
-
],
|
|
57
|
-
}));
|
|
58
|
-
}
|
|
59
|
-
}), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, billsBulkActionViewReducer_1.billsBulkActionFailure)((0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Bulk Send For Approval bill REST API call errored out ' +
|
|
60
|
-
JSON.stringify(error))))));
|
|
61
|
-
}));
|
|
62
|
-
exports.submitDraftBillsBulkActionEpic = submitDraftBillsBulkActionEpic;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
|
-
import { Observable } from 'rxjs';
|
|
3
|
-
import { RootState } from '../../../../reducer';
|
|
4
|
-
import { ZeniAPI } from '../../../../zeniAPI';
|
|
5
|
-
import { createNewTaskGroup, updateTaskGroupCreationFetchStatus, updateTaskGroupViewOnTaskGroupCreationSuccess } from '../taskGroupViewReducer';
|
|
6
|
-
import { updateTaskListOnNewGroupCreationSuccess, bulkUpdateTaskList } from '../../taskListView/taskListReducer';
|
|
7
|
-
import { updateTaskGroup } from '../../../../entity/taskGroup/taskGroupReducer';
|
|
8
|
-
import { openSnackbar } from '../../../../entity/snackbar/snackbarReducer';
|
|
9
|
-
export declare type ActionType = ReturnType<typeof createNewTaskGroup> | ReturnType<typeof updateTaskGroup> | ReturnType<typeof updateTaskListOnNewGroupCreationSuccess> | ReturnType<typeof updateTaskGroupViewOnTaskGroupCreationSuccess> | ReturnType<typeof openSnackbar> | ReturnType<typeof bulkUpdateTaskList> | ReturnType<typeof updateTaskGroupCreationFetchStatus>;
|
|
10
|
-
export declare const createNewTaskGroupEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createNewTaskGroupEpic = void 0;
|
|
4
|
-
const rxjs_1 = require("rxjs");
|
|
5
|
-
const operators_1 = require("rxjs/operators");
|
|
6
|
-
const responsePayload_1 = require("../../../../responsePayload");
|
|
7
|
-
const taskGroupViewReducer_1 = require("../taskGroupViewReducer");
|
|
8
|
-
const taskListReducer_1 = require("../../taskListView/taskListReducer");
|
|
9
|
-
const taskGroupReducer_1 = require("../../../../entity/taskGroup/taskGroupReducer");
|
|
10
|
-
const snackbarReducer_1 = require("../../../../entity/snackbar/snackbarReducer");
|
|
11
|
-
const createNewTaskGroupEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(taskGroupViewReducer_1.createNewTaskGroup.match), (0, operators_1.switchMap)((action) => {
|
|
12
|
-
const { groupName, updateSelectedTasks } = action.payload;
|
|
13
|
-
const state = state$.value;
|
|
14
|
-
const { localData } = state.taskListState;
|
|
15
|
-
const payload = {
|
|
16
|
-
name: groupName,
|
|
17
|
-
};
|
|
18
|
-
return zeniAPI
|
|
19
|
-
.postAndGetJSON(`${zeniAPI.apiEndPoints.taskMicroServiceBaseUrl}/1.0/task-manager/groups`, payload)
|
|
20
|
-
.pipe((0, operators_1.mergeMap)((response) => {
|
|
21
|
-
if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
|
|
22
|
-
const actions = [
|
|
23
|
-
(0, taskGroupReducer_1.updateTaskGroup)(response.data.task_groups[0]),
|
|
24
|
-
(0, taskGroupViewReducer_1.updateTaskGroupViewOnTaskGroupCreationSuccess)({
|
|
25
|
-
newTaskGroupId: response.data.task_groups[0].task_group_id,
|
|
26
|
-
}),
|
|
27
|
-
(0, taskListReducer_1.updateTaskListOnNewGroupCreationSuccess)({
|
|
28
|
-
newTaskGroup: response.data.task_groups[0],
|
|
29
|
-
}),
|
|
30
|
-
(0, snackbarReducer_1.openSnackbar)({
|
|
31
|
-
messageSection: 'task_group_creation_success',
|
|
32
|
-
messageText: 'success',
|
|
33
|
-
type: 'success',
|
|
34
|
-
}),
|
|
35
|
-
];
|
|
36
|
-
if (updateSelectedTasks === true) {
|
|
37
|
-
actions.push((0, taskListReducer_1.bulkUpdateTaskList)(localData.selectedTaskIds, {
|
|
38
|
-
taskGroupIds: [response.data.task_groups[0].task_group_id],
|
|
39
|
-
}));
|
|
40
|
-
}
|
|
41
|
-
return (0, rxjs_1.from)(actions);
|
|
42
|
-
}
|
|
43
|
-
else {
|
|
44
|
-
return (0, rxjs_1.of)((0, taskGroupViewReducer_1.updateTaskGroupCreationFetchStatus)({
|
|
45
|
-
fetchState: 'Error',
|
|
46
|
-
error: response.status,
|
|
47
|
-
}));
|
|
48
|
-
}
|
|
49
|
-
}), (0, operators_1.catchError)((error) => {
|
|
50
|
-
return (0, rxjs_1.of)((0, taskGroupViewReducer_1.updateTaskGroupCreationFetchStatus)({
|
|
51
|
-
fetchState: 'Error',
|
|
52
|
-
error: (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Create Task Group REST API call errored out' +
|
|
53
|
-
JSON.stringify(error)),
|
|
54
|
-
}));
|
|
55
|
-
}));
|
|
56
|
-
}));
|
|
57
|
-
exports.createNewTaskGroupEpic = createNewTaskGroupEpic;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
|
-
import { Observable } from 'rxjs';
|
|
3
|
-
import { RootState } from '../../../../reducer';
|
|
4
|
-
import { ZeniAPI } from '../../../../zeniAPI';
|
|
5
|
-
import { deleteTaskGroup, updateTaskGroupDeletionFetchStatus, updateTaskGroupViewOnTaskDeletionSuccess } from '../taskGroupViewReducer';
|
|
6
|
-
import { updateTaskListOnTaskGroupDeletion } from '../../taskListView/taskListReducer';
|
|
7
|
-
import { removeTaskGroup } from '../../../../entity/taskGroup/taskGroupReducer';
|
|
8
|
-
import { openSnackbar } from '../../../../entity/snackbar/snackbarReducer';
|
|
9
|
-
export declare type ActionType = ReturnType<typeof deleteTaskGroup> | ReturnType<typeof removeTaskGroup> | ReturnType<typeof updateTaskListOnTaskGroupDeletion> | ReturnType<typeof updateTaskGroupDeletionFetchStatus> | ReturnType<typeof openSnackbar> | ReturnType<typeof updateTaskGroupViewOnTaskDeletionSuccess>;
|
|
10
|
-
export declare const deleteTaskGroupEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.deleteTaskGroupEpic = void 0;
|
|
4
|
-
const rxjs_1 = require("rxjs");
|
|
5
|
-
const operators_1 = require("rxjs/operators");
|
|
6
|
-
const responsePayload_1 = require("../../../../responsePayload");
|
|
7
|
-
const taskGroupViewReducer_1 = require("../taskGroupViewReducer");
|
|
8
|
-
const taskListReducer_1 = require("../../taskListView/taskListReducer");
|
|
9
|
-
const taskGroupReducer_1 = require("../../../../entity/taskGroup/taskGroupReducer");
|
|
10
|
-
const snackbarReducer_1 = require("../../../../entity/snackbar/snackbarReducer");
|
|
11
|
-
const deleteTaskGroupEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(taskGroupViewReducer_1.deleteTaskGroup.match), (0, operators_1.switchMap)((action) => {
|
|
12
|
-
const { taskGroupId } = action.payload;
|
|
13
|
-
return zeniAPI
|
|
14
|
-
.deleteAndGetJSON(`${zeniAPI.apiEndPoints.taskMicroServiceBaseUrl}/1.0/task-manager/groups/${taskGroupId}`)
|
|
15
|
-
.pipe((0, operators_1.mergeMap)((response) => {
|
|
16
|
-
if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
|
|
17
|
-
return (0, rxjs_1.of)((0, taskGroupReducer_1.removeTaskGroup)(taskGroupId), (0, taskGroupViewReducer_1.updateTaskGroupViewOnTaskDeletionSuccess)({
|
|
18
|
-
deletedTaskGroupId: taskGroupId,
|
|
19
|
-
}), (0, taskListReducer_1.updateTaskListOnTaskGroupDeletion)({
|
|
20
|
-
taskGroupId,
|
|
21
|
-
}), (0, snackbarReducer_1.openSnackbar)({
|
|
22
|
-
messageSection: 'task_group_deletion_success',
|
|
23
|
-
messageText: 'success',
|
|
24
|
-
type: 'success',
|
|
25
|
-
}));
|
|
26
|
-
}
|
|
27
|
-
else {
|
|
28
|
-
return (0, rxjs_1.of)((0, taskGroupViewReducer_1.updateTaskGroupDeletionFetchStatus)({
|
|
29
|
-
fetchState: 'Error',
|
|
30
|
-
error: response.status,
|
|
31
|
-
}));
|
|
32
|
-
}
|
|
33
|
-
}), (0, operators_1.catchError)((error) => {
|
|
34
|
-
return (0, rxjs_1.of)((0, taskGroupViewReducer_1.updateTaskGroupDeletionFetchStatus)({
|
|
35
|
-
fetchState: 'Error',
|
|
36
|
-
error: (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Delete Task Group REST API call errored out' +
|
|
37
|
-
JSON.stringify(error)),
|
|
38
|
-
}));
|
|
39
|
-
}));
|
|
40
|
-
}));
|
|
41
|
-
exports.deleteTaskGroupEpic = deleteTaskGroupEpic;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
|
-
import { Observable } from 'rxjs';
|
|
3
|
-
import { RootState } from '../../../../reducer';
|
|
4
|
-
import { ZeniAPI } from '../../../../zeniAPI';
|
|
5
|
-
import { fetchAllTaskGroups, updateTaskGroupsOnSuccess, updateTaskGroupsFetchStatus } from '../taskGroupViewReducer';
|
|
6
|
-
import { updateTaskGroups } from '../../../../entity/taskGroup/taskGroupReducer';
|
|
7
|
-
export declare type ActionType = ReturnType<typeof fetchAllTaskGroups> | ReturnType<typeof updateTaskGroups> | ReturnType<typeof updateTaskGroupsOnSuccess> | ReturnType<typeof updateTaskGroupsFetchStatus>;
|
|
8
|
-
export declare const fetchAllTaskGroupsEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.fetchAllTaskGroupsEpic = void 0;
|
|
4
|
-
const rxjs_1 = require("rxjs");
|
|
5
|
-
const operators_1 = require("rxjs/operators");
|
|
6
|
-
const responsePayload_1 = require("../../../../responsePayload");
|
|
7
|
-
const taskGroupViewReducer_1 = require("../taskGroupViewReducer");
|
|
8
|
-
const taskGroupReducer_1 = require("../../../../entity/taskGroup/taskGroupReducer");
|
|
9
|
-
const fetchAllTaskGroupsEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(taskGroupViewReducer_1.fetchAllTaskGroups.match), (0, operators_1.switchMap)(() => {
|
|
10
|
-
const queryParam = { filter_type: 'all' };
|
|
11
|
-
return zeniAPI
|
|
12
|
-
.getJSON(`${zeniAPI.apiEndPoints.taskMicroServiceBaseUrl}/1.0/task-manager/groups?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, taskGroupReducer_1.updateTaskGroups)(response.data.task_groups), (0, taskGroupViewReducer_1.updateTaskGroupsOnSuccess)({
|
|
16
|
-
data: response.data.task_groups,
|
|
17
|
-
}));
|
|
18
|
-
}
|
|
19
|
-
else {
|
|
20
|
-
return (0, rxjs_1.of)((0, taskGroupViewReducer_1.updateTaskGroupsFetchStatus)({
|
|
21
|
-
fetchState: 'Error',
|
|
22
|
-
error: response.status,
|
|
23
|
-
}));
|
|
24
|
-
}
|
|
25
|
-
}), (0, operators_1.catchError)((error) => {
|
|
26
|
-
return (0, rxjs_1.of)((0, taskGroupViewReducer_1.updateTaskGroupsFetchStatus)({
|
|
27
|
-
fetchState: 'Error',
|
|
28
|
-
error: (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Fetch all task groups REST API call errored out' +
|
|
29
|
-
JSON.stringify(error)),
|
|
30
|
-
}));
|
|
31
|
-
}));
|
|
32
|
-
}));
|
|
33
|
-
exports.fetchAllTaskGroupsEpic = fetchAllTaskGroupsEpic;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
|
-
import { Observable } from 'rxjs';
|
|
3
|
-
import { RootState } from '../../../../reducer';
|
|
4
|
-
import { ZeniAPI } from '../../../../zeniAPI';
|
|
5
|
-
import { updateTaskGroupName, updateTaskGroupFetchStatus } from '../taskGroupViewReducer';
|
|
6
|
-
import { updateTaskListOnTaskGroupNameUpdate } from '../../taskListView/taskListReducer';
|
|
7
|
-
import { updateTaskGroup } from '../../../../entity/taskGroup/taskGroupReducer';
|
|
8
|
-
import { openSnackbar } from '../../../../entity/snackbar/snackbarReducer';
|
|
9
|
-
export declare type ActionType = ReturnType<typeof updateTaskGroupName> | ReturnType<typeof updateTaskGroupFetchStatus> | ReturnType<typeof updateTaskGroup> | ReturnType<typeof updateTaskListOnTaskGroupNameUpdate> | ReturnType<typeof openSnackbar>;
|
|
10
|
-
export declare const updateTaskGroupNameEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.updateTaskGroupNameEpic = void 0;
|
|
4
|
-
const rxjs_1 = require("rxjs");
|
|
5
|
-
const operators_1 = require("rxjs/operators");
|
|
6
|
-
const responsePayload_1 = require("../../../../responsePayload");
|
|
7
|
-
const taskGroupViewReducer_1 = require("../taskGroupViewReducer");
|
|
8
|
-
const taskListReducer_1 = require("../../taskListView/taskListReducer");
|
|
9
|
-
const taskGroupReducer_1 = require("../../../../entity/taskGroup/taskGroupReducer");
|
|
10
|
-
const snackbarReducer_1 = require("../../../../entity/snackbar/snackbarReducer");
|
|
11
|
-
const updateTaskGroupNameEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(taskGroupViewReducer_1.updateTaskGroupName.match), (0, operators_1.switchMap)((action) => {
|
|
12
|
-
const { taskGroupId, taskGroupName } = action.payload;
|
|
13
|
-
const payload = {
|
|
14
|
-
name: taskGroupName,
|
|
15
|
-
};
|
|
16
|
-
return zeniAPI
|
|
17
|
-
.putAndGetJSON(`${zeniAPI.apiEndPoints.taskMicroServiceBaseUrl}/1.0/task-manager/groups/${taskGroupId}`, payload)
|
|
18
|
-
.pipe((0, operators_1.mergeMap)((response) => {
|
|
19
|
-
if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
|
|
20
|
-
const actions = [
|
|
21
|
-
(0, taskGroupReducer_1.updateTaskGroup)(response.data.task_groups[0]),
|
|
22
|
-
(0, taskGroupViewReducer_1.updateTaskGroupFetchStatus)({
|
|
23
|
-
fetchState: 'Completed',
|
|
24
|
-
}),
|
|
25
|
-
(0, taskListReducer_1.updateTaskListOnTaskGroupNameUpdate)({
|
|
26
|
-
taskGroupId,
|
|
27
|
-
taskGroupName,
|
|
28
|
-
}),
|
|
29
|
-
(0, snackbarReducer_1.openSnackbar)({
|
|
30
|
-
messageSection: 'task_group_update_success',
|
|
31
|
-
messageText: 'success',
|
|
32
|
-
type: 'success',
|
|
33
|
-
}),
|
|
34
|
-
];
|
|
35
|
-
return (0, rxjs_1.from)(actions);
|
|
36
|
-
}
|
|
37
|
-
else {
|
|
38
|
-
return (0, rxjs_1.of)((0, taskGroupViewReducer_1.updateTaskGroupFetchStatus)({
|
|
39
|
-
fetchState: 'Error',
|
|
40
|
-
error: response.status,
|
|
41
|
-
}));
|
|
42
|
-
}
|
|
43
|
-
}), (0, operators_1.catchError)((error) => {
|
|
44
|
-
return (0, rxjs_1.of)((0, taskGroupViewReducer_1.updateTaskGroupFetchStatus)({
|
|
45
|
-
fetchState: 'Error',
|
|
46
|
-
error: (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Update Task Group REST API call errored out' +
|
|
47
|
-
JSON.stringify(error)),
|
|
48
|
-
}));
|
|
49
|
-
}));
|
|
50
|
-
}));
|
|
51
|
-
exports.updateTaskGroupNameEpic = updateTaskGroupNameEpic;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { TaskGroupPayload } from '../../../entity/taskGroup/taskGroupPayload';
|
|
2
|
-
import { ZeniAPIResponse } from '../../../responsePayload';
|
|
3
|
-
export interface FetchTaskGroupsPayload {
|
|
4
|
-
task_groups: TaskGroupPayload[];
|
|
5
|
-
}
|
|
6
|
-
export declare type FetchTaskGroupsResponse = ZeniAPIResponse<FetchTaskGroupsPayload>;
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { FetchState, ID } from '../../../commonStateTypes/common';
|
|
2
|
-
import { TaskGroupPayload } from '../../../entity/taskGroup/taskGroupPayload';
|
|
3
|
-
import { ZeniAPIStatus } from '../../../responsePayload';
|
|
4
|
-
import { TaskGroupViewState } from './taskGroupViewState';
|
|
5
|
-
export declare const initialState: TaskGroupViewState;
|
|
6
|
-
export declare const fetchAllTaskGroups: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, updateTaskGroupsOnSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
7
|
-
data: TaskGroupPayload[];
|
|
8
|
-
}, string>, updateTaskGroupsFetchStatus: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
9
|
-
fetchState: FetchState;
|
|
10
|
-
error?: ZeniAPIStatus<Record<string, unknown>> | undefined;
|
|
11
|
-
}, string>, createNewTaskGroup: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[groupName: string, updateSelectedTasks: boolean], {
|
|
12
|
-
groupName: string;
|
|
13
|
-
updateSelectedTasks: boolean;
|
|
14
|
-
}, string, never, never>, updateTaskGroupCreationFetchStatus: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
15
|
-
fetchState: FetchState;
|
|
16
|
-
error?: ZeniAPIStatus<Record<string, unknown>> | undefined;
|
|
17
|
-
}, string>, updateTaskGroupViewOnTaskGroupCreationSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
18
|
-
newTaskGroupId: ID;
|
|
19
|
-
}, string>, deleteTaskGroup: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[taskGroupId: string], {
|
|
20
|
-
taskGroupId: string;
|
|
21
|
-
}, string, never, never>, updateTaskGroupDeletionFetchStatus: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
22
|
-
fetchState: FetchState;
|
|
23
|
-
error?: ZeniAPIStatus<Record<string, unknown>> | undefined;
|
|
24
|
-
}, string>, updateTaskGroupViewOnTaskDeletionSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
25
|
-
deletedTaskGroupId: ID;
|
|
26
|
-
}, string>, updateTaskGroupName: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[taskGroupId: any, taskGroupName: any], {
|
|
27
|
-
taskGroupId: any;
|
|
28
|
-
taskGroupName: any;
|
|
29
|
-
}, string, never, never>, updateTaskGroupFetchStatus: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
30
|
-
fetchState: FetchState;
|
|
31
|
-
error?: ZeniAPIStatus<Record<string, unknown>> | undefined;
|
|
32
|
-
}, string>, clearTaskGroupView: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
|
|
33
|
-
declare const _default: import("@reduxjs/toolkit").Reducer<TaskGroupViewState, import("@reduxjs/toolkit").AnyAction>;
|
|
34
|
-
export default _default;
|
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var _a;
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.clearTaskGroupView = exports.updateTaskGroupFetchStatus = exports.updateTaskGroupName = exports.updateTaskGroupViewOnTaskDeletionSuccess = exports.updateTaskGroupDeletionFetchStatus = exports.deleteTaskGroup = exports.updateTaskGroupViewOnTaskGroupCreationSuccess = exports.updateTaskGroupCreationFetchStatus = exports.createNewTaskGroup = exports.updateTaskGroupsFetchStatus = exports.updateTaskGroupsOnSuccess = exports.fetchAllTaskGroups = exports.initialState = void 0;
|
|
5
|
-
const toolkit_1 = require("@reduxjs/toolkit");
|
|
6
|
-
exports.initialState = {
|
|
7
|
-
taskGroupsIds: [],
|
|
8
|
-
fetchState: 'Not-Started',
|
|
9
|
-
error: undefined,
|
|
10
|
-
hasValidState() {
|
|
11
|
-
return this.fetchState == 'Completed';
|
|
12
|
-
},
|
|
13
|
-
taskGroupCreationStatus: {
|
|
14
|
-
fetchState: 'Not-Started',
|
|
15
|
-
error: undefined,
|
|
16
|
-
},
|
|
17
|
-
taskGroupDeleteStatus: {
|
|
18
|
-
fetchState: 'Not-Started',
|
|
19
|
-
error: undefined,
|
|
20
|
-
},
|
|
21
|
-
taskGroupUpdateStatus: {
|
|
22
|
-
fetchState: 'Not-Started',
|
|
23
|
-
error: undefined,
|
|
24
|
-
},
|
|
25
|
-
};
|
|
26
|
-
const taskGroupView = (0, toolkit_1.createSlice)({
|
|
27
|
-
name: 'taskGroupView',
|
|
28
|
-
initialState: exports.initialState,
|
|
29
|
-
reducers: {
|
|
30
|
-
fetchAllTaskGroups(draft) {
|
|
31
|
-
draft.fetchState = 'In-Progress';
|
|
32
|
-
draft.error = undefined;
|
|
33
|
-
},
|
|
34
|
-
updateTaskGroupsOnSuccess(draft, action) {
|
|
35
|
-
const { data } = action.payload;
|
|
36
|
-
draft.fetchState = 'Completed';
|
|
37
|
-
draft.error = undefined;
|
|
38
|
-
draft.taskGroupsIds = data.map((task) => task.task_group_id);
|
|
39
|
-
},
|
|
40
|
-
updateTaskGroupsFetchStatus(draft, action) {
|
|
41
|
-
draft.fetchState = action.payload.fetchState;
|
|
42
|
-
draft.error = action.payload.error;
|
|
43
|
-
},
|
|
44
|
-
createNewTaskGroup: {
|
|
45
|
-
reducer(draft) {
|
|
46
|
-
draft.taskGroupCreationStatus = {
|
|
47
|
-
fetchState: 'In-Progress',
|
|
48
|
-
error: undefined,
|
|
49
|
-
};
|
|
50
|
-
},
|
|
51
|
-
prepare(groupName, updateSelectedTasks) {
|
|
52
|
-
return {
|
|
53
|
-
payload: {
|
|
54
|
-
groupName,
|
|
55
|
-
updateSelectedTasks,
|
|
56
|
-
},
|
|
57
|
-
};
|
|
58
|
-
},
|
|
59
|
-
},
|
|
60
|
-
updateTaskGroupViewOnTaskGroupCreationSuccess(draft, action) {
|
|
61
|
-
const { newTaskGroupId } = action.payload;
|
|
62
|
-
draft.taskGroupsIds = [...draft.taskGroupsIds, newTaskGroupId];
|
|
63
|
-
draft.taskGroupCreationStatus.fetchState = 'Completed';
|
|
64
|
-
draft.taskGroupCreationStatus.error = undefined;
|
|
65
|
-
},
|
|
66
|
-
updateTaskGroupCreationFetchStatus(draft, action) {
|
|
67
|
-
draft.taskGroupCreationStatus.fetchState = action.payload.fetchState;
|
|
68
|
-
draft.taskGroupCreationStatus.error = action.payload.error;
|
|
69
|
-
},
|
|
70
|
-
deleteTaskGroup: {
|
|
71
|
-
reducer(draft) {
|
|
72
|
-
draft.taskGroupDeleteStatus = {
|
|
73
|
-
fetchState: 'In-Progress',
|
|
74
|
-
error: undefined,
|
|
75
|
-
};
|
|
76
|
-
},
|
|
77
|
-
prepare(taskGroupId) {
|
|
78
|
-
return {
|
|
79
|
-
payload: {
|
|
80
|
-
taskGroupId,
|
|
81
|
-
},
|
|
82
|
-
};
|
|
83
|
-
},
|
|
84
|
-
},
|
|
85
|
-
updateTaskGroupViewOnTaskDeletionSuccess(draft, action) {
|
|
86
|
-
const { deletedTaskGroupId } = action.payload;
|
|
87
|
-
draft.taskGroupsIds = draft.taskGroupsIds.filter((groupId) => groupId !== deletedTaskGroupId);
|
|
88
|
-
draft.taskGroupDeleteStatus.fetchState = 'Completed';
|
|
89
|
-
draft.taskGroupDeleteStatus.error = undefined;
|
|
90
|
-
},
|
|
91
|
-
updateTaskGroupDeletionFetchStatus(draft, action) {
|
|
92
|
-
draft.taskGroupDeleteStatus.fetchState = action.payload.fetchState;
|
|
93
|
-
draft.taskGroupDeleteStatus.error = action.payload.error;
|
|
94
|
-
},
|
|
95
|
-
updateTaskGroupName: {
|
|
96
|
-
reducer(draft) {
|
|
97
|
-
draft.taskGroupUpdateStatus = {
|
|
98
|
-
fetchState: 'In-Progress',
|
|
99
|
-
error: undefined,
|
|
100
|
-
};
|
|
101
|
-
},
|
|
102
|
-
prepare(taskGroupId, taskGroupName) {
|
|
103
|
-
return {
|
|
104
|
-
payload: {
|
|
105
|
-
taskGroupId,
|
|
106
|
-
taskGroupName,
|
|
107
|
-
},
|
|
108
|
-
};
|
|
109
|
-
},
|
|
110
|
-
},
|
|
111
|
-
updateTaskGroupFetchStatus(draft, action) {
|
|
112
|
-
draft.taskGroupUpdateStatus = {
|
|
113
|
-
fetchState: action.payload.fetchState,
|
|
114
|
-
error: action.payload.error,
|
|
115
|
-
};
|
|
116
|
-
},
|
|
117
|
-
clearTaskGroupView(draft) {
|
|
118
|
-
Object.assign(draft, exports.initialState);
|
|
119
|
-
},
|
|
120
|
-
},
|
|
121
|
-
});
|
|
122
|
-
_a = taskGroupView.actions, exports.fetchAllTaskGroups = _a.fetchAllTaskGroups, exports.updateTaskGroupsOnSuccess = _a.updateTaskGroupsOnSuccess, exports.updateTaskGroupsFetchStatus = _a.updateTaskGroupsFetchStatus, exports.createNewTaskGroup = _a.createNewTaskGroup, exports.updateTaskGroupCreationFetchStatus = _a.updateTaskGroupCreationFetchStatus, exports.updateTaskGroupViewOnTaskGroupCreationSuccess = _a.updateTaskGroupViewOnTaskGroupCreationSuccess, exports.deleteTaskGroup = _a.deleteTaskGroup, exports.updateTaskGroupDeletionFetchStatus = _a.updateTaskGroupDeletionFetchStatus, exports.updateTaskGroupViewOnTaskDeletionSuccess = _a.updateTaskGroupViewOnTaskDeletionSuccess, exports.updateTaskGroupName = _a.updateTaskGroupName, exports.updateTaskGroupFetchStatus = _a.updateTaskGroupFetchStatus, exports.clearTaskGroupView = _a.clearTaskGroupView;
|
|
123
|
-
exports.default = taskGroupView.reducer;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { ID, FetchedState, FetchStateAndError } from '../../../commonStateTypes/common';
|
|
2
|
-
export interface TaskGroupViewState extends FetchedState {
|
|
3
|
-
taskGroupsIds: ID[];
|
|
4
|
-
taskGroupCreationStatus: FetchStateAndError;
|
|
5
|
-
taskGroupDeleteStatus: FetchStateAndError;
|
|
6
|
-
taskGroupUpdateStatus: FetchStateAndError;
|
|
7
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
|
-
import { Observable } from 'rxjs';
|
|
3
|
-
import { RootState } from '../../../reducer';
|
|
4
|
-
import { ZeniAPI } from '../../../zeniAPI';
|
|
5
|
-
import { bulkUpdateTaskList, updateTasksListOnBulkUpdateTasksSuccess, updateTasksListOnBulkUpdateTasksFailure } from './taskListReducer';
|
|
6
|
-
import { updateTasks } from '../../../entity/task/taskReducer';
|
|
7
|
-
export declare type ActionType = ReturnType<typeof bulkUpdateTaskList> | ReturnType<typeof updateTasks> | ReturnType<typeof updateTasksListOnBulkUpdateTasksFailure> | ReturnType<typeof updateTasksListOnBulkUpdateTasksSuccess>;
|
|
8
|
-
export declare const bulkUpdateTaskListEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|