ru.coon 2.8.17 → 2.8.19

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.19, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/0537f45b4622bee187af6285993c287d9c5998c2)
2
+ * ## Fixes
3
+ * <span style='color:red'>refactoring && fix in UiCustomPanelEditor</span> ([927a5e], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/927a5e80e2382c44213541bf4770a7abc58c0cf3))
4
+
5
+ * HT-10117 fix: Перед генерацией хэша добавлена проверка на циклические ссылки ([2cd8d5], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/2cd8d5ca19750218d51ab7832b6711ddd3767724))
6
+ * remove getHtaEl from util.js ([1df6ae], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/1df6ae10306dab7fb473681357650fc674c47a9a))
7
+ * update: CHANGELOG.md ([33ba01], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/33ba01a8d1d9b4a831a743d0b7c5767c7c46c434))
8
+
9
+ # Version 2.8.18, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/15150627eb106243e7123c0b93dd4f50cf09b84e)
10
+ * ## Features
11
+ * <span style='color:green'>feat: HT-10526: set Number format in number summary cells</span> ([5b0a52], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/5b0a52f1642fdeafc40f301abf744bbe08ef7cce))
12
+
13
+ * TR-69125 Доработка плагина ExecuteReportPlugin (исправление ошибок передачи параметров в репорт) ([a8458e], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/a8458efe5a833cec82c95c7f785e028e7ed64956))
14
+ * TR-69125 Доработка плагина ExecuteReportPlugin (исправление ошибок передачи параметров в репорт) ([a4b514], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/a4b5145ae8431e0b0af46351db74019a4f9129e2))
15
+ * update: CHANGELOG.md ([10761e], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/10761e0eaa12ede202531f6cac24956388a2736d))
16
+
1
17
  # Version 2.8.17, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/51f5ec3eb47e0e8f6357a21d23aa0b5412ca66d7)
2
18
  * ## Features
3
19
  * <span style='color:green'>feat: HT-10458: remove empty summary row. fix template apply in footer and header</span> ([378487], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/378487478540583f055d1c4cc1ee281f434a9648))
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "name": "ru.coon"
5
5
  },
6
6
  "description": "",
