@configuratorware/configurator-admingui 1.36.0-beta.0 → 1.36.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.
- package/App/Config/defaultConfig.js +3 -0
- package/App/Data.js +12 -1
- package/App/Translations.js +4 -2
- package/Components/FormFragments/MonacoEditor.js +1 -1
- package/Screens/Client/Containers/Edit.js +2 -1
- package/Screens/Client/Translations.js +4 -2
- package/Screens/CurrentClient/Containers/Edit.js +2 -1
- package/Screens/DefaultClient/Containers/Edit.js +2 -1
- package/Screens/Designer/Components/TemplateList.js +1 -1
- package/Screens/Designer/SubScreens/DesignAreas/Containers/FormProductionMethods.js +13 -1
- package/Screens/Designer/SubScreens/DesignAreas/Reducers/Reducer.js +3 -0
- package/Screens/Designer/SubScreens/Designviews/Reducers/Actions.js +13 -5
- package/Screens/Designer/Translations.js +3 -1
- package/Screens/Font/Reducers/Actions.js +15 -7
- package/Screens/Font/Reducers/Reducer.js +1 -0
- package/Screens/Item/Containers/Edit.js +30 -0
- package/Screens/Item/Translations.js +2 -0
- package/Screens/Item/index.js +3 -1
- package/Screens/Itemclassification/Containers/Edit.js +65 -0
- package/Screens/Itemclassification/Containers/List.js +63 -0
- package/Screens/Itemclassification/Reducers/Actions.js +26 -0
- package/Screens/Itemclassification/Reducers/Reducer.js +67 -0
- package/Screens/Itemclassification/Screen.js +32 -0
- package/Screens/Itemclassification/Translations.js +21 -0
- package/Screens/Itemclassification/index.js +20 -0
- package/Screens/index.js +3 -0
- package/package.json +24 -18
- package/scripts/getDefaultWebpackConfig.js +11 -22
- package/src/App/Config/defaultConfig.js +13 -9
- package/src/App/Data.js +14 -0
- package/src/App/Translations.js +2 -0
- package/src/Components/FormFragments/MonacoEditor.js +1 -1
- package/src/Screens/Client/Containers/Edit.js +2 -1
- package/src/Screens/Client/Translations.js +2 -0
- package/src/Screens/CurrentClient/Containers/Edit.js +2 -1
- package/src/Screens/DefaultClient/Containers/Edit.js +1 -0
- package/src/Screens/Designer/Components/TemplateList.js +1 -1
- package/src/Screens/Designer/SubScreens/DesignAreas/Containers/FormProductionMethods.js +15 -1
- package/src/Screens/Designer/SubScreens/DesignAreas/Reducers/Reducer.js +1 -0
- package/src/Screens/Designer/SubScreens/Designviews/Reducers/Actions.js +9 -1
- package/src/Screens/Designer/Translations.js +2 -0
- package/src/Screens/Designer/__tests__/__snapshots__/FormProductionMethods.test.js.snap +38 -0
- package/src/Screens/Font/Reducers/Actions.js +16 -11
- package/src/Screens/Font/Reducers/Reducer.js +1 -1
- package/src/Screens/Item/Containers/Edit.js +23 -1
- package/src/Screens/Item/Translations.js +2 -0
- package/src/Screens/Item/index.js +2 -1
- package/src/Screens/Itemclassification/Containers/Edit.js +49 -0
- package/src/Screens/Itemclassification/Containers/List.js +64 -0
- package/src/Screens/Itemclassification/Reducers/Actions.js +17 -0
- package/src/Screens/Itemclassification/Reducers/Reducer.js +43 -0
- package/src/Screens/Itemclassification/Screen.js +19 -0
- package/src/Screens/Itemclassification/Translations.js +22 -0
- package/src/Screens/Itemclassification/index.js +9 -0
- package/src/Screens/index.js +3 -1
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
require("../../App/i18n").use({
|
|
4
|
+
en: {
|
|
5
|
+
itemclassifications: {
|
|
6
|
+
addButtonLabel: 'Add Product category',
|
|
7
|
+
menuLabel: 'Product Categories'
|
|
8
|
+
},
|
|
9
|
+
item_classifications: 'Product categories',
|
|
10
|
+
'Minimum order amount': 'Minimum order amount'
|
|
11
|
+
},
|
|
12
|
+
de: {
|
|
13
|
+
itemclassifications: {
|
|
14
|
+
addButtonLabel: 'Produktkategorie hinzufügen',
|
|
15
|
+
menuLabel: 'Produktkategorien'
|
|
16
|
+
},
|
|
17
|
+
'Sequence number': 'Reihenfolge',
|
|
18
|
+
item_classifications: 'Produktkategorien',
|
|
19
|
+
'Minimum order amount': 'Mindestbestellmenge'
|
|
20
|
+
}
|
|
21
|
+
}, true);
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = void 0;
|
|
7
|
+
|
|
8
|
+
var _Screen = _interopRequireDefault(require("./Screen"));
|
|
9
|
+
|
|
10
|
+
var _Reducer = _interopRequireDefault(require("./Reducers/Reducer"));
|
|
11
|
+
|
|
12
|
+
var _FeatureReducers = require("../../App/FeatureReducers");
|
|
13
|
+
|
|
14
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
15
|
+
|
|
16
|
+
(0, _FeatureReducers.addReducers)(_Reducer["default"]);
|
|
17
|
+
var _default = {
|
|
18
|
+
Screen: _Screen["default"]
|
|
19
|
+
};
|
|
20
|
+
exports["default"] = _default;
|
package/Screens/index.js
CHANGED
|
@@ -70,6 +70,8 @@ var _TrackingCodes = _interopRequireDefault(require("./TrackingCodes"));
|
|
|
70
70
|
|
|
71
71
|
var _User = _interopRequireDefault(require("./User"));
|
|
72
72
|
|
|
73
|
+
var _Itemclassification = _interopRequireDefault(require("./Itemclassification"));
|
|
74
|
+
|
|
73
75
|
var _Finder = _interopRequireDefault(require("./Finder"));
|
|
74
76
|
|
|
75
77
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
@@ -90,6 +92,7 @@ var features = {
|
|
|
90
92
|
designer: _Designer["default"],
|
|
91
93
|
design_production_methods: _DesignProductionMethods["default"],
|
|
92
94
|
items: _Item["default"],
|
|
95
|
+
item_classifications: _Itemclassification["default"],
|
|
93
96
|
licenses: _Screen2["default"],
|
|
94
97
|
options: _Option["default"],
|
|
95
98
|
option_classifications: _Optionclassification["default"],
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@configuratorware/configurator-admingui",
|
|
3
|
-
"version": "1.36.0
|
|
3
|
+
"version": "1.36.0",
|
|
4
4
|
"license": "UNLICENSED",
|
|
5
5
|
"private": false,
|
|
6
6
|
"dependencies": {
|
|
7
7
|
"@babel/polyfill": "^7.12.1",
|
|
8
|
-
"@hot-loader/react-dom": "^
|
|
8
|
+
"@hot-loader/react-dom": "^16.14.0",
|
|
9
9
|
"@material-ui/core": "^3.9.4",
|
|
10
10
|
"@material-ui/icons": "^3.0.2",
|
|
11
11
|
"@tweenjs/tween.js": "^17.6.0",
|
|
@@ -15,21 +15,21 @@
|
|
|
15
15
|
"css-element-queries": "^1.2.3",
|
|
16
16
|
"downshift": "^3.4.8",
|
|
17
17
|
"lodash": "^4.17.21",
|
|
18
|
-
"monaco-editor": "^0.
|
|
19
|
-
"monaco-editor-webpack-plugin": "^
|
|
18
|
+
"monaco-editor": "^0.20.0",
|
|
19
|
+
"monaco-editor-webpack-plugin": "^1.9.1",
|
|
20
20
|
"prop-types": "^15.7.2",
|
|
21
21
|
"qs": "^6.10.1",
|
|
22
|
-
"react": "^
|
|
23
|
-
"react-dom": "^
|
|
24
|
-
"react-file-drop": "^
|
|
22
|
+
"react": "^16.14.0",
|
|
23
|
+
"react-dom": "^16.14.0",
|
|
24
|
+
"react-file-drop": "^0.2.8",
|
|
25
25
|
"react-hot-loader": "^4.13.0",
|
|
26
26
|
"react-i18nify": "^1.11.18",
|
|
27
27
|
"react-mde": "^11.5.0",
|
|
28
28
|
"react-redux": "^7.2.4",
|
|
29
29
|
"react-redux-i18n": "^1.9.3",
|
|
30
30
|
"react-router": "^3.2.6",
|
|
31
|
-
"react-sortable-hoc": "^
|
|
32
|
-
"redhotmagma-visualization": "1.36.0
|
|
31
|
+
"react-sortable-hoc": "^1.11.0",
|
|
32
|
+
"redhotmagma-visualization": "1.36.0",
|
|
33
33
|
"redux": "^4.1.0",
|
|
34
34
|
"redux-logger": "^3.0.6",
|
|
35
35
|
"redux-persist": "^5.10.0",
|
|
@@ -39,17 +39,23 @@
|
|
|
39
39
|
"validate.js": "^0.12.0"
|
|
40
40
|
},
|
|
41
41
|
"peerDependencies": {
|
|
42
|
+
"@babel/cli": "^7.2.3",
|
|
43
|
+
"@babel/core": "^7.2.2",
|
|
44
|
+
"@babel/plugin-proposal-class-properties": "^7.2.3",
|
|
45
|
+
"@babel/plugin-syntax-dynamic-import": "^7.2.0",
|
|
46
|
+
"@babel/preset-env": "^7.2.3",
|
|
47
|
+
"@babel/preset-react": "^7.0.0",
|
|
42
48
|
"babel-loader": "^8.0.5",
|
|
43
|
-
"
|
|
44
|
-
"css-
|
|
45
|
-
"file-loader": "^
|
|
46
|
-
"mini-css-extract-plugin": "^
|
|
49
|
+
"babel-plugin-module-resolver": "^4.1.0",
|
|
50
|
+
"css-loader": "^2.1.0",
|
|
51
|
+
"file-loader": "^3.0.1",
|
|
52
|
+
"mini-css-extract-plugin": "^0.5.0",
|
|
53
|
+
"node-sass": "^4.11.0",
|
|
47
54
|
"optimize-css-assets-webpack-plugin": "^5.0.1",
|
|
48
|
-
"sass": "^1.
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
-
"
|
|
52
|
-
"url-loader": "^4.1.1"
|
|
55
|
+
"sass-loader": "^7.1.0",
|
|
56
|
+
"style-loader": "^0.23.1",
|
|
57
|
+
"terser-webpack-plugin": "^1.2.1",
|
|
58
|
+
"url-loader": "^1.1.2"
|
|
53
59
|
},
|
|
54
60
|
"scripts": {
|
|
55
61
|
"copy-public": "node ./scripts/cpFavicon.js",
|
|
@@ -23,19 +23,11 @@ const moduleRules = [
|
|
|
23
23
|
},
|
|
24
24
|
{
|
|
25
25
|
test: /\.(png|jpg|gif|svg)$/,
|
|
26
|
-
loader: 'url-loader',
|
|
27
|
-
options: {
|
|
28
|
-
limit: 16384,
|
|
29
|
-
name: 'images/[name].[hash].[ext]',
|
|
30
|
-
},
|
|
26
|
+
loader: 'url-loader?limit=16384&name=images/[name].[hash].[ext]',
|
|
31
27
|
},
|
|
32
28
|
{
|
|
33
29
|
test: /\.ttf$/,
|
|
34
|
-
loader: 'url-loader',
|
|
35
|
-
options: {
|
|
36
|
-
limit: 16384,
|
|
37
|
-
name: 'fonts/[name].[hash].[ext]',
|
|
38
|
-
},
|
|
30
|
+
loader: 'url-loader?limit=16384&name=fonts/[name].[hash].[ext]',
|
|
39
31
|
},
|
|
40
32
|
];
|
|
41
33
|
|
|
@@ -73,7 +65,7 @@ function getDevConfig(dirname, options = {}) {
|
|
|
73
65
|
filename: 'bundle.js',
|
|
74
66
|
publicPath: '/',
|
|
75
67
|
},
|
|
76
|
-
devtool: '
|
|
68
|
+
devtool: 'cheap-module-eval-source-map',
|
|
77
69
|
devServer: {
|
|
78
70
|
hot: true,
|
|
79
71
|
contentBase: BUILD_DIR,
|
|
@@ -112,10 +104,7 @@ function getDevConfig(dirname, options = {}) {
|
|
|
112
104
|
'react/lib/ExecutionEnvironment': true,
|
|
113
105
|
'react/lib/ReactContext': true,
|
|
114
106
|
},
|
|
115
|
-
|
|
116
|
-
moduleIds: 'named',
|
|
117
|
-
},
|
|
118
|
-
plugins: [new webpack.HotModuleReplacementPlugin(), monaco],
|
|
107
|
+
plugins: [new webpack.HotModuleReplacementPlugin(), new webpack.NamedModulesPlugin(), monaco],
|
|
119
108
|
};
|
|
120
109
|
}
|
|
121
110
|
|
|
@@ -123,17 +112,17 @@ function importPluginsForBuild() {
|
|
|
123
112
|
try {
|
|
124
113
|
const TerserPlugin = require('terser-webpack-plugin');
|
|
125
114
|
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
|
|
126
|
-
const
|
|
115
|
+
const OptimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin');
|
|
127
116
|
return {
|
|
128
117
|
TerserPlugin,
|
|
129
118
|
MiniCssExtractPlugin,
|
|
130
|
-
|
|
119
|
+
OptimizeCSSAssetsPlugin,
|
|
131
120
|
};
|
|
132
121
|
} catch (e) {
|
|
133
122
|
const packages = [
|
|
134
123
|
'terser-webpack-plugin',
|
|
135
124
|
'mini-css-extract-plugin',
|
|
136
|
-
'css-
|
|
125
|
+
'optimize-css-assets-webpack-plugin',
|
|
137
126
|
];
|
|
138
127
|
console.error(
|
|
139
128
|
'To use the build script, please install the following packages: ' + packages.join(', ')
|
|
@@ -146,14 +135,14 @@ function getProdConfig(dirname) {
|
|
|
146
135
|
const BUILD_DIR = path.resolve(dirname, 'public');
|
|
147
136
|
const APP_DIR = path.resolve(dirname, 'src');
|
|
148
137
|
|
|
149
|
-
const { TerserPlugin, MiniCssExtractPlugin,
|
|
138
|
+
const { TerserPlugin, MiniCssExtractPlugin, OptimizeCSSAssetsPlugin } = importPluginsForBuild();
|
|
150
139
|
|
|
151
140
|
const extractSass = new MiniCssExtractPlugin({
|
|
152
141
|
filename: 'bundle.css',
|
|
153
142
|
chunkFilename: 'bundle.[name].css',
|
|
154
143
|
});
|
|
155
144
|
|
|
156
|
-
const optimizeCss = new
|
|
145
|
+
const optimizeCss = new OptimizeCSSAssetsPlugin({});
|
|
157
146
|
|
|
158
147
|
const minimizer = new TerserPlugin({
|
|
159
148
|
extractComments: true,
|
|
@@ -199,9 +188,9 @@ function getProdConfig(dirname) {
|
|
|
199
188
|
],
|
|
200
189
|
noParse: moduleNoParse,
|
|
201
190
|
},
|
|
202
|
-
plugins: [env, extractSass, monaco],
|
|
191
|
+
plugins: [env, extractSass, optimizeCss, monaco],
|
|
203
192
|
optimization: {
|
|
204
|
-
minimizer: [minimizer
|
|
193
|
+
minimizer: [minimizer],
|
|
205
194
|
},
|
|
206
195
|
};
|
|
207
196
|
}
|
|
@@ -27,6 +27,10 @@ export default {
|
|
|
27
27
|
{
|
|
28
28
|
name: 'group_entries',
|
|
29
29
|
},
|
|
30
|
+
{
|
|
31
|
+
name: 'item_classifications',
|
|
32
|
+
label: 'itemclassifications.menuLabel',
|
|
33
|
+
},
|
|
30
34
|
],
|
|
31
35
|
},
|
|
32
36
|
{
|
|
@@ -95,15 +99,15 @@ export default {
|
|
|
95
99
|
],
|
|
96
100
|
},
|
|
97
101
|
{
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
102
|
+
name: 'finderitems',
|
|
103
|
+
label: 'finder',
|
|
104
|
+
credentials: ['question_trees'],
|
|
105
|
+
items: [
|
|
106
|
+
{
|
|
107
|
+
name: 'finder',
|
|
108
|
+
label: 'question_trees',
|
|
109
|
+
},
|
|
110
|
+
],
|
|
107
111
|
},
|
|
108
112
|
{
|
|
109
113
|
name: 'configurations',
|
package/src/App/Data.js
CHANGED
|
@@ -3,6 +3,8 @@ import { validate } from 'validate.js';
|
|
|
3
3
|
import isArray from 'lodash/isArray';
|
|
4
4
|
import { t } from './i18n';
|
|
5
5
|
|
|
6
|
+
export const whiteSpacePattern = /^[\S]+$/;
|
|
7
|
+
|
|
6
8
|
validate.validators.nonEmptyArray = function(value, options) {
|
|
7
9
|
if (options && options === true && isArray(value) && value.length !== 0) {
|
|
8
10
|
return null;
|
|
@@ -67,6 +69,18 @@ validate.validators.color = function(value, options) {
|
|
|
67
69
|
return true;
|
|
68
70
|
};
|
|
69
71
|
|
|
72
|
+
validate.validators.noWhitespace = function(value, options) {
|
|
73
|
+
if (
|
|
74
|
+
options === true &&
|
|
75
|
+
typeof value === 'string' &&
|
|
76
|
+
value.match(whiteSpacePattern) &&
|
|
77
|
+
value.match(whiteSpacePattern)[0] === value
|
|
78
|
+
) {
|
|
79
|
+
return null;
|
|
80
|
+
}
|
|
81
|
+
return t('customValidators.noWhitespace');
|
|
82
|
+
}
|
|
83
|
+
|
|
70
84
|
export default class Data {
|
|
71
85
|
static EventTypes = {
|
|
72
86
|
init: 'init',
|
package/src/App/Translations.js
CHANGED
|
@@ -65,6 +65,7 @@ require('./i18n').use(
|
|
|
65
65
|
'Identifiers should only contain lowercase letters, numbers, underscores, periods and dashes.',
|
|
66
66
|
blankError: "Can't be blank",
|
|
67
67
|
decimalPoint: 'Please use dot (".") as decimal separator',
|
|
68
|
+
noWhitespace: "Name should not contain whitespaces.",
|
|
68
69
|
},
|
|
69
70
|
callToActionDefault: {
|
|
70
71
|
addToCart: 'Use default setting (Add to cart)',
|
|
@@ -160,6 +161,7 @@ require('./i18n').use(
|
|
|
160
161
|
'Der Identifier darf nur aus Kleinbuchstaben, Zahlen, Unterstrichen, Punkten und Bindestrichen bestehen.',
|
|
161
162
|
blankError: 'Kann nicht leer sein',
|
|
162
163
|
decimalPoint: 'Bitte Punkt (".") als Dezimaltrennzeichen verwenden',
|
|
164
|
+
noWhitespace: "Name darf keine Leerzeichen enthalten.",
|
|
163
165
|
},
|
|
164
166
|
callToActionDefault: {
|
|
165
167
|
addToCart: 'Default (In den Warenkorb)',
|
|
@@ -2,7 +2,7 @@ import Actions, { REDUCER_NAME } from '../Reducers/Actions';
|
|
|
2
2
|
import SimpleNestedData from '../../../Components/FormFragments/SimpleNestedData';
|
|
3
3
|
import generateConnectedEdit from '../../../Components/DefaultConnectedForm';
|
|
4
4
|
import ColorTextField from '../Components/ColorTextField';
|
|
5
|
-
import { t } from '../../../App/i18n';
|
|
5
|
+
import { T, t } from '../../../App/i18n';
|
|
6
6
|
import React from 'react';
|
|
7
7
|
import { CallToActionField } from '../../../Components/CallToActionField';
|
|
8
8
|
import { PdfMarkDownField } from '../Components/PdfMarkdownField';
|
|
@@ -54,6 +54,7 @@ const formFields = [
|
|
|
54
54
|
accept: '.ttf',
|
|
55
55
|
showFileName: true,
|
|
56
56
|
deleteEnabled: true,
|
|
57
|
+
warningMessage: T('clientFontMessage')
|
|
57
58
|
},
|
|
58
59
|
{
|
|
59
60
|
name: 'logo',
|
|
@@ -16,6 +16,7 @@ require('../../App/i18n').use(
|
|
|
16
16
|
headerInfo: 'Please check your changes in a generated pdf to make sure it looks as expected',
|
|
17
17
|
footerInfo: 'Please check your changes in a generated pdf to make sure it looks as expected',
|
|
18
18
|
emailHint: 'separate multiple addresses with a semicolon',
|
|
19
|
+
clientFontMessage: 'For the font to be rendered correctly in the configuratorware frontend, make sure the filename does not contain any spaces and matches the fonts internal name.'
|
|
19
20
|
},
|
|
20
21
|
de: {
|
|
21
22
|
clients: 'Klienten',
|
|
@@ -46,6 +47,7 @@ require('../../App/i18n').use(
|
|
|
46
47
|
headerInfo: 'Bitte überprüfe Deine Änderungen in einem generierten PDF',
|
|
47
48
|
footerInfo: 'Bitte überprüfe Deine Änderungen in einem generierten PDF',
|
|
48
49
|
emailHint: 'trenne mehrere Adressen mit einem Semikolon',
|
|
50
|
+
clientFontMessage: 'Für eine korrekte Darstellung der Schrift im configuratorware Fronted darf der Dateiname keine Leerzeichen enthalten und muss dem internen Namen der Schriftart entsprechen.'
|
|
49
51
|
},
|
|
50
52
|
},
|
|
51
53
|
true
|
|
@@ -2,7 +2,7 @@ import Actions, { REDUCER_NAME } from '../Reducers/Actions';
|
|
|
2
2
|
import SimpleNestedData from '../../../Components/FormFragments/SimpleNestedData';
|
|
3
3
|
import generateConnectedEdit from '../../../Components/DefaultConnectedForm';
|
|
4
4
|
import { withLoadAction } from '../../../Components/withLoadAction';
|
|
5
|
-
import { t } from '../../../App/i18n';
|
|
5
|
+
import {T, t } from '../../../App/i18n';
|
|
6
6
|
import { CallToActionField } from '../../../Components/CallToActionField';
|
|
7
7
|
import PdfMarkDownField from '../../Client/Components/PdfMarkdownField';
|
|
8
8
|
|
|
@@ -23,6 +23,7 @@ const formFields = [
|
|
|
23
23
|
accept: '.ttf',
|
|
24
24
|
showFileName: true,
|
|
25
25
|
deleteEnabled: true,
|
|
26
|
+
warningMessage: T('clientFontMessage')
|
|
26
27
|
},
|
|
27
28
|
{
|
|
28
29
|
name: 'logo',
|
|
@@ -114,7 +114,7 @@ export default class TemplateList extends Component {
|
|
|
114
114
|
|
|
115
115
|
onSearchChange = delay(data => {
|
|
116
116
|
_.isFunction(this.props.onSearchChange) && this.props.onSearchChange(data);
|
|
117
|
-
});
|
|
117
|
+
}, 500);
|
|
118
118
|
|
|
119
119
|
renderAddItemButton = () => this.props.onAddItem && <AddItemButton onClick={this.props.onAddItem} />;
|
|
120
120
|
|
|
@@ -121,7 +121,7 @@ class FormProductionMethods extends React.Component {
|
|
|
121
121
|
let { value } = e.target;
|
|
122
122
|
const nextData = {};
|
|
123
123
|
|
|
124
|
-
if (key === 'allowBulkNames' || key === 'isDefault' || key === 'designElementsLocked') {
|
|
124
|
+
if (key === 'allowBulkNames' || key === 'isDefault' || key === 'designElementsLocked' || key === 'oneLineText') {
|
|
125
125
|
value = e.target.checked;
|
|
126
126
|
}
|
|
127
127
|
|
|
@@ -893,6 +893,19 @@ class FormProductionMethods extends React.Component {
|
|
|
893
893
|
label={t('designElementsLocked')}
|
|
894
894
|
/>
|
|
895
895
|
</Grid>
|
|
896
|
+
<Grid item xs={12} className={classes.checkboxGrid}>
|
|
897
|
+
<FormControlLabel
|
|
898
|
+
control={
|
|
899
|
+
<Checkbox
|
|
900
|
+
checked={productionMethod.oneLineText}
|
|
901
|
+
onChange={this.onChange('oneLineText')}
|
|
902
|
+
value={'oneLineText'}
|
|
903
|
+
color="primary"
|
|
904
|
+
/>
|
|
905
|
+
}
|
|
906
|
+
label={t('oneLineText')}
|
|
907
|
+
/>
|
|
908
|
+
</Grid>
|
|
896
909
|
<Grid item xs={12} className={classes.checkboxGrid}>
|
|
897
910
|
<TextField
|
|
898
911
|
label={t('minimumOrderAmount')}
|
|
@@ -903,6 +916,7 @@ class FormProductionMethods extends React.Component {
|
|
|
903
916
|
{...this.getErrorProps('minimumOrderAmount')}
|
|
904
917
|
/>
|
|
905
918
|
</Grid>
|
|
919
|
+
|
|
906
920
|
<Grid item xs={12} className={classes.checkboxGrid}>
|
|
907
921
|
<div className={classes.inputWithLabel}>
|
|
908
922
|
<FormLabel component="legend"> {t('maxTextElements')} </FormLabel>
|
|
@@ -19,6 +19,13 @@ import {
|
|
|
19
19
|
} from '../../../../../App/Reducers/Entity/Actions';
|
|
20
20
|
import { dispatchPostData } from '../../../../../App/Reducers/Api/Helpers';
|
|
21
21
|
|
|
22
|
+
const renameFile = (originalFile, newName) => {
|
|
23
|
+
return new File([originalFile], newName, {
|
|
24
|
+
type: originalFile.type,
|
|
25
|
+
lastModified: originalFile.lastModified,
|
|
26
|
+
});
|
|
27
|
+
};
|
|
28
|
+
|
|
22
29
|
const beforeApiStateHandler = apiAction => (dispatch, getState) => {
|
|
23
30
|
return new Promise(resolve => {
|
|
24
31
|
const state = getState()[REDUCER_NAME];
|
|
@@ -31,8 +38,9 @@ const beforeApiStateHandler = apiAction => (dispatch, getState) => {
|
|
|
31
38
|
return Promise.all(
|
|
32
39
|
keys.map(async key => {
|
|
33
40
|
const { file, type, id } = viewImages[key];
|
|
41
|
+
const renamedFile = renameFile(file, file.name.replace(/\s/g, ''));
|
|
34
42
|
const files = new FormData();
|
|
35
|
-
files.append('file',
|
|
43
|
+
files.append('file', renamedFile);
|
|
36
44
|
//const itemId = get(state, 'source.item.id');
|
|
37
45
|
const url = `/designviews/${apiAction.data.id}/${type}/upload/detail_image/${id}`;
|
|
38
46
|
const result = await dispatchPostData(dispatch)(`designview/images/${key}`, url, files);
|
|
@@ -7,6 +7,7 @@ require('../../App/i18n').use(
|
|
|
7
7
|
visualMaintenance: 'Visual maintenance',
|
|
8
8
|
pleaseUseVisualMaintanance: 'please use visual maintanance',
|
|
9
9
|
modeChangeConfirm: 'The views and visual maintanance data will be lost. Do you want to proceed?',
|
|
10
|
+
oneLineText: 'Restrict textinput to one line',
|
|
10
11
|
designDataTransfer: {
|
|
11
12
|
buttonUseAsTemplate: 'Use as template',
|
|
12
13
|
dialogTitle: 'Transfer of design settings',
|
|
@@ -47,6 +48,7 @@ require('../../App/i18n').use(
|
|
|
47
48
|
itemStatus: 'Status',
|
|
48
49
|
},
|
|
49
50
|
Hint: 'Hinweis',
|
|
51
|
+
oneLineText: 'Texteingabe auf eine Zeile beschränken',
|
|
50
52
|
},
|
|
51
53
|
},
|
|
52
54
|
true
|
|
@@ -249,6 +249,44 @@ exports[`Unit- FormProductionMethods renders correctly 1`] = `
|
|
|
249
249
|
</span>
|
|
250
250
|
</label>
|
|
251
251
|
</div>
|
|
252
|
+
<div
|
|
253
|
+
class="MuiGrid-item-44 MuiGrid-grid-xs-12-83 FormProductionMethods-checkboxGrid-1"
|
|
254
|
+
>
|
|
255
|
+
<label
|
|
256
|
+
class="MuiFormControlLabel-root-205"
|
|
257
|
+
>
|
|
258
|
+
<span
|
|
259
|
+
class="MuiButtonBase-root-227 MuiIconButton-root-221 MuiPrivateSwitchBase-root-217 MuiCheckbox-root-211 MuiCheckbox-colorPrimary-215"
|
|
260
|
+
>
|
|
261
|
+
<span
|
|
262
|
+
class="MuiIconButton-label-226"
|
|
263
|
+
>
|
|
264
|
+
<svg
|
|
265
|
+
aria-hidden="true"
|
|
266
|
+
class="MuiSvgIcon-root-184"
|
|
267
|
+
focusable="false"
|
|
268
|
+
role="presentation"
|
|
269
|
+
viewBox="0 0 24 24"
|
|
270
|
+
>
|
|
271
|
+
<path
|
|
272
|
+
d="M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"
|
|
273
|
+
/>
|
|
274
|
+
</svg>
|
|
275
|
+
<input
|
|
276
|
+
class="MuiPrivateSwitchBase-input-220"
|
|
277
|
+
data-indeterminate="false"
|
|
278
|
+
type="checkbox"
|
|
279
|
+
value="oneLineText"
|
|
280
|
+
/>
|
|
281
|
+
</span>
|
|
282
|
+
</span>
|
|
283
|
+
<span
|
|
284
|
+
class="MuiTypography-root-230 MuiTypography-body1-239 MuiFormControlLabel-label-210"
|
|
285
|
+
>
|
|
286
|
+
oneLineText
|
|
287
|
+
</span>
|
|
288
|
+
</label>
|
|
289
|
+
</div>
|
|
252
290
|
<div
|
|
253
291
|
class="MuiGrid-item-44 MuiGrid-grid-xs-12-83 FormProductionMethods-checkboxGrid-1"
|
|
254
292
|
>
|
|
@@ -10,6 +10,7 @@ import { SET_DATA } from '../../../App/Reducers/Entity/Actions';
|
|
|
10
10
|
|
|
11
11
|
import { generateDefaultActions } from '../../../App/Reducers/Entity/Actions';
|
|
12
12
|
import { dispatchPostData } from '../../../App/Reducers/Api/Helpers';
|
|
13
|
+
import { whiteSpacePattern } from "../../../App/Data";
|
|
13
14
|
|
|
14
15
|
const actions = generateDefaultActions(LIST_KEY, DATA_KEY, REDUCER_NAME, 'fonts');
|
|
15
16
|
|
|
@@ -45,24 +46,28 @@ actions.postData = () => (dispatch, getState) => {
|
|
|
45
46
|
const fontsToUpload = [];
|
|
46
47
|
|
|
47
48
|
const fontName = state.data.name.value;
|
|
48
|
-
|
|
49
|
-
if (fontName) {
|
|
49
|
+
if (fontName && fontName.match(whiteSpacePattern) && fontName.match(whiteSpacePattern)[0] === fontName) {
|
|
50
50
|
const fontTypeMap = {
|
|
51
51
|
fileNameRegular: 'regular',
|
|
52
52
|
fileNameBold: 'bold',
|
|
53
53
|
fileNameItalic: 'italic',
|
|
54
54
|
fileNameBoldItalic: 'bolditalic',
|
|
55
55
|
};
|
|
56
|
-
|
|
56
|
+
|
|
57
57
|
for (const fontType in fontTypeMap) {
|
|
58
58
|
const fontFile = state.data[fontType].value;
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
59
|
+
if (fontFile) {
|
|
60
|
+
const filename = fontName + '-' + fontTypeMap[fontType] + '.ttf';
|
|
61
|
+
if (!isString(fontFile)) {
|
|
62
|
+
fontsToUpload.push({
|
|
63
|
+
name: fontType,
|
|
64
|
+
value: fontFile,
|
|
65
|
+
filename
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
dispatch(setFilenameField(fontType, filename));
|
|
70
|
+
}
|
|
66
71
|
}
|
|
67
72
|
}
|
|
68
73
|
}
|
|
@@ -82,7 +87,7 @@ actions.postData = () => (dispatch, getState) => {
|
|
|
82
87
|
});
|
|
83
88
|
|
|
84
89
|
checkFontsToUpload();
|
|
85
|
-
});
|
|
90
|
+
});
|
|
86
91
|
};
|
|
87
92
|
|
|
88
93
|
checkFontsToUpload();
|
|
@@ -8,7 +8,7 @@ const initialState = {
|
|
|
8
8
|
...getDefaultEntityState(
|
|
9
9
|
{
|
|
10
10
|
id: null,
|
|
11
|
-
name: { value: '', constraints: { presence: true } },
|
|
11
|
+
name: { value: '', constraints: { noWhitespace: true, presence: true } },
|
|
12
12
|
active: false,
|
|
13
13
|
isDefault: { value: false },
|
|
14
14
|
fileNameRegular: null,
|
|
@@ -235,6 +235,27 @@ const formFields = [
|
|
|
235
235
|
type: 'toggle',
|
|
236
236
|
shouldRender: schema => schema.children.value.length > 0,
|
|
237
237
|
},
|
|
238
|
+
{
|
|
239
|
+
name: 'itemclassifications',
|
|
240
|
+
label: 'itemclassifications',
|
|
241
|
+
type: 'dynSource',
|
|
242
|
+
sourceConfig: {
|
|
243
|
+
value: 'id',
|
|
244
|
+
text: 'translated_title',
|
|
245
|
+
},
|
|
246
|
+
dynSource: {
|
|
247
|
+
type: 'chip',
|
|
248
|
+
listKey: ITEMCLASSIFICATION_LIST_KEY,
|
|
249
|
+
url: ITEMCLASSIFICATIONS_URL,
|
|
250
|
+
autoLoad: false,
|
|
251
|
+
maxSearchResults: 25,
|
|
252
|
+
mapItems: item => ({ ...item, label: `${item.translated_title}` }),
|
|
253
|
+
},
|
|
254
|
+
openOnFocus: true,
|
|
255
|
+
loadEntity: Actions.loadEntity,
|
|
256
|
+
entityReducerName: 'itemclassificationData',
|
|
257
|
+
equalityCheckAttribute: 'identifier',
|
|
258
|
+
},
|
|
238
259
|
{
|
|
239
260
|
name: 'minimumOrderAmount',
|
|
240
261
|
label: 'MinimumOrderAmount',
|
|
@@ -357,7 +378,8 @@ import { LOGIN_REDUCER_NAME } from '../../Login/Reducers/Actions';
|
|
|
357
378
|
import CheckData from '../../Creator/Components/CheckData/CheckData';
|
|
358
379
|
import LocalizedPriceValue from '../../../Components/LocalizedPriceValue';
|
|
359
380
|
import { LocalizedPriceTextField } from '../../../Components/LocalizedPriceTextField';
|
|
360
|
-
import {CallToActionField} from "../../../Components/CallToActionField";
|
|
381
|
+
import { CallToActionField } from "../../../Components/CallToActionField";
|
|
382
|
+
import { ITEMCLASSIFICATION_LIST_KEY, ITEMCLASSIFICATIONS_URL } from "../../Itemclassification/Reducers/Actions";
|
|
361
383
|
|
|
362
384
|
const styles = theme => ({
|
|
363
385
|
root: {
|
|
@@ -18,6 +18,7 @@ require('../../App/i18n').use(
|
|
|
18
18
|
editDialogTitle: 'Edit selected entries',
|
|
19
19
|
editDialogHint:
|
|
20
20
|
'Use the checkboxes to select one or more entries in the list</br>and then click this icon to set the item status for them.',
|
|
21
|
+
itemclassifications: 'Product categories',
|
|
21
22
|
visualizationData: {
|
|
22
23
|
'2d': "2D",
|
|
23
24
|
'3d': "3D",
|
|
@@ -99,6 +100,7 @@ require('../../App/i18n').use(
|
|
|
99
100
|
editDialogTitle: 'Gewählte Einträge bearbeiten',
|
|
100
101
|
editDialogHint:
|
|
101
102
|
'Nutze die Checkboxen in der Liste und klicke dann dieses Icon,</br>um den Status für einen oder mehrere Einträge zu setzen.',
|
|
103
|
+
itemclassifications: 'Produktkategorien',
|
|
102
104
|
visualizationData: {
|
|
103
105
|
'2d': "2D",
|
|
104
106
|
'3d': "3D",
|