@configuratorware/configurator-frontendgui 1.30.3 → 1.31.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.
- package/App/Reducers/Configurator/Actions.js +20 -81
- package/App/Screens/Configurator/ThemeProvider.js +1 -1
- package/App/{Screens/Configurator/Containers/DesignApproval.js → Shared/Components/AcceptPrivacy/index.js} +78 -71
- package/App/Shared/Components/AddToBasket/index.js +1 -1
- package/App/Shared/Components/AmountPrice/index.js +83 -49
- package/App/Shared/Components/PriceOverview/index.js +5 -3
- package/App/Shared/Components/ReceiveOfferForm/index.js +9 -10
- package/App/configuration.js +1 -1
- package/package.json +4 -4
- package/public/translations/de_DE.json +4 -1
- package/public/translations/en_GB.json +4 -1
- package/src/App/Reducers/Configurator/Actions.js +6 -37
- package/src/App/Screens/Configurator/ThemeProvider.js +2 -2
- package/src/App/Shared/Components/AcceptPrivacy/index.js +78 -0
- package/src/App/Shared/Components/AddToBasket/index.js +1 -1
- package/src/App/Shared/Components/AmountPrice/index.js +48 -3
- package/src/App/Shared/Components/PriceOverview/index.js +3 -0
- package/src/App/Shared/Components/ReceiveOfferForm/__snapshots__/index.test.jsx.snap +64 -64
- package/src/App/Shared/Components/ReceiveOfferForm/index.js +9 -10
- package/src/App/configuration.js +1 -1
- package/App/Screens/Configurator/Components/DesignApproval/index.js +0 -76
- package/App/Screens/Configurator/Components/DesignApproval/index.story.js +0 -27
- package/App/Screens/Configurator/Components/DesignApproval/index.test.js +0 -31
- package/src/App/Screens/Configurator/Components/DesignApproval/__snapshots__/index.test.jsx.snap +0 -91
- package/src/App/Screens/Configurator/Components/DesignApproval/index.js +0 -54
- package/src/App/Screens/Configurator/Components/DesignApproval/index.story.js +0 -12
- package/src/App/Screens/Configurator/Components/DesignApproval/index.test.jsx +0 -17
- package/src/App/Screens/Configurator/Containers/DesignApproval.js +0 -76
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.setSelectedCalculation = exports.switchSelectedAmount = exports.setComment = exports.deleteSelectedAmounts = exports.setSelectedAmounts = exports.deleteSelectedAmount = exports.clearBulkNames = exports.saveBulkNames = exports.setSelectedAmount = exports.loadDesignerData = exports.receiveDesignerData = exports.loadConfiguration = exports.viewOptionDetails = exports.selectMultipleOptions = exports.selectOption = exports.resolveConflicts = exports.loadInitialOptionclassification = exports.fetchInitialConfiguration = exports.setConflictingSwitchoptionData = exports.setOptionclassificationChecked = exports.setCalculationEnabled = exports.setSelectedVariantIdentifier = exports.setStockInformationOption = exports.setLoadIdentifier = exports.setLoadCode = exports.fetchInspirations = exports.fetchClientData = exports.fetchCodesnippets = exports.fetchConfigurationVariants = exports.validateConfiguration = exports.saveConfiguration = exports.fetchOptionDetails = exports.doCalculation = exports.switchOptions = exports.
|
|
6
|
+
exports.setSelectedCalculation = exports.switchSelectedAmount = exports.setComment = exports.deleteSelectedAmounts = exports.setSelectedAmounts = exports.deleteSelectedAmount = exports.clearBulkNames = exports.saveBulkNames = exports.setSelectedAmount = exports.loadDesignerData = exports.receiveDesignerData = exports.loadConfiguration = exports.viewOptionDetails = exports.selectMultipleOptions = exports.selectOption = exports.resolveConflicts = exports.loadInitialOptionclassification = exports.fetchInitialConfiguration = exports.setConflictingSwitchoptionData = exports.setOptionclassificationChecked = exports.setCalculationEnabled = exports.setSelectedVariantIdentifier = exports.setStockInformationOption = exports.setLoadIdentifier = exports.setLoadCode = exports.fetchInspirations = exports.fetchClientData = exports.fetchCodesnippets = exports.fetchConfigurationVariants = exports.validateConfiguration = exports.saveConfiguration = exports.fetchOptionDetails = exports.doCalculation = exports.switchOptions = exports.switchOptionsBasic = exports.fetchOptions = exports.fetchConfigurationByCodeAsync = exports.fetchConfigurationByCode = exports.fetchConfiguration = exports.inspectValidationResults = exports.inspectCheckResults = exports.setCustomTitle = exports.receiveInspirations = exports.receiveClientData = exports.fetchConfigurationForDesignerProductPreview = exports.receiveCodesnippets = exports.receiveConfigurationVariants = exports.receiveValidation = exports.receiveSavedConfiguration = exports.clearOptionDetails = exports.receiveOptionDetails = exports.skipNextAutoResolve = exports.setCalculationAutoResolveEnabled = exports.setCalculationErrorsResolved = exports.invalidateCalculation = exports.receiveCalculation = exports.receiveSwitchoptionsresult = exports.receiveOptions = exports.selectOptionclassification = exports.applyVariantAmountPreSelection = exports.setDefaultSelectedVariantIdentifier = exports.deleteMissingVariants = exports.receiveConfiguration = exports.DELETE_SELECTED_AMOUNTS = exports.SET_SELECTED_AMOUNTS = exports.SET_COMMENT = exports.SET_SELECTED_CALCULATION = exports.DELETE_SELECTED_AMOUNT = exports.CLEAR_BULKNAMES = exports.SAVE_BULKNAMES = exports.SWITCH_SELECTED_AMOUNT = exports.SET_SELECTED_AMOUNT = exports.SET_CONFLICTING_SWITCHOPTION_DATA = exports.SET_OPTIONCLASSIFICATION_CHECKED = exports.SET_CALCULATION_AUTO_RESOLVE_ENABLED = exports.SET_CALCULATION_ERRORS_RESOLVED = exports.SET_CALCULATION_ENABLED = exports.SET_SELECTED_VARIANT_IDENTIFIER = exports.SET_STOCK_INFORMATION_OPTION = exports.SET_LOAD_IDENTIFIER = exports.SET_LOAD_CODE = exports.SET_CUSTOM_TITLE = exports.RECEIVE_INSPIRATIONS = exports.RECEIVE_CLIENT_DATA = exports.RECEIVE_CODESNIPPETS = exports.RECEIVE_CONFIGURATIONVARIANTS = exports.RECEIVE_VALIDATION = exports.RECEIVE_SAVEDCONFIGURATION = exports.RECEIVE_OPTIONDETAILS = exports.INVALIDATE_CALCULATION = exports.RECEIVE_CALCULATION = exports.RECEIVE_SWITCHOPTIONSRESULT = exports.RECEIVE_OPTIONS = exports.SELECT_OPTIONCLASSIFICATION = exports.RECEIVE_DESIGNER_DATA = exports.RECEIVE_CONFIGURATION = void 0;
|
|
7
7
|
|
|
8
8
|
var apiActions = _interopRequireWildcard(require("../Actions"));
|
|
9
9
|
|
|
@@ -57,17 +57,9 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
57
57
|
|
|
58
58
|
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; }
|
|
59
59
|
|
|
60
|
-
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); }
|
|
61
|
-
|
|
62
60
|
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; }
|
|
63
61
|
|
|
64
|
-
function
|
|
65
|
-
|
|
66
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
67
|
-
|
|
68
|
-
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
69
|
-
|
|
70
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
62
|
+
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); }
|
|
71
63
|
|
|
72
64
|
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; } } }; }
|
|
73
65
|
|
|
@@ -753,7 +745,7 @@ var fetchOptions = function fetchOptions(itemidentifier, optionclassification, c
|
|
|
753
745
|
|
|
754
746
|
exports.fetchOptions = fetchOptions;
|
|
755
747
|
|
|
756
|
-
var switchOptionsBasic = function switchOptionsBasic(configuration,
|
|
748
|
+
var switchOptionsBasic = function switchOptionsBasic(configuration, switchedOptions) {
|
|
757
749
|
var noCheck = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
758
750
|
var config = {};
|
|
759
751
|
|
|
@@ -765,7 +757,7 @@ var switchOptionsBasic = function switchOptionsBasic(configuration, switchedopti
|
|
|
765
757
|
|
|
766
758
|
return apiActions.postData('configuration/switchoption', {
|
|
767
759
|
configuration: configuration,
|
|
768
|
-
|
|
760
|
+
switchedOptions: switchedOptions
|
|
769
761
|
}, function (data) {
|
|
770
762
|
return {
|
|
771
763
|
// dummy receiver
|
|
@@ -777,65 +769,12 @@ var switchOptionsBasic = function switchOptionsBasic(configuration, switchedopti
|
|
|
777
769
|
|
|
778
770
|
exports.switchOptionsBasic = switchOptionsBasic;
|
|
779
771
|
|
|
780
|
-
var switchOptionArrays = function switchOptionArrays(configuration, switchOptionData) {
|
|
781
|
-
var noCheck = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
782
|
-
return function (dispatch) {
|
|
783
|
-
var switchedoptions = {};
|
|
784
|
-
var afterSwitch = [];
|
|
785
|
-
|
|
786
|
-
for (var componentIdentifier in switchOptionData) {
|
|
787
|
-
if ((0, _lodash.isArray)(switchOptionData[componentIdentifier])) {
|
|
788
|
-
var _switchOptionData$com = _toArray(switchOptionData[componentIdentifier]),
|
|
789
|
-
firstOption = _switchOptionData$com[0],
|
|
790
|
-
otherOptions = _switchOptionData$com.slice(1);
|
|
791
|
-
|
|
792
|
-
switchedoptions[componentIdentifier] = firstOption;
|
|
793
|
-
|
|
794
|
-
if (otherOptions.length > 0) {
|
|
795
|
-
var _iterator2 = _createForOfIteratorHelper(otherOptions),
|
|
796
|
-
_step2;
|
|
797
|
-
|
|
798
|
-
try {
|
|
799
|
-
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
800
|
-
var optionData = _step2.value;
|
|
801
|
-
afterSwitch.push(_defineProperty({}, componentIdentifier, optionData));
|
|
802
|
-
}
|
|
803
|
-
} catch (err) {
|
|
804
|
-
_iterator2.e(err);
|
|
805
|
-
} finally {
|
|
806
|
-
_iterator2.f();
|
|
807
|
-
}
|
|
808
|
-
}
|
|
809
|
-
} else {
|
|
810
|
-
switchedoptions[componentIdentifier] = switchOptionData[componentIdentifier];
|
|
811
|
-
}
|
|
812
|
-
}
|
|
813
|
-
|
|
814
|
-
var p = dispatch(switchOptionsBasic(configuration, switchedoptions, noCheck));
|
|
815
|
-
|
|
816
|
-
var _loop = function _loop() {
|
|
817
|
-
var switchOption = _afterSwitch[_i];
|
|
818
|
-
p = p.then(function (action) {
|
|
819
|
-
return dispatch(switchOptionsBasic(action.data, switchOption, noCheck));
|
|
820
|
-
});
|
|
821
|
-
};
|
|
822
|
-
|
|
823
|
-
for (var _i = 0, _afterSwitch = afterSwitch; _i < _afterSwitch.length; _i++) {
|
|
824
|
-
_loop();
|
|
825
|
-
}
|
|
826
|
-
|
|
827
|
-
return p;
|
|
828
|
-
};
|
|
829
|
-
};
|
|
830
|
-
|
|
831
|
-
exports.switchOptionArrays = switchOptionArrays;
|
|
832
|
-
|
|
833
772
|
var switchOptions = function switchOptions(configuration, switchOptionData) {
|
|
834
773
|
var noCheck = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
835
774
|
var refreshOptions = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
|
|
836
775
|
var setChecked = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
|
|
837
776
|
return function (dispatch) {
|
|
838
|
-
return dispatch(
|
|
777
|
+
return dispatch(switchOptionsBasic(configuration, switchOptionData, noCheck)).then(function (action) {
|
|
839
778
|
var extraData = {
|
|
840
779
|
switchOptionData: switchOptionData,
|
|
841
780
|
noCheck: noCheck,
|
|
@@ -1060,12 +999,12 @@ var resolveConflicts = function resolveConflicts() {
|
|
|
1060
999
|
if ((0, _lodash.isArray)(incompatibilityCheckResults.check_results)) {
|
|
1061
1000
|
dispatch(setCalculationEnabled(false)); // disable calculation while waiting for all options to be switched
|
|
1062
1001
|
|
|
1063
|
-
var
|
|
1064
|
-
|
|
1002
|
+
var _iterator2 = _createForOfIteratorHelper(incompatibilityCheckResults.check_results),
|
|
1003
|
+
_step2;
|
|
1065
1004
|
|
|
1066
1005
|
try {
|
|
1067
|
-
for (
|
|
1068
|
-
var result =
|
|
1006
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
1007
|
+
var result = _step2.value;
|
|
1069
1008
|
|
|
1070
1009
|
if (result.status === false) {
|
|
1071
1010
|
(function () {
|
|
@@ -1075,19 +1014,19 @@ var resolveConflicts = function resolveConflicts() {
|
|
|
1075
1014
|
if (switchOptionsData) {
|
|
1076
1015
|
if (p) {
|
|
1077
1016
|
p = p.then(function (action) {
|
|
1078
|
-
return dispatch(
|
|
1017
|
+
return dispatch(switchOptionsBasic(action.data, switchOptionsData, true));
|
|
1079
1018
|
});
|
|
1080
1019
|
} else {
|
|
1081
|
-
p = dispatch(
|
|
1020
|
+
p = dispatch(switchOptionsBasic(configuration, switchOptionsData, true));
|
|
1082
1021
|
}
|
|
1083
1022
|
}
|
|
1084
1023
|
})();
|
|
1085
1024
|
}
|
|
1086
1025
|
}
|
|
1087
1026
|
} catch (err) {
|
|
1088
|
-
|
|
1027
|
+
_iterator2.e(err);
|
|
1089
1028
|
} finally {
|
|
1090
|
-
|
|
1029
|
+
_iterator2.f();
|
|
1091
1030
|
}
|
|
1092
1031
|
|
|
1093
1032
|
if (p) {
|
|
@@ -1160,26 +1099,26 @@ var selectMultipleOptions = function selectMultipleOptions(optionsList) {
|
|
|
1160
1099
|
var configuration = (0, _Selectors.getConfiguration)((0, _Selectors.getConfigurator)(getState()));
|
|
1161
1100
|
var switchOptionData = {};
|
|
1162
1101
|
|
|
1163
|
-
var
|
|
1164
|
-
|
|
1102
|
+
var _iterator3 = _createForOfIteratorHelper(optionsList),
|
|
1103
|
+
_step3;
|
|
1165
1104
|
|
|
1166
1105
|
try {
|
|
1167
|
-
for (
|
|
1168
|
-
var component =
|
|
1106
|
+
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
1107
|
+
var component = _step3.value;
|
|
1169
1108
|
switchOptionData[component.identifier] = component.selectedoptions.map(function (_ref5) {
|
|
1170
1109
|
var identifier = _ref5.identifier,
|
|
1171
1110
|
amount = _ref5.amount;
|
|
1172
1111
|
return {
|
|
1173
1112
|
identifier: identifier,
|
|
1174
|
-
amount: amount
|
|
1113
|
+
amount: typeof amount === 'undefined' ? 1 : amount,
|
|
1175
1114
|
check_results: null
|
|
1176
1115
|
};
|
|
1177
1116
|
});
|
|
1178
1117
|
}
|
|
1179
1118
|
} catch (err) {
|
|
1180
|
-
|
|
1119
|
+
_iterator3.e(err);
|
|
1181
1120
|
} finally {
|
|
1182
|
-
|
|
1121
|
+
_iterator3.f();
|
|
1183
1122
|
}
|
|
1184
1123
|
|
|
1185
1124
|
return dispatch(switchOptions(configuration, switchOptionData, false, false, true));
|
|
@@ -267,7 +267,7 @@ var ThemeMixer = function ThemeMixer(_ref) {
|
|
|
267
267
|
withTheme = _ref.withTheme,
|
|
268
268
|
children = _ref.children;
|
|
269
269
|
var themeMix = (0, _react.useMemo)(function () {
|
|
270
|
-
var theme = (0, _styles.
|
|
270
|
+
var theme = (0, _styles.createTheme)(createThemeFromClientTheme(client && client.theme ? client.theme : {}, customTheme || {}));
|
|
271
271
|
|
|
272
272
|
if (typeof withTheme === 'function') {
|
|
273
273
|
withTheme(theme);
|
|
@@ -9,13 +9,21 @@ exports["default"] = void 0;
|
|
|
9
9
|
|
|
10
10
|
var _react = _interopRequireDefault(require("react"));
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _styles = require("@material-ui/core/styles");
|
|
13
|
+
|
|
14
|
+
var _i18n = require("../../../../Framework/i18n");
|
|
15
|
+
|
|
16
|
+
var _withWidth = _interopRequireDefault(require("@material-ui/core/withWidth/withWidth"));
|
|
13
17
|
|
|
14
|
-
var
|
|
18
|
+
var _Grid = _interopRequireDefault(require("@material-ui/core/Grid/Grid"));
|
|
15
19
|
|
|
16
|
-
var
|
|
20
|
+
var _FormControlLabel = _interopRequireDefault(require("@material-ui/core/FormControlLabel"));
|
|
17
21
|
|
|
18
|
-
var
|
|
22
|
+
var _Checkbox = _interopRequireDefault(require("@material-ui/core/Checkbox"));
|
|
23
|
+
|
|
24
|
+
var _FormHelperText = _interopRequireDefault(require("@material-ui/core/FormHelperText"));
|
|
25
|
+
|
|
26
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
19
27
|
|
|
20
28
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
21
29
|
|
|
@@ -41,89 +49,88 @@ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.g
|
|
|
41
49
|
|
|
42
50
|
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; }
|
|
43
51
|
|
|
44
|
-
var
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
52
|
+
var styles = function styles(theme) {
|
|
53
|
+
return {
|
|
54
|
+
checkboxLabel: _defineProperty({
|
|
55
|
+
fontSize: 15,
|
|
56
|
+
paddingLeft: 15,
|
|
57
|
+
paddingBottom: 12
|
|
58
|
+
}, theme.breakpoints.down('xs'), {
|
|
59
|
+
paddingLeft: 12
|
|
60
|
+
}),
|
|
61
|
+
checkbox: {
|
|
62
|
+
alignSelf: 'flex-start',
|
|
63
|
+
top: -10
|
|
64
|
+
},
|
|
65
|
+
formHelperText: {
|
|
66
|
+
marginLeft: 45,
|
|
67
|
+
marginBottom: 15
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
};
|
|
48
71
|
|
|
49
|
-
|
|
50
|
-
|
|
72
|
+
var AcceptPrivacy = /*#__PURE__*/function (_React$Component) {
|
|
73
|
+
_inherits(AcceptPrivacy, _React$Component);
|
|
51
74
|
|
|
52
|
-
|
|
75
|
+
var _super = _createSuper(AcceptPrivacy);
|
|
53
76
|
|
|
54
|
-
|
|
77
|
+
function AcceptPrivacy() {
|
|
78
|
+
_classCallCheck(this, AcceptPrivacy);
|
|
55
79
|
|
|
56
|
-
|
|
57
|
-
_this.setState({
|
|
58
|
-
approval: {
|
|
59
|
-
checked: checked,
|
|
60
|
-
error: false
|
|
61
|
-
}
|
|
62
|
-
});
|
|
63
|
-
});
|
|
64
|
-
|
|
65
|
-
_this.state = {
|
|
66
|
-
approval: {
|
|
67
|
-
checked: false,
|
|
68
|
-
error: false
|
|
69
|
-
}
|
|
70
|
-
};
|
|
71
|
-
return _this;
|
|
80
|
+
return _super.apply(this, arguments);
|
|
72
81
|
}
|
|
73
82
|
|
|
74
|
-
_createClass(
|
|
75
|
-
key: "validate",
|
|
76
|
-
value: function validate() {
|
|
77
|
-
var checked = this.state.approval.checked;
|
|
78
|
-
|
|
79
|
-
if (checked) {
|
|
80
|
-
return true;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
this.setState({
|
|
84
|
-
approval: {
|
|
85
|
-
checked: checked,
|
|
86
|
-
error: true
|
|
87
|
-
}
|
|
88
|
-
});
|
|
89
|
-
return false;
|
|
90
|
-
}
|
|
91
|
-
}, {
|
|
83
|
+
_createClass(AcceptPrivacy, [{
|
|
92
84
|
key: "render",
|
|
93
85
|
value: function render() {
|
|
94
|
-
var approval = this.state.approval;
|
|
95
86
|
var _this$props = this.props,
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
87
|
+
classes = _this$props.classes,
|
|
88
|
+
handleChangeCheckboxApproval = _this$props.handleChangeCheckboxApproval,
|
|
89
|
+
approval = _this$props.approval,
|
|
90
|
+
dataPrivacyLink = _this$props.dataPrivacyLink;
|
|
91
|
+
var privacyLink = "<a href=\"".concat(dataPrivacyLink, "\"\n target=\"_blank\">").concat((0, _i18n.t)('receiveOfferForm.privacyLinkLabel'), "</a>");
|
|
92
|
+
var privacyNotice = (0, _i18n.t)('receiveOfferForm.privacyNotice', {
|
|
93
|
+
privacyLink: privacyLink
|
|
103
94
|
});
|
|
95
|
+
return /*#__PURE__*/_react["default"].createElement(_Grid["default"], {
|
|
96
|
+
container: true
|
|
97
|
+
}, /*#__PURE__*/_react["default"].createElement(_Grid["default"], {
|
|
98
|
+
item: true,
|
|
99
|
+
xs: 12
|
|
100
|
+
}, /*#__PURE__*/_react["default"].createElement(_FormControlLabel["default"], {
|
|
101
|
+
className: classes.checkboxLabel,
|
|
102
|
+
control: /*#__PURE__*/_react["default"].createElement(_Checkbox["default"], {
|
|
103
|
+
className: classes.checkbox,
|
|
104
|
+
name: "dataPrivacyAccepted",
|
|
105
|
+
checked: approval.value,
|
|
106
|
+
onChange: handleChangeCheckboxApproval,
|
|
107
|
+
color: "primary"
|
|
108
|
+
}),
|
|
109
|
+
label: /*#__PURE__*/_react["default"].createElement("span", {
|
|
110
|
+
dangerouslySetInnerHTML: {
|
|
111
|
+
__html: privacyNotice
|
|
112
|
+
}
|
|
113
|
+
})
|
|
114
|
+
}), approval.error && /*#__PURE__*/_react["default"].createElement(_FormHelperText["default"], {
|
|
115
|
+
error: true,
|
|
116
|
+
className: classes.formHelperText
|
|
117
|
+
}, (0, _i18n.t)('receiveOfferForm.selectionError'))));
|
|
104
118
|
}
|
|
105
119
|
}]);
|
|
106
120
|
|
|
107
|
-
return
|
|
121
|
+
return AcceptPrivacy;
|
|
108
122
|
}(_react["default"].Component);
|
|
109
123
|
|
|
110
|
-
_defineProperty(
|
|
111
|
-
|
|
112
|
-
|
|
124
|
+
_defineProperty(AcceptPrivacy, "propTypes", {
|
|
125
|
+
classes: _propTypes["default"].object,
|
|
126
|
+
width: _propTypes["default"].string,
|
|
127
|
+
handleChangeCheckboxApproval: _propTypes["default"].func,
|
|
128
|
+
approval: _propTypes["default"].object,
|
|
129
|
+
dataPrivacyLink: _propTypes["default"].string
|
|
113
130
|
});
|
|
114
131
|
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
});
|
|
118
|
-
|
|
119
|
-
var mapStateToProps = function mapStateToProps(_ref) {
|
|
120
|
-
var configurator = _ref.configurator;
|
|
121
|
-
return {
|
|
122
|
-
Component: DesignApprovalContainer,
|
|
123
|
-
termsAndConditionsLink: (0, _Selectors.getClientTexts)(configurator).termsAndConditionsLink
|
|
124
|
-
};
|
|
125
|
-
};
|
|
126
|
-
|
|
127
|
-
var _default = (0, _ComponentContainer.containerConnect)(mapStateToProps);
|
|
132
|
+
var _default = (0, _withWidth["default"])()((0, _styles.withStyles)(styles, {
|
|
133
|
+
name: 'AcceptPrivacy'
|
|
134
|
+
})(AcceptPrivacy));
|
|
128
135
|
|
|
129
136
|
exports["default"] = _default;
|
|
@@ -71,6 +71,8 @@ var _LoadingOverlay = _interopRequireDefault(require("../../../../Framework/Comp
|
|
|
71
71
|
|
|
72
72
|
var _core = require("@material-ui/core");
|
|
73
73
|
|
|
74
|
+
var _AcceptPrivacy = _interopRequireDefault(require("../AcceptPrivacy"));
|
|
75
|
+
|
|
74
76
|
var _excluded = ["onTouchMove"],
|
|
75
77
|
_excluded2 = ["wrapperClass", "renderPriceBox"];
|
|
76
78
|
|
|
@@ -346,7 +348,8 @@ var AmountPrice = /*#__PURE__*/function (_React$Component) {
|
|
|
346
348
|
error: null
|
|
347
349
|
},
|
|
348
350
|
inView: true,
|
|
349
|
-
showErrors: false
|
|
351
|
+
showErrors: false,
|
|
352
|
+
dataPrivacyAccepted: false
|
|
350
353
|
});
|
|
351
354
|
|
|
352
355
|
_defineProperty(_assertThisInitialized(_this), "receiveOfferFormComponentRef", /*#__PURE__*/_react["default"].createRef());
|
|
@@ -388,6 +391,15 @@ var AmountPrice = /*#__PURE__*/function (_React$Component) {
|
|
|
388
391
|
}
|
|
389
392
|
});
|
|
390
393
|
}
|
|
394
|
+
|
|
395
|
+
if (!_this.dataPrivacyApproved()) {
|
|
396
|
+
_this.setState({
|
|
397
|
+
dataPrivacyAccepted: {
|
|
398
|
+
value: false,
|
|
399
|
+
error: true
|
|
400
|
+
}
|
|
401
|
+
});
|
|
402
|
+
}
|
|
391
403
|
});
|
|
392
404
|
|
|
393
405
|
_defineProperty(_assertThisInitialized(_this), "requestHasErrors", function () {
|
|
@@ -396,7 +408,7 @@ var AmountPrice = /*#__PURE__*/function (_React$Component) {
|
|
|
396
408
|
displayAcceptDesign = _this$props2.displayAcceptDesign;
|
|
397
409
|
var designApproved = _this.state.approval.value;
|
|
398
410
|
|
|
399
|
-
if (bulkNameErrors && bulkNameErrors.length > 0 || displayAcceptDesign && !designApproved) {
|
|
411
|
+
if (bulkNameErrors && bulkNameErrors.length > 0 || displayAcceptDesign && !designApproved || !_this.dataPrivacyApproved()) {
|
|
400
412
|
return true;
|
|
401
413
|
}
|
|
402
414
|
|
|
@@ -413,6 +425,15 @@ var AmountPrice = /*#__PURE__*/function (_React$Component) {
|
|
|
413
425
|
}
|
|
414
426
|
});
|
|
415
427
|
|
|
428
|
+
_defineProperty(_assertThisInitialized(_this), "dataPrivacyApproved", function () {
|
|
429
|
+
var _this$props3 = _this.props,
|
|
430
|
+
showReceiveOfferForm = _this$props3.showReceiveOfferForm,
|
|
431
|
+
clientTexts = _this$props3.clientTexts;
|
|
432
|
+
var dataPrivacyLink = clientTexts.dataPrivacyLink;
|
|
433
|
+
var dataPrivacyApproved = _this.state.dataPrivacyAccepted.value;
|
|
434
|
+
return showReceiveOfferForm && dataPrivacyApproved && dataPrivacyLink;
|
|
435
|
+
});
|
|
436
|
+
|
|
416
437
|
_defineProperty(_assertThisInitialized(_this), "handleTouchMove", function (evt) {
|
|
417
438
|
var dialogContent = _this.dialogContentRef.current;
|
|
418
439
|
evt.preventDefault();
|
|
@@ -554,18 +575,18 @@ var AmountPrice = /*#__PURE__*/function (_React$Component) {
|
|
|
554
575
|
});
|
|
555
576
|
|
|
556
577
|
_defineProperty(_assertThisInitialized(_this), "renderDefaultPriceBox", function () {
|
|
557
|
-
var _this$
|
|
558
|
-
classes = _this$
|
|
559
|
-
amount = _this$
|
|
560
|
-
boxed = _this$
|
|
561
|
-
priceFormatted = _this$
|
|
562
|
-
hidePrices = _this$
|
|
563
|
-
hidePieces = _this$
|
|
564
|
-
vatNotice = _this$
|
|
565
|
-
showReceiveOfferForm = _this$
|
|
566
|
-
showCallToAction = _this$
|
|
567
|
-
showConfigurationModeSwitch = _this$
|
|
568
|
-
ConfigurationModeSwitchComponent = _this$
|
|
578
|
+
var _this$props4 = _this.props,
|
|
579
|
+
classes = _this$props4.classes,
|
|
580
|
+
amount = _this$props4.amount,
|
|
581
|
+
boxed = _this$props4.boxed,
|
|
582
|
+
priceFormatted = _this$props4.priceFormatted,
|
|
583
|
+
hidePrices = _this$props4.hidePrices,
|
|
584
|
+
hidePieces = _this$props4.hidePieces,
|
|
585
|
+
vatNotice = _this$props4.vatNotice,
|
|
586
|
+
showReceiveOfferForm = _this$props4.showReceiveOfferForm,
|
|
587
|
+
showCallToAction = _this$props4.showCallToAction,
|
|
588
|
+
showConfigurationModeSwitch = _this$props4.showConfigurationModeSwitch,
|
|
589
|
+
ConfigurationModeSwitchComponent = _this$props4.ConfigurationModeSwitchComponent;
|
|
569
590
|
var boxStyle = boxed ? classes.card : classes.cardUnboxed;
|
|
570
591
|
return /*#__PURE__*/_react["default"].createElement(_Card["default"], {
|
|
571
592
|
className: (0, _clsx["default"])(boxStyle, (0, _customClassName["default"])('cta-box'))
|
|
@@ -653,9 +674,9 @@ var AmountPrice = /*#__PURE__*/function (_React$Component) {
|
|
|
653
674
|
_createClass(AmountPrice, [{
|
|
654
675
|
key: "componentDidUpdate",
|
|
655
676
|
value: function componentDidUpdate(prevProps, prevState) {
|
|
656
|
-
var _this$
|
|
657
|
-
error = _this$
|
|
658
|
-
bulkNameErrors = _this$
|
|
677
|
+
var _this$props5 = this.props,
|
|
678
|
+
error = _this$props5.error,
|
|
679
|
+
bulkNameErrors = _this$props5.bulkNameErrors;
|
|
659
680
|
|
|
660
681
|
if (error && !(0, _isEqual["default"])(error, prevProps.error) && this.dialogContentRef.current) {
|
|
661
682
|
this.dialogContentRef.current.scrollTo(0, 0);
|
|
@@ -695,32 +716,35 @@ var AmountPrice = /*#__PURE__*/function (_React$Component) {
|
|
|
695
716
|
approval = _this$state.approval,
|
|
696
717
|
inView = _this$state.inView,
|
|
697
718
|
showErrors = _this$state.showErrors,
|
|
698
|
-
bulkNameErrors = _this$state.bulkNameErrors
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
719
|
+
bulkNameErrors = _this$state.bulkNameErrors,
|
|
720
|
+
dataPrivacyAccepted = _this$state.dataPrivacyAccepted;
|
|
721
|
+
var _this$props6 = this.props,
|
|
722
|
+
amount = _this$props6.amount,
|
|
723
|
+
priceList = _this$props6.priceList,
|
|
724
|
+
priceFormatted = _this$props6.priceFormatted,
|
|
725
|
+
onSelectableChanged = _this$props6.onSelectableChanged,
|
|
726
|
+
showProductVariants = _this$props6.showProductVariants,
|
|
727
|
+
ProductVariantComponent = _this$props6.ProductVariantComponent,
|
|
728
|
+
error = _this$props6.error,
|
|
729
|
+
width = _this$props6.width,
|
|
730
|
+
hidePrices = _this$props6.hidePrices,
|
|
731
|
+
title = _this$props6.title,
|
|
732
|
+
classes = _this$props6.classes,
|
|
733
|
+
showReceiveOfferForm = _this$props6.showReceiveOfferForm,
|
|
734
|
+
vatNotice = _this$props6.vatNotice,
|
|
735
|
+
clientTexts = _this$props6.clientTexts,
|
|
736
|
+
displayAcceptDesign = _this$props6.displayAcceptDesign,
|
|
737
|
+
notifications = _this$props6.notifications,
|
|
738
|
+
showCallToAction = _this$props6.showCallToAction,
|
|
739
|
+
ReceiveOfferFormComponent = _this$props6.ReceiveOfferFormComponent,
|
|
740
|
+
AcceptDesignComponent = _this$props6.AcceptDesignComponent,
|
|
741
|
+
PriceOverviewComponent = _this$props6.PriceOverviewComponent,
|
|
742
|
+
NotificationComponent = _this$props6.NotificationComponent,
|
|
743
|
+
PriceListComponent = _this$props6.PriceListComponent,
|
|
744
|
+
AddToCartComponent = _this$props6.AddToCartComponent,
|
|
745
|
+
AcceptPrivacyComponent = _this$props6.AcceptPrivacyComponent;
|
|
746
|
+
var termsAndConditionsLink = clientTexts.termsAndConditionsLink,
|
|
747
|
+
dataPrivacyLink = clientTexts.dataPrivacyLink;
|
|
724
748
|
var mergedNotifications = _toConsumableArray(notifications) || [];
|
|
725
749
|
|
|
726
750
|
if (showErrors && bulkNameErrors && bulkNameErrors.length > 0) {
|
|
@@ -785,6 +809,14 @@ var AmountPrice = /*#__PURE__*/function (_React$Component) {
|
|
|
785
809
|
noteLabel: (0, _i18n.t)('amountPrice.notice'),
|
|
786
810
|
handleChange: this.handleBasketNoticeChange
|
|
787
811
|
}) : null,
|
|
812
|
+
acceptDataPrivacyComponent: showReceiveOfferForm && dataPrivacyLink ? /*#__PURE__*/_react["default"].createElement(AcceptPrivacyComponent, {
|
|
813
|
+
dataPrivacyLink: dataPrivacyLink,
|
|
814
|
+
displayAcceptDesign: true,
|
|
815
|
+
handleChangeCheckboxApproval: this.handleChange,
|
|
816
|
+
approval: dataPrivacyAccepted,
|
|
817
|
+
closeProductOverviewDialog: this.handleClose,
|
|
818
|
+
displayNote: false
|
|
819
|
+
}) : null,
|
|
788
820
|
notificationComponent: mergedNotifications.map(function (_ref4, key) {
|
|
789
821
|
var message = _ref4.message,
|
|
790
822
|
level = _ref4.level,
|
|
@@ -839,10 +871,10 @@ var AmountPrice = /*#__PURE__*/function (_React$Component) {
|
|
|
839
871
|
}, {
|
|
840
872
|
key: "render",
|
|
841
873
|
value: function render() {
|
|
842
|
-
var _this$
|
|
843
|
-
wrapperClass = _this$
|
|
844
|
-
renderPriceBox = _this$
|
|
845
|
-
props = _objectWithoutProperties(_this$
|
|
874
|
+
var _this$props7 = this.props,
|
|
875
|
+
wrapperClass = _this$props7.wrapperClass,
|
|
876
|
+
renderPriceBox = _this$props7.renderPriceBox,
|
|
877
|
+
props = _objectWithoutProperties(_this$props7, _excluded2);
|
|
846
878
|
|
|
847
879
|
var showPriceOverview = this.state.showPriceOverview;
|
|
848
880
|
var openPriceOverview = this.openPriceOverview,
|
|
@@ -899,7 +931,8 @@ _defineProperty(AmountPrice, "propTypes", {
|
|
|
899
931
|
PriceListComponent: _propTypes["default"].elementType,
|
|
900
932
|
AddToCartComponent: _propTypes["default"].elementType,
|
|
901
933
|
renderPriceBox: _propTypes["default"].func,
|
|
902
|
-
userComment: _propTypes["default"].string
|
|
934
|
+
userComment: _propTypes["default"].string,
|
|
935
|
+
AcceptPrivacyComponent: _propTypes["default"].elementType
|
|
903
936
|
});
|
|
904
937
|
|
|
905
938
|
_defineProperty(AmountPrice, "defaultProps", {
|
|
@@ -915,7 +948,8 @@ _defineProperty(AmountPrice, "defaultProps", {
|
|
|
915
948
|
PriceOverviewComponent: _PriceOverview["default"],
|
|
916
949
|
NotificationComponent: _Notification["default"],
|
|
917
950
|
PriceListComponent: _PriceList["default"],
|
|
918
|
-
AddToCartComponent: _AddToBasket["default"]
|
|
951
|
+
AddToCartComponent: _AddToBasket["default"],
|
|
952
|
+
AcceptPrivacyComponent: _AcceptPrivacy["default"]
|
|
919
953
|
});
|
|
920
954
|
|
|
921
955
|
var _default = (0, _withWidth["default"])()((0, _styles.withStyles)(styles, {
|
|
@@ -97,7 +97,8 @@ var PriceOverview = /*#__PURE__*/function (_React$Component) {
|
|
|
97
97
|
receiveOfferFormComponent = _this$props.receiveOfferFormComponent,
|
|
98
98
|
showReceiveOfferForm = _this$props.showReceiveOfferForm,
|
|
99
99
|
amount = _this$props.amount,
|
|
100
|
-
acceptDesignComponent = _this$props.acceptDesignComponent
|
|
100
|
+
acceptDesignComponent = _this$props.acceptDesignComponent,
|
|
101
|
+
acceptDataPrivacyComponent = _this$props.acceptDataPrivacyComponent;
|
|
101
102
|
return /*#__PURE__*/_react["default"].createElement(_Grid["default"], {
|
|
102
103
|
item: true,
|
|
103
104
|
xs: 12,
|
|
@@ -124,7 +125,7 @@ var PriceOverview = /*#__PURE__*/function (_React$Component) {
|
|
|
124
125
|
}, /*#__PURE__*/_react["default"].createElement("b", null, contactData)), receiveOfferFormComponent), /*#__PURE__*/_react["default"].createElement(_Grid["default"], {
|
|
125
126
|
item: true,
|
|
126
127
|
xs: 12
|
|
127
|
-
}, acceptDesignComponent, amount > 0 && /*#__PURE__*/_react["default"].createElement(_Divider["default"], null), priceListComponent), /*#__PURE__*/_react["default"].createElement(_Grid["default"], {
|
|
128
|
+
}, acceptDesignComponent, acceptDataPrivacyComponent, amount > 0 && /*#__PURE__*/_react["default"].createElement(_Divider["default"], null), priceListComponent), /*#__PURE__*/_react["default"].createElement(_Grid["default"], {
|
|
128
129
|
item: true,
|
|
129
130
|
xs: 12
|
|
130
131
|
}, addToCartComponent && /*#__PURE__*/_react["default"].createElement(_Divider["default"], null), addToCartComponent)), !showReceiveOfferForm && /*#__PURE__*/_react["default"].createElement(_Grid["default"], {
|
|
@@ -167,7 +168,8 @@ _defineProperty(PriceOverview, "propTypes", {
|
|
|
167
168
|
receiveOfferFormComponent: _propTypes["default"].element,
|
|
168
169
|
showReceiveOfferForm: _propTypes["default"].bool,
|
|
169
170
|
amount: _propTypes["default"].number,
|
|
170
|
-
acceptDesignComponent: _propTypes["default"].element
|
|
171
|
+
acceptDesignComponent: _propTypes["default"].element,
|
|
172
|
+
acceptDataPrivacyComponent: _propTypes["default"].element
|
|
171
173
|
});
|
|
172
174
|
|
|
173
175
|
var _default = (0, _styles.withStyles)(styles, {
|