@cxbox-ui/core 1.37.2-alpha.10 → 1.37.2-alpha.11
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/dist/actions/index.d.ts +2 -1
- package/dist/cxbox-ui-core.cjs.development.js +340 -312
- package/dist/cxbox-ui-core.cjs.production.min.js +1 -1
- package/dist/cxbox-ui-core.esm.js +234 -206
- package/dist/cxbox-ui-core.modern.development.js +230 -203
- package/dist/cxbox-ui-core.modern.js +230 -203
- package/dist/cxbox-ui-core.modern.production.min.js +1 -1
- package/dist/interfaces/session.d.ts +1 -0
- package/dist/utils/apiError.d.ts +19 -0
- package/dist/utils/index.d.ts +1 -0
- package/package.json +1 -1
|
@@ -493,6 +493,8 @@ __export(utils_exports, {
|
|
|
493
493
|
buildSearchResultTree: () => buildSearchResultTree,
|
|
494
494
|
buildUrl: () => buildUrl,
|
|
495
495
|
checkShowCondition: () => checkShowCondition,
|
|
496
|
+
createApiError: () => createApiError,
|
|
497
|
+
createApiErrorObservable: () => createApiErrorObservable,
|
|
496
498
|
defaultBuildURL: () => defaultBuildURL,
|
|
497
499
|
defaultParseURL: () => defaultParseURL,
|
|
498
500
|
deleteUndefinedFromObject: () => deleteUndefinedFromObject,
|
|
@@ -540,6 +542,18 @@ function applyRawParams(url, qso) {
|
|
|
540
542
|
const result = new URLSearchParams(qso).toString();
|
|
541
543
|
return `${addTailControlSequences(url)}${result && `${result}`}`;
|
|
542
544
|
}
|
|
545
|
+
// src/utils/apiError.ts
|
|
546
|
+
import { actions } from "@cxbox-ui/core";
|
|
547
|
+
import { EMPTY, of } from "rxjs";
|
|
548
|
+
function createApiError(error, context = { widgetName: "unknown" }) {
|
|
549
|
+
if (!error.isAxiosError)
|
|
550
|
+
return void 0;
|
|
551
|
+
return actions.apiError({ error, callContext: context });
|
|
552
|
+
}
|
|
553
|
+
function createApiErrorObservable(error, context) {
|
|
554
|
+
const apiError2 = createApiError(error, context);
|
|
555
|
+
return apiError2 ? of(apiError2) : EMPTY;
|
|
556
|
+
}
|
|
543
557
|
// src/utils/strings.ts
|
|
544
558
|
function getTemplate(literals, ...placeholders) {
|
|
545
559
|
let result = "";
|
|
@@ -1094,7 +1108,9 @@ var createScreenReducerBuilderManager = (initialState) => new ReducerBuilderMana
|
|
|
1094
1108
|
state.bo.bc[action.payload.bcName].page = action.payload.page;
|
|
1095
1109
|
state.bo.bc[action.payload.bcName].loading = true;
|
|
1096
1110
|
}).addCase(showViewPopup, (state, action) => {
|
|
1097
|
-
|
|
1111
|
+
var _a, _b;
|
|
1112
|
+
const currentPage = (_b = (_a = state.bo.bc[action.payload.bcName]) == null ? void 0 : _a.page) != null ? _b : 1;
|
|
1113
|
+
state.bo.bc[action.payload.bcName].page = action.payload.bcName === action.payload.calleeBCName ? currentPage : 1;
|
|
1098
1114
|
state.bo.bc[action.payload.bcName].loading = action.payload.bcName !== action.payload.calleeBCName;
|
|
1099
1115
|
}).addCase(sendOperationSuccess, (state, action) => {
|
|
1100
1116
|
state.bo.bc[action.payload.bcName].loading = false;
|
|
@@ -1123,7 +1139,8 @@ var initialSessionState = {
|
|
|
1123
1139
|
errorMsg: null,
|
|
1124
1140
|
screens: [],
|
|
1125
1141
|
pendingRequests: [],
|
|
1126
|
-
notifications: []
|
|
1142
|
+
notifications: [],
|
|
1143
|
+
isMetaRefreshing: false
|
|
1127
1144
|
};
|
|
1128
1145
|
var createSessionReducerBuilderManager = (initialState) => new ReducerBuilderManager().addCase(login, (state) => {
|
|
1129
1146
|
state.loginSpin = true;
|
|
@@ -1153,6 +1170,12 @@ var createSessionReducerBuilderManager = (initialState) => new ReducerBuilderMan
|
|
|
1153
1170
|
}).addCase(removeNotifications, (state, action) => {
|
|
1154
1171
|
const closingKeys = action.payload;
|
|
1155
1172
|
state.notifications = state.notifications.filter((notification) => !closingKeys.includes(notification.key));
|
|
1173
|
+
}).addCase(refreshMeta, (state) => {
|
|
1174
|
+
state.isMetaRefreshing = true;
|
|
1175
|
+
}).addCase(refreshMetaDone, (state) => {
|
|
1176
|
+
state.isMetaRefreshing = false;
|
|
1177
|
+
}).addCase(refreshMetaFail, (state) => {
|
|
1178
|
+
state.isMetaRefreshing = false;
|
|
1156
1179
|
});
|
|
1157
1180
|
// src/reducers/view.ts
|
|
1158
1181
|
import { OperationTypeCrud as OperationTypeCrud4 } from "@cxbox-ui/schema";
|
|
@@ -1201,7 +1224,7 @@ var createViewReducerBuilderManager = (initialState) => new ReducerBuilderManage
|
|
|
1201
1224
|
}).addCase(bcNewDataSuccess, (state, action) => {
|
|
1202
1225
|
state.selectedCell = initialViewState.selectedCell;
|
|
1203
1226
|
}).addCase(forceActiveRmUpdate, (state, action) => {
|
|
1204
|
-
var _a, _b, _c, _d;
|
|
1227
|
+
var _a, _b, _c, _d, _e;
|
|
1205
1228
|
const { bcName, bcUrl, currentRecordData, rowMeta, cursor } = action.payload;
|
|
1206
1229
|
const handledForceActive = {};
|
|
1207
1230
|
const rowMetaForcedValues = {};
|
|
@@ -1213,6 +1236,7 @@ var createViewReducerBuilderManager = (initialState) => new ReducerBuilderManage
|
|
|
1213
1236
|
forceActiveFieldKeys.push(field.key);
|
|
1214
1237
|
}
|
|
1215
1238
|
});
|
|
1239
|
+
state.pendingDataChanges[bcName] = (_a = state.pendingDataChanges[bcName]) != null ? _a : {};
|
|
1216
1240
|
const consolidatedFrontData = __spreadValues(__spreadValues({}, currentRecordData), state.pendingDataChanges[bcName][cursor]);
|
|
1217
1241
|
Object.keys(consolidatedFrontData).forEach((key) => {
|
|
1218
1242
|
if (rowMetaForcedValues[key] !== void 0 && consolidatedFrontData[key] !== rowMetaForcedValues[key]) {
|
|
@@ -1225,12 +1249,12 @@ var createViewReducerBuilderManager = (initialState) => new ReducerBuilderManage
|
|
|
1225
1249
|
handledForceActive[key] = newPendingDataChanges[key];
|
|
1226
1250
|
}
|
|
1227
1251
|
});
|
|
1228
|
-
state.handledForceActive[bcName] = (
|
|
1229
|
-
state.handledForceActive[bcName][cursor] = (
|
|
1252
|
+
state.handledForceActive[bcName] = (_b = state.handledForceActive[bcName]) != null ? _b : {};
|
|
1253
|
+
state.handledForceActive[bcName][cursor] = (_c = state.handledForceActive[bcName][cursor]) != null ? _c : {};
|
|
1230
1254
|
Object.assign(state.handledForceActive[bcName][cursor], handledForceActive);
|
|
1231
|
-
state.pendingDataChanges[bcName] = (
|
|
1255
|
+
state.pendingDataChanges[bcName] = (_d = state.pendingDataChanges[bcName]) != null ? _d : {};
|
|
1232
1256
|
state.pendingDataChanges[bcName][cursor] = newPendingDataChanges;
|
|
1233
|
-
state.rowMeta[bcName] = (
|
|
1257
|
+
state.rowMeta[bcName] = (_e = state.rowMeta[bcName]) != null ? _e : {};
|
|
1234
1258
|
state.rowMeta[bcName][bcUrl] = rowMeta;
|
|
1235
1259
|
}).addCase(changeDataItem, (state, action) => {
|
|
1236
1260
|
var _a, _b, _c;
|
|
@@ -1493,9 +1517,9 @@ __export(epics_exports, {
|
|
|
1493
1517
|
userDrillDownEpic: () => userDrillDownEpic
|
|
1494
1518
|
});
|
|
1495
1519
|
// src/epics/view/sendOperationEpic.ts
|
|
1496
|
-
import { catchError, concat, EMPTY, filter, mergeMap, of as
|
|
1520
|
+
import { catchError, concat, EMPTY as EMPTY2, filter, mergeMap, of as of3 } from "rxjs";
|
|
1497
1521
|
// src/epics/utils/postOperationRoutine.ts
|
|
1498
|
-
import { of } from "rxjs";
|
|
1522
|
+
import { of as of2 } from "rxjs";
|
|
1499
1523
|
function postOperationRoutine(widgetName, postInvoke, preInvoke, operationType, bcName) {
|
|
1500
1524
|
const postInvokeConfirm = Object.values(OperationPostInvokeConfirmType).includes(postInvoke == null ? void 0 : postInvoke.type);
|
|
1501
1525
|
const result = [];
|
|
@@ -1518,7 +1542,7 @@ function postOperationRoutine(widgetName, postInvoke, preInvoke, operationType,
|
|
|
1518
1542
|
preInvoke
|
|
1519
1543
|
}));
|
|
1520
1544
|
}
|
|
1521
|
-
return result.map((item) =>
|
|
1545
|
+
return result.map((item) => of2(item));
|
|
1522
1546
|
}
|
|
1523
1547
|
// src/epics/view/sendOperationEpic.ts
|
|
1524
1548
|
var sendOperationEpic = (action$, state$, { api }) => action$.pipe(filter(sendOperation.match), filter((action) => matchOperationRole("none", action.payload, state$.value)), mergeMap((action) => {
|
|
@@ -1554,7 +1578,7 @@ var sendOperationEpic = (action$, state$, { api }) => action$.pipe(filter(sendOp
|
|
|
1554
1578
|
var _a2, _b2;
|
|
1555
1579
|
const postInvoke = (_a2 = response.postActions) == null ? void 0 : _a2[0];
|
|
1556
1580
|
const preInvoke = response.preInvoke;
|
|
1557
|
-
return defaultSaveOperation ? ((_b2 = action == null ? void 0 : action.payload) == null ? void 0 : _b2.onSuccessAction) ? concat(
|
|
1581
|
+
return defaultSaveOperation ? ((_b2 = action == null ? void 0 : action.payload) == null ? void 0 : _b2.onSuccessAction) ? concat(of3(bcCancelPendingChanges({ bcNames: [bcName] })), of3(action.payload.onSuccessAction)) : EMPTY2 : concat(of3(sendOperationSuccess({ bcName, cursor })), of3(bcForceUpdate({ bcName })), ...postOperationRoutine(widgetName, postInvoke, preInvoke, operationType, bcName));
|
|
1558
1582
|
}), catchError((e) => {
|
|
1559
1583
|
var _a2, _b2, _c2, _d2, _e2, _f2;
|
|
1560
1584
|
console.error(e);
|
|
@@ -1565,11 +1589,11 @@ var sendOperationEpic = (action$, state$, { api }) => action$.pipe(filter(sendOp
|
|
|
1565
1589
|
entityError = (_d2 = operationError == null ? void 0 : operationError.error) == null ? void 0 : _d2.entity;
|
|
1566
1590
|
viewError = (_f2 = (_e2 = operationError == null ? void 0 : operationError.error) == null ? void 0 : _e2.popup) == null ? void 0 : _f2[0];
|
|
1567
1591
|
}
|
|
1568
|
-
return
|
|
1592
|
+
return concat(of3(sendOperationFail({ bcName, bcUrl, viewError, entityError })), createApiErrorObservable(e, context));
|
|
1569
1593
|
}));
|
|
1570
1594
|
}));
|
|
1571
1595
|
// src/epics/view/showAssocPopupEpic.ts
|
|
1572
|
-
import { EMPTY as
|
|
1596
|
+
import { EMPTY as EMPTY3, filter as filter2, mergeMap as mergeMap2, of as of4 } from "rxjs";
|
|
1573
1597
|
import { WidgetTypes as WidgetTypes3 } from "@cxbox-ui/schema";
|
|
1574
1598
|
var showAssocPopupEpic = (action$, state$) => action$.pipe(filter2(showViewPopup.match), filter2((action) => !!(action.payload.calleeBCName && action.payload.associateFieldKey)), mergeMap2((action) => {
|
|
1575
1599
|
var _a, _b, _c, _d;
|
|
@@ -1582,7 +1606,7 @@ var showAssocPopupEpic = (action$, state$) => action$.pipe(filter2(showViewPopup
|
|
|
1582
1606
|
const assocFieldChanges = calleePendingChanges == null ? void 0 : calleePendingChanges[assocFieldKey];
|
|
1583
1607
|
const somethingMissing = !assocWidget || !calleePendingChanges || !assocFieldChanges || !assocFieldChanges;
|
|
1584
1608
|
if (somethingMissing || assocWidget.options && !assocWidget.options.hierarchyFull) {
|
|
1585
|
-
return
|
|
1609
|
+
return EMPTY3;
|
|
1586
1610
|
}
|
|
1587
1611
|
const popupInitPendingChanges = {};
|
|
1588
1612
|
assocFieldChanges.forEach((record) => {
|
|
@@ -1605,14 +1629,14 @@ var showAssocPopupEpic = (action$, state$) => action$.pipe(filter2(showViewPopup
|
|
|
1605
1629
|
}
|
|
1606
1630
|
});
|
|
1607
1631
|
}
|
|
1608
|
-
return
|
|
1632
|
+
return of4(changeDataItems({
|
|
1609
1633
|
bcName,
|
|
1610
1634
|
cursors: Object.keys(popupInitPendingChanges),
|
|
1611
1635
|
dataItems: Object.values(popupInitPendingChanges)
|
|
1612
1636
|
}));
|
|
1613
1637
|
}));
|
|
1614
1638
|
// src/epics/view/fileUploadConfirmEpic.ts
|
|
1615
|
-
import { concat as concat2, filter as filter3, mergeMap as mergeMap3, of as
|
|
1639
|
+
import { catchError as catchError2, concat as concat2, filter as filter3, mergeMap as mergeMap3, of as of5 } from "rxjs";
|
|
1616
1640
|
import { OperationTypeCrud as OperationTypeCrud5 } from "@cxbox-ui/schema";
|
|
1617
1641
|
var fileUploadConfirmEpic = (action$, state$, { api }) => action$.pipe(filter3(bulkUploadFiles.match), mergeMap3((action) => {
|
|
1618
1642
|
var _a, _b;
|
|
@@ -1627,11 +1651,14 @@ var fileUploadConfirmEpic = (action$, state$, { api }) => action$.pipe(filter3(b
|
|
|
1627
1651
|
var _a2;
|
|
1628
1652
|
const postInvoke = (_a2 = response.postActions) == null ? void 0 : _a2[0];
|
|
1629
1653
|
const preInvoke = response.preInvoke;
|
|
1630
|
-
return concat2(
|
|
1654
|
+
return concat2(of5(sendOperationSuccess({ bcName, cursor: null })), of5(bcForceUpdate({ bcName })), of5(closeViewPopup(null)), ...postOperationRoutine(widgetName, postInvoke, preInvoke, OperationTypeCrud5.save, bcName));
|
|
1655
|
+
}), catchError2((error) => {
|
|
1656
|
+
console.error(error);
|
|
1657
|
+
return createApiErrorObservable(error);
|
|
1631
1658
|
}));
|
|
1632
1659
|
}));
|
|
1633
1660
|
// src/epics/view/selectTableCellInitEpic.ts
|
|
1634
|
-
import { concat as concat3, filter as filter4, mergeMap as mergeMap4, of as
|
|
1661
|
+
import { concat as concat3, filter as filter4, mergeMap as mergeMap4, of as of6 } from "rxjs";
|
|
1635
1662
|
var selectTableCellInitEpic = (action$, state$) => action$.pipe(filter4(selectTableCellInit.match), mergeMap4((action) => {
|
|
1636
1663
|
var _a;
|
|
1637
1664
|
const resultObservables = [];
|
|
@@ -1642,18 +1669,18 @@ var selectTableCellInitEpic = (action$, state$) => action$.pipe(filter4(selectTa
|
|
|
1642
1669
|
const nextBcCursor = (_a = state.screen.bo.bc[nextBcName]) == null ? void 0 : _a.cursor;
|
|
1643
1670
|
const selectedCell = state.view.selectedCell;
|
|
1644
1671
|
if (nextRowId !== nextBcCursor) {
|
|
1645
|
-
resultObservables.push(
|
|
1672
|
+
resultObservables.push(of6(bcSelectRecord({ bcName: nextBcName, cursor: nextRowId })));
|
|
1646
1673
|
}
|
|
1647
1674
|
if (!selectedCell || fieldKey !== selectedCell.fieldKey || nextRowId !== selectedCell.rowId || (nextWidget == null ? void 0 : nextWidget.name) !== selectedCell.widgetName) {
|
|
1648
|
-
resultObservables.push(
|
|
1675
|
+
resultObservables.push(of6(selectTableCell({ widgetName: nextWidget == null ? void 0 : nextWidget.name, rowId: nextRowId, fieldKey })));
|
|
1649
1676
|
}
|
|
1650
1677
|
return concat3(...resultObservables);
|
|
1651
1678
|
}));
|
|
1652
1679
|
// src/epics/view/showFileUploadPopupEpic.ts
|
|
1653
|
-
import { concat as concat4, filter as filter5, mergeMap as mergeMap5, of as
|
|
1680
|
+
import { concat as concat4, filter as filter5, mergeMap as mergeMap5, of as of7 } from "rxjs";
|
|
1654
1681
|
import { OperationTypeCrud as OperationTypeCrud6 } from "@cxbox-ui/schema";
|
|
1655
1682
|
var showFileUploadPopupEpic = (action$, state$) => action$.pipe(filter5(sendOperation.match), filter5((action) => matchOperationRole(OperationTypeCrud6.fileUpload, action.payload, state$.value)), mergeMap5((action) => {
|
|
1656
|
-
return concat4(
|
|
1683
|
+
return concat4(of7(bcChangeCursors({ cursorsMap: { [action.payload.bcName]: null } })), of7(showFileUploadPopup({ widgetName: action.payload.widgetName })));
|
|
1657
1684
|
}));
|
|
1658
1685
|
// src/epics/view/sendOperationAssociateEpic.ts
|
|
1659
1686
|
import { filter as filter6, map } from "rxjs";
|
|
@@ -1668,11 +1695,11 @@ var sendOperationAssociateEpic = (action$, state$) => action$.pipe(filter6(sendO
|
|
|
1668
1695
|
});
|
|
1669
1696
|
}));
|
|
1670
1697
|
// src/epics/view/getRowMetaByForceActiveEpic.ts
|
|
1671
|
-
import { EMPTY as
|
|
1698
|
+
import { EMPTY as EMPTY4, concat as concat5, filter as filter7, mergeMap as mergeMap6, of as of8, catchError as catchError3 } from "rxjs";
|
|
1672
1699
|
import { WidgetTypes as WidgetTypes4 } from "@cxbox-ui/schema";
|
|
1673
1700
|
import { nanoid } from "@reduxjs/toolkit";
|
|
1674
1701
|
var getRowMetaByForceActiveEpic = (action$, state$, { api }) => action$.pipe(filter7(changeDataItem.match), mergeMap6((action) => {
|
|
1675
|
-
var _a, _b, _c, _d;
|
|
1702
|
+
var _a, _b, _c, _d, _e;
|
|
1676
1703
|
const state = state$.value;
|
|
1677
1704
|
const initUrl = state.view.url;
|
|
1678
1705
|
const { bcName, cursor, disableRetry } = action.payload;
|
|
@@ -1681,19 +1708,19 @@ var getRowMetaByForceActiveEpic = (action$, state$, { api }) => action$.pipe(fil
|
|
|
1681
1708
|
return widget.bcName === bcName && widget.type === WidgetTypes4.AssocListPopup && (((_a2 = widget.options) == null ? void 0 : _a2.hierarchySameBc) || ((_b2 = widget.options) == null ? void 0 : _b2.hierarchyFull));
|
|
1682
1709
|
});
|
|
1683
1710
|
if (isBcHierarchy) {
|
|
1684
|
-
return
|
|
1711
|
+
return EMPTY4;
|
|
1685
1712
|
}
|
|
1686
1713
|
const isPickListPopup = state.view.widgets.find((item) => {
|
|
1687
1714
|
var _a2;
|
|
1688
1715
|
return item.name === ((_a2 = state.view.popupData) == null ? void 0 : _a2.widgetName) && [WidgetTypes4.PickListPopup, WidgetTypes4.FlatTreePopup].includes(item.type);
|
|
1689
1716
|
});
|
|
1690
1717
|
const bcUrl = buildBcUrl(bcName, true, state);
|
|
1691
|
-
const pendingChanges = state.view.pendingDataChanges[bcName][cursor];
|
|
1692
|
-
const handledForceActive = ((
|
|
1693
|
-
const currentRecordData = (
|
|
1694
|
-
const fieldsRowMeta = (
|
|
1718
|
+
const pendingChanges = (_a = state.view.pendingDataChanges[bcName]) == null ? void 0 : _a[cursor];
|
|
1719
|
+
const handledForceActive = ((_b = state.view.handledForceActive[bcName]) == null ? void 0 : _b[cursor]) || {};
|
|
1720
|
+
const currentRecordData = (_c = state.data[bcName]) == null ? void 0 : _c.find((record) => record.id === cursor);
|
|
1721
|
+
const fieldsRowMeta = (_e = (_d = state.view.rowMeta[bcName]) == null ? void 0 : _d[bcUrl]) == null ? void 0 : _e.fields;
|
|
1695
1722
|
let changedFiledKey = null;
|
|
1696
|
-
const closePopup = concat5(
|
|
1723
|
+
const closePopup = concat5(of8(closeViewPopup(null)), of8(viewClearPickMap(null)), of8(bcRemoveAllFilters({ bcName })));
|
|
1697
1724
|
const someForceActiveChanged = fieldsRowMeta == null ? void 0 : fieldsRowMeta.filter((field) => field.forceActive && pendingChanges[field.key] !== void 0).some((field) => {
|
|
1698
1725
|
const result = pendingChanges[field.key] !== handledForceActive[field.key];
|
|
1699
1726
|
if (result) {
|
|
@@ -1703,10 +1730,10 @@ var getRowMetaByForceActiveEpic = (action$, state$, { api }) => action$.pipe(fil
|
|
|
1703
1730
|
});
|
|
1704
1731
|
const requestId = nanoid();
|
|
1705
1732
|
if (someForceActiveChanged && !disableRetry) {
|
|
1706
|
-
return concat5(
|
|
1707
|
-
const result = [
|
|
1733
|
+
return concat5(of8(addPendingRequest({ request: { requestId, type: "force-active" } })), api.getRmByForceActive(state.screen.screenName, bcUrl, __spreadProps(__spreadValues({}, pendingChanges), { vstamp: currentRecordData == null ? void 0 : currentRecordData.vstamp })).pipe(mergeMap6((data) => {
|
|
1734
|
+
const result = [of8(removePendingRequest({ requestId }))];
|
|
1708
1735
|
if (state.view.url === initUrl) {
|
|
1709
|
-
result.push(
|
|
1736
|
+
result.push(of8(forceActiveRmUpdate({
|
|
1710
1737
|
rowMeta: data,
|
|
1711
1738
|
currentRecordData,
|
|
1712
1739
|
bcName,
|
|
@@ -1718,43 +1745,43 @@ var getRowMetaByForceActiveEpic = (action$, state$, { api }) => action$.pipe(fil
|
|
|
1718
1745
|
result.push(closePopup);
|
|
1719
1746
|
}
|
|
1720
1747
|
return concat5(...result);
|
|
1721
|
-
}),
|
|
1722
|
-
var _a2, _b2, _c2, _d2,
|
|
1748
|
+
}), catchError3((e) => {
|
|
1749
|
+
var _a2, _b2, _c2, _d2, _e2, _f;
|
|
1723
1750
|
console.error(e);
|
|
1724
1751
|
let viewError = null;
|
|
1725
1752
|
let entityError = null;
|
|
1726
1753
|
const operationError = (_a2 = e.response) == null ? void 0 : _a2.data;
|
|
1727
1754
|
if (((_b2 = e.response) == null ? void 0 : _b2.data) === Object((_c2 = e.response) == null ? void 0 : _c2.data)) {
|
|
1728
1755
|
entityError = (_d2 = operationError == null ? void 0 : operationError.error) == null ? void 0 : _d2.entity;
|
|
1729
|
-
viewError = (_f = (
|
|
1756
|
+
viewError = (_f = (_e2 = operationError == null ? void 0 : operationError.error) == null ? void 0 : _e2.popup) == null ? void 0 : _f[0];
|
|
1730
1757
|
}
|
|
1731
|
-
return concat5(
|
|
1758
|
+
return concat5(of8(removePendingRequest({ requestId })), state.view.url === initUrl ? concat5(of8(changeDataItem({
|
|
1732
1759
|
bcName,
|
|
1733
1760
|
bcUrl: buildBcUrl(bcName, true, state),
|
|
1734
1761
|
cursor,
|
|
1735
1762
|
dataItem: { [changedFiledKey]: currentRecordData == null ? void 0 : currentRecordData[changedFiledKey] },
|
|
1736
1763
|
disableRetry: true
|
|
1737
|
-
})),
|
|
1764
|
+
})), of8(forceActiveChangeFail({ bcName, bcUrl, viewError, entityError }))) : EMPTY4, createApiErrorObservable(e));
|
|
1738
1765
|
})));
|
|
1739
1766
|
}
|
|
1740
|
-
return isPickListPopup ? closePopup :
|
|
1767
|
+
return isPickListPopup ? closePopup : EMPTY4;
|
|
1741
1768
|
}));
|
|
1742
1769
|
// src/epics/view/showAllTableRecordsInitEpic.ts
|
|
1743
|
-
import { concat as concat6, filter as filter8, mergeMap as mergeMap7, of as
|
|
1770
|
+
import { concat as concat6, filter as filter8, mergeMap as mergeMap7, of as of9 } from "rxjs";
|
|
1744
1771
|
var showAllTableRecordsInitEpic = (action$, state$) => action$.pipe(filter8(showAllTableRecordsInit.match), mergeMap7((action) => {
|
|
1745
1772
|
const resultObservables = [];
|
|
1746
1773
|
const { bcName, cursor } = action.payload;
|
|
1747
1774
|
const state = state$.value;
|
|
1748
1775
|
const route = state.router;
|
|
1749
|
-
resultObservables.push(
|
|
1776
|
+
resultObservables.push(of9(bcChangeCursors({ cursorsMap: { [bcName]: null } })));
|
|
1750
1777
|
const bcPath = route.bcPath.slice(0, route.bcPath.indexOf(`${bcName}/${cursor}`));
|
|
1751
1778
|
const url = defaultBuildURL(__spreadProps(__spreadValues({}, route), { bcPath }));
|
|
1752
|
-
resultObservables.push(
|
|
1753
|
-
resultObservables.push(
|
|
1779
|
+
resultObservables.push(of9(bcForceUpdate({ bcName })));
|
|
1780
|
+
resultObservables.push(of9(changeLocation({ location: defaultParseURL(new URL(url, window.location.origin)) })));
|
|
1754
1781
|
return concat6(...resultObservables);
|
|
1755
1782
|
}));
|
|
1756
1783
|
// src/epics/view/clearPendingDataChangesAfterCursorChangeEpic.ts
|
|
1757
|
-
import { EMPTY as
|
|
1784
|
+
import { EMPTY as EMPTY5, filter as filter9, mergeMap as mergeMap8, of as of10 } from "rxjs";
|
|
1758
1785
|
var clearPendingDataChangesAfterCursorChangeEpic = (action$, state$) => action$.pipe(filter9(bcChangeCursors.match), mergeMap8((action) => {
|
|
1759
1786
|
const state = state$.value;
|
|
1760
1787
|
const nextCursors = parseBcCursors(state.router.bcPath) || {};
|
|
@@ -1767,12 +1794,12 @@ var clearPendingDataChangesAfterCursorChangeEpic = (action$, state$) => action$.
|
|
|
1767
1794
|
}
|
|
1768
1795
|
});
|
|
1769
1796
|
if (Object.keys(cursorsDiffMap).length) {
|
|
1770
|
-
return
|
|
1797
|
+
return of10(bcChangeCursors({ cursorsMap: cursorsDiffMap }));
|
|
1771
1798
|
}
|
|
1772
|
-
return
|
|
1799
|
+
return EMPTY5;
|
|
1773
1800
|
}));
|
|
1774
1801
|
// src/epics/router/drilldownEpic.ts
|
|
1775
|
-
import { concat as concat7, EMPTY as
|
|
1802
|
+
import { concat as concat7, EMPTY as EMPTY6, filter as filter10, switchMap } from "rxjs";
|
|
1776
1803
|
var drillDownEpic = (action$, state$) => action$.pipe(filter10(drillDown.match), switchMap((action) => {
|
|
1777
1804
|
var _a, _b;
|
|
1778
1805
|
const state = state$.value;
|
|
@@ -1847,7 +1874,7 @@ var drillDownEpic = (action$, state$) => action$.pipe(filter10(drillDown.match),
|
|
|
1847
1874
|
result.push(changeLocation({ location: defaultParseURL(new URL(makeRelativeUrl(urlBase), window.location.origin)) }));
|
|
1848
1875
|
break;
|
|
1849
1876
|
}
|
|
1850
|
-
return result.length ? concat7(result) :
|
|
1877
|
+
return result.length ? concat7(result) : EMPTY6;
|
|
1851
1878
|
}));
|
|
1852
1879
|
function shallowCompare(prevProps, nextProps, ignore = []) {
|
|
1853
1880
|
const diffProps = [];
|
|
@@ -1874,18 +1901,18 @@ function shallowCompare(prevProps, nextProps, ignore = []) {
|
|
|
1874
1901
|
return diffProps;
|
|
1875
1902
|
}
|
|
1876
1903
|
// src/epics/router/loginDoneEpic.ts
|
|
1877
|
-
import { filter as filter11, of as
|
|
1904
|
+
import { filter as filter11, of as of11, switchMap as switchMap2 } from "rxjs";
|
|
1878
1905
|
var loginDoneEpic = (action$, state$) => action$.pipe(filter11(loginDone.match), switchMap2((action) => {
|
|
1879
1906
|
const state = state$.value;
|
|
1880
1907
|
if (state.router.type === "router" /* router */) {
|
|
1881
|
-
return
|
|
1908
|
+
return of11(handleRouter(state.router));
|
|
1882
1909
|
}
|
|
1883
1910
|
const nextScreenName = state.router.screenName;
|
|
1884
1911
|
const nextScreen = state.session.screens.find((item) => nextScreenName ? item.name === nextScreenName : item.defaultScreen) || state.session.screens[0];
|
|
1885
|
-
return nextScreen ?
|
|
1912
|
+
return nextScreen ? of11(selectScreen({ screen: nextScreen })) : of11(selectScreenFail({ screenName: nextScreenName }));
|
|
1886
1913
|
}));
|
|
1887
1914
|
// src/epics/router/selectViewEpic.ts
|
|
1888
|
-
import { EMPTY as
|
|
1915
|
+
import { EMPTY as EMPTY7, filter as filter12, of as of12, switchMap as switchMap3 } from "rxjs";
|
|
1889
1916
|
var changeViewEpic = (action$, state$) => action$.pipe(filter12(selectView.match), switchMap3((action) => {
|
|
1890
1917
|
const state = state$.value;
|
|
1891
1918
|
const nextCursors = parseBcCursors(state.router.bcPath) || {};
|
|
@@ -1898,34 +1925,34 @@ var changeViewEpic = (action$, state$) => action$.pipe(filter12(selectView.match
|
|
|
1898
1925
|
}
|
|
1899
1926
|
});
|
|
1900
1927
|
if (Object.keys(cursorsDiffMap).length) {
|
|
1901
|
-
return
|
|
1928
|
+
return of12(bcChangeCursors({ cursorsMap: cursorsDiffMap }));
|
|
1902
1929
|
}
|
|
1903
|
-
return
|
|
1930
|
+
return EMPTY7;
|
|
1904
1931
|
}));
|
|
1905
1932
|
// src/epics/router/handleRouterEpic.ts
|
|
1906
|
-
import { catchError as
|
|
1933
|
+
import { catchError as catchError4, EMPTY as EMPTY8, filter as filter13, mergeMap as mergeMap9, switchMap as switchMap4 } from "rxjs";
|
|
1907
1934
|
var handleRouterEpic = (action$, state$, { api }) => action$.pipe(filter13(handleRouter.match), switchMap4((action) => {
|
|
1908
1935
|
const path = action.payload.path;
|
|
1909
1936
|
const params = action.payload.params;
|
|
1910
1937
|
return api.routerRequest(path, params).pipe(mergeMap9(() => {
|
|
1911
|
-
return
|
|
1912
|
-
}),
|
|
1938
|
+
return EMPTY8;
|
|
1939
|
+
}), catchError4((error) => {
|
|
1913
1940
|
console.error(error);
|
|
1914
|
-
return
|
|
1941
|
+
return createApiErrorObservable(error);
|
|
1915
1942
|
}));
|
|
1916
1943
|
}));
|
|
1917
1944
|
// src/epics/router/selectScreenEpic.ts
|
|
1918
|
-
import { filter as filter14, of as
|
|
1945
|
+
import { filter as filter14, of as of13, switchMap as switchMap5 } from "rxjs";
|
|
1919
1946
|
var changeScreen = (action$, state$) => action$.pipe(filter14(selectScreen.match), switchMap5((action) => {
|
|
1920
1947
|
const state = state$.value;
|
|
1921
1948
|
const nextViewName = state.router.viewName;
|
|
1922
1949
|
const requestedView = state.screen.views.find((item) => item.name === nextViewName);
|
|
1923
1950
|
const defaultView = !nextViewName && state.screen.primaryView && state.screen.views.find((item) => item.name === state.screen.primaryView);
|
|
1924
1951
|
const nextView = requestedView || defaultView || state.screen.views[0];
|
|
1925
|
-
return nextView ?
|
|
1952
|
+
return nextView ? of13(selectView(nextView)) : of13(selectViewFail({ viewName: nextViewName }));
|
|
1926
1953
|
}));
|
|
1927
1954
|
// src/epics/router/userDrillDownEpic.ts
|
|
1928
|
-
import { catchError as
|
|
1955
|
+
import { catchError as catchError5, concat as concat8, EMPTY as EMPTY9, filter as filter15, mergeMap as mergeMap10, of as of14, switchMap as switchMap6 } from "rxjs";
|
|
1929
1956
|
var userDrillDownEpic = (action$, state$, { api }) => action$.pipe(filter15(userDrillDown.match), switchMap6((action) => {
|
|
1930
1957
|
const state = state$.value;
|
|
1931
1958
|
const { bcName, fieldKey, cursor } = action.payload;
|
|
@@ -1936,33 +1963,33 @@ var userDrillDownEpic = (action$, state$, { api }) => action$.pipe(filter15(user
|
|
|
1936
1963
|
const route = state.router;
|
|
1937
1964
|
const drillDownKey = (_b = (_a = state.view.widgets.find((widget) => widget.bcName === bcName)) == null ? void 0 : _a.fields.find((field) => field.key === fieldKey)) == null ? void 0 : _b.drillDownKey;
|
|
1938
1965
|
const customDrillDownUrl = (_d = (_c = state.data[bcName]) == null ? void 0 : _c.find((record) => record.id === cursor)) == null ? void 0 : _d[drillDownKey];
|
|
1939
|
-
return customDrillDownUrl || (drillDownField == null ? void 0 : drillDownField.drillDown) || (drillDownField == null ? void 0 : drillDownField.drillDown) !== route.path ? concat8((drillDownField == null ? void 0 : drillDownField.drillDownType) !== DrillDownType.inner ?
|
|
1966
|
+
return customDrillDownUrl || (drillDownField == null ? void 0 : drillDownField.drillDown) || (drillDownField == null ? void 0 : drillDownField.drillDown) !== route.path ? concat8((drillDownField == null ? void 0 : drillDownField.drillDownType) !== DrillDownType.inner ? of14(bcFetchRowMetaSuccess({ bcName, rowMeta, bcUrl, cursor })) : EMPTY9, of14(userDrillDownSuccess({ bcName, bcUrl, cursor })), of14(drillDown({
|
|
1940
1967
|
url: customDrillDownUrl || drillDownField.drillDown,
|
|
1941
1968
|
drillDownType: drillDownField.drillDownType,
|
|
1942
1969
|
route
|
|
1943
|
-
}))) :
|
|
1944
|
-
}),
|
|
1970
|
+
}))) : EMPTY9;
|
|
1971
|
+
}), catchError5((error) => {
|
|
1945
1972
|
console.error(error);
|
|
1946
|
-
return
|
|
1973
|
+
return createApiErrorObservable(error);
|
|
1947
1974
|
}));
|
|
1948
1975
|
}));
|
|
1949
1976
|
// src/epics/router/changeLocationEpic.ts
|
|
1950
|
-
import { concat as concat9, EMPTY as
|
|
1977
|
+
import { concat as concat9, EMPTY as EMPTY10, filter as filter16, mergeMap as mergeMap11, of as of15 } from "rxjs";
|
|
1951
1978
|
var changeLocationEpic = (action$, state$) => action$.pipe(filter16(changeLocation.match), mergeMap11((action) => {
|
|
1952
1979
|
var _a, _b;
|
|
1953
1980
|
const state = state$.value;
|
|
1954
1981
|
if (!state.session.active) {
|
|
1955
|
-
return
|
|
1982
|
+
return EMPTY10;
|
|
1956
1983
|
}
|
|
1957
1984
|
if (state.router.type === "router" /* router */) {
|
|
1958
|
-
return
|
|
1985
|
+
return of15(handleRouter(state.router));
|
|
1959
1986
|
}
|
|
1960
1987
|
const currentScreenName = state.screen.screenName;
|
|
1961
1988
|
const defaultScreenName = ((_a = state.session.screens.find((screen) => screen.defaultScreen)) == null ? void 0 : _a.name) || ((_b = state.session.screens[0]) == null ? void 0 : _b.name);
|
|
1962
1989
|
const nextScreenName = state.router.type === "default" /* default */ ? defaultScreenName : state.router.screenName;
|
|
1963
1990
|
if (nextScreenName !== currentScreenName) {
|
|
1964
1991
|
const nextScreen = state.session.screens.find((item) => item.name === nextScreenName);
|
|
1965
|
-
return nextScreen ?
|
|
1992
|
+
return nextScreen ? of15(selectScreen({ screen: nextScreen })) : of15(selectScreenFail({ screenName: nextScreenName }));
|
|
1966
1993
|
}
|
|
1967
1994
|
const currentViewName = state.view.name;
|
|
1968
1995
|
const nextViewName = state.router.viewName;
|
|
@@ -1979,17 +2006,17 @@ var changeLocationEpic = (action$, state$) => action$.pipe(filter16(changeLocati
|
|
|
1979
2006
|
const needUpdateViews = nextViewName !== currentViewName;
|
|
1980
2007
|
const resultObservables = [];
|
|
1981
2008
|
if (needUpdateCursors) {
|
|
1982
|
-
resultObservables.push(
|
|
2009
|
+
resultObservables.push(of15(bcChangeCursors({ cursorsMap: cursorsDiffMap })));
|
|
1983
2010
|
}
|
|
1984
2011
|
if (needUpdateViews) {
|
|
1985
2012
|
const nextView = nextViewName ? state.screen.views.find((item) => item.name === nextViewName) : state.screen.primaryView ? state.screen.views.find((item) => item.name === state.screen.primaryView) : state.screen.views[0];
|
|
1986
|
-
resultObservables.push(nextView ?
|
|
2013
|
+
resultObservables.push(nextView ? of15(selectView(nextView)) : of15(selectViewFail({ viewName: nextViewName })));
|
|
1987
2014
|
}
|
|
1988
2015
|
if (needUpdateCursors && !needUpdateViews) {
|
|
1989
2016
|
Object.entries(nextCursors).forEach((entry) => {
|
|
1990
2017
|
const [bcName, cursor] = entry;
|
|
1991
2018
|
if (!state.data[bcName].find((item) => item.id === cursor)) {
|
|
1992
|
-
resultObservables.push(
|
|
2019
|
+
resultObservables.push(of15(bcForceUpdate({ bcName })));
|
|
1993
2020
|
}
|
|
1994
2021
|
});
|
|
1995
2022
|
}
|
|
@@ -2029,27 +2056,27 @@ var userDrillDownChangeCursorsEpic = (action$, state$) => action$.pipe(filter19(
|
|
|
2029
2056
|
}));
|
|
2030
2057
|
// src/epics/screen/apiErrorEpic.ts
|
|
2031
2058
|
import axios from "axios";
|
|
2032
|
-
import { EMPTY as
|
|
2059
|
+
import { EMPTY as EMPTY11, filter as filter20, mergeMap as mergeMap12, of as of16 } from "rxjs";
|
|
2033
2060
|
var apiErrorEpic = (action$) => action$.pipe(filter20(apiError.match), mergeMap12((action) => {
|
|
2034
2061
|
const { error, callContext } = action.payload;
|
|
2035
2062
|
if (error.response) {
|
|
2036
|
-
return
|
|
2063
|
+
return of16(httpError({
|
|
2037
2064
|
statusCode: error.response.status,
|
|
2038
2065
|
error,
|
|
2039
2066
|
callContext
|
|
2040
2067
|
}));
|
|
2041
2068
|
}
|
|
2042
2069
|
else if (!axios.isCancel(error)) {
|
|
2043
|
-
return
|
|
2070
|
+
return of16(showViewError({
|
|
2044
2071
|
error: {
|
|
2045
2072
|
type: 2 /* NetworkError */
|
|
2046
2073
|
}
|
|
2047
2074
|
}));
|
|
2048
2075
|
}
|
|
2049
|
-
return
|
|
2076
|
+
return EMPTY11;
|
|
2050
2077
|
}));
|
|
2051
2078
|
// src/epics/screen/downloadFileEpic.ts
|
|
2052
|
-
import { EMPTY as
|
|
2079
|
+
import { EMPTY as EMPTY12, filter as filter21, mergeMap as mergeMap13, tap } from "rxjs";
|
|
2053
2080
|
var downloadFileEpic = (action$, state$, { api }) => action$.pipe(filter21(downloadFile.match), tap((action) => {
|
|
2054
2081
|
const { fileId } = action.payload;
|
|
2055
2082
|
const anchor = document.createElement("a");
|
|
@@ -2060,7 +2087,7 @@ var downloadFileEpic = (action$, state$, { api }) => action$.pipe(filter21(downl
|
|
|
2060
2087
|
anchor.click();
|
|
2061
2088
|
document.body.removeChild(anchor);
|
|
2062
2089
|
}, 100);
|
|
2063
|
-
}), mergeMap13(() =>
|
|
2090
|
+
}), mergeMap13(() => EMPTY12));
|
|
2064
2091
|
// src/epics/screen/httpError401Epic.ts
|
|
2065
2092
|
import { filter as filter22, map as map5 } from "rxjs";
|
|
2066
2093
|
var httpError401Epic = (action$) => action$.pipe(filter22(httpError.match), filter22((action) => action.payload.statusCode === 401), map5((action) => {
|
|
@@ -2084,24 +2111,24 @@ var httpError409Epic = (action$, state$) => action$.pipe(filter23(httpError.matc
|
|
|
2084
2111
|
});
|
|
2085
2112
|
}));
|
|
2086
2113
|
// src/epics/screen/httpError418Epic.ts
|
|
2087
|
-
import { concat as concat10, EMPTY as
|
|
2114
|
+
import { concat as concat10, EMPTY as EMPTY13, filter as filter24, mergeMap as mergeMap14, of as of17 } from "rxjs";
|
|
2088
2115
|
var httpError418Epic = (action$, state$) => action$.pipe(filter24(httpError.match), filter24((action) => action.payload.statusCode === 418), mergeMap14((action) => {
|
|
2089
2116
|
var _a, _b;
|
|
2090
2117
|
const { error, callContext } = action.payload;
|
|
2091
2118
|
const result = [];
|
|
2092
2119
|
const typedError = (_a = error.response) == null ? void 0 : _a.data;
|
|
2093
2120
|
if (!typedError.error.popup) {
|
|
2094
|
-
return
|
|
2121
|
+
return EMPTY13;
|
|
2095
2122
|
}
|
|
2096
2123
|
const businessError = {
|
|
2097
2124
|
type: 0 /* BusinessError */,
|
|
2098
2125
|
message: typedError.error.popup[0]
|
|
2099
2126
|
};
|
|
2100
|
-
result.push(
|
|
2127
|
+
result.push(of17(showViewError({ error: businessError })));
|
|
2101
2128
|
if ((_b = typedError.error.postActions) == null ? void 0 : _b[0]) {
|
|
2102
2129
|
const widget = state$.value.view.widgets.find((item) => item.name === callContext.widgetName);
|
|
2103
2130
|
const bcName = widget == null ? void 0 : widget.bcName;
|
|
2104
|
-
result.push(
|
|
2131
|
+
result.push(of17(processPostInvoke({
|
|
2105
2132
|
bcName,
|
|
2106
2133
|
postInvoke: typedError.error.postActions[0],
|
|
2107
2134
|
widgetName: widget == null ? void 0 : widget.name
|
|
@@ -2133,7 +2160,7 @@ var httpErrorDefaultEpic = (action$, state$) => action$.pipe(filter26(httpError.
|
|
|
2133
2160
|
return showViewError({ error: businessError });
|
|
2134
2161
|
}));
|
|
2135
2162
|
// src/epics/screen/downloadFileByUrlEpic.ts
|
|
2136
|
-
import { EMPTY as
|
|
2163
|
+
import { EMPTY as EMPTY14, filter as filter27, mergeMap as mergeMap15, tap as tap2 } from "rxjs";
|
|
2137
2164
|
var downloadFileByUrlEpic = (action$, state$) => action$.pipe(filter27(downloadFileByUrl.match), tap2((action) => {
|
|
2138
2165
|
const { url } = action.payload;
|
|
2139
2166
|
const anchor = document.createElement("a");
|
|
@@ -2144,15 +2171,15 @@ var downloadFileByUrlEpic = (action$, state$) => action$.pipe(filter27(downloadF
|
|
|
2144
2171
|
anchor.click();
|
|
2145
2172
|
document.body.removeChild(anchor);
|
|
2146
2173
|
}, 100);
|
|
2147
|
-
}), mergeMap15(() =>
|
|
2174
|
+
}), mergeMap15(() => EMPTY14));
|
|
2148
2175
|
// src/epics/screen/processPostInvokeEpic.ts
|
|
2149
|
-
import { EMPTY as
|
|
2176
|
+
import { EMPTY as EMPTY15, filter as filter28, mergeMap as mergeMap16, of as of18 } from "rxjs";
|
|
2150
2177
|
var processPostInvokeEpic = (action$, state$) => action$.pipe(filter28(processPostInvoke.match), mergeMap16((action) => {
|
|
2151
2178
|
var _a;
|
|
2152
2179
|
const state = state$.value;
|
|
2153
2180
|
switch (action.payload.postInvoke.type) {
|
|
2154
2181
|
case "drillDown" /* drillDown */:
|
|
2155
|
-
return
|
|
2182
|
+
return of18(drillDown(__spreadProps(__spreadValues({}, action.payload.postInvoke), {
|
|
2156
2183
|
route: state.router,
|
|
2157
2184
|
widgetName: action.payload.widgetName
|
|
2158
2185
|
})));
|
|
@@ -2170,7 +2197,7 @@ var processPostInvokeEpic = (action$, state$) => action$.pipe(filter28(processPo
|
|
|
2170
2197
|
widgetName: action.payload.widgetName
|
|
2171
2198
|
}));
|
|
2172
2199
|
}
|
|
2173
|
-
return
|
|
2200
|
+
return of18(...result);
|
|
2174
2201
|
}
|
|
2175
2202
|
case "refreshBC" /* refreshBC */: {
|
|
2176
2203
|
const bo = state.screen.bo;
|
|
@@ -2180,34 +2207,34 @@ var processPostInvokeEpic = (action$, state$) => action$.pipe(filter28(processPo
|
|
|
2180
2207
|
const widgetName = action.payload.widgetName || "";
|
|
2181
2208
|
const infiniteWidgets = state.view.infiniteWidgets || [];
|
|
2182
2209
|
const infinitePagination = state.view.widgets.some((item) => item.bcName === postInvokeBC && infiniteWidgets.includes(item.name));
|
|
2183
|
-
return infinitePagination ?
|
|
2210
|
+
return infinitePagination ? of18(bcFetchDataPages({
|
|
2184
2211
|
bcName: postInvokeBCItem.name,
|
|
2185
2212
|
widgetName,
|
|
2186
2213
|
from: 1,
|
|
2187
2214
|
to: postInvokeBCItem.page
|
|
2188
|
-
})) :
|
|
2215
|
+
})) : of18(bcFetchDataRequest({
|
|
2189
2216
|
bcName: postInvokeBCItem.name,
|
|
2190
2217
|
widgetName
|
|
2191
2218
|
}));
|
|
2192
2219
|
}
|
|
2193
2220
|
case "showMessage" /* showMessage */: {
|
|
2194
2221
|
const postInvoke = action.payload.postInvoke;
|
|
2195
|
-
return
|
|
2222
|
+
return of18(showNotification({ type: postInvoke.messageType, message: postInvoke.messageText }));
|
|
2196
2223
|
}
|
|
2197
2224
|
case "downloadFile" /* downloadFile */: {
|
|
2198
2225
|
const postInvoke = action.payload.postInvoke;
|
|
2199
|
-
return
|
|
2226
|
+
return of18(downloadFile({ fileId: postInvoke.fileId }));
|
|
2200
2227
|
}
|
|
2201
2228
|
case "downloadFileByUrl" /* downloadFileByUrl */: {
|
|
2202
2229
|
const postInvoke = action.payload.postInvoke;
|
|
2203
|
-
return
|
|
2230
|
+
return of18(downloadFileByUrl({ url: postInvoke.url }));
|
|
2204
2231
|
}
|
|
2205
2232
|
default:
|
|
2206
|
-
return
|
|
2233
|
+
return EMPTY15;
|
|
2207
2234
|
}
|
|
2208
2235
|
}));
|
|
2209
2236
|
// src/epics/screen/processPostInvokeConfirmEpic.ts
|
|
2210
|
-
import { EMPTY as
|
|
2237
|
+
import { EMPTY as EMPTY16, filter as filter29, mergeMap as mergeMap17, of as of19 } from "rxjs";
|
|
2211
2238
|
import { isAnyOf } from "@reduxjs/toolkit";
|
|
2212
2239
|
var processPostInvokeConfirmEpic = (action$, state$) => action$.pipe(filter29(isAnyOf(processPostInvokeConfirm, processPreInvoke)), mergeMap17((action) => {
|
|
2213
2240
|
const { bcName, operationType, widgetName } = action.payload;
|
|
@@ -2217,7 +2244,7 @@ var processPostInvokeConfirmEpic = (action$, state$) => action$.pipe(filter29(is
|
|
|
2217
2244
|
case "info" /* info */:
|
|
2218
2245
|
case "error" /* error */:
|
|
2219
2246
|
case "confirmText" /* confirmText */: {
|
|
2220
|
-
return
|
|
2247
|
+
return of19(operationConfirmation({
|
|
2221
2248
|
operation: {
|
|
2222
2249
|
bcName,
|
|
2223
2250
|
operationType,
|
|
@@ -2227,7 +2254,7 @@ var processPostInvokeConfirmEpic = (action$, state$) => action$.pipe(filter29(is
|
|
|
2227
2254
|
}));
|
|
2228
2255
|
}
|
|
2229
2256
|
default:
|
|
2230
|
-
return
|
|
2257
|
+
return EMPTY16;
|
|
2231
2258
|
}
|
|
2232
2259
|
}));
|
|
2233
2260
|
// src/epics/session/switchRoleEpic.ts
|
|
@@ -2236,7 +2263,7 @@ var switchRoleEpic = (action$, state$) => action$.pipe(filter30(switchRole.match
|
|
|
2236
2263
|
return concat11([logoutDone(null), login({ login: "", password: "", role: action.payload.role })]);
|
|
2237
2264
|
}));
|
|
2238
2265
|
// src/epics/session/refreshMetaEpic.ts
|
|
2239
|
-
import { catchError as
|
|
2266
|
+
import { catchError as catchError6, concat as concat12, filter as filter31, mergeMap as mergeMap18, switchMap as switchMap8 } from "rxjs";
|
|
2240
2267
|
var refreshMetaEpic = (action$, state$, { api }) => action$.pipe(filter31(refreshMeta.match), mergeMap18(() => {
|
|
2241
2268
|
const state = state$.value;
|
|
2242
2269
|
const { router } = state;
|
|
@@ -2248,13 +2275,13 @@ var refreshMetaEpic = (action$, state$, { api }) => action$.pipe(filter31(refres
|
|
|
2248
2275
|
changeLocation({
|
|
2249
2276
|
location: router
|
|
2250
2277
|
})
|
|
2251
|
-
])),
|
|
2278
|
+
])), catchError6((error) => concat12([loginFail(error), refreshMetaFail(), createApiError(error)])));
|
|
2252
2279
|
}));
|
|
2253
2280
|
// src/epics/session/loginDoneEpic.ts
|
|
2254
|
-
import { EMPTY as
|
|
2255
|
-
var loginDoneSessionEpic = (action$, store) => action$.pipe(filter32(login.match), switchMap9((action) =>
|
|
2281
|
+
import { EMPTY as EMPTY17, filter as filter32, switchMap as switchMap9 } from "rxjs";
|
|
2282
|
+
var loginDoneSessionEpic = (action$, store) => action$.pipe(filter32(login.match), switchMap9((action) => EMPTY17));
|
|
2256
2283
|
// src/epics/session/loginByAnotherRoleEpic.ts
|
|
2257
|
-
import { catchError as
|
|
2284
|
+
import { catchError as catchError7, concat as concat13, filter as filter33, mergeMap as mergeMap19, of as of20, switchMap as switchMap10 } from "rxjs";
|
|
2258
2285
|
var responseStatusMessages = {
|
|
2259
2286
|
401: "Invalid credentials",
|
|
2260
2287
|
403: "Access denied"
|
|
@@ -2288,17 +2315,17 @@ var loginByAnotherRoleEpic = (action$, state$, { api }) => action$.pipe(filter33
|
|
|
2288
2315
|
login: data.login
|
|
2289
2316
|
})
|
|
2290
2317
|
]);
|
|
2291
|
-
}),
|
|
2318
|
+
}), catchError7((error) => {
|
|
2292
2319
|
console.error(error);
|
|
2293
2320
|
const errorMsg = error.response ? responseStatusMessages[error.response.status] || "Server application unavailable" : "Empty server response";
|
|
2294
|
-
return
|
|
2321
|
+
return concat13(of20(loginFail({ errorMsg })), createApiErrorObservable(error));
|
|
2295
2322
|
}));
|
|
2296
2323
|
}));
|
|
2297
2324
|
// src/epics/session/refreshMetaAndReloadPageEpic.ts
|
|
2298
|
-
import { concat as concat14, EMPTY as
|
|
2299
|
-
var refreshMetaAndReloadPageEpic = (action$, state$) => action$.pipe(filter34(refreshMetaAndReloadPage.match), switchMap11(() => concat14(
|
|
2325
|
+
import { concat as concat14, EMPTY as EMPTY18, filter as filter34, of as of21, switchMap as switchMap11, take, tap as tap3 } from "rxjs";
|
|
2326
|
+
var refreshMetaAndReloadPageEpic = (action$, state$) => action$.pipe(filter34(refreshMetaAndReloadPage.match), switchMap11(() => concat14(of21(refreshMeta()), action$.pipe(filter34(loginDone.match), take(1), tap3(() => location.reload()), switchMap11(() => EMPTY18)))));
|
|
2300
2327
|
// src/epics/data/bcNewDataEpic.ts
|
|
2301
|
-
import { catchError as
|
|
2328
|
+
import { catchError as catchError8, concat as concat15, EMPTY as EMPTY19, filter as filter35, mergeMap as mergeMap20, of as of22 } from "rxjs";
|
|
2302
2329
|
import { OperationTypeCrud as OperationTypeCrud8 } from "@cxbox-ui/schema";
|
|
2303
2330
|
var bcNewDataEpic = (action$, state$, { api }) => action$.pipe(filter35(sendOperation.match), filter35((action) => matchOperationRole(OperationTypeCrud8.create, action.payload, state$.value)), mergeMap20((action) => {
|
|
2304
2331
|
var _a;
|
|
@@ -2316,23 +2343,23 @@ var bcNewDataEpic = (action$, state$, { api }) => action$.pipe(filter35(sendOper
|
|
|
2316
2343
|
});
|
|
2317
2344
|
const postInvoke = (_a2 = data.postActions) == null ? void 0 : _a2[0];
|
|
2318
2345
|
const cursor = dataItem.id;
|
|
2319
|
-
return concat15(
|
|
2346
|
+
return concat15(of22(bcNewDataSuccess({ bcName, dataItem, bcUrl })), of22(bcFetchRowMetaSuccess({ bcName, bcUrl: `${bcUrl}/${cursor}`, rowMeta, cursor })), of22(changeDataItem({
|
|
2320
2347
|
bcName,
|
|
2321
2348
|
bcUrl: (_b = buildBcUrl(bcName, true, state)) != null ? _b : "",
|
|
2322
2349
|
cursor,
|
|
2323
2350
|
dataItem: {
|
|
2324
2351
|
id: cursor
|
|
2325
2352
|
}
|
|
2326
|
-
})), postInvoke ?
|
|
2327
|
-
}),
|
|
2353
|
+
})), postInvoke ? of22(processPostInvoke({ bcName, postInvoke, cursor, widgetName: action.payload.widgetName })) : EMPTY19);
|
|
2354
|
+
}), catchError8((error) => {
|
|
2328
2355
|
console.error(error);
|
|
2329
|
-
return
|
|
2356
|
+
return concat15(of22(bcNewDataFail({ bcName })), createApiErrorObservable(error, context));
|
|
2330
2357
|
}));
|
|
2331
2358
|
}));
|
|
2332
2359
|
// src/epics/data/bcLoadMoreEpic.ts
|
|
2333
|
-
import { catchError as
|
|
2360
|
+
import { catchError as catchError9, concat as concat16, filter as filter37, mergeMap as mergeMap22, of as of24, race } from "rxjs";
|
|
2334
2361
|
// src/utils/cancelRequestEpic.ts
|
|
2335
|
-
import { filter as filter36, mergeMap as mergeMap21, of as
|
|
2362
|
+
import { filter as filter36, mergeMap as mergeMap21, of as of23, take as take2 } from "rxjs";
|
|
2336
2363
|
import { isAnyOf as isAnyOf2 } from "@reduxjs/toolkit";
|
|
2337
2364
|
var cancelRequestActionTypes = [selectView, logout];
|
|
2338
2365
|
function cancelRequestEpic(action$, actionTypes, cancelFn, cancelActionCreator, filterFn = (item) => {
|
|
@@ -2340,7 +2367,7 @@ function cancelRequestEpic(action$, actionTypes, cancelFn, cancelActionCreator,
|
|
|
2340
2367
|
}) {
|
|
2341
2368
|
return action$.pipe(filter36(isAnyOf2(...actionTypes)), filter36(filterFn), mergeMap21(() => {
|
|
2342
2369
|
cancelFn == null ? void 0 : cancelFn();
|
|
2343
|
-
return
|
|
2370
|
+
return of23(cancelActionCreator);
|
|
2344
2371
|
}), take2(1));
|
|
2345
2372
|
}
|
|
2346
2373
|
// src/epics/data/bcLoadMoreEpic.ts
|
|
@@ -2365,20 +2392,20 @@ var bcLoadMoreEpic = (action$, state$, { api }) => action$.pipe(filter37(bcLoadM
|
|
|
2365
2392
|
var _a2;
|
|
2366
2393
|
const oldBcDataIds = (_a2 = state.data[bcName]) == null ? void 0 : _a2.map((i) => i.id);
|
|
2367
2394
|
const newData = [...state.data[bcName], ...data.data.filter((i) => !oldBcDataIds.includes(i.id))];
|
|
2368
|
-
return
|
|
2395
|
+
return of24(bcFetchDataSuccess({
|
|
2369
2396
|
bcName,
|
|
2370
2397
|
data: newData,
|
|
2371
2398
|
bcUrl,
|
|
2372
2399
|
hasNext: data.hasNext
|
|
2373
2400
|
}));
|
|
2374
|
-
}),
|
|
2401
|
+
}), catchError9((error) => {
|
|
2375
2402
|
console.error(error);
|
|
2376
|
-
return
|
|
2403
|
+
return concat16(of24(bcFetchDataFail({ bcName, bcUrl })), createApiErrorObservable(error));
|
|
2377
2404
|
}));
|
|
2378
2405
|
return race(cancelFlow, normalFlow);
|
|
2379
2406
|
}));
|
|
2380
2407
|
// src/epics/data/bcSaveDataEpic.ts
|
|
2381
|
-
import { catchError as
|
|
2408
|
+
import { catchError as catchError10, concat as concat17, EMPTY as EMPTY20, filter as filter38, mergeMap as mergeMap23, of as of25 } from "rxjs";
|
|
2382
2409
|
var bcSaveDataEpic = (action$, state$, { api }) => action$.pipe(filter38(sendOperation.match), filter38((action) => matchOperationRole(OperationTypeCrud.save, action.payload, state$.value)), mergeMap23((action) => {
|
|
2383
2410
|
var _a, _b, _c, _d;
|
|
2384
2411
|
const state = state$.value;
|
|
@@ -2407,18 +2434,18 @@ var bcSaveDataEpic = (action$, state$, { api }) => action$.pipe(filter38(sendOpe
|
|
|
2407
2434
|
var _a2;
|
|
2408
2435
|
const postInvoke = (_a2 = data.postActions) == null ? void 0 : _a2[0];
|
|
2409
2436
|
const responseDataItem = data.record;
|
|
2410
|
-
return
|
|
2437
|
+
return concat17(of25(bcSaveDataSuccess({ bcName, cursor, dataItem: responseDataItem })), of25(bcFetchRowMeta({ widgetName, bcName })), of25(...fetchChildrenBcData), postInvoke ? of25(processPostInvoke({
|
|
2411
2438
|
bcName,
|
|
2412
2439
|
widgetName,
|
|
2413
2440
|
postInvoke,
|
|
2414
2441
|
cursor: responseDataItem.id
|
|
2415
|
-
})) :
|
|
2416
|
-
}),
|
|
2442
|
+
})) : EMPTY20, action.payload.onSuccessAction ? of25(action.payload.onSuccessAction) : EMPTY20);
|
|
2443
|
+
}), catchError10((e) => {
|
|
2417
2444
|
var _a2, _b2, _c2, _d2, _e, _f, _g, _h;
|
|
2418
2445
|
console.error(e);
|
|
2419
|
-
let notification$ =
|
|
2446
|
+
let notification$ = EMPTY20;
|
|
2420
2447
|
if (action.payload.onSuccessAction && !(options == null ? void 0 : options.disableNotification)) {
|
|
2421
|
-
notification$ =
|
|
2448
|
+
notification$ = of25(addNotification({
|
|
2422
2449
|
key: "data_autosave_undo",
|
|
2423
2450
|
type: "buttonWarningNotification",
|
|
2424
2451
|
message: "There are pending changes. Please save them or cancel.",
|
|
@@ -2438,11 +2465,11 @@ var bcSaveDataEpic = (action$, state$, { api }) => action$.pipe(filter38(sendOpe
|
|
|
2438
2465
|
entityError = (_e = (_d2 = operationError == null ? void 0 : operationError.error) == null ? void 0 : _d2.entity) != null ? _e : entityError;
|
|
2439
2466
|
viewError = (_h = (_g = (_f = operationError == null ? void 0 : operationError.error) == null ? void 0 : _f.popup) == null ? void 0 : _g[0]) != null ? _h : viewError;
|
|
2440
2467
|
}
|
|
2441
|
-
return
|
|
2468
|
+
return concat17(of25(bcSaveDataFail({ bcName, bcUrl, viewError, entityError })), notification$, createApiErrorObservable(e, context));
|
|
2442
2469
|
}));
|
|
2443
2470
|
}));
|
|
2444
2471
|
// src/epics/data/selectViewEpic.ts
|
|
2445
|
-
import { EMPTY as
|
|
2472
|
+
import { EMPTY as EMPTY21, filter as filter39, mergeMap as mergeMap24 } from "rxjs";
|
|
2446
2473
|
var selectViewEpic = (action$, state$) => action$.pipe(filter39(selectView.match), mergeMap24((action) => {
|
|
2447
2474
|
try {
|
|
2448
2475
|
const state = state$.value;
|
|
@@ -2467,11 +2494,11 @@ var selectViewEpic = (action$, state$) => action$.pipe(filter39(selectView.match
|
|
|
2467
2494
|
}
|
|
2468
2495
|
catch (e) {
|
|
2469
2496
|
console.error(`selectView Epic:: ${e}`);
|
|
2470
|
-
return
|
|
2497
|
+
return EMPTY21;
|
|
2471
2498
|
}
|
|
2472
2499
|
}));
|
|
2473
2500
|
// src/epics/data/bcFetchDataEpic.ts
|
|
2474
|
-
import { catchError as
|
|
2501
|
+
import { catchError as catchError11, concat as concat18, EMPTY as EMPTY22, filter as filter40, mergeMap as mergeMap25, of as of26, race as race2 } from "rxjs";
|
|
2475
2502
|
import { WidgetTypes as WidgetTypes5 } from "@cxbox-ui/schema";
|
|
2476
2503
|
import { isAnyOf as isAnyOf3 } from "@reduxjs/toolkit";
|
|
2477
2504
|
var bcFetchDataEpic = (action$, state$, { api }) => action$.pipe(filter40(isAnyOf3(bcFetchDataRequest, bcFetchDataPages, showViewPopup, bcForceUpdate, bcChangePage)), mergeMap25((action) => {
|
|
@@ -2480,7 +2507,7 @@ var bcFetchDataEpic = (action$, state$, { api }) => action$.pipe(filter40(isAnyO
|
|
|
2480
2507
|
const { bcName } = action.payload;
|
|
2481
2508
|
const keepDelta = bcFetchDataRequest.match(action) ? action.payload.keepDelta : void 0;
|
|
2482
2509
|
const newCursor = (_a = data[0]) == null ? void 0 : _a.id;
|
|
2483
|
-
return
|
|
2510
|
+
return of26(bcChangeCursors({
|
|
2484
2511
|
cursorsMap: {
|
|
2485
2512
|
[bcName]: data.some((i) => i.id === prevCursor) ? prevCursor : newCursor
|
|
2486
2513
|
},
|
|
@@ -2490,7 +2517,7 @@ var bcFetchDataEpic = (action$, state$, { api }) => action$.pipe(filter40(isAnyO
|
|
|
2490
2517
|
const getChildrenData = (widgets, bcDictionary, isHierarchy, showConditionCheck) => {
|
|
2491
2518
|
const { bcName } = action.payload;
|
|
2492
2519
|
const { ignorePageLimit, keepDelta } = bcFetchDataRequest.match(action) ? action.payload : { ignorePageLimit: void 0, keepDelta: void 0 };
|
|
2493
|
-
return
|
|
2520
|
+
return concat18(...Object.entries(getBcChildren(bcName, widgets, bcDictionary)).filter(([childBcName, widgetNames]) => {
|
|
2494
2521
|
const nonLazyWidget = widgets.find((item) => {
|
|
2495
2522
|
return widgetNames.includes(item.name) && !PopupWidgetTypes.includes(item.type) && showConditionCheck(item);
|
|
2496
2523
|
});
|
|
@@ -2503,7 +2530,7 @@ var bcFetchDataEpic = (action$, state$, { api }) => action$.pipe(filter40(isAnyO
|
|
|
2503
2530
|
const nonLazyWidget = widgets.find((item) => {
|
|
2504
2531
|
return widgetNames.includes(item.name) && !PopupWidgetTypes.includes(item.type) && showConditionCheck(item);
|
|
2505
2532
|
});
|
|
2506
|
-
return
|
|
2533
|
+
return of26(bcFetchDataRequest({
|
|
2507
2534
|
bcName: childBcName,
|
|
2508
2535
|
widgetName: nonLazyWidget == null ? void 0 : nonLazyWidget.name,
|
|
2509
2536
|
ignorePageLimit: ignorePageLimit || showViewPopup.match(action),
|
|
@@ -2518,7 +2545,7 @@ var bcFetchDataEpic = (action$, state$, { api }) => action$.pipe(filter40(isAnyO
|
|
|
2518
2545
|
const { widgets, infiniteWidgets } = state.view;
|
|
2519
2546
|
const widget = (_a = widgets == null ? void 0 : widgets.find((item) => item.name === widgetName)) != null ? _a : widgets == null ? void 0 : widgets.find((item) => item.bcName === action.payload.bcName);
|
|
2520
2547
|
if (!widget) {
|
|
2521
|
-
return [
|
|
2548
|
+
return [EMPTY22];
|
|
2522
2549
|
}
|
|
2523
2550
|
const bcName = action.payload.bcName;
|
|
2524
2551
|
const bc = state.screen.bo.bc[bcName];
|
|
@@ -2526,7 +2553,7 @@ var bcFetchDataEpic = (action$, state$, { api }) => action$.pipe(filter40(isAnyO
|
|
|
2526
2553
|
const limit = (_c = ((_b = widgets == null ? void 0 : widgets.find((i) => i.bcName === bcName)) == null ? void 0 : _b.limit) || bc.limit) != null ? _c : 5;
|
|
2527
2554
|
const sorters = state.screen.sorters[bcName];
|
|
2528
2555
|
if (showViewPopup.match(action) && bcName === action.payload.calleeBCName) {
|
|
2529
|
-
return [
|
|
2556
|
+
return [EMPTY22];
|
|
2530
2557
|
}
|
|
2531
2558
|
const anyHierarchyWidget = widgets == null ? void 0 : widgets.find((item) => {
|
|
2532
2559
|
return item.bcName === widget.bcName && item.type === WidgetTypes5.AssocListPopup && isHierarchyWidget(item);
|
|
@@ -2587,19 +2614,19 @@ var bcFetchDataEpic = (action$, state$, { api }) => action$.pipe(filter40(isAnyO
|
|
|
2587
2614
|
const lazyWidget = (!isWidgetVisible(widget) || PopupWidgetTypes.includes(widget.type)) && !parentOfNotLazyWidget;
|
|
2588
2615
|
const skipLazy = ((_a2 = state.view.popupData) == null ? void 0 : _a2.bcName) !== widget.bcName;
|
|
2589
2616
|
if (lazyWidget && skipLazy) {
|
|
2590
|
-
return
|
|
2617
|
+
return EMPTY22;
|
|
2591
2618
|
}
|
|
2592
|
-
const fetchChildren = ((_b2 = response.data) == null ? void 0 : _b2.length) ? getChildrenData(widgets, state.screen.bo.bc, !!anyHierarchyWidget, isWidgetVisible) :
|
|
2593
|
-
const fetchRowMeta =
|
|
2594
|
-
return
|
|
2619
|
+
const fetchChildren = ((_b2 = response.data) == null ? void 0 : _b2.length) ? getChildrenData(widgets, state.screen.bo.bc, !!anyHierarchyWidget, isWidgetVisible) : EMPTY22;
|
|
2620
|
+
const fetchRowMeta = of26(bcFetchRowMeta({ widgetName, bcName }));
|
|
2621
|
+
return concat18(cursorChange, of26(bcFetchDataSuccess({
|
|
2595
2622
|
bcName,
|
|
2596
2623
|
data: response.data,
|
|
2597
2624
|
bcUrl,
|
|
2598
2625
|
hasNext: response.hasNext
|
|
2599
2626
|
})), fetchRowMeta, fetchChildren);
|
|
2600
|
-
}),
|
|
2627
|
+
}), catchError11((error) => {
|
|
2601
2628
|
console.error(error);
|
|
2602
|
-
return
|
|
2629
|
+
return concat18(of26(bcFetchDataFail({ bcName: action.payload.bcName, bcUrl })), createApiErrorObservable(error));
|
|
2603
2630
|
}));
|
|
2604
2631
|
return [cancelFlow, cancelByParentBc, normalFlow];
|
|
2605
2632
|
};
|
|
@@ -2610,7 +2637,7 @@ function isHierarchyWidget(widget) {
|
|
|
2610
2637
|
return ((_a = widget.options) == null ? void 0 : _a.hierarchy) || ((_b = widget.options) == null ? void 0 : _b.hierarchyFull);
|
|
2611
2638
|
}
|
|
2612
2639
|
// src/epics/data/bcDeleteDataEpic.ts
|
|
2613
|
-
import { catchError as
|
|
2640
|
+
import { catchError as catchError12, concat as concat19, EMPTY as EMPTY23, filter as filter41, mergeMap as mergeMap26, of as of27 } from "rxjs";
|
|
2614
2641
|
import { OperationTypeCrud as OperationTypeCrud9 } from "@cxbox-ui/schema";
|
|
2615
2642
|
var bcDeleteDataEpic = (action$, store$, { api }) => action$.pipe(filter41(sendOperation.match), filter41((action) => matchOperationRole(OperationTypeCrud9.delete, action.payload, store$.value)), mergeMap26((action) => {
|
|
2616
2643
|
const widgetName = action.payload.widgetName;
|
|
@@ -2623,14 +2650,14 @@ var bcDeleteDataEpic = (action$, store$, { api }) => action$.pipe(filter41(sendO
|
|
|
2623
2650
|
return api.deleteBcData(state.screen.screenName, bcUrl, context).pipe(mergeMap26((data) => {
|
|
2624
2651
|
var _a;
|
|
2625
2652
|
const postInvoke = (_a = data.postActions) == null ? void 0 : _a[0];
|
|
2626
|
-
return
|
|
2627
|
-
}),
|
|
2653
|
+
return concat19(isTargetFormatPVF ? of27(bcCancelPendingChanges({ bcNames: [bcName] })) : EMPTY23, of27(bcFetchDataRequest({ bcName, widgetName })), postInvoke ? of27(processPostInvoke({ bcName, postInvoke, cursor, widgetName })) : EMPTY23);
|
|
2654
|
+
}), catchError12((error) => {
|
|
2628
2655
|
console.error(error);
|
|
2629
|
-
return
|
|
2656
|
+
return concat19(of27(bcDeleteDataFail({ bcName })), createApiErrorObservable(error, context));
|
|
2630
2657
|
}));
|
|
2631
2658
|
}));
|
|
2632
2659
|
// src/epics/data/bcSelectRecordEpic.ts
|
|
2633
|
-
import { concat as
|
|
2660
|
+
import { concat as concat20, filter as filter42, mergeMap as mergeMap27, of as of28 } from "rxjs";
|
|
2634
2661
|
var bcSelectRecordEpic = (action$, store$) => action$.pipe(filter42(bcSelectRecord.match), mergeMap27((action) => {
|
|
2635
2662
|
const { bcName, cursor } = action.payload;
|
|
2636
2663
|
const widgets = store$.value.view.widgets;
|
|
@@ -2644,17 +2671,17 @@ var bcSelectRecordEpic = (action$, store$) => action$.pipe(filter42(bcSelectReco
|
|
|
2644
2671
|
keepDelta: action.payload.keepDelta
|
|
2645
2672
|
});
|
|
2646
2673
|
});
|
|
2647
|
-
return
|
|
2674
|
+
return concat20(of28(bcChangeCursors({ cursorsMap: { [bcName]: cursor }, keepDelta: action.payload.keepDelta })), of28(bcFetchRowMeta({ widgetName: "", bcName })), fetchChildrenBcData);
|
|
2648
2675
|
}));
|
|
2649
2676
|
// src/epics/data/changeAssociationEpic.ts
|
|
2650
|
-
import { concat as
|
|
2677
|
+
import { concat as concat21, filter as filter43, mergeMap as mergeMap28, of as of29 } from "rxjs";
|
|
2651
2678
|
var changeAssociationEpic = (action$, state$) => action$.pipe(filter43(changeAssociation.match), mergeMap28((action) => {
|
|
2652
2679
|
var _a, _b, _c, _d, _e;
|
|
2653
2680
|
const state = state$.value;
|
|
2654
2681
|
const selected = action.payload.dataItem._associate;
|
|
2655
2682
|
const bcName = action.payload.bcName;
|
|
2656
2683
|
const result = [
|
|
2657
|
-
|
|
2684
|
+
of29(changeDataItem({
|
|
2658
2685
|
bcName,
|
|
2659
2686
|
bcUrl: buildBcUrl(bcName, true, state),
|
|
2660
2687
|
cursor: action.payload.dataItem.id,
|
|
@@ -2674,7 +2701,7 @@ var changeAssociationEpic = (action$, state$) => action$.pipe(filter43(changeAss
|
|
|
2674
2701
|
const hierarchyTraverse = (_d = widget.options) == null ? void 0 : _d.hierarchyTraverse;
|
|
2675
2702
|
const childrenBc = hierarchy == null ? void 0 : hierarchy.slice(hierarchy.findIndex((item) => item.bcName === action.payload.bcName) + 1).map((item) => item.bcName);
|
|
2676
2703
|
if (hierarchyGroupSelection && hierarchyDescriptor.radio && !selected) {
|
|
2677
|
-
result.push(
|
|
2704
|
+
result.push(of29(dropAllAssociations({
|
|
2678
2705
|
bcNames: childrenBc
|
|
2679
2706
|
})));
|
|
2680
2707
|
}
|
|
@@ -2685,11 +2712,11 @@ var changeAssociationEpic = (action$, state$) => action$.pipe(filter43(changeAss
|
|
|
2685
2712
|
const parentItem = (_e = state.data[parent == null ? void 0 : parent.bcName]) == null ? void 0 : _e.find((item) => item.id === state.screen.bo.bc[parent == null ? void 0 : parent.bcName].cursor);
|
|
2686
2713
|
if (parent && hierarchyTraverse && selected) {
|
|
2687
2714
|
if (hierarchyDescriptor.radio) {
|
|
2688
|
-
result.push(
|
|
2715
|
+
result.push(of29(dropAllAssociations({
|
|
2689
2716
|
bcNames: [parent.bcName]
|
|
2690
2717
|
})));
|
|
2691
2718
|
}
|
|
2692
|
-
result.push(
|
|
2719
|
+
result.push(of29(changeAssociation({
|
|
2693
2720
|
bcName: parent.bcName,
|
|
2694
2721
|
widgetName: action.payload.widgetName,
|
|
2695
2722
|
dataItem: __spreadProps(__spreadValues({}, parentItem), {
|
|
@@ -2709,7 +2736,7 @@ var changeAssociationEpic = (action$, state$) => action$.pipe(filter43(changeAss
|
|
|
2709
2736
|
data.find((dataValue) => dataValue.id === deltaValue.id);
|
|
2710
2737
|
});
|
|
2711
2738
|
if (wasLastInData && wasLastInDelta) {
|
|
2712
|
-
result.push(
|
|
2739
|
+
result.push(of29(changeAssociation({
|
|
2713
2740
|
bcName: parent.bcName,
|
|
2714
2741
|
widgetName: action.payload.widgetName,
|
|
2715
2742
|
dataItem: __spreadProps(__spreadValues({}, parentItem), { _associate: false }),
|
|
@@ -2717,10 +2744,10 @@ var changeAssociationEpic = (action$, state$) => action$.pipe(filter43(changeAss
|
|
|
2717
2744
|
})));
|
|
2718
2745
|
}
|
|
2719
2746
|
}
|
|
2720
|
-
return
|
|
2747
|
+
return concat21(...result);
|
|
2721
2748
|
}));
|
|
2722
2749
|
// src/epics/data/bcCancelCreateDataEpic.ts
|
|
2723
|
-
import { catchError as
|
|
2750
|
+
import { catchError as catchError13, concat as concat22, EMPTY as EMPTY24, filter as filter44, mergeMap as mergeMap29, of as of30 } from "rxjs";
|
|
2724
2751
|
import { OperationTypeCrud as OperationTypeCrud10 } from "@cxbox-ui/schema";
|
|
2725
2752
|
import { isAnyOf as isAnyOf4 } from "@reduxjs/toolkit";
|
|
2726
2753
|
var actionTypesMatcher = isAnyOf4(sendOperation);
|
|
@@ -2741,17 +2768,17 @@ var bcCancelCreateDataEpic = (action$, state$, { api }) => action$.pipe(filter44
|
|
|
2741
2768
|
return api.customAction(screenName, bcUrl, data, context, params).pipe(mergeMap29((response) => {
|
|
2742
2769
|
var _a2;
|
|
2743
2770
|
const postInvoke = (_a2 = response.postActions) == null ? void 0 : _a2[0];
|
|
2744
|
-
return
|
|
2745
|
-
}),
|
|
2771
|
+
return concat22(of30(sendOperationSuccess({ bcName, cursor })), of30(bcChangeCursors({ cursorsMap })), postInvoke ? of30(processPostInvoke({ bcName, postInvoke, cursor, widgetName: context.widgetName })) : EMPTY24);
|
|
2772
|
+
}), catchError13((error) => {
|
|
2746
2773
|
console.error(error);
|
|
2747
|
-
return
|
|
2774
|
+
return concat22(of30(bcDeleteDataFail({ bcName })), createApiErrorObservable(error, context));
|
|
2748
2775
|
}));
|
|
2749
2776
|
}));
|
|
2750
2777
|
// src/epics/data/bcSelectDepthRecordEpic.ts
|
|
2751
|
-
import { concat as
|
|
2778
|
+
import { concat as concat23, filter as filter45, mergeMap as mergeMap30, of as of31 } from "rxjs";
|
|
2752
2779
|
var bcSelectDepthRecordEpic = (action$) => action$.pipe(filter45(bcSelectDepthRecord.match), mergeMap30((action) => {
|
|
2753
2780
|
const { bcName, cursor, depth } = action.payload;
|
|
2754
|
-
return
|
|
2781
|
+
return concat23(of31(bcChangeDepthCursor({ bcName, depth, cursor })), of31(bcFetchDataRequest({
|
|
2755
2782
|
bcName,
|
|
2756
2783
|
depth: depth + 1,
|
|
2757
2784
|
widgetName: "",
|
|
@@ -2759,7 +2786,7 @@ var bcSelectDepthRecordEpic = (action$) => action$.pipe(filter45(bcSelectDepthRe
|
|
|
2759
2786
|
})));
|
|
2760
2787
|
}));
|
|
2761
2788
|
// src/epics/data/removeMultivalueTagEpic.ts
|
|
2762
|
-
import { concat as
|
|
2789
|
+
import { concat as concat24, filter as filter46, mergeMap as mergeMap31, of as of32 } from "rxjs";
|
|
2763
2790
|
var removeMultivalueTagEpic = (action$, state$) => action$.pipe(filter46(removeMultivalueTag.match), mergeMap31((action) => {
|
|
2764
2791
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
|
|
2765
2792
|
const state = state$.value;
|
|
@@ -2795,7 +2822,7 @@ var removeMultivalueTagEpic = (action$, state$) => action$.pipe(filter46(removeM
|
|
|
2795
2822
|
return removedNodes.includes(descendant) || !associated.includes(descendant);
|
|
2796
2823
|
});
|
|
2797
2824
|
if (parentDeepEmpty) {
|
|
2798
|
-
return
|
|
2825
|
+
return concat24(of32(removeMultivalueTag(__spreadProps(__spreadValues({}, action.payload), {
|
|
2799
2826
|
removedItem: { id: parent.id, value: null }
|
|
2800
2827
|
}))));
|
|
2801
2828
|
}
|
|
@@ -2806,7 +2833,7 @@ var removeMultivalueTagEpic = (action$, state$) => action$.pipe(filter46(removeM
|
|
|
2806
2833
|
}
|
|
2807
2834
|
}
|
|
2808
2835
|
if ((_e = widget == null ? void 0 : widget.options) == null ? void 0 : _e.hierarchyFull) {
|
|
2809
|
-
return
|
|
2836
|
+
return of32(changeDataItem({
|
|
2810
2837
|
bcName,
|
|
2811
2838
|
bcUrl: buildBcUrl(bcName, true, state),
|
|
2812
2839
|
cursor,
|
|
@@ -2818,7 +2845,7 @@ var removeMultivalueTagEpic = (action$, state$) => action$.pipe(filter46(removeM
|
|
|
2818
2845
|
var _a2;
|
|
2819
2846
|
return (_a2 = state.view.pendingDataChanges[hierarchyData.bcName]) == null ? void 0 : _a2[action.payload.removedItem.id];
|
|
2820
2847
|
})) == null ? void 0 : _i.bcName) != null ? _j : bcName;
|
|
2821
|
-
return
|
|
2848
|
+
return concat24(of32(changeDataItem({
|
|
2822
2849
|
/**
|
|
2823
2850
|
* This is incorrect and will break if different BC has records with
|
|
2824
2851
|
* identical ids.
|
|
@@ -2829,19 +2856,19 @@ var removeMultivalueTagEpic = (action$, state$) => action$.pipe(filter46(removeM
|
|
|
2829
2856
|
bcUrl: buildBcUrl(hierarchyBcName, true, state),
|
|
2830
2857
|
cursor: action.payload.removedItem.id,
|
|
2831
2858
|
dataItem: __spreadProps(__spreadValues({}, action.payload.removedItem), { _associate: false })
|
|
2832
|
-
})),
|
|
2859
|
+
})), of32(changeDataItem({
|
|
2833
2860
|
bcName,
|
|
2834
2861
|
bcUrl: buildBcUrl(bcName, true, state),
|
|
2835
2862
|
cursor,
|
|
2836
2863
|
dataItem: { [associateFieldKey]: action.payload.dataItem }
|
|
2837
2864
|
})));
|
|
2838
2865
|
}
|
|
2839
|
-
return
|
|
2866
|
+
return concat24(of32(changeDataItem({
|
|
2840
2867
|
bcName: popupBcName,
|
|
2841
2868
|
bcUrl: buildBcUrl(popupBcName, true, state),
|
|
2842
2869
|
cursor: action.payload.removedItem.id,
|
|
2843
2870
|
dataItem: __spreadProps(__spreadValues({}, action.payload.removedItem), { _associate: false })
|
|
2844
|
-
})),
|
|
2871
|
+
})), of32(changeDataItem({
|
|
2845
2872
|
bcName,
|
|
2846
2873
|
bcUrl: buildBcUrl(bcName, true, state),
|
|
2847
2874
|
cursor,
|
|
@@ -2849,7 +2876,7 @@ var removeMultivalueTagEpic = (action$, state$) => action$.pipe(filter46(removeM
|
|
|
2849
2876
|
})));
|
|
2850
2877
|
}));
|
|
2851
2878
|
// src/epics/data/bcFetchRowMetaRequestEpic.ts
|
|
2852
|
-
import { catchError as
|
|
2879
|
+
import { catchError as catchError14, concat as concat25, filter as filter47, map as map9, mergeMap as mergeMap32, of as of33, race as race3 } from "rxjs";
|
|
2853
2880
|
var bcFetchRowMetaRequestEpic = (action$, state$, { api }) => action$.pipe(filter47(bcFetchRowMeta.match), mergeMap32((action) => {
|
|
2854
2881
|
var _a, _b;
|
|
2855
2882
|
const state = state$.value;
|
|
@@ -2865,14 +2892,14 @@ var bcFetchRowMetaRequestEpic = (action$, state$, { api }) => action$.pipe(filte
|
|
|
2865
2892
|
});
|
|
2866
2893
|
const normalFlow = api.fetchRowMeta(screenName, bcUrl, void 0, canceler.cancelToken).pipe(map9((rowMeta) => {
|
|
2867
2894
|
return bcFetchRowMetaSuccess({ bcName, rowMeta, bcUrl, cursor });
|
|
2868
|
-
}),
|
|
2895
|
+
}), catchError14((error) => {
|
|
2869
2896
|
console.error(error);
|
|
2870
|
-
return
|
|
2897
|
+
return concat25(of33(bcFetchRowMetaFail({ bcName })), createApiErrorObservable(error));
|
|
2871
2898
|
}));
|
|
2872
2899
|
return race3(cancelFlow, cancelByParentBc, normalFlow);
|
|
2873
2900
|
}));
|
|
2874
2901
|
// src/epics/data/changeAssociationFullEpic.ts
|
|
2875
|
-
import { concat as
|
|
2902
|
+
import { concat as concat26, filter as filter48, mergeMap as mergeMap33, of as of34 } from "rxjs";
|
|
2876
2903
|
var changeAssociationFullEpic = (action$, state$) => action$.pipe(filter48(changeAssociationFull.match), mergeMap33((action) => {
|
|
2877
2904
|
var _a, _b, _c, _d, _e;
|
|
2878
2905
|
const state = state$.value;
|
|
@@ -2902,7 +2929,7 @@ var changeAssociationFullEpic = (action$, state$) => action$.pipe(filter48(chang
|
|
|
2902
2929
|
return false;
|
|
2903
2930
|
});
|
|
2904
2931
|
if (prevSelected) {
|
|
2905
|
-
result.push(
|
|
2932
|
+
result.push(of34(changeAssociationFull({
|
|
2906
2933
|
bcName,
|
|
2907
2934
|
depth,
|
|
2908
2935
|
widgetName: action.payload.widgetName,
|
|
@@ -2912,7 +2939,7 @@ var changeAssociationFullEpic = (action$, state$) => action$.pipe(filter48(chang
|
|
|
2912
2939
|
}
|
|
2913
2940
|
}
|
|
2914
2941
|
else {
|
|
2915
|
-
result.push(
|
|
2942
|
+
result.push(of34(changeDescendantsAssociationsFull({
|
|
2916
2943
|
bcName,
|
|
2917
2944
|
parentId: action.payload.dataItem.id,
|
|
2918
2945
|
depth: depth + 1,
|
|
@@ -2921,14 +2948,14 @@ var changeAssociationFullEpic = (action$, state$) => action$.pipe(filter48(chang
|
|
|
2921
2948
|
})));
|
|
2922
2949
|
}
|
|
2923
2950
|
}
|
|
2924
|
-
result.push(
|
|
2951
|
+
result.push(of34(changeDataItem({
|
|
2925
2952
|
bcName: action.payload.bcName,
|
|
2926
2953
|
bcUrl: buildBcUrl(action.payload.bcName, true, state),
|
|
2927
2954
|
cursor: action.payload.dataItem.id,
|
|
2928
2955
|
dataItem: action.payload.dataItem
|
|
2929
2956
|
})));
|
|
2930
2957
|
if (parentDepth && hierarchyTraverse && selected) {
|
|
2931
|
-
result.push(
|
|
2958
|
+
result.push(of34(changeAssociationFull({
|
|
2932
2959
|
bcName,
|
|
2933
2960
|
depth: parentDepth,
|
|
2934
2961
|
widgetName: action.payload.widgetName,
|
|
@@ -2947,7 +2974,7 @@ var changeAssociationFullEpic = (action$, state$) => action$.pipe(filter48(chang
|
|
|
2947
2974
|
const deltaFalseId = delta && ((_e = Object.values(delta)) == null ? void 0 : _e.filter((item) => item._associate === false).map((item) => item.id));
|
|
2948
2975
|
const wasLastInData = currentLevelData.filter((item) => item.id !== action.payload.dataItem.id && !(deltaFalseId == null ? void 0 : deltaFalseId.includes(item.id))).every((item) => !item._associate);
|
|
2949
2976
|
if (wasLastInData && wasLastInDelta) {
|
|
2950
|
-
result.push(
|
|
2977
|
+
result.push(of34(changeAssociationFull({
|
|
2951
2978
|
bcName,
|
|
2952
2979
|
depth: parentDepth,
|
|
2953
2980
|
widgetName: action.payload.widgetName,
|
|
@@ -2956,10 +2983,10 @@ var changeAssociationFullEpic = (action$, state$) => action$.pipe(filter48(chang
|
|
|
2956
2983
|
})));
|
|
2957
2984
|
}
|
|
2958
2985
|
}
|
|
2959
|
-
return
|
|
2986
|
+
return concat26(...result);
|
|
2960
2987
|
}));
|
|
2961
2988
|
// src/epics/data/saveAssociationsActiveEpic.ts
|
|
2962
|
-
import { catchError as
|
|
2989
|
+
import { catchError as catchError15, concat as concat27, EMPTY as EMPTY25, filter as filter49, mergeMap as mergeMap34, of as of35, switchMap as switchMap12 } from "rxjs";
|
|
2963
2990
|
var saveAssociationsActiveEpic = (action$, state$, { api }) => action$.pipe(filter49(saveAssociations.match), filter49((action) => {
|
|
2964
2991
|
var _a;
|
|
2965
2992
|
return (_a = state$.value.view.popupData) == null ? void 0 : _a.active;
|
|
@@ -2975,20 +3002,20 @@ var saveAssociationsActiveEpic = (action$, state$, { api }) => action$.pipe(filt
|
|
|
2975
3002
|
return api.associate(state.screen.screenName, bcUrl, Object.values(pendingChanges).filter((i) => i._associate), params).pipe(mergeMap34((response) => {
|
|
2976
3003
|
const postInvoke = response.postActions[0];
|
|
2977
3004
|
const calleeWidget = state.view.widgets.find((widgetItem) => widgetItem.bcName === calleeBCName);
|
|
2978
|
-
return
|
|
2979
|
-
}),
|
|
3005
|
+
return concat27(postInvoke ? of35(processPostInvoke({ bcName: calleeBCName, postInvoke, widgetName: calleeWidget == null ? void 0 : calleeWidget.name })) : EMPTY25, of35(bcCancelPendingChanges({ bcNames })), of35(bcForceUpdate({ bcName: calleeBCName, widgetName: calleeWidgetName })));
|
|
3006
|
+
}), catchError15((err) => {
|
|
2980
3007
|
console.error(err);
|
|
2981
|
-
return
|
|
3008
|
+
return EMPTY25;
|
|
2982
3009
|
}));
|
|
2983
3010
|
}));
|
|
2984
3011
|
// src/epics/data/changeAssociationSameBcEpic.ts
|
|
2985
|
-
import { concat as
|
|
3012
|
+
import { concat as concat28, filter as filter50, mergeMap as mergeMap35, of as of36 } from "rxjs";
|
|
2986
3013
|
var changeAssociationSameBcEpic = (action$, state$) => action$.pipe(filter50(changeAssociationSameBc.match), mergeMap35((action) => {
|
|
2987
3014
|
var _a, _b, _c, _d, _e, _f;
|
|
2988
3015
|
const state = state$.value;
|
|
2989
3016
|
const bcName = action.payload.bcName;
|
|
2990
3017
|
const result = [
|
|
2991
|
-
|
|
3018
|
+
of36(changeDataItem({
|
|
2992
3019
|
bcName,
|
|
2993
3020
|
bcUrl: buildBcUrl(bcName, true, state),
|
|
2994
3021
|
cursor: action.payload.dataItem.id,
|
|
@@ -3004,7 +3031,7 @@ var changeAssociationSameBcEpic = (action$, state$) => action$.pipe(filter50(cha
|
|
|
3004
3031
|
const parentCursor = parentDepth ? parentDepth > 1 ? (_d = (_c = state.screen.bo.bc[bcName].depthBc) == null ? void 0 : _c[parentDepth]) == null ? void 0 : _d.cursor : state.screen.bo.bc[bcName].cursor : null;
|
|
3005
3032
|
const parentItem = parentCursor ? parentDepth > 1 ? (_f = (_e = state.depthData[parentDepth]) == null ? void 0 : _e[bcName]) == null ? void 0 : _f.find((item) => item.id === parentCursor) : state.data[bcName].find((item) => item.id === parentCursor) : null;
|
|
3006
3033
|
if (parentDepth && hierarchyTraverse && selected) {
|
|
3007
|
-
result.push(
|
|
3034
|
+
result.push(of36(changeAssociationSameBc({
|
|
3008
3035
|
bcName,
|
|
3009
3036
|
depth: parentDepth,
|
|
3010
3037
|
widgetName: action.payload.widgetName,
|
|
@@ -3018,7 +3045,7 @@ var changeAssociationSameBcEpic = (action$, state$) => action$.pipe(filter50(cha
|
|
|
3018
3045
|
if (parentDepth && hierarchyTraverse && !selected) {
|
|
3019
3046
|
const wasLastInData = currentData.filter((item) => item.id !== action.payload.dataItem.id).every((item) => !item._associate);
|
|
3020
3047
|
if (wasLastInData) {
|
|
3021
|
-
result.push(
|
|
3048
|
+
result.push(of36(changeAssociationSameBc({
|
|
3022
3049
|
bcName,
|
|
3023
3050
|
depth: parentDepth,
|
|
3024
3051
|
widgetName: action.payload.widgetName,
|
|
@@ -3027,10 +3054,10 @@ var changeAssociationSameBcEpic = (action$, state$) => action$.pipe(filter50(cha
|
|
|
3027
3054
|
})));
|
|
3028
3055
|
}
|
|
3029
3056
|
}
|
|
3030
|
-
return
|
|
3057
|
+
return concat28(...result);
|
|
3031
3058
|
}));
|
|
3032
3059
|
// src/epics/data/inlinePickListFetchDataEpic.ts
|
|
3033
|
-
import { catchError as
|
|
3060
|
+
import { catchError as catchError16, filter as filter51, mergeMap as mergeMap36, of as of37, race as race4 } from "rxjs";
|
|
3034
3061
|
var inlinePickListFetchDataEpic = (action$, state$, { api }) => action$.pipe(filter51(inlinePickListFetchDataRequest.match), mergeMap36((action) => {
|
|
3035
3062
|
const { bcName, searchSpec, searchString } = action.payload;
|
|
3036
3063
|
const state = state$.value;
|
|
@@ -3038,15 +3065,15 @@ var inlinePickListFetchDataEpic = (action$, state$, { api }) => action$.pipe(fil
|
|
|
3038
3065
|
const canceler = api.createCanceler();
|
|
3039
3066
|
const cancelFlow = cancelRequestEpic(action$, cancelRequestActionTypes, canceler.cancel, bcFetchDataFail({ bcName, bcUrl }));
|
|
3040
3067
|
const normalFlow = api.fetchBcData(state$.value.screen.screenName, bcUrl, { [searchSpec + ".contains"]: searchString }, canceler.cancelToken).pipe(mergeMap36((data) => {
|
|
3041
|
-
return
|
|
3042
|
-
}),
|
|
3068
|
+
return of37(bcFetchDataSuccess({ bcName, data: data.data, bcUrl }));
|
|
3069
|
+
}), catchError16((error) => {
|
|
3043
3070
|
console.error(error);
|
|
3044
|
-
return
|
|
3071
|
+
return of37(bcFetchDataFail({ bcName: action.payload.bcName, bcUrl }));
|
|
3045
3072
|
}));
|
|
3046
3073
|
return race4(cancelFlow, normalFlow);
|
|
3047
3074
|
}));
|
|
3048
3075
|
// src/epics/data/saveAssociationsPassiveEpic.ts
|
|
3049
|
-
import { filter as filter52, of as
|
|
3076
|
+
import { filter as filter52, of as of38, switchMap as switchMap13 } from "rxjs";
|
|
3050
3077
|
var saveAssociationsPassiveEpic = (action$, state$) => action$.pipe(filter52(saveAssociations.match), filter52(() => {
|
|
3051
3078
|
var _a;
|
|
3052
3079
|
return !((_a = state$.value.view.popupData) == null ? void 0 : _a.active);
|
|
@@ -3078,7 +3105,7 @@ var saveAssociationsPassiveEpic = (action$, state$) => action$.pipe(filter52(sav
|
|
|
3078
3105
|
}
|
|
3079
3106
|
return true;
|
|
3080
3107
|
}).concat(...addedItems);
|
|
3081
|
-
return
|
|
3108
|
+
return of38(changeDataItem({
|
|
3082
3109
|
bcName: calleeBCName,
|
|
3083
3110
|
bcUrl: buildBcUrl(calleeBCName, true, state),
|
|
3084
3111
|
cursor,
|
|
@@ -3088,11 +3115,11 @@ var saveAssociationsPassiveEpic = (action$, state$) => action$.pipe(filter52(sav
|
|
|
3088
3115
|
}));
|
|
3089
3116
|
}));
|
|
3090
3117
|
// src/epics/data/changeChildrenAssociationsEpic.ts
|
|
3091
|
-
import { filter as filter53, mergeMap as mergeMap37, of as
|
|
3118
|
+
import { filter as filter53, mergeMap as mergeMap37, of as of39 } from "rxjs";
|
|
3092
3119
|
var changeChildrenAssociationsEpic = (action$, state$, { api }) => action$.pipe(filter53(changeChildrenAssociations.match), mergeMap37((action) => {
|
|
3093
3120
|
const state = state$.value;
|
|
3094
3121
|
const data = state.data[action.payload.bcName];
|
|
3095
|
-
return
|
|
3122
|
+
return of39(changeDataItems({
|
|
3096
3123
|
bcName: action.payload.bcName,
|
|
3097
3124
|
cursors: data.map((item) => item.id),
|
|
3098
3125
|
dataItems: data.map((item) => __spreadProps(__spreadValues({}, item), {
|
|
@@ -3102,12 +3129,12 @@ var changeChildrenAssociationsEpic = (action$, state$, { api }) => action$.pipe(
|
|
|
3102
3129
|
}));
|
|
3103
3130
|
}));
|
|
3104
3131
|
// src/epics/data/changeChildrenAssociationsSameBcEpic.ts
|
|
3105
|
-
import { filter as filter54, mergeMap as mergeMap38, of as
|
|
3132
|
+
import { filter as filter54, mergeMap as mergeMap38, of as of40 } from "rxjs";
|
|
3106
3133
|
var changeChildrenAssociationsSameBcEpic = (action$, state$) => action$.pipe(filter54(changeChildrenAssociationsSameBc.match), mergeMap38((action) => {
|
|
3107
3134
|
var _a;
|
|
3108
3135
|
const state = state$.value;
|
|
3109
3136
|
const data = ((_a = state.depthData[action.payload.depth]) == null ? void 0 : _a[action.payload.bcName]) || [];
|
|
3110
|
-
return
|
|
3137
|
+
return of40(changeDataItems({
|
|
3111
3138
|
bcName: action.payload.bcName,
|
|
3112
3139
|
cursors: data.map((item) => item.id),
|
|
3113
3140
|
dataItems: data.map((item) => __spreadProps(__spreadValues({}, item), {
|
|
@@ -3117,14 +3144,14 @@ var changeChildrenAssociationsSameBcEpic = (action$, state$) => action$.pipe(fil
|
|
|
3117
3144
|
}));
|
|
3118
3145
|
}));
|
|
3119
3146
|
// src/epics/data/changeDescendantsAssociationsFullEpic.ts
|
|
3120
|
-
import { concat as
|
|
3147
|
+
import { concat as concat29, filter as filter55, mergeMap as mergeMap39, of as of41 } from "rxjs";
|
|
3121
3148
|
var changeDescendantsAssociationsFullEpic = (action$, state$) => action$.pipe(filter55(changeDescendantsAssociationsFull.match), mergeMap39((action) => {
|
|
3122
3149
|
const state = state$.value;
|
|
3123
3150
|
const depth = action.payload.depth;
|
|
3124
3151
|
const data = state.data[action.payload.bcName];
|
|
3125
3152
|
const targetData = (data || []).filter((item) => item.level === depth && item.parentId === action.payload.parentId);
|
|
3126
3153
|
const result = [
|
|
3127
|
-
|
|
3154
|
+
of41(changeDataItems({
|
|
3128
3155
|
bcName: action.payload.bcName,
|
|
3129
3156
|
cursors: targetData.map((item) => item.id),
|
|
3130
3157
|
dataItems: targetData.map((item) => __spreadProps(__spreadValues({}, item), {
|
|
@@ -3135,13 +3162,13 @@ var changeDescendantsAssociationsFullEpic = (action$, state$) => action$.pipe(fi
|
|
|
3135
3162
|
];
|
|
3136
3163
|
targetData.forEach((targetDataItem) => {
|
|
3137
3164
|
if (data.find((dataItem) => dataItem.parentId === targetDataItem.id)) {
|
|
3138
|
-
result.push(
|
|
3165
|
+
result.push(of41(changeDescendantsAssociationsFull(__spreadProps(__spreadValues({}, action.payload), {
|
|
3139
3166
|
parentId: targetDataItem.id,
|
|
3140
3167
|
depth: depth + 1
|
|
3141
3168
|
}))));
|
|
3142
3169
|
}
|
|
3143
3170
|
});
|
|
3144
|
-
return
|
|
3171
|
+
return concat29(...result);
|
|
3145
3172
|
}));
|
|
3146
3173
|
// src/api/ObservableApiWrapper.ts
|
|
3147
3174
|
import axios2 from "axios";
|
|
@@ -3184,7 +3211,7 @@ var ObservableApiWrapper = class {
|
|
|
3184
3211
|
};
|
|
3185
3212
|
// src/api/ObservableApi.ts
|
|
3186
3213
|
import axios3 from "axios";
|
|
3187
|
-
import { EMPTY as
|
|
3214
|
+
import { EMPTY as EMPTY26, expand, map as map11, reduce } from "rxjs";
|
|
3188
3215
|
var Api = class {
|
|
3189
3216
|
constructor(instance) {
|
|
3190
3217
|
__publicField(this, "api$");
|
|
@@ -3205,7 +3232,7 @@ var Api = class {
|
|
|
3205
3232
|
fetchBcDataAll(screenName, bcUrl, params = {}) {
|
|
3206
3233
|
let currentPage = 1;
|
|
3207
3234
|
return this.fetchBcData(screenName, bcUrl, __spreadProps(__spreadValues({}, params), { _page: currentPage })).pipe(expand((response) => {
|
|
3208
|
-
return response.hasNext ? this.fetchBcData(screenName, bcUrl, __spreadProps(__spreadValues({}, params), { _page: ++currentPage })) :
|
|
3235
|
+
return response.hasNext ? this.fetchBcData(screenName, bcUrl, __spreadProps(__spreadValues({}, params), { _page: ++currentPage })) : EMPTY26;
|
|
3209
3236
|
}), reduce((items, nextResponse) => {
|
|
3210
3237
|
return [...items, ...nextResponse.data];
|
|
3211
3238
|
}, []));
|
|
@@ -3421,13 +3448,13 @@ var requiredFields = ({ getState, dispatch }) => (next) => (action) => {
|
|
|
3421
3448
|
}
|
|
3422
3449
|
return next(action);
|
|
3423
3450
|
};
|
|
3424
|
-
function operationRequiresAutosave(operationType,
|
|
3451
|
+
function operationRequiresAutosave(operationType, actions2) {
|
|
3425
3452
|
let result = false;
|
|
3426
|
-
if (!
|
|
3453
|
+
if (!actions2) {
|
|
3427
3454
|
console.error('rowMeta is missing in the middle of "sendOperation" action');
|
|
3428
3455
|
return result;
|
|
3429
3456
|
}
|
|
3430
|
-
result = flattenOperations(
|
|
3457
|
+
result = flattenOperations(actions2).some((action) => action.type === operationType && action.autoSaveBefore);
|
|
3431
3458
|
return result;
|
|
3432
3459
|
}
|
|
3433
3460
|
function getRequiredFieldsMissing(record, pendingChanges, fieldsMeta) {
|
|
@@ -3481,8 +3508,8 @@ var preInvokeAction = ({ getState }) => (next) => (action) => {
|
|
|
3481
3508
|
const bcName = (_a = state.view.widgets.find((widgetItem) => widgetItem.name === widgetName)) == null ? void 0 : _a.bcName;
|
|
3482
3509
|
const bcUrl = buildBcUrl(bcName, true, state);
|
|
3483
3510
|
const rowMeta = bcUrl && ((_b = state.view.rowMeta[bcName]) == null ? void 0 : _b[bcUrl]);
|
|
3484
|
-
const
|
|
3485
|
-
const preInvoke = (_c =
|
|
3511
|
+
const actions2 = rowMeta && flattenOperations(rowMeta.actions);
|
|
3512
|
+
const preInvoke = (_c = actions2 == null ? void 0 : actions2.find((item) => item.type === operationType)) == null ? void 0 : _c.preInvoke;
|
|
3486
3513
|
return preInvoke && !confirm ? next(processPreInvoke({
|
|
3487
3514
|
bcName,
|
|
3488
3515
|
operationType,
|