ru.coon 3.0.62 → 3.0.68

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/.husky/pre-commit CHANGED
File without changes
package/CHANGELOG.md CHANGED
@@ -1,7 +1,33 @@
1
- # Version 3.0.62, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/84377986f250a0a6d0428be0f0b4439bc8e4b080)
2
- * sync ([368524], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/368524d52dd3f4fe03818291c6418246af14d81f))
3
- * sync ([7896b3], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/7896b3427c19ff691b961deca2c28bac9e39145d))
4
- * sync ([aa2c61], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/aa2c61b0e9f0d57e1f8fa1a5a47231cc70cc7813))
1
+ # Version 3.0.68, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/4c8a28a5fc4878ff7e670c77d3bc794069ab7d2d)
2
+ * HT-14811: исправление редактирования характеристик FKV ([b5c035], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/b5c0356d657071ecc5353a39be973d5b592f7648))
3
+ * update: CHANGELOG.md ([87a10f], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/87a10faa1d038191be9cec97076df7bcea165105))
4
+
5
+ # Version 3.0.67, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/d850ee12048246ba85557eef4475595043fc9d00)
6
+ * HT-14811: исправление открытия редактора для характеристик FKV ([becf94], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/becf94689878553b8c8287c6260ca986a314b08e))
7
+ * update: CHANGELOG.md ([ef54a3], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/ef54a339c72c36ce13a27672dff3cf89e35ddded))
8
+
9
+ # Version 3.0.66, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/75bb3540f20b528ed830505b80d99216d572121c)
10
+ * HT-14811: доработан внешний вид и открытие на редактирование характеристик FKV ([c55804], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/c558045e343890c69c03801984b203b238cae552))
11
+ * update: CHANGELOG.md ([dd323a], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/dd323a40af65c90d5ac4e59b03d48f365cbf003f))
12
+
13
+ # Version 3.0.65, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/b313f77a0208579201ce66ff042e5f548b54533d)
14
+ * ## Fixes
15
+ * <span style='color:red'> validator.mixin</span> ([8eadf3], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/8eadf3f0b3b2843e2ea42bc3e577ed6db9f1b62b))
16
+
17
+ * update: CHANGELOG.md ([196fe2], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/196fe2b32f8bacb0551b5517ce7b458548945f6a))
18
+
19
+ # Version 3.0.64, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/977abbf84dfd6b813420431d11c1202170cd2fe8)
20
+ * ## Fixes
21
+ * <span style='color:red'>fix show title only with staticText</span> ([05d479], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/05d479ef92447495d4246dda085656e2042b0889))
22
+
23
+ * update: CHANGELOG.md ([9b97b4], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/9b97b4c4ca9abfda170712cf594ffb725b9e9f03))
24
+
25
+ # Version 3.0.63, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/eb48b260e66b233a4cad92d0d856d0d8da4c021b)
26
+ # Version 3.0.62, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/d8f3faa85fc70860397b0074b43d93aa9b9ffa00)
27
+ * ## Fixes
28
+ * <span style='color:red'>fix csrf in ReportTreeStore</span> ([cb402a], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/cb402a1790a7b1081a5e8a17968db947ba583df9))
29
+
30
+ * HT-14775 fix: Исправление ширины системного тулбара ([bdd783], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/bdd7836f8eef889ec642e486e896d3910eeb1850))
5
31
  * update: CHANGELOG.md ([0624d1], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/0624d16d97c878b4e695b775a6a08cb00d3f12bd))
6
32
 
7
33
  # Version 3.0.61, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/0a79e6af1f962bbf5062d7a242281b679c4b0f35)
@@ -16,11 +42,12 @@
16
42
 
17
43
  * HT-13993 добавлена боковая панель фильтров для репортов ([e2d5c7], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/e2d5c7436900d232cd48c9389a685affbacf721a))
18
44
  * HT-14628 открытие компонента внутри репорта - закрытие через крестик ([fc4f4e], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/fc4f4e9112a3ba1a85cb4a064d65d7a7cfb8cec1))
