@configuratorware/configurator-admingui 1.33.4 → 1.34.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.
@@ -5,7 +5,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- exports.dismissRequest = exports.deleteData = exports.postData = exports.fetchDataIfNeeded = exports.fetchData = exports.expiredResponse = exports.deleteRequest = exports.postRequest = exports.networkError = exports.receiveData = exports.requestData = exports.resetSource = exports.resetDidInvalidate = exports.invalidateSource = exports.RESET_SOURCE = exports.RESET_DID_INVALIDATE = exports.EXPIRED_RESPONSE = exports.CANCEL_REQUEST = exports.DELETE_DATA = exports.POST_DATA = exports.HANDLED_NETWORK_ERROR = exports.NETWORK_ERROR = exports.INVALIDATE_SOURCE = exports.RECEIVE_DATA = exports.REQUEST_DATA = void 0;
8
+ exports.dismissRequest = exports.deleteData = exports.postData = exports.fetchDataIfNeeded = exports.fetchData = exports.expiredResponse = exports.deleteRequest = exports.postRequest = exports.networkError = exports.receiveData = exports.requestData = exports.resetDidInvalidate = exports.invalidateSource = exports.RESET_DID_INVALIDATE = exports.EXPIRED_RESPONSE = exports.CANCEL_REQUEST = exports.DELETE_DATA = exports.POST_DATA = exports.HANDLED_NETWORK_ERROR = exports.NETWORK_ERROR = exports.INVALIDATE_SOURCE = exports.RECEIVE_DATA = exports.REQUEST_DATA = void 0;
9
9
 
10
10
  var _lodash = _interopRequireDefault(require("lodash"));
11
11
 
@@ -43,8 +43,6 @@ var EXPIRED_RESPONSE = 'EXPIRED_RESPONSE';
43
43
  exports.EXPIRED_RESPONSE = EXPIRED_RESPONSE;
44
44
  var RESET_DID_INVALIDATE = 'RESET_DID_INVALIDATE';
45
45
  exports.RESET_DID_INVALIDATE = RESET_DID_INVALIDATE;
46
- var RESET_SOURCE = 'RESET_SOURCE';
47
- exports.RESET_SOURCE = RESET_SOURCE;
48
46
 
