ru.coon 3.0.16 → 3.0.18

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 (26) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/package.json +1 -1
  3. package/src/Function.js +5 -1
  4. package/src/app/Application.js +3 -1
  5. package/src/app/viewPort/CenterView.js +6 -4
  6. package/src/report/column/HintColumn.js +1 -1
  7. package/src/report/command/GetDynamicReportDataCommand.js +8 -2
  8. package/src/report/command/GetKeyValueListByReportCommand.js +10 -4
  9. package/src/report/component/ReportPanel.js +9 -1
  10. package/src/report/component/calculator/ReportCalculatorMenuItem.js +120 -42
  11. package/src/report/component/calculator/ReportCalculatorMenuItem.scss +16 -0
  12. package/src/report/component/calculator/ReportCalculatorPanel.js +3 -0
  13. package/src/report/component/settings/ReportFormEditPanelController.js +11 -1
  14. package/src/report/component/settings/ReportFormEditPanelModel.js +0 -11
  15. package/src/report/component/settings/property/PropertySelectPanel.js +120 -78
  16. package/src/report/component/settings/property/ReportPropertiesPanel.js +224 -148
  17. package/src/report/component/settings/property/ReportPropertiesPanel.scss +41 -3
  18. package/src/report/component/settings/property/ReportPropertyDictionary.js +25 -9
  19. package/src/report/component/settings/property/ReportPropertyForm.js +70 -0
  20. package/src/report/component/settings/property/ReportPropertyGrid.js +73 -0
  21. package/src/report/plugin/grid/CalculatorPlugin.js +61 -7
  22. package/src/report/plugin/grid/GridContextMenu.js +2 -1
  23. package/src/report/plugin/grid/GridContextPlugin.js +1 -1
  24. package/src/util.js +6 -5
  25. package/src/version.js +1 -1
  26. package/src/report/component/settings/property/ReportPropertiesPanelController.js +0 -414
package/CHANGELOG.md CHANGED
@@ -1,3 +1,18 @@
1
+ # Version 3.0.18, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/bb39afb212a53701712c8b7fe902731447b750b3)
2
+ * HT-12682 ([cb7749], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/cb7749c37221e2300ef9fd808d7dd1bbe6485d16))
3
+ * upd ([b7296d], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/b7296d96541755709adbb4d128482076014d7a28))
4
+ * upd ([db6372], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/db637292f38afade2e8ea9960f667b0f1dfeca7f))
5
+ * upd ([c0f74f], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/c0f74f9e5bd6dbbdbc47aa8d29ab47f8532de78b))
6
+ * upd ([8b4435], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/8b44350dad3b194814defe9b0b97a60ad58bfb80))
7
+ * HT-12690 fix: Исправление разметки выбора значения для калькулятора ([437375], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/437375141d61cb8148320db5922c70ad5f3f51cd))
8
+ * update: CHANGELOG.md ([4bab06], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/4bab06487f996c9e55e3e01e1c6fb58950451cee))
9
+
10
+ # Version 3.0.17, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/0dcb35eed6ba22aaca715caec2b37099e186dcfa)
11
+ * upd ([175d4c], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/175d4c78d3374ac64bd3a9c484671e40fee6f093))
12
+ * HT-12960 #feat доработка пункта контекстного меню с кнопками калькулятор ([ed4cdb], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/ed4cdbe1f7152f362c35896adea0131ba76b917c))
13
+ * up ([476a5f], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/476a5f80e0cbe013581c17b45701585dc37eabd2))
14
+ * update: CHANGELOG.md ([bccfcb], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/bccfcbbaa044a23a919d7a572b562a113e750ed2))
15
+
1
16
  # Version 3.0.16, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/8c523f942539c21495d27f79366c3429cfbba26a)
2
17
  * ## Fixes
3
18
  * <span style='color:red'>fix</span> ([e33cdc], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/e33cdc8c5ee5899795915cfe174ad874a952b2bf))
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "name": "ru.coon"
5
5
  },
6
6
  "description": "",
