@zeniai/client-epic-state 5.0.81-betaJK5 → 5.0.81-betaJK7
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/esm/view/companyTaskManagerView/epics/fetchCompanyTaskManagerViewEpic.js +1 -2
- package/lib/esm/view/companyTaskManagerView/epics/updateCompanyTaskManagerViewUIStateEpic.js +8 -2
- package/lib/view/companyTaskManagerView/epics/fetchCompanyTaskManagerViewEpic.js +1 -2
- package/lib/view/companyTaskManagerView/epics/updateCompanyTaskManagerViewUIStateEpic.js +8 -2
- package/package.json +1 -1
|
@@ -9,7 +9,6 @@ const DEFAULT_PAGE_SIZE = 100;
|
|
|
9
9
|
export const fetchCompanyTaskManagerViewEpic = (actions$, _state$, zeniAPI) => actions$.pipe(filter(fetchCompanyTaskManagerView.match), switchMap((action) => {
|
|
10
10
|
const { from: fromOffset, searchString, sortKey, sortOrder, filters, } = action.payload;
|
|
11
11
|
const queryValue = {
|
|
12
|
-
aggregation_by: 'status',
|
|
13
12
|
bool_type: 'should',
|
|
14
13
|
size: DEFAULT_PAGE_SIZE,
|
|
15
14
|
from: fromOffset,
|
|
@@ -67,7 +66,7 @@ const toFilterByPayload = (filters) => {
|
|
|
67
66
|
}
|
|
68
67
|
return filters.categories.map((category) => ({
|
|
69
68
|
field: category.field ?? '',
|
|
70
|
-
operator: category.matchingOperator,
|
|
69
|
+
operator: category.matchingOperator === 'equal' ? 'is' : 'is_not',
|
|
71
70
|
values: category.values.map((v) => String(v)),
|
|
72
71
|
join: category.valuesCombinationOperator === 'ALL' ? 'and' : 'or',
|
|
73
72
|
}));
|
package/lib/esm/view/companyTaskManagerView/epics/updateCompanyTaskManagerViewUIStateEpic.js
CHANGED
|
@@ -2,9 +2,15 @@ import { EMPTY, of } from 'rxjs';
|
|
|
2
2
|
import { filter, switchMap } from 'rxjs/operators';
|
|
3
3
|
import { fetchCompanyTaskManagerView, updateCompanyTaskManagerViewUIState, } from '../companyTaskManagerViewReducer';
|
|
4
4
|
export const updateCompanyTaskManagerViewUIStateEpic = (actions$, state$) => actions$.pipe(filter(updateCompanyTaskManagerViewUIState.match), switchMap((action) => {
|
|
5
|
-
|
|
5
|
+
const filters = action.payload.filters;
|
|
6
|
+
const allCategoriesValid = filters?.categories == null
|
|
7
|
+
? true
|
|
8
|
+
: filters?.categories?.every((category) => category.field != null &&
|
|
9
|
+
category.values != null &&
|
|
10
|
+
category.values.length > 0);
|
|
11
|
+
if (!allCategoriesValid) {
|
|
6
12
|
return EMPTY;
|
|
7
13
|
}
|
|
8
14
|
const { uiState } = state$.value.companyTaskManagerViewState;
|
|
9
|
-
return of(fetchCompanyTaskManagerView(0, uiState.sortKey, uiState.sortOrder, false, uiState.filterText,
|
|
15
|
+
return of(fetchCompanyTaskManagerView(0, uiState.sortKey, uiState.sortOrder, false, uiState.filterText, filters));
|
|
10
16
|
}));
|
|
@@ -12,7 +12,6 @@ const DEFAULT_PAGE_SIZE = 100;
|
|
|
12
12
|
const fetchCompanyTaskManagerViewEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(companyTaskManagerViewReducer_1.fetchCompanyTaskManagerView.match), (0, operators_1.switchMap)((action) => {
|
|
13
13
|
const { from: fromOffset, searchString, sortKey, sortOrder, filters, } = action.payload;
|
|
14
14
|
const queryValue = {
|
|
15
|
-
aggregation_by: 'status',
|
|
16
15
|
bool_type: 'should',
|
|
17
16
|
size: DEFAULT_PAGE_SIZE,
|
|
18
17
|
from: fromOffset,
|
|
@@ -71,7 +70,7 @@ const toFilterByPayload = (filters) => {
|
|
|
71
70
|
}
|
|
72
71
|
return filters.categories.map((category) => ({
|
|
73
72
|
field: category.field ?? '',
|
|
74
|
-
operator: category.matchingOperator,
|
|
73
|
+
operator: category.matchingOperator === 'equal' ? 'is' : 'is_not',
|
|
75
74
|
values: category.values.map((v) => String(v)),
|
|
76
75
|
join: category.valuesCombinationOperator === 'ALL' ? 'and' : 'or',
|
|
77
76
|
}));
|
|
@@ -5,10 +5,16 @@ const rxjs_1 = require("rxjs");
|
|
|
5
5
|
const operators_1 = require("rxjs/operators");
|
|
6
6
|
const companyTaskManagerViewReducer_1 = require("../companyTaskManagerViewReducer");
|
|
7
7
|
const updateCompanyTaskManagerViewUIStateEpic = (actions$, state$) => actions$.pipe((0, operators_1.filter)(companyTaskManagerViewReducer_1.updateCompanyTaskManagerViewUIState.match), (0, operators_1.switchMap)((action) => {
|
|
8
|
-
|
|
8
|
+
const filters = action.payload.filters;
|
|
9
|
+
const allCategoriesValid = filters?.categories == null
|
|
10
|
+
? true
|
|
11
|
+
: filters?.categories?.every((category) => category.field != null &&
|
|
12
|
+
category.values != null &&
|
|
13
|
+
category.values.length > 0);
|
|
14
|
+
if (!allCategoriesValid) {
|
|
9
15
|
return rxjs_1.EMPTY;
|
|
10
16
|
}
|
|
11
17
|
const { uiState } = state$.value.companyTaskManagerViewState;
|
|
12
|
-
return (0, rxjs_1.of)((0, companyTaskManagerViewReducer_1.fetchCompanyTaskManagerView)(0, uiState.sortKey, uiState.sortOrder, false, uiState.filterText,
|
|
18
|
+
return (0, rxjs_1.of)((0, companyTaskManagerViewReducer_1.fetchCompanyTaskManagerView)(0, uiState.sortKey, uiState.sortOrder, false, uiState.filterText, filters));
|
|
13
19
|
}));
|
|
14
20
|
exports.updateCompanyTaskManagerViewUIStateEpic = updateCompanyTaskManagerViewUIStateEpic;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeniai/client-epic-state",
|
|
3
|
-
"version": "5.0.81-
|
|
3
|
+
"version": "5.0.81-betaJK7",
|
|
4
4
|
"description": "Shared module between Web & Mobile containing required abstractions for state management, async network communication. ",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "lib/esm/index.js",
|