ru.coon 2.8.14 → 2.8.16

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,19 @@
1
+ # Version 2.8.16, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/87872e4d0fe6f6cdf23cc72721ec14721a15e7c8)
2
+ * update: CHANGELOG.md ([80dc33], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/80dc3360b47ddac2924e7d25d40873815511154a))
3
+
4
+ # Version 2.8.15, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/8243a899e863488223002046a50b6692d3af8fb5)
5
+ * ## Features
6
+ * <span style='color:green'>feat: HT-10125: remove tbfill when it has in items</span> ([f57798], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/f57798b08404721c6d13512b3be38771dc53ee30))
7
+ * <span style='color:green'>feat: HT-10125: remove tbfill when it has in items</span> ([3e9b04], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/3e9b04e719016aedab59ac8b889da93de0540715))
8
+ * <span style='color:green'>feat: HT-10008: refactor overrides styles code part</span> ([ffbcc9], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/ffbcc9fc179deba7c46fb1e158136cd32a5d4c3c))
9
+ * <span style='color:green'>feat: HT-8951: fix css</span> ([7ddd11], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/7ddd117e3ba365e1c2da3472ecd0efe180e1e204))
10
+ * <span style='color:green'>feat: HT-10485: apply tpl for xls and xlsx</span> ([eb4503], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/eb450352f7e5062d394f6b0f29eff84603c1511a))
11
+
12
+ * ## Fixes
13
+ * <span style='color:red'>fixes</span> ([77fb8d], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/77fb8de94f02156769b48092d91ea16a11f9aa94))
14
+
15
+ * update: CHANGELOG.md ([b6ceb3], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/b6ceb36854b9ae262d9dcf375f19695392da16ca))
16
+
1
17
  # Version 2.8.14, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/dcae10177e3289827d597b883c0e7be99ff45e98)
2
18
  * ## Fixes
3
19
  * <span style='color:red'>fix ClearFiltersButton visible status, HT-10125</span> ([689462], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/6894624e9d2cc0ba572308e2ac4c366a626432c8))
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "name": "ru.coon"
5
5
  },
6
6
  "description": "",