7
- "version": "3.0.16",
7
+ "version": "3.0.18",
8
8
  "repository": {
9
9
  "type": "git",
10
10
  "url": "git+http://gitlab-dbr.sigma-it.local/dbr/ru.coon"
package/src/Function.js CHANGED
@@ -454,6 +454,10 @@ Ext.define('Coon.Function', {
454
454
  return Coon.Function.decodeProperties.call(this, listOfProperties, filterFunction, transformTypeFunction);
455
455
  },
456
456
 
457
+ isStringContainFunction(value) {
458
+ return /^function\s*\(.*?\)\s*\{/.test(value);
459
+ },
460
+
457
461
  decodeProperties: function(properties, filterFn, transformTypeFn) {
458
462
  if (!Ext.isObject(properties) && !Ext.isArray(properties)) {
459
463
  return properties;
@@ -470,7 +474,7 @@ Ext.define('Coon.Function', {
470
474
  } else {
471
475
  if (Ext.isString(value) && (Coon.format.startsWith(value, '{') && value.lastIndexOf(':') !== -1)) {
472
476
  value = JSON5.parse(value);
473
- } else if (Ext.isString(value) && Coon.format.startsWith(value, 'function')) {
477
+ } else if (Ext.isString(value) && Coon.Function.isStringContainFunction(value)) {
474
478
  value = eval('(' + value + ')');
475
479
  } else if (Ext.isString(value) && Coon.format.startsWith(value, '[')) {
476
480
  value = eval(value);
@@ -93,7 +93,6 @@ Ext.define('Coon.app.Application', {
93
93
  this.afterAuthorized();
94
94
  });
95
95
  this.getApplicationMainView().show();
96
- this.setDefaultWindowTitle();
97
96
  },
98
97
 
99
98
  afterLoad: async function() {
@@ -105,6 +104,9 @@ Ext.define('Coon.app.Application', {
105
104
  this.setUserData();
106
105
  }
107
106
  const isAuthValid = authenticated === true && !requireTwoFactorAuthentication;
107
+ if (isAuthValid) {
108
+ this.setDefaultWindowTitle();
109
+ }
108
110
  let view = isAuthValid ? 'mainview' : 'loginview';
109
111
 
110
112
  if (window.location.href.indexOf('customForm') > -1) {
@@ -12,11 +12,13 @@ Ext.define('Coon.app.viewPort.CenterView', {
12
12
  tabLimit: 50,
13
13
  },
14
14
 
15
- plugins: {
16
- tabreorderer: {
15
+ plugins: [
16
+ // 'tabscrollermenu',
17
+ {
18
+ ptype: 'tabreorderer',
17
19
  animate: false,
18
- },
19
- },
20
+ }
21
+ ],
20
22
 
21
23
  frame: true,
22
24
 
@@ -8,7 +8,7 @@ Ext.define('Coon.report.column.HintColumn', {
8
8
 
9
9
  $metaConfig: {
10
10
  type: 'column',
11
- description: `компонент выпадающего списка`,
11
+ description: 'компонент выпадающего списка',
12
12
  },
13
13
 
14
14
  initComponent: function() {
@@ -11,6 +11,8 @@ Ext.define('Coon.report.command.GetDynamicReportDataCommand', {
11
11
  ],
12
12
  url: '/ReportFormData/get',
13
13
 
14
+ enableFieldTruncate: false,
15
+
14
16
  execute: function(reportId, parameterList, start, limit, necessaryFields) {
15
17
  if (Array.isArray(parameterList)) {
16
18
  parameterList = Ext.encode(parameterList);
@@ -24,8 +26,12 @@ Ext.define('Coon.report.command.GetDynamicReportDataCommand', {
24
26
  start: start,
25
27
  limit: limit,
26
28
  };
27
- if (Array.isArray(necessaryFields) && necessaryFields.length) {
28
- params.filterReportFieldCdList = necessaryFields.join(',');
29
+ if (this.enableFieldTruncate) {
30
+ if (Array.isArray(necessaryFields) && necessaryFields.length) {
31
+ params.filterReportFieldCdList = necessaryFields.join(',');
32
+ }
33
+ } else {
34
+ delete params.filterReportFieldCdList;
29
35
  }
30
36
  this.callParent([params]);
31
37
  },
@@ -15,6 +15,8 @@ Ext.define('Coon.report.command.GetKeyValueListByReportCommand', {
15
15
  reportId: undefined,
16
16
  parametersList: undefined,
17
17
 
18
+ enableFieldTruncate: false,
19
+
18
20
  /**
19
21
  * url запроса.
20
22
  **/
@@ -45,10 +47,14 @@ Ext.define('Coon.report.command.GetKeyValueListByReportCommand', {
45
47
  parameterList: this.parametersList,
46
48
  reportId: this.reportId,
47
49
  };
48
- if (Array.isArray(necessaryFields) && necessaryFields.length) {
49
- params.filterReportFieldCdList = Array.from(
50
- new Set([this.keyField, this.valueField, ...necessaryFields])
51
- ).join(',');
50
+ if (this.enableFieldTruncate) {
51
+ if (Array.isArray(necessaryFields) && necessaryFields.length) {
52
+ params.filterReportFieldCdList = Array.from(
53
+ new Set([this.keyField, this.valueField, ...necessaryFields])
54
+ ).join(',');
55
+ }
56
+ } else {
57
+ delete params.filterReportFieldCdList;
52
58
  }
53
59
  this.callParent([params]);
54
60
  },
@@ -75,6 +75,8 @@ Ext.define('Coon.report.component.ReportPanel', {
75
75
  collapseMode: 'mini',
76
76
  },
77
77
 
78
+ lazyConfigLoading: true,
79
+
78
80
  locals: {
79
81
  plugins: new Map(),
80
82
  },
@@ -411,8 +413,14 @@ Ext.define('Coon.report.component.ReportPanel', {
411
413
  if (this.reportID) {
412
414
  this.reportId = this.reportID;
413
415
  }
416
+
414
417
  if (this.reportId) {
415
- this.configureReport();
418
+ if (this.lazyConfigLoading) {
419
+ // report reads the configuration only after has been laid out for the first time at its initial size
420
+ this.on('boxready', this.configureReport, this);
421
+ } else {
422
+ this.configureReport();
423
+ }
416
424
  }
417
425
 
418
426
  this.eventDestroier = Ext.on('rezise', this.onWindowResize, this);
@@ -4,63 +4,112 @@ Ext.define('Coon.report.component.calculator.ReportCalculatorMenuItem', {
4
4
  xtype: 'ReportCalculatorMenuItem',
5
5
  cls: 'ReportCalculatorMenuItem',
6
6
  defaultListenerScope: true,
7
+ referenceHolder: true,
8
+
7
9
  viewModel: {
8
10
  data: {
9
- isHiddenAll: false,
11
+ oneCellValue: 0,
12
+ summaryValue: 0,
13
+ oneCellValueVisible: false,
14
+ summaryValueVisible: false,
15
+ valueVariant: 'cell',
16
+ },
17
+ formulas: {
18
+ isHiddenAll: {
19
+ get: function(data) {
20
+ return !data('oneCellValueVisible') && !data('summaryValueVisible');
21
+ },
22
+ },
10
23
  },
11
24
  },
12
25
  margin: '0 0 0 48',
13
26
  bodyPadding: '5 0 0 0',
14
- layout: {type: 'hbox'},
27
+ layout: {type: 'hbox', align: 'stretch'},
15
28
  items: [
16
29
  {
17
30
  xtype: 'container',
18
- layout: {type: 'hbox', align: 'stretch'},
19
- defaults: {
20
- margin: '0 0 0 6',
21
- cls: 'calculator-contextmenu-button-type1',
22
- },
31
+ flex: 1,
32
+ layout: {type: 'vbox', align: 'stretch'},
23
33
  items: [
24
34
  {
25
- xtype: 'button',
26
- margin: '0 0 0 0',
27
- iconCls: 'svg-icon svg-icon-calculator',
28
- eventName: 'openCalculator',
29
- handler: 'onClickButton',
30
- },
31
- {
32
- xtype: 'button',
33
- text: 'M=',
34
- eventName: 'setMemory',
35
- handler: 'onClickButton',
36
- width: 46,
35
+ xtype: 'radiogroup',
36
+ simpleValue: true,
37
37
  hidden: true,
38
+ columns: 1,
39
+ vertical: true,
38
40
  bind: {
39
41
  hidden: '{isHiddenAll}',
42
+ value: '{valueVariant}',
40
43
  },
44
+ items: [
45
+ {
46
+ bind: {
47
+ boxLabel: '{oneCellValue}',
48
+ visible: '{oneCellValueVisible}',
49
+ },
50
+ inputValue: 'cell',
51
+ },
52
+ {
53
+ bind: {
54
+ boxLabel: `<div class="sum-value-container">
55
+ <div class="sum-icon">&sum;</div><div class="sum-value">{summaryValue}</div>
56
+ </div>`,
57
+ visible: '{summaryValueVisible}',
58
+ },
59
+ inputValue: 'range',
60
+ }
61
+ ],
41
62
  },
42
63
  {
43
- xtype: 'button',
44
- text: 'M+',
45
- eventName: 'addMemory',
46
- handler: 'onClickButton',
47
- width: 46,
48
- hidden: true,
49
- bind: {
50
- hidden: '{isHiddenAll}',
51
- },
52
- },
53
- {
54
- xtype: 'button',
55
- text: 'M-',
56
- eventName: 'subtractMemory',
57
- handler: 'onClickButton',
58
- width: 46,
59
- margin: '0 6 0 6',
60
- hidden: true,
61
- bind: {
62
- hidden: '{isHiddenAll}',
64
+ xtype: 'container',
65
+ layout: {type: 'hbox', align: 'stretch'},
66
+ defaults: {
67
+ margin: '0 0 0 6',
68
+ cls: 'calculator-contextmenu-button-type1',
63
69
  },
70
+ items: [
71
+ {
72
+ xtype: 'button',
73
+ margin: '0 0 0 0',
74
+ iconCls: 'svg-icon svg-icon-calculator',
75
+ eventName: 'openCalculator',
76
+ handler: 'onClickButton',
77
+ },
78
+ {
79
+ xtype: 'button',
80
+ text: 'M=',
81
+ eventName: 'setMemory',
82
+ handler: 'onClickButton',
83
+ width: 46,
84
+ hidden: true,
85
+ bind: {
86
+ hidden: '{isHiddenAll}',
87
+ },
88
+ },
89
+ {
90
+ xtype: 'button',
91
+ text: 'M+',
92
+ eventName: 'addMemory',
93
+ handler: 'onClickButton',
94
+ width: 46,
95
+ hidden: true,
96
+ bind: {
97
+ hidden: '{isHiddenAll}',
98
+ },
99
+ },
100
+ {
101
+ xtype: 'button',
102
+ text: 'M-',
103
+ eventName: 'subtractMemory',
104
+ handler: 'onClickButton',
105
+ width: 46,
106
+ margin: '0 6 0 6',
107
+ hidden: true,
108
+ bind: {
109
+ hidden: '{isHiddenAll}',
110
+ },
111
+ }
112
+ ],
64
113
  }
65
114
  ],
66
115
  },
@@ -85,11 +134,29 @@ Ext.define('Coon.report.component.calculator.ReportCalculatorMenuItem', {
85
134
  },
86
135
 
87
136
  onClickButton(button) {
88
- this.fireEvent(button.eventName, button.text);
137
+ const vm = this.getViewModel();
138
+ const value = vm.get('valueVariant') === 'cell' ?
139
+ vm.get('oneCellValue'):
140
+ vm.get('summaryValue');
141
+
142
+ this.fireEvent(button.eventName, button.text, value);
89
143
  },
90
144
 
91
- setHiddenMemoryButtons(isHidden) {
92
- this.getViewModel().set('isHiddenAll', isHidden);
145
+ /**
146
+ * Установка свойств, влияющих на видимость радиокнопок
147
+ * @param {boolean} oneCellValueVisible
148
+ * @param {boolean} summaryValueVisible
149
+ */
150
+ setVisibleValueVariants(oneCellValueVisible, summaryValueVisible) {
151
+ this.getViewModel().set({
152
+ oneCellValueVisible,
153
+ summaryValueVisible,
154
+ });
155
+ if (!oneCellValueVisible && summaryValueVisible) {
156
+ this.getViewModel().set('valueVariant', 'range');
157
+ } else if (oneCellValueVisible && !summaryValueVisible) {
158
+ this.getViewModel().set('valueVariant', 'cell');
159
+ }
93
160
  },
94
161
 
95
162
  isItemHidden() {
@@ -98,4 +165,15 @@ Ext.define('Coon.report.component.calculator.ReportCalculatorMenuItem', {
98
165
  isItemDisabled() {
99
166
  return false;
100
167
  },
168
+ /**
169
+ * Установка значений
170
+ * @param {number} value значение ячейки
171
+ * @param {number} summaryValue сумма значений ячеек по выделенным записям
172
+ */
173
+ setValueByContext(value, summaryValue) {
174
+ this.getViewModel().set({
175
+ oneCellValue: `${value}`,
176
+ summaryValue: `${summaryValue}`,
177
+ });
178
+ },
101
179
  });
@@ -38,4 +38,20 @@
38
38
  padding: 6px 6px;
39
39
  }
40
40
  }
41
+
42
+ .x-form-item-body-default {
43
+ min-height: 22px !important;
44
+ }
45
+ .x-form-cb-wrap-default {
46
+ height: 24px !important;
47
+ }
48
+ .sum-value-container {
49
+ display: flex;
50
+ }
51
+ .sum-icon {
52
+ color: gray !important;
53
+ }
54
+ .sum-value {
55
+ margin: 2px 0 0 4px
56
+ }
41
57
  }
@@ -1,3 +1,6 @@
1
+ /**
2
+ * todo: Вынести бизнеслогику и хранение стейтов в отдельный класс singleton.
3
+ */
1
4
  Ext.define('Coon.report.component.calculator.ReportCalculatorPanel', {
2
5
  extend: 'Ext.panel.Panel',
3
6
  alias: 'widget.ReportCalculatorPanel',
@@ -29,6 +29,13 @@ Ext.define('Coon.report.component.settings.ReportFormEditPanelController', {
29
29
  this.getView().on('tabchange', function() {
30
30
  this.lookupReference('plugins').saveState();
31
31
  });
32
+ this.setEditorTitle(reportID);
33
+ },
34
+
35
+ setEditorTitle(reportID) {
36
+ this.getView().setTitle(
37
+ reportID ? `${reportID} - репорт` : 'новый репорт'
38
+ );
32
39
  },
33
40
 
34
41
  load: function(reportID) {
@@ -234,7 +241,10 @@ Ext.define('Coon.report.component.settings.ReportFormEditPanelController', {
234
241
  validate: function(items) {
235
242
  let isValid = true;
236
243
  for (const key in items.items) {
237
- isValid = items.items[key].getController().validate();
244
+ const component = items.items[key];
245
+ isValid = component.validate ?
246
+ component.validate() :
247
+ component.getController().validate();
238
248
  if (!isValid) {
239
249
  this.getView().setActiveTab(items.items[key]);
240
250
  break;
@@ -15,17 +15,6 @@ Ext.define('Coon.report.component.settings.ReportFormEditPanelModel', {
15
15
  enableAddFieldProps: false,
16
16
  },
17
17
  formulas: {
18
- title: {
19
- bind: {
20
- isNew: '{isNew}',
21
- reportId: '{report.reportId}',
22
- reportDescription: '{report.reportDescription}',
23
- },
24
- get: function(data) {
25
- return (data.isNew ? 'Создание SWE репорта ' : 'Редактирование SWE репорта ') +
26
- data.reportId + ' (' + data.reportDescription + ' )';
27
- },
28
- },
29
18
  SQLPARAMS: {
30
19
  bind: {
31
20
  bindTo: '{report.SQLText}',