ru.coon 2.7.12 → 2.7.13

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,16 @@
1
+ # Version 2.7.13, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/c2a509ebbdf7d3ddd07faaf3a42f0ef759a31cc4)
2
+ * ## Fixes
3
+ * <span style='color:red'>fix report property editor</span> ([ba33a6], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/ba33a6f5379601e92e243ee8f971fc5811ac648f))
4
+
5
+ * update: CHANGELOG.md ([52e5a1], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/52e5a14c22b9cf57be5d97fc73d81adfcd2c53f1))
6
+
1
7
  # Version 2.7.12, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/c0f357b6b648867b16809b8dc164e2dcdf023eac)
2
8
  * ## Features
3
9
  * <span style='color:green'>feat: HT-8422: make plugin</span> ([c0f288], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/c0f28814e230b079799bb7091ccfc6a4985027d7))
4
10
  * <span style='color:green'>feat: HT-8422: make plugin</span> ([3a716f], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/3a716f1e031351cc9cb7e824dd547bb26a209d8a))
5
11
  * <span style='color:green'>feat: HT-8422: make plugin</span> ([dfee6a], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/dfee6a538ab0930e3a6768024dd1cc3d680f379e))
6
12
 
13
+ * upd ([20702b], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/20702be763b8d49e5844a472789d013fca40708b))
7
14
  * HT-8467 fix: Проверка наличия плагина перед использованием его методов. ([e531df], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/e531df48524bc9ccef92c62463eea5d114f3a9cf))
8
15
  * update: CHANGELOG.md ([6a43ba], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/6a43ba46583e65e72523c1b6f28c46049d02e372))
9
16
 
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "name": "ru.coon"
5
5
  },
6
6
  "description": "",
