@configuratorware/configurator-admingui 1.30.1 → 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.
Files changed (38) hide show
  1. package/App/Reducers/Api/Actions.js +12 -1
  2. package/App/Reducers/Api/Reducer.js +6 -0
  3. package/Components/DefaultForm.js +3 -2
  4. package/Components/ValidatorCallbackProvider.js +1 -1
  5. package/Screens/Client/Containers/Edit.js +15 -4
  6. package/Screens/Client/Translations.js +3 -1
  7. package/Screens/Creator/Components/VisualizationAndMediaData/Components/ImageEditTools.js +78 -28
  8. package/Screens/Creator/Components/VisualizationAndMediaData/Translations.js +4 -2
  9. package/Screens/CurrentClient/Containers/Edit.js +17 -6
  10. package/Screens/CurrentClient/Reducers/Reducer.js +1 -4
  11. package/Screens/DefaultClient/Containers/Edit.js +15 -4
  12. package/Screens/DefaultClient/Reducers/Reducer.js +1 -4
  13. package/Screens/Group/Reducers/Actions.js +4 -2
  14. package/Screens/Item/Components/Variants/VariantsEditor.js +4 -2
  15. package/Screens/Item/Components/Variants/VariantsEditorPopup.js +34 -0
  16. package/Screens/Login/Reducers/Actions.js +4 -5
  17. package/package.json +2 -2
  18. package/src/App/Reducers/Api/Actions.js +6 -0
  19. package/src/App/Reducers/Api/Reducer.js +7 -0
  20. package/src/Components/DefaultForm.js +2 -1
  21. package/src/Components/TranslationFinder.js +1 -0
  22. package/src/Components/ValidatorCallbackProvider.js +1 -1
  23. package/src/Screens/Client/Containers/Edit.js +15 -2
  24. package/src/Screens/Client/Translations.js +3 -1
  25. package/src/Screens/Creator/Components/VisualizationAndMediaData/Components/ImageEditTools.js +65 -40
  26. package/src/Screens/Creator/Components/VisualizationAndMediaData/Translations.js +2 -0
  27. package/src/Screens/Creator/Components/VisualizationAndMediaData/VisualizationAndMediaData.js +1 -0
  28. package/src/Screens/Creator/Components/VisualizationAndMediaData/VisualizationAndMediaData.test.js +1 -0
  29. package/src/Screens/CurrentClient/Containers/Edit.js +17 -4
  30. package/src/Screens/CurrentClient/Reducers/Reducer.js +1 -1
  31. package/src/Screens/DefaultClient/Containers/Edit.js +15 -2
  32. package/src/Screens/DefaultClient/Reducers/Reducer.js +1 -1
  33. package/src/Screens/Group/Reducers/Actions.js +1 -1
  34. package/src/Screens/Item/Components/Variants/VariantsEditor.js +3 -2
  35. package/src/Screens/Item/Components/Variants/VariantsEditorPopup.js +11 -1
  36. package/src/Screens/Login/Reducers/Actions.js +1 -5
  37. package/Screens/Client/Components/TextFields.js +0 -163
  38. package/src/Screens/Client/Components/TextFields.js +0 -77
@@ -1,77 +0,0 @@
1
- import React, { Component } from 'react';
2
- import find from 'lodash/find';
3
- import TextField from '@material-ui/core/TextField/TextField';
4
- import Typography from '@material-ui/core/Typography/Typography';
5
- import { t } from '../../../App/i18n';
6
-
7
- export default class TextFields extends Component {
8
- onTextChange = textId => ({ target: { value: termsAndConditionsLink } }) => {
9
- const { value: texts, name, onChange } = this.props;
10
-
11
- const newTexts = texts.map(text => {
12
- if (text.id !== textId) {
13
- return text;
14
- }
15
-
16
- return {
17
- ...text,
18
- termsAndConditionsLink,
19
- };
20
- });
21
-
22
- onChange(name, newTexts);
23
- };
24
-
25
- getGroupedTexts = () => {
26
- const { value } = this.props;
27
-
28
- const groupedTexts = [];
29
-
30
- for (const text of value) {
31
- let group = find(groupedTexts, { id: text.channel.id });
32
-
33
- if (!group) {
34
- group = {
35
- id: text.channel.id,
36
- identifier: text.channel.identifier,
37
- texts: [],
38
- };
39
-
40
- groupedTexts.push(group);
41
- }
42
-
43
- group.texts.push({
44
- id: text.id,
45
- language: text.language,
46
- termsAndConditionsLink: text.termsAndConditionsLink,
47
- });
48
- }
49
-
50
- return groupedTexts;
51
- };
52
-
53
- render() {
54
- const groupedTexts = this.getGroupedTexts();
55
-
56
- return groupedTexts.length ? (
57
- <div>
58
- <Typography>{t('Texts')}</Typography>
59
- {groupedTexts.map((group, groupIndex) => (
60
- <React.Fragment key={groupIndex}>
61
- <Typography variant="overline">{group.identifier}</Typography>
62
- {group.texts.map((text, textIndex) => (
63
- <TextField
64
- key={textIndex}
65
- label={`${t('termsAndConditionsLink')} ${text.language}`}
66
- onChange={this.onTextChange(text.id)}
67
- value={text.termsAndConditionsLink || ''}
68
- fullWidth
69
- margin="normal"
70
- />
71
- ))}
72
- </React.Fragment>
73
- ))}
74
- </div>
75
- ) : null;
76
- }
77
- }