@configuratorware/configurator-admingui 1.26.5 → 1.27.2

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.
Files changed (44) hide show
  1. package/package.json +2 -2
  2. package/src/App/Data.js +9 -0
  3. package/src/App/Reducers/Common/OrderList/Actions.js +11 -3
  4. package/src/App/Reducers/Common/OrderList/Listener.js +2 -2
  5. package/src/App/Reducers/Common/OrderList/Reducer.js +22 -3
  6. package/src/App/Styles.scss +19 -1
  7. package/src/Components/DefaultConnectedScreen.js +3 -2
  8. package/src/Components/DefaultScreen.js +10 -2
  9. package/src/Components/Form.js +4 -0
  10. package/src/Components/FormFragments/HintText.js +14 -0
  11. package/src/Components/FormFragments/InputArray.js +42 -13
  12. package/src/Components/FormFragments/SimpleTable.js +18 -2
  13. package/src/Components/FormFragments/Styles.scss +4 -0
  14. package/src/Components/FormFragments/Text.js +1 -0
  15. package/src/Components/FormFragments/index.js +3 -0
  16. package/src/Components/List.js +1 -0
  17. package/src/Components/OrderList.js +15 -7
  18. package/src/Components/Pagination.js +8 -0
  19. package/src/Components/SplitContainer.js +25 -2
  20. package/src/Components/Styles.scss +2 -0
  21. package/src/Components/Translations.js +6 -0
  22. package/src/Screens/ColorPalettes/Components/DefaultColorSwitch.js +54 -0
  23. package/src/Screens/ColorPalettes/Containers/Edit.js +39 -21
  24. package/src/Screens/ColorPalettes/Translations.js +1 -0
  25. package/src/Screens/Creator/Reducers/ConfigurationActions.js +1 -1
  26. package/src/Screens/DesignProductionMethods/Containers/Edit.js +0 -5
  27. package/src/Screens/DesignProductionMethods/Reducers/DesignProductionMethodsReducer.js +0 -1
  28. package/src/Screens/Designer/SubScreens/DesignAreas/Containers/FormProductionMethods.js +339 -256
  29. package/src/Screens/Designer/SubScreens/DesignAreas/Reducers/Reducer.js +26 -3
  30. package/src/Screens/Designer/SubScreens/DesignAreas/Translations.js +16 -2
  31. package/src/Screens/Designer/__tests__/FormProductionMethods.test.js +0 -2
  32. package/src/Screens/Designer/__tests__/__snapshots__/FormProductionMethods.test.js.snap +167 -50
  33. package/src/Screens/DesignerGlobalItemPrices/Containers/Edit.js +34 -6
  34. package/src/Screens/DesignerGlobalItemPrices/Reducers/Actions.js +1 -1
  35. package/src/Screens/DesignerGlobalItemPrices/Screen.js +3 -1
  36. package/src/Screens/DesignerGlobalItemPrices/Translations.js +8 -0
  37. package/src/Screens/Font/Containers/List.js +14 -3
  38. package/src/Screens/Item/Containers/Styles.scss +3 -0
  39. package/src/Screens/OptionPools/Containers/Edit.js +20 -0
  40. package/src/Screens/OptionPools/Reducers/Reducer.js +3 -2
  41. package/src/Screens/Setting/Containers/Edit.js +6 -0
  42. package/src/Screens/Setting/Reducers/Reducer.js +1 -0
  43. package/src/Screens/Setting/Translations.js +4 -0
  44. package/src/Screens/ColorPalettes/Components/DefaultColorRadio.js +0 -35
@@ -2,6 +2,7 @@ import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import { T, t, getLocale } from '../../../../../App/i18n';
4
4
  import _ from 'lodash';
5
+ import get from 'lodash/get';
5
6
  import withStyles from '@material-ui/core/styles/withStyles';
6
7
  import Grid from '@material-ui/core/Grid/Grid';
7
8
  import Checkbox from '@material-ui/core/Checkbox/Checkbox';