7
- "version": "2.7.12",
7
+ "version": "2.7.13",
8
8
  "repository": {
9
9
  "type": "git",
10
10
  "url": "git+http://gitlab-dbr.sigma-it.local/dbr/ru.coon"
package/src/log.js CHANGED
@@ -185,6 +185,14 @@ Ext.define('Coon.log', {
185
185
  }
186
186
  },
187
187
 
188
+ fnDebug(fn, desc) {
189
+ return function(...args) {
190
+ const result = fn.call(this, ...args);
191
+ Coon.log.debug(desc ? desc+' : ' : '', result);
192
+ return result;
193
+ };
194
+ },
195
+
188
196
  getParentPropChain(id, propPaths) {
189
197
  const seek = (cfg, props, acc, opts) => {
190
198
  acc = acc || [];
@@ -56,7 +56,7 @@ Ext.define('Coon.report.component.settings.property.ReportPropertiesPanel', {
56
56
  items: [
57
57
  {
58
58
  xtype: 'treepanel',
59
- flex: 1,
59
+ width: 400,
60
60
  style: {
61
61
  borderTop: '1px solid #e1e1e1',
62
62
  borderRight: '1px solid #e1e1e1',
@@ -74,14 +74,13 @@ Ext.define('Coon.report.component.settings.property.ReportPropertiesPanel', {
74
74
  },
75
75
  },
76
76
  viewConfig: {
77
- getRowClass: function(record) {
77
+ getRowClass: Coon.log.fnDebug(function(record) {
78
78
  if (record.get('isDeleted')) {
79
79
  return 'is-deleted';
80
80
  }
81
81
  if (record.get('value') === undefined &&
82
82
  record.get('leaf') === true) {
83
83
  return record.get('isDeleted') ? 'is-deleted' : 'is-new-rec';
84
- // return record.get('isDeleted') && !record.get('isNewColumn') === 'true' ? 'is-deleted' : 'is-new-rec';
85
84
  }
86
85
 
87
86
  if (record) {
@@ -90,14 +89,14 @@ Ext.define('Coon.report.component.settings.property.ReportPropertiesPanel', {
90
89
  classes.push(record.get('duplicate') ? 'duplicate-record' : '');
91
90
  return classes.join(' ');
92
91
  }
93
- },
92
+ }, 'getRowClass'),
94
93
  },
95
94
  columns: [
96
95
  {
97
96
  xtype: 'treecolumn',
98
97
  dataIndex: 'name',
99
98
  text: 'Параметр',
100
- width: 300,
99
+ width: 200,
101
100
  renderer(v, mt, record) {
102
101
  return v ? `<span style="font-weight:bold;color: darkgray">${v}</span>`:
103
102
  `<span>${(record.get('children') && record.get('propTag')) || record.get('key') || ''}</span>`;
@@ -25,9 +25,6 @@ Ext.define('Coon.report.component.settings.property.ReportPropertiesPanelControl
25
25
  this.lookup('customPropertyGrid').on('propertyChanged', this.recordChangeHandler, this);
26
26
  this.lookup('propertyGrid').on('propertyChanged', this.recordChangeHandler, this);
27
27
  view.on('propertyChanged', this.recordChangeHandler, this);
28
- // view.on('reloadProperties', () => this.allowDuplicate.map((key) =>
29
- // this.allowDuplicateRecords = this.getViewModel().get('report.properties') &&
30
- // this.getViewModel().get('report.properties').filter((record) => key === record.key)));
31
28
  },
32
29
 
33
30
  getExistedKeysSet() {
@@ -48,7 +45,6 @@ Ext.define('Coon.report.component.settings.property.ReportPropertiesPanelControl
48
45
  xtype: 'PropertySelectPanel',
49
46
  existedKeys: this.getExistedKeysSet(),
50
47
  treeData: Coon.report.component.settings.property.ReportPropertyDictionary.schema,
51
- // buildPropertiesTreeData: this.buildPropertiesTreeData.bind(this),
52
48
  listeners: {
53
49
  itemdblclick: {
54
50
  fn: this.onAddProperty,
@@ -69,7 +65,6 @@ Ext.define('Coon.report.component.settings.property.ReportPropertiesPanelControl
69
65
  },
70
66
 
71
67
  onAddProperty(_, record) {
72
- const allowMultiple = record.get('allowMultiple');
73
68
  const store = this.lookup('propertyGrid').store;
74
69
  const propPathMap = this.getRecordPathMap(record);
75
70
  let currentNode = store.getRootNode();
@@ -78,10 +73,10 @@ Ext.define('Coon.report.component.settings.property.ReportPropertiesPanelControl
78
73
  const existNode = currentNode.childNodes.find((childNode) => {
79
74
  const state = (
80
75
  key &&
81
- !allowMultiple &&
82
76
  key === childNode.get('key')
83
77
  ) || (
84
78
  !leaf &&
79
+ propTag &&
85
80
  propTag === childNode.get('propTag')
86
81
  );
87
82
  return state;
@@ -99,41 +94,13 @@ Ext.define('Coon.report.component.settings.property.ReportPropertiesPanelControl
99
94
  this.lookup('propertyValueContainer').removeAll();
100
95
 
101
96
  this.propertySelectPanel.close();
102
- this.getView().fireEvent('propertyChanged');
103
97
  return;
104
98
  },
105
99
 
106
- checkPropertyDependencies(propertyName, val) {
107
- const property = this.dictionary.propertyMap.get(propertyName);
108
- const excludeObj = property && property.exclude;
109
- excludeObj && Object.entries(excludeObj).forEach((el) => {
110
- const [prop, value] = el;
111
- if (value.onVal + '' === val + '') {
112
- // если для данного свойства уже есть набор других свойств,
113
- // которые его перекрывают, то добавить новое,
114
- // иначе создать и добавить новый набор
115
- this.excludeMap.has(prop) ? this.excludeMap.get(prop).add(propertyName) : this.excludeMap.set(prop, new Set([propertyName]));
116
- } else if (value + '' !== val + '' && this.excludeMap.has(prop)) {
117
- // удалить исключающее сойтво
118
- this.excludeMap.get(prop).delete(propertyName);
119
- // если после удаления не осталось перекрывающих свойств, то удалить из списка текущее свойство
120
- Array.from(this.excludeMap.get(prop).values()).length === 0 && this.excludeMap.delete(prop);
121
- }
122
- });
123
- this.lookup('propertyGrid').getStore().getRange().forEach((record) => {
124
- if (this.excludeMap.has(record.get('key'))) {
125
- record.set('isExcluded', true);
126
- } else {
127
- record.set('isExcluded', false);
128
- }
129
- });
130
- },
131
-
132
100
  beforeSelectPropGrid(_, record) {
133
101
  return !this.excludeMap.has(record.get('key'));
134
102
  },
135
103
 
136
-
137
104
  selectProperty(_, record) {
138
105
  this.lookup('propertyValueContainer').removeAll();
139
106
  this.lookup('descriptionField').setValue(record.get('description'));
@@ -181,22 +148,6 @@ Ext.define('Coon.report.component.settings.property.ReportPropertiesPanelControl
181
148
  contextMenu.showAt(e.getXY());
182
149
  },
183
150
 
184
- // setDuplicateValue(duplicateValues) {
185
- // const store = this.lookup('propertyGrid').getStore();
186
-
187
- // for (const elem of duplicateValues) {
188
- // const record = store.findRecord('sequenceNumber', elem.sequenceNumber);
189
- // if (record) {
190
- // record.set('value', record.get('value'));
191
- // } else {
192
- // if (store.findRecord('key', elem.key)) {
193
- // const value = store.findRecord('key', elem.key).get('value');
194
- // store.findRecord('key', elem.key).set('value', `${value},${elem.value}`, {commit: true});
195
- // }
196
- // }
197
- // }
198
- // },
199
-
200
151
  onDeleteProperty() {
201
152
  const record = this.lookup('propertyGrid').getSelection()[0];
202
153
  if (!record) {
@@ -326,92 +277,48 @@ Ext.define('Coon.report.component.settings.property.ReportPropertiesPanelControl
326
277
  if (!Array.isArray(data)) {
327
278
  return;
328
279
  }
329
- const customPropStore = this.lookup('customPropertyGrid').getStore();
280
+ const propStore = this.lookup('customPropertyGrid').getStore();
330
281
 
331
282
  const customProps = [];
332
283
  const props = [];
333
- // const duplicateValues = [];
334
284
  data.forEach((el) => {
335
- if (el.isDeleted) {
336
- return;
337
- }
338
285
  const property = this.dictionary.propertyMap.get(el.key);
339
286
  if (!property) {
340
287
  customProps.push(el);
341
288
  return;
342
289
  }
343
- // if (this.allowDuplicate.includes(el.key)) {
344
- // duplicateValues.push(el);
345
- // }
346
290
  props.push(el);
347
291
  });
348
292
  const treeData = this.buildPropertiesTreeData(props);
349
293
  this.lookup('propertyGrid').getStore().setRoot(treeData);
350
-
351
- customPropStore.loadData(customProps);
352
- // this.setDuplicateValue(duplicateValues);
294
+ propStore.loadData(customProps);
353
295
  },
354
296
 
355
297
  getData: function() {
356
298
  const customRecords = this.lookup('customPropertyGrid').getStore().getRange();
299
+
357
300
  const records = this.lookup('propertyGrid').getStore().getRange();
358
301
 
359
- this.recordsToSave = [];
360
- for (let i = 0; i < customRecords.length; i++) {
361
- this.recordsToSave.push(customRecords[i].getData());
362
- }
363
- for (const record of records) {
364
- if ((!Ext.isEmpty(record.get('value')) || record.get('isDeleted')) && !record.get('isExcluded')) {
365
- // if (this.allowDuplicate.includes(record.get('key'))) {
366
- // this.processDuplicateRecords(record);
367
- // } else {
302
+ this.recordsToSave = customRecords.map((el) => el.getData());
303
+ records.forEach((record) => {
304
+ if (
305
+ record.get('value') ||
306
+ record.get('isDeleted')
307
+ ) {
368
308
  this.recordsToSave.push(record.getData());
369
- // }
370
- }
371
- }
372
- // this.allowDuplicateRecords && this.allowDuplicateRecords.map((el) => {
373
- // const foundInRecordsToSave = this.recordsToSave.find((record) => record.key === el.key && record.value === el.value);
374
- // if (!foundInRecordsToSave) {
375
- // el.isDeleted = true;
376
- // this.recordsToSave.push(el);
377
- // } else {
378
- // foundInRecordsToSave.sequenceNumber = el.sequenceNumber;
379
- // }
380
- // if (foundInRecordsToSave) {
381
- // foundInRecordsToSave.sequenceNumber = el.sequenceNumber;
382
- // }
383
- // });
384
- this.recordsToSave.forEach((record) => {
385
- if (!record.sequenceNumber) {
386
- record.sequenceNumber = this.generateSequenceNumber();
387
309
  }
388
310
  });
389
311
  const data = Coon.Function.serializeRecords(
390
- this.recordsToSave.map(this.formatRecordObject)
312
+ this.recordsToSave.map(this.formatRecordObject, this)
391
313
  );
392
314
  return data;
393
315
  },
394
316
 
395
- // processDuplicateRecords(record) {
396
- // const arrayValue = [record.get('value')];
397
- // if (arrayValue.length > 1) {
398
- // arrayValue.map((duplicateRecord) => {
399
- // if (this.recordsToSave.find((recordToSave) =>
400
- // recordToSave.value === duplicateRecord && recordToSave.key === record.get('key'))) {
401
- // return;
402
- // }
403
- // this.recordsToSave.push({
404
- // key: record.get('key'),
405
- // value: duplicateRecord,
406
- // });
407
- // });
408
- // } else {
409
- // this.recordsToSave.push(record.getData());
410
- // }
411
- // },
412
-
413
- formatRecordObject(obj) {
414
- const {key, value, sequenceNumber, isNew, isDeleted} = obj;
317
+ formatRecordObject(record) {
318
+ if (!record.sequenceNumber) {
319
+ record.sequenceNumber = this.generateSequenceNumber();
320
+ }
321
+ const {key, value, sequenceNumber, isNew, isDeleted} = record;
415
322
  return {
416
323
  key,
417
324
  value,
@@ -280,13 +280,11 @@ Ext.define('Coon.report.component.settings.property.ReportPropertyDictionary', {
280
280
  {
281
281
  id: 'TAG',
282
282
  leaf: true,
283
- allowMultiple: true,
284
283
  defaultVal: null,
285
284
  description: `
286
285
  Свойство позволяет добавить еще один параметр поиска отчета в списке отчетов. </br>
287
286
  string
288
287
  `,
289
- // valueType: 'tag',
290
288
  },
291
289
  {
292
290
  id: 'TEMPLATE',
package/src/version.js CHANGED
@@ -1,4 +1,4 @@
1
1
  Ext.define('Coon.version', {
2
2
  singleton: true,
3
- number: '2.7.12',
3
+ number: '2.7.13',
4
4
  });