ru.coon 2.5.21 → 2.5.22

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/CHANGELOG.md CHANGED
@@ -1,3 +1,12 @@
1
+ # Version 2.5.22, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/a5adcd5f65e1a51dab152558c6fb72efe4b97893)
2
+ * ## Fixes
3
+ * <span style='color:red'>fix ReportLookupCompo.loadReportData
4
+
5
+ isolate lastValue from native ComboBox logic</span> ([57078e], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/57078efccd71e7c21830ec9b7abf055e3d09f71e))
6
+ * <span style='color:red'> HT-6314 fix focus</span> ([e9009a], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/e9009a55da073196bf1bd8c4b3fabff263831bf7))
7
+
8
+ * update: CHANGELOG.md ([473997], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/4739978f7ebb8564b5b233c496ce9c98d977c1c6))
9
+
1
10
  # Version 2.5.21, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/dc202083a949169e0203fa47bf2defa312201a33)
2
11
  * update: CHANGELOG.md ([e1a4d6], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/e1a4d65ec93284adeab64eb21ab51e737c229df7))
3
12
 
@@ -17,6 +26,9 @@
17
26
 
18
27
  fix ReportLookupCombo autoLoadData after destroy component
19
28
  fix ReportPropertiesPanelController</span> ([e2b928], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/e2b928b1eddc58f46657ce79297ea2dbb2cae1ce))
29
+ * <span style='color:red'> HT-6314 change icon and master widget style</span> ([fff9b6], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/fff9b6c8d6652addfac024b21bd03d01f86623f7))
30
+ * <span style='color:red'> HT-6314 change icon and master widget style</span> ([ac9da8], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/ac9da82d4f00015e52da554cb985b4f2bdf2a1fe))
31
+ * <span style='color:red'> HT-6314 change icon and master widget style</span> ([6b03cc], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/6b03ccc5600c2d757b811bad43b790a85633d844))
20
32
 
21
33
  * update: CHANGELOG.md ([ff88bb], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/ff88bb739914adacf1bbfa5284b31f603e480795))
22
34
 
@@ -214,8 +226,12 @@ ReportSqlPreviewPanel - add UiAceEditor as sql preview field(readOnly) with sql
214
226
  * update: CHANGELOG.md ([cab0be], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/cab0beabbbe9e1ada4ccea28763253c0e5feb839))
215
227
 
216
228
  # Version 2.4.41, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/95627ef5983aa5f2fd5eaf8bd4b808ba169a48fb)
229
+ * ## Features
230
+ * <span style='color:green'>feat: HT-6314 Изменение отображения CharacteristicGridCopyPlugin</span> ([5fa321], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/5fa3214c6e395bc66804a7acc7fe062780da1dfd))
231
+
217
232
  * add no-console rule to eslint rules ([aa512d], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/aa512db0fb0165af39481718d010c9748c5cebb5))
218
233
  * ([Update], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/Update src/report/component/ReportPanel.js, src/nav/AppNavigationMenuController.js504a591e823ee40141ebbcd443fef8dc6e952cef))
234
+ * HT-6314 Изменение отображения CharacteristicGridCopyPlugin ([a1e5bc], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/a1e5bc00b8072b3171d5fbddbca78af02f3f17bd))
219
235
  * update: CHANGELOG.md ([e66ddf], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/e66ddf82f691185bdb8023ccee37fcf4871c8b32))
220
236
 
221
237
  # Version 2.4.40, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/f49f8f4d8bfe24a5b6d47119585931d85dc03e33)
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "name": "ru.coon"
5
5
  },
6
6
  "description": "",
