ru.coon 3.0.75 → 3.0.78

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,9 +1,33 @@
1
+ # Version 3.0.78, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/a6e988a302441a8caed1ca77948890a3d01926d2)
2
+ * ## Fixes
3
+ * <span style='color:red'> Добавление недостающих стилей, при формировании заголовка таблицы. Closes HT-10579.</span> ([2a5f88], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/2a5f88a201ed319f030164e13513458a09e0f2bf))
4
+ * <span style='color:red'>fix HT-15169: TriggerFieldEditorCreator set window title</span> ([d55115], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/d55115c1684ecc8ad9e9689fc1216c22100ac076))
5
+ * <span style='color:red'>fix HT-15169: TriggerFieldEditorCreator set window title</span> ([3bc707], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/3bc707c3aab9349482572c15e4f243a7ad97687d))
6
+ * <span style='color:red'>fix HT-15169: CharacteristicGridEditor delete value</span> ([99e05a], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/99e05a21822c48dce600109db56481baff030783))
7
+
8
+ * update: CHANGELOG.md ([b9fef7], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/b9fef7414d9705114190b9f24db27727cd4d3d3b))
9
+
10
+ # Version 3.0.77, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/d15ddab76fd455fb8b9b82cbff864158bbf9a462)
11
+ * ## Features
12
+ * <span style='color:green'>feat: move new tab after current</span> ([775c5f], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/775c5fd4ffc07e70db7b3524c260410448b21d4a))
13
+
14
+ * update: CHANGELOG.md ([ee60b0], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/ee60b048f763cbf3d45439a54fbab4c370bb954f))
15
+
16
+ # Version 3.0.76, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/fcaeb8313f0e64d8f380e69efed2665ba4b4a6d6)
17
+ * ## Fixes
18
+ * <span style='color:red'>fix HT-15169: TriggerFieldEditorCreator remove value</span> ([c492c3], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/c492c3662b15701fcbe78bda2d62412373e7c91a))
19
+
20
+ * update: CHANGELOG.md ([640dc5], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/640dc51e5601eba349bc14c91ec0641c4a8d1d86))
21
+
1
22
  # Version 3.0.75, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/bca8dfcc721f5bf5f9150e54f382e6224565f427)
2
23
  * ## Fixes
24
+ * <span style='color:red'>fix HT-15169: CharacteristicGridEditor delete value</span> ([c2a6be], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/c2a6be72637a265ca2d368c68f4d16c31c2f6456))
25
+ * <span style='color:red'>fix HT-15169: TriggerFieldEditorCreator remove value</span> ([dd3606], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/dd3606934e4acefe54956f835da038afc4b887b7))
3
26
  * <span style='color:red'> исправление в PeriodPickerPlugin сообщений minText и maxText</span> ([552b34], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/552b3430b8535edf87c420f54cc16f8d5dc03011))
4
27
 
5
28
  * HT-14725: исправление работы BindCustomPanelPlugin ([26547e], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/26547e340cec89c0019b98ddf5c3ecd6a8b24438))
6
29
  * HT-14681 исправление ошибки редактирования характеристик ([bb5a7a], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/bb5a7acab1af722623ef497234221bd3762a7b50))
30
+ * HT-15077 В отчете убран scroll в начало при событии afterlayout. ([fb6b97], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/fb6b975dd1bdd2352e3523db862af420aa34eea4))
7
31
  * HT-15218: исправление ошибки формирования itemId ([b233ed], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/b233ed8ba44305ca10acc8a1062573bbe7250124))
8
32
  * update: CHANGELOG.md ([c0892b], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/c0892bd2441c94e5168773b008a262b28a31b39d))
9
33
 
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "name": "ru.coon"
5
5
  },
6
6
  "description": "",
