@crystaldesign/diva-backoffice 26.14.0-beta.14 → 26.14.0-beta.15

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.
@@ -38153,6 +38153,78 @@ function _isIdmCatalogPublished() {
38153
38153
  return _isIdmCatalogPublished.apply(this, arguments);
38154
38154
  }
38155
38155
 
38156
+ /** One update of a bulk request: the record id and the JSON patch the grid sends for it. */
38157
+
38158
+ /** A changed key of one update row: the column and its new value. */
38159
+
38160
+ /** The JSON patch path of a column field (`a.b` → `/a/b`). */
38161
+ var patchPath = function patchPath(field) {
38162
+ return "/".concat(field.split('.').join('/'));
38163
+ };
38164
+
38165
+ /** The keys an update row changes: a patch operation on a key column or below it. */
38166
+ var changedKeys = function changedKeys(row, keyFields) {
38167
+ return keyFields.flatMap(function (field) {
38168
+ var _row$patch;
38169
+ var path = patchPath(field);
38170
+ var operation = (_row$patch = row.patch) === null || _row$patch === void 0 ? void 0 : _row$patch.find(function (candidate) {
38171
+ return candidate.path === path || candidate.path.startsWith("".concat(path, "/"));
38172
+ });
38173
+ return operation ? [{
38174
+ field: field,
38175
+ value: operation.value
38176
+ }] : [];
38177
+ });
38178
+ };
38179
+
38180
+ /**
38181
+ * A key change in a published IDM catalog is asked before it is written: baskets and products saved with the old key
38182
+ * cannot find it any more, whether or not anything in the catalog still references it. The bulk request then asks the
38183
+ * server to refuse every key change (`confirmKeyChanges`), so the one in-use dialog shows the warning together with the
38184
+ * places, if any, and its confirmation writes the change.
38185
+ */
38186
+ function createPublishedKeyChangeCheck(deps) {
38187
+ return /*#__PURE__*/function () {
38188
+ var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(request) {
38189
+ var _request$update;
38190
+ var changesKey;
38191
+ return _regeneratorRuntime.wrap(function _callee$(_context) {
38192
+ while (1) switch (_context.prev = _context.next) {
38193
+ case 0:
38194
+ changesKey = ((_request$update = request.update) !== null && _request$update !== void 0 ? _request$update : []).some(function (row) {
38195
+ return changedKeys(row, deps.keyFields).length > 0;
38196
+ });
38197
+ _context.t0 = !changesKey || deps.isAgentWrite();
38198
+ if (_context.t0) {
38199
+ _context.next = 6;
38200
+ break;
38201
+ }
38202
+ _context.next = 5;
38203
+ return deps.catalogPublished();
38204
+ case 5:
38205
+ _context.t0 = !_context.sent;
38206
+ case 6:
38207
+ if (!_context.t0) {
38208
+ _context.next = 8;
38209
+ break;
38210
+ }
38211
+ return _context.abrupt("return", undefined);
38212
+ case 8:
38213
+ return _context.abrupt("return", {
38214
+ confirmKeyChanges: 'true'
38215
+ });
38216
+ case 9:
38217
+ case "end":
38218
+ return _context.stop();
38219
+ }
38220
+ }, _callee);
38221
+ }));
38222
+ return function (_x) {
38223
+ return _ref.apply(this, arguments);
38224
+ };
38225
+ }();
38226
+ }
38227
+
38156
38228
  function ownKeys$1P(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; }
