ru.coon 3.0.72 → 3.0.74

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 CHANGED
File without changes
package/CHANGELOG.md CHANGED
@@ -1,3 +1,17 @@
1
+ # Version 3.0.74, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/723e4a3b5562fe1ce81ea131cba9987cfe286001)
2
+ * HT-10758: исправление доступности кнопок в зависимости от типа параметра ([db308d], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/db308d95a02df99e875998bc2039380dff4c87c7))
3
+ * update: CHANGELOG.md ([734d0f], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/734d0fed9b45fffbff8d29a7b43723e06d9265fb))
4
+
5
+ # Version 3.0.73, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/d77f15a5f3bbd05c134e65d32edab3f7cbb2b80f)
6
+ * ## Features
7
+ * <span style='color:green'>feat: HT-12053: Добавил возможность изменить xtype кнопки, что позволит использовать split, segmented и кастомные кнопки</span> ([b0f2e7], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/b0f2e72e4115266d83b9a39028159169355d2e73))
8
+ * <span style='color:green'> HT-14762 upd</span> ([f1b5a0], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/f1b5a0f60dac47792011678fe46997acf8bbe28a))
9
+ * <span style='color:green'> HT-14762 checkErrorsComponent</span> ([099a88], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/099a889718fcf4638409802f99fce07e6f307958))
10
+
11
+ * ([Update], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/Update file CustomButtonPlugin.jse007992a055e82a1ad3bfcb7b4bfb2f643af375a))
12
+ * upd ([16e891], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/16e891ac6eb9cd8713787a571571c12ef8aee409))
13
+ * update: CHANGELOG.md ([f5084b], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/f5084bd2f86cfee8d31b470b2e9859905e08de21))
14
+
1
15
  # Version 3.0.72, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/c2f5896748cca4a1467fa9dedd00ed69b950c033)
2
16
  * ## Fixes
3
17
  * <span style='color:red'> исправление отображения кнопок репорта</span> ([45f49f], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/45f49ff03cfd18a299ba92a73f415fc86f9c6bbf))
@@ -259,6 +273,7 @@
259
273
  * ## Fixes
260
274
  * <span style='color:red'>NEVA-947 fix UiCustomPanel reloadFrame</span> ([fa11cb], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/fa11cb33bf25866bf8a49035dd0121830cd9f5e3))
261
275
 
276
+ * HT-9130 fix: change minWidth ([832f4a], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/832f4ac2af931449cdf1bcb3ee6528ef2d560f97))
262
277
  * update: CHANGELOG.md ([0b19f1], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/0b19f173f5285306bd642141ea01e5472782e44f))
263
278
 
264
279
  # Version 3.0.32, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/54a1adc38f21829b195830d3eced818bf79b9ae8)
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "name": "ru.coon"
5
5
  },
6
6
  "description": "",
