@configuratorware/configurator-frontendgui 1.35.6 → 1.35.7

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.
@@ -196,7 +196,8 @@ var DesignerSelectionToolbox = function DesignerSelectionToolbox(props) {
196
196
  addCustomFont = props.addCustomFont,
197
197
  defaultFont = props.defaultFont,
198
198
  loadFonts = props.loadFonts,
199
- initialColor = props.initialColor;
199
+ initialColor = props.initialColor,
200
+ autoFocusEditor = props.autoFocusEditor;
200
201
  var rteRef = (0, _react.useRef)(null);
201
202
  var editorRef = (0, _react.useRef)(null);
202
203
 
@@ -330,7 +331,7 @@ var DesignerSelectionToolbox = function DesignerSelectionToolbox(props) {
330
331
  }
331
332
 
332
333
  return renderTextEditor(_objectSpread(_objectSpread({}, textToolsRenderObj), {}, {
333
- autoFocusWhenMounted: !((0, _Selectors.isPlaceholderContent)(selectedObject.content) || (0, _isMobileDevice["default"])()),
334
+ autoFocusWhenMounted: autoFocusEditor || !((0, _Selectors.isPlaceholderContent)(selectedObject.content) || (0, _isMobileDevice["default"])()),
334
335
  textEditorElementProps: textEditorElementProps,
335
336
  onChangeHTML: function onChangeHTML() {
336
337
  // call the original function first with all the args
@@ -411,7 +412,8 @@ DesignerSelectionToolbox.propTypes = {
411
412
  calculateTextEditorBackgroundColor: _propTypes["default"].func,
412
413
  addCustomFont: _propTypes["default"].func,
413
414
  defaultFont: _propTypes["default"].object,
414
- initialColor: _propTypes["default"].object
415
+ initialColor: _propTypes["default"].object,
416
+ autoFocusEditor: _propTypes["default"].bool
415
417
  };
416
418
  DesignerSelectionToolbox.defaultProps = {
417
419
  TextControlboxComponent: _TextControlbox["default"],
@@ -422,7 +424,8 @@ DesignerSelectionToolbox.defaultProps = {
422
424
  classes: {},
423
425
  width: '',
424
426
  isActiveBulkName: false,
425
- isPortraitMode: false
427
+ isPortraitMode: false,
428
+ autoFocusEditor: false
426
429
  };
427
430
 
428
431
  var _default = (0, _withWidth["default"])()((0, _withStyles["default"])(styles, {
@@ -358,6 +358,10 @@ var AmountPrice = /*#__PURE__*/function (_React$Component) {
358
358
 
359
359
  _defineProperty(_assertThisInitialized(_this), "priceListRef", /*#__PURE__*/_react["default"].createRef());
360
360
 
361
+ _defineProperty(_assertThisInitialized(_this), "acceptDesignRef", /*#__PURE__*/_react["default"].createRef());
362
+
363
+ _defineProperty(_assertThisInitialized(_this), "acceptDataPrivacyRef", /*#__PURE__*/_react["default"].createRef());
364
+
361
365
  _defineProperty(_assertThisInitialized(_this), "handleChange", function (event) {
362
366
  _this.setState(_defineProperty({}, event.target.name, {
363
367
  value: event.target.checked,
@@ -365,7 +369,7 @@ var AmountPrice = /*#__PURE__*/function (_React$Component) {
365
369
  }));
366
370
  });
367
371
 
368
- _defineProperty(_assertThisInitialized(_this), "verifyRequestErrors", function () {
372
+ _defineProperty(_assertThisInitialized(_this), "verifyRequestErrors", function (hasFormValidationErrors) {
369
373
  var _this$props = _this.props,
370
374
  bulkNameErrors = _this$props.bulkNameErrors,
371
375
  displayAcceptDesign = _this$props.displayAcceptDesign;
@@ -390,6 +394,8 @@ var AmountPrice = /*#__PURE__*/function (_React$Component) {
390
394
  error: true
391
395
  }
392
396
  });
397
+
398
+ !hasFormValidationErrors && _this.acceptDesignRef.current && _this.acceptDesignRef.current.scrollIntoView();
393
399
  }
394
400
 
395
401
  if (!_this.dataPrivacyApproved()) {
@@ -399,6 +405,8 @@ var AmountPrice = /*#__PURE__*/function (_React$Component) {
399
405
  error: true
400
406
  }
401
407
  });
408
+
409
+ !hasFormValidationErrors && _this.acceptDataPrivacyRef.current && _this.acceptDataPrivacyRef.current.scrollIntoView();
402
410
  }
403
411
  });
404
412
 
@@ -523,7 +531,7 @@ var AmountPrice = /*#__PURE__*/function (_React$Component) {
523
531
  break;
524
532
 
525
533
  case 9:
526
- _this.verifyRequestErrors();
534
+ _this.verifyRequestErrors(formValidation.hasError);
527
535
 
528
536
  case 10:
529
537
  case "end":
@@ -799,7 +807,9 @@ var AmountPrice = /*#__PURE__*/function (_React$Component) {
799
807
  contactData: (0, _i18n.t)('amountPrice.contactData'),
800
808
  handleClose: this.handleClose,
801
809
  amount: amount,
802
- acceptDesignComponent: showCallToAction ? /*#__PURE__*/_react["default"].createElement(AcceptDesignComponent, {
810
+ acceptDesignComponent: showCallToAction ? /*#__PURE__*/_react["default"].createElement("div", {
811
+ ref: this.acceptDesignRef
812
+ }, /*#__PURE__*/_react["default"].createElement(AcceptDesignComponent, {
803
813
  termsAndConditionsLink: termsAndConditionsLink,
804
814
  displayAcceptDesign: displayAcceptDesign,
805
815
  handleChangeCheckboxApproval: this.handleChange,
@@ -808,15 +818,17 @@ var AmountPrice = /*#__PURE__*/function (_React$Component) {
808
818
  notice: notice,
809
819
  noteLabel: (0, _i18n.t)('amountPrice.notice'),
810
820
  handleChange: this.handleBasketNoticeChange
811
- }) : null,
812
- acceptDataPrivacyComponent: showReceiveOfferForm && dataPrivacyLink ? /*#__PURE__*/_react["default"].createElement(AcceptPrivacyComponent, {
821
+ })) : null,
822
+ acceptDataPrivacyComponent: showReceiveOfferForm && dataPrivacyLink ? /*#__PURE__*/_react["default"].createElement("div", {
823
+ ref: this.acceptDataPrivacyRef
824
+ }, /*#__PURE__*/_react["default"].createElement(AcceptPrivacyComponent, {
813
825
  dataPrivacyLink: dataPrivacyLink,
814
826
  displayAcceptDesign: true,
815
827
  handleChangeCheckboxApproval: this.handleChange,
816
828
  approval: dataPrivacyAccepted,
817
829
  closeProductOverviewDialog: this.handleClose,
818
830
  displayNote: false
819
- }) : null,
831
+ })) : null,
820
832
  notificationComponent: mergedNotifications.map(function (_ref4, key) {
821
833
  var message = _ref4.message,
822
834
  level = _ref4.level,
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@configuratorware/configurator-frontendgui",
3
- "version": "1.35.6",
3
+ "version": "1.35.7",
4
4
  "license": "UNLICENSED",
5
5
  "private": false,
6
6
  "main": "./index.js",
7
7
  "dependencies": {
8
8
  "@babel/polyfill": "^7.12.1",
9
- "@configuratorware/scripts": "1.35.6",
9
+ "@configuratorware/scripts": "1.35.7",
10
10
  "@hot-loader/react-dom": "^17.0.1",
11
11
  "@material-ui/core": "^4.12.2",
12
12
  "@material-ui/icons": "^4.11.2",
@@ -39,8 +39,8 @@
39
39
  "react-router-dom": "^5.2.0",
40
40
  "react-swipeable": "^5.5.1",
41
41
  "react-zoom-pan-pinch": "^2.1.3",
42
- "redhotmagma-graphics-editor": "1.35.6",
43
- "redhotmagma-visualization": "1.35.6",
42
+ "redhotmagma-graphics-editor": "1.35.7",
43
+ "redhotmagma-visualization": "1.35.7",
44
44
  "redux": "^4.1.0",
45
45
  "redux-logger": "^3.0.6",
46
46
  "redux-persist": "^5.10.0",
@@ -132,6 +132,7 @@ const DesignerSelectionToolbox = props => {
132
132
  defaultFont,
133
133
  loadFonts,
134
134
  initialColor,
135
+ autoFocusEditor,
135
136
  } = props;
136
137
 
137
138
  const rteRef = useRef(null);
@@ -291,10 +292,13 @@ const DesignerSelectionToolbox = props => {
291
292
 
292
293
  return renderTextEditor({
293
294
  ...textToolsRenderObj,
294
- autoFocusWhenMounted: !(
295
- isPlaceholderContent(selectedObject.content) ||
296
- isMobileDevice()
297
- ),
295
+ autoFocusWhenMounted:
296
+ autoFocusEditor ||
297
+ !(
298
+ isPlaceholderContent(
299
+ selectedObject.content
300
+ ) || isMobileDevice()
301
+ ),
298
302
  textEditorElementProps,
299
303
  onChangeHTML: (...args) => {
300
304
  // call the original function first with all the args
@@ -396,6 +400,7 @@ DesignerSelectionToolbox.propTypes = {
396
400
  addCustomFont: PropTypes.func,
397
401
  defaultFont: PropTypes.object,
398
402
  initialColor: PropTypes.object,
403
+ autoFocusEditor: PropTypes.bool,
399
404
  };
400
405
 
401
406
  DesignerSelectionToolbox.defaultProps = {
@@ -408,6 +413,7 @@ DesignerSelectionToolbox.defaultProps = {
408
413
  width: '',
409
414
  isActiveBulkName: false,
410
415
  isPortraitMode: false,
416
+ autoFocusEditor: false,
411
417
  };
412
418
 
413
419
  export default withWidth()(
@@ -339,6 +339,8 @@ class AmountPrice extends React.Component {
339
339
  receiveOfferFormComponentRef = React.createRef();
340
340
  dialogContentRef = React.createRef();
341
341
  priceListRef = React.createRef();
342
+ acceptDesignRef = React.createRef();
343
+ acceptDataPrivacyRef = React.createRef();
342
344
 
343
345
  handleChange = event => {
344
346
  this.setState({
@@ -349,10 +351,9 @@ class AmountPrice extends React.Component {
349
351
  });
350
352
  };
351
353
 
352
- verifyRequestErrors = () => {
354
+ verifyRequestErrors = hasFormValidationErrors => {
353
355
  const { bulkNameErrors, displayAcceptDesign } = this.props;
354
356
  const designApproved = this.state.approval.value;
355
-
356
357
  if (bulkNameErrors && bulkNameErrors.length > 0) {
357
358
  this.setState({ showErrors: true });
358
359
  this.setState({ bulkNameErrors });
@@ -365,6 +366,9 @@ class AmountPrice extends React.Component {
365
366
  error: true,
366
367
  },
367
368
  });
369
+ !hasFormValidationErrors &&
370
+ this.acceptDesignRef.current &&
371
+ this.acceptDesignRef.current.scrollIntoView();
368
372
  }
369
373
  if (!this.dataPrivacyApproved()) {
370
374
  this.setState({
@@ -373,6 +377,9 @@ class AmountPrice extends React.Component {
373
377
  error: true,
374
378
  },
375
379
  });
380
+ !hasFormValidationErrors &&
381
+ this.acceptDataPrivacyRef.current &&
382
+ this.acceptDataPrivacyRef.current.scrollIntoView();
376
383
  }
377
384
  };
378
385
 
@@ -449,7 +456,7 @@ class AmountPrice extends React.Component {
449
456
  this.setState({ hasErrorReceiveOfferForm: false });
450
457
  }
451
458
  } else {
452
- this.verifyRequestErrors();
459
+ this.verifyRequestErrors(formValidation.hasError);
453
460
  }
454
461
  };
455
462
 
@@ -574,28 +581,32 @@ class AmountPrice extends React.Component {
574
581
  amount={amount}
575
582
  acceptDesignComponent={
576
583
  showCallToAction ? (
577
- <AcceptDesignComponent
578
- termsAndConditionsLink={termsAndConditionsLink}
579
- displayAcceptDesign={displayAcceptDesign}
580
- handleChangeCheckboxApproval={this.handleChange}
581
- approval={approval}
582
- closeProductOverviewDialog={this.handleClose}
583
- notice={notice}
584
- noteLabel={t('amountPrice.notice')}
585
- handleChange={this.handleBasketNoticeChange}
586
- />
584
+ <div ref={this.acceptDesignRef}>
585
+ <AcceptDesignComponent
586
+ termsAndConditionsLink={termsAndConditionsLink}
587
+ displayAcceptDesign={displayAcceptDesign}
588
+ handleChangeCheckboxApproval={this.handleChange}
589
+ approval={approval}
590
+ closeProductOverviewDialog={this.handleClose}
591
+ notice={notice}
592
+ noteLabel={t('amountPrice.notice')}
593
+ handleChange={this.handleBasketNoticeChange}
594
+ />
595
+ </div>
587
596
  ) : null
588
597
  }
589
598
  acceptDataPrivacyComponent={
590
599
  showReceiveOfferForm && dataPrivacyLink ? (
591
- <AcceptPrivacyComponent
592
- dataPrivacyLink={dataPrivacyLink}
593
- displayAcceptDesign={true}
594
- handleChangeCheckboxApproval={this.handleChange}
595
- approval={dataPrivacyAccepted}
596
- closeProductOverviewDialog={this.handleClose}
597
- displayNote={false}
598
- />
600
+ <div ref={this.acceptDataPrivacyRef}>
601
+ <AcceptPrivacyComponent
602
+ dataPrivacyLink={dataPrivacyLink}
603
+ displayAcceptDesign={true}
604
+ handleChangeCheckboxApproval={this.handleChange}
605
+ approval={dataPrivacyAccepted}
606
+ closeProductOverviewDialog={this.handleClose}
607
+ displayNote={false}
608
+ />
609
+ </div>
599
610
  ) : null
600
611
  }
601
612
  notificationComponent={mergedNotifications.map(