38157
38229
  function _objectSpread$1P(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$1P(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1P(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
38158
38230
  /** The warning for a key change in a published catalog: baskets and products saved with the old key cannot find it any more. */
@@ -38165,10 +38237,10 @@ var publishedCatalogKeyChangeWarning = function publishedCatalogKeyChangeWarning
38165
38237
  /**
38166
38238
  * The change of a key other records address a record by (a feature number, an option key) while it is still used: the
38167
38239
  * server refuses it with `<ENTITY>_IN_USE` and the places, confirmed with `?updateReferences=true` it changes them too.
38168
- * Every table with the in-use review gets it; `catalogPublished` adds the warning for a published catalog, unless every
38169
- * refused row was confirmed with it before it was sent (`warnedBefore`).
38240
+ * Every table with the in-use review gets it. In a published catalog (`catalogPublished`) the server refuses every key
38241
+ * change, also an unused one (see `createPublishedKeyChangeCheck`), and this one dialog carries the warning.
38170
38242
  */
38171
- var referencedKeyChangeConfirmation = function referencedKeyChangeConfirmation(t, inUse, catalogPublished, warnedBefore) {
38243
+ var referencedKeyChangeConfirmation = function referencedKeyChangeConfirmation(t, inUse, catalogPublished) {
38172
38244
  var _inUse$usageTypeLabel;
38173
38245
  return {
38174
38246
  errorCode: /_IN_USE$/,
@@ -38186,44 +38258,36 @@ var referencedKeyChangeConfirmation = function referencedKeyChangeConfirmation(t
38186
38258
  question: t('backoffice.inUse.keyChange.question', {
38187
38259
  defaultValue: 'Die Änderung wird an allen diesen Stellen übernommen.'
38188
38260
  }),
38189
- warning: catalogPublished && (/*#__PURE__*/function () {
38190
- var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(rows) {
38191
- return _regeneratorRuntime.wrap(function _callee$(_context) {
38192
- while (1) switch (_context.prev = _context.next) {
38193
- case 0:
38194
- _context.t0 = !rows.every(function (row) {
38195
- return warnedBefore === null || warnedBefore === void 0 ? void 0 : warnedBefore(row);
38196
- });
38197
- if (!_context.t0) {
38198
- _context.next = 5;
38199
- break;
38200
- }
38201
- _context.next = 4;
38202
- return catalogPublished();
38203
- case 4:
38204
- _context.t0 = _context.sent;
38205
- case 5:
38206
- if (!_context.t0) {
38207
- _context.next = 9;
38208
- break;
38209
- }
38210
- _context.t1 = publishedCatalogKeyChangeWarning(t);
38211
- _context.next = 10;
38261
+ warning: catalogPublished && /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
38262
+ return _regeneratorRuntime.wrap(function _callee$(_context) {
38263
+ while (1) switch (_context.prev = _context.next) {
38264
+ case 0:
38265
+ _context.next = 2;
38266
+ return catalogPublished();
38267
+ case 2:
38268
+ if (!_context.sent) {
38269
+ _context.next = 6;
38212
38270
  break;
38213
- case 9:
38214
- _context.t1 = undefined;
38215
- case 10:
38216
- return _context.abrupt("return", _context.t1);
38217
- case 11:
38218
- case "end":
38219
- return _context.stop();
38220
- }
38221
- }, _callee);
38222
- }));
38223
- return function (_x) {
38224
- return _ref.apply(this, arguments);
38225
- };
38226
- }()),
38271
+ }
38272
+ _context.t0 = publishedCatalogKeyChangeWarning(t);
38273
+ _context.next = 7;
38274
+ break;
38275
+ case 6:
38276
+ _context.t0 = undefined;
38277
+ case 7:
38278
+ return _context.abrupt("return", _context.t0);
38279
+ case 8:
38280
+ case "end":
38281
+ return _context.stop();
38282
+ }
38283
+ }, _callee);
38284
+ })),
38285
+ warningTitle: t('backoffice.inUse.keyChange.publishedTitle', {
38286
+ defaultValue: 'Schlüssel geändert'
38287
+ }),
38288
+ warningOkText: t('backoffice.inUse.keyChange.publishedConfirm', {
38289
+ defaultValue: 'Trotzdem ändern'
38290
+ }),
38227
38291
  okText: t('backoffice.inUse.keyChange.confirm', {
38228
38292
  defaultValue: 'Überall ändern'
38229
38293
  }),
@@ -38252,7 +38316,7 @@ function createUpdateConfirmationReview(deps) {
38252
38316
  return /*#__PURE__*/function () {
38253
38317
  var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(response, request) {
38254
38318
  var _response$errors$upda, _response$errors;
38255
- var updateErrors, matches, isRefused, refused, entries, refusedRows, agentWrite, placesOf, confirmed, _options$agentConfirm, _options$agentConfirm2, _options$warning, _options$agentHint, warning, _options$warning2, _warning, retryErrors, _retry$errors$update, _retry$errors, retry, ownErrors, text;
38319
+ var updateErrors, matches, isRefused, refused, entries, refusedRows, agentWrite, placesOf, confirmed, _options$agentConfirm, _options$agentConfirm2, _options$warning, _options$agentHint, warning, _options$warning2, _warning, used, retryErrors, _retry$errors$update, _retry$errors, retry, ownErrors, text;
38256
38320
  return _regeneratorRuntime.wrap(function _callee2$(_context2) {
38257
38321
  while (1) switch (_context2.prev = _context2.next) {
38258
38322
  case 0:
@@ -38271,12 +38335,14 @@ function createUpdateConfirmationReview(deps) {
38271
38335
  return _context2.abrupt("return", response);
38272
38336
  case 6:
38273
38337
  entries = refused.map(function (error) {
38274
- var _error$usages, _request$update$error, _request$update, _error$usageCount;
38338
+ var _error$usages, _request$update$error, _request$update, _deps$newKey, _request$update2, _error$usageCount;
38275
38339
  var usages = (_error$usages = error.usages) !== null && _error$usages !== void 0 ? _error$usages : [];
38276
38340
  var id = String((_request$update$error = request === null || request === void 0 || (_request$update = request.update) === null || _request$update === void 0 || (_request$update = _request$update[error.index]) === null || _request$update === void 0 ? void 0 : _request$update._id) !== null && _request$update$error !== void 0 ? _request$update$error : '');
38341
+ var name = deps.rowLabel(id, error.key);
38342
+ var newKey = (_deps$newKey = deps.newKey) === null || _deps$newKey === void 0 ? void 0 : _deps$newKey.call(deps, request === null || request === void 0 || (_request$update2 = request.update) === null || _request$update2 === void 0 ? void 0 : _request$update2[error.index]);
38277
38343
  return {
38278
38344
  error: error,
38279
- name: deps.rowLabel(id, error.key),
38345
+ name: newKey ? "".concat(name, " \u2192 ").concat(newKey) : name,
38280
38346
  count: (_error$usageCount = error.usageCount) !== null && _error$usageCount !== void 0 ? _error$usageCount : usages.length,
38281
38347
  usages: usages,
38282
38348
  places: usages.map(function (usage) {
@@ -38286,8 +38352,8 @@ function createUpdateConfirmationReview(deps) {
38286
38352
  };
38287
38353
  });
38288
38354
  refusedRows = refused.map(function (error) {
38289
- var _request$update2;
38290
- return request === null || request === void 0 || (_request$update2 = request.update) === null || _request$update2 === void 0 ? void 0 : _request$update2[error.index];
38355
+ var _request$update3;
38356
+ return request === null || request === void 0 || (_request$update3 = request.update) === null || _request$update3 === void 0 ? void 0 : _request$update3[error.index];
38291
38357
  });
38292
38358
  agentWrite = deps.agentWrite();
38293
38359
  placesOf = function placesOf(entry) {
@@ -38309,19 +38375,33 @@ function createUpdateConfirmationReview(deps) {
38309
38375
  warning = _context2.sent;
38310
38376
  agentWrite.notes.push("Not changed: ".concat(entries.map(placesOf).join('; '), ". ").concat((_options$agentHint = options.agentHint) !== null && _options$agentHint !== void 0 ? _options$agentHint : 'Only the user can confirm this change, in the table: report the places to them.').concat(warning ? " Tell the user this warning together with the places, before they agree: \"".concat(warning, "\"") : ''));
38311
38377
  case 18:
38312
- _context2.next = 26;
38378
+ _context2.next = 27;
38313
38379
  break;
38314
38380
  case 20:
38315
38381
  _context2.next = 22;
38316
38382
  return (_options$warning2 = options.warning) === null || _options$warning2 === void 0 ? void 0 : _options$warning2.call(options, refusedRows);
38317
38383
  case 22:
38318
38384
  _warning = _context2.sent;
38319
- _context2.next = 25;
38385
+ // A key change nothing references is refused only to show the warning: it has no places to list
38386
+ used = entries.filter(function (entry) {
38387
+ return entry.count > 0;
38388
+ });
38389
+ _context2.next = 26;
38320
38390
  return modal.confirm({
38321
- title: options.title,
38391
+ title: _warning && options.warningTitle || options.title,
38322
38392
  width: 560,
38323
38393
  content: /*#__PURE__*/jsxs(Fragment, {
38324
- children: [entries.map(function (entry) {
38394
+ children: [_warning && /*#__PURE__*/jsx("p", {
38395
+ children: _warning
38396
+ }), entries.filter(function (entry) {
38397
+ return entry.count === 0;
38398
+ }).map(function (entry) {
38399
+ return /*#__PURE__*/jsx("div", {
38400
+ children: /*#__PURE__*/jsx("strong", {
38401
+ children: entry.name
38402
+ })
38403
+ }, entry.name);
38404
+ }), used.map(function (entry) {
38325
38405
  return /*#__PURE__*/jsxs("div", {
38326
38406
  children: [/*#__PURE__*/jsx("strong", {
38327
38407
  children: options.entry(entry.name, entry.count)
@@ -38343,31 +38423,29 @@ function createUpdateConfirmationReview(deps) {
38343
38423
  })]
38344
38424
  })]
38345
38425
  }, entry.name);
38346
- }), /*#__PURE__*/jsx("p", {
38426
+ }), used.length > 0 && /*#__PURE__*/jsx("p", {
38347
38427
  children: options.question
38348
- }), _warning && /*#__PURE__*/jsx("p", {
38349
- children: _warning
38350
38428
  })]
38351
38429
  }),
38352
- okText: options.okText,
38430
+ okText: _warning && options.warningOkText || options.okText,
38353
38431
  cancelText: t('backoffice.inUse.cancel', {
38354
38432
  defaultValue: 'Abbrechen'
38355
38433
  })
38356
38434
  });
38357
- case 25:
38358
- confirmed = _context2.sent;
38359
38435
  case 26:
38436
+ confirmed = _context2.sent;
38437
+ case 27:
38360
38438
  retryErrors = new Map();
38361
38439
  if (!confirmed) {
38362
- _context2.next = 41;
38440
+ _context2.next = 42;
38363
38441
  break;
38364
38442
  }
38365
- _context2.prev = 28;
38366
- _context2.next = 31;
38443
+ _context2.prev = 29;
38444
+ _context2.next = 32;
38367
38445
  return deps.sendConfirmed(refused.map(function (error) {
38368
38446
  return request.update[error.index];
38369
38447
  }));
38370
- case 31:
38448
+ case 32:
38371
38449
  retry = _context2.sent;
38372
38450
  ownErrors = (_retry$errors$update = retry === null || retry === void 0 || (_retry$errors = retry.errors) === null || _retry$errors === void 0 ? void 0 : _retry$errors.update) !== null && _retry$errors$update !== void 0 ? _retry$errors$update : [];
38373
38451
  refused.forEach(function (error, i) {
@@ -38387,11 +38465,11 @@ function createUpdateConfirmationReview(deps) {
38387
38465
  })
38388
38466
  });
38389
38467
  });
38390
- _context2.next = 40;
38468
+ _context2.next = 41;
38391
38469
  break;
38392
- case 36:
38393
- _context2.prev = 36;
38394
- _context2.t0 = _context2["catch"](28);
38470
+ case 37:
38471
+ _context2.prev = 37;
38472
+ _context2.t0 = _context2["catch"](29);
38395
38473
  text = _context2.t0 instanceof Error ? _context2.t0.message : String(_context2.t0);
38396
38474
  refused.forEach(function (error) {
38397
38475
  return retryErrors.set(error, {
@@ -38400,14 +38478,14 @@ function createUpdateConfirmationReview(deps) {
38400
38478
  error: text
38401
38479
  });
38402
38480
  });
38403
- case 40:
38481
+ case 41:
38404
38482
  // The agent hears what the confirmed retry did, not what it asked for
38405
38483
  entries.forEach(function (entry) {
38406
38484
  var _retryError$error;
38407
38485
  var retryError = retryErrors.get(entry.error);
38408
38486
  agentWrite === null || agentWrite === void 0 || agentWrite.notes.push(retryError ? "Not changed: ".concat(placesOf(entry), " - ").concat((_retryError$error = retryError.error) !== null && _retryError$error !== void 0 ? _retryError$error : "status ".concat(retryError.statusCode), ".") : "Changed together with every place that uses it: ".concat(placesOf(entry), "."));
38409
38487
  });
38410
- case 41:
38488
+ case 42:
38411
38489
  return _context2.abrupt("return", _objectSpread$1P(_objectSpread$1P({}, response), {}, {
38412
38490
  errors: _objectSpread$1P(_objectSpread$1P({}, response.errors), {}, {
38413
38491
  update: updateErrors.map(function (error) {
@@ -38423,13 +38501,13 @@ function createUpdateConfirmationReview(deps) {
38423
38501
  })
38424
38502
  })
38425
38503
  }));
38426
- case 42:
38504
+ case 43:
38427
38505
  case "end":
38428
38506
  return _context2.stop();
38429
38507
  }
38430
- }, _callee2, null, [[28, 36]]);
38508
+ }, _callee2, null, [[29, 37]]);
38431
38509
  }));
38432
- return function (_x2, _x3) {
38510
+ return function (_x, _x2) {
38433
38511
  return _ref2.apply(this, arguments);
38434
38512
  };
38435
38513
  }();
@@ -38484,152 +38562,12 @@ function createConfirmedUpdater(params) {
38484
38562
  }
38485
38563
  }, _callee3);
38486
38564
  }));
38487
- return function (_x4) {
38565
+ return function (_x3) {
38488
38566
  return _ref4.apply(this, arguments);
38489
38567
  };
38490
38568
  }();
38491
38569
  }