7
- "version": "3.0.72",
7
+ "version": "3.0.74",
8
8
  "repository": {
9
9
  "type": "git",
10
10
  "url": "git+http://gitlab-dbr.sigma-it.local/dbr/ru.coon"
@@ -0,0 +1,111 @@
1
+ Ext.define('Coon.common.component.CheckErrorsComponent', {
2
+ extend: 'Ext.panel.Panel',
3
+ xtype: 'CheckErrorsComponent',
4
+
5
+ config: {
6
+ period: '',
7
+ maskComponent: '',
8
+ checks: [],
9
+ },
10
+ layout: 'fit',
11
+
12
+ async checkHandler() {
13
+ this.afterCheck = false;
14
+ const period = this.getPeriod();
15
+
16
+ this.maskTab(true);
17
+
18
+ const store = this.checksGrid.getStore();
19
+ store.each((record) => record.set('state', '?'));
20
+
21
+ for (const reportId of this.checksReports) {
22
+ try {
23
+ const record = store.getData().getRange().find((rec) => rec.get('reportId') === reportId);
24
+ if (record.get('state') === 'Успешно' && reportId === '') {
25
+ return;
26
+ }
27
+ record.set('state', 'Проверка');
28
+ let data;
29
+ if (reportId === '') {
30
+ data = await Coon.util.promisifyCmd('SigmaUtilities.view.calendar.opa.getClosedStateCalendarPeriodCommand',
31
+ 'UBUT_PD',
32
+ period
33
+ );
34
+ } else {
35
+ data = await Coon.util.promisifyCmd('command.GetDynamicReportDataCommand',
36
+ reportId,
37
+ [{'type': 'PERIOD_ID', 'value': period}]
38
+ );
39
+ }
40
+ if (data === true || !data.list.length) {
41
+ record.set('state', 'Успешно');
42
+ } else if (data.list.length) {
43
+ record.set('state', 'Ошибка');
44
+ }
45
+ this.afterCheck = true;
46
+ } catch (e) {
47
+ Coon.log.error('Невозможно выполнить все проверки </br>', e);
48
+ Ext.Msg.alert('Сообщение системы', 'Невозможно выполнить все проверки');
49
+ break;
50
+ }
51
+ }
52
+ this.maskTab(false);
53
+ },
54
+
55
+ getMaskComponent: function() {
56
+ return this.up(this.maskComponent);
57
+ },
58
+
59
+ maskTab: function(state) {
60
+ this.getMaskComponent()[state ? 'mask' : 'unmask']();
61
+ },
62
+
63
+ initComponent: function() {
64
+ this.items = [
65
+ {
66
+ xtype: 'grid',
67
+ reference: 'checksGrid',
68
+ columns: [
69
+ {
70
+ text: 'Тип',
71
+ dataIndex: 'checkName',
72
+ width: 360,
73
+ },
74
+ {
75
+ text: 'Статус</br> проверки',
76
+ dataIndex: 'state',
77
+ width: 100,
78
+ }
79
+ ],
80
+ listeners: {
81
+ itemclick: function(_, rec) {
82
+ if (this.afterCheck) {
83
+ this.fireEvent('checkitemclick', _, rec);
84
+ }
85
+ },
86
+ scope: this,
87
+ },
88
+ store: {
89
+ type: 'json',
90
+ data: [],
91
+ },
92
+ tbar: {
93
+ items: [
94
+ {
95
+ text: 'Запустить',
96
+ handler: this.checkHandler.bind(this),
97
+ }
98
+ ],
99
+ },
100
+ }
101
+ ];
102
+ this.callParent(arguments);
103
+
104
+ this.checksReports = [];
105
+ for (const record of this.checks) {
106
+ this.checksReports.push(record.reportId);
107
+ }
108
+ this.checksGrid = this.down('[reference=checksGrid]');
109
+ this.checksGrid.getStore().loadData(this.checks);
110
+ },
111
+ });
File without changes
File without changes
@@ -28,6 +28,7 @@ Ext.define('Coon.report.component.settings.common.ReportFormContextParametersGri
28
28
  },
29
29
 
30
30
  initComponent: function() {
31
+ const me = this;
31
32
  this.storeForSELR = [
32
33
  {
33
34
  value: 'CVW',
@@ -102,6 +103,8 @@ Ext.define('Coon.report.component.settings.common.ReportFormContextParametersGri
102
103
  allowBlank: false,
103
104
  });
104
105
 
106
+ this.fullValueEditorCombo = this.getFullValueEditorCombo();
107
+
105
108
  const valueDefaultEditor = Ext.create('Ext.form.field.Text', {
106
109
  allowBlank: false,
107
110
  });
@@ -132,7 +135,7 @@ Ext.define('Coon.report.component.settings.common.ReportFormContextParametersGri
132
135
  dataIndex: 'reportNavigationOptionContextSourceValue',
133
136
  xtype: 'hintColumn',
134
137
  width: 130,
135
- editor: this.valueEditor,
138
+ editable: true,
136
139
  renderer: Ext.bind(function(value, meta, record) {
137
140
  const type = record.get('reportNavigationOptionContextSource');
138
141
  let visibleValue;
@@ -140,16 +143,28 @@ Ext.define('Coon.report.component.settings.common.ReportFormContextParametersGri
140
143
  let found;
141
144
  if (type === 'FLD') {
142
145
  found = this.fieldsStore.findRecord('value', value);
143
- visibleValue = found && found.get('description');
146
+ visibleValue = found && (`${found.get('value')} (${found.get('description')})`);
144
147
  } else if (type === 'PRM') {
145
148
  found = this.paramsStore.findRecord('value', value);
146
- visibleValue = found && found.get('description');
149
+ visibleValue = found && (`${found.get('value')} (${found.get('description')})`);
147
150
  } else if (type === 'SELR' || type === 'ALLR' || type === 'RCRD' || type === 'MDFD' || type === 'CHCK') {
148
151
  found = this.storeForSELR.find((obj) => obj.value === value);
149
152
  visibleValue = found && found.description;
150
153
  }
151
154
  return Coon.format.withHint(visibleValue);
152
155
  }, this),
156
+ getEditor: function(record) {
157
+ const type = record.get('reportNavigationOptionContextSource');
158
+ let editor;
159
+ if (['PRM', 'FLD'].includes(type)) {
160
+ editor = me.fullValueEditorCombo;
161
+ } else {
162
+ editor = me.valueEditor;
163
+ }
164
+ return Ext.create('Ext.grid.CellEditor', {
165
+ field: editor,
166
+ });
167
+ },
153
168
  },
154
169
  {
155
170
  text: 'Значение по умолчанию',
@@ -235,6 +250,37 @@ Ext.define('Coon.report.component.settings.common.ReportFormContextParametersGri
235
250
  }, this);
236
251
  },
237
252
 
253
+ getFullValueEditorCombo() {
254
+ const {$reportField, $description, $reportFieldTypeLookup} =
255
+ Coon.report.model.ReportFieldMaintenanceBeanFields;
256
+ const fieldTypeStyle =
257
+ 'opacity:.8;background-color:lightgrey;font-size:.7rem;padding:2px 4px;';
258
+ const listItemTpl = Ext.create(
259
+ 'Ext.XTemplate',
260
+ '<ul class="x-list-plain"><tpl for=".">',
261
+ '<li role="option" class="x-boundlist-item">',
262
+ `<b>{[values["${$reportField}"]]}</b> : <i style="${fieldTypeStyle}">{[values["${$reportFieldTypeLookup}"]]}</i>`,
263
+ '<tpl if="description.length">',
264
+ `<div style="opacity:.8;font-size: 1rem;"><i>{[values["${$description}"]]}</i></div>`,
265
+ '</tpl>',
266
+ '</li>',
267
+ '</tpl></ul>'
268
+ );
269
+ return Ext.create(
270
+ 'Coon.report.component.SimplestReportCombo',
271
+ {
272
+ valueField: $reportField,
273
+ displayField: $reportField,
274
+ listConfig: {
275
+ tpl: listItemTpl,
276
+ },
277
+ displayTpl: new Ext.XTemplate(
278
+ '<tpl>{[values[0].reportFieldCd]} ({[values[0].description]})</tpl>'
279
+ ),
280
+ }
281
+ );
282
+ },
283
+
238
284
  /**
239
285
  * Инициализация
240
286
  */
@@ -323,9 +369,11 @@ Ext.define('Coon.report.component.settings.common.ReportFormContextParametersGri
323
369
  switch (type) {
324
370
  case 'FLD':
325
371
  list = Coon.Function.serializeRecords(this.fieldsStore.getRange());
372
+ this.fillFullValueCombo(this.fieldsStore.getRange());
326
373
  break;
327
374
  case 'PRM':
328
375
  list = Coon.Function.serializeRecords(this.paramsStore.getRange());
376
+ this.fillFullValueCombo(this.paramsStore.getRange());
329
377
  break;
330
378
  case 'RCRD':
331
379
  case 'ALLR':
@@ -342,10 +390,29 @@ Ext.define('Coon.report.component.settings.common.ReportFormContextParametersGri
342
390
  }
343
391
  },
344
392
 
393
+ fillFullValueCombo(data) {
394
+ const {$reportField, $description, $reportFieldTypeLookup} =
395
+ Coon.report.model.ReportFieldMaintenanceBeanFields;
396
+ const columnsData = [];
397
+ data.forEach((item) => {
398
+ // const fieldData = item.getData();
399
+ const description = Ext.util.Format.stripTags(
400
+ String(item.get('description')).replaceAll('<br>', ' ')
401
+ );
402
+ columnsData.push({
403
+ [$description]: description || '',
404
+ [$reportField]: item.get('value'),
405
+ [$reportFieldTypeLookup]: item.get('typeLookup'),
406
+ });
407
+ });
408
+ this.fullValueEditorCombo.getStore().loadData(columnsData);
409
+ },
410
+
345
411
  changeFieldsList: function(fields) {
346
412
  const cvList = fields.map((field) => ({
347
413
  value: field['reportFieldCd'],
348
414
  description: field['description'],
415
+ typeLookup: field['reportFieldTypeLookup'],
349
416
  }));
350
417
  this.fieldsStore.loadData(cvList);
351
418
  },
@@ -354,6 +421,7 @@ Ext.define('Coon.report.component.settings.common.ReportFormContextParametersGri
354
421
  const cvList = parameters.map((param) => ({
355
422
  value: param['reportParameterCd'],
356
423
  description: param['description'],
424
+ typeLookup: param['reportParameterTypeLookup'],
357
425
  }));
358
426
  this.paramsStore.loadData(cvList);
359
427
  },
@@ -640,7 +640,7 @@ Ext.define('Coon.report.plugin.grid.AddFilterConditionPlugin', {
640
640
  foundMenuItem.setText(`Фильтр по пустому значению`);
641
641
  } else {
642
642
  foundMenuItem.setText(`<div style="max-width: 300px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;">
643
- Фильтр по "${this.getValueText(this.columnValue)}"
643
+ Фильтр по "${this.getValueText(this.columnValue)}"
644
644
  </div>`);
645
645
  }
646
646
  }
@@ -711,7 +711,7 @@ Ext.define('Coon.report.plugin.grid.AddFilterConditionPlugin', {
711
711
  if (['string', 'numeric', 'date', 'list', 'combo'].includes(filterType)) {
712
712
  filterWrapPanelCfg.width = 600;
713
713
  } else {
714
- filterWrapPanelCfg.minWidth = 200;
714
+ filterWrapPanelCfg.minWidth = 300;
715
715
  }
716
716
  const menuItem = Ext.widget('FilterWrapPanel', filterWrapPanelCfg);
717
717
  menuItem.on('dofilter', function(value, condition) {
@@ -92,7 +92,16 @@ Ext.define('Coon.report.plugin.grid.CustomButtonPlugin', {
92
92
  <b>${this.panelButtonItemId}</b>.
93
93
  ${this.panelButtonItemId} - ключ, по которому связана конфигурация кнопки в кастомной панели с кнопкой в репорте.`;
94
94
  }
95
- this.separateAction = new Ext.Button(buttonConfig);
95
+ buttonConfig.xtype = buttonConfig.xtype || 'button';
96
+ const button = Ext.create(buttonConfig)
97
+ if (!button.isButton) {
98
+ Coon.log.error(`[CustomButtonPlugin] xtype error - it's not a button component`)
99
+ buttonConfig.xtype = 'button';
100
+ button.destroy()
101
+ this.separateAction = Ext.create(buttonConfig);
102
+ } else {
103
+ this.separateAction = button;
104
+ }
96
105
  if (!this.isUnused) {
97
106
  this.processBind(bindConfig);
98
107
  }
@@ -243,10 +243,8 @@ Ext.define('Coon.report.plugin.grid.GridToolbarButtonPlugin', {
243
243
  param.editable ? requiredMultiParameters.push(param) : notRequiredMultiParameters.push(param);
244
244
  multiDependencyParameters.push(param);
245
245
  onlyIndependentParameters = false;
246
- } else if (param.reportNavigationOptionContextSource === 'DFLT') {
247
- reportIndependentParameters.push(param);
248
246
  } else {
249
- onlyIndependentParameters = false;
247
+ reportIndependentParameters.push(param);
250
248
  }
251
249
  });
252
250
 
@@ -10,7 +10,7 @@ Ext.define('Coon.report.plugin.grid.addFilterConditionPlugin.FilterFieldFactory'
10
10
  case 'date':
11
11
  return this.getDateFields();
12
12
  case 'boolean':
13
- return this.getBooleanFields(options.booleanLabels);
13
+ return this.getBooleanFields(options);
14
14
  case 'numeric':
15
15
  return this.getNumericFields();
16
16
  case 'list':
@@ -56,8 +56,8 @@ Ext.define('Coon.report.plugin.grid.addFilterConditionPlugin.FilterFieldFactory'
56
56
  },
57
57
  });
58
58
  },
59
- getBooleanFields(labels) {
60
- labels = labels || {};
59
+ getBooleanFields(options) {
60
+ const labels = options.booleanLabels || {};
61
61
  return {
62
62
  xtype: 'container',
63
63
  items: {
@@ -67,8 +67,8 @@ Ext.define('Coon.report.plugin.grid.addFilterConditionPlugin.FilterFieldFactory'
67
67
  },
68
68
  simpleValue: true,
69
69
  items: [
70
- {boxLabel: labels.trueText || 'Да', name: 'condition', inputValue: true},
71
- {boxLabel: labels.falseText || 'Нет', name: 'condition', inputValue: false, margin: '0 0 0 15'}
70
+ {boxLabel: labels.trueText || 'Да', name: options.dataIndex, inputValue: true},
71
+ {boxLabel: labels.falseText || 'Нет', name: options.dataIndex, inputValue: false, margin: '0 0 0 15'}
72
72
  ],
73
73
  bind: {
74
74
  value: '{filter.fromValue}',
@@ -156,7 +156,16 @@ Ext.define('Coon.report.plugin.grid.addFilterConditionPlugin.FilterItem', {
156
156
  const listData = filter.listData;
157
157
  const useCombo = filter.useCombo && operator==='eq';
158
158
  const allowBlank= !['like', 'eq'].includes(operator);
159
- return this.factory.getFields(type, {booleanLabels, listData, useCombo, allowBlank});
159
+ return this.factory.getFields(
160
+ type,
161
+ {
162
+ booleanLabels,
163
+ listData,
164
+ useCombo,
165
+ allowBlank,
166
+ dataIndex: this.filter.dataIndex,
167
+ }
168
+ );
160
169
  },
161
170
 
162
171
  isValid() {
package/src/version.js CHANGED
@@ -1,4 +1,4 @@
1
1
  Ext.define('Coon.version', {
2
2
  singleton: true,
3
- number: '3.0.72',
3
+ number: '3.0.74',
4
4
  });