@configuratorware/configurator-frontendgui 1.31.1 → 1.31.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.
Files changed (34) hide show
  1. package/App/Modules/Designer/Components/ImageEditDialog/ImageUpload.js +5 -3
  2. package/App/Reducers/Configurator/Actions.js +20 -81
  3. package/App/Reducers/ImageGallery/Reducer.js +7 -4
  4. package/App/Screens/Configurator/ThemeProvider.js +1 -1
  5. package/App/Services/DesignerService.js +8 -1
  6. package/App/{Screens/Configurator/Containers/DesignApproval.js → Shared/Components/AcceptPrivacy/index.js} +78 -71
  7. package/App/Shared/Components/AddToBasket/index.js +1 -1
  8. package/App/Shared/Components/AmountPrice/index.js +83 -49
  9. package/App/Shared/Components/PriceOverview/index.js +5 -3
  10. package/App/Shared/Components/ReceiveOfferForm/index.js +9 -10
  11. package/App/configuration.js +4 -2
  12. package/package.json +4 -4
  13. package/public/translations/de_DE.json +4 -1
  14. package/public/translations/en_GB.json +10 -5
  15. package/src/App/Modules/Designer/Components/ImageEditDialog/ImageUpload.js +4 -3
  16. package/src/App/Reducers/Configurator/Actions.js +6 -37
  17. package/src/App/Reducers/ImageGallery/Reducer.js +5 -1
  18. package/src/App/Screens/Configurator/ThemeProvider.js +2 -2
  19. package/src/App/Services/DesignerService.js +7 -0
  20. package/src/App/Shared/Components/AcceptPrivacy/index.js +78 -0
  21. package/src/App/Shared/Components/AddToBasket/index.js +1 -1
  22. package/src/App/Shared/Components/AmountPrice/index.js +48 -3
  23. package/src/App/Shared/Components/PriceOverview/index.js +3 -0
  24. package/src/App/Shared/Components/ReceiveOfferForm/__snapshots__/index.test.jsx.snap +64 -64
  25. package/src/App/Shared/Components/ReceiveOfferForm/index.js +9 -10
  26. package/src/App/configuration.js +14 -0
  27. package/App/Screens/Configurator/Components/DesignApproval/index.js +0 -76
  28. package/App/Screens/Configurator/Components/DesignApproval/index.story.js +0 -27
  29. package/App/Screens/Configurator/Components/DesignApproval/index.test.js +0 -31
  30. package/src/App/Screens/Configurator/Components/DesignApproval/__snapshots__/index.test.jsx.snap +0 -91
  31. package/src/App/Screens/Configurator/Components/DesignApproval/index.js +0 -54
  32. package/src/App/Screens/Configurator/Components/DesignApproval/index.story.js +0 -12
  33. package/src/App/Screens/Configurator/Components/DesignApproval/index.test.jsx +0 -17
  34. package/src/App/Screens/Configurator/Containers/DesignApproval.js +0 -76
