@configuratorware/configurator-admingui 1.40.0 → 1.40.2

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.
@@ -15,6 +15,8 @@ var _GeneralFragments = require("./GeneralFragments");
15
15
 
16
16
  var _debounce = _interopRequireDefault(require("lodash/debounce"));
17
17
 
18
+ var _withStyles = _interopRequireDefault(require("@material-ui/core/styles/withStyles"));
19
+
18
20
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
19
21
 
20
22
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
@@ -39,6 +41,17 @@ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.g
39
41
 
40
42
  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; }
41
43
 
44
+ var styles = function styles() {
45
+ return {
46
+ dialogContentContainer: {
47
+ display: 'flex',
48
+ flexDirection: 'column',
49
+ flex: 1,
50
+ width: '100%'
51
+ }
52
+ };
53
+ };
54
+
42
55
  var ModalContainer = /*#__PURE__*/function (_React$Component) {
43
56
  _inherits(ModalContainer, _React$Component);
44
57
 
@@ -116,6 +129,7 @@ var ModalContainer = /*#__PURE__*/function (_React$Component) {
116
129
  maxWidth: "lg",
117
130
  classes: classes
118
131
  }, /*#__PURE__*/_react["default"].createElement("div", {
132
+ className: classes.dialogContentContainer,
119
133
  ref: this.setContainerRef
120
134
  }, detailsComponent)), children);
121
135
  }
@@ -124,5 +138,6 @@ var ModalContainer = /*#__PURE__*/function (_React$Component) {
124
138
  return ModalContainer;
125
139
  }(_react["default"].Component);
126
140
 
127
- var _default = ModalContainer;
141
+ var _default = (0, _withStyles["default"])(styles)(ModalContainer);
142
+
128
143
  exports["default"] = _default;
