@cxbox-ui/core 1.37.2-alpha.9 → 1.37.3-alpha.0

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.
@@ -115,6 +115,8 @@ __export(actions_exports, {
115
115
  processPreInvoke: function () { return processPreInvoke; },
116
116
  refreshMeta: function () { return refreshMeta; },
117
117
  refreshMetaAndReloadPage: function () { return refreshMetaAndReloadPage; },
118
+ refreshMetaDone: function () { return refreshMetaDone; },
119
+ refreshMetaFail: function () { return refreshMetaFail; },
118
120
  removeMultivalueTag: function () { return removeMultivalueTag; },
119
121
  removeNotifications: function () { return removeNotifications; },
120
122
  removePendingRequest: function () { return removePendingRequest; },
@@ -234,6 +236,8 @@ var switchDebugMode = createAction("switchDebugMode");
234
236
  var exportState = createAction("exportState");
235
237
  var emptyAction = createAction("emptyAction");
236
238
  var refreshMeta = createAction("refreshMeta");
239
+ var refreshMetaDone = createAction("refreshMetaDone");
240
+ var refreshMetaFail = createAction("refreshMetaFail");
237
241
  var refreshMetaAndReloadPage = createAction("refreshMetaAndReloadPage");
238
242
  var switchRole = createAction("switchRole");
239
243
  var addPendingRequest = createAction("addPendingRequest");
@@ -493,6 +497,8 @@ __export(utils_exports, {
493
497
  buildSearchResultTree: function () { return buildSearchResultTree; },
494
498
  buildUrl: function () { return buildUrl; },
495
499
  checkShowCondition: function () { return checkShowCondition; },
500
+ createApiError: function () { return createApiError; },
501
+ createApiErrorObservable: function () { return createApiErrorObservable; },
496
502
  defaultBuildURL: function () { return defaultBuildURL; },
497
503
  defaultParseURL: function () { return defaultParseURL; },
498
504
  deleteUndefinedFromObject: function () { return deleteUndefinedFromObject; },
@@ -540,6 +546,19 @@ function applyRawParams(url, qso) {
540
546
  var result = new URLSearchParams(qso).toString();
541
547
  return "".concat(addTailControlSequences(url)).concat(result && "".concat(result));
542
548
  }
549
+ // src/utils/apiError.ts
550
+ import { actions } from "@cxbox-ui/core";
551
+ import { EMPTY, of } from "rxjs";
552
+ function createApiError(error, context) {
553
+ if (context === void 0) { context = { widgetName: "unknown" }; }
554
+ if (!error.isAxiosError)
555
+ return void 0;
556
+ return actions.apiError({ error: error, callContext: context });
557
+ }
558
+ function createApiErrorObservable(error, context) {
559
+ var apiError2 = createApiError(error, context);
560
+ return apiError2 ? of(apiError2) : EMPTY;
561
+ }
543
562
  // src/utils/strings.ts
544
563
  function getTemplate(literals) {
545
564
  var placeholders = [];
@@ -1105,7 +1124,9 @@ var createScreenReducerBuilderManager = function (initialState) { return new Red
1105
1124
  state.bo.bc[action.payload.bcName].page = action.payload.page;
1106
1125
  state.bo.bc[action.payload.bcName].loading = true;
1107
1126
  }).addCase(showViewPopup, function (state, action) {
1108
- state.bo.bc[action.payload.bcName].page = 1;
1127
+ var _a, _b;
1128
+ var currentPage = (_b = (_a = state.bo.bc[action.payload.bcName]) === null || _a === void 0 ? void 0 : _a.page) !== null && _b !== void 0 ? _b : 1;
1129
+ state.bo.bc[action.payload.bcName].page = action.payload.bcName === action.payload.calleeBCName ? currentPage : 1;
1109
1130
  state.bo.bc[action.payload.bcName].loading = action.payload.bcName !== action.payload.calleeBCName;
1110
1131
  }).addCase(sendOperationSuccess, function (state, action) {
1111
1132
  state.bo.bc[action.payload.bcName].loading = false;
@@ -1134,7 +1155,8 @@ var initialSessionState = {
1134
1155
  errorMsg: null,
1135
1156
  screens: [],
1136
1157
  pendingRequests: [],
1137
- notifications: []
1158
+ notifications: [],
1159
+ isMetaRefreshing: false
1138
1160
  };
1139
1161
  var createSessionReducerBuilderManager = function (initialState) { return new ReducerBuilderManager().addCase(login, function (state) {
1140
1162
  state.loginSpin = true;
@@ -1164,6 +1186,12 @@ var createSessionReducerBuilderManager = function (initialState) { return new Re
1164
1186
  }).addCase(removeNotifications, function (state, action) {
1165
1187
  var closingKeys = action.payload;
1166
1188
  state.notifications = state.notifications.filter(function (notification) { return !closingKeys.includes(notification.key); });
1189
+ }).addCase(refreshMeta, function (state) {
1190
+ state.isMetaRefreshing = true;
1191
+ }).addCase(refreshMetaDone, function (state) {
1192
+ state.isMetaRefreshing = false;
1193
+ }).addCase(refreshMetaFail, function (state) {
1194
+ state.isMetaRefreshing = false;
1167
1195
  }); };
1168
1196
  // src/reducers/view.ts
1169
1197
  import { OperationTypeCrud as OperationTypeCrud4 } from "@cxbox-ui/schema";
@@ -1212,8 +1240,8 @@ var createViewReducerBuilderManager = function (initialState) { return new Reduc
1212
1240
  }).addCase(bcNewDataSuccess, function (state, action) {
1213
1241
  state.selectedCell = initialViewState.selectedCell;
1214
1242
  }).addCase(forceActiveRmUpdate, function (state, action) {
1215
- var _a, _b, _c, _d;
1216
- var _e = action.payload, bcName = _e.bcName, bcUrl = _e.bcUrl, currentRecordData = _e.currentRecordData, rowMeta = _e.rowMeta, cursor = _e.cursor;
1243
+ var _a, _b, _c, _d, _e;
1244
+ var _f = action.payload, bcName = _f.bcName, bcUrl = _f.bcUrl, currentRecordData = _f.currentRecordData, rowMeta = _f.rowMeta, cursor = _f.cursor;
1217
1245
  var handledForceActive = {};
1218
1246
  var rowMetaForcedValues = {};
1219
1247
  var newPendingChangesDiff = {};
@@ -1224,6 +1252,7 @@ var createViewReducerBuilderManager = function (initialState) { return new Reduc
1224
1252
  forceActiveFieldKeys.push(field.key);
1225
1253
  }
1226
1254
  });
1255
+ state.pendingDataChanges[bcName] = (_a = state.pendingDataChanges[bcName]) !== null && _a !== void 0 ? _a : {};
1227
1256
  var consolidatedFrontData = __assign(__assign({}, currentRecordData), state.pendingDataChanges[bcName][cursor]);
1228
1257
  Object.keys(consolidatedFrontData).forEach(function (key) {
1229
1258
  if (rowMetaForcedValues[key] !== void 0 && consolidatedFrontData[key] !== rowMetaForcedValues[key]) {
@@ -1236,12 +1265,12 @@ var createViewReducerBuilderManager = function (initialState) { return new Reduc
1236
1265
  handledForceActive[key] = newPendingDataChanges[key];
1237
1266
  }
1238
1267
  });
1239
- state.handledForceActive[bcName] = (_a = state.handledForceActive[bcName]) !== null && _a !== void 0 ? _a : {};
1240
- state.handledForceActive[bcName][cursor] = (_b = state.handledForceActive[bcName][cursor]) !== null && _b !== void 0 ? _b : {};
1268
+ state.handledForceActive[bcName] = (_b = state.handledForceActive[bcName]) !== null && _b !== void 0 ? _b : {};
1269
+ state.handledForceActive[bcName][cursor] = (_c = state.handledForceActive[bcName][cursor]) !== null && _c !== void 0 ? _c : {};
1241
1270
  Object.assign(state.handledForceActive[bcName][cursor], handledForceActive);
1242
- state.pendingDataChanges[bcName] = (_c = state.pendingDataChanges[bcName]) !== null && _c !== void 0 ? _c : {};
1271
+ state.pendingDataChanges[bcName] = (_d = state.pendingDataChanges[bcName]) !== null && _d !== void 0 ? _d : {};
1243
1272
  state.pendingDataChanges[bcName][cursor] = newPendingDataChanges;
1244
- state.rowMeta[bcName] = (_d = state.rowMeta[bcName]) !== null && _d !== void 0 ? _d : {};
1273
+ state.rowMeta[bcName] = (_e = state.rowMeta[bcName]) !== null && _e !== void 0 ? _e : {};
1245
1274
  state.rowMeta[bcName][bcUrl] = rowMeta;
1246
1275
  }).addCase(changeDataItem, function (state, action) {
1247
1276
  var _a, _b, _c;
@@ -1507,9 +1536,9 @@ __export(epics_exports, {
1507
1536
  userDrillDownEpic: function () { return userDrillDownEpic; }
1508
1537
  });
1509
1538
  // src/epics/view/sendOperationEpic.ts
1510
- import { catchError, concat, EMPTY, filter, mergeMap, of as of2 } from "rxjs";
1539
+ import { catchError, concat, EMPTY as EMPTY2, filter, mergeMap, of as of3 } from "rxjs";
1511
1540
  // src/epics/utils/postOperationRoutine.ts
1512
- import { of } from "rxjs";
1541
+ import { of as of2 } from "rxjs";
1513
1542
  function postOperationRoutine(widgetName, postInvoke, preInvoke, operationType, bcName) {
1514
1543
  var postInvokeConfirm = Object.values(OperationPostInvokeConfirmType).includes(postInvoke === null || postInvoke === void 0 ? void 0 : postInvoke.type);
1515
1544
  var result = [];
@@ -1532,7 +1561,7 @@ function postOperationRoutine(widgetName, postInvoke, preInvoke, operationType,
1532
1561
  preInvoke: preInvoke
1533
1562
  }));
1534
1563
  }
1535
- return result.map(function (item) { return of(item); });
1564
+ return result.map(function (item) { return of2(item); });
1536
1565
  }
1537
1566
  // src/epics/view/sendOperationEpic.ts
1538
1567
  var sendOperationEpic = function (action$, state$, _a) {
@@ -1571,8 +1600,8 @@ var sendOperationEpic = function (action$, state$, _a) {
1571
1600
  var _a, _b;
1572
1601
  var postInvoke = (_a = response.postActions) === null || _a === void 0 ? void 0 : _a[0];
1573
1602
  var preInvoke = response.preInvoke;
1574
- return defaultSaveOperation ? ((_b = action === null || action === void 0 ? void 0 : action.payload) === null || _b === void 0 ? void 0 : _b.onSuccessAction) ? concat(of2(bcCancelPendingChanges({ bcNames: [bcName] })), of2(action.payload.onSuccessAction)) : EMPTY : concat.apply(void 0, __spreadArray([of2(sendOperationSuccess({ bcName: bcName, cursor: cursor })),
1575
- of2(bcForceUpdate({ bcName: bcName }))], postOperationRoutine(widgetName, postInvoke, preInvoke, operationType, bcName), false));
1603
+ return defaultSaveOperation ? ((_b = action === null || action === void 0 ? void 0 : action.payload) === null || _b === void 0 ? void 0 : _b.onSuccessAction) ? concat(of3(bcCancelPendingChanges({ bcNames: [bcName] })), of3(action.payload.onSuccessAction)) : EMPTY2 : concat.apply(void 0, __spreadArray([of3(sendOperationSuccess({ bcName: bcName, cursor: cursor })),
1604
+ of3(bcForceUpdate({ bcName: bcName }))], postOperationRoutine(widgetName, postInvoke, preInvoke, operationType, bcName), false));
1576
1605
  }), catchError(function (e) {
1577
1606
  var _a, _b, _c, _d, _e, _f;
1578
1607
  console.error(e);
@@ -1583,12 +1612,12 @@ var sendOperationEpic = function (action$, state$, _a) {
1583
1612
  entityError = (_d = operationError === null || operationError === void 0 ? void 0 : operationError.error) === null || _d === void 0 ? void 0 : _d.entity;
1584
1613
  viewError = (_f = (_e = operationError === null || operationError === void 0 ? void 0 : operationError.error) === null || _e === void 0 ? void 0 : _e.popup) === null || _f === void 0 ? void 0 : _f[0];
1585
1614
  }
1586
- return of2(sendOperationFail({ bcName: bcName, bcUrl: bcUrl, viewError: viewError, entityError: entityError }));
1615
+ return concat(of3(sendOperationFail({ bcName: bcName, bcUrl: bcUrl, viewError: viewError, entityError: entityError })), createApiErrorObservable(e, context));
1587
1616
  }));
1588
1617
  }));