7
- "version": "2.5.21",
7
+ "version": "2.5.22",
8
8
  "repository": {
9
9
  "type": "git",
10
10
  "url": "git+http://gitlab-dbr.sigma-it.local/dbr/ru.coon"
@@ -3,9 +3,8 @@ Ext.define('Coon.common.component.editor.CharacteristicGridCopyPlugin', {
3
3
  alias: 'plugin.CharacteristicGridCopyPlugin',
4
4
  copyConfig: {},
5
5
  icons: {
6
- copy: 'x-fa fa-copy',
7
- paste: 'x-fa fa-paste',
8
- cancel: 'x-fa fa-cancel',
6
+ slave: 'x-fa fa-copy',
7
+ master: 'x-fa fa-paste',
9
8
  },
10
9
 
11
10
  constructor(config) {
@@ -17,7 +16,7 @@ Ext.define('Coon.common.component.editor.CharacteristicGridCopyPlugin', {
17
16
  this.component = editor;
18
17
  if (typeof this.copyConfig === 'object') {
19
18
  this.slaveConfig = Object.entries(this.copyConfig).reduce((acc, configEl) => {
20
- configEl.length && configEl.pop().map((el) => acc[el] = ''+configEl);
19
+ configEl.length && configEl.pop().map((el) => acc[el] = '' + configEl);
21
20
  return acc;
22
21
  }, {});
23
22
  }
@@ -32,31 +31,31 @@ Ext.define('Coon.common.component.editor.CharacteristicGridCopyPlugin', {
32
31
 
33
32
  createWidgetColumn() {
34
33
  const me = this;
34
+ me.masterWidgets = [];
35
+
36
+ this.component.getView().grid.getEl().down('[class="x-grid-item-container"]').addCls('CharacteristicGridCopyPlugin');
35
37
  const widgetColumn = Ext.create('Ext.grid.column.Widget', {
38
+ widget: {xtype: 'button', hidden: true, padding: '6px 16px 6px 16px'},
36
39
  width: 50,
37
40
  onWidgetAttach: function(col, widget, record) {
38
41
  me.clearWidgetState(widget);
39
42
  const type = record.get('type').trim();
43
+
40
44
  if (me.copyConfig[type]) {
41
- widget.setHidden(me.component.readMode);
42
- widget.setDisabled(false);
43
- widget.setIconCls(me.icons.copy);
44
- widget.on('click', me.onCopyWidget, me);
45
- me.component.on(type, me.setStateWidget, me, widget);
45
+ me.masterWidgets.push(widget);
46
+ widget.setIconCls(me.icons.master);
46
47
  return;
47
48
  }
49
+
48
50
  if (me.slaveConfig[type]) {
49
51
  widget.setHidden(me.component.readMode);
50
- widget.setIconCls(me.icons.paste);
51
- widget.setDisabled(true);
52
- widget.on('click', me.onPasteWidget, me);
53
- me.component.on(me.slaveConfig[type], me.setDisabledWidget, me, widget);
52
+ widget.setDisabled(me.component.readMode);
53
+ widget.setIconCls(me.icons.slave);
54
+ widget.on('click', me.onPasteWidget, me, {args: [widget, type]});
55
+ widget.on('mouseover', me.showSlaveIcon, me, {args: [type, false, me.masterWidgets]});
56
+ widget.on('mouseout', me.showSlaveIcon, me, {args: [type, true, me.masterWidgets]});
54
57
  }
55
58
  },
56
- widget: {
57
- xtype: 'button',
58
- hidden: true,
59
- },
60
59
  });
61
60
  const columns = this.component.getColumns().map((el) => el.initialConfig);
62
61
  columns.push(widgetColumn);
@@ -65,41 +64,27 @@ Ext.define('Coon.common.component.editor.CharacteristicGridCopyPlugin', {
65
64
 
66
65
  clearWidgetState(widget) {
67
66
  widget.setIconCls('');
68
- const type = widget.getWidgetRecord().get('type').trim();
69
- this.component.removeListener(type, this.setDisabledWidget, this, widget);
70
- this.component.removeListener(type, this.setStateWidget, this, widget);
71
- widget.removeListener('click', this.onCopyWidget, this);
67
+ widget.setDisabled(true);
68
+ widget.setHidden(true);
72
69
  widget.removeListener('click', this.onPasteWidget, this);
70
+ widget.removeListener('mouseover', this.showSlaveIcon, this);
71
+ widget.removeListener('mouseout', this.showSlaveIcon, this);
73
72
  },
74
73
 
75
- setDisabledWidget(widget) {
76
- widget.setDisabled(!widget.disabled);
74
+ showSlaveIcon(type, hideMasterIcon, masterWidgets) {
75
+ masterWidgets.find((widget) => widget.getWidgetRecord().get('type').trim() === this.slaveConfig[type]).setHidden(hideMasterIcon);
77
76
  },
78
77
 
79
- setStateWidget(widget) {
80
- if (this.state === 'cancel') {
81
- this.state = 'copy';
82
- this.masterRecord = {};
83
- } else {
84
- this.state = 'cancel';
85
- this.masterRecord = widget.getWidgetRecord();
86
- }
87
- widget.setIconCls(this.icons[this.state]);
88
- },
78
+ onPasteWidget(widget, type) {
79
+ const masterWidget = this.masterWidgets.find((widget) => widget.getWidgetRecord().get('type').trim() === this.slaveConfig[type]);
80
+ const masterRecord = masterWidget && masterWidget.getWidgetRecord();
81
+ const slaveRecord = widget.getWidgetRecord();
89
82
 
90
- onCopyWidget(widget) {
91
- const type = widget.getWidgetRecord().get('type').trim();
92
- this.component.fireEvent(type);
93
- },
94
-
95
- onPasteWidget(widget) {
96
- const record = widget.getWidgetRecord();
97
- const type = record.get('type').trim();
98
- if (!this.masterRecord) {
83
+ if (!masterRecord) {
99
84
  return;
100
85
  }
101
- record.set('value', this.masterRecord.get('value'));
102
- record.set('valueDescription', this.masterRecord.get('valueDescription') || '');
103
- this.component.fireEvent(this.slaveConfig[type]);
86
+
87
+ slaveRecord.set('value', masterRecord.get('value'));
88
+ slaveRecord.set('valueDescription', masterRecord.get('valueDescription') || '');
104
89
  },
105
90
  });
@@ -67,6 +67,8 @@ Ext.define('Coon.report.component.ReportLookupCombo', {
67
67
  },
68
68
  },
69
69
 
70
+ locals: {},
71
+
70
72
  initComponent() {
71
73
  if (!this.getDisplayField()) {
72
74
  Coon.log.error('displayField is empty!');
@@ -169,7 +171,7 @@ Ext.define('Coon.report.component.ReportLookupCombo', {
169
171
  * @param {string} value
170
172
  */
171
173
  loadReportData(value) {
172
- if (this.lastValue === value) {
174
+ if (value && this.locals.lastValue === value) {
173
175
  this.selectRecordByValue(value);
174
176
  return;
175
177
  }
@@ -191,7 +193,13 @@ Ext.define('Coon.report.component.ReportLookupCombo', {
191
193
  }
192
194
  if (result && Array.isArray(result.list)) {
193
195
  this.getStore().loadData(result.list);
194
- me.selectRecordByValue(value);
196
+ if (result.list[0]) {
197
+ this.locals.lastValue = value;
198
+ me.selectRecordByValue(value);
199
+ } else {
200
+ this.locals.lastValue = false;
201
+ me.clearComboValue();
202
+ }
195
203
  me.enable();
196
204
  }
197
205
  }).catch((error) => {
@@ -180,6 +180,9 @@ Ext.define('Coon.report.plugin.configPanel.ReportCharacteristicBindPluginConfig'
180
180
  this.callParent(arguments);
181
181
  this.displayFieldSet(config, this.getFieldSet(), 'addDate');
182
182
  this.setVisibleFields(config['type']);
183
+ if (config && config.copyGridRecords) {
184
+ this.copyGrid.getStore().loadData(config.copyGridRecords);
185
+ }
183
186
  },
184
187
 
185
188
  setVisibleFields: function(value) {
@@ -201,13 +204,33 @@ Ext.define('Coon.report.plugin.configPanel.ReportCharacteristicBindPluginConfig'
201
204
  getConfiguration: function() {
202
205
  const config = this.callParent(arguments);
203
206
  const fieldSet = this.getFieldSet();
207
+ const showCopyColumn = this.down('[name="showCopyColumn"]');
208
+
204
209
  if (!Ext.isEmpty(fieldSet)) {
205
210
  config['addDate'] = !fieldSet.collapsed;
206
211
  }
212
+
207
213
  config['defaultDate'] = this.defaultDateField.isVisible() ? config['defaultDate'] : undefined;
208
214
  config['dateFromField'] = this.dateFromField.isVisible() ? config['dateFromField'] : undefined;
209
215
  config['dateFromParam'] = this.dateFromParam.isVisible() ? config['dateFromParam'] : undefined;
210
216
  config['today'] = this.today || undefined;
217
+
218
+ if (showCopyColumn.getValue() === true) {
219
+ const copyConfig = {};
220
+ const copyGridRecords = Coon.Function.serializeRecords(this.copyGrid.getStore().getRange());
221
+ copyGridRecords.map((rec) => {
222
+ if (rec.master && rec.slave) {
223
+ try {
224
+ copyConfig[rec.master.trim()] = rec.slave.replaceAll(' ', '').split(',');
225
+ } catch (e) {
226
+ Coon.log.error(`${e}: Неверно указана конфигурация копирования!`);
227
+ }
228
+ }
229
+ });
230
+ config['copyConfig'] = copyConfig;
231
+ config['copyGridRecords'] = copyGridRecords;
232
+ }
233
+
211
234
  return config;
212
235
  },
213
236
 
@@ -377,30 +400,87 @@ Ext.define('Coon.report.plugin.configPanel.ReportCharacteristicBindPluginConfig'
377
400
  },
378
401
 
379
402
  createCopyFieldSet: function() {
403
+ const me = this;
404
+
405
+ this.copyGrid = Ext.create('Ext.grid.Panel', {
406
+ name: 'grid',
407
+ columns: {
408
+ items: [
409
+ {
410
+ xtype: 'hintColumn',
411
+ text: 'Родительские характеристика',
412
+ dataIndex: 'master',
413
+ width: 300,
414
+ editor: 'textfield',
415
+ },
416
+ {
417
+ xtype: 'hintColumn',
418
+ text: 'Зависимые характеристики',
419
+ dataIndex: 'slave',
420
+ width: 300,
421
+ editor: 'textfield',
422
+ }
423
+ ],
424
+ },
425
+ plugins: [{ptype: 'cellediting', clicksToEdit: 2}],
426
+ store: {},
427
+ dockedItems: [{
428
+ xtype: 'toolbar',
429
+ dock: 'top',
430
+ itemId: 'toptoolbar',
431
+ items: [
432
+ {
433
+ xtype: 'button',
434
+ text: 'Добавить',
435
+ reference: 'addButton',
436
+ ui: 'blue-text-button-border',
437
+ handler: function() {
438
+ const store = me.copyGrid.getStore();
439
+ store.add(store.model.create());
440
+ },
441
+ },
442
+ {
443
+ xtype: 'button',
444
+ text: 'Удалить',
445
+ reference: 'deleteBtn',
446
+ ui: 'blue-text-button-border',
447
+ handler: function(btn) {
448
+ const record = me.copyGrid.getSelectionModel().getSelection()[0];
449
+ if (record) {
450
+ me.copyGrid.getStore().remove(record);
451
+ }
452
+ },
453
+ }
454
+ ],
455
+ }],
456
+ });
457
+
380
458
  return {
381
459
  xtype: 'fieldset',
382
460
  defaults: {
383
461
  labelWidth: 130,
384
- width: 430,
385
462
  },
386
463
  name: 'showCopyColumnConfig',
387
464
  title: 'Копирование характеристик',
388
465
  checkboxName: 'showCopyColumn',
389
466
  checkboxToggle: true,
390
- collapsed: true,
467
+ collapsed: false,
391
468
  layout: {
392
469
  type: 'vbox',
393
470
  align: 'stretch',
394
471
  },
395
472
  items: [
396
473
  {
397
- xtype: 'textarea',
398
- fieldLabel: 'copyConfig',
399
- emptyText: `ожидается конфиг в формате: {"MASTER": ["COPY1", "COPY2"]}`,
400
- reference: 'copyConfigField',
401
- name: 'copyConfig',
402
- height: 200,
403
- }
474
+ xtype: 'container',
475
+ width: '100%',
476
+ html: `
477
+ <div style="font-size:12px;color:gray">
478
+ В левой колонке укажите родительскую характеристику<br>
479
+ В правой колонке укажите через запятую характеристики, в которые будет копироваться родительская характеристика.
480
+ </div>
481
+ `,
482
+ },
483
+ this.copyGrid
404
484
  ],
405
485
  };
406
486
  },
package/src/version.js CHANGED
@@ -1,4 +1,4 @@
1
1
  Ext.define('Coon.version', {
2
2
  singleton: true,
3
- number: '2.5.21',
3
+ number: '2.5.22',
4
4
  });