ru.coon 3.0.67 → 3.0.68
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/.husky/pre-commit +0 -0
- package/CHANGELOG.md +10 -0
- package/package.json +1 -1
- package/src/common/AbstractPlugin.js +17 -0
- package/src/common/component/editor/CharacteristicGridEditor.js +7 -2
- package/src/common/component/editor/TypedCharacteristicEditor.js +6 -2
- package/src/common/field/FieldsHelper.js +0 -0
- package/src/common/panel/WindowWrap.js +0 -0
- package/src/report/component/ReportPanel.js +5 -0
- package/src/report/component/reportpanel/ReportGrid.js +1 -0
- package/src/report/util.js +27 -27
- package/src/util.js +7 -9
- package/src/validator.js +33 -22
- package/src/version.js +1 -1
package/.husky/pre-commit
CHANGED
|
File without changes
|
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
# Version 3.0.68, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/4c8a28a5fc4878ff7e670c77d3bc794069ab7d2d)
|
|
2
|
+
* HT-14811: исправление редактирования характеристик FKV ([b5c035], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/b5c0356d657071ecc5353a39be973d5b592f7648))
|
|
3
|
+
* update: CHANGELOG.md ([87a10f], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/87a10faa1d038191be9cec97076df7bcea165105))
|
|
4
|
+
|
|
1
5
|
# Version 3.0.67, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/d850ee12048246ba85557eef4475595043fc9d00)
|
|
2
6
|
* HT-14811: исправление открытия редактора для характеристик FKV ([becf94], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/becf94689878553b8c8287c6260ca986a314b08e))
|
|
3
7
|
* update: CHANGELOG.md ([ef54a3], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/ef54a339c72c36ce13a27672dff3cf89e35ddded))
|
|
@@ -38,6 +42,12 @@
|
|
|
38
42
|
|
|
39
43
|
* HT-13993 добавлена боковая панель фильтров для репортов ([e2d5c7], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/e2d5c7436900d232cd48c9389a685affbacf721a))
|
|
40
44
|
* HT-14628 открытие компонента внутри репорта - закрытие через крестик ([fc4f4e], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/fc4f4e9112a3ba1a85cb4a064d65d7a7cfb8cec1))
|
|
45
|
+
* update: CHANGELOG.md ([2ab856], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/2ab8566fb3c7400e91d3706a5bd8383d48060556))
|
|
46
|
+
|
|
47
|
+
# Version 3.0.60, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/b3ba3aeb89954b8e1650cb40e052a4509b4809fb)
|
|
48
|
+
* ## Fixes
|
|
49
|
+
* <span style='color:red'>fix validator, util.getByPath</span> ([608e70], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/608e7096603a0ed31656b0f45686bab7a4ee302b))
|
|
50
|
+
|
|
41
51
|
* update: CHANGELOG.md ([e42a2a], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/e42a2a6fb8b511ba174ab5060fc84c683a046945))
|
|
42
52
|
|
|
43
53
|
# Version 3.0.59, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/065a134b1f6c6211d56ef758b127778d5e104faa)
|
package/package.json
CHANGED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
Ext.define('Coon.common.AbstractPlugin', {
|
|
2
|
+
extend: 'Ext.AbstractPlugin',
|
|
3
|
+
|
|
4
|
+
constructor(config) {
|
|
5
|
+
Ext.apply(this, config || {});
|
|
6
|
+
|
|
7
|
+
if (Array.isArray(this.validConfig)) {
|
|
8
|
+
const state = Coon.validator.isObjectValid(this.pluginConfig.properties, this.validConfig);
|
|
9
|
+
if (!state.valid) {
|
|
10
|
+
console.error(`Invalid configuration for plugin ${this.pluginConfig.name}:\n${state.errors}`);
|
|
11
|
+
}
|
|
12
|
+
this.pluginConfig.validity = state;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
this.callParent([config]);
|
|
16
|
+
},
|
|
17
|
+
});
|
|
@@ -245,9 +245,14 @@ Ext.define('Coon.common.component.editor.CharacteristicGridEditor', {
|
|
|
245
245
|
}
|
|
246
246
|
return Coon.format.withHint(visibleValue, visibleValue || tooltip);
|
|
247
247
|
},
|
|
248
|
+
|
|
248
249
|
getEditor: function(record) {
|
|
249
|
-
if (
|
|
250
|
-
|
|
250
|
+
if (record.get('entity') === 'FKV') {
|
|
251
|
+
const mask = record.get('mask');
|
|
252
|
+
const maskText = mask.match(/link:"(.*?)"/);
|
|
253
|
+
if (maskText) {
|
|
254
|
+
return false;
|
|
255
|
+
}
|
|
251
256
|
}
|
|
252
257
|
return Ext.create('Ext.grid.CellEditor', {
|
|
253
258
|
field: Ext.create('Ext.form.field.Text', {
|
|
@@ -296,8 +296,12 @@ Ext.define('Coon.common.component.editor.TypedCharacteristicEditor', {
|
|
|
296
296
|
|
|
297
297
|
cellclickHandler(cmp, td, cellIndex, record) {
|
|
298
298
|
if (this.isEditableChar(record)) {
|
|
299
|
-
if (
|
|
300
|
-
|
|
299
|
+
if (record.get('entity') === 'FKV') {
|
|
300
|
+
const mask = record.get('mask');
|
|
301
|
+
const maskText = mask.match(/link:"(.*?)"/);
|
|
302
|
+
if (maskText) {
|
|
303
|
+
this.prepareType(record);
|
|
304
|
+
}
|
|
301
305
|
}
|
|
302
306
|
}
|
|
303
307
|
},
|
|
File without changes
|
|
File without changes
|
|
@@ -866,6 +866,11 @@ Ext.define('Coon.report.component.ReportPanel', {
|
|
|
866
866
|
}
|
|
867
867
|
config[prefix + 'type'] = plugin[ns.$uiElement].xtype || plugin[ns.$xtype];
|
|
868
868
|
config[ns.$sortSequence] = plugin[ns.$sortSequence] || null;
|
|
869
|
+
config.pluginConfig = {
|
|
870
|
+
properties: Object.assign({}, config),
|
|
871
|
+
type,
|
|
872
|
+
name: prefix + 'type',
|
|
873
|
+
};
|
|
869
874
|
return config;
|
|
870
875
|
});
|
|
871
876
|
},
|
package/src/report/util.js
CHANGED
|
@@ -10,17 +10,17 @@ Ext.define('Coon.report.util', {
|
|
|
10
10
|
path: 'fields',
|
|
11
11
|
valid: 'array',
|
|
12
12
|
rules: [
|
|
13
|
-
{path: '
|
|
14
|
-
{path: '
|
|
15
|
-
{path: '
|
|
16
|
-
{path: '
|
|
13
|
+
{path: 'description', valid: 'string, required'},
|
|
14
|
+
{path: 'reportFieldCd', valid: 'string, required'},
|
|
15
|
+
{path: 'visibleSwitch', valid: 'boolean'},
|
|
16
|
+
{path: 'reportFieldTypeLookup', valid: 'uppercase, required'},
|
|
17
17
|
{
|
|
18
|
-
path: '
|
|
18
|
+
path: 'properties',
|
|
19
19
|
valid: 'array',
|
|
20
20
|
rules: [
|
|
21
|
-
{path: '
|
|
22
|
-
{path: '
|
|
23
|
-
{path: '
|
|
21
|
+
{path: 'sequenceNumber', valid: 'number'},
|
|
22
|
+
{path: 'key', valid: 'type.string'},
|
|
23
|
+
{path: 'value', valid: '!type.undefined'}
|
|
24
24
|
],
|
|
25
25
|
}
|
|
26
26
|
],
|
|
@@ -29,40 +29,40 @@ Ext.define('Coon.report.util', {
|
|
|
29
29
|
path: 'plugins',
|
|
30
30
|
valid: 'array',
|
|
31
31
|
rules: [
|
|
32
|
-
{path: '
|
|
33
|
-
{path: '
|
|
34
|
-
{path: '
|
|
35
|
-
{path: '
|
|
36
|
-
{path: '
|
|
37
|
-
{path: '
|
|
32
|
+
{path: 'xtype', valid: 'string, required'},
|
|
33
|
+
{path: 'type', valid: 'string, required'},
|
|
34
|
+
{path: 'uiElement', valid: 'string, required'},
|
|
35
|
+
{path: 'jsonProperties', valid: 'string, required'},
|
|
36
|
+
{path: 'sequenceNumber', valid: 'number, required'},
|
|
37
|
+
{path: 'sortSequence', valid: 'number, required'}
|
|
38
38
|
],
|
|
39
39
|
},
|
|
40
40
|
{
|
|
41
41
|
path: 'properties',
|
|
42
42
|
valid: 'array',
|
|
43
43
|
rules: [
|
|
44
|
-
{path: '
|
|
45
|
-
{path: '
|
|
46
|
-
{path: '
|
|
44
|
+
{path: 'key', valid: 'string, required'},
|
|
45
|
+
{path: 'value', valid: 'string, required'},
|
|
46
|
+
{path: 'sequenceNumber', valid: 'string, required'}
|
|
47
47
|
],
|
|
48
48
|
},
|
|
49
49
|
{
|
|
50
50
|
path: 'parameters',
|
|
51
51
|
valid: 'array',
|
|
52
52
|
rules: [
|
|
53
|
-
{path: '
|
|
54
|
-
{path: '
|
|
55
|
-
{path: '
|
|
56
|
-
{path: '
|
|
57
|
-
{path: '
|
|
58
|
-
{path: '
|
|
53
|
+
{path: 'requiredSwitch', valid: 'boolean'},
|
|
54
|
+
{path: 'visibleSwitch', valid: 'boolean'},
|
|
55
|
+
{path: 'notUsedInSQLSwitch', valid: 'boolean'},
|
|
56
|
+
{path: 'description', valid: 'string, required'},
|
|
57
|
+
{path: 'reportParameterCd', valid: 'string, required'},
|
|
58
|
+
{path: 'reportParameterTypeLookup', valid: 'string, required, uppercase'},
|
|
59
59
|
{
|
|
60
|
-
path: '
|
|
60
|
+
path: 'properties',
|
|
61
61
|
valid: 'array',
|
|
62
62
|
rules: [
|
|
63
|
-
{path: '
|
|
64
|
-
{path: '
|
|
65
|
-
{path: '
|
|
63
|
+
{path: 'key', valid: 'string, required'},
|
|
64
|
+
{path: 'value', valid: 'string, required'},
|
|
65
|
+
{path: 'sequenceNumber', valid: 'number'}
|
|
66
66
|
],
|
|
67
67
|
}
|
|
68
68
|
],
|
package/src/util.js
CHANGED
|
@@ -73,19 +73,17 @@ Ext.define('Coon.util', {
|
|
|
73
73
|
}
|
|
74
74
|
return path.reduce((acc, pathProp) => {
|
|
75
75
|
if (acc) {
|
|
76
|
+
if (pathProp.startsWith('[') && pathProp.endsWith(']')) {
|
|
77
|
+
pathProp = pathProp.slice(1, -1) || 0;
|
|
78
|
+
if (Number.isInteger(parseInt(pathProp))) {
|
|
79
|
+
acc = acc[parseInt(pathProp)];
|
|
80
|
+
return acc;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
76
83
|
if (Ext.isObject(acc)) {
|
|
77
84
|
acc = acc[pathProp];
|
|
78
85
|
return acc;
|
|
79
86
|
}
|
|
80
|
-
if (Array.isArray(acc)) {
|
|
81
|
-
if (pathProp.startsWith('[') && pathProp.endsWith(']')) {
|
|
82
|
-
pathProp = pathProp.slice(1, -1) || 0;
|
|
83
|
-
if (Number.isInteger(parseInt(pathProp))) {
|
|
84
|
-
acc = acc[parseInt(pathProp)];
|
|
85
|
-
return acc;
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
87
|
} else {
|
|
90
88
|
path = [];
|
|
91
89
|
acc = defaultValue;
|
package/src/validator.js
CHANGED
|
@@ -58,6 +58,12 @@ Ext.define('Coon.validator', {
|
|
|
58
58
|
* ]
|
|
59
59
|
*/
|
|
60
60
|
isObjectValid(obj, rules) {
|
|
61
|
+
if (!Ext.isObject(obj)) {
|
|
62
|
+
return {
|
|
63
|
+
valid: false,
|
|
64
|
+
errors: ['object is not valid'],
|
|
65
|
+
};
|
|
66
|
+
}
|
|
61
67
|
const getValid = (valid) => {
|
|
62
68
|
if (typeof valid === 'string') {
|
|
63
69
|
return valid.split(',').map((el) => el.trim());
|
|
@@ -69,42 +75,47 @@ Ext.define('Coon.validator', {
|
|
|
69
75
|
const checkValidity = (validProps, value) => validProps.find((prop) => {
|
|
70
76
|
const [name, ...args] = prop.split('.');
|
|
71
77
|
if (typeof validators[name] === 'function') {
|
|
72
|
-
return
|
|
73
|
-
|
|
74
|
-
);
|
|
78
|
+
return validators[name](value, ...args);
|
|
79
|
+
} else {
|
|
80
|
+
console.error(`validator [${name}] is not exist!`);
|
|
81
|
+
return false;
|
|
75
82
|
}
|
|
76
83
|
});
|
|
77
84
|
const validators = this.getValidators();
|
|
78
|
-
const getErrors = (
|
|
85
|
+
const getErrors = (src, rules) => {
|
|
86
|
+
if (Array.isArray(src)) {
|
|
87
|
+
for (const el of src) {
|
|
88
|
+
const state = getErrors(el, rules);
|
|
89
|
+
if (!state.valid) {
|
|
90
|
+
return state;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
return {valid: true, errors: []};
|
|
94
|
+
}
|
|
79
95
|
const errors = Coon.util.filterMap(rules, (rule) => {
|
|
96
|
+
let errorMessage = '';
|
|
80
97
|
if (!rule.path) {
|
|
81
98
|
return;
|
|
82
99
|
}
|
|
83
|
-
const value = Coon.util.getByPath(
|
|
100
|
+
const value = Coon.util.getByPath(src, rule.path);
|
|
84
101
|
const validTags = getValid(rule.valid) || [];
|
|
85
|
-
let
|
|
86
|
-
|
|
87
|
-
validTags(value) :
|
|
88
|
-
checkValidity(validTags, value);
|
|
102
|
+
let subResult;
|
|
103
|
+
const isValid = checkValidity(validTags, value);
|
|
89
104
|
if (
|
|
90
|
-
|
|
91
|
-
!isInvalid &&
|
|
105
|
+
isValid &&
|
|
92
106
|
Array.isArray(rule.rules) &&
|
|
93
107
|
rule.rules.length
|
|
94
108
|
) {
|
|
95
|
-
|
|
96
|
-
if (!subResult.valid) {
|
|
97
|
-
isInvalid = false;
|
|
98
|
-
subErrors = subResult.errors.join('\n');
|
|
99
|
-
}
|
|
109
|
+
subResult = getErrors(value, rule.rules);
|
|
100
110
|
}
|
|
101
|
-
if (
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
111
|
+
if (!isValid) {
|
|
112
|
+
errorMessage += rule.msg ||
|
|
113
|
+
`The property on the path "${rule.path}" with the value ${value} is invalid, validity check: ${rule.valid}`;
|
|
114
|
+
}
|
|
115
|
+
if (subResult && !subResult.valid) {
|
|
116
|
+
errorMessage += '\n---\n ' + subResult.errors.join('\n ');
|
|
107
117
|
}
|
|
118
|
+
return errorMessage || false;
|
|
108
119
|
});
|
|
109
120
|
return {
|
|
110
121
|
valid: !errors.length,
|
package/src/version.js
CHANGED