@configuratorware/configurator-admingui 1.34.2 → 1.35.1

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.
Files changed (39) hide show
  1. package/App/Config/defaultConfig.js +8 -0
  2. package/App/Config/icons.js +1 -0
  3. package/App/Translations.js +2 -0
  4. package/Components/FormFragments/File.js +2 -1
  5. package/Components/FormFragments/Select.js +5 -2
  6. package/Screens/Designer/SubScreens/Designviews/Containers/Edit.js +1 -1
  7. package/Screens/Designer/SubScreens/Designviews/Translations.js +6 -0
  8. package/Screens/Finder/Containers/Edit.js +49 -0
  9. package/Screens/Finder/Containers/List.js +39 -0
  10. package/Screens/Finder/Reducers/Actions.js +137 -0
  11. package/Screens/Finder/Reducers/FinderReducer.js +35 -0
  12. package/Screens/Finder/Screen.js +32 -0
  13. package/Screens/Finder/Translations.js +12 -0
  14. package/Screens/Finder/index.js +21 -0
  15. package/Screens/Option/Containers/Edit.js +53 -3
  16. package/Screens/Option/Reducers/Reducer.js +2 -0
  17. package/Screens/Option/Translations.js +10 -0
  18. package/Screens/index.js +4 -1
  19. package/UIComponents/SelectField.js +3 -1
  20. package/package.json +2 -2
  21. package/src/App/Config/defaultConfig.js +11 -0
  22. package/src/App/Config/icons.js +1 -0
  23. package/src/App/Translations.js +2 -0
  24. package/src/Components/FormFragments/File.js +1 -0
  25. package/src/Components/FormFragments/Select.js +4 -1
  26. package/src/Screens/Designer/SubScreens/Designviews/Containers/Edit.js +1 -1
  27. package/src/Screens/Designer/SubScreens/Designviews/Translations.js +6 -0
  28. package/src/Screens/Finder/Containers/Edit.js +35 -0
  29. package/src/Screens/Finder/Containers/List.js +36 -0
  30. package/src/Screens/Finder/Reducers/Actions.js +96 -0
  31. package/src/Screens/Finder/Reducers/FinderReducer.js +22 -0
  32. package/src/Screens/Finder/Screen.js +19 -0
  33. package/src/Screens/Finder/Translations.js +13 -0
  34. package/src/Screens/Finder/index.js +11 -0
  35. package/src/Screens/Option/Containers/Edit.js +63 -4
  36. package/src/Screens/Option/Reducers/Reducer.js +2 -0
  37. package/src/Screens/Option/Translations.js +10 -0
  38. package/src/Screens/index.js +2 -0
  39. package/src/UIComponents/SelectField.js +2 -1
@@ -69,6 +69,14 @@ var _default = {
69
69
  name: 'tags'
70
70
  }]
71
71
  }]