7
- "version": "2.8.17",
7
+ "version": "2.8.19",
8
8
  "repository": {
9
9
  "type": "git",
10
10
  "url": "git+http://gitlab-dbr.sigma-it.local/dbr/ru.coon"
package/src/Function.js CHANGED
@@ -27,7 +27,9 @@ Ext.define('Coon.Function', {
27
27
  * @returns
28
28
  */
29
29
  doRequest: function(component, requestOptions, sync) {
30
- const requestHash = Coon.util.generateHashFromObj(requestOptions);
30
+ const forHashData = Ext.clone(requestOptions);
31
+ delete forHashData.callback;
32
+ const requestHash = Coon.util.generateHashFromObj(forHashData);
31
33
  if (!this.beforeRequest(requestOptions, requestHash)) {
32
34
  return;
33
35
  }
@@ -90,7 +90,7 @@ Ext.define('Coon.common.component.TreeComponentStructure', {
90
90
  iconCls: 'x-fa fa-list',
91
91
  tooltip: 'редактировать (отчет)/смотреть структуру (кастомная панель)',
92
92
  handler(view, rIdx, cIdx, item, e, record) {
93
- view.ownerCt.fireEvent('viewstructure', view, record);
93
+ view.up().fireEvent('viewstructure', view, record);
94
94
  },
95
95
  }
96
96
  ],
@@ -107,7 +107,7 @@ Ext.define('Coon.common.component.TreeComponentStructure', {
107
107
  iconCls: 'x-fa fa-pen',
108
108
  tooltip: 'редактировать этот компонент',
109
109
  handler(view, rIdx, cIdx, item, e, record) {
110
- view.ownerCt.fireEvent('editelement', view, record);
110
+ view.up().fireEvent('editelement', view, record);
111
111
  },
112
112
  }
113
113
  ],
@@ -123,7 +123,7 @@ Ext.define('Coon.common.component.TreeComponentStructure', {
123
123
  iconCls: 'x-fa fa-cog',
124
124
  tooltip: 'исследовать этот компонент',
125
125
  handler(view, rIdx, cIdx, item, e, record) {
126
- view.ownerCt.fireEvent('viewstructure', view, record);
126
+ view.up().fireEvent('viewstructure', view, record);
127
127
  },
128
128
  }
129
129
  ],
@@ -141,7 +141,7 @@ Ext.define('Coon.common.component.TreeComponentStructure', {
141
141
  iconCls: 'x-fa fa-external-link-alt',
142
142
  tooltip: 'перейти в конфигурацию в место определения компонента',
143
143
  handler(view, rIdx, cIdx, item, e, record) {
144
- view.ownerCt.fireEvent('search', record);
144
+ view.up().fireEvent('search', record);
145
145
  },
146
146
  }
147
147
  ],
@@ -39,13 +39,13 @@ Ext.define('Coon.common.component.editor.CharacteristicLoaderPlugin', {
39
39
  return;
40
40
  }
41
41
 
42
- const newDate = typeof date === 'string' ? new Date(date) : date;
43
- const effectiveDate = typeof this.model.effectiveDate === 'string' ?
44
- new Date(this.model.effectiveDate) :
45
- this.model.effectiveDate;
42
+ const getTruncated = (date) => {
43
+ date = Ext.isString(date) ? new Date(date) : date;
44
+ return new Date(date.setHours(0, 0, 0, 0)).valueOf();
45
+ };
46
46
 
47
- if (new Date(newDate.setHours(0, 0, 0, 0)).valueOf() != new Date(effectiveDate.setHours(0, 0, 0, 0)).valueOf()) {
48
- this.model.effectiveDate = newDate;
47
+ if (getTruncated(date) !== getTruncated(this.model.effectiveDate)) {
48
+ this.model.effectiveDate = date;
49
49
  this.load();
50
50
  }
51
51
  }, characteristicEditor);
@@ -90,10 +90,10 @@ Ext.define('Coon.common.component.editor.CharacteristicLoaderPlugin', {
90
90
  }
91
91
  return data.map((el) => {
92
92
  if (typeof el.value === 'string') {
93
- el.value = el.value.trim()
93
+ el.value = el.value.trim();
94
94
  }
95
- return el
96
- })
95
+ return el;
96
+ });
97
97
  },
98
98
  load: function() {
99
99
  if (this.caching) {
@@ -123,7 +123,6 @@ Ext.define('Coon.common.component.editor.CharacteristicLoaderPlugin', {
123
123
  this.model.subentityId = answer.subentityId || null;
124
124
  }.bind(this),
125
125
  params: this.model,
126
- scope: this,
127
126
  }
128
127
  );
129
128
  },
@@ -166,7 +165,6 @@ Ext.define('Coon.common.component.editor.CharacteristicLoaderPlugin', {
166
165
  }
167
166
  }.bind(this),
168
167
  params: data,
169
- scope: this,
170
168
  }
171
169
  );
172
170
  },
