@configuratorware/configurator-frontendgui 1.40.4 → 1.40.5
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/Containers/ImageEditDialog.js +10 -28
- package/App/Reducers/DesignArea/Selectors.js +11 -44
- package/App/Reducers/DesignData/Modifiers.js +1 -3
- package/App/Reducers/ImageGallery/Actions.js +18 -25
- package/App/Reducers/ImageGallery/Reducer.js +0 -5
- package/App/Reducers/ImageGallery/Selectors.js +1 -1
- package/App/Screens/DesignerProductPreview/DesignerProductPreviewManager.js +9 -10
- package/App/Services/DesignDataService.js +435 -494
- package/App/configuration.js +1 -1
- package/package.json +4 -4
- package/src/App/Modules/Designer/Containers/ImageEditDialog.js +6 -33
- package/src/App/Reducers/DesignArea/Selectors.js +9 -39
- package/src/App/Reducers/DesignArea/__tests__/Selectors.test.js +0 -19
- package/src/App/Reducers/DesignData/Modifiers.js +0 -3
- package/src/App/Reducers/ImageGallery/Actions.js +5 -20
- package/src/App/Reducers/ImageGallery/Reducer.js +0 -5
- package/src/App/Reducers/ImageGallery/Selectors.js +3 -4
- package/src/App/Reducers/ImageGallery/__tests__/Actions.test.js +7 -81
- package/src/App/Screens/DesignerProductPreview/DesignerProductPreviewManager.js +1 -4
- package/src/App/Services/DesignDataService.js +16 -56
- package/src/App/configuration.js +1 -1
|
@@ -86,8 +86,6 @@ import {
|
|
|
86
86
|
getVectorizeForDesignProductionMethods,
|
|
87
87
|
getImagesByDesignArea,
|
|
88
88
|
designProductionMethodHasEmbroideryVisualizationEffect,
|
|
89
|
-
getMandatoryVectorizationForDesignProductionMethods,
|
|
90
|
-
isVectorizedLogoMandatory,
|
|
91
89
|
} from '../Reducers/DesignArea/Selectors';
|
|
92
90
|
import {
|
|
93
91
|
getUserImage,
|
|
@@ -1077,33 +1075,6 @@ export default class DesignDataService {
|
|
|
1077
1075
|
}
|
|
1078
1076
|
};
|
|
1079
1077
|
|
|
1080
|
-
handleDesignProductionMethodChangeToMandatoryVectorization = async designProductionMethodIdentifier => {
|
|
1081
|
-
const state = Services.store.state;
|
|
1082
|
-
|
|
1083
|
-
const {
|
|
1084
|
-
currentVectorsMandatory,
|
|
1085
|
-
newVectorsMandatory,
|
|
1086
|
-
} = getMandatoryVectorizationForDesignProductionMethods(state, designProductionMethodIdentifier);
|
|
1087
|
-
|
|
1088
|
-
const designArea = getSelectedDesignArea(state);
|
|
1089
|
-
const nonColorizedImages = getImagesByDesignArea(state, designArea.identifier).filter(
|
|
1090
|
-
obj => !get(obj, 'imageData.gallery') && !get(obj, 'imageData.displayColorPreview')
|
|
1091
|
-
);
|
|
1092
|
-
|
|
1093
|
-
if (
|
|
1094
|
-
nonColorizedImages.length === 1 &&
|
|
1095
|
-
((!currentVectorsMandatory && newVectorsMandatory) ||
|
|
1096
|
-
!isColorPreviewCompatible(
|
|
1097
|
-
state,
|
|
1098
|
-
nonColorizedImages[0].imageData,
|
|
1099
|
-
designProductionMethodIdentifier
|
|
1100
|
-
))
|
|
1101
|
-
) {
|
|
1102
|
-
await Services.store.dispatch(showSwitchToProductionMethodWithVectorization());
|
|
1103
|
-
return true;
|
|
1104
|
-
}
|
|
1105
|
-
};
|
|
1106
|
-
|
|
1107
1078
|
checkColorUsageForDesignProductionMethod = async designProductionMethodIdentifier => {
|
|
1108
1079
|
const state = Services.store.state;
|
|
1109
1080
|
const { maxColorAmount, designProductionMethod } = getSelectedDesignAreaProperties(state);
|
|
@@ -1115,9 +1086,9 @@ export default class DesignDataService {
|
|
|
1115
1086
|
const currentVectorsRequired = !!get(designProductionMethod, 'options.vectorsRequired');
|
|
1116
1087
|
const newVectorsRequired = !!get(newProductionMethod, 'options.vectorsRequired');
|
|
1117
1088
|
const designArea = getSelectedDesignArea(state);
|
|
1118
|
-
const colorPreviewRequired =
|
|
1119
|
-
|
|
1120
|
-
|
|
1089
|
+
const colorPreviewRequired = designProductionMethodHasEmbroideryVisualizationEffect(
|
|
1090
|
+
newProductionMethod
|
|
1091
|
+
);
|
|
1121
1092
|
|
|
1122
1093
|
if (
|
|
1123
1094
|
(newMaxColorAmount !== 0 && newMaxColorAmount < maxColorAmount) ||
|
|
@@ -1145,8 +1116,6 @@ export default class DesignDataService {
|
|
|
1145
1116
|
images.forEach(object => {
|
|
1146
1117
|
object.remove();
|
|
1147
1118
|
});
|
|
1148
|
-
|
|
1149
|
-
await this.updateCanvasData(canvas);
|
|
1150
1119
|
}
|
|
1151
1120
|
}
|
|
1152
1121
|
|
|
@@ -1225,9 +1194,9 @@ export default class DesignDataService {
|
|
|
1225
1194
|
};
|
|
1226
1195
|
|
|
1227
1196
|
async vectorizeSingleImageAndShowEditDialog(identifier) {
|
|
1228
|
-
const showImageEditDialog =
|
|
1229
|
-
|
|
1230
|
-
|
|
1197
|
+
const showImageEditDialog = await this.handleDesignProductionMethodChangeFromNonVectorizationToVectorization(
|
|
1198
|
+
identifier
|
|
1199
|
+
);
|
|
1231
1200
|
|
|
1232
1201
|
if (showImageEditDialog) {
|
|
1233
1202
|
Services.ui.show('globalLoader');
|
|
@@ -1235,22 +1204,16 @@ export default class DesignDataService {
|
|
|
1235
1204
|
const state = Services.store.state;
|
|
1236
1205
|
const designArea = getSelectedDesignArea(state);
|
|
1237
1206
|
const canvas = this._getCanvas(designArea);
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
const firstNonVectorizedImage = images.find(
|
|
1241
|
-
obj =>
|
|
1242
|
-
!get(obj, 'imageData.gallery') &&
|
|
1243
|
-
(!get(obj, 'imageData.operations.vectorize') ||
|
|
1244
|
-
!get(obj, 'imageData.displayColorPreview'))
|
|
1207
|
+
const firstNonVectorizedImage = getImagesByDesignArea(state, designArea.identifier).find(
|
|
1208
|
+
obj => !get(obj, 'imageData.operations.vectorize')
|
|
1245
1209
|
);
|
|
1210
|
+
const operations = {
|
|
1211
|
+
...firstNonVectorizedImage.imageData.operations,
|
|
1212
|
+
vectorize: true,
|
|
1213
|
+
};
|
|
1214
|
+
const imageData = firstNonVectorizedImage.imageData;
|
|
1246
1215
|
|
|
1247
1216
|
try {
|
|
1248
|
-
const operations = {
|
|
1249
|
-
...firstNonVectorizedImage.imageData.operations,
|
|
1250
|
-
vectorize: true,
|
|
1251
|
-
};
|
|
1252
|
-
const imageData = firstNonVectorizedImage.imageData;
|
|
1253
|
-
|
|
1254
1217
|
//returing if placeHolderImage, from executing edit operations
|
|
1255
1218
|
if (imageData.isPlaceHolderImage) {
|
|
1256
1219
|
return;
|
|
@@ -1892,16 +1855,13 @@ export default class DesignDataService {
|
|
|
1892
1855
|
const compatibilityInfoHash = getDesignAreaImageCompatibilityInfo(designProductionMethod);
|
|
1893
1856
|
const imageIsCompatible = areHashesCompatible(image.compatibilityInfoHash, compatibilityInfoHash);
|
|
1894
1857
|
const operationsMatching = compareOperations(image.operations, operations);
|
|
1895
|
-
const
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
designProductionMethodHasEmbroideryVisualizationEffect(designProductionMethod) ||
|
|
1899
|
-
vectorizedLogoMandatory;
|
|
1858
|
+
const colorPreviewRequired = designProductionMethodHasEmbroideryVisualizationEffect(
|
|
1859
|
+
designProductionMethod
|
|
1860
|
+
);
|
|
1900
1861
|
|
|
1901
1862
|
const imageDataPatch = {
|
|
1902
1863
|
compatibilityInfoHash,
|
|
1903
1864
|
colorPreviewRequired,
|
|
1904
|
-
vectorizedLogoMandatory,
|
|
1905
1865
|
...(displayColorPreview !== undefined && { displayColorPreview }),
|
|
1906
1866
|
};
|
|
1907
1867
|
|