@@ -23,9 +24,12 @@ import TranslationFinder from '../../../../../Components/TranslationFinder';
23
24
  import UISelectField from '../../../../../UIComponents/SelectField';
24
25
  import ColorPalettes from '../Components/ColorPalettes';
25
26
  import { ProductionMethodMaskEditorField } from './ConnectedMaskEditorField';
26
- import MenuItem from "../../../../../UIComponents/MenuItem";
27
- import { Card } from "@material-ui/core";
28
- import { LocalizedPriceTextField } from "../../../../../Components/LocalizedPriceTextField";
27
+ import MenuItem from '../../../../../UIComponents/MenuItem';
28
+ import { Card } from '@material-ui/core';
29
+ import { LocalizedPriceTextField } from '../../../../../Components/LocalizedPriceTextField';
30
+
31
+ const isEngravingEffect = designProductionMethod =>
32
+ 'engraving' === get(designProductionMethod, 'options.visualizationEffect');
29
33
 
30
34
  const styles = () => ({
31
35
  checkboxGrid: {
@@ -35,7 +39,7 @@ const styles = () => ({
35
39
  engravingBackgroundColor: {
36
40
  display: 'flex',
37
41
  alignItems: 'baseline',
38
- padding: 20,
42
+ marginBottom: '1em',
39
43
  },
40
44
  inputAlign: {
41
45
  textAlign: 'center',
@@ -73,7 +77,16 @@ const styles = () => ({
73
77
  card: {
74
78
  padding: '0 1em 0 1em',
75
79
  margin: '1em 0 1em 0',
76
- }
80
+ },
81
+ InputLabel: {
82
+ paddingRight: 8,
83
+ },
84
+ inputWithLabel: {
85
+ display: 'flex',
86
+ flexDirection: 'column',
87
+ padding: '20px 0px',
88
+ alignItems: 'baseline',
89
+ },
77
90
  });
78
91
 
79
92
  class FormProductionMethods extends React.Component {
@@ -84,6 +97,12 @@ class FormProductionMethods extends React.Component {
84
97
  onChange: PropTypes.func,
85
98
  onRemove: PropTypes.func,
86
99
  data: PropTypes.object,
100
+ classes: PropTypes.object,
101
+ channels: PropTypes.array,
102
+ rowNumber: PropTypes.number,
103
+ errors: PropTypes.array,
104
+ setProductionMethodIsDefault: PropTypes.func,
105
+ extendedItem: PropTypes.object,
87
106
  };
88
107
 
89
108
  constructor(props) {
@@ -92,6 +111,8 @@ class FormProductionMethods extends React.Component {
92
111
  checked: false,
93
112
  expanded: null,
94
113
  openedVariantsDefaultColor: null,
114
+ maxImageError: false,
115
+ maxTextError: false,
95
116
  };
96
117
  }
97
118
 
@@ -100,7 +121,7 @@ class FormProductionMethods extends React.Component {
100
121
  let { value } = e.target;
101
122
  const nextData = {};
102
123
 
103
- if (key === 'allowBulkNames' || key === 'isDefault') {
124
+ if (key === 'allowBulkNames' || key === 'isDefault' || key === 'designElementsLocked') {
104
125
  value = e.target.checked;
105
126
  }
106
127
 
@@ -147,6 +168,38 @@ class FormProductionMethods extends React.Component {
147
168
  Object.assign(nextData, data, { [key]: value });
148
169
  }
149
170
 
171
+ if (key === 'maxTexts') {
172
+ if (value === '0' && data.maxImages !== null && Number(data.maxImages) === 0) {
173
+ this.setState({ maxTextError: true });
174
+ Object.assign(nextData, data, { [key]: '' });
175
+ }
176
+ if (value === '') {
177
+ Object.assign(nextData, data, { [key]: null });
178
+ }
179
+ if (this.state.maxTextError && (Number(value) > 0 || Number(data.maxImages) > 0)) {
180
+ this.setState({ maxTextError: false });
181
+ }
182
+ }
183
+
184
+ if (key === 'maxImages') {
185
+ if (value === '0' && data.maxTexts !== null && Number(data.maxTexts) === 0) {
186
+ this.setState({ maxImageError: true });
187
+ Object.assign(nextData, data, { [key]: '' });
188
+ }
189
+ if (value === '') {
190
+ Object.assign(nextData, data, { [key]: null });
191
+ }
192
+ if (this.state.maxImageError && (Number(value) > 0 || Number(data.maxTexts) > 0)) {
193
+ this.setState({ maxImageError: false });
194
+ }
195
+ }
196
+
197
+ if (key === 'maxElements') {
198
+ if (value === '') {
199
+ Object.assign(nextData, data, { [key]: null });
200
+ }
201
+ }
202
+
150
203
  if (key === 'isDefault') {
151
204
  this.props.setProductionMethodIsDefault(nextData.id, value);
152
205
  return;
@@ -278,7 +331,7 @@ class FormProductionMethods extends React.Component {
278
331
  const item = _.find(currentValues, { itemIdentifier: identifier });
279
332
  result.push({
280
333
  itemIdentifier: identifier,
281
- colorHex: item ? item.colorHex : '',
334
+ colorHex: item ? item.colorHex : 'rgba(0, 0, 0, 0.5)',
282
335
  });
283
336
  }
284
337
  return result;
@@ -466,6 +519,185 @@ class FormProductionMethods extends React.Component {
466
519
  ));
467
520
  }
468
521
 
522
+ renderCalculationTypes(productionMethod, channels) {
523
+ const { classes } = this.props;
524
+ const calculationTypes = (productionMethod && productionMethod.calculationTypes) || [];
525
+ return (
526
+ <Grid container>
527
+ <Grid item xs={12}>
528
+ {calculationTypes.length > 0 && (
529
+ <FormLabel classes={{ root: classes.FormLabel }} component="legend">
530
+ {t('CalculationTypes')}
531
+ </FormLabel>
532
+ )}
533
+ {calculationTypes
534
+ .filter(calculationType => calculationType.itemAmountDependent)
535
+ .map((calculationType, calculationIndex) => (
536
+ <ExpansionPanel
537
+ expanded={
538
+ this.state.expanded === calculationType.identifier ||
539
+ this.isCalculationError(calculationIndex)
540
+ }
541
+ onChange={this.onCollapseClick(calculationType.identifier)}
542
+ key={calculationType.identifier}
543
+ >
544
+ <ExpansionPanelSummary expandIcon={<ExpandMoreIcon />}>
545
+ <Typography>
546
+ {productionMethod.id === null || !calculationType.title ? (
547
+ <TranslationFinder
548
+ data={calculationType.texts}
549
+ property="title"
550
+ fallback={calculationType.identifier}
551
+ />
552
+ ) : (
553
+ calculationType.title
554
+ )}
555
+ </Typography>
556
+ </ExpansionPanelSummary>
557
+ <ExpansionPanelDetails classes={{ root: classes.ExpansionPanelDetailRoot }}>
558
+ {(channels || []).map(channel => (
559
+ <React.Fragment key={channel.identifier}>
560
+ <Typography className={classes.TypographyFontWeight}>
561
+ {channel.identifier +
562
+ '/' +
563
+ channel.currency.symbol +
564
+ '(' +
565
+ channel.currency.iso +
566
+ ')'}
567
+ </Typography>
568
+ {(calculationType.prices || [])
569
+ .filter(price => parseInt(price.channel) === channel.id)
570
+ .map((price, priceIndex) => (
571
+ <React.Fragment key={priceIndex}>
572
+ <Grid container>
573
+ <Grid item xs={3}>
574
+ <TextField
575
+ label={t('colorAmountFrom')}
576
+ onChange={e => {
577
+ this.onChangeCalculationTypesPrices(
578
+ calculationType.identifier,
579
+ 'colorAmountFrom',
580
+ priceIndex,
581
+ e.target.value
582
+ );
583
+ }}
584
+ value={price.colorAmountFrom || ''}
585
+ type="number"
586
+ InputProps={{
587
+ classes: {
588
+ inputType: classes.inputText,
589
+ },
590
+ }}
591
+ />
592
+ </Grid>
593
+ <Grid item xs={3}>
594
+ <LocalizedPriceTextField
595
+ label={t('Price')}
596
+ onChange={(name, value) => {
597
+ this.onChangeCalculationTypesPrices(
598
+ calculationType.identifier,
599
+ 'price',
600
+ priceIndex,
601
+ value
602
+ );
603
+ }}
604
+ value={price.price}
605
+ inputProps={{
606
+ style: {
607
+ height: '2em',
608
+ },
609
+ }}
610
+ />
611
+ </Grid>
612
+ <Grid item xs={3}>
613
+ <LocalizedPriceTextField
614
+ label={t('PriceNet')}
615
+ onChange={(name, value) => {
616
+ this.onChangeCalculationTypesPrices(
617
+ calculationType.identifier,
618
+ 'priceNet',
619
+ priceIndex,
620
+ value
621
+ );
622
+ }}
623
+ value={price.priceNet}
624
+ inputProps={{
625
+ style: {
626
+ height: '2em',
627
+ },
628
+ }}
629
+ />
630
+ </Grid>
631
+ <Grid
632
+ item
633
+ xs={3}
634
+ className={classes.gridFormatting}
635
+ >
636
+ <TextField
637
+ label={t('AmountFrom')}
638
+ onChange={e => {
639
+ this.onChangeCalculationTypesPrices(
640
+ calculationType.identifier,
641
+ 'amountFrom',
642
+ priceIndex,
643
+ e.target.value
644
+ );
645
+ }}
646
+ value={price.amountFrom || ''}
647
+ type="number"
648
+ InputProps={{
649
+ classes: {
650
+ inputType: classes.inputText,
651
+ },
652
+ }}
653
+ />
654
+ <IconButton
655
+ label={t('Remove')}
656
+ onClick={() =>
657
+ this.onRemovePrices(
658
+ price,
659
+ calculationType.identifier
660
+ )
661
+ }
662
+ id="remove"
663
+ >
664
+ <DeleteIcon />
665
+ </IconButton>
666
+ </Grid>
667
+ </Grid>
668
+ <div>
669
+ {this.getPriceError(calculationIndex, priceIndex)}
670
+ </div>
671
+ </React.Fragment>
672
+ ))}
673
+ <Grid container>
674
+ <Grid item xs={12}>
675
+ <div className="action-buttons">
676
+ <RaisedButton
677
+ primary={true}
678
+ onClick={() =>
679
+ this.onAddNewPrices(
680
+ calculationType.identifier,
681
+ channel.id
682
+ )
683
+ }
684
+ >
685
+ <Add />
686
+ {T('Add')}
687
+ </RaisedButton>
688
+ </div>
689
+ </Grid>
690
+ </Grid>
691
+ </React.Fragment>
692
+ ))}
693
+ </ExpansionPanelDetails>
694
+ </ExpansionPanel>
695
+ ))}
696
+ </Grid>
697
+ </Grid>
698
+ );
699
+ }
700
+
469
701
  render() {
470
702
  const {
471
703
  onRemove,
@@ -497,19 +729,26 @@ class FormProductionMethods extends React.Component {
497
729
  <Grid container>
498
730
  <Grid item xs={12}>
499
731
  <UISelectField
500
- style={{width: '100%'}}
732
+ style={{ width: '100%' }}
501
733
  onChange={this.onProductionMethodChange}
502
734
  value={productionMethod.id}
503
735
  >
504
- {editDesignProductionMethods.map((productionMethod) => (
505
- <MenuItem value={productionMethod.id} key={productionMethod.id}>{this.getProductionMethodLabel(productionMethod)}</MenuItem>
736
+ {editDesignProductionMethods.map(productionMethod => (
737
+ <MenuItem value={productionMethod.id} key={productionMethod.id}>
738
+ {this.getProductionMethodLabel(productionMethod)}
739
+ </MenuItem>
506
740
  ))}
507
741
  </UISelectField>
508
742
  <Grid item xs={12}>
509
- {_.get(productionMethod, 'options.hasEngravingBackgroundColors') &&
743
+ {isEngravingEffect(productionMethod) &&
510
744
  engravingBackgroundColors.map(item => (
511
- <div key={item.itemIdentifier} className={classes.engravingBackgroundColor}>
512
- <FormLabel component="legend"> {item.itemIdentifier}: </FormLabel>
745
+ <div
746
+ key={item.itemIdentifier}
747
+ className={classes.engravingBackgroundColor}
748
+ >
749
+ <FormLabel classes={{ root: classes.InputLabel }} component="legend">
750
+ {item.itemIdentifier}:
751
+ </FormLabel>
513
752
  <TextField
514
753
  key={item.itemIdentifier}
515
754
  placeholder={t('EngravingBackgroundColor')}
@@ -635,255 +874,99 @@ class FormProductionMethods extends React.Component {
635
874
  </Grid>
636
875
  ))}
637
876
 
638
- {this.renderMaskEditorField()}
877
+ {this.renderMaskEditorField()}
639
878
 
640
- <Grid item xs={12} className={classes.checkboxGrid}>
879
+ <Grid item xs={12} className={classes.checkboxGrid}>
880
+ <FormControlLabel
881
+ control={
882
+ <Checkbox
883
+ checked={productionMethod.designElementsLocked}
884
+ onChange={this.onChange('designElementsLocked')}
885
+ value={t('designElementsLocked')}
886
+ color="primary"
887
+ />
888
+ }
889
+ label={t('designElementsLocked')}
890
+ />
891
+ </Grid>
892
+ <Grid item xs={12} className={classes.checkboxGrid}>
893
+ <TextField
894
+ label={t('minimumOrderAmount')}
895
+ onChange={this.onChange('minimumOrderAmount')}
896
+ value={productionMethod.minimumOrderAmount || ''}
897
+ style={styles.input}
898
+ type="number"
899
+ {...this.getErrorProps('minimumOrderAmount')}
900
+ />
901
+ </Grid>
902
+ <Grid item xs={12} className={classes.checkboxGrid}>
903
+ <div className={classes.inputWithLabel}>
904
+ <FormLabel component="legend"> {t('maxTextElements')} </FormLabel>
641
905
  <TextField
642
- label={t('minimumOrderAmount')}
643
- onChange={this.onChange('minimumOrderAmount')}
644
- value={productionMethod.minimumOrderAmount || ''}
645
- style={styles.input}
906
+ onChange={this.onChange('maxTexts')}
907
+ value={productionMethod.maxTexts}
646
908
  type="number"
647
- {...this.getErrorProps('minimumOrderAmount')}
909
+ error={this.state.maxTextError}
910
+ helperText={this.state.maxTextError ? T('minElementsError') : ''}
911
+ {...this.getErrorProps('maxTexts')}
648
912
  />
649
- </Grid>
913
+ </div>
914
+ </Grid>
915
+ <Grid item xs={12} className={classes.checkboxGrid}>
916
+ <div className={classes.inputWithLabel}>
917
+ <FormLabel component="legend"> {t('maxImageElements')} </FormLabel>
918
+ <TextField
919
+ onChange={this.onChange('maxImages')}
920
+ value={productionMethod.maxImages}
921
+ type="number"
922
+ error={this.state.maxImageError}
923
+ helperText={this.state.maxImageError ? T('minElementsError') : ''}
924
+ {...this.getErrorProps('maxImages')}
925
+ />
926
+ </div>
927
+ </Grid>
928
+ <Grid item xs={12} className={classes.checkboxGrid}>
929
+ <div className={classes.inputWithLabel}>
930
+ <FormLabel component="legend"> {t('maxTotalElements')} </FormLabel>
931
+ <TextField
932
+ onChange={this.onChange('maxElements')}
933
+ value={productionMethod.maxElements || ''}
934
+ type="number"
935
+ {...this.getErrorProps('maxElements')}
936
+ />
937
+ </div>
938
+ </Grid>
650
939
 
651
- <Grid container>
652
- <Grid item xs={12}>
653
- {productionMethod &&
654
- productionMethod.calculationTypes &&
655
- productionMethod.calculationTypes.length > 0 && (
656
- <FormLabel classes={{ root: classes.FormLabel }} component="legend">
657
- {t('CalculationTypes')}
658
- </FormLabel>
659
- )}
660
- {productionMethod &&
661
- productionMethod.calculationTypes &&
662
- productionMethod.calculationTypes.map(
663
- (calculationType, calculationIndex) =>
664
- calculationType.itemAmountDependent && (
665
- <ExpansionPanel
666
- expanded={
667
- this.state.expanded === calculationType.identifier ||
668
- this.isCalculationError(calculationIndex)
669
- }
670
- onChange={this.onCollapseClick(calculationType.identifier)}
671
- key={calculationType.identifier}
672
- >
673
- <ExpansionPanelSummary expandIcon={<ExpandMoreIcon />}>
674
- <Typography>
675
- {productionMethod.id === null ||
676
- !calculationType.title ? (
677
- <TranslationFinder
678
- data={calculationType.texts}
679
- property="title"
680
- fallback={calculationType.identifier}
681
- />
682
- ) : (
683
- calculationType.title
684
- )}
685
- </Typography>
686
- </ExpansionPanelSummary>
687
- <ExpansionPanelDetails
688
- classes={{ root: classes.ExpansionPanelDetailRoot }}
689
- >
690
- {channels &&
691
- channels.map(channel => (
692
- <React.Fragment key={channel.identifier}>
693
- <Typography
694
- className={classes.TypographyFontWeight}
695
- >
696
- {channel.identifier +
697
- '/' +
698
- channel.currency.symbol +
699
- '(' +
700
- channel.currency.iso +
701
- ')'}
702
- </Typography>
703
- {calculationType.prices &&
704
- calculationType.prices.map(
705
- (price, priceIndex) =>
706
- parseInt(price.channel) ===
707
- channel.id && (
708
- <React.Fragment key={priceIndex}>
709
- <Grid container>
710
- <Grid item xs={3}>
711
- <TextField
712
- label={t(
713
- 'colorAmountFrom'
714
- )}
715
- onChange={(e) => {
716
- this.onChangeCalculationTypesPrices(
717
- calculationType.identifier,
718
- 'colorAmountFrom',
719
- priceIndex,
720
- e.target.value
721
- )}}
722
- value={
723
- price.colorAmountFrom ||
724
- ''
725
- }
726
- type="number"
727
- InputProps={{
728
- classes: {
729
- inputType:
730
- classes.inputText,
731
- },
732
- }}
733
- />
734
- </Grid>
735
- <Grid item xs={3}>
736
- <LocalizedPriceTextField
737
- label={t('Price')}
738
- onChange={(name, value) => {
739
- this.onChangeCalculationTypesPrices(
740
- calculationType.identifier,
741
- 'price',
742
- priceIndex,
743
- value
744
- )
745
- }}
746
- value={
747
- price.price
748
- }
749
- inputProps={{
750
- style: {
751
- height: '2em',
752
- }
753
- }}
754
- />
755
- </Grid>
756
- <Grid item xs={3}>
757
- <LocalizedPriceTextField
758
- label={t(
759
- 'PriceNet'
760
- )}
761
- onChange={(name, value) => {
762
- this.onChangeCalculationTypesPrices(
763
- calculationType.identifier,
764
- 'priceNet',
765
- priceIndex,
766
- value
767
- )
768
- }}
769
- value={
770
- price.priceNet
771
- }
772
- inputProps={{
773
- style: {
774
- height: '2em',
775
- }
776
- }}
777
- />
778
- </Grid>
779
- <Grid
780
- item
781
- xs={3}
782
- className={
783
- classes.gridFormatting
784
- }
785
- >
786
- <TextField
787
- label={t(
788
- 'AmountFrom'
789
- )}
790
- onChange={(e) => {
791
- this.onChangeCalculationTypesPrices(
792
- calculationType.identifier,
793
- 'amountFrom',
794
- priceIndex,
795
- e.target.value
796
- );
797
- }}
798
- value={
799
- price.amountFrom ||
800
- ''
801
- }
802
- type="number"
803
- InputProps={{
804
- classes: {
805
- inputType:
806
- classes.inputText,
807
- },
808
- }}
809
- />
810
- <IconButton
811
- label={t(
812
- 'Remove'
813
- )}
814
- onClick={() =>
815
- this.onRemovePrices(
816
- price,
817
- calculationType.identifier
818
- )
819
- }
820
- id="remove"
821
- >
822
- <DeleteIcon />
823
- </IconButton>
824
- </Grid>
825
- </Grid>
826
- <div>
827
- {this.getPriceError(
828
- calculationIndex,
829
- priceIndex
830
- )}
831
- </div>
832
- </React.Fragment>
833
- )
834
- )}
835
- <Grid container>
836
- <Grid item xs={12}>
837
- <div className="action-buttons">
838
- <RaisedButton
839
- primary={true}
840
- onClick={() =>
841
- this.onAddNewPrices(
842
- calculationType.identifier,
843
- channel.id
844
- )
845
- }
846
- >
847
- <Add />
848
- {T('Add')}
849
- </RaisedButton>
850
- </div>
851
- </Grid>
852
- </Grid>
853
- </React.Fragment>
854
- ))}
855
- </ExpansionPanelDetails>
856
- </ExpansionPanel>
857
- )
858
- )}
859
- </Grid>
860
- </Grid>
861
- <Grid container justify="flex-end">
862
- <Grid item xs={12}>
863
- <IconButton
864
- label={t('Remove')}
865
- onClick={() => onRemove(productionMethod)}
866
- id="remove"
867
- >
868
- <DeleteIcon />
869
- </IconButton>
870
- </Grid>
871
- </Grid>
872
- {openedVariantsDefaultColor !== null && (
873
- <Dialog
874
- open={true}
875
- maxWidth="xs"
876
- fullWidth={true}
877
- onClose={this.onColorPalettesDialogClose}
940
+ {this.renderCalculationTypes(productionMethod, channels)}
941
+
942
+ <Grid container justify="flex-end">
943
+ <Grid item xs={12}>
944
+ <IconButton
945
+ label={t('Remove')}
946
+ onClick={() => onRemove(productionMethod)}
947
+ id="remove"
878
948
  >
879
- <ColorPalettes
880
- selectedColor={this.getColorFromVariantsDefaultColor(openedVariantsDefaultColor)}
881
- colorSelectClick={this.onColorPalettesDialogSelectClick}
882
- colorPalettes={colorPalettes}
883
- closeColorPalettes={this.onColorPalettesDialogClose}
884
- />
885
- </Dialog>
886
- )}
949
+ <DeleteIcon />
950
+ </IconButton>
951
+ </Grid>
952
+ </Grid>
953
+ {openedVariantsDefaultColor !== null && (
954
+ <Dialog
955
+ open={true}
956
+ maxWidth="xs"
957
+ fullWidth={true}
958
+ onClose={this.onColorPalettesDialogClose}
959
+ >
960
+ <ColorPalettes
961
+ selectedColor={this.getColorFromVariantsDefaultColor(
962
+ openedVariantsDefaultColor
963
+ )}
964
+ colorSelectClick={this.onColorPalettesDialogSelectClick}
965
+ colorPalettes={colorPalettes}
966
+ closeColorPalettes={this.onColorPalettesDialogClose}
967
+ />
968
+ </Dialog>
969
+ )}
887
970
  </Grid>
888
971
  </Card>
889
972
  );