@@ -61,17 +61,15 @@ var createClientActions = function createClientActions(listKey, dataKey, reducer
61
61
 
62
62
  var beforeApiStateHandler = function beforeApiStateHandler(apiAction) {
63
63
  return function (dispatch, getState) {
64
- return new Promise(function (resolve) {
65
- var state = (0, _cloneDeep["default"])(getState()[reducerName]);
64
+ var state = (0, _cloneDeep["default"])(getState()[reducerName]);
66
65
 
67
- if (apiAction.type === _Helpers.RECEIVE_DATA) {
68
- state.logoFile && uploadFile(apiAction.data.id, state.logoFile, 'logo', dispatch);
69
- state.fontFile && uploadFile(apiAction.data.id, state.fontFile, 'font', dispatch);
70
- resolve(apiAction);
71
- }
66
+ if (apiAction.type === _Helpers.RECEIVE_DATA) {
67
+ return Promise.all([state.logoFile && uploadFile(apiAction.data.id, state.logoFile, 'logo', dispatch), state.fontFile && uploadFile(apiAction.data.id, state.fontFile, 'font', dispatch)]).then(function () {
68
+ return apiAction;
69
+ });
70
+ }
72
71
 
73
- resolve(apiAction);
74
- });
72
+ return apiAction;
75
73
  };
76
74
  };
77
75
 
@@ -84,7 +82,7 @@ var createClientActions = function createClientActions(listKey, dataKey, reducer
84
82
  var fileToUpload = new FormData();
85
83
  fileToUpload.append(field, file, file.name);
86
84
  var url = CLIENT_UPLOAD.replace('{field}', field).replace('{itemId}', clientId);
87
- (0, _Helpers.dispatchPostData)(dispatch)(UPLOAD_KEY, url, fileToUpload);
85
+ return (0, _Helpers.dispatchPostData)(dispatch)(UPLOAD_KEY, url, fileToUpload);
88
86
  };
89
87
 
90
88
  actions.setFieldData = function (field, value) {
@@ -129,6 +129,7 @@ var styles = function styles(theme) {
129
129
  editorRoot: _defineProperty({
130
130
  display: 'flex',
131
131
  flexDirection: 'row',
132
+ overflow: 'hidden',
132
133
  '&.fullHeight': {
133
134
  height: 'calc(100vh - 180px)'
134
135
  },
@@ -147,11 +148,10 @@ var styles = function styles(theme) {
147
148
  }),
148
149
  leftSide: {
149
150
  marginRight: 2 * theme.spacing.unit,
150
- flex: 1
151
- },
152
- header: {
153
- flex: 1
151
+ flex: 1,
152
+ overflow: 'auto'
154
153
  },
154
+ header: {},
155
155
  header3D: {
156
156
  flex: 1
157
157
  },
@@ -161,6 +161,9 @@ var styles = function styles(theme) {
161
161
  },
162
162
  rightSide: {
163
163
  flex: 1,
164
+ display: 'flex',
165
+ flexDirection: 'column',
166
+ overflow: 'auto',
164
167
  '& > $header': _defineProperty({}, breakPoint.max, {
165
168
  display: 'none'
166
169
  })
@@ -207,18 +210,25 @@ var styles = function styles(theme) {
207
210
  loadingText: {
208
211
  marginTop: 2 * theme.spacing.unit
209
212
  },
210
- advancedEditor: {
211
- maxWidth: 600
212
- },
213
+ advancedEditor: _defineProperty({
214
+ maxWidth: 600,
215
+ overflow: 'auto'
216
+ }, breakPoint.max, {
217
+ maxWidth: '100%'
218
+ }),
213
219
  visualizationRoot: (_visualizationRoot = {
214
220
  display: 'flex',
215
- flexDirection: 'row'
221
+ flexDirection: 'row',
222
+ overflow: 'hidden'
216
223
  }, _defineProperty(_visualizationRoot, breakPoint.max, {
217
224
  flexDirection: 'column'
218
225
  }), _defineProperty(_visualizationRoot, '& > $leftSide', _defineProperty({
219
- width: '70%'
226
+ width: '70%',
227
+ overflow: 'hidden',
228
+ flex: 'initial'
220
229
  }, breakPoint.max, {
221
- width: '100%'
230
+ width: '100%',
231
+ flex: 1
222
232
  })), _visualizationRoot),
223
233
  visualizationContainer: {
224
234
  width: '100%',
@@ -39,7 +39,8 @@ var styles = function styles() {
39
39
  display: 'flex'
40
40
  },
41
41
  dialogContentTextRoot: {
42
- width: '100%'
42
+ width: '100%',
43
+ display: 'flex'
43
44
  }
44
45
  };
45
46
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@configuratorware/configurator-admingui",
3
- "version": "1.40.0",
3
+ "version": "1.40.2",
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.40.0",
32
+ "redhotmagma-visualization": "1.40.2",
33
33
  "redux": "^4.1.0",
34
34
  "redux-logger": "^3.0.6",
35
35
  "redux-persist": "^5.10.0",
@@ -2,6 +2,16 @@ import React from 'react';
2
2
  import Dialog from '../UIComponents/Dialog';
3
3
  import { Headline } from './GeneralFragments';
4
4
  import debounce from 'lodash/debounce';
5
+ import withStyles from '@material-ui/core/styles/withStyles';
6
+
7
+ const styles = () => ({
8
+ dialogContentContainer: {
9
+ display: 'flex',
10
+ flexDirection: 'column',
11
+ flex: 1,
12
+ width: '100%',
13
+ },
14
+ });
5
15
 
6
16
  class ModalContainer extends React.Component {
7
17
  componentDidMount() {
@@ -55,7 +65,9 @@ class ModalContainer extends React.Component {
55
65
  maxWidth="lg"
56
66
  classes={classes}
57
67
  >
58
- <div ref={this.setContainerRef}>{detailsComponent}</div>
68
+ <div className={classes.dialogContentContainer} ref={this.setContainerRef}>
69
+ {detailsComponent}
70
+ </div>
59
71
  </Dialog>
60
72
 
61
73
  {children}
@@ -64,4 +76,4 @@ class ModalContainer extends React.Component {
64
76
  }
65
77
  }
66
78
 
67
- export default ModalContainer;
79
+ export default withStyles(styles)(ModalContainer);
@@ -25,15 +25,14 @@ export const setFontFile = font => ({
25
25
 
26
26
  export const createClientActions = (listKey, dataKey, reducerName, url, ctx = {}) => {
27
27
  const beforeApiStateHandler = apiAction => (dispatch, getState) => {
28
- return new Promise(resolve => {
29
- const state = cloneDeep(getState()[reducerName]);
30
- if (apiAction.type === RECEIVE_DATA) {
31
- state.logoFile && uploadFile(apiAction.data.id, state.logoFile, 'logo', dispatch);
32
- state.fontFile && uploadFile(apiAction.data.id, state.fontFile, 'font', dispatch);
33
- resolve(apiAction);
34
- }
35
- resolve(apiAction);
36
- });
28
+ const state = cloneDeep(getState()[reducerName]);
29
+ if (apiAction.type === RECEIVE_DATA) {
30
+ return Promise.all([
31
+ state.logoFile && uploadFile(apiAction.data.id, state.logoFile, 'logo', dispatch),
32
+ state.fontFile && uploadFile(apiAction.data.id, state.fontFile, 'font', dispatch),
33
+ ]).then(() => apiAction);
34
+ }
35
+ return apiAction;
37
36
  };
38
37
 
39
38
  const actions = generateDefaultActions(listKey, dataKey, reducerName, url, {
@@ -46,7 +45,7 @@ export const createClientActions = (listKey, dataKey, reducerName, url, ctx = {}
46
45
  const fileToUpload = new FormData();
47
46
  fileToUpload.append(field, file, file.name);
48
47
  const url = CLIENT_UPLOAD.replace('{field}', field).replace('{itemId}', clientId);
49
- dispatchPostData(dispatch)(UPLOAD_KEY, url, fileToUpload);
48
+ return dispatchPostData(dispatch)(UPLOAD_KEY, url, fileToUpload);
50
49
  };
51
50
 
52
51
  actions.setFieldData = (field, value) => dispatch => {
@@ -58,6 +58,7 @@ const styles = theme => {
58
58
  editorRoot: {
59
59
  display: 'flex',
60
60
  flexDirection: 'row',
61
+ overflow: 'hidden',
61
62
  '&.fullHeight': {
62
63
  height: 'calc(100vh - 180px)',
63
64
  },
@@ -80,10 +81,9 @@ const styles = theme => {
80
81
  leftSide: {
81
82
  marginRight: 2 * theme.spacing.unit,
82
83
  flex: 1,
84
+ overflow: 'auto',
83
85
  },
84
- header: {
85
- flex: 1,
86
- },
86
+ header: {},
87
87
  header3D: {
88
88
  flex: 1,
89
89
  },
@@ -93,6 +93,9 @@ const styles = theme => {
93
93
  },
94
94
  rightSide: {
95
95
  flex: 1,
96
+ display: 'flex',
97
+ flexDirection: 'column',
98
+ overflow: 'auto',
96
99
  '& > $header': {
97
100
  [breakPoint.max]: {
98
101
  display: 'none',
@@ -146,17 +149,25 @@ const styles = theme => {
146
149
  },
147
150
  advancedEditor: {
148
151
  maxWidth: 600,
152
+ overflow: 'auto',
153
+ [breakPoint.max]: {
154
+ maxWidth: '100%',
155
+ },
149
156
  },
150
157
  visualizationRoot: {
151
158
  display: 'flex',
152
159
  flexDirection: 'row',
160
+ overflow: 'hidden',
153
161
  [breakPoint.max]: {
154
162
  flexDirection: 'column',
155
163
  },
156
164
  '& > $leftSide': {
157
165
  width: '70%',
166
+ overflow: 'hidden',
167
+ flex: 'initial',
158
168
  [breakPoint.max]: {
159
169
  width: '100%',
170
+ flex: 1,
160
171
  },
161
172
  },
162
173
  },
@@ -16,6 +16,7 @@ const styles = () => ({
16
16
  },
17
17
  dialogContentTextRoot: {
18
18
  width: '100%',
19
+ display: 'flex',
19
20
  },
20
21
  });
21
22