49
47
  var invalidateSource = function invalidateSource(key) {
50
48
  return {
@@ -64,15 +62,6 @@ var resetDidInvalidate = function resetDidInvalidate(key) {
64
62
 
65
63
  exports.resetDidInvalidate = resetDidInvalidate;
66
64
 
67
- var resetSource = function resetSource(key) {
68
- return {
69
- type: RESET_SOURCE,
70
- key: key
71
- };
72
- };
73
-
74
- exports.resetSource = resetSource;
75
-
76
65
  var requestData = function requestData(source, key) {
77
66
  return {
78
67
  type: REQUEST_DATA,
@@ -33,7 +33,7 @@ Object.defineProperty(exports, "HANDLED_NETWORK_ERROR", {
33
33
  return _Actions.HANDLED_NETWORK_ERROR;
34
34
  }
35
35
  });
36
- exports["default"] = exports.getMethods = exports.apiActionHandler = exports.handleNetworkErrorAction = exports.dispatchDeleteData = exports.dispatchPostData = exports.dispatchResetSource = exports.dispatchFetchData = void 0;
36
+ exports["default"] = exports.getMethods = exports.apiActionHandler = exports.handleNetworkErrorAction = exports.dispatchDeleteData = exports.dispatchPostData = exports.dispatchFetchData = void 0;
37
37
 
38
38
  var _Actions = require("./Actions");
39
39
 
@@ -45,14 +45,6 @@ var dispatchFetchData = function dispatchFetchData(dispatch) {
45
45
 
46
46
  exports.dispatchFetchData = dispatchFetchData;
47
47
 
48
- var dispatchResetSource = function dispatchResetSource(dispatch) {
49
- return function (key) {
50
- return dispatch((0, _Actions.resetSource)(key));
51
- };
52
- };
53
-
54
- exports.dispatchResetSource = dispatchResetSource;
55
-
56
48
  var dispatchPostData = function dispatchPostData(dispatch) {
57
49
  return function (key, source, data) {
58
50
  return dispatch((0, _Actions.postData)(source, data, key));
@@ -84,11 +84,6 @@ var data = function data() {
84
84
  isDeleted: action.ids
85
85
  });
86
86
 
87
- case _Actions.RESET_SOURCE:
88
- return _objectSpread(_objectSpread({}, state), {}, {
89
- source: null
90
- });
91
-
92
87
  default:
93
88
  return state;
94
89
  }
@@ -108,7 +103,6 @@ var dataBySource = function dataBySource() {
108
103
  case _Actions.CANCEL_REQUEST:
109
104
  case _Actions.EXPIRED_RESPONSE:
110
105
  case _Actions.RESET_DID_INVALIDATE:
111
- case _Actions.RESET_SOURCE:
112
106
  return _objectSpread(_objectSpread({}, state), {}, _defineProperty({}, action.key, data(state[action.key], action)));
113
107
 
114
108
  default:
@@ -305,9 +305,7 @@ var generateDefaultActions = function generateDefaultActions(listKey, dataKey, r
305
305
  return dispatch(triggerUnsavedEntity()).then(function () {
306
306
  dispatch(unmountEntity());
307
307
  dispatch(initUnsavedEntity(reducerName));
308
- dispatch(mountNewEntity()); // source might still be set from last fetch, so reset it here
309
-
310
- (0, _Helpers.dispatchResetSource)(dispatch)(dataKey);
308
+ dispatch(mountNewEntity());
311
309
  dispatch(loadDependencies());
312
310
  dispatch(showDetails());
313
311
  });
@@ -28,10 +28,10 @@
28
28
  color: black;
29
29
  }
30
30
  .split-right {
31
- padding-bottom: 74px;
31
+ padding-bottom: 110px;
32
32
  .action-buttons {
33
33
  position: absolute;
34
- bottom: 24px;
34
+ bottom: -15px;
35
35
  right: 24px;
36
36
  }
37
37
  }
@@ -17,8 +17,6 @@ var _DefaultConnectedForm = _interopRequireWildcard(require("../../../../../Comp
17
17
 
18
18
  var _Actions = _interopRequireWildcard(require("../Reducers/Actions"));
19
19
 
20
- var _Actions2 = require("../../../Reducers/Actions");
21
-
22
20
  var _File = _interopRequireDefault(require("../../../../../Components/FormFragments/File"));
23
21
 
24
22
  var _CircularProgress = _interopRequireDefault(require("@material-ui/core/CircularProgress"));
@@ -110,7 +108,7 @@ var FileInput = (0, _styles.withStyles)({
110
108
  return (0, _get["default"])(state[_Actions.REDUCER_NAME], 'source.item.identifier');
111
109
  });
112
110
  var itemId = (0, _reactRedux.useSelector)(function (state) {
113
- return (0, _get["default"])(state[_Actions2.DESIGNER_REDUCER_NAME], 'source.id');
111
+ return (0, _get["default"])(state[_Actions.REDUCER_NAME], 'source.item.id');
114
112
  });
115
113
  var colorGroupEntries = (0, _reactRedux.useSelector)(getGroupEntries('color'));
116
114
  var viewImages = (0, _reactRedux.useSelector)(function (state) {
@@ -344,10 +344,13 @@ var formFields = [{
344
344
  noWrap: true,
345
345
  field: {
346
346
  name: 'visualizationMode',
347
- label: 'itemCoreData.visualizationComponent',
347
+ label: 'visualizationData.visualizationComponent',
348
348
  type: 'select',
349
349
  sourceConfig: {
350
- text: 'label',
350
+ text: function text(_ref11) {
351
+ var label = _ref11.label;
352
+ return (0, _i18n.T)("visualizationData.".concat(label));
353
+ },
351
354
  value: 'id'
352
355
  },
353
356
  source: [],
@@ -376,9 +379,9 @@ var formFields = [{
376
379
  label: 'Prices',
377
380
  type: 'dynSource',
378
381
  sourceConfig: {
379
- text: function text(_ref11) {
380
- var identifier = _ref11.identifier,
381
- currency = _ref11.currency;
382
+ text: function text(_ref12) {
383
+ var identifier = _ref12.identifier,
384
+ currency = _ref12.currency;
382
385
  return "".concat(identifier, " / ").concat(currency.symbol, " (").concat(currency.iso, ")");
383
386
  }
384
387
  },
@@ -17,8 +17,13 @@ require("../../App/i18n").use({
17
17
  save: 'Save',
18
18
  editDialogTitle: 'Edit selected entries',
19
19
  editDialogHint: 'Use the checkboxes to select one or more entries in the list</br>and then click this icon to set the item status for them.',
20
+ visualizationData: {
21
+ '2d': "2D",
22
+ '3d': "3D",
23
+ '2doverlay': '2D image in the foreground',
24
+ visualizationComponent: 'Visualization component'
25
+ },
20
26
  itemCoreData: {
21
- visualizationComponent: 'Visualization component',
22
27
  configurationMode: 'Configuration mode',
23
28
  creator: 'creator',
24
29
  designer: 'designer'
@@ -88,8 +93,13 @@ require("../../App/i18n").use({
88
93
  save: 'Speichern',
89
94
  editDialogTitle: 'Gewählte Einträge bearbeiten',
90
95
  editDialogHint: 'Nutze die Checkboxen in der Liste und klicke dann dieses Icon,</br>um den Status für einen oder mehrere Einträge zu setzen.',
96
+ visualizationData: {
97
+ '2d': "2D",
98
+ '3d': "3D",
99
+ '2doverlay': '2D, Bild im Vordergrund',
100
+ visualizationComponent: 'Visualisierungskomponente'
101
+ },
91
102
  itemCoreData: {
92
- visualizationComponent: 'Visualisierungskomponente',
93
103
  configurationMode: 'Konfigurationsmodus',
94
104
  creator: 'creator',
95
105
  designer: 'designer'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@configuratorware/configurator-admingui",
3
- "version": "1.33.4",
3
+ "version": "1.34.0",
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.33.4",
32
+ "redhotmagma-visualization": "1.34.0",
33
33
  "redux": "^4.1.0",
34
34
  "redux-logger": "^3.0.6",
35
35
  "redux-persist": "^5.10.0",
@@ -11,7 +11,6 @@ export const DELETE_DATA = 'DELETE_DATA';
11
11
  export const CANCEL_REQUEST = 'CANCEL_REQUEST';
12
12
  export const EXPIRED_RESPONSE = 'EXPIRED_RESPONSE';
13
13
  export const RESET_DID_INVALIDATE = 'RESET_DID_INVALIDATE';
14
- export const RESET_SOURCE = 'RESET_SOURCE';
15
14
 
16
15
  export const invalidateSource = key => ({
17
16
  type: INVALIDATE_SOURCE,
@@ -23,11 +22,6 @@ export const resetDidInvalidate = key => ({
23
22
  key,
24
23
  });
25
24
 
26
- export const resetSource = key => ({
27
- type: RESET_SOURCE,
28
- key,
29
- });
30
-
31
25
  export const requestData = (source, key) => ({
32
26
  type: REQUEST_DATA,
33
27
  source,
@@ -1,7 +1,6 @@
1
1
  import {
2
2
  fetchDataIfNeeded,
3
3
  invalidateSource,
4
- resetSource,
5
4
  postData,
6
5
  deleteData,
7
6
  dismissRequest,
@@ -18,10 +17,6 @@ export const dispatchFetchData = dispatch => (key, source) => {
18
17
 
19
18
  export { invalidateSource };
20
19
 
21
- export const dispatchResetSource = dispatch => key => {
22
- return dispatch(resetSource(key));
23
- };
24
-
25
20
  export const dispatchPostData = dispatch => (key, source, data) => {
26
21
  return dispatch(postData(source, data, key));
27
22
  };
@@ -8,7 +8,6 @@ import {
8
8
  CANCEL_REQUEST,
9
9
  EXPIRED_RESPONSE,
10
10
  RESET_DID_INVALIDATE,
11
- RESET_SOURCE,
12
11
  } from './Actions';
13
12
 
14
13
  const data = (
@@ -82,11 +81,6 @@ const data = (
82
81
  didInvalidate: false,
83
82
  isDeleted: action.ids,
84
83
  };
85
- case RESET_SOURCE:
86
- return {
87
- ...state,
88
- source: null,
89
- };
90
84
  default:
91
85
  return state;
92
86
  }
@@ -103,7 +97,6 @@ export const dataBySource = (state = {}, action) => {
103
97
  case CANCEL_REQUEST:
104
98
  case EXPIRED_RESPONSE:
105
99
  case RESET_DID_INVALIDATE:
106
- case RESET_SOURCE:
107
100
  return {
108
101
  ...state,
109
102
  [action.key]: data(state[action.key], action),
@@ -80,7 +80,6 @@ import {
80
80
  dispatchPostData,
81
81
  dispatchDeleteData,
82
82
  invalidateSource,
83
- dispatchResetSource,
84
83
  dismissRequest,
85
84
  } from '../Api/Helpers';
86
85
  import { RECEIVE_DATA, HANDLED_NETWORK_ERROR, NETWORK_ERROR } from '../Api/Actions';
@@ -222,8 +221,6 @@ export const generateDefaultActions = (listKey, dataKey, reducerName, url, ctx =
222
221
  dispatch(unmountEntity());
223
222
  dispatch(initUnsavedEntity(reducerName));
224
223
  dispatch(mountNewEntity());
225
- // source might still be set from last fetch, so reset it here
226
- dispatchResetSource(dispatch)(dataKey);
227
224
  dispatch(loadDependencies());
228
225
  dispatch(showDetails());
229
226
  });
@@ -28,10 +28,10 @@
28
28
  color: black;
29
29
  }
30
30
  .split-right {
31
- padding-bottom: 74px;
31
+ padding-bottom: 110px;
32
32
  .action-buttons {
33
33
  position: absolute;
34
- bottom: 24px;
34
+ bottom: -15px;
35
35
  right: 24px;
36
36
  }
37
37
  }
@@ -3,7 +3,6 @@ import { useSelector } from 'react-redux';
3
3
  import get from 'lodash/get';
4
4
  import generateConnectedEdit, { CancelButton } from '../../../../../Components/DefaultConnectedForm';
5
5
  import Actions, { REDUCER_NAME } from '../Reducers/Actions';
6
- import { DESIGNER_REDUCER_NAME } from '../../../Reducers/Actions';
7
6
  import File from '../../../../../Components/FormFragments/File';
8
7
  import CircularProgress from '@material-ui/core/CircularProgress';
9
8
  import { withStyles } from '@material-ui/core/styles';
@@ -42,7 +41,7 @@ const FileInput = withStyles({
42
41
  },
43
42
  })(({ value, onChange, classes, ...props }) => {
44
43
  const itemIdentifier = useSelector(state => get(state[REDUCER_NAME], 'source.item.identifier'));
45
- const itemId = useSelector(state => get(state[DESIGNER_REDUCER_NAME], 'source.id'));
44
+ const itemId = useSelector(state => get(state[REDUCER_NAME], 'source.item.id'));
46
45
  const colorGroupEntries = useSelector(getGroupEntries('color'));
47
46
  const viewImages = useSelector(state => get(state[REDUCER_NAME], 'viewImages'));
48
47
  if (colorGroupEntries.length) {
@@ -219,10 +219,10 @@ const formFields = [
219
219
  noWrap: true,
220
220
  field: {
221
221
  name: 'visualizationMode',
222
- label: 'itemCoreData.visualizationComponent',
222
+ label: 'visualizationData.visualizationComponent',
223
223
  type: 'select',
224
224
  sourceConfig: {
225
- text: 'label',
225
+ text: ({label}) => T(`visualizationData.${label}`),
226
226
  value: 'id',
227
227
  },
228
228
  source: [],
@@ -243,8 +243,8 @@ describe('Item/Edit', () => {
243
243
  const selectWrapper = wrapper.find('select[name="visualizationMode"]');
244
244
 
245
245
  const findButton = text => findWithText('li', text, selectWrapper);
246
- const button2D = findButton('2d');
247
- const button3D = findButton('3d');
246
+ const button2D = findButton('visualizationData.2d');
247
+ const button3D = findButton('visualizationData.3d');
248
248
  expect(button2D).toHaveLength(1);
249
249
  expect(button3D).toHaveLength(1);
250
250
  button3D.simulate('click');
@@ -18,8 +18,13 @@ require('../../App/i18n').use(
18
18
  editDialogTitle: 'Edit selected entries',
19
19
  editDialogHint:
20
20
  'Use the checkboxes to select one or more entries in the list</br>and then click this icon to set the item status for them.',
21
+ visualizationData: {
22
+ '2d': "2D",
23
+ '3d': "3D",
24
+ '2doverlay': '2D image in the foreground',
25
+ visualizationComponent: 'Visualization component',
26
+ },
21
27
  itemCoreData: {
22
- visualizationComponent: 'Visualization component',
23
28
  configurationMode: 'Configuration mode',
24
29
  creator: 'creator',
25
30
  designer: 'designer',
@@ -94,8 +99,13 @@ require('../../App/i18n').use(
94
99
  editDialogTitle: 'Gewählte Einträge bearbeiten',
95
100
  editDialogHint:
96
101
  'Nutze die Checkboxen in der Liste und klicke dann dieses Icon,</br>um den Status für einen oder mehrere Einträge zu setzen.',
97
- itemCoreData: {
102
+ visualizationData: {
103
+ '2d': "2D",
104
+ '3d': "3D",
105
+ '2doverlay': '2D, Bild im Vordergrund',
98
106
  visualizationComponent: 'Visualisierungskomponente',
107
+ },
108
+ itemCoreData: {
99
109
  configurationMode: 'Konfigurationsmodus',
100
110
  creator: 'creator',
101
111
  designer: 'designer',