@crystaldesign/web-planner-logic 26.13.0-beta.32 → 26.13.0-beta.33
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/cjs/{DivaBoxPlanner-f9f577b0.js → DivaBoxPlanner-c0b3b67e.js} +2 -2
- package/build/cjs/{DivaStandardPlanner-fd71c557.js → DivaStandardPlanner-cf61c859.js} +2 -2
- package/build/cjs/{DoorPlanner-1e941d6e.js → DoorPlanner-dc29d7ab.js} +1 -1
- package/build/cjs/{Host3DSignalR-7aa4d347.js → Host3DSignalR-4d97cc14.js} +1 -1
- package/build/cjs/{LiviqueWWSHandler-c8f83739.js → LiviqueWWSHandler-64ed4664.js} +1 -1
- package/build/cjs/{PfisterWWSHandler-d3fd59c5.js → PfisterWWSHandler-8b3bca3f.js} +1 -1
- package/build/cjs/{PlannerHandler2D-e6d1cebc.js → PlannerHandler2D-9ff3a275.js} +1 -1
- package/build/cjs/{SeriousBasketHandler-c8abdb16.js → SeriousBasketHandler-7f4b1074.js} +1 -1
- package/build/cjs/{ShelfPlanner-173ee746.js → ShelfPlanner-6de3f648.js} +488 -192
- package/build/cjs/{StandardWWSHandler-e31f5446.js → StandardWWSHandler-a0f96b15.js} +1 -1
- package/build/cjs/{index-76d3a1ec.js → index-3ecaaaa1.js} +2823 -1843
- package/build/cjs/index.js +7 -1
- package/build/esm/{DivaBoxPlanner-086b4c02.js → DivaBoxPlanner-8ccf387b.js} +2 -2
- package/build/esm/{DivaStandardPlanner-9864a9dd.js → DivaStandardPlanner-9ff3f239.js} +2 -2
- package/build/esm/{DoorPlanner-d29bc13e.js → DoorPlanner-ad29d046.js} +1 -1
- package/build/esm/{Host3DSignalR-dbe6624e.js → Host3DSignalR-f4450ab3.js} +1 -1
- package/build/esm/{LiviqueWWSHandler-60691979.js → LiviqueWWSHandler-6b0cefa0.js} +1 -1
- package/build/esm/{PfisterWWSHandler-1fe8accd.js → PfisterWWSHandler-da0842f9.js} +1 -1
- package/build/esm/{PlannerHandler2D-88b9a108.js → PlannerHandler2D-15825d64.js} +1 -1
- package/build/esm/{SeriousBasketHandler-0a3966d6.js → SeriousBasketHandler-93cadbac.js} +1 -1
- package/build/esm/{ShelfPlanner-614b7281.js → ShelfPlanner-967358c5.js} +488 -192
- package/build/esm/{StandardWWSHandler-12b16709.js → StandardWWSHandler-2fd953d1.js} +1 -1
- package/build/esm/{index-8d311c4b.js → index-62a23464.js} +2817 -1844
- package/build/esm/index.js +1 -1
- package/build/types/web-planner-logic/src/index.d.ts +5 -1
- package/build/types/web-planner-logic/src/index.d.ts.map +1 -1
- package/build/types/web-planner-logic/src/interface/DivaCatalogDataType.d.ts +2 -0
- package/build/types/web-planner-logic/src/interface/DivaCatalogDataType.d.ts.map +1 -1
- package/build/types/web-planner-logic/src/interface/OptionTypes/CatalogOptionDataTypes.d.ts +10 -0
- package/build/types/web-planner-logic/src/interface/OptionTypes/CatalogOptionDataTypes.d.ts.map +1 -1
- package/build/types/web-planner-logic/src/interface/Rendering/AlternativeRendering.d.ts +4 -0
- package/build/types/web-planner-logic/src/interface/Rendering/AlternativeRendering.d.ts.map +1 -1
- package/build/types/web-planner-logic/src/interface/ShelfPlanner/ShelfAccessoiresView.d.ts +5 -0
- package/build/types/web-planner-logic/src/interface/ShelfPlanner/ShelfAccessoiresView.d.ts.map +1 -1
- package/build/types/web-planner-logic/src/interface/webPlannerParams/WebPlannerParamsType.d.ts +1 -1
- package/build/types/web-planner-logic/src/interface/webPlannerParams/WebPlannerParamsType.d.ts.map +1 -1
- package/build/types/web-planner-logic/src/logic/Article/ArticleOptionState.d.ts.map +1 -1
- package/build/types/web-planner-logic/src/logic/ConfigTree/DivaConfigTreeHandler.d.ts +7 -0
- package/build/types/web-planner-logic/src/logic/ConfigTree/DivaConfigTreeHandler.d.ts.map +1 -1
- package/build/types/web-planner-logic/src/logic/ConfigTree/Shelfplanner/ShelfPlanner.d.ts +51 -7
- package/build/types/web-planner-logic/src/logic/ConfigTree/Shelfplanner/ShelfPlanner.d.ts.map +1 -1
- package/build/types/web-planner-logic/src/logic/ConfigTree/Shelfplanner/ShelfPlannerGrid.d.ts +14 -2
- package/build/types/web-planner-logic/src/logic/ConfigTree/Shelfplanner/ShelfPlannerGrid.d.ts.map +1 -1
- package/build/types/web-planner-logic/src/logic/ConfigTree/viewerStateToggles.d.ts +19 -0
- package/build/types/web-planner-logic/src/logic/ConfigTree/viewerStateToggles.d.ts.map +1 -0
- package/build/types/web-planner-logic/src/logic/ConfigTree/viewerStateToggles.test.d.ts +2 -0
- package/build/types/web-planner-logic/src/logic/ConfigTree/viewerStateToggles.test.d.ts.map +1 -0
- package/build/types/web-planner-logic/src/logic/DivaWebPlanner.d.ts +73 -15
- package/build/types/web-planner-logic/src/logic/DivaWebPlanner.d.ts.map +1 -1
- package/build/types/web-planner-logic/src/logic/Planner/DivaPlannerHandler.d.ts +7 -2
- package/build/types/web-planner-logic/src/logic/Planner/DivaPlannerHandler.d.ts.map +1 -1
- package/build/types/web-planner-logic/src/logic/Planner/IDM3D/idm3dTranslation.d.ts +6 -7
- package/build/types/web-planner-logic/src/logic/Planner/IDM3D/idm3dTranslation.d.ts.map +1 -1
- package/build/types/web-planner-logic/src/logic/Planner/IDM3D/idm3dTranslation.test.d.ts +2 -0
- package/build/types/web-planner-logic/src/logic/Planner/IDM3D/idm3dTranslation.test.d.ts.map +1 -0
- package/build/types/web-planner-logic/src/logic/Planner/Rendering/PlannerHandler3D.d.ts +13 -1
- package/build/types/web-planner-logic/src/logic/Planner/Rendering/PlannerHandler3D.d.ts.map +1 -1
- package/build/types/web-planner-logic/src/logic/Planner/Room/rtvFeatures.d.ts +17 -0
- package/build/types/web-planner-logic/src/logic/Planner/Room/rtvFeatures.d.ts.map +1 -0
- package/build/types/web-planner-logic/src/logic/Planner/Room/rtvFeatures.test.d.ts +2 -0
- package/build/types/web-planner-logic/src/logic/Planner/Room/rtvFeatures.test.d.ts.map +1 -0
- package/build/types/web-planner-logic/src/logic/Planner/plannerSwitch.d.ts +32 -0
- package/build/types/web-planner-logic/src/logic/Planner/plannerSwitch.d.ts.map +1 -0
- package/build/types/web-planner-logic/src/logic/Planner/plannerSwitch.test.d.ts +2 -0
- package/build/types/web-planner-logic/src/logic/Planner/plannerSwitch.test.d.ts.map +1 -0
- package/build/types/web-planner-logic/src/logic/Set/DivaSet.d.ts +12 -6
- package/build/types/web-planner-logic/src/logic/Set/DivaSet.d.ts.map +1 -1
- package/build/types/web-planner-logic/src/logic/Set/DivaSetHandler.d.ts +26 -6
- package/build/types/web-planner-logic/src/logic/Set/DivaSetHandler.d.ts.map +1 -1
- package/build/types/web-planner-logic/src/model/Catalog/CatalogData.d.ts +3 -0
- package/build/types/web-planner-logic/src/model/Catalog/CatalogData.d.ts.map +1 -1
- package/build/types/web-planner-logic/src/model/Catalog/DivaCatalogData.d.ts.map +1 -1
- package/build/types/web-planner-logic/src/model/Options/ArticleOptionData.d.ts +10 -0
- package/build/types/web-planner-logic/src/model/Options/ArticleOptionData.d.ts.map +1 -1
- package/build/types/web-planner-logic/src/model/Options/CatalogOptionData.d.ts +4 -1
- package/build/types/web-planner-logic/src/model/Options/CatalogOptionData.d.ts.map +1 -1
- package/build/types/web-planner-logic/src/model/Planner/PlannerElementData.d.ts.map +1 -1
- package/build/types/web-planner-logic/src/model/Properties/propertySchemaRegistry.d.ts.map +1 -1
- package/build/types/web-planner-logic/src/test/alternateRenderingToggle.test.d.ts +2 -0
- package/build/types/web-planner-logic/src/test/alternateRenderingToggle.test.d.ts.map +1 -0
- package/build/types/web-planner-logic/src/test/capturedSetImages.test.d.ts +1 -0
- package/build/types/web-planner-logic/src/test/capturedSetImages.test.d.ts.map +1 -1
- package/build/types/web-planner-logic/src/test/copyRestoreConnectors.test.d.ts +2 -0
- package/build/types/web-planner-logic/src/test/copyRestoreConnectors.test.d.ts.map +1 -0
- package/build/types/web-planner-logic/src/test/familySwapInPlace.test.d.ts +2 -0
- package/build/types/web-planner-logic/src/test/familySwapInPlace.test.d.ts.map +1 -0
- package/build/types/web-planner-logic/src/test/liveArUpdate.test.d.ts +2 -0
- package/build/types/web-planner-logic/src/test/liveArUpdate.test.d.ts.map +1 -0
- package/build/types/web-planner-logic/src/test/planning2DCapture.test.d.ts +2 -0
- package/build/types/web-planner-logic/src/test/planning2DCapture.test.d.ts.map +1 -0
- package/build/types/web-planner-logic/src/test/rotationSnap.test.d.ts +2 -0
- package/build/types/web-planner-logic/src/test/rotationSnap.test.d.ts.map +1 -0
- package/build/types/web-planner-logic/src/test/shelfEditNoting.test.d.ts +3 -0
- package/build/types/web-planner-logic/src/test/shelfEditNoting.test.d.ts.map +1 -0
- package/build/types/web-planner-logic/src/test/shelfGridCarryOver.test.d.ts +2 -0
- package/build/types/web-planner-logic/src/test/shelfGridCarryOver.test.d.ts.map +1 -0
- package/build/types/web-planner-logic/src/test/shelfMoveLocks.test.d.ts +2 -0
- package/build/types/web-planner-logic/src/test/shelfMoveLocks.test.d.ts.map +1 -0
- package/build/types/web-planner-logic/src/test/shelfOfferedCells.test.d.ts +2 -0
- package/build/types/web-planner-logic/src/test/shelfOfferedCells.test.d.ts.map +1 -0
- package/build/types/web-planner-logic/src/test/sideCopySubstitute.test.d.ts +3 -0
- package/build/types/web-planner-logic/src/test/sideCopySubstitute.test.d.ts.map +1 -0
- package/package.json +3 -3
|
@@ -6,7 +6,7 @@ var _classCallCheck = require('@babel/runtime/helpers/classCallCheck');
|
|
|
6
6
|
var _createClass = require('@babel/runtime/helpers/createClass');
|
|
7
7
|
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
8
8
|
var _regeneratorRuntime = require('@babel/runtime/regenerator');
|
|
9
|
-
var index = require('./index-
|
|
9
|
+
var index = require('./index-3ecaaaa1.js');
|
|
10
10
|
var DivaUtils = require('@crystaldesign/diva-utils');
|
|
11
11
|
require('@babel/runtime/helpers/slicedToArray');
|
|
12
12
|
require('@babel/runtime/helpers/objectWithoutProperties');
|
|
@@ -40,6 +40,11 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
|
|
|
40
40
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty__default["default"](e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
41
41
|
var LOG = DivaUtils__default["default"].initLog('Planner', 'WEB-PLANNER-LOGIC');
|
|
42
42
|
|
|
43
|
+
/** The accessoire really went into the cell - not a rejected fit, whose article is deleted again. */
|
|
44
|
+
function isPlaced(result) {
|
|
45
|
+
return result !== false && result.index !== undefined && !!result.accessoire && result.type !== 'doesNotFit' && !result.type.startsWith('notAllowed');
|
|
46
|
+
}
|
|
47
|
+
|
|
43
48
|
/** Values the parents pass on to their accessoires with their global options, per basketId of the accessoire. */
|
|
44
49
|
var ShelfPlanner = /*#__PURE__*/function () {
|
|
45
50
|
function ShelfPlanner(data, article) {
|
|
@@ -82,8 +87,12 @@ var ShelfPlanner = /*#__PURE__*/function () {
|
|
|
82
87
|
_defineProperty__default["default"](this, "shelfDebugSeq", 0);
|
|
83
88
|
//accessoires of grids that were cleared by a grid rule, per gridIndex and the HeightGridCellCountOnRule entry the grid
|
|
84
89
|
//ran as. They get placed again when the grid becomes active again under the same entry - eg a shelf that is configured
|
|
85
|
-
//from 100cm to 50cm and back keeps its accessoires. A grid that comes back under another entry starts with that entry's
|
|
90
|
+
//from 100cm to 50cm and back keeps its accessoires. A grid that comes back under another entry starts with that entry's
|
|
91
|
+
//initAcc; with rtv-next it first takes what the change cleared (placeTransferredAccessoires)
|
|
86
92
|
_defineProperty__default["default"](this, "stashedAccessoires", {});
|
|
93
|
+
//a memory is outdated once something was edited by hand after it was taken (the init jump of a shelf edits nothing)
|
|
94
|
+
_defineProperty__default["default"](this, "editEpoch", 0);
|
|
95
|
+
_defineProperty__default["default"](this, "stashEpochs", {});
|
|
87
96
|
this.article = article;
|
|
88
97
|
this.restorePending = !!article.shelfPlanData;
|
|
89
98
|
this.disableCellsByElement = data.DisableCells;
|
|
@@ -218,7 +227,7 @@ var ShelfPlanner = /*#__PURE__*/function () {
|
|
|
218
227
|
key: "onConfigChanged",
|
|
219
228
|
value: (function () {
|
|
220
229
|
var _onConfigChanged = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee2(variantValues) {
|
|
221
|
-
var newHeightSet, gridsTodos, ruleIndexesBefore, i, _i, grid, _i2, _i3, _grid, grids, _i4, _grid2$DisableCellsBy, _grid2;
|
|
230
|
+
var newHeightSet, gridsTodos, ruleIndexesBefore, i, _i, grid, clearedNow, _i2, stashed, _i3, _grid, own, carryOver, grids, _i4, _grid2$DisableCellsBy, _grid2;
|
|
222
231
|
return _regeneratorRuntime__default["default"].wrap(function _callee2$(_context2) {
|
|
223
232
|
while (1) switch (_context2.prev = _context2.next) {
|
|
224
233
|
case 0:
|
|
@@ -260,39 +269,42 @@ var ShelfPlanner = /*#__PURE__*/function () {
|
|
|
260
269
|
_context2.next = 5;
|
|
261
270
|
break;
|
|
262
271
|
case 14:
|
|
272
|
+
//what this change clears, per grid - carried over into a grid that comes back without an up-to-date memory of its own
|
|
273
|
+
clearedNow = new Map(); //first delete all disables grids then init all the new ones
|
|
263
274
|
_i2 = 0;
|
|
264
|
-
case
|
|
275
|
+
case 16:
|
|
265
276
|
if (!(_i2 < gridsTodos.length)) {
|
|
266
|
-
_context2.next =
|
|
277
|
+
_context2.next = 26;
|
|
267
278
|
break;
|
|
268
279
|
}
|
|
269
280
|
if (gridsTodos[_i2].length) {
|
|
270
|
-
_context2.next =
|
|
281
|
+
_context2.next = 19;
|
|
271
282
|
break;
|
|
272
283
|
}
|
|
273
|
-
return _context2.abrupt("continue",
|
|
274
|
-
case
|
|
284
|
+
return _context2.abrupt("continue", 23);
|
|
285
|
+
case 19:
|
|
275
286
|
//remember the accessoires before they get deleted, so they can be placed again when the grid becomes active again
|
|
276
|
-
this.stashAccessoiresOfGrid(_i2, ruleIndexesBefore[_i2]);
|
|
277
|
-
|
|
287
|
+
stashed = this.stashAccessoiresOfGrid(_i2, ruleIndexesBefore[_i2]);
|
|
288
|
+
if (!this.isOnlyInitContent(this.grids[_i2], stashed)) clearedNow.set(_i2, stashed);
|
|
289
|
+
_context2.next = 23;
|
|
278
290
|
return this.grids[_i2].deleteAllAccOfGrid();
|
|
279
|
-
case
|
|
291
|
+
case 23:
|
|
280
292
|
_i2++;
|
|
281
|
-
_context2.next =
|
|
293
|
+
_context2.next = 16;
|
|
282
294
|
break;
|
|
283
|
-
case
|
|
295
|
+
case 26:
|
|
284
296
|
_i3 = 0;
|
|
285
|
-
case
|
|
297
|
+
case 27:
|
|
286
298
|
if (!(_i3 < gridsTodos.length)) {
|
|
287
|
-
_context2.next =
|
|
299
|
+
_context2.next = 65;
|
|
288
300
|
break;
|
|
289
301
|
}
|
|
290
302
|
if (gridsTodos[_i3].length) {
|
|
291
|
-
_context2.next =
|
|
303
|
+
_context2.next = 30;
|
|
292
304
|
break;
|
|
293
305
|
}
|
|
294
|
-
return _context2.abrupt("continue",
|
|
295
|
-
case
|
|
306
|
+
return _context2.abrupt("continue", 62);
|
|
307
|
+
case 30:
|
|
296
308
|
if (gridsTodos[_i3].includes('heightGridRule')) {
|
|
297
309
|
this.creatNewGrid(_i3);
|
|
298
310
|
newHeightSet = true;
|
|
@@ -300,58 +312,109 @@ var ShelfPlanner = /*#__PURE__*/function () {
|
|
|
300
312
|
//read the grid after a possible recreate, the replaced one is not the grid that gets filled
|
|
301
313
|
_grid = this.grids[_i3];
|
|
302
314
|
if (!((gridsTodos[_i3].includes('heightGridRule') || gridsTodos[_i3].includes('disableGridRule')) && !_grid.DisabledByRule)) {
|
|
303
|
-
_context2.next =
|
|
315
|
+
_context2.next = 62;
|
|
304
316
|
break;
|
|
305
317
|
}
|
|
306
318
|
if (!this.restorePending) {
|
|
307
|
-
_context2.next =
|
|
319
|
+
_context2.next = 35;
|
|
308
320
|
break;
|
|
309
321
|
}
|
|
310
|
-
return _context2.abrupt("continue",
|
|
311
|
-
case 33:
|
|
312
|
-
_context2.next = 35;
|
|
313
|
-
return this.placeStashedAccessoiresOfGrid(_i3);
|
|
322
|
+
return _context2.abrupt("continue", 62);
|
|
314
323
|
case 35:
|
|
315
|
-
|
|
316
|
-
|
|
324
|
+
//the grid's own memory beats the initAcc while nothing was edited since, else another grid's newer content is carried over
|
|
325
|
+
own = this.takeStashOfGrid(_i3); //only rtv-next carries content over between grids, otherwise the memory is restored as is
|
|
326
|
+
carryOver = this.article.set.CatalogData.divaUseRtvNext;
|
|
327
|
+
_context2.t0 = own && (!own.outdated || !carryOver);
|
|
328
|
+
if (!_context2.t0) {
|
|
329
|
+
_context2.next = 42;
|
|
330
|
+
break;
|
|
331
|
+
}
|
|
332
|
+
_context2.next = 41;
|
|
333
|
+
return this.placeStashedAccessoiresInGrid(_i3, own.accessoires);
|
|
334
|
+
case 41:
|
|
335
|
+
_context2.t0 = _context2.sent;
|
|
336
|
+
case 42:
|
|
337
|
+
if (!_context2.t0) {
|
|
338
|
+
_context2.next = 45;
|
|
339
|
+
break;
|
|
340
|
+
}
|
|
341
|
+
clearedNow["delete"](_i3);
|
|
342
|
+
return _context2.abrupt("continue", 62);
|
|
343
|
+
case 45:
|
|
344
|
+
_context2.t1 = carryOver;
|
|
345
|
+
if (!_context2.t1) {
|
|
346
|
+
_context2.next = 50;
|
|
347
|
+
break;
|
|
348
|
+
}
|
|
349
|
+
_context2.next = 49;
|
|
350
|
+
return this.placeTransferredAccessoires(_i3, clearedNow);
|
|
351
|
+
case 49:
|
|
352
|
+
_context2.t1 = _context2.sent;
|
|
353
|
+
case 50:
|
|
354
|
+
if (!_context2.t1) {
|
|
355
|
+
_context2.next = 54;
|
|
317
356
|
break;
|
|
318
357
|
}
|
|
319
|
-
_context2.next =
|
|
358
|
+
_context2.next = 53;
|
|
320
359
|
return this.initAccList(_i3);
|
|
321
|
-
case
|
|
360
|
+
case 53:
|
|
361
|
+
return _context2.abrupt("continue", 62);
|
|
362
|
+
case 54:
|
|
363
|
+
if (!(carryOver && own !== null && own !== void 0 && own.outdated)) {
|
|
364
|
+
_context2.next = 60;
|
|
365
|
+
break;
|
|
366
|
+
}
|
|
367
|
+
this.logShelfDebug({
|
|
368
|
+
phase: 'configChanged',
|
|
369
|
+
action: 'stashOutdatedRestored',
|
|
370
|
+
gridIndex: _i3,
|
|
371
|
+
detail: 'edited since, but nothing to carry over'
|
|
372
|
+
});
|
|
373
|
+
_context2.next = 58;
|
|
374
|
+
return this.placeStashedAccessoiresInGrid(_i3, own.accessoires);
|
|
375
|
+
case 58:
|
|
376
|
+
if (!_context2.sent) {
|
|
377
|
+
_context2.next = 60;
|
|
378
|
+
break;
|
|
379
|
+
}
|
|
380
|
+
return _context2.abrupt("continue", 62);
|
|
381
|
+
case 60:
|
|
382
|
+
_context2.next = 62;
|
|
383
|
+
return this.initAccList(_i3);
|
|
384
|
+
case 62:
|
|
322
385
|
_i3++;
|
|
323
|
-
_context2.next =
|
|
386
|
+
_context2.next = 27;
|
|
324
387
|
break;
|
|
325
|
-
case
|
|
388
|
+
case 65:
|
|
326
389
|
if (!(!newHeightSet && Object.keys(variantValues).length)) {
|
|
327
|
-
_context2.next =
|
|
390
|
+
_context2.next = 76;
|
|
328
391
|
break;
|
|
329
392
|
}
|
|
330
393
|
grids = this.activeGrids;
|
|
331
394
|
_i4 = 0;
|
|
332
|
-
case
|
|
395
|
+
case 68:
|
|
333
396
|
if (!(_i4 < grids.length)) {
|
|
334
|
-
_context2.next =
|
|
397
|
+
_context2.next = 76;
|
|
335
398
|
break;
|
|
336
399
|
}
|
|
337
400
|
_grid2 = grids[_i4];
|
|
338
401
|
if (!((_grid2$DisableCellsBy = _grid2.DisableCellsByMeasures) !== null && _grid2$DisableCellsBy !== void 0 && _grid2$DisableCellsBy.options.find(function (o) {
|
|
339
402
|
return Object.keys(variantValues).includes('OPT' + o.opt);
|
|
340
403
|
}) || !!_grid2.disableCellsByRules)) {
|
|
341
|
-
_context2.next =
|
|
404
|
+
_context2.next = 73;
|
|
342
405
|
break;
|
|
343
406
|
}
|
|
344
407
|
newHeightSet = true;
|
|
345
|
-
return _context2.abrupt("break",
|
|
346
|
-
case
|
|
408
|
+
return _context2.abrupt("break", 76);
|
|
409
|
+
case 73:
|
|
347
410
|
_i4++;
|
|
348
|
-
_context2.next =
|
|
411
|
+
_context2.next = 68;
|
|
349
412
|
break;
|
|
350
|
-
case
|
|
413
|
+
case 76:
|
|
351
414
|
if (newHeightSet) {
|
|
352
415
|
this.updateDisabledCells();
|
|
353
416
|
}
|
|
354
|
-
case
|
|
417
|
+
case 77:
|
|
355
418
|
case "end":
|
|
356
419
|
return _context2.stop();
|
|
357
420
|
}
|
|
@@ -379,8 +442,145 @@ var ShelfPlanner = /*#__PURE__*/function () {
|
|
|
379
442
|
key: "stashAccessoiresOfGrid",
|
|
380
443
|
value: function stashAccessoiresOfGrid(gridIndex, ruleIndex) {
|
|
381
444
|
var stashedAccessoires = this.collectAccessoiresToStash(this.grids[gridIndex], this.valuesPassedOnByParents());
|
|
382
|
-
if (!stashedAccessoires.length) return;
|
|
383
|
-
this.
|
|
445
|
+
if (!stashedAccessoires.length) return stashedAccessoires;
|
|
446
|
+
var stashKey = this.stashKey(gridIndex, ruleIndex);
|
|
447
|
+
this.stashedAccessoires[stashKey] = stashedAccessoires;
|
|
448
|
+
this.stashEpochs[stashKey] = this.editEpoch;
|
|
449
|
+
return stashedAccessoires;
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
/** A hand edit of this shelf or of an accessoire inside it (add, delete, move) - outdates the memories taken before. */
|
|
453
|
+
}, {
|
|
454
|
+
key: "noteUserEdit",
|
|
455
|
+
value: function noteUserEdit() {
|
|
456
|
+
var _this$article$accesso;
|
|
457
|
+
this.editEpoch++;
|
|
458
|
+
(_this$article$accesso = this.article.accessoireParentArticle) === null || _this$article$accesso === void 0 || (_this$article$accesso = _this$article$accesso.shelfPlanner) === null || _this$article$accesso === void 0 || _this$article$accesso.noteUserEdit();
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
/** The hand edit noted last changed nothing (eg the drop did not fit) - the memories taken before it stay up to date. */
|
|
462
|
+
}, {
|
|
463
|
+
key: "withdrawUserEdit",
|
|
464
|
+
value: function withdrawUserEdit() {
|
|
465
|
+
var _this$article$accesso2;
|
|
466
|
+
this.editEpoch--;
|
|
467
|
+
(_this$article$accesso2 = this.article.accessoireParentArticle) === null || _this$article$accesso2 === void 0 || (_this$article$accesso2 = _this$article$accesso2.shelfPlanner) === null || _this$article$accesso2 === void 0 || _this$article$accesso2.withdrawUserEdit();
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
/**
|
|
471
|
+
* True when a grid held nothing but its own initAcc - eg the Kleiderstange of a shelf that only passes through another
|
|
472
|
+
* width while it initializes. Such content is not carried over, the other grid starts with its own initAcc.
|
|
473
|
+
*/
|
|
474
|
+
}, {
|
|
475
|
+
key: "isOnlyInitContent",
|
|
476
|
+
value: function isOnlyInitContent(grid, stashed) {
|
|
477
|
+
return stashed.every(function (acc) {
|
|
478
|
+
var _grid$InitAccArr;
|
|
479
|
+
return (_grid$InitAccArr = grid.InitAccArr) === null || _grid$InitAccArr === void 0 ? void 0 : _grid$InitAccArr.some(function (init) {
|
|
480
|
+
return init.Codex === acc.articleCodex && init.initRH.includes(acc.cellIndex);
|
|
481
|
+
});
|
|
482
|
+
});
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
/**
|
|
486
|
+
* Fallback for a grid without an up-to-date memory of its own: places what this change cleared from it, else from a grid
|
|
487
|
+
* the change switched off, mapped by family (eg the 50cm tablar comes back as the 100cm one). The cleared grid keeps its
|
|
488
|
+
* own memory.
|
|
489
|
+
* @param cleared what this change cleared, per grid - a placed source is taken out
|
|
490
|
+
* @returns how many were placed
|
|
491
|
+
*/
|
|
492
|
+
}, {
|
|
493
|
+
key: "placeTransferredAccessoires",
|
|
494
|
+
value: (function () {
|
|
495
|
+
var _placeTransferredAccessoires = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee3(gridIndex, cleared) {
|
|
496
|
+
var _this = this;
|
|
497
|
+
var sources, _iterator, _step, source, accessoires, placed;
|
|
498
|
+
return _regeneratorRuntime__default["default"].wrap(function _callee3$(_context3) {
|
|
499
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
500
|
+
case 0:
|
|
501
|
+
//a grid that stays active keeps its content for itself
|
|
502
|
+
sources = [gridIndex].concat(_toConsumableArray__default["default"](_toConsumableArray__default["default"](cleared.keys()).filter(function (source) {
|
|
503
|
+
return source !== gridIndex && _this.grids[source].DisabledByRule;
|
|
504
|
+
})));
|
|
505
|
+
_iterator = _createForOfIteratorHelper(sources);
|
|
506
|
+
_context3.prev = 2;
|
|
507
|
+
_iterator.s();
|
|
508
|
+
case 4:
|
|
509
|
+
if ((_step = _iterator.n()).done) {
|
|
510
|
+
_context3.next = 18;
|
|
511
|
+
break;
|
|
512
|
+
}
|
|
513
|
+
source = _step.value;
|
|
514
|
+
accessoires = cleared.get(source);
|
|
515
|
+
if (accessoires) {
|
|
516
|
+
_context3.next = 9;
|
|
517
|
+
break;
|
|
518
|
+
}
|
|
519
|
+
return _context3.abrupt("continue", 16);
|
|
520
|
+
case 9:
|
|
521
|
+
_context3.next = 11;
|
|
522
|
+
return this.placeStashedAccessoiresInGrid(gridIndex, accessoires, true);
|
|
523
|
+
case 11:
|
|
524
|
+
placed = _context3.sent;
|
|
525
|
+
if (placed) {
|
|
526
|
+
_context3.next = 14;
|
|
527
|
+
break;
|
|
528
|
+
}
|
|
529
|
+
return _context3.abrupt("continue", 16);
|
|
530
|
+
case 14:
|
|
531
|
+
cleared["delete"](source);
|
|
532
|
+
return _context3.abrupt("return", placed);
|
|
533
|
+
case 16:
|
|
534
|
+
_context3.next = 4;
|
|
535
|
+
break;
|
|
536
|
+
case 18:
|
|
537
|
+
_context3.next = 23;
|
|
538
|
+
break;
|
|
539
|
+
case 20:
|
|
540
|
+
_context3.prev = 20;
|
|
541
|
+
_context3.t0 = _context3["catch"](2);
|
|
542
|
+
_iterator.e(_context3.t0);
|
|
543
|
+
case 23:
|
|
544
|
+
_context3.prev = 23;
|
|
545
|
+
_iterator.f();
|
|
546
|
+
return _context3.finish(23);
|
|
547
|
+
case 26:
|
|
548
|
+
return _context3.abrupt("return", 0);
|
|
549
|
+
case 27:
|
|
550
|
+
case "end":
|
|
551
|
+
return _context3.stop();
|
|
552
|
+
}
|
|
553
|
+
}, _callee3, this, [[2, 20, 23, 26]]);
|
|
554
|
+
}));
|
|
555
|
+
function placeTransferredAccessoires(_x3, _x4) {
|
|
556
|
+
return _placeTransferredAccessoires.apply(this, arguments);
|
|
557
|
+
}
|
|
558
|
+
return placeTransferredAccessoires;
|
|
559
|
+
}() /** How many accessoires of `articleCodex` or of its family the grid holds, each counted in the cell it starts in. */)
|
|
560
|
+
}, {
|
|
561
|
+
key: "countPlacedOfFamily",
|
|
562
|
+
value: function countPlacedOfFamily(grid, articleCodex) {
|
|
563
|
+
var codexes = [articleCodex].concat(_toConsumableArray__default["default"](index.familyMembersOf(articleCodex, this.article.CatalogData.allCatalogArticles)));
|
|
564
|
+
var startsHere = function startsHere(cell) {
|
|
565
|
+
return cell.InUse === cell.Index && !cell.OnlyPlaceHolder;
|
|
566
|
+
};
|
|
567
|
+
return grid.Cells.filter(function (cell) {
|
|
568
|
+
var _cell$Article$article, _cell$Article;
|
|
569
|
+
return startsHere(cell) && codexes.includes((_cell$Article$article = (_cell$Article = cell.Article) === null || _cell$Article === void 0 ? void 0 : _cell$Article.articleCodex) !== null && _cell$Article$article !== void 0 ? _cell$Article$article : '');
|
|
570
|
+
}).length;
|
|
571
|
+
}
|
|
572
|
+
|
|
573
|
+
/** The article itself when the grid allows it, else the members of its family the grid allows. */
|
|
574
|
+
}, {
|
|
575
|
+
key: "familyCandidates",
|
|
576
|
+
value: function familyCandidates(grid, articleCodex) {
|
|
577
|
+
var allowed = grid.getAllArticleRelations();
|
|
578
|
+
var family = index.familyMembersOf(articleCodex, this.article.CatalogData.allCatalogArticles).filter(function (codex) {
|
|
579
|
+
return codex !== articleCodex;
|
|
580
|
+
});
|
|
581
|
+
return [articleCodex].concat(_toConsumableArray__default["default"](family)).filter(function (codex) {
|
|
582
|
+
return allowed.includes(codex);
|
|
583
|
+
});
|
|
384
584
|
}
|
|
385
585
|
|
|
386
586
|
/** The memory is per grid and per HeightGridCellCountOnRule entry, false when the grid runs without a matching entry. */
|
|
@@ -401,25 +601,13 @@ var ShelfPlanner = /*#__PURE__*/function () {
|
|
|
401
601
|
var stashedAccessoires = [];
|
|
402
602
|
var inheritedValues = ShelfPlanner.addValuesPassedOnBy(this.article, parentInheritedValues);
|
|
403
603
|
for (var i = 0; i < grid.Cells.length; i++) {
|
|
404
|
-
var _inheritedValues$acce;
|
|
604
|
+
var _accessoire$shelfPlan, _accessoire$shelfPlan2, _inheritedValues$acce;
|
|
405
605
|
var cell = grid.Cells[i];
|
|
406
606
|
var accessoire = cell.Article;
|
|
407
607
|
if (cell.InUse !== i || !accessoire) continue;
|
|
408
608
|
|
|
409
609
|
//the accessoire can be a shelf itself (eg an EINBAU), its own accessoires are grouped by its own grids
|
|
410
|
-
var accessoires = {};
|
|
411
|
-
var accessoireShelfPlanner = accessoire.shelfPlanner;
|
|
412
|
-
for (var j = 0; j < ((_accessoireShelfPlann = accessoireShelfPlanner === null || accessoireShelfPlanner === void 0 ? void 0 : accessoireShelfPlanner.grids.length) !== null && _accessoireShelfPlann !== void 0 ? _accessoireShelfPlann : 0); j++) {
|
|
413
|
-
var _accessoireShelfPlann;
|
|
414
|
-
var accessoireGrid = accessoireShelfPlanner.grids[j];
|
|
415
|
-
var accessoiresOfGrid = accessoireShelfPlanner.collectAccessoiresToStash(accessoireGrid, inheritedValues);
|
|
416
|
-
if (accessoiresOfGrid.length) {
|
|
417
|
-
accessoires[accessoireGrid.ShelfIndex] = {
|
|
418
|
-
ruleIndex: accessoireGrid.CurrentLoadedRuleIndex,
|
|
419
|
-
accessoires: accessoiresOfGrid
|
|
420
|
-
};
|
|
421
|
-
}
|
|
422
|
-
}
|
|
610
|
+
var accessoires = (_accessoire$shelfPlan = (_accessoire$shelfPlan2 = accessoire.shelfPlanner) === null || _accessoire$shelfPlan2 === void 0 ? void 0 : _accessoire$shelfPlan2.collectOwnAccessoiresToStash(inheritedValues)) !== null && _accessoire$shelfPlan !== void 0 ? _accessoire$shelfPlan : {};
|
|
423
611
|
|
|
424
612
|
//a value the accessoire only took over from the parent is not remembered: placed again, the accessoire takes over the
|
|
425
613
|
//parent's value of that time, the parent may have changed it in between
|
|
@@ -465,134 +653,210 @@ var ShelfPlanner = /*#__PURE__*/function () {
|
|
|
465
653
|
* @returns the values passed on per basketId, a new object
|
|
466
654
|
*/
|
|
467
655
|
}, {
|
|
468
|
-
key: "
|
|
469
|
-
value:
|
|
656
|
+
key: "collectOwnAccessoiresToStash",
|
|
657
|
+
value: /** The accessoires of all grids of this shelfplanner, grouped by grid - eg the drawers of an EINBAU that gets replaced. */
|
|
658
|
+
function collectOwnAccessoiresToStash() {
|
|
659
|
+
var parentInheritedValues = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.valuesPassedOnByParents();
|
|
660
|
+
var accessoires = {};
|
|
661
|
+
for (var j = 0; j < this.grids.length; j++) {
|
|
662
|
+
var grid = this.grids[j];
|
|
663
|
+
var accessoiresOfGrid = this.collectAccessoiresToStash(grid, parentInheritedValues);
|
|
664
|
+
if (accessoiresOfGrid.length) accessoires[grid.ShelfIndex] = {
|
|
665
|
+
ruleIndex: grid.CurrentLoadedRuleIndex,
|
|
666
|
+
accessoires: accessoiresOfGrid
|
|
667
|
+
};
|
|
668
|
+
}
|
|
669
|
+
return accessoires;
|
|
670
|
+
}
|
|
671
|
+
|
|
470
672
|
/**
|
|
471
|
-
*
|
|
673
|
+
* Takes the accessoires remembered for the rule entry the grid runs now out of the memory.
|
|
472
674
|
* @param gridIndex grid that became active again
|
|
473
|
-
* @returns
|
|
675
|
+
* @returns the remembered accessoires and whether something was edited by hand since they were taken
|
|
676
|
+
*/
|
|
677
|
+
}, {
|
|
678
|
+
key: "takeStashOfGrid",
|
|
679
|
+
value: function takeStashOfGrid(gridIndex) {
|
|
680
|
+
//a recreated grid already runs its new rule entry, only accessoires planned under that entry belong into it
|
|
681
|
+
var stashKey = this.stashKey(gridIndex, this.grids[gridIndex].CurrentLoadedRuleIndex);
|
|
682
|
+
var accessoires = this.stashedAccessoires[stashKey];
|
|
683
|
+
var outdated = this.stashEpochs[stashKey] !== this.editEpoch;
|
|
684
|
+
//remove it first, a reconfiguration triggered by placing them must not place them a second time
|
|
685
|
+
delete this.stashedAccessoires[stashKey];
|
|
686
|
+
delete this.stashEpochs[stashKey];
|
|
687
|
+
return accessoires !== null && accessoires !== void 0 && accessoires.length ? {
|
|
688
|
+
accessoires: accessoires,
|
|
689
|
+
outdated: outdated
|
|
690
|
+
} : undefined;
|
|
691
|
+
}
|
|
692
|
+
|
|
693
|
+
/**
|
|
694
|
+
* Places stashed accessoires that are grouped by gridIndex - used for the accessoires of an accessoire.
|
|
695
|
+
* @param mapByFamily the accessoire was replaced by another member of its family: its grids run their own rule entry, and
|
|
696
|
+
* every accessoire is placed as itself or as the family member the grid allows
|
|
474
697
|
*/
|
|
475
|
-
function () {
|
|
476
|
-
var _placeStashedAccessoiresOfGrid = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee3(gridIndex) {
|
|
477
|
-
var stashKey, stashedAccessoires;
|
|
478
|
-
return _regeneratorRuntime__default["default"].wrap(function _callee3$(_context3) {
|
|
479
|
-
while (1) switch (_context3.prev = _context3.next) {
|
|
480
|
-
case 0:
|
|
481
|
-
//a recreated grid already runs its new rule entry, only accessoires planned under that entry belong into it
|
|
482
|
-
stashKey = this.stashKey(gridIndex, this.grids[gridIndex].CurrentLoadedRuleIndex);
|
|
483
|
-
stashedAccessoires = this.stashedAccessoires[stashKey];
|
|
484
|
-
if (stashedAccessoires !== null && stashedAccessoires !== void 0 && stashedAccessoires.length) {
|
|
485
|
-
_context3.next = 4;
|
|
486
|
-
break;
|
|
487
|
-
}
|
|
488
|
-
return _context3.abrupt("return", 0);
|
|
489
|
-
case 4:
|
|
490
|
-
//remove it first, a reconfiguration triggered by placing them must not place them a second time
|
|
491
|
-
delete this.stashedAccessoires[stashKey];
|
|
492
|
-
_context3.next = 7;
|
|
493
|
-
return this.placeStashedAccessoiresInGrid(gridIndex, stashedAccessoires);
|
|
494
|
-
case 7:
|
|
495
|
-
return _context3.abrupt("return", _context3.sent);
|
|
496
|
-
case 8:
|
|
497
|
-
case "end":
|
|
498
|
-
return _context3.stop();
|
|
499
|
-
}
|
|
500
|
-
}, _callee3, this);
|
|
501
|
-
}));
|
|
502
|
-
function placeStashedAccessoiresOfGrid(_x3) {
|
|
503
|
-
return _placeStashedAccessoiresOfGrid.apply(this, arguments);
|
|
504
|
-
}
|
|
505
|
-
return placeStashedAccessoiresOfGrid;
|
|
506
|
-
}() /** Places stashed accessoires that are grouped by gridIndex - used for the accessoires of an accessoire. */)
|
|
507
698
|
}, {
|
|
508
699
|
key: "placeStashedAccessoiresByGrid",
|
|
509
700
|
value: (function () {
|
|
510
701
|
var _placeStashedAccessoiresByGrid = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee4(stashedAccessoires) {
|
|
511
|
-
var
|
|
702
|
+
var mapByFamily,
|
|
703
|
+
gridIndexes,
|
|
704
|
+
i,
|
|
705
|
+
gridIndex,
|
|
706
|
+
grid,
|
|
707
|
+
stashed,
|
|
708
|
+
_args4 = arguments;
|
|
512
709
|
return _regeneratorRuntime__default["default"].wrap(function _callee4$(_context4) {
|
|
513
710
|
while (1) switch (_context4.prev = _context4.next) {
|
|
514
711
|
case 0:
|
|
712
|
+
mapByFamily = _args4.length > 1 && _args4[1] !== undefined ? _args4[1] : false;
|
|
515
713
|
gridIndexes = Object.keys(stashedAccessoires);
|
|
516
714
|
i = 0;
|
|
517
|
-
case
|
|
715
|
+
case 3:
|
|
518
716
|
if (!(i < gridIndexes.length)) {
|
|
519
|
-
_context4.next =
|
|
717
|
+
_context4.next = 19;
|
|
520
718
|
break;
|
|
521
719
|
}
|
|
522
720
|
gridIndex = Number(gridIndexes[i]);
|
|
523
721
|
grid = this.getGridByIndex(gridIndex);
|
|
524
722
|
stashed = stashedAccessoires[gridIndex]; //the accessoire was created new, its grids run their own rule entry with that entry's initAcc in place. A grid that
|
|
525
723
|
//runs another entry than the remembered accessoires were planned under keeps them
|
|
526
|
-
if (!(!grid || grid.CurrentLoadedRuleIndex !== stashed.ruleIndex)) {
|
|
527
|
-
_context4.next =
|
|
724
|
+
if (!(!grid || !mapByFamily && grid.CurrentLoadedRuleIndex !== stashed.ruleIndex)) {
|
|
725
|
+
_context4.next = 9;
|
|
528
726
|
break;
|
|
529
727
|
}
|
|
530
|
-
return _context4.abrupt("continue",
|
|
531
|
-
case
|
|
532
|
-
_context4.next =
|
|
728
|
+
return _context4.abrupt("continue", 16);
|
|
729
|
+
case 9:
|
|
730
|
+
_context4.next = 11;
|
|
533
731
|
return grid.deleteAllAccOfGrid();
|
|
534
|
-
case
|
|
535
|
-
_context4.next =
|
|
536
|
-
return this.placeStashedAccessoiresInGrid(gridIndex, stashed.accessoires);
|
|
537
|
-
case
|
|
732
|
+
case 11:
|
|
733
|
+
_context4.next = 13;
|
|
734
|
+
return this.placeStashedAccessoiresInGrid(gridIndex, stashed.accessoires, mapByFamily);
|
|
735
|
+
case 13:
|
|
538
736
|
if (_context4.sent) {
|
|
539
|
-
_context4.next =
|
|
737
|
+
_context4.next = 16;
|
|
540
738
|
break;
|
|
541
739
|
}
|
|
542
|
-
_context4.next =
|
|
740
|
+
_context4.next = 16;
|
|
543
741
|
return this.initAccList(gridIndex);
|
|
544
|
-
case
|
|
742
|
+
case 16:
|
|
545
743
|
i++;
|
|
546
|
-
_context4.next =
|
|
744
|
+
_context4.next = 3;
|
|
547
745
|
break;
|
|
548
|
-
case
|
|
746
|
+
case 19:
|
|
549
747
|
case "end":
|
|
550
748
|
return _context4.stop();
|
|
551
749
|
}
|
|
552
750
|
}, _callee4, this);
|
|
553
751
|
}));
|
|
554
|
-
function placeStashedAccessoiresByGrid(
|
|
752
|
+
function placeStashedAccessoiresByGrid(_x5) {
|
|
555
753
|
return _placeStashedAccessoiresByGrid.apply(this, arguments);
|
|
556
754
|
}
|
|
557
755
|
return placeStashedAccessoiresByGrid;
|
|
558
|
-
}()
|
|
756
|
+
}()
|
|
757
|
+
/**
|
|
758
|
+
* @param mapByFamily an accessoire the grid does not allow is placed as the member of its family the grid allows
|
|
759
|
+
* @returns how many of the stashed accessoires were placed
|
|
760
|
+
*/
|
|
761
|
+
)
|
|
559
762
|
}, {
|
|
560
763
|
key: "placeStashedAccessoiresInGrid",
|
|
561
764
|
value: (function () {
|
|
562
765
|
var _placeStashedAccessoiresInGrid = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee5(gridIndex, stashedAccessoires) {
|
|
563
|
-
var
|
|
766
|
+
var mapByFamily,
|
|
767
|
+
placedAccessoires,
|
|
768
|
+
grid,
|
|
769
|
+
i,
|
|
770
|
+
stashed,
|
|
771
|
+
result,
|
|
772
|
+
_iterator2,
|
|
773
|
+
_step2,
|
|
774
|
+
articleCodex,
|
|
775
|
+
fitResult,
|
|
776
|
+
accessoire,
|
|
777
|
+
replaced,
|
|
778
|
+
variantValues,
|
|
779
|
+
_args5 = arguments;
|
|
564
780
|
return _regeneratorRuntime__default["default"].wrap(function _callee5$(_context5) {
|
|
565
781
|
while (1) switch (_context5.prev = _context5.next) {
|
|
566
782
|
case 0:
|
|
783
|
+
mapByFamily = _args5.length > 2 && _args5[2] !== undefined ? _args5[2] : false;
|
|
567
784
|
placedAccessoires = 0;
|
|
568
785
|
grid = this.getGridByIndex(gridIndex);
|
|
569
786
|
if (grid) {
|
|
570
|
-
_context5.next =
|
|
787
|
+
_context5.next = 5;
|
|
571
788
|
break;
|
|
572
789
|
}
|
|
573
790
|
return _context5.abrupt("return", placedAccessoires);
|
|
574
|
-
case 4:
|
|
575
|
-
i = 0;
|
|
576
791
|
case 5:
|
|
792
|
+
i = 0;
|
|
793
|
+
case 6:
|
|
577
794
|
if (!(i < stashedAccessoires.length)) {
|
|
578
|
-
_context5.next =
|
|
795
|
+
_context5.next = 53;
|
|
579
796
|
break;
|
|
580
797
|
}
|
|
581
798
|
stashed = stashedAccessoires[i];
|
|
582
|
-
|
|
583
|
-
|
|
799
|
+
result = false;
|
|
800
|
+
_iterator2 = _createForOfIteratorHelper(mapByFamily ? this.familyCandidates(grid, stashed.articleCodex) : [stashed.articleCodex]);
|
|
801
|
+
_context5.prev = 10;
|
|
802
|
+
_iterator2.s();
|
|
803
|
+
case 12:
|
|
804
|
+
if ((_step2 = _iterator2.n()).done) {
|
|
805
|
+
_context5.next = 23;
|
|
806
|
+
break;
|
|
807
|
+
}
|
|
808
|
+
articleCodex = _step2.value;
|
|
809
|
+
grid.ActAccessoire = articleCodex;
|
|
810
|
+
_context5.next = 17;
|
|
584
811
|
return index.setHandlerInstance.addAccessorieOnShelfPlanner(this.article.set, gridIndex, stashed.cellIndex, this.article.basketId, {
|
|
585
812
|
noMove: stashed.noMove,
|
|
586
813
|
noDelete: stashed.noDelete,
|
|
587
|
-
byInit: true
|
|
814
|
+
byInit: true,
|
|
815
|
+
onlyOfferedCells: mapByFamily
|
|
588
816
|
});
|
|
589
|
-
case
|
|
817
|
+
case 17:
|
|
590
818
|
result = _context5.sent;
|
|
591
819
|
grid.ActAccessoire = undefined;
|
|
592
|
-
|
|
820
|
+
if (!isPlaced(result)) {
|
|
821
|
+
_context5.next = 21;
|
|
822
|
+
break;
|
|
823
|
+
}
|
|
824
|
+
return _context5.abrupt("break", 23);
|
|
825
|
+
case 21:
|
|
826
|
+
_context5.next = 12;
|
|
827
|
+
break;
|
|
828
|
+
case 23:
|
|
829
|
+
_context5.next = 28;
|
|
830
|
+
break;
|
|
831
|
+
case 25:
|
|
832
|
+
_context5.prev = 25;
|
|
833
|
+
_context5.t0 = _context5["catch"](10);
|
|
834
|
+
_iterator2.e(_context5.t0);
|
|
835
|
+
case 28:
|
|
836
|
+
_context5.prev = 28;
|
|
837
|
+
_iterator2.f();
|
|
838
|
+
return _context5.finish(28);
|
|
839
|
+
case 31:
|
|
840
|
+
//a failed fit still returns its result, with the temporary article already deleted
|
|
841
|
+
fitResult = mapByFamily ? isPlaced(result) ? result : undefined : result === false || result.index === undefined ? undefined : result;
|
|
593
842
|
accessoire = fitResult === null || fitResult === void 0 ? void 0 : fitResult.accessoire;
|
|
843
|
+
if (!(mapByFamily && (!fitResult || !accessoire))) {
|
|
844
|
+
_context5.next = 36;
|
|
845
|
+
break;
|
|
846
|
+
}
|
|
847
|
+
//carrying over is a best effort - what has no fitting family member in this grid is left out
|
|
848
|
+
this.logShelfDebug({
|
|
849
|
+
phase: 'configChanged',
|
|
850
|
+
action: 'accessoryNotTransferred',
|
|
851
|
+
gridIndex: gridIndex,
|
|
852
|
+
cellIndex: stashed.cellIndex,
|
|
853
|
+
articleCodex: stashed.articleCodex,
|
|
854
|
+
detail: 'no member of its family fits into this grid'
|
|
855
|
+
});
|
|
856
|
+
return _context5.abrupt("continue", 50);
|
|
857
|
+
case 36:
|
|
594
858
|
if (!(!fitResult || !accessoire)) {
|
|
595
|
-
_context5.next =
|
|
859
|
+
_context5.next = 39;
|
|
596
860
|
break;
|
|
597
861
|
}
|
|
598
862
|
LOG.error(new DivaUtils.DivaError('shelfaccessoire of a switched off grid does not fit anymore and gets dropped', {
|
|
@@ -606,37 +870,46 @@ var ShelfPlanner = /*#__PURE__*/function () {
|
|
|
606
870
|
parentBasketId: this.article.basketId
|
|
607
871
|
}
|
|
608
872
|
}));
|
|
609
|
-
return _context5.abrupt("continue",
|
|
610
|
-
case
|
|
873
|
+
return _context5.abrupt("continue", 50);
|
|
874
|
+
case 39:
|
|
611
875
|
accessoire.quantity = stashed.quantity;
|
|
612
876
|
placedAccessoires++;
|
|
877
|
+
replaced = accessoire.articleCodex !== stashed.articleCodex;
|
|
878
|
+
if (mapByFamily) this.logShelfDebug({
|
|
879
|
+
phase: 'configChanged',
|
|
880
|
+
action: 'accessoryTransferred',
|
|
881
|
+
gridIndex: gridIndex,
|
|
882
|
+
cellIndex: stashed.cellIndex,
|
|
883
|
+
articleCodex: accessoire.articleCodex,
|
|
884
|
+
detail: replaced ? "as family member of ".concat(stashed.articleCodex) : 'same article'
|
|
885
|
+
});
|
|
613
886
|
variantValues = this.valuesToPlaceAgain(stashed, accessoire);
|
|
614
887
|
if (!Object.keys(variantValues).length) {
|
|
615
|
-
_context5.next =
|
|
888
|
+
_context5.next = 47;
|
|
616
889
|
break;
|
|
617
890
|
}
|
|
618
|
-
_context5.next =
|
|
891
|
+
_context5.next = 47;
|
|
619
892
|
return index.articleHandlerInstance.updateCfgValues(accessoire, variantValues, {});
|
|
620
|
-
case
|
|
893
|
+
case 47:
|
|
621
894
|
if (!accessoire.shelfPlanner) {
|
|
622
|
-
_context5.next =
|
|
895
|
+
_context5.next = 50;
|
|
623
896
|
break;
|
|
624
897
|
}
|
|
625
|
-
_context5.next =
|
|
626
|
-
return accessoire.shelfPlanner.placeStashedAccessoiresByGrid(stashed.accessoires);
|
|
627
|
-
case
|
|
898
|
+
_context5.next = 50;
|
|
899
|
+
return accessoire.shelfPlanner.placeStashedAccessoiresByGrid(stashed.accessoires, mapByFamily || replaced);
|
|
900
|
+
case 50:
|
|
628
901
|
i++;
|
|
629
|
-
_context5.next =
|
|
902
|
+
_context5.next = 6;
|
|
630
903
|
break;
|
|
631
|
-
case
|
|
904
|
+
case 53:
|
|
632
905
|
return _context5.abrupt("return", placedAccessoires);
|
|
633
|
-
case
|
|
906
|
+
case 54:
|
|
634
907
|
case "end":
|
|
635
908
|
return _context5.stop();
|
|
636
909
|
}
|
|
637
|
-
}, _callee5, this);
|
|
910
|
+
}, _callee5, this, [[10, 25, 28, 31]]);
|
|
638
911
|
}));
|
|
639
|
-
function placeStashedAccessoiresInGrid(
|
|
912
|
+
function placeStashedAccessoiresInGrid(_x6, _x7) {
|
|
640
913
|
return _placeStashedAccessoiresInGrid.apply(this, arguments);
|
|
641
914
|
}
|
|
642
915
|
return placeStashedAccessoiresInGrid;
|
|
@@ -658,17 +931,17 @@ var ShelfPlanner = /*#__PURE__*/function () {
|
|
|
658
931
|
});
|
|
659
932
|
if (!ownInheritableCodices.length) return variantValues;
|
|
660
933
|
var inheritedNow = (_ShelfPlanner$addValu = ShelfPlanner.addValuesPassedOnBy(this.article, this.valuesPassedOnByParents())[accessoire.basketId]) !== null && _ShelfPlanner$addValu !== void 0 ? _ShelfPlanner$addValu : {};
|
|
661
|
-
var
|
|
662
|
-
|
|
934
|
+
var _iterator3 = _createForOfIteratorHelper(ownInheritableCodices),
|
|
935
|
+
_step3;
|
|
663
936
|
try {
|
|
664
|
-
for (
|
|
665
|
-
var codex =
|
|
937
|
+
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
938
|
+
var codex = _step3.value;
|
|
666
939
|
if (inheritedNow[codex] !== undefined && inheritedNow[codex] !== stashed.inheritedValues[codex]) delete variantValues[codex];
|
|
667
940
|
}
|
|
668
941
|
} catch (err) {
|
|
669
|
-
|
|
942
|
+
_iterator3.e(err);
|
|
670
943
|
} finally {
|
|
671
|
-
|
|
944
|
+
_iterator3.f();
|
|
672
945
|
}
|
|
673
946
|
return variantValues;
|
|
674
947
|
}
|
|
@@ -681,7 +954,7 @@ var ShelfPlanner = /*#__PURE__*/function () {
|
|
|
681
954
|
key: "initAccList",
|
|
682
955
|
value: (function () {
|
|
683
956
|
var _initAccList = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee6(gridIndex) {
|
|
684
|
-
var grids, i, grid, j, initAcc, k, _this$article$
|
|
957
|
+
var grids, i, grid, heldByFamily, j, _this$article$Catalog, _this$article$Catalog2, _heldByFamily$get, initAcc, family, held, placed, k, parentIsReal, _this$article$accesso3, shelfId, accessoires, _accessoireToDelete$s, accessoireToDelete, rh;
|
|
685
958
|
return _regeneratorRuntime__default["default"].wrap(function _callee6$(_context6) {
|
|
686
959
|
while (1) switch (_context6.prev = _context6.next) {
|
|
687
960
|
case 0:
|
|
@@ -689,7 +962,7 @@ var ShelfPlanner = /*#__PURE__*/function () {
|
|
|
689
962
|
i = 0;
|
|
690
963
|
case 2:
|
|
691
964
|
if (!(i < grids.length)) {
|
|
692
|
-
_context6.next =
|
|
965
|
+
_context6.next = 43;
|
|
693
966
|
break;
|
|
694
967
|
}
|
|
695
968
|
grid = grids[i];
|
|
@@ -697,25 +970,31 @@ var ShelfPlanner = /*#__PURE__*/function () {
|
|
|
697
970
|
_context6.next = 6;
|
|
698
971
|
break;
|
|
699
972
|
}
|
|
700
|
-
return _context6.abrupt("continue",
|
|
973
|
+
return _context6.abrupt("continue", 40);
|
|
701
974
|
case 6:
|
|
702
975
|
if (grid.InitAccArr) {
|
|
703
976
|
_context6.next = 8;
|
|
704
977
|
break;
|
|
705
978
|
}
|
|
706
|
-
return _context6.abrupt("continue",
|
|
979
|
+
return _context6.abrupt("continue", 40);
|
|
707
980
|
case 8:
|
|
981
|
+
//only tops up: what the grid held of a family before (eg a carried over Kleiderstange in another cell) counts once
|
|
982
|
+
heldByFamily = new Map();
|
|
708
983
|
j = 0;
|
|
709
|
-
case
|
|
984
|
+
case 10:
|
|
710
985
|
if (!(j < grid.InitAccArr.length)) {
|
|
711
|
-
_context6.next =
|
|
986
|
+
_context6.next = 40;
|
|
712
987
|
break;
|
|
713
988
|
}
|
|
714
989
|
initAcc = grid.InitAccArr[j];
|
|
715
|
-
|
|
716
|
-
|
|
990
|
+
family = (_this$article$Catalog = (_this$article$Catalog2 = this.article.CatalogData.allCatalogArticles[initAcc.Codex]) === null || _this$article$Catalog2 === void 0 ? void 0 : _this$article$Catalog2.accessoireFamily) !== null && _this$article$Catalog !== void 0 ? _this$article$Catalog : initAcc.Codex;
|
|
991
|
+
held = (_heldByFamily$get = heldByFamily.get(family)) !== null && _heldByFamily$get !== void 0 ? _heldByFamily$get : this.countPlacedOfFamily(grid, initAcc.Codex);
|
|
992
|
+
placed = Math.min(held, initAcc.initRH.length);
|
|
993
|
+
heldByFamily.set(family, held - placed);
|
|
994
|
+
k = placed;
|
|
995
|
+
case 17:
|
|
717
996
|
if (!(k < initAcc.initRH.length)) {
|
|
718
|
-
_context6.next =
|
|
997
|
+
_context6.next = 37;
|
|
719
998
|
break;
|
|
720
999
|
}
|
|
721
1000
|
grid.ActAccessoire = initAcc.Codex;
|
|
@@ -727,56 +1006,58 @@ var ShelfPlanner = /*#__PURE__*/function () {
|
|
|
727
1006
|
articleCodex: initAcc.Codex,
|
|
728
1007
|
detail: 'from InitAccArr — a missing matching accessoryPlaced entry right after means the init placement failed'
|
|
729
1008
|
});
|
|
730
|
-
_context6.next =
|
|
1009
|
+
_context6.next = 22;
|
|
731
1010
|
return index.setHandlerInstance.addAccessorieOnShelfPlanner(this.article.set, grid.ShelfIndex, initAcc.initRH[k], grid.basketId, {
|
|
732
1011
|
noMove: initAcc.noMove,
|
|
733
1012
|
noDelete: initAcc.noDelete,
|
|
734
1013
|
byInit: true
|
|
735
1014
|
});
|
|
736
|
-
case
|
|
737
|
-
|
|
738
|
-
|
|
1015
|
+
case 22:
|
|
1016
|
+
//UseCase Atlantis Kleiderstange gets deleted on parent - not by a dry run, its parent is the real shelf it previews in
|
|
1017
|
+
parentIsReal = !index.setHandlerInstance.isDryRunArticle(this.article.accessoireParentArticle);
|
|
1018
|
+
if (!(initAcc.replaceFromParent && !(index.setHandlerInstance.isDryRunArticle(this.article) && parentIsReal))) {
|
|
1019
|
+
_context6.next = 33;
|
|
739
1020
|
break;
|
|
740
1021
|
}
|
|
741
1022
|
shelfId = this.getShelfParentShelfId();
|
|
742
|
-
if (!(shelfId && (_this$article$
|
|
743
|
-
_context6.next =
|
|
1023
|
+
if (!(shelfId && (_this$article$accesso3 = this.article.accessoireParentArticle) !== null && _this$article$accesso3 !== void 0 && _this$article$accesso3.shelfPlanner)) {
|
|
1024
|
+
_context6.next = 33;
|
|
744
1025
|
break;
|
|
745
1026
|
}
|
|
746
1027
|
accessoires = this.article.accessoireParentArticle.shelfPlanner.getAccessorireByCodex(shelfId, initAcc.Codex);
|
|
747
1028
|
if (!(accessoires && accessoires.length > 0)) {
|
|
748
|
-
_context6.next =
|
|
1029
|
+
_context6.next = 33;
|
|
749
1030
|
break;
|
|
750
1031
|
}
|
|
751
1032
|
accessoireToDelete = accessoires[0];
|
|
752
1033
|
rh = (_accessoireToDelete$s = accessoireToDelete.shelfPlanner) === null || _accessoireToDelete$s === void 0 ? void 0 : _accessoireToDelete$s.getRHOnParentArticle();
|
|
753
1034
|
if (!(rh !== undefined && accessoireToDelete.relatedToShelfGrid !== undefined)) {
|
|
754
|
-
_context6.next =
|
|
1035
|
+
_context6.next = 33;
|
|
755
1036
|
break;
|
|
756
1037
|
}
|
|
757
|
-
_context6.next =
|
|
1038
|
+
_context6.next = 33;
|
|
758
1039
|
return index.setHandlerInstance.deleteAccessorieOnShelfPlanner(this.article.set, accessoireToDelete.relatedToShelfGrid, rh, this.article.accessoireParentArticle.basketId);
|
|
759
|
-
case
|
|
1040
|
+
case 33:
|
|
760
1041
|
grid.ActAccessoire = undefined;
|
|
761
|
-
case
|
|
1042
|
+
case 34:
|
|
762
1043
|
k++;
|
|
763
|
-
_context6.next =
|
|
1044
|
+
_context6.next = 17;
|
|
764
1045
|
break;
|
|
765
|
-
case
|
|
1046
|
+
case 37:
|
|
766
1047
|
j++;
|
|
767
|
-
_context6.next =
|
|
1048
|
+
_context6.next = 10;
|
|
768
1049
|
break;
|
|
769
|
-
case
|
|
1050
|
+
case 40:
|
|
770
1051
|
i++;
|
|
771
1052
|
_context6.next = 2;
|
|
772
1053
|
break;
|
|
773
|
-
case
|
|
1054
|
+
case 43:
|
|
774
1055
|
case "end":
|
|
775
1056
|
return _context6.stop();
|
|
776
1057
|
}
|
|
777
1058
|
}, _callee6, this);
|
|
778
1059
|
}));
|
|
779
|
-
function initAccList(
|
|
1060
|
+
function initAccList(_x8) {
|
|
780
1061
|
return _initAccList.apply(this, arguments);
|
|
781
1062
|
}
|
|
782
1063
|
return initAccList;
|
|
@@ -866,7 +1147,7 @@ var ShelfPlanner = /*#__PURE__*/function () {
|
|
|
866
1147
|
}
|
|
867
1148
|
}, _callee7, this);
|
|
868
1149
|
}));
|
|
869
|
-
function triggerVisibility(
|
|
1150
|
+
function triggerVisibility(_x9) {
|
|
870
1151
|
return _triggerVisibility.apply(this, arguments);
|
|
871
1152
|
}
|
|
872
1153
|
return triggerVisibility;
|
|
@@ -953,6 +1234,21 @@ var ShelfPlanner = /*#__PURE__*/function () {
|
|
|
953
1234
|
}
|
|
954
1235
|
}
|
|
955
1236
|
|
|
1237
|
+
/**
|
|
1238
|
+
* `tryFitOnShelfOfGrid` limited to the cells `getFreeSpacesOfAccessoire` offers (an active grid, room above and below,
|
|
1239
|
+
* neighbour and montage rules) - for a placement nobody picked by hand: a carry-over or a family swap.
|
|
1240
|
+
*/
|
|
1241
|
+
}, {
|
|
1242
|
+
key: "tryFitOnOfferedCellOfGrid",
|
|
1243
|
+
value: function tryFitOnOfferedCellOfGrid(gridIndex, cellIndex, accessoire) {
|
|
1244
|
+
var fit = this.tryFitOnShelfOfGrid(gridIndex, cellIndex, accessoire);
|
|
1245
|
+
if (fit === false || fit.index === undefined || fit.type === 'doesNotFit' || fit.type.startsWith('notAllowed')) return fit;
|
|
1246
|
+
return this.grids[gridIndex].getFreeSpacesOfAccessoire(accessoire).includes(fit.index) ? fit : {
|
|
1247
|
+
type: 'doesNotFit',
|
|
1248
|
+
size: fit.size
|
|
1249
|
+
};
|
|
1250
|
+
}
|
|
1251
|
+
|
|
956
1252
|
/**
|
|
957
1253
|
*
|
|
958
1254
|
* @param gridName
|
|
@@ -1045,7 +1341,7 @@ var ShelfPlanner = /*#__PURE__*/function () {
|
|
|
1045
1341
|
}
|
|
1046
1342
|
}, _callee9, this);
|
|
1047
1343
|
}));
|
|
1048
|
-
function deleteAccessoireOfCellInGrid(
|
|
1344
|
+
function deleteAccessoireOfCellInGrid(_x10, _x11) {
|
|
1049
1345
|
return _deleteAccessoireOfCellInGrid.apply(this, arguments);
|
|
1050
1346
|
}
|
|
1051
1347
|
return deleteAccessoireOfCellInGrid;
|
|
@@ -1081,7 +1377,7 @@ var ShelfPlanner = /*#__PURE__*/function () {
|
|
|
1081
1377
|
key: "handleDeleteTakePlaceOnOtherGrids",
|
|
1082
1378
|
value: (function () {
|
|
1083
1379
|
var _handleDeleteTakePlaceOnOtherGrids = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee10(gridIndex, cellIndex, accessoire) {
|
|
1084
|
-
var i, _cell$
|
|
1380
|
+
var i, _cell$Article2, cell, _i7, _cell$Article3, _cell, _i8;
|
|
1085
1381
|
return _regeneratorRuntime__default["default"].wrap(function _callee10$(_context10) {
|
|
1086
1382
|
while (1) switch (_context10.prev = _context10.next) {
|
|
1087
1383
|
case 0:
|
|
@@ -1094,7 +1390,7 @@ var ShelfPlanner = /*#__PURE__*/function () {
|
|
|
1094
1390
|
if (accessoire.shelfHeightAbove) {
|
|
1095
1391
|
for (i = 0; i < accessoire.shelfHeightAbove; i++) {
|
|
1096
1392
|
cell = this.grids[gridIndex].Cells[cellIndex + accessoire.shelfHeight + i];
|
|
1097
|
-
if ((cell === null || cell === void 0 || (_cell$
|
|
1393
|
+
if ((cell === null || cell === void 0 || (_cell$Article2 = cell.Article) === null || _cell$Article2 === void 0 ? void 0 : _cell$Article2.basketId) === accessoire.basketId) {
|
|
1098
1394
|
cell.ClearInUse();
|
|
1099
1395
|
}
|
|
1100
1396
|
}
|
|
@@ -1102,7 +1398,7 @@ var ShelfPlanner = /*#__PURE__*/function () {
|
|
|
1102
1398
|
if (accessoire.shelfHeightBelow) {
|
|
1103
1399
|
for (_i7 = 0; _i7 < accessoire.shelfHeightBelow; _i7++) {
|
|
1104
1400
|
_cell = this.grids[gridIndex].Cells[cellIndex - (_i7 + 1)];
|
|
1105
|
-
if ((_cell === null || _cell === void 0 || (_cell$
|
|
1401
|
+
if ((_cell === null || _cell === void 0 || (_cell$Article3 = _cell.Article) === null || _cell$Article3 === void 0 ? void 0 : _cell$Article3.basketId) === accessoire.basketId) {
|
|
1106
1402
|
_cell.ClearInUse();
|
|
1107
1403
|
}
|
|
1108
1404
|
}
|
|
@@ -1135,7 +1431,7 @@ var ShelfPlanner = /*#__PURE__*/function () {
|
|
|
1135
1431
|
}
|
|
1136
1432
|
}, _callee10, this);
|
|
1137
1433
|
}));
|
|
1138
|
-
function handleDeleteTakePlaceOnOtherGrids(
|
|
1434
|
+
function handleDeleteTakePlaceOnOtherGrids(_x12, _x13, _x14) {
|
|
1139
1435
|
return _handleDeleteTakePlaceOnOtherGrids.apply(this, arguments);
|
|
1140
1436
|
}
|
|
1141
1437
|
return handleDeleteTakePlaceOnOtherGrids;
|
|
@@ -1200,7 +1496,7 @@ var ShelfPlanner = /*#__PURE__*/function () {
|
|
|
1200
1496
|
}
|
|
1201
1497
|
}, _callee11, this);
|
|
1202
1498
|
}));
|
|
1203
|
-
function addAccessoireInCellInGrid(
|
|
1499
|
+
function addAccessoireInCellInGrid(_x15, _x16, _x17, _x18, _x19) {
|
|
1204
1500
|
return _addAccessoireInCellInGrid.apply(this, arguments);
|
|
1205
1501
|
}
|
|
1206
1502
|
return addAccessoireInCellInGrid;
|
|
@@ -1306,10 +1602,10 @@ var ShelfPlanner = /*#__PURE__*/function () {
|
|
|
1306
1602
|
});
|
|
1307
1603
|
if (grid.ShelfIndex != i) cells[j].gridIndex = grid.ShelfIndex;
|
|
1308
1604
|
if (cell.InUse == j) {
|
|
1309
|
-
var _cell$
|
|
1605
|
+
var _cell$Article4, _cell$Article5;
|
|
1310
1606
|
cells[j].usedArticleData = {
|
|
1311
|
-
Codex: (_cell$
|
|
1312
|
-
BasketID: (_cell$
|
|
1607
|
+
Codex: (_cell$Article4 = cell.Article) === null || _cell$Article4 === void 0 ? void 0 : _cell$Article4.articleCodex,
|
|
1608
|
+
BasketID: (_cell$Article5 = cell.Article) === null || _cell$Article5 === void 0 ? void 0 : _cell$Article5.basketId
|
|
1313
1609
|
};
|
|
1314
1610
|
}
|
|
1315
1611
|
}
|
|
@@ -1335,13 +1631,13 @@ var ShelfPlanner = /*#__PURE__*/function () {
|
|
|
1335
1631
|
for (var j = 0; j < grid.Cells.length; j++) {
|
|
1336
1632
|
var cell = grid.Cells[j];
|
|
1337
1633
|
if (cell.InUse == j && cell.Article && cell.Article.model3DName && !cell.OnlyPlaceHolder) {
|
|
1338
|
-
var _cell$
|
|
1634
|
+
var _cell$Article6;
|
|
1339
1635
|
var cellIndex = cell.Index;
|
|
1340
1636
|
if (grid.Direction == 'vertikal' && this.article.CatalogData.useShelfPlannerRTV != true) {
|
|
1341
1637
|
cellIndex = grid.Cells.length - 1 - cell.Index;
|
|
1342
1638
|
}
|
|
1343
1639
|
accessoires.push({
|
|
1344
|
-
basketId: (_cell$
|
|
1640
|
+
basketId: (_cell$Article6 = cell.Article) === null || _cell$Article6 === void 0 ? void 0 : _cell$Article6.basketId,
|
|
1345
1641
|
gridId: grid.ShelfIndex,
|
|
1346
1642
|
gridName: grid.GridName,
|
|
1347
1643
|
model: cell.Article.model3DName,
|
|
@@ -1362,8 +1658,8 @@ var ShelfPlanner = /*#__PURE__*/function () {
|
|
|
1362
1658
|
}, {
|
|
1363
1659
|
key: "getShelfElementId",
|
|
1364
1660
|
value: function getShelfElementId() {
|
|
1365
|
-
var _this$article$
|
|
1366
|
-
if ((_this$article$
|
|
1661
|
+
var _this$article$accesso4;
|
|
1662
|
+
if ((_this$article$accesso4 = this.article.accessoireParentArticle) !== null && _this$article$accesso4 !== void 0 && _this$article$accesso4.shelfPlanner && this.article.relatedToShelfGrid !== undefined && this.grids.length > 0) {
|
|
1367
1663
|
var rh = this.getRHOnParentArticle();
|
|
1368
1664
|
var parentId = this.article.accessoireParentArticle.shelfPlanner.getShelfElementId();
|
|
1369
1665
|
return parentId + '.' + this.article.relatedToShelfGrid + '.' + rh;
|
|
@@ -1378,13 +1674,13 @@ var ShelfPlanner = /*#__PURE__*/function () {
|
|
|
1378
1674
|
}, {
|
|
1379
1675
|
key: "getRHOnParentArticle",
|
|
1380
1676
|
value: function getRHOnParentArticle() {
|
|
1381
|
-
var _this$article$
|
|
1382
|
-
|
|
1677
|
+
var _this$article$accesso5,
|
|
1678
|
+
_this2 = this;
|
|
1383
1679
|
if (this.article.relatedToShelfGrid === undefined) return undefined;
|
|
1384
|
-
return (_this$article$
|
|
1680
|
+
return (_this$article$accesso5 = this.article.accessoireParentArticle) === null || _this$article$accesso5 === void 0 || (_this$article$accesso5 = _this$article$accesso5.shelfPlanner) === null || _this$article$accesso5 === void 0 || (_this$article$accesso5 = _this$article$accesso5.grids[this.article.relatedToShelfGrid].Cells.find(function (item) {
|
|
1385
1681
|
var _item$Article;
|
|
1386
|
-
return ((_item$Article = item.Article) === null || _item$Article === void 0 ? void 0 : _item$Article.basketId) ==
|
|
1387
|
-
})) === null || _this$article$
|
|
1682
|
+
return ((_item$Article = item.Article) === null || _item$Article === void 0 ? void 0 : _item$Article.basketId) == _this2.article.basketId;
|
|
1683
|
+
})) === null || _this$article$accesso5 === void 0 ? void 0 : _this$article$accesso5.InUse;
|
|
1388
1684
|
}
|
|
1389
1685
|
|
|
1390
1686
|
/**
|
|
@@ -1447,8 +1743,8 @@ var ShelfPlanner = /*#__PURE__*/function () {
|
|
|
1447
1743
|
}, {
|
|
1448
1744
|
key: "getShelfParentShelfId",
|
|
1449
1745
|
value: function getShelfParentShelfId() {
|
|
1450
|
-
var _this$article$
|
|
1451
|
-
if (this.article.relatedToShelfGrid !== undefined) return (_this$article$
|
|
1746
|
+
var _this$article$accesso6;
|
|
1747
|
+
if (this.article.relatedToShelfGrid !== undefined) return (_this$article$accesso6 = this.article.accessoireParentArticle) === null || _this$article$accesso6 === void 0 || (_this$article$accesso6 = _this$article$accesso6.shelfPlanner) === null || _this$article$accesso6 === void 0 || (_this$article$accesso6 = _this$article$accesso6.grids[this.article.relatedToShelfGrid]) === null || _this$article$accesso6 === void 0 ? void 0 : _this$article$accesso6.ShelfId;
|
|
1452
1748
|
return undefined;
|
|
1453
1749
|
}
|
|
1454
1750
|
|
|
@@ -1508,7 +1804,7 @@ var ShelfPlanner = /*#__PURE__*/function () {
|
|
|
1508
1804
|
key: "disableCellsByDockedShelfs",
|
|
1509
1805
|
value: (function () {
|
|
1510
1806
|
var _disableCellsByDockedShelfs = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee12(count) {
|
|
1511
|
-
var
|
|
1807
|
+
var _this3 = this;
|
|
1512
1808
|
var grids, _loop2, i;
|
|
1513
1809
|
return _regeneratorRuntime__default["default"].wrap(function _callee12$(_context13) {
|
|
1514
1810
|
while (1) switch (_context13.prev = _context13.next) {
|
|
@@ -1532,7 +1828,7 @@ var ShelfPlanner = /*#__PURE__*/function () {
|
|
|
1532
1828
|
newlyEnabled = grid.Cells.filter(function (cell, j) {
|
|
1533
1829
|
return cell.IsDisabled && !toDisableCells.includes(j);
|
|
1534
1830
|
}).length;
|
|
1535
|
-
if (newlyDisabled.length || newlyEnabled)
|
|
1831
|
+
if (newlyDisabled.length || newlyEnabled) _this3.logShelfDebug({
|
|
1536
1832
|
phase: 'docking',
|
|
1537
1833
|
action: 'disabledCellsUpdated',
|
|
1538
1834
|
gridIndex: grid.ShelfIndex,
|
|
@@ -1550,7 +1846,7 @@ var ShelfPlanner = /*#__PURE__*/function () {
|
|
|
1550
1846
|
break;
|
|
1551
1847
|
}
|
|
1552
1848
|
_context12.next = 14;
|
|
1553
|
-
return index.setHandlerInstance.deleteAccessorieOnShelfPlanner(
|
|
1849
|
+
return index.setHandlerInstance.deleteAccessorieOnShelfPlanner(_this3.article.set, grid.ShelfIndex, cell.InUse, grid.basketId);
|
|
1554
1850
|
case 14:
|
|
1555
1851
|
cell.IsDisabled = true;
|
|
1556
1852
|
case 15:
|
|
@@ -1598,7 +1894,7 @@ var ShelfPlanner = /*#__PURE__*/function () {
|
|
|
1598
1894
|
}
|
|
1599
1895
|
}, _callee12, this);
|
|
1600
1896
|
}));
|
|
1601
|
-
function disableCellsByDockedShelfs(
|
|
1897
|
+
function disableCellsByDockedShelfs(_x20) {
|
|
1602
1898
|
return _disableCellsByDockedShelfs.apply(this, arguments);
|
|
1603
1899
|
}
|
|
1604
1900
|
return disableCellsByDockedShelfs;
|