19
- * prerelease urls ([da6a94], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/da6a94022df090290d9ff8f7ae96adf2f486fed8))
20
- * sync ([4f0a82], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/4f0a82ba634e89ef75c8c7006d691725c5252ba1))
21
- * sync ([f650de], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/f650de035c4135485bbe05745b372095d807c565))
22
- * upd ([47ade3], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/47ade3ed0f9782d87c3271b98fa746cb1f4d9157))
23
- * upd ([7f6bc5], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/7f6bc58a66df2cac0f35853416c2ef3a0c9a8455))
45
+ * update: CHANGELOG.md ([2ab856], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/2ab8566fb3c7400e91d3706a5bd8383d48060556))
46
+
47
+ # Version 3.0.60, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/b3ba3aeb89954b8e1650cb40e052a4509b4809fb)
48
+ * ## Fixes
49
+ * <span style='color:red'>fix validator, util.getByPath</span> ([608e70], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/608e7096603a0ed31656b0f45686bab7a4ee302b))
50
+
24
51
  * update: CHANGELOG.md ([e42a2a], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/e42a2a6fb8b511ba174ab5060fc84c683a046945))
25
52
 
26
53
  # Version 3.0.59, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/065a134b1f6c6211d56ef758b127778d5e104faa)
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "name": "ru.coon"
5
5
  },
6
6
  "description": "",
