ru.coon 3.0.77 → 3.0.79

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,25 @@
1
+ # Version 3.0.79, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/05cc0396686f91876a09be0e05bed80d6e3591a8)
2
+ * ## Fixes
3
+ * <span style='color:red'> HT-13828 upd</span> ([54a357], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/54a357933afc6b44569625816ad724d56053c012))
4
+ * <span style='color:red'> HT-13828 upd</span> ([7f75df], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/7f75df96aaa27d9563b63117c27e84fc01671624))
5
+ * <span style='color:red'> HT-13828 ReportFormData/getCSVReport</span> ([bb3a16], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/bb3a1642daeb9ee52bdfb1726f3245b8669fd1a8))
6
+
7
+ * refactoring ([5f3f72], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/5f3f72e58a8b60e83f60a682162e3a7a15ba4e4e))
8
+ * ([Update], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/Update file OpenPanelPlugin.jsa547ab1288c887b0c3c9405d86fc8f6afd7de2c3))
9
+ * upd ([85ffb7], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/85ffb7997e465b3618f903f321b056fe87304126))
10
+ * upd ([0dca21], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/0dca21517a5c8dfc0f607c6050c7e6191e2f5421))
11
+ * update: CHANGELOG.md ([8a9562], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/8a9562a11c8d0b93f21c7a3f2954a45dcb381e7d))
12
+
13
+ # Version 3.0.78, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/a6e988a302441a8caed1ca77948890a3d01926d2)
14
+ * ## Fixes
15
+ * <span style='color:red'> Добавление недостающих стилей, при формировании заголовка таблицы. Closes HT-10579.</span> ([2a5f88], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/2a5f88a201ed319f030164e13513458a09e0f2bf))
16
+ * <span style='color:red'> HT-13828 ReportFormData/getCSVReport</span> ([b10fd7], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/b10fd76a565c5393cca7fb91d77420ce253b80c3))
17
+ * <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))
18
+ * <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))
19
+ * <span style='color:red'>fix HT-15169: CharacteristicGridEditor delete value</span> ([99e05a], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/99e05a21822c48dce600109db56481baff030783))
20
+
21
+ * update: CHANGELOG.md ([b9fef7], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/b9fef7414d9705114190b9f24db27727cd4d3d3b))
22
+
1
23
  # Version 3.0.77, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/d15ddab76fd455fb8b9b82cbff864158bbf9a462)
2
24
  * ## Features
3
25
  * <span style='color:green'>feat: move new tab after current</span> ([775c5f], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/775c5fd4ffc07e70db7b3524c260410448b21d4a))
@@ -5,10 +27,15 @@
5
27
  * update: CHANGELOG.md ([ee60b0], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/ee60b048f763cbf3d45439a54fbab4c370bb954f))
6
28
 
7
29
  # Version 3.0.76, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/fcaeb8313f0e64d8f380e69efed2665ba4b4a6d6)
30
+ * ## Fixes
31
+ * <span style='color:red'>fix HT-15169: TriggerFieldEditorCreator remove value</span> ([c492c3], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/c492c3662b15701fcbe78bda2d62412373e7c91a))
32
+
8
33
  * update: CHANGELOG.md ([640dc5], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/640dc51e5601eba349bc14c91ec0641c4a8d1d86))
9
34
 
10
35
  # Version 3.0.75, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/bca8dfcc721f5bf5f9150e54f382e6224565f427)
11
36
  * ## Fixes
37
+ * <span style='color:red'>fix HT-15169: CharacteristicGridEditor delete value</span> ([c2a6be], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/c2a6be72637a265ca2d368c68f4d16c31c2f6456))
38
+ * <span style='color:red'>fix HT-15169: TriggerFieldEditorCreator remove value</span> ([dd3606], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/dd3606934e4acefe54956f835da038afc4b887b7))
12
39
  * <span style='color:red'> исправление в PeriodPickerPlugin сообщений minText и maxText</span> ([552b34], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/552b3430b8535edf87c420f54cc16f8d5dc03011))
13
40
 
14
41
  * HT-14725: исправление работы BindCustomPanelPlugin ([26547e], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/26547e340cec89c0019b98ddf5c3ecd6a8b24438))
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "name": "ru.coon"
5
5
  },
6
6
  "description": "",
