ru.coon 3.0.78 → 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,6 +1,19 @@
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
+
1
13
  # Version 3.0.78, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/a6e988a302441a8caed1ca77948890a3d01926d2)
2
14
  * ## Fixes
3
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))
4
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))
5
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))
6
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))
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "name": "ru.coon"
5
5
  },
6
6
  "description": "",
7
- "version": "3.0.78",
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"
@@ -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
+
@@ -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.78',
3
+ number: '3.0.79',
4
4
  });