ru.coon 2.5.56 → 2.5.58

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,21 @@
1
+ # Version 2.5.58, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/0bc705cdb14b90982a31dfff10ebf7d4c4819fd2)
2
+ * ## Features
3
+ * <span style='color:green'>feat: BFL-9258: add PercentEditorCreator</span> ([3998d6], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/3998d6908cf7b9bd59e659c5652808e39b5ea4f4))
4
+
5
+ * ## Fixes
6
+ * <span style='color:red'> CRM-8161 Исправлен доступ к FilterPanel. Исправлено поведение IsweBindCustomPanelPlugin.</span> ([f54bee], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/f54beedaf28f9be18c3f0b588c0af2ec340b50a5))
7
+
8
+ * update: CHANGELOG.md ([44feda], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/44fedab2d737c9d50e1f3bb802ab16f7af5d581c))
9
+
10
+ # Version 2.5.57, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/98c71c4543fd95e80906b6fff0c955031a86eca1)
11
+ * ## Fixes
12
+ * <span style='color:red'> CRM-8102 Возвращена настройка additionalFields в SimplestReportCombo и SimpleReportTag</span> ([8a1afb], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/8a1afb48b9e6c23b91649a20fc08b7e2405209b0))
13
+ * <span style='color:red'> HT-7440 Исправлено некорректное отображение кнопок maximize/restore при...</span> ([fa605d], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/fa605dcd97c3fadd4707b7f72cfdffea616d7a12))
14
+
15
+ * BFL-10242 изменение плагина SettingsManagerPlugin ([07d4ca], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/07d4ca3f4ce78f6e35883b70dda2eb66f7790d9b))
16
+ * BFL-10242 изменение плагина SettingsManagerPlugin ([de0469], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/de046978a779f5426bd70cce958cd80463ad3ba0))
17
+ * update: CHANGELOG.md ([fb454c], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/fb454c4aa2a1e2132a607fa66430838051dff815))
18
+
1
19
  # Version 2.5.56, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/128444f42dc670412319a7f3bf6c53407f8ca3c7)
2
20
  * ## Features
3
21
  * <span style='color:green'>feat: HT-7788: check execute chain function result on error, add validation function in unified toolbar plugin</span> ([9af285], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/9af28505fd7c8761aa0cfe51d258892307a25d5d))
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "name": "ru.coon"
5
5
  },
6
6
  "description": "",