1589
1618
  };
1590
1619
  // src/epics/view/showAssocPopupEpic.ts
1591
- import { EMPTY as EMPTY2, filter as filter2, mergeMap as mergeMap2, of as of3 } from "rxjs";
1620
+ import { EMPTY as EMPTY3, filter as filter2, mergeMap as mergeMap2, of as of4 } from "rxjs";
1592
1621
  import { WidgetTypes as WidgetTypes3 } from "@cxbox-ui/schema";
1593
1622
  var showAssocPopupEpic = function (action$, state$) { return action$.pipe(filter2(showViewPopup.match), filter2(function (action) { return !!(action.payload.calleeBCName && action.payload.associateFieldKey); }), mergeMap2(function (action) {
1594
1623
  var _a, _b, _c, _d;
@@ -1601,7 +1630,7 @@ var showAssocPopupEpic = function (action$, state$) { return action$.pipe(filter
1601
1630
  var assocFieldChanges = calleePendingChanges === null || calleePendingChanges === void 0 ? void 0 : calleePendingChanges[assocFieldKey];
1602
1631
  var somethingMissing = !assocWidget || !calleePendingChanges || !assocFieldChanges || !assocFieldChanges;
1603
1632
  if (somethingMissing || assocWidget.options && !assocWidget.options.hierarchyFull) {
1604
- return EMPTY2;
1633
+ return EMPTY3;
1605
1634
  }
1606
1635
  var popupInitPendingChanges = {};
1607
1636
  assocFieldChanges.forEach(function (record) {
@@ -1624,14 +1653,14 @@ var showAssocPopupEpic = function (action$, state$) { return action$.pipe(filter
1624
1653
  }
1625
1654
  });
1626
1655
  }
1627
- return of3(changeDataItems({
1656
+ return of4(changeDataItems({
1628
1657
  bcName: bcName,
1629
1658
  cursors: Object.keys(popupInitPendingChanges),
1630
1659
  dataItems: Object.values(popupInitPendingChanges)
1631
1660
  }));
1632
1661
  })); };
1633
1662
  // src/epics/view/fileUploadConfirmEpic.ts
1634
- import { concat as concat2, filter as filter3, mergeMap as mergeMap3, of as of4 } from "rxjs";
1663
+ import { catchError as catchError2, concat as concat2, filter as filter3, mergeMap as mergeMap3, of as of5 } from "rxjs";
1635
1664
  import { OperationTypeCrud as OperationTypeCrud5 } from "@cxbox-ui/schema";
1636
1665
  var fileUploadConfirmEpic = function (action$, state$, _a) {
1637
1666
  var api = _a.api;
@@ -1648,14 +1677,17 @@ var fileUploadConfirmEpic = function (action$, state$, _a) {
1648
1677
  var _a;
1649
1678
  var postInvoke = (_a = response.postActions) === null || _a === void 0 ? void 0 : _a[0];
1650
1679
  var preInvoke = response.preInvoke;
1651
- return concat2.apply(void 0, __spreadArray([of4(sendOperationSuccess({ bcName: bcName, cursor: null })),
1652
- of4(bcForceUpdate({ bcName: bcName })),
1653
- of4(closeViewPopup(null))], postOperationRoutine(widgetName, postInvoke, preInvoke, OperationTypeCrud5.save, bcName), false));
1680
+ return concat2.apply(void 0, __spreadArray([of5(sendOperationSuccess({ bcName: bcName, cursor: null })),
1681
+ of5(bcForceUpdate({ bcName: bcName })),
1682
+ of5(closeViewPopup(null))], postOperationRoutine(widgetName, postInvoke, preInvoke, OperationTypeCrud5.save, bcName), false));
1683
+ }), catchError2(function (error) {
1684
+ console.error(error);
1685
+ return createApiErrorObservable(error);
1654
1686
  }));
1655
1687
  }));
1656
1688
  };
1657
1689
  // src/epics/view/selectTableCellInitEpic.ts
1658
- import { concat as concat3, filter as filter4, mergeMap as mergeMap4, of as of5 } from "rxjs";
1690
+ import { concat as concat3, filter as filter4, mergeMap as mergeMap4, of as of6 } from "rxjs";
1659
1691
  var selectTableCellInitEpic = function (action$, state$) { return action$.pipe(filter4(selectTableCellInit.match), mergeMap4(function (action) {
1660
1692
  var _a;
1661
1693
  var resultObservables = [];
@@ -1666,19 +1698,19 @@ var selectTableCellInitEpic = function (action$, state$) { return action$.pipe(f
1666
1698
  var nextBcCursor = (_a = state.screen.bo.bc[nextBcName]) === null || _a === void 0 ? void 0 : _a.cursor;
1667
1699
  var selectedCell = state.view.selectedCell;
1668
1700
  if (nextRowId !== nextBcCursor) {
1669
- resultObservables.push(of5(bcSelectRecord({ bcName: nextBcName, cursor: nextRowId })));
1701
+ resultObservables.push(of6(bcSelectRecord({ bcName: nextBcName, cursor: nextRowId })));
1670
1702
  }
1671
1703
  if (!selectedCell || fieldKey !== selectedCell.fieldKey || nextRowId !== selectedCell.rowId || (nextWidget === null || nextWidget === void 0 ? void 0 : nextWidget.name) !== selectedCell.widgetName) {
1672
- resultObservables.push(of5(selectTableCell({ widgetName: nextWidget === null || nextWidget === void 0 ? void 0 : nextWidget.name, rowId: nextRowId, fieldKey: fieldKey })));
1704
+ resultObservables.push(of6(selectTableCell({ widgetName: nextWidget === null || nextWidget === void 0 ? void 0 : nextWidget.name, rowId: nextRowId, fieldKey: fieldKey })));
1673
1705
  }
1674
1706
  return concat3.apply(void 0, resultObservables);
1675
1707
  })); };
1676
1708
  // src/epics/view/showFileUploadPopupEpic.ts
1677
- import { concat as concat4, filter as filter5, mergeMap as mergeMap5, of as of6 } from "rxjs";
1709
+ import { concat as concat4, filter as filter5, mergeMap as mergeMap5, of as of7 } from "rxjs";
1678
1710
  import { OperationTypeCrud as OperationTypeCrud6 } from "@cxbox-ui/schema";
1679
1711
  var showFileUploadPopupEpic = function (action$, state$) { return action$.pipe(filter5(sendOperation.match), filter5(function (action) { return matchOperationRole(OperationTypeCrud6.fileUpload, action.payload, state$.value); }), mergeMap5(function (action) {
1680
1712
  var _a;
1681
- return concat4(of6(bcChangeCursors({ cursorsMap: (_a = {}, _a[action.payload.bcName] = null, _a) })), of6(showFileUploadPopup({ widgetName: action.payload.widgetName })));
1713
+ return concat4(of7(bcChangeCursors({ cursorsMap: (_a = {}, _a[action.payload.bcName] = null, _a) })), of7(showFileUploadPopup({ widgetName: action.payload.widgetName })));
1682
1714
  })); };
1683
1715
  // src/epics/view/sendOperationAssociateEpic.ts
1684
1716
  import { filter as filter6, map } from "rxjs";
@@ -1693,31 +1725,31 @@ var sendOperationAssociateEpic = function (action$, state$) { return action$.pip
1693
1725
  });
1694
1726
  })); };
1695
1727
  // src/epics/view/getRowMetaByForceActiveEpic.ts
1696
- import { EMPTY as EMPTY3, concat as concat5, filter as filter7, mergeMap as mergeMap6, of as of7, catchError as catchError2 } from "rxjs";
1728
+ import { EMPTY as EMPTY4, concat as concat5, filter as filter7, mergeMap as mergeMap6, of as of8, catchError as catchError3 } from "rxjs";
1697
1729
  import { WidgetTypes as WidgetTypes4 } from "@cxbox-ui/schema";
1698
1730
  import { nanoid } from "@reduxjs/toolkit";