7
- "version": "3.0.62",
7
+ "version": "3.0.68",
8
8
  "repository": {
9
9
  "type": "git",
10
10
  "url": "git+http://gitlab-dbr.sigma-it.local/dbr/ru.coon"
@@ -7,8 +7,6 @@ Ext.define('Coon.app.Application', {
7
7
  applicationMainView: null,
8
8
  },
9
9
 
10
- links: {},
11
-
12
10
  init() {
13
11
  this.appRouter = Coon.app.Router;
14
12
  },
@@ -258,6 +256,7 @@ Ext.define('Coon.app.Application', {
258
256
  },
259
257
 
260
258
  launch: function() {
259
+ this.appRouter.onBeforeRouteEnterFn = this.isAuthenticated.bind(this);
261
260
  Ext.on('auth:logout', this.onLogout, this);
262
261
  let jwtToken;
263
262
  let beforeAuth = () => Promise.resolve();
package/src/app/Router.js CHANGED
@@ -1,8 +1,6 @@
1
1
  Ext.define('Coon.app.Router', {
2
2
  mixins: ['Ext.route.Mixin'],
3
3
  singleton: true,
4
-
5
- maxUrlLength: 2048,
6
4
  constructor() {
7
5
  this.setRoutes({
8
6
  '*': {before: 'onAny'},
@@ -10,17 +8,6 @@ Ext.define('Coon.app.Router', {
10
8
  action: 'onRouteEnter',
11
9
  before: 'validateMenuItem',
12
10
  },
13
- 'route/:{cmpId}?:{parameters}': {
14
- action: 'onSpecificRoute',
15
- conditions: {
16
- parameters: {
17
- re: '(.*)?',
18
- parse: function(values) {
19
- return Ext.isEmpty(values) ? {} : Ext.urlDecode(values);
20
- },
21
- },
22
- },
23
- },
24
11
  });
25
12
  Ext.on('router:goToLastRoute', () => {
26
13
  this.onRouteEnter(this.lastRoute);
@@ -29,27 +16,9 @@ Ext.define('Coon.app.Router', {
29
16
 
30
17
  lastRoute: null,
31
18
 
32
- onSpecificRoute(route) {
33
- route.urlHash = window.location.hash;
34
- if (route.urlHash.length > Coon.app.Router.maxUrlLength) {
35
- return;
36
- }
37
-
38
- if (this.getRouterView()) {
39
- Ext.create('Coon.common.component.OpenComponent', {})
40
- .loadUIElement(route.cmpId, route.parameters, {urlHash: route.urlHash});
41
- } else {
42
- Ext.getApplication().on('centerview:init', () => {
43
- Ext.create('Coon.common.component.OpenComponent', {})
44
- .loadUIElement(route.cmpId, route.parameters, {urlHash: route.urlHash});
45
- });
46
- }
47
- },
48
-
49
19
  onAny(action) {
50
20
  if (Ext.getApplication().isAuthenticated()) {
51
21
  action.resume();
52
- return true;
53
22
  } else {
54
23
  Coon.log.debug('beforeAnyRoute: not authorized');
55
24
  if (action.stop) {
@@ -77,7 +46,6 @@ Ext.define('Coon.app.Router', {
77
46
  route.stop();
78
47
  return;
79
48
  }
80
- route.urlHash = window.location.hash;
81
49
  return true;
82
50
  } catch (ex) {
83
51
  route.stop();
@@ -85,6 +53,24 @@ Ext.define('Coon.app.Router', {
85
53
  }
86
54
  },
87
55
 
56
+ onBeforeRouteEnterFn: null,
57
+
58
+ onBeforeRouteEnter() {
59
+ if (typeof this.onBeforeRouteEnterFn === 'function') {
60
+ return this.onBeforeRouteEnterFn();
61
+ }
62
+ return true;
63
+ },
64
+
65
+ onBeforeRouteEnterFailedFn: null,
66
+
67
+ onBeforeRouteEnterFailed() {
68
+ if (typeof this.onBeforeRouteEnterFailedFn === 'function') {
69
+ return this.onBeforeRouteEnterFailedFn();
70
+ }
71
+ return true;
72
+ },
73
+
88
74
  getLastRoute() {
89
75
  return this.lastRoute;
90
76
  },
@@ -99,7 +85,7 @@ Ext.define('Coon.app.Router', {
99
85
  },
100
86
 
101
87
  getRouterView() {
102
- return Ext.getApplication().links && Ext.getApplication().links.centerView;
88
+ return Ext.ComponentQuery.query('centerview')[0];
103
89
  },
104
90
 
105
91
  getActiveComponent() {
@@ -117,12 +103,4 @@ Ext.define('Coon.app.Router', {
117
103
  return jwtToken;
118
104
  },
119
105
 
120
- assign(urlHash) {
121
- if (urlHash.length <= Coon.app.Router.maxUrlLength) {
122
- window.location.assign(urlHash);
123
- } else {
124
- Coon.log.debug('urlHash too long');
125
- }
126
- },
127
-
128
106
  });
@@ -32,17 +32,14 @@ Ext.define('Coon.app.viewPort.CenterView', {
32
32
 
33
33
  initComponent() {
34
34
  this.callParent();
35
- Ext.getApplication().links.centerView = this;
35
+
36
36
  Ext.on('route:change', this.setMenuComponent, this);
37
+
37
38
  this.on('beforeadd', function() {
38
39
  return !this.isTabLimit();
39
40
  }, this);
41
+
40
42
  this.on('add', function(_, component) {
41
- component.on('activate', function(component) {
42
- if (typeof component.urlHash === 'string' && component.urlHash.startsWith('#')) {
43
- Coon.app.Router.assign(component.urlHash);
44
- }
45
- }, this);
46
43
  component.on('render', function() {
47
44
  this.setScrollButtonVisibility();
48
45
  }, this, {single: true});
@@ -50,8 +47,6 @@ Ext.define('Coon.app.viewPort.CenterView', {
50
47
  this.on('remove', function() {
51
48
  this.setScrollButtonVisibility();
52
49
  }, this);
53
-
54
- Ext.getApplication().fireEvent('centerview:init');
55
50
  },
56
51
 
57
52
  setScrollButtonVisibility() {
@@ -0,0 +1,17 @@
1
+ Ext.define('Coon.common.AbstractPlugin', {
2
+ extend: 'Ext.AbstractPlugin',
3
+
4
+ constructor(config) {
5
+ Ext.apply(this, config || {});
6
+
7
+ if (Array.isArray(this.validConfig)) {
8
+ const state = Coon.validator.isObjectValid(this.pluginConfig.properties, this.validConfig);
9
+ if (!state.valid) {
10
+ console.error(`Invalid configuration for plugin ${this.pluginConfig.name}:\n${state.errors}`);
11
+ }
12
+ this.pluginConfig.validity = state;
13
+ }
14
+
15
+ this.callParent([config]);
16
+ },
17
+ });
@@ -161,7 +161,6 @@ Ext.define('Coon.common.ComponentFactory', {
161
161
  }
162
162
  const instanceConfig = {
163
163
  xtype: 'CVWrapperPanel',
164
- urlHash: route.urlHash,
165
164
  closable: true,
166
165
  componentContext: config.componentContext,
167
166
  menuItem: config.menuItem,
@@ -200,10 +200,16 @@ Ext.define('Coon.uielement.component.characteristic.characteristicGroup.EntityGr
200
200
  if (context.field === 'mask') {
201
201
  const editor = context.record.get('editor');
202
202
  if (editor) {
203
- const proto = Ext.ClassManager.classes[Ext.ClassManager.aliasToName['widget.'+editor]].prototype;
204
- if (Ext.isObject(proto.editorOptions)) {
205
- context.column.field.triggers.info.show();
203
+ const editorClass = Ext.ClassManager.classes[Ext.ClassManager.aliasToName['widget.'+editor]];
204
+ if (editorClass) {
205
+ const proto = Ext.ClassManager.classes[Ext.ClassManager.aliasToName['widget.'+editor]].prototype;
206
+ if (Ext.isObject(proto.editorOptions)) {
207
+ context.column.field.triggers.info.show();
208
+ } else {
209
+ context.column.field.triggers.info.hide();
210
+ }
206
211
  } else {
212
+ console.error(`Редактор ${editor} не найден.`);
207
213
  context.column.field.triggers.info.hide();
208
214
  }
209
215
  } else {
@@ -226,6 +226,15 @@ Ext.define('Coon.common.component.editor.CharacteristicGridEditor', {
226
226
  } else {
227
227
  visibleValue = '';
228
228
  }
229
+ } else if (record.get('entity') == 'FKV') {
230
+ const mask = record.get('mask');
231
+ const maskText = mask.match(/link:"(.*?)"/);
232
+ if (maskText) {
233
+ meta.tdCls += ' FVK-cell_link';
234
+ visibleValue = maskText[1];
235
+ } else {
236
+ visibleValue = val;
237
+ }
229
238
  } else if (record.get(ns.$entity) === 'FLV' && !Ext.isEmpty(val)) {
230
239
  visibleValue = val.substring(40);
231
240
  } else {
@@ -236,7 +245,15 @@ Ext.define('Coon.common.component.editor.CharacteristicGridEditor', {
236
245
  }
237
246
  return Coon.format.withHint(visibleValue, visibleValue || tooltip);
238
247
  },
248
+
239
249
  getEditor: function(record) {
250
+ if (record.get('entity') === 'FKV') {
251
+ const mask = record.get('mask');
252
+ const maskText = mask.match(/link:"(.*?)"/);
253
+ if (maskText) {
254
+ return false;
255
+ }
256
+ }
240
257
  return Ext.create('Ext.grid.CellEditor', {
241
258
  field: Ext.create('Ext.form.field.Text', {
242
259
  allowBlank: false,
@@ -59,6 +59,16 @@
59
59
  }
60
60
  }
61
61
  }
62
+
63
+ .FVK-cell_link {
64
+ span {
65
+ color: #0B57D0;
66
+ &:hover {
67
+ text-decoration: underline;
68
+ cursor: pointer;
69
+ }
70
+ }
71
+ }
62
72
  }
63
73
 
64
74
  .CharacteristicGridEditor {
@@ -92,6 +92,8 @@ Ext.define('Coon.common.component.editor.TypedCharacteristicEditor', {
92
92
 
93
93
  this.on('edit', this.afterEditHandler, this);
94
94
  this.factory = this.createFactory();
95
+
96
+ this.on('cellclick', this.cellclickHandler, this);
95
97
  },
96
98
 
97
99
  createAdditionButtons: function() {
@@ -292,6 +294,18 @@ Ext.define('Coon.common.component.editor.TypedCharacteristicEditor', {
292
294
  }
293
295
  },
294
296
 
297
+ cellclickHandler(cmp, td, cellIndex, record) {
298
+ if (this.isEditableChar(record)) {
299
+ if (record.get('entity') === 'FKV') {
300
+ const mask = record.get('mask');
301
+ const maskText = mask.match(/link:"(.*?)"/);
302
+ if (maskText) {
303
+ this.prepareType(record);
304
+ }
305
+ }
306
+ }
307
+ },
308
+
295
309
  // private
296
310
  calculateState: function() {
297
311
  if (this.addTypeButton) {
File without changes
File without changes
@@ -866,6 +866,11 @@ Ext.define('Coon.report.component.ReportPanel', {
866
866
  }
867
867
  config[prefix + 'type'] = plugin[ns.$uiElement].xtype || plugin[ns.$xtype];
868
868
  config[ns.$sortSequence] = plugin[ns.$sortSequence] || null;
869
+ config.pluginConfig = {
870
+ properties: Object.assign({}, config),
871
+ type,
872
+ name: prefix + 'type',
873
+ };
869
874
  return config;
870
875
  });
871
876
  },
@@ -1033,7 +1038,7 @@ Ext.define('Coon.report.component.ReportPanel', {
1033
1038
  if (params.bar.items.length === 1) {
1034
1039
  return;
1035
1040
  }
1036
- params.bar.items.doSort((a, b) => {
1041
+ params.bar.items.sortBy((a, b) => {
1037
1042
  if (a.position !== b.position) {
1038
1043
  if (a.position < b.position) {
1039
1044
  return -1;
@@ -57,6 +57,7 @@ Ext.define('Coon.report.component.reportpanel.ReportGrid', {
57
57
  try {
58
58
  this.addPlugin(plugin);
59
59
  } catch (e) {
60
+ console.error('plugin error', e);
60
61
  pluginErrors.push(e.message);
61
62
  }
62
63
  });
@@ -16,6 +16,9 @@ Ext.define('Coon.report.component.reportpanel.ReportTreeStore', {
16
16
  getMethod: function() {
17
17
  return 'POST';
18
18
  },
19
+ getHeaders: function() {
20
+ return {'X-CSRF-Token': localStorage.getItem('CSRFToken')};
21
+ },
19
22
  url: 'ReportFormData/get',
20
23
  reader: {
21
24
  type: 'json',
@@ -92,21 +92,6 @@ Ext.define('Coon.report.plugin.configPanel.ControlColumnByParamPluginConfigPanel
92
92
  ];
93
93
  },
94
94
 
95
- addHandler: function(btn) {
96
- const grid = btn.up('panel').down('gridpanel');
97
- grid.getStore().add({paramValue: ''});
98
- const editor = grid.findPlugin('cellediting');
99
- editor.startEditByPosition({row: this.getStore().getCount() - 1, column: 0});
100
- },
101
-
102
- deleteHandler: function(btn) {
103
- const grid = btn.up('panel').down('gridpanel');
104
- const record = grid.getSelectionModel().getSelection()[0];
105
- if (record) {
106
- grid.getStore().remove(record);
107
- }
108
- },
109
-
110
95
  doInit: function(config) {
111
96
  this.grid.doInit(config['valueConfig']);
112
97
  },
@@ -108,7 +108,6 @@ Ext.define('Coon.report.plugin.grid.GridToolbarButtonPlugin', {
108
108
 
109
109
  computeInteractUIState() {
110
110
  const state = {disabled: false, hidden: !!this.invisibleByDefault};
111
-
112
111
  if (this.isButtonAdded()) {
113
112
  if (!this.dependOnGridParameters && !this.dependOnGridRow) {
114
113
  return state;
@@ -120,9 +119,20 @@ Ext.define('Coon.report.plugin.grid.GridToolbarButtonPlugin', {
120
119
  state.disabled = this.isFilterDependedParamEmpty();
121
120
  }
122
121
 
123
- if (!state.disabled && this.dependOnGridRow && this.isValidForRequiredParametersChecking()) {
124
- const isRequiredParametersPassed = this.isRequiredParametersPassed();
125
- state.disabled = this.skipRowValueCheck ? false : !isRequiredParametersPassed;
122
+ if (
123
+ !state.disabled &&
124
+ this.inputParametersConfig.haveRequiredReportParameters
125
+ ) {
126
+ state.disabled = !this.isRequiredParametersPassed('PRM');
127
+ }
128
+
129
+ if (
130
+ !state.disabled &&
131
+ this.dependOnGridRow &&
132
+ this.isValidForRequiredParametersChecking()
133
+ ) {
134
+ const isRequiredFLDParametersPassed = this.isRequiredParametersPassed('FLD');
135
+ state.disabled = this.skipRowValueCheck ? false : !isRequiredFLDParametersPassed;
126
136
  }
127
137
 
128
138
  state.hidden = this.isButtonHidden(state.disabled);
@@ -179,12 +189,27 @@ Ext.define('Coon.report.plugin.grid.GridToolbarButtonPlugin', {
179
189
  */
180
190
  computeRowInteractState() {
181
191
  let rowInteractEnabled= this.isRowInteractBySelection();
182
- if (rowInteractEnabled && !Ext.isEmpty(this.dependOnGridParameters)) {
192
+ if (
193
+ rowInteractEnabled &&
194
+ !Ext.isEmpty(this.dependOnGridParameters)
195
+ ) {
183
196
  rowInteractEnabled = !this.isFilterDependedParamEmpty();
184
197
  }
185
- if (rowInteractEnabled && this.dependOnGridRow && !this.isSelectionModelDefaultModeEnabled) {
186
- rowInteractEnabled = this.skipRowValueCheck ? true : this.isRequiredParametersPassed();
198
+
199
+ if (
200
+ rowInteractEnabled &&
201
+ this.inputParametersConfig.haveRequiredReportParameters
202
+ ) {
203
+ rowInteractEnabled = this.isRequiredParametersPassed('PRM');
204
+ }
205
+
206
+ if (
207
+ rowInteractEnabled &&
208
+ this.dependOnGridRow
209
+ ) {
210
+ rowInteractEnabled = this.skipRowValueCheck ? true : this.isRequiredParametersPassed('FLD');
187
211
  }
212
+
188
213
  return {
189
214
  rowInteractEnabled,
190
215
  };
@@ -225,6 +250,10 @@ Ext.define('Coon.report.plugin.grid.GridToolbarButtonPlugin', {
225
250
  }
226
251
  });
227
252
 
253
+ const haveRequiredReportParameters=
254
+ parameters.filter((param) => param.editable &&
255
+ param.reportNavigationOptionContextSource === 'PRM').length > 0;
256
+
228
257
  return {
229
258
  selectionDependencyType: multiDependencyParameters.length > 0 ? 'multi' : 'single',
230
259
  multiDependencyParameters,
@@ -232,6 +261,7 @@ Ext.define('Coon.report.plugin.grid.GridToolbarButtonPlugin', {
232
261
  notRequiredMultiParameters,
233
262
  defaultParameters: reportIndependentParameters,
234
263
  onlyIndependentParameters,
264
+ haveRequiredReportParameters,
235
265
  };
236
266
  },
237
267
 
@@ -276,32 +306,31 @@ Ext.define('Coon.report.plugin.grid.GridToolbarButtonPlugin', {
276
306
  },
277
307
 
278
308
  /**
279
- * Проверка того, что определены (заданы) значения входных параметров плагина, помеченных как обязательные.
280
- * В рассмотрение берутся только параметры:
281
- * PRM - параметр отчета
282
- * FLD - поле выбранной записи.
283
- * Достаточно чтобы значение было определено.
309
+ * Обязательные параметры плагина типа type (зависит от значения параметра репорта) настроены и заполнены.
310
+ * @param {string} type тип пареметра плагина (FLD, PRM)
284
311
  * @returns {boolean}
285
312
  */
286
- isRequiredParametersPassed() {
287
- const parameters = this.getRequiredParameters();
313
+ isRequiredParametersPassed(type) {
314
+ const parameters = this.getRequiredParameters(type);
288
315
  if (parameters.length === 0) {
289
316
  return true;
290
317
  }
291
- const selected = this.component.getSelectionModel().getLastSelected();
292
-
293
318
  return parameters.every((param) => {
294
- const paramValue = this.getParamValue(param, selected);
319
+ const paramValue = this.getParamValue(param);
295
320
  return !Ext.isEmpty(paramValue);
296
321
  });
297
322
  },
298
323
 
299
- getRequiredParameters() {
324
+ getRequiredParameters(type) {
300
325
  const params = Array.isArray(this.parameters) ? this.parameters : [this.parameters];
301
- return params.filter((param) => param && param.editable);
326
+ return params.filter((param) =>
327
+ param &&
328
+ param.editable &&
329
+ (!type || type === param.reportNavigationOptionContextSource)
330
+ );
302
331
  },
303
332
 
304
- getParamValue(param, selectedRecord) {
333
+ getParamValue(param) {
305
334
  const {
306
335
  defaultValue,
307
336
  reportNavigationOptionContextSource: source,
@@ -314,7 +343,7 @@ Ext.define('Coon.report.plugin.grid.GridToolbarButtonPlugin', {
314
343
 
315
344
  switch (source) {
316
345
  case 'FLD':
317
- return selectedRecord?.get(field);
346
+ return this.component.getContextManager()?.getSelectedRecord()?.get(field);
318
347
  case 'PRM':
319
348
  return this.component.contextMenu?.params?.[field];
320
349
  default: