@configuratorware/configurator-admingui 1.40.6 → 1.41.1
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/Components/FormFragments/Checkbox.js +6 -2
- package/Screens/Channel/Containers/Edit.js +8 -0
- package/Screens/Channel/Reducers/Reducer.js +3 -0
- package/Screens/Channel/Translations.js +2 -1
- package/Screens/Client/Components/ColorTextField.js +35 -7
- package/Screens/Client/Components/PdfMarkdownField.js +0 -2
- package/Screens/Client/Translations.js +2 -0
- package/Screens/Creator/Components/OptionclassificationEditor.js +89 -12
- package/Screens/Creator/Containers/Edit.js +9 -5
- package/Screens/Creator/Reducers/ConfigurationActions.js +82 -3
- package/Screens/Creator/Reducers/ConfigurationReducer.js +53 -1
- package/Screens/Creator/Translations.js +6 -2
- package/Screens/CurrentClient/Containers/Edit.js +3 -1
- package/Screens/DefaultClient/Containers/Edit.js +3 -1
- package/Screens/DesignProductionMethods/Containers/Edit.js +5 -1
- package/Screens/DesignProductionMethods/Reducers/DesignProductionMethodsReducer.js +3 -0
- package/Screens/DesignProductionMethods/Translations.js +4 -2
- package/Screens/Designer/Components/TemplateDefaultList.js +23 -16
- package/Screens/Designer/Components/TemplateList.js +2 -1
- package/Screens/Item/Components/Styles.scss +11 -10
- package/package.json +2 -2
- package/src/Components/Form.js +1 -1
- package/src/Components/FormFragments/Checkbox.js +16 -12
- package/src/Components/FormFragments/index.js +1 -1
- package/src/Screens/Channel/Containers/Edit.js +11 -0
- package/src/Screens/Channel/Reducers/Reducer.js +1 -0
- package/src/Screens/Channel/Translations.js +1 -0
- package/src/Screens/Client/Components/ColorTextField.js +72 -47
- package/src/Screens/Client/Components/PdfMarkdownField.js +1 -2
- package/src/Screens/Client/Translations.js +4 -0
- package/src/Screens/Creator/Components/OptionclassificationEditor.js +93 -17
- package/src/Screens/Creator/Containers/Edit.js +7 -3
- package/src/Screens/Creator/Reducers/ConfigurationActions.js +40 -0
- package/src/Screens/Creator/Reducers/ConfigurationReducer.js +57 -0
- package/src/Screens/Creator/Translations.js +4 -0
- package/src/Screens/CurrentClient/Containers/Edit.js +2 -1
- package/src/Screens/DefaultClient/Containers/Edit.js +2 -1
- package/src/Screens/DesignProductionMethods/Containers/Edit.js +17 -8
- package/src/Screens/DesignProductionMethods/Reducers/DesignProductionMethodsReducer.js +1 -0
- package/src/Screens/DesignProductionMethods/Translations.js +4 -2
- package/src/Screens/Designer/Components/TemplateDefaultList.js +21 -15
- package/src/Screens/Designer/Components/TemplateList.js +1 -0
- package/src/Screens/Item/Components/Styles.scss +11 -10
|
@@ -43,6 +43,7 @@ export const CONFIGURATION_HIDE_DESIGNER_PREVIEW_ERROR = 'CONFIGURATION_HIDE_DES
|
|
|
43
43
|
export const CONFIGURATION_HIDE_CREATOR_PREVIEW_ERROR = 'CONFIGURATION_HIDE_CREATOR_PREVIEW_ERROR';
|
|
44
44
|
export const CONFIGURATION_SHOW_CONFIGURATOR_ADMIN_MODE = 'CONFIGURATION_SHOW_CONFIGURATOR_ADMIN_MODE';
|
|
45
45
|
export const CONFIGURATION_SET_OVERWRITE_COMPONENT_ORDER = 'CONFIGURATION_SET_OVERWRITE_COMPONENT_ORDER';
|
|
46
|
+
export const CONFIGURATION_SET_OVERRIDE_OPTION_ORDER = 'CONFIGURATION_SET_OVERRIDE_OPTION_ORDER';
|
|
46
47
|
|
|
47
48
|
export const showOptionSelection = (show = false, component = null) => ({
|
|
48
49
|
type: CONFIGURATION_SHOW_OPTION_SELECTION,
|
|
@@ -212,3 +213,42 @@ export const setOverwriteComponentOrder = value => async (dispatch, getState) =>
|
|
|
212
213
|
});
|
|
213
214
|
}
|
|
214
215
|
};
|
|
216
|
+
|
|
217
|
+
export const setOverrideOptionOrder = value => async (dispatch, getState) => {
|
|
218
|
+
const entityState = getState()[CONFIGURATION_REDUCER_NAME];
|
|
219
|
+
await dispatch({
|
|
220
|
+
type: CONFIGURATION_SET_OVERRIDE_OPTION_ORDER,
|
|
221
|
+
value,
|
|
222
|
+
});
|
|
223
|
+
const item = get(entityState, 'data.item.value');
|
|
224
|
+
if (item) {
|
|
225
|
+
const { stock, ...itemData } = item;
|
|
226
|
+
const data = { ...itemData, overrideOptionOrder: value };
|
|
227
|
+
const url = `items`;
|
|
228
|
+
return dispatch(postData({ url }, data, CONFIGURATION_SAVE_ITEM)).then(apiAction => {
|
|
229
|
+
switch (apiAction.type) {
|
|
230
|
+
case RECEIVE_DATA: {
|
|
231
|
+
dispatch(showInfoMessage(t('entity.saveOk')));
|
|
232
|
+
dispatch(saveConfigurationSuccess(apiAction.data));
|
|
233
|
+
return true;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
case NETWORK_ERROR: {
|
|
237
|
+
const state = getState();
|
|
238
|
+
const source = state.dataBySource[apiAction.key];
|
|
239
|
+
if (source.isPosted) {
|
|
240
|
+
// data is saved
|
|
241
|
+
dispatch(showErrorMessage(t('entity.saveError'), apiAction.error));
|
|
242
|
+
} else {
|
|
243
|
+
dispatch(showErrorMessage(t('entity.loadError'), apiAction.error));
|
|
244
|
+
}
|
|
245
|
+
dispatch({
|
|
246
|
+
type: CONFIGURATION_SET_OVERRIDE_OPTION_ORDER,
|
|
247
|
+
value: !value,
|
|
248
|
+
});
|
|
249
|
+
return false;
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
});
|
|
253
|
+
}
|
|
254
|
+
};
|
|
@@ -22,6 +22,7 @@ import {
|
|
|
22
22
|
CONFIGURATION_SHOW_CREATOR_PREVIEW_ERROR,
|
|
23
23
|
CONFIGURATION_HIDE_DESIGNER_PREVIEW_ERROR,
|
|
24
24
|
CONFIGURATION_HIDE_CREATOR_PREVIEW_ERROR,
|
|
25
|
+
CONFIGURATION_SET_OVERRIDE_OPTION_ORDER,
|
|
25
26
|
} from './ConfigurationActions';
|
|
26
27
|
|
|
27
28
|
import { getDefaultEntityState, defaultEntityReducer } from '../../../App/Reducers/Entity/Reducer';
|
|
@@ -80,6 +81,7 @@ const initialState = {
|
|
|
80
81
|
showConfigurator: false,
|
|
81
82
|
showOpenDesignerPreviewError: false,
|
|
82
83
|
showOpenCreatorPreviewError: false,
|
|
84
|
+
showOverrideOptionOrderSaveHint: false,
|
|
83
85
|
};
|
|
84
86
|
|
|
85
87
|
export const baseConfigurationData = createFeatureReducer(
|
|
@@ -129,6 +131,13 @@ export const baseConfigurationData = createFeatureReducer(
|
|
|
129
131
|
adminModeHash,
|
|
130
132
|
};
|
|
131
133
|
}
|
|
134
|
+
|
|
135
|
+
if (action.key === CONFIGURATION_DATA_KEY) {
|
|
136
|
+
return {
|
|
137
|
+
...state,
|
|
138
|
+
showOverrideOptionOrderSaveHint: false
|
|
139
|
+
}
|
|
140
|
+
}
|
|
132
141
|
|
|
133
142
|
return state;
|
|
134
143
|
}
|
|
@@ -318,6 +327,54 @@ export const baseConfigurationData = createFeatureReducer(
|
|
|
318
327
|
};
|
|
319
328
|
}
|
|
320
329
|
|
|
330
|
+
case CONFIGURATION_SET_OVERRIDE_OPTION_ORDER: {
|
|
331
|
+
const overrideOptionOrder = action.value;
|
|
332
|
+
|
|
333
|
+
let nextState = state;
|
|
334
|
+
let showOverrideOptionOrderSaveHint = false;
|
|
335
|
+
if (!overrideOptionOrder) {
|
|
336
|
+
showOverrideOptionOrderSaveHint = true;
|
|
337
|
+
// reset options seuqence number -> global sequence number will be used when loading in FE
|
|
338
|
+
const { data } = state;
|
|
339
|
+
const { selectableComponents } = data;
|
|
340
|
+
|
|
341
|
+
const { value: currentOptionclassifications } = selectableComponents;
|
|
342
|
+
currentOptionclassifications.forEach((optionClassification) => optionClassification.selectableOptions.forEach(
|
|
343
|
+
(option) => option.sequenceNumber = null
|
|
344
|
+
));
|
|
345
|
+
|
|
346
|
+
nextState = {
|
|
347
|
+
...state,
|
|
348
|
+
data: {
|
|
349
|
+
...data,
|
|
350
|
+
selectableComponents: {
|
|
351
|
+
...selectableComponents,
|
|
352
|
+
value: currentOptionclassifications,
|
|
353
|
+
},
|
|
354
|
+
},
|
|
355
|
+
};
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
const { data } = nextState;
|
|
359
|
+
const { item } = data;
|
|
360
|
+
const { value } = item;
|
|
361
|
+
|
|
362
|
+
return {
|
|
363
|
+
...nextState,
|
|
364
|
+
showOverrideOptionOrderSaveHint,
|
|
365
|
+
data: {
|
|
366
|
+
...data,
|
|
367
|
+
item: {
|
|
368
|
+
...item,
|
|
369
|
+
value: {
|
|
370
|
+
...value,
|
|
371
|
+
overrideOptionOrder,
|
|
372
|
+
},
|
|
373
|
+
},
|
|
374
|
+
},
|
|
375
|
+
};
|
|
376
|
+
}
|
|
377
|
+
|
|
321
378
|
default:
|
|
322
379
|
state = defaultEntityReducer(state, action, initialState);
|
|
323
380
|
|
|
@@ -64,6 +64,8 @@ require('../../App/i18n').use(
|
|
|
64
64
|
description: 'Option "%{option}" in Component "%{component}" by Product "%{product}"',
|
|
65
65
|
addButtonLabel: 'Add price',
|
|
66
66
|
},
|
|
67
|
+
overrideOptionOrder: 'Edit option order for item</br>(when deactivated, the global option order is used)',
|
|
68
|
+
overrideOptionOrderHint: '</br></br>In order to see the options globally, you have to save your current changes.'
|
|
67
69
|
},
|
|
68
70
|
openPreviewError: {
|
|
69
71
|
title: 'Missing data',
|
|
@@ -136,6 +138,8 @@ require('../../App/i18n').use(
|
|
|
136
138
|
description: 'Option "%{option}" in Komponente "%{component}" an Produkt "%{product}"',
|
|
137
139
|
addButtonLabel: 'Preis hinzufügen',
|
|
138
140
|
},
|
|
141
|
+
overrideOptionOrder: 'Optionsreihenfolge auf Produktebene pflegen </br>(Wenn deaktiviert, greift die globale Optionsreihenfolge)',
|
|
142
|
+
overrideOptionOrderHint: '</br></br>Um die globale Sortierung der Optionen anzuwenden, speichere bitte deine aktuellen Änderungen.'
|
|
139
143
|
},
|
|
140
144
|
openPreviewError: {
|
|
141
145
|
title: 'Fehlende Daten',
|
|
@@ -5,6 +5,7 @@ import { withLoadAction } from '../../../Components/withLoadAction';
|
|
|
5
5
|
import { T, t } from '../../../App/i18n';
|
|
6
6
|
import { CallToActionField } from '../../../Components/CallToActionField';
|
|
7
7
|
import PdfMarkDownField from '../../Client/Components/PdfMarkdownField';
|
|
8
|
+
import ColorTextField from '../../Client/Components/ColorTextField';
|
|
8
9
|
|
|
9
10
|
const formFields = [
|
|
10
11
|
{
|
|
@@ -14,7 +15,7 @@ const formFields = [
|
|
|
14
15
|
{
|
|
15
16
|
name: 'highlightColor',
|
|
16
17
|
label: 'Theme - Highlight color',
|
|
17
|
-
type:
|
|
18
|
+
type: ColorTextField,
|
|
18
19
|
},
|
|
19
20
|
{
|
|
20
21
|
name: 'font',
|
|
@@ -4,6 +4,7 @@ import { withLoadAction } from '../../../Components/withLoadAction';
|
|
|
4
4
|
import SimpleNestedData from '../../../Components/FormFragments/SimpleNestedData';
|
|
5
5
|
import { t, T } from '../../../App/i18n';
|
|
6
6
|
import PdfMarkDownField from '../../Client/Components/PdfMarkdownField';
|
|
7
|
+
import ColorTextField from '../../Client/Components/ColorTextField';
|
|
7
8
|
|
|
8
9
|
const formFields = [
|
|
9
10
|
{
|
|
@@ -13,7 +14,7 @@ const formFields = [
|
|
|
13
14
|
{
|
|
14
15
|
name: 'highlightColor',
|
|
15
16
|
label: 'Theme - Highlight color',
|
|
16
|
-
type:
|
|
17
|
+
type: ColorTextField,
|
|
17
18
|
},
|
|
18
19
|
{
|
|
19
20
|
name: 'font',
|
|
@@ -5,8 +5,8 @@ import SimpleNestedData from '../../../Components/FormFragments/SimpleNestedData
|
|
|
5
5
|
import Toggle from '../../../Components/FormFragments/Toggle';
|
|
6
6
|
import { T } from '../../../App/i18n';
|
|
7
7
|
import TranslationFinder, { findTranslation } from '../../../Components/TranslationFinder';
|
|
8
|
-
import {LocalizedPriceTextField} from
|
|
9
|
-
import LocalizedPriceValue from
|
|
8
|
+
import { LocalizedPriceTextField } from '../../../Components/LocalizedPriceTextField';
|
|
9
|
+
import LocalizedPriceValue from '../../../Components/LocalizedPriceValue';
|
|
10
10
|
|
|
11
11
|
const formFields = [
|
|
12
12
|
{
|
|
@@ -29,7 +29,12 @@ const formFields = [
|
|
|
29
29
|
fields: [
|
|
30
30
|
{
|
|
31
31
|
name: 'vectorsRequired',
|
|
32
|
-
label: '
|
|
32
|
+
label: 'vectorsRequired',
|
|
33
|
+
type: 'checkbox',
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
name: 'vectorizedLogoMandatory',
|
|
37
|
+
label: 'vectorizedLogoMandatory',
|
|
33
38
|
type: 'checkbox',
|
|
34
39
|
},
|
|
35
40
|
{
|
|
@@ -192,9 +197,13 @@ const formFields = [
|
|
|
192
197
|
className: 'table',
|
|
193
198
|
array: {
|
|
194
199
|
disableAdd: ({ parentSchema, value }) => {
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
200
|
+
const colorAmountDependent =
|
|
201
|
+
parentSchema.colorAmountDependent &&
|
|
202
|
+
parentSchema.colorAmountDependent.value;
|
|
203
|
+
const itemAmountDependent =
|
|
204
|
+
parentSchema.itemAmountDependent &&
|
|
205
|
+
parentSchema.itemAmountDependent.value;
|
|
206
|
+
return !colorAmountDependent && !itemAmountDependent && value.length > 0;
|
|
198
207
|
},
|
|
199
208
|
addButtonLabel: 'designProductionMethod.prices.addButtonLabel',
|
|
200
209
|
columns: null,
|
|
@@ -203,13 +212,13 @@ const formFields = [
|
|
|
203
212
|
name: 'price',
|
|
204
213
|
label: 'Price',
|
|
205
214
|
type: LocalizedPriceTextField,
|
|
206
|
-
renderValue: value => <LocalizedPriceValue data={value}/>,
|
|
215
|
+
renderValue: value => <LocalizedPriceValue data={value} />,
|
|
207
216
|
},
|
|
208
217
|
{
|
|
209
218
|
name: 'priceNet',
|
|
210
219
|
label: 'Price Net',
|
|
211
220
|
type: LocalizedPriceTextField,
|
|
212
|
-
renderValue: value => <LocalizedPriceValue data={value}/>,
|
|
221
|
+
renderValue: value => <LocalizedPriceValue data={value} />,
|
|
213
222
|
},
|
|
214
223
|
{
|
|
215
224
|
name: 'colorAmountFrom',
|
|
@@ -20,7 +20,8 @@ require('../../App/i18n').use(
|
|
|
20
20
|
embroidery: 'embroidery',
|
|
21
21
|
doming: 'doming',
|
|
22
22
|
},
|
|
23
|
-
|
|
23
|
+
vectorsRequired: 'Colorize step is mandatory',
|
|
24
|
+
vectorizedLogoMandatory: 'Force using vectorized logo',
|
|
24
25
|
'Maximum Color Amount': 'Maximum Color Amount',
|
|
25
26
|
'Minimum Font Size': 'Minimum Font Size',
|
|
26
27
|
'Has Engraving Background Colors': 'Has Engraving Background Colors',
|
|
@@ -56,7 +57,8 @@ require('../../App/i18n').use(
|
|
|
56
57
|
embroidery: 'Stick',
|
|
57
58
|
doming: 'Doming',
|
|
58
59
|
},
|
|
59
|
-
|
|
60
|
+
vectorsRequired: 'Umfärben erzwingen',
|
|
61
|
+
vectorizedLogoMandatory: 'Vektorisierte Bilddaten müssen verwendet werden',
|
|
60
62
|
'Maximum Color Amount': 'Maximale Farbanzahl',
|
|
61
63
|
'Minimum Font Size': 'Minimale Schriftgröße',
|
|
62
64
|
'Has Engraving Background Colors': 'Hat Gravur-Hintergrundfarben',
|
|
@@ -174,11 +174,7 @@ export default class TemplateDefaultList extends Component {
|
|
|
174
174
|
};
|
|
175
175
|
|
|
176
176
|
getAvailableItems = () => {
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
const excludedIds = [sourceItemId];
|
|
180
|
-
|
|
181
|
-
return _.get(list, 'data', []).filter(item => excludedIds.indexOf(item.id) === -1);
|
|
177
|
+
return _.get(this.props.list, 'data', []);
|
|
182
178
|
};
|
|
183
179
|
|
|
184
180
|
onMoveItems = () => {
|
|
@@ -186,7 +182,7 @@ export default class TemplateDefaultList extends Component {
|
|
|
186
182
|
const data = this.getAvailableItems();
|
|
187
183
|
|
|
188
184
|
const newItems = _.filter(data, (item, index) => {
|
|
189
|
-
return
|
|
185
|
+
return selectedRows.indexOf(index) !== -1 || selectedRows === 'all';
|
|
190
186
|
});
|
|
191
187
|
|
|
192
188
|
this.setState(
|
|
@@ -217,23 +213,32 @@ export default class TemplateDefaultList extends Component {
|
|
|
217
213
|
}
|
|
218
214
|
);
|
|
219
215
|
};
|
|
220
|
-
|
|
221
|
-
isItemAtIndexMoved=
|
|
216
|
+
|
|
217
|
+
isItemAtIndexMoved = index => {
|
|
222
218
|
const clickedItem = this.props.list.data[index];
|
|
223
219
|
|
|
224
220
|
return _.find(this.state.movedItems, { id: clickedItem.id });
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
}
|
|
221
|
+
};
|
|
222
|
+
|
|
223
|
+
isItemAtIndexSource = index => {
|
|
224
|
+
const clickedItem = this.props.list.data[index];
|
|
230
225
|
|
|
231
|
-
|
|
226
|
+
return clickedItem.id === this.props.sourceItemId;
|
|
227
|
+
};
|
|
228
|
+
|
|
229
|
+
isRowSelectable = index => {
|
|
230
|
+
return !this.isItemAtIndexMoved(index) && !this.isItemAtIndexSource(index);
|
|
231
|
+
};
|
|
232
|
+
|
|
233
|
+
getRowStyle = index => {
|
|
232
234
|
if (this.isItemAtIndexMoved(index)) {
|
|
233
235
|
return { cursor: 'not-allowed', backgroundColor: 'lightgreen' };
|
|
234
236
|
}
|
|
237
|
+
if (this.isItemAtIndexSource(index)) {
|
|
238
|
+
return { cursor: 'not-allowed', opacity: 0.5 };
|
|
239
|
+
}
|
|
235
240
|
return { cursor: 'pointer' };
|
|
236
|
-
}
|
|
241
|
+
};
|
|
237
242
|
|
|
238
243
|
onMovedItemsChange = () => {
|
|
239
244
|
const movedItemIds = this.state.movedItems.map(item => item.id);
|
|
@@ -275,6 +280,7 @@ export default class TemplateDefaultList extends Component {
|
|
|
275
280
|
shownColumns={shownColumns}
|
|
276
281
|
rowsTotal={total}
|
|
277
282
|
rowsPerPage={this.state.listParams.limit}
|
|
283
|
+
listParams={this.state.listParams}
|
|
278
284
|
onRowSelection={this.onRowSelection}
|
|
279
285
|
selected={selected || this.state.selectedRows}
|
|
280
286
|
onAddItem={onAddItem}
|
|
@@ -63,19 +63,20 @@
|
|
|
63
63
|
overflow-y: hidden;
|
|
64
64
|
height: 250px;
|
|
65
65
|
white-space: nowrap;
|
|
66
|
-
|
|
67
|
-
li {
|
|
68
|
-
white-space: normal;
|
|
69
|
-
display: inline-block;
|
|
70
|
-
width: calc(25% - 10px);
|
|
71
|
-
margin-right: 10px;
|
|
72
|
-
height: 100%;
|
|
73
|
-
vertical-align: top;
|
|
74
|
-
padding: 0 10px;
|
|
75
|
-
}
|
|
76
66
|
}
|
|
77
67
|
}
|
|
78
68
|
|
|
69
|
+
.draggable-option-item {
|
|
70
|
+
list-style-type: none;
|
|
71
|
+
white-space: normal;
|
|
72
|
+
display: inline-block;
|
|
73
|
+
width: calc(25% - 10px);
|
|
74
|
+
margin-right: 10px;
|
|
75
|
+
height: 100%;
|
|
76
|
+
vertical-align: top;
|
|
77
|
+
padding: 0 10px;
|
|
78
|
+
}
|
|
79
|
+
|
|
79
80
|
.optionclassificationEditor-item {
|
|
80
81
|
|
|
81
82
|
.headline {
|