ru.coon 2.7.41 → 2.7.42

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,15 @@
1
+ # Version 2.7.42, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/78db40df67dd733a9e7f3df492c880fbf80dd426)
2
+ * ## Features
3
+ * <span style='color:green'>feat: add search in CustomPanelEditor plugins
4
+ fix: restore version of custom panel in editor</span> ([53a300], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/53a3008f800de7d5614b6225dc60f4e4f4ff28a6))
5
+
6
+ * ## Fixes
7
+ * <span style='color:red'> HT-9040 add disabled icon</span> ([ea806c], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/ea806cdaad4ef51c1095a232aff6c089c59a37a5))
8
+ * <span style='color:red'> HT-9040 add disabled icon</span> ([9cf233], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/9cf23309d417947c8f5ee39ce5d58393e8e14cf6))
9
+
10
+ * HT-9216 fix: доработка обработки шаблона в имени файла в CopyRowsPlugin ([ed9e16], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/ed9e16066620ac86bd2075e5649ad181b6c28f9e))
11
+ * update: CHANGELOG.md ([35df54], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/35df54911b78b36e0f8928c431bd20c9e1a5c8e0))
12
+
1
13
  # Version 2.7.41, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/272f9a2bc799a85971259fa4725466066e367b6e)
2
14
  * ## Fixes
3
15
  * <span style='color:red'> HT-9216 Исправлена конфигурация плагина.</span> ([94b8b8], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/94b8b873bd5a4e07a17c2307564f80375b7b73ba))
@@ -29,6 +41,8 @@
29
41
  # Version 2.7.37, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/9c30533f4a94a056b7723c7bf7e07379a979e3fd)
30
42
  * ## Fixes
31
43
  * <span style='color:red'> HT-9272 ExportReportDataToFilePlugin add property exportAllRows</span> ([58af00], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/58af00a085a964d6fcc2c2eca42ec98d4137b373))
44
+ * <span style='color:red'> TR-67883 in checkbox visibleSwitch change fieldLabel to boxlabel</span> ([611601], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/611601afa0a86ff987d40135a5f003f4fc6faa21))
45
+ * <span style='color:red'> TR-67883 edit existing menu and checking duplicate workspace</span> ([00e2a0], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/00e2a0d352d74930a6a05602f47e6d5300dfc025))
32
46
 
33
47
  * update: CHANGELOG.md ([0ed1ed], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/0ed1edefa3a1a5c3bee5bf4cac0da1ba663026b3))
34
48
 
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "name": "ru.coon"
5
5
  },
6
6
  "description": "",