1699
1731
  var getRowMetaByForceActiveEpic = function (action$, state$, _a) {
1700
1732
  var api = _a.api;
1701
1733
  return action$.pipe(filter7(changeDataItem.match), mergeMap6(function (action) {
1702
- var _a, _b, _c, _d;
1734
+ var _a, _b, _c, _d, _e;
1703
1735
  var state = state$.value;
1704
1736
  var initUrl = state.view.url;
1705
- var _e = action.payload, bcName = _e.bcName, cursor = _e.cursor, disableRetry = _e.disableRetry;
1737
+ var _f = action.payload, bcName = _f.bcName, cursor = _f.cursor, disableRetry = _f.disableRetry;
1706
1738
  var isBcHierarchy = state.view.widgets.some(function (widget) {
1707
1739
  var _a, _b;
1708
1740
  return widget.bcName === bcName && widget.type === WidgetTypes4.AssocListPopup && (((_a = widget.options) === null || _a === void 0 ? void 0 : _a.hierarchySameBc) || ((_b = widget.options) === null || _b === void 0 ? void 0 : _b.hierarchyFull));
1709
1741
  });
1710
1742
  if (isBcHierarchy) {
1711
- return EMPTY3;
1743
+ return EMPTY4;
1712
1744
  }
1713
1745
  var isPickListPopup = state.view.widgets.find(function (item) { var _a; return item.name === ((_a = state.view.popupData) === null || _a === void 0 ? void 0 : _a.widgetName) && [WidgetTypes4.PickListPopup, WidgetTypes4.FlatTreePopup].includes(item.type); });
1714
1746
  var bcUrl = buildBcUrl(bcName, true, state);
1715
- var pendingChanges = state.view.pendingDataChanges[bcName][cursor];
1716
- var handledForceActive = ((_a = state.view.handledForceActive[bcName]) === null || _a === void 0 ? void 0 : _a[cursor]) || {};
1717
- var currentRecordData = (_b = state.data[bcName]) === null || _b === void 0 ? void 0 : _b.find(function (record) { return record.id === cursor; });
1718
- var fieldsRowMeta = (_d = (_c = state.view.rowMeta[bcName]) === null || _c === void 0 ? void 0 : _c[bcUrl]) === null || _d === void 0 ? void 0 : _d.fields;
1747
+ var pendingChanges = (_a = state.view.pendingDataChanges[bcName]) === null || _a === void 0 ? void 0 : _a[cursor];
1748
+ var handledForceActive = ((_b = state.view.handledForceActive[bcName]) === null || _b === void 0 ? void 0 : _b[cursor]) || {};
1749
+ var currentRecordData = (_c = state.data[bcName]) === null || _c === void 0 ? void 0 : _c.find(function (record) { return record.id === cursor; });
1750
+ var fieldsRowMeta = (_e = (_d = state.view.rowMeta[bcName]) === null || _d === void 0 ? void 0 : _d[bcUrl]) === null || _e === void 0 ? void 0 : _e.fields;
1719
1751
  var changedFiledKey = null;
1720
- var closePopup = concat5(of7(closeViewPopup(null)), of7(viewClearPickMap(null)), of7(bcRemoveAllFilters({ bcName: bcName })));
1752
+ var closePopup = concat5(of8(closeViewPopup(null)), of8(viewClearPickMap(null)), of8(bcRemoveAllFilters({ bcName: bcName })));
1721
1753
  var someForceActiveChanged = fieldsRowMeta === null || fieldsRowMeta === void 0 ? void 0 : fieldsRowMeta.filter(function (field) { return field.forceActive && pendingChanges[field.key] !== void 0; }).some(function (field) {
1722
1754
  var result = pendingChanges[field.key] !== handledForceActive[field.key];
1723
1755
  if (result) {
@@ -1727,10 +1759,10 @@ var getRowMetaByForceActiveEpic = function (action$, state$, _a) {
1727
1759
  });
1728
1760
  var requestId = nanoid();
1729
1761
  if (someForceActiveChanged && !disableRetry) {
1730
- return concat5(of7(addPendingRequest({ request: { requestId: requestId, type: "force-active" } })), api.getRmByForceActive(state.screen.screenName, bcUrl, __assign(__assign({}, pendingChanges), { vstamp: currentRecordData === null || currentRecordData === void 0 ? void 0 : currentRecordData.vstamp })).pipe(mergeMap6(function (data) {
1731
- var result = [of7(removePendingRequest({ requestId: requestId }))];
1762
+ return concat5(of8(addPendingRequest({ request: { requestId: requestId, type: "force-active" } })), api.getRmByForceActive(state.screen.screenName, bcUrl, __assign(__assign({}, pendingChanges), { vstamp: currentRecordData === null || currentRecordData === void 0 ? void 0 : currentRecordData.vstamp })).pipe(mergeMap6(function (data) {
1763
+ var result = [of8(removePendingRequest({ requestId: requestId }))];
1732
1764
  if (state.view.url === initUrl) {
1733
- result.push(of7(forceActiveRmUpdate({
1765
+ result.push(of8(forceActiveRmUpdate({
1734
1766
  rowMeta: data,
1735
1767
  currentRecordData: currentRecordData,
1736
1768
  bcName: bcName,
@@ -1742,7 +1774,7 @@ var getRowMetaByForceActiveEpic = function (action$, state$, _a) {
1742
1774
  result.push(closePopup);
1743
1775
  }
1744
1776
  return concat5.apply(void 0, result);
1745
- }), catchError2(function (e) {
1777
+ }), catchError3(function (e) {
1746
1778
  var _a;
1747
1779
  var _b, _c, _d, _e, _f, _g;
1748
1780
  console.error(e);
@@ -1753,35 +1785,35 @@ var getRowMetaByForceActiveEpic = function (action$, state$, _a) {
1753
1785
  entityError = (_e = operationError === null || operationError === void 0 ? void 0 : operationError.error) === null || _e === void 0 ? void 0 : _e.entity;
1754
1786
  viewError = (_g = (_f = operationError === null || operationError === void 0 ? void 0 : operationError.error) === null || _f === void 0 ? void 0 : _f.popup) === null || _g === void 0 ? void 0 : _g[0];
1755
1787
  }
1756
- return concat5(of7(removePendingRequest({ requestId: requestId })), state.view.url === initUrl ? concat5(of7(changeDataItem({
1788
+ return concat5(of8(removePendingRequest({ requestId: requestId })), state.view.url === initUrl ? concat5(of8(changeDataItem({
1757
1789
  bcName: bcName,
1758
1790
  bcUrl: buildBcUrl(bcName, true, state),
1759
1791
  cursor: cursor,
1760
1792
  dataItem: (_a = {}, _a[changedFiledKey] = currentRecordData === null || currentRecordData === void 0 ? void 0 : currentRecordData[changedFiledKey], _a),
1761
1793
  disableRetry: true
1762
- })), of7(forceActiveChangeFail({ bcName: bcName, bcUrl: bcUrl, viewError: viewError, entityError: entityError }))) : EMPTY3);
1794
+ })), of8(forceActiveChangeFail({ bcName: bcName, bcUrl: bcUrl, viewError: viewError, entityError: entityError }))) : EMPTY4, createApiErrorObservable(e));
1763
1795
  })));
1764
1796
  }
1765
- return isPickListPopup ? closePopup : EMPTY3;
1797
+ return isPickListPopup ? closePopup : EMPTY4;
1766
1798
  }));
1767
1799
  };
1768
1800
  // src/epics/view/showAllTableRecordsInitEpic.ts
1769
- import { concat as concat6, filter as filter8, mergeMap as mergeMap7, of as of8 } from "rxjs";
1801
+ import { concat as concat6, filter as filter8, mergeMap as mergeMap7, of as of9 } from "rxjs";
1770
1802
  var showAllTableRecordsInitEpic = function (action$, state$) { return action$.pipe(filter8(showAllTableRecordsInit.match), mergeMap7(function (action) {
1771
1803
  var _a;
1772
1804
  var resultObservables = [];
1773
1805
  var _b = action.payload, bcName = _b.bcName, cursor = _b.cursor;
1774
1806
  var state = state$.value;
1775
1807
  var route = state.router;
1776
- resultObservables.push(of8(bcChangeCursors({ cursorsMap: (_a = {}, _a[bcName] = null, _a) })));
1808
+ resultObservables.push(of9(bcChangeCursors({ cursorsMap: (_a = {}, _a[bcName] = null, _a) })));
1777
1809
  var bcPath = route.bcPath.slice(0, route.bcPath.indexOf("".concat(bcName, "/").concat(cursor)));
1778
1810
  var url = defaultBuildURL(__assign(__assign({}, route), { bcPath: bcPath }));
1779
- resultObservables.push(of8(bcForceUpdate({ bcName: bcName })));
1780
- resultObservables.push(of8(changeLocation({ location: defaultParseURL(new URL(url, window.location.origin)) })));
1811
+ resultObservables.push(of9(bcForceUpdate({ bcName: bcName })));
1812
+ resultObservables.push(of9(changeLocation({ location: defaultParseURL(new URL(url, window.location.origin)) })));
1781
1813
  return concat6.apply(void 0, resultObservables);
1782
1814
  })); };
1783
1815
  // src/epics/view/clearPendingDataChangesAfterCursorChangeEpic.ts
1784
- import { EMPTY as EMPTY4, filter as filter9, mergeMap as mergeMap8, of as of9 } from "rxjs";
1816
+ import { EMPTY as EMPTY5, filter as filter9, mergeMap as mergeMap8, of as of10 } from "rxjs";
1785
1817
  var clearPendingDataChangesAfterCursorChangeEpic = function (action$, state$) { return action$.pipe(filter9(bcChangeCursors.match), mergeMap8(function (action) {
1786
1818
  var state = state$.value;
1787
1819
  var nextCursors = parseBcCursors(state.router.bcPath) || {};
@@ -1794,12 +1826,12 @@ var clearPendingDataChangesAfterCursorChangeEpic = function (action$, state$) {
1794
1826
  }
1795
1827
  });
1796
1828
  if (Object.keys(cursorsDiffMap).length) {
1797
- return of9(bcChangeCursors({ cursorsMap: cursorsDiffMap }));
1829
+ return of10(bcChangeCursors({ cursorsMap: cursorsDiffMap }));
1798
1830
  }
1799
- return EMPTY4;
1831
+ return EMPTY5;
1800
1832
  })); };
1801
1833
  // src/epics/router/drilldownEpic.ts
1802
- import { concat as concat7, EMPTY as EMPTY5, filter as filter10, switchMap } from "rxjs";
1834
+ import { concat as concat7, EMPTY as EMPTY6, filter as filter10, switchMap } from "rxjs";
1803
1835
  var drillDownEpic = function (action$, state$) { return action$.pipe(filter10(drillDown.match), switchMap(function (action) {
1804
1836
  var _a, _b;
1805
1837
  var state = state$.value;
@@ -1876,7 +1908,7 @@ var drillDownEpic = function (action$, state$) { return action$.pipe(filter10(dr
1876
1908
  result.push(changeLocation({ location: defaultParseURL(new URL(makeRelativeUrl(urlBase), window.location.origin)) }));
1877
1909
  break;
1878
1910
  }
1879
- return result.length ? concat7(result) : EMPTY5;
1911
+ return result.length ? concat7(result) : EMPTY6;
1880
1912
  })); };
1881
1913
  function shallowCompare(prevProps, nextProps, ignore) {
1882
1914
  if (ignore === void 0) { ignore = []; }
@@ -1904,18 +1936,18 @@ function shallowCompare(prevProps, nextProps, ignore) {
1904
1936
  return diffProps;
1905
1937
  }
1906
1938
  // src/epics/router/loginDoneEpic.ts
1907
- import { filter as filter11, of as of10, switchMap as switchMap2 } from "rxjs";
1939
+ import { filter as filter11, of as of11, switchMap as switchMap2 } from "rxjs";
1908
1940
  var loginDoneEpic = function (action$, state$) { return action$.pipe(filter11(loginDone.match), switchMap2(function (action) {
1909
1941
  var state = state$.value;
1910
1942
  if (state.router.type === "router" /* router */) {
1911
- return of10(handleRouter(state.router));
1943
+ return of11(handleRouter(state.router));
1912
1944
  }
1913
1945
  var nextScreenName = state.router.screenName;
1914
1946
  var nextScreen = state.session.screens.find(function (item) { return nextScreenName ? item.name === nextScreenName : item.defaultScreen; }) || state.session.screens[0];
1915
- return nextScreen ? of10(selectScreen({ screen: nextScreen })) : of10(selectScreenFail({ screenName: nextScreenName }));
1947
+ return nextScreen ? of11(selectScreen({ screen: nextScreen })) : of11(selectScreenFail({ screenName: nextScreenName }));
1916
1948
  })); };
1917
1949
  // src/epics/router/selectViewEpic.ts
1918
- import { EMPTY as EMPTY6, filter as filter12, of as of11, switchMap as switchMap3 } from "rxjs";
1950
+ import { EMPTY as EMPTY7, filter as filter12, of as of12, switchMap as switchMap3 } from "rxjs";
1919
1951
  var changeViewEpic = function (action$, state$) { return action$.pipe(filter12(selectView.match), switchMap3(function (action) {
1920
1952
  var state = state$.value;
1921
1953
  var nextCursors = parseBcCursors(state.router.bcPath) || {};
@@ -1928,37 +1960,37 @@ var changeViewEpic = function (action$, state$) { return action$.pipe(filter12(s
1928
1960
  }
1929
1961
  });
1930
1962
  if (Object.keys(cursorsDiffMap).length) {
1931
- return of11(bcChangeCursors({ cursorsMap: cursorsDiffMap }));
1963
+ return of12(bcChangeCursors({ cursorsMap: cursorsDiffMap }));
1932
1964
  }
1933
- return EMPTY6;
1965
+ return EMPTY7;
1934
1966
  })); };
1935
1967
  // src/epics/router/handleRouterEpic.ts
1936
- import { catchError as catchError3, EMPTY as EMPTY7, filter as filter13, mergeMap as mergeMap9, switchMap as switchMap4 } from "rxjs";
1968
+ import { catchError as catchError4, EMPTY as EMPTY8, filter as filter13, mergeMap as mergeMap9, switchMap as switchMap4 } from "rxjs";
1937
1969
  var handleRouterEpic = function (action$, state$, _a) {
1938
1970
  var api = _a.api;
1939
1971
  return action$.pipe(filter13(handleRouter.match), switchMap4(function (action) {
1940
1972
  var path = action.payload.path;
1941
1973
  var params = action.payload.params;
1942
1974
  return api.routerRequest(path, params).pipe(mergeMap9(function () {
1943
- return EMPTY7;
1944
- }), catchError3(function (error) {
1975
+ return EMPTY8;
1976
+ }), catchError4(function (error) {
1945
1977
  console.error(error);
1946
- return EMPTY7;
1978
+ return createApiErrorObservable(error);
1947
1979
  }));
1948
1980
  }));
1949
1981
  };
1950
1982
  // src/epics/router/selectScreenEpic.ts
1951
- import { filter as filter14, of as of12, switchMap as switchMap5 } from "rxjs";
1983
+ import { filter as filter14, of as of13, switchMap as switchMap5 } from "rxjs";
1952
1984
  var changeScreen = function (action$, state$) { return action$.pipe(filter14(selectScreen.match), switchMap5(function (action) {
1953
1985
  var state = state$.value;
1954
1986
  var nextViewName = state.router.viewName;
1955
1987
  var requestedView = state.screen.views.find(function (item) { return item.name === nextViewName; });
1956
1988
  var defaultView = !nextViewName && state.screen.primaryView && state.screen.views.find(function (item) { return item.name === state.screen.primaryView; });
1957
1989
  var nextView = requestedView || defaultView || state.screen.views[0];
1958
- return nextView ? of12(selectView(nextView)) : of12(selectViewFail({ viewName: nextViewName }));
1990
+ return nextView ? of13(selectView(nextView)) : of13(selectViewFail({ viewName: nextViewName }));
1959
1991
  })); };
1960
1992
  // src/epics/router/userDrillDownEpic.ts
1961
- import { catchError as catchError4, concat as concat8, EMPTY as EMPTY8, filter as filter15, mergeMap as mergeMap10, of as of13, switchMap as switchMap6 } from "rxjs";
1993
+ import { catchError as catchError5, concat as concat8, EMPTY as EMPTY9, filter as filter15, mergeMap as mergeMap10, of as of14, switchMap as switchMap6 } from "rxjs";
1962
1994
  var userDrillDownEpic = function (action$, state$, _a) {
1963
1995
  var api = _a.api;
1964
1996
  return action$.pipe(filter15(userDrillDown.match), switchMap6(function (action) {
@@ -1971,34 +2003,34 @@ var userDrillDownEpic = function (action$, state$, _a) {
1971
2003
  var route = state.router;
1972
2004
  var drillDownKey = (_b = (_a = state.view.widgets.find(function (widget) { return widget.bcName === bcName; })) === null || _a === void 0 ? void 0 : _a.fields.find(function (field) { return field.key === fieldKey; })) === null || _b === void 0 ? void 0 : _b.drillDownKey;
1973
2005
  var customDrillDownUrl = (_d = (_c = state.data[bcName]) === null || _c === void 0 ? void 0 : _c.find(function (record) { return record.id === cursor; })) === null || _d === void 0 ? void 0 : _d[drillDownKey];
1974
- return customDrillDownUrl || (drillDownField === null || drillDownField === void 0 ? void 0 : drillDownField.drillDown) || (drillDownField === null || drillDownField === void 0 ? void 0 : drillDownField.drillDown) !== route.path ? concat8((drillDownField === null || drillDownField === void 0 ? void 0 : drillDownField.drillDownType) !== DrillDownType.inner ? of13(bcFetchRowMetaSuccess({ bcName: bcName, rowMeta: rowMeta, bcUrl: bcUrl, cursor: cursor })) : EMPTY8, of13(userDrillDownSuccess({ bcName: bcName, bcUrl: bcUrl, cursor: cursor })), of13(drillDown({
2006
+ return customDrillDownUrl || (drillDownField === null || drillDownField === void 0 ? void 0 : drillDownField.drillDown) || (drillDownField === null || drillDownField === void 0 ? void 0 : drillDownField.drillDown) !== route.path ? concat8((drillDownField === null || drillDownField === void 0 ? void 0 : drillDownField.drillDownType) !== DrillDownType.inner ? of14(bcFetchRowMetaSuccess({ bcName: bcName, rowMeta: rowMeta, bcUrl: bcUrl, cursor: cursor })) : EMPTY9, of14(userDrillDownSuccess({ bcName: bcName, bcUrl: bcUrl, cursor: cursor })), of14(drillDown({
1975
2007
  url: customDrillDownUrl || drillDownField.drillDown,
1976
2008
  drillDownType: drillDownField.drillDownType,
1977
2009
  route: route
1978
- }))) : EMPTY8;
1979
- }), catchError4(function (error) {
2010
+ }))) : EMPTY9;
2011
+ }), catchError5(function (error) {
1980
2012
  console.error(error);
1981
- return EMPTY8;
2013
+ return createApiErrorObservable(error);
1982
2014
  }));
1983
2015
  }));
1984
2016
  };
1985
2017
  // src/epics/router/changeLocationEpic.ts
1986
- import { concat as concat9, EMPTY as EMPTY9, filter as filter16, mergeMap as mergeMap11, of as of14 } from "rxjs";
2018
+ import { concat as concat9, EMPTY as EMPTY10, filter as filter16, mergeMap as mergeMap11, of as of15 } from "rxjs";
1987
2019
  var changeLocationEpic = function (action$, state$) { return action$.pipe(filter16(changeLocation.match), mergeMap11(function (action) {
1988
2020
  var _a, _b;
1989
2021
  var state = state$.value;
1990
2022
  if (!state.session.active) {
1991
- return EMPTY9;
2023
+ return EMPTY10;
1992
2024
  }
1993
2025
  if (state.router.type === "router" /* router */) {
1994
- return of14(handleRouter(state.router));
2026
+ return of15(handleRouter(state.router));
1995
2027
  }
1996
2028
  var currentScreenName = state.screen.screenName;
1997
2029
  var defaultScreenName = ((_a = state.session.screens.find(function (screen) { return screen.defaultScreen; })) === null || _a === void 0 ? void 0 : _a.name) || ((_b = state.session.screens[0]) === null || _b === void 0 ? void 0 : _b.name);
1998
2030
  var nextScreenName = state.router.type === "default" /* default */ ? defaultScreenName : state.router.screenName;
1999
2031
  if (nextScreenName !== currentScreenName) {
2000
2032
  var nextScreen = state.session.screens.find(function (item) { return item.name === nextScreenName; });
2001
- return nextScreen ? of14(selectScreen({ screen: nextScreen })) : of14(selectScreenFail({ screenName: nextScreenName }));
2033
+ return nextScreen ? of15(selectScreen({ screen: nextScreen })) : of15(selectScreenFail({ screenName: nextScreenName }));
2002
2034
  }
2003
2035
  var currentViewName = state.view.name;
2004
2036
  var nextViewName = state.router.viewName;
@@ -2015,17 +2047,17 @@ var changeLocationEpic = function (action$, state$) { return action$.pipe(filter
2015
2047
  var needUpdateViews = nextViewName !== currentViewName;
2016
2048
  var resultObservables = [];
2017
2049
  if (needUpdateCursors) {
2018
- resultObservables.push(of14(bcChangeCursors({ cursorsMap: cursorsDiffMap })));
2050
+ resultObservables.push(of15(bcChangeCursors({ cursorsMap: cursorsDiffMap })));
2019
2051
  }
2020
2052
  if (needUpdateViews) {
2021
2053
  var nextView = nextViewName ? state.screen.views.find(function (item) { return item.name === nextViewName; }) : state.screen.primaryView ? state.screen.views.find(function (item) { return item.name === state.screen.primaryView; }) : state.screen.views[0];
2022
- resultObservables.push(nextView ? of14(selectView(nextView)) : of14(selectViewFail({ viewName: nextViewName })));
2054
+ resultObservables.push(nextView ? of15(selectView(nextView)) : of15(selectViewFail({ viewName: nextViewName })));
2023
2055
  }
2024
2056
  if (needUpdateCursors && !needUpdateViews) {
2025
2057
  Object.entries(nextCursors).forEach(function (entry) {
2026
2058
  var bcName = entry[0], cursor = entry[1];
2027
2059
  if (!state.data[bcName].find(function (item) { return item.id === cursor; })) {
2028
- resultObservables.push(of14(bcForceUpdate({ bcName: bcName })));
2060
+ resultObservables.push(of15(bcForceUpdate({ bcName: bcName })));
2029
2061
  }
2030
2062
  });
2031
2063
  }
@@ -2066,27 +2098,27 @@ var userDrillDownChangeCursorsEpic = function (action$, state$) { return action$
2066
2098
  })); };
2067
2099
  // src/epics/screen/apiErrorEpic.ts
2068
2100
  import axios from "axios";
2069
- import { EMPTY as EMPTY10, filter as filter20, mergeMap as mergeMap12, of as of15 } from "rxjs";
2101
+ import { EMPTY as EMPTY11, filter as filter20, mergeMap as mergeMap12, of as of16 } from "rxjs";
2070
2102
  var apiErrorEpic = function (action$) { return action$.pipe(filter20(apiError.match), mergeMap12(function (action) {
2071
2103
  var _a = action.payload, error = _a.error, callContext = _a.callContext;
2072
2104
  if (error.response) {
2073
- return of15(httpError({
2105
+ return of16(httpError({
2074
2106
  statusCode: error.response.status,
2075
2107
  error: error,
2076
2108
  callContext: callContext
2077
2109
  }));
2078
2110
  }
2079
2111
  else if (!axios.isCancel(error)) {
2080
- return of15(showViewError({
2112
+ return of16(showViewError({
2081
2113
  error: {
2082
2114
  type: 2 /* NetworkError */
2083
2115
  }
2084
2116
  }));
2085
2117
  }
2086
- return EMPTY10;
2118
+ return EMPTY11;
2087
2119
  })); };
2088
2120
  // src/epics/screen/downloadFileEpic.ts
2089
- import { EMPTY as EMPTY11, filter as filter21, mergeMap as mergeMap13, tap } from "rxjs";
2121
+ import { EMPTY as EMPTY12, filter as filter21, mergeMap as mergeMap13, tap } from "rxjs";
2090
2122
  var downloadFileEpic = function (action$, state$, _a) {
2091
2123
  var api = _a.api;
2092
2124
  return action$.pipe(filter21(downloadFile.match), tap(function (action) {
@@ -2099,7 +2131,7 @@ var downloadFileEpic = function (action$, state$, _a) {
2099
2131
  anchor.click();
2100
2132
  document.body.removeChild(anchor);
2101
2133
  }, 100);
2102
- }), mergeMap13(function () { return EMPTY11; }));
2134
+ }), mergeMap13(function () { return EMPTY12; }));
2103
2135
  };
2104
2136
  // src/epics/screen/httpError401Epic.ts
2105
2137
  import { filter as filter22, map as map5 } from "rxjs";
@@ -2124,24 +2156,24 @@ var httpError409Epic = function (action$, state$) { return action$.pipe(filter23
2124
2156
  });
2125
2157
  })); };
2126
2158
  // src/epics/screen/httpError418Epic.ts
2127
- import { concat as concat10, EMPTY as EMPTY12, filter as filter24, mergeMap as mergeMap14, of as of16 } from "rxjs";
2159
+ import { concat as concat10, EMPTY as EMPTY13, filter as filter24, mergeMap as mergeMap14, of as of17 } from "rxjs";
2128
2160
  var httpError418Epic = function (action$, state$) { return action$.pipe(filter24(httpError.match), filter24(function (action) { return action.payload.statusCode === 418; }), mergeMap14(function (action) {
2129
2161
  var _a, _b;
2130
2162
  var _c = action.payload, error = _c.error, callContext = _c.callContext;
2131
2163
  var result = [];
2132
2164
  var typedError = (_a = error.response) === null || _a === void 0 ? void 0 : _a.data;
2133
2165
  if (!typedError.error.popup) {
2134
- return EMPTY12;
2166
+ return EMPTY13;
2135
2167
  }
2136
2168
  var businessError = {
2137
2169
  type: 0 /* BusinessError */,
2138
2170
  message: typedError.error.popup[0]
2139
2171
  };
2140
- result.push(of16(showViewError({ error: businessError })));
2172
+ result.push(of17(showViewError({ error: businessError })));
2141
2173
  if ((_b = typedError.error.postActions) === null || _b === void 0 ? void 0 : _b[0]) {
2142
2174
  var widget = state$.value.view.widgets.find(function (item) { return item.name === callContext.widgetName; });
2143
2175
  var bcName = widget === null || widget === void 0 ? void 0 : widget.bcName;
2144
- result.push(of16(processPostInvoke({
2176
+ result.push(of17(processPostInvoke({
2145
2177
  bcName: bcName,
2146
2178
  postInvoke: typedError.error.postActions[0],
2147
2179
  widgetName: widget === null || widget === void 0 ? void 0 : widget.name
@@ -2173,7 +2205,7 @@ var httpErrorDefaultEpic = function (action$, state$) { return action$.pipe(filt
2173
2205
  return showViewError({ error: businessError });
2174
2206
  })); };
2175
2207
  // src/epics/screen/downloadFileByUrlEpic.ts
2176
- import { EMPTY as EMPTY13, filter as filter27, mergeMap as mergeMap15, tap as tap2 } from "rxjs";
2208
+ import { EMPTY as EMPTY14, filter as filter27, mergeMap as mergeMap15, tap as tap2 } from "rxjs";
2177
2209
  var downloadFileByUrlEpic = function (action$, state$) { return action$.pipe(filter27(downloadFileByUrl.match), tap2(function (action) {
2178
2210
  var url = action.payload.url;
2179
2211
  var anchor = document.createElement("a");
@@ -2184,16 +2216,16 @@ var downloadFileByUrlEpic = function (action$, state$) { return action$.pipe(fil
2184
2216
  anchor.click();
2185
2217
  document.body.removeChild(anchor);
2186
2218
  }, 100);
2187
- }), mergeMap15(function () { return EMPTY13; })); };
2219
+ }), mergeMap15(function () { return EMPTY14; })); };
2188
2220
  // src/epics/screen/processPostInvokeEpic.ts
2189
- import { EMPTY as EMPTY14, filter as filter28, mergeMap as mergeMap16, of as of17 } from "rxjs";
2221
+ import { EMPTY as EMPTY15, filter as filter28, mergeMap as mergeMap16, of as of18 } from "rxjs";
2190
2222
  var processPostInvokeEpic = function (action$, state$) { return action$.pipe(filter28(processPostInvoke.match), mergeMap16(function (action) {
2191
2223
  var _a;
2192
2224
  var _b;
2193
2225
  var state = state$.value;
2194
2226
  switch (action.payload.postInvoke.type) {
2195
2227
  case "drillDown" /* drillDown */:
2196
- return of17(drillDown(__assign(__assign({}, action.payload.postInvoke), { route: state.router, widgetName: action.payload.widgetName })));
2228
+ return of18(drillDown(__assign(__assign({}, action.payload.postInvoke), { route: state.router, widgetName: action.payload.widgetName })));
2197
2229
  case "postDelete" /* postDelete */: {
2198
2230
  var cursorsMap = (_a = {}, _a[action.payload.bcName] = null, _a);
2199
2231
  var result = [bcChangeCursors({ cursorsMap: cursorsMap })];
@@ -2208,7 +2240,7 @@ var processPostInvokeEpic = function (action$, state$) { return action$.pipe(fil
2208
2240
  widgetName: action.payload.widgetName
2209
2241
  }));
2210
2242
  }
2211
- return of17.apply(void 0, result);
2243
+ return of18.apply(void 0, result);
2212
2244
  }
2213
2245
  case "refreshBC" /* refreshBC */: {
2214
2246
  var bo = state.screen.bo;
@@ -2218,34 +2250,34 @@ var processPostInvokeEpic = function (action$, state$) { return action$.pipe(fil
2218
2250
  var widgetName = action.payload.widgetName || "";
2219
2251
  var infiniteWidgets_1 = state.view.infiniteWidgets || [];
2220
2252
  var infinitePagination = state.view.widgets.some(function (item) { return item.bcName === postInvokeBC_1 && infiniteWidgets_1.includes(item.name); });
2221
- return infinitePagination ? of17(bcFetchDataPages({
2253
+ return infinitePagination ? of18(bcFetchDataPages({
2222
2254
  bcName: postInvokeBCItem.name,
2223
2255
  widgetName: widgetName,
2224
2256
  from: 1,
2225
2257
  to: postInvokeBCItem.page
2226
- })) : of17(bcFetchDataRequest({
2258
+ })) : of18(bcFetchDataRequest({
2227
2259
  bcName: postInvokeBCItem.name,
2228
2260
  widgetName: widgetName
2229
2261
  }));
2230
2262
  }
2231
2263
  case "showMessage" /* showMessage */: {
2232
2264
  var postInvoke = action.payload.postInvoke;
2233
- return of17(showNotification({ type: postInvoke.messageType, message: postInvoke.messageText }));
2265
+ return of18(showNotification({ type: postInvoke.messageType, message: postInvoke.messageText }));
2234
2266
  }
2235
2267
  case "downloadFile" /* downloadFile */: {
2236
2268
  var postInvoke = action.payload.postInvoke;
2237
- return of17(downloadFile({ fileId: postInvoke.fileId }));
2269
+ return of18(downloadFile({ fileId: postInvoke.fileId }));
2238
2270
  }
2239
2271
  case "downloadFileByUrl" /* downloadFileByUrl */: {
2240
2272
  var postInvoke = action.payload.postInvoke;
2241
- return of17(downloadFileByUrl({ url: postInvoke.url }));
2273
+ return of18(downloadFileByUrl({ url: postInvoke.url }));
2242
2274
  }
2243
2275
  default:
2244
- return EMPTY14;
2276
+ return EMPTY15;
2245
2277
  }
2246
2278
  })); };
2247
2279
  // src/epics/screen/processPostInvokeConfirmEpic.ts
2248
- import { EMPTY as EMPTY15, filter as filter29, mergeMap as mergeMap17, of as of18 } from "rxjs";
2280
+ import { EMPTY as EMPTY16, filter as filter29, mergeMap as mergeMap17, of as of19 } from "rxjs";
2249
2281
  import { isAnyOf } from "@reduxjs/toolkit";
2250
2282
  var processPostInvokeConfirmEpic = function (action$, state$) { return action$.pipe(filter29(isAnyOf(processPostInvokeConfirm, processPreInvoke)), mergeMap17(function (action) {
2251
2283
  var _a = action.payload, bcName = _a.bcName, operationType = _a.operationType, widgetName = _a.widgetName;
@@ -2255,7 +2287,7 @@ var processPostInvokeConfirmEpic = function (action$, state$) { return action$.p
2255
2287
  case "info" /* info */:
2256
2288
  case "error" /* error */:
2257
2289
  case "confirmText" /* confirmText */: {
2258
- return of18(operationConfirmation({
2290
+ return of19(operationConfirmation({
2259
2291
  operation: {
2260
2292
  bcName: bcName,
2261
2293
  operationType: operationType,
@@ -2265,7 +2297,7 @@ var processPostInvokeConfirmEpic = function (action$, state$) { return action$.p
2265
2297
  }));
2266
2298
  }
2267
2299
  default:
2268
- return EMPTY15;
2300
+ return EMPTY16;
2269
2301
  }
2270
2302
  })); };
2271
2303
  // src/epics/session/switchRoleEpic.ts
@@ -2274,7 +2306,7 @@ var switchRoleEpic = function (action$, state$) { return action$.pipe(filter30(s
2274
2306
  return concat11([logoutDone(null), login({ login: "", password: "", role: action.payload.role })]);
2275
2307
  })); };
2276
2308
  // src/epics/session/refreshMetaEpic.ts
2277
- import { catchError as catchError5, concat as concat12, filter as filter31, mergeMap as mergeMap18, of as of19, switchMap as switchMap8 } from "rxjs";
2309
+ import { catchError as catchError6, concat as concat12, filter as filter31, mergeMap as mergeMap18, switchMap as switchMap8 } from "rxjs";
2278
2310
  var refreshMetaEpic = function (action$, state$, _a) {
2279
2311
  var api = _a.api;
2280
2312
  return action$.pipe(filter31(refreshMeta.match), mergeMap18(function () {
@@ -2282,19 +2314,20 @@ var refreshMetaEpic = function (action$, state$, _a) {
2282
2314
  var router = state.router;
2283
2315
  var activeRole = state.session.activeRole;
2284
2316
  return api.refreshMeta().pipe(switchMap8(function () { return concat12([
2317
+ refreshMetaDone(),
2285
2318
  logoutDone(null),
2286
2319
  login({ login: "", password: "", role: activeRole }),
2287
2320
  changeLocation({
2288
2321
  location: router
2289
2322
  })
2290
- ]); }), catchError5(function (error) { return of19(loginFail(error)); }));
2323
+ ]); }), catchError6(function (error) { return concat12([loginFail(error), refreshMetaFail(), createApiError(error)]); }));
2291
2324
  }));
2292
2325
  };
2293
2326
  // src/epics/session/loginDoneEpic.ts
2294
- import { EMPTY as EMPTY16, filter as filter32, switchMap as switchMap9 } from "rxjs";
2295
- var loginDoneSessionEpic = function (action$, store) { return action$.pipe(filter32(login.match), switchMap9(function (action) { return EMPTY16; })); };
2327
+ import { EMPTY as EMPTY17, filter as filter32, switchMap as switchMap9 } from "rxjs";
2328
+ var loginDoneSessionEpic = function (action$, store) { return action$.pipe(filter32(login.match), switchMap9(function (action) { return EMPTY17; })); };
2296
2329
  // src/epics/session/loginByAnotherRoleEpic.ts
2297
- import { catchError as catchError6, concat as concat13, filter as filter33, mergeMap as mergeMap19, of as of20, switchMap as switchMap10 } from "rxjs";
2330
+ import { catchError as catchError7, concat as concat13, filter as filter33, mergeMap as mergeMap19, of as of20, switchMap as switchMap10 } from "rxjs";
2298
2331
  var responseStatusMessages = {
2299
2332
  401: "Invalid credentials",
2300
2333
  403: "Access denied"
@@ -2326,18 +2359,18 @@ var loginByAnotherRoleEpic = function (action$, state$, _a) {
2326
2359
  login: data.login
2327
2360
  })
2328
2361
  ], false));
2329
- }), catchError6(function (error) {
2362
+ }), catchError7(function (error) {
2330
2363
  console.error(error);
2331
2364
  var errorMsg = error.response ? responseStatusMessages[error.response.status] || "Server application unavailable" : "Empty server response";
2332
- return of20(loginFail({ errorMsg: errorMsg }));
2365
+ return concat13(of20(loginFail({ errorMsg: errorMsg })), createApiErrorObservable(error));
2333
2366
  }));
2334
2367
  }));
2335
2368
  };
2336
2369
  // src/epics/session/refreshMetaAndReloadPageEpic.ts
2337
- import { concat as concat14, EMPTY as EMPTY17, filter as filter34, of as of21, switchMap as switchMap11, take, tap as tap3 } from "rxjs";
2338
- var refreshMetaAndReloadPageEpic = function (action$, state$) { return action$.pipe(filter34(refreshMetaAndReloadPage.match), switchMap11(function () { return concat14(of21(refreshMeta(null)), action$.pipe(filter34(loginDone.match), take(1), tap3(function () { return location.reload(); }), switchMap11(function () { return EMPTY17; }))); })); };
2370
+ import { concat as concat14, EMPTY as EMPTY18, filter as filter34, of as of21, switchMap as switchMap11, take, tap as tap3 } from "rxjs";
2371
+ var refreshMetaAndReloadPageEpic = function (action$, state$) { return action$.pipe(filter34(refreshMetaAndReloadPage.match), switchMap11(function () { return concat14(of21(refreshMeta()), action$.pipe(filter34(loginDone.match), take(1), tap3(function () { return location.reload(); }), switchMap11(function () { return EMPTY18; }))); })); };
2339
2372
  // src/epics/data/bcNewDataEpic.ts
2340
- import { catchError as catchError7, concat as concat15, EMPTY as EMPTY18, filter as filter35, mergeMap as mergeMap20, of as of22 } from "rxjs";
2373
+ import { catchError as catchError8, concat as concat15, EMPTY as EMPTY19, filter as filter35, mergeMap as mergeMap20, of as of22 } from "rxjs";
2341
2374
  import { OperationTypeCrud as OperationTypeCrud8 } from "@cxbox-ui/schema";
2342
2375
  var bcNewDataEpic = function (action$, state$, _a) {
2343
2376
  var api = _a.api;
@@ -2364,15 +2397,15 @@ var bcNewDataEpic = function (action$, state$, _a) {
2364
2397
  dataItem: {
2365
2398
  id: cursor
2366
2399
  }
2367
- })), postInvoke ? of22(processPostInvoke({ bcName: bcName, postInvoke: postInvoke, cursor: cursor, widgetName: action.payload.widgetName })) : EMPTY18);
2368
- }), catchError7(function (error) {
2400
+ })), postInvoke ? of22(processPostInvoke({ bcName: bcName, postInvoke: postInvoke, cursor: cursor, widgetName: action.payload.widgetName })) : EMPTY19);
2401
+ }), catchError8(function (error) {
2369
2402
  console.error(error);
2370
- return of22(bcNewDataFail({ bcName: bcName }));
2403
+ return concat15(of22(bcNewDataFail({ bcName: bcName })), createApiErrorObservable(error, context));
2371
2404
  }));
2372
2405
  }));
2373
2406
  };
2374
2407
  // src/epics/data/bcLoadMoreEpic.ts
2375
- import { catchError as catchError8, filter as filter37, mergeMap as mergeMap22, of as of24, race } from "rxjs";
2408
+ import { catchError as catchError9, concat as concat16, filter as filter37, mergeMap as mergeMap22, of as of24, race } from "rxjs";
2376
2409
  // src/utils/cancelRequestEpic.ts
2377
2410
  import { filter as filter36, mergeMap as mergeMap21, of as of23, take as take2 } from "rxjs";
2378
2411
  import { isAnyOf as isAnyOf2 } from "@reduxjs/toolkit";
@@ -2413,15 +2446,15 @@ var bcLoadMoreEpic = function (action$, state$, _a) {
2413
2446
  bcUrl: bcUrl,
2414
2447
  hasNext: data.hasNext
2415
2448
  }));