7
- "version": "3.0.77",
7
+ "version": "3.0.79",
8
8
  "repository": {
9
9
  "type": "git",
10
10
  "url": "git+http://gitlab-dbr.sigma-it.local/dbr/ru.coon"
@@ -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
  }
@@ -120,6 +120,32 @@ Ext.define('Coon.report.plugin.configPanel.ExportReportDataToFilePluginConfigPan
120
120
  displayField: 'name',
121
121
  valueField: 'id',
122
122
  name: 'exportFileFormat',
123
+ listeners: {
124
+ change: function(_, value) {
125
+ const isCsvOrTxtFormat = value === 'csv' || value === 'txt';
126
+ this.down('[name=charsetOption]').setHidden(!isCsvOrTxtFormat);
127
+ this.down('[name=exportWithHeaders]').setHidden(!isCsvOrTxtFormat);
128
+ },
129
+ scope: this,
130
+ },
131
+ },
132
+ {
133
+ xtype: 'radiogroup',
134
+ fieldLabel: 'Кодировка',
135
+ hidden: true,
136
+ simpleValue: true,
137
+ vertical: true,
138
+ name: 'charsetOption',
139
+ items: [
140
+ {boxLabel: 'UTF-8', inputValue: 'utf-8', checked: true},
141
+ {boxLabel: 'windows-1251', inputValue: 'windows-1251'}
142
+ ],
143
+ },
144
+ {
145
+ xtype: 'checkbox',
146
+ hidden: true,
147
+ boxLabel: 'exportWithHeaders',
148
+ name: 'exportWithHeaders',
123
149
  },
