@zeniai/client-epic-state 5.1.3-betaAS1 → 5.1.3-betaJK1
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/commonPayloadTypes/commonPayload.d.ts +4 -25
- package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
- package/lib/entity/snackbar/snackbarTypes.js +1 -0
- package/lib/entity/task/taskPayload.d.ts +1 -0
- package/lib/entity/task/taskPayload.js +1 -0
- package/lib/entity/task/taskReducer.d.ts +5 -1
- package/lib/entity/task/taskReducer.js +8 -2
- package/lib/entity/task/taskState.d.ts +1 -0
- package/lib/epic.d.ts +3 -1
- package/lib/epic.js +3 -1
- package/lib/esm/entity/snackbar/snackbarTypes.js +1 -0
- package/lib/esm/entity/task/taskPayload.js +1 -0
- package/lib/esm/entity/task/taskReducer.js +7 -1
- package/lib/esm/epic.js +3 -1
- package/lib/esm/index.js +3 -8
- package/lib/esm/view/spendManagement/billPay/internationalWireVerification/epics/fetchIntlVerificationFormEpic.js +3 -7
- package/lib/esm/view/spendManagement/billPay/internationalWireVerification/epics/initializeIntlVerificationFormEpic.js +34 -33
- package/lib/esm/view/spendManagement/billPay/internationalWireVerification/epics/submitIntlVerificationEpic.js +7 -2
- package/lib/esm/view/spendManagement/billPay/internationalWireVerification/internationalWireVerificationPayload.js +8 -55
- package/lib/esm/view/spendManagement/billPay/internationalWireVerification/internationalWireVerificationReducer.js +6 -5
- package/lib/esm/view/spendManagement/billPay/internationalWireVerification/internationalWireVerificationSelector.js +15 -39
- package/lib/esm/view/taskManager/taskDetailView/epics/createSubTaskEpic.js +80 -0
- package/lib/esm/view/taskManager/taskDetailView/epics/fetchSubTasksEpic.js +36 -0
- package/lib/esm/view/taskManager/taskDetailView/epics/fetchTaskDetailEpic.js +13 -0
- package/lib/esm/view/taskManager/taskDetailView/taskDetailReducer.js +56 -2
- package/lib/esm/view/taskManager/taskDetailView/taskDetailSelector.js +19 -8
- package/lib/index.d.ts +5 -11
- package/lib/index.js +12 -27
- package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +1 -1
- package/lib/view/spendManagement/billPay/internationalWireVerification/epics/fetchIntlVerificationFormEpic.d.ts +3 -3
- package/lib/view/spendManagement/billPay/internationalWireVerification/epics/fetchIntlVerificationFormEpic.js +2 -6
- package/lib/view/spendManagement/billPay/internationalWireVerification/epics/initializeIntlVerificationFormEpic.d.ts +1 -2
- package/lib/view/spendManagement/billPay/internationalWireVerification/epics/initializeIntlVerificationFormEpic.js +33 -32
- package/lib/view/spendManagement/billPay/internationalWireVerification/epics/submitIntlVerificationEpic.js +7 -2
- package/lib/view/spendManagement/billPay/internationalWireVerification/internationalWireVerificationPayload.d.ts +1 -24
- package/lib/view/spendManagement/billPay/internationalWireVerification/internationalWireVerificationPayload.js +9 -59
- package/lib/view/spendManagement/billPay/internationalWireVerification/internationalWireVerificationReducer.js +5 -4
- package/lib/view/spendManagement/billPay/internationalWireVerification/internationalWireVerificationSelector.js +15 -39
- package/lib/view/spendManagement/billPay/internationalWireVerification/internationalWireVerificationState.d.ts +1 -20
- package/lib/view/taskManager/taskDetailView/epics/createSubTaskEpic.d.ts +9 -0
- package/lib/view/taskManager/taskDetailView/epics/createSubTaskEpic.js +84 -0
- package/lib/view/taskManager/taskDetailView/epics/fetchSubTasksEpic.d.ts +8 -0
- package/lib/view/taskManager/taskDetailView/epics/fetchSubTasksEpic.js +40 -0
- package/lib/view/taskManager/taskDetailView/epics/fetchTaskDetailEpic.d.ts +2 -1
- package/lib/view/taskManager/taskDetailView/epics/fetchTaskDetailEpic.js +13 -0
- package/lib/view/taskManager/taskDetailView/taskDetail.d.ts +13 -0
- package/lib/view/taskManager/taskDetailView/taskDetailReducer.d.ts +14 -2
- package/lib/view/taskManager/taskDetailView/taskDetailReducer.js +57 -3
- package/lib/view/taskManager/taskDetailView/taskDetailSelector.d.ts +2 -1
- package/lib/view/taskManager/taskDetailView/taskDetailSelector.js +17 -6
- package/package.json +1 -1
- package/lib/esm/view/spendManagement/billPay/internationalWireVerification/internationalWireOnboardingDetailsToLocalData.js +0 -146
- package/lib/esm/view/spendManagement/billPay/internationalWireVerification/internationalWireVerificationFieldConstants.js +0 -40
- package/lib/esm/view/spendManagement/billPay/internationalWireVerification/internationalWireVerificationLocalDataHelpers.js +0 -86
- package/lib/esm/view/spendManagement/billPay/internationalWireVerification/internationalWireVerificationSubmitPayload.js +0 -154
- package/lib/view/spendManagement/billPay/internationalWireVerification/internationalWireOnboardingDetailsToLocalData.d.ts +0 -4
- package/lib/view/spendManagement/billPay/internationalWireVerification/internationalWireOnboardingDetailsToLocalData.js +0 -150
- package/lib/view/spendManagement/billPay/internationalWireVerification/internationalWireVerificationFieldConstants.d.ts +0 -38
- package/lib/view/spendManagement/billPay/internationalWireVerification/internationalWireVerificationFieldConstants.js +0 -43
- package/lib/view/spendManagement/billPay/internationalWireVerification/internationalWireVerificationLocalDataHelpers.d.ts +0 -27
- package/lib/view/spendManagement/billPay/internationalWireVerification/internationalWireVerificationLocalDataHelpers.js +0 -96
- package/lib/view/spendManagement/billPay/internationalWireVerification/internationalWireVerificationSubmitPayload.d.ts +0 -32
- package/lib/view/spendManagement/billPay/internationalWireVerification/internationalWireVerificationSubmitPayload.js +0 -159
|
@@ -1,40 +1,17 @@
|
|
|
1
1
|
import { AllowedValueWithCode } from '../../../../commonStateTypes/allowedValue';
|
|
2
2
|
import { ZeniAPIResponse } from '../../../../responsePayload';
|
|
3
|
-
import { VerificationFormField
|
|
4
|
-
export declare const InternationalWireVerificationFormOrder: readonly ["certificate_of_good_standing", "business_ownership", "company_proof_of_address", "company_officer_proof_of_address", "company_registration_date", "annual_turnover", "expected_transaction_volume", "employee_count", "intended_use_of_account", "transaction_countries", "stake_holder", "controlling_person"];
|
|
5
|
-
export interface FieldOptionPayload {
|
|
6
|
-
label: string;
|
|
7
|
-
}
|
|
8
|
-
export interface SubFieldPayload {
|
|
9
|
-
label: string;
|
|
10
|
-
type: string;
|
|
11
|
-
field_hint_text?: string;
|
|
12
|
-
field_values?: {
|
|
13
|
-
code: string;
|
|
14
|
-
description: string;
|
|
15
|
-
}[];
|
|
16
|
-
is_multiple_options_supported?: boolean;
|
|
17
|
-
options?: Record<string, FieldOptionPayload>;
|
|
18
|
-
}
|
|
3
|
+
import { VerificationFormField } from './internationalWireVerificationState';
|
|
19
4
|
export interface FieldPayload {
|
|
20
5
|
label: string;
|
|
21
6
|
type: string;
|
|
22
|
-
default?: boolean;
|
|
23
7
|
field_hint_text?: string;
|
|
24
8
|
field_values?: {
|
|
25
9
|
code: string;
|
|
26
10
|
description: string;
|
|
27
11
|
}[];
|
|
28
|
-
is_multiple_options_supported?: boolean;
|
|
29
12
|
is_multiple_values_allowed?: boolean;
|
|
30
|
-
options?: Record<string, FieldOptionPayload>;
|
|
31
|
-
requirements?: string[];
|
|
32
|
-
subfields?: Record<string, SubFieldPayload>;
|
|
33
13
|
}
|
|
34
14
|
export declare const toDynamicFormField: (key: string, payload: FieldPayload) => VerificationFormField;
|
|
35
|
-
export declare const filterVerificationFormFieldsForReadonlyView: (fields: VerificationFormField[], localData: VerificationFormLocalData, isReadonly: boolean) => VerificationFormField[];
|
|
36
|
-
export declare const sortVerificationFormFields: (fields: VerificationFormField[]) => VerificationFormField[];
|
|
37
|
-
export declare const toVerificationFormFields: (internationalWireFormPayload: Record<string, FieldPayload>) => VerificationFormField[];
|
|
38
15
|
export type IntlVerificationFormResponse = ZeniAPIResponse<IntlVerificationFormPayload>;
|
|
39
16
|
export interface IntlVerificationFormPayload {
|
|
40
17
|
create_time: string;
|
|
@@ -1,69 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
const internationalWireVerificationFieldConstants_1 = require("./internationalWireVerificationFieldConstants");
|
|
5
|
-
const internationalWireVerificationLocalDataHelpers_1 = require("./internationalWireVerificationLocalDataHelpers");
|
|
6
|
-
exports.InternationalWireVerificationFormOrder = [
|
|
7
|
-
internationalWireVerificationFieldConstants_1.InternationalWireVerificationFormFieldNames.certificateOfGoodStanding,
|
|
8
|
-
internationalWireVerificationFieldConstants_1.InternationalWireVerificationFormFieldNames.businessOwnership,
|
|
9
|
-
internationalWireVerificationFieldConstants_1.InternationalWireVerificationFormFieldNames.companyProofOfAddress,
|
|
10
|
-
internationalWireVerificationFieldConstants_1.InternationalWireVerificationFormFieldNames.companyOfficerProofOfAddress,
|
|
11
|
-
internationalWireVerificationFieldConstants_1.InternationalWireVerificationFormFieldNames.companyRegistrationDate,
|
|
12
|
-
internationalWireVerificationFieldConstants_1.InternationalWireVerificationFormFieldNames.annualTurnover,
|
|
13
|
-
internationalWireVerificationFieldConstants_1.InternationalWireVerificationFormFieldNames.expectedTransactionVolume,
|
|
14
|
-
internationalWireVerificationFieldConstants_1.InternationalWireVerificationFormFieldNames.employeeCount,
|
|
15
|
-
internationalWireVerificationFieldConstants_1.InternationalWireVerificationFormFieldNames.intendedUseOfAccount,
|
|
16
|
-
internationalWireVerificationFieldConstants_1.InternationalWireVerificationFormFieldNames.transactionCountries,
|
|
17
|
-
internationalWireVerificationFieldConstants_1.InternationalWireVerificationFormFieldNames.stakeHolder,
|
|
18
|
-
internationalWireVerificationFieldConstants_1.InternationalWireVerificationFormFieldNames.controllingPerson,
|
|
19
|
-
];
|
|
20
|
-
const toFieldValues = (fieldValues) => fieldValues?.map(({ code, description }) => ({ code, description })) ?? [];
|
|
21
|
-
const toSubField = (subfield) => ({
|
|
22
|
-
label: subfield.label,
|
|
23
|
-
placeholder: subfield.field_hint_text ?? '',
|
|
24
|
-
type: subfield.type,
|
|
25
|
-
fieldValues: toFieldValues(subfield.field_values),
|
|
26
|
-
isMultipleOptionsSupported: subfield.is_multiple_options_supported,
|
|
27
|
-
options: subfield.options,
|
|
28
|
-
});
|
|
3
|
+
exports.toDynamicFormField = void 0;
|
|
29
4
|
const toDynamicFormField = (key, payload) => ({
|
|
30
5
|
name: key,
|
|
31
6
|
label: payload.label,
|
|
32
7
|
placeholder: payload.field_hint_text ?? '',
|
|
33
8
|
isMultipleValuesAllowed: payload.is_multiple_values_allowed ?? false,
|
|
34
9
|
type: payload.type,
|
|
35
|
-
fieldValues:
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
toSubField(subfield),
|
|
44
|
-
]))
|
|
45
|
-
: undefined,
|
|
10
|
+
fieldValues: payload.field_values != null && payload.field_values.length > 0
|
|
11
|
+
? payload.field_values.map((fieldValue) => {
|
|
12
|
+
return {
|
|
13
|
+
code: fieldValue.code,
|
|
14
|
+
description: fieldValue.description,
|
|
15
|
+
};
|
|
16
|
+
})
|
|
17
|
+
: [],
|
|
46
18
|
});
|
|
47
19
|
exports.toDynamicFormField = toDynamicFormField;
|
|
48
|
-
const readonlyHideableVerificationFormFieldNames = new Set(internationalWireVerificationFieldConstants_1.InternationalWireVerificationReadonlyHideableFieldNames);
|
|
49
|
-
const filterVerificationFormFieldsForReadonlyView = (fields, localData, isReadonly) => {
|
|
50
|
-
if (!isReadonly || (0, internationalWireVerificationLocalDataHelpers_1.hasBusinessOwnershipValueInLocalData)(localData)) {
|
|
51
|
-
return fields;
|
|
52
|
-
}
|
|
53
|
-
return fields.filter((field) => !readonlyHideableVerificationFormFieldNames.has(field.name));
|
|
54
|
-
};
|
|
55
|
-
exports.filterVerificationFormFieldsForReadonlyView = filterVerificationFormFieldsForReadonlyView;
|
|
56
|
-
const sortVerificationFormFields = (fields) => {
|
|
57
|
-
const orderIndex = new Map(exports.InternationalWireVerificationFormOrder.map((name, index) => [name, index]));
|
|
58
|
-
return fields.slice().sort((a, b) => {
|
|
59
|
-
const aIndex = orderIndex.get(a.name) ?? exports.InternationalWireVerificationFormOrder.length;
|
|
60
|
-
const bIndex = orderIndex.get(b.name) ?? exports.InternationalWireVerificationFormOrder.length;
|
|
61
|
-
if (aIndex !== bIndex) {
|
|
62
|
-
return aIndex - bIndex;
|
|
63
|
-
}
|
|
64
|
-
return a.name.localeCompare(b.name);
|
|
65
|
-
});
|
|
66
|
-
};
|
|
67
|
-
exports.sortVerificationFormFields = sortVerificationFormFields;
|
|
68
|
-
const toVerificationFormFields = (internationalWireFormPayload) => (0, exports.sortVerificationFormFields)(Object.keys(internationalWireFormPayload).map((key) => (0, exports.toDynamicFormField)(key, internationalWireFormPayload[key])));
|
|
69
|
-
exports.toVerificationFormFields = toVerificationFormFields;
|
|
@@ -8,7 +8,6 @@ exports.initialState = {
|
|
|
8
8
|
verificationFormFetchState: {
|
|
9
9
|
fetchState: 'Not-Started',
|
|
10
10
|
},
|
|
11
|
-
verificationFormFieldLabels: {},
|
|
12
11
|
verificationFormFields: [],
|
|
13
12
|
verificationFormLocalData: {},
|
|
14
13
|
verificationFormSubmitState: {
|
|
@@ -36,8 +35,11 @@ const internationalWireVerification = (0, toolkit_1.createSlice)({
|
|
|
36
35
|
},
|
|
37
36
|
updateInternationalVerificationForm(draft, action) {
|
|
38
37
|
const { internationalWireFormPayload } = action.payload;
|
|
39
|
-
|
|
40
|
-
|
|
38
|
+
const verificationFormFields = [];
|
|
39
|
+
Object.keys(internationalWireFormPayload).forEach((key) => {
|
|
40
|
+
verificationFormFields.push((0, internationalWireVerificationPayload_1.toDynamicFormField)(key, internationalWireFormPayload[key]));
|
|
41
|
+
});
|
|
42
|
+
draft.verificationFormFields = verificationFormFields;
|
|
41
43
|
draft.verificationFormFetchState.fetchState = 'Completed';
|
|
42
44
|
},
|
|
43
45
|
updateVerificationFormFailure(draft, action) {
|
|
@@ -47,7 +49,6 @@ const internationalWireVerification = (0, toolkit_1.createSlice)({
|
|
|
47
49
|
},
|
|
48
50
|
updateVerificationFormLocalData(draft, action) {
|
|
49
51
|
draft.verificationFormLocalData = {
|
|
50
|
-
...draft.verificationFormLocalData,
|
|
51
52
|
...action.payload,
|
|
52
53
|
};
|
|
53
54
|
},
|
|
@@ -1,53 +1,29 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getIntlWireVerificationView = void 0;
|
|
4
|
-
const companySelector_1 = require("../../../../entity/company/companySelector");
|
|
5
4
|
const fileSelector_1 = require("../../../../entity/file/fileSelector");
|
|
6
|
-
const tenantSelector_1 = require("../../../../entity/tenant/tenantSelector");
|
|
7
5
|
const fileViewSelector_1 = require("../../../fileView/fileViewSelector");
|
|
8
|
-
const internationalWireVerificationPayload_1 = require("./internationalWireVerificationPayload");
|
|
9
|
-
const collectFileIdsFromLocalData = (localData) => {
|
|
10
|
-
const fileIds = new Set();
|
|
11
|
-
Object.values(localData).forEach((value) => {
|
|
12
|
-
if (typeof value === 'string' && value.startsWith('file_')) {
|
|
13
|
-
fileIds.add(value);
|
|
14
|
-
return;
|
|
15
|
-
}
|
|
16
|
-
if (Array.isArray(value)) {
|
|
17
|
-
value.forEach((item) => {
|
|
18
|
-
if (typeof item === 'string' && item.startsWith('file_')) {
|
|
19
|
-
fileIds.add(item);
|
|
20
|
-
}
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
|
-
return Array.from(fileIds);
|
|
25
|
-
};
|
|
26
6
|
const getIntlWireVerificationView = (state) => {
|
|
27
7
|
const deleteFileStatusById = {};
|
|
28
8
|
const updateFileStatusById = {};
|
|
29
|
-
|
|
30
|
-
const
|
|
31
|
-
|
|
9
|
+
// field with type = file
|
|
10
|
+
const fileField = state.internationalWireVerificationState.verificationFormFields.find((field) => field.type === 'file');
|
|
11
|
+
let fileId;
|
|
12
|
+
if (fileField != null) {
|
|
13
|
+
fileId = state.internationalWireVerificationState.verificationFormLocalData[fileField.name];
|
|
14
|
+
}
|
|
15
|
+
if (fileId != null) {
|
|
32
16
|
deleteFileStatusById[fileId] = (0, fileViewSelector_1.getFileDeleteStatusById)(state, fileId);
|
|
33
17
|
updateFileStatusById[fileId] = (0, fileViewSelector_1.getFileUpdateNameStatusById)(state, fileId);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
: undefined;
|
|
42
|
-
const onboardingStatusCode = company?.companyBillPayInfo?.internationalWireOnboardingStatus?.code;
|
|
43
|
-
const isReadonly = onboardingStatusCode != null &&
|
|
44
|
-
onboardingStatusCode !== 'onboarding_status_not_started';
|
|
45
|
-
const visibleVerificationFormFields = (0, internationalWireVerificationPayload_1.filterVerificationFormFieldsForReadonlyView)(verificationFormFields, verificationFormLocalData, isReadonly);
|
|
18
|
+
}
|
|
19
|
+
let userFiles = [];
|
|
20
|
+
if (fileId != null) {
|
|
21
|
+
userFiles = (0, fileSelector_1.getFilesByFileIds)(state.fileState, [fileId]);
|
|
22
|
+
}
|
|
23
|
+
const fetchState = state.internationalWireVerificationState.verificationFormFetchState
|
|
24
|
+
.fetchState;
|
|
46
25
|
return {
|
|
47
|
-
|
|
48
|
-
verificationFormFields: visibleVerificationFormFields,
|
|
49
|
-
verificationFormLocalData,
|
|
50
|
-
verificationFormSubmitState,
|
|
26
|
+
...state.internationalWireVerificationState,
|
|
51
27
|
deleteFileStatusById,
|
|
52
28
|
updateFileStatusById,
|
|
53
29
|
userFiles,
|
|
@@ -1,29 +1,15 @@
|
|
|
1
1
|
import { FetchStateAndError } from '../../../../commonStateTypes/common';
|
|
2
|
-
import { FieldPayload } from './internationalWireVerificationPayload';
|
|
3
2
|
export interface InternationalWireVerificationState {
|
|
4
3
|
verificationFormFetchState: FetchStateAndError;
|
|
5
|
-
verificationFormFieldLabels: Record<string, FieldPayload>;
|
|
6
4
|
verificationFormFields: VerificationFormField[];
|
|
7
5
|
verificationFormLocalData: VerificationFormLocalData;
|
|
8
6
|
verificationFormSubmitState: FetchStateAndError;
|
|
9
7
|
}
|
|
10
|
-
export type
|
|
11
|
-
export type VerificationFormLocalData = Record<string, VerificationFormLocalDataValue>;
|
|
8
|
+
export type VerificationFormLocalData = Record<string, string | string[]>;
|
|
12
9
|
export interface FieldValueType {
|
|
13
10
|
code: string;
|
|
14
11
|
description: string;
|
|
15
12
|
}
|
|
16
|
-
export interface VerificationFormFieldOption {
|
|
17
|
-
label: string;
|
|
18
|
-
}
|
|
19
|
-
export interface VerificationFormSubField {
|
|
20
|
-
fieldValues: FieldValueType[];
|
|
21
|
-
label: string;
|
|
22
|
-
placeholder: string;
|
|
23
|
-
type: string;
|
|
24
|
-
isMultipleOptionsSupported?: boolean;
|
|
25
|
-
options?: Record<string, VerificationFormFieldOption>;
|
|
26
|
-
}
|
|
27
13
|
export interface VerificationFormField {
|
|
28
14
|
fieldValues: FieldValueType[];
|
|
29
15
|
isMultipleValuesAllowed: boolean;
|
|
@@ -31,9 +17,4 @@ export interface VerificationFormField {
|
|
|
31
17
|
name: string;
|
|
32
18
|
placeholder: string;
|
|
33
19
|
type: string;
|
|
34
|
-
default?: boolean;
|
|
35
|
-
isMultipleOptionsSupported?: boolean;
|
|
36
|
-
options?: Record<string, VerificationFormFieldOption>;
|
|
37
|
-
requirements?: string[];
|
|
38
|
-
subfields?: Record<string, VerificationFormSubField>;
|
|
39
20
|
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
|
+
import { openSnackbar } from '../../../../entity/snackbar/snackbarReducer';
|
|
3
|
+
import { appendSubTaskId, updateTasks } from '../../../../entity/task/taskReducer';
|
|
4
|
+
import { RootState } from '../../../../reducer';
|
|
5
|
+
import { ZeniAPI } from '../../../../zeniAPI';
|
|
6
|
+
import { updateTaskListOnNewTaskCreationSuccess } from '../../taskListView/taskListReducer';
|
|
7
|
+
import { createSubTask, createSubTaskSuccessOrFailure } from '../taskDetailReducer';
|
|
8
|
+
export type ActionType = ReturnType<typeof createSubTask> | ReturnType<typeof updateTasks> | ReturnType<typeof appendSubTaskId> | ReturnType<typeof openSnackbar> | ReturnType<typeof updateTaskListOnNewTaskCreationSuccess> | ReturnType<typeof createSubTaskSuccessOrFailure>;
|
|
9
|
+
export declare const createSubTaskEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => import("rxjs").Observable<ActionType>;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createSubTaskEpic = void 0;
|
|
4
|
+
const rxjs_1 = require("rxjs");
|
|
5
|
+
const operators_1 = require("rxjs/operators");
|
|
6
|
+
const formatMinutesToFromHHMM_1 = require("../../../../commonStateTypes/fiscalYearHelpers/formatMinutesToFromHHMM");
|
|
7
|
+
const snackbarReducer_1 = require("../../../../entity/snackbar/snackbarReducer");
|
|
8
|
+
const taskReducer_1 = require("../../../../entity/task/taskReducer");
|
|
9
|
+
const taskSelector_1 = require("../../../../entity/task/taskSelector");
|
|
10
|
+
const responsePayload_1 = require("../../../../responsePayload");
|
|
11
|
+
const taskListReducer_1 = require("../../taskListView/taskListReducer");
|
|
12
|
+
const taskDetailReducer_1 = require("../taskDetailReducer");
|
|
13
|
+
const createSubTaskEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(taskDetailReducer_1.createSubTask.match), (0, operators_1.mergeMap)((action) => {
|
|
14
|
+
const state = state$.value;
|
|
15
|
+
const parentTask = (0, taskSelector_1.getTaskById)(state.taskState, action.payload.parentTaskId);
|
|
16
|
+
const parentTaskGroupId = parentTask?.taskGroupIds[0];
|
|
17
|
+
const isTaskListFetched = state.taskListState.fetchState === 'Completed';
|
|
18
|
+
const payload = prepareSubTaskPayload(action.payload, parentTaskGroupId);
|
|
19
|
+
return zeniAPI
|
|
20
|
+
.postAndGetJSON(`${zeniAPI.apiEndPoints.taskMicroServiceBaseUrl}/1.0/task-manager/tasks`, payload)
|
|
21
|
+
.pipe((0, operators_1.mergeMap)((response) => {
|
|
22
|
+
if ((0, responsePayload_1.isSuccessResponse)(response) &&
|
|
23
|
+
response.data != null &&
|
|
24
|
+
response.data.tasks.length > 0) {
|
|
25
|
+
const newTaskId = response.data.tasks[0].task_id;
|
|
26
|
+
const actions = [
|
|
27
|
+
(0, taskReducer_1.updateTasks)(response.data.tasks),
|
|
28
|
+
(0, taskReducer_1.appendSubTaskId)({
|
|
29
|
+
parentTaskId: action.payload.parentTaskId,
|
|
30
|
+
subTaskId: newTaskId,
|
|
31
|
+
}),
|
|
32
|
+
(0, taskDetailReducer_1.createSubTaskSuccessOrFailure)({
|
|
33
|
+
fetchState: 'Completed',
|
|
34
|
+
newTaskId,
|
|
35
|
+
}),
|
|
36
|
+
(0, snackbarReducer_1.openSnackbar)({
|
|
37
|
+
messageSection: 'create_sub_task',
|
|
38
|
+
messageText: 'success',
|
|
39
|
+
type: 'success',
|
|
40
|
+
}),
|
|
41
|
+
];
|
|
42
|
+
if (isTaskListFetched === true && parentTaskGroupId != null) {
|
|
43
|
+
actions.push((0, taskListReducer_1.updateTaskListOnNewTaskCreationSuccess)({
|
|
44
|
+
taskGroupId: parentTaskGroupId,
|
|
45
|
+
task: response.data.tasks[0],
|
|
46
|
+
}));
|
|
47
|
+
}
|
|
48
|
+
return (0, rxjs_1.from)(actions);
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
return (0, rxjs_1.of)((0, taskDetailReducer_1.createSubTaskSuccessOrFailure)({
|
|
52
|
+
fetchState: 'Error',
|
|
53
|
+
error: response.status,
|
|
54
|
+
}), (0, snackbarReducer_1.openSnackbar)({
|
|
55
|
+
messageSection: 'create_sub_task',
|
|
56
|
+
messageText: 'failed',
|
|
57
|
+
type: 'error',
|
|
58
|
+
variables: [
|
|
59
|
+
{
|
|
60
|
+
variableName: '_api-error_',
|
|
61
|
+
variableValue: response.status.message,
|
|
62
|
+
},
|
|
63
|
+
],
|
|
64
|
+
}));
|
|
65
|
+
}
|
|
66
|
+
}), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, taskDetailReducer_1.createSubTaskSuccessOrFailure)({
|
|
67
|
+
fetchState: 'Error',
|
|
68
|
+
error: (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Create Sub Task REST API call errored out' +
|
|
69
|
+
JSON.stringify(error)),
|
|
70
|
+
}))));
|
|
71
|
+
}));
|
|
72
|
+
exports.createSubTaskEpic = createSubTaskEpic;
|
|
73
|
+
const prepareSubTaskPayload = (subTask, parentTaskGroupId) => ({
|
|
74
|
+
name: subTask.name,
|
|
75
|
+
assignees: subTask.assignee,
|
|
76
|
+
description: subTask.description,
|
|
77
|
+
priority: subTask.priority,
|
|
78
|
+
status: subTask.status,
|
|
79
|
+
tags: subTask.tagIds,
|
|
80
|
+
time_spent: (0, formatMinutesToFromHHMM_1.convertHHMMStrToMinutes)(subTask.timeSpent),
|
|
81
|
+
group_assignees: subTask.groupAssignees,
|
|
82
|
+
parent_task_id: subTask.parentTaskId,
|
|
83
|
+
task_group_ids: parentTaskGroupId == null ? [] : [parentTaskGroupId],
|
|
84
|
+
});
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { updateTasks } from '../../../../entity/task/taskReducer';
|
|
4
|
+
import { RootState } from '../../../../reducer';
|
|
5
|
+
import { ZeniAPI } from '../../../../zeniAPI';
|
|
6
|
+
import { fetchSubTasks, updateSubTasks, updateSubTasksFetchStatus } from '../taskDetailReducer';
|
|
7
|
+
export type ActionType = ReturnType<typeof fetchSubTasks> | ReturnType<typeof updateTasks> | ReturnType<typeof updateSubTasks> | ReturnType<typeof updateSubTasksFetchStatus>;
|
|
8
|
+
export declare const fetchSubTasksEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.fetchSubTasksEpic = void 0;
|
|
4
|
+
const rxjs_1 = require("rxjs");
|
|
5
|
+
const operators_1 = require("rxjs/operators");
|
|
6
|
+
const taskReducer_1 = require("../../../../entity/task/taskReducer");
|
|
7
|
+
const responsePayload_1 = require("../../../../responsePayload");
|
|
8
|
+
const taskDetailReducer_1 = require("../taskDetailReducer");
|
|
9
|
+
const fetchSubTasksEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(taskDetailReducer_1.fetchSubTasks.match), (0, operators_1.switchMap)((action) => {
|
|
10
|
+
const { parentTaskId } = action.payload;
|
|
11
|
+
const query = JSON.stringify({
|
|
12
|
+
task_type: 'subtasks',
|
|
13
|
+
parent_task_id: parentTaskId,
|
|
14
|
+
});
|
|
15
|
+
return zeniAPI
|
|
16
|
+
.getJSON(`${zeniAPI.apiEndPoints.taskMicroServiceBaseUrl}/1.0/task-manager/tasks?query=${encodeURIComponent(query)}`)
|
|
17
|
+
.pipe((0, operators_1.mergeMap)((response) => {
|
|
18
|
+
if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
|
|
19
|
+
const { tasks } = response.data;
|
|
20
|
+
return (0, rxjs_1.of)((0, taskReducer_1.updateTasks)(tasks), (0, taskDetailReducer_1.updateSubTasks)({
|
|
21
|
+
parentTaskId,
|
|
22
|
+
}));
|
|
23
|
+
}
|
|
24
|
+
else {
|
|
25
|
+
return (0, rxjs_1.of)((0, taskDetailReducer_1.updateSubTasksFetchStatus)({
|
|
26
|
+
parentTaskId,
|
|
27
|
+
fetchState: 'Error',
|
|
28
|
+
error: response.status,
|
|
29
|
+
}));
|
|
30
|
+
}
|
|
31
|
+
}), (0, operators_1.catchError)((error) => {
|
|
32
|
+
return (0, rxjs_1.of)((0, taskDetailReducer_1.updateSubTasksFetchStatus)({
|
|
33
|
+
parentTaskId,
|
|
34
|
+
fetchState: 'Error',
|
|
35
|
+
error: (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Fetch Sub Tasks REST API call errored out' +
|
|
36
|
+
JSON.stringify(error)),
|
|
37
|
+
}));
|
|
38
|
+
}));
|
|
39
|
+
}));
|
|
40
|
+
exports.fetchSubTasksEpic = fetchSubTasksEpic;
|
|
@@ -6,6 +6,7 @@ import { updateTasks } from '../../../../entity/task/taskReducer';
|
|
|
6
6
|
import { RootState } from '../../../../reducer';
|
|
7
7
|
import { ZeniAPI } from '../../../../zeniAPI';
|
|
8
8
|
import { fetchFileList } from '../../../fileView/fileViewReducer';
|
|
9
|
+
import { updateTaskListOnNewTaskCreationSuccess } from '../../taskListView/taskListReducer';
|
|
9
10
|
import { fetchTaskDetail, initializeTaskToLocalStore, removeTaskDetail, updateEditTaskFetchStatus } from '../taskDetailReducer';
|
|
10
|
-
export 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>;
|
|
11
|
+
export 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> | ReturnType<typeof updateTaskListOnNewTaskCreationSuccess>;
|
|
11
12
|
export declare const fetchTaskDetailEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
@@ -10,13 +10,16 @@ const operators_1 = require("rxjs/operators");
|
|
|
10
10
|
const snackbarReducer_1 = require("../../../../entity/snackbar/snackbarReducer");
|
|
11
11
|
const tagReducer_1 = require("../../../../entity/tag/tagReducer");
|
|
12
12
|
const taskReducer_1 = require("../../../../entity/task/taskReducer");
|
|
13
|
+
const taskSelector_1 = require("../../../../entity/task/taskSelector");
|
|
13
14
|
const responsePayload_1 = require("../../../../responsePayload");
|
|
14
15
|
const fileViewReducer_1 = require("../../../fileView/fileViewReducer");
|
|
16
|
+
const taskListReducer_1 = require("../../taskListView/taskListReducer");
|
|
15
17
|
const taskDetailReducer_1 = require("../taskDetailReducer");
|
|
16
18
|
const fetchTaskDetailEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(taskDetailReducer_1.fetchTaskDetail.match), (0, operators_1.mergeMap)((action) => {
|
|
17
19
|
const { taskId, cacheOverride } = action.payload;
|
|
18
20
|
const taskActions = [];
|
|
19
21
|
const state = state$.value;
|
|
22
|
+
const isTaskListFetched = state.taskListState.fetchState === 'Completed';
|
|
20
23
|
const taskDetail = (0, get_1.default)(state.taskDetailState.editTaskStateById, taskId, undefined);
|
|
21
24
|
if (cacheOverride === true) {
|
|
22
25
|
taskActions.push((0, taskDetailReducer_1.removeTaskDetail)(taskId));
|
|
@@ -38,6 +41,16 @@ const fetchTaskDetailEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, ope
|
|
|
38
41
|
(0, tagReducer_1.updateTags)(response.data.tasks.map((task) => task.tags).flat()),
|
|
39
42
|
(0, taskDetailReducer_1.initializeTaskToLocalStore)(taskId),
|
|
40
43
|
];
|
|
44
|
+
if (isTaskListFetched === true) {
|
|
45
|
+
const taskGroupId = response.data.tasks[0].task_group_ids?.[0];
|
|
46
|
+
if (taskGroupId != null) {
|
|
47
|
+
fetchActions.push((0, taskListReducer_1.updateTaskListOnNewTaskCreationSuccess)({
|
|
48
|
+
taskGroupId,
|
|
49
|
+
task: response.data.tasks[0],
|
|
50
|
+
currentTaskState: (0, taskSelector_1.getTaskById)(state.taskState, taskId),
|
|
51
|
+
}));
|
|
52
|
+
}
|
|
53
|
+
}
|
|
41
54
|
const fileIds = response.data.tasks[0].file_ids;
|
|
42
55
|
if (fileIds.length > 0) {
|
|
43
56
|
fetchActions.push((0, fileViewReducer_1.fetchFileList)(fileIds));
|
|
@@ -3,9 +3,22 @@ import { DayOfWeek, PriorityCodeType, TaskStatusCodeType, TaskType } from '../..
|
|
|
3
3
|
import { ZeniDate } from '../../../zeniDayJS';
|
|
4
4
|
import { RecurringDatePickerOptions, RecurringFrequencyType } from '../../common/recurringViewHelper';
|
|
5
5
|
import { CommonHistoryView } from '../../spendManagement/commonHistoryView/commonHistory';
|
|
6
|
+
export interface CreateSubTaskPayload {
|
|
7
|
+
assignee: ID[];
|
|
8
|
+
description: string;
|
|
9
|
+
groupAssignees: ID[];
|
|
10
|
+
name: string;
|
|
11
|
+
parentTaskId: ID;
|
|
12
|
+
priority: PriorityCodeType;
|
|
13
|
+
status: TaskStatusCodeType;
|
|
14
|
+
tagIds: ID[];
|
|
15
|
+
timeSpent: string;
|
|
16
|
+
}
|
|
6
17
|
export interface TaskDetailViewState {
|
|
7
18
|
editTaskStateById: Record<ID, EditTaskDetail>;
|
|
8
19
|
newTaskState: EditTaskDetail;
|
|
20
|
+
subTaskCreateStatus: FetchStateAndError;
|
|
21
|
+
subTaskListFetchStatusByParentId: Record<ID, FetchStateAndError>;
|
|
9
22
|
taskHistoryById: Record<ID, CommonHistoryView>;
|
|
10
23
|
}
|
|
11
24
|
export interface EditTaskDetail {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { FetchState, ID } from '../../../commonStateTypes/common';
|
|
2
2
|
import { ZeniAPIStatus } from '../../../responsePayload';
|
|
3
3
|
import { HistoricEventPayload } from '../../spendManagement/commonHistoryView/commonHistoryPayload';
|
|
4
|
-
import { EditTaskLocalData, TaskDetailViewState } from './taskDetail';
|
|
4
|
+
import { CreateSubTaskPayload, EditTaskLocalData, TaskDetailViewState } from './taskDetail';
|
|
5
5
|
export declare const initialState: TaskDetailViewState;
|
|
6
6
|
export declare const fetchTaskDetailPage: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[cacheOverride: boolean, taskId?: string | undefined], {
|
|
7
7
|
cacheOverride: boolean;
|
|
@@ -34,7 +34,19 @@ export declare const fetchTaskDetailPage: import("@reduxjs/toolkit").ActionCreat
|
|
|
34
34
|
error?: ZeniAPIStatus;
|
|
35
35
|
newTaskId?: ID;
|
|
36
36
|
taskId?: ID;
|
|
37
|
-
}, "taskDetailView/saveTaskSuccessOrFailure">,
|
|
37
|
+
}, "taskDetailView/saveTaskSuccessOrFailure">, createSubTask: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[payload: CreateSubTaskPayload], CreateSubTaskPayload, "taskDetailView/createSubTask", never, never>, createSubTaskSuccessOrFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
38
|
+
fetchState: FetchState;
|
|
39
|
+
error?: ZeniAPIStatus;
|
|
40
|
+
newTaskId?: ID;
|
|
41
|
+
}, "taskDetailView/createSubTaskSuccessOrFailure">, resetSubTaskCreateStatus: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"taskDetailView/resetSubTaskCreateStatus">, fetchSubTasks: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[parentTaskId: string], {
|
|
42
|
+
parentTaskId: string;
|
|
43
|
+
}, "taskDetailView/fetchSubTasks", never, never>, updateSubTasks: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
44
|
+
parentTaskId: ID;
|
|
45
|
+
}, "taskDetailView/updateSubTasks">, updateSubTasksFetchStatus: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
46
|
+
fetchState: FetchState;
|
|
47
|
+
parentTaskId: ID;
|
|
48
|
+
error?: ZeniAPIStatus;
|
|
49
|
+
}, "taskDetailView/updateSubTasksFetchStatus">, deleteTask: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[taskId?: string | undefined], {
|
|
38
50
|
taskId: string | undefined;
|
|
39
51
|
}, "taskDetailView/deleteTask", never, never>, removeTaskDetail: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "taskDetailView/removeTaskDetail">, deleteTaskSuccessOrFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
40
52
|
fetchState: FetchState;
|
|
@@ -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.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;
|
|
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.updateSubTasksFetchStatus = exports.updateSubTasks = exports.fetchSubTasks = exports.resetSubTaskCreateStatus = exports.createSubTaskSuccessOrFailure = exports.createSubTask = 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");
|
|
@@ -13,6 +13,11 @@ const taskDetail_1 = require("./taskDetail");
|
|
|
13
13
|
exports.initialState = {
|
|
14
14
|
newTaskState: taskDetail_1.initialTaskDetail,
|
|
15
15
|
editTaskStateById: {},
|
|
16
|
+
subTaskCreateStatus: {
|
|
17
|
+
fetchState: 'Not-Started',
|
|
18
|
+
error: undefined,
|
|
19
|
+
},
|
|
20
|
+
subTaskListFetchStatusByParentId: {},
|
|
16
21
|
taskHistoryById: {},
|
|
17
22
|
};
|
|
18
23
|
const taskDetailView = (0, toolkit_1.createSlice)({
|
|
@@ -57,7 +62,7 @@ const taskDetailView = (0, toolkit_1.createSlice)({
|
|
|
57
62
|
updateEditTaskFetchStatus(draft, action) {
|
|
58
63
|
const { taskId, fetchState, error } = action.payload;
|
|
59
64
|
draft.editTaskStateById[taskId] = {
|
|
60
|
-
...draft.editTaskStateById[taskId],
|
|
65
|
+
...(draft.editTaskStateById[taskId] ?? taskDetail_1.initialTaskDetail),
|
|
61
66
|
fetchTaskStatus: {
|
|
62
67
|
fetchState,
|
|
63
68
|
error: fetchState === 'Error' ? error : undefined,
|
|
@@ -325,10 +330,59 @@ const taskDetailView = (0, toolkit_1.createSlice)({
|
|
|
325
330
|
error,
|
|
326
331
|
};
|
|
327
332
|
},
|
|
333
|
+
createSubTask: {
|
|
334
|
+
reducer(draft) {
|
|
335
|
+
draft.subTaskCreateStatus = {
|
|
336
|
+
fetchState: 'In-Progress',
|
|
337
|
+
error: undefined,
|
|
338
|
+
};
|
|
339
|
+
},
|
|
340
|
+
prepare(payload) {
|
|
341
|
+
return { payload };
|
|
342
|
+
},
|
|
343
|
+
},
|
|
344
|
+
createSubTaskSuccessOrFailure(draft, action) {
|
|
345
|
+
const { fetchState, error } = action.payload;
|
|
346
|
+
draft.subTaskCreateStatus = {
|
|
347
|
+
fetchState,
|
|
348
|
+
error,
|
|
349
|
+
};
|
|
350
|
+
},
|
|
351
|
+
resetSubTaskCreateStatus(draft) {
|
|
352
|
+
draft.subTaskCreateStatus = {
|
|
353
|
+
...exports.initialState.subTaskCreateStatus,
|
|
354
|
+
};
|
|
355
|
+
},
|
|
356
|
+
fetchSubTasks: {
|
|
357
|
+
reducer(draft, action) {
|
|
358
|
+
const { parentTaskId } = action.payload;
|
|
359
|
+
draft.subTaskListFetchStatusByParentId[parentTaskId] = {
|
|
360
|
+
fetchState: 'In-Progress',
|
|
361
|
+
error: undefined,
|
|
362
|
+
};
|
|
363
|
+
},
|
|
364
|
+
prepare(parentTaskId) {
|
|
365
|
+
return { payload: { parentTaskId } };
|
|
366
|
+
},
|
|
367
|
+
},
|
|
368
|
+
updateSubTasks(draft, action) {
|
|
369
|
+
const { parentTaskId } = action.payload;
|
|
370
|
+
draft.subTaskListFetchStatusByParentId[parentTaskId] = {
|
|
371
|
+
fetchState: 'Completed',
|
|
372
|
+
error: undefined,
|
|
373
|
+
};
|
|
374
|
+
},
|
|
375
|
+
updateSubTasksFetchStatus(draft, action) {
|
|
376
|
+
const { parentTaskId, fetchState, error } = action.payload;
|
|
377
|
+
draft.subTaskListFetchStatusByParentId[parentTaskId] = {
|
|
378
|
+
fetchState,
|
|
379
|
+
error,
|
|
380
|
+
};
|
|
381
|
+
},
|
|
328
382
|
clearTaskDetail(draft) {
|
|
329
383
|
Object.assign(draft, exports.initialState);
|
|
330
384
|
},
|
|
331
385
|
},
|
|
332
386
|
});
|
|
333
|
-
_a = taskDetailView.actions, exports.fetchTaskDetailPage = _a.fetchTaskDetailPage, exports.fetchTaskDetail = _a.fetchTaskDetail, exports.initializeTaskToLocalStore = _a.initializeTaskToLocalStore, exports.updateEditTaskFetchStatus = _a.updateEditTaskFetchStatus, exports.saveTaskUpdatesToLocalStore = _a.saveTaskUpdatesToLocalStore, exports.discardTaskUpdatesInLocalStore = _a.discardTaskUpdatesInLocalStore, exports.saveTaskDetail = _a.saveTaskDetail, exports.archiveTask = _a.archiveTask, exports.archiveTaskSuccessOrFailure = _a.archiveTaskSuccessOrFailure, exports.saveTaskSuccessOrFailure = _a.saveTaskSuccessOrFailure, exports.deleteTask = _a.deleteTask, exports.removeTaskDetail = _a.removeTaskDetail, exports.deleteTaskSuccessOrFailure = _a.deleteTaskSuccessOrFailure, exports.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;
|
|
387
|
+
_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.createSubTask = _a.createSubTask, exports.createSubTaskSuccessOrFailure = _a.createSubTaskSuccessOrFailure, exports.resetSubTaskCreateStatus = _a.resetSubTaskCreateStatus, exports.fetchSubTasks = _a.fetchSubTasks, exports.updateSubTasks = _a.updateSubTasks, exports.updateSubTasksFetchStatus = _a.updateSubTasksFetchStatus, 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;
|
|
334
388
|
exports.default = taskDetailView.reducer;
|
|
@@ -2,7 +2,7 @@ import { FetchStateAndError, ID } from '../../../commonStateTypes/common';
|
|
|
2
2
|
import { SelectorView } from '../../../commonStateTypes/viewAndReport/viewAndReport';
|
|
3
3
|
import { Class } from '../../../entity/class/classState';
|
|
4
4
|
import { File } from '../../../entity/file/fileState';
|
|
5
|
-
import { TaskPriority, TaskStatus } from '../../../entity/task/taskState';
|
|
5
|
+
import { Task, TaskPriority, TaskStatus } from '../../../entity/task/taskState';
|
|
6
6
|
import { RootState } from '../../../reducer';
|
|
7
7
|
import { ZeniDate } from '../../../zeniDayJS';
|
|
8
8
|
import { UserAndRole } from '../../companyView/types/userAndRole';
|
|
@@ -14,6 +14,7 @@ export interface TaskDetailSelectorView extends SelectorView {
|
|
|
14
14
|
deleteFileStatusById: Record<ID, FetchStateAndError | undefined>;
|
|
15
15
|
files: File[];
|
|
16
16
|
showTaskDetailFormFooter: boolean;
|
|
17
|
+
subtasks: Task[];
|
|
17
18
|
taskDetailView: EditTaskDetail;
|
|
18
19
|
taskHistory: HistoricEvent[];
|
|
19
20
|
updateFileStatusById: Record<ID, FetchStateAndError | undefined>;
|