7
- "version": "2.7.41",
7
+ "version": "2.7.42",
8
8
  "repository": {
9
9
  "type": "git",
10
10
  "url": "git+http://gitlab-dbr.sigma-it.local/dbr/ru.coon"
@@ -0,0 +1,5 @@
1
+ Ext.define('Coon.common.field.checkbox.RoundCheckbox', {
2
+ extend: 'Ext.form.field.Checkbox',
3
+ cls: 'RoundCheckbox',
4
+ xtype: ['roundcheckbox', 'RoundCheckbox'],
5
+ });
@@ -0,0 +1,48 @@
1
+ .x-form-fieldCheckbox {
2
+ .x-form-field {
3
+ position: relative;
4
+ }
5
+
6
+ .x-form-field label {
7
+ background-color: #fff;
8
+ border: 1px solid #ccc;
9
+ border-radius: 50%;
10
+ cursor: pointer;
11
+ height: 28px;
12
+ left: 0;
13
+ position: absolute;
14
+ top: 0;
15
+ width: 28px;
16
+ }
17
+
18
+ .x-form-field label:after {
19
+ border: 2px solid #fff;
20
+ border-top: none;
21
+ border-right: none;
22
+ content: "";
23
+ height: 6px;
24
+ left: 7px;
25
+ opacity: 0;
26
+ position: absolute;
27
+ top: 8px;
28
+ transform: rotate(-45deg);
29
+ width: 12px;
30
+ }
31
+
32
+ .x-form-field input[type="checkbox"] {
33
+ visibility: hidden;
34
+ }
35
+
36
+ .x-form-field input[type="checkbox"]:checked + label {
37
+ background-color: #66bb6a;
38
+ border-color: #66bb6a;
39
+ }
40
+
41
+ .x-form-field input[type="checkbox"]:checked + label:after {
42
+ opacity: 1;
43
+ }
44
+
45
+ .x-form-item-body, .x-form-cb-wrap-inner {
46
+ margin: 0 auto;
47
+ }
48
+ }
@@ -101,7 +101,8 @@ Ext.define('Coon.common.panel.MainUploadPanel', {
101
101
  return [
102
102
  Ext.create('Ext.Button', {
103
103
  text: 'Загрузить',
104
- disabled: !this.hidden,
104
+ disabled: true,
105
+ itemId: 'submitButton',
105
106
  reference: 'submitButton',
106
107
  hidden: this.hideButtons,
107
108
  handler: this.submitFunction.bind(this),
@@ -109,7 +110,8 @@ Ext.define('Coon.common.panel.MainUploadPanel', {
109
110
  }),
110
111
 
111
112
  Ext.create('Ext.Button', {
112
- text: Coon.MessageResources.getMessage('Ext.ccb.uploadforms.closeButton', 'Закрыть'),
113
+ text: 'Закрыть',
114
+ itemId: 'closeButton',
113
115
  reference: 'closeButton',
114
116
  handler: this.closeFunction.bind(this),
115
117
  hidden: this.hideButtons,
@@ -140,10 +142,8 @@ Ext.define('Coon.common.panel.MainUploadPanel', {
140
142
  ];
141
143
  },
142
144
  onFileSelect: function(value) {
143
- const loadButton = this.query('[reference="submitButton"]')[0];
144
- if (!loadButton.hidden) {
145
- loadButton.setDisabled(!value);
146
- }
145
+ const loadButton = this.down('#submitButton');
146
+ loadButton.setDisabled(!value);
147
147
  },
148
148
 
149
149
  clearForm: function() {
@@ -0,0 +1,23 @@
1
+ Ext.define('Coon.nav.MenuLoader', {
2
+ singleton: true,
3
+
4
+ isLoaded: false,
5
+
6
+ load() {
7
+ return Coon.util.promisifyCmd('command.GetDynamicReportDataCommand', 'MENU_ALLITEMS')
8
+ .then((data) => {
9
+ if (Array.isArray(data.list)) {
10
+ this.uiElementMap = data.list.reduce();
11
+ }
12
+ this.isLoaded = true;
13
+ });
14
+ },
15
+
16
+ get() {
17
+
18
+ },
19
+
20
+ isValidMenuItem(uiEmentId) {
21
+ return this.uiElementMap.has(uiEmentId);
22
+ },
23
+ });
@@ -67,7 +67,7 @@ Ext.define('Coon.nav.editor.menu.form.NavMenuFormView', {
67
67
  items: [
68
68
  {
69
69
  xtype: 'checkbox',
70
- fieldLabel: 'Видимый',
70
+ boxLabel: 'Видимый',
71
71
  bind: '{menu.visibleSwitch}',
72
72
  }
73
73
  ],
@@ -23,7 +23,7 @@ Ext.define('Coon.nav.editor.menu.form.NavMenuFormViewController', {
23
23
 
24
24
  /**
25
25
  * получение данных об элементе меню по id при откртыии формы для редактирования
26
- * @param {String} workspaceId
26
+ * @param {String} menuId
27
27
  */
28
28
 
29
29
  doInit: function(menuId) {
@@ -98,8 +98,8 @@ Ext.define('Coon.nav.editor.menu.form.NavMenuFormViewController', {
98
98
  params: {reportId: 'MENU_ALLITEMS', parameterList: `[{"type":"MENU_ENTRY_CD","value":"${data.menuId}"}]`},
99
99
  })
100
100
  .then((resp) => {
101
- if (resp.totalCount > 0) {
102
- Ext.Msg.alert('Ошибка', `Пункт мено с идентификатором ${data.menuId} уже существует`);
101
+ if (vm.get('newMenu') && resp.totalCount > 0) {
102
+ Ext.Msg.alert('Ошибка', `Пункт меню с идентификатором ${data.menuId} уже существует`);
103
103
  } else {
104
104
  Coon.util.promisifyCmd('command.' + commandClass, data)
105
105
  .then((menuBean) => {
@@ -149,7 +149,6 @@ Ext.define('Coon.nav.editor.menu.form.NavMenuFormViewController', {
149
149
  win.show();
150
150
  win.content.doInit('UI_ELEMENTS_LIST', {
151
151
  UI_ELEMENT_CD: editorField.getValue(),
152
- UI_ELEMENT_CD: editorField.getValue(),
153
152
  }, !!editorField.getValue());
154
153
  },
155
154
 
@@ -85,6 +85,22 @@ Ext.define('Coon.nav.editor.workspace.form.NavWorkspaceFormController', {
85
85
  iconClassButton && iconClassButton.setIconCls(iconClassField.getValue());
86
86
  },
87
87
 
88
+ /**
89
+ * Срабатывает при сохранении формы
90
+ * Пелучаем данные формы и обрабатывает пустые значения (для postgres)
91
+ */
92
+
93
+ getSavedData() {
94
+ const vmData = this.getViewModel().get('workspace');
95
+ const data = {};
96
+ if (Ext.isObject(vmData)) {
97
+ for (const [key, value] of Object.entries(vmData)) {
98
+ data[key] = !Ext.isString(value) || value.trim() ? value : null;
99
+ }
100
+ }
101
+ return data;
102
+ },
103
+
88
104
  /**
89
105
  * Срабатывает при сохранении формы
90
106
  * Вызывает команду по добавлению/сохранению данных о рабочем пространстве
@@ -94,15 +110,31 @@ Ext.define('Coon.nav.editor.workspace.form.NavWorkspaceFormController', {
94
110
  if (this.validate()) {
95
111
  const vm = this.getViewModel();
96
112
  const commandClass = vm.get('newWorkspace') ? 'AddWorkspaceCommand' : 'SaveWorkspaceCommand';
97
- Coon.util.promisifyCmd('command.' + commandClass, vm.get('workspace'))
98
- .then((workspaceBean) => {
99
- vm.set('workspace', workspaceBean);
100
- Ext.fireEvent('nav:reload');
101
- this.getView().close();
113
+ const data = this.getSavedData();
114
+ Coon.util.promisifyCmd({
115
+ command: 'command.GetDynamicReportDataCommand',
116
+ params: {reportId: 'WORKSPACE_LIST'},
117
+ })
118
+ .then((resp) => {
119
+ const isDuplicateWorkspace = resp.list.find((workspace) => workspace.WORKSPACE_CD === data.workspaceId);
120
+ if (vm.get('newWorkspace') && isDuplicateWorkspace) {
121
+ Ext.Msg.alert('Ошибка', `Рабочее пространство с идентификатором ${data.workspaceId} уже существует`);
122
+ } else {
123
+ Coon.util.promisifyCmd('command.' + commandClass, vm.get('workspace'))
124
+ .then((workspaceBean) => {
125
+ vm.set('workspace', workspaceBean);
126
+ Ext.fireEvent('nav:reload');
127
+ this.getView().close();
128
+ })
129
+ .catch((error) => {
130
+ Coon.log.debug(error);
131
+ Ext.Msg.alert(error.toString());
132
+ });
133
+ }
102
134
  })
103
135
  .catch((error) => {
104
136
  Coon.log.debug(error);
105
- Ext.Msg.alert(error.toString());
137
+ Ext.Msg.alert('Ошибка', error.toString());
106
138
  });
107
139
  }
108
140
  },
@@ -95,6 +95,7 @@ Ext.define('Coon.report.plugin.configPanel.CopyRowsFromGridConfigPanel', {
95
95
  ];
96
96
  },
97
97
  setContext: function(context) {
98
+ this.context = context;
98
99
  this.callParent(arguments);
99
100
  const visibleFields = context && context.fields ? context.fields.filter((field) => field.visibleSwitch === true) : [];
100
101
  if (visibleFields && visibleFields.length) {
@@ -161,20 +162,7 @@ Ext.define('Coon.report.plugin.configPanel.CopyRowsFromGridConfigPanel', {
161
162
  fieldLabel: 'Имя файла (без расширения)',
162
163
  name: 'reportFileName',
163
164
  msgTarget: 'under',
164
- validator: (value) => {
165
- if (Ext.isEmpty(value)) {
166
- return true;
167
- }
168
- const isValid = (function() {
169
- const rg1 = /^[^\\/:\*\?"<>\|]+$/; // запрещенные символы \ / : * ? " < > |
170
- const rg2 = /^\./; // не должно начинаться с точки (.)
171
- const rg3 = /^(nul|prn|con|lpt[0-9]|com[0-9])(\.|$)/i; // запрещенные имена файлов
172
- return function isValid(fname) {
173
- return rg1.test(fname) && !rg2.test(fname) && !rg3.test(fname);
174
- };
175
- })();
176
- return !isValid(value) ? 'Недопустимое имя файла' : true;
177
- },
165
+ validator: this.reportFileNameValidator.bind(this),
178
166
  },
179
167
  {
180
168
  xtype: 'container',
@@ -399,4 +387,36 @@ Ext.define('Coon.report.plugin.configPanel.CopyRowsFromGridConfigPanel', {
399
387
  value: true,
400
388
  };
401
389
  },
390
+
391
+ reportFileNameValidator: function(value) {
392
+ if (Ext.isEmpty(value)) {
393
+ return true;
394
+ }
395
+
396
+ let templateErrorMessage;
397
+ try {
398
+ const params = {};
399
+ this.context.parameters.forEach((parameter) => {
400
+ params[parameter['reportParameterCd']] = '';
401
+ });
402
+ new Ext.XTemplate(value, {strict: true}).apply({
403
+ parameters: params,
404
+ });
405
+ } catch (err) {
406
+ templateErrorMessage = `Ошибка в шаблоне: ${err.message}`;
407
+ Coon.log.warn(templateErrorMessage);
408
+ }
409
+
410
+ const isValid = (function() {
411
+ const rg1 = /^[^\\/:\*\?"<>\|]+$/; // запрещенные символы \ / : * ? " < > |
412
+ const rg2 = /^\./; // не должно начинаться с точки (.)
413
+ const rg3 = /^(nul|prn|con|lpt[0-9]|com[0-9])(\.|$)/i; // запрещенные имена файлов
414
+ return function isValid(fname) {
415
+ return rg1.test(fname) && !rg2.test(fname) && !rg3.test(fname);
416
+ };
417
+ })();
418
+
419
+ return !isValid(value) ? 'Недопустимое имя файла':
420
+ templateErrorMessage ? templateErrorMessage: true;
421
+ },
402
422
  });
@@ -389,7 +389,7 @@ Ext.define('Coon.report.plugin.grid.CopyRowsFromGrid', {
389
389
  execute: function() {
390
390
  const reportPanel = this.component.up('ReportPanel');
391
391
  const selected = this.getSelected()[0];
392
- const name = this.getParameterPartName(this.reportFileName) ||
392
+ const name = this.getTemplatedFileName(this.reportFileName) ||
393
393
  (selected && selected.data['CM_REPORT_CD']) ||
394
394
  this.tryToGetTitle() ||
395
395
  (reportPanel && reportPanel.reportId) ||
@@ -423,17 +423,23 @@ Ext.define('Coon.report.plugin.grid.CopyRowsFromGrid', {
423
423
  reportPanel && reportPanel.unmask();
424
424
  },
425
425
 
426
- getParameterPartName: function(message) {
427
- if (Ext.isString(message) && message.match(/{.*}/g) !== null) {
428
- return this.getTemplatedMessage(message);
426
+ /**
427
+ * Имя файла может содержать шаблон
428
+ * @param fileName имя файла
429
+ * @returns {*}
430
+ */
431
+ getTemplatedFileName: function(fileName) {
432
+ if (!Ext.isString(fileName) || fileName.match(/{.*}/g) === null) {
433
+ return fileName;
429
434
  }
430
- return message;
431
- },
432
-
433
- getTemplatedMessage: function(message) {
434
- return new Ext.XTemplate(message).apply({
435
- parameters: this.component.up('ReportPanel').currentParamList,
436
- });
435
+ try {
436
+ fileName = new Ext.XTemplate(fileName, {strict: true}).apply({
437
+ parameters: this.component.up('ReportPanel').currentParamList,
438
+ });
439
+ } catch (err) {
440
+ Coon.log.warn(err);
441
+ }
442
+ return fileName;
437
443
  },
438
444
 
439
445
  normalizeFileName: function(fileName) {
@@ -0,0 +1,7 @@
1
+ **спецификация:**
2
+
3
+ входные параметры:
4
+
5
+ - exportFileFormat [xls/pdf]
6
+ - allowUserSelectColumnsToUpload
7
+ - addToSearchButton добавить в кнопку "поиск", в этом случае в качестве параметра отправляем текущие параметры из FilterPanel(useRawFilterParams: true)
@@ -10,10 +10,14 @@ Ext.define('Coon.report.plugin.grid.TreeNestingToolbarButtonPlugin', {
10
10
 
11
11
  isSingle: true,
12
12
 
13
+ iconEnabled: 'svg-icon svg-icon-scheme-3',
14
+ iconDisabled: 'svg-icon svg-icon-disabled svg-icon-scheme-3',
15
+
13
16
  createToolbarItem: function() {
14
17
  this.nestingButton = Ext.create({
15
18
  xtype: 'button',
16
- iconCls: 'svg-icon svg-icon-scheme-3',
19
+ iconCls: this.iconDisabled,
20
+ ui: 'blue-text-button',
17
21
  disabled: true,
18
22
  width: 66,
19
23
  height: 40,
@@ -32,15 +36,21 @@ Ext.define('Coon.report.plugin.grid.TreeNestingToolbarButtonPlugin', {
32
36
  reportTree.getStore().on('load', function() {
33
37
  const records = reportTree.getStore().getRange();
34
38
  if (!records.length) {
39
+ this.setDisabledButton(true, this.iconDisabled, null);
35
40
  return;
36
41
  }
37
42
 
38
- const menus = this.getMenu(reportTree);
39
- this.nestingButton.setDisabled(false);
40
- this.nestingButton.setMenu(menus, false);
43
+ const menu = this.getMenu(reportTree);
44
+ this.setDisabledButton(false, this.iconEnabled, menu);
41
45
  }, this);
42
46
  },
43
47
 
48
+ setDisabledButton: function(isDisabled, icon, menu) {
49
+ this.nestingButton.setDisabled(isDisabled);
50
+ this.nestingButton.setIconCls(icon);
51
+ this.nestingButton.setMenu(menu, false);
52
+ },
53
+
44
54
  getMenu: function(reportTree) {
45
55
  return [
46
56
  {
@@ -69,7 +69,7 @@ Ext.define('Coon.uielement.component.settings.plugin.UiCustomPanelPluginGrid', {
69
69
  this.fireEvent('dataUpdated');
70
70
  },
71
71
  getData: function() {
72
- return this.getStore().getRange().map((rec) => rec.getData());
72
+ return this.getStore().getDataSource().getRange().map((rec) => rec.getData());
73
73
  },
74
74
 
75
75
  excludePtypes() {
@@ -113,6 +113,23 @@ Ext.define('Coon.uielement.component.settings.plugin.UiCustomPanelPluginGrid', {
113
113
  listeners: {
114
114
  select: 'addHandler',
115
115
  },
116
+ },
117
+ {
118
+ xtype: 'textfield',
119
+ emptyText: 'фильтр по тексту в плагинах',
120
+ flex: 1,
121
+ listeners: {
122
+ change: 'searchInPlugins',
123
+ },
124
+ triggers: {
125
+ clear: {
126
+ cls: 'svg-icon svg-icon-cancel-small',
127
+ tooltip: 'Очистить поле',
128
+ handler: function() {
129
+ this.clear();
130
+ },
131
+ },
132
+ },
116
133
  }
117
134
  ],
118
135
  }],
@@ -201,6 +218,5 @@ Ext.define('Coon.uielement.component.settings.plugin.UiCustomPanelPluginGrid', {
201
218
  this.callParent(arguments);
202
219
  const state = Ext.state.Manager.getProvider().get('UiCustomPanelPluginGrid') || {};
203
220
  this.setPinned(state.pinned);
204
- Coon.log.debug(state, this);
205
221
  },
206
222
  });
@@ -25,6 +25,16 @@ Ext.define('Coon.uielement.component.settings.plugin.UiCustomPanelPluginGridCont
25
25
  });
26
26
  },
27
27
 
28
+ searchInPlugins(field, value) {
29
+ const filterByText = (plugin) => JSON.stringify(plugin.get('jsonProperties')).includes(value);
30
+ const store = this.getView().getStore();
31
+ if (value) {
32
+ store.addFilter(filterByText);
33
+ } else {
34
+ store.clearFilter();
35
+ }
36
+ },
37
+
28
38
  getNextIDSeq: function() {
29
39
  let maxSeqID = 0;
30
40
  this.getView().getStore().each(function(record) {
@@ -83,7 +83,8 @@ Ext.define('Coon.uielement.component.settings.version.UiCPVersionPanelController
83
83
  const record = grid.getSelection()[0];
84
84
  const version = vm.get('version');
85
85
  if (record && version) {
86
- this.getView().fireEvent('loadUiElementBean', version);
86
+ const controller = this.getView().up('UiCustomPanelEditor').getController();
87
+ controller.loadUiElementBean(version);
87
88
  }
88
89
  },
89
90
  onApplyChanges: function(elem) {
@@ -1,5 +1,5 @@
1
1
  Ext.define('Coon.uielement.plugin.AddOutputParamsPlugin', {
2
- extend: 'Ext.plugin.Abstract',
2
+ extend: 'Coon.uielement.plugin.CustomPanelPlugin',
3
3
  alias: 'plugin.AddOutputParamsPlugin',
4
4
  configurePanelWizardForFormEditor: 'AddOutputParamsPluginConfigPanelFormEditor',
5
5
  config: {
@@ -0,0 +1,18 @@
1
+ Ext.define('Coon.uielement.plugin.CustomPanelPlugin', {
2
+ extend: 'Ext.AbstractPlugin',
3
+
4
+ bindHandler() {
5
+ let scope;
6
+ if (this.getScope && this.getScope() === 'view') {
7
+ scope = this.getCmp();
8
+ } else {
9
+ scope = this.getCmp().getController() || this.getCmp();
10
+ }
11
+ if (!this.handlerName) {
12
+ throw new Error(`${this.$className}: handlerName cant be empty!`);
13
+ }
14
+
15
+ Coon.util.bindMethods(this.handlerName, scope, this.getCmp(), scope);
16
+ return scope;
17
+ },
18
+ });
package/src/version.js CHANGED
@@ -1,4 +1,4 @@
1
1
  Ext.define('Coon.version', {
2
2
  singleton: true,
3
- number: '2.7.41',
3
+ number: '2.7.42',
4
4
  });