7
- "version": "2.5.56",
7
+ "version": "2.5.58",
8
8
  "repository": {
9
9
  "type": "git",
10
10
  "url": "git+http://gitlab-dbr.sigma-it.local/dbr/ru.coon"
@@ -0,0 +1,4 @@
1
+ Ext.define('Coon.common.component.editor.creators.PercentEditorCreator', {
2
+ extend: 'Coon.common.component.editor.creators.NumberEditorCreator',
3
+ alias: 'widget.PercentEditorCreator',
4
+ });
@@ -13,6 +13,7 @@ Ext.define('Coon.common.panel.WindowWrap', {
13
13
  constrain: true,
14
14
  scrollable: false,
15
15
  maximizable: true,
16
+ maximized: false,
16
17
  shrinkWrap: false,
17
18
  shrinkWrapDock: false,
18
19
  cls: 'window-wrap shadow',
@@ -34,6 +35,24 @@ Ext.define('Coon.common.panel.WindowWrap', {
34
35
  }
35
36
  },
36
37
 
38
+ addTool: function(tools) {
39
+ const me = this;
40
+ const isWinMaximized = me.height >= me.maxHeight && me.width >= me.maxWidth;
41
+ me.maximized = me.maximized || isWinMaximized;
42
+ me.height = Ext.isEmpty(me.height) || me.height >= me.maxHeight ? 500 : me.height;
43
+ me.width = Ext.isEmpty(me.width) || me.width >= me.maxWidth ? 800 : me.width;
44
+
45
+ me.callParent([tools]);
46
+
47
+ if (me.maximized && !!me.tools.maximize) {
48
+ me.tools.maximize.setType('restore');
49
+ }
50
+
51
+ if (me.rendered && me.tabGuard) {
52
+ me.initTabGuards();
53
+ }
54
+ },
55
+
37
56
  ghost: function(cls) {
38
57
  return this.callParent([cls||'window-wrap']);
39
58
  },
@@ -46,7 +46,9 @@ Ext.define('Coon.report.command.GetKeyValueListByReportCommand', {
46
46
  reportId: this.reportId,
47
47
  };
48
48
  if (Array.isArray(necessaryFields) && necessaryFields.length) {
49
- params.filterReportFieldCdList = necessaryFields.join(',');
49
+ params.filterReportFieldCdList = Array.from(
50
+ new Set([this.keyField, this.valueField, ...necessaryFields])
51
+ ).join(',');
50
52
  }
51
53
  this.callParent([params]);
52
54
  },
@@ -506,7 +506,6 @@ Ext.define('Coon.report.component.ReportPanel', {
506
506
  },
507
507
 
508
508
  clear: function() {
509
- // this.filterContainer.removeAll();
510
509
  this.northPanel.clear();
511
510
  this.clearSidePanels();
512
511
  if (this.grid) {
@@ -531,7 +530,6 @@ Ext.define('Coon.report.component.ReportPanel', {
531
530
  },
532
531
 
533
532
  clearFilter: function() {
534
- // Coon.Function.clearAllFieldsOnForm(this.filterContainer, false);
535
533
  this.northPanel.clearFilter();
536
534
  this.fireEvent('clearFilter');
537
535
  },
@@ -784,7 +782,10 @@ Ext.define('Coon.report.component.ReportPanel', {
784
782
  applyFilter: function(params) {
785
783
  params = params || {};
786
784
  const parameters = Ext.apply({}, params, this.getFilterDefaults());
787
- this.down('FilterPanel').markFilterFields(this.getFilterDefaults() || {});
785
+ const filterPanel = this.down('FilterPanel');
786
+ if (filterPanel) {
787
+ filterPanel.markFilterFields(this.getFilterDefaults() || {});
788
+ }
788
789
  this.fillFilter(!params.__doNotDecode, parameters);
789
790
  // Если задано - фильтрация без ожидания ввода параметров
790
791
  const doFilter = (parameters ? parameters.doFilter : undefined) ||
@@ -2,10 +2,24 @@
2
2
  * @constant DANGEROUS_AMOUNT_OF_DATA максимальное количество записей, загружаемых в store компонента.
3
3
  * При начитывании репорта есть параметр, который может ограничить возвращаемые поля определенным списком полей, чтобы экономить память и уменьшить
4
4
  * нагрузку на сеть.
5
- * @param {[string]} extraFields список дополнительных полей (в дополнении к основным displayField, valueField), которые будут
6
- * запрошены у отчета.
5
+ * @param {[string]} extraFields список дополнительных полей из отчета (в дополнении к основным displayField, valueField),
6
+ * которые будут запрошены у отчета.
7
7
  * @param {boolean} isReportFilterField. По умолчанию false. true - значит компонент является полем фильтрпанели ReportPanel
8
- */
8
+ * @param {[object]} additionalFields позволяет добавить в store вычисляемые поля (не входящие в отчет),
9
+ * которые могут быть использованы в качестве displayField.
10
+ * Доступные возможности для вычисления полей описаны в документации Ext.data.field.Field
11
+ * @example
12
+ * additionalFields: [
13
+ * {
14
+ * name: 'LONG_DESCRIPTION',
15
+ * calculate: function(data) {
16
+ * return `${data.DESCRIPTION} : ( ${data.ROLE_DESC.toLowerCase()} )`; //Тест : ( подрядчик )
17
+ * },
18
+ * }
19
+ * ],
20
+ Добавляет в store компонента поле LONG_DESCRIPTION, формируемого из других полей отчета, с возможностью отображения его в displayField.
21
+ * */
22
+
9
23
  Ext.define('Coon.report.component.SimpleReportTag', {
10
24
  extend: 'Ext.form.field.Tag',
11
25
  alternateClassName: ['SigmaUtilities.view.common.field.SimpleReportTag'],
@@ -33,6 +47,7 @@ Ext.define('Coon.report.component.SimpleReportTag', {
33
47
  tagMarkToRemoveCls: 'mark-to-remove',
34
48
  charSeq: {},
35
49
  isReportFilterField: false,
50
+ additionalFields: [],
36
51
  },
37
52
 
38
53
  grow: false,
@@ -133,7 +148,6 @@ Ext.define('Coon.report.component.SimpleReportTag', {
133
148
  this.setTriggers(triggers);
134
149
  }
135
150
  this.store = new Ext.data.Store({
136
- fields: this.getReportFields(),
137
151
  idProperty: this.valueField,
138
152
  autoLoad: false,
139
153
  });
@@ -208,7 +222,13 @@ Ext.define('Coon.report.component.SimpleReportTag', {
208
222
  this.enable();
209
223
  data = this.truncateResponse(data);
210
224
  this.initialData = data;
211
- this.store.loadData(data);
225
+ const defaultFields = !Ext.isEmpty(data) && Object.keys(data[0]) || [];
226
+ const newFields = Array.from(
227
+ new Set([...defaultFields, ...this.additionalFields]), (item) => {
228
+ return typeof item === 'string' ? {name: item} : item;
229
+ });
230
+ this.store.getModel().addFields(newFields);
231
+ this.store.loadData(data, true);
212
232
  this.store.fireEvent('load', this.store, this.store.getRange(), true);
213
233
  this.fireEvent('load', this, this.store);
214
234
  if (this.value) {
@@ -253,14 +273,23 @@ Ext.define('Coon.report.component.SimpleReportTag', {
253
273
  return [{name: 'params'}];
254
274
  },
255
275
 
276
+ getFieldsForCommand: function() {
277
+ const necessaryFields = this.useNecessaryFields && this.getExtraFields() || [];
278
+ const additionalFields = this.additionalFields.map((field) => field.name);
279
+ const reportFields = [this.valueField, this.displayField, ...necessaryFields].filter((field) => !additionalFields.includes(field));
280
+ return [
281
+ reportFields[0],
282
+ reportFields[1],
283
+ this.useNecessaryFields && reportFields.slice(1)
284
+ ];
285
+ },
286
+
256
287
  loadHandler: function(params) {
257
288
  this.disable();
258
289
  this.command.execute(
259
290
  this.reportId,
260
291
  Ext.apply({}, params, this.defaultParameters || {}),
261
- this.valueField,
262
- this.displayField,
263
- this.useNecessaryFields && this.getReportFields()
292
+ ...this.getFieldsForCommand()
264
293
  );
265
294
  },
266
295
 
@@ -285,18 +314,4 @@ Ext.define('Coon.report.component.SimpleReportTag', {
285
314
  }
286
315
  return data;
287
316
  },
288
-
289
- /**
290
- * Получение списка необходимых полей репорта.
291
- * @returns {(*|string)[]}
292
- */
293
- getReportFields() {
294
- const fieldList = new Set([this.valueField, this.displayField].filter((field) => !Ext.isEmpty(field)));
295
- if (this.getExtraFields()) {
296
- for (const fieldName of this.getExtraFields()) {
297
- fieldList.add(fieldName);
298
- }
299
- }
300
- return [...fieldList];
301
- },
302
317
  });
@@ -7,9 +7,8 @@
7
7
  * @param autoLoadData загружать репорт при инстанцировании
8
8
  * @param {boolean} cutDangerousAmount урезать данные репорта при превышении DANGEROUS_AMOUNT_OF_DATA. По умолчанию true (данные будут усечены).
9
9
  * @constant DANGEROUS_AMOUNT_OF_DATA предел количества строк в репорте, считающийся опасным
10
- * @param {[string]} extraFields список дополнительных полей (в дополнении к основным displayField, valueField, поля bindToModel), которые будут
11
- * запрошены у отчета.
12
- *
10
+ * @param {[string]} extraFields список дополнительных полей из отчета (в дополнении к основным displayField, valueField, поля bindToModel),
11
+ * которые будут запрошены у отчета.
13
12
  * При начитывании данных репорта есть параметр, который может ограничить возвращаемые поля определенным списком полей, чтобы экономить память
14
13
  * и уменьшить нагрузку на сеть. Этот параметр принимает список полей, которые необходимо начитать.
15
14
  * Свойство компонента useNecessaryFields отвечает за использование этого функционала:
@@ -17,8 +16,21 @@
17
16
  * компонент определяет перечень полей для начитывания.
18
17
  * Если компонент SimplestReportCombo находится в ReportPanel (определяется по свойству isReportFilterField, которое примешивается в конфиг
19
18
  * компонента, когда компонент конструируется в FilterPanel), useNecessaryFields выставляется в значение true.
20
- *
21
- */
19
+ * @param {[object]} additionalFields позволяет добавить в store вычисляемые поля (не входящие в отчет),
20
+ * которые могут быть использованы в качестве displayField.
21
+ * Доступные возможности для вычисления полей описаны в документации Ext.data.field.Field
22
+ * @example
23
+ * additionalFields: [
24
+ * {
25
+ * name: 'LONG_DESCRIPTION',
26
+ * calculate: function(data) {
27
+ * return `${data.DESCRIPTION} : ( ${data.ROLE_DESC.toLowerCase()} )`; //Тест : ( подрядчик )
28
+ * },
29
+ * }
30
+ * ],
31
+ * Добавляет в store компонента поле LONG_DESCRIPTION, формируемого из других полей отчета, с возможностью отображения его в displayField.
32
+ * */
33
+
22
34
  Ext.define('Coon.report.component.SimplestReportCombo', {
23
35
  extend: 'Coon.report.component.ParameterizedReportCombo',
24
36
  alias: 'widget.SimplestReportCombo',
@@ -51,6 +63,7 @@ Ext.define('Coon.report.component.SimplestReportCombo', {
51
63
  showNavigationArrowButtons: false,
52
64
  disabledClassName: 'svg-icon-disabled',
53
65
  disableBusyFeature: false,
66
+ additionalFields: [],
54
67
  },
55
68
  displayField: undefined,
56
69
  extraFields: undefined,
@@ -120,7 +133,6 @@ Ext.define('Coon.report.component.SimplestReportCombo', {
120
133
  this.displayField = this.displayField || 'DESCRIPTION';
121
134
 
122
135
  this.store = new Ext.data.Store({
123
- fields: this.getReportFields(),
124
136
  idProperty: this.valueField,
125
137
  autoLoad: false,
126
138
  });
@@ -256,6 +268,12 @@ Ext.define('Coon.report.component.SimplestReportCombo', {
256
268
  // todo: Писать в grafana
257
269
  Coon.log.warn(`Отчет ${this.reportId}. Слишком много записей - ${map.length}.`);
258
270
  }
271
+ const defaultFields = !Ext.isEmpty(map) && Object.keys(map[0]) || [];
272
+ const newFields = Array.from(
273
+ new Set([...defaultFields, ...this.additionalFields]), (item) => {
274
+ return typeof item === 'string' ? {name: item} : item;
275
+ });
276
+ this.store.model.addFields(newFields);
259
277
  this.store.loadData(map);
260
278
  this.store.fireEvent('load', this.store, this.store.getRange(), true);
261
279
  this.fireEvent('load', this, this.store);
@@ -285,14 +303,23 @@ Ext.define('Coon.report.component.SimplestReportCombo', {
285
303
  return [{name: 'params'}];
286
304
  },
287
305
 
306
+ getFieldsForCommand: function() {
307
+ const necessaryFields = this.useNecessaryFields && this.getExtraFields() || [];
308
+ const additionalFields = this.additionalFields.map((field) => field.name);
309
+ const reportFields = [this.valueField, this.displayField, ...necessaryFields].filter((field) => !additionalFields.includes(field));
310
+ return [
311
+ reportFields[0],
312
+ reportFields[1],
313
+ this.useNecessaryFields && reportFields.slice(1)
314
+ ];
315
+ },
316
+
288
317
  loadHandler: function(params) {
289
318
  this.setBusy(true);
290
319
  this.command.execute(
291
320
  this.reportId,
292
321
  Ext.apply({}, params, this.defaultParameters || {}),
293
- this.valueField,
294
- this.displayField,
295
- this.useNecessaryFields && this.getReportFields()
322
+ ...this.getFieldsForCommand()
296
323
  );
297
324
  },
298
325
 
@@ -309,23 +336,4 @@ Ext.define('Coon.report.component.SimplestReportCombo', {
309
336
  this.setDisabled(isBusy);
310
337
  this.setEmptyText(isBusy ? this.getLoadingText() : null);
311
338
  },
312
-
313
- /**
314
- * Получение списка необходимых полей репорта.
315
- * @returns {*[]|(*|string)[]}
316
- */
317
- getReportFields() {
318
- const fieldList = new Set([this.valueField, this.displayField, this.defaultValueFlg].filter((field) => !Ext.isEmpty(field)));
319
- if (Ext.isObject(this.bindToModel)) {
320
- Object.keys(this.bindToModel).forEach((fieldName) => {
321
- fieldList.add(fieldName);
322
- });
323
- }
324
- if (this.getExtraFields()) {
325
- for (const fieldName of this.getExtraFields()) {
326
- fieldList.add(fieldName);
327
- }
328
- }
329
- return [...fieldList];
330
- },
331
339
  });
@@ -86,7 +86,7 @@ Ext.define('Coon.report.component.report.NorthPanel', {
86
86
 
87
87
  isValid() {
88
88
  const filterPanel = this.down('FilterPanel');
89
- return filterPanel.validateRequired() && Coon.Function.validateAllFieldsOnForm(this.filterContainer);
89
+ return filterPanel && filterPanel.validateRequired() && Coon.Function.validateAllFieldsOnForm(this.filterContainer);
90
90
  },
91
91
 
92
92
  collectParams() {
@@ -14,6 +14,7 @@ Ext.define('Coon.report.plugin.SettingsManagerPlugin.SettingsManagerPlugin', {
14
14
  isShowDetails: false,
15
15
  isIgnoreAutoSize: true,
16
16
  isShowEmptyProfile: false,
17
+ isSaveHiddenFilters: true,
17
18
  emptyProfileId: 0,
18
19
  emptyProfileTitle: 'Настройки по умолчанию',
19
20
  },
@@ -23,13 +24,13 @@ Ext.define('Coon.report.plugin.SettingsManagerPlugin.SettingsManagerPlugin', {
23
24
  forceAutoFilter: true,
24
25
  debug(entry, tag) {
25
26
  if (!entry) {
26
- console.debug(entry, tag);
27
+ Coon.log.debug(entry, tag);
27
28
  return;
28
29
  }
29
30
  const settings = entry.settings || entry.get('settings');
30
31
  const id = entry.id;
31
32
  const isDirty = entry.dirty;
32
- console.dir({id, isDirty, sum: this.checksum(settings), settings: settings.columns}, tag);
33
+ Coon.log.debug({id, isDirty, sum: this.checksum(settings), settings: settings.columns}, tag);
33
34
  },
34
35
  checksum: function() {
35
36
  return Ext.hashFromObj(...arguments);
@@ -80,6 +81,10 @@ Ext.define('Coon.report.plugin.SettingsManagerPlugin.SettingsManagerPlugin', {
80
81
  if (filterParams[key] === '') {
81
82
  delete filterParams[key];
82
83
  }
84
+ const currentField = this.getReportPanel().filterContainer.query('[name=' + key + ']')[0];
85
+ if (this.isSaveHiddenFilters && currentField.hidden === true) {
86
+ delete filterParams[key];
87
+ }
83
88
  });
84
89
  const columns = this.getComponent().columnManager.getColumns().map((c) => {
85
90
  const col = {
@@ -43,6 +43,12 @@ Ext.define('Coon.report.plugin.SettingsManagerPlugin.view.SMPConfigPanel', {
43
43
  name: 'isIgnoreAutoSize',
44
44
  boxLabel: 'Игнорировать автоширину колонок',
45
45
  },
46
+ {
47
+ xtype: 'checkbox',
48
+ name: 'isSaveHiddenFilters',
49
+ boxLabel: 'Сохранять скрытые параметры',
50
+ value: true,
51
+ },
46
52
  {
47
53
  xtype: 'checkbox',
48
54
  name: 'isRemoteStore',
@@ -65,4 +65,15 @@ Ext.define('Coon.report.plugin.report.IsweBindCustomPanelPlugin', {
65
65
  }
66
66
  Coon.Function.executeComponentDoInit(this.panel, params);
67
67
  },
68
+
69
+ initHandler: function() {
70
+ const rows = this.component.getSelectionModel().getSelection();
71
+ const gridContextPlugin = this.component.getContextManager();
72
+ if (this.dependOnGridRow && rows.length !== 1) {
73
+ this.clearDependForm();
74
+ } else {
75
+ gridContextPlugin.resetContext();
76
+ this.component.getContextManager().executeFunction(Ext.bind(this.doInitDependForm, this), this.parameters);
77
+ }
78
+ },
68
79
  });
@@ -57,7 +57,7 @@ Ext.define('Coon.uielement.component.UiCustomController', {
57
57
  addCopyLinkTool: function(view) {
58
58
  const me = this;
59
59
  if (this.getView().copyLink) {
60
- view.addTool({
60
+ view.tools.push({
61
61
  tooltip: 'Скопировать ссылку на форму',
62
62
  iconCls: 'svg-icon svg-icon-bg-white svg-icon-link',
63
63
  callback: function() {
package/src/version.js CHANGED
@@ -1,4 +1,4 @@
1
1
  Ext.define('Coon.version', {
2
2
  singleton: true,
3
- number: '2.5.56',
3
+ number: '2.5.58',
4
4
  });