@configuratorware/configurator-frontendgui 1.31.1 → 1.31.4
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/Modules/Designer/Components/ImageEditDialog/ImageUpload.js +5 -3
- package/App/Reducers/Configurator/Actions.js +20 -81
- package/App/Reducers/ImageGallery/Reducer.js +7 -4
- package/App/Screens/Configurator/ThemeProvider.js +1 -1
- package/App/Services/DesignerService.js +8 -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 +4 -2
- package/package.json +4 -4
- package/public/translations/de_DE.json +4 -1
- package/public/translations/en_GB.json +10 -5
- package/src/App/Modules/Designer/Components/ImageEditDialog/ImageUpload.js +4 -3
- package/src/App/Reducers/Configurator/Actions.js +6 -37
- package/src/App/Reducers/ImageGallery/Reducer.js +5 -1
- package/src/App/Screens/Configurator/ThemeProvider.js +2 -2
- package/src/App/Services/DesignerService.js +7 -0
- 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 +14 -0
- 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
|
@@ -41,6 +41,8 @@ var _ServiceLocator = require("../../../../ServiceLocator");
|
|
|
41
41
|
|
|
42
42
|
var _withWidth = _interopRequireWildcard(require("@material-ui/core/withWidth/withWidth"));
|
|
43
43
|
|
|
44
|
+
var _configuration = require("../../../../configuration");
|
|
45
|
+
|
|
44
46
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
45
47
|
|
|
46
48
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
@@ -240,7 +242,7 @@ var ImageEditDialog = /*#__PURE__*/function (_React$Component) {
|
|
|
240
242
|
}
|
|
241
243
|
|
|
242
244
|
var extension = file.name.toLowerCase().match(/\.([0-9a-z]+)$/i)[1];
|
|
243
|
-
var allowedFormats =
|
|
245
|
+
var allowedFormats = (0, _configuration.getConf)('designer.allowedImageUploadFormats');
|
|
244
246
|
|
|
245
247
|
if (allowedFormats.indexOf(extension) === -1) {
|
|
246
248
|
error = (0, _i18n.t)('fileUpload.uploadFormatError', {
|
|
@@ -260,8 +262,8 @@ var ImageEditDialog = /*#__PURE__*/function (_React$Component) {
|
|
|
260
262
|
imageData: null
|
|
261
263
|
});
|
|
262
264
|
|
|
263
|
-
var
|
|
264
|
-
var isRenderable =
|
|
265
|
+
var renderableFormats = ['jpg', 'jpeg', 'svg', 'png', 'bmp', 'gif'];
|
|
266
|
+
var isRenderable = renderableFormats.indexOf(extension) !== -1;
|
|
265
267
|
|
|
266
268
|
if (isRenderable && file.type && file.type.match('image.*')) {
|
|
267
269
|
var reader = new FileReader();
|
|
@@ -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));
|
|
@@ -186,7 +186,9 @@ function imageGalleryReducer() {
|
|
|
186
186
|
selectedImage: currentImage
|
|
187
187
|
});
|
|
188
188
|
} else {
|
|
189
|
-
|
|
189
|
+
var idx = _userImages.indexOf(currentImage);
|
|
190
|
+
|
|
191
|
+
_userImages[idx] = _objectSpread(_objectSpread({}, currentImage), selectedImage);
|
|
190
192
|
return _objectSpread(_objectSpread({}, state), {}, {
|
|
191
193
|
userImages: _userImages
|
|
192
194
|
});
|
|
@@ -266,12 +268,13 @@ function imageGalleryReducer() {
|
|
|
266
268
|
|
|
267
269
|
if (action.immediateCommit) {
|
|
268
270
|
result.userImages = _toConsumableArray(_userImages2);
|
|
269
|
-
|
|
271
|
+
|
|
272
|
+
var _idx = (0, _findIndex["default"])(_userImages2, {
|
|
270
273
|
identifier: image.identifier
|
|
271
274
|
});
|
|
272
275
|
|
|
273
|
-
if (
|
|
274
|
-
result.userImages[
|
|
276
|
+
if (_idx !== -1) {
|
|
277
|
+
result.userImages[_idx] = image;
|
|
275
278
|
} else {
|
|
276
279
|
result.userImages.push(image);
|
|
277
280
|
}
|
|
@@ -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);
|
|
@@ -55,10 +55,17 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d
|
|
|
55
55
|
|
|
56
56
|
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; }
|
|
57
57
|
|
|
58
|
+
function getCanvasImageScalingWithImageData(canvasImage, imageData) {
|
|
59
|
+
var currentPreview = canvasImage.imageData.preview;
|
|
60
|
+
var nextPreview = imageData.preview;
|
|
61
|
+
return canvasImage.scaling * (currentPreview.width / nextPreview.width);
|
|
62
|
+
}
|
|
63
|
+
|
|
58
64
|
function updateCanvasImageWithImageData(canvasImage, imageData) {
|
|
59
65
|
return canvasImage.updateOptions((0, _Transformers.prepareImageObjectData)({
|
|
60
66
|
imageData: imageData,
|
|
61
|
-
src: "".concat((0, _configuration.getConf)('network.host')).concat(imageData.preview.url)
|
|
67
|
+
src: "".concat((0, _configuration.getConf)('network.host')).concat(imageData.preview.url),
|
|
68
|
+
scaling: getCanvasImageScalingWithImageData(canvasImage, imageData)
|
|
62
69
|
}));
|
|
63
70
|
}
|
|
64
71
|
|
|
@@ -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;
|