7
- "version": "2.8.14",
7
+ "version": "2.8.16",
8
8
  "repository": {
9
9
  "type": "git",
10
10
  "url": "git+http://gitlab-dbr.sigma-it.local/dbr/ru.coon"
@@ -493,13 +493,24 @@ Ext.define('Coon.report.component.ReportPanel', {
493
493
  },
494
494
 
495
495
  createTopToolbar(items) {
496
- return this.gridTopToolbar = Ext.create({
497
- xtype: 'toolbar', hidden: true, enableOverflow: true, items: [].concat(items || []).concat([{
496
+ const clearBlock = [];
497
+ if ((items && Ext.isArray(items) && !items.find((item) => {
498
+ if (Ext.isObject(item)) {
499
+ return item.xtype === 'tbfill';
500
+ } else {
501
+ return item === '->';
502
+ }
503
+ })) || !items) {
504
+ clearBlock.push({
498
505
  xtype: 'tbfill',
499
506
  position: 997,
500
- }, {
501
- xtype: 'ClearFiltersButton',
502
- }]),
507
+ });
508
+ }
509
+ clearBlock.push({
510
+ xtype: 'ClearFiltersButton',
511
+ });
512
+ return this.gridTopToolbar = Ext.create({
513
+ xtype: 'toolbar', hidden: true, enableOverflow: true, items: [].concat(items || []).concat(clearBlock),
503
514
  });
504
515
  },
505
516
  createBottomToolbar(items) {
@@ -205,14 +205,18 @@ Ext.define('Coon.report.plugin.grid.CopyRowsFromGrid', {
205
205
  return this.mergeDeep(target, ...sources);
206
206
  },
207
207
 
208
- applyTemplate(content) {
208
+ getCurrentFilterParameters() {
209
+ return this.component.up('ReportPanel').currentParamList || {};
210
+ },
211
+
212
+ applyTemplate(content = '', data = {}) {
209
213
  const tpl = new Ext.XTemplate(content, {
210
214
  disableFormats: true,
211
215
  date(format = 'd.m.Y') {
212
216
  return Ext.Date.format(new Date(), format);
213
217
  },
214
218
  });
215
- return tpl.apply({params: this.component.up('ReportPanel').currentParamList || {}});
219
+ return tpl.apply(Object.assign(data, {parameters: this.getCurrentFilterParameters()}));
216
220
  },
217
221
 
218
222
  parseJsEditorObj: function(obj, workbook) {
@@ -229,7 +233,7 @@ Ext.define('Coon.report.plugin.grid.CopyRowsFromGrid', {
229
233
  result.push(tr.reduce((accumulator, td) => {
230
234
  if (td.display === true) {
231
235
  const tmp = {
232
- 'value': this.applyTemplate(td.content.replace(/<br>/gi, '')),
236
+ 'value': td.content.replace(/&nbsp;|<br>/gi, ''),
233
237
  };
234
238
  if (td.colspan && td.colspan > 1) {
235
239
  tmp.mergeAcross = td.colspan - 1;
@@ -368,7 +372,6 @@ Ext.define('Coon.report.plugin.grid.CopyRowsFromGrid', {
368
372
  const dataRows = [];
369
373
  let headerRows = [];
370
374
  let footerRows = [];
371
- const dataForTemplate = this.getDataForTemplate();
372
375
  const grid = this.component;
373
376
  const columnModel = grid.getColumns();
374
377
  const columnCount = grid.getColumns().length;
@@ -382,10 +385,8 @@ Ext.define('Coon.report.plugin.grid.CopyRowsFromGrid', {
382
385
  }
383
386
  if (this.headerXlsx) {
384
387
  const headerXlsx = this.parseJsEditorObj(this.headerXlsx, workbook);
385
- const tmpl = new Ext.XTemplate(
386
- this.processingTemplate(JSON.stringify(headerXlsx))
387
- ).apply(dataForTemplate);
388
- headerRows = headerRows.concat(JSON.parse(tmpl));
388
+ const html = this.processingTemplate(JSON.stringify(headerXlsx));
389
+ headerRows = headerRows.concat(JSON.parse(this.applyTemplate(html, this.getDataForTemplate(html))));
389
390
  }
390
391
  const dataIndexToColumn = [];
391
392
  const visibleColumns = [];
@@ -418,10 +419,8 @@ Ext.define('Coon.report.plugin.grid.CopyRowsFromGrid', {
418
419
  }, this);
419
420
  if (this.footerXlsx) {
420
421
  const footerXlsx = this.parseJsEditorObj(this.footerXlsx, workbook);
421
- const tmpl = new Ext.XTemplate(
422
- this.processingTemplate(JSON.stringify(footerXlsx))
423
- ).apply(dataForTemplate);
424
- footerRows = JSON.parse(tmpl);
422
+ const html = this.processingTemplate(JSON.stringify(footerXlsx));
423
+ footerRows = JSON.parse(this.applyTemplate(html, this.getDataForTemplate(html)));
425
424
  }
426
425
  return {headerRows, dataRows, footerRows};
427
426
  },
@@ -477,8 +476,8 @@ Ext.define('Coon.report.plugin.grid.CopyRowsFromGrid', {
477
476
  return fileName;
478
477
  }
479
478
  try {
480
- fileName = new Ext.XTemplate(fileName, {strict: true}).apply({
481
- parameters: this.component.up('ReportPanel').currentParamList || {},
479
+ fileName = this.applyTemplate(fileName, {
480
+ parameters: this.getCurrentFilterParameters(),
482
481
  });
483
482
  } catch (err) {
484
483
  Coon.log.warn(err);
@@ -534,7 +533,7 @@ Ext.define('Coon.report.plugin.grid.CopyRowsFromGrid', {
534
533
  this.collectGridDataAsObject(this.getSelected(), exporter.excel);
535
534
  const tableHeaderRows = this.getTableHeaderRows(exporter);
536
535
  const summaryRows = this.getSummaryRows();
537
- this.assignStyle([...dataRows, ...summaryRows], this.allBordersStyle);
536
+ // this.assignStyle([...dataRows, ...summaryRows], this.allBordersStyle);
538
537
  exporter.jsonData = [...headerRows, ...tableHeaderRows, ...dataRows, ...summaryRows, ...footerRows];
539
538
  exporter.getContent = this.getContent.bind(exporter, this);
540
539
  return exporter;
@@ -941,7 +940,6 @@ Ext.define('Coon.report.plugin.grid.CopyRowsFromGrid', {
941
940
  const result = [];
942
941
  const grid = this.component;
943
942
  const columnCount = grid.getColumns().length;
944
- const dataForTemplates = this.getDataForTemplate();
945
943
  result.push('<html>' +
946
944
  '<head>' +
947
945
  '<meta http-equiv=Content-Type content="text/html; charset=utf-8">' +
@@ -963,7 +961,8 @@ Ext.define('Coon.report.plugin.grid.CopyRowsFromGrid', {
963
961
  }
964
962
 
965
963
  if (!Ext.isEmpty(this.header)) {
966
- result.push(new Ext.XTemplate(this.processingTemplate(this.headerTemplate.html)).apply(dataForTemplates));
964
+ const html = this.processingTemplate(this.headerTemplate.html);
965
+ result.push(this.applyTemplate(html, this.getDataForTemplate(html)));
967
966
  }
968
967
  // собираем заголовки
969
968
  const dataIndexToColumn = [];
@@ -1024,7 +1023,8 @@ Ext.define('Coon.report.plugin.grid.CopyRowsFromGrid', {
1024
1023
  result.push('</table>');
1025
1024
  // Нижний колонтитул (если задан).
1026
1025
  if (!Ext.isEmpty(this.footer)) {
1027
- result.push(new Ext.XTemplate(this.processingTemplate(this.footerTemplate.html)).apply(dataForTemplates));
1026
+ const html = this.processingTemplate(this.footerTemplate.html);
1027
+ result.push(this.applyTemplate(html, this.getDataForTemplate(html)));
1028
1028
  }
1029
1029
  result.push('</body></html>');
1030
1030
  return result;
@@ -1140,23 +1140,23 @@ Ext.define('Coon.report.plugin.grid.CopyRowsFromGrid', {
1140
1140
  </td>
1141
1141
  `);
1142
1142
  } else {
1143
- const col = Ext.apply(
1144
- {value: this.getRenderedValue(value, valueType) || ''},
1145
- this.getRowStyleXlsx(grid, record, workbook)
1146
- );
1143
+ let styles = this.getRowStyleXlsx(grid, record, workbook);
1144
+ const col = {value: this.getRenderedValue(value, valueType) || ''};
1145
+ styles = this.mergeDeep(styles, this.allBordersStyle);
1147
1146
  if (valueType === 'float') {
1148
1147
  let precision = Number(columnConfig.precision);
1149
1148
  if (!Number.isInteger(precision)) {
1150
1149
  precision = Number(this.getConfig('floatPrecision') || this.defaultFloatPrecision);
1151
1150
  }
1152
- col['styleId'] = workbook.addCellStyle({
1153
- format: precision !== 0 ? '0.'.padEnd(precision + 2, '0') : '0',
1154
- });
1151
+ styles = this.mergeDeep(styles, {format: precision !== 0 ? '0.'.padEnd(precision + 2, '0') : '0'});
1155
1152
  if (col['value'].length) {
1156
1153
  col['value'] = parseFloat(col['value'].replace(/\s/g, '').replace(',', '.'));
1157
1154
  }
1158
1155
  }
1159
- result.push(col);
1156
+
1157
+ col['styleId'] = workbook.addCellStyle(styles);
1158
+
1159
+ result.push(JSON.parse(JSON.stringify(col)));
1160
1160
  }
1161
1161
  }, this);
1162
1162
  if (!object) {
@@ -1181,7 +1181,7 @@ Ext.define('Coon.report.plugin.grid.CopyRowsFromGrid', {
1181
1181
  }
1182
1182
  }
1183
1183
 
1184
- return Object.keys(styles).length ? {'styleId': workbook.addCellStyle(styles)} : {};
1184
+ return {styles: styles};
1185
1185
  },
1186
1186
  getRowStyle: function(grid, record) {
1187
1187
  const rowElement = Ext.fly(grid.getView().getRow(grid.getStore().indexOf(record)));
@@ -1301,8 +1301,7 @@ Ext.define('Coon.report.plugin.grid.CopyRowsFromGrid', {
1301
1301
  },
1302
1302
 
1303
1303
  // Получение параметров шаблонов
1304
- getDataForTemplate: function() {
1305
- const text = (this.header || '') + (this.footer || '');
1304
+ getDataForTemplate: function(text) {
1306
1305
  if (Ext.isEmpty(text)) {
1307
1306
  return {};
1308
1307
  }
@@ -39,7 +39,7 @@
39
39
  .function-button-type {
40
40
 
41
41
  border: 1px solid #F5F7F8 !important;
42
- background-color: #ECEEEF;
42
+ background-color: #F5F7F8;
43
43
  border-radius: 6px;
44
44
  }
45
45
 
@@ -62,7 +62,7 @@
62
62
 
63
63
 
64
64
  .function-button-type.x-btn-over {
65
- background-color: #E3E7EA;
65
+ background-color: #ECF0F3;
66
66
  }
67
67
 
68
68
  .function-button-type.x-btn-over .x-btn-arrow-right::after {
@@ -9,6 +9,7 @@ Ext.define('Coon.report.toolbar.ReportGridToolbar', {
9
9
  userPreferences: {},
10
10
  reportPanel: undefined,
11
11
  newButtons: {},
12
+
12
13
  initComponent: function() {
13
14
  this.layout = {
14
15
  overflowHandler: Ext.create('Coon.report.toolbar.layout.ReportToolbarOverflow', {
@@ -25,6 +26,9 @@ Ext.define('Coon.report.toolbar.ReportGridToolbar', {
25
26
  this.foldItemsContainer,
26
27
  {
27
28
  xtype: 'displayfield',
29
+ width: 2,
30
+ margin: 0,
31
+ padding: 0,
28
32
  position: -10,
29
33
  itemId: 'hiddenDisplayElement',
30
34
  }
@@ -139,6 +143,7 @@ Ext.define('Coon.report.toolbar.ReportGridToolbar', {
139
143
  return 0;
140
144
  });
141
145
  },
146
+
142
147
  readUserPreferences: function() {
143
148
  if (this.getEl()) {
144
149
  this.getLayout().overflowHandler.menuButton.setTooltip(null);
@@ -146,7 +146,7 @@ Ext.define('Coon.report.toolbar.layout.ReportToolbarOverflow', {
146
146
  },
147
147
  },
148
148
  style: {
149
- borderLeft: '3px solid #D3D3D3',
149
+ borderLeft: '2px solid #D3D3D3',
150
150
  },
151
151
  items: systemItemsList,
152
152
  });
package/src/version.js CHANGED
@@ -1,4 +1,4 @@
1
1
  Ext.define('Coon.version', {
2
2
  singleton: true,
3
- number: '2.8.14',
3
+ number: '2.8.16',
4
4
  });