124
150
  {
125
151
  xtype: 'container',
@@ -13,6 +13,8 @@ Ext.define('Coon.report.plugin.grid.ExportReportDataToFilePlugin', {
13
13
  allowUserSelectColumnsToUpload: undefined,
14
14
  addToSearchButton: false,
15
15
  countHours: 1,
16
+ charsetOption: 'utf-8',
17
+ exportWithHeaders: false,
16
18
  },
17
19
  exportConfig: {},
18
20
  defaultDateFormat: 'Y-m-d_h-i',
@@ -23,7 +25,6 @@ Ext.define('Coon.report.plugin.grid.ExportReportDataToFilePlugin', {
23
25
  this.callParent(arguments);
24
26
  },
25
27
 
26
-
27
28
  createToolbarItem: function(config) {
28
29
  const tbItem = this.callParent([config]);
29
30
  tbItem.exportFileFormat = this.exportFileFormat;
@@ -34,6 +35,9 @@ Ext.define('Coon.report.plugin.grid.ExportReportDataToFilePlugin', {
34
35
  this.callParent([grid]);
35
36
  this.grid = grid;
36
37
  const format = this.config.exportFileFormat;
38
+
39
+ this.setupCharsetConfig();
40
+
37
41
  this.buttonText = this.buttonText || (format && 'Экспорт в ' + format);
38
42
  grid.on('render', function() {
39
43
  this.report = grid.findParentByType('ReportPanel');
@@ -54,6 +58,15 @@ Ext.define('Coon.report.plugin.grid.ExportReportDataToFilePlugin', {
54
58
  }, this);
55
59
  this.printPdfCommand = Ext.create('command.GetPdfReportDataCommand', {useRawFilterParams: this.getAddToSearchButton()});
56
60
  },
61
+
62
+ setupCharsetConfig() {
63
+ this.config.charsetOption = this.config.charsetOption || 'utf-8';
64
+
65
+ if (this.config.charsetOption.toLowerCase().startsWith('utf')) {
66
+ this.config.insertBOM = '\uFEFF';
67
+ }
68
+ },
69
+
57
70
  callExportByType() {
58
71
  switch (this.config.exportFileFormat) {
59
72
  case 'pdf':
@@ -70,6 +83,7 @@ Ext.define('Coon.report.plugin.grid.ExportReportDataToFilePlugin', {
70
83
  break;
71
84
  }
72
85
  },
86
+
73
87
  handler: function() {
74
88
  if (this.config.allowUserSelectColumnsToUpload) {
75
89
  this.showPanel();
@@ -186,6 +200,7 @@ Ext.define('Coon.report.plugin.grid.ExportReportDataToFilePlugin', {
186
200
  this.config.cmp.timeout :
187
201
  (this.getCountHours() * this.defaultTimeout);
188
202
  },
203
+
189
204
  printCsvFile: async function(extension) {
190
205
  this.grid.mask('подождите пожалуйста...');
191
206
  const currentParamList = this.getAddToSearchButton() ? this.report.northPanel.collectParams() : this.report.currentParamList;
@@ -208,17 +223,23 @@ Ext.define('Coon.report.plugin.grid.ExportReportDataToFilePlugin', {
208
223
  toExcel: JSON.stringify(this.config.toExcel),
209
224
  separator: ';',
210
225
  border: '',
226
+ exportWithHeaders: JSON.stringify(this.config.exportWithHeaders),
227
+ charset: this.config.charsetOption,
211
228
  }, this.exportConfig);
212
229
  Ext.Ajax.request({
213
230
  url,
214
231
  method: 'POST',
215
232
  binary: true,
233
+ headers: {
234
+ 'Content-Type': `application/x-www-form-urlencoded;charset=${this.config.charsetOption}`,
235
+ },
216
236
  timeout: this.getTimeout(),
217
237
  params: params,
218
238
  success(response) {
239
+ const blobParts = this.config.insertBOM ? [this.config.insertBOM, response.responseBytes] : [response.responseBytes];
219
240
  this.grid.unmask();
220
241
  Coon.util.downloadFileFromBlob(
221
- new Blob(['\uFEFF', response.responseBytes], {type: 'text/csv;charset=utf-8'}),
242
+ new Blob(blobParts, {type: `text/csv;charset=${this.config.charsetOption}`}),
222
243
  `${this.fileName}.${extension}`
223
244
  );
224
245
  },
@@ -230,6 +251,7 @@ Ext.define('Coon.report.plugin.grid.ExportReportDataToFilePlugin', {
230
251
  scope: this,
231
252
  });
232
253
  },
254
+
233
255
  printExcelFile: async function() {
234
256
  this.grid.mask('подождите пожалуйста...');
235
257
  const currentParamList = this.getAddToSearchButton() ? this.report.northPanel.collectParams() : this.report.currentParamList;
@@ -275,3 +297,4 @@ Ext.define('Coon.report.plugin.grid.ExportReportDataToFilePlugin', {
275
297
  });
276
298
  },
277
299
  });
300
+
@@ -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
 
@@ -90,8 +90,8 @@ Ext.define('Coon.uielement.plugin.OpenPanelPlugin', {
90
90
  this.centerView.setActiveComponent({componentContextId});
91
91
  return;
92
92
  }
93
- console.log('OPP.panel', panel);
94
93
  this.centerView.setActiveComponent(panel);
94
+ this.addPanelEventListeners(panel);
95
95
  Coon.Function.executeComponentDoInit(panel, this.initArguments);
96
96
  panel.setClosable(true);
97
97
  panel.on('afterlayout', function(panel) {
@@ -129,17 +129,23 @@ Ext.define('Coon.uielement.plugin.OpenPanelPlugin', {
129
129
  Coon.Function.executeComponentDoInit(panel, this.initArguments);
130
130
  }, this);
131
131
 
132
- if (!Ext.isEmpty(this.panelEventListeners)) {
133
- for (const eventName in this.panelEventListeners) {
134
- if (this.panelEventListeners.hasOwnProperty(eventName)) {
135
- panel.on(eventName, this.view.getController()[this.panelEventListeners[eventName]], this.view);
136
- }
137
- }
138
- }
132
+ this.addPanelEventListeners(panel);
139
133
 
140
134
  openWindow.show();
141
135
  },
142
136
 
137
+ addPanelEventListeners(panel) {
138
+ Object.entries(
139
+ this.panelEventListeners || {}
140
+ )
141
+ .forEach(([eventName, handlerName]) => {
142
+ const handler = this.view.getController()[handlerName];
143
+ if (typeof handler === 'function') {
144
+ panel.on(eventName, handler, this.view);
145
+ }
146
+ });
147
+ },
148
+
143
149
  setInitArguments() {
144
150
  this.initArguments = {};
145
151
  for (const name in this.parameters) {
package/src/version.js CHANGED
@@ -1,4 +1,4 @@
1
1
  Ext.define('Coon.version', {
2
2
  singleton: true,
3
- number: '3.0.77',
3
+ number: '3.0.79',
4
4
  });