@@ -544,7 +544,7 @@ Ext.define('Coon.report.plugin.grid.CopyRowsFromGrid', {
544
544
  const {headerRows, dataRows, footerRows} =
545
545
  this.collectGridDataAsObject(this.getSelected(), exporter.excel);
546
546
  const tableHeaderRows = this.getTableHeaderRows(exporter);
547
- const summaryRows = this.getSummaryRows();
547
+ const summaryRows = this.getSummaryRows(exporter.excel);
548
548
  // this.assignStyle([...dataRows, ...summaryRows], this.allBordersStyle);
549
549
  exporter.jsonData = [...headerRows, ...tableHeaderRows, ...dataRows, ...summaryRows, ...footerRows];
550
550
  exporter.getContent = this.getContent.bind(exporter, this);
@@ -583,7 +583,7 @@ Ext.define('Coon.report.plugin.grid.CopyRowsFromGrid', {
583
583
  * ```
584
584
  * @returns {Object[]}
585
585
  */
586
- getSummaryRows() {
586
+ getSummaryRows(workbook) {
587
587
  const summaryRows = [];
588
588
  if (!this.component.initialConfig.features.find((f) => f.summaryBar && f.showSummaryRow)) {
589
589
  return summaryRows;
@@ -592,7 +592,15 @@ Ext.define('Coon.report.plugin.grid.CopyRowsFromGrid', {
592
592
 
593
593
  if (summaries && summaries.length) {
594
594
  summaries.each((row) => {
595
- summaryRows.push(row.getCells().getValues('_value').map((value) => ({value})));
595
+ summaryRows.push(row.getCells().getValues('_value').map((value) => {
596
+ const res = {value: value};
597
+ const styles = this.allBordersStyle;
598
+ if (workbook && Ext.isNumber(value)) {
599
+ styles.format = 'General Number';
600
+ }
601
+ res['styleId'] = workbook.addCellStyle(styles);
602
+ return res;
603
+ }));
596
604
  });
597
605
  }
598
606
  return summaryRows;
@@ -155,6 +155,7 @@ Ext.define('Coon.uielement.component.settings.UiCustomPanelEditor', {
155
155
  xtype: 'UiCPConfigPanel',
156
156
  title: 'Конфигурация',
157
157
  reference: 'UiAceEditorPanel',
158
+ cls: 'UiAceEditorPanel',
158
159
  flex: true,
159
160
  scrollable: 'y',
160
161
  bind: {
@@ -1,4 +1,7 @@
1
1
  .UiCustomPanelEditor {
2
+ .UiAceEditorPanel {
3
+ border-bottom: 4px solid gray;
4
+ }
2
5
  .good-hash {
3
6
  color: #64AA2B;
4
7
  font-size: 19px;
@@ -117,9 +117,10 @@ Ext.define('Coon.uielement.component.settings.config.UiCPConfigPanelController',
117
117
  },
118
118
 
119
119
  gotoConfig(record) {
120
+ const cmpId = record.get('componentId');
120
121
  if (record.get('type') === 'report') {
121
122
  if (record.get('source') === 'editor') {
122
- const exist = this.lookup('uiEditor').searchGoto(`reportId: '${record.get('id')}'`);
123
+ const exist = this.lookup('uiEditor').searchGoto(`reportId: '${cmpId}'`);
123
124
  if (exist) {
124
125
  this.getView().setActiveTab(0);
125
126
  }
@@ -166,6 +167,7 @@ Ext.define('Coon.uielement.component.settings.config.UiCPConfigPanelController',
166
167
  },
167
168
 
168
169
  viewUi(view, record) {
170
+ const cmpId = record.get('componentId');
169
171
  const win = Ext.create('widget.WindowWrap', {
170
172
  title: 'просмотр UiElement',
171
173
  width: 800,
@@ -180,10 +182,10 @@ Ext.define('Coon.uielement.component.settings.config.UiCPConfigPanelController',
180
182
  });
181
183
  const treePanel = win.down('TreeComponentStructure');
182
184
  const command = Ext.create('command.GetUIStructure');
183
- command.get(record.get('id'), true)
185
+ command.get(cmpId, true)
184
186
  .then((uiStructure) => {
185
187
  if (uiStructure.isParsingError === true) {
186
- Ext.Msg.alert('Сообщение системы', `Загрузка конфигурации репорта ${record.get('id')} не удалась.`);
188
+ Ext.Msg.alert('Сообщение системы', `Загрузка конфигурации репорта ${cmpId} не удалась.`);
187
189
  }
188
190
  treePanel.store.setRoot(uiStructure);
189
191
  treePanel.unmask();
@@ -197,7 +199,8 @@ Ext.define('Coon.uielement.component.settings.config.UiCPConfigPanelController',
197
199
  },
198
200
 
199
201
  openReport(view, record) {
200
- if (record.get('type') === 'report' && record.get('id')) {
202
+ const cmpId = record.get('componentId');
203
+ if (record.get('type') === 'report' && cmpId) {
201
204
  const win = Ext.create('widget.WindowWrap', {
202
205
  maximized: true,
203
206
  items: [
@@ -208,7 +211,7 @@ Ext.define('Coon.uielement.component.settings.config.UiCPConfigPanelController',
208
211
  ],
209
212
  });
210
213
  const reportForm = win.down('ReportFormEditPanel');
211
- reportForm.getController().load(record.get('id'));
214
+ reportForm.getController().load(cmpId);
212
215
  win.show();
213
216
  }
214
217
  },
@@ -48,7 +48,22 @@ Ext.define('Coon.uielement.plugin.ExecuteReportPlugin', {
48
48
  try {
49
49
  const paramObj = JSON5.parse(paramValue);
50
50
  const arr = [];
51
- Object.keys(paramObj).forEach((param) => arr.push({type: param, value: paramObj[param]}));
51
+ const context = this;
52
+ Object.entries(paramObj).forEach(([key, value]) => {
53
+ let paramValue;
54
+ if (value.startsWith('{')) {
55
+ paramValue = context.vm.get(value.substring(1, value.length - 1));
56
+ } else {
57
+ paramValue = value;
58
+ }
59
+
60
+ if (paramValue) {
61
+ arr.push({
62
+ type: key,
63
+ value: paramValue,
64
+ });
65
+ }
66
+ });
52
67
  return arr;
53
68
  } catch (ex) {
54
69
  Coon.log.error(ex);
@@ -119,10 +134,12 @@ Ext.define('Coon.uielement.plugin.ExecuteReportPlugin', {
119
134
 
120
135
  Ext.each(command.inputParameters(), (field) => {
121
136
  const paramValue = parameters[field.name];
122
- if (Ext.isString(paramValue) && paramValue.startsWith('{')) {
123
- initArguments.push(this.parsePropertiesToArray(paramValue));
124
- } else {
125
- initArguments.push(paramValue);
137
+ if (paramValue) {
138
+ if (Ext.isString(paramValue) && paramValue.startsWith('{')) {
139
+ initArguments.push(this.parsePropertiesToArray(paramValue));
140
+ } else {
141
+ initArguments.push(paramValue);
142
+ }
126
143
  }
127
144
  });
128
145
  const fn = () => command.execute.apply(command, initArguments);
package/src/util.js CHANGED
@@ -3,13 +3,15 @@ Ext.define('Coon.util', {
3
3
 
4
4
  locals: {},
5
5
 
6
- generateHashFromObj(obj, opts) {
7
- if (obj === undefined) {
6
+ generateHashFromObj(source, opts) {
7
+ if (!source) {
8
8
  return;
9
9
  }
10
+ const obj = Coon.util.markCircularLinks(source);
10
11
  try {
11
12
  return Ext.hashFromObj(obj, opts);
12
13
  } catch (ex) {
14
+ Coon.log.error(ex);
13
15
  return;
14
16
  }
15
17
  },
@@ -223,16 +225,6 @@ Ext.define('Coon.util', {
223
225
  return acc;
224
226
  },
225
227
 
226
- getHtaEl: function() {
227
- if (!this.htaEL) {
228
- this.htaEL = document.createElement('textarea');
229
- this.htaEL.id = 'coonHtaEL';
230
- this.htaEL.style = 'position: absolute;left: -10000px;top: 0px;';
231
- document.body.appendChild(this.htaEL);
232
- }
233
- return this.htaEL;
234
- },
235
-
236
228
  copyToClipboard(copiedData) {
237
229
  try {
238
230
  if (!Ext.browser.is.Firefox && navigator && navigator.clipboard) {
@@ -522,6 +514,12 @@ Ext.define('Coon.util', {
522
514
  if (Ext.isObject(data)) {
523
515
  return 'object';
524
516
  }
517
+ if (data instanceof Set) {
518
+ return 'set';
519
+ }
520
+ if (data instanceof Map) {
521
+ return 'map';
522
+ }
525
523
  if (data === null) {
526
524
  return 'null';
527
525
  }
@@ -661,4 +659,59 @@ Ext.define('Coon.util', {
661
659
  }
662
660
  });
663
661
  },
662
+
663
+ isCircular(data) {
664
+ if (!Ext.isObject(data)) {
665
+ return;
666
+ }
667
+ const linkMap = new WeakSet();
668
+
669
+ /**
670
+ * Рекурсивный поиск циклической ссылки в объекте
671
+ * @param data
672
+ */
673
+ function detectCycle(data) {
674
+ if (Ext.isObject(data)) {
675
+ if (linkMap.has(data)) {
676
+ return true;
677
+ }
678
+ linkMap.add(data);
679
+ if (Object.entries(data).find(([_, val]) => detectCycle(val))) {
680
+ }
681
+ return true;
682
+ }
683
+ if (Array.isArray(data) && data.length) {
684
+ if (data.find((val) => detectCycle(val))) {
685
+ return true;
686
+ }
687
+ }
688
+ }
689
+ return detectCycle(data);
690
+ },
691
+
692
+ markCircularLinks(data) {
693
+ if (!Ext.isObject(data)) {
694
+ return data;
695
+ }
696
+ const markerValue = '__linkedObj';
697
+ const linkMap = new WeakSet();
698
+ const converter = (data) => {
699
+ const acc = {};
700
+ if (Ext.isObject(data)) {
701
+ if (linkMap.has(data)) {
702
+ return markerValue;
703
+ }
704
+ linkMap.add(data);
705
+ Object.entries(data).forEach(([key, val]) => {
706
+ acc[key] = converter(val);
707
+ });
708
+ return acc;
709
+ }
710
+ if (Array.isArray(data)) {
711
+ return data.map(converter);
712
+ }
713
+ return data;
714
+ };
715
+ return converter(data);
716
+ },
664
717
  });
package/src/version.js CHANGED
@@ -1,4 +1,4 @@
1
1
  Ext.define('Coon.version', {
2
2
  singleton: true,
3
- number: '2.8.17',
3
+ number: '2.8.19',
4
4
  });