2416
- }), catchError8(function (error) {
2449
+ }), catchError9(function (error) {
2417
2450
  console.error(error);
2418
- return of24(bcFetchDataFail({ bcName: bcName, bcUrl: bcUrl }));
2451
+ return concat16(of24(bcFetchDataFail({ bcName: bcName, bcUrl: bcUrl })), createApiErrorObservable(error));
2419
2452
  }));
2420
2453
  return race(cancelFlow, normalFlow);
2421
2454
  }));
2422
2455
  };
2423
2456
  // src/epics/data/bcSaveDataEpic.ts
2424
- import { catchError as catchError9, concat as concat16, EMPTY as EMPTY19, filter as filter38, mergeMap as mergeMap23, of as of25 } from "rxjs";
2457
+ import { catchError as catchError10, concat as concat17, EMPTY as EMPTY20, filter as filter38, mergeMap as mergeMap23, of as of25 } from "rxjs";
2425
2458
  var bcSaveDataEpic = function (action$, state$, _a) {
2426
2459
  var api = _a.api;
2427
2460
  return action$.pipe(filter38(sendOperation.match), filter38(function (action) { return matchOperationRole(OperationTypeCrud.save, action.payload, state$.value); }), mergeMap23(function (action) {
@@ -2455,16 +2488,16 @@ var bcSaveDataEpic = function (action$, state$, _a) {
2455
2488
  var _a;
2456
2489
  var postInvoke = (_a = data.postActions) === null || _a === void 0 ? void 0 : _a[0];
2457
2490
  var responseDataItem = data.record;
2458
- return concat16(of25(bcSaveDataSuccess({ bcName: bcName, cursor: cursor, dataItem: responseDataItem })), of25(bcFetchRowMeta({ widgetName: widgetName, bcName: bcName })), of25.apply(void 0, fetchChildrenBcData), postInvoke ? of25(processPostInvoke({
2491
+ return concat17(of25(bcSaveDataSuccess({ bcName: bcName, cursor: cursor, dataItem: responseDataItem })), of25(bcFetchRowMeta({ widgetName: widgetName, bcName: bcName })), of25.apply(void 0, fetchChildrenBcData), postInvoke ? of25(processPostInvoke({
2459
2492
  bcName: bcName,
2460
2493
  widgetName: widgetName,
2461
2494
  postInvoke: postInvoke,
2462
2495
  cursor: responseDataItem.id
2463
- })) : EMPTY19, action.payload.onSuccessAction ? of25(action.payload.onSuccessAction) : EMPTY19);
2464
- }), catchError9(function (e) {
2496
+ })) : EMPTY20, action.payload.onSuccessAction ? of25(action.payload.onSuccessAction) : EMPTY20);
2497
+ }), catchError10(function (e) {
2465
2498
  var _a, _b, _c, _d, _e, _f, _g, _h;
2466
2499
  console.error(e);
2467
- var notification$ = EMPTY19;
2500
+ var notification$ = EMPTY20;
2468
2501
  if (action.payload.onSuccessAction && !(options === null || options === void 0 ? void 0 : options.disableNotification)) {
2469
2502
  notification$ = of25(addNotification({
2470
2503
  key: "data_autosave_undo",
@@ -2486,12 +2519,12 @@ var bcSaveDataEpic = function (action$, state$, _a) {
2486
2519
  entityError = (_e = (_d = operationError === null || operationError === void 0 ? void 0 : operationError.error) === null || _d === void 0 ? void 0 : _d.entity) !== null && _e !== void 0 ? _e : entityError;
2487
2520
  viewError = (_h = (_g = (_f = operationError === null || operationError === void 0 ? void 0 : operationError.error) === null || _f === void 0 ? void 0 : _f.popup) === null || _g === void 0 ? void 0 : _g[0]) !== null && _h !== void 0 ? _h : viewError;
2488
2521
  }
2489
- return concat16(of25(bcSaveDataFail({ bcName: bcName, bcUrl: bcUrl, viewError: viewError, entityError: entityError })), notification$);
2522
+ return concat17(of25(bcSaveDataFail({ bcName: bcName, bcUrl: bcUrl, viewError: viewError, entityError: entityError })), notification$, createApiErrorObservable(e, context));
2490
2523
  }));
2491
2524
  }));
2492
2525
  };
2493
2526
  // src/epics/data/selectViewEpic.ts
2494
- import { EMPTY as EMPTY20, filter as filter39, mergeMap as mergeMap24 } from "rxjs";
2527
+ import { EMPTY as EMPTY21, filter as filter39, mergeMap as mergeMap24 } from "rxjs";
2495
2528
  var selectViewEpic = function (action$, state$) { return action$.pipe(filter39(selectView.match), mergeMap24(function (action) {
2496
2529
  try {
2497
2530
  var state_1 = state$.value;
@@ -2517,11 +2550,11 @@ var selectViewEpic = function (action$, state$) { return action$.pipe(filter39(s
2517
2550
  }
2518
2551
  catch (e) {
2519
2552
  console.error("selectView Epic:: ".concat(e));
2520
- return EMPTY20;
2553
+ return EMPTY21;
2521
2554
  }
2522
2555
  })); };
2523
2556
  // src/epics/data/bcFetchDataEpic.ts
2524
- import { catchError as catchError10, concat as concat17, EMPTY as EMPTY21, filter as filter40, mergeMap as mergeMap25, of as of26, race as race2 } from "rxjs";
2557
+ import { catchError as catchError11, concat as concat18, EMPTY as EMPTY22, filter as filter40, mergeMap as mergeMap25, of as of26, race as race2 } from "rxjs";
2525
2558
  import { WidgetTypes as WidgetTypes5 } from "@cxbox-ui/schema";
2526
2559
  import { isAnyOf as isAnyOf3 } from "@reduxjs/toolkit";
2527
2560
  var bcFetchDataEpic = function (action$, state$, _a) {
@@ -2543,7 +2576,7 @@ var bcFetchDataEpic = function (action$, state$, _a) {
2543
2576
  var getChildrenData = function (widgets, bcDictionary, isHierarchy, showConditionCheck) {
2544
2577
  var bcName = action.payload.bcName;
2545
2578
  var _a = bcFetchDataRequest.match(action) ? action.payload : { ignorePageLimit: void 0, keepDelta: void 0 }, ignorePageLimit = _a.ignorePageLimit, keepDelta = _a.keepDelta;
2546
- return concat17.apply(void 0, Object.entries(getBcChildren(bcName, widgets, bcDictionary)).filter(function (_a) {
2579
+ return concat18.apply(void 0, Object.entries(getBcChildren(bcName, widgets, bcDictionary)).filter(function (_a) {
2547
2580
  var childBcName = _a[0], widgetNames = _a[1];
2548
2581
  var nonLazyWidget = widgets.find(function (item) {
2549
2582
  return widgetNames.includes(item.name) && !PopupWidgetTypes.includes(item.type) && showConditionCheck(item);
@@ -2573,7 +2606,7 @@ var bcFetchDataEpic = function (action$, state$, _a) {
2573
2606
  var _k = state.view, widgets = _k.widgets, infiniteWidgets = _k.infiniteWidgets;
2574
2607
  var widget = (_a = widgets === null || widgets === void 0 ? void 0 : widgets.find(function (item) { return item.name === widgetName; })) !== null && _a !== void 0 ? _a : widgets === null || widgets === void 0 ? void 0 : widgets.find(function (item) { return item.bcName === action.payload.bcName; });
2575
2608
  if (!widget) {
2576
- return [EMPTY21];
2609
+ return [EMPTY22];
2577
2610
  }
2578
2611
  var bcName = action.payload.bcName;
2579
2612
  var bc = state.screen.bo.bc[bcName];
@@ -2581,7 +2614,7 @@ var bcFetchDataEpic = function (action$, state$, _a) {
2581
2614
  var limit = (_c = (((_b = widgets === null || widgets === void 0 ? void 0 : widgets.find(function (i) { return i.bcName === bcName; })) === null || _b === void 0 ? void 0 : _b.limit) || bc.limit)) !== null && _c !== void 0 ? _c : 5;
2582
2615
  var sorters = state.screen.sorters[bcName];
2583
2616
  if (showViewPopup.match(action) && bcName === action.payload.calleeBCName) {
2584
- return [EMPTY21];
2617
+ return [EMPTY22];
2585
2618
  }
2586
2619
  var anyHierarchyWidget = widgets === null || widgets === void 0 ? void 0 : widgets.find(function (item) {
2587
2620
  return item.bcName === widget.bcName && item.type === WidgetTypes5.AssocListPopup && isHierarchyWidget(item);
@@ -2639,19 +2672,19 @@ var bcFetchDataEpic = function (action$, state$, _a) {
2639
2672
  var lazyWidget = (!isWidgetVisible(widget) || PopupWidgetTypes.includes(widget.type)) && !parentOfNotLazyWidget;
2640
2673
  var skipLazy = ((_a = state.view.popupData) === null || _a === void 0 ? void 0 : _a.bcName) !== widget.bcName;
2641
2674
  if (lazyWidget && skipLazy) {
2642
- return EMPTY21;
2675
+ return EMPTY22;
2643
2676
  }
2644
- var fetchChildren = ((_b = response.data) === null || _b === void 0 ? void 0 : _b.length) ? getChildrenData(widgets, state.screen.bo.bc, !!anyHierarchyWidget, isWidgetVisible) : EMPTY21;
2677
+ var fetchChildren = ((_b = response.data) === null || _b === void 0 ? void 0 : _b.length) ? getChildrenData(widgets, state.screen.bo.bc, !!anyHierarchyWidget, isWidgetVisible) : EMPTY22;
2645
2678
  var fetchRowMeta = of26(bcFetchRowMeta({ widgetName: widgetName, bcName: bcName }));
2646
- return concat17(cursorChange, of26(bcFetchDataSuccess({
2679
+ return concat18(cursorChange, of26(bcFetchDataSuccess({
2647
2680
  bcName: bcName,
2648
2681
  data: response.data,
2649
2682
  bcUrl: bcUrl,
2650
2683
  hasNext: response.hasNext
2651
2684
  })), fetchRowMeta, fetchChildren);
2652
- }), catchError10(function (error) {
2685
+ }), catchError11(function (error) {
2653
2686
  console.error(error);
2654
- return of26(bcFetchDataFail({ bcName: action.payload.bcName, bcUrl: bcUrl }));
2687
+ return concat18(of26(bcFetchDataFail({ bcName: action.payload.bcName, bcUrl: bcUrl })), createApiErrorObservable(error));
2655
2688
  }));
2656
2689
  return [cancelFlow, cancelByParentBc, normalFlow];
2657
2690
  };
@@ -2663,7 +2696,7 @@ function isHierarchyWidget(widget) {
2663
2696
  return ((_a = widget.options) === null || _a === void 0 ? void 0 : _a.hierarchy) || ((_b = widget.options) === null || _b === void 0 ? void 0 : _b.hierarchyFull);
2664
2697
  }
2665
2698
  // src/epics/data/bcDeleteDataEpic.ts
2666
- import { catchError as catchError11, concat as concat18, EMPTY as EMPTY22, filter as filter41, mergeMap as mergeMap26, of as of27 } from "rxjs";
2699
+ import { catchError as catchError12, concat as concat19, EMPTY as EMPTY23, filter as filter41, mergeMap as mergeMap26, of as of27 } from "rxjs";
2667
2700
  import { OperationTypeCrud as OperationTypeCrud9 } from "@cxbox-ui/schema";
2668
2701
  var bcDeleteDataEpic = function (action$, store$, _a) {
2669
2702
  var api = _a.api;
@@ -2678,15 +2711,15 @@ var bcDeleteDataEpic = function (action$, store$, _a) {
2678
2711
  return api.deleteBcData(state.screen.screenName, bcUrl, context).pipe(mergeMap26(function (data) {
2679
2712
  var _a;
2680
2713
  var postInvoke = (_a = data.postActions) === null || _a === void 0 ? void 0 : _a[0];
2681
- return concat18(isTargetFormatPVF ? of27(bcCancelPendingChanges({ bcNames: [bcName] })) : EMPTY22, of27(bcFetchDataRequest({ bcName: bcName, widgetName: widgetName })), postInvoke ? of27(processPostInvoke({ bcName: bcName, postInvoke: postInvoke, cursor: cursor, widgetName: widgetName })) : EMPTY22);
2682
- }), catchError11(function (error) {
2714
+ return concat19(isTargetFormatPVF ? of27(bcCancelPendingChanges({ bcNames: [bcName] })) : EMPTY23, of27(bcFetchDataRequest({ bcName: bcName, widgetName: widgetName })), postInvoke ? of27(processPostInvoke({ bcName: bcName, postInvoke: postInvoke, cursor: cursor, widgetName: widgetName })) : EMPTY23);
2715
+ }), catchError12(function (error) {
2683
2716
  console.error(error);
2684
- return of27(bcDeleteDataFail({ bcName: bcName }));
2717
+ return concat19(of27(bcDeleteDataFail({ bcName: bcName })), createApiErrorObservable(error, context));
2685
2718
  }));
2686
2719
  }));
2687
2720
  };
2688
2721
  // src/epics/data/bcSelectRecordEpic.ts
2689
- import { concat as concat19, filter as filter42, mergeMap as mergeMap27, of as of28 } from "rxjs";
2722
+ import { concat as concat20, filter as filter42, mergeMap as mergeMap27, of as of28 } from "rxjs";
2690
2723
  var bcSelectRecordEpic = function (action$, store$) { return action$.pipe(filter42(bcSelectRecord.match), mergeMap27(function (action) {
2691
2724
  var _a;
2692
2725
  var _b = action.payload, bcName = _b.bcName, cursor = _b.cursor;
@@ -2701,10 +2734,10 @@ var bcSelectRecordEpic = function (action$, store$) { return action$.pipe(filter
2701
2734
  keepDelta: action.payload.keepDelta
2702
2735
  });
2703
2736
  });
2704
- return concat19(of28(bcChangeCursors({ cursorsMap: (_a = {}, _a[bcName] = cursor, _a), keepDelta: action.payload.keepDelta })), of28(bcFetchRowMeta({ widgetName: "", bcName: bcName })), fetchChildrenBcData);
2737
+ return concat20(of28(bcChangeCursors({ cursorsMap: (_a = {}, _a[bcName] = cursor, _a), keepDelta: action.payload.keepDelta })), of28(bcFetchRowMeta({ widgetName: "", bcName: bcName })), fetchChildrenBcData);
2705
2738
  })); };
2706
2739
  // src/epics/data/changeAssociationEpic.ts
2707
- import { concat as concat20, filter as filter43, mergeMap as mergeMap28, of as of29 } from "rxjs";
2740
+ import { concat as concat21, filter as filter43, mergeMap as mergeMap28, of as of29 } from "rxjs";
2708
2741
  var changeAssociationEpic = function (action$, state$) { return action$.pipe(filter43(changeAssociation.match), mergeMap28(function (action) {
2709
2742
  var _a, _b, _c, _d, _e;
2710
2743
  var state = state$.value;
@@ -2771,10 +2804,10 @@ var changeAssociationEpic = function (action$, state$) { return action$.pipe(fil
2771
2804
  })));
2772
2805
  }
2773
2806
  }
2774
- return concat20.apply(void 0, result);
2807
+ return concat21.apply(void 0, result);
2775
2808
  })); };
2776
2809
  // src/epics/data/bcCancelCreateDataEpic.ts
2777
- import { catchError as catchError12, concat as concat21, EMPTY as EMPTY23, filter as filter44, mergeMap as mergeMap29, of as of30 } from "rxjs";
2810
+ import { catchError as catchError13, concat as concat22, EMPTY as EMPTY24, filter as filter44, mergeMap as mergeMap29, of as of30 } from "rxjs";
2778
2811
  import { OperationTypeCrud as OperationTypeCrud10 } from "@cxbox-ui/schema";
2779
2812
  import { isAnyOf as isAnyOf4 } from "@reduxjs/toolkit";
2780
2813
  var actionTypesMatcher = isAnyOf4(sendOperation);
@@ -2798,18 +2831,18 @@ var bcCancelCreateDataEpic = function (action$, state$, _a) {
2798
2831
  return api.customAction(screenName, bcUrl, data, context, params).pipe(mergeMap29(function (response) {
2799
2832
  var _a;
2800
2833
  var postInvoke = (_a = response.postActions) === null || _a === void 0 ? void 0 : _a[0];
2801
- return concat21(of30(sendOperationSuccess({ bcName: bcName, cursor: cursor })), of30(bcChangeCursors({ cursorsMap: cursorsMap })), postInvoke ? of30(processPostInvoke({ bcName: bcName, postInvoke: postInvoke, cursor: cursor, widgetName: context.widgetName })) : EMPTY23);
2802
- }), catchError12(function (error) {
2834
+ return concat22(of30(sendOperationSuccess({ bcName: bcName, cursor: cursor })), of30(bcChangeCursors({ cursorsMap: cursorsMap })), postInvoke ? of30(processPostInvoke({ bcName: bcName, postInvoke: postInvoke, cursor: cursor, widgetName: context.widgetName })) : EMPTY24);
2835
+ }), catchError13(function (error) {
2803
2836
  console.error(error);
2804
- return of30(bcDeleteDataFail({ bcName: bcName }));
2837
+ return concat22(of30(bcDeleteDataFail({ bcName: bcName })), createApiErrorObservable(error, context));
2805
2838
  }));
2806
2839
  }));
2807
2840
  };
2808
2841
  // src/epics/data/bcSelectDepthRecordEpic.ts
2809
- import { concat as concat22, filter as filter45, mergeMap as mergeMap30, of as of31 } from "rxjs";
2842
+ import { concat as concat23, filter as filter45, mergeMap as mergeMap30, of as of31 } from "rxjs";
2810
2843
  var bcSelectDepthRecordEpic = function (action$) { return action$.pipe(filter45(bcSelectDepthRecord.match), mergeMap30(function (action) {
2811
2844
  var _a = action.payload, bcName = _a.bcName, cursor = _a.cursor, depth = _a.depth;
2812
- return concat22(of31(bcChangeDepthCursor({ bcName: bcName, depth: depth, cursor: cursor })), of31(bcFetchDataRequest({
2845
+ return concat23(of31(bcChangeDepthCursor({ bcName: bcName, depth: depth, cursor: cursor })), of31(bcFetchDataRequest({
2813
2846
  bcName: bcName,
2814
2847
  depth: depth + 1,
2815
2848
  widgetName: "",
@@ -2817,7 +2850,7 @@ var bcSelectDepthRecordEpic = function (action$) { return action$.pipe(filter45(
2817
2850
  })));
2818
2851
  })); };
2819
2852
  // src/epics/data/removeMultivalueTagEpic.ts
2820
- import { concat as concat23, filter as filter46, mergeMap as mergeMap31, of as of32 } from "rxjs";
2853
+ import { concat as concat24, filter as filter46, mergeMap as mergeMap31, of as of32 } from "rxjs";
2821
2854
  var removeMultivalueTagEpic = function (action$, state$) { return action$.pipe(filter46(removeMultivalueTag.match), mergeMap31(function (action) {
2822
2855
  var _a, _b, _c;
2823
2856
  var _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
@@ -2854,7 +2887,7 @@ var removeMultivalueTagEpic = function (action$, state$) { return action$.pipe(f
2854
2887
  return removedNodes.includes(descendant) || !associated.includes(descendant);
2855
2888
  });
2856
2889
  if (parentDeepEmpty) {
2857
- return concat23(of32(removeMultivalueTag(__assign(__assign({}, action.payload), { removedItem: { id: parent_1.id, value: null } }))));
2890
+ return concat24(of32(removeMultivalueTag(__assign(__assign({}, action.payload), { removedItem: { id: parent_1.id, value: null } }))));
2858
2891
  }
2859
2892
  }
2860
2893
  else {
@@ -2875,7 +2908,7 @@ var removeMultivalueTagEpic = function (action$, state$) { return action$.pipe(f
2875
2908
  var _a;
2876
2909
  return (_a = state.view.pendingDataChanges[hierarchyData.bcName]) === null || _a === void 0 ? void 0 : _a[action.payload.removedItem.id];
2877
2910
  })) === null || _m === void 0 ? void 0 : _m.bcName) !== null && _o !== void 0 ? _o : bcName;
2878
- return concat23(of32(changeDataItem({
2911
+ return concat24(of32(changeDataItem({
2879
2912
  /**
2880
2913
  * This is incorrect and will break if different BC has records with
2881
2914
  * identical ids.
@@ -2893,7 +2926,7 @@ var removeMultivalueTagEpic = function (action$, state$) { return action$.pipe(f
2893
2926
  dataItem: (_b = {}, _b[associateFieldKey] = action.payload.dataItem, _b)
2894
2927
  })));
2895
2928
  }
2896
- return concat23(of32(changeDataItem({
2929
+ return concat24(of32(changeDataItem({
2897
2930
  bcName: popupBcName,
2898
2931
  bcUrl: buildBcUrl(popupBcName, true, state),
2899
2932
  cursor: action.payload.removedItem.id,
@@ -2906,7 +2939,7 @@ var removeMultivalueTagEpic = function (action$, state$) { return action$.pipe(f
2906
2939
  })));
2907
2940
  })); };
2908
2941
  // src/epics/data/bcFetchRowMetaRequestEpic.ts
2909
- import { catchError as catchError13, filter as filter47, map as map9, mergeMap as mergeMap32, of as of33, race as race3 } from "rxjs";
2942
+ import { catchError as catchError14, concat as concat25, filter as filter47, map as map9, mergeMap as mergeMap32, of as of33, race as race3 } from "rxjs";
2910
2943
  var bcFetchRowMetaRequestEpic = function (action$, state$, _a) {
2911
2944
  var api = _a.api;
2912
2945
  return action$.pipe(filter47(bcFetchRowMeta.match), mergeMap32(function (action) {
@@ -2924,15 +2957,15 @@ var bcFetchRowMetaRequestEpic = function (action$, state$, _a) {
2924
2957
  });
2925
2958
  var normalFlow = api.fetchRowMeta(screenName, bcUrl, void 0, canceler.cancelToken).pipe(map9(function (rowMeta) {
2926
2959
  return bcFetchRowMetaSuccess({ bcName: bcName, rowMeta: rowMeta, bcUrl: bcUrl, cursor: cursor });
2927
- }), catchError13(function (error) {
2960
+ }), catchError14(function (error) {
2928
2961
  console.error(error);
2929
- return of33(bcFetchRowMetaFail({ bcName: bcName }));
2962
+ return concat25(of33(bcFetchRowMetaFail({ bcName: bcName })), createApiErrorObservable(error));
2930
2963
  }));
2931
2964
  return race3(cancelFlow, cancelByParentBc, normalFlow);
2932
2965
  }));
2933
2966
  };
2934
2967
  // src/epics/data/changeAssociationFullEpic.ts
2935
- import { concat as concat24, filter as filter48, mergeMap as mergeMap33, of as of34 } from "rxjs";
2968
+ import { concat as concat26, filter as filter48, mergeMap as mergeMap33, of as of34 } from "rxjs";
2936
2969
  var changeAssociationFullEpic = function (action$, state$) { return action$.pipe(filter48(changeAssociationFull.match), mergeMap33(function (action) {
2937
2970
  var _a, _b, _c, _d, _e;
2938
2971
  var state = state$.value;
@@ -3013,10 +3046,10 @@ var changeAssociationFullEpic = function (action$, state$) { return action$.pipe
3013
3046
  })));
3014
3047
  }
3015
3048
  }
3016
- return concat24.apply(void 0, result);
3049
+ return concat26.apply(void 0, result);
3017
3050
  })); };
3018
3051
  // src/epics/data/saveAssociationsActiveEpic.ts
3019
- import { catchError as catchError14, concat as concat25, EMPTY as EMPTY24, filter as filter49, mergeMap as mergeMap34, of as of35, switchMap as switchMap12 } from "rxjs";
3052
+ import { catchError as catchError15, concat as concat27, EMPTY as EMPTY25, filter as filter49, mergeMap as mergeMap34, of as of35, switchMap as switchMap12 } from "rxjs";
3020
3053
  var saveAssociationsActiveEpic = function (action$, state$, _a) {
3021
3054
  var api = _a.api;
3022
3055
  return action$.pipe(filter49(saveAssociations.match), filter49(function (action) {
@@ -3034,15 +3067,15 @@ var saveAssociationsActiveEpic = function (action$, state$, _a) {
3034
3067
  return api.associate(state.screen.screenName, bcUrl, Object.values(pendingChanges).filter(function (i) { return i._associate; }), params).pipe(mergeMap34(function (response) {
3035
3068
  var postInvoke = response.postActions[0];
3036
3069
  var calleeWidget = state.view.widgets.find(function (widgetItem) { return widgetItem.bcName === calleeBCName; });
3037
- return concat25(postInvoke ? of35(processPostInvoke({ bcName: calleeBCName, postInvoke: postInvoke, widgetName: calleeWidget === null || calleeWidget === void 0 ? void 0 : calleeWidget.name })) : EMPTY24, of35(bcCancelPendingChanges({ bcNames: bcNames })), of35(bcForceUpdate({ bcName: calleeBCName, widgetName: calleeWidgetName })));
3038
- }), catchError14(function (err) {
3070
+ return concat27(postInvoke ? of35(processPostInvoke({ bcName: calleeBCName, postInvoke: postInvoke, widgetName: calleeWidget === null || calleeWidget === void 0 ? void 0 : calleeWidget.name })) : EMPTY25, of35(bcCancelPendingChanges({ bcNames: bcNames })), of35(bcForceUpdate({ bcName: calleeBCName, widgetName: calleeWidgetName })));
3071
+ }), catchError15(function (err) {
3039
3072
  console.error(err);
3040
- return EMPTY24;
3073
+ return EMPTY25;
3041
3074
  }));
3042
3075
  }));
3043
3076
  };
3044
3077
  // src/epics/data/changeAssociationSameBcEpic.ts
3045
- import { concat as concat26, filter as filter50, mergeMap as mergeMap35, of as of36 } from "rxjs";
3078
+ import { concat as concat28, filter as filter50, mergeMap as mergeMap35, of as of36 } from "rxjs";
3046
3079
  var changeAssociationSameBcEpic = function (action$, state$) { return action$.pipe(filter50(changeAssociationSameBc.match), mergeMap35(function (action) {
3047
3080
  var _a, _b, _c, _d, _e, _f;
3048
3081
  var state = state$.value;
@@ -3084,10 +3117,10 @@ var changeAssociationSameBcEpic = function (action$, state$) { return action$.pi
3084
3117
  })));
3085
3118
  }
3086
3119
  }
3087
- return concat26.apply(void 0, result);
3120
+ return concat28.apply(void 0, result);
3088
3121
  })); };
3089
3122
  // src/epics/data/inlinePickListFetchDataEpic.ts
3090
- import { catchError as catchError15, filter as filter51, mergeMap as mergeMap36, of as of37, race as race4 } from "rxjs";
3123
+ import { catchError as catchError16, filter as filter51, mergeMap as mergeMap36, of as of37, race as race4 } from "rxjs";
3091
3124
  var inlinePickListFetchDataEpic = function (action$, state$, _a) {
3092
3125
  var api = _a.api;
3093
3126
  return action$.pipe(filter51(inlinePickListFetchDataRequest.match), mergeMap36(function (action) {
@@ -3099,7 +3132,7 @@ var inlinePickListFetchDataEpic = function (action$, state$, _a) {
3099
3132
  var cancelFlow = cancelRequestEpic(action$, cancelRequestActionTypes, canceler.cancel, bcFetchDataFail({ bcName: bcName, bcUrl: bcUrl }));
3100
3133
  var normalFlow = api.fetchBcData(state$.value.screen.screenName, bcUrl, (_a = {}, _a[searchSpec + ".contains"] = searchString, _a), canceler.cancelToken).pipe(mergeMap36(function (data) {
3101
3134
  return of37(bcFetchDataSuccess({ bcName: bcName, data: data.data, bcUrl: bcUrl }));
3102
- }), catchError15(function (error) {
3135
+ }), catchError16(function (error) {
3103
3136
  console.error(error);
3104
3137
  return of37(bcFetchDataFail({ bcName: action.payload.bcName, bcUrl: bcUrl }));
3105
3138
  }));
@@ -3177,7 +3210,7 @@ var changeChildrenAssociationsSameBcEpic = function (action$, state$) { return a
3177
3210
  }));
3178
3211
  })); };
3179
3212
  // src/epics/data/changeDescendantsAssociationsFullEpic.ts
3180
- import { concat as concat27, filter as filter55, mergeMap as mergeMap39, of as of41 } from "rxjs";
3213
+ import { concat as concat29, filter as filter55, mergeMap as mergeMap39, of as of41 } from "rxjs";
3181
3214
  var changeDescendantsAssociationsFullEpic = function (action$, state$) { return action$.pipe(filter55(changeDescendantsAssociationsFull.match), mergeMap39(function (action) {
3182
3215
  var state = state$.value;
3183
3216
  var depth = action.payload.depth;
@@ -3195,7 +3228,7 @@ var changeDescendantsAssociationsFullEpic = function (action$, state$) { return
3195
3228
  result.push(of41(changeDescendantsAssociationsFull(__assign(__assign({}, action.payload), { parentId: targetDataItem.id, depth: depth + 1 }))));
3196
3229
  }
3197
3230
  });
3198
- return concat27.apply(void 0, result);
3231
+ return concat29.apply(void 0, result);
3199
3232
  })); };
3200
3233
  // src/api/ObservableApiWrapper.ts
3201
3234
  import axios2 from "axios";
@@ -3239,7 +3272,7 @@ var ObservableApiWrapper = /** @class */ (function () {
3239
3272
  }());
3240
3273
  // src/api/ObservableApi.ts
3241
3274
  import axios3 from "axios";
3242
- import { EMPTY as EMPTY25, expand, map as map11, reduce } from "rxjs";
3275
+ import { EMPTY as EMPTY26, expand, map as map11, reduce } from "rxjs";
3243
3276
  var Api = /** @class */ (function () {
3244
3277
  function class_3(instance) {
3245
3278
  this.api$ = new ObservableApiWrapper(instance);
@@ -3259,7 +3292,7 @@ var Api = /** @class */ (function () {
3259
3292
  if (params === void 0) { params = {}; }
3260
3293
  var currentPage = 1;
3261
3294
  return this.fetchBcData(screenName, bcUrl, __assign(__assign({}, params), { _page: currentPage })).pipe(expand(function (response) {
3262
- return response.hasNext ? _this.fetchBcData(screenName, bcUrl, __assign(__assign({}, params), { _page: ++currentPage })) : EMPTY25;
3295
+ return response.hasNext ? _this.fetchBcData(screenName, bcUrl, __assign(__assign({}, params), { _page: ++currentPage })) : EMPTY26;
3263
3296
  }), reduce(function (items, nextResponse) {
3264
3297
  return __spreadArray(__spreadArray([], items, true), nextResponse.data, true);
3265
3298
  }, []));
@@ -3475,13 +3508,13 @@ var requiredFields = function (_a) {
3475
3508
  return next(action);
3476
3509
  }; };
3477
3510
  };
3478
- function operationRequiresAutosave(operationType, actions) {
3511
+ function operationRequiresAutosave(operationType, actions2) {
3479
3512
  var result = false;
3480
- if (!actions) {
3513
+ if (!actions2) {
3481
3514
  console.error('rowMeta is missing in the middle of "sendOperation" action');
3482
3515
  return result;
3483
3516
  }
3484
- result = flattenOperations(actions).some(function (action) { return action.type === operationType && action.autoSaveBefore; });
3517
+ result = flattenOperations(actions2).some(function (action) { return action.type === operationType && action.autoSaveBefore; });
3485
3518
  return result;
3486
3519
  }
3487
3520
  function getRequiredFieldsMissing(record, pendingChanges, fieldsMeta) {
@@ -3537,8 +3570,8 @@ var preInvokeAction = function (_a) {
3537
3570
  var bcName = (_a = state.view.widgets.find(function (widgetItem) { return widgetItem.name === widgetName_2; })) === null || _a === void 0 ? void 0 : _a.bcName;
3538
3571
  var bcUrl = buildBcUrl(bcName, true, state);
3539
3572
  var rowMeta = bcUrl && ((_b = state.view.rowMeta[bcName]) === null || _b === void 0 ? void 0 : _b[bcUrl]);
3540
- var actions = rowMeta && flattenOperations(rowMeta.actions);
3541
- var preInvoke = (_c = actions === null || actions === void 0 ? void 0 : actions.find(function (item) { return item.type === operationType_1; })) === null || _c === void 0 ? void 0 : _c.preInvoke;
3573
+ var actions2 = rowMeta && flattenOperations(rowMeta.actions);
3574
+ var preInvoke = (_c = actions2 === null || actions2 === void 0 ? void 0 : actions2.find(function (item) { return item.type === operationType_1; })) === null || _c === void 0 ? void 0 : _c.preInvoke;
3542
3575
  return preInvoke && !confirm ? next(processPreInvoke({
3543
3576
  bcName: bcName,
3544
3577
  operationType: operationType_1,