38492
38570
 
38493
- /** A field of a row by its dotted path. */
38494
- var valueAt = function valueAt(data, field) {
38495
- return field.split('.').reduce(function (value, key) {
38496
- return value === null || value === void 0 ? void 0 : value[key];
38497
- }, data);
38498
- };
38499
- /** The JSON patch path of a column field (`a.b` → `/a/b`). */
38500
- var patchPath = function patchPath(field) {
38501
- return "/".concat(field.split('.').join('/'));
38502
- };
38503
-
38504
- /** The keys an update row changes: a patch operation on a key column or below it. */
38505
- var changedKeys = function changedKeys(row, keyFields) {
38506
- return keyFields.flatMap(function (field) {
38507
- var _row$patch;
38508
- var path = patchPath(field);
38509
- var operation = (_row$patch = row.patch) === null || _row$patch === void 0 ? void 0 : _row$patch.find(function (candidate) {
38510
- return candidate.path === path || candidate.path.startsWith("".concat(path, "/"));
38511
- });
38512
- return operation ? [{
38513
- field: field,
38514
- value: operation.value
38515
- }] : [];
38516
- });
38517
- };
38518
-
38519
- /** Identifies an update row across a retry, which prepares the same patch anew. */
38520
- var rowSignature = function rowSignature(row) {
38521
- var _row$_id, _row$patch2;
38522
- return "".concat((_row$_id = row._id) !== null && _row$_id !== void 0 ? _row$_id : '', "|").concat(JSON.stringify((_row$patch2 = row.patch) !== null && _row$patch2 !== void 0 ? _row$patch2 : []));
38523
- };
38524
-
38525
- /**
38526
- * A key change in a published IDM catalog is asked before it is sent: baskets and products saved with the old key cannot
38527
- * find it any more, whether or not anything in the catalog still references it. Returns the bulk request review (the
38528
- * positions the user did not confirm, held back) and whether an update row was confirmed with that warning already, so
38529
- * the in-use dialog that may follow does not ask about it twice.
38530
- */
38531
- function createPublishedKeyChangeReview(deps) {
38532
- var confirmed = new Set();
38533
-
38534
- /** `originals`: the grid's data of each update row before the edit, at the positions of `request.update`. */
38535
- var review = /*#__PURE__*/function () {
38536
- var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(request) {
38537
- var _request$update;
38538
- var originals,
38539
- keyRows,
38540
- ok,
38541
- _args = arguments;
38542
- return _regeneratorRuntime.wrap(function _callee$(_context) {
38543
- while (1) switch (_context.prev = _context.next) {
38544
- case 0:
38545
- originals = _args.length > 1 && _args[1] !== undefined ? _args[1] : [];
38546
- keyRows = ((_request$update = request.update) !== null && _request$update !== void 0 ? _request$update : []).map(function (row, index) {
38547
- return {
38548
- row: row,
38549
- index: index,
38550
- keys: changedKeys(row, deps.keyFields)
38551
- };
38552
- }).filter(function (entry) {
38553
- return entry.keys.length && !confirmed.has(rowSignature(entry.row));
38554
- });
38555
- _context.t0 = !keyRows.length || deps.isAgentWrite();
38556
- if (_context.t0) {
38557
- _context.next = 7;
38558
- break;
38559
- }
38560
- _context.next = 6;
38561
- return deps.catalogPublished();
38562
- case 6:
38563
- _context.t0 = !_context.sent;
38564
- case 7:
38565
- if (!_context.t0) {
38566
- _context.next = 9;
38567
- break;
38568
- }
38569
- return _context.abrupt("return", []);
38570
- case 9:
38571
- _context.next = 11;
38572
- return deps.modal.confirm({
38573
- title: deps.t('backoffice.inUse.keyChange.publishedTitle', {
38574
- defaultValue: 'Schlüssel geändert'
38575
- }),
38576
- width: 560,
38577
- content: /*#__PURE__*/jsxs(Fragment, {
38578
- children: [/*#__PURE__*/jsx("p", {
38579
- children: publishedCatalogKeyChangeWarning(deps.t)
38580
- }), /*#__PURE__*/jsx("ul", {
38581
- children: keyRows.map(function (_ref2) {
38582
- var row = _ref2.row,
38583
- index = _ref2.index,
38584
- keys = _ref2.keys;
38585
- return /*#__PURE__*/jsx("li", {
38586
- children: keys.map(function (key) {
38587
- var _ref3, _valueAt, _key$value;
38588
- return "".concat(String((_ref3 = (_valueAt = valueAt(originals[index], key.field)) !== null && _valueAt !== void 0 ? _valueAt : row._id) !== null && _ref3 !== void 0 ? _ref3 : ''), " \u2192 ").concat(String((_key$value = key.value) !== null && _key$value !== void 0 ? _key$value : ''));
38589
- }).join(', ')
38590
- }, index);
38591
- })
38592
- })]
38593
- }),
38594
- okText: deps.t('backoffice.inUse.keyChange.publishedConfirm', {
38595
- defaultValue: 'Trotzdem ändern'
38596
- }),
38597
- cancelText: deps.t('backoffice.inUse.cancel', {
38598
- defaultValue: 'Abbrechen'
38599
- })
38600
- });
38601
- case 11:
38602
- ok = _context.sent;
38603
- if (ok) {
38604
- _context.next = 14;
38605
- break;
38606
- }
38607
- return _context.abrupt("return", keyRows.map(function (entry) {
38608
- return entry.index;
38609
- }));
38610
- case 14:
38611
- keyRows.forEach(function (entry) {
38612
- return confirmed.add(rowSignature(entry.row));
38613
- });
38614
- return _context.abrupt("return", []);
38615
- case 16:
38616
- case "end":
38617
- return _context.stop();
38618
- }
38619
- }, _callee);
38620
- }));
38621
- return function review(_x) {
38622
- return _ref.apply(this, arguments);
38623
- };
38624
- }();
38625
- return {
38626
- review: review,
38627
- wasConfirmed: function wasConfirmed(row) {
38628
- return confirmed.has(rowSignature(row));
38629
- }
38630
- };
38631
- }
38632
-
38633
38571
  var _excluded$d = ["toolbarToolId", "agentBoundParent"];