7
- "version": "3.0.75",
7
+ "version": "3.0.78",
8
8
  "repository": {
9
9
  "type": "git",
10
10
  "url": "git+http://gitlab-dbr.sigma-it.local/dbr/ru.coon"
@@ -122,12 +122,14 @@ Ext.define('Coon.app.viewPort.CenterView', {
122
122
  if (isComponentExist) {
123
123
  return this.setActiveTab(isComponentExist);
124
124
  }
125
+
126
+ this.add(component);
127
+
125
128
  if (previousView) {
126
129
  component.prevComponentContextId = previousView.componentContextId;
130
+ this.moveAfter(component, previousView);
127
131
  }
128
132
 
129
- this.add(component);
130
-
131
133
  component.on('titlechange', function(_, title) {
132
134
  title = title || Coon.format.withHint('', 'заголовок не задан');
133
135
  if (typeof title !== 'string') {
@@ -21,7 +21,6 @@ Ext.define('Coon.common.component.editor.TypedCharacteristicEditor', {
21
21
  twoWayBindable: ['context'],
22
22
 
23
23
  initComponent: function() {
24
- const ns = Coon.report.model.CharacteristicBeanFields;
25
24
  this.tbarItems = this.tbarItems || [];
26
25
 
27
26
  this.createAdditionButtons();
@@ -61,9 +60,13 @@ Ext.define('Coon.common.component.editor.TypedCharacteristicEditor', {
61
60
  buttons.del.disable();
62
61
  } else {
63
62
  if (select) {
64
- if (this.getSelection()[0].get(ns.$required)) {
63
+ const isDeletableChar = this.isDeletableChar(this.getSelection()[0]);
64
+ if (!isDeletableChar) {
65
65
  buttons.del.disable();
66
66
  }
67
+ const delButtonText = isDeletableChar === 'allowDeleteValue' ? 'Удалить значение' :
68
+ isDeletableChar === 'allowDeleteChar' ? 'Удалить характеристику' : 'Удалить';
69
+ buttons.del.setText(delButtonText);
67
70
  } else {
68
71
  buttons.del.disable();
69
72
  }
@@ -96,6 +99,16 @@ Ext.define('Coon.common.component.editor.TypedCharacteristicEditor', {
96
99
  this.on('cellclick', this.cellclickHandler, this);
97
100
  },
98
101
 
102
+ isDeletableChar: function(char) {
103
+ if (char.get('required') && char.get('allowEmpty') && char.get('value') && char.get('value').trim()) {
104
+ return 'allowDeleteValue';
105
+ } else if (!char.get('required')) {
106
+ return 'allowDeleteChar';
107
+ } else {
108
+ return false;
109
+ }
110
+ },
111
+
99
112
  createAdditionButtons: function() {
100
113
  const ns = Coon.report.model.CharacteristicBeanFields;
101
114
 
@@ -364,6 +377,10 @@ Ext.define('Coon.common.component.editor.TypedCharacteristicEditor', {
364
377
  record.set(ns.$isDeleted, !currentIsDeleted);
365
378
  }
366
379
  }
380
+ if (record && (record.get(ns.$editable) || record.isNew) && this.isDeletableChar(record) === 'allowDeleteValue') {
381
+ record.set(ns.$value, ' ');
382
+ record.set(ns.$valueDescription, ' ');
383
+ }
367
384
  this.getView().refresh();
368
385
  },
369
386
 
@@ -46,6 +46,9 @@ Ext.define('Coon.common.component.editor.creators.TriggerFieldEditorCreator', {
46
46
  const props = this.parseMask(record.get(ns.$mask).trim());
47
47
  this.value = record.get(ns.$value);
48
48
 
49
+ const effectiveValue = !record.get('isDeleted') && (!!(record.get('valueDescription') && record.get('valueDescription').trim()) ?
50
+ record.get('valueDescription') : record.get('value'));
51
+
49
52
  const panel = Ext.create({
50
53
  xtype: 'ReportPanel',
51
54
  autoFilter: true,
@@ -53,12 +56,46 @@ Ext.define('Coon.common.component.editor.creators.TriggerFieldEditorCreator', {
53
56
  });
54
57
 
55
58
  const win = Ext.widget('WindowWrap', {
56
- items: panel,
59
+ title: 'Редактирование характеристики '+ record.get('typeDescription'),
60
+ layout: {
61
+ type: 'vbox',
62
+ },
63
+ margin: 5,
64
+ items: [
65
+ {
66
+ xtype: 'container',
67
+ flex: 1,
68
+ layout: {
69
+ type: 'hbox',
70
+ align: 'stretch',
71
+ },
72
+ hidden: !effectiveValue,
73
+ margin: 5,
74
+ items: [
75
+ {
76
+ xtype: 'displayfield',
77
+ value: 'Значение характеристики:',
78
+ fieldStyle: {
79
+ fontSize: '14px',
80
+ color: '#a9a9a9',
81
+ },
82
+ },
83
+ {
84
+ xtype: 'displayfield',
85
+ flex: 1,
86
+ value: effectiveValue,
87
+ fieldStyle: {
88
+ fontSize: '14px',
89
+ },
90
+ }
91
+ ],
92
+ },
93
+ panel],
57
94
  });
58
95
  if (props) {
59
96
  const parameter = {};
60
97
  parameter[props.parameterName] = this.field.ID;
61
- win.doInit(props.reportId, Object.assign(parameter, this.context), true);
98
+ panel.doInit(props.reportId, Object.assign(parameter, this.context), true);
62
99
  } else {
63
100
  Coon.log.error('Не задана маска характеристики');
64
101
  }
@@ -125,6 +162,7 @@ Ext.define('Coon.common.component.editor.creators.TriggerFieldEditorCreator', {
125
162
 
126
163
  result.valueColumn = arr.length > ind ? arr[ind++] : result.parameterName;
127
164
  result.descriptionColumn = arr.length > ind ? arr[ind++] : result.valueColumn;
165
+ result.allowDeleteValue = arr.length > ind ? arr[ind++] : result.descriptionColumn;
128
166
  } else {
129
167
  Coon.log.error('Неверно задана маска характеристики');
130
168
  }
@@ -438,24 +438,11 @@ Ext.define('Coon.report.component.ReportPanel', {
438
438
  }
439
439
  }
440
440
 
441
- this.eventDestroier = Ext.on('rezise', this.onWindowResize, this);
441
+ Ext.on('rezise', this.onWindowResize, this);
442
442
  this.onWindowResize(Ext.Element.getViewportWidth(), Ext.Element.getViewportHeight());
443
443
  this.on('afterrender', function() {
444
444
  this.el && this.el.dom && this.el.dom.setAttribute('data-report', this.r_id || this.reportId);
445
445
  }, this);
446
- this.on('afterlayout', function() {
447
- if (!this.grid || this.grid.destroyed) {
448
- return;
449
- }
450
- setTimeout(function() {
451
- if (!this.grid || this.grid.destroyed) {
452
- return;
453
- }
454
- if (this.grid.viewConfig) {
455
- this.grid.scrollTo(0, 0);
456
- }
457
- }.bind(this), 500);
458
- }, this);
459
446
  this.on('invalidateCache', this.filterHandler.bind(this, true));
460
447
  },
461
448
 
@@ -7,8 +7,6 @@ Ext.define('Coon.report.plugin.grid.exporters.xlsxExporter', {
7
7
  },
8
8
 
9
9
  getExporter(filename) {
10
- // Coon.perf.clearAll();
11
- // const stopMeasure = Coon.perf.start('getExporter', true);
12
10
  const exporter = Ext.create('Ext.exporter.excel.Xlsx', {
13
11
  fileName: filename + '.xlsx',
14
12
  tableHeaderStyle: this.tableHeaderStyle,
@@ -28,15 +26,38 @@ Ext.define('Coon.report.plugin.grid.exporters.xlsxExporter', {
28
26
  const {headerRows, dataRows, footerRows} =
29
27
  this.collectGridDataAsObject(this.getSelected(), exporter.excel);
30
28
  const tableHeaderRows = this.getTableHeaderRows(exporter);
29
+ this.mergeDown(tableHeaderRows);
30
+ this.mergeAcross(tableHeaderRows);
31
31
  const summaryRows = this.getSummaryRows(exporter.excel);
32
32
  exporter.jsonData = [...headerRows, ...tableHeaderRows, ...dataRows, ...summaryRows, ...footerRows];
33
33
  exporter.getContent = this.getContent.bind(exporter, this);
34
- // Coon.log.debug(
35
- // Coon.perf.getLog(stopMeasure())
36
- // );
37
34
  return exporter;
38
35
  },
39
36
 
37
+ mergeDown(rows = []) {
38
+ rows.forEach((row, rowIndex) => {
39
+ row.forEach(({index, mergeDown, styleId}) => {
40
+ if (typeof mergeDown === 'number') {
41
+ for (let i = rowIndex + mergeDown; i > rowIndex; i--) {
42
+ rows[i].splice(index - 1, 0, {styleId, index});
43
+ }
44
+ }
45
+ });
46
+ });
47
+ },
48
+
49
+ mergeAcross(rows = []) {
50
+ rows.forEach((row) => {
51
+ row.forEach(({index, mergeAcross, styleId}, cellIndex) => {
52
+ if (typeof mergeAcross === 'number') {
53
+ for (let i = mergeAcross; i > 0; i--) {
54
+ row.splice(cellIndex + 1, 0, {styleId, index: index + i});
55
+ }
56
+ }
57
+ });
58
+ });
59
+ },
60
+
40
61
  getContent: function() {
41
62
  const me = this;
42
63
  const config = this.getConfig();
@@ -116,16 +137,6 @@ Ext.define('Coon.report.plugin.grid.exporters.xlsxExporter', {
116
137
  if (this.plugin.footerXlsx) {
117
138
  footerRows = this.parseJsEditorObj(this.plugin.footerXlsx, workbook);
118
139
  }
119
- // Coon.log.debug(
120
- // Coon.perf.getLog(stopMeasure())
121
- // );
122
- // Coon.log.debug(
123
- // Coon.perf.getLog('mergeDeep', 6)
124
- // );
125
- // Coon.log.debug(
126
- // Coon.perf.getLog('collectColumns', 5)
127
- // );
128
-
129
140
  return {headerRows, dataRows, footerRows};
130
141
  },
131
142
 
package/src/version.js CHANGED
@@ -1,4 +1,4 @@
1
1
  Ext.define('Coon.version', {
2
2
  singleton: true,
3
- number: '3.0.75',
3
+ number: '3.0.78',
4
4
  });