@@ -16,7 +16,7 @@ const styles = theme => ({
16
16
  marginTop: 0,
17
17
  },
18
18
  outlinedInput: {
19
- padding: 14,
19
+ padding: 10,
20
20
  fontSize: 15,
21
21
  [theme.breakpoints.down('xs')]: {
22
22
  padding: 19,
@@ -91,7 +91,6 @@ class ReceiveOfferForm extends React.Component {
91
91
  this.handleChange = this.handleChange.bind(this);
92
92
  this.handleBlur = this.handleBlur.bind(this);
93
93
  this.setInputRef = this.setInputRef.bind(this);
94
- this.designApprovalRef = React.createRef();
95
94
  }
96
95
 
97
96
  setInputRef = ref => {
@@ -175,7 +174,7 @@ class ReceiveOfferForm extends React.Component {
175
174
  onChange={this.handleChange}
176
175
  onBlur={this.handleBlur}
177
176
  label={t('receiveOfferForm.email')}
178
- margin="normal"
177
+ margin="dense"
179
178
  variant="outlined"
180
179
  fullWidth
181
180
  error={!!email.error}
@@ -201,7 +200,7 @@ class ReceiveOfferForm extends React.Component {
201
200
  onChange={this.handleChange}
202
201
  onBlur={this.handleBlur}
203
202
  label={t('receiveOfferForm.name')}
204
- margin="normal"
203
+ margin="dense"
205
204
  variant="outlined"
206
205
  fullWidth
207
206
  error={!!name.error}
@@ -224,7 +223,7 @@ class ReceiveOfferForm extends React.Component {
224
223
  onChange={this.handleChange}
225
224
  onBlur={this.handleBlur}
226
225
  label={t('receiveOfferForm.company')}
227
- margin="normal"
226
+ margin="dense"
228
227
  variant="outlined"
229
228
  fullWidth
230
229
  error={!!company.error}
@@ -247,7 +246,7 @@ class ReceiveOfferForm extends React.Component {
247
246
  onChange={this.handleChange}
248
247
  onBlur={this.handleBlur}
249
248
  label={t('receiveOfferForm.phonenumber')}
250
- margin="normal"
249
+ margin="dense"
251
250
  variant="outlined"
252
251
  fullWidth
253
252
  error={!!phonenumber.error}
@@ -272,7 +271,7 @@ class ReceiveOfferForm extends React.Component {
272
271
  onChange={this.handleChange}
273
272
  onBlur={this.handleBlur}
274
273
  label={t('receiveOfferForm.zip')}
275
- margin="normal"
274
+ margin="dense"
276
275
  variant="outlined"
277
276
  fullWidth
278
277
  error={!!zip.error}
@@ -297,7 +296,7 @@ class ReceiveOfferForm extends React.Component {
297
296
  onChange={this.handleChange}
298
297
  onBlur={this.handleBlur}
299
298
  label={t('receiveOfferForm.city')}
300
- margin="normal"
299
+ margin="dense"
301
300
  variant="outlined"
302
301
  fullWidth
303
302
  error={!!city.error}
@@ -322,7 +321,7 @@ class ReceiveOfferForm extends React.Component {
322
321
  onChange={this.handleChange}
323
322
  onBlur={this.handleBlur}
324
323
  label={t('receiveOfferForm.street')}
325
- margin="normal"
324
+ margin="dense"
326
325
  variant="outlined"
327
326
  fullWidth
328
327
  error={!!street.error}
@@ -345,7 +344,7 @@ class ReceiveOfferForm extends React.Component {
345
344
  onChange={this.handleChange}
346
345
  onBlur={this.handleBlur}
347
346
  label={t('receiveOfferForm.country')}
348
- margin="normal"
347
+ margin="dense"
349
348
  variant="outlined"
350
349
  fullWidth
351
350
  error={!!country.error}
@@ -186,6 +186,20 @@ let applicationConfiguration = {
186
186
  designer: {
187
187
  dpi: 300, // the default canvas dpi as project specific option
188
188
  maxColorAmount: 10, // the default max number of colors in the colorizing feature
189
+ allowedImageUploadFormats: [
190
+ // the image formats users can upload to designareas / designer items
191
+ 'jpg',
192
+ 'jpeg',
193
+ 'svg',
194
+ 'png',
195
+ 'pdf',
196
+ 'bmp',
197
+ 'tif',
198
+ 'tiff',
199
+ 'eps',
200
+ 'ai',
201
+ 'gif',
202
+ ],
189
203
  },
190
204
 
191
205
  vectorizeImageQuality: 45000,
@@ -1,76 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports["default"] = void 0;
7
-
8
- var _react = _interopRequireDefault(require("react"));
9
-
10
- var _propTypes = _interopRequireDefault(require("prop-types"));
11
-
12
- var _core = require("@material-ui/core");
13
-
14
- var _FormControlLabel = _interopRequireDefault(require("@material-ui/core/FormControlLabel"));
15
-
16
- var _Checkbox = _interopRequireDefault(require("@material-ui/core/Checkbox"));
17
-
18
- var _FormHelperText = _interopRequireDefault(require("@material-ui/core/FormHelperText"));
19
-
20
- var _i18n = require("../../../../../Framework/i18n");
21
-
22
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
23
-
24
- var styles = function styles(theme) {
25
- return {
26
- link: {
27
- '& a': {
28
- color: theme.palette.primary.main
29
- }
30
- }
31
- };
32
- };
33
-
34
- var DesignApproval = function DesignApproval(props) {
35
- var handleChange = function handleChange(event) {
36
- var onChange = props.onChange;
37
- onChange(event.target.checked);
38
- };
39
-
40
- var classes = props.classes,
41
- checked = props.checked,
42
- error = props.error,
43
- link = props.link;
44
- return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_FormControlLabel["default"], {
45
- control: /*#__PURE__*/_react["default"].createElement(_Checkbox["default"], {
46
- name: "approval",
47
- checked: checked,
48
- onChange: handleChange,
49
- color: "primary"
50
- }),
51
- label: /*#__PURE__*/_react["default"].createElement("div", {
52
- className: classes.link,
53
- dangerouslySetInnerHTML: {
54
- __html: (0, _i18n.t)('receiveOfferForm.approval', {
55
- link: link
56
- })
57
- }
58
- })
59
- }), error && /*#__PURE__*/_react["default"].createElement(_FormHelperText["default"], {
60
- error: true
61
- }, (0, _i18n.t)('receiveOfferForm.errors.notApproved')));
62
- };
63
-
64
- DesignApproval.propTypes = {
65
- classes: _propTypes["default"].object,
66
- onChange: _propTypes["default"].func,
67
- checked: _propTypes["default"].bool,
68
- error: _propTypes["default"].bool,
69
- link: _propTypes["default"].string
70
- };
71
-
72
- var _default = (0, _core.withStyles)(styles, {
73
- name: 'DesignApproval'
74
- })(DesignApproval);
75
-
76
- exports["default"] = _default;
@@ -1,27 +0,0 @@
1
- "use strict";
2
-
3
- var _react = _interopRequireDefault(require("react"));
4
-
5
- var _noop = _interopRequireDefault(require("lodash/noop"));
6
-
7
- var _react2 = require("@storybook/react");
8
-
9
- var _index = _interopRequireDefault(require("./index"));
10
-
11
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
12
-
13
- (0, _react2.storiesOf)('DesignApproval', module).add('without error', function () {
14
- return /*#__PURE__*/_react["default"].createElement(_index["default"], {
15
- checked: true,
16
- error: false,
17
- link: 'fakeLink',
18
- onChange: _noop["default"]
19
- });
20
- }).add('with error', function () {
21
- return /*#__PURE__*/_react["default"].createElement(_index["default"], {
22
- checked: false,
23
- error: true,
24
- link: 'fakeLink',
25
- onChange: _noop["default"]
26
- });
27
- });
@@ -1,31 +0,0 @@
1
- "use strict";
2
-
3
- var _react = _interopRequireDefault(require("react"));
4
-
5
- var _noop = _interopRequireDefault(require("lodash/noop"));
6
-
7
- var _enzyme = require("enzyme");
8
-
9
- var _index = _interopRequireDefault(require("./index"));
10
-
11
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
12
-
13
- /* eslint-env jest */
14
- it('renders correctly without error', function () {
15
- var tree = (0, _enzyme.render)( /*#__PURE__*/_react["default"].createElement(_index["default"], {
16
- checked: true,
17
- error: false,
18
- link: 'fakeLink',
19
- onChange: _noop["default"]
20
- }));
21
- expect(tree).toMatchSnapshot();
22
- });
23
- it('renders correctly with error', function () {
24
- var tree = (0, _enzyme.render)( /*#__PURE__*/_react["default"].createElement(_index["default"], {
25
- checked: false,
26
- error: true,
27
- link: 'fakeLink',
28
- onChange: _noop["default"]
29
- }));
30
- expect(tree).toMatchSnapshot();
31
- });
@@ -1,91 +0,0 @@
1
- // Jest Snapshot v1, https://goo.gl/fbAQLP
2
-
3
- exports[`renders correctly with error 1`] = `
4
- Array [
5
- <label
6
- class="MuiFormControlLabel-root"
7
- >
8
- <span
9
- aria-disabled="false"
10
- class="MuiButtonBase-root MuiIconButton-root PrivateSwitchBase-root-2 MuiCheckbox-root MuiCheckbox-colorPrimary MuiIconButton-colorPrimary"
11
- >
12
- <span
13
- class="MuiIconButton-label"
14
- >
15
- <input
16
- class="PrivateSwitchBase-input-5"
17
- data-indeterminate="false"
18
- name="approval"
19
- type="checkbox"
20
- />
21
- <svg
22
- aria-hidden="true"
23
- class="MuiSvgIcon-root"
24
- focusable="false"
25
- viewBox="0 0 24 24"
26
- >
27
- <path
28
- d="M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"
29
- />
30
- </svg>
31
- </span>
32
- </span>
33
- <span
34
- class="MuiTypography-root MuiFormControlLabel-label MuiTypography-body1"
35
- >
36
- <div
37
- class="DesignApproval-link-1"
38
- >
39
- receiveOfferForm.approval
40
- </div>
41
- </span>
42
- </label>,
43
- <p
44
- class="MuiFormHelperText-root Mui-error"
45
- >
46
- receiveOfferForm.errors.notApproved
47
- </p>,
48
- ]
49
- `;
50
-
51
- exports[`renders correctly without error 1`] = `
52
- <label
53
- class="MuiFormControlLabel-root"
54
- >
55
- <span
56
- aria-disabled="false"
57
- class="MuiButtonBase-root MuiIconButton-root PrivateSwitchBase-root-2 MuiCheckbox-root MuiCheckbox-colorPrimary PrivateSwitchBase-checked-3 Mui-checked MuiIconButton-colorPrimary"
58
- >
59
- <span
60
- class="MuiIconButton-label"
61
- >
62
- <input
63
- checked=""
64
- class="PrivateSwitchBase-input-5"
65
- data-indeterminate="false"
66
- name="approval"
67
- type="checkbox"
68
- />
69
- <svg
70
- aria-hidden="true"
71
- class="MuiSvgIcon-root"
72
- focusable="false"
73
- viewBox="0 0 24 24"
74
- >
75
- <path
76
- d="M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"
77
- />
78
- </svg>
79
- </span>
80
- </span>
81
- <span
82
- class="MuiTypography-root MuiFormControlLabel-label MuiTypography-body1"
83
- >
84
- <div
85
- class="DesignApproval-link-1"
86
- >
87
- receiveOfferForm.approval
88
- </div>
89
- </span>
90
- </label>
91
- `;
@@ -1,54 +0,0 @@
1
- import React from 'react';
2
- import PropTypes from 'prop-types';
3
- import { withStyles } from '@material-ui/core';
4
- import FormControlLabel from '@material-ui/core/FormControlLabel';
5
- import Checkbox from '@material-ui/core/Checkbox';
6
- import FormHelperText from '@material-ui/core/FormHelperText';
7
- import { t } from 'Framework/i18n';
8
-
9
- const styles = theme => ({
10
- link: {
11
- '& a': {
12
- color: theme.palette.primary.main,
13
- },
14
- },
15
- });
16
-
17
- const DesignApproval = props => {
18
- const handleChange = event => {
19
- const { onChange } = props;
20
-
21
- onChange(event.target.checked);
22
- };
23
-
24
- const { classes, checked, error, link } = props;
25
-
26
- return (
27
- <React.Fragment>
28
- <FormControlLabel
29
- control={
30
- <Checkbox name="approval" checked={checked} onChange={handleChange} color="primary" />
31
- }
32
- label={
33
- <div
34
- className={classes.link}
35
- dangerouslySetInnerHTML={{ __html: t('receiveOfferForm.approval', { link }) }}
36
- />
37
- }
38
- />
39
- {error && (
40
- <FormHelperText error={true}>{t('receiveOfferForm.errors.notApproved')}</FormHelperText>
41
- )}
42
- </React.Fragment>
43
- );
44
- };
45
-
46
- DesignApproval.propTypes = {
47
- classes: PropTypes.object,
48
- onChange: PropTypes.func,
49
- checked: PropTypes.bool,
50
- error: PropTypes.bool,
51
- link: PropTypes.string,
52
- };
53
-
54
- export default withStyles(styles, { name: 'DesignApproval' })(DesignApproval);
@@ -1,12 +0,0 @@
1
- import React from 'react';
2
- import noop from 'lodash/noop';
3
- import { storiesOf } from '@storybook/react';
4
- import DesignApproval from './index';
5
-
6
- storiesOf('DesignApproval', module)
7
- .add('without error', () => (
8
- <DesignApproval checked={true} error={false} link={'fakeLink'} onChange={noop} />
9
- ))
10
- .add('with error', () => (
11
- <DesignApproval checked={false} error={true} link={'fakeLink'} onChange={noop} />
12
- ));
@@ -1,17 +0,0 @@
1
- /* eslint-env jest */
2
- import React from 'react';
3
- import noop from 'lodash/noop';
4
- import { render } from 'enzyme';
5
- import DesignApproval from './index';
6
-
7
- it('renders correctly without error', () => {
8
- const tree = render(<DesignApproval checked={true} error={false} link={'fakeLink'} onChange={noop} />);
9
-
10
- expect(tree).toMatchSnapshot();
11
- });
12
-
13
- it('renders correctly with error', () => {
14
- const tree = render(<DesignApproval checked={false} error={true} link={'fakeLink'} onChange={noop} />);
15
-
16
- expect(tree).toMatchSnapshot();
17
- });
@@ -1,76 +0,0 @@
1
- import React from 'react';
2
- import PropTypes from 'prop-types';
3
- import { getClientTexts } from 'App/Reducers/Configurator/Selectors';
4
- import DesignApproval from '../Components/DesignApproval';
5
- import { containerConnect } from 'Framework/ComponentContainer';
6
-
7
- class DesignApprovalContainer extends React.Component {
8
- static propTypes = {
9
- termsAndConditionsLink: PropTypes.string,
10
- DesignApprovalComponent: PropTypes.func,
11
- };
12
-
13
- static defaultProps = {
14
- DesignApprovalComponent: DesignApproval,
15
- };
16
-
17
- constructor(props) {
18
- super(props);
19
-
20
- this.state = {
21
- approval: {
22
- checked: false,
23
- error: false,
24
- },
25
- };
26
- }
27
-
28
- handleApprovalChange = checked => {
29
- this.setState({
30
- approval: {
31
- checked,
32
- error: false,
33
- },
34
- });
35
- };
36
-
37
- validate() {
38
- const {
39
- approval: { checked },
40
- } = this.state;
41
-
42
- if (checked) {
43
- return true;
44
- }
45
-
46
- this.setState({
47
- approval: {
48
- checked,
49
- error: true,
50
- },
51
- });
52
-
53
- return false;
54
- }
55
-
56
- render() {
57
- const { approval } = this.state;
58
- const { termsAndConditionsLink, DesignApprovalComponent } = this.props;
59
-
60
- return (
61
- <DesignApprovalComponent
62
- checked={approval.checked}
63
- error={approval.error}
64
- link={termsAndConditionsLink}
65
- onChange={this.handleApprovalChange}
66
- />
67
- );
68
- }
69
- }
70
-
71
- const mapStateToProps = ({ configurator }) => ({
72
- Component: DesignApprovalContainer,
73
- termsAndConditionsLink: getClientTexts(configurator).termsAndConditionsLink,
74
- });
75
-
76
- export default containerConnect(mapStateToProps);