38634
38572
  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; } } }; }
38635
38573
  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; } }
@@ -38644,7 +38582,7 @@ function _objectSpread$1O(e) { for (var r = 1; r < arguments.length; r++) { var
38644
38582
  * @returns JSX element representing the spreadsheet wrapper
38645
38583
  */
38646
38584
  var SpreadsheetWrapper = /*#__PURE__*/forwardRef(function SpreadsheetWrapper(_ref, ref) {
38647
- var _props$configuration$, _props$configuration, _props$configuration2, _props$applicationDat, _props$configuration3, _props$configuration$2, _props$configuration4, _publishedKeyChangeRe, _props$configuration$3, _read$list, _ref2, _props$configuration$4, _props$configuration5, _props$configuration6, _root$contentStore$bo, _root$contentStore$ri;
38585
+ var _props$configuration$, _props$configuration, _props$configuration2, _props$applicationDat, _props$configuration3, _props$configuration$2, _props$configuration4, _props$configuration$3, _read$list, _ref2, _props$configuration$4, _props$configuration5, _props$configuration6, _root$contentStore$bo, _root$contentStore$ri;
38648
38586
  var toolbarToolId = _ref.toolbarToolId,
38649
38587
  agentBoundParent = _ref.agentBoundParent,
38650
38588
  props = _objectWithoutProperties(_ref, _excluded$d);
@@ -38716,7 +38654,7 @@ var SpreadsheetWrapper = /*#__PURE__*/forwardRef(function SpreadsheetWrapper(_re
38716
38654
  // An IDM catalog table: a key change there can break the baskets and products of a published catalog
38717
38655
  var catalogIdRef = useRef();
38718
38656
  catalogIdRef.current = typeof ((_props$applicationDat = props.applicationData) === null || _props$applicationDat === void 0 ? void 0 : _props$applicationDat.catalogId) === 'string' ? props.applicationData.catalogId : undefined;
38719
- var _catalogPublished = function catalogPublished() {
38657
+ var catalogPublished = function catalogPublished() {
38720
38658
  var catalogId = catalogIdRef.current;
38721
38659
  if (!catalogId) return Promise.resolve(false);
38722
38660
  return isIdmCatalogPublished({
@@ -38729,24 +38667,20 @@ var SpreadsheetWrapper = /*#__PURE__*/forwardRef(function SpreadsheetWrapper(_re
38729
38667
  }
38730
38668
  });
38731
38669
  };
38732
- // A key change in a published catalog is asked before it is sent; the review keeps what was confirmed, so it lives as long as the table
38670
+ // A key change in a published catalog is refused by the server until confirmed, also an unused one
38733
38671
  var keyFields = (_props$configuration3 = props.configuration) === null || _props$configuration3 === void 0 ? void 0 : _props$configuration3.keyFields;
38734
38672
  var publishedKeyChangeRef = useRef();
38735
- if (keyFields !== null && keyFields !== void 0 && keyFields.length && !publishedKeyChangeRef.current) publishedKeyChangeRef.current = createPublishedKeyChangeReview({
38673
+ if (keyFields !== null && keyFields !== void 0 && keyFields.length && !publishedKeyChangeRef.current) publishedKeyChangeRef.current = createPublishedKeyChangeCheck({
38736
38674
  keyFields: keyFields,
38737
- catalogPublished: function catalogPublished() {
38738
- return catalogIdRef.current ? _catalogPublished() : Promise.resolve(false);
38739
- },
38675
+ catalogPublished: catalogPublished,
38740
38676
  isAgentWrite: function isAgentWrite() {
38741
38677
  return !!root.gridRegistry.agentWriteTo(handleRef.current);
38742
- },
38743
- t: t,
38744
- modal: modal
38678
+ }
38745
38679
  });
38746
38680
  var updateConfirmationRef = useRef([]);
38747
38681
  var bulkTemplate = removeTemplates === null || removeTemplates === void 0 ? void 0 : removeTemplates.bulk;
38748
38682
  // the table's own confirmations first: the in-use one answers only the rows they left
38749
- var updateConfirmations = [].concat(_toConsumableArray([(_props$configuration$2 = (_props$configuration4 = props.configuration) === null || _props$configuration4 === void 0 ? void 0 : _props$configuration4.updateConfirmation) !== null && _props$configuration$2 !== void 0 ? _props$configuration$2 : []].flat()), _toConsumableArray(inUseOption ? [referencedKeyChangeConfirmation(t, inUseOption === true ? undefined : inUseOption, catalogIdRef.current ? _catalogPublished : undefined, (_publishedKeyChangeRe = publishedKeyChangeRef.current) === null || _publishedKeyChangeRe === void 0 ? void 0 : _publishedKeyChangeRe.wasConfirmed)] : []));
38683
+ var updateConfirmations = [].concat(_toConsumableArray([(_props$configuration$2 = (_props$configuration4 = props.configuration) === null || _props$configuration4 === void 0 ? void 0 : _props$configuration4.updateConfirmation) !== null && _props$configuration$2 !== void 0 ? _props$configuration$2 : []].flat()), _toConsumableArray(inUseOption ? [referencedKeyChangeConfirmation(t, inUseOption === true ? undefined : inUseOption, catalogIdRef.current ? catalogPublished : undefined)] : []));
38750
38684
  updateConfirmationRef.current = updateConfirmations.length && bulkTemplate ? updateConfirmations.map(function (options) {
38751
38685
  return createUpdateConfirmationReview({
38752
38686
  options: options,
@@ -38758,6 +38692,12 @@ var SpreadsheetWrapper = /*#__PURE__*/forwardRef(function SpreadsheetWrapper(_re
38758
38692
  rowLabel: function rowLabel(id, key) {
38759
38693
  return key !== null && key !== void 0 ? key : id;
38760
38694
  },
38695
+ newKey: function newKey(row) {
38696
+ return changedKeys(row, keyFields !== null && keyFields !== void 0 ? keyFields : []).map(function (change) {
38697
+ var _change$value;
38698
+ return String((_change$value = change.value) !== null && _change$value !== void 0 ? _change$value : '');
38699
+ }).join(', ') || undefined;
38700
+ },
38761
38701
  sendConfirmed: createConfirmedUpdater({
38762
38702
  bulk: bulkTemplate,
38763
38703
  confirmParam: options.confirmParam,
@@ -38775,78 +38715,34 @@ var SpreadsheetWrapper = /*#__PURE__*/forwardRef(function SpreadsheetWrapper(_re
38775
38715
  if (!(viewConfiguration !== null && viewConfiguration !== void 0 && viewConfiguration.inUseReview) && !(viewConfiguration !== null && viewConfiguration !== void 0 && viewConfiguration.updateConfirmation) && !(viewConfiguration !== null && viewConfiguration !== void 0 && (_viewConfiguration$ke = viewConfiguration.keyFields) !== null && _viewConfiguration$ke !== void 0 && _viewConfiguration$ke.length) || !('apiInterface' in viewConfiguration)) return viewConfiguration;
38776
38716
  if (!((_viewConfiguration$ap = viewConfiguration.apiInterface) !== null && _viewConfiguration$ap !== void 0 && _viewConfiguration$ap.bulk) && !((_viewConfiguration$ap2 = viewConfiguration.apiInterface) !== null && _viewConfiguration$ap2 !== void 0 && _viewConfiguration$ap2["delete"])) return viewConfiguration;
38777
38717
  var ownReview = viewConfiguration.apiInterface.reviewBulkResponse;
38778
- var ownRequestReview = viewConfiguration.apiInterface.reviewBulkRequest;
38779
38718
  return _objectSpread$1O(_objectSpread$1O({}, viewConfiguration), {}, {
38780
38719
  apiInterface: _objectSpread$1O(_objectSpread$1O({}, viewConfiguration.apiInterface), {}, {
38781
- reviewBulkRequest: function () {
38782
- var _reviewBulkRequest = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(request, originals) {
38783
- var _yield$ownRequestRevi, _request$update;
38784
- var heldBack, keyChanges, asked;
38720
+ bulkQueryParams: function () {
38721
+ var _bulkQueryParams = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(request) {
38722
+ var _viewConfiguration$ap3, _viewConfiguration$ap4, _publishedKeyChangeRe;
38723
+ var ownParams, keyChangeParams;
38785
38724
  return _regeneratorRuntime.wrap(function _callee$(_context) {
38786
38725
  while (1) switch (_context.prev = _context.next) {
38787
38726
  case 0:
38788
- if (!ownRequestReview) {
38789
- _context.next = 15;
38790
- break;
38791
- }
38792
- _context.next = 3;
38793
- return ownRequestReview(request, originals);
38794
- case 3:
38795
- _context.t2 = _yield$ownRequestRevi = _context.sent;
38796
- _context.t1 = _context.t2 !== null;
38797
- if (!_context.t1) {
38798
- _context.next = 7;
38799
- break;
38800
- }
38801
- _context.t1 = _yield$ownRequestRevi !== void 0;
38727
+ _context.next = 2;
38728
+ return (_viewConfiguration$ap3 = (_viewConfiguration$ap4 = viewConfiguration.apiInterface).bulkQueryParams) === null || _viewConfiguration$ap3 === void 0 ? void 0 : _viewConfiguration$ap3.call(_viewConfiguration$ap4, request);
38729
+ case 2:
38730
+ ownParams = _context.sent;
38731
+ _context.next = 5;
38732
+ return (_publishedKeyChangeRe = publishedKeyChangeRef.current) === null || _publishedKeyChangeRe === void 0 ? void 0 : _publishedKeyChangeRe.call(publishedKeyChangeRef, request);
38733
+ case 5:
38734
+ keyChangeParams = _context.sent;
38735
+ return _context.abrupt("return", ownParams || keyChangeParams ? _objectSpread$1O(_objectSpread$1O({}, ownParams), keyChangeParams) : undefined);
38802
38736
  case 7:
38803
- if (!_context.t1) {
38804
- _context.next = 11;
38805
- break;
38806
- }
38807
- _context.t3 = _yield$ownRequestRevi;
38808
- _context.next = 12;
38809
- break;
38810
- case 11:
38811
- _context.t3 = [];
38812
- case 12:
38813
- _context.t0 = _context.t3;
38814
- _context.next = 16;
38815
- break;
38816
- case 15:
38817
- _context.t0 = [];
38818
- case 16:
38819
- heldBack = _context.t0;
38820
- keyChanges = publishedKeyChangeRef.current; // a row the table's own review held back already is not asked about
38821
- if (!keyChanges) {
38822
- _context.next = 24;
38823
- break;
38824
- }
38825
- _context.next = 21;
38826
- return keyChanges.review(_objectSpread$1O(_objectSpread$1O({}, request), {}, {
38827
- update: (_request$update = request.update) === null || _request$update === void 0 ? void 0 : _request$update.map(function (row, index) {
38828
- return heldBack.includes(index) ? {} : row;
38829
- })
38830
- }), originals);
38831
- case 21:
38832
- _context.t4 = _context.sent;
38833
- _context.next = 25;
38834
- break;
38835
- case 24:
38836
- _context.t4 = [];
38837
- case 25:
38838
- asked = _context.t4;
38839
- return _context.abrupt("return", [].concat(_toConsumableArray(heldBack), _toConsumableArray(asked)));
38840
- case 27:
38841
38737
  case "end":
38842
38738
  return _context.stop();
38843
38739
  }
38844
38740
  }, _callee);
38845
38741
  }));
38846
- function reviewBulkRequest(_x, _x2) {
38847
- return _reviewBulkRequest.apply(this, arguments);
38742
+ function bulkQueryParams(_x) {
38743
+ return _bulkQueryParams.apply(this, arguments);
38848
38744
  }
38849
- return reviewBulkRequest;
38745
+ return bulkQueryParams;
38850
38746
  }(),
38851
38747
  reviewBulkResponse: function () {
38852
38748
  var _reviewBulkResponse = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(response, request) {
@@ -38903,7 +38799,7 @@ var SpreadsheetWrapper = /*#__PURE__*/forwardRef(function SpreadsheetWrapper(_re
38903
38799
  }
38904
38800
  }, _callee2, null, [[9, 20, 23, 26]]);
38905
38801
  }));
38906
- function reviewBulkResponse(_x3, _x4) {
38802
+ function reviewBulkResponse(_x2, _x3) {
38907
38803
  return _reviewBulkResponse.apply(this, arguments);
38908
38804
  }
38909
38805
  return reviewBulkResponse;
@@ -38952,7 +38848,7 @@ var SpreadsheetWrapper = /*#__PURE__*/forwardRef(function SpreadsheetWrapper(_re
38952
38848
  return boundParentRef.current;
38953
38849
  }
38954
38850
  } : {}), {}, {
38955
- catalogPublished: _catalogPublished,
38851
+ catalogPublished: catalogPublished,
38956
38852
  keyFields: (_props$configuration7 = props.configuration) === null || _props$configuration7 === void 0 ? void 0 : _props$configuration7.keyFields,
38957
38853
  requestAgentApproval: function requestAgentApproval(changeCount, actionLabel, signal) {
38958
38854
  return new Promise(function (resolve) {
@@ -67739,6 +67635,7 @@ var Features$2 = /*#__PURE__*/forwardRef(function Features(_ref, ref) {
67739
67635
  cellDataType: 'lookup',
67740
67636
  customParams: {
67741
67637
  nameField: 'featureText',
67638
+ keepExistingName: true,
67742
67639
  filterCellType: 'number',
67743
67640
  displayLabelTemplate: '${value}',
67744
67641
  lookupLabelTemplate: '${name} (${value})',
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=publishedKeyChangeCheck.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"publishedKeyChangeCheck.test.d.ts","sourceRoot":"","sources":["../../../../../../../../src/tests/unit/ui/CommonComponents/publishedKeyChangeCheck.test.ts"],"names":[],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/ui/CommonComponents/SpreadsheetWrapper/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAe,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAE/G,OAAO,KAAK,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AACrF,OAAO,KAAwE,MAAM,OAAO,CAAC;AAK7F,OAAO,EAAkD,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAGzG,OAAO,EAIL,yBAAyB,EAC1B,MAAM,4BAA4B,CAAC;AAGpC,gHAAgH;AAEhH,MAAM,MAAM,sBAAsB,CAAC,KAAK,GAAG,GAAG,IAAI,aAAa,CAAC,KAAK,CAAC,GAAG;IACvE,+DAA+D;IAC/D,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,iGAAiG;IACjG,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,wGAAwG;IACxG,YAAY,CAAC,EAAE,eAAe,EAAE,CAAC;IACjC;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,GAAG,kBAAkB,CAAC;IAC3C;;;OAGG;IACH,kBAAkB,CAAC,EAAE,yBAAyB,GAAG,yBAAyB,EAAE,CAAC;IAC7E;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;CACtB,CAAC;;mBAGe,sBAAsB;IACrC,0FAA0F;oBAC1E,MAAM;IACtB,kGAAkG;uBAC/E,gBAAgB;;AAySrC,wBAA4C"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/ui/CommonComponents/SpreadsheetWrapper/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAe,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAE/G,OAAO,KAAK,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AACrF,OAAO,KAAwE,MAAM,OAAO,CAAC;AAK7F,OAAO,EAAkD,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAGzG,OAAO,EAIL,yBAAyB,EAC1B,MAAM,4BAA4B,CAAC;AAGpC,gHAAgH;AAEhH,MAAM,MAAM,sBAAsB,CAAC,KAAK,GAAG,GAAG,IAAI,aAAa,CAAC,KAAK,CAAC,GAAG;IACvE,+DAA+D;IAC/D,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,iGAAiG;IACjG,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,wGAAwG;IACxG,YAAY,CAAC,EAAE,eAAe,EAAE,CAAC;IACjC;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,GAAG,kBAAkB,CAAC;IAC3C;;;OAGG;IACH,kBAAkB,CAAC,EAAE,yBAAyB,GAAG,yBAAyB,EAAE,CAAC;IAC7E;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;CACtB,CAAC;;mBAGe,sBAAsB;IACrC,0FAA0F;oBAC1E,MAAM;IACtB,kGAAkG;uBAC/E,gBAAgB;;AA+RrC,wBAA4C"}
@@ -1,5 +1,3 @@
1
- import type { TFunction } from 'i18next';
2
- import type { HookAPI } from 'antd/es/modal/useModal';
3
1
  /** One update of a bulk request: the record id and the JSON patch the grid sends for it. */
4
2
  interface UpdateRow {
5
3
  _id?: string;
@@ -20,22 +18,17 @@ interface PublishedKeyChangeDeps {
20
18
  catalogPublished: () => Promise<boolean>;
21
19
  /** Set while the agent writes: its approval bar (or the auto-approve hold) has warned already. */
22
20
  isAgentWrite: () => boolean;
23
- t: TFunction;
24
- modal: HookAPI;
25
21
  }
26
22
  /** The keys an update row changes: a patch operation on a key column or below it. */
27
23
  export declare const changedKeys: (row: UpdateRow, keyFields: string[]) => KeyChange[];
28
24
  /**
29
- * A key change in a published IDM catalog is asked before it is sent: baskets and products saved with the old key cannot
30
- * find it any more, whether or not anything in the catalog still references it. Returns the bulk request review (the
31
- * positions the user did not confirm, held back) and whether an update row was confirmed with that warning already, so
32
- * the in-use dialog that may follow does not ask about it twice.
25
+ * A key change in a published IDM catalog is asked before it is written: baskets and products saved with the old key
26
+ * cannot find it any more, whether or not anything in the catalog still references it. The bulk request then asks the
27
+ * server to refuse every key change (`confirmKeyChanges`), so the one in-use dialog shows the warning together with the
28
+ * places, if any, and its confirmation writes the change.
33
29
  */
34
- export declare function createPublishedKeyChangeReview(deps: PublishedKeyChangeDeps): {
35
- review: (request: {
36
- update?: UpdateRow[];
37
- }, originals?: unknown[]) => Promise<number[]>;
38
- wasConfirmed: (row: UpdateRow) => boolean;
39
- };
30
+ export declare function createPublishedKeyChangeCheck(deps: PublishedKeyChangeDeps): (request: {
31
+ update?: UpdateRow[];
32
+ }) => Promise<Record<string, string> | undefined>;
40
33
  export {};
41
- //# sourceMappingURL=publishedKeyChangeReview.d.ts.map
34
+ //# sourceMappingURL=publishedKeyChangeCheck.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"publishedKeyChangeCheck.d.ts","sourceRoot":"","sources":["../../../../../../../src/ui/CommonComponents/SpreadsheetWrapper/publishedKeyChangeCheck.ts"],"names":[],"mappings":"AAAA,4FAA4F;AAC5F,UAAU,SAAS;IACjB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE,EAAE,CAAC;CACzD;AAED,qEAAqE;AACrE,UAAU,SAAS;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,OAAO,CAAC;CAChB;AAED,UAAU,sBAAsB;IAC9B,iHAAiH;IACjH,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,gBAAgB,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;IACzC,kGAAkG;IAClG,YAAY,EAAE,MAAM,OAAO,CAAC;CAC7B;AAKD,qFAAqF;AACrF,eAAO,MAAM,WAAW,QAAS,SAAS,aAAa,MAAM,EAAE,KAAG,SAAS,EAKvE,CAAC;AAEL;;;;;GAKG;AACH,wBAAgB,6BAA6B,CAAC,IAAI,EAAE,sBAAsB,aACjD;IAAE,MAAM,CAAC,EAAE,SAAS,EAAE,CAAA;CAAE,KAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,CAAC,CAK9F"}
@@ -17,8 +17,11 @@ export interface UpdateConfirmationOptions {
17
17
  entry: (name: string, count: number) => string;
18
18
  /** What confirming does, under the places. */
19
19
  question: string;
20
- /** A warning under the question for the refused update rows, looked up when the dialog opens; none when it resolves to nothing. */
20
+ /** A warning for the refused update rows, looked up when the dialog opens; none when it resolves to nothing. */
21
21
  warning?: (rows: unknown[]) => Promise<string | undefined>;
22
+ /** Title and confirm button while the warning shows; default: `title` and `okText`. */
23
+ warningTitle?: string;
24
+ warningOkText?: string;
22
25
  okText: string;
23
26
  /** Groups the places under a heading per kind; without it they are one list. */
24
27
  usageTypeLabel?: (type: string) => string;
@@ -34,10 +37,10 @@ export declare const publishedCatalogKeyChangeWarning: (t: TFunction) => string;
34
37
  /**
35
38
  * The change of a key other records address a record by (a feature number, an option key) while it is still used: the
36
39
  * server refuses it with `<ENTITY>_IN_USE` and the places, confirmed with `?updateReferences=true` it changes them too.
37
- * Every table with the in-use review gets it; `catalogPublished` adds the warning for a published catalog, unless every
38
- * refused row was confirmed with it before it was sent (`warnedBefore`).
40
+ * Every table with the in-use review gets it. In a published catalog (`catalogPublished`) the server refuses every key
41
+ * change, also an unused one (see `createPublishedKeyChangeCheck`), and this one dialog carries the warning.
39
42
  */
40
- export declare const referencedKeyChangeConfirmation: (t: TFunction, inUse?: InUseReviewOptions, catalogPublished?: () => Promise<boolean>, warnedBefore?: (row: any) => boolean) => UpdateConfirmationOptions;
43
+ export declare const referencedKeyChangeConfirmation: (t: TFunction, inUse?: InUseReviewOptions, catalogPublished?: () => Promise<boolean>) => UpdateConfirmationOptions;
41
44
  export interface UpdateConfirmationDeps {
42
45
  options: UpdateConfirmationOptions;
43
46
  t: TFunction;
@@ -46,6 +49,8 @@ export interface UpdateConfirmationDeps {
46
49
  agentWrite: () => AgentWriteScope | undefined;
47
50
  /** The record's name: by its id, else the key the server names it by. */
48
51
  rowLabel: (id: string, key?: string) => string;
52
+ /** The new key an update row sets, shown after the record's name; none when the row changes no key. */
53
+ newKey?: (row: unknown) => string | undefined;
49
54
  /** Sends updates (`{ _id, patch }`) again, confirmed; answers in the bulk shape. */
50
55
  sendConfirmed: (updates: unknown[]) => Promise<any>;
51
56
  }
@@ -1 +1 @@
1
- {"version":3,"file":"updateConfirmationReview.d.ts","sourceRoot":"","sources":["../../../../../../../src/ui/CommonComponents/SpreadsheetWrapper/updateConfirmationReview.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,EAAyB,kBAAkB,EAAE,UAAU,EAAgC,MAAM,qBAAqB,CAAC;AAG1H;;;;GAIG;AACH,MAAM,WAAW,yBAAyB;IACxC,8EAA8E;IAC9E,SAAS,EAAE,MAAM,GAAG,MAAM,CAAC;IAC3B,4CAA4C;IAC5C,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,+EAA+E;IAC/E,KAAK,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;IAC/C,8CAA8C;IAC9C,QAAQ,EAAE,MAAM,CAAC;IACjB,mIAAmI;IACnI,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;IAC3D,MAAM,EAAE,MAAM,CAAC;IACf,gFAAgF;IAChF,cAAc,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC;IAC1C,+CAA+C;IAC/C,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,MAAM,CAAC;IAC3C,2GAA2G;IAC3G,aAAa,CAAC,EAAE,CAAC,UAAU,EAAE,eAAe,KAAK,OAAO,CAAC;IACzD,8DAA8D;IAC9D,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,gIAAgI;AAChI,eAAO,MAAM,gCAAgC,MAAO,SAAS,WAIzD,CAAC;AAEL;;;;;GAKG;AACH,eAAO,MAAM,+BAA+B,MACvC,SAAS,UACJ,kBAAkB,qBACP,MAAM,OAAO,CAAC,OAAO,CAAC,iBAC1B,CAAC,GAAG,EAAE,GAAG,KAAK,OAAO,KACnC,yBAeD,CAAC;AAoBH,MAAM,WAAW,sBAAsB;IACrC,OAAO,EAAE,yBAAyB,CAAC;IACnC,CAAC,EAAE,SAAS,CAAC;IACb,KAAK,EAAE,OAAO,CAAC;IACf,qEAAqE;IACrE,UAAU,EAAE,MAAM,eAAe,GAAG,SAAS,CAAC;IAC9C,yEAAyE;IACzE,QAAQ,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC;IAC/C,oFAAoF;IACpF,aAAa,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,OAAO,CAAC,GAAG,CAAC,CAAC;CACrD;AAED;;;GAGG;AACH,wBAAgB,8BAA8B,CAAC,IAAI,EAAE,sBAAsB,GAAG,CAAC,QAAQ,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,KAAK,OAAO,CAAC,GAAG,CAAC,CAoH1H;AAED,uFAAuF;AACvF,wBAAgB,sBAAsB,CAAC,MAAM,EAAE;IAC7C,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,MAAM,CAAC;IACrB,eAAe,EAAE,OAAO,CAAC;IACzB,GAAG,EAAE,MAAM,MAAM,GAAG,SAAS,CAAC;CAC/B,GAAG,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,OAAO,CAAC,GAAG,CAAC,CAmBvC"}
1
+ {"version":3,"file":"updateConfirmationReview.d.ts","sourceRoot":"","sources":["../../../../../../../src/ui/CommonComponents/SpreadsheetWrapper/updateConfirmationReview.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,EAAyB,kBAAkB,EAAE,UAAU,EAAgC,MAAM,qBAAqB,CAAC;AAG1H;;;;GAIG;AACH,MAAM,WAAW,yBAAyB;IACxC,8EAA8E;IAC9E,SAAS,EAAE,MAAM,GAAG,MAAM,CAAC;IAC3B,4CAA4C;IAC5C,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,+EAA+E;IAC/E,KAAK,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;IAC/C,8CAA8C;IAC9C,QAAQ,EAAE,MAAM,CAAC;IACjB,gHAAgH;IAChH,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;IAC3D,uFAAuF;IACvF,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,gFAAgF;IAChF,cAAc,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC;IAC1C,+CAA+C;IAC/C,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,MAAM,CAAC;IAC3C,2GAA2G;IAC3G,aAAa,CAAC,EAAE,CAAC,UAAU,EAAE,eAAe,KAAK,OAAO,CAAC;IACzD,8DAA8D;IAC9D,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,gIAAgI;AAChI,eAAO,MAAM,gCAAgC,MAAO,SAAS,WAIzD,CAAC;AAEL;;;;;GAKG;AACH,eAAO,MAAM,+BAA+B,MACvC,SAAS,UACJ,kBAAkB,qBACP,MAAM,OAAO,CAAC,OAAO,CAAC,KACxC,yBAeD,CAAC;AAoBH,MAAM,WAAW,sBAAsB;IACrC,OAAO,EAAE,yBAAyB,CAAC;IACnC,CAAC,EAAE,SAAS,CAAC;IACb,KAAK,EAAE,OAAO,CAAC;IACf,qEAAqE;IACrE,UAAU,EAAE,MAAM,eAAe,GAAG,SAAS,CAAC;IAC9C,yEAAyE;IACzE,QAAQ,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC;IAC/C,uGAAuG;IACvG,MAAM,CAAC,EAAE,CAAC,GAAG,EAAE,OAAO,KAAK,MAAM,GAAG,SAAS,CAAC;IAC9C,oFAAoF;IACpF,aAAa,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,OAAO,CAAC,GAAG,CAAC,CAAC;CACrD;AAED;;;GAGG;AACH,wBAAgB,8BAA8B,CAAC,IAAI,EAAE,sBAAsB,GAAG,CAAC,QAAQ,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,KAAK,OAAO,CAAC,GAAG,CAAC,CA+H1H;AAED,uFAAuF;AACvF,wBAAgB,sBAAsB,CAAC,MAAM,EAAE;IAC7C,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,MAAM,CAAC;IACrB,eAAe,EAAE,OAAO,CAAC;IACzB,GAAG,EAAE,MAAM,MAAM,GAAG,SAAS,CAAC;CAC/B,GAAG,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,OAAO,CAAC,GAAG,CAAC,CAmBvC"}
@@ -1 +1 @@
1
- {"version":3,"file":"Features.d.ts","sourceRoot":"","sources":["../../../../../../../src/ui/IDMCatalogEditor/Tables/Features.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA2D,MAAM,OAAO,CAAC;AAIhF,OAAO,EAAE,SAAS,EAA+B,MAAM,0BAA0B,CAAC;AAClF,OAAO,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACvF,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAkBvC,QAAA,MAAM,QAAQ;oBAGM,MAAM;qBACL,WAAW;eACjB,SAAS;YACZ,oBAAoB,CAAC,GAAG,CAAC;6CAkUnC,CAAC;AAEH,eAAe,QAAQ,CAAC"}
1
+ {"version":3,"file":"Features.d.ts","sourceRoot":"","sources":["../../../../../../../src/ui/IDMCatalogEditor/Tables/Features.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA2D,MAAM,OAAO,CAAC;AAIhF,OAAO,EAAE,SAAS,EAA+B,MAAM,0BAA0B,CAAC;AAClF,OAAO,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACvF,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAkBvC,QAAA,MAAM,QAAQ;oBAGM,MAAM;qBACL,WAAW;eACjB,SAAS;YACZ,oBAAoB,CAAC,GAAG,CAAC;6CAmUnC,CAAC;AAEH,eAAe,QAAQ,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crystaldesign/diva-backoffice",
3
- "version": "26.14.0-beta.14",
3
+ "version": "26.14.0-beta.15",
4
4
  "description": "Ant Design backoffice shell (configuration modules), the Diva Data Engine component hosting the IDM and enricher editors, and the Produkt Onboarding component hosting the Assortment Manager.",
5
5
  "license": "COMMERCIAL",
6
6
  "devDependencies": {
@@ -16,16 +16,16 @@
16
16
  "dependencies": {
17
17
  "@ant-design/icons": "6.3.4",
18
18
  "@babel/runtime": "7.24.7",
19
- "@crystaldesign/classification": "26.14.0-beta.14",
20
- "@crystaldesign/content-box": "26.14.0-beta.14",
21
- "@crystaldesign/content-item": "26.14.0-beta.14",
22
- "@crystaldesign/diva-agent": "26.14.0-beta.14",
23
- "@crystaldesign/diva-core": "26.14.0-beta.14",
24
- "@crystaldesign/diva-utils": "26.14.0-beta.14",
25
- "@crystaldesign/mass-configurator": "26.14.0-beta.14",
26
- "@crystaldesign/media-upload": "26.14.0-beta.14",
27
- "@crystaldesign/rtf-editor": "26.14.0-beta.14",
28
- "@crystaldesign/spreadsheet": "26.14.0-beta.14",
19
+ "@crystaldesign/classification": "26.14.0-beta.15",
20
+ "@crystaldesign/content-box": "26.14.0-beta.15",
21
+ "@crystaldesign/content-item": "26.14.0-beta.15",
22
+ "@crystaldesign/diva-agent": "26.14.0-beta.15",
23
+ "@crystaldesign/diva-core": "26.14.0-beta.15",
24
+ "@crystaldesign/diva-utils": "26.14.0-beta.15",
25
+ "@crystaldesign/mass-configurator": "26.14.0-beta.15",
26
+ "@crystaldesign/media-upload": "26.14.0-beta.15",
27
+ "@crystaldesign/rtf-editor": "26.14.0-beta.15",
28
+ "@crystaldesign/spreadsheet": "26.14.0-beta.15",
29
29
  "@dnd-kit/core": "^6.1.0",
30
30
  "@dnd-kit/sortable": "^8.0.0",
31
31
  "@dnd-kit/utilities": "^3.2.2",
@@ -62,5 +62,5 @@
62
62
  "suiteName": "diva-backoffice",
63
63
  "outputDirectory": "./test-reports"
64
64
  },
65
- "gitHead": "08fc1d00210b682a40b407973c80ba3782f051e6"
65
+ "gitHead": "90c05638b9e706476d467f7d15196c75e938242f"
66
66
  }
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=publishedKeyChangeReview.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"publishedKeyChangeReview.test.d.ts","sourceRoot":"","sources":["../../../../../../../../src/tests/unit/ui/CommonComponents/publishedKeyChangeReview.test.tsx"],"names":[],"mappings":""}
@@ -1 +0,0 @@
1
- {"version":3,"file":"publishedKeyChangeReview.d.ts","sourceRoot":"","sources":["../../../../../../../src/ui/CommonComponents/SpreadsheetWrapper/publishedKeyChangeReview.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAGtD,4FAA4F;AAC5F,UAAU,SAAS;IACjB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE,EAAE,CAAC;CACzD;AAED,qEAAqE;AACrE,UAAU,SAAS;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,OAAO,CAAC;CAChB;AAKD,UAAU,sBAAsB;IAC9B,iHAAiH;IACjH,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,gBAAgB,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;IACzC,kGAAkG;IAClG,YAAY,EAAE,MAAM,OAAO,CAAC;IAC5B,CAAC,EAAE,SAAS,CAAC;IACb,KAAK,EAAE,OAAO,CAAC;CAChB;AAKD,qFAAqF;AACrF,eAAO,MAAM,WAAW,QAAS,SAAS,aAAa,MAAM,EAAE,KAAG,SAAS,EAKvE,CAAC;AAKL;;;;;GAKG;AACH,wBAAgB,8BAA8B,CAAC,IAAI,EAAE,sBAAsB;sBAI1C;QAAE,MAAM,CAAC,EAAE,SAAS,EAAE,CAAA;KAAE,cAAa,OAAO,EAAE,KAAQ,OAAO,CAAC,MAAM,EAAE,CAAC;wBA6BjE,SAAS;EAC/C"}