72
+ }, {
73
+ name: 'finderitems',
74
+ label: 'finder',
75
+ credentials: ['question_trees'],
76
+ items: [{
77
+ name: 'finder',
78
+ label: 'question_trees'
79
+ }]
72
80
  }, {
73
81
  name: 'configurations',
74
82
  label: 'user_configuration',
@@ -13,6 +13,7 @@ var iconMap = {
13
13
  items: 'local_offer',
14
14
  creatoritems: 'perm_data_setting',
15
15
  designeritems: 'create',
16
+ finderitems: 'filter_alt',
16
17
  configurations: 'format_list_bulleted',
17
18
  basic_settings: 'settings',
18
19
  clients: 'filter_9_plus'
@@ -39,6 +39,7 @@ require("./i18n").use({
39
39
  design_production_methods: 'Production methods',
40
40
  roles: 'Roles',
41
41
  basic_settings: 'Settings',
42
+ question_trees: 'Question Trees',
42
43
  //General
43
44
  selectAll: 'select all',
44
45
  unSelectAll: 'unselect all',
@@ -105,6 +106,7 @@ require("./i18n").use({
105
106
  design_production_methods: 'Produktionsverfahren',
106
107
  roles: 'Rollen',
107
108
  basic_settings: 'Einstellungen',
109
+ question_trees: 'Fragebäume',
108
110
  // ROUTING
109
111
  'No routing found for the specified URL[DOT]': 'Kein Routing für die angegebene URL gefunden.',
110
112
  // DELETE ITEMS
@@ -73,7 +73,8 @@ var styles = {
73
73
  opacity: 0
74
74
  },
75
75
  fileInputName: {
76
- display: 'inline-block'
76
+ display: 'inline-block',
77
+ marginLeft: 15
77
78
  },
78
79
  folderIcon: {
79
80
  verticalAlign: 'middle',
@@ -28,7 +28,7 @@ var select = function select(props) {
28
28
  width: '100%'
29
29
  },
30
30
  label: props.label,
31
- value: value || '',
31
+ value: value,
32
32
  onChange: function onChange(event) {
33
33
  if (props.useObjects && props.sourceConfig) {
34
34
  var key = props.sourceConfig.value;
@@ -43,7 +43,10 @@ var select = function select(props) {
43
43
  },
44
44
  disabled: props.disabled,
45
45
  error: props.error,
46
- shrinkLabel: props.shrinkLabel
46
+ shrinkLabel: props.shrinkLabel,
47
+ placeholderValue: props.placeholderValue,
48
+ placeholder: props.placeholder,
49
+ disablePlaceholder: props.disablePlaceholder
47
50
  }, props.source.map(function (item, idx) {
48
51
  var _getInputItemParamsBy = (0, _InputWithSource.getInputItemParamsByConfig)(item, props.sourceConfig),
49
52
  value = _getInputItemParamsBy.value,
@@ -200,7 +200,7 @@ var formFields = [{
200
200
  }
201
201
  }, {
202
202
  name: 'images',
203
- label: 'Item View image',
203
+ label: "designcontainer.imageUploadLabel",
204
204
  type: FileInput,
205
205
  accept: '.png,.jpg',
206
206
  openEnabled: false,
@@ -5,12 +5,18 @@ require("../../../../App/i18n").use({
5
5
  designviews: 'Designviews',
6
6
  designview: {
7
7
  addButtonLabel: 'Add Designview'
8
+ },
9
+ designcontainer: {
10
+ imageUploadLabel: "Background image of the designarea"
8
11
  }
9
12
  },
10
13
  de: {
11
14
  designviews: 'Designansichten',
12
15
  designview: {
13
16
  addButtonLabel: 'Designansichten hinzufügen'
17
+ },
18
+ designcontainer: {
19
+ imageUploadLabel: "Hintergrundbild der Designfläche"
14
20
  }
15
21
  }
16
22
  }, true);
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+
3
+ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports["default"] = void 0;
9
+
10
+ var _Actions = _interopRequireWildcard(require("../Reducers/Actions"));
11
+
12
+ var _DefaultConnectedForm = _interopRequireDefault(require("../../../Components/DefaultConnectedForm"));
13
+
14
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
15
+
16
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
17
+
18
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
19
+
20
+ var setFieldData = _Actions["default"].setFieldData,
21
+ postData = _Actions["default"].postData;
22
+ var formFields = [{
23
+ name: 'identifier',
24
+ label: 'identifier',
25
+ type: 'text'
26
+ }, {
27
+ name: 'texts',
28
+ label: 'Title',
29
+ type: 'intl',
30
+ intl: {
31
+ name: 'title',
32
+ type: 'text'
33
+ }
34
+ }, {
35
+ name: 'data',
36
+ type: 'intl',
37
+ label: 'questionTree',
38
+ accept: '.json',
39
+ deleteEnabled: false,
40
+ showFileName: true,
41
+ intl: {
42
+ name: 'fileName',
43
+ type: 'file'
44
+ }
45
+ }];
46
+
47
+ var _default = (0, _DefaultConnectedForm["default"])(formFields, _Actions.FINDER_REDUCER_NAME, setFieldData, postData);
48
+
49
+ exports["default"] = _default;
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+
3
+ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports["default"] = void 0;
9
+
10
+ var _Actions = _interopRequireWildcard(require("../Reducers/Actions"));
11
+
12
+ var _DefaultConnectedList = _interopRequireDefault(require("../../../Components/DefaultConnectedList"));
13
+
14
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
15
+
16
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
17
+
18
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
19
+
20
+ var columns = [{
21
+ name: 'identifier',
22
+ label: 'Identifier',
23
+ filterable: true,
24
+ sortable: true
25
+ }, {
26
+ name: 'translated_title',
27
+ label: 'Title',
28
+ filterable: true,
29
+ sortable: true
30
+ }];
31
+ var listParams = {
32
+ entity: 'questionTree',
33
+ orderdir: 'asc',
34
+ addButtonLabel: 'addButtonLabel'
35
+ };
36
+
37
+ var _default = (0, _DefaultConnectedList["default"])(columns, listParams, _Actions.FINDER_LIST_KEY, _Actions["default"].listAction, _Actions["default"].detailsAction, _Actions["default"].hideDetails, _Actions["default"].showDetails, _Actions["default"].createEntity, _Actions["default"].deleteEntities);
38
+
39
+ exports["default"] = _default;
@@ -0,0 +1,137 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports["default"] = exports.FINDER_UPLOAD_KEY = exports.FINDER_ITEM_URL = exports.FINDER_REDUCER_NAME = exports.FINDER_DATA_KEY = exports.FINDER_LIST_URL = exports.FINDER_LIST_KEY = void 0;
7
+
8
+ var _Helpers = require("../../../App/Reducers/Api/Helpers");
9
+
10
+ var _Actions = require("../../../App/Reducers/Entity/Actions");
11
+
12
+ var _lodash = require("lodash");
13
+
14
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
15
+
16
+ function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
17
+
18
+ var FINDER_LIST_KEY = 'questiontrees';
19
+ exports.FINDER_LIST_KEY = FINDER_LIST_KEY;
20
+ var FINDER_LIST_URL = 'questiontrees';
21
+ exports.FINDER_LIST_URL = FINDER_LIST_URL;
22
+ var FINDER_DATA_KEY = 'questiontree';
23
+ exports.FINDER_DATA_KEY = FINDER_DATA_KEY;
24
+ var FINDER_REDUCER_NAME = 'questiontreeData';
25
+ exports.FINDER_REDUCER_NAME = FINDER_REDUCER_NAME;
26
+ var FINDER_ITEM_URL = 'questiontrees/{itemId}';
27
+ exports.FINDER_ITEM_URL = FINDER_ITEM_URL;
28
+ var FINDER_UPLOAD_KEY = 'questionTreeUpload';
29
+ exports.FINDER_UPLOAD_KEY = FINDER_UPLOAD_KEY;
30
+ var actions = (0, _Actions.generateDefaultActions)(FINDER_LIST_KEY, FINDER_DATA_KEY, FINDER_REDUCER_NAME, FINDER_LIST_URL);
31
+ var originalPostDataAction = actions.postData;
32
+
33
+ var uploadFile = function uploadFile(filename, jsonContent, languageId, questionTreeId, dispatch, resolve, cb) {
34
+ var files = new FormData();
35
+ var blob = new Blob([jsonContent], {
36
+ type: 'text/json'
37
+ });
38
+ files.append('file', blob, filename);
39
+ (0, _Helpers.dispatchPostData)(dispatch)(FINDER_UPLOAD_KEY, "questiontrees/".concat(questionTreeId, "/data/").concat(languageId, "/upload"), files).then(function (uploadApiAction) {
40
+ if (uploadApiAction.type === _Helpers.RECEIVE_DATA) {
41
+ cb();
42
+ } else {
43
+ resolve(uploadApiAction);
44
+ }
45
+ });
46
+ };
47
+
48
+ actions.postData = function () {
49
+ return function (dispatch, getState) {
50
+ return new Promise( /*#__PURE__*/function () {
51
+ var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(resolve) {
52
+ var state, languages, result, filesToUpload, questionTreeId, checkFilesToUpload;
53
+ return regeneratorRuntime.wrap(function _callee$(_context) {
54
+ while (1) {
55
+ switch (_context.prev = _context.next) {
56
+ case 0:
57
+ state = (0, _lodash.cloneDeep)(getState()[FINDER_REDUCER_NAME]);
58
+ languages = (0, _lodash.cloneDeep)(getState()['language']).languages;
59
+ _context.next = 4;
60
+ return dispatch(originalPostDataAction());
61
+
62
+ case 4:
63
+ result = _context.sent;
64
+ filesToUpload = [];
65
+
66
+ if (state.data.data.value.length > 0 && result && result.data && result.data.id) {
67
+ questionTreeId = result.data.id;
68
+ state.data.data.value.forEach(function (treeFile) {
69
+ var languageId = languages.findIndex(function (language) {
70
+ return language.iso === treeFile.language;
71
+ }) + 1;
72
+
73
+ if (languageId > 0 && treeFile.fileName.name) {
74
+ filesToUpload.push({
75
+ value: treeFile.fileName,
76
+ languageId: languageId,
77
+ questionTreeId: questionTreeId
78
+ });
79
+ }
80
+ });
81
+
82
+ checkFilesToUpload = function checkFilesToUpload() {
83
+ var file = filesToUpload.length ? filesToUpload[0] : null;
84
+
85
+ if (file === null) {
86
+ dispatch(originalPostDataAction());
87
+ return;
88
+ }
89
+
90
+ var reader = new FileReader();
91
+
92
+ reader.onload = function (fileContent) {
93
+ var text = reader.result; // "repair" (possibly) broken json from mindmap tool
94
+
95
+ try {
96
+ text = text.replace(/''"/g, '"');
97
+ text = text.replace(/"''/g, '"');
98
+ text = text.replace(/'"/g, '"');
99
+ text = text.replace(/"'/g, '"');
100
+ text = text.replace(/'/g, '"'); // fix fieldnames wrapped in single quotes - json only allows for double quotes
101
+
102
+ text = text.replace(/(['"])?([a-zA-Z0-9_]+)(['"])?:([^\/])/g, '"$2":$4');
103
+ } catch (e) {
104
+ console.log('error doing json replacements');
105
+ }
106
+
107
+ uploadFile(file.value.name, text, file.languageId, questionTreeId, dispatch, resolve, function () {
108
+ (0, _lodash.remove)(filesToUpload, function (n) {
109
+ return n === file;
110
+ });
111
+ checkFilesToUpload();
112
+ });
113
+ };
114
+
115
+ reader.readAsText(file.value);
116
+ };
117
+
118
+ checkFilesToUpload();
119
+ }
120
+
121
+ case 7:
122
+ case "end":
123
+ return _context.stop();
124
+ }
125
+ }
126
+ }, _callee);
127
+ }));
128
+
129
+ return function (_x) {
130
+ return _ref.apply(this, arguments);
131
+ };
132
+ }());
133
+ };
134
+ };
135
+
136
+ var _default = actions;
137
+ exports["default"] = _default;
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports["default"] = exports.finderData = void 0;
7
+
8
+ var _Actions = require("./Actions");
9
+
10
+ var _Reducer = require("../../../App/Reducers/Entity/Reducer");
11
+
12
+ var _FeatureReducers = require("../../../App/FeatureReducers");
13
+
14
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
15
+
16
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
17
+
18
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
19
+
20
+ var initialState = _objectSpread({}, (0, _Reducer.getDefaultEntityState)({
21
+ id: null,
22
+ identifier: '',
23
+ texts: [],
24
+ data: []
25
+ }, _Actions.FINDER_DATA_KEY));
26
+
27
+ var finderData = (0, _FeatureReducers.createFeatureReducer)(_Actions.FINDER_REDUCER_NAME, function () {
28
+ var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState;
29
+ var action = arguments.length > 1 ? arguments[1] : undefined;
30
+ state = (0, _Reducer.defaultEntityReducer)(state, action, initialState);
31
+ return state;
32
+ });
33
+ exports.finderData = finderData;
34
+ var _default = finderData;
35
+ exports["default"] = _default;
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+
3
+ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports["default"] = void 0;
9
+
10
+ var _Actions = _interopRequireWildcard(require("./Reducers/Actions"));
11
+
12
+ var _List = _interopRequireDefault(require("./Containers/List"));
13
+
14
+ var _Edit = _interopRequireDefault(require("./Containers/Edit"));
15
+
16
+ require("./Translations");
17
+
18
+ var _DefaultConnectedScreen = require("../../Components/DefaultConnectedScreen");
19
+
20
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
21
+
22
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
23
+
24
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
25
+
26
+ var invalidateList = _Actions["default"].invalidateList,
27
+ triggerUnsavedEntity = _Actions["default"].triggerUnsavedEntity,
28
+ hideDetails = _Actions["default"].hideDetails;
29
+
30
+ var _default = (0, _DefaultConnectedScreen.generateConnectedSplitScreen)('question_trees', _List["default"], _Edit["default"], _Actions.FINDER_REDUCER_NAME, invalidateList, triggerUnsavedEntity, hideDetails);
31
+
32
+ exports["default"] = _default;
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+
3
+ require("../../App/i18n").use({
4
+ en: {
5
+ questionTree: 'Question Tree',
6
+ addButtonLabel: 'Add Question Tree'
7
+ },
8
+ de: {
9
+ questionTree: 'Fragebaum',
10
+ addButtonLabel: 'Fragebaum hinzufügen'
11
+ }
12
+ }, true);
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports["default"] = void 0;
7
+
8
+ var _Screen = _interopRequireDefault(require("./Screen"));
9
+
10
+ var _FinderReducer = _interopRequireDefault(require("./Reducers/FinderReducer"));
11
+
12
+ var _FeatureReducers = require("../../App/FeatureReducers");
13
+
14
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
15
+
16
+ (0, _FeatureReducers.addReducers)(_FinderReducer["default"]);
17
+ var _default = {
18
+ Screen: _Screen["default"],
19
+ credentials: ['question_trees']
20
+ };
21
+ exports["default"] = _default;
@@ -21,6 +21,12 @@ var _LocalizedPriceTextField = require("../../../Components/LocalizedPriceTextFi
21
21
 
22
22
  var _LocalizedPriceValue = _interopRequireDefault(require("../../../Components/LocalizedPriceValue"));
23
23
 
24
+ var _i18n = require("../../../App/i18n");
25
+
26
+ var _reactRedux = require("react-redux");
27
+
28
+ var _lodash = _interopRequireDefault(require("lodash"));
29
+
24
30
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
25
31
 
26
32
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
@@ -39,6 +45,20 @@ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToAr
39
45
 
40
46
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
41
47
 
48
+ var noValidationPlaceholder = 'noValidation';
49
+ var InputValidationTypeField = (0, _reactRedux.connect)(function (state) {
50
+ var hasTextinput = _lodash["default"].get(state, "".concat(_Actions.OPTION_REDUCER_NAME, ".data.hasTextinput.value"), false);
51
+
52
+ return {
53
+ hasTextinput: hasTextinput
54
+ };
55
+ })(function (_ref) {
56
+ var field = _ref.field,
57
+ renderWrappedInput = _ref.renderWrappedInput,
58
+ hasTextinput = _ref.hasTextinput;
59
+ field.disabled = !hasTextinput;
60
+ return /*#__PURE__*/_react["default"].createElement("div", null, renderWrappedInput(field));
61
+ });
42
62
  var formFields = [{
43
63
  name: 'identifier',
44
64
  label: 'Identifier',
@@ -73,14 +93,44 @@ var formFields = [{
73
93
  name: 'description',
74
94
  type: 'markDown'
75
95
  }
96
+ }, {
97
+ name: 'hasTextinput',
98
+ label: 'hasTextinput',
99
+ type: 'toggle'
100
+ }, {
101
+ type: InputValidationTypeField,
102
+ field: {
103
+ name: 'inputValidationType',
104
+ label: 'hasTextinputValidation',
105
+ type: 'dynSource',
106
+ placeholder: (0, _i18n.T)(noValidationPlaceholder),
107
+ placeholderValue: null,
108
+ disablePlaceholder: false,
109
+ shrinkLabel: true,
110
+ sourceConfig: {
111
+ text: 'label',
112
+ value: 'value'
113
+ },
114
+ dynSource: {
115
+ type: 'select',
116
+ listKey: 'options/inputvalidationtypes',
117
+ url: 'options/inputvalidationtypes',
118
+ mapItems: function mapItems(item) {
119
+ return {
120
+ value: item,
121
+ label: (0, _i18n.T)(item)
122
+ };
123
+ }
124
+ }
125
+ }
76
126
  }, {
77
127
  name: 'prices',
78
128
  label: 'Prices',
79
129
  type: 'dynSource',
80
130
  sourceConfig: {
81
- text: function text(_ref) {
82
- var identifier = _ref.identifier,
83
- currency = _ref.currency;
131
+ text: function text(_ref2) {
132
+ var identifier = _ref2.identifier,
133
+ currency = _ref2.currency;
84
134
  return "".concat(identifier, " / ").concat(currency.symbol, " (").concat(currency.iso, ")");
85
135
  }
86
136
  },
@@ -32,6 +32,8 @@ var initialState = _objectSpread({}, (0, _Reducer.getDefaultEntityState)(_object
32
32
  configurable: false,
33
33
  deactivated: false,
34
34
  price: null,
35
+ hasTextinput: false,
36
+ inputValidationType: null,
35
37
  texts: [],
36
38
  // title, abstract, description
37
39
  prices: {
@@ -2,6 +2,11 @@
2
2
 
3
3
  require("../../App/i18n").use({
4
4
  en: {
5
+ hasTextinput: 'Has Textinput',
6
+ hasTextinputValidation: 'Textinput Type',
7
+ optionInputNotEmpty: 'Text must not be empty',
8
+ optionInputNumber: 'Text must be a number',
9
+ noValidation: 'No validation',
5
10
  option: {
6
11
  addButtonLabel: 'Add Option',
7
12
  prices: {
@@ -12,6 +17,11 @@ require("../../App/i18n").use({
12
17
  },
13
18
  de: {
14
19
  'Sequence number': 'Reihenfolge',
20
+ hasTextinput: 'Texteingabe',
21
+ hasTextinputValidation: 'Art der Texteingabe',
22
+ optionInputNotEmpty: 'Text darf nicht leer sein',
23
+ optionInputNumber: 'Text muss eine Zahl sein',
24
+ noValidation: 'Keine Validierung',
15
25
  option: {
16
26
  addButtonLabel: 'Option hinzufügen',
17
27
  prices: {
package/Screens/index.js CHANGED
@@ -70,6 +70,8 @@ var _TrackingCodes = _interopRequireDefault(require("./TrackingCodes"));
70
70
 
71
71
  var _User = _interopRequireDefault(require("./User"));
72
72
 
73
+ var _Finder = _interopRequireDefault(require("./Finder"));
74
+
73
75
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
74
76
 
75
77
  function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
@@ -95,7 +97,8 @@ var features = {
95
97
  roles: _Roles["default"],
96
98
  softwareupdate: _SoftwareUpdates["default"],
97
99
  trackingCodes: _TrackingCodes["default"],
98
- users: _User["default"]
100
+ users: _User["default"],
101
+ finder: _Finder["default"]
99
102
  };
100
103
  exports.features = features;
101
104
 
@@ -84,6 +84,8 @@ var UISelectField = /*#__PURE__*/function (_React$Component) {
84
84
  style = _this$props.style,
85
85
  children = _this$props.children,
86
86
  placeholderValue = _this$props.placeholderValue,
87
+ _this$props$disablePl = _this$props.disablePlaceholder,
88
+ disablePlaceholder = _this$props$disablePl === void 0 ? true : _this$props$disablePl,
87
89
  disableUnderline = _this$props.disableUnderline,
88
90
  disabled = _this$props.disabled,
89
91
  error = _this$props.error,
@@ -110,7 +112,7 @@ var UISelectField = /*#__PURE__*/function (_React$Component) {
110
112
  disabled: disabled
111
113
  }, placeholder && /*#__PURE__*/_react["default"].createElement(_MenuItem["default"], {
112
114
  value: placeholderValue,
113
- disabled: true
115
+ disabled: disablePlaceholder
114
116
  }, placeholder), children), /*#__PURE__*/_react["default"].createElement(_FormHelperText["default"], null, error));
115
117
  }
116
118
  }]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@configuratorware/configurator-admingui",
3
- "version": "1.34.2",
3
+ "version": "1.35.1",
4
4
  "license": "UNLICENSED",
5
5
  "private": false,
6
6
  "dependencies": {
@@ -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.34.2",
32
+ "redhotmagma-visualization": "1.35.1",
33
33
  "redux": "^4.1.0",
34
34
  "redux-logger": "^3.0.6",
35
35
  "redux-persist": "^5.10.0",
@@ -94,6 +94,17 @@ export default {
94
94
  },
95
95
  ],
96
96
  },
97
+ {
98
+ name: 'finderitems',
99
+ label: 'finder',
100
+ credentials: ['question_trees'],
101
+ items: [
102
+ {
103
+ name: 'finder',
104
+ label: 'question_trees',
105
+ },
106
+ ]
107
+ },
97
108
  {
98
109
  name: 'configurations',
99
110
  label: 'user_configuration',
@@ -6,6 +6,7 @@ const iconMap = {
6
6
  items: 'local_offer',
7
7
  creatoritems: 'perm_data_setting',
8
8
  designeritems: 'create',
9
+ finderitems: 'filter_alt',
9
10
  configurations: 'format_list_bulleted',
10
11
  basic_settings: 'settings',
11
12
  clients: 'filter_9_plus',
@@ -40,6 +40,7 @@ require('./i18n').use(
40
40
  design_production_methods: 'Production methods',
41
41
  roles: 'Roles',
42
42
  basic_settings: 'Settings',
43
+ question_trees: 'Question Trees',
43
44
  //General
44
45
  selectAll: 'select all',
45
46
  unSelectAll: 'unselect all',
@@ -112,6 +113,7 @@ require('./i18n').use(
112
113
  design_production_methods: 'Produktionsverfahren',
113
114
  roles: 'Rollen',
114
115
  basic_settings: 'Einstellungen',
116
+ question_trees: 'Fragebäume',
115
117
  // ROUTING
116
118
 
117
119
  'No routing found for the specified URL[DOT]': 'Kein Routing für die angegebene URL gefunden.',
@@ -34,6 +34,7 @@ const styles = {
34
34
  },
35
35
  fileInputName: {
36
36
  display: 'inline-block',
37
+ marginLeft: 15,
37
38
  },
38
39
  folderIcon: {
39
40
  verticalAlign: 'middle',
@@ -12,7 +12,7 @@ const select = props => {
12
12
  <SelectField
13
13
  style={{ width: '100%' }}
14
14
  label={props.label}
15
- value={value || ''}
15
+ value={value}
16
16
  onChange={event => {
17
17
  if (props.useObjects && props.sourceConfig) {
18
18
  const key = props.sourceConfig.value;
@@ -26,6 +26,9 @@ const select = props => {
26
26
  disabled={props.disabled}
27
27
  error={props.error}
28
28
  shrinkLabel={props.shrinkLabel}
29
+ placeholderValue={props.placeholderValue}
30
+ placeholder={props.placeholder}
31
+ disablePlaceholder={props.disablePlaceholder}
29
32
  >
30
33
  {props.source.map((item, idx) => {
31
34
  const { value, text } = getInputItemParamsByConfig(item, props.sourceConfig);
@@ -115,7 +115,7 @@ const formFields = [
115
115
  },
116
116
  {
117
117
  name: 'images',
118
- label: 'Item View image',
118
+ label: `designcontainer.imageUploadLabel`,
119
119
  type: FileInput,
120
120
  accept: '.png,.jpg',
121
121
  openEnabled: false,
@@ -5,12 +5,18 @@ require('../../../../App/i18n').use(
5
5
  designview: {
6
6
  addButtonLabel: 'Add Designview',
7
7
  },
8
+ designcontainer: {
9
+ imageUploadLabel: "Background image of the designarea",
10
+ },
8
11
  },
9
12
  de: {
10
13
  designviews: 'Designansichten',
11
14
  designview: {
12
15
  addButtonLabel: 'Designansichten hinzufügen',
13
16
  },
17
+ designcontainer: {
18
+ imageUploadLabel: "Hintergrundbild der Designfläche",
19
+ },
14
20
  },
15
21
  },
16
22
  true
@@ -0,0 +1,35 @@
1
+ import Actions, { FINDER_REDUCER_NAME } from '../Reducers/Actions';
2
+ const { setFieldData, postData } = Actions;
3
+
4
+ const formFields = [
5
+ {
6
+ name: 'identifier',
7
+ label: 'identifier',
8
+ type: 'text',
9
+ },
10
+ {
11
+ name: 'texts',
12
+ label: 'Title',
13
+ type: 'intl',
14
+ intl: {
15
+ name: 'title',
16
+ type: 'text',
17
+ },
18
+ },
19
+ {
20
+ name: 'data',
21
+ type: 'intl',
22
+ label: 'questionTree',
23
+ accept: '.json',
24
+ deleteEnabled: false,
25
+ showFileName: true,
26
+ intl: {
27
+ name: 'fileName',
28
+ type: 'file',
29
+
30
+ },
31
+ },
32
+ ];
33
+
34
+ import generateConnectedEdit from '../../../Components/DefaultConnectedForm';
35
+ export default generateConnectedEdit(formFields, FINDER_REDUCER_NAME, setFieldData, postData);
@@ -0,0 +1,36 @@
1
+ import Actions, { FINDER_LIST_KEY, FINDER_REDUCER_NAME } from '../Reducers/Actions';
2
+
3
+ const columns = [
4
+ {
5
+ name: 'identifier',
6
+ label: 'Identifier',
7
+ filterable: true,
8
+ sortable: true,
9
+ },
10
+ {
11
+ name: 'translated_title',
12
+ label: 'Title',
13
+ filterable: true,
14
+ sortable: true,
15
+ },
16
+ ];
17
+
18
+ const listParams = {
19
+ entity: 'questionTree',
20
+ orderdir: 'asc',
21
+ addButtonLabel: 'addButtonLabel',
22
+ };
23
+
24
+ import generateConnectedList from '../../../Components/DefaultConnectedList';
25
+
26
+ export default generateConnectedList(
27
+ columns,
28
+ listParams,
29
+ FINDER_LIST_KEY,
30
+ Actions.listAction,
31
+ Actions.detailsAction,
32
+ Actions.hideDetails,
33
+ Actions.showDetails,
34
+ Actions.createEntity,
35
+ Actions.deleteEntities,
36
+ );
@@ -0,0 +1,96 @@
1
+ import { dispatchPostData, RECEIVE_DATA } from "../../../App/Reducers/Api/Helpers";
2
+ export const FINDER_LIST_KEY = 'questiontrees';
3
+ export const FINDER_LIST_URL = 'questiontrees';
4
+ export const FINDER_DATA_KEY = 'questiontree';
5
+ export const FINDER_REDUCER_NAME = 'questiontreeData';
6
+ export const FINDER_ITEM_URL = 'questiontrees/{itemId}';
7
+ export const FINDER_UPLOAD_KEY = 'questionTreeUpload';
8
+
9
+ import { generateDefaultActions } from '../../../App/Reducers/Entity/Actions';
10
+ import { cloneDeep, remove } from "lodash";
11
+
12
+ const actions = generateDefaultActions(
13
+ FINDER_LIST_KEY,
14
+ FINDER_DATA_KEY,
15
+ FINDER_REDUCER_NAME,
16
+ FINDER_LIST_URL,
17
+ );
18
+
19
+ const originalPostDataAction = actions.postData;
20
+
21
+ const uploadFile = (filename, jsonContent, languageId, questionTreeId, dispatch, resolve, cb) => {
22
+ const files = new FormData();
23
+ const blob = new Blob([jsonContent], {
24
+ type: 'text/json'
25
+ });
26
+ files.append('file', blob, filename);
27
+
28
+ dispatchPostData(dispatch)(FINDER_UPLOAD_KEY, `questiontrees/${questionTreeId}/data/${languageId}/upload`, files).then(uploadApiAction => {
29
+ if (uploadApiAction.type === RECEIVE_DATA) {
30
+ cb();
31
+ } else {
32
+ resolve(uploadApiAction);
33
+ }
34
+ });
35
+ };
36
+
37
+ actions.postData = () => (dispatch, getState) => {
38
+ return new Promise(async resolve => {
39
+ const state = cloneDeep(getState()[FINDER_REDUCER_NAME]);
40
+ const languages = cloneDeep(getState()['language']).languages;
41
+
42
+ const result = await dispatch(originalPostDataAction());
43
+ const filesToUpload = [];
44
+ if (state.data.data.value.length > 0 && result && result.data && result.data.id) {
45
+ const questionTreeId = result.data.id;
46
+ state.data.data.value.forEach((treeFile) => {
47
+ const languageId = languages.findIndex((language) => language.iso === treeFile.language) + 1;
48
+ if (languageId > 0 && treeFile.fileName.name) {
49
+ filesToUpload.push({
50
+ value: treeFile.fileName,
51
+ languageId,
52
+ questionTreeId
53
+ });
54
+ }
55
+ });
56
+
57
+ const checkFilesToUpload = () => {
58
+ let file = filesToUpload.length ? filesToUpload[0] : null;
59
+
60
+ if (file === null) {
61
+ dispatch(originalPostDataAction());
62
+ return;
63
+ }
64
+
65
+ const reader = new FileReader();
66
+ reader.onload = function(fileContent) {
67
+ let text = reader.result;
68
+ // "repair" (possibly) broken json from mindmap tool
69
+ try {
70
+ text = text.replace(/''"/g, '"');
71
+ text = text.replace(/"''/g, '"');
72
+ text = text.replace(/'"/g, '"');
73
+ text = text.replace(/"'/g, '"');
74
+ text = text.replace(/'/g, '"');
75
+ // fix fieldnames wrapped in single quotes - json only allows for double quotes
76
+ text = text.replace(/(['"])?([a-zA-Z0-9_]+)(['"])?:([^\/])/g, '"$2":$4');
77
+ } catch (e) {
78
+ console.log('error doing json replacements')
79
+ }
80
+ uploadFile(file.value.name, text, file.languageId, questionTreeId, dispatch, resolve, () => {
81
+ remove(filesToUpload, function(n) {
82
+ return n === file;
83
+ });
84
+
85
+ checkFilesToUpload();
86
+ });
87
+ }
88
+ reader.readAsText(file.value);
89
+
90
+ };
91
+ checkFilesToUpload();
92
+ }
93
+ });
94
+ };
95
+
96
+ export default actions;
@@ -0,0 +1,22 @@
1
+ import { FINDER_DATA_KEY, FINDER_REDUCER_NAME } from './Actions';
2
+ import { getDefaultEntityState, defaultEntityReducer } from '../../../App/Reducers/Entity/Reducer';
3
+ import { createFeatureReducer } from '../../../App/FeatureReducers';
4
+
5
+ const initialState = {
6
+ ...getDefaultEntityState(
7
+ {
8
+ id: null,
9
+ identifier: '',
10
+ texts: [],
11
+ data: [],
12
+ },
13
+ FINDER_DATA_KEY
14
+ ),
15
+ };
16
+
17
+ export const finderData = createFeatureReducer(FINDER_REDUCER_NAME, (state = initialState, action) => {
18
+ state = defaultEntityReducer(state, action, initialState);
19
+ return state;
20
+ });
21
+
22
+ export default finderData;
@@ -0,0 +1,19 @@
1
+ import Actions, { FINDER_REDUCER_NAME } from './Reducers/Actions';
2
+ const { invalidateList, triggerUnsavedEntity, hideDetails } = Actions;
3
+
4
+ import List from './Containers/List';
5
+ import Edit from './Containers/Edit';
6
+
7
+ import './Translations';
8
+
9
+ import { generateConnectedSplitScreen } from '../../Components/DefaultConnectedScreen';
10
+
11
+ export default generateConnectedSplitScreen(
12
+ 'question_trees',
13
+ List,
14
+ Edit,
15
+ FINDER_REDUCER_NAME,
16
+ invalidateList,
17
+ triggerUnsavedEntity,
18
+ hideDetails
19
+ );
@@ -0,0 +1,13 @@
1
+ require('../../App/i18n').use(
2
+ {
3
+ en: {
4
+ questionTree: 'Question Tree',
5
+ addButtonLabel: 'Add Question Tree',
6
+ },
7
+ de: {
8
+ questionTree: 'Fragebaum',
9
+ addButtonLabel: 'Fragebaum hinzufügen'
10
+ },
11
+ },
12
+ true
13
+ );
@@ -0,0 +1,11 @@
1
+ import Screen from './Screen';
2
+ import designerData from './Reducers/FinderReducer';
3
+
4
+ import { addReducers } from '../../App/FeatureReducers';
5
+
6
+ addReducers(designerData);
7
+
8
+ export default {
9
+ Screen,
10
+ credentials: ['question_trees'],
11
+ };
@@ -1,6 +1,39 @@
1
1
  import React from 'react';
2
2
  import Actions, { OPTION_REDUCER_NAME } from '../Reducers/Actions';
3
3
  import attributesDataStructure from '../../Item/DataStructures/Attributes/Editor';
4
+ import generateConnectedEdit from '../../../Components/DefaultConnectedForm';
5
+ import EditorPopup from '../../Item/Components/AttributeEditorPopup';
6
+ import {LocalizedPriceTextField} from "../../../Components/LocalizedPriceTextField";
7
+ import LocalizedPriceValue from "../../../Components/LocalizedPriceValue";
8
+ import {T} from "../../../App/i18n"; import {connect, useSelector} from "react-redux";
9
+ import _ from "lodash";
10
+
11
+ const noValidationPlaceholder = 'noValidation';
12
+
13
+ const InputValidationTypeField = connect(
14
+ state => {
15
+ const hasTextinput = _.get(
16
+ state,
17
+ `${OPTION_REDUCER_NAME}.data.hasTextinput.value`,
18
+ false
19
+ );
20
+ return {
21
+ hasTextinput
22
+ };
23
+ },
24
+ )(
25
+ ({
26
+ field,
27
+ renderWrappedInput,
28
+ hasTextinput,
29
+ }) => {
30
+ field.disabled = !hasTextinput;
31
+ return (
32
+ <div >
33
+ {renderWrappedInput(field)}
34
+ </div>
35
+ )
36
+ });
4
37
 
5
38
  const formFields = [
6
39
  {
@@ -42,6 +75,36 @@ const formFields = [
42
75
  type: 'markDown',
43
76
  },
44
77
  },
78
+ {
79
+ name: 'hasTextinput',
80
+ label: 'hasTextinput',
81
+ type: 'toggle',
82
+ },
83
+ {
84
+ type: InputValidationTypeField,
85
+ field: {
86
+ name: 'inputValidationType',
87
+ label: 'hasTextinputValidation',
88
+ type: 'dynSource',
89
+ placeholder: T(noValidationPlaceholder),
90
+ placeholderValue: null,
91
+ disablePlaceholder: false,
92
+ shrinkLabel: true,
93
+ sourceConfig: {
94
+ text: 'label',
95
+ value: 'value'
96
+ },
97
+ dynSource: {
98
+ type: 'select',
99
+ listKey: 'options/inputvalidationtypes',
100
+ url: 'options/inputvalidationtypes',
101
+ mapItems: item => ({
102
+ value: item,
103
+ label: T(item),
104
+ }),
105
+ },
106
+ },
107
+ },
45
108
  {
46
109
  name: 'prices',
47
110
  label: 'Prices',
@@ -90,10 +153,6 @@ const formFields = [
90
153
  ...attributesDataStructure,
91
154
  ];
92
155
 
93
- import generateConnectedEdit from '../../../Components/DefaultConnectedForm';
94
- import EditorPopup from '../../Item/Components/AttributeEditorPopup';
95
- import {LocalizedPriceTextField} from "../../../Components/LocalizedPriceTextField";
96
- import LocalizedPriceValue from "../../../Components/LocalizedPriceValue";
97
156
  const BaseDataForm = generateConnectedEdit(
98
157
  formFields,
99
158
  OPTION_REDUCER_NAME,
@@ -15,6 +15,8 @@ const initialState = {
15
15
  configurable: false,
16
16
  deactivated: false,
17
17
  price: null,
18
+ hasTextinput: false,
19
+ inputValidationType: null,
18
20
  texts: [], // title, abstract, description
19
21
  prices: {
20
22
  value: [],
@@ -1,6 +1,11 @@
1
1
  require('../../App/i18n').use(
2
2
  {
3
3
  en: {
4
+ hasTextinput: 'Has Textinput',
5
+ hasTextinputValidation: 'Textinput Type',
6
+ optionInputNotEmpty: 'Text must not be empty',
7
+ optionInputNumber: 'Text must be a number',
8
+ noValidation: 'No validation',
4
9
  option: {
5
10
  addButtonLabel: 'Add Option',
6
11
  prices: {
@@ -11,6 +16,11 @@ require('../../App/i18n').use(
11
16
  },
12
17
  de: {
13
18
  'Sequence number': 'Reihenfolge',
19
+ hasTextinput: 'Texteingabe',
20
+ hasTextinputValidation: 'Art der Texteingabe',
21
+ optionInputNotEmpty: 'Text darf nicht leer sein',
22
+ optionInputNumber: 'Text muss eine Zahl sein',
23
+ noValidation: 'Keine Validierung',
14
24
  option: {
15
25
  addButtonLabel: 'Option hinzufügen',
16
26
  prices: {
@@ -19,6 +19,7 @@ import Savedconfigurations from './Savedconfigurations';
19
19
  import SoftwareUpdates from './SoftwareUpdates';
20
20
  import TrackingCodes from './TrackingCodes';
21
21
  import User from './User';
22
+ import Finder from './Finder'
22
23
 
23
24
  export { Dashboard };
24
25
  export { Login };
@@ -43,6 +44,7 @@ export const features = {
43
44
  softwareupdate: SoftwareUpdates,
44
45
  trackingCodes: TrackingCodes,
45
46
  users: User,
47
+ finder: Finder,
46
48
  };
47
49
 
48
50
  for (let { name } of getFlattenedFeatures()) {
@@ -32,6 +32,7 @@ class UISelectField extends React.Component {
32
32
  style,
33
33
  children,
34
34
  placeholderValue,
35
+ disablePlaceholder = true,
35
36
  disableUnderline,
36
37
  disabled,
37
38
  error,
@@ -52,7 +53,7 @@ class UISelectField extends React.Component {
52
53
  disabled={disabled}
53
54
  >
54
55
  {placeholder && (
55
- <MenuItem value={placeholderValue} disabled>
56
+ <MenuItem value={placeholderValue} disabled={disablePlaceholder}>
56
57
  {placeholder}
57
58
  </MenuItem>
58
59
  )}