@crystaldesign/diva-backoffice 26.12.0-beta.22 → 26.12.0-beta.24
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/build/esm/index.js +1373 -1140
- package/build/types/backoffice/src/layout/Toolbar/Tools/DivaAgent/navigationToolset.d.ts +25 -0
- package/build/types/backoffice/src/layout/Toolbar/Tools/DivaAgent/navigationToolset.d.ts.map +1 -1
- package/build/types/backoffice/src/tests/unit/layout/Toolbar/Tools/DivaAgent/fakeGridEnvironment.d.ts +11 -0
- package/build/types/backoffice/src/tests/unit/layout/Toolbar/Tools/DivaAgent/fakeGridEnvironment.d.ts.map +1 -1
- package/build/types/backoffice/src/tests/unit/layout/Toolbar/Tools/DivaAgent/locateRowBulkOrFilter.test.d.ts +2 -0
- package/build/types/backoffice/src/tests/unit/layout/Toolbar/Tools/DivaAgent/locateRowBulkOrFilter.test.d.ts.map +1 -0
- package/build/types/backoffice/src/tests/unit/ui/TableRenderJobs/stateHistoryMessages.test.d.ts +2 -0
- package/build/types/backoffice/src/tests/unit/ui/TableRenderJobs/stateHistoryMessages.test.d.ts.map +1 -0
- package/build/types/backoffice/src/ui/List/index.d.ts.map +1 -1
- package/build/types/backoffice/src/ui/TableRenderJobs/components/RenderApprove/components/SessionOverview/index.d.ts.map +1 -1
- package/build/types/backoffice/src/ui/TableRenderJobs/components/RenderApprove/hooks/useSessionOverviewData.d.ts +4 -0
- package/build/types/backoffice/src/ui/TableRenderJobs/components/RenderApprove/hooks/useSessionOverviewData.d.ts.map +1 -1
- package/build/types/backoffice/src/ui/TableRenderJobs/constants.d.ts +1 -0
- package/build/types/backoffice/src/ui/TableRenderJobs/constants.d.ts.map +1 -1
- package/build/types/backoffice/src/ui/TableRenderJobs/utils.d.ts +18 -0
- package/build/types/backoffice/src/ui/TableRenderJobs/utils.d.ts.map +1 -1
- package/package.json +10 -10
package/build/esm/index.js
CHANGED
|
@@ -13816,7 +13816,12 @@ function loadConfiguration(t, root, config, lang, apiConfig) {
|
|
|
13816
13816
|
}, 'von', {
|
|
13817
13817
|
field: 'authorByName'
|
|
13818
13818
|
}],
|
|
13819
|
+
// Recognised render-pipeline failures carry a code that is translated into plain language; the
|
|
13820
|
+
// reported message follows it, so an unclassified failure still shows what the pipeline said.
|
|
13819
13821
|
content: [{
|
|
13822
|
+
field: 'messageCode',
|
|
13823
|
+
translationPrefix: 'renderjob.error'
|
|
13824
|
+
}, {
|
|
13820
13825
|
field: 'message'
|
|
13821
13826
|
}]
|
|
13822
13827
|
}
|
|
@@ -27821,6 +27826,9 @@ var ListWrapper = function ListWrapper(props, ref) {
|
|
|
27821
27826
|
}),
|
|
27822
27827
|
description: item.description
|
|
27823
27828
|
}), /*#__PURE__*/jsx("div", {
|
|
27829
|
+
style: {
|
|
27830
|
+
whiteSpace: 'pre-wrap'
|
|
27831
|
+
},
|
|
27824
27832
|
children: item.content
|
|
27825
27833
|
}), /*#__PURE__*/jsx("div", {
|
|
27826
27834
|
style: {
|
|
@@ -51345,7 +51353,7 @@ var NAVIGATION_TOOL_DEFS = [{
|
|
|
51345
51353
|
argAliases: GRID_ARG_ALIASES
|
|
51346
51354
|
}, {
|
|
51347
51355
|
name: 'locateRow',
|
|
51348
|
-
description: "Locate a row in an on-screen table: already-loaded rows are scrolled to and flashed directly (no filter); rows not loaded yet are found via a server-side column filter (filterApplied:true in the result — the filter narrows the visible table, clearGridFilter restores it). EXACT ALWAYS WINS: an equals match is tried first (numbers and text alike); only when NONE exists does it fall back to a loose contains/prefix candidate — the result then carries `exact:false` and the `note` says so explicitly, it is never disguised as a genuine hit (a contains-match on a KEY column can otherwise stand in for a value that was never actually there, e.g. serieNo '9' resolving to '99'). Pass `exact:true` to reject a loose candidate outright (matchedRows:0) instead of returning it. Optionally selects the match (main-table selection reveals the subtable). ALSO THE CHEAPEST RECORD READ: the returned `firstRow` carries the record fields including ones that are not grid columns at all (featureRefs, catalogId, the raw localized JSON of a name column) — useful fields first, and on very wide records `firstRowOmittedFields` names what did not fit — plus toolbarTools and gridsOnScreen in the same answer. For \"what does this record actually contain\" it beats readGridRows on completeness AND tokens; reach for readGridRows when you want MANY rows, for locateRow when you want ONE row whole. BULK READ: pass 'values' (an array) to fetch SEVERAL records by the same column in ONE call — one trimmed row per value, misses and values that hit no UNIQUE exact row listed separately, no selection
|
|
51356
|
+
description: "Locate a row in an on-screen table: already-loaded rows are scrolled to and flashed directly (no filter); rows not loaded yet are found via a server-side column filter (filterApplied:true in the result — the filter narrows the visible table, clearGridFilter restores it). EXACT ALWAYS WINS: an equals match is tried first (numbers and text alike); only when NONE exists does it fall back to a loose contains/prefix candidate — the result then carries `exact:false` and the `note` says so explicitly, it is never disguised as a genuine hit (a contains-match on a KEY column can otherwise stand in for a value that was never actually there, e.g. serieNo '9' resolving to '99'). Pass `exact:true` to reject a loose candidate outright (matchedRows:0) instead of returning it. Optionally selects the match (main-table selection reveals the subtable). ALSO THE CHEAPEST RECORD READ: the returned `firstRow` carries the record fields including ones that are not grid columns at all (featureRefs, catalogId, the raw localized JSON of a name column) — useful fields first, and on very wide records `firstRowOmittedFields` names what did not fit — plus toolbarTools and gridsOnScreen in the same answer. For \"what does this record actually contain\" it beats readGridRows on completeness AND tokens; reach for readGridRows when you want MANY rows, for locateRow when you want ONE row whole. BULK READ: pass 'values' (an array) to fetch SEVERAL records by the same column in ONE call — on a fully loaded table the rows are read directly, otherwise they go to the server as ONE combined equals filter per 50 values (not one lookup per value, so 100 values cost two server round trips): one trimmed row per value, misses and values that hit no UNIQUE exact row listed separately, no selection, no loose matching. Use it whenever you would otherwise chain locateRow calls (collecting reference ids, pre-write checks), and hand over the WHOLE list — splitting it into batches of a handful only multiplies the calls.",
|
|
51349
51357
|
input_schema: {
|
|
51350
51358
|
type: 'object',
|
|
51351
51359
|
properties: {
|
|
@@ -51366,7 +51374,7 @@ var NAVIGATION_TOOL_DEFS = [{
|
|
|
51366
51374
|
items: {
|
|
51367
51375
|
type: 'string'
|
|
51368
51376
|
},
|
|
51369
|
-
description: 'BULK READ: several values to locate in ONE call — returns one row per value plus the misses; no selection'
|
|
51377
|
+
description: 'BULK READ: several values (a whole list, hundreds are fine) to locate in ONE call — one combined server filter per 50 values; returns one row per value plus the misses; no selection'
|
|
51370
51378
|
},
|
|
51371
51379
|
select: {
|
|
51372
51380
|
type: 'boolean',
|
|
@@ -52143,6 +52151,60 @@ function countExactRows(api, column, value) {
|
|
|
52143
52151
|
return count;
|
|
52144
52152
|
}
|
|
52145
52153
|
|
|
52154
|
+
/** The first `limit` DISPLAYED real rows whose cell is EXACTLY the value — enough to tell none / one / several apart without a full count. */
|
|
52155
|
+
function exactRowsOf(api, column, value, isNumber) {
|
|
52156
|
+
var limit = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 2;
|
|
52157
|
+
var nodes = [];
|
|
52158
|
+
var displayed = api.getDisplayedRowCount();
|
|
52159
|
+
for (var i = 0; i < Math.min(displayed, 500) && nodes.length < limit; i++) {
|
|
52160
|
+
var node = api.getDisplayedRowAtIndex(i);
|
|
52161
|
+
if (isRealRow(node) && cellMatchesExact(cellValueOf(api, node, column), value, isNumber)) nodes.push(node);
|
|
52162
|
+
}
|
|
52163
|
+
return nodes;
|
|
52164
|
+
}
|
|
52165
|
+
|
|
52166
|
+
/**
|
|
52167
|
+
* Whether the DISPLAYED set reaches past what is loaded: a row without data is a block the server has not delivered
|
|
52168
|
+
* yet. A creating table's trailing creator row is such a stub too while it sits past the loaded block, so one stub
|
|
52169
|
+
* there is not a data block. Past 500 displayed rows the rest is not scanned and counts as unloaded.
|
|
52170
|
+
*/
|
|
52171
|
+
function hasUnloadedDisplayedRows(api) {
|
|
52172
|
+
var _api$getGridOption;
|
|
52173
|
+
var displayed = api.getDisplayedRowCount();
|
|
52174
|
+
if (displayed > 500) return true;
|
|
52175
|
+
var stubs = 0;
|
|
52176
|
+
var creatorLoaded = false;
|
|
52177
|
+
for (var i = 0; i < displayed; i++) {
|
|
52178
|
+
var _node$data$__diva_con2;
|
|
52179
|
+
var node = api.getDisplayedRowAtIndex(i);
|
|
52180
|
+
if (!(node !== null && node !== void 0 && node.data)) stubs += 1;else if ((_node$data$__diva_con2 = node.data.__diva_context) !== null && _node$data$__diva_con2 !== void 0 && _node$data$__diva_con2.isEmpty) creatorLoaded = true;
|
|
52181
|
+
}
|
|
52182
|
+
var canCreate = !!((_api$getGridOption = api.getGridOption('context')) !== null && _api$getGridOption !== void 0 && _api$getGridOption.canCreate);
|
|
52183
|
+
return stubs > (canCreate && !creatorLoaded ? 1 : 0);
|
|
52184
|
+
}
|
|
52185
|
+
|
|
52186
|
+
/** Resolves a column id case-insensitively to the grid's own field id and def; throws the teaching error when there is none. */
|
|
52187
|
+
function resolveFilterColumn(api, column) {
|
|
52188
|
+
var _api$getColumns;
|
|
52189
|
+
var direct = api.getColumnDef(column);
|
|
52190
|
+
if (direct) return {
|
|
52191
|
+
column: column,
|
|
52192
|
+
colDef: direct
|
|
52193
|
+
};
|
|
52194
|
+
var fields = ((_api$getColumns = api.getColumns()) !== null && _api$getColumns !== void 0 ? _api$getColumns : []).map(function (c) {
|
|
52195
|
+
return c.getColId();
|
|
52196
|
+
});
|
|
52197
|
+
var matched = fields.find(function (f) {
|
|
52198
|
+
return f.toLowerCase() === column.toLowerCase();
|
|
52199
|
+
});
|
|
52200
|
+
var colDef = matched ? api.getColumnDef(matched) : undefined;
|
|
52201
|
+
if (!matched || !colDef) throw new Error("Column '".concat(column, "' not found. Fields of this table: ").concat(fields.slice(0, 40).join(', ')).concat(fields.length > 40 ? ', …' : '', "."));
|
|
52202
|
+
return {
|
|
52203
|
+
column: matched,
|
|
52204
|
+
colDef: colDef
|
|
52205
|
+
};
|
|
52206
|
+
}
|
|
52207
|
+
|
|
52146
52208
|
/**
|
|
52147
52209
|
* Scan the ALREADY-LOADED rows for matches (unloaded server-side blocks are skipped, never fetched).
|
|
52148
52210
|
* An EXACT hit (case-sensitive text equality / numeric equality) always wins over a merely LOOSE one
|
|
@@ -52192,16 +52254,18 @@ function locateRowCore(_x3, _x4, _x5) {
|
|
|
52192
52254
|
return _locateRowCore.apply(this, arguments);
|
|
52193
52255
|
}
|
|
52194
52256
|
|
|
52195
|
-
/**
|
|
52257
|
+
/**
|
|
52258
|
+
* Server round trips of a bulk locate go in chunks of this many values, ONE combined equals-OR filter per chunk (the
|
|
52259
|
+
* grid's condition cap, the spreadsheet's FILTER_MAX_CONDITIONS, sits well above it). Half a server-side block of 100
|
|
52260
|
+
* rows: the loaded-row scan sees only the first block, so a key that recurs twice still lands inside it.
|
|
52261
|
+
*/
|
|
52196
52262
|
function _locateRowCore() {
|
|
52197
52263
|
_locateRowCore = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee14(api, column, value) {
|
|
52198
52264
|
var _rowIndex;
|
|
52199
52265
|
var select,
|
|
52200
52266
|
deadline,
|
|
52267
|
+
resolved,
|
|
52201
52268
|
colDef,
|
|
52202
|
-
_api$getColumns,
|
|
52203
|
-
fields,
|
|
52204
|
-
matched,
|
|
52205
52269
|
isNumber,
|
|
52206
52270
|
budget,
|
|
52207
52271
|
loaded,
|
|
@@ -52227,31 +52291,13 @@ function _locateRowCore() {
|
|
|
52227
52291
|
select = _args21.length > 3 && _args21[3] !== undefined ? _args21[3] : true;
|
|
52228
52292
|
/** Epoch ms after which no further wait is started — a bulk caller's budget, honoured INSIDE the lookup. */
|
|
52229
52293
|
deadline = _args21.length > 4 ? _args21[4] : undefined;
|
|
52230
|
-
|
|
52231
|
-
|
|
52232
|
-
|
|
52233
|
-
break;
|
|
52234
|
-
}
|
|
52235
|
-
fields = ((_api$getColumns = api.getColumns()) !== null && _api$getColumns !== void 0 ? _api$getColumns : []).map(function (c) {
|
|
52236
|
-
return c.getColId();
|
|
52237
|
-
});
|
|
52238
|
-
matched = fields.find(function (f) {
|
|
52239
|
-
return f.toLowerCase() === column.toLowerCase();
|
|
52240
|
-
});
|
|
52241
|
-
if (matched) {
|
|
52242
|
-
column = matched;
|
|
52243
|
-
colDef = api.getColumnDef(matched);
|
|
52244
|
-
}
|
|
52245
|
-
if (colDef) {
|
|
52246
|
-
_context21.next = 9;
|
|
52247
|
-
break;
|
|
52248
|
-
}
|
|
52249
|
-
throw new Error("Column '".concat(column, "' not found. Fields of this table: ").concat(fields.slice(0, 40).join(', ')).concat(fields.length > 40 ? ', …' : '', "."));
|
|
52250
|
-
case 9:
|
|
52294
|
+
resolved = resolveFilterColumn(api, column);
|
|
52295
|
+
column = resolved.column;
|
|
52296
|
+
colDef = resolved.colDef;
|
|
52251
52297
|
isNumber = matchesNumerically(colDef, String(value)); // A non-numeric value can never match a number column — bail out before the server-side
|
|
52252
52298
|
// filter would send NaN (the grid API 500s on it and the table is left in an error state).
|
|
52253
52299
|
if (!(colDef.cellDataType === 'number' && Number.isNaN(Number(value)))) {
|
|
52254
|
-
_context21.next =
|
|
52300
|
+
_context21.next = 8;
|
|
52255
52301
|
break;
|
|
52256
52302
|
}
|
|
52257
52303
|
return _context21.abrupt("return", {
|
|
@@ -52261,26 +52307,26 @@ function _locateRowCore() {
|
|
|
52261
52307
|
exact: false,
|
|
52262
52308
|
column: column
|
|
52263
52309
|
});
|
|
52264
|
-
case
|
|
52310
|
+
case 8:
|
|
52265
52311
|
// Every wait is capped by the caller's deadline: a bulk read that checked its budget only between lookups let one
|
|
52266
52312
|
// lookup spend three full waits on its own.
|
|
52267
52313
|
budget = function budget(ms) {
|
|
52268
52314
|
return deadline === undefined ? ms : Math.max(0, Math.min(ms, deadline - Date.now()));
|
|
52269
52315
|
}; // Right after a navigation the first server-side block may still be loading — without waiting, the scan misses.
|
|
52270
52316
|
if (isRealRow(api.getDisplayedRowAtIndex(0))) {
|
|
52271
|
-
_context21.next =
|
|
52317
|
+
_context21.next = 12;
|
|
52272
52318
|
break;
|
|
52273
52319
|
}
|
|
52274
|
-
_context21.next =
|
|
52320
|
+
_context21.next = 12;
|
|
52275
52321
|
return waitForRows(api, budget(8000));
|
|
52276
|
-
case
|
|
52322
|
+
case 12:
|
|
52277
52323
|
loaded = scanLoadedRows(api, column, String(value), isNumber);
|
|
52278
52324
|
firstNode = loaded.first;
|
|
52279
52325
|
filterApplied = false;
|
|
52280
52326
|
exact = loaded.exact;
|
|
52281
52327
|
loadedMatches = loaded.count;
|
|
52282
52328
|
if (firstNode) {
|
|
52283
|
-
_context21.next =
|
|
52329
|
+
_context21.next = 48;
|
|
52284
52330
|
break;
|
|
52285
52331
|
}
|
|
52286
52332
|
outOfBudget = {
|
|
@@ -52292,11 +52338,11 @@ function _locateRowCore() {
|
|
|
52292
52338
|
budgetExhausted: true
|
|
52293
52339
|
}; // No budget left for an answer: do not even send the filter.
|
|
52294
52340
|
if (!(budget(LOOKUP_WAIT_MS) <= 0)) {
|
|
52295
|
-
_context21.next =
|
|
52341
|
+
_context21.next = 21;
|
|
52296
52342
|
break;
|
|
52297
52343
|
}
|
|
52298
52344
|
return _context21.abrupt("return", outOfBudget);
|
|
52299
|
-
case
|
|
52345
|
+
case 21:
|
|
52300
52346
|
previousFilter = api.getFilterModel(); // EXACT first, ALWAYS — including for TEXT columns (previously 'contains' only there). A plain
|
|
52301
52347
|
// substring/prefix filter let a value that was never actually present stand in silently for one
|
|
52302
52348
|
// that only LOOKS similar (serieNo '9' ~ '99', partlistKey 'PL_JULIA' ~ 'PL_JULIAN').
|
|
@@ -52325,11 +52371,11 @@ function _locateRowCore() {
|
|
|
52325
52371
|
// pass is NOT tried after it: a second wait would run the bulk callers past their budget, and a loose hit cannot
|
|
52326
52372
|
// stand in for an exact query the server never answered.
|
|
52327
52373
|
exactWait = budget(LOOKUP_WAIT_MS);
|
|
52328
|
-
_context21.next =
|
|
52374
|
+
_context21.next = 29;
|
|
52329
52375
|
return lookupUnanswered(api, exactWait);
|
|
52330
|
-
case
|
|
52376
|
+
case 29:
|
|
52331
52377
|
if (!_context21.sent) {
|
|
52332
|
-
_context21.next =
|
|
52378
|
+
_context21.next = 32;
|
|
52333
52379
|
break;
|
|
52334
52380
|
}
|
|
52335
52381
|
restoreFilter();
|
|
@@ -52337,14 +52383,14 @@ function _locateRowCore() {
|
|
|
52337
52383
|
return _context21.abrupt("return", exactWait < LOOKUP_WAIT_MS ? _objectSpread$X(_objectSpread$X({}, outOfBudget), {}, {
|
|
52338
52384
|
filterApplied: filterApplied
|
|
52339
52385
|
}) : unanswered);
|
|
52340
|
-
case
|
|
52386
|
+
case 32:
|
|
52341
52387
|
candidate = (_api$getDisplayedRowA3 = api.getDisplayedRowAtIndex(0)) !== null && _api$getDisplayedRowA3 !== void 0 ? _api$getDisplayedRowA3 : undefined;
|
|
52342
52388
|
exact = isRealRow(candidate);
|
|
52343
52389
|
// The loose pass is diagnostic only (the closest candidate for a typo'd key) — an exact miss the server DID answer
|
|
52344
52390
|
// stands as the verdict when the budget cannot carry a second wait.
|
|
52345
52391
|
looseWait = budget(LOOKUP_WAIT_MS);
|
|
52346
52392
|
if (!(!exact && !isNumber && looseWait > 0)) {
|
|
52347
|
-
_context21.next =
|
|
52393
|
+
_context21.next = 43;
|
|
52348
52394
|
break;
|
|
52349
52395
|
}
|
|
52350
52396
|
// No exact server-side hit — fall back to the ORIGINAL loose (contains) search so a partial/typo'd
|
|
@@ -52355,11 +52401,11 @@ function _locateRowCore() {
|
|
|
52355
52401
|
type: 'contains',
|
|
52356
52402
|
filter: String(value)
|
|
52357
52403
|
}));
|
|
52358
|
-
_context21.next =
|
|
52404
|
+
_context21.next = 39;
|
|
52359
52405
|
return lookupUnanswered(api, looseWait);
|
|
52360
|
-
case
|
|
52406
|
+
case 39:
|
|
52361
52407
|
if (!_context21.sent) {
|
|
52362
|
-
_context21.next =
|
|
52408
|
+
_context21.next = 42;
|
|
52363
52409
|
break;
|
|
52364
52410
|
}
|
|
52365
52411
|
restoreFilter();
|
|
@@ -52372,11 +52418,11 @@ function _locateRowCore() {
|
|
|
52372
52418
|
} : _objectSpread$X(_objectSpread$X({}, unanswered), {}, {
|
|
52373
52419
|
exactAnswered: true
|
|
52374
52420
|
}));
|
|
52375
|
-
case
|
|
52421
|
+
case 42:
|
|
52376
52422
|
candidate = (_api$getDisplayedRowA4 = api.getDisplayedRowAtIndex(0)) !== null && _api$getDisplayedRowA4 !== void 0 ? _api$getDisplayedRowA4 : undefined;
|
|
52377
|
-
case
|
|
52423
|
+
case 43:
|
|
52378
52424
|
if (isRealRow(candidate)) {
|
|
52379
|
-
_context21.next =
|
|
52425
|
+
_context21.next = 46;
|
|
52380
52426
|
break;
|
|
52381
52427
|
}
|
|
52382
52428
|
restoreFilter();
|
|
@@ -52387,15 +52433,15 @@ function _locateRowCore() {
|
|
|
52387
52433
|
exact: false,
|
|
52388
52434
|
column: column
|
|
52389
52435
|
});
|
|
52390
|
-
case
|
|
52436
|
+
case 46:
|
|
52391
52437
|
firstNode = candidate;
|
|
52392
52438
|
loadedMatches = 0; // recomputed by callers from the now-filtered DISPLAYED set (countExactRows or an equivalent scan).
|
|
52393
|
-
case
|
|
52439
|
+
case 48:
|
|
52394
52440
|
api.ensureIndexVisible((_rowIndex = firstNode.rowIndex) !== null && _rowIndex !== void 0 ? _rowIndex : 0, 'middle');
|
|
52395
52441
|
// Let the scrolled-to row render before highlighting.
|
|
52396
|
-
_context21.next =
|
|
52442
|
+
_context21.next = 51;
|
|
52397
52443
|
return sleep(budget(150));
|
|
52398
|
-
case
|
|
52444
|
+
case 51:
|
|
52399
52445
|
api.flashCells({
|
|
52400
52446
|
rowNodes: [firstNode]
|
|
52401
52447
|
});
|
|
@@ -52414,7 +52460,7 @@ function _locateRowCore() {
|
|
|
52414
52460
|
exact: exact,
|
|
52415
52461
|
column: column
|
|
52416
52462
|
});
|
|
52417
|
-
case
|
|
52463
|
+
case 54:
|
|
52418
52464
|
case "end":
|
|
52419
52465
|
return _context21.stop();
|
|
52420
52466
|
}
|
|
@@ -52422,6 +52468,213 @@ function _locateRowCore() {
|
|
|
52422
52468
|
}));
|
|
52423
52469
|
return _locateRowCore.apply(this, arguments);
|
|
52424
52470
|
}
|
|
52471
|
+
var BULK_LOOKUP_CHUNK = 50;
|
|
52472
|
+
/** How many conditions the grid KEPT of a column filter model — it drops what exceeds filterParams.maxNumConditions silently. */
|
|
52473
|
+
function conditionCountOf(model) {
|
|
52474
|
+
if (!model || _typeof(model) !== 'object') return 0;
|
|
52475
|
+
var conditions = model.conditions;
|
|
52476
|
+
return Array.isArray(conditions) ? conditions.length : 1;
|
|
52477
|
+
}
|
|
52478
|
+
|
|
52479
|
+
/**
|
|
52480
|
+
* Locates MANY values of one column: loaded rows are scanned first, every value still open then goes to the server in
|
|
52481
|
+
* chunks, each chunk ONE combined equals-OR filter. Previously one filter and one wait went out PER VALUE — twenty
|
|
52482
|
+
* values were twenty refilters of a lazy table, and the call budget cut the tail off. The last lookup filter is left in
|
|
52483
|
+
* place; the caller restores the model it captured before.
|
|
52484
|
+
*/
|
|
52485
|
+
function bulkLocateRows(_x6, _x7, _x8, _x9) {
|
|
52486
|
+
return _bulkLocateRows.apply(this, arguments);
|
|
52487
|
+
}
|
|
52488
|
+
|
|
52489
|
+
/** Audit stamps come LAST so they never crowd payload fields out of the row preview. */
|
|
52490
|
+
function _bulkLocateRows() {
|
|
52491
|
+
_bulkLocateRows = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee15(api, column, values, deadline) {
|
|
52492
|
+
var resolved, colDef, budget, result, numeric, judge, partlyLoaded, pending, _i16, _arr4, value, loaded, groups, chunkSize, _iterator27, _step27, _loop10;
|
|
52493
|
+
return _regeneratorRuntime.wrap(function _callee15$(_context23) {
|
|
52494
|
+
while (1) switch (_context23.prev = _context23.next) {
|
|
52495
|
+
case 0:
|
|
52496
|
+
resolved = resolveFilterColumn(api, column);
|
|
52497
|
+
column = resolved.column;
|
|
52498
|
+
colDef = resolved.colDef;
|
|
52499
|
+
budget = function budget(ms) {
|
|
52500
|
+
return Math.max(0, Math.min(ms, deadline - Date.now()));
|
|
52501
|
+
};
|
|
52502
|
+
result = {
|
|
52503
|
+
hits: [],
|
|
52504
|
+
missing: [],
|
|
52505
|
+
unverified: [],
|
|
52506
|
+
notUnique: [],
|
|
52507
|
+
notReached: [],
|
|
52508
|
+
serverLookups: 0,
|
|
52509
|
+
filterApplied: false
|
|
52510
|
+
}; // Right after a navigation the first server-side block may still be loading — without waiting, the scan misses.
|
|
52511
|
+
if (isRealRow(api.getDisplayedRowAtIndex(0))) {
|
|
52512
|
+
_context23.next = 8;
|
|
52513
|
+
break;
|
|
52514
|
+
}
|
|
52515
|
+
_context23.next = 8;
|
|
52516
|
+
return waitForRows(api, budget(8000));
|
|
52517
|
+
case 8:
|
|
52518
|
+
numeric = function numeric(value) {
|
|
52519
|
+
return matchesNumerically(colDef, value);
|
|
52520
|
+
}; // `unproven`: rows on screen are still unloaded, so one loaded hit does not prove uniqueness and none does not prove
|
|
52521
|
+
// absence — only a visible duplicate is a verdict either way.
|
|
52522
|
+
judge = function judge(value, rows, unproven) {
|
|
52523
|
+
if (rows.length > 1) result.notUnique.push({
|
|
52524
|
+
value: value,
|
|
52525
|
+
matches: countExactRows(api, column, value)
|
|
52526
|
+
});else if (unproven) result.unverified.push(value);else if (rows.length === 1) result.hits.push({
|
|
52527
|
+
value: value,
|
|
52528
|
+
node: rows[0]
|
|
52529
|
+
});else result.missing.push(value);
|
|
52530
|
+
}; // On a lazy table the whole row count is on screen but only the first block is loaded: a loaded hit there says
|
|
52531
|
+
// nothing about a second row further down, so such values go to the server like the unloaded ones.
|
|
52532
|
+
partlyLoaded = hasUnloadedDisplayedRows(api);
|
|
52533
|
+
pending = [];
|
|
52534
|
+
_i16 = 0, _arr4 = _toConsumableArray(new Set(values));
|
|
52535
|
+
case 13:
|
|
52536
|
+
if (!(_i16 < _arr4.length)) {
|
|
52537
|
+
_context23.next = 23;
|
|
52538
|
+
break;
|
|
52539
|
+
}
|
|
52540
|
+
value = _arr4[_i16];
|
|
52541
|
+
if (!(colDef.cellDataType === 'number' && Number.isNaN(Number(value)))) {
|
|
52542
|
+
_context23.next = 18;
|
|
52543
|
+
break;
|
|
52544
|
+
}
|
|
52545
|
+
result.missing.push(value);
|
|
52546
|
+
return _context23.abrupt("continue", 20);
|
|
52547
|
+
case 18:
|
|
52548
|
+
loaded = exactRowsOf(api, column, value, numeric(value));
|
|
52549
|
+
if (loaded.length > 1 || loaded.length === 1 && !partlyLoaded) judge(value, loaded, partlyLoaded);else pending.push(value);
|
|
52550
|
+
case 20:
|
|
52551
|
+
_i16++;
|
|
52552
|
+
_context23.next = 13;
|
|
52553
|
+
break;
|
|
52554
|
+
case 23:
|
|
52555
|
+
// A number and a text condition cannot share one column filter — numeric-looking values go in chunks of their own.
|
|
52556
|
+
groups = [pending.filter(numeric), pending.filter(function (value) {
|
|
52557
|
+
return !numeric(value);
|
|
52558
|
+
})].filter(function (group) {
|
|
52559
|
+
return group.length;
|
|
52560
|
+
});
|
|
52561
|
+
chunkSize = BULK_LOOKUP_CHUNK;
|
|
52562
|
+
_iterator27 = _createForOfIteratorHelper$r(groups);
|
|
52563
|
+
_context23.prev = 26;
|
|
52564
|
+
_loop10 = /*#__PURE__*/_regeneratorRuntime.mark(function _loop10() {
|
|
52565
|
+
var queue, isNumber, _api$getFilterModel3, _result$notReached, chunk, conditions, kept, wait, _ref49, overflow, _iterator28, _step28, _value;
|
|
52566
|
+
return _regeneratorRuntime.wrap(function _loop10$(_context22) {
|
|
52567
|
+
while (1) switch (_context22.prev = _context22.next) {
|
|
52568
|
+
case 0:
|
|
52569
|
+
queue = _step27.value;
|
|
52570
|
+
isNumber = numeric(queue[0]);
|
|
52571
|
+
case 2:
|
|
52572
|
+
if (!queue.length) {
|
|
52573
|
+
_context22.next = 26;
|
|
52574
|
+
break;
|
|
52575
|
+
}
|
|
52576
|
+
if (!(budget(LOOKUP_WAIT_MS) <= 0)) {
|
|
52577
|
+
_context22.next = 6;
|
|
52578
|
+
break;
|
|
52579
|
+
}
|
|
52580
|
+
(_result$notReached = result.notReached).push.apply(_result$notReached, _toConsumableArray(queue.splice(0)));
|
|
52581
|
+
return _context22.abrupt("break", 26);
|
|
52582
|
+
case 6:
|
|
52583
|
+
chunk = queue.splice(0, chunkSize);
|
|
52584
|
+
conditions = chunk.map(function (value) {
|
|
52585
|
+
return isNumber ? {
|
|
52586
|
+
filterType: 'number',
|
|
52587
|
+
type: 'equals',
|
|
52588
|
+
filter: Number(value)
|
|
52589
|
+
} : {
|
|
52590
|
+
filterType: 'text',
|
|
52591
|
+
type: 'equals',
|
|
52592
|
+
filter: value
|
|
52593
|
+
};
|
|
52594
|
+
});
|
|
52595
|
+
api.setFilterModel(_defineProperty({}, column, conditions.length === 1 ? conditions[0] : {
|
|
52596
|
+
filterType: conditions[0].filterType,
|
|
52597
|
+
operator: 'OR',
|
|
52598
|
+
conditions: conditions
|
|
52599
|
+
}));
|
|
52600
|
+
result.filterApplied = true;
|
|
52601
|
+
result.serverLookups += 1;
|
|
52602
|
+
// The grid caps a column's conditions (filterParams.maxNumConditions) and drops the rest without a word: what it
|
|
52603
|
+
// dropped goes back on the queue, and the chunks shrink to what it keeps.
|
|
52604
|
+
kept = conditionCountOf((_api$getFilterModel3 = api.getFilterModel()) === null || _api$getFilterModel3 === void 0 ? void 0 : _api$getFilterModel3[column]);
|
|
52605
|
+
if (!(kept === 0)) {
|
|
52606
|
+
_context22.next = 14;
|
|
52607
|
+
break;
|
|
52608
|
+
}
|
|
52609
|
+
throw new Error("The table did not accept an equals filter on '".concat(column, "' \u2014 locate these values one by one (locateRow with value)."));
|
|
52610
|
+
case 14:
|
|
52611
|
+
if (kept < chunk.length) {
|
|
52612
|
+
queue.unshift.apply(queue, _toConsumableArray(chunk.splice(kept)));
|
|
52613
|
+
chunkSize = kept;
|
|
52614
|
+
}
|
|
52615
|
+
wait = budget(LOOKUP_WAIT_MS);
|
|
52616
|
+
_context22.next = 18;
|
|
52617
|
+
return lookupUnanswered(api, wait);
|
|
52618
|
+
case 18:
|
|
52619
|
+
if (!_context22.sent) {
|
|
52620
|
+
_context22.next = 21;
|
|
52621
|
+
break;
|
|
52622
|
+
}
|
|
52623
|
+
// A wait the deadline cut short says nothing about the server — only the full wait does.
|
|
52624
|
+
(_ref49 = wait < LOOKUP_WAIT_MS ? result.notReached : result.unverified).push.apply(_ref49, _toConsumableArray(chunk));
|
|
52625
|
+
return _context22.abrupt("continue", 2);
|
|
52626
|
+
case 21:
|
|
52627
|
+
overflow = hasUnloadedDisplayedRows(api);
|
|
52628
|
+
_iterator28 = _createForOfIteratorHelper$r(chunk);
|
|
52629
|
+
try {
|
|
52630
|
+
for (_iterator28.s(); !(_step28 = _iterator28.n()).done;) {
|
|
52631
|
+
_value = _step28.value;
|
|
52632
|
+
judge(_value, exactRowsOf(api, column, _value, isNumber), overflow);
|
|
52633
|
+
}
|
|
52634
|
+
} catch (err) {
|
|
52635
|
+
_iterator28.e(err);
|
|
52636
|
+
} finally {
|
|
52637
|
+
_iterator28.f();
|
|
52638
|
+
}
|
|
52639
|
+
_context22.next = 2;
|
|
52640
|
+
break;
|
|
52641
|
+
case 26:
|
|
52642
|
+
case "end":
|
|
52643
|
+
return _context22.stop();
|
|
52644
|
+
}
|
|
52645
|
+
}, _loop10);
|
|
52646
|
+
});
|
|
52647
|
+
_iterator27.s();
|
|
52648
|
+
case 29:
|
|
52649
|
+
if ((_step27 = _iterator27.n()).done) {
|
|
52650
|
+
_context23.next = 33;
|
|
52651
|
+
break;
|
|
52652
|
+
}
|
|
52653
|
+
return _context23.delegateYield(_loop10(), "t0", 31);
|
|
52654
|
+
case 31:
|
|
52655
|
+
_context23.next = 29;
|
|
52656
|
+
break;
|
|
52657
|
+
case 33:
|
|
52658
|
+
_context23.next = 38;
|
|
52659
|
+
break;
|
|
52660
|
+
case 35:
|
|
52661
|
+
_context23.prev = 35;
|
|
52662
|
+
_context23.t1 = _context23["catch"](26);
|
|
52663
|
+
_iterator27.e(_context23.t1);
|
|
52664
|
+
case 38:
|
|
52665
|
+
_context23.prev = 38;
|
|
52666
|
+
_iterator27.f();
|
|
52667
|
+
return _context23.finish(38);
|
|
52668
|
+
case 41:
|
|
52669
|
+
return _context23.abrupt("return", result);
|
|
52670
|
+
case 42:
|
|
52671
|
+
case "end":
|
|
52672
|
+
return _context23.stop();
|
|
52673
|
+
}
|
|
52674
|
+
}, _callee15, null, [[26, 35, 38, 41]]);
|
|
52675
|
+
}));
|
|
52676
|
+
return _bulkLocateRows.apply(this, arguments);
|
|
52677
|
+
}
|
|
52425
52678
|
var AUDIT_FIELD = /^(created|lastUpdated)/;
|
|
52426
52679
|
|
|
52427
52680
|
/** Row preview for the model: internal fields dropped, audit stamps last, at most 25 columns, nested objects shortened; names what was cut. */
|
|
@@ -52792,7 +53045,7 @@ function createNavigationToolset(ctx) {
|
|
|
52792
53045
|
}
|
|
52793
53046
|
}, _callee, null, [[8, 14]]);
|
|
52794
53047
|
}));
|
|
52795
|
-
return function applyParentRowPrelude(
|
|
53048
|
+
return function applyParentRowPrelude(_x10, _x11) {
|
|
52796
53049
|
return _ref13.apply(this, arguments);
|
|
52797
53050
|
};
|
|
52798
53051
|
}();
|
|
@@ -52883,7 +53136,7 @@ function createNavigationToolset(ctx) {
|
|
|
52883
53136
|
},
|
|
52884
53137
|
dispatch: function () {
|
|
52885
53138
|
var _dispatch = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee11(name, input, signal, onProgress) {
|
|
52886
|
-
var awaitingApproval, args, _i2, _Object$entries, _Object$entries$_i, alias, canonical, from, _allViews2, views, editorSubviews, _args$path, _root$navigationState2, _allViews3, _views, _editorSubviews, requested, dynamic, known, catalogIdIn, fromCatalog, toCatalog, only, entries, compactWanted, fullWanted, _args$value, _resolveGrid, entry, api, error, multiValues, filterBeforeBulk,
|
|
53139
|
+
var awaitingApproval, args, _i2, _Object$entries, _Object$entries$_i, alias, canonical, from, _allViews2, views, editorSubviews, _args$path, _root$navigationState2, _allViews3, _views, _editorSubviews, requested, dynamic, known, catalogIdIn, fromCatalog, toCatalog, only, entries, compactWanted, fullWanted, _args$value, _resolveGrid, entry, api, error, multiValues, filterBeforeBulk, deadline, bulk, _api$getFilterModel, rows, _bulk, missing, unverified, notUnique, notReached, filterBeforeLocate, located, _args$value2, matchedRows, _cellValueOf2, matchedValue, gridsOnScreen, subtableHint, trimmedFirstRow, revealNote, revealed, _args$id, openError, _entry$getHandle$getD, _entry$getHandle2, _lastNode$data, _entry$getHandle$hasP, _entry$getHandle3, _api$getFilterModel2, prelude, _resolveGrid2, _entry, _api, _error, waitedForRowsMs, previewCell, divaDefs, leafFields, _requested, columns, unknownColumns, limit, _rows, displayed, unsavedRowCount, i, _api$getDisplayedRowA, context, _i3, node, values, truncatedColumns, _iterator5, _step5, column, raw, columnMeta, lastNode, gridContext, hasCreatorRow, creatorRowLoaded, totalRowCount, dirty, filterModel, filteredBy, _ref26, _ref27, _staged$0$rowId, _staged$, _addedRows$, _outcome$committed, _root$navigationState3, _outcome$failed, _outcome$skipped, KNOWN_KEYS, ALIASES, unknownKeys, hints, edits, EDIT_KEYS, EDIT_ALIASES, editFaults, addRows, addRowsTsv, lines, header, duplicate, faults, removeRowIds, removeRows, editedRows, removedRows, intendedRowCount, _prelude, _resolveGrid3, _entry2, _api2, _error2, handle, explicitParentRow, mountedAfterFirst, isSubtable, parentBinding, boundParentRow, parentBindingNote, idColumnPresent, isUnloadedRecordId, reroutedRecordIds, _iterator6, _step6, _edit2, _i4, _arr2, rowId, serieScope, fmt, _divaDefs, checkCellInput, parserRefusal, parseRefusalOf, newRowEditability, newRowEditRefusal, typedValueOf, computedRefusalOf, writeCell, isLookupColumn, lookupWrite, staged, storedWrite, expectedValueOf, stagingNotes, failed, unchanged, removed, removedRecordIds, filterBeforeStaging, keyFilterApplied, restoreUserFilter, keyCache, resolveByKey, resolveTarget, applyEditToNode, columnDefFor, requiredFields, failures, editabilityUnverified, failedRows, problems, needsServerLookup, lookupKeyOf, lookupKeys, _iterator8, _step8, _edit3, _keyColumn2, _keyValue2, _iterator9, _step9, _removal, _keyColumn3, _keyValue3, _iterator10, _step10, edit, keyColumn, keyValue, _iterator11, _step11, removal, _keyColumn, _keyValue, mergedOutcome, mergeCommitOutcome, preApproved, intendedCount, _approved, _iterator12, _step12, _loop3, _ret3, filterWasChanged, _iterator14, _step14, _removal2, _target2, _target2$error, id, _iterator15, _step15, _edit4$column, _edit4, _column2, _target3, _target3$error, _node2, _rowId2, targets, _iterator16, _step16, _api2$getRowNode2, _rowId, addedRows, providedAddColumns, conditionedPosDefaults, lookupWriteCache, _loop4, _ret4, _i7, addSchemaHint, validationErrors, alreadySent, _iterator17, _step17, _api2$getRowNode12, _rowId3, rowErrors, focusNode, totalStaged, survivingOperations, approved, survived, survivedCount, trimEcho, finalOutcome, outcome, serverErrors, reported, isSessionRowId, sentValuesOf, lengthLimitNote, addError, _iterator18, _step18, failure, _iterator19, _step19, _rowId4, _iterator20, _step20, _api2$getRowNode13, _rowId5, _rowErrors, _i9, _addedRows, _api2$getRowNode5, a, outcomeIsEmpty, survivedAfterCommit, autoCommitted, autoCommittedOps, committedIds, failedIds, editTargets, addTargets, removalTargets, hasIdColumn, verifyDeadline, verifyDeadlineHit, filterBeforeVerify, verifyFilterApplied, probeServerRow, restoreVerifyFilter, verifiedChanges, verifiedAdds, verifiedRemovals, _iterator21, _step21, _loop5, _iterator22, _step22, target, probe, _iterator23, _step23, _target, _probe, appliedCount, livePath, editorPathFor, echoValues, withServerIds, addedRowsWithoutId, landedInSeries, foreignSeries, committedOps, confirmedCount, notCommittedRowIds, isEmptyCell, silentlyDropped, dirtyGrids, _root$navigationState4, _livePath$match, _livePath$match2, _ref44, _ref45, _livePath, packageBase, catalogBase, baseId, isPack, _root$webplannerInsta, destroyed, reloadTriggered, knownKeys, source, _action, _input, _entry3$getActions, _entry3$getActions2, _resolveGrid4, _entry3, _error3, _handle, actionName, actionInput, _addTargets, removeTargets, viewActions, available, approve, declined, autoNote, authorizedFetch, refreshAndSettle, unsettledNote, viewAction, mutating, cloneSettled, _catalogId, _handle$getApplicatio7, _handle$getApplicatio8, catalogId, importSettled, _handle$getApplicatio9, _handle$getApplicatio10, _params2$scope, _pricelistNode, app, serieNo, _params2, scope, key, parent, parentHandle, pricelistNode, patch, label, factors, pricelistRowId, factorOutcome, rejected, _handle$getApplicatio11, _handle$getApplicatio12, _app, pricesSettled, removeTargetIn, _target4, _header, live, saved, gone, attempt, rowsNote, _target5, keys, resolved, _iterator26, _step26, _loop8, _ret6, added, newColumns, _loop9, _i15, _resolved, decisionSubtableNote, partialNote, _column8, _search, _entry4$getActions, _entry4$getActions2, _enumDef$customParams, _data, _plainWords$sort$, _resolveGrid5, _entry4, _api3, _error4, _handle2, _column7, search, _limit, wantsExact, needle, equals, optionAction, _yield$optionAction$o, options, note, enumDef, enumData, _enumDef$customParams2, computedDef, savedRowsOnly, fields, _enumDef$cellDataType, firstRow, rowData, patternChars, plainWords, remoteSearch, matchLocally, fetchLimit, fetched, text, _options, fetchCapped, _defs$find$customPara, _defs$find, _handle2$getApplicati, _handle2$getApplicati2, defs, url, _rowFields, appScope, deps, hint, _resolveGrid6, _api4, _error5, _resolveGrid7, _entry5, _error6, _handle3, _label, _autoNote;
|
|
52887
53140
|
return _regeneratorRuntime.wrap(function _callee11$(_context18) {
|
|
52888
53141
|
while (1) switch (_context18.prev = _context18.next) {
|
|
52889
53142
|
case 0:
|
|
@@ -52899,7 +53152,7 @@ function createNavigationToolset(ctx) {
|
|
|
52899
53152
|
if (!args[canonical] && from) args[canonical] = from;
|
|
52900
53153
|
}
|
|
52901
53154
|
_context18.t0 = name;
|
|
52902
|
-
_context18.next = _context18.t0 === 'listViews' ? 6 : _context18.t0 === 'navigateTo' ? 8 : _context18.t0 === 'listGrids' ? 24 : _context18.t0 === 'locateRow' ? 31 : _context18.t0 === 'openToolbarTool' ?
|
|
53155
|
+
_context18.next = _context18.t0 === 'listViews' ? 6 : _context18.t0 === 'navigateTo' ? 8 : _context18.t0 === 'listGrids' ? 24 : _context18.t0 === 'locateRow' ? 31 : _context18.t0 === 'openToolbarTool' ? 86 : _context18.t0 === 'readGridRows' ? 92 : _context18.t0 === 'stageTableEdits' ? 142 : _context18.t0 === 'reloadPage' ? 557 : _context18.t0 === 'reloadPlanner' ? 562 : _context18.t0 === 'runTableAction' ? 576 : _context18.t0 === 'readColumnOptions' ? 827 : _context18.t0 === 'clearGridFilter' ? 896 : _context18.t0 === 'discardStagedChanges' ? 901 : 922;
|
|
52903
53156
|
break;
|
|
52904
53157
|
case 6:
|
|
52905
53158
|
_allViews2 = allViews(root, ctx), views = _allViews2.views, editorSubviews = _allViews2.editorSubviews;
|
|
@@ -53050,110 +53303,51 @@ function createNavigationToolset(ctx) {
|
|
|
53050
53303
|
// BULK READ: one call instead of a locateRow chain. Read-only — the pre-bulk filter model is restored before returning.
|
|
53051
53304
|
multiValues = Array.isArray(input === null || input === void 0 ? void 0 : input.values) ? input.values.map(String) : undefined;
|
|
53052
53305
|
if (!(multiValues !== null && multiValues !== void 0 && multiValues.length)) {
|
|
53053
|
-
_context18.next =
|
|
53306
|
+
_context18.next = 55;
|
|
53054
53307
|
break;
|
|
53055
53308
|
}
|
|
53056
|
-
filterBeforeBulk = api.getFilterModel();
|
|
53057
|
-
rows = [];
|
|
53058
|
-
missing = []; // A miss the server never answered is not a miss (measured: an existing row reported 'missing' on a lazy table).
|
|
53059
|
-
unverified = []; // A contains-hit on a neighbour value, or several rows carrying the value, is NOT a usable reference row.
|
|
53060
|
-
notUnique = []; // Time budget: running past the bridge's call timeout leaves this handler blocking the serialized call queue.
|
|
53309
|
+
filterBeforeBulk = api.getFilterModel(); // Time budget: running past the call timeout leaves this handler blocking the serialized call queue.
|
|
53061
53310
|
deadline = Date.now() + 14000;
|
|
53062
|
-
|
|
53063
|
-
|
|
53064
|
-
|
|
53065
|
-
|
|
53066
|
-
|
|
53067
|
-
|
|
53068
|
-
if ((_step5 = _iterator5.n()).done) {
|
|
53069
|
-
_context18.next = 77;
|
|
53070
|
-
break;
|
|
53071
|
-
}
|
|
53072
|
-
value = _step5.value;
|
|
53073
|
-
if (!(Date.now() >= deadline)) {
|
|
53074
|
-
_context18.next = 52;
|
|
53075
|
-
break;
|
|
53076
|
-
}
|
|
53077
|
-
notReached.push(value);
|
|
53078
|
-
return _context18.abrupt("continue", 75);
|
|
53079
|
-
case 52:
|
|
53080
|
-
hit = void 0;
|
|
53081
|
-
_context18.prev = 53;
|
|
53082
|
-
_context18.next = 56;
|
|
53083
|
-
return locateRowCore(api, args.column, value, false, deadline);
|
|
53084
|
-
case 56:
|
|
53085
|
-
hit = _context18.sent;
|
|
53086
|
-
_context18.next = 62;
|
|
53311
|
+
_context18.prev = 38;
|
|
53312
|
+
_context18.next = 41;
|
|
53313
|
+
return bulkLocateRows(api, args.column, multiValues, deadline);
|
|
53314
|
+
case 41:
|
|
53315
|
+
bulk = _context18.sent;
|
|
53316
|
+
_context18.next = 48;
|
|
53087
53317
|
break;
|
|
53088
|
-
case
|
|
53089
|
-
_context18.prev =
|
|
53090
|
-
_context18.t1 = _context18["catch"](
|
|
53318
|
+
case 44:
|
|
53319
|
+
_context18.prev = 44;
|
|
53320
|
+
_context18.t1 = _context18["catch"](38);
|
|
53321
|
+
// A lookup that failed AFTER its filter went out (a column that takes no equals filter) must not leave the
|
|
53322
|
+
// user's own filter wiped — setFilterModel replaces the whole model, not just this column's part.
|
|
53323
|
+
if (JSON.stringify((_api$getFilterModel = api.getFilterModel()) !== null && _api$getFilterModel !== void 0 ? _api$getFilterModel : {}) !== JSON.stringify(filterBeforeBulk !== null && filterBeforeBulk !== void 0 ? filterBeforeBulk : {})) api.setFilterModel(Object.keys(filterBeforeBulk !== null && filterBeforeBulk !== void 0 ? filterBeforeBulk : {}).length ? filterBeforeBulk : null);
|
|
53091
53324
|
return _context18.abrupt("return", {
|
|
53092
53325
|
error: _context18.t1 instanceof Error ? _context18.t1.message : String(_context18.t1)
|
|
53093
53326
|
});
|
|
53094
|
-
case
|
|
53095
|
-
|
|
53096
|
-
|
|
53097
|
-
|
|
53098
|
-
|
|
53099
|
-
|
|
53100
|
-
|
|
53101
|
-
|
|
53102
|
-
|
|
53103
|
-
|
|
53104
|
-
|
|
53105
|
-
|
|
53106
|
-
|
|
53107
|
-
|
|
53108
|
-
|
|
53109
|
-
|
|
53110
|
-
value: value,
|
|
53111
|
-
matchedValue: String((_cellValueOf2 = cellValueOf(api, hit.node, hit.column)) !== null && _cellValueOf2 !== void 0 ? _cellValueOf2 : '')
|
|
53112
|
-
});
|
|
53113
|
-
return _context18.abrupt("continue", 75);
|
|
53114
|
-
case 69:
|
|
53115
|
-
matches = countExactRows(api, hit.column, value);
|
|
53116
|
-
if (!(matches > 1)) {
|
|
53117
|
-
_context18.next = 73;
|
|
53118
|
-
break;
|
|
53119
|
-
}
|
|
53120
|
-
notUnique.push({
|
|
53121
|
-
value: value,
|
|
53122
|
-
matches: matches
|
|
53123
|
-
});
|
|
53124
|
-
return _context18.abrupt("continue", 75);
|
|
53125
|
-
case 73:
|
|
53126
|
-
trimmed = trimRowData(hit.node.data);
|
|
53127
|
-
rows.push(_objectSpread$X({
|
|
53128
|
-
value: value,
|
|
53129
|
-
firstRow: (_trimmed$row = trimmed === null || trimmed === void 0 ? void 0 : trimmed.row) !== null && _trimmed$row !== void 0 ? _trimmed$row : {}
|
|
53130
|
-
}, trimmed !== null && trimmed !== void 0 && trimmed.omitted.length ? {
|
|
53131
|
-
fieldsOmitted: trimmed.omitted
|
|
53132
|
-
} : {}));
|
|
53133
|
-
case 75:
|
|
53134
|
-
_context18.next = 47;
|
|
53135
|
-
break;
|
|
53136
|
-
case 77:
|
|
53137
|
-
_context18.next = 82;
|
|
53138
|
-
break;
|
|
53139
|
-
case 79:
|
|
53140
|
-
_context18.prev = 79;
|
|
53141
|
-
_context18.t2 = _context18["catch"](45);
|
|
53142
|
-
_iterator5.e(_context18.t2);
|
|
53143
|
-
case 82:
|
|
53144
|
-
_context18.prev = 82;
|
|
53145
|
-
_iterator5.f();
|
|
53146
|
-
return _context18.finish(82);
|
|
53147
|
-
case 85:
|
|
53148
|
-
if (!anyLookupFilter) {
|
|
53149
|
-
_context18.next = 89;
|
|
53327
|
+
case 48:
|
|
53328
|
+
// Row previews BEFORE the filter goes back — the grid recycles its nodes on a refilter.
|
|
53329
|
+
rows = bulk.hits.map(function (_ref17) {
|
|
53330
|
+
var _trimmed$row;
|
|
53331
|
+
var value = _ref17.value,
|
|
53332
|
+
node = _ref17.node;
|
|
53333
|
+
var trimmed = trimRowData(node.data);
|
|
53334
|
+
return _objectSpread$X({
|
|
53335
|
+
value: value,
|
|
53336
|
+
firstRow: (_trimmed$row = trimmed === null || trimmed === void 0 ? void 0 : trimmed.row) !== null && _trimmed$row !== void 0 ? _trimmed$row : {}
|
|
53337
|
+
}, trimmed !== null && trimmed !== void 0 && trimmed.omitted.length ? {
|
|
53338
|
+
fieldsOmitted: trimmed.omitted
|
|
53339
|
+
} : {});
|
|
53340
|
+
}); // A pure read must not leave lookup filters behind — restore what was active before.
|
|
53341
|
+
if (!bulk.filterApplied) {
|
|
53342
|
+
_context18.next = 53;
|
|
53150
53343
|
break;
|
|
53151
53344
|
}
|
|
53152
53345
|
api.setFilterModel(Object.keys(filterBeforeBulk !== null && filterBeforeBulk !== void 0 ? filterBeforeBulk : {}).length ? filterBeforeBulk : null);
|
|
53153
53346
|
// The settle wait lives inside the budget too — the model is restored either way.
|
|
53154
|
-
_context18.next =
|
|
53347
|
+
_context18.next = 53;
|
|
53155
53348
|
return waitForRows(api, Math.max(0, deadline - Date.now()));
|
|
53156
|
-
case
|
|
53349
|
+
case 53:
|
|
53350
|
+
_bulk = bulk, missing = _bulk.missing, unverified = _bulk.unverified, notUnique = _bulk.notUnique, notReached = _bulk.notReached;
|
|
53157
53351
|
return _context18.abrupt("return", _objectSpread$X(_objectSpread$X(_objectSpread$X(_objectSpread$X(_objectSpread$X({
|
|
53158
53352
|
rows: rows
|
|
53159
53353
|
}, missing.length ? {
|
|
@@ -53165,35 +53359,35 @@ function createNavigationToolset(ctx) {
|
|
|
53165
53359
|
} : {}), notReached.length ? {
|
|
53166
53360
|
notReached: notReached
|
|
53167
53361
|
} : {}), {}, {
|
|
53168
|
-
note: "".concat(rows.length, "/").concat(multiValues.length, " located.") + (missing.length ? " Missing values did NOT match — check them for typos before concluding they don't exist." : '') + (unverified.length ? " UNVERIFIED values
|
|
53362
|
+
note: "".concat(rows.length, "/").concat(multiValues.length, " located") + (bulk.serverLookups ? " in ".concat(bulk.serverLookups, " server lookup(s) of up to ").concat(BULK_LOOKUP_CHUNK, " values each.") : ' from the loaded rows, no server lookup needed.') + (missing.length ? " Missing values did NOT match — check them for typos before concluding they don't exist." : '') + (unverified.length ? " UNVERIFIED values have NO verdict \u2014 that is not a miss: their server lookup did not answer within ".concat(LOOKUP_WAIT_MS / 1000, " s, or the batch matched more rows than the table loads at once. Look them up again (smaller batches, once the tab is idle), never conclude they do not exist.") : '') + (notUnique.length ? ' notUnique values match SEVERAL rows (matches = how many carry the exact value) — never use them as a reference id; locateRow such a value on its own (its filter then shows every row carrying it) and readGridRows those rows.' : '') + (notReached.length ? " TIME BUDGET HIT: ".concat(notReached.length, " value(s) were NOT looked up \u2014 call again with just those.") : ' No filter was left behind.')
|
|
53169
53363
|
}));
|
|
53170
|
-
case
|
|
53364
|
+
case 55:
|
|
53171
53365
|
if (!(((_args$value = args.value) !== null && _args$value !== void 0 ? _args$value : '') === '')) {
|
|
53172
|
-
_context18.next =
|
|
53366
|
+
_context18.next = 57;
|
|
53173
53367
|
break;
|
|
53174
53368
|
}
|
|
53175
53369
|
return _context18.abrupt("return", {
|
|
53176
53370
|
error: "Provide 'value' (one row) or 'values' (bulk read)."
|
|
53177
53371
|
});
|
|
53178
|
-
case
|
|
53372
|
+
case 57:
|
|
53179
53373
|
// Captured before the lookup: a rejected loose hit must hand the user's OWN filter back, not an empty one.
|
|
53180
53374
|
filterBeforeLocate = api.getFilterModel();
|
|
53181
|
-
_context18.prev =
|
|
53182
|
-
_context18.next =
|
|
53375
|
+
_context18.prev = 58;
|
|
53376
|
+
_context18.next = 61;
|
|
53183
53377
|
return locateRowCore(api, args.column, String((_args$value2 = args.value) !== null && _args$value2 !== void 0 ? _args$value2 : ''), args.select !== false);
|
|
53184
|
-
case
|
|
53378
|
+
case 61:
|
|
53185
53379
|
located = _context18.sent;
|
|
53186
|
-
_context18.next =
|
|
53380
|
+
_context18.next = 67;
|
|
53187
53381
|
break;
|
|
53188
|
-
case
|
|
53189
|
-
_context18.prev =
|
|
53190
|
-
_context18.
|
|
53382
|
+
case 64:
|
|
53383
|
+
_context18.prev = 64;
|
|
53384
|
+
_context18.t2 = _context18["catch"](58);
|
|
53191
53385
|
return _context18.abrupt("return", {
|
|
53192
|
-
error: _context18.
|
|
53386
|
+
error: _context18.t2 instanceof Error ? _context18.t2.message : String(_context18.t2)
|
|
53193
53387
|
});
|
|
53194
|
-
case
|
|
53388
|
+
case 67:
|
|
53195
53389
|
if (located.node) {
|
|
53196
|
-
_context18.next =
|
|
53390
|
+
_context18.next = 69;
|
|
53197
53391
|
break;
|
|
53198
53392
|
}
|
|
53199
53393
|
return _context18.abrupt("return", _objectSpread$X(_objectSpread$X({
|
|
@@ -53203,34 +53397,34 @@ function createNavigationToolset(ctx) {
|
|
|
53203
53397
|
} : {}), {}, {
|
|
53204
53398
|
note: located.lookupTimedOut ? "The server filter for ".concat(args.column, " = '").concat(args.value, "' did NOT answer within ").concat(LOOKUP_WAIT_MS / 1000, " s \u2014 this is NOT proof that the row is missing (a busy or stuck grid). Retry once the tab is idle; the lookup filter is already removed.") : "No row matched ".concat(args.column, " ~ '").concat(args.value, "'. The lookup filter is already removed \u2014 do NOT call clearGridFilter, it would drop a filter the user set.")
|
|
53205
53399
|
}));
|
|
53206
|
-
case
|
|
53400
|
+
case 69:
|
|
53207
53401
|
matchedRows = located.filterApplied ? countDisplayedRealRows(api) : located.loadedMatches; // `exact:true` requires a genuine hit — a loose (contains/prefix) one is reported as NOT FOUND rather
|
|
53208
53402
|
// than handed back disguised as the requested value (serieNo '9' resolving to '99').
|
|
53209
53403
|
if (!(args.exact && !located.exact)) {
|
|
53210
|
-
_context18.next =
|
|
53404
|
+
_context18.next = 77;
|
|
53211
53405
|
break;
|
|
53212
53406
|
}
|
|
53213
|
-
matchedValue = String((
|
|
53407
|
+
matchedValue = String((_cellValueOf2 = cellValueOf(api, located.node, located.column)) !== null && _cellValueOf2 !== void 0 ? _cellValueOf2 : '');
|
|
53214
53408
|
if (!located.filterApplied) {
|
|
53215
|
-
_context18.next =
|
|
53409
|
+
_context18.next = 76;
|
|
53216
53410
|
break;
|
|
53217
53411
|
}
|
|
53218
53412
|
api.setFilterModel(Object.keys(filterBeforeLocate !== null && filterBeforeLocate !== void 0 ? filterBeforeLocate : {}).length ? filterBeforeLocate : null);
|
|
53219
|
-
_context18.next =
|
|
53413
|
+
_context18.next = 76;
|
|
53220
53414
|
return waitForRows(api);
|
|
53221
|
-
case
|
|
53415
|
+
case 76:
|
|
53222
53416
|
return _context18.abrupt("return", {
|
|
53223
53417
|
matchedRows: 0,
|
|
53224
53418
|
note: "No EXACT match for ".concat(args.column, " = '").concat(args.value, "' \u2014 the closest candidate was '").concat(matchedValue, "' (").concat(matchedRows, " loose candidate(s) total, none exact). Nothing was selected.")
|
|
53225
53419
|
});
|
|
53226
|
-
case
|
|
53420
|
+
case 77:
|
|
53227
53421
|
if (!(args.select !== false)) {
|
|
53228
|
-
_context18.next =
|
|
53422
|
+
_context18.next = 80;
|
|
53229
53423
|
break;
|
|
53230
53424
|
}
|
|
53231
|
-
_context18.next =
|
|
53425
|
+
_context18.next = 80;
|
|
53232
53426
|
return sleep(400);
|
|
53233
|
-
case
|
|
53427
|
+
case 80:
|
|
53234
53428
|
// A subtable already on screen re-renders in place, so only openToolbarTool for one NOT yet listed.
|
|
53235
53429
|
gridsOnScreen = root.gridRegistry.entries.map(function (e) {
|
|
53236
53430
|
return e.label;
|
|
@@ -53261,57 +53455,57 @@ function createNavigationToolset(ctx) {
|
|
|
53261
53455
|
gridsOnScreen: gridsOnScreen,
|
|
53262
53456
|
note: (located.exact ? '' : "NOT AN EXACT MATCH: ".concat(args.column, " = '").concat(args.value, "' was requested but this row's value is different (see firstRow) \u2014 ") + "it only matched loosely. Do not treat this as proof that '".concat(args.value, "' exists; pass exact:true to require a genuine hit instead of the closest candidate. ")) + (located.filterApplied ? 'VERIFY via firstRow that this is really the requested entity. LEAVE the filter active — it is what shows the user the match; clearGridFilter only when the user is done with this row or before locating something else.' : 'The row was already loaded — scrolled to and highlighted WITHOUT filtering (matchedRows counts the loaded rows; more may exist server-side). No filter to clear.') + subtableHint + revealNote
|
|
53263
53457
|
}));
|
|
53264
|
-
case
|
|
53458
|
+
case 86:
|
|
53265
53459
|
openError = openToolbarToolById(String((_args$id = args.id) !== null && _args$id !== void 0 ? _args$id : ''));
|
|
53266
53460
|
if (!openError) {
|
|
53267
|
-
_context18.next =
|
|
53461
|
+
_context18.next = 89;
|
|
53268
53462
|
break;
|
|
53269
53463
|
}
|
|
53270
53464
|
throw new Error(openError);
|
|
53271
|
-
case
|
|
53272
|
-
_context18.next =
|
|
53465
|
+
case 89:
|
|
53466
|
+
_context18.next = 91;
|
|
53273
53467
|
return sleep(400);
|
|
53274
|
-
case
|
|
53468
|
+
case 91:
|
|
53275
53469
|
return _context18.abrupt("return", {
|
|
53276
53470
|
ok: true,
|
|
53277
53471
|
gridsNowOnScreen: root.gridRegistry.entries.map(function (entry) {
|
|
53278
53472
|
return entry.label;
|
|
53279
53473
|
})
|
|
53280
53474
|
});
|
|
53281
|
-
case
|
|
53282
|
-
_context18.next =
|
|
53475
|
+
case 92:
|
|
53476
|
+
_context18.next = 94;
|
|
53283
53477
|
return applyParentRowPrelude(input, args);
|
|
53284
|
-
case
|
|
53478
|
+
case 94:
|
|
53285
53479
|
prelude = _context18.sent;
|
|
53286
53480
|
if (!prelude) {
|
|
53287
|
-
_context18.next =
|
|
53481
|
+
_context18.next = 97;
|
|
53288
53482
|
break;
|
|
53289
53483
|
}
|
|
53290
53484
|
return _context18.abrupt("return", prelude);
|
|
53291
|
-
case
|
|
53485
|
+
case 97:
|
|
53292
53486
|
_resolveGrid2 = resolveGrid(args.grid), _entry = _resolveGrid2.entry, _api = _resolveGrid2.api, _error = _resolveGrid2.error;
|
|
53293
53487
|
if (!(_error || !_api || !_entry)) {
|
|
53294
|
-
_context18.next =
|
|
53488
|
+
_context18.next = 100;
|
|
53295
53489
|
break;
|
|
53296
53490
|
}
|
|
53297
53491
|
return _context18.abrupt("return", {
|
|
53298
53492
|
error: _error
|
|
53299
53493
|
});
|
|
53300
|
-
case
|
|
53494
|
+
case 100:
|
|
53301
53495
|
if (!isRealRow(_api.getDisplayedRowAtIndex(0))) {
|
|
53302
|
-
_context18.next =
|
|
53496
|
+
_context18.next = 104;
|
|
53303
53497
|
break;
|
|
53304
53498
|
}
|
|
53305
|
-
_context18.
|
|
53306
|
-
_context18.next =
|
|
53499
|
+
_context18.t3 = 0;
|
|
53500
|
+
_context18.next = 107;
|
|
53307
53501
|
break;
|
|
53308
|
-
case
|
|
53309
|
-
_context18.next =
|
|
53502
|
+
case 104:
|
|
53503
|
+
_context18.next = 106;
|
|
53310
53504
|
return waitForRows(_api);
|
|
53311
|
-
case
|
|
53312
|
-
_context18.
|
|
53313
|
-
case
|
|
53314
|
-
waitedForRowsMs = _context18.
|
|
53505
|
+
case 106:
|
|
53506
|
+
_context18.t3 = _context18.sent;
|
|
53507
|
+
case 107:
|
|
53508
|
+
waitedForRowsMs = _context18.t3;
|
|
53315
53509
|
previewCell = function previewCell(column, v, truncatedColumns) {
|
|
53316
53510
|
if (v == null || _typeof(v) !== 'object') return v;
|
|
53317
53511
|
// Scalar arrays are VALUES (decisionRefs, featureRefs) — a truncated list is unwritable, return them whole.
|
|
@@ -53350,31 +53544,31 @@ function createNavigationToolset(ctx) {
|
|
|
53350
53544
|
if (context !== null && context !== void 0 && context.isNew && !context.isEmpty) unsavedRowCount += 1;
|
|
53351
53545
|
}
|
|
53352
53546
|
_i3 = 0;
|
|
53353
|
-
case
|
|
53547
|
+
case 120:
|
|
53354
53548
|
if (!(_i3 < displayed && _rows.length < limit)) {
|
|
53355
|
-
_context18.next =
|
|
53549
|
+
_context18.next = 132;
|
|
53356
53550
|
break;
|
|
53357
53551
|
}
|
|
53358
53552
|
node = _api.getDisplayedRowAtIndex(_i3);
|
|
53359
53553
|
if (!(!isRealRow(node) || !node.id)) {
|
|
53360
|
-
_context18.next =
|
|
53554
|
+
_context18.next = 124;
|
|
53361
53555
|
break;
|
|
53362
53556
|
}
|
|
53363
|
-
return _context18.abrupt("continue",
|
|
53364
|
-
case
|
|
53557
|
+
return _context18.abrupt("continue", 129);
|
|
53558
|
+
case 124:
|
|
53365
53559
|
values = {};
|
|
53366
53560
|
truncatedColumns = [];
|
|
53367
|
-
|
|
53561
|
+
_iterator5 = _createForOfIteratorHelper$r(columns);
|
|
53368
53562
|
try {
|
|
53369
|
-
for (
|
|
53370
|
-
column =
|
|
53563
|
+
for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
|
|
53564
|
+
column = _step5.value;
|
|
53371
53565
|
raw = cellValueOf(_api, node, column); // The stored SET_POS_COUNT_VALUE:n form reads like a decision action; the number is what gets written back.
|
|
53372
53566
|
values[column] = isPosCountActionsColumn(divaDefOf(divaDefs, column)) ? posCountOf$1(raw) : previewCell(column, raw, truncatedColumns);
|
|
53373
53567
|
}
|
|
53374
53568
|
} catch (err) {
|
|
53375
|
-
|
|
53569
|
+
_iterator5.e(err);
|
|
53376
53570
|
} finally {
|
|
53377
|
-
|
|
53571
|
+
_iterator5.f();
|
|
53378
53572
|
}
|
|
53379
53573
|
_rows.push(_objectSpread$X({
|
|
53380
53574
|
rowId: node.id,
|
|
@@ -53382,11 +53576,11 @@ function createNavigationToolset(ctx) {
|
|
|
53382
53576
|
}, truncatedColumns.length ? {
|
|
53383
53577
|
truncatedColumns: truncatedColumns
|
|
53384
53578
|
} : {}));
|
|
53385
|
-
case
|
|
53579
|
+
case 129:
|
|
53386
53580
|
_i3++;
|
|
53387
|
-
_context18.next =
|
|
53581
|
+
_context18.next = 120;
|
|
53388
53582
|
break;
|
|
53389
|
-
case
|
|
53583
|
+
case 132:
|
|
53390
53584
|
columnMeta = columns.map(function (field) {
|
|
53391
53585
|
return _objectSpread$X({
|
|
53392
53586
|
column: field
|
|
@@ -53402,7 +53596,7 @@ function createNavigationToolset(ctx) {
|
|
|
53402
53596
|
creatorRowLoaded = !!(lastNode !== null && lastNode !== void 0 && (_lastNode$data = lastNode.data) !== null && _lastNode$data !== void 0 && (_lastNode$data = _lastNode$data.__diva_context) !== null && _lastNode$data !== void 0 && _lastNode$data.isEmpty);
|
|
53403
53597
|
totalRowCount = displayed && (creatorRowLoaded || hasCreatorRow) ? displayed - 1 : displayed; // totalRowCount counts DISPLAYED rows, so an unreconciled optimistic row inflates it.
|
|
53404
53598
|
dirty = (_entry$getHandle$hasP = (_entry$getHandle3 = _entry.getHandle()) === null || _entry$getHandle3 === void 0 ? void 0 : _entry$getHandle3.hasPendingChanges()) !== null && _entry$getHandle$hasP !== void 0 ? _entry$getHandle$hasP : false; // An active filter makes totalRowCount the FILTERED count — without naming it, the number reads as the table size.
|
|
53405
|
-
filterModel = (_api$
|
|
53599
|
+
filterModel = (_api$getFilterModel2 = _api.getFilterModel()) !== null && _api$getFilterModel2 !== void 0 ? _api$getFilterModel2 : {};
|
|
53406
53600
|
filteredBy = Object.keys(filterModel);
|
|
53407
53601
|
return _context18.abrupt("return", _objectSpread$X(_objectSpread$X(_objectSpread$X(_objectSpread$X(_objectSpread$X(_objectSpread$X(_objectSpread$X({
|
|
53408
53602
|
grid: _entry.label,
|
|
@@ -53430,7 +53624,7 @@ function createNavigationToolset(ctx) {
|
|
|
53430
53624
|
countNote: dirty ? 'This table has UNCOMMITTED staged rows, so totalRowCount is inflated by them — do not report it as the row count; enumerate, or reload the page first.' : undefined,
|
|
53431
53625
|
note: _rows.length === 0 ? "The table has 0 loaded rows after polling ".concat(waitedForRowsMs, " ms for its first block \u2014 its prefilter (serie/catalog selection) yields no data here. This is not a loading race any more: treat it as empty; re-read only if you changed the selection/filter or navigated since.") : "Returned ".concat(_rows.length, " of ").concat(totalRowCount, " rows").concat(_rows.length < totalRowCount ? _rows.length === limit ? " \u2014 the `limit` (".concat(limit, ") cut the slice: re-call with a higher limit (max 500) for more. For COUNTS always report totalRowCount, never the returned slice") : ' — the rest is not loaded client-side (server-side lazy table; scrolling or a filter loads more). For COUNTS always report totalRowCount, never the returned slice' : '', ". For stageTableEdits you can address rows directly by keyColumn/keyValue (unique value) \u2014 rowId is the fallback for rows without a unique key.")
|
|
53432
53626
|
}));
|
|
53433
|
-
case
|
|
53627
|
+
case 142:
|
|
53434
53628
|
// A misspelled top-level key would be dropped in silence and `grid` would default to the wrong table.
|
|
53435
53629
|
KNOWN_KEYS = ['grid', 'edits', 'addRows', 'removeRowIds', 'removeRows', 'parentRow', 'addRowsTsv', 'source', 'mapping', 'dryRun'];
|
|
53436
53630
|
ALIASES = {
|
|
@@ -53441,18 +53635,18 @@ function createNavigationToolset(ctx) {
|
|
|
53441
53635
|
}; // Over the MCP bridge a `source` and its `mapping` are replaced by the payload's rows before the call ever
|
|
53442
53636
|
// reaches here. Arriving unexpanded means this is the in-app agent, which has no payload store of its own.
|
|
53443
53637
|
if (!(input !== null && input !== void 0 && input.source || input !== null && input !== void 0 && input.mapping)) {
|
|
53444
|
-
_context18.next =
|
|
53638
|
+
_context18.next = 146;
|
|
53445
53639
|
break;
|
|
53446
53640
|
}
|
|
53447
53641
|
return _context18.abrupt("return", {
|
|
53448
53642
|
error: "A payload `source` (and its `mapping`) only works over the MCP bridge, where the service resolves it into rows. In this chat, pass the rows as addRows or addRowsTsv, with the table's own column ids. Nothing was staged."
|
|
53449
53643
|
});
|
|
53450
|
-
case
|
|
53644
|
+
case 146:
|
|
53451
53645
|
unknownKeys = Object.keys(input !== null && input !== void 0 ? input : {}).filter(function (key) {
|
|
53452
53646
|
return !KNOWN_KEYS.includes(key);
|
|
53453
53647
|
});
|
|
53454
53648
|
if (!unknownKeys.length) {
|
|
53455
|
-
_context18.next =
|
|
53649
|
+
_context18.next = 150;
|
|
53456
53650
|
break;
|
|
53457
53651
|
}
|
|
53458
53652
|
hints = unknownKeys.map(function (key) {
|
|
@@ -53461,7 +53655,7 @@ function createNavigationToolset(ctx) {
|
|
|
53461
53655
|
return _context18.abrupt("return", {
|
|
53462
53656
|
error: "Unknown parameter(s) ".concat(hints.join(', '), ". stageTableEdits takes: ").concat(KNOWN_KEYS.join(', '), ". Nothing was staged.")
|
|
53463
53657
|
});
|
|
53464
|
-
case
|
|
53658
|
+
case 150:
|
|
53465
53659
|
edits = Array.isArray(input === null || input === void 0 ? void 0 : input.edits) ? input.edits : []; // A missing `newValue` would coerce to '' — the documented "clear the cell" — and wipe the cell in silence.
|
|
53466
53660
|
EDIT_KEYS = ['rowId', 'keyColumn', 'keyValue', 'column', 'newValue'];
|
|
53467
53661
|
EDIT_ALIASES = {
|
|
@@ -53484,13 +53678,13 @@ function createNavigationToolset(ctx) {
|
|
|
53484
53678
|
return ["edits[".concat(index, "] ").concat(faults.filter(Boolean).join(' and '))];
|
|
53485
53679
|
});
|
|
53486
53680
|
if (!editFaults.length) {
|
|
53487
|
-
_context18.next =
|
|
53681
|
+
_context18.next = 156;
|
|
53488
53682
|
break;
|
|
53489
53683
|
}
|
|
53490
53684
|
return _context18.abrupt("return", {
|
|
53491
53685
|
error: "".concat(editFaults.join('; '), ". Each edit takes: ").concat(EDIT_KEYS.join(', '), " \u2014 newValue is required (an empty string clears the cell). Nothing was staged.")
|
|
53492
53686
|
});
|
|
53493
|
-
case
|
|
53687
|
+
case 156:
|
|
53494
53688
|
// Entries without the `values` wrapper are unambiguous — treat the entry AS the values.
|
|
53495
53689
|
addRows = (Array.isArray(input === null || input === void 0 ? void 0 : input.addRows) ? input.addRows : []).map(function (row) {
|
|
53496
53690
|
return row && _typeof(row) === 'object' && !('values' in row) && Object.keys(row).length ? {
|
|
@@ -53502,7 +53696,7 @@ function createNavigationToolset(ctx) {
|
|
|
53502
53696
|
// left out of that row, so its default (or 'required' complaint) behaves as if it had never been mentioned.
|
|
53503
53697
|
addRowsTsv = typeof (input === null || input === void 0 ? void 0 : input.addRowsTsv) === 'string' ? input.addRowsTsv : undefined;
|
|
53504
53698
|
if (!(addRowsTsv !== undefined)) {
|
|
53505
|
-
_context18.next =
|
|
53699
|
+
_context18.next = 171;
|
|
53506
53700
|
break;
|
|
53507
53701
|
}
|
|
53508
53702
|
lines = addRowsTsv.split('\n').map(function (line) {
|
|
@@ -53513,13 +53707,13 @@ function createNavigationToolset(ctx) {
|
|
|
53513
53707
|
// Exactly one empty tail is the final newline; a second one is a blank row the caller wrote and gets its fault.
|
|
53514
53708
|
if (lines.length && lines[lines.length - 1] === '') lines.pop();
|
|
53515
53709
|
if (!(lines.length < 2)) {
|
|
53516
|
-
_context18.next =
|
|
53710
|
+
_context18.next = 163;
|
|
53517
53711
|
break;
|
|
53518
53712
|
}
|
|
53519
53713
|
return _context18.abrupt("return", {
|
|
53520
53714
|
error: "addRowsTsv needs a HEADER line of column field ids and at least one row line, tab-separated (e.g. 'typeNo\\tsequenceNo' then 'ART_001\\t10'). Nothing was staged."
|
|
53521
53715
|
});
|
|
53522
|
-
case
|
|
53716
|
+
case 163:
|
|
53523
53717
|
header = lines[0].split('\t').map(function (cell) {
|
|
53524
53718
|
return cell.trim();
|
|
53525
53719
|
});
|
|
@@ -53527,13 +53721,13 @@ function createNavigationToolset(ctx) {
|
|
|
53527
53721
|
return cell && header.indexOf(cell) !== index;
|
|
53528
53722
|
});
|
|
53529
53723
|
if (!(!header.every(Boolean) || duplicate)) {
|
|
53530
|
-
_context18.next =
|
|
53724
|
+
_context18.next = 167;
|
|
53531
53725
|
break;
|
|
53532
53726
|
}
|
|
53533
53727
|
return _context18.abrupt("return", {
|
|
53534
53728
|
error: duplicate ? "addRowsTsv names the column '".concat(duplicate, "' twice in its header line. Nothing was staged.") : 'addRowsTsv has an empty column name in its header line. Nothing was staged.'
|
|
53535
53729
|
});
|
|
53536
|
-
case
|
|
53730
|
+
case 167:
|
|
53537
53731
|
faults = [];
|
|
53538
53732
|
lines.slice(1).forEach(function (line, index) {
|
|
53539
53733
|
if (!line.trim()) {
|
|
@@ -53547,9 +53741,9 @@ function createNavigationToolset(ctx) {
|
|
|
53547
53741
|
}
|
|
53548
53742
|
var values = Object.fromEntries(header.map(function (column, position) {
|
|
53549
53743
|
return [column, cells[position].trim()];
|
|
53550
|
-
}).filter(function (
|
|
53551
|
-
var
|
|
53552
|
-
value =
|
|
53744
|
+
}).filter(function (_ref18) {
|
|
53745
|
+
var _ref19 = _slicedToArray(_ref18, 2),
|
|
53746
|
+
value = _ref19[1];
|
|
53553
53747
|
return value !== '';
|
|
53554
53748
|
}));
|
|
53555
53749
|
if (!Object.keys(values).length) {
|
|
@@ -53561,19 +53755,19 @@ function createNavigationToolset(ctx) {
|
|
|
53561
53755
|
});
|
|
53562
53756
|
});
|
|
53563
53757
|
if (!faults.length) {
|
|
53564
|
-
_context18.next =
|
|
53758
|
+
_context18.next = 171;
|
|
53565
53759
|
break;
|
|
53566
53760
|
}
|
|
53567
53761
|
return _context18.abrupt("return", {
|
|
53568
53762
|
error: "addRowsTsv: ".concat(faults.slice(0, 5).join('; ')).concat(faults.length > 5 ? "; and ".concat(faults.length - 5, " more") : '', ". Every row line needs exactly one cell per header column (an empty cell leaves that column unset). Nothing was staged.")
|
|
53569
53763
|
});
|
|
53570
|
-
case
|
|
53764
|
+
case 171:
|
|
53571
53765
|
removeRowIds = _toConsumableArray(new Set((Array.isArray(input === null || input === void 0 ? void 0 : input.removeRowIds) ? input.removeRowIds : []).map(String)));
|
|
53572
53766
|
removeRows = Array.isArray(input === null || input === void 0 ? void 0 : input.removeRows) ? input.removeRows : []; // A dry run must NEVER reach the staging path below. It only knows how to check NEW rows: entered on
|
|
53573
53767
|
// `dryRun && addRows.length`, a dry run carrying only edits or removals used to fall through and was staged,
|
|
53574
53768
|
// approved and committed for real. A mixed call would check the rows and write the rest — refused as well.
|
|
53575
53769
|
if (!(input !== null && input !== void 0 && input.dryRun && (!addRows.length || edits.length || removeRowIds.length || removeRows.length))) {
|
|
53576
|
-
_context18.next =
|
|
53770
|
+
_context18.next = 175;
|
|
53577
53771
|
break;
|
|
53578
53772
|
}
|
|
53579
53773
|
return _context18.abrupt("return", {
|
|
@@ -53581,7 +53775,7 @@ function createNavigationToolset(ctx) {
|
|
|
53581
53775
|
dryRun: true,
|
|
53582
53776
|
error: 'A dry run checks NEW rows only (addRows, addRowsTsv or a payload `source`)' + (addRows.length ? ', and this call also carries edits or removals, which it would not check. ' : ', and this call carries none. ') + 'Nothing was staged. Re-send without dryRun to apply edits or removals, or send only the rows to check.'
|
|
53583
53777
|
});
|
|
53584
|
-
case
|
|
53778
|
+
case 175:
|
|
53585
53779
|
// The cap counts ROWS on screen: two edits on one row are one live grid row, so each row counts once however
|
|
53586
53780
|
// many of its cells change.
|
|
53587
53781
|
editedRows = new Set(edits.map(function (edit) {
|
|
@@ -53595,7 +53789,7 @@ function createNavigationToolset(ctx) {
|
|
|
53595
53789
|
intendedRowCount = editedRows.size + addRows.length + removeRowIds.length + removedRows.size; // A dry run stages nothing, so the browser limit does not apply to it — checking a big payload in one go is
|
|
53596
53790
|
// exactly how an agent finds out it has to split, and what to fix before it does.
|
|
53597
53791
|
if (!(intendedRowCount > WRITE_ROW_LIMIT && !(input !== null && input !== void 0 && input.dryRun))) {
|
|
53598
|
-
_context18.next =
|
|
53792
|
+
_context18.next = 180;
|
|
53599
53793
|
break;
|
|
53600
53794
|
}
|
|
53601
53795
|
return _context18.abrupt("return", {
|
|
@@ -53603,47 +53797,47 @@ function createNavigationToolset(ctx) {
|
|
|
53603
53797
|
intendedRowCount: intendedRowCount,
|
|
53604
53798
|
limit: WRITE_ROW_LIMIT
|
|
53605
53799
|
});
|
|
53606
|
-
case
|
|
53800
|
+
case 180:
|
|
53607
53801
|
if (!(!edits.length && !addRows.length && !removeRowIds.length && !removeRows.length)) {
|
|
53608
|
-
_context18.next =
|
|
53802
|
+
_context18.next = 182;
|
|
53609
53803
|
break;
|
|
53610
53804
|
}
|
|
53611
53805
|
throw new Error('Provide edits: [{rowId | keyColumn+keyValue, column, newValue}], addRows: [{values}], removeRowIds and/or removeRows: [{keyColumn, keyValue}] — key addressing locates the row for you (unique value of any column), rowIds come from readGridRows.');
|
|
53612
|
-
case
|
|
53613
|
-
_context18.next =
|
|
53806
|
+
case 182:
|
|
53807
|
+
_context18.next = 184;
|
|
53614
53808
|
return applyParentRowPrelude(input, args);
|
|
53615
|
-
case
|
|
53809
|
+
case 184:
|
|
53616
53810
|
_prelude = _context18.sent;
|
|
53617
53811
|
if (!_prelude) {
|
|
53618
|
-
_context18.next =
|
|
53812
|
+
_context18.next = 187;
|
|
53619
53813
|
break;
|
|
53620
53814
|
}
|
|
53621
53815
|
return _context18.abrupt("return", _prelude);
|
|
53622
|
-
case
|
|
53816
|
+
case 187:
|
|
53623
53817
|
_resolveGrid3 = resolveGrid(args.grid), _entry2 = _resolveGrid3.entry, _api2 = _resolveGrid3.api, _error2 = _resolveGrid3.error;
|
|
53624
53818
|
if (!(_error2 || !_api2 || !_entry2)) {
|
|
53625
|
-
_context18.next =
|
|
53819
|
+
_context18.next = 190;
|
|
53626
53820
|
break;
|
|
53627
53821
|
}
|
|
53628
53822
|
return _context18.abrupt("return", {
|
|
53629
53823
|
error: _error2
|
|
53630
53824
|
});
|
|
53631
|
-
case
|
|
53825
|
+
case 190:
|
|
53632
53826
|
handle = _entry2.getHandle();
|
|
53633
53827
|
if (handle) {
|
|
53634
|
-
_context18.next =
|
|
53828
|
+
_context18.next = 193;
|
|
53635
53829
|
break;
|
|
53636
53830
|
}
|
|
53637
53831
|
return _context18.abrupt("return", {
|
|
53638
53832
|
error: "Table '".concat(_entry2.label, "' is not ready.")
|
|
53639
53833
|
});
|
|
53640
|
-
case
|
|
53834
|
+
case 193:
|
|
53641
53835
|
if (!handle.hasPendingChanges()) {
|
|
53642
|
-
_context18.next =
|
|
53836
|
+
_context18.next = 195;
|
|
53643
53837
|
break;
|
|
53644
53838
|
}
|
|
53645
53839
|
throw new Error('This table already has uncommitted (staged) changes — wait for the pending decision or ask the user to save/discard their manual edits first.');
|
|
53646
|
-
case
|
|
53840
|
+
case 195:
|
|
53647
53841
|
// Without parentRow the write lands under the parent the subtable is bound to — the one an earlier call left
|
|
53648
53842
|
// selected. Only the subtable's own declaration names it; without one the write is refused, never guessed.
|
|
53649
53843
|
explicitParentRow = !!(input !== null && input !== void 0 && input.parentRow); // Mount order is the fallback for a subtable whose module declares no parent (media refs, the assortment item
|
|
@@ -53654,13 +53848,13 @@ function createNavigationToolset(ctx) {
|
|
|
53654
53848
|
isSubtable = explicitParentRow || !!_entry2.getBoundParent || mountedAfterFirst;
|
|
53655
53849
|
parentBinding = explicitParentRow ? undefined : declaredParentBinding(_entry2);
|
|
53656
53850
|
if (!(parentBinding !== null && parentBinding !== void 0 && parentBinding.refusal)) {
|
|
53657
|
-
_context18.next =
|
|
53851
|
+
_context18.next = 201;
|
|
53658
53852
|
break;
|
|
53659
53853
|
}
|
|
53660
53854
|
return _context18.abrupt("return", {
|
|
53661
53855
|
error: parentBinding.refusal
|
|
53662
53856
|
});
|
|
53663
|
-
case
|
|
53857
|
+
case 201:
|
|
53664
53858
|
boundParentRow = parentBinding === null || parentBinding === void 0 ? void 0 : parentBinding.parent;
|
|
53665
53859
|
parentBindingNote = boundParentRow ? " SUBTABLE WRITE WITHOUT parentRow: bound to the parent row this subtable is showing \u2014 '".concat(boundParentRow.grid, "' ").concat(boundParentRow.column, " = '").concat(boundParentRow.value, "' (boundParentRow). Verify that is the intended parent; pass parentRow to bind explicitly.") : mountedAfterFirst && !explicitParentRow && !_entry2.getBoundParent ? ' SUBTABLE WRITE WITHOUT parentRow: this table declares no parent binding, so the parent row it landed under cannot be named here — verify it in the table before building on the write.' : ''; // A record _id offered as rowId — partlistpos hands the _id out AS the rowId, and locateRow.firstRow._id is the
|
|
53666
53860
|
// same value — is a valid address once its node is loaded. When it is not (the subtable re-rendered, a filter
|
|
@@ -53671,10 +53865,10 @@ function createNavigationToolset(ctx) {
|
|
|
53671
53865
|
return idColumnPresent && typeof rowId === 'string' && isRecordId(rowId) && !isRealRow(_api2.getRowNode(rowId));
|
|
53672
53866
|
};
|
|
53673
53867
|
reroutedRecordIds = 0;
|
|
53674
|
-
|
|
53868
|
+
_iterator6 = _createForOfIteratorHelper$r(edits);
|
|
53675
53869
|
try {
|
|
53676
|
-
for (
|
|
53677
|
-
_edit2 =
|
|
53870
|
+
for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
|
|
53871
|
+
_edit2 = _step6.value;
|
|
53678
53872
|
if ((_edit2 === null || _edit2 === void 0 ? void 0 : _edit2.rowId) != null && isUnloadedRecordId(String(_edit2.rowId))) {
|
|
53679
53873
|
_edit2.keyColumn = '_id';
|
|
53680
53874
|
_edit2.keyValue = String(_edit2.rowId);
|
|
@@ -53683,45 +53877,45 @@ function createNavigationToolset(ctx) {
|
|
|
53683
53877
|
}
|
|
53684
53878
|
}
|
|
53685
53879
|
} catch (err) {
|
|
53686
|
-
|
|
53880
|
+
_iterator6.e(err);
|
|
53687
53881
|
} finally {
|
|
53688
|
-
|
|
53882
|
+
_iterator6.f();
|
|
53689
53883
|
}
|
|
53690
53884
|
_i4 = 0, _arr2 = _toConsumableArray(removeRowIds);
|
|
53691
|
-
case
|
|
53885
|
+
case 209:
|
|
53692
53886
|
if (!(_i4 < _arr2.length)) {
|
|
53693
|
-
_context18.next =
|
|
53887
|
+
_context18.next = 219;
|
|
53694
53888
|
break;
|
|
53695
53889
|
}
|
|
53696
53890
|
rowId = _arr2[_i4];
|
|
53697
53891
|
if (isUnloadedRecordId(rowId)) {
|
|
53698
|
-
_context18.next =
|
|
53892
|
+
_context18.next = 213;
|
|
53699
53893
|
break;
|
|
53700
53894
|
}
|
|
53701
|
-
return _context18.abrupt("continue",
|
|
53702
|
-
case
|
|
53895
|
+
return _context18.abrupt("continue", 216);
|
|
53896
|
+
case 213:
|
|
53703
53897
|
removeRowIds.splice(removeRowIds.indexOf(rowId), 1);
|
|
53704
53898
|
removeRows.push({
|
|
53705
53899
|
keyColumn: '_id',
|
|
53706
53900
|
keyValue: rowId
|
|
53707
53901
|
});
|
|
53708
53902
|
reroutedRecordIds += 1;
|
|
53709
|
-
case
|
|
53903
|
+
case 216:
|
|
53710
53904
|
_i4++;
|
|
53711
|
-
_context18.next =
|
|
53905
|
+
_context18.next = 209;
|
|
53712
53906
|
break;
|
|
53713
|
-
case
|
|
53907
|
+
case 219:
|
|
53714
53908
|
// Hard stop for CREATES when the serie scope is unresolved — the row would be filed wherever the endpoint defaults to.
|
|
53715
53909
|
serieScope = serieScopeOf(_entry2, handle);
|
|
53716
53910
|
if (!(addRows.length && serieScope && !serieScope.serieId)) {
|
|
53717
|
-
_context18.next =
|
|
53911
|
+
_context18.next = 222;
|
|
53718
53912
|
break;
|
|
53719
53913
|
}
|
|
53720
53914
|
return _context18.abrupt("return", {
|
|
53721
53915
|
error: "'".concat(_entry2.label, "' belongs to ONE serie (its endpoint is /series/<id>/\u2026) and NO serie is selected, so a new row would be filed wherever the view defaults to \u2014 usually the FIRST serie (serie 0, the components serie). Nothing was staged."),
|
|
53722
53916
|
fix: 'selectSerie(<serieNo>) first — listSeries shows the numbers and the current selection — then re-send this call unchanged.'
|
|
53723
53917
|
});
|
|
53724
|
-
case
|
|
53918
|
+
case 222:
|
|
53725
53919
|
fmt = function fmt(v) {
|
|
53726
53920
|
return v == null ? undefined : _typeof(v) === 'object' ? JSON.stringify(v).slice(0, 80) : v;
|
|
53727
53921
|
}; // The AG col def loses the DIVA custom props (editable/required/customParams) — check the DIVA def too.
|
|
@@ -53805,20 +53999,20 @@ function createNavigationToolset(ctx) {
|
|
|
53805
53999
|
};
|
|
53806
54000
|
var multi = !!(divaDef !== null && divaDef !== void 0 && (_divaDef$customParams7 = divaDef.customParams) !== null && _divaDef$customParams7 !== void 0 && _divaDef$customParams7.multiple);
|
|
53807
54001
|
var resolve = function resolve(token) {
|
|
53808
|
-
var
|
|
53809
|
-
return (
|
|
54002
|
+
var _ref20, _enumData$find;
|
|
54003
|
+
return (_ref20 = (_enumData$find = enumData.find(function (e) {
|
|
53810
54004
|
return String(e === null || e === void 0 ? void 0 : e.value) === token;
|
|
53811
54005
|
})) !== null && _enumData$find !== void 0 ? _enumData$find : enumData.find(function (e) {
|
|
53812
54006
|
return String(e === null || e === void 0 ? void 0 : e.value).toLowerCase() === token.toLowerCase();
|
|
53813
|
-
})) !== null &&
|
|
54007
|
+
})) !== null && _ref20 !== void 0 ? _ref20 : enumData.find(function (e) {
|
|
53814
54008
|
return String(e === null || e === void 0 ? void 0 : e.name).toLowerCase() === token.toLowerCase();
|
|
53815
54009
|
});
|
|
53816
54010
|
};
|
|
53817
54011
|
var tokens = multi ? raw.split(/[,;]/).map(function (s) {
|
|
53818
54012
|
return s.trim();
|
|
53819
54013
|
}).filter(Boolean) : [raw.trim()];
|
|
53820
|
-
var
|
|
53821
|
-
if (!tokens.length ||
|
|
54014
|
+
var matches = tokens.map(resolve);
|
|
54015
|
+
if (!tokens.length || matches.some(function (m) {
|
|
53822
54016
|
return !m;
|
|
53823
54017
|
})) {
|
|
53824
54018
|
var _enumData$;
|
|
@@ -53832,7 +54026,7 @@ function createNavigationToolset(ctx) {
|
|
|
53832
54026
|
// The enum parser matches names and values exactly — hand it the canonical values the tokens resolved to.
|
|
53833
54027
|
return {
|
|
53834
54028
|
ok: true,
|
|
53835
|
-
text:
|
|
54029
|
+
text: matches.map(function (m) {
|
|
53836
54030
|
return String(m.value);
|
|
53837
54031
|
}).join(',')
|
|
53838
54032
|
};
|
|
@@ -54041,7 +54235,7 @@ function createNavigationToolset(ctx) {
|
|
|
54041
54235
|
};
|
|
54042
54236
|
/** The table's own write path; a refusal comes back as the message the agent reports. */
|
|
54043
54237
|
writeCell = /*#__PURE__*/function () {
|
|
54044
|
-
var
|
|
54238
|
+
var _ref21 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(rowId, column, text) {
|
|
54045
54239
|
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
54046
54240
|
while (1) switch (_context2.prev = _context2.next) {
|
|
54047
54241
|
case 0:
|
|
@@ -54071,8 +54265,8 @@ function createNavigationToolset(ctx) {
|
|
|
54071
54265
|
}
|
|
54072
54266
|
}, _callee2, null, [[0, 7]]);
|
|
54073
54267
|
}));
|
|
54074
|
-
return function writeCell(
|
|
54075
|
-
return
|
|
54268
|
+
return function writeCell(_x16, _x17, _x18) {
|
|
54269
|
+
return _ref21.apply(this, arguments);
|
|
54076
54270
|
};
|
|
54077
54271
|
}();
|
|
54078
54272
|
isLookupColumn = function isLookupColumn(column) {
|
|
@@ -54080,7 +54274,7 @@ function createNavigationToolset(ctx) {
|
|
|
54080
54274
|
return ((_divaDefOf2 = divaDefOf(_divaDefs, column)) === null || _divaDefOf2 === void 0 ? void 0 : _divaDefOf2.cellDataType) === 'lookup';
|
|
54081
54275
|
};
|
|
54082
54276
|
lookupWrite = /*#__PURE__*/function () {
|
|
54083
|
-
var
|
|
54277
|
+
var _ref22 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3(column, raw, rowData) {
|
|
54084
54278
|
var _divaDefs$find2;
|
|
54085
54279
|
var multiple, normalizedRaw, parsed, keys, _yield$handle$resolve, data, resolved, _missing, candidates, valueForLabel, corrected, _yield$handle$resolve2, separatorHint, candidateList, candidateHint;
|
|
54086
54280
|
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
@@ -54190,8 +54384,8 @@ function createNavigationToolset(ctx) {
|
|
|
54190
54384
|
}
|
|
54191
54385
|
}, _callee3, null, [[6, 35]]);
|
|
54192
54386
|
}));
|
|
54193
|
-
return function lookupWrite(
|
|
54194
|
-
return
|
|
54387
|
+
return function lookupWrite(_x19, _x20, _x21) {
|
|
54388
|
+
return _ref22.apply(this, arguments);
|
|
54195
54389
|
};
|
|
54196
54390
|
}();
|
|
54197
54391
|
staged = [];
|
|
@@ -54217,7 +54411,7 @@ function createNavigationToolset(ctx) {
|
|
|
54217
54411
|
}; // Key addressing: loose (contains) or multiple matches are rejected — edits must never hit the wrong row.
|
|
54218
54412
|
keyCache = new Map();
|
|
54219
54413
|
resolveByKey = /*#__PURE__*/function () {
|
|
54220
|
-
var
|
|
54414
|
+
var _ref23 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee4(keyColumn, keyValue) {
|
|
54221
54415
|
var label, cacheKey, cached, located, matches, exact;
|
|
54222
54416
|
return _regeneratorRuntime.wrap(function _callee4$(_context4) {
|
|
54223
54417
|
while (1) switch (_context4.prev = _context4.next) {
|
|
@@ -54307,12 +54501,12 @@ function createNavigationToolset(ctx) {
|
|
|
54307
54501
|
}
|
|
54308
54502
|
}, _callee4, null, [[5, 11]]);
|
|
54309
54503
|
}));
|
|
54310
|
-
return function resolveByKey(
|
|
54311
|
-
return
|
|
54504
|
+
return function resolveByKey(_x22, _x23) {
|
|
54505
|
+
return _ref23.apply(this, arguments);
|
|
54312
54506
|
};
|
|
54313
54507
|
}();
|
|
54314
54508
|
resolveTarget = /*#__PURE__*/function () {
|
|
54315
|
-
var
|
|
54509
|
+
var _ref24 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee5(address) {
|
|
54316
54510
|
var rowId, _node, keyColumn, keyValue;
|
|
54317
54511
|
return _regeneratorRuntime.wrap(function _callee5$(_context5) {
|
|
54318
54512
|
while (1) switch (_context5.prev = _context5.next) {
|
|
@@ -54364,13 +54558,13 @@ function createNavigationToolset(ctx) {
|
|
|
54364
54558
|
}
|
|
54365
54559
|
}, _callee5);
|
|
54366
54560
|
}));
|
|
54367
|
-
return function resolveTarget(
|
|
54368
|
-
return
|
|
54561
|
+
return function resolveTarget(_x24) {
|
|
54562
|
+
return _ref24.apply(this, arguments);
|
|
54369
54563
|
};
|
|
54370
54564
|
}();
|
|
54371
54565
|
/** Apply one column edit to an already-resolved row — shared by the direct loop and the sequential lookup path below. */
|
|
54372
54566
|
applyEditToNode = /*#__PURE__*/function () {
|
|
54373
|
-
var
|
|
54567
|
+
var _ref25 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee6(node, rowId, column, rawNewValue) {
|
|
54374
54568
|
var _node$data2, _api2$getRowNode;
|
|
54375
54569
|
var from, _node$data, _res$data$column, res, _ok, check, ok;
|
|
54376
54570
|
return _regeneratorRuntime.wrap(function _callee6$(_context6) {
|
|
@@ -54469,8 +54663,8 @@ function createNavigationToolset(ctx) {
|
|
|
54469
54663
|
}
|
|
54470
54664
|
}, _callee6);
|
|
54471
54665
|
}));
|
|
54472
|
-
return function applyEditToNode(
|
|
54473
|
-
return
|
|
54666
|
+
return function applyEditToNode(_x25, _x26, _x27, _x28) {
|
|
54667
|
+
return _ref25.apply(this, arguments);
|
|
54474
54668
|
};
|
|
54475
54669
|
}(); // --- Multiple EXISTING rows addressed by keyColumn/keyValue, none of them already loaded on screen
|
|
54476
54670
|
// (the prices grid, and generally any table bigger than its initial window): each such lookup goes
|
|
@@ -54499,7 +54693,7 @@ function createNavigationToolset(ctx) {
|
|
|
54499
54693
|
// for rows that came from a payload: the agent never read them, so this is its only way to check them — and
|
|
54500
54694
|
// the answer stays small, counts plus the failing rows, however many rows there are.
|
|
54501
54695
|
if (!(input !== null && input !== void 0 && input.dryRun && addRows.length)) {
|
|
54502
|
-
_context18.next =
|
|
54696
|
+
_context18.next = 259;
|
|
54503
54697
|
break;
|
|
54504
54698
|
}
|
|
54505
54699
|
requiredFields = _divaDefs.filter(function (definition) {
|
|
@@ -54536,17 +54730,17 @@ function createNavigationToolset(ctx) {
|
|
|
54536
54730
|
return definition.field === column;
|
|
54537
54731
|
})) === null || _divaDefs$find3 === void 0 ? void 0 : _divaDefs$find3.customParams) !== null && _customParams !== void 0 ? _customParams : {};
|
|
54538
54732
|
if (_params.nameField) provided.add(_params.nameField);
|
|
54539
|
-
var
|
|
54540
|
-
|
|
54733
|
+
var _iterator7 = _createForOfIteratorHelper$r((_params$additionalMap = _params.additionalMappings) !== null && _params$additionalMap !== void 0 ? _params$additionalMap : []),
|
|
54734
|
+
_step7;
|
|
54541
54735
|
try {
|
|
54542
|
-
for (
|
|
54543
|
-
var mapping =
|
|
54736
|
+
for (_iterator7.s(); !(_step7 = _iterator7.n()).done;) {
|
|
54737
|
+
var mapping = _step7.value;
|
|
54544
54738
|
if (mapping.targetField) provided.add(mapping.targetField);
|
|
54545
54739
|
}
|
|
54546
54740
|
} catch (err) {
|
|
54547
|
-
|
|
54741
|
+
_iterator7.e(err);
|
|
54548
54742
|
} finally {
|
|
54549
|
-
|
|
54743
|
+
_iterator7.f();
|
|
54550
54744
|
}
|
|
54551
54745
|
return 0; // continue
|
|
54552
54746
|
}
|
|
@@ -54640,7 +54834,7 @@ function createNavigationToolset(ctx) {
|
|
|
54640
54834
|
return "'".concat(column, "'");
|
|
54641
54835
|
}).join(', '), " (editabilityUnverified) \u2014 its rule needs grid context a dry run does not have, so the real call may still refuse it. ") : '. ') + "Row numbers count the addRows list (a payload's rows follow the rows listed in the call), then the addRowsTsv lines. " + 'Re-send without dryRun to stage and commit.' + (addRows.length > WRITE_ROW_LIMIT ? " NOTE: ".concat(addRows.length, " rows exceed the ").concat(WRITE_ROW_LIMIT, "-row limit of ONE write \u2014 split them across calls.") : '')
|
|
54642
54836
|
}));
|
|
54643
|
-
case
|
|
54837
|
+
case 259:
|
|
54644
54838
|
/** Mirrors locateRowCore's own loaded-rows check (read-only) — never mutates the filter itself. */
|
|
54645
54839
|
needsServerLookup = function needsServerLookup(keyColumn, keyValue) {
|
|
54646
54840
|
var colDef = columnDefFor(keyColumn);
|
|
@@ -54652,10 +54846,10 @@ function createNavigationToolset(ctx) {
|
|
|
54652
54846
|
return "".concat(keyColumn, "\0").concat(keyValue);
|
|
54653
54847
|
};
|
|
54654
54848
|
lookupKeys = new Map();
|
|
54655
|
-
|
|
54849
|
+
_iterator8 = _createForOfIteratorHelper$r(edits);
|
|
54656
54850
|
try {
|
|
54657
|
-
for (
|
|
54658
|
-
_edit3 =
|
|
54851
|
+
for (_iterator8.s(); !(_step8 = _iterator8.n()).done;) {
|
|
54852
|
+
_edit3 = _step8.value;
|
|
54659
54853
|
if ((_edit3 === null || _edit3 === void 0 ? void 0 : _edit3.rowId) == null && (_edit3 === null || _edit3 === void 0 ? void 0 : _edit3.keyColumn) != null && (_edit3 === null || _edit3 === void 0 ? void 0 : _edit3.keyValue) != null) {
|
|
54660
54854
|
_keyColumn2 = String(_edit3.keyColumn);
|
|
54661
54855
|
_keyValue2 = String(_edit3.keyValue);
|
|
@@ -54666,14 +54860,14 @@ function createNavigationToolset(ctx) {
|
|
|
54666
54860
|
}
|
|
54667
54861
|
}
|
|
54668
54862
|
} catch (err) {
|
|
54669
|
-
|
|
54863
|
+
_iterator8.e(err);
|
|
54670
54864
|
} finally {
|
|
54671
|
-
|
|
54865
|
+
_iterator8.f();
|
|
54672
54866
|
}
|
|
54673
|
-
|
|
54867
|
+
_iterator9 = _createForOfIteratorHelper$r(removeRows);
|
|
54674
54868
|
try {
|
|
54675
|
-
for (
|
|
54676
|
-
_removal =
|
|
54869
|
+
for (_iterator9.s(); !(_step9 = _iterator9.n()).done;) {
|
|
54870
|
+
_removal = _step9.value;
|
|
54677
54871
|
if ((_removal === null || _removal === void 0 ? void 0 : _removal.keyColumn) != null && (_removal === null || _removal === void 0 ? void 0 : _removal.keyValue) != null) {
|
|
54678
54872
|
_keyColumn3 = String(_removal.keyColumn);
|
|
54679
54873
|
_keyValue3 = String(_removal.keyValue);
|
|
@@ -54687,15 +54881,15 @@ function createNavigationToolset(ctx) {
|
|
|
54687
54881
|
// rows that were loaded at that point. So once any key needs the server, every key-addressed row goes
|
|
54688
54882
|
// through the per-row path: a row that is still loaded resolves there without touching the filter.
|
|
54689
54883
|
} catch (err) {
|
|
54690
|
-
|
|
54884
|
+
_iterator9.e(err);
|
|
54691
54885
|
} finally {
|
|
54692
|
-
|
|
54886
|
+
_iterator9.f();
|
|
54693
54887
|
}
|
|
54694
54888
|
if (lookupKeys.size > 0) {
|
|
54695
|
-
|
|
54889
|
+
_iterator10 = _createForOfIteratorHelper$r(edits);
|
|
54696
54890
|
try {
|
|
54697
|
-
for (
|
|
54698
|
-
edit =
|
|
54891
|
+
for (_iterator10.s(); !(_step10 = _iterator10.n()).done;) {
|
|
54892
|
+
edit = _step10.value;
|
|
54699
54893
|
if ((edit === null || edit === void 0 ? void 0 : edit.rowId) == null && (edit === null || edit === void 0 ? void 0 : edit.keyColumn) != null && (edit === null || edit === void 0 ? void 0 : edit.keyValue) != null) {
|
|
54700
54894
|
keyColumn = String(edit.keyColumn);
|
|
54701
54895
|
keyValue = String(edit.keyValue);
|
|
@@ -54706,14 +54900,14 @@ function createNavigationToolset(ctx) {
|
|
|
54706
54900
|
}
|
|
54707
54901
|
}
|
|
54708
54902
|
} catch (err) {
|
|
54709
|
-
|
|
54903
|
+
_iterator10.e(err);
|
|
54710
54904
|
} finally {
|
|
54711
|
-
|
|
54905
|
+
_iterator10.f();
|
|
54712
54906
|
}
|
|
54713
|
-
|
|
54907
|
+
_iterator11 = _createForOfIteratorHelper$r(removeRows);
|
|
54714
54908
|
try {
|
|
54715
|
-
for (
|
|
54716
|
-
removal =
|
|
54909
|
+
for (_iterator11.s(); !(_step11 = _iterator11.n()).done;) {
|
|
54910
|
+
removal = _step11.value;
|
|
54717
54911
|
if ((removal === null || removal === void 0 ? void 0 : removal.keyColumn) != null && (removal === null || removal === void 0 ? void 0 : removal.keyValue) != null) {
|
|
54718
54912
|
_keyColumn = String(removal.keyColumn);
|
|
54719
54913
|
_keyValue = String(removal.keyValue);
|
|
@@ -54724,9 +54918,9 @@ function createNavigationToolset(ctx) {
|
|
|
54724
54918
|
}
|
|
54725
54919
|
}
|
|
54726
54920
|
} catch (err) {
|
|
54727
|
-
|
|
54921
|
+
_iterator11.e(err);
|
|
54728
54922
|
} finally {
|
|
54729
|
-
|
|
54923
|
+
_iterator11.f();
|
|
54730
54924
|
}
|
|
54731
54925
|
}
|
|
54732
54926
|
mergedOutcome = {
|
|
@@ -54744,24 +54938,24 @@ function createNavigationToolset(ctx) {
|
|
|
54744
54938
|
};
|
|
54745
54939
|
preApproved = false;
|
|
54746
54940
|
if (!(lookupKeys.size > 0)) {
|
|
54747
|
-
_context18.next =
|
|
54941
|
+
_context18.next = 307;
|
|
54748
54942
|
break;
|
|
54749
54943
|
}
|
|
54750
54944
|
intendedCount = edits.length + addRows.length + removeRowIds.length + removeRows.length;
|
|
54751
54945
|
if (!ctx.autoApprove) awaitingApproval();
|
|
54752
|
-
_context18.
|
|
54753
|
-
if (_context18.
|
|
54754
|
-
_context18.next =
|
|
54946
|
+
_context18.t4 = ctx.autoApprove;
|
|
54947
|
+
if (_context18.t4) {
|
|
54948
|
+
_context18.next = 278;
|
|
54755
54949
|
break;
|
|
54756
54950
|
}
|
|
54757
|
-
_context18.next =
|
|
54951
|
+
_context18.next = 277;
|
|
54758
54952
|
return _entry2.requestAgentApproval(intendedCount, "".concat(intendedCount, " change(s) \u2014 ").concat(lookupKeys.size, " row(s) must be located first"), signal);
|
|
54759
|
-
case
|
|
54760
|
-
_context18.
|
|
54761
|
-
case
|
|
54762
|
-
_approved = _context18.
|
|
54953
|
+
case 277:
|
|
54954
|
+
_context18.t4 = _context18.sent;
|
|
54955
|
+
case 278:
|
|
54956
|
+
_approved = _context18.t4;
|
|
54763
54957
|
if (_approved) {
|
|
54764
|
-
_context18.next =
|
|
54958
|
+
_context18.next = 282;
|
|
54765
54959
|
break;
|
|
54766
54960
|
}
|
|
54767
54961
|
restoreUserFilter();
|
|
@@ -54770,16 +54964,16 @@ function createNavigationToolset(ctx) {
|
|
|
54770
54964
|
stagedCount: 0,
|
|
54771
54965
|
note: 'The user DECLINED the change — nothing was staged or saved. Do not retry; ask what to do instead.'
|
|
54772
54966
|
});
|
|
54773
|
-
case
|
|
54967
|
+
case 282:
|
|
54774
54968
|
preApproved = true;
|
|
54775
|
-
|
|
54776
|
-
_context18.prev =
|
|
54969
|
+
_iterator12 = _createForOfIteratorHelper$r(lookupKeys.values());
|
|
54970
|
+
_context18.prev = 284;
|
|
54777
54971
|
_loop3 = /*#__PURE__*/_regeneratorRuntime.mark(function _loop3() {
|
|
54778
|
-
var
|
|
54972
|
+
var _step12$value, keyColumn, keyValue, target, _target$error, node, rowId, rowEdits, rowRemovals, _node$data3, _iterator13, _step13, _edit$column, _edit;
|
|
54779
54973
|
return _regeneratorRuntime.wrap(function _loop3$(_context7) {
|
|
54780
54974
|
while (1) switch (_context7.prev = _context7.next) {
|
|
54781
54975
|
case 0:
|
|
54782
|
-
|
|
54976
|
+
_step12$value = _step12.value, keyColumn = _step12$value.keyColumn, keyValue = _step12$value.keyValue;
|
|
54783
54977
|
_context7.next = 3;
|
|
54784
54978
|
return resolveByKey(keyColumn, keyValue);
|
|
54785
54979
|
case 3:
|
|
@@ -54829,15 +55023,15 @@ function createNavigationToolset(ctx) {
|
|
|
54829
55023
|
_context7.next = 38;
|
|
54830
55024
|
break;
|
|
54831
55025
|
case 21:
|
|
54832
|
-
|
|
55026
|
+
_iterator13 = _createForOfIteratorHelper$r(rowEdits);
|
|
54833
55027
|
_context7.prev = 22;
|
|
54834
|
-
|
|
55028
|
+
_iterator13.s();
|
|
54835
55029
|
case 24:
|
|
54836
|
-
if ((
|
|
55030
|
+
if ((_step13 = _iterator13.n()).done) {
|
|
54837
55031
|
_context7.next = 30;
|
|
54838
55032
|
break;
|
|
54839
55033
|
}
|
|
54840
|
-
_edit =
|
|
55034
|
+
_edit = _step13.value;
|
|
54841
55035
|
_context7.next = 28;
|
|
54842
55036
|
return applyEditToNode(node, rowId, String((_edit$column = _edit === null || _edit === void 0 ? void 0 : _edit.column) !== null && _edit$column !== void 0 ? _edit$column : ''), _edit === null || _edit === void 0 ? void 0 : _edit.newValue);
|
|
54843
55037
|
case 28:
|
|
@@ -54849,10 +55043,10 @@ function createNavigationToolset(ctx) {
|
|
|
54849
55043
|
case 32:
|
|
54850
55044
|
_context7.prev = 32;
|
|
54851
55045
|
_context7.t0 = _context7["catch"](22);
|
|
54852
|
-
|
|
55046
|
+
_iterator13.e(_context7.t0);
|
|
54853
55047
|
case 35:
|
|
54854
55048
|
_context7.prev = 35;
|
|
54855
|
-
|
|
55049
|
+
_iterator13.f();
|
|
54856
55050
|
return _context7.finish(35);
|
|
54857
55051
|
case 38:
|
|
54858
55052
|
_context7.t1 = mergeCommitOutcome;
|
|
@@ -54867,117 +55061,117 @@ function createNavigationToolset(ctx) {
|
|
|
54867
55061
|
}
|
|
54868
55062
|
}, _loop3, null, [[22, 32, 35, 38]]);
|
|
54869
55063
|
});
|
|
54870
|
-
|
|
54871
|
-
case
|
|
54872
|
-
if ((
|
|
54873
|
-
_context18.next =
|
|
55064
|
+
_iterator12.s();
|
|
55065
|
+
case 287:
|
|
55066
|
+
if ((_step12 = _iterator12.n()).done) {
|
|
55067
|
+
_context18.next = 294;
|
|
54874
55068
|
break;
|
|
54875
55069
|
}
|
|
54876
|
-
return _context18.delegateYield(_loop3(), "
|
|
54877
|
-
case
|
|
54878
|
-
_ret3 = _context18.
|
|
55070
|
+
return _context18.delegateYield(_loop3(), "t5", 289);
|
|
55071
|
+
case 289:
|
|
55072
|
+
_ret3 = _context18.t5;
|
|
54879
55073
|
if (!(_ret3 === 0)) {
|
|
54880
|
-
_context18.next =
|
|
55074
|
+
_context18.next = 292;
|
|
54881
55075
|
break;
|
|
54882
55076
|
}
|
|
54883
|
-
return _context18.abrupt("continue",
|
|
54884
|
-
case
|
|
54885
|
-
_context18.next =
|
|
55077
|
+
return _context18.abrupt("continue", 292);
|
|
55078
|
+
case 292:
|
|
55079
|
+
_context18.next = 287;
|
|
54886
55080
|
break;
|
|
54887
|
-
case
|
|
54888
|
-
_context18.next =
|
|
55081
|
+
case 294:
|
|
55082
|
+
_context18.next = 299;
|
|
54889
55083
|
break;
|
|
54890
|
-
case
|
|
54891
|
-
_context18.prev =
|
|
54892
|
-
_context18.
|
|
54893
|
-
|
|
54894
|
-
case
|
|
54895
|
-
_context18.prev =
|
|
54896
|
-
|
|
54897
|
-
return _context18.finish(
|
|
54898
|
-
case
|
|
55084
|
+
case 296:
|
|
55085
|
+
_context18.prev = 296;
|
|
55086
|
+
_context18.t6 = _context18["catch"](284);
|
|
55087
|
+
_iterator12.e(_context18.t6);
|
|
55088
|
+
case 299:
|
|
55089
|
+
_context18.prev = 299;
|
|
55090
|
+
_iterator12.f();
|
|
55091
|
+
return _context18.finish(299);
|
|
55092
|
+
case 302:
|
|
54899
55093
|
// Bring the loaded window back to what the caller had before more edits (possibly rowId-addressed,
|
|
54900
55094
|
// always assumed already-loaded) rely on it — restoreUserFilter only mutates when a lookup above
|
|
54901
55095
|
// actually changed something, and the grid needs a moment to settle after a filter change.
|
|
54902
55096
|
filterWasChanged = keyFilterApplied;
|
|
54903
55097
|
restoreUserFilter();
|
|
54904
55098
|
if (!filterWasChanged) {
|
|
54905
|
-
_context18.next =
|
|
55099
|
+
_context18.next = 307;
|
|
54906
55100
|
break;
|
|
54907
55101
|
}
|
|
54908
|
-
_context18.next =
|
|
55102
|
+
_context18.next = 307;
|
|
54909
55103
|
return waitForRows(_api2);
|
|
54910
|
-
case
|
|
55104
|
+
case 307:
|
|
54911
55105
|
// Key-addressed removals resolve to rowIds before the edit loop (conflicts are checked against the final id list).
|
|
54912
55106
|
// Rows already resolved+staged+committed by the sequential lookup pass above are skipped here.
|
|
54913
|
-
|
|
54914
|
-
_context18.prev =
|
|
54915
|
-
|
|
54916
|
-
case
|
|
54917
|
-
if ((
|
|
54918
|
-
_context18.next =
|
|
55107
|
+
_iterator14 = _createForOfIteratorHelper$r(removeRows);
|
|
55108
|
+
_context18.prev = 308;
|
|
55109
|
+
_iterator14.s();
|
|
55110
|
+
case 310:
|
|
55111
|
+
if ((_step14 = _iterator14.n()).done) {
|
|
55112
|
+
_context18.next = 324;
|
|
54919
55113
|
break;
|
|
54920
55114
|
}
|
|
54921
|
-
_removal2 =
|
|
55115
|
+
_removal2 = _step14.value;
|
|
54922
55116
|
if (!((_removal2 === null || _removal2 === void 0 ? void 0 : _removal2.keyColumn) != null && (_removal2 === null || _removal2 === void 0 ? void 0 : _removal2.keyValue) != null && lookupKeys.has(lookupKeyOf(String(_removal2.keyColumn), String(_removal2.keyValue))))) {
|
|
54923
|
-
_context18.next =
|
|
55117
|
+
_context18.next = 314;
|
|
54924
55118
|
break;
|
|
54925
55119
|
}
|
|
54926
|
-
return _context18.abrupt("continue",
|
|
54927
|
-
case
|
|
54928
|
-
_context18.next =
|
|
55120
|
+
return _context18.abrupt("continue", 322);
|
|
55121
|
+
case 314:
|
|
55122
|
+
_context18.next = 316;
|
|
54929
55123
|
return resolveTarget(_removal2);
|
|
54930
|
-
case
|
|
55124
|
+
case 316:
|
|
54931
55125
|
_target2 = _context18.sent;
|
|
54932
55126
|
if (!(_target2.error || !_target2.node)) {
|
|
54933
|
-
_context18.next =
|
|
55127
|
+
_context18.next = 320;
|
|
54934
55128
|
break;
|
|
54935
55129
|
}
|
|
54936
55130
|
failed.push({
|
|
54937
55131
|
rowId: _target2.label,
|
|
54938
55132
|
error: (_target2$error = _target2.error) !== null && _target2$error !== void 0 ? _target2$error : 'Row not found.'
|
|
54939
55133
|
});
|
|
54940
|
-
return _context18.abrupt("continue",
|
|
54941
|
-
case
|
|
55134
|
+
return _context18.abrupt("continue", 322);
|
|
55135
|
+
case 320:
|
|
54942
55136
|
id = String(_target2.node.id);
|
|
54943
55137
|
if (!removeRowIds.includes(id)) removeRowIds.push(id);
|
|
54944
|
-
case
|
|
54945
|
-
_context18.next =
|
|
55138
|
+
case 322:
|
|
55139
|
+
_context18.next = 310;
|
|
54946
55140
|
break;
|
|
54947
|
-
case
|
|
54948
|
-
_context18.next =
|
|
55141
|
+
case 324:
|
|
55142
|
+
_context18.next = 329;
|
|
54949
55143
|
break;
|
|
54950
|
-
case
|
|
54951
|
-
_context18.prev =
|
|
54952
|
-
_context18.
|
|
54953
|
-
|
|
54954
|
-
case
|
|
54955
|
-
_context18.prev =
|
|
54956
|
-
|
|
54957
|
-
return _context18.finish(
|
|
54958
|
-
case
|
|
54959
|
-
|
|
54960
|
-
_context18.prev =
|
|
54961
|
-
|
|
54962
|
-
case
|
|
54963
|
-
if ((
|
|
54964
|
-
_context18.next =
|
|
55144
|
+
case 326:
|
|
55145
|
+
_context18.prev = 326;
|
|
55146
|
+
_context18.t7 = _context18["catch"](308);
|
|
55147
|
+
_iterator14.e(_context18.t7);
|
|
55148
|
+
case 329:
|
|
55149
|
+
_context18.prev = 329;
|
|
55150
|
+
_iterator14.f();
|
|
55151
|
+
return _context18.finish(329);
|
|
55152
|
+
case 332:
|
|
55153
|
+
_iterator15 = _createForOfIteratorHelper$r(edits);
|
|
55154
|
+
_context18.prev = 333;
|
|
55155
|
+
_iterator15.s();
|
|
55156
|
+
case 335:
|
|
55157
|
+
if ((_step15 = _iterator15.n()).done) {
|
|
55158
|
+
_context18.next = 355;
|
|
54965
55159
|
break;
|
|
54966
55160
|
}
|
|
54967
|
-
_edit4 =
|
|
55161
|
+
_edit4 = _step15.value;
|
|
54968
55162
|
if (!((_edit4 === null || _edit4 === void 0 ? void 0 : _edit4.rowId) == null && (_edit4 === null || _edit4 === void 0 ? void 0 : _edit4.keyColumn) != null && (_edit4 === null || _edit4 === void 0 ? void 0 : _edit4.keyValue) != null && lookupKeys.has(lookupKeyOf(String(_edit4.keyColumn), String(_edit4.keyValue))))) {
|
|
54969
|
-
_context18.next =
|
|
55163
|
+
_context18.next = 339;
|
|
54970
55164
|
break;
|
|
54971
55165
|
}
|
|
54972
|
-
return _context18.abrupt("continue",
|
|
54973
|
-
case
|
|
55166
|
+
return _context18.abrupt("continue", 353);
|
|
55167
|
+
case 339:
|
|
54974
55168
|
_column2 = String((_edit4$column = _edit4 === null || _edit4 === void 0 ? void 0 : _edit4.column) !== null && _edit4$column !== void 0 ? _edit4$column : '');
|
|
54975
|
-
_context18.next =
|
|
55169
|
+
_context18.next = 342;
|
|
54976
55170
|
return resolveTarget(_edit4);
|
|
54977
|
-
case
|
|
55171
|
+
case 342:
|
|
54978
55172
|
_target3 = _context18.sent;
|
|
54979
55173
|
if (!(_target3.error || !_target3.node)) {
|
|
54980
|
-
_context18.next =
|
|
55174
|
+
_context18.next = 346;
|
|
54981
55175
|
break;
|
|
54982
55176
|
}
|
|
54983
55177
|
failed.push({
|
|
@@ -54985,12 +55179,12 @@ function createNavigationToolset(ctx) {
|
|
|
54985
55179
|
column: _column2,
|
|
54986
55180
|
error: (_target3$error = _target3.error) !== null && _target3$error !== void 0 ? _target3$error : 'Row not found.'
|
|
54987
55181
|
});
|
|
54988
|
-
return _context18.abrupt("continue",
|
|
54989
|
-
case
|
|
55182
|
+
return _context18.abrupt("continue", 353);
|
|
55183
|
+
case 346:
|
|
54990
55184
|
_node2 = _target3.node;
|
|
54991
55185
|
_rowId2 = String(_node2.id);
|
|
54992
55186
|
if (!removeRowIds.includes(_rowId2)) {
|
|
54993
|
-
_context18.next =
|
|
55187
|
+
_context18.next = 351;
|
|
54994
55188
|
break;
|
|
54995
55189
|
}
|
|
54996
55190
|
failed.push({
|
|
@@ -54998,25 +55192,25 @@ function createNavigationToolset(ctx) {
|
|
|
54998
55192
|
column: _column2,
|
|
54999
55193
|
error: 'This row is also being removed — edit OR remove a row, not both.'
|
|
55000
55194
|
});
|
|
55001
|
-
return _context18.abrupt("continue",
|
|
55002
|
-
case
|
|
55003
|
-
_context18.next =
|
|
55195
|
+
return _context18.abrupt("continue", 353);
|
|
55196
|
+
case 351:
|
|
55197
|
+
_context18.next = 353;
|
|
55004
55198
|
return applyEditToNode(_node2, _rowId2, _column2, _edit4 === null || _edit4 === void 0 ? void 0 : _edit4.newValue);
|
|
55005
|
-
case
|
|
55006
|
-
_context18.next =
|
|
55199
|
+
case 353:
|
|
55200
|
+
_context18.next = 335;
|
|
55007
55201
|
break;
|
|
55008
|
-
case
|
|
55009
|
-
_context18.next =
|
|
55202
|
+
case 355:
|
|
55203
|
+
_context18.next = 360;
|
|
55010
55204
|
break;
|
|
55011
|
-
case
|
|
55012
|
-
_context18.prev =
|
|
55013
|
-
_context18.
|
|
55014
|
-
|
|
55015
|
-
case
|
|
55016
|
-
_context18.prev =
|
|
55017
|
-
|
|
55018
|
-
return _context18.finish(
|
|
55019
|
-
case
|
|
55205
|
+
case 357:
|
|
55206
|
+
_context18.prev = 357;
|
|
55207
|
+
_context18.t8 = _context18["catch"](333);
|
|
55208
|
+
_iterator15.e(_context18.t8);
|
|
55209
|
+
case 360:
|
|
55210
|
+
_context18.prev = 360;
|
|
55211
|
+
_iterator15.f();
|
|
55212
|
+
return _context18.finish(360);
|
|
55213
|
+
case 363:
|
|
55020
55214
|
targets = removeRowIds.filter(function (rowId) {
|
|
55021
55215
|
if (isRealRow(_api2.getRowNode(rowId))) return true;
|
|
55022
55216
|
failed.push({
|
|
@@ -55025,26 +55219,26 @@ function createNavigationToolset(ctx) {
|
|
|
55025
55219
|
});
|
|
55026
55220
|
return false;
|
|
55027
55221
|
});
|
|
55028
|
-
|
|
55222
|
+
_iterator16 = _createForOfIteratorHelper$r(targets);
|
|
55029
55223
|
try {
|
|
55030
|
-
for (
|
|
55031
|
-
_rowId =
|
|
55224
|
+
for (_iterator16.s(); !(_step16 = _iterator16.n()).done;) {
|
|
55225
|
+
_rowId = _step16.value;
|
|
55032
55226
|
removedRecordIds.set(_rowId, (_api2$getRowNode2 = _api2.getRowNode(_rowId)) === null || _api2$getRowNode2 === void 0 || (_api2$getRowNode2 = _api2$getRowNode2.data) === null || _api2$getRowNode2 === void 0 ? void 0 : _api2$getRowNode2._id);
|
|
55033
55227
|
}
|
|
55034
55228
|
} catch (err) {
|
|
55035
|
-
|
|
55229
|
+
_iterator16.e(err);
|
|
55036
55230
|
} finally {
|
|
55037
|
-
|
|
55231
|
+
_iterator16.f();
|
|
55038
55232
|
}
|
|
55039
55233
|
if (!targets.length) {
|
|
55040
|
-
_context18.next =
|
|
55234
|
+
_context18.next = 370;
|
|
55041
55235
|
break;
|
|
55042
55236
|
}
|
|
55043
|
-
_context18.next =
|
|
55237
|
+
_context18.next = 369;
|
|
55044
55238
|
return handle.stageRemoveRows(targets);
|
|
55045
|
-
case
|
|
55239
|
+
case 369:
|
|
55046
55240
|
removed.push.apply(removed, _toConsumableArray(targets));
|
|
55047
|
-
case
|
|
55241
|
+
case 370:
|
|
55048
55242
|
addedRows = [];
|
|
55049
55243
|
/** Columns the AGENT provided per added row — lookup writes drag companion fields into `values`. */
|
|
55050
55244
|
providedAddColumns = new Map();
|
|
@@ -55052,7 +55246,7 @@ function createNavigationToolset(ctx) {
|
|
|
55052
55246
|
lookupWriteCache = new Map();
|
|
55053
55247
|
_loop4 = /*#__PURE__*/_regeneratorRuntime.mark(function _loop4() {
|
|
55054
55248
|
var _addRows$_i7$values, _addRows$_i, _handle$getApplicatio5, _handle$getApplicatio6;
|
|
55055
|
-
var rawValues, plainCols, lookupCols, bad, _i10, _Object$entries4, _Object$entries4$_i, _column3, rawValue, check, provided, _loop6, _i11, _lookupCols, hasField, requiredMissing, seed, newId, values, _i12, _plainCols, _plainCols$_i, _column4, text, ok, appData, rowFields, rowDepsOf, lookupColumns, _loop7, _ret5, _api2$getRowNode$data, _api2$getRowNode9, finished,
|
|
55249
|
+
var rawValues, plainCols, lookupCols, bad, _i10, _Object$entries4, _Object$entries4$_i, _column3, rawValue, check, provided, _loop6, _i11, _lookupCols, hasField, requiredMissing, seed, newId, values, _i12, _plainCols, _plainCols$_i, _column4, text, ok, appData, rowFields, rowDepsOf, lookupColumns, _loop7, _ret5, _api2$getRowNode$data, _api2$getRowNode9, finished, _iterator25, _step25, _divaDefOf3, _step25$value, _column5, _text, isPosCountRow, _ok2, _api2$getRowNode$data2, _api2$getRowNode10, _finished, _i13, _arr3, _divaDefOf4, _column6, editableFn, locked;
|
|
55056
55250
|
return _regeneratorRuntime.wrap(function _loop4$(_context12) {
|
|
55057
55251
|
while (1) switch (_context12.prev = _context12.next) {
|
|
55058
55252
|
case 0:
|
|
@@ -55116,14 +55310,14 @@ function createNavigationToolset(ctx) {
|
|
|
55116
55310
|
case 24:
|
|
55117
55311
|
// Fail fast with the COMPLETE list of missing required columns; defaulted ones are filled by the add itself.
|
|
55118
55312
|
// A lookup also fills its companion fields (name field, mapped fields), so those count as provided.
|
|
55119
|
-
provided = new Set(plainCols.map(function (
|
|
55120
|
-
var
|
|
55121
|
-
column =
|
|
55313
|
+
provided = new Set(plainCols.map(function (_ref36) {
|
|
55314
|
+
var _ref37 = _slicedToArray(_ref36, 1),
|
|
55315
|
+
column = _ref37[0];
|
|
55122
55316
|
return column;
|
|
55123
55317
|
}));
|
|
55124
55318
|
_loop6 = /*#__PURE__*/_regeneratorRuntime.mark(function _loop6() {
|
|
55125
55319
|
var _divaDefs$find$custom, _divaDefs$find4, _params$additionalMap2;
|
|
55126
|
-
var _lookupCols$_i, column, params,
|
|
55320
|
+
var _lookupCols$_i, column, params, _iterator24, _step24, mapping;
|
|
55127
55321
|
return _regeneratorRuntime.wrap(function _loop6$(_context10) {
|
|
55128
55322
|
while (1) switch (_context10.prev = _context10.next) {
|
|
55129
55323
|
case 0:
|
|
@@ -55133,16 +55327,16 @@ function createNavigationToolset(ctx) {
|
|
|
55133
55327
|
return d.field === column;
|
|
55134
55328
|
})) === null || _divaDefs$find4 === void 0 ? void 0 : _divaDefs$find4.customParams) !== null && _divaDefs$find$custom !== void 0 ? _divaDefs$find$custom : {};
|
|
55135
55329
|
if (params.nameField) provided.add(params.nameField);
|
|
55136
|
-
|
|
55330
|
+
_iterator24 = _createForOfIteratorHelper$r((_params$additionalMap2 = params.additionalMappings) !== null && _params$additionalMap2 !== void 0 ? _params$additionalMap2 : []);
|
|
55137
55331
|
try {
|
|
55138
|
-
for (
|
|
55139
|
-
mapping =
|
|
55332
|
+
for (_iterator24.s(); !(_step24 = _iterator24.n()).done;) {
|
|
55333
|
+
mapping = _step24.value;
|
|
55140
55334
|
if (mapping.targetField) provided.add(mapping.targetField);
|
|
55141
55335
|
}
|
|
55142
55336
|
} catch (err) {
|
|
55143
|
-
|
|
55337
|
+
_iterator24.e(err);
|
|
55144
55338
|
} finally {
|
|
55145
|
-
|
|
55339
|
+
_iterator24.f();
|
|
55146
55340
|
}
|
|
55147
55341
|
case 6:
|
|
55148
55342
|
case "end":
|
|
@@ -55255,21 +55449,21 @@ function createNavigationToolset(ctx) {
|
|
|
55255
55449
|
return rowFields.has(p) && appData[p] === undefined;
|
|
55256
55450
|
});
|
|
55257
55451
|
}; // The loop below consumes `lookupCols`, and the finished row is judged on every column the call wrote.
|
|
55258
|
-
lookupColumns = lookupCols.map(function (
|
|
55259
|
-
var
|
|
55260
|
-
column =
|
|
55452
|
+
lookupColumns = lookupCols.map(function (_ref38) {
|
|
55453
|
+
var _ref39 = _slicedToArray(_ref38, 1),
|
|
55454
|
+
column = _ref39[0];
|
|
55261
55455
|
return column;
|
|
55262
55456
|
});
|
|
55263
55457
|
_loop7 = /*#__PURE__*/_regeneratorRuntime.mark(function _loop7() {
|
|
55264
55458
|
var _api2$getRowNode$data3, _api2$getRowNode11, _lookupWriteCache$get;
|
|
55265
|
-
var readyIdx, _lookupCols$splice$, column, rawValue, missingDeps, providers, lookupRowData, lookupCacheKey, res, write, _i14, _Object$entries5, _res$data, _Object$entries5$_i, key,
|
|
55459
|
+
var readyIdx, _lookupCols$splice$, column, rawValue, missingDeps, providers, lookupRowData, lookupCacheKey, res, write, _i14, _Object$entries5, _res$data, _Object$entries5$_i, key, value;
|
|
55266
55460
|
return _regeneratorRuntime.wrap(function _loop7$(_context11) {
|
|
55267
55461
|
while (1) switch (_context11.prev = _context11.next) {
|
|
55268
55462
|
case 0:
|
|
55269
55463
|
// Prefer a lookup whose row dependencies are already satisfied — its write may provide what the deferred one needs.
|
|
55270
|
-
readyIdx = lookupCols.findIndex(function (
|
|
55271
|
-
var
|
|
55272
|
-
column =
|
|
55464
|
+
readyIdx = lookupCols.findIndex(function (_ref42) {
|
|
55465
|
+
var _ref43 = _slicedToArray(_ref42, 1),
|
|
55466
|
+
column = _ref43[0];
|
|
55273
55467
|
return rowDepsOf(column).every(function (dep) {
|
|
55274
55468
|
return values[dep] !== undefined || rawValues[dep] !== undefined;
|
|
55275
55469
|
});
|
|
@@ -55335,8 +55529,8 @@ function createNavigationToolset(ctx) {
|
|
|
55335
55529
|
// On a NEW row an undefined write-shape entry means "leave empty" — skip it so it does not clobber a provided key.
|
|
55336
55530
|
write = {};
|
|
55337
55531
|
for (_i14 = 0, _Object$entries5 = Object.entries((_res$data = res.data) !== null && _res$data !== void 0 ? _res$data : {}); _i14 < _Object$entries5.length; _i14++) {
|
|
55338
|
-
_Object$entries5$_i = _slicedToArray(_Object$entries5[_i14], 2), key = _Object$entries5$_i[0],
|
|
55339
|
-
if (
|
|
55532
|
+
_Object$entries5$_i = _slicedToArray(_Object$entries5[_i14], 2), key = _Object$entries5$_i[0], value = _Object$entries5$_i[1];
|
|
55533
|
+
if (value !== undefined) write[key] = value;
|
|
55340
55534
|
}
|
|
55341
55535
|
_context11.t1 = Object.keys(write).length;
|
|
55342
55536
|
if (!_context11.t1) {
|
|
@@ -55393,15 +55587,15 @@ function createNavigationToolset(ctx) {
|
|
|
55393
55587
|
finished = (_api2$getRowNode$data = (_api2$getRowNode9 = _api2.getRowNode(newId)) === null || _api2$getRowNode9 === void 0 ? void 0 : _api2$getRowNode9.data) !== null && _api2$getRowNode$data !== void 0 ? _api2$getRowNode$data : values; // A row-dependent PARSER needs the finished row just as much: the count column stores
|
|
55394
55588
|
// SET_POS_COUNT_VALUE:n only once the row's decision is known, and that decision is a lookup written
|
|
55395
55589
|
// after it. Writing the same text again now lets the column parse it into the shape it really has.
|
|
55396
|
-
|
|
55590
|
+
_iterator25 = _createForOfIteratorHelper$r(plainCols);
|
|
55397
55591
|
_context12.prev = 75;
|
|
55398
|
-
|
|
55592
|
+
_iterator25.s();
|
|
55399
55593
|
case 77:
|
|
55400
|
-
if ((
|
|
55594
|
+
if ((_step25 = _iterator25.n()).done) {
|
|
55401
55595
|
_context12.next = 92;
|
|
55402
55596
|
break;
|
|
55403
55597
|
}
|
|
55404
|
-
|
|
55598
|
+
_step25$value = _slicedToArray(_step25.value, 2), _column5 = _step25$value[0], _text = _step25$value[1];
|
|
55405
55599
|
isPosCountRow = (_divaDefOf3 = divaDefOf(_divaDefs, _column5)) === null || _divaDefOf3 === void 0 || (_divaDefOf3 = _divaDefOf3.customParams) === null || _divaDefOf3 === void 0 ? void 0 : _divaDefOf3.isPosCount;
|
|
55406
55600
|
if (!(typeof isPosCountRow !== 'function' || !isPosCountRow(finished))) {
|
|
55407
55601
|
_context12.next = 82;
|
|
@@ -55435,10 +55629,10 @@ function createNavigationToolset(ctx) {
|
|
|
55435
55629
|
case 94:
|
|
55436
55630
|
_context12.prev = 94;
|
|
55437
55631
|
_context12.t2 = _context12["catch"](75);
|
|
55438
|
-
|
|
55632
|
+
_iterator25.e(_context12.t2);
|
|
55439
55633
|
case 97:
|
|
55440
55634
|
_context12.prev = 97;
|
|
55441
|
-
|
|
55635
|
+
_iterator25.f();
|
|
55442
55636
|
return _context12.finish(97);
|
|
55443
55637
|
case 100:
|
|
55444
55638
|
if (bad) {
|
|
@@ -55447,9 +55641,9 @@ function createNavigationToolset(ctx) {
|
|
|
55447
55641
|
}
|
|
55448
55642
|
_finished = (_api2$getRowNode$data2 = (_api2$getRowNode10 = _api2.getRowNode(newId)) === null || _api2$getRowNode10 === void 0 ? void 0 : _api2$getRowNode10.data) !== null && _api2$getRowNode$data2 !== void 0 ? _api2$getRowNode$data2 : values; // Lookup columns too: `lookupWrite` never evaluates the rule, so a lookup a creatable table locks on the
|
|
55449
55643
|
// finished row (a parent key chosen by another column) would otherwise reach the server unchecked.
|
|
55450
|
-
_i13 = 0, _arr3 = [].concat(_toConsumableArray(plainCols.map(function (
|
|
55451
|
-
var
|
|
55452
|
-
field =
|
|
55644
|
+
_i13 = 0, _arr3 = [].concat(_toConsumableArray(plainCols.map(function (_ref40) {
|
|
55645
|
+
var _ref41 = _slicedToArray(_ref40, 1),
|
|
55646
|
+
field = _ref41[0];
|
|
55453
55647
|
return field;
|
|
55454
55648
|
})), _toConsumableArray(lookupColumns));
|
|
55455
55649
|
case 103:
|
|
@@ -55512,24 +55706,24 @@ function createNavigationToolset(ctx) {
|
|
|
55512
55706
|
}, _loop4, null, [[75, 94, 97, 100]]);
|
|
55513
55707
|
});
|
|
55514
55708
|
_i7 = 0;
|
|
55515
|
-
case
|
|
55709
|
+
case 376:
|
|
55516
55710
|
if (!(_i7 < addRows.length)) {
|
|
55517
|
-
_context18.next =
|
|
55711
|
+
_context18.next = 384;
|
|
55518
55712
|
break;
|
|
55519
55713
|
}
|
|
55520
|
-
return _context18.delegateYield(_loop4(), "
|
|
55521
|
-
case
|
|
55522
|
-
_ret4 = _context18.
|
|
55714
|
+
return _context18.delegateYield(_loop4(), "t9", 378);
|
|
55715
|
+
case 378:
|
|
55716
|
+
_ret4 = _context18.t9;
|
|
55523
55717
|
if (!(_ret4 === 0)) {
|
|
55524
|
-
_context18.next =
|
|
55718
|
+
_context18.next = 381;
|
|
55525
55719
|
break;
|
|
55526
55720
|
}
|
|
55527
|
-
return _context18.abrupt("continue",
|
|
55528
|
-
case
|
|
55721
|
+
return _context18.abrupt("continue", 381);
|
|
55722
|
+
case 381:
|
|
55529
55723
|
_i7++;
|
|
55530
|
-
_context18.next =
|
|
55724
|
+
_context18.next = 376;
|
|
55531
55725
|
break;
|
|
55532
|
-
case
|
|
55726
|
+
case 384:
|
|
55533
55727
|
// Any add failed → return the table's FULL add schema so the next attempt has everything.
|
|
55534
55728
|
addSchemaHint = function addSchemaHint() {
|
|
55535
55729
|
if (!addRows.length) return '';
|
|
@@ -55546,7 +55740,7 @@ function createNavigationToolset(ctx) {
|
|
|
55546
55740
|
return " ADD SCHEMA of '".concat(_entry2.label, "' \u2014 required: ").concat(req.join(', ') || 'none').concat(defaulted.length ? "; defaulted (OMIT): ".concat(defaulted.join(', ')) : '', ". Enum/lookup columns take only their listed values (listGrids/readColumnOptions).");
|
|
55547
55741
|
};
|
|
55548
55742
|
if (!(!staged.length && !addedRows.length && !removed.length)) {
|
|
55549
|
-
_context18.next =
|
|
55743
|
+
_context18.next = 388;
|
|
55550
55744
|
break;
|
|
55551
55745
|
}
|
|
55552
55746
|
restoreUserFilter();
|
|
@@ -55557,32 +55751,32 @@ function createNavigationToolset(ctx) {
|
|
|
55557
55751
|
failed: failed.length ? summarizeFailures(failed) : undefined,
|
|
55558
55752
|
note: unchanged.length ? 'NOTHING was staged: every proposed value equals the current cell value (the change may already have been applied earlier). Tell the user the data already matches — do NOT claim you changed anything.' : "Nothing could be staged \u2014 nothing to approve. Fix the failures (fresh readGridRows) and try again.".concat(failed.length ? addSchemaHint() : '')
|
|
55559
55753
|
});
|
|
55560
|
-
case
|
|
55754
|
+
case 388:
|
|
55561
55755
|
// The table would silently skip invalid staged rows on save — surface that as a failure instead of a fake success.
|
|
55562
55756
|
validationErrors = []; // Rows the sequential lookup pass already sent carry the SERVER's verdict (a rejection leaves the same
|
|
55563
55757
|
// error markers) — that is reported as a server error below, not as a validation failure of the rest.
|
|
55564
55758
|
alreadySent = new Set([].concat(_toConsumableArray(mergedOutcome.committed), _toConsumableArray(mergedOutcome.failed.map(function (failure) {
|
|
55565
55759
|
return failure.rowId;
|
|
55566
55760
|
})), _toConsumableArray(mergedOutcome.skipped)));
|
|
55567
|
-
|
|
55761
|
+
_iterator17 = _createForOfIteratorHelper$r(new Set([].concat(_toConsumableArray(staged.map(function (s) {
|
|
55568
55762
|
return s.rowId;
|
|
55569
55763
|
})), _toConsumableArray(addedRows.map(function (a) {
|
|
55570
55764
|
return a.rowId;
|
|
55571
55765
|
})))));
|
|
55572
|
-
_context18.prev =
|
|
55573
|
-
|
|
55574
|
-
case
|
|
55575
|
-
if ((
|
|
55576
|
-
_context18.next =
|
|
55766
|
+
_context18.prev = 391;
|
|
55767
|
+
_iterator17.s();
|
|
55768
|
+
case 393:
|
|
55769
|
+
if ((_step17 = _iterator17.n()).done) {
|
|
55770
|
+
_context18.next = 401;
|
|
55577
55771
|
break;
|
|
55578
55772
|
}
|
|
55579
|
-
_rowId3 =
|
|
55773
|
+
_rowId3 = _step17.value;
|
|
55580
55774
|
if (!alreadySent.has(_rowId3)) {
|
|
55581
|
-
_context18.next =
|
|
55775
|
+
_context18.next = 397;
|
|
55582
55776
|
break;
|
|
55583
55777
|
}
|
|
55584
|
-
return _context18.abrupt("continue",
|
|
55585
|
-
case
|
|
55778
|
+
return _context18.abrupt("continue", 399);
|
|
55779
|
+
case 397:
|
|
55586
55780
|
rowErrors = (_api2$getRowNode12 = _api2.getRowNode(_rowId3)) === null || _api2$getRowNode12 === void 0 || (_api2$getRowNode12 = _api2$getRowNode12.data) === null || _api2$getRowNode12 === void 0 || (_api2$getRowNode12 = _api2$getRowNode12.__diva_context) === null || _api2$getRowNode12 === void 0 ? void 0 : _api2$getRowNode12.errors;
|
|
55587
55781
|
if (Array.isArray(rowErrors) && rowErrors.length) {
|
|
55588
55782
|
validationErrors.push({
|
|
@@ -55592,28 +55786,28 @@ function createNavigationToolset(ctx) {
|
|
|
55592
55786
|
})
|
|
55593
55787
|
});
|
|
55594
55788
|
}
|
|
55595
|
-
case
|
|
55596
|
-
_context18.next =
|
|
55789
|
+
case 399:
|
|
55790
|
+
_context18.next = 393;
|
|
55597
55791
|
break;
|
|
55598
|
-
case
|
|
55599
|
-
_context18.next =
|
|
55792
|
+
case 401:
|
|
55793
|
+
_context18.next = 406;
|
|
55600
55794
|
break;
|
|
55601
|
-
case
|
|
55602
|
-
_context18.prev =
|
|
55603
|
-
_context18.
|
|
55604
|
-
|
|
55605
|
-
case
|
|
55606
|
-
_context18.prev =
|
|
55607
|
-
|
|
55608
|
-
return _context18.finish(
|
|
55609
|
-
case
|
|
55795
|
+
case 403:
|
|
55796
|
+
_context18.prev = 403;
|
|
55797
|
+
_context18.t10 = _context18["catch"](391);
|
|
55798
|
+
_iterator17.e(_context18.t10);
|
|
55799
|
+
case 406:
|
|
55800
|
+
_context18.prev = 406;
|
|
55801
|
+
_iterator17.f();
|
|
55802
|
+
return _context18.finish(406);
|
|
55803
|
+
case 409:
|
|
55610
55804
|
if (!validationErrors.length) {
|
|
55611
|
-
_context18.next =
|
|
55805
|
+
_context18.next = 414;
|
|
55612
55806
|
break;
|
|
55613
55807
|
}
|
|
55614
|
-
_context18.next =
|
|
55808
|
+
_context18.next = 412;
|
|
55615
55809
|
return handle.rollback();
|
|
55616
|
-
case
|
|
55810
|
+
case 412:
|
|
55617
55811
|
restoreUserFilter();
|
|
55618
55812
|
// Rows resolved by the sequential lookup pass above commit individually, BEFORE this check runs —
|
|
55619
55813
|
// a validation failure in the rest of the batch cannot roll those back, so "everything was reverted"
|
|
@@ -55628,9 +55822,9 @@ function createNavigationToolset(ctx) {
|
|
|
55628
55822
|
failed: failed.length ? summarizeFailures(failed) : undefined,
|
|
55629
55823
|
note: mergedOutcome.committed.length ? "".concat(mergedOutcome.committed.length, " row(s) addressed by keyColumn/keyValue were already COMMITTED individually before this validation failure (each such row is located, staged and saved on its own, to avoid losing it to a later filter change) \u2014 do NOT re-send those, see committedRowIds. The REST of the batch failed validation and was reverted: fix the listed problems and try ONE new stageTableEdits call for just those.").concat(addSchemaHint()) : "NOTHING was staged for approval: some rows fail the table's validation (everything was reverted). Fix the listed problems \u2014 e.g. fill the required columns \u2014 and try ONE new stageTableEdits call.".concat(addSchemaHint())
|
|
55630
55824
|
}));
|
|
55631
|
-
case
|
|
55825
|
+
case 414:
|
|
55632
55826
|
// Bring the first staged row into view; staged cells/rows are highlighted.
|
|
55633
|
-
focusNode = _api2.getRowNode((
|
|
55827
|
+
focusNode = _api2.getRowNode((_ref26 = (_ref27 = (_staged$0$rowId = (_staged$ = staged[0]) === null || _staged$ === void 0 ? void 0 : _staged$.rowId) !== null && _staged$0$rowId !== void 0 ? _staged$0$rowId : removed[0]) !== null && _ref27 !== void 0 ? _ref27 : (_addedRows$ = addedRows[0]) === null || _addedRows$ === void 0 ? void 0 : _addedRows$.rowId) !== null && _ref26 !== void 0 ? _ref26 : '');
|
|
55634
55828
|
if ((focusNode === null || focusNode === void 0 ? void 0 : focusNode.rowIndex) != null) _api2.ensureIndexVisible(focusNode.rowIndex, 'middle');
|
|
55635
55829
|
totalStaged = staged.length + addedRows.length + removed.length;
|
|
55636
55830
|
/**
|
|
@@ -55658,29 +55852,29 @@ function createNavigationToolset(ctx) {
|
|
|
55658
55852
|
}; // Block until the user decides on the approval bar (abort = discard) — unless auto-approve is on, or
|
|
55659
55853
|
// the sequential lookup pass above already asked (and got) the one approval this whole call needs.
|
|
55660
55854
|
if (!ctx.autoApprove && !preApproved) awaitingApproval();
|
|
55661
|
-
_context18.
|
|
55662
|
-
if (_context18.
|
|
55663
|
-
_context18.next =
|
|
55855
|
+
_context18.t11 = ctx.autoApprove || preApproved;
|
|
55856
|
+
if (_context18.t11) {
|
|
55857
|
+
_context18.next = 424;
|
|
55664
55858
|
break;
|
|
55665
55859
|
}
|
|
55666
|
-
_context18.next =
|
|
55860
|
+
_context18.next = 423;
|
|
55667
55861
|
return _entry2.requestAgentApproval(totalStaged, undefined, signal);
|
|
55668
|
-
case
|
|
55669
|
-
_context18.
|
|
55670
|
-
case
|
|
55671
|
-
approved = _context18.
|
|
55862
|
+
case 423:
|
|
55863
|
+
_context18.t11 = _context18.sent;
|
|
55864
|
+
case 424:
|
|
55865
|
+
approved = _context18.t11;
|
|
55672
55866
|
if (approved) {
|
|
55673
|
-
_context18.next =
|
|
55867
|
+
_context18.next = 434;
|
|
55674
55868
|
break;
|
|
55675
55869
|
}
|
|
55676
|
-
_context18.next =
|
|
55870
|
+
_context18.next = 428;
|
|
55677
55871
|
return handle.rollback();
|
|
55678
|
-
case
|
|
55872
|
+
case 428:
|
|
55679
55873
|
survived = survivingOperations();
|
|
55680
55874
|
survivedCount = survived.changes.length + survived.addedRowIds.length + survived.removedRowIds.length;
|
|
55681
55875
|
restoreUserFilter();
|
|
55682
55876
|
if (survivedCount) {
|
|
55683
|
-
_context18.next =
|
|
55877
|
+
_context18.next = 433;
|
|
55684
55878
|
break;
|
|
55685
55879
|
}
|
|
55686
55880
|
return _context18.abrupt("return", {
|
|
@@ -55689,7 +55883,7 @@ function createNavigationToolset(ctx) {
|
|
|
55689
55883
|
failed: failed.length ? summarizeFailures(failed) : undefined,
|
|
55690
55884
|
note: 'The user DISCARDED the staged changes — nothing was saved. Do NOT re-stage the same values; ask what to adjust instead.'
|
|
55691
55885
|
});
|
|
55692
|
-
case
|
|
55886
|
+
case 433:
|
|
55693
55887
|
return _context18.abrupt("return", {
|
|
55694
55888
|
applied: true,
|
|
55695
55889
|
appliedCount: survivedCount,
|
|
@@ -55706,7 +55900,7 @@ function createNavigationToolset(ctx) {
|
|
|
55706
55900
|
failed: failed.length ? summarizeFailures(failed) : undefined,
|
|
55707
55901
|
note: 'The user DISCARDED the staged changes, but the table had ALREADY SAVED the listed operations before the decision arrived ' + '(it saves pending edits by itself when the user clicks outside the grid), so the rollback found nothing to revert. ' + 'Report EXACTLY these operations as live on the server and ask the user whether to undo them — do NOT re-send them, and do not claim the discard took effect.'
|
|
55708
55902
|
});
|
|
55709
|
-
case
|
|
55903
|
+
case 434:
|
|
55710
55904
|
// Trim the echoed row: drop `*DisplayTexts` mirrors, collapse localized objects to one language.
|
|
55711
55905
|
trimEcho = function trimEcho(values) {
|
|
55712
55906
|
var isLocalized = function isLocalized(v) {
|
|
@@ -55719,16 +55913,16 @@ function createNavigationToolset(ctx) {
|
|
|
55719
55913
|
var _localized$DE;
|
|
55720
55914
|
var _Object$entries3$_i = _slicedToArray(_Object$entries3[_i8], 2),
|
|
55721
55915
|
key = _Object$entries3$_i[0],
|
|
55722
|
-
|
|
55916
|
+
value = _Object$entries3$_i[1];
|
|
55723
55917
|
if (/DisplayTexts?$/.test(key)) continue;
|
|
55724
|
-
var localized =
|
|
55725
|
-
out[key] = isLocalized(
|
|
55918
|
+
var localized = value;
|
|
55919
|
+
out[key] = isLocalized(value) ? (_localized$DE = localized.DE) !== null && _localized$DE !== void 0 ? _localized$DE : Object.values(localized)[0] : value;
|
|
55726
55920
|
}
|
|
55727
55921
|
return out;
|
|
55728
55922
|
}; // The commit REPORTS what the server confirmed; grid state cannot (a vanished rejected row gets no marker).
|
|
55729
|
-
_context18.next =
|
|
55923
|
+
_context18.next = 437;
|
|
55730
55924
|
return handle.commitStagedChanges();
|
|
55731
|
-
case
|
|
55925
|
+
case 437:
|
|
55732
55926
|
finalOutcome = _context18.sent;
|
|
55733
55927
|
// Rows resolved by the sequential lookup pass above were already committed individually — merge
|
|
55734
55928
|
// their outcomes in. When that pass never ran (the common case), this is exactly `finalOutcome`.
|
|
@@ -55752,10 +55946,10 @@ function createNavigationToolset(ctx) {
|
|
|
55752
55946
|
})), _toConsumableArray(addedRows.filter(function (a) {
|
|
55753
55947
|
return a.rowId === rowId;
|
|
55754
55948
|
}).flatMap(function (a) {
|
|
55755
|
-
return Object.entries(a.values).map(function (
|
|
55756
|
-
var
|
|
55757
|
-
column =
|
|
55758
|
-
value =
|
|
55949
|
+
return Object.entries(a.values).map(function (_ref28) {
|
|
55950
|
+
var _ref29 = _slicedToArray(_ref28, 2),
|
|
55951
|
+
column = _ref29[0],
|
|
55952
|
+
value = _ref29[1];
|
|
55759
55953
|
return {
|
|
55760
55954
|
column: column,
|
|
55761
55955
|
length: String(value !== null && value !== void 0 ? value : '').length
|
|
@@ -55799,37 +55993,37 @@ function createNavigationToolset(ctx) {
|
|
|
55799
55993
|
errors: [].concat(_toConsumableArray(said), _toConsumableArray(lengthNote ? [lengthNote] : []), _toConsumableArray(remedy ? [remedy] : []))
|
|
55800
55994
|
});
|
|
55801
55995
|
};
|
|
55802
|
-
|
|
55996
|
+
_iterator18 = _createForOfIteratorHelper$r((_outcome$failed = outcome === null || outcome === void 0 ? void 0 : outcome.failed) !== null && _outcome$failed !== void 0 ? _outcome$failed : []);
|
|
55803
55997
|
try {
|
|
55804
|
-
for (
|
|
55805
|
-
failure =
|
|
55998
|
+
for (_iterator18.s(); !(_step18 = _iterator18.n()).done;) {
|
|
55999
|
+
failure = _step18.value;
|
|
55806
56000
|
addError(failure.rowId, failure.errors);
|
|
55807
56001
|
}
|
|
55808
56002
|
} catch (err) {
|
|
55809
|
-
|
|
56003
|
+
_iterator18.e(err);
|
|
55810
56004
|
} finally {
|
|
55811
|
-
|
|
56005
|
+
_iterator18.f();
|
|
55812
56006
|
}
|
|
55813
|
-
|
|
56007
|
+
_iterator19 = _createForOfIteratorHelper$r((_outcome$skipped = outcome === null || outcome === void 0 ? void 0 : outcome.skipped) !== null && _outcome$skipped !== void 0 ? _outcome$skipped : []);
|
|
55814
56008
|
try {
|
|
55815
|
-
for (
|
|
55816
|
-
_rowId4 =
|
|
56009
|
+
for (_iterator19.s(); !(_step19 = _iterator19.n()).done;) {
|
|
56010
|
+
_rowId4 = _step19.value;
|
|
55817
56011
|
addError(_rowId4, ['Row was NOT sent to the server — the commit skipped it (its grid row was gone, or it still carried validation errors). ' + 'VERIFY BEFORE RE-SENDING: this message has been measured WRONG (the row WAS on the server) — locateRow the row by its key first; a blind re-send creates a silent duplicate. ' + 'Typical on rows created AFTER this view last loaded (the lazy grid evicts them): locateRow the row (loads and pins it), then re-send ONLY its cells as an own batch — one row per call.']);
|
|
55818
56012
|
}
|
|
55819
56013
|
// Secondary signal for rows the outcome did not mention: server-rejected rows stay pending with error markers.
|
|
55820
56014
|
} catch (err) {
|
|
55821
|
-
|
|
56015
|
+
_iterator19.e(err);
|
|
55822
56016
|
} finally {
|
|
55823
|
-
|
|
56017
|
+
_iterator19.f();
|
|
55824
56018
|
}
|
|
55825
|
-
|
|
56019
|
+
_iterator20 = _createForOfIteratorHelper$r(new Set([].concat(_toConsumableArray(staged.map(function (s) {
|
|
55826
56020
|
return s.rowId;
|
|
55827
56021
|
})), _toConsumableArray(addedRows.map(function (a) {
|
|
55828
56022
|
return a.rowId;
|
|
55829
56023
|
})), removed)));
|
|
55830
56024
|
try {
|
|
55831
|
-
for (
|
|
55832
|
-
_rowId5 =
|
|
56025
|
+
for (_iterator20.s(); !(_step20 = _iterator20.n()).done;) {
|
|
56026
|
+
_rowId5 = _step20.value;
|
|
55833
56027
|
_rowErrors = (_api2$getRowNode13 = _api2.getRowNode(_rowId5)) === null || _api2$getRowNode13 === void 0 || (_api2$getRowNode13 = _api2$getRowNode13.data) === null || _api2$getRowNode13 === void 0 || (_api2$getRowNode13 = _api2$getRowNode13.__diva_context) === null || _api2$getRowNode13 === void 0 ? void 0 : _api2$getRowNode13.errors;
|
|
55834
56028
|
if (Array.isArray(_rowErrors) && _rowErrors.length) {
|
|
55835
56029
|
addError(_rowId5, _rowErrors.map(function (e) {
|
|
@@ -55839,9 +56033,9 @@ function createNavigationToolset(ctx) {
|
|
|
55839
56033
|
}
|
|
55840
56034
|
// A committed row loses its isNew marker. NOT keyed on _id: bulk endpoints may not echo the record.
|
|
55841
56035
|
} catch (err) {
|
|
55842
|
-
|
|
56036
|
+
_iterator20.e(err);
|
|
55843
56037
|
} finally {
|
|
55844
|
-
|
|
56038
|
+
_iterator20.f();
|
|
55845
56039
|
}
|
|
55846
56040
|
for (_i9 = 0, _addedRows = addedRows; _i9 < _addedRows.length; _i9++) {
|
|
55847
56041
|
a = _addedRows[_i9];
|
|
@@ -55855,12 +56049,12 @@ function createNavigationToolset(ctx) {
|
|
|
55855
56049
|
survivedAfterCommit = outcomeIsEmpty ? survivingOperations() : undefined;
|
|
55856
56050
|
autoCommitted = !!survivedAfterCommit && survivedAfterCommit.changes.length + survivedAfterCommit.addedRowIds.length + survivedAfterCommit.removedRowIds.length > 0;
|
|
55857
56051
|
if (!(outcomeIsEmpty && !autoCommitted && !serverErrors.length)) {
|
|
55858
|
-
_context18.next =
|
|
56052
|
+
_context18.next = 461;
|
|
55859
56053
|
break;
|
|
55860
56054
|
}
|
|
55861
|
-
_context18.next =
|
|
56055
|
+
_context18.next = 459;
|
|
55862
56056
|
return handle.rollback();
|
|
55863
|
-
case
|
|
56057
|
+
case 459:
|
|
55864
56058
|
restoreUserFilter();
|
|
55865
56059
|
return _context18.abrupt("return", {
|
|
55866
56060
|
applied: false,
|
|
@@ -55868,13 +56062,13 @@ function createNavigationToolset(ctx) {
|
|
|
55868
56062
|
failed: failed.length ? summarizeFailures(failed) : undefined,
|
|
55869
56063
|
note: 'NOTHING was saved: the commit reported no row as saved or rejected, and the grid holds none of the staged values any more ' + '(the table dropped the pending edits before they were sent). Do NOT report this as done — re-read the rows (readGridRows) and stage the batch again.'
|
|
55870
56064
|
});
|
|
55871
|
-
case
|
|
56065
|
+
case 461:
|
|
55872
56066
|
autoCommittedOps = autoCommitted ? survivedAfterCommit : undefined;
|
|
55873
56067
|
committedIds = new Set(autoCommittedOps ? [].concat(_toConsumableArray(autoCommittedOps.changes.map(function (change) {
|
|
55874
56068
|
return change.rowId;
|
|
55875
56069
|
})), _toConsumableArray(autoCommittedOps.addedRowIds), _toConsumableArray(autoCommittedOps.removedRowIds)) : (_outcome$committed = outcome === null || outcome === void 0 ? void 0 : outcome.committed) !== null && _outcome$committed !== void 0 ? _outcome$committed : []);
|
|
55876
56070
|
if (!serverErrors.length) {
|
|
55877
|
-
_context18.next =
|
|
56071
|
+
_context18.next = 543;
|
|
55878
56072
|
break;
|
|
55879
56073
|
}
|
|
55880
56074
|
failedIds = new Set(serverErrors.map(function (s) {
|
|
@@ -55907,9 +56101,9 @@ function createNavigationToolset(ctx) {
|
|
|
55907
56101
|
_id: removedRecordIds.get(rowId)
|
|
55908
56102
|
};
|
|
55909
56103
|
}); // Clear the rejected leftovers (they would block the next staging).
|
|
55910
|
-
_context18.next =
|
|
56104
|
+
_context18.next = 470;
|
|
55911
56105
|
return handle.rollback();
|
|
55912
|
-
case
|
|
56106
|
+
case 470:
|
|
55913
56107
|
restoreUserFilter();
|
|
55914
56108
|
// Partial failure: neither the commit report nor the rollback is reliable — read the server back per operation.
|
|
55915
56109
|
hasIdColumn = !!_api2.getColumnDef('_id'); // A COUNT budget bounded nothing: one probe can spend three 8s row-waits, so 25 of them ran for ten
|
|
@@ -55923,7 +56117,7 @@ function createNavigationToolset(ctx) {
|
|
|
55923
56117
|
filterBeforeVerify = _api2.getFilterModel();
|
|
55924
56118
|
verifyFilterApplied = false;
|
|
55925
56119
|
probeServerRow = /*#__PURE__*/function () {
|
|
55926
|
-
var
|
|
56120
|
+
var _ref30 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee7(_id, onFound) {
|
|
55927
56121
|
var _id2, _located$node$data, located, exact;
|
|
55928
56122
|
return _regeneratorRuntime.wrap(function _callee7$(_context8) {
|
|
55929
56123
|
while (1) switch (_context8.prev = _context8.next) {
|
|
@@ -55984,8 +56178,8 @@ function createNavigationToolset(ctx) {
|
|
|
55984
56178
|
}
|
|
55985
56179
|
}, _callee7, null, [[5, 17]]);
|
|
55986
56180
|
}));
|
|
55987
|
-
return function probeServerRow(
|
|
55988
|
-
return
|
|
56181
|
+
return function probeServerRow(_x29, _x30) {
|
|
56182
|
+
return _ref30.apply(this, arguments);
|
|
55989
56183
|
};
|
|
55990
56184
|
}();
|
|
55991
56185
|
restoreVerifyFilter = function restoreVerifyFilter() {
|
|
@@ -55996,16 +56190,16 @@ function createNavigationToolset(ctx) {
|
|
|
55996
56190
|
verifiedChanges = [];
|
|
55997
56191
|
verifiedAdds = [];
|
|
55998
56192
|
verifiedRemovals = [];
|
|
55999
|
-
_context18.prev =
|
|
56000
|
-
|
|
56001
|
-
_context18.prev =
|
|
56193
|
+
_context18.prev = 481;
|
|
56194
|
+
_iterator21 = _createForOfIteratorHelper$r(editTargets);
|
|
56195
|
+
_context18.prev = 483;
|
|
56002
56196
|
_loop5 = /*#__PURE__*/_regeneratorRuntime.mark(function _loop5() {
|
|
56003
56197
|
var _expectedValueOf, _target$from;
|
|
56004
56198
|
var target, probe, serverValue, serverState;
|
|
56005
56199
|
return _regeneratorRuntime.wrap(function _loop5$(_context9) {
|
|
56006
56200
|
while (1) switch (_context9.prev = _context9.next) {
|
|
56007
56201
|
case 0:
|
|
56008
|
-
target =
|
|
56202
|
+
target = _step21.value;
|
|
56009
56203
|
_context9.next = 3;
|
|
56010
56204
|
return probeServerRow(target._id, function (node) {
|
|
56011
56205
|
return fmt(cellValueOf(_api2, node, target.column));
|
|
@@ -56042,48 +56236,48 @@ function createNavigationToolset(ctx) {
|
|
|
56042
56236
|
}
|
|
56043
56237
|
}, _loop5);
|
|
56044
56238
|
});
|
|
56045
|
-
|
|
56046
|
-
case
|
|
56047
|
-
if ((
|
|
56048
|
-
_context18.next =
|
|
56239
|
+
_iterator21.s();
|
|
56240
|
+
case 486:
|
|
56241
|
+
if ((_step21 = _iterator21.n()).done) {
|
|
56242
|
+
_context18.next = 492;
|
|
56049
56243
|
break;
|
|
56050
56244
|
}
|
|
56051
|
-
return _context18.delegateYield(_loop5(), "
|
|
56052
|
-
case
|
|
56053
|
-
if (!_context18.
|
|
56054
|
-
_context18.next =
|
|
56245
|
+
return _context18.delegateYield(_loop5(), "t12", 488);
|
|
56246
|
+
case 488:
|
|
56247
|
+
if (!_context18.t12) {
|
|
56248
|
+
_context18.next = 490;
|
|
56055
56249
|
break;
|
|
56056
56250
|
}
|
|
56057
|
-
return _context18.abrupt("continue",
|
|
56058
|
-
case
|
|
56059
|
-
_context18.next =
|
|
56251
|
+
return _context18.abrupt("continue", 490);
|
|
56252
|
+
case 490:
|
|
56253
|
+
_context18.next = 486;
|
|
56060
56254
|
break;
|
|
56061
|
-
case
|
|
56062
|
-
_context18.next =
|
|
56255
|
+
case 492:
|
|
56256
|
+
_context18.next = 497;
|
|
56063
56257
|
break;
|
|
56064
|
-
case
|
|
56065
|
-
_context18.prev =
|
|
56066
|
-
_context18.
|
|
56067
|
-
|
|
56068
|
-
case
|
|
56069
|
-
_context18.prev =
|
|
56070
|
-
|
|
56071
|
-
return _context18.finish(
|
|
56072
|
-
case
|
|
56073
|
-
|
|
56074
|
-
_context18.prev =
|
|
56075
|
-
|
|
56076
|
-
case
|
|
56077
|
-
if ((
|
|
56078
|
-
_context18.next =
|
|
56258
|
+
case 494:
|
|
56259
|
+
_context18.prev = 494;
|
|
56260
|
+
_context18.t13 = _context18["catch"](483);
|
|
56261
|
+
_iterator21.e(_context18.t13);
|
|
56262
|
+
case 497:
|
|
56263
|
+
_context18.prev = 497;
|
|
56264
|
+
_iterator21.f();
|
|
56265
|
+
return _context18.finish(497);
|
|
56266
|
+
case 500:
|
|
56267
|
+
_iterator22 = _createForOfIteratorHelper$r(addTargets);
|
|
56268
|
+
_context18.prev = 501;
|
|
56269
|
+
_iterator22.s();
|
|
56270
|
+
case 503:
|
|
56271
|
+
if ((_step22 = _iterator22.n()).done) {
|
|
56272
|
+
_context18.next = 511;
|
|
56079
56273
|
break;
|
|
56080
56274
|
}
|
|
56081
|
-
target =
|
|
56082
|
-
_context18.next =
|
|
56275
|
+
target = _step22.value;
|
|
56276
|
+
_context18.next = 507;
|
|
56083
56277
|
return probeServerRow(target._id, function () {
|
|
56084
56278
|
return true;
|
|
56085
56279
|
});
|
|
56086
|
-
case
|
|
56280
|
+
case 507:
|
|
56087
56281
|
probe = _context18.sent;
|
|
56088
56282
|
verifiedAdds.push(_objectSpread$X(_objectSpread$X({
|
|
56089
56283
|
rowId: target.rowId,
|
|
@@ -56093,60 +56287,60 @@ function createNavigationToolset(ctx) {
|
|
|
56093
56287
|
} : {}), {}, {
|
|
56094
56288
|
serverState: probe.state === 'found' ? 'applied' : probe.state === 'missing' ? 'reverted' : 'unknown'
|
|
56095
56289
|
}));
|
|
56096
|
-
case
|
|
56097
|
-
_context18.next =
|
|
56290
|
+
case 509:
|
|
56291
|
+
_context18.next = 503;
|
|
56098
56292
|
break;
|
|
56099
|
-
case
|
|
56100
|
-
_context18.next =
|
|
56293
|
+
case 511:
|
|
56294
|
+
_context18.next = 516;
|
|
56101
56295
|
break;
|
|
56102
|
-
case
|
|
56103
|
-
_context18.prev =
|
|
56104
|
-
_context18.
|
|
56105
|
-
|
|
56106
|
-
case
|
|
56107
|
-
_context18.prev =
|
|
56108
|
-
|
|
56109
|
-
return _context18.finish(
|
|
56110
|
-
case
|
|
56111
|
-
|
|
56112
|
-
_context18.prev =
|
|
56113
|
-
|
|
56114
|
-
case
|
|
56115
|
-
if ((
|
|
56116
|
-
_context18.next =
|
|
56296
|
+
case 513:
|
|
56297
|
+
_context18.prev = 513;
|
|
56298
|
+
_context18.t14 = _context18["catch"](501);
|
|
56299
|
+
_iterator22.e(_context18.t14);
|
|
56300
|
+
case 516:
|
|
56301
|
+
_context18.prev = 516;
|
|
56302
|
+
_iterator22.f();
|
|
56303
|
+
return _context18.finish(516);
|
|
56304
|
+
case 519:
|
|
56305
|
+
_iterator23 = _createForOfIteratorHelper$r(removalTargets);
|
|
56306
|
+
_context18.prev = 520;
|
|
56307
|
+
_iterator23.s();
|
|
56308
|
+
case 522:
|
|
56309
|
+
if ((_step23 = _iterator23.n()).done) {
|
|
56310
|
+
_context18.next = 530;
|
|
56117
56311
|
break;
|
|
56118
56312
|
}
|
|
56119
|
-
_target =
|
|
56120
|
-
_context18.next =
|
|
56313
|
+
_target = _step23.value;
|
|
56314
|
+
_context18.next = 526;
|
|
56121
56315
|
return probeServerRow(_target._id, function () {
|
|
56122
56316
|
return true;
|
|
56123
56317
|
});
|
|
56124
|
-
case
|
|
56318
|
+
case 526:
|
|
56125
56319
|
_probe = _context18.sent;
|
|
56126
56320
|
verifiedRemovals.push({
|
|
56127
56321
|
rowId: _target.rowId,
|
|
56128
56322
|
serverState: _probe.state === 'missing' ? 'applied' : _probe.state === 'found' ? 'reverted' : 'unknown'
|
|
56129
56323
|
});
|
|
56130
|
-
case
|
|
56131
|
-
_context18.next =
|
|
56324
|
+
case 528:
|
|
56325
|
+
_context18.next = 522;
|
|
56132
56326
|
break;
|
|
56133
|
-
case
|
|
56134
|
-
_context18.next =
|
|
56327
|
+
case 530:
|
|
56328
|
+
_context18.next = 535;
|
|
56135
56329
|
break;
|
|
56136
|
-
case
|
|
56137
|
-
_context18.prev =
|
|
56138
|
-
_context18.
|
|
56139
|
-
|
|
56140
|
-
case
|
|
56141
|
-
_context18.prev =
|
|
56142
|
-
|
|
56143
|
-
return _context18.finish(
|
|
56144
|
-
case
|
|
56145
|
-
_context18.prev =
|
|
56330
|
+
case 532:
|
|
56331
|
+
_context18.prev = 532;
|
|
56332
|
+
_context18.t15 = _context18["catch"](520);
|
|
56333
|
+
_iterator23.e(_context18.t15);
|
|
56334
|
+
case 535:
|
|
56335
|
+
_context18.prev = 535;
|
|
56336
|
+
_iterator23.f();
|
|
56337
|
+
return _context18.finish(535);
|
|
56338
|
+
case 538:
|
|
56339
|
+
_context18.prev = 538;
|
|
56146
56340
|
// The table belongs to the user again before we answer, whatever the probes did.
|
|
56147
56341
|
restoreVerifyFilter();
|
|
56148
|
-
return _context18.finish(
|
|
56149
|
-
case
|
|
56342
|
+
return _context18.finish(538);
|
|
56343
|
+
case 541:
|
|
56150
56344
|
appliedCount = [].concat(verifiedChanges, verifiedAdds, verifiedRemovals).filter(function (v) {
|
|
56151
56345
|
return v.serverState === 'applied';
|
|
56152
56346
|
}).length;
|
|
@@ -56171,7 +56365,7 @@ function createNavigationToolset(ctx) {
|
|
|
56171
56365
|
failed: failed.length ? summarizeFailures(failed) : undefined,
|
|
56172
56366
|
note: 'The SERVER REJECTED the listed rows. Every other operation was READ BACK from the server — its `serverState` is the truth: ' + 'applied = the effect IS on the server (do NOT re-send it), reverted = re-send it after fixing the rejection cause, ' + 'unknown = verify with readGridRows/locateRow before re-sending. Never re-send an applied or unknown operation blindly — that is how silent duplicates happen.' + (verifyDeadlineHit ? ' The read-back ran out of time, so some `unknown`s mean UNCHECKED rather than unanswered — check those yourself before deciding.' : '') + parentBindingNote
|
|
56173
56367
|
}));
|
|
56174
|
-
case
|
|
56368
|
+
case 543:
|
|
56175
56369
|
// Return the real _id so references are not built from grid rowIds; catalogs/packages list rows are new EDITORS.
|
|
56176
56370
|
livePath = (_root$navigationState3 = root.navigationState.path) !== null && _root$navigationState3 !== void 0 ? _root$navigationState3 : '';
|
|
56177
56371
|
editorPathFor = function editorPathFor(id) {
|
|
@@ -56238,23 +56432,23 @@ function createNavigationToolset(ctx) {
|
|
|
56238
56432
|
column: s.column
|
|
56239
56433
|
};
|
|
56240
56434
|
})), _toConsumableArray(addedRows.flatMap(function (a) {
|
|
56241
|
-
return Object.entries(a.values).filter(function (
|
|
56435
|
+
return Object.entries(a.values).filter(function (_ref31) {
|
|
56242
56436
|
var _providedAddColumns$g, _providedAddColumns$g2;
|
|
56243
|
-
var
|
|
56244
|
-
column =
|
|
56245
|
-
value =
|
|
56437
|
+
var _ref32 = _slicedToArray(_ref31, 2),
|
|
56438
|
+
column = _ref32[0],
|
|
56439
|
+
value = _ref32[1];
|
|
56246
56440
|
return !isEmptyCell(value) && ((_providedAddColumns$g = (_providedAddColumns$g2 = providedAddColumns.get(a.rowId)) === null || _providedAddColumns$g2 === void 0 ? void 0 : _providedAddColumns$g2.has(column)) !== null && _providedAddColumns$g !== void 0 ? _providedAddColumns$g : true);
|
|
56247
|
-
}).map(function (
|
|
56248
|
-
var
|
|
56249
|
-
column =
|
|
56441
|
+
}).map(function (_ref33) {
|
|
56442
|
+
var _ref34 = _slicedToArray(_ref33, 1),
|
|
56443
|
+
column = _ref34[0];
|
|
56250
56444
|
return {
|
|
56251
56445
|
rowId: a.rowId,
|
|
56252
56446
|
column: column
|
|
56253
56447
|
};
|
|
56254
56448
|
});
|
|
56255
|
-
}))).filter(function (
|
|
56256
|
-
var rowId =
|
|
56257
|
-
column =
|
|
56449
|
+
}))).filter(function (_ref35) {
|
|
56450
|
+
var rowId = _ref35.rowId,
|
|
56451
|
+
column = _ref35.column;
|
|
56258
56452
|
var node = _api2.getRowNode(rowId);
|
|
56259
56453
|
return node ? isEmptyCell(cellValueOf(_api2, node, column)) : false;
|
|
56260
56454
|
});
|
|
@@ -56296,7 +56490,7 @@ function createNavigationToolset(ctx) {
|
|
|
56296
56490
|
// The serie by NUMBER AND NAME, not by 24-hex id — the thing to check is whether this is serie 0.
|
|
56297
56491
|
serieScope && (addedRows.length || staged.length || removed.length) ? " SERIE-SCOPED TABLE: these rows belong to ".concat(serieLabelOf(serieScope), " \u2014 the serie the VIEW's selector held, which AUTO-SELECTS THE FIRST serie when nobody chose one").concat(addedRows.length ? ', so a new row can land in the components serie without anyone deciding that' : '', ". CONFIRM it is the serie you meant before continuing.").concat(foreignSeries.length ? " MISMATCH: the saved record(s) report serieId ".concat(foreignSeries.join(', '), ", which is NOT this view's scope \u2014 read the rows back before doing anything else.") : '') : '') + (removed.length ? ' REMOVALS: inbound references are NOT cleaned up. Deleting an entity leaves dead pointers in decisions (featureRefs + condition columns), price feature groups + their finishes conditions, option-group membership, partlistpos.itemRefTypeNo, items.featureClassRefNo and items.partListRef, plus formula keys inside action strings — measured on all of these. Two of them make the planner THROW on init (a missing feature class, a missing formula). Only option keys inside decision condition/action cells are cleaned, and a deleted PRICE FEATURE GROUP is the one clean case (its matrix column goes with it). So after any delete, read the referrers yourself; nothing warns you. ' + 'lintCatalog finds most of them AFTER a reloadPlanner — but NOT a dead items.featureClassRefNo, because that article throws during init and never enters the snapshot it lints. For that one check the EDITOR: on the items view, readGridRows({grid:"items", columns:["typeNo","featureClassRefNo"]}) and compare against readColumnOptions({grid:"items", column:"featureClassRefNo"}), which lists the classes that still exist. Same approach for partlistpos.itemRefTypeNo against the items list.' : '') + ' Loaded planner instances still hold PRE-change data — reloadPlanner before verifying these changes in the planner.' + (stagingNotes.length ? " HOUSE-STYLE NOTES: ".concat(stagingNotes.join(' ')) : '')
|
|
56298
56492
|
}));
|
|
56299
|
-
case
|
|
56493
|
+
case 557:
|
|
56300
56494
|
// Thrown (not returned) so the refusal does NOT end the turn — the model tells the user to decide on the staged edits first.
|
|
56301
56495
|
dirtyGrids = root.gridRegistry.entries.filter(function (entry) {
|
|
56302
56496
|
var _entry$getHandle4;
|
|
@@ -56305,11 +56499,11 @@ function createNavigationToolset(ctx) {
|
|
|
56305
56499
|
return entry.label;
|
|
56306
56500
|
});
|
|
56307
56501
|
if (!dirtyGrids.length) {
|
|
56308
|
-
_context18.next =
|
|
56502
|
+
_context18.next = 560;
|
|
56309
56503
|
break;
|
|
56310
56504
|
}
|
|
56311
56505
|
throw new Error("Page reload refused: table(s) ".concat(dirtyGrids.join(', '), " still carry staged, unapproved edits that a reload would silently drop. Ask the user to \xDCbernehmen or Verwerfen them first, then call reloadPage again."));
|
|
56312
|
-
case
|
|
56506
|
+
case 560:
|
|
56313
56507
|
// Deferred so the tool result reaches the chat and the turn is persisted (the stored endedByTool record is what
|
|
56314
56508
|
// triggers the automatic 'Continue.' after the reload) before the document unloads.
|
|
56315
56509
|
setTimeout(function () {
|
|
@@ -56321,29 +56515,29 @@ function createNavigationToolset(ctx) {
|
|
|
56321
56515
|
pageReload: true,
|
|
56322
56516
|
note: "Full page reload triggered — this turn ends here. The chat reopens on this conversation and an automatic 'Continue.' follows once the view is ready (if the agent panel is not open after the reload, it fires when the user opens it). Every planner instance is rebuilt from a FRESH article payload, so decisionRefs and media changes are now in effect — verify with listDecisions / getMediaInfo, do not assume."
|
|
56323
56517
|
});
|
|
56324
|
-
case
|
|
56518
|
+
case 562:
|
|
56325
56519
|
_livePath = (_root$navigationState4 = root.navigationState.path) !== null && _root$navigationState4 !== void 0 ? _root$navigationState4 : '';
|
|
56326
56520
|
packageBase = (_livePath$match = _livePath.match(/catalogs\/idmeditor\/packages\/([^/]+)/)) === null || _livePath$match === void 0 ? void 0 : _livePath$match[1];
|
|
56327
56521
|
catalogBase = (_livePath$match2 = _livePath.match(/catalogs\/idmeditor\/catalogs\/([^/]+)/)) === null || _livePath$match2 === void 0 ? void 0 : _livePath$match2[1];
|
|
56328
|
-
baseId = (
|
|
56522
|
+
baseId = (_ref44 = (_ref45 = packageBase !== null && packageBase !== void 0 ? packageBase : catalogBase) !== null && _ref45 !== void 0 ? _ref45 : ctx.packageId) !== null && _ref44 !== void 0 ? _ref44 : ctx.catalogId;
|
|
56329
56523
|
if (baseId) {
|
|
56330
|
-
_context18.next =
|
|
56524
|
+
_context18.next = 568;
|
|
56331
56525
|
break;
|
|
56332
56526
|
}
|
|
56333
56527
|
return _context18.abrupt("return", {
|
|
56334
56528
|
error: 'No catalog/package context — nothing to reload.'
|
|
56335
56529
|
});
|
|
56336
|
-
case
|
|
56530
|
+
case 568:
|
|
56337
56531
|
// Package views load the ENRICHER pack, catalog views the raw IDM catalog.
|
|
56338
56532
|
isPack = baseId === packageBase || !packageBase && !catalogBase && baseId === ctx.packageId;
|
|
56339
56533
|
_root$webplannerInsta = root.webplannerInstanceStore.invalidateByBase(baseId), destroyed = _root$webplannerInsta.destroyed, reloadTriggered = _root$webplannerInsta.reloadTriggered, knownKeys = _root$webplannerInsta.knownKeys;
|
|
56340
56534
|
source = isPack ? "PACKAGE ".concat(baseId, " (enricher pack: pricelist factors and manual prices APPLY)") : "CATALOG ".concat(baseId, " (raw IDM catalog: enricher pricelists do NOT apply \u2014 to verify pack prices, navigateTo the package view first, then reloadPlanner there)"); // A base matching no instance key invalidates nothing — report that instead of claiming the discard happened.
|
|
56341
56535
|
if (!(!destroyed && !reloadTriggered)) {
|
|
56342
|
-
_context18.next =
|
|
56536
|
+
_context18.next = 575;
|
|
56343
56537
|
break;
|
|
56344
56538
|
}
|
|
56345
56539
|
if (knownKeys.length) {
|
|
56346
|
-
_context18.next =
|
|
56540
|
+
_context18.next = 574;
|
|
56347
56541
|
break;
|
|
56348
56542
|
}
|
|
56349
56543
|
return _context18.abrupt("return", {
|
|
@@ -56353,7 +56547,7 @@ function createNavigationToolset(ctx) {
|
|
|
56353
56547
|
environmentUnchanged: true,
|
|
56354
56548
|
note: "NOTHING TO RELOAD \u2014 no planner instance is loaded for ".concat(baseId, ", so there was no stale snapshot to discard. The next planner use loads CURRENT data from ").concat(source, ".")
|
|
56355
56549
|
});
|
|
56356
|
-
case
|
|
56550
|
+
case 574:
|
|
56357
56551
|
return _context18.abrupt("return", {
|
|
56358
56552
|
ok: false,
|
|
56359
56553
|
destroyed: destroyed,
|
|
@@ -56362,32 +56556,32 @@ function createNavigationToolset(ctx) {
|
|
|
56362
56556
|
knownKeys: knownKeys,
|
|
56363
56557
|
error: "Nothing was invalidated: no loaded planner belongs to '".concat(baseId, "'. Loaded instance keys are [").concat(knownKeys.join(', '), "] ") + "(key = catalogId|serieNo|itemTypeNo|language). A key whose first segment is EMPTY or differs from '".concat(baseId, "' means the ") + "configurator was mounted without the catalog binding \u2014 reload the page to re-bind, then reloadPlanner again. Do NOT treat " + "planner reads as current until this succeeds."
|
|
56364
56558
|
});
|
|
56365
|
-
case
|
|
56559
|
+
case 575:
|
|
56366
56560
|
return _context18.abrupt("return", {
|
|
56367
56561
|
ok: true,
|
|
56368
56562
|
destroyed: destroyed,
|
|
56369
56563
|
reloadTriggered: reloadTriggered,
|
|
56370
56564
|
note: "Planner instances were discarded \u2014 the next planner use loads CURRENT data from ".concat(source) + (reloadTriggered ? ' (the open configurator reloads itself, and its stale instance is destroyed rather than re-adopted)' : '') + ". The turn ends here; an automatic 'Continue.' follows."
|
|
56371
56565
|
});
|
|
56372
|
-
case
|
|
56566
|
+
case 576:
|
|
56373
56567
|
_resolveGrid4 = resolveGrid(args.grid), _entry3 = _resolveGrid4.entry, _error3 = _resolveGrid4.error;
|
|
56374
56568
|
if (!(_error3 || !_entry3)) {
|
|
56375
|
-
_context18.next =
|
|
56569
|
+
_context18.next = 579;
|
|
56376
56570
|
break;
|
|
56377
56571
|
}
|
|
56378
56572
|
return _context18.abrupt("return", {
|
|
56379
56573
|
error: _error3
|
|
56380
56574
|
});
|
|
56381
|
-
case
|
|
56575
|
+
case 579:
|
|
56382
56576
|
_handle = _entry3.getHandle();
|
|
56383
56577
|
if (_handle) {
|
|
56384
|
-
_context18.next =
|
|
56578
|
+
_context18.next = 582;
|
|
56385
56579
|
break;
|
|
56386
56580
|
}
|
|
56387
56581
|
return _context18.abrupt("return", {
|
|
56388
56582
|
error: "Table '".concat(_entry3.label, "' is not ready.")
|
|
56389
56583
|
});
|
|
56390
|
-
case
|
|
56584
|
+
case 582:
|
|
56391
56585
|
actionName = String((_action = input === null || input === void 0 ? void 0 : input.action) !== null && _action !== void 0 ? _action : '');
|
|
56392
56586
|
actionInput = String((_input = input === null || input === void 0 ? void 0 : input.input) !== null && _input !== void 0 ? _input : '').trim();
|
|
56393
56587
|
_addTargets = _handle.getDivaColumnDefs().filter(isHeaderAddColumn);
|
|
@@ -56399,15 +56593,15 @@ function createNavigationToolset(ctx) {
|
|
|
56399
56593
|
return action.name;
|
|
56400
56594
|
})));
|
|
56401
56595
|
if (available.includes(actionName)) {
|
|
56402
|
-
_context18.next =
|
|
56596
|
+
_context18.next = 590;
|
|
56403
56597
|
break;
|
|
56404
56598
|
}
|
|
56405
56599
|
return _context18.abrupt("return", {
|
|
56406
56600
|
error: "Action '".concat(actionName, "' is not available on '").concat(_entry3.label, "' \u2014 this table has: ").concat(available.join(', ') || 'no actions', " (listGrids shows each table's actions).")
|
|
56407
56601
|
});
|
|
56408
|
-
case
|
|
56602
|
+
case 590:
|
|
56409
56603
|
approve = /*#__PURE__*/function () {
|
|
56410
|
-
var
|
|
56604
|
+
var _ref46 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee8(label) {
|
|
56411
56605
|
return _regeneratorRuntime.wrap(function _callee8$(_context13) {
|
|
56412
56606
|
while (1) switch (_context13.prev = _context13.next) {
|
|
56413
56607
|
case 0:
|
|
@@ -56429,8 +56623,8 @@ function createNavigationToolset(ctx) {
|
|
|
56429
56623
|
}
|
|
56430
56624
|
}, _callee8);
|
|
56431
56625
|
}));
|
|
56432
|
-
return function approve(
|
|
56433
|
-
return
|
|
56626
|
+
return function approve(_x31) {
|
|
56627
|
+
return _ref46.apply(this, arguments);
|
|
56434
56628
|
};
|
|
56435
56629
|
}();
|
|
56436
56630
|
declined = {
|
|
@@ -56439,7 +56633,7 @@ function createNavigationToolset(ctx) {
|
|
|
56439
56633
|
}; // Same transparency rule as stageTableEdits: a silently executed action must be reported as such.
|
|
56440
56634
|
autoNote = ctx.autoApprove ? ' AUTO-APPROVE is on — executed WITHOUT the approval bar; mention that ONCE per reply, not per call.' : '';
|
|
56441
56635
|
authorizedFetch = /*#__PURE__*/function () {
|
|
56442
|
-
var
|
|
56636
|
+
var _ref47 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee9(url, method, body) {
|
|
56443
56637
|
var response, detail;
|
|
56444
56638
|
return _regeneratorRuntime.wrap(function _callee9$(_context14) {
|
|
56445
56639
|
while (1) switch (_context14.prev = _context14.next) {
|
|
@@ -56473,12 +56667,12 @@ function createNavigationToolset(ctx) {
|
|
|
56473
56667
|
}
|
|
56474
56668
|
}, _callee9);
|
|
56475
56669
|
}));
|
|
56476
|
-
return function authorizedFetch(
|
|
56477
|
-
return
|
|
56670
|
+
return function authorizedFetch(_x32, _x33, _x34) {
|
|
56671
|
+
return _ref47.apply(this, arguments);
|
|
56478
56672
|
};
|
|
56479
56673
|
}(); // The reload is asynchronous — purge, then wait bounded until rows are back.
|
|
56480
56674
|
refreshAndSettle = /*#__PURE__*/function () {
|
|
56481
|
-
var
|
|
56675
|
+
var _ref48 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee10() {
|
|
56482
56676
|
var api, deadline;
|
|
56483
56677
|
return _regeneratorRuntime.wrap(function _callee10$(_context15) {
|
|
56484
56678
|
while (1) switch (_context15.prev = _context15.next) {
|
|
@@ -56505,7 +56699,7 @@ function createNavigationToolset(ctx) {
|
|
|
56505
56699
|
}, _callee10);
|
|
56506
56700
|
}));
|
|
56507
56701
|
return function refreshAndSettle() {
|
|
56508
|
-
return
|
|
56702
|
+
return _ref48.apply(this, arguments);
|
|
56509
56703
|
};
|
|
56510
56704
|
}();
|
|
56511
56705
|
unsettledNote = ' WARNING: the table has NOT repopulated yet (server still recomputing) — before reading it, reopen the view: locateRow the parent row again, openToolbarTool the subtable.'; // Declared by the VIEW and executed by it — this toolset only carries the input and the approval.
|
|
@@ -56513,336 +56707,336 @@ function createNavigationToolset(ctx) {
|
|
|
56513
56707
|
return action.name === actionName;
|
|
56514
56708
|
});
|
|
56515
56709
|
if (!viewAction) {
|
|
56516
|
-
_context18.next =
|
|
56710
|
+
_context18.next = 618;
|
|
56517
56711
|
break;
|
|
56518
56712
|
}
|
|
56519
56713
|
mutating = viewAction.mutating !== false;
|
|
56520
|
-
_context18.
|
|
56521
|
-
if (!_context18.
|
|
56522
|
-
_context18.next =
|
|
56714
|
+
_context18.t16 = mutating;
|
|
56715
|
+
if (!_context18.t16) {
|
|
56716
|
+
_context18.next = 604;
|
|
56523
56717
|
break;
|
|
56524
56718
|
}
|
|
56525
|
-
_context18.next =
|
|
56719
|
+
_context18.next = 603;
|
|
56526
56720
|
return approve("".concat(actionName, ": ").concat(actionInput || '(no input)'));
|
|
56527
|
-
case
|
|
56528
|
-
_context18.
|
|
56529
|
-
case
|
|
56530
|
-
if (!_context18.
|
|
56531
|
-
_context18.next =
|
|
56721
|
+
case 603:
|
|
56722
|
+
_context18.t16 = !_context18.sent;
|
|
56723
|
+
case 604:
|
|
56724
|
+
if (!_context18.t16) {
|
|
56725
|
+
_context18.next = 606;
|
|
56532
56726
|
break;
|
|
56533
56727
|
}
|
|
56534
56728
|
return _context18.abrupt("return", declined);
|
|
56535
|
-
case
|
|
56536
|
-
_context18.prev =
|
|
56537
|
-
_context18.
|
|
56538
|
-
_context18.next =
|
|
56729
|
+
case 606:
|
|
56730
|
+
_context18.prev = 606;
|
|
56731
|
+
_context18.t17 = "";
|
|
56732
|
+
_context18.next = 610;
|
|
56539
56733
|
return viewAction.run(actionInput);
|
|
56540
|
-
case
|
|
56541
|
-
_context18.
|
|
56542
|
-
_context18.
|
|
56734
|
+
case 610:
|
|
56735
|
+
_context18.t18 = _context18.sent;
|
|
56736
|
+
_context18.t19 = _context18.t17.concat.call(_context18.t17, _context18.t18).concat(mutating ? autoNote : '');
|
|
56543
56737
|
return _context18.abrupt("return", {
|
|
56544
56738
|
applied: true,
|
|
56545
|
-
note: _context18.
|
|
56739
|
+
note: _context18.t19
|
|
56546
56740
|
});
|
|
56547
|
-
case
|
|
56548
|
-
_context18.prev =
|
|
56549
|
-
_context18.
|
|
56741
|
+
case 615:
|
|
56742
|
+
_context18.prev = 615;
|
|
56743
|
+
_context18.t20 = _context18["catch"](606);
|
|
56550
56744
|
return _context18.abrupt("return", {
|
|
56551
|
-
error: _context18.
|
|
56745
|
+
error: _context18.t20 instanceof Error ? _context18.t20.message : String(_context18.t20)
|
|
56552
56746
|
});
|
|
56553
|
-
case
|
|
56747
|
+
case 618:
|
|
56554
56748
|
if (!(actionName === 'cloneCatalog')) {
|
|
56555
|
-
_context18.next =
|
|
56749
|
+
_context18.next = 637;
|
|
56556
56750
|
break;
|
|
56557
56751
|
}
|
|
56558
56752
|
if (isRecordId(actionInput)) {
|
|
56559
|
-
_context18.next =
|
|
56753
|
+
_context18.next = 621;
|
|
56560
56754
|
break;
|
|
56561
56755
|
}
|
|
56562
56756
|
return _context18.abrupt("return", {
|
|
56563
56757
|
error: "input must be the catalog's _id (24-hex) — read it from the _id column (readGridRows)."
|
|
56564
56758
|
});
|
|
56565
|
-
case
|
|
56566
|
-
_context18.next =
|
|
56759
|
+
case 621:
|
|
56760
|
+
_context18.next = 623;
|
|
56567
56761
|
return approve("cloneCatalog: ".concat(actionInput));
|
|
56568
|
-
case
|
|
56762
|
+
case 623:
|
|
56569
56763
|
if (_context18.sent) {
|
|
56570
|
-
_context18.next =
|
|
56764
|
+
_context18.next = 625;
|
|
56571
56765
|
break;
|
|
56572
56766
|
}
|
|
56573
56767
|
return _context18.abrupt("return", declined);
|
|
56574
|
-
case
|
|
56575
|
-
_context18.prev =
|
|
56576
|
-
_context18.next =
|
|
56768
|
+
case 625:
|
|
56769
|
+
_context18.prev = 625;
|
|
56770
|
+
_context18.next = 628;
|
|
56577
56771
|
return authorizedFetch("".concat(root.configurationStore.apiConfig.idmService, "/catalogs/").concat(actionInput, "/clone"), 'POST', '{}');
|
|
56578
|
-
case
|
|
56579
|
-
_context18.next =
|
|
56772
|
+
case 628:
|
|
56773
|
+
_context18.next = 633;
|
|
56580
56774
|
break;
|
|
56581
|
-
case
|
|
56582
|
-
_context18.prev =
|
|
56583
|
-
_context18.
|
|
56775
|
+
case 630:
|
|
56776
|
+
_context18.prev = 630;
|
|
56777
|
+
_context18.t21 = _context18["catch"](625);
|
|
56584
56778
|
return _context18.abrupt("return", {
|
|
56585
|
-
error: _context18.
|
|
56779
|
+
error: _context18.t21 instanceof Error ? _context18.t21.message : String(_context18.t21)
|
|
56586
56780
|
});
|
|
56587
|
-
case
|
|
56588
|
-
_context18.next =
|
|
56781
|
+
case 633:
|
|
56782
|
+
_context18.next = 635;
|
|
56589
56783
|
return refreshAndSettle();
|
|
56590
|
-
case
|
|
56784
|
+
case 635:
|
|
56591
56785
|
cloneSettled = _context18.sent;
|
|
56592
56786
|
return _context18.abrupt("return", {
|
|
56593
56787
|
applied: true,
|
|
56594
56788
|
note: "Catalog cloned server-side \u2014 the table refreshes; the copy appears as a new row (readGridRows to find it and REPORT its name + _id).".concat(autoNote).concat(cloneSettled ? '' : unsettledNote)
|
|
56595
56789
|
});
|
|
56596
|
-
case
|
|
56790
|
+
case 637:
|
|
56597
56791
|
if (!(actionName === 'importGlobalFeatures')) {
|
|
56598
|
-
_context18.next =
|
|
56792
|
+
_context18.next = 657;
|
|
56599
56793
|
break;
|
|
56600
56794
|
}
|
|
56601
56795
|
catalogId = String((_catalogId = ((_handle$getApplicatio7 = (_handle$getApplicatio8 = _handle.getApplicationData) === null || _handle$getApplicatio8 === void 0 ? void 0 : _handle$getApplicatio8.call(_handle)) !== null && _handle$getApplicatio7 !== void 0 ? _handle$getApplicatio7 : {}).catalogId) !== null && _catalogId !== void 0 ? _catalogId : '');
|
|
56602
56796
|
if (catalogId) {
|
|
56603
|
-
_context18.next =
|
|
56797
|
+
_context18.next = 641;
|
|
56604
56798
|
break;
|
|
56605
56799
|
}
|
|
56606
56800
|
return _context18.abrupt("return", {
|
|
56607
56801
|
error: 'No catalog context on this table.'
|
|
56608
56802
|
});
|
|
56609
|
-
case
|
|
56610
|
-
_context18.next =
|
|
56803
|
+
case 641:
|
|
56804
|
+
_context18.next = 643;
|
|
56611
56805
|
return approve('importGlobalFeatures');
|
|
56612
|
-
case
|
|
56806
|
+
case 643:
|
|
56613
56807
|
if (_context18.sent) {
|
|
56614
|
-
_context18.next =
|
|
56808
|
+
_context18.next = 645;
|
|
56615
56809
|
break;
|
|
56616
56810
|
}
|
|
56617
56811
|
return _context18.abrupt("return", declined);
|
|
56618
|
-
case
|
|
56619
|
-
_context18.prev =
|
|
56620
|
-
_context18.next =
|
|
56812
|
+
case 645:
|
|
56813
|
+
_context18.prev = 645;
|
|
56814
|
+
_context18.next = 648;
|
|
56621
56815
|
return authorizedFetch("".concat(root.configurationStore.apiConfig.idmService, "/catalogs/").concat(catalogId, "/features/global"), 'POST');
|
|
56622
|
-
case
|
|
56623
|
-
_context18.next =
|
|
56816
|
+
case 648:
|
|
56817
|
+
_context18.next = 653;
|
|
56624
56818
|
break;
|
|
56625
|
-
case
|
|
56626
|
-
_context18.prev =
|
|
56627
|
-
_context18.
|
|
56819
|
+
case 650:
|
|
56820
|
+
_context18.prev = 650;
|
|
56821
|
+
_context18.t22 = _context18["catch"](645);
|
|
56628
56822
|
return _context18.abrupt("return", {
|
|
56629
|
-
error: _context18.
|
|
56823
|
+
error: _context18.t22 instanceof Error ? _context18.t22.message : String(_context18.t22)
|
|
56630
56824
|
});
|
|
56631
|
-
case
|
|
56632
|
-
_context18.next =
|
|
56825
|
+
case 653:
|
|
56826
|
+
_context18.next = 655;
|
|
56633
56827
|
return refreshAndSettle();
|
|
56634
|
-
case
|
|
56828
|
+
case 655:
|
|
56635
56829
|
importSettled = _context18.sent;
|
|
56636
56830
|
return _context18.abrupt("return", {
|
|
56637
56831
|
applied: true,
|
|
56638
56832
|
note: "Global features imported \u2014 the table refreshes with the added feature rows.".concat(autoNote).concat(importSettled ? '' : unsettledNote)
|
|
56639
56833
|
});
|
|
56640
|
-
case
|
|
56834
|
+
case 657:
|
|
56641
56835
|
if (!(actionName === 'setPriceFactor' || actionName === 'setPriceFactorPriority')) {
|
|
56642
|
-
_context18.next =
|
|
56836
|
+
_context18.next = 718;
|
|
56643
56837
|
break;
|
|
56644
56838
|
}
|
|
56645
56839
|
app = (_handle$getApplicatio9 = (_handle$getApplicatio10 = _handle.getApplicationData) === null || _handle$getApplicatio10 === void 0 ? void 0 : _handle$getApplicatio10.call(_handle)) !== null && _handle$getApplicatio9 !== void 0 ? _handle$getApplicatio9 : {};
|
|
56646
56840
|
serieNo = Number(app.serieNo);
|
|
56647
|
-
_context18.prev =
|
|
56841
|
+
_context18.prev = 660;
|
|
56648
56842
|
_params2 = JSON.parse(actionInput || '{}');
|
|
56649
|
-
_context18.next =
|
|
56843
|
+
_context18.next = 667;
|
|
56650
56844
|
break;
|
|
56651
|
-
case
|
|
56652
|
-
_context18.prev =
|
|
56653
|
-
_context18.
|
|
56845
|
+
case 664:
|
|
56846
|
+
_context18.prev = 664;
|
|
56847
|
+
_context18.t23 = _context18["catch"](660);
|
|
56654
56848
|
return _context18.abrupt("return", {
|
|
56655
56849
|
error: "input must be a JSON object — listGrids shows this action's exact shape."
|
|
56656
56850
|
});
|
|
56657
|
-
case
|
|
56851
|
+
case 667:
|
|
56658
56852
|
scope = String((_params2$scope = _params2.scope) !== null && _params2$scope !== void 0 ? _params2$scope : '');
|
|
56659
56853
|
if (scope in PRICE_FACTOR_FIELDS) {
|
|
56660
|
-
_context18.next =
|
|
56854
|
+
_context18.next = 670;
|
|
56661
56855
|
break;
|
|
56662
56856
|
}
|
|
56663
56857
|
return _context18.abrupt("return", {
|
|
56664
56858
|
error: "scope must be one of: ".concat(Object.keys(PRICE_FACTOR_FIELDS).join(', '), ".")
|
|
56665
56859
|
});
|
|
56666
|
-
case
|
|
56860
|
+
case 670:
|
|
56667
56861
|
key = _params2.key === undefined ? undefined : String(_params2.key); // The factor maps live on the PRICELIST record — the write goes through the parent pricelists grid row.
|
|
56668
56862
|
parent = resolveGrid('pricelists');
|
|
56669
56863
|
if (!(parent.error || !parent.entry || !parent.api)) {
|
|
56670
|
-
_context18.next =
|
|
56864
|
+
_context18.next = 674;
|
|
56671
56865
|
break;
|
|
56672
56866
|
}
|
|
56673
56867
|
return _context18.abrupt("return", {
|
|
56674
56868
|
error: "The parent 'pricelists' table must be on screen for factor actions."
|
|
56675
56869
|
});
|
|
56676
|
-
case
|
|
56870
|
+
case 674:
|
|
56677
56871
|
parentHandle = parent.entry.getHandle();
|
|
56678
56872
|
if (parentHandle) {
|
|
56679
|
-
_context18.next =
|
|
56873
|
+
_context18.next = 677;
|
|
56680
56874
|
break;
|
|
56681
56875
|
}
|
|
56682
56876
|
return _context18.abrupt("return", {
|
|
56683
56877
|
error: "Table 'pricelists' is not ready."
|
|
56684
56878
|
});
|
|
56685
|
-
case
|
|
56879
|
+
case 677:
|
|
56686
56880
|
parent.api.forEachNode(function (node) {
|
|
56687
56881
|
var _node$data4;
|
|
56688
56882
|
if (((_node$data4 = node.data) === null || _node$data4 === void 0 ? void 0 : _node$data4._id) === app.pricelistId) pricelistNode = node;
|
|
56689
56883
|
});
|
|
56690
56884
|
if ((_pricelistNode = pricelistNode) !== null && _pricelistNode !== void 0 && _pricelistNode.id) {
|
|
56691
|
-
_context18.next =
|
|
56885
|
+
_context18.next = 680;
|
|
56692
56886
|
break;
|
|
56693
56887
|
}
|
|
56694
56888
|
return _context18.abrupt("return", {
|
|
56695
56889
|
error: "Pricelist ".concat(app.pricelistId, " is not loaded in the 'pricelists' table.")
|
|
56696
56890
|
});
|
|
56697
|
-
case
|
|
56698
|
-
_context18.prev =
|
|
56891
|
+
case 680:
|
|
56892
|
+
_context18.prev = 680;
|
|
56699
56893
|
if (!(actionName === 'setPriceFactor')) {
|
|
56700
|
-
_context18.next =
|
|
56894
|
+
_context18.next = 689;
|
|
56701
56895
|
break;
|
|
56702
56896
|
}
|
|
56703
56897
|
factors = _params2.factors;
|
|
56704
56898
|
if (!(!Array.isArray(factors) || factors.some(function (f) {
|
|
56705
56899
|
return typeof f !== 'number' || !Number.isFinite(f) || f <= 0;
|
|
56706
56900
|
}))) {
|
|
56707
|
-
_context18.next =
|
|
56901
|
+
_context18.next = 685;
|
|
56708
56902
|
break;
|
|
56709
56903
|
}
|
|
56710
56904
|
return _context18.abrupt("return", {
|
|
56711
56905
|
error: 'factors must be an array of positive numbers (>1 = factor, <1 = discount fraction, e.g. 0.95 = 5% off); [] clears the entry.'
|
|
56712
56906
|
});
|
|
56713
|
-
case
|
|
56907
|
+
case 685:
|
|
56714
56908
|
patch = applyPriceFactor(pricelistNode.data, serieNo, scope, key, factors);
|
|
56715
56909
|
label = "setPriceFactor ".concat(scope).concat(key ? " ".concat(key) : '', " \u2192 [").concat(factors.join('; '), "] (Serie ").concat(serieNo, ")");
|
|
56716
|
-
_context18.next =
|
|
56910
|
+
_context18.next = 695;
|
|
56717
56911
|
break;
|
|
56718
|
-
case
|
|
56912
|
+
case 689:
|
|
56719
56913
|
if (!(typeof _params2.priority !== 'boolean')) {
|
|
56720
|
-
_context18.next =
|
|
56914
|
+
_context18.next = 691;
|
|
56721
56915
|
break;
|
|
56722
56916
|
}
|
|
56723
56917
|
return _context18.abrupt("return", {
|
|
56724
56918
|
error: 'priority must be true or false.'
|
|
56725
56919
|
});
|
|
56726
|
-
case
|
|
56920
|
+
case 691:
|
|
56727
56921
|
if (key) {
|
|
56728
|
-
_context18.next =
|
|
56922
|
+
_context18.next = 693;
|
|
56729
56923
|
break;
|
|
56730
56924
|
}
|
|
56731
56925
|
return _context18.abrupt("return", {
|
|
56732
56926
|
error: 'key is required (the pfg id / price group).'
|
|
56733
56927
|
});
|
|
56734
|
-
case
|
|
56928
|
+
case 693:
|
|
56735
56929
|
patch = applyPriceFactorPriority(pricelistNode.data, serieNo, scope, key, _params2.priority);
|
|
56736
56930
|
label = "setPriceFactorPriority ".concat(scope, " ").concat(key, " \u2192 ").concat(_params2.priority, " (Serie ").concat(serieNo, ")");
|
|
56737
|
-
case
|
|
56738
|
-
_context18.next =
|
|
56931
|
+
case 695:
|
|
56932
|
+
_context18.next = 700;
|
|
56739
56933
|
break;
|
|
56740
|
-
case
|
|
56741
|
-
_context18.prev =
|
|
56742
|
-
_context18.
|
|
56934
|
+
case 697:
|
|
56935
|
+
_context18.prev = 697;
|
|
56936
|
+
_context18.t24 = _context18["catch"](680);
|
|
56743
56937
|
return _context18.abrupt("return", {
|
|
56744
|
-
error: _context18.
|
|
56938
|
+
error: _context18.t24 instanceof Error ? _context18.t24.message : String(_context18.t24)
|
|
56745
56939
|
});
|
|
56746
|
-
case
|
|
56747
|
-
_context18.next =
|
|
56940
|
+
case 700:
|
|
56941
|
+
_context18.next = 702;
|
|
56748
56942
|
return approve(label);
|
|
56749
|
-
case
|
|
56943
|
+
case 702:
|
|
56750
56944
|
if (_context18.sent) {
|
|
56751
|
-
_context18.next =
|
|
56945
|
+
_context18.next = 704;
|
|
56752
56946
|
break;
|
|
56753
56947
|
}
|
|
56754
56948
|
return _context18.abrupt("return", declined);
|
|
56755
|
-
case
|
|
56949
|
+
case 704:
|
|
56756
56950
|
pricelistRowId = pricelistNode.id;
|
|
56757
|
-
_context18.next =
|
|
56951
|
+
_context18.next = 707;
|
|
56758
56952
|
return parentHandle.setNodeDataValue(pricelistRowId, patch, {
|
|
56759
56953
|
suppressAutoCommit: true
|
|
56760
56954
|
});
|
|
56761
|
-
case
|
|
56955
|
+
case 707:
|
|
56762
56956
|
if (_context18.sent) {
|
|
56763
|
-
_context18.next =
|
|
56957
|
+
_context18.next = 709;
|
|
56764
56958
|
break;
|
|
56765
56959
|
}
|
|
56766
56960
|
return _context18.abrupt("return", {
|
|
56767
56961
|
error: 'The pricelist row rejected the update.'
|
|
56768
56962
|
});
|
|
56769
|
-
case
|
|
56770
|
-
_context18.next =
|
|
56963
|
+
case 709:
|
|
56964
|
+
_context18.next = 711;
|
|
56771
56965
|
return parentHandle.commitStagedChanges();
|
|
56772
|
-
case
|
|
56966
|
+
case 711:
|
|
56773
56967
|
factorOutcome = _context18.sent;
|
|
56774
56968
|
rejected = factorOutcome === null || factorOutcome === void 0 ? void 0 : factorOutcome.failed.find(function (failure) {
|
|
56775
56969
|
return failure.rowId === pricelistRowId;
|
|
56776
56970
|
});
|
|
56777
56971
|
if (!rejected) {
|
|
56778
|
-
_context18.next =
|
|
56972
|
+
_context18.next = 715;
|
|
56779
56973
|
break;
|
|
56780
56974
|
}
|
|
56781
56975
|
return _context18.abrupt("return", {
|
|
56782
56976
|
error: "The server rejected the factor update: ".concat(rejected.errors.join(' ') || 'no reason given', ". Nothing was changed.")
|
|
56783
56977
|
});
|
|
56784
|
-
case
|
|
56978
|
+
case 715:
|
|
56785
56979
|
if (!(factorOutcome && !factorOutcome.committed.includes(pricelistRowId))) {
|
|
56786
|
-
_context18.next =
|
|
56980
|
+
_context18.next = 717;
|
|
56787
56981
|
break;
|
|
56788
56982
|
}
|
|
56789
56983
|
return _context18.abrupt("return", {
|
|
56790
56984
|
error: 'The factor update was NOT saved — the commit did not confirm the pricelist row. Re-read the pricelist (readGridRows) before retrying.'
|
|
56791
56985
|
});
|
|
56792
|
-
case
|
|
56986
|
+
case 717:
|
|
56793
56987
|
return _context18.abrupt("return", {
|
|
56794
56988
|
applied: true,
|
|
56795
56989
|
note: "Saved on the pricelist record and confirmed by the server (same path as the factor modal) \u2014 the prices table reflects it immediately.".concat(autoNote)
|
|
56796
56990
|
});
|
|
56797
|
-
case
|
|
56991
|
+
case 718:
|
|
56798
56992
|
if (!(actionName === 'deleteAllManualPrices')) {
|
|
56799
|
-
_context18.next =
|
|
56993
|
+
_context18.next = 736;
|
|
56800
56994
|
break;
|
|
56801
56995
|
}
|
|
56802
56996
|
_app = (_handle$getApplicatio11 = (_handle$getApplicatio12 = _handle.getApplicationData) === null || _handle$getApplicatio12 === void 0 ? void 0 : _handle$getApplicatio12.call(_handle)) !== null && _handle$getApplicatio11 !== void 0 ? _handle$getApplicatio11 : {};
|
|
56803
|
-
_context18.next =
|
|
56997
|
+
_context18.next = 722;
|
|
56804
56998
|
return approve("deleteAllManualPrices (Pricelist ".concat(_app.pricelistId, ", Serie ").concat(_app.serieNo, ")"));
|
|
56805
|
-
case
|
|
56999
|
+
case 722:
|
|
56806
57000
|
if (_context18.sent) {
|
|
56807
|
-
_context18.next =
|
|
57001
|
+
_context18.next = 724;
|
|
56808
57002
|
break;
|
|
56809
57003
|
}
|
|
56810
57004
|
return _context18.abrupt("return", declined);
|
|
56811
|
-
case
|
|
56812
|
-
_context18.prev =
|
|
56813
|
-
_context18.next =
|
|
57005
|
+
case 724:
|
|
57006
|
+
_context18.prev = 724;
|
|
57007
|
+
_context18.next = 727;
|
|
56814
57008
|
return authorizedFetch("".concat(root.configurationStore.apiConfig.enricherService, "/packages/").concat(_app.packageId, "/pricelists/").concat(_app.pricelistId, "/serie/").concat(_app.serieNo, "/prices/manual"), 'DELETE');
|
|
56815
|
-
case
|
|
56816
|
-
_context18.next =
|
|
57009
|
+
case 727:
|
|
57010
|
+
_context18.next = 732;
|
|
56817
57011
|
break;
|
|
56818
|
-
case
|
|
56819
|
-
_context18.prev =
|
|
56820
|
-
_context18.
|
|
57012
|
+
case 729:
|
|
57013
|
+
_context18.prev = 729;
|
|
57014
|
+
_context18.t25 = _context18["catch"](724);
|
|
56821
57015
|
return _context18.abrupt("return", {
|
|
56822
|
-
error: _context18.
|
|
57016
|
+
error: _context18.t25 instanceof Error ? _context18.t25.message : String(_context18.t25)
|
|
56823
57017
|
});
|
|
56824
|
-
case
|
|
56825
|
-
_context18.next =
|
|
57018
|
+
case 732:
|
|
57019
|
+
_context18.next = 734;
|
|
56826
57020
|
return refreshAndSettle();
|
|
56827
|
-
case
|
|
57021
|
+
case 734:
|
|
56828
57022
|
pricesSettled = _context18.sent;
|
|
56829
57023
|
return _context18.abrupt("return", {
|
|
56830
57024
|
applied: true,
|
|
56831
57025
|
note: "All manual price overrides of this pricelist+serie were deleted (irreversible) \u2014 the table refreshed; origPrices and factors now determine every cell.".concat(autoNote).concat(pricesSettled ? '' : unsettledNote)
|
|
56832
57026
|
});
|
|
56833
|
-
case
|
|
57027
|
+
case 736:
|
|
56834
57028
|
if (!(actionName === 'removeColumn')) {
|
|
56835
|
-
_context18.next =
|
|
57029
|
+
_context18.next = 775;
|
|
56836
57030
|
break;
|
|
56837
57031
|
}
|
|
56838
57032
|
if (actionInput) {
|
|
56839
|
-
_context18.next =
|
|
57033
|
+
_context18.next = 739;
|
|
56840
57034
|
break;
|
|
56841
57035
|
}
|
|
56842
57036
|
return _context18.abrupt("return", {
|
|
56843
57037
|
error: "Provide input: the column to remove — its field id ('optionsSetRefs.2305') or the bare key ('2305'); listGrids shows the columns."
|
|
56844
57038
|
});
|
|
56845
|
-
case
|
|
57039
|
+
case 739:
|
|
56846
57040
|
removeTargetIn = function removeTargetIn(defs) {
|
|
56847
57041
|
return defs.find(function (def) {
|
|
56848
57042
|
return def.field === actionInput || def.colId === actionInput || String(def.field).endsWith(".".concat(actionInput));
|
|
@@ -56850,7 +57044,7 @@ function createNavigationToolset(ctx) {
|
|
|
56850
57044
|
};
|
|
56851
57045
|
_target4 = removeTargetIn(removeTargets);
|
|
56852
57046
|
if (_target4) {
|
|
56853
|
-
_context18.next =
|
|
57047
|
+
_context18.next = 743;
|
|
56854
57048
|
break;
|
|
56855
57049
|
}
|
|
56856
57050
|
return _context18.abrupt("return", {
|
|
@@ -56858,75 +57052,75 @@ function createNavigationToolset(ctx) {
|
|
|
56858
57052
|
return "'".concat(def.field, "'");
|
|
56859
57053
|
}).join(', ') || 'none', ".")
|
|
56860
57054
|
});
|
|
56861
|
-
case
|
|
57055
|
+
case 743:
|
|
56862
57056
|
_header = typeof _target4.headerName === 'string' ? root.t(_target4.headerName) : String(_target4.field);
|
|
56863
|
-
_context18.next =
|
|
57057
|
+
_context18.next = 746;
|
|
56864
57058
|
return approve("removeColumn: ".concat(_header));
|
|
56865
|
-
case
|
|
57059
|
+
case 746:
|
|
56866
57060
|
if (_context18.sent) {
|
|
56867
|
-
_context18.next =
|
|
57061
|
+
_context18.next = 748;
|
|
56868
57062
|
break;
|
|
56869
57063
|
}
|
|
56870
57064
|
return _context18.abrupt("return", declined);
|
|
56871
|
-
case
|
|
57065
|
+
case 748:
|
|
56872
57066
|
// The defs are rebuilt on every render, each onRemove closing over the feature list of ITS render — the
|
|
56873
57067
|
// pre-wait closure would drop a feature the user added while the bar was open. Re-resolve after the wait.
|
|
56874
57068
|
live = removeTargetIn(_handle.getDivaColumnDefs().filter(isRemovableColumn));
|
|
56875
57069
|
if (live) {
|
|
56876
|
-
_context18.next =
|
|
57070
|
+
_context18.next = 751;
|
|
56877
57071
|
break;
|
|
56878
57072
|
}
|
|
56879
57073
|
return _context18.abrupt("return", {
|
|
56880
57074
|
applied: false,
|
|
56881
57075
|
note: "'".concat(_target4.field, "' left the table while the approval was pending \u2014 nothing was removed. listGrids shows the current columns.")
|
|
56882
57076
|
});
|
|
56883
|
-
case
|
|
56884
|
-
_context18.prev =
|
|
56885
|
-
_context18.next =
|
|
57077
|
+
case 751:
|
|
57078
|
+
_context18.prev = 751;
|
|
57079
|
+
_context18.next = 754;
|
|
56886
57080
|
return live.headerComponentParams.onRemove();
|
|
56887
|
-
case
|
|
57081
|
+
case 754:
|
|
56888
57082
|
saved = _context18.sent;
|
|
56889
|
-
_context18.next =
|
|
57083
|
+
_context18.next = 760;
|
|
56890
57084
|
break;
|
|
56891
|
-
case
|
|
56892
|
-
_context18.prev =
|
|
56893
|
-
_context18.
|
|
57085
|
+
case 757:
|
|
57086
|
+
_context18.prev = 757;
|
|
57087
|
+
_context18.t26 = _context18["catch"](751);
|
|
56894
57088
|
return _context18.abrupt("return", {
|
|
56895
|
-
error: _context18.
|
|
57089
|
+
error: _context18.t26 instanceof Error ? _context18.t26.message : String(_context18.t26)
|
|
56896
57090
|
});
|
|
56897
|
-
case
|
|
57091
|
+
case 760:
|
|
56898
57092
|
if (!(saved === false)) {
|
|
56899
|
-
_context18.next =
|
|
57093
|
+
_context18.next = 762;
|
|
56900
57094
|
break;
|
|
56901
57095
|
}
|
|
56902
57096
|
return _context18.abrupt("return", {
|
|
56903
57097
|
applied: false,
|
|
56904
57098
|
note: "The parent row did not take the new feature list \u2014 '".concat(_target4.field, "' was NOT removed. locateRow the parent row again so the view reloads, then retry.")
|
|
56905
57099
|
});
|
|
56906
|
-
case
|
|
57100
|
+
case 762:
|
|
56907
57101
|
// Poll until the column left the view — the parent entity's write and the rebuild are asynchronous.
|
|
56908
57102
|
gone = false;
|
|
56909
57103
|
attempt = 0;
|
|
56910
|
-
case
|
|
57104
|
+
case 764:
|
|
56911
57105
|
if (!(attempt < 20 && !gone)) {
|
|
56912
|
-
_context18.next =
|
|
57106
|
+
_context18.next = 771;
|
|
56913
57107
|
break;
|
|
56914
57108
|
}
|
|
56915
|
-
_context18.next =
|
|
57109
|
+
_context18.next = 767;
|
|
56916
57110
|
return sleep(100);
|
|
56917
|
-
case
|
|
57111
|
+
case 767:
|
|
56918
57112
|
gone = !_handle.getDivaColumnDefs().some(function (def) {
|
|
56919
57113
|
return def.field === _target4.field;
|
|
56920
57114
|
});
|
|
56921
|
-
case
|
|
57115
|
+
case 768:
|
|
56922
57116
|
attempt++;
|
|
56923
|
-
_context18.next =
|
|
57117
|
+
_context18.next = 764;
|
|
56924
57118
|
break;
|
|
56925
|
-
case
|
|
57119
|
+
case 771:
|
|
56926
57120
|
// The view declares what becomes of the rows' cells of a removed feature column.
|
|
56927
57121
|
rowsNote = _target4.headerComponentParams.removeKeepsCells ? ' The rows KEEP their cells for that feature (hidden now, still exported) — re-add the column to see or clear them.' : " The server also strips that feature's cells from every row of this table.";
|
|
56928
57122
|
if (gone) {
|
|
56929
|
-
_context18.next =
|
|
57123
|
+
_context18.next = 774;
|
|
56930
57124
|
break;
|
|
56931
57125
|
}
|
|
56932
57126
|
return _context18.abrupt("return", {
|
|
@@ -56938,7 +57132,7 @@ function createNavigationToolset(ctx) {
|
|
|
56938
57132
|
viewNotRebuilt: true,
|
|
56939
57133
|
note: "The parent row took the new feature list, but '".concat(_target4.field, "' is still in the view after the wait \u2014 the rebuild is pending. Re-read the columns (listGrids) before touching this table again; do NOT retry the removal.") + rowsNote + autoNote
|
|
56940
57134
|
});
|
|
56941
|
-
case
|
|
57135
|
+
case 774:
|
|
56942
57136
|
return _context18.abrupt("return", {
|
|
56943
57137
|
applied: true,
|
|
56944
57138
|
removed: {
|
|
@@ -56947,30 +57141,30 @@ function createNavigationToolset(ctx) {
|
|
|
56947
57141
|
},
|
|
56948
57142
|
note: 'Column removed.' + rowsNote + autoNote
|
|
56949
57143
|
});
|
|
56950
|
-
case
|
|
57144
|
+
case 775:
|
|
56951
57145
|
// addColumn: one approval, sequential adds — parallel adds race the view rebuild.
|
|
56952
57146
|
_target5 = _addTargets[0];
|
|
56953
57147
|
if (actionInput) {
|
|
56954
|
-
_context18.next =
|
|
57148
|
+
_context18.next = 778;
|
|
56955
57149
|
break;
|
|
56956
57150
|
}
|
|
56957
57151
|
return _context18.abrupt("return", {
|
|
56958
57152
|
error: "Provide input: the key(s) to add, comma-separated \u2014 readColumnOptions('".concat(_target5.field, "') lists the addable entries.")
|
|
56959
57153
|
});
|
|
56960
|
-
case
|
|
57154
|
+
case 778:
|
|
56961
57155
|
keys = actionInput.split(',').map(function (k) {
|
|
56962
57156
|
return k.trim();
|
|
56963
57157
|
}).filter(Boolean); // Resolve ALL keys BEFORE asking approval: the bar shows the real labels, invalid keys fail fast.
|
|
56964
57158
|
resolved = [];
|
|
56965
|
-
_context18.prev =
|
|
56966
|
-
|
|
56967
|
-
_context18.prev =
|
|
57159
|
+
_context18.prev = 780;
|
|
57160
|
+
_iterator26 = _createForOfIteratorHelper$r(keys);
|
|
57161
|
+
_context18.prev = 782;
|
|
56968
57162
|
_loop8 = /*#__PURE__*/_regeneratorRuntime.mark(function _loop8() {
|
|
56969
57163
|
var key, options, option;
|
|
56970
57164
|
return _regeneratorRuntime.wrap(function _loop8$(_context16) {
|
|
56971
57165
|
while (1) switch (_context16.prev = _context16.next) {
|
|
56972
57166
|
case 0:
|
|
56973
|
-
key =
|
|
57167
|
+
key = _step26.value;
|
|
56974
57168
|
_context16.next = 3;
|
|
56975
57169
|
return _handle.fetchLookupOptions(_target5.field, [key], {}, 0, 50);
|
|
56976
57170
|
case 3:
|
|
@@ -56998,58 +57192,58 @@ function createNavigationToolset(ctx) {
|
|
|
56998
57192
|
}
|
|
56999
57193
|
}, _loop8);
|
|
57000
57194
|
});
|
|
57001
|
-
|
|
57002
|
-
case
|
|
57003
|
-
if ((
|
|
57004
|
-
_context18.next =
|
|
57195
|
+
_iterator26.s();
|
|
57196
|
+
case 785:
|
|
57197
|
+
if ((_step26 = _iterator26.n()).done) {
|
|
57198
|
+
_context18.next = 792;
|
|
57005
57199
|
break;
|
|
57006
57200
|
}
|
|
57007
|
-
return _context18.delegateYield(_loop8(), "
|
|
57008
|
-
case
|
|
57009
|
-
_ret6 = _context18.
|
|
57201
|
+
return _context18.delegateYield(_loop8(), "t27", 787);
|
|
57202
|
+
case 787:
|
|
57203
|
+
_ret6 = _context18.t27;
|
|
57010
57204
|
if (!_ret6) {
|
|
57011
|
-
_context18.next =
|
|
57205
|
+
_context18.next = 790;
|
|
57012
57206
|
break;
|
|
57013
57207
|
}
|
|
57014
57208
|
return _context18.abrupt("return", _ret6.v);
|
|
57015
|
-
case
|
|
57016
|
-
_context18.next =
|
|
57209
|
+
case 790:
|
|
57210
|
+
_context18.next = 785;
|
|
57017
57211
|
break;
|
|
57018
|
-
case
|
|
57019
|
-
_context18.next =
|
|
57212
|
+
case 792:
|
|
57213
|
+
_context18.next = 797;
|
|
57020
57214
|
break;
|
|
57021
|
-
case
|
|
57022
|
-
_context18.prev =
|
|
57023
|
-
_context18.
|
|
57024
|
-
|
|
57025
|
-
case
|
|
57026
|
-
_context18.prev =
|
|
57027
|
-
|
|
57028
|
-
return _context18.finish(
|
|
57029
|
-
case
|
|
57030
|
-
_context18.next =
|
|
57215
|
+
case 794:
|
|
57216
|
+
_context18.prev = 794;
|
|
57217
|
+
_context18.t28 = _context18["catch"](782);
|
|
57218
|
+
_iterator26.e(_context18.t28);
|
|
57219
|
+
case 797:
|
|
57220
|
+
_context18.prev = 797;
|
|
57221
|
+
_iterator26.f();
|
|
57222
|
+
return _context18.finish(797);
|
|
57223
|
+
case 800:
|
|
57224
|
+
_context18.next = 805;
|
|
57031
57225
|
break;
|
|
57032
|
-
case
|
|
57033
|
-
_context18.prev =
|
|
57034
|
-
_context18.
|
|
57226
|
+
case 802:
|
|
57227
|
+
_context18.prev = 802;
|
|
57228
|
+
_context18.t29 = _context18["catch"](780);
|
|
57035
57229
|
return _context18.abrupt("return", {
|
|
57036
|
-
error: _context18.
|
|
57230
|
+
error: _context18.t29 instanceof Error ? _context18.t29.message : String(_context18.t29)
|
|
57037
57231
|
});
|
|
57038
|
-
case
|
|
57039
|
-
_context18.next =
|
|
57232
|
+
case 805:
|
|
57233
|
+
_context18.next = 807;
|
|
57040
57234
|
return approve("addColumn: ".concat(resolved.map(function (r) {
|
|
57041
57235
|
return r.label;
|
|
57042
57236
|
}).join(', ')));
|
|
57043
|
-
case
|
|
57237
|
+
case 807:
|
|
57044
57238
|
if (_context18.sent) {
|
|
57045
|
-
_context18.next =
|
|
57239
|
+
_context18.next = 809;
|
|
57046
57240
|
break;
|
|
57047
57241
|
}
|
|
57048
57242
|
return _context18.abrupt("return", declined);
|
|
57049
|
-
case
|
|
57243
|
+
case 809:
|
|
57050
57244
|
added = [];
|
|
57051
57245
|
newColumns = [];
|
|
57052
|
-
_context18.prev =
|
|
57246
|
+
_context18.prev = 811;
|
|
57053
57247
|
_loop9 = /*#__PURE__*/_regeneratorRuntime.mark(function _loop9() {
|
|
57054
57248
|
var key, beforeFields, _attempt, newColumn;
|
|
57055
57249
|
return _regeneratorRuntime.wrap(function _loop9$(_context17) {
|
|
@@ -57096,17 +57290,17 @@ function createNavigationToolset(ctx) {
|
|
|
57096
57290
|
}, _loop9);
|
|
57097
57291
|
});
|
|
57098
57292
|
_i15 = 0, _resolved = resolved;
|
|
57099
|
-
case
|
|
57293
|
+
case 814:
|
|
57100
57294
|
if (!(_i15 < _resolved.length)) {
|
|
57101
|
-
_context18.next =
|
|
57295
|
+
_context18.next = 819;
|
|
57102
57296
|
break;
|
|
57103
57297
|
}
|
|
57104
|
-
return _context18.delegateYield(_loop9(), "
|
|
57105
|
-
case
|
|
57298
|
+
return _context18.delegateYield(_loop9(), "t30", 816);
|
|
57299
|
+
case 816:
|
|
57106
57300
|
_i15++;
|
|
57107
|
-
_context18.next =
|
|
57301
|
+
_context18.next = 814;
|
|
57108
57302
|
break;
|
|
57109
|
-
case
|
|
57303
|
+
case 819:
|
|
57110
57304
|
// On a decision's option-combinations subtable the add also writes the decision's featureRefs.
|
|
57111
57305
|
decisionSubtableNote = /optioncombination/i.test(_entry3.label) ? " NOTE: on a decision's option-combinations subtable this ALSO wrote the feature(s) into the decision's featureRefs — existing rows carry NO condition for it, which in a type-0/1 re-opens that feature entirely. Re-read the decision row; fill the rows or revert featureRefs if you only wanted to look." : '';
|
|
57112
57306
|
partialNote = newColumns.length < resolved.length ? " ".concat(resolved.length - newColumns.length, " added column(s) did not surface a field id within the poll \u2014 listGrids shows the final columns.") : '';
|
|
@@ -57122,31 +57316,31 @@ function createNavigationToolset(ctx) {
|
|
|
57122
57316
|
return "'".concat(c, "'");
|
|
57123
57317
|
}).join(', '), ".") : 'Column(s) added — the table re-renders; listGrids shows the new columns and their field ids.') + partialNote + decisionSubtableNote + autoNote
|
|
57124
57318
|
}));
|
|
57125
|
-
case
|
|
57126
|
-
_context18.prev =
|
|
57127
|
-
_context18.
|
|
57319
|
+
case 824:
|
|
57320
|
+
_context18.prev = 824;
|
|
57321
|
+
_context18.t31 = _context18["catch"](811);
|
|
57128
57322
|
return _context18.abrupt("return", {
|
|
57129
|
-
error: "".concat(_context18.
|
|
57323
|
+
error: "".concat(_context18.t31 instanceof Error ? _context18.t31.message : String(_context18.t31)).concat(newColumns.length ? " \u2014 ".concat(newColumns.length, " column(s) were already added before the failure: ").concat(newColumns.join(', ')) : '')
|
|
57130
57324
|
});
|
|
57131
|
-
case
|
|
57325
|
+
case 827:
|
|
57132
57326
|
_resolveGrid5 = resolveGrid(args.grid), _entry4 = _resolveGrid5.entry, _api3 = _resolveGrid5.api, _error4 = _resolveGrid5.error;
|
|
57133
57327
|
if (!(_error4 || !_api3 || !_entry4)) {
|
|
57134
|
-
_context18.next =
|
|
57328
|
+
_context18.next = 830;
|
|
57135
57329
|
break;
|
|
57136
57330
|
}
|
|
57137
57331
|
return _context18.abrupt("return", {
|
|
57138
57332
|
error: _error4
|
|
57139
57333
|
});
|
|
57140
|
-
case
|
|
57334
|
+
case 830:
|
|
57141
57335
|
_handle2 = _entry4.getHandle();
|
|
57142
57336
|
if (_handle2) {
|
|
57143
|
-
_context18.next =
|
|
57337
|
+
_context18.next = 833;
|
|
57144
57338
|
break;
|
|
57145
57339
|
}
|
|
57146
57340
|
return _context18.abrupt("return", {
|
|
57147
57341
|
error: "Table '".concat(_entry4.label, "' is not ready.")
|
|
57148
57342
|
});
|
|
57149
|
-
case
|
|
57343
|
+
case 833:
|
|
57150
57344
|
_column7 = String((_column8 = input === null || input === void 0 ? void 0 : input.column) !== null && _column8 !== void 0 ? _column8 : '');
|
|
57151
57345
|
search = String((_search = input === null || input === void 0 ? void 0 : input.search) !== null && _search !== void 0 ? _search : '');
|
|
57152
57346
|
_limit = Math.min(Number(input === null || input === void 0 ? void 0 : input.limit) > 0 ? Number(input.limit) : 50, 200); // `exact` is one contract for every source below: action values and enum values as well as lookups.
|
|
@@ -57161,11 +57355,11 @@ function createNavigationToolset(ctx) {
|
|
|
57161
57355
|
return action.name === _column7;
|
|
57162
57356
|
});
|
|
57163
57357
|
if (!optionAction) {
|
|
57164
|
-
_context18.next =
|
|
57358
|
+
_context18.next = 855;
|
|
57165
57359
|
break;
|
|
57166
57360
|
}
|
|
57167
57361
|
if (optionAction.options) {
|
|
57168
|
-
_context18.next =
|
|
57362
|
+
_context18.next = 843;
|
|
57169
57363
|
break;
|
|
57170
57364
|
}
|
|
57171
57365
|
return _context18.abrupt("return", {
|
|
@@ -57174,11 +57368,11 @@ function createNavigationToolset(ctx) {
|
|
|
57174
57368
|
hasMore: false,
|
|
57175
57369
|
note: "'".concat(_column7, "' is a table ACTION with no value list \u2014 its input is described in listGrids: ").concat(optionAction.description)
|
|
57176
57370
|
});
|
|
57177
|
-
case
|
|
57178
|
-
_context18.prev =
|
|
57179
|
-
_context18.next =
|
|
57371
|
+
case 843:
|
|
57372
|
+
_context18.prev = 843;
|
|
57373
|
+
_context18.next = 846;
|
|
57180
57374
|
return optionAction.options(search, _limit);
|
|
57181
|
-
case
|
|
57375
|
+
case 846:
|
|
57182
57376
|
_yield$optionAction$o = _context18.sent;
|
|
57183
57377
|
options = _yield$optionAction$o.options;
|
|
57184
57378
|
note = _yield$optionAction$o.note;
|
|
@@ -57191,20 +57385,20 @@ function createNavigationToolset(ctx) {
|
|
|
57191
57385
|
} : {}), {}, {
|
|
57192
57386
|
note: "Values for runTableAction('".concat(_column7, "', <input>) \u2014 pass the VALUE(s), not the label.").concat(note ? " ".concat(note) : '').concat(wantsExact ? ' exact:true — only options whose value or label equals the search.' : '')
|
|
57193
57387
|
}));
|
|
57194
|
-
case
|
|
57195
|
-
_context18.prev =
|
|
57196
|
-
_context18.
|
|
57388
|
+
case 852:
|
|
57389
|
+
_context18.prev = 852;
|
|
57390
|
+
_context18.t32 = _context18["catch"](843);
|
|
57197
57391
|
return _context18.abrupt("return", {
|
|
57198
|
-
error: _context18.
|
|
57392
|
+
error: _context18.t32 instanceof Error ? _context18.t32.message : String(_context18.t32)
|
|
57199
57393
|
});
|
|
57200
|
-
case
|
|
57394
|
+
case 855:
|
|
57201
57395
|
// Enum columns are answered here too: 'which values does this column take' is ONE question.
|
|
57202
57396
|
enumDef = _handle2.getDivaColumnDefs().find(function (d) {
|
|
57203
57397
|
return d.field === _column7;
|
|
57204
57398
|
});
|
|
57205
57399
|
enumData = enumDef === null || enumDef === void 0 || (_enumDef$customParams = enumDef.customParams) === null || _enumDef$customParams === void 0 ? void 0 : _enumDef$customParams.enumData;
|
|
57206
57400
|
if (!(Array.isArray(enumData) && enumData.length)) {
|
|
57207
|
-
_context18.next =
|
|
57401
|
+
_context18.next = 859;
|
|
57208
57402
|
break;
|
|
57209
57403
|
}
|
|
57210
57404
|
return _context18.abrupt("return", _objectSpread$X(_objectSpread$X({
|
|
@@ -57224,14 +57418,14 @@ function createNavigationToolset(ctx) {
|
|
|
57224
57418
|
} : {}), {}, {
|
|
57225
57419
|
note: "Enum column \u2014 this is the COMPLETE allowed set (also in listGrids). Stage the VALUE, not the label".concat(enumDef !== null && enumDef !== void 0 && (_enumDef$customParams2 = enumDef.customParams) !== null && _enumDef$customParams2 !== void 0 && _enumDef$customParams2.multiple ? ', comma-separated for multiple' : '', ".").concat(wantsExact ? ' exact:true — only options whose value or label equals the search.' : '')
|
|
57226
57420
|
}));
|
|
57227
|
-
case
|
|
57421
|
+
case 859:
|
|
57228
57422
|
if (enumDef) {
|
|
57229
|
-
_context18.next =
|
|
57423
|
+
_context18.next = 866;
|
|
57230
57424
|
break;
|
|
57231
57425
|
}
|
|
57232
57426
|
computedDef = divaDefOf(_handle2.getDivaColumnDefs(), _column7);
|
|
57233
57427
|
if (!isComputedColumn(computedDef)) {
|
|
57234
|
-
_context18.next =
|
|
57428
|
+
_context18.next = 864;
|
|
57235
57429
|
break;
|
|
57236
57430
|
}
|
|
57237
57431
|
// Same source as listGrids, so the two cannot disagree about whether a new row may carry this column.
|
|
@@ -57242,16 +57436,16 @@ function createNavigationToolset(ctx) {
|
|
|
57242
57436
|
hasMore: false,
|
|
57243
57437
|
note: savedRowsOnly ? "'".concat(_column7, "' is a computed matrix cell \u2014 it has no option list, and addRows cannot set it. Create the row, then set it with stageTableEdits 'edits'.") : "'".concat(_column7, "' is a computed matrix cell \u2014 it has no option list; stage its value directly with stageTableEdits.")
|
|
57244
57438
|
});
|
|
57245
|
-
case
|
|
57439
|
+
case 864:
|
|
57246
57440
|
fields = _handle2.getDivaColumnDefs().map(function (d) {
|
|
57247
57441
|
return d.field;
|
|
57248
57442
|
}).filter(Boolean);
|
|
57249
57443
|
return _context18.abrupt("return", {
|
|
57250
57444
|
error: "Column '".concat(_column7, "' not found. Fields of '").concat(_entry4.label, "': ").concat(fields.join(', '), ".")
|
|
57251
57445
|
});
|
|
57252
|
-
case
|
|
57446
|
+
case 866:
|
|
57253
57447
|
if (!(enumDef.cellDataType === 'asset')) {
|
|
57254
|
-
_context18.next =
|
|
57448
|
+
_context18.next = 868;
|
|
57255
57449
|
break;
|
|
57256
57450
|
}
|
|
57257
57451
|
return _context18.abrupt("return", {
|
|
@@ -57260,9 +57454,9 @@ function createNavigationToolset(ctx) {
|
|
|
57260
57454
|
hasMore: false,
|
|
57261
57455
|
note: "'".concat(_column7, "' is an ASSET cell \u2014 no option list; write it via uploadAsset + setAssetCell.")
|
|
57262
57456
|
});
|
|
57263
|
-
case
|
|
57457
|
+
case 868:
|
|
57264
57458
|
if (!(enumDef.cellDataType !== 'lookup' && !isHeaderAddColumn(enumDef))) {
|
|
57265
|
-
_context18.next =
|
|
57459
|
+
_context18.next = 870;
|
|
57266
57460
|
break;
|
|
57267
57461
|
}
|
|
57268
57462
|
return _context18.abrupt("return", {
|
|
@@ -57271,7 +57465,7 @@ function createNavigationToolset(ctx) {
|
|
|
57271
57465
|
hasMore: false,
|
|
57272
57466
|
note: "'".concat(_column7, "' is a free-form ").concat((_enumDef$cellDataType = enumDef.cellDataType) !== null && _enumDef$cellDataType !== void 0 ? _enumDef$cellDataType : 'text', " column \u2014 it has no option list; stage a ").concat(enumDef.cellDataType === 'number' ? 'number' : 'value', " directly with stageTableEdits.")
|
|
57273
57467
|
});
|
|
57274
|
-
case
|
|
57468
|
+
case 870:
|
|
57275
57469
|
// Row-dependent url/filter templates resolve against a loaded row.
|
|
57276
57470
|
firstRow = _api3.getDisplayedRowAtIndex(0);
|
|
57277
57471
|
rowData = isRealRow(firstRow) ? (_data = firstRow.data) !== null && _data !== void 0 ? _data : {} : {}; // The server's contains-filter reads the search as a pattern: a bracket or a pipe in it returns nothing at all
|
|
@@ -57284,10 +57478,10 @@ function createNavigationToolset(ctx) {
|
|
|
57284
57478
|
})[0]) !== null && _plainWords$sort$ !== void 0 ? _plainWords$sort$ : '' : search;
|
|
57285
57479
|
matchLocally = remoteSearch !== search || wantsExact; // The local match only sees ONE capped fetch — a plain word with more hits than that can still hide the value.
|
|
57286
57480
|
fetchLimit = matchLocally ? Math.max(_limit, 200) : _limit;
|
|
57287
|
-
_context18.prev =
|
|
57288
|
-
_context18.next =
|
|
57481
|
+
_context18.prev = 877;
|
|
57482
|
+
_context18.next = 880;
|
|
57289
57483
|
return _handle2.fetchLookupOptions(_column7, remoteSearch, rowData, 0, fetchLimit);
|
|
57290
|
-
case
|
|
57484
|
+
case 880:
|
|
57291
57485
|
fetched = _context18.sent;
|
|
57292
57486
|
text = function text(o) {
|
|
57293
57487
|
var _o$label2;
|
|
@@ -57315,9 +57509,9 @@ function createNavigationToolset(ctx) {
|
|
|
57315
57509
|
} : {}), {}, {
|
|
57316
57510
|
note: (isHeaderAddColumn(enumDef) ? "These entries are ADDABLE via runTableAction 'addColumn' (each becomes a table column) — they are not cell values to stage." : 'Stage this column with the VALUE(s) — comma-separated when the column is multi-select (see columnMeta.multiSelect).') + (remoteSearch !== search ? " The search contains characters the server filter reads as a pattern \u2014 the server was asked for '".concat(remoteSearch, "' and the full text '").concat(search, "' was matched here.") : '') + (wantsExact ? ' exact:true — only options whose value or label equals the search.' : '') + (fetchCapped ? " The ".concat(wantsExact ? 'exact' : 'full-text', " check ran on the first ").concat(fetchLimit, " rows").concat(remoteSearch ? " matching '".concat(remoteSearch, "'") : '', " only \u2014 narrow the search if the value is not among them.") : '')
|
|
57317
57511
|
}));
|
|
57318
|
-
case
|
|
57319
|
-
_context18.prev =
|
|
57320
|
-
_context18.
|
|
57512
|
+
case 887:
|
|
57513
|
+
_context18.prev = 887;
|
|
57514
|
+
_context18.t33 = _context18["catch"](877);
|
|
57321
57515
|
// On an empty table a row-dependent lookup request goes out broken — teach the recovery instead of the opaque error.
|
|
57322
57516
|
defs = _handle2.getDivaColumnDefs();
|
|
57323
57517
|
url = String((_defs$find$customPara = (_defs$find = defs.find(function (d) {
|
|
@@ -57335,96 +57529,96 @@ function createNavigationToolset(ctx) {
|
|
|
57335
57529
|
});
|
|
57336
57530
|
hint = deps.length ? " This lookup's option list depends on row value(s) ".concat(deps.join(', '), " \u2014 with no loaded row it cannot be listed here: stage the add directly with the depending column in the SAME row (lookups resolve row-aware there).") : '';
|
|
57337
57531
|
return _context18.abrupt("return", {
|
|
57338
|
-
error: (_context18.
|
|
57532
|
+
error: (_context18.t33 instanceof Error ? _context18.t33.message : String(_context18.t33)) + hint
|
|
57339
57533
|
});
|
|
57340
|
-
case
|
|
57534
|
+
case 896:
|
|
57341
57535
|
_resolveGrid6 = resolveGrid(args.grid), _api4 = _resolveGrid6.api, _error5 = _resolveGrid6.error;
|
|
57342
57536
|
if (!(_error5 || !_api4)) {
|
|
57343
|
-
_context18.next =
|
|
57537
|
+
_context18.next = 899;
|
|
57344
57538
|
break;
|
|
57345
57539
|
}
|
|
57346
57540
|
return _context18.abrupt("return", {
|
|
57347
57541
|
error: _error5
|
|
57348
57542
|
});
|
|
57349
|
-
case
|
|
57543
|
+
case 899:
|
|
57350
57544
|
_api4.setFilterModel(null);
|
|
57351
57545
|
return _context18.abrupt("return", {
|
|
57352
57546
|
ok: true
|
|
57353
57547
|
});
|
|
57354
|
-
case
|
|
57548
|
+
case 901:
|
|
57355
57549
|
_resolveGrid7 = resolveGrid(args.grid), _entry5 = _resolveGrid7.entry, _error6 = _resolveGrid7.error;
|
|
57356
57550
|
if (!(_error6 || !_entry5)) {
|
|
57357
|
-
_context18.next =
|
|
57551
|
+
_context18.next = 904;
|
|
57358
57552
|
break;
|
|
57359
57553
|
}
|
|
57360
57554
|
return _context18.abrupt("return", {
|
|
57361
57555
|
error: _error6
|
|
57362
57556
|
});
|
|
57363
|
-
case
|
|
57557
|
+
case 904:
|
|
57364
57558
|
_handle3 = _entry5.getHandle();
|
|
57365
57559
|
if (_handle3) {
|
|
57366
|
-
_context18.next =
|
|
57560
|
+
_context18.next = 907;
|
|
57367
57561
|
break;
|
|
57368
57562
|
}
|
|
57369
57563
|
return _context18.abrupt("return", {
|
|
57370
57564
|
error: "Table '".concat(_entry5.label, "' is not ready.")
|
|
57371
57565
|
});
|
|
57372
|
-
case
|
|
57566
|
+
case 907:
|
|
57373
57567
|
if (_handle3.hasPendingChanges()) {
|
|
57374
|
-
_context18.next =
|
|
57568
|
+
_context18.next = 909;
|
|
57375
57569
|
break;
|
|
57376
57570
|
}
|
|
57377
57571
|
return _context18.abrupt("return", {
|
|
57378
57572
|
discarded: false,
|
|
57379
57573
|
note: "Nothing is staged on '".concat(_entry5.label, "' \u2014 no staging blocks writes to it.")
|
|
57380
57574
|
});
|
|
57381
|
-
case
|
|
57575
|
+
case 909:
|
|
57382
57576
|
if (ctx.autoApprove) {
|
|
57383
|
-
_context18.next =
|
|
57577
|
+
_context18.next = 916;
|
|
57384
57578
|
break;
|
|
57385
57579
|
}
|
|
57386
57580
|
awaitingApproval();
|
|
57387
57581
|
// The bar's own buttons read Apply/Discard — the label says what Apply does, or Discard reads as the action.
|
|
57388
57582
|
_label = "discardStagedChanges: every staged change on '".concat(_entry5.label, "' is dropped, the table returns to its last committed state");
|
|
57389
|
-
_context18.next =
|
|
57583
|
+
_context18.next = 914;
|
|
57390
57584
|
return _entry5.requestAgentApproval(1, _label, signal);
|
|
57391
|
-
case
|
|
57585
|
+
case 914:
|
|
57392
57586
|
if (_context18.sent) {
|
|
57393
|
-
_context18.next =
|
|
57587
|
+
_context18.next = 916;
|
|
57394
57588
|
break;
|
|
57395
57589
|
}
|
|
57396
57590
|
return _context18.abrupt("return", {
|
|
57397
57591
|
discarded: false,
|
|
57398
57592
|
note: 'The user KEPT the staged changes — nothing was discarded. Ask what to do with them instead.'
|
|
57399
57593
|
});
|
|
57400
|
-
case
|
|
57594
|
+
case 916:
|
|
57401
57595
|
if (_handle3.hasPendingChanges()) {
|
|
57402
|
-
_context18.next =
|
|
57596
|
+
_context18.next = 918;
|
|
57403
57597
|
break;
|
|
57404
57598
|
}
|
|
57405
57599
|
return _context18.abrupt("return", {
|
|
57406
57600
|
discarded: false,
|
|
57407
57601
|
note: "The table SAVED the staged changes on '".concat(_entry5.label, "' before the decision arrived (it saves pending edits by itself when the user clicks outside the grid) \u2014 nothing was discarded, those changes are live on the server. Read the rows back (readGridRows) and ask the user whether to undo them.")
|
|
57408
57602
|
});
|
|
57409
|
-
case
|
|
57410
|
-
_context18.next =
|
|
57603
|
+
case 918:
|
|
57604
|
+
_context18.next = 920;
|
|
57411
57605
|
return _handle3.rollback();
|
|
57412
|
-
case
|
|
57606
|
+
case 920:
|
|
57413
57607
|
// Same transparency rule as runTableAction: a discard executed without the bar must be reported as such.
|
|
57414
57608
|
_autoNote = ctx.autoApprove ? ' AUTO-APPROVE is on — executed WITHOUT the approval bar, so the user could not keep their own pending edits; mention that ONCE per reply, not per call.' : '';
|
|
57415
57609
|
return _context18.abrupt("return", {
|
|
57416
57610
|
discarded: true,
|
|
57417
57611
|
note: "The staged changes on '".concat(_entry5.label, "' were discarded \u2014 the table is back at its last committed state, nothing was sent to the server, and writes to it are possible again.").concat(_autoNote)
|
|
57418
57612
|
});
|
|
57419
|
-
case
|
|
57613
|
+
case 922:
|
|
57420
57614
|
throw new Error("Unknown navigation tool: ".concat(name));
|
|
57421
|
-
case
|
|
57615
|
+
case 923:
|
|
57422
57616
|
case "end":
|
|
57423
57617
|
return _context18.stop();
|
|
57424
57618
|
}
|
|
57425
|
-
}, _callee11, null, [[
|
|
57619
|
+
}, _callee11, null, [[38, 44], [58, 64], [284, 296, 299, 302], [308, 326, 329, 332], [333, 357, 360, 363], [391, 403, 406, 409], [481,, 538, 541], [483, 494, 497, 500], [501, 513, 516, 519], [520, 532, 535, 538], [606, 615], [625, 630], [645, 650], [660, 664], [680, 697], [724, 729], [751, 757], [780, 802], [782, 794, 797, 800], [811, 824], [843, 852], [877, 887]]);
|
|
57426
57620
|
}));
|
|
57427
|
-
function dispatch(
|
|
57621
|
+
function dispatch(_x12, _x13, _x14, _x15) {
|
|
57428
57622
|
return _dispatch.apply(this, arguments);
|
|
57429
57623
|
}
|
|
57430
57624
|
return dispatch;
|
|
@@ -57446,7 +57640,7 @@ function findGridEntry(root, gridRef) {
|
|
|
57446
57640
|
}
|
|
57447
57641
|
|
|
57448
57642
|
/** Waits for a registered on-screen grid (by label, or the first one) to be mounted and ready. */
|
|
57449
|
-
function waitForGrid(
|
|
57643
|
+
function waitForGrid(_x35, _x36, _x37) {
|
|
57450
57644
|
return _waitForGrid.apply(this, arguments);
|
|
57451
57645
|
}
|
|
57452
57646
|
/**
|
|
@@ -57456,41 +57650,41 @@ function waitForGrid(_x31, _x32, _x33) {
|
|
|
57456
57650
|
* refusal on timeout; a grid without a declaration passes at once.
|
|
57457
57651
|
*/
|
|
57458
57652
|
function _waitForGrid() {
|
|
57459
|
-
_waitForGrid = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function
|
|
57653
|
+
_waitForGrid = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee16(root, gridLabel, timeoutMs) {
|
|
57460
57654
|
var deadline, _entry$getHandle5, entry, api;
|
|
57461
|
-
return _regeneratorRuntime.wrap(function
|
|
57462
|
-
while (1) switch (
|
|
57655
|
+
return _regeneratorRuntime.wrap(function _callee16$(_context24) {
|
|
57656
|
+
while (1) switch (_context24.prev = _context24.next) {
|
|
57463
57657
|
case 0:
|
|
57464
57658
|
deadline = Date.now() + timeoutMs;
|
|
57465
57659
|
case 1:
|
|
57466
57660
|
if (!(Date.now() < deadline)) {
|
|
57467
|
-
|
|
57661
|
+
_context24.next = 10;
|
|
57468
57662
|
break;
|
|
57469
57663
|
}
|
|
57470
57664
|
entry = gridLabel ? findGridEntry(root, gridLabel) : root.gridRegistry.entries[0];
|
|
57471
57665
|
api = entry === null || entry === void 0 || (_entry$getHandle5 = entry.getHandle()) === null || _entry$getHandle5 === void 0 ? void 0 : _entry$getHandle5.getGridApi();
|
|
57472
57666
|
if (!api) {
|
|
57473
|
-
|
|
57667
|
+
_context24.next = 6;
|
|
57474
57668
|
break;
|
|
57475
57669
|
}
|
|
57476
|
-
return
|
|
57670
|
+
return _context24.abrupt("return", api);
|
|
57477
57671
|
case 6:
|
|
57478
|
-
|
|
57672
|
+
_context24.next = 8;
|
|
57479
57673
|
return sleep(250);
|
|
57480
57674
|
case 8:
|
|
57481
|
-
|
|
57675
|
+
_context24.next = 1;
|
|
57482
57676
|
break;
|
|
57483
57677
|
case 10:
|
|
57484
|
-
return
|
|
57678
|
+
return _context24.abrupt("return", undefined);
|
|
57485
57679
|
case 11:
|
|
57486
57680
|
case "end":
|
|
57487
|
-
return
|
|
57681
|
+
return _context24.stop();
|
|
57488
57682
|
}
|
|
57489
|
-
},
|
|
57683
|
+
}, _callee16);
|
|
57490
57684
|
}));
|
|
57491
57685
|
return _waitForGrid.apply(this, arguments);
|
|
57492
57686
|
}
|
|
57493
|
-
function waitForDeclaredParent(
|
|
57687
|
+
function waitForDeclaredParent(_x38, _x39, _x40, _x41, _x42) {
|
|
57494
57688
|
return _waitForDeclaredParent.apply(this, arguments);
|
|
57495
57689
|
}
|
|
57496
57690
|
/**
|
|
@@ -57500,53 +57694,53 @@ function waitForDeclaredParent(_x34, _x35, _x36, _x37, _x38) {
|
|
|
57500
57694
|
* is already on screen.
|
|
57501
57695
|
*/
|
|
57502
57696
|
function _waitForDeclaredParent() {
|
|
57503
|
-
_waitForDeclaredParent = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function
|
|
57504
|
-
var deadline, label, mismatch, _entry$getBoundParent, entry, declared,
|
|
57505
|
-
return _regeneratorRuntime.wrap(function
|
|
57506
|
-
while (1) switch (
|
|
57697
|
+
_waitForDeclaredParent = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee17(root, gridRef, parentApi, parentNode, timeoutMs) {
|
|
57698
|
+
var deadline, label, mismatch, _entry$getBoundParent, entry, declared, _cellValueOf3, _declared$value, expected;
|
|
57699
|
+
return _regeneratorRuntime.wrap(function _callee17$(_context25) {
|
|
57700
|
+
while (1) switch (_context25.prev = _context25.next) {
|
|
57507
57701
|
case 0:
|
|
57508
57702
|
deadline = Date.now() + timeoutMs;
|
|
57509
57703
|
label = gridRef;
|
|
57510
57704
|
mismatch = 'no bound parent row';
|
|
57511
57705
|
case 3:
|
|
57512
57706
|
if (!(Date.now() < deadline)) {
|
|
57513
|
-
|
|
57707
|
+
_context25.next = 18;
|
|
57514
57708
|
break;
|
|
57515
57709
|
}
|
|
57516
57710
|
entry = findGridEntry(root, gridRef);
|
|
57517
57711
|
if (!(entry && !entry.getBoundParent)) {
|
|
57518
|
-
|
|
57712
|
+
_context25.next = 7;
|
|
57519
57713
|
break;
|
|
57520
57714
|
}
|
|
57521
|
-
return
|
|
57715
|
+
return _context25.abrupt("return", undefined);
|
|
57522
57716
|
case 7:
|
|
57523
57717
|
declared = entry === null || entry === void 0 || (_entry$getBoundParent = entry.getBoundParent) === null || _entry$getBoundParent === void 0 ? void 0 : _entry$getBoundParent.call(entry);
|
|
57524
57718
|
if (!(entry && declared)) {
|
|
57525
|
-
|
|
57719
|
+
_context25.next = 14;
|
|
57526
57720
|
break;
|
|
57527
57721
|
}
|
|
57528
|
-
expected = String((
|
|
57722
|
+
expected = String((_cellValueOf3 = cellValueOf(parentApi, parentNode, declared.column)) !== null && _cellValueOf3 !== void 0 ? _cellValueOf3 : '');
|
|
57529
57723
|
if (!(expected && declared.value === expected)) {
|
|
57530
|
-
|
|
57724
|
+
_context25.next = 12;
|
|
57531
57725
|
break;
|
|
57532
57726
|
}
|
|
57533
|
-
return
|
|
57727
|
+
return _context25.abrupt("return", undefined);
|
|
57534
57728
|
case 12:
|
|
57535
57729
|
label = entry.label;
|
|
57536
57730
|
mismatch = "".concat(declared.column, " = '").concat((_declared$value = declared.value) !== null && _declared$value !== void 0 ? _declared$value : '', "', not the located row's '").concat(expected, "'");
|
|
57537
57731
|
case 14:
|
|
57538
|
-
|
|
57732
|
+
_context25.next = 16;
|
|
57539
57733
|
return sleep(250);
|
|
57540
57734
|
case 16:
|
|
57541
|
-
|
|
57735
|
+
_context25.next = 3;
|
|
57542
57736
|
break;
|
|
57543
57737
|
case 18:
|
|
57544
|
-
return
|
|
57738
|
+
return _context25.abrupt("return", "parentRow: the '".concat(label, "' subtable still shows ").concat(mismatch, ", after waiting ").concat(timeoutMs, " ms \u2014 it did not switch to the selected parent in time. Nothing was read or staged."));
|
|
57545
57739
|
case 19:
|
|
57546
57740
|
case "end":
|
|
57547
|
-
return
|
|
57741
|
+
return _context25.stop();
|
|
57548
57742
|
}
|
|
57549
|
-
},
|
|
57743
|
+
}, _callee17);
|
|
57550
57744
|
}));
|
|
57551
57745
|
return _waitForDeclaredParent.apply(this, arguments);
|
|
57552
57746
|
}
|
|
@@ -57560,7 +57754,7 @@ function gridIdentity(entry) {
|
|
|
57560
57754
|
* other helpers resolve FIRST — its gridId, or the label only when it has none. Returning the label would hand a
|
|
57561
57755
|
* colliding name straight back to waitForGrid/resolveGrid, which then pick the parent grid of the same label.
|
|
57562
57756
|
*/
|
|
57563
|
-
function waitForNewGrid(
|
|
57757
|
+
function waitForNewGrid(_x43, _x44, _x45) {
|
|
57564
57758
|
return _waitForNewGrid.apply(this, arguments);
|
|
57565
57759
|
}
|
|
57566
57760
|
/**
|
|
@@ -57568,50 +57762,50 @@ function waitForNewGrid(_x39, _x40, _x41) {
|
|
|
57568
57762
|
* waits for the table, then locates + selects the row (subtable deep-links carry tool/subGrid/subColumn/subValue).
|
|
57569
57763
|
*/
|
|
57570
57764
|
function _waitForNewGrid() {
|
|
57571
|
-
_waitForNewGrid = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function
|
|
57765
|
+
_waitForNewGrid = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee18(root, before, timeoutMs) {
|
|
57572
57766
|
var deadline, fresh;
|
|
57573
|
-
return _regeneratorRuntime.wrap(function
|
|
57574
|
-
while (1) switch (
|
|
57767
|
+
return _regeneratorRuntime.wrap(function _callee18$(_context26) {
|
|
57768
|
+
while (1) switch (_context26.prev = _context26.next) {
|
|
57575
57769
|
case 0:
|
|
57576
57770
|
deadline = Date.now() + timeoutMs;
|
|
57577
57771
|
case 1:
|
|
57578
57772
|
if (!(Date.now() < deadline)) {
|
|
57579
|
-
|
|
57773
|
+
_context26.next = 9;
|
|
57580
57774
|
break;
|
|
57581
57775
|
}
|
|
57582
57776
|
fresh = root.gridRegistry.entries.find(function (entry) {
|
|
57583
57777
|
return !before.has(gridIdentity(entry));
|
|
57584
57778
|
});
|
|
57585
57779
|
if (!fresh) {
|
|
57586
|
-
|
|
57780
|
+
_context26.next = 5;
|
|
57587
57781
|
break;
|
|
57588
57782
|
}
|
|
57589
|
-
return
|
|
57783
|
+
return _context26.abrupt("return", gridIdentity(fresh));
|
|
57590
57784
|
case 5:
|
|
57591
|
-
|
|
57785
|
+
_context26.next = 7;
|
|
57592
57786
|
return sleep(250);
|
|
57593
57787
|
case 7:
|
|
57594
|
-
|
|
57788
|
+
_context26.next = 1;
|
|
57595
57789
|
break;
|
|
57596
57790
|
case 9:
|
|
57597
|
-
return
|
|
57791
|
+
return _context26.abrupt("return", undefined);
|
|
57598
57792
|
case 10:
|
|
57599
57793
|
case "end":
|
|
57600
|
-
return
|
|
57794
|
+
return _context26.stop();
|
|
57601
57795
|
}
|
|
57602
|
-
},
|
|
57796
|
+
}, _callee18);
|
|
57603
57797
|
}));
|
|
57604
57798
|
return _waitForNewGrid.apply(this, arguments);
|
|
57605
57799
|
}
|
|
57606
|
-
function showEntityFromLink(
|
|
57800
|
+
function showEntityFromLink(_x46, _x47) {
|
|
57607
57801
|
return _showEntityFromLink.apply(this, arguments);
|
|
57608
57802
|
}
|
|
57609
57803
|
function _showEntityFromLink() {
|
|
57610
|
-
_showEntityFromLink = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function
|
|
57804
|
+
_showEntityFromLink = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee19(root, href) {
|
|
57611
57805
|
var _params$get, _params$get2, _params$get3, _params$get4, _params$get5, _params$get6, _params$get7, _params$get8;
|
|
57612
|
-
var params, targetPath, grid, column, value, targetMissing, api, _yield$locateRowCore$, parentNode, toolId, toolDeadline, opened,
|
|
57613
|
-
return _regeneratorRuntime.wrap(function
|
|
57614
|
-
while (1) switch (
|
|
57806
|
+
var params, targetPath, grid, column, value, targetMissing, api, _yield$locateRowCore$, parentNode, toolId, toolDeadline, opened, _i17, _arr5, bar, tool, subGrid, subColumn, subValue, subApi;
|
|
57807
|
+
return _regeneratorRuntime.wrap(function _callee19$(_context27) {
|
|
57808
|
+
while (1) switch (_context27.prev = _context27.next) {
|
|
57615
57809
|
case 0:
|
|
57616
57810
|
params = new URL(href).searchParams;
|
|
57617
57811
|
targetPath = ((_params$get = params.get('path')) !== null && _params$get !== void 0 ? _params$get : '').replace(/^\//, '');
|
|
@@ -57619,7 +57813,7 @@ function _showEntityFromLink() {
|
|
|
57619
57813
|
column = (_params$get3 = params.get('column')) !== null && _params$get3 !== void 0 ? _params$get3 : '';
|
|
57620
57814
|
value = (_params$get4 = params.get('value')) !== null && _params$get4 !== void 0 ? _params$get4 : ''; // Model-derived path — same whitelist as navigateTo.
|
|
57621
57815
|
if (!(targetPath && !isKnownPath(root, targetPath))) {
|
|
57622
|
-
|
|
57816
|
+
_context27.next = 7;
|
|
57623
57817
|
break;
|
|
57624
57818
|
}
|
|
57625
57819
|
throw new Error("entity link targets unknown path '".concat(targetPath, "'"));
|
|
@@ -57629,16 +57823,16 @@ function _showEntityFromLink() {
|
|
|
57629
57823
|
root.navigate('/' + targetPath);
|
|
57630
57824
|
}
|
|
57631
57825
|
if (!(!column || !value)) {
|
|
57632
|
-
|
|
57826
|
+
_context27.next = 10;
|
|
57633
57827
|
break;
|
|
57634
57828
|
}
|
|
57635
|
-
return
|
|
57829
|
+
return _context27.abrupt("return");
|
|
57636
57830
|
case 10:
|
|
57637
57831
|
if (!(value === column)) {
|
|
57638
|
-
|
|
57832
|
+
_context27.next = 12;
|
|
57639
57833
|
break;
|
|
57640
57834
|
}
|
|
57641
|
-
return
|
|
57835
|
+
return _context27.abrupt("return");
|
|
57642
57836
|
case 12:
|
|
57643
57837
|
// Locate failures past this point happen AFTER a successful navigation — mark them so the
|
|
57644
57838
|
// caller can report "view opened, row not found" instead of a dead link.
|
|
@@ -57647,25 +57841,25 @@ function _showEntityFromLink() {
|
|
|
57647
57841
|
entityLinkTargetMissing: true
|
|
57648
57842
|
});
|
|
57649
57843
|
};
|
|
57650
|
-
|
|
57844
|
+
_context27.next = 15;
|
|
57651
57845
|
return waitForGrid(root, grid, 10000);
|
|
57652
57846
|
case 15:
|
|
57653
|
-
api =
|
|
57847
|
+
api = _context27.sent;
|
|
57654
57848
|
if (api) {
|
|
57655
|
-
|
|
57849
|
+
_context27.next = 18;
|
|
57656
57850
|
break;
|
|
57657
57851
|
}
|
|
57658
57852
|
throw targetMissing("entity link: table '".concat(grid !== null && grid !== void 0 ? grid : '', "' not found on '").concat(targetPath, "'"));
|
|
57659
57853
|
case 18:
|
|
57660
|
-
|
|
57854
|
+
_context27.next = 20;
|
|
57661
57855
|
return locateRowCore(api, column, value)["catch"](function (e) {
|
|
57662
57856
|
throw targetMissing(e instanceof Error ? e.message : String(e));
|
|
57663
57857
|
});
|
|
57664
57858
|
case 20:
|
|
57665
|
-
_yield$locateRowCore$ =
|
|
57859
|
+
_yield$locateRowCore$ = _context27.sent;
|
|
57666
57860
|
parentNode = _yield$locateRowCore$.node;
|
|
57667
57861
|
if (parentNode) {
|
|
57668
|
-
|
|
57862
|
+
_context27.next = 24;
|
|
57669
57863
|
break;
|
|
57670
57864
|
}
|
|
57671
57865
|
throw targetMissing("entity link: no row with ".concat(column, "='").concat(value, "' in '").concat(grid !== null && grid !== void 0 ? grid : '', "'"));
|
|
@@ -57673,75 +57867,75 @@ function _showEntityFromLink() {
|
|
|
57673
57867
|
// Subtable chain: the parent selection reveals a conditional toolbar tool — open it, then locate inside it.
|
|
57674
57868
|
toolId = (_params$get5 = params.get('tool')) !== null && _params$get5 !== void 0 ? _params$get5 : params.get('subGrid');
|
|
57675
57869
|
if (toolId) {
|
|
57676
|
-
|
|
57870
|
+
_context27.next = 27;
|
|
57677
57871
|
break;
|
|
57678
57872
|
}
|
|
57679
|
-
return
|
|
57873
|
+
return _context27.abrupt("return");
|
|
57680
57874
|
case 27:
|
|
57681
57875
|
toolDeadline = Date.now() + 5000;
|
|
57682
57876
|
opened = false;
|
|
57683
57877
|
case 29:
|
|
57684
57878
|
if (!(Date.now() < toolDeadline && !opened)) {
|
|
57685
|
-
|
|
57879
|
+
_context27.next = 47;
|
|
57686
57880
|
break;
|
|
57687
57881
|
}
|
|
57688
|
-
|
|
57882
|
+
_i17 = 0, _arr5 = [root.contentStore.rightToolBar, root.contentStore.bottomToolBar];
|
|
57689
57883
|
case 31:
|
|
57690
|
-
if (!(
|
|
57691
|
-
|
|
57884
|
+
if (!(_i17 < _arr5.length)) {
|
|
57885
|
+
_context27.next = 42;
|
|
57692
57886
|
break;
|
|
57693
57887
|
}
|
|
57694
|
-
bar =
|
|
57888
|
+
bar = _arr5[_i17];
|
|
57695
57889
|
tool = bar.tools.find(function (candidate) {
|
|
57696
57890
|
return candidate.id.toLowerCase() === toolId.toLowerCase();
|
|
57697
57891
|
});
|
|
57698
57892
|
if (!tool) {
|
|
57699
|
-
|
|
57893
|
+
_context27.next = 39;
|
|
57700
57894
|
break;
|
|
57701
57895
|
}
|
|
57702
57896
|
bar.selectTool(tool.id);
|
|
57703
57897
|
bar.hidden = false;
|
|
57704
57898
|
opened = true;
|
|
57705
|
-
return
|
|
57899
|
+
return _context27.abrupt("break", 42);
|
|
57706
57900
|
case 39:
|
|
57707
|
-
|
|
57708
|
-
|
|
57901
|
+
_i17++;
|
|
57902
|
+
_context27.next = 31;
|
|
57709
57903
|
break;
|
|
57710
57904
|
case 42:
|
|
57711
57905
|
if (opened) {
|
|
57712
|
-
|
|
57906
|
+
_context27.next = 45;
|
|
57713
57907
|
break;
|
|
57714
57908
|
}
|
|
57715
|
-
|
|
57909
|
+
_context27.next = 45;
|
|
57716
57910
|
return sleep(250);
|
|
57717
57911
|
case 45:
|
|
57718
|
-
|
|
57912
|
+
_context27.next = 29;
|
|
57719
57913
|
break;
|
|
57720
57914
|
case 47:
|
|
57721
57915
|
subGrid = (_params$get6 = params.get('subGrid')) !== null && _params$get6 !== void 0 ? _params$get6 : undefined;
|
|
57722
57916
|
subColumn = (_params$get7 = params.get('subColumn')) !== null && _params$get7 !== void 0 ? _params$get7 : '';
|
|
57723
57917
|
subValue = (_params$get8 = params.get('subValue')) !== null && _params$get8 !== void 0 ? _params$get8 : '';
|
|
57724
57918
|
if (!(!opened || !subColumn || !subValue)) {
|
|
57725
|
-
|
|
57919
|
+
_context27.next = 52;
|
|
57726
57920
|
break;
|
|
57727
57921
|
}
|
|
57728
|
-
return
|
|
57922
|
+
return _context27.abrupt("return");
|
|
57729
57923
|
case 52:
|
|
57730
|
-
|
|
57924
|
+
_context27.next = 54;
|
|
57731
57925
|
return waitForGrid(root, subGrid, 10000);
|
|
57732
57926
|
case 54:
|
|
57733
|
-
subApi =
|
|
57927
|
+
subApi = _context27.sent;
|
|
57734
57928
|
if (!subApi) {
|
|
57735
|
-
|
|
57929
|
+
_context27.next = 58;
|
|
57736
57930
|
break;
|
|
57737
57931
|
}
|
|
57738
|
-
|
|
57932
|
+
_context27.next = 58;
|
|
57739
57933
|
return locateRowCore(subApi, subColumn, subValue);
|
|
57740
57934
|
case 58:
|
|
57741
57935
|
case "end":
|
|
57742
|
-
return
|
|
57936
|
+
return _context27.stop();
|
|
57743
57937
|
}
|
|
57744
|
-
},
|
|
57938
|
+
}, _callee19);
|
|
57745
57939
|
}));
|
|
57746
57940
|
return _showEntityFromLink.apply(this, arguments);
|
|
57747
57941
|
}
|
|
@@ -73969,6 +74163,124 @@ function SessionHeader(_ref) {
|
|
|
73969
74163
|
});
|
|
73970
74164
|
}
|
|
73971
74165
|
|
|
74166
|
+
/**
|
|
74167
|
+
* Numeric render-job states used by the RenderApprove session.
|
|
74168
|
+
* Mirrors `RenderJobState` in `node-apps/diva-media/src/infra/db/models/RenderJobModel.ts`
|
|
74169
|
+
* (kept as plain literals to avoid a cross-package import).
|
|
74170
|
+
*/
|
|
74171
|
+
var RENDER_JOB_STATE = {
|
|
74172
|
+
paymentClarified: 2,
|
|
74173
|
+
readyForProduction: 3,
|
|
74174
|
+
readyForRenderer: 5,
|
|
74175
|
+
inChecking: 7,
|
|
74176
|
+
approved: 8,
|
|
74177
|
+
rejected: 9,
|
|
74178
|
+
error: 11,
|
|
74179
|
+
finished: 12
|
|
74180
|
+
};
|
|
74181
|
+
|
|
74182
|
+
/**
|
|
74183
|
+
* Mandatory rejection reasons per acceptance criteria / Story 5 (7 categories).
|
|
74184
|
+
* `value` is sent as the `message` payload of `PATCH /renderjobs/:id/state`.
|
|
74185
|
+
*/
|
|
74186
|
+
var REJECTION_REASONS = [{
|
|
74187
|
+
value: 'qualityInsufficient',
|
|
74188
|
+
labelKey: 'backoffice.renderapprove.rejectionReasons.qualityInsufficient'
|
|
74189
|
+
}, {
|
|
74190
|
+
value: 'wrongPerspective',
|
|
74191
|
+
labelKey: 'backoffice.renderapprove.rejectionReasons.wrongPerspective'
|
|
74192
|
+
}, {
|
|
74193
|
+
value: 'lightingIssues',
|
|
74194
|
+
labelKey: 'backoffice.renderapprove.rejectionReasons.lightingIssues'
|
|
74195
|
+
}, {
|
|
74196
|
+
value: 'materialIssues',
|
|
74197
|
+
labelKey: 'backoffice.renderapprove.rejectionReasons.materialIssues'
|
|
74198
|
+
}, {
|
|
74199
|
+
value: 'geometryIssues',
|
|
74200
|
+
labelKey: 'backoffice.renderapprove.rejectionReasons.geometryIssues'
|
|
74201
|
+
}, {
|
|
74202
|
+
value: 'compositionIssues',
|
|
74203
|
+
labelKey: 'backoffice.renderapprove.rejectionReasons.compositionIssues'
|
|
74204
|
+
}, {
|
|
74205
|
+
value: 'other',
|
|
74206
|
+
labelKey: 'backoffice.renderapprove.rejectionReasons.other'
|
|
74207
|
+
}];
|
|
74208
|
+
function getRejectionReasonLabelKey(reason) {
|
|
74209
|
+
var _match$labelKey;
|
|
74210
|
+
var match = REJECTION_REASONS.find(function (entry) {
|
|
74211
|
+
return entry.value === reason;
|
|
74212
|
+
});
|
|
74213
|
+
return (_match$labelKey = match === null || match === void 0 ? void 0 : match.labelKey) !== null && _match$labelKey !== void 0 ? _match$labelKey : 'backoffice.renderapprove.rejectionReasons.other';
|
|
74214
|
+
}
|
|
74215
|
+
|
|
74216
|
+
/**
|
|
74217
|
+
* Keyboard shortcut identifiers used by `useKeyboardShortcuts`.
|
|
74218
|
+
* Layout: Arrow Right = Approve, Arrow Left = Reject, Arrow Down = Skip.
|
|
74219
|
+
* Optional navigation shortcuts use PageUp/PageDown. Space = Fullscreen,
|
|
74220
|
+
* Escape closes Modal / Fullscreen, Ctrl/Cmd+Z undoes the last action
|
|
74221
|
+
* within the undo window.
|
|
74222
|
+
*
|
|
74223
|
+
* `code` matches `KeyboardEvent.code` (layout-stable); `mod` requires
|
|
74224
|
+
* Ctrl (Windows/Linux) or Cmd (macOS) to be held during the keypress.
|
|
74225
|
+
*/
|
|
74226
|
+
|
|
74227
|
+
var KEY_MAP = {
|
|
74228
|
+
approve: {
|
|
74229
|
+
code: 'Enter'
|
|
74230
|
+
},
|
|
74231
|
+
reject: {
|
|
74232
|
+
code: 'Backspace'
|
|
74233
|
+
},
|
|
74234
|
+
prev: {
|
|
74235
|
+
code: 'ArrowLeft'
|
|
74236
|
+
},
|
|
74237
|
+
next: {
|
|
74238
|
+
code: 'ArrowRight'
|
|
74239
|
+
},
|
|
74240
|
+
swiperPrev: {
|
|
74241
|
+
code: 'KeyA'
|
|
74242
|
+
},
|
|
74243
|
+
swiperNext: {
|
|
74244
|
+
code: 'KeyD'
|
|
74245
|
+
},
|
|
74246
|
+
// A/D already drive the left swiper, so the variant swiper gets its own pair.
|
|
74247
|
+
variantPrev: {
|
|
74248
|
+
code: 'KeyQ'
|
|
74249
|
+
},
|
|
74250
|
+
variantNext: {
|
|
74251
|
+
code: 'KeyE'
|
|
74252
|
+
},
|
|
74253
|
+
compare: {
|
|
74254
|
+
code: 'KeyC'
|
|
74255
|
+
},
|
|
74256
|
+
details: {
|
|
74257
|
+
code: 'KeyD',
|
|
74258
|
+
mod: true
|
|
74259
|
+
},
|
|
74260
|
+
prompt: {
|
|
74261
|
+
code: 'KeyI',
|
|
74262
|
+
mod: true
|
|
74263
|
+
},
|
|
74264
|
+
fullscreen: {
|
|
74265
|
+
code: 'Space'
|
|
74266
|
+
},
|
|
74267
|
+
close: {
|
|
74268
|
+
code: 'Escape'
|
|
74269
|
+
},
|
|
74270
|
+
undo: {
|
|
74271
|
+
code: 'KeyZ',
|
|
74272
|
+
mod: true
|
|
74273
|
+
}
|
|
74274
|
+
};
|
|
74275
|
+
/**
|
|
74276
|
+
* Default lifetime of the Phase 4 undo notification (ms).
|
|
74277
|
+
* Kept here so it can be referenced from multiple hooks/components.
|
|
74278
|
+
*/
|
|
74279
|
+
var UNDO_TIMEOUT_MS = 5000;
|
|
74280
|
+
|
|
74281
|
+
function _createForOfIteratorHelper$k(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$k(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
|
|
74282
|
+
function _unsupportedIterableToArray$k(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$k(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$k(r, a) : void 0; } }
|
|
74283
|
+
function _arrayLikeToArray$k(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
73972
74284
|
/** Mime types of images a browser cannot render in an `<img>` element. */
|
|
73973
74285
|
var NON_RENDERABLE_MIME_TYPES = new Set(['image/tiff', 'image/tif']);
|
|
73974
74286
|
|
|
@@ -73993,6 +74305,47 @@ function getViewerUrl(media) {
|
|
|
73993
74305
|
return (_media$url = media.url) !== null && _media$url !== void 0 ? _media$url : null;
|
|
73994
74306
|
}
|
|
73995
74307
|
|
|
74308
|
+
/** One entry of a render job's state history, as delivered by diva-media. */
|
|
74309
|
+
|
|
74310
|
+
/** Most recent state-history entry of the given state that carries a message. */
|
|
74311
|
+
function latestEntryWithMessage(history, state) {
|
|
74312
|
+
if (!Array.isArray(history)) return undefined;
|
|
74313
|
+
var best;
|
|
74314
|
+
var _iterator = _createForOfIteratorHelper$k(history),
|
|
74315
|
+
_step;
|
|
74316
|
+
try {
|
|
74317
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
74318
|
+
var _entry$created, _best$created;
|
|
74319
|
+
var entry = _step.value;
|
|
74320
|
+
if ((entry === null || entry === void 0 ? void 0 : entry.state) !== state) continue;
|
|
74321
|
+
if (typeof entry.message !== 'string' || entry.message.length === 0) continue;
|
|
74322
|
+
if (!best || ((_entry$created = entry.created) !== null && _entry$created !== void 0 ? _entry$created : 0) >= ((_best$created = best.created) !== null && _best$created !== void 0 ? _best$created : 0)) best = entry;
|
|
74323
|
+
}
|
|
74324
|
+
} catch (err) {
|
|
74325
|
+
_iterator.e(err);
|
|
74326
|
+
} finally {
|
|
74327
|
+
_iterator.f();
|
|
74328
|
+
}
|
|
74329
|
+
return best;
|
|
74330
|
+
}
|
|
74331
|
+
|
|
74332
|
+
/** Message (reason + comment) of the most recent rejection in a job's state history. */
|
|
74333
|
+
function latestRejectMessage(history) {
|
|
74334
|
+
var _latestEntryWithMessa;
|
|
74335
|
+
return (_latestEntryWithMessa = latestEntryWithMessage(history, RENDER_JOB_STATE.rejected)) === null || _latestEntryWithMessa === void 0 ? void 0 : _latestEntryWithMessa.message;
|
|
74336
|
+
}
|
|
74337
|
+
|
|
74338
|
+
/**
|
|
74339
|
+
* Most recent failure in a job's state history.
|
|
74340
|
+
*
|
|
74341
|
+
* The reported reason is the only thing a user gets to see about a job the render pipeline could not
|
|
74342
|
+
* process, so both the message and its code are returned - the code is translated, the message is the
|
|
74343
|
+
* fallback for an unrecognised failure.
|
|
74344
|
+
*/
|
|
74345
|
+
function latestErrorEntry(history) {
|
|
74346
|
+
return latestEntryWithMessage(history, RENDER_JOB_STATE.error);
|
|
74347
|
+
}
|
|
74348
|
+
|
|
73996
74349
|
var root$b = "root-bbDdW";
|
|
73997
74350
|
var header$1 = "header--owh8";
|
|
73998
74351
|
var content$1 = "content-q2m1c";
|
|
@@ -74859,9 +75212,9 @@ styleInject(css_248z$n);
|
|
|
74859
75212
|
|
|
74860
75213
|
function ownKeys$D(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
74861
75214
|
function _objectSpread$D(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$D(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$D(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
74862
|
-
function _createForOfIteratorHelper$
|
|
74863
|
-
function _unsupportedIterableToArray$
|
|
74864
|
-
function _arrayLikeToArray$
|
|
75215
|
+
function _createForOfIteratorHelper$j(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$j(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
|
|
75216
|
+
function _unsupportedIterableToArray$j(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$j(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$j(r, a) : void 0; } }
|
|
75217
|
+
function _arrayLikeToArray$j(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
74865
75218
|
/**
|
|
74866
75219
|
* Builds the initial item list. When `selectedUrls` (the persisted
|
|
74867
75220
|
* `renderImages`) are present, the matching slides are selected and ordered
|
|
@@ -74884,7 +75237,7 @@ function buildItems(slides, selectedUrls) {
|
|
|
74884
75237
|
}));
|
|
74885
75238
|
var selected = [];
|
|
74886
75239
|
var rest = [];
|
|
74887
|
-
var _iterator = _createForOfIteratorHelper$
|
|
75240
|
+
var _iterator = _createForOfIteratorHelper$j(withMeta),
|
|
74888
75241
|
_step;
|
|
74889
75242
|
try {
|
|
74890
75243
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
@@ -74995,7 +75348,7 @@ function AIImageSelector(_ref2) {
|
|
|
74995
75348
|
// Running order number among the selected items, in list order.
|
|
74996
75349
|
var counter = 0;
|
|
74997
75350
|
var orderByKey = new Map();
|
|
74998
|
-
var _iterator2 = _createForOfIteratorHelper$
|
|
75351
|
+
var _iterator2 = _createForOfIteratorHelper$j(items),
|
|
74999
75352
|
_step2;
|
|
75000
75353
|
try {
|
|
75001
75354
|
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
@@ -75222,120 +75575,6 @@ function InputImagesModal(_ref) {
|
|
|
75222
75575
|
});
|
|
75223
75576
|
}
|
|
75224
75577
|
|
|
75225
|
-
/**
|
|
75226
|
-
* Numeric render-job states used by the RenderApprove session.
|
|
75227
|
-
* Mirrors `RenderJobState` in `node-apps/diva-media/src/infra/db/models/RenderJobModel.ts`
|
|
75228
|
-
* (kept as plain literals to avoid a cross-package import).
|
|
75229
|
-
*/
|
|
75230
|
-
var RENDER_JOB_STATE = {
|
|
75231
|
-
paymentClarified: 2,
|
|
75232
|
-
readyForProduction: 3,
|
|
75233
|
-
readyForRenderer: 5,
|
|
75234
|
-
inChecking: 7,
|
|
75235
|
-
approved: 8,
|
|
75236
|
-
rejected: 9,
|
|
75237
|
-
finished: 12
|
|
75238
|
-
};
|
|
75239
|
-
|
|
75240
|
-
/**
|
|
75241
|
-
* Mandatory rejection reasons per acceptance criteria / Story 5 (7 categories).
|
|
75242
|
-
* `value` is sent as the `message` payload of `PATCH /renderjobs/:id/state`.
|
|
75243
|
-
*/
|
|
75244
|
-
var REJECTION_REASONS = [{
|
|
75245
|
-
value: 'qualityInsufficient',
|
|
75246
|
-
labelKey: 'backoffice.renderapprove.rejectionReasons.qualityInsufficient'
|
|
75247
|
-
}, {
|
|
75248
|
-
value: 'wrongPerspective',
|
|
75249
|
-
labelKey: 'backoffice.renderapprove.rejectionReasons.wrongPerspective'
|
|
75250
|
-
}, {
|
|
75251
|
-
value: 'lightingIssues',
|
|
75252
|
-
labelKey: 'backoffice.renderapprove.rejectionReasons.lightingIssues'
|
|
75253
|
-
}, {
|
|
75254
|
-
value: 'materialIssues',
|
|
75255
|
-
labelKey: 'backoffice.renderapprove.rejectionReasons.materialIssues'
|
|
75256
|
-
}, {
|
|
75257
|
-
value: 'geometryIssues',
|
|
75258
|
-
labelKey: 'backoffice.renderapprove.rejectionReasons.geometryIssues'
|
|
75259
|
-
}, {
|
|
75260
|
-
value: 'compositionIssues',
|
|
75261
|
-
labelKey: 'backoffice.renderapprove.rejectionReasons.compositionIssues'
|
|
75262
|
-
}, {
|
|
75263
|
-
value: 'other',
|
|
75264
|
-
labelKey: 'backoffice.renderapprove.rejectionReasons.other'
|
|
75265
|
-
}];
|
|
75266
|
-
function getRejectionReasonLabelKey(reason) {
|
|
75267
|
-
var _match$labelKey;
|
|
75268
|
-
var match = REJECTION_REASONS.find(function (entry) {
|
|
75269
|
-
return entry.value === reason;
|
|
75270
|
-
});
|
|
75271
|
-
return (_match$labelKey = match === null || match === void 0 ? void 0 : match.labelKey) !== null && _match$labelKey !== void 0 ? _match$labelKey : 'backoffice.renderapprove.rejectionReasons.other';
|
|
75272
|
-
}
|
|
75273
|
-
|
|
75274
|
-
/**
|
|
75275
|
-
* Keyboard shortcut identifiers used by `useKeyboardShortcuts`.
|
|
75276
|
-
* Layout: Arrow Right = Approve, Arrow Left = Reject, Arrow Down = Skip.
|
|
75277
|
-
* Optional navigation shortcuts use PageUp/PageDown. Space = Fullscreen,
|
|
75278
|
-
* Escape closes Modal / Fullscreen, Ctrl/Cmd+Z undoes the last action
|
|
75279
|
-
* within the undo window.
|
|
75280
|
-
*
|
|
75281
|
-
* `code` matches `KeyboardEvent.code` (layout-stable); `mod` requires
|
|
75282
|
-
* Ctrl (Windows/Linux) or Cmd (macOS) to be held during the keypress.
|
|
75283
|
-
*/
|
|
75284
|
-
|
|
75285
|
-
var KEY_MAP = {
|
|
75286
|
-
approve: {
|
|
75287
|
-
code: 'Enter'
|
|
75288
|
-
},
|
|
75289
|
-
reject: {
|
|
75290
|
-
code: 'Backspace'
|
|
75291
|
-
},
|
|
75292
|
-
prev: {
|
|
75293
|
-
code: 'ArrowLeft'
|
|
75294
|
-
},
|
|
75295
|
-
next: {
|
|
75296
|
-
code: 'ArrowRight'
|
|
75297
|
-
},
|
|
75298
|
-
swiperPrev: {
|
|
75299
|
-
code: 'KeyA'
|
|
75300
|
-
},
|
|
75301
|
-
swiperNext: {
|
|
75302
|
-
code: 'KeyD'
|
|
75303
|
-
},
|
|
75304
|
-
// A/D already drive the left swiper, so the variant swiper gets its own pair.
|
|
75305
|
-
variantPrev: {
|
|
75306
|
-
code: 'KeyQ'
|
|
75307
|
-
},
|
|
75308
|
-
variantNext: {
|
|
75309
|
-
code: 'KeyE'
|
|
75310
|
-
},
|
|
75311
|
-
compare: {
|
|
75312
|
-
code: 'KeyC'
|
|
75313
|
-
},
|
|
75314
|
-
details: {
|
|
75315
|
-
code: 'KeyD',
|
|
75316
|
-
mod: true
|
|
75317
|
-
},
|
|
75318
|
-
prompt: {
|
|
75319
|
-
code: 'KeyI',
|
|
75320
|
-
mod: true
|
|
75321
|
-
},
|
|
75322
|
-
fullscreen: {
|
|
75323
|
-
code: 'Space'
|
|
75324
|
-
},
|
|
75325
|
-
close: {
|
|
75326
|
-
code: 'Escape'
|
|
75327
|
-
},
|
|
75328
|
-
undo: {
|
|
75329
|
-
code: 'KeyZ',
|
|
75330
|
-
mod: true
|
|
75331
|
-
}
|
|
75332
|
-
};
|
|
75333
|
-
/**
|
|
75334
|
-
* Default lifetime of the Phase 4 undo notification (ms).
|
|
75335
|
-
* Kept here so it can be referenced from multiple hooks/components.
|
|
75336
|
-
*/
|
|
75337
|
-
var UNDO_TIMEOUT_MS = 5000;
|
|
75338
|
-
|
|
75339
75578
|
var container$3 = "container-PmByk";
|
|
75340
75579
|
var header = "header-ESR-S";
|
|
75341
75580
|
var title = "title-g5pl0";
|
|
@@ -75374,7 +75613,7 @@ var statusTriggerLocked = "statusTriggerLocked-5u8lc";
|
|
|
75374
75613
|
var statusIcon = "statusIcon-rpMzy";
|
|
75375
75614
|
var menuDot = "menuDot-ybea1";
|
|
75376
75615
|
var footer = "footer-HdZwL";
|
|
75377
|
-
var css_248z$l = ".container-PmByk {\n flex: 1;\n min-height: 0;\n display: flex;\n flex-direction: column;\n gap: 14px;\n overflow: auto;\n padding: 16px 20px;\n}\n\n.header-ESR-S {\n display: flex;\n flex-direction: column;\n gap: 4px;\n}\n\n.title-g5pl0 {\n font-size: 16px;\n font-weight: 600;\n}\n\n.subtitle-wYnId {\n color: #8c8c8c;\n font-size: 13px;\n}\n\n.tiles-4NW82 {\n display: flex;\n flex-wrap: wrap;\n gap: 8px;\n}\n\n.tile-vHlQ9 {\n display: inline-flex;\n align-items: center;\n gap: 8px;\n padding: 6px 12px;\n border: 1px solid #f0f0f0;\n border-radius: 8px;\n background: #fff;\n cursor: pointer;\n font: inherit;\n color: inherit;\n transition: border-color 0.15s, background 0.15s;\n}\n\n.tile-vHlQ9:hover {\n border-color: #1677ff;\n}\n\n.tile-vHlQ9.focus-visible-am0Va {\n outline: 2px solid #1677ff;\n outline-offset: 2px;\n}\n\n.tile-vHlQ9:focus-visible {\n outline: 2px solid #1677ff;\n outline-offset: 2px;\n}\n\n.tileActive-Kl6AW {\n border-color: #1677ff;\n background: #e6f4ff;\n}\n\n.clearFilter-KsvRj {\n align-self: center;\n border: none;\n background: none;\n color: #1677ff;\n cursor: pointer;\n font: inherit;\n font-size: 12px;\n padding: 0 4px;\n}\n\n.clearFilter-KsvRj:hover {\n text-decoration: underline;\n}\n\n.dot-x41U9 {\n width: 8px;\n height: 8px;\n border-radius: 50%;\n flex: none;\n}\n\n.dotApproved-jidKD {\n background: #52c41a;\n}\n\n.dotRejected-9TFUi {\n background: #ff4d4f;\n}\n\n.dotOpen-eHbi0 {\n background: #faad14;\n}\n\n.dotFinished-Id6hR {\n background: #722ed1;\n}\n\n.dotPayment-Fzk7U {\n background: #13c2c2;\n}\n\n.dotReadyForProduction-yIYkt {\n background: #1677ff;\n}\n\n.tileNum-9DGoc {\n font-size: 16px;\n font-weight: 600;\n font-feature-settings: \"tnum\";\n font-variant-numeric: tabular-nums;\n}\n\n.tileLabel-nG0xD {\n color: #8c8c8c;\n font-size: 12px;\n}\n\n.toolbar-jJDio {\n display: flex;\n align-items: center;\n gap: 12px;\n flex-wrap: wrap;\n}\n\n.selInfo-r4QBF {\n color: #8c8c8c;\n font-size: 13px;\n}\n\n.spacer-g69QI {\n flex: 1;\n}\n\n.thumb-Wd6Zw {\n width: 74px;\n height: 54px;\n border-radius: 6px;\n overflow: hidden;\n border: 1px solid #f0f0f0;\n background: #fafafa;\n display: flex;\n align-items: center;\n justify-content: center;\n position: relative;\n cursor: pointer;\n}\n\n.thumbStatic-kc-Qn {\n cursor: default;\n}\n\n.thumbImg-ViR1y {\n width: 100%;\n height: 100%;\n -o-object-fit: cover;\n object-fit: cover;\n display: block;\n}\n\n.thumbPlaceholder-gp0b2 {\n color: #bfbfbf;\n font-size: 18px;\n}\n\n.badge-bYA4m {\n position: absolute;\n left: 4px;\n bottom: 4px;\n background: rgba(0, 0, 0, 0.6);\n color: #fff;\n font-size: 10px;\n font-weight: 600;\n line-height: 1;\n padding: 2px 5px;\n border-radius: 3px;\n}\n\n.videoBadge--DvZy {\n position: absolute;\n color: #fff;\n font-size: 22px;\n filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5));\n}\n\n.prodName-t5Dom {\n font-weight: 600;\n}\n\n.info--EMmi {\n display: flex;\n flex-direction: column;\n gap: 2px;\n}\n\n.infoLines-HenMK {\n display: flex;\n flex-direction: column;\n gap: 2px;\n margin-top: 2px;\n}\n\n.infoLine-EyUqw {\n font-size: 12px;\n color: #8c8c8c;\n}\n\n.infoLabel-JfxNQ {\n color: #bfbfbf;\n}\n\n.reason-wzttm {\n margin-top: 4px;\n max-width: 220px;\n font-size: 12px;\n color: #8c8c8c;\n white-space: normal;\n}\n\n.prodSub-cZZSl {\n color: #8c8c8c;\n font-size: 12px;\n display: flex;\n gap: 8px;\n flex-wrap: wrap;\n margin-top: 2px;\n}\n\n.sku-7EODQ {\n font-family: monospace;\n}\n\n.statusTrigger-oGuEq {\n cursor: pointer;\n display: inline-flex;\n align-items: center;\n gap: 4px;\n}\n\n.statusTriggerLocked-5u8lc {\n cursor: default;\n}\n\n.statusIcon-rpMzy {\n font-size: 10px;\n color: #8c8c8c;\n}\n\n.menuDot-ybea1 {\n display: inline-block;\n width: 8px;\n height: 8px;\n border-radius: 50%;\n margin-right: 8px;\n vertical-align: middle;\n}\n\n.footer-HdZwL {\n display: flex;\n justify-content: space-between;\n gap: 8px;\n flex-wrap: wrap;\n padding-top: 4px;\n}\n\n/* Dark mode */\n.darkmode .tile-vHlQ9 {\n background: #1f1f1f;\n border-color: #434343;\n}\n\n.darkmode .tileActive-Kl6AW {\n border-color: #3c89e8;\n background: rgba(60, 137, 232, 0.16);\n}\n\n.darkmode .thumb-Wd6Zw {\n background: #262626;\n border-color: #434343;\n}\n\n.darkmode .subtitle-wYnId,\n.darkmode .tileLabel-nG0xD,\n.darkmode .selInfo-r4QBF,\n.darkmode .prodSub-cZZSl,\n.darkmode .infoLine-EyUqw,\n.darkmode .reason-wzttm {\n color: rgba(255, 255, 255, 0.5);\n}\n\n.darkmode .infoLabel-JfxNQ {\n color: rgba(255, 255, 255, 0.35);\n}\n";
|
|
75616
|
+
var css_248z$l = ".container-PmByk {\n flex: 1;\n min-height: 0;\n display: flex;\n flex-direction: column;\n gap: 14px;\n overflow: auto;\n padding: 16px 20px;\n}\n\n.header-ESR-S {\n display: flex;\n flex-direction: column;\n gap: 4px;\n}\n\n.title-g5pl0 {\n font-size: 16px;\n font-weight: 600;\n}\n\n.subtitle-wYnId {\n color: #8c8c8c;\n font-size: 13px;\n}\n\n.tiles-4NW82 {\n display: flex;\n flex-wrap: wrap;\n gap: 8px;\n}\n\n.tile-vHlQ9 {\n display: inline-flex;\n align-items: center;\n gap: 8px;\n padding: 6px 12px;\n border: 1px solid #f0f0f0;\n border-radius: 8px;\n background: #fff;\n cursor: pointer;\n font: inherit;\n color: inherit;\n transition: border-color 0.15s, background 0.15s;\n}\n\n.tile-vHlQ9:hover {\n border-color: #1677ff;\n}\n\n.tile-vHlQ9.focus-visible-am0Va {\n outline: 2px solid #1677ff;\n outline-offset: 2px;\n}\n\n.tile-vHlQ9:focus-visible {\n outline: 2px solid #1677ff;\n outline-offset: 2px;\n}\n\n.tileActive-Kl6AW {\n border-color: #1677ff;\n background: #e6f4ff;\n}\n\n.clearFilter-KsvRj {\n align-self: center;\n border: none;\n background: none;\n color: #1677ff;\n cursor: pointer;\n font: inherit;\n font-size: 12px;\n padding: 0 4px;\n}\n\n.clearFilter-KsvRj:hover {\n text-decoration: underline;\n}\n\n.dot-x41U9 {\n width: 8px;\n height: 8px;\n border-radius: 50%;\n flex: none;\n}\n\n.dotApproved-jidKD {\n background: #52c41a;\n}\n\n.dotRejected-9TFUi {\n background: #ff4d4f;\n}\n\n.dotOpen-eHbi0 {\n background: #faad14;\n}\n\n.dotFinished-Id6hR {\n background: #722ed1;\n}\n\n.dotPayment-Fzk7U {\n background: #13c2c2;\n}\n\n.dotReadyForProduction-yIYkt {\n background: #1677ff;\n}\n\n.tileNum-9DGoc {\n font-size: 16px;\n font-weight: 600;\n font-feature-settings: \"tnum\";\n font-variant-numeric: tabular-nums;\n}\n\n.tileLabel-nG0xD {\n color: #8c8c8c;\n font-size: 12px;\n}\n\n.toolbar-jJDio {\n display: flex;\n align-items: center;\n gap: 12px;\n flex-wrap: wrap;\n}\n\n.selInfo-r4QBF {\n color: #8c8c8c;\n font-size: 13px;\n}\n\n.spacer-g69QI {\n flex: 1;\n}\n\n.thumb-Wd6Zw {\n width: 74px;\n height: 54px;\n border-radius: 6px;\n overflow: hidden;\n border: 1px solid #f0f0f0;\n background: #fafafa;\n display: flex;\n align-items: center;\n justify-content: center;\n position: relative;\n cursor: pointer;\n}\n\n.thumbStatic-kc-Qn {\n cursor: default;\n}\n\n.thumbImg-ViR1y {\n width: 100%;\n height: 100%;\n -o-object-fit: cover;\n object-fit: cover;\n display: block;\n}\n\n.thumbPlaceholder-gp0b2 {\n color: #bfbfbf;\n font-size: 18px;\n}\n\n.badge-bYA4m {\n position: absolute;\n left: 4px;\n bottom: 4px;\n background: rgba(0, 0, 0, 0.6);\n color: #fff;\n font-size: 10px;\n font-weight: 600;\n line-height: 1;\n padding: 2px 5px;\n border-radius: 3px;\n}\n\n.videoBadge--DvZy {\n position: absolute;\n color: #fff;\n font-size: 22px;\n filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5));\n}\n\n.prodName-t5Dom {\n font-weight: 600;\n}\n\n.info--EMmi {\n display: flex;\n flex-direction: column;\n gap: 2px;\n}\n\n.infoLines-HenMK {\n display: flex;\n flex-direction: column;\n gap: 2px;\n margin-top: 2px;\n}\n\n.infoLine-EyUqw {\n font-size: 12px;\n color: #8c8c8c;\n}\n\n.infoLabel-JfxNQ {\n color: #bfbfbf;\n}\n\n.reason-wzttm {\n margin-top: 4px;\n max-width: 220px;\n font-size: 12px;\n color: #8c8c8c;\n white-space: normal;\n /* A failure reason can be a whole render log - without the clamp one row would blow up the table.\n The full text stays reachable through the element's tooltip. */\n display: -webkit-box;\n -webkit-line-clamp: 3;\n -webkit-box-orient: vertical;\n overflow: hidden;\n}\n\n.prodSub-cZZSl {\n color: #8c8c8c;\n font-size: 12px;\n display: flex;\n gap: 8px;\n flex-wrap: wrap;\n margin-top: 2px;\n}\n\n.sku-7EODQ {\n font-family: monospace;\n}\n\n.statusTrigger-oGuEq {\n cursor: pointer;\n display: inline-flex;\n align-items: center;\n gap: 4px;\n}\n\n.statusTriggerLocked-5u8lc {\n cursor: default;\n}\n\n.statusIcon-rpMzy {\n font-size: 10px;\n color: #8c8c8c;\n}\n\n.menuDot-ybea1 {\n display: inline-block;\n width: 8px;\n height: 8px;\n border-radius: 50%;\n margin-right: 8px;\n vertical-align: middle;\n}\n\n.footer-HdZwL {\n display: flex;\n justify-content: space-between;\n gap: 8px;\n flex-wrap: wrap;\n padding-top: 4px;\n}\n\n/* Dark mode */\n.darkmode .tile-vHlQ9 {\n background: #1f1f1f;\n border-color: #434343;\n}\n\n.darkmode .tileActive-Kl6AW {\n border-color: #3c89e8;\n background: rgba(60, 137, 232, 0.16);\n}\n\n.darkmode .thumb-Wd6Zw {\n background: #262626;\n border-color: #434343;\n}\n\n.darkmode .subtitle-wYnId,\n.darkmode .tileLabel-nG0xD,\n.darkmode .selInfo-r4QBF,\n.darkmode .prodSub-cZZSl,\n.darkmode .infoLine-EyUqw,\n.darkmode .reason-wzttm {\n color: rgba(255, 255, 255, 0.5);\n}\n\n.darkmode .infoLabel-JfxNQ {\n color: rgba(255, 255, 255, 0.35);\n}\n";
|
|
75378
75617
|
styleInject(css_248z$l);
|
|
75379
75618
|
|
|
75380
75619
|
var PAYMENT_CLARIFIED = RENDER_JOB_STATE.paymentClarified,
|
|
@@ -75382,6 +75621,7 @@ var PAYMENT_CLARIFIED = RENDER_JOB_STATE.paymentClarified,
|
|
|
75382
75621
|
READY_FOR_RENDERER = RENDER_JOB_STATE.readyForRenderer,
|
|
75383
75622
|
APPROVED = RENDER_JOB_STATE.approved,
|
|
75384
75623
|
REJECTED = RENDER_JOB_STATE.rejected,
|
|
75624
|
+
ERROR = RENDER_JOB_STATE.error,
|
|
75385
75625
|
INCHECKING = RENDER_JOB_STATE.inChecking,
|
|
75386
75626
|
FINISHED = RENDER_JOB_STATE.finished;
|
|
75387
75627
|
|
|
@@ -75957,9 +76197,24 @@ function SessionOverview(_ref3) {
|
|
|
75957
76197
|
}
|
|
75958
76198
|
})]
|
|
75959
76199
|
})
|
|
75960
|
-
}), r.state === REJECTED && r.rejectMessage ?
|
|
76200
|
+
}), r.state === REJECTED && r.rejectMessage ?
|
|
76201
|
+
/*#__PURE__*/
|
|
76202
|
+
// Shares the clamped cell with the error message below, so the full reason needs the same tooltip.
|
|
76203
|
+
jsx("div", {
|
|
75961
76204
|
className: reason,
|
|
76205
|
+
title: r.rejectMessage,
|
|
75962
76206
|
children: r.rejectMessage
|
|
76207
|
+
}) : null, r.state === ERROR && r.errorMessage ?
|
|
76208
|
+
/*#__PURE__*/
|
|
76209
|
+
// A recognised failure gets its plain-language text in front of the reported message -
|
|
76210
|
+
// never instead of it, so a wrong classification cannot hide the only diagnosis there is.
|
|
76211
|
+
// The clamped cell keeps the full text reachable as a tooltip.
|
|
76212
|
+
jsx("div", {
|
|
76213
|
+
className: reason,
|
|
76214
|
+
title: r.errorMessage,
|
|
76215
|
+
children: [r.errorMessageCode ? t("renderjob.error.".concat(r.errorMessageCode), {
|
|
76216
|
+
defaultValue: ''
|
|
76217
|
+
}) : '', r.errorMessage].filter(Boolean).join(' — ')
|
|
75963
76218
|
}) : null]
|
|
75964
76219
|
});
|
|
75965
76220
|
}
|
|
@@ -76433,9 +76688,9 @@ styleInject(css_248z$j);
|
|
|
76433
76688
|
|
|
76434
76689
|
function ownKeys$C(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
76435
76690
|
function _objectSpread$C(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$C(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$C(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
76436
|
-
function _createForOfIteratorHelper$
|
|
76437
|
-
function _unsupportedIterableToArray$
|
|
76438
|
-
function _arrayLikeToArray$
|
|
76691
|
+
function _createForOfIteratorHelper$i(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$i(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
|
|
76692
|
+
function _unsupportedIterableToArray$i(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$i(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$i(r, a) : void 0; } }
|
|
76693
|
+
function _arrayLikeToArray$i(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
76439
76694
|
var BYTES_IN_KIB = 1024;
|
|
76440
76695
|
|
|
76441
76696
|
/** A job without an explicit `nrOfVariants` behaves like a single variant. */
|
|
@@ -76542,7 +76797,7 @@ function buildDetailsPatch(job, fields, draft) {
|
|
|
76542
76797
|
value: next
|
|
76543
76798
|
});
|
|
76544
76799
|
};
|
|
76545
|
-
var _iterator = _createForOfIteratorHelper$
|
|
76800
|
+
var _iterator = _createForOfIteratorHelper$i(fields),
|
|
76546
76801
|
_step;
|
|
76547
76802
|
try {
|
|
76548
76803
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
@@ -78719,9 +78974,9 @@ function useRenderApproveSession(_ref) {
|
|
|
78719
78974
|
|
|
78720
78975
|
function ownKeys$x(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
78721
78976
|
function _objectSpread$x(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$x(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$x(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
78722
|
-
function _createForOfIteratorHelper$
|
|
78723
|
-
function _unsupportedIterableToArray$
|
|
78724
|
-
function _arrayLikeToArray$
|
|
78977
|
+
function _createForOfIteratorHelper$h(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$h(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
|
|
78978
|
+
function _unsupportedIterableToArray$h(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$h(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$h(r, a) : void 0; } }
|
|
78979
|
+
function _arrayLikeToArray$h(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
78725
78980
|
var LOG$b = getLogger('Backoffice', 'RenderApprove');
|
|
78726
78981
|
function getMediaItemId(job) {
|
|
78727
78982
|
var list = job === null || job === void 0 ? void 0 : job.mediaItems;
|
|
@@ -78854,7 +79109,7 @@ function _fetchProductMedia() {
|
|
|
78854
79109
|
seen = new Set();
|
|
78855
79110
|
if (excludeUrl) seen.add(excludeUrl);
|
|
78856
79111
|
result = [];
|
|
78857
|
-
_iterator2 = _createForOfIteratorHelper$
|
|
79112
|
+
_iterator2 = _createForOfIteratorHelper$h(sorted);
|
|
78858
79113
|
_context4.prev = 12;
|
|
78859
79114
|
_iterator2.s();
|
|
78860
79115
|
case 14:
|
|
@@ -79058,7 +79313,7 @@ function buildLeftSlides(left, renderImages, productMedia) {
|
|
|
79058
79313
|
});
|
|
79059
79314
|
if (renderImages.length === 0) return [left].concat(_toConsumableArray(remainingProduct));
|
|
79060
79315
|
var productByUrl = new Map();
|
|
79061
|
-
var _iterator = _createForOfIteratorHelper$
|
|
79316
|
+
var _iterator = _createForOfIteratorHelper$h(productMedia),
|
|
79062
79317
|
_step;
|
|
79063
79318
|
try {
|
|
79064
79319
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
@@ -79450,34 +79705,9 @@ function useRenderJobData(id, refreshKey) {
|
|
|
79450
79705
|
|
|
79451
79706
|
function ownKeys$w(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
79452
79707
|
function _objectSpread$w(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$w(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$w(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
79453
|
-
function _createForOfIteratorHelper$h(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$h(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
|
|
79454
|
-
function _unsupportedIterableToArray$h(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$h(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$h(r, a) : void 0; } }
|
|
79455
|
-
function _arrayLikeToArray$h(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
79456
79708
|
var LOG$a = getLogger('Backoffice', 'RenderApprove');
|
|
79457
79709
|
var METADATA_CHUNK_SIZE = 100;
|
|
79458
79710
|
var RESULT_CONCURRENCY = 6;
|
|
79459
|
-
/** Message of the most recent rejection (state 9) in the job's state history. */
|
|
79460
|
-
function latestRejectMessage(history) {
|
|
79461
|
-
var _best;
|
|
79462
|
-
if (!Array.isArray(history)) return undefined;
|
|
79463
|
-
var best;
|
|
79464
|
-
var _iterator = _createForOfIteratorHelper$h(history),
|
|
79465
|
-
_step;
|
|
79466
|
-
try {
|
|
79467
|
-
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
79468
|
-
var _entry$created, _best$created;
|
|
79469
|
-
var entry = _step.value;
|
|
79470
|
-
if ((entry === null || entry === void 0 ? void 0 : entry.state) !== RENDER_JOB_STATE.rejected) continue;
|
|
79471
|
-
if (typeof entry.message !== 'string' || entry.message.length === 0) continue;
|
|
79472
|
-
if (!best || ((_entry$created = entry.created) !== null && _entry$created !== void 0 ? _entry$created : 0) >= ((_best$created = best.created) !== null && _best$created !== void 0 ? _best$created : 0)) best = entry;
|
|
79473
|
-
}
|
|
79474
|
-
} catch (err) {
|
|
79475
|
-
_iterator.e(err);
|
|
79476
|
-
} finally {
|
|
79477
|
-
_iterator.f();
|
|
79478
|
-
}
|
|
79479
|
-
return (_best = best) === null || _best === void 0 ? void 0 : _best.message;
|
|
79480
|
-
}
|
|
79481
79711
|
function buildOverviewUrl(baseUrl, ids) {
|
|
79482
79712
|
var params = new URLSearchParams();
|
|
79483
79713
|
params.set('limit', String(ids.length));
|
|
@@ -79670,6 +79900,7 @@ function useSessionOverviewData(ids, enabled) {
|
|
|
79670
79900
|
base = ids.map(function (id) {
|
|
79671
79901
|
var _raw$productName, _raw$organizationName, _raw$realTimeRenderUr;
|
|
79672
79902
|
var raw = byId.get(id);
|
|
79903
|
+
var errorEntry = latestErrorEntry(raw === null || raw === void 0 ? void 0 : raw.stateHistory);
|
|
79673
79904
|
return {
|
|
79674
79905
|
id: id,
|
|
79675
79906
|
state: typeof (raw === null || raw === void 0 ? void 0 : raw.state) === 'number' ? raw.state : -1,
|
|
@@ -79685,6 +79916,8 @@ function useSessionOverviewData(ids, enabled) {
|
|
|
79685
79916
|
catalogName: raw === null || raw === void 0 ? void 0 : raw.catalogName,
|
|
79686
79917
|
organizationName: (_raw$organizationName = raw === null || raw === void 0 ? void 0 : raw.organizationName) !== null && _raw$organizationName !== void 0 ? _raw$organizationName : raw === null || raw === void 0 ? void 0 : raw.organization,
|
|
79687
79918
|
rejectMessage: latestRejectMessage(raw === null || raw === void 0 ? void 0 : raw.stateHistory),
|
|
79919
|
+
errorMessage: errorEntry === null || errorEntry === void 0 ? void 0 : errorEntry.message,
|
|
79920
|
+
errorMessageCode: errorEntry === null || errorEntry === void 0 ? void 0 : errorEntry.messageCode,
|
|
79688
79921
|
preview: {
|
|
79689
79922
|
url: (_raw$realTimeRenderUr = raw === null || raw === void 0 ? void 0 : raw.realTimeRenderUrl) !== null && _raw$realTimeRenderUr !== void 0 ? _raw$realTimeRenderUr : null,
|
|
79690
79923
|
mediaType: 'PCT',
|