@configuratorware/configurator-admingui 1.53.9 → 1.54.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/App/Data.js +32 -15
- package/App/Reducers/Entity/Actions.js +6 -1
- package/App/Translations.js +0 -2
- package/Components/DefaultConnectedForm.js +4 -1
- package/Components/DefaultForm.js +4 -2
- package/Components/Form.js +2 -1
- package/Components/FormFragments/InputArray.js +2 -1
- package/Components/FormFragments/NestedDataComponent.js +3 -1
- package/Components/FormHooks/useDataSchema.js +6 -3
- package/Screens/Creator/Components/OptionPriceEditor.js +4 -2
- package/Screens/Creator/Components/OptionclassificationEditor.js +5 -4
- package/Screens/Designer/SubScreens/DesignAreas/Components/FormArray.js +13 -9
- package/Screens/Designer/SubScreens/Visualization/Containers/Edit/Edit.js +11 -2
- package/Screens/Login/Reducers/Actions.js +29 -4
- package/Screens/Setting/Reducers/Reducer.js +2 -1
- package/Screens/index.js +0 -3
- package/package.json +3 -3
- package/Screens/Assemblypointeditor/Components/AssemblypointTable.js +0 -125
- package/Screens/Assemblypointeditor/Components/Assemblypointeditor.js +0 -741
- package/Screens/Assemblypointeditor/Components/Styles.scss +0 -58
- package/Screens/Assemblypointeditor/Components/fabric.min.js +0 -1
- package/Screens/Assemblypointeditor/Containers/Edit.js +0 -65
- package/Screens/Assemblypointeditor/Containers/List.js +0 -42
- package/Screens/Assemblypointeditor/Reducers/Actions.js +0 -56
- package/Screens/Assemblypointeditor/Reducers/Reducer.js +0 -139
- package/Screens/Assemblypointeditor/Screen.js +0 -34
- package/Screens/Assemblypointeditor/Styles.scss +0 -38
- package/Screens/Assemblypointeditor/Translations.js +0 -14
- package/Screens/Assemblypointeditor/index.js +0 -14
package/App/Data.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.whiteSpacePattern = exports.validateDataObject = exports.identifierPattern = exports.getErrorsFromValidatedDataObject = exports["default"] = exports.DataValidator = void 0;
|
|
6
|
+
exports.whiteSpacePattern = exports.validateDataObject = exports.identifierWithUmlautsPattern = exports.identifierPattern = exports.getErrorsFromValidatedDataObject = exports["default"] = exports.DataValidator = void 0;
|
|
7
7
|
var _lodash = _interopRequireDefault(require("lodash"));
|
|
8
8
|
var _validate = require("validate.js");
|
|
9
9
|
var _isArray = _interopRequireDefault(require("lodash/isArray"));
|
|
@@ -20,6 +20,7 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
|
|
|
20
20
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
21
21
|
var whiteSpacePattern = exports.whiteSpacePattern = /^[\S]+$/;
|
|
22
22
|
var identifierPattern = exports.identifierPattern = /^[A-za-z0-9_.-]+$/;
|
|
23
|
+
var identifierWithUmlautsPattern = exports.identifierWithUmlautsPattern = /^[A-za-z0-9äöüÄÖÜß_.-]+$/;
|
|
23
24
|
_validate.validate.validators.nonEmptyArray = function (value, options) {
|
|
24
25
|
if (options && options === true && (0, _isArray["default"])(value) && value.length !== 0) {
|
|
25
26
|
return null;
|
|
@@ -45,8 +46,10 @@ _validate.validate.validators.numericOrEmpty = function (value, options) {
|
|
|
45
46
|
return _validate.validate.validators.numericality(value, options);
|
|
46
47
|
}
|
|
47
48
|
};
|
|
48
|
-
_validate.validate.validators.identifier = function (value, options) {
|
|
49
|
-
|
|
49
|
+
_validate.validate.validators.identifier = function (value, options, key, attributes, globalOptions) {
|
|
50
|
+
var allowUmlauts = (globalOptions === null || globalOptions === void 0 ? void 0 : globalOptions.allowUmlauts) || false;
|
|
51
|
+
var pattern = allowUmlauts ? identifierWithUmlautsPattern : identifierPattern;
|
|
52
|
+
if (options && options === true && typeof value === 'string' && value.match(pattern) && value.match(pattern)[0] === value) {
|
|
50
53
|
return null;
|
|
51
54
|
}
|
|
52
55
|
return (0, _i18n.t)('customValidators.identifier');
|
|
@@ -79,9 +82,15 @@ _validate.validate.validators.noWhitespace = function (value, options) {
|
|
|
79
82
|
var Data = exports["default"] = /*#__PURE__*/function () {
|
|
80
83
|
function Data(dataObject) {
|
|
81
84
|
var mutate = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
85
|
+
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
82
86
|
_classCallCheck(this, Data);
|
|
83
87
|
Data.instances++;
|
|
84
88
|
this._listeners = {};
|
|
89
|
+
Object.defineProperty(this, '_allowUmlauts', {
|
|
90
|
+
value: options.allowUmlauts,
|
|
91
|
+
writable: true,
|
|
92
|
+
enumerable: false
|
|
93
|
+
});
|
|
85
94
|
if (dataObject) {
|
|
86
95
|
this.init(dataObject, mutate);
|
|
87
96
|
}
|
|
@@ -236,7 +245,11 @@ var Data = exports["default"] = /*#__PURE__*/function () {
|
|
|
236
245
|
key: "validate",
|
|
237
246
|
value: function validate() {
|
|
238
247
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
239
|
-
var
|
|
248
|
+
var allowUmlauts = options.allowUmlauts !== undefined ? options.allowUmlauts : this._allowUmlauts;
|
|
249
|
+
var mergedOptions = _objectSpread(_objectSpread({}, options), {}, {
|
|
250
|
+
allowUmlauts: allowUmlauts
|
|
251
|
+
});
|
|
252
|
+
var isValid = this._validator.validate(mergedOptions);
|
|
240
253
|
this._trigger(Data.EventTypes.validate, {
|
|
241
254
|
isValid: isValid
|
|
242
255
|
});
|
|
@@ -315,13 +328,13 @@ var DataValidator = exports.DataValidator = /*#__PURE__*/function () {
|
|
|
315
328
|
for (var prop in this._data) {
|
|
316
329
|
var dataSchema = _lodash["default"].get(this._data[prop], 'schema');
|
|
317
330
|
if (dataSchema instanceof Data) {
|
|
318
|
-
isValid = dataSchema.validate() && isValid;
|
|
331
|
+
isValid = dataSchema.validate(options) && isValid;
|
|
319
332
|
}
|
|
320
333
|
}
|
|
321
334
|
var valueObject = options.valueObject,
|
|
322
335
|
idx = options.idx,
|
|
323
336
|
dataArr = options.dataArr;
|
|
324
|
-
isValid = _validateDataObject(this._data, valueObject, idx, dataArr) && isValid;
|
|
337
|
+
isValid = _validateDataObject(this._data, valueObject, idx, dataArr, options) && isValid;
|
|
325
338
|
this._validation.isDone = true;
|
|
326
339
|
return isValid;
|
|
327
340
|
}
|
|
@@ -356,7 +369,7 @@ var prepareConstraints = function prepareConstraints() {
|
|
|
356
369
|
});
|
|
357
370
|
return constraints;
|
|
358
371
|
};
|
|
359
|
-
var validateField = function validateField(prop, valueToValidate, idx, dataArr, dataObject) {
|
|
372
|
+
var validateField = function validateField(prop, valueToValidate, idx, dataArr, dataObject, validationOptions) {
|
|
360
373
|
var valid = true;
|
|
361
374
|
if (prop.constraints) {
|
|
362
375
|
var constraints = prepareConstraints({
|
|
@@ -364,12 +377,14 @@ var validateField = function validateField(prop, valueToValidate, idx, dataArr,
|
|
|
364
377
|
valueToValidate: valueToValidate,
|
|
365
378
|
idx: idx,
|
|
366
379
|
dataArr: dataArr,
|
|
367
|
-
dataObject: dataObject
|
|
380
|
+
dataObject: dataObject,
|
|
381
|
+
validationOptions: validationOptions
|
|
368
382
|
});
|
|
369
383
|
if (!constraints) {
|
|
370
384
|
return valid;
|
|
371
385
|
}
|
|
372
|
-
var
|
|
386
|
+
var globalOptions = _objectSpread({}, validationOptions);
|
|
387
|
+
var result = _validate.validate.single(valueToValidate, constraints, globalOptions);
|
|
373
388
|
if (Number.isInteger(idx) && idx >= 0) {
|
|
374
389
|
if (result) {
|
|
375
390
|
prop.error = prop.error || [];
|
|
@@ -386,32 +401,34 @@ var validateField = function validateField(prop, valueToValidate, idx, dataArr,
|
|
|
386
401
|
}
|
|
387
402
|
return valid;
|
|
388
403
|
};
|
|
389
|
-
var _validateDataObject = exports.validateDataObject = function validateDataObject(dataObject, valueObject, idx, dataArr) {
|
|
404
|
+
var _validateDataObject = exports.validateDataObject = function validateDataObject(dataObject, valueObject, idx, dataArr, validationOptions) {
|
|
390
405
|
var valid = true;
|
|
391
406
|
var _loop2 = function _loop2() {
|
|
392
407
|
var prop = dataObject[p];
|
|
408
|
+
if (!prop || _typeof(prop) !== 'object') {
|
|
409
|
+
return 1; // continue
|
|
410
|
+
}
|
|
393
411
|
prop.beforeValidate && prop.beforeValidate({
|
|
394
412
|
prop: prop,
|
|
395
413
|
idx: idx,
|
|
396
414
|
dataArr: dataArr
|
|
397
415
|
});
|
|
398
416
|
var valueToValidate = valueObject ? valueObject[p] : prop.value;
|
|
399
|
-
valid = validateField(prop, valueToValidate, idx, dataArr || prop.value, dataObject) && valid;
|
|
417
|
+
valid = validateField(prop, valueToValidate, idx, dataArr || prop.value, dataObject, validationOptions) && valid;
|
|
400
418
|
if (prop.schema) {
|
|
401
419
|
if (_lodash["default"].isArray(prop.value)) {
|
|
402
|
-
// validate all values against the schema rules
|
|
403
420
|
prop.value.forEach(function (value, idx) {
|
|
404
|
-
valid = _validateDataObject(prop.schema, value, idx, prop.value) && valid;
|
|
421
|
+
valid = _validateDataObject(prop.schema, value, idx, prop.value, validationOptions) && valid;
|
|
405
422
|
});
|
|
406
423
|
} else if (prop.value === null) {
|
|
407
424
|
// skip validation, if the value is null
|
|
408
425
|
} else {
|
|
409
|
-
valid = _validateDataObject(prop.schema, prop.value) && valid;
|
|
426
|
+
valid = _validateDataObject(prop.schema, prop.value, null, null, validationOptions) && valid;
|
|
410
427
|
}
|
|
411
428
|
}
|
|
412
429
|
};
|
|
413
430
|
for (var p in dataObject) {
|
|
414
|
-
_loop2();
|
|
431
|
+
if (_loop2()) continue;
|
|
415
432
|
}
|
|
416
433
|
return valid;
|
|
417
434
|
};
|
|
@@ -5,10 +5,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.reportUnsavedEntity = exports.reportDeleteEntities = exports.releaseUnsavedEntity = exports.initUnsavedEntity = exports.generateListActions = exports.generateDeleteAction = exports.generateDefaultActions = exports.dataIsModified = exports.cancelUnsavedEntityDialog = exports.cancelDeleteEntitiesDialog = exports.UNMOUNT_ENTITY = exports.SHOW_DETAILS = exports.SET_VALIDATION_ERRORS = exports.SET_VALIDATED_DATA = exports.SET_DATA_SOURCE = exports.SET_DATA = exports.REPORT_UNSAVED_ENTITY = exports.REPORT_DELETE_ENTITIES = exports.RELEASE_UNSAVED_ENTITY = exports.MOUNT_NEXT = exports.MOUNT_ENTITY = exports.MODIFIED_UNSAVED_ENTITY = exports.INIT_UNSAVED_ENTITY = exports.HIDE_DETAILS = exports.ENTITY_WILL_UNMOUNT = exports.ENTITY_WILL_MOUNT = exports.CANCEL_UNSAVED_ENTITY_DIALOG = exports.CANCEL_DELETE_ENTITIES_DIALOG = void 0;
|
|
7
7
|
var _Helpers = require("../Api/Helpers");
|
|
8
|
+
var _get = _interopRequireDefault(require("lodash/get"));
|
|
8
9
|
var _Actions = require("../Api/Actions");
|
|
9
10
|
var _Data = require("../../Data");
|
|
10
11
|
var _Actions2 = require("../Frame/Actions");
|
|
11
12
|
var _i18n = require("../../i18n");
|
|
13
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
12
14
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
13
15
|
function ownKeys(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; }
|
|
14
16
|
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(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; }
|
|
@@ -408,8 +410,11 @@ var generateDefaultActions = exports.generateDefaultActions = function generateD
|
|
|
408
410
|
var validateData = function validateData() {
|
|
409
411
|
return function (dispatch, getState) {
|
|
410
412
|
var state = getState();
|
|
413
|
+
var allowUmlauts = !!(0, _get["default"])(state, 'settingData.data.allowUmlautsInIdentifiers.value', false);
|
|
411
414
|
var data = new _Data.DataValidator(state[reducerName].data, false);
|
|
412
|
-
if (data.validate(
|
|
415
|
+
if (data.validate({
|
|
416
|
+
allowUmlauts: allowUmlauts
|
|
417
|
+
})) {
|
|
413
418
|
return true;
|
|
414
419
|
} else {
|
|
415
420
|
dispatch({
|
package/App/Translations.js
CHANGED
|
@@ -32,7 +32,6 @@ require("./i18n").use({
|
|
|
32
32
|
coredata: 'Core data',
|
|
33
33
|
productdata: 'All items',
|
|
34
34
|
creatoritems: 'creator',
|
|
35
|
-
assembly_points: 'Assembly points',
|
|
36
35
|
configurations: 'Saved configurations',
|
|
37
36
|
user_configuration: 'User configurations',
|
|
38
37
|
receive_offer_requests: 'Receive offer requests',
|
|
@@ -105,7 +104,6 @@ require("./i18n").use({
|
|
|
105
104
|
productdata: 'Alle Produkte',
|
|
106
105
|
creatoritems: 'creator',
|
|
107
106
|
designeritems: 'designer',
|
|
108
|
-
assembly_points: 'Anbaupunkte',
|
|
109
107
|
configurations: 'Gespeicherte Konfigurationen',
|
|
110
108
|
user_configuration: 'Nutzer-Konfigurationen',
|
|
111
109
|
receive_offer_requests: 'Angebotsanfragen',
|
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.generateMappings = exports.generateConnectedForm = exports["default"] = exports.connectDefault = exports.SaveAndStayButton = exports.CancelButton = void 0;
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
var _reactRedux = require("react-redux");
|
|
9
|
+
var _get = _interopRequireDefault(require("lodash/get"));
|
|
9
10
|
var _DefaultForm = require("./DefaultForm");
|
|
10
11
|
var _i18n = require("../App/i18n");
|
|
11
12
|
var _RaisedButton = _interopRequireDefault(require("../UIComponents/RaisedButton"));
|
|
@@ -20,8 +21,10 @@ var generateMappings = exports.generateMappings = function generateMappings(enti
|
|
|
20
21
|
return {
|
|
21
22
|
mapStateToProps: function mapStateToProps(state) {
|
|
22
23
|
var entityState = state[entityReducerName];
|
|
24
|
+
var allowUmlauts = !!(0, _get["default"])(state, 'settingData.data.allowUmlautsInIdentifiers.value', false);
|
|
23
25
|
return {
|
|
24
|
-
entityState: entityState
|
|
26
|
+
entityState: entityState,
|
|
27
|
+
allowUmlauts: allowUmlauts
|
|
25
28
|
};
|
|
26
29
|
},
|
|
27
30
|
mapDispatchToProps: function mapDispatchToProps(dispatch) {
|
|
@@ -41,7 +41,8 @@ var DefaultForm = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
|
41
41
|
onAction = _this$props.onAction,
|
|
42
42
|
config = _this$props.config,
|
|
43
43
|
closeAfterSave = _this$props.closeAfterSave,
|
|
44
|
-
customPostData = _this$props.customPostData
|
|
44
|
+
customPostData = _this$props.customPostData,
|
|
45
|
+
allowUmlauts = _this$props.allowUmlauts;
|
|
45
46
|
var actionButtons = config.actionButtons;
|
|
46
47
|
var onSubmit = customPostData ? customPostData : !closeAfterSave ? postData : function () {
|
|
47
48
|
return postData(true);
|
|
@@ -53,7 +54,8 @@ var DefaultForm = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
|
53
54
|
onSubmit: onSubmit,
|
|
54
55
|
onCancel: onCancel,
|
|
55
56
|
onAction: onAction,
|
|
56
|
-
actionButtons: actionButtons
|
|
57
|
+
actionButtons: actionButtons,
|
|
58
|
+
allowUmlauts: allowUmlauts
|
|
57
59
|
}) : /*#__PURE__*/_react["default"].createElement("div", null, (0, _i18n.T)('Loading entity data'), "...");
|
|
58
60
|
}
|
|
59
61
|
}]);
|
package/Components/Form.js
CHANGED
|
@@ -191,7 +191,8 @@ var ConfigurableForm = exports.ConfigurableForm = /*#__PURE__*/function (_Compon
|
|
|
191
191
|
onChange: _this.onChange,
|
|
192
192
|
onAction: _this.onAction,
|
|
193
193
|
renderWrappedInput: _this.renderWrappedInput,
|
|
194
|
-
helperText: input.helperText && (0, _i18n.T)(input.helperText)
|
|
194
|
+
helperText: input.helperText && (0, _i18n.T)(input.helperText),
|
|
195
|
+
allowUmlauts: _this.props.allowUmlauts
|
|
195
196
|
});
|
|
196
197
|
if (input.name) {
|
|
197
198
|
var field = input.name;
|
|
@@ -72,7 +72,8 @@ var InputArray = /*#__PURE__*/function (_Component) {
|
|
|
72
72
|
var dataArr = _this.props.value instanceof Array ? _this.props.value : undefined;
|
|
73
73
|
if (schema.validate({
|
|
74
74
|
dataArr: dataArr,
|
|
75
|
-
idx: selectedRow
|
|
75
|
+
idx: selectedRow,
|
|
76
|
+
allowUmlauts: _this.props.allowUmlauts
|
|
76
77
|
})) {
|
|
77
78
|
var value = _lodash["default"].isArray(_this.props.value) ? _this.props.value : [];
|
|
78
79
|
var data = schema.getData();
|
|
@@ -41,7 +41,9 @@ var nestedDataComponent = function nestedDataComponent(NestingComponent) {
|
|
|
41
41
|
if (schema instanceof _Data["default"]) {
|
|
42
42
|
data = schema;
|
|
43
43
|
} else {
|
|
44
|
-
data = new _Data["default"](schema
|
|
44
|
+
data = new _Data["default"](schema, false, {
|
|
45
|
+
allowUmlauts: _this.props.allowUmlauts
|
|
46
|
+
});
|
|
45
47
|
}
|
|
46
48
|
data.addListener(_Data["default"].EventTypes.validate, _this.onDataModified);
|
|
47
49
|
data.addListener(_Data["default"].EventTypes.setValue, _this.onDataModified);
|
|
@@ -29,7 +29,8 @@ function fillDataSchema(dataSchema, data) {
|
|
|
29
29
|
}
|
|
30
30
|
var useDataSchema = exports.useDataSchema = function useDataSchema(_ref) {
|
|
31
31
|
var dataSchema = _ref.dataSchema,
|
|
32
|
-
data = _ref.data
|
|
32
|
+
data = _ref.data,
|
|
33
|
+
allowUmlauts = _ref.allowUmlauts;
|
|
33
34
|
var _useState = (0, _react.useState)(fillDataSchema(dataSchema, data)),
|
|
34
35
|
_useState2 = _slicedToArray(_useState, 2),
|
|
35
36
|
currentData = _useState2[0],
|
|
@@ -39,13 +40,15 @@ var useDataSchema = exports.useDataSchema = function useDataSchema(_ref) {
|
|
|
39
40
|
}, [dataSchema, data]);
|
|
40
41
|
var validate = (0, _react.useCallback)(function () {
|
|
41
42
|
var validator = new _Data.DataValidator(currentData, false);
|
|
42
|
-
if (validator.validate(
|
|
43
|
+
if (validator.validate({
|
|
44
|
+
allowUmlauts: allowUmlauts
|
|
45
|
+
})) {
|
|
43
46
|
return true;
|
|
44
47
|
} else {
|
|
45
48
|
setCurrentData(validator.getValidatedData());
|
|
46
49
|
return false;
|
|
47
50
|
}
|
|
48
|
-
}, [currentData]);
|
|
51
|
+
}, [currentData, allowUmlauts]);
|
|
49
52
|
return {
|
|
50
53
|
currentData: currentData,
|
|
51
54
|
validate: validate
|
|
@@ -98,10 +98,12 @@ var OptionPriceEditor = exports.OptionPriceEditor = function OptionPriceEditor(p
|
|
|
98
98
|
var selectedOption = props.selectedOption,
|
|
99
99
|
product = props.product,
|
|
100
100
|
selectedComponent = props.selectedComponent,
|
|
101
|
-
showOptionPriceEditorDialog = props.showOptionPriceEditorDialog
|
|
101
|
+
showOptionPriceEditorDialog = props.showOptionPriceEditorDialog,
|
|
102
|
+
allowUmlauts = props.allowUmlauts;
|
|
102
103
|
var _useDataSchema = (0, _useDataSchema2.useDataSchema)({
|
|
103
104
|
dataSchema: deltaPriceDataSchema,
|
|
104
|
-
data: selectedOption
|
|
105
|
+
data: selectedOption,
|
|
106
|
+
allowUmlauts: allowUmlauts
|
|
105
107
|
}),
|
|
106
108
|
currentData = _useDataSchema.currentData,
|
|
107
109
|
validate = _useDataSchema.validate;
|
|
@@ -470,9 +470,9 @@ var OptionEditor = /*#__PURE__*/function (_React$Component5) {
|
|
|
470
470
|
}
|
|
471
471
|
}]);
|
|
472
472
|
}(_react["default"].Component);
|
|
473
|
-
function mapStateToProps(
|
|
474
|
-
var baseConfigurationData =
|
|
475
|
-
creatorData =
|
|
473
|
+
function mapStateToProps(state) {
|
|
474
|
+
var baseConfigurationData = state.baseConfigurationData,
|
|
475
|
+
creatorData = state.creatorData;
|
|
476
476
|
return {
|
|
477
477
|
showOptionSelectionDialog: baseConfigurationData.showOptionSelectionDialog,
|
|
478
478
|
selectedComponent: baseConfigurationData.selectedComponent,
|
|
@@ -482,7 +482,8 @@ function mapStateToProps(_ref4) {
|
|
|
482
482
|
options: baseConfigurationData.selectableOptions,
|
|
483
483
|
product: creatorData.source,
|
|
484
484
|
showOverrideOptionOrderSaveHint: baseConfigurationData.showOverrideOptionOrderSaveHint,
|
|
485
|
-
priceEditEnabled: _lodash["default"].get(baseConfigurationData, 'dataSources.settings.calculationMethod') === 'deltaprices'
|
|
485
|
+
priceEditEnabled: _lodash["default"].get(baseConfigurationData, 'dataSources.settings.calculationMethod') === 'deltaprices',
|
|
486
|
+
allowUmlauts: !!_lodash["default"].get(state, 'settingData.data.allowUmlautsInIdentifiers.value', false)
|
|
486
487
|
};
|
|
487
488
|
}
|
|
488
489
|
function mapDispatchToProps(dispatch) {
|
|
@@ -145,20 +145,24 @@ var FormArray = /*#__PURE__*/function (_Component) {
|
|
|
145
145
|
return _createClass(FormArray, [{
|
|
146
146
|
key: "initSchema",
|
|
147
147
|
value: function initSchema() {
|
|
148
|
-
var
|
|
149
|
-
|
|
148
|
+
var _this$props4 = this.props,
|
|
149
|
+
schema = _this$props4.schema,
|
|
150
|
+
allowUmlauts = _this$props4.allowUmlauts;
|
|
151
|
+
return new _Data["default"](schema, false, {
|
|
152
|
+
allowUmlauts: allowUmlauts
|
|
153
|
+
});
|
|
150
154
|
}
|
|
151
155
|
}, {
|
|
152
156
|
key: "render",
|
|
153
157
|
value: function render() {
|
|
154
158
|
var _this2 = this;
|
|
155
|
-
var _this$
|
|
156
|
-
label = _this$
|
|
157
|
-
formArray = _this$
|
|
158
|
-
value = _this$
|
|
159
|
-
errors = _this$
|
|
160
|
-
classes = _this$
|
|
161
|
-
props = _objectWithoutProperties(_this$
|
|
159
|
+
var _this$props5 = this.props,
|
|
160
|
+
label = _this$props5.label,
|
|
161
|
+
formArray = _this$props5.formArray,
|
|
162
|
+
value = _this$props5.value,
|
|
163
|
+
errors = _this$props5.errors,
|
|
164
|
+
classes = _this$props5.classes,
|
|
165
|
+
props = _objectWithoutProperties(_this$props5, _excluded);
|
|
162
166
|
var disableAdd = formArray.disableAdd,
|
|
163
167
|
FormComponent = formArray.FormComponent,
|
|
164
168
|
updateOnPropertyMatch = formArray.updateOnPropertyMatch;
|
|
@@ -15,6 +15,7 @@ var _merge = _interopRequireDefault(require("lodash/merge"));
|
|
|
15
15
|
var _withStyles = _interopRequireDefault(require("@material-ui/core/styles/withStyles"));
|
|
16
16
|
var _visualizationAdapterCreator = require("redhotmagma-visualization/visualizationAdapterCreator");
|
|
17
17
|
var _Constants = require("redhotmagma-visualization/Constants");
|
|
18
|
+
var _reactRedux = require("react-redux");
|
|
18
19
|
var _RemappedProps = require("../../../../../../Utils/HOCs/RemappedProps");
|
|
19
20
|
var _AsyncProps = require("../../../../../../Utils/HOCs/AsyncProps");
|
|
20
21
|
var _DefaultConnectedForm = require("../../../../../../Components/DefaultConnectedForm");
|
|
@@ -277,7 +278,10 @@ var VisualizationSettingsEdit = exports.VisualizationSettingsEdit = /*#__PURE__*
|
|
|
277
278
|
_defineProperty(_this, "updateData", function () {
|
|
278
279
|
var customData = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
279
280
|
var designAreas = (0, _get["default"])(_this.props, 'entityState.data.designAreas');
|
|
280
|
-
var
|
|
281
|
+
var allowUmlauts = _this.props.allowUmlauts || false;
|
|
282
|
+
var data = new _Data["default"](designAreas.schema, false, {
|
|
283
|
+
allowUmlauts: allowUmlauts
|
|
284
|
+
});
|
|
281
285
|
var previousData = (0, _Three2DEditor.fixIncompletePosition)(_this.getCurrentDesignAreaData());
|
|
282
286
|
var baseShapeData = previousData.baseShape || {
|
|
283
287
|
type: 'Plane'
|
|
@@ -869,4 +873,9 @@ var StyledVisualizationSettingsEdit = exports.StyledVisualizationSettingsEdit =
|
|
|
869
873
|
mode: mode
|
|
870
874
|
};
|
|
871
875
|
})(VisualizationSettingsEdit))));
|
|
872
|
-
var
|
|
876
|
+
var ConnectedEdit = (0, _DefaultConnectedForm.connectDefault)(StyledVisualizationSettingsEdit, _Actions.REDUCER_NAME, _Actions["default"].setFieldData, _Actions["default"].postData, _Actions["default"].hideDetails);
|
|
877
|
+
var _default = exports["default"] = (0, _reactRedux.connect)(function (state) {
|
|
878
|
+
return {
|
|
879
|
+
allowUmlauts: !!(0, _get["default"])(state, 'settingData.data.allowUmlautsInIdentifiers.value', false)
|
|
880
|
+
};
|
|
881
|
+
})(ConnectedEdit);
|
|
@@ -6,11 +6,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.setLicense = exports.postLoginData = exports.logout = exports.loginError = exports.SET_LICENSE = exports.LOGIN_SET_DATA = exports.LOGIN_RESET = exports.LOGIN_REDUCER_NAME = exports.LOGIN_ERROR = exports.LOGIN_DATA_KEY = void 0;
|
|
7
7
|
var _reactRouter = require("react-router");
|
|
8
8
|
var _Helpers = require("../../../App/Reducers/Api/Helpers");
|
|
9
|
-
var _Actions = require("../../../App/Reducers/
|
|
9
|
+
var _Actions = require("../../../App/Reducers/Api/Actions");
|
|
10
|
+
var _Actions2 = require("../../../App/Reducers/Entity/Actions");
|
|
11
|
+
var _Actions3 = require("../../Setting/Reducers/Actions");
|
|
12
|
+
var _Actions4 = require("../../../App/Reducers/Frame/Actions");
|
|
10
13
|
var _Api = require("../../../App/Api");
|
|
11
14
|
var _ReduxListener = require("../../../App/ReduxListener");
|
|
12
15
|
var _network = _interopRequireDefault(require("../../../App/Config/network"));
|
|
13
|
-
var _Listener =
|
|
16
|
+
var _Listener = require("./Listener");
|
|
14
17
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
15
18
|
var LOGIN_DATA_KEY = exports.LOGIN_DATA_KEY = 'login';
|
|
16
19
|
var LOGIN_REDUCER_NAME = exports.LOGIN_REDUCER_NAME = 'loginData';
|
|
@@ -47,13 +50,35 @@ var receiveHandler = function receiveHandler(dispatch) {
|
|
|
47
50
|
if (source.isPosted) {
|
|
48
51
|
//browserHistory.push(basePath); // redirect to dashboard
|
|
49
52
|
dispatch(setLoginData(source.data));
|
|
53
|
+
// Fetch settings after successful login and mount into settingData so allowUmlautsInIdentifiers etc. are available
|
|
54
|
+
dispatch(function (dispatchThunk, getState) {
|
|
55
|
+
return (0, _Helpers.dispatchFetchData)(dispatchThunk)(_Actions3.SETTING_LIST_KEY, 'settings/1').then(function (apiAction) {
|
|
56
|
+
if (apiAction && apiAction.type === _Actions.RECEIVE_DATA) {
|
|
57
|
+
var state = getState();
|
|
58
|
+
var sourceData = state.dataBySource[_Actions3.SETTING_LIST_KEY];
|
|
59
|
+
if (sourceData && sourceData.data) {
|
|
60
|
+
dispatchThunk({
|
|
61
|
+
type: _Actions2.ENTITY_WILL_MOUNT,
|
|
62
|
+
key: _Actions3.SETTING_DATA_KEY,
|
|
63
|
+
data: sourceData.data
|
|
64
|
+
});
|
|
65
|
+
dispatchThunk({
|
|
66
|
+
type: _Actions2.MOUNT_ENTITY,
|
|
67
|
+
key: _Actions3.SETTING_DATA_KEY,
|
|
68
|
+
data: sourceData.data,
|
|
69
|
+
isSaved: sourceData.isPosted || false
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
});
|
|
50
75
|
}
|
|
51
76
|
};
|
|
52
77
|
};
|
|
53
78
|
var errorHandler = function errorHandler(dispatch) {
|
|
54
79
|
return function (error) {
|
|
55
80
|
dispatch(loginError(error.response.data.message));
|
|
56
|
-
dispatch((0,
|
|
81
|
+
dispatch((0, _Actions4.showErrorMessage)(error.response.data.message));
|
|
57
82
|
};
|
|
58
83
|
};
|
|
59
84
|
var postLoginData = exports.postLoginData = function postLoginData(username, password) {
|
|
@@ -66,4 +91,4 @@ var postLoginData = exports.postLoginData = function postLoginData(username, pas
|
|
|
66
91
|
});
|
|
67
92
|
};
|
|
68
93
|
};
|
|
69
|
-
(0, _ReduxListener.addReduxListener)(_Listener
|
|
94
|
+
(0, _ReduxListener.addReduxListener)(_Listener.loginListener);
|
|
@@ -34,7 +34,8 @@ var initialState = _objectSpread({}, (0, _Reducer.getDefaultEntityState)({
|
|
|
34
34
|
showItemIdentifier: false,
|
|
35
35
|
calculationMethod: 'sumofall',
|
|
36
36
|
configurationsClientRestricted: true,
|
|
37
|
-
shareurl: ''
|
|
37
|
+
shareurl: '',
|
|
38
|
+
allowUmlautsInIdentifiers: false
|
|
38
39
|
}, {}, _Actions.SETTING_DATA_KEY));
|
|
39
40
|
var settingData = exports.settingData = (0, _FeatureReducers.createFeatureReducer)(_Actions.SETTING_REDUCER_NAME, function () {
|
|
40
41
|
var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState;
|
package/Screens/index.js
CHANGED
|
@@ -96,9 +96,6 @@ function addFeature(key, module) {
|
|
|
96
96
|
function importFeature(featureName) {
|
|
97
97
|
var module;
|
|
98
98
|
switch (featureName) {
|
|
99
|
-
case 'assembly_points':
|
|
100
|
-
module = require("./Assemblypointeditor");
|
|
101
|
-
break;
|
|
102
99
|
case 'color_palettes':
|
|
103
100
|
module = require("./ColorPalettes");
|
|
104
101
|
break;
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@configuratorware/configurator-admingui",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.54.0",
|
|
4
4
|
"license": "UNLICENSED",
|
|
5
5
|
"private": false,
|
|
6
6
|
"dependencies": {
|
|
7
7
|
"@babel/polyfill": "^7.12.1",
|
|
8
|
-
"@configuratorware/scripts": "1.
|
|
8
|
+
"@configuratorware/scripts": "1.54.0",
|
|
9
9
|
"@material-ui/core": "^3.9.4",
|
|
10
10
|
"@material-ui/icons": "^3.0.2",
|
|
11
11
|
"@tweenjs/tween.js": "^17.6.0",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"react-redux-i18n": "^1.9.3",
|
|
30
30
|
"react-router": "^3.2.6",
|
|
31
31
|
"react-sortable-hoc": "^1.11.0",
|
|
32
|
-
"redhotmagma-visualization": "1.
|
|
32
|
+
"redhotmagma-visualization": "1.54.0",
|
|
33
33
|
"redux": "^4.1.0",
|
|
34
34
|
"redux-logger": "^3.0.6",
|
|
35
35
|
"redux-persist": "^5.10.0",
|
|
@@ -1,125 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports["default"] = void 0;
|
|
8
|
-
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
var _i18n = require("../../../App/i18n");
|
|
10
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
11
|
-
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
12
|
-
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
13
|
-
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
|
|
14
|
-
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
15
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
16
|
-
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
17
|
-
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
18
|
-
function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); }
|
|
19
|
-
function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
|
|
20
|
-
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
21
|
-
function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
|
|
22
|
-
function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
|
|
23
|
-
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
24
|
-
var AssemblypointTable = /*#__PURE__*/function (_React$Component) {
|
|
25
|
-
function AssemblypointTable() {
|
|
26
|
-
_classCallCheck(this, AssemblypointTable);
|
|
27
|
-
return _callSuper(this, AssemblypointTable, arguments);
|
|
28
|
-
}
|
|
29
|
-
_inherits(AssemblypointTable, _React$Component);
|
|
30
|
-
return _createClass(AssemblypointTable, [{
|
|
31
|
-
key: "render",
|
|
32
|
-
value: function render() {
|
|
33
|
-
var _this$props = this.props,
|
|
34
|
-
activeAssemblyPoints = _this$props.activeAssemblyPoints,
|
|
35
|
-
onSelect = _this$props.onSelect,
|
|
36
|
-
onChange = _this$props.onChange,
|
|
37
|
-
sampleOptions = _this$props.sampleOptions,
|
|
38
|
-
assemblyPoints = _this$props.assemblyPoints;
|
|
39
|
-
return /*#__PURE__*/_react["default"].createElement("table", {
|
|
40
|
-
style: {
|
|
41
|
-
width: '100%'
|
|
42
|
-
}
|
|
43
|
-
}, /*#__PURE__*/_react["default"].createElement("thead", null, /*#__PURE__*/_react["default"].createElement("tr", null, /*#__PURE__*/_react["default"].createElement("th", null, (0, _i18n.T)('Name')), /*#__PURE__*/_react["default"].createElement("th", null, (0, _i18n.T)('X')), /*#__PURE__*/_react["default"].createElement("th", null, (0, _i18n.T)('Y')), /*#__PURE__*/_react["default"].createElement("th", null, (0, _i18n.T)('Rotation')), /*#__PURE__*/_react["default"].createElement("th", null, (0, _i18n.T)('Product')))), /*#__PURE__*/_react["default"].createElement("tbody", null, assemblyPoints.map(function (assemblyPoint, idx) {
|
|
44
|
-
var products = sampleOptions[assemblyPoint.optionclassification] && sampleOptions[assemblyPoint.optionclassification][assemblyPoint.identifier] || [];
|
|
45
|
-
return /*#__PURE__*/_react["default"].createElement(AssemblypointTableRow, {
|
|
46
|
-
key: idx,
|
|
47
|
-
assemblyPoint: assemblyPoint,
|
|
48
|
-
onChange: onChange,
|
|
49
|
-
onSelect: onSelect,
|
|
50
|
-
products: products,
|
|
51
|
-
active: activeAssemblyPoints.indexOf(assemblyPoint.identifier) > -1
|
|
52
|
-
});
|
|
53
|
-
})));
|
|
54
|
-
}
|
|
55
|
-
}]);
|
|
56
|
-
}(_react["default"].Component);
|
|
57
|
-
var AssemblypointTableRow = /*#__PURE__*/function (_React$Component2) {
|
|
58
|
-
function AssemblypointTableRow() {
|
|
59
|
-
var _this;
|
|
60
|
-
_classCallCheck(this, AssemblypointTableRow);
|
|
61
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
62
|
-
args[_key] = arguments[_key];
|
|
63
|
-
}
|
|
64
|
-
_this = _callSuper(this, AssemblypointTableRow, [].concat(args));
|
|
65
|
-
_defineProperty(_this, "onChange", function (e) {
|
|
66
|
-
var _e$target = e.target,
|
|
67
|
-
name = _e$target.name,
|
|
68
|
-
value = _e$target.value;
|
|
69
|
-
var _this$props2 = _this.props,
|
|
70
|
-
assemblyPoint = _this$props2.assemblyPoint,
|
|
71
|
-
onSelect = _this$props2.onSelect,
|
|
72
|
-
onChange = _this$props2.onChange;
|
|
73
|
-
onSelect(assemblyPoint.identifier);
|
|
74
|
-
assemblyPoint[name] = value;
|
|
75
|
-
onChange(assemblyPoint);
|
|
76
|
-
});
|
|
77
|
-
_defineProperty(_this, "onSelect", function (e) {
|
|
78
|
-
if (['INPUT', 'SELECT'].indexOf(e.target.tagName) === -1) {
|
|
79
|
-
var _this$props3 = _this.props,
|
|
80
|
-
assemblyPoint = _this$props3.assemblyPoint,
|
|
81
|
-
onSelect = _this$props3.onSelect;
|
|
82
|
-
onSelect(assemblyPoint.identifier);
|
|
83
|
-
}
|
|
84
|
-
});
|
|
85
|
-
return _this;
|
|
86
|
-
}
|
|
87
|
-
_inherits(AssemblypointTableRow, _React$Component2);
|
|
88
|
-
return _createClass(AssemblypointTableRow, [{
|
|
89
|
-
key: "render",
|
|
90
|
-
value: function render() {
|
|
91
|
-
var _this$props4 = this.props,
|
|
92
|
-
assemblyPoint = _this$props4.assemblyPoint,
|
|
93
|
-
active = _this$props4.active,
|
|
94
|
-
products = _this$props4.products;
|
|
95
|
-
return /*#__PURE__*/_react["default"].createElement("tr", {
|
|
96
|
-
className: active ? 'active' : '',
|
|
97
|
-
onClick: this.onSelect
|
|
98
|
-
}, /*#__PURE__*/_react["default"].createElement("td", null, assemblyPoint.identifier), /*#__PURE__*/_react["default"].createElement("td", null, /*#__PURE__*/_react["default"].createElement("input", {
|
|
99
|
-
type: "number",
|
|
100
|
-
name: "x",
|
|
101
|
-
value: assemblyPoint.x || '',
|
|
102
|
-
onChange: this.onChange
|
|
103
|
-
})), /*#__PURE__*/_react["default"].createElement("td", null, /*#__PURE__*/_react["default"].createElement("input", {
|
|
104
|
-
type: "number",
|
|
105
|
-
name: "y",
|
|
106
|
-
value: assemblyPoint.y || '',
|
|
107
|
-
onChange: this.onChange
|
|
108
|
-
})), /*#__PURE__*/_react["default"].createElement("td", null, /*#__PURE__*/_react["default"].createElement("input", {
|
|
109
|
-
type: "number",
|
|
110
|
-
name: "rotation",
|
|
111
|
-
value: assemblyPoint.rotation || '',
|
|
112
|
-
onChange: this.onChange
|
|
113
|
-
})), /*#__PURE__*/_react["default"].createElement("td", null, /*#__PURE__*/_react["default"].createElement("select", {
|
|
114
|
-
name: "product",
|
|
115
|
-
onChange: this.onChange
|
|
116
|
-
}, products.map(function (product, idx) {
|
|
117
|
-
return /*#__PURE__*/_react["default"].createElement("option", {
|
|
118
|
-
value: product.identifier,
|
|
119
|
-
key: idx
|
|
120
|
-
}, product.identifier);
|
|
121
|
-
}))));
|
|
122
|
-
}
|
|
123
|
-
}]);
|
|
124
|
-
}(_react["default"].Component);
|
|
125
|
-
var _default = exports["default"] = AssemblypointTable;
|