ru.coon 2.5.63 → 2.5.65

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,8 +1,30 @@
1
+ # Version 2.5.65, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/64478c87b5169b1d5be5b28bae8b82ada2477f32)
2
+ * ## Fixes
3
+ * <span style='color:red'> HT-7918 WindowWrap missing focus</span> ([0bdf38], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/0bdf38c03dbd1cac10c9f2d8ea5d0786909d68e1))
4
+
5
+ * update: CHANGELOG.md ([4a4d82], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/4a4d820afb7cfa7df56e325ba7435a3ecdfff712))
6
+
7
+ # Version 2.5.64, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/9f48777236abed76cf08cd5cef56e7f9be0dac63)
8
+ * ## Features
9
+ * <span style='color:green'>feat: HT-7955: focus CP before save action, set cell editing values in grids</span> ([4c6578], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/4c6578c6873cd21c509de304494938276e7367a9))
10
+ * <span style='color:green'>feat: BFL-9365 move TimeEditorCreator and DeliveryTimeField from ISWE</span> ([12c3c7], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/12c3c701ac9387f4d2918a9feb1840bf0f7fb3ea))
11
+ * <span style='color:green'>feat: HT-7281 GridEditorPlugin editor dependField</span> ([387052], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/38705228276f86858100b6b43c0e204bcc6f26b7))
12
+
13
+ * ## Fixes
14
+ * <span style='color:red'>Fix:HT-7887 fix filterItemsOnRow property in ReportFormParameterEditPanel</span> ([c10ca9], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/c10ca98610970df2f51ca39fe698e278db6fe719))
15
+ * <span style='color:red'> HT-7941: check if do not have saved data object then close window</span> ([0baf4e], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/0baf4ea72862a4a61230ffc3ac0af7f8b065d794))
16
+
17
+ * remove unnecessary filterItemsOnRow property ([772f61], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/772f6190df8b958bd6ff97e5731a59971c9a11fc))
18
+ * update: CHANGELOG.md ([2ec18c], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/2ec18ccddcb1d571ef6a1d00b9cde439355c8304))
19
+
1
20
  # Version 2.5.63, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/49035e56acea653959f01f96ea96a10d962b1424)
2
21
  * BFL-10644 ([e02d63], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/e02d636d78004a9687ab5715ce2787fcf50abe5a))
3
22
  * update: CHANGELOG.md ([e3238f], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/e3238fb0cd5428b0f941440a297868db68ae4f69))
4
23
 
5
24
  # Version 2.5.62, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/aeeccacd770cc533281e3d05d7d840b35607ebf9)
25
+ * ## Features
26
+ * <span style='color:green'>feat: HT-7281 GridEditorPlugin editor dependField</span> ([cbf672], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/cbf67227388b27e73167666922835d1689d88a0d))
27
+
6
28
  * ## Fixes
7
29
  * <span style='color:red'> HT-7718: add check - break chain when method return false in MethodChainPlugin. reject error on command complete failure in ExecuteCommandPlugin</span> ([293aae], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/293aae575e1abb231ecc07fc6707880eecba61ad))
8
30
 
@@ -10,6 +32,7 @@
10
32
 
11
33
  # Version 2.5.61, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/8b05280ab5f9f1f4f80aa8f7bdff7755ff8d5cb1)
12
34
  * ## Features
35
+ * <span style='color:green'>feat: HT-7281 GridEditorPlugin editor dependField</span> ([cbc841], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/cbc84116414b7d52c8711e4085f8711707c15a24))
13
36
  * <span style='color:green'>Feat:HT-7506 Add search by substring in SimpleReportTag</span> ([44ed94], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/44ed94ddfeea30f605174f005ee314211d21a022))
14
37
 
15
38
  * ## Fixes
@@ -79,6 +102,7 @@
79
102
  * <span style='color:green'>feat: HT-7346: remove callback prepare data function</span> ([968a10], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/968a10cd85fb68fb13f4f3887d1785c73934e4cd))
80
103
  * <span style='color:green'>feat: BFL-10334: add export csv button</span> ([5c067e], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/5c067e688795ac9b4341be80ab0909572d899f90))
81
104
  * <span style='color:green'>feat: BFL-10334: add export csv button</span> ([afe199], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/afe199fc47b3587dc076debbc9b8e824c4421ed8))
105
+ * <span style='color:green'>feat: HT-7281 GridEditorPlugin editor dependField</span> ([b4b805], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/b4b805ab85470c7af499b6f66d11de7746a847ca))
82
106
  * <span style='color:green'>feat: HT-7346: get save function return value for call close window functiion</span> ([f0bea7], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/f0bea74091a045b2477d8518d5d07c4ee2ae3fa1))
83
107
  * <span style='color:green'>feat: HT-7346: get save function return value for call close window functiion</span> ([86806d], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/86806d51d6a38fce1a4754d3c8497a6957841e1d))
84
108
 
@@ -105,6 +129,7 @@
105
129
  # Version 2.5.50, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/b79597948d4412d8613b028e5e07e49cfb173eb4)
106
130
  * ## Features
107
131
  * <span style='color:green'>feat: HT-7346: rename plugin</span> ([e06f2c], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/e06f2cd09c83890ca955c6a11d3071a8d31a1528))
132
+ * <span style='color:green'>feat: HT-7281 GridEditorPlugin editor dependField</span> ([8496f6], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/8496f6811c6e744652641758f2af3b49c358c51c))
108
133
 
109
134
  * update: CHANGELOG.md ([9ca215], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/9ca2159b8222b4953516c7720fc9f5dbe03e4337))
110
135
 
@@ -145,6 +170,9 @@ fix ExecuteCommandPlugin - remove reject on failure if command hasnt erorHandler
145
170
  * update: CHANGELOG.md ([4d5a2a], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/4d5a2ac3120c4aba6a672256fc7cc977014f3591))
146
171
 
147
172
  # Version 2.5.46, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/a60918e34030d42d694153e8a86fa2c13c97e3a0)
173
+ * ## Fixes
174
+ * <span style='color:red'>fix ReportSqlPreviewPanel buttons</span> ([850095], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/850095956abc939ab8e45f18e19f4d50d3963e96))
175
+
148
176
  * Update src/util.js ([da9c30], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/da9c307688b60cfa198137929578f257e3d0645f))
149
177
  * HT-7570 Падает SelectionModelFeature ([df48e2], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/df48e24511eec0e5572d30984fbf6d24ec2e09cd))
150
178
  * HT-7570 Падает SelectionModelFeature ([09366e], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/09366ee08c7700ba03ea46ebb5bc9461963ea9d3))
@@ -161,6 +189,9 @@ fix ExecuteCommandPlugin - remove reject on failure if command hasnt erorHandler
161
189
  * update: CHANGELOG.md ([8b0186], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/8b0186d787ec77ad2a4dfc211e85c8ffadee6559))
162
190
 
163
191
  # Version 2.5.44, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/0c4d4a663ae3451dec321c0d68bf1d5c8d70ff58)
192
+ * ## Features
193
+ * <span style='color:green'>feat: Добавлен просмотр шаблона запроса в сравнении с оригинальным текстом запроса. Closes HT-7489.</span> ([10ea27], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/10ea27c06ddbb48922272c25643da3a2a98c23f7))
194
+
164
195
  * ## Fixes
165
196
  * <span style='color:red'> HT-7469: commit store state on doInit action. This method remove all modified records from store state</span> ([34c025], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/34c02583013b66314a74c2fbc9512f04f218d85e))
166
197
 
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "name": "ru.coon"
5
5
  },
6
6
  "description": "",
7
- "version": "2.5.63",
7
+ "version": "2.5.65",
8
8
  "repository": {
9
9
  "type": "git",
10
10
  "url": "git+http://gitlab-dbr.sigma-it.local/dbr/ru.coon"
@@ -0,0 +1,14 @@
1
+ Ext.define('Coon.common.component.editor.creators.TimeEditorCreator', {
2
+ extend: 'Coon.common.component.editor.creators.BaseEditorCreator',
3
+ alias: 'widget.TimeEditorCreator',
4
+
5
+ createField: function(record, parent) {
6
+ const charNs = Coon.report.model.CharacteristicBeanFields;
7
+
8
+ return Ext.create({
9
+ xtype: 'DeliveryTimeField',
10
+ format: record.get(charNs.$mask).trim() || 'H:i',
11
+ increment: 60,
12
+ });
13
+ },
14
+ });
@@ -0,0 +1,30 @@
1
+ Ext.define('Coon.common.field.DeliveryTimeField', {
2
+ extend: 'Ext.form.field.Time',
3
+ alias: 'widget.DeliveryTimeField',
4
+ displayField: 'date',
5
+
6
+ initComponent: function() {
7
+ this.callParent();
8
+ this.bindStore(this.createStore(), false);
9
+ },
10
+
11
+ createStore: function() {
12
+ const initDate = [2008, 0, 1];
13
+ const times = [];
14
+ let min = new Date(initDate[0], initDate[1], initDate[2], 8);
15
+ const max = new Date(initDate[0], initDate[1], initDate[2] + 1, 7);
16
+
17
+ while (min <= max) {
18
+ times.push({
19
+ date: Ext.Date.format(min, this.format),
20
+ });
21
+ min = Ext.Date.add(min, 'mi', this.increment);
22
+ }
23
+
24
+ return times;
25
+ },
26
+
27
+ getValue: function() {
28
+ return this.rawValue;
29
+ },
30
+ });
@@ -115,7 +115,7 @@ Ext.define('Coon.common.panel.WindowWrap', {
115
115
  }];
116
116
  }
117
117
  this.callParent();
118
- this.defaultFocus = this.readOnly ? undefined : (panel.defaultFocus || 'textfield[hidden=false][readOnly=false]');
118
+ this.setFocusTarget(panel);
119
119
  this.content = this.items.getAt(0);
120
120
  this.title = Ext.isEmpty(this.title) ? this.content.title : this.title;
121
121
  if (!Ext.isEmpty(this.content.wrapWindowResizeEvent)) {
@@ -167,6 +167,15 @@ Ext.define('Coon.common.panel.WindowWrap', {
167
167
  }
168
168
  },
169
169
 
170
+ setFocusTarget: function(panel) {
171
+ this.on('render', function() {
172
+ this.focus();
173
+ }, this);
174
+ this.on('focus', function() {
175
+ this.defaultFocus = this.readOnly ? undefined : (panel.defaultFocus || 'textfield[hidden=false][readOnly=false]');
176
+ }, this);
177
+ },
178
+
170
179
  wikiLink: function() {
171
180
  const context = (Ext.isFunction(this.content.getWikiContext) && this.content.getWikiContext()) || this.content.getXType();
172
181
  const panel = Ext.create('Coon.requests.wiki.WikiLinkView');
@@ -16,4 +16,15 @@
16
16
  }
17
17
  }
18
18
  }
19
+
20
+ &:has(.hover-style:hover, .create-line-left:hover) .create-line-left::before{
21
+ content: " ";
22
+ background: #BDBDBD;
23
+ width: 3px;
24
+ height: 26px;
25
+ position: absolute;
26
+ top: 0;
27
+ bottom: 0;
28
+ margin: auto 0;
29
+ }
19
30
  }
@@ -22,6 +22,7 @@ Ext.define('Coon.report.component.settings.common.ReportFormCommonPanel', {
22
22
  collapseToolText: 'Свернуть',
23
23
  expandToolText: 'Развернуть',
24
24
  titlePosition: 1,
25
+ bodyPadding: 10,
25
26
  layout: {
26
27
  type: 'vbox',
27
28
  align: 'stretch',
@@ -89,7 +90,7 @@ Ext.define('Coon.report.component.settings.common.ReportFormCommonPanel', {
89
90
  items: [
90
91
  {
91
92
  xtype: 'button',
92
- text: 'Скопировать для "PL/SQL"',
93
+ text: 'Скопировать запрос',
93
94
  ui: 'blue-text-button-border',
94
95
  maxWidth: 200,
95
96
  copyData: undefined,
@@ -106,34 +107,16 @@ Ext.define('Coon.report.component.settings.common.ReportFormCommonPanel', {
106
107
  },
107
108
  {
108
109
  xtype: 'button',
109
- text: 'Предпросмотр SQL',
110
+ text: 'Посмотреть шаблон запроса...',
110
111
  ui: 'blue-text-button-border',
111
112
  handler: 'sqlPreviewHandler',
112
113
  margin: '0 0 0 20px',
113
114
  },
114
- {
115
- xtype: 'segmentedbutton',
116
- stateId: 'ReportFormCommonPanel.sqlmode',
117
- margin: '0 0 0 20px',
118
- items: [
119
- {
120
- itemId: 'sql',
121
- text: 'SQL',
122
- pressed: true,
123
- handler: 'chooseSqlMode',
124
- },
125
- {
126
- itemId: 'pgsql',
127
- text: 'PgSQL',
128
- handler: 'chooseSqlMode',
129
- }
130
- ],
131
- },
132
115
  {
133
116
  xtype: 'splitbutton',
134
117
  margin: '0 0 0 20px',
135
118
  ui: 'blue-text-button-border',
136
- text: 'Украсить SQL',
119
+ text: 'Форматировать запрос',
137
120
  handler: 'beautifySQL',
138
121
  menu: [
139
122
  {
@@ -147,7 +130,7 @@ Ext.define('Coon.report.component.settings.common.ReportFormCommonPanel', {
147
130
  },
148
131
  {
149
132
  xtype: 'UiAceEditor',
150
- mode: 'sql',
133
+ mode: 'pgsql',
151
134
  cls: 'textareastyle',
152
135
  reference: 'reportSQLField',
153
136
  flex: 1,
@@ -1,6 +1,7 @@
1
1
  Ext.define('Coon.report.component.settings.common.ReportFormCommonPanelController', {
2
2
  extend: 'Ext.app.ViewController',
3
3
  alias: 'controller.ReportFormCommonPanelController',
4
+ requires: ['Coon.report.component.settings.common.ReportSqlBeautifierPanel'],
4
5
  defaultBeautifierConfig: {
5
6
  language: 'plsql',
6
7
  keywordCase: 'upper',
@@ -16,15 +17,6 @@ Ext.define('Coon.report.component.settings.common.ReportFormCommonPanelControlle
16
17
  this.beautifierConfig = Ext.apply({}, this.defaultBeautifierConfig);
17
18
  },
18
19
 
19
- chooseSqlMode: function(button) {
20
- const vm = this.getViewModel();
21
- const editor = this.lookup('reportSQLField').editor;
22
- const language = button.itemId === 'sql' ? 'plsql' : 'postgresql';
23
- editor.session.setMode(`ace/mode/${button.itemId}`);
24
- this.defaultBeautifierConfig.language = language;
25
- vm.set('language', language);
26
- },
27
-
28
20
  reportTypeChangeHandler: function(field) {
29
21
  const pageSizeField = this.lookup('pageSizeField');
30
22
  const type = field.getValue();
@@ -50,11 +42,25 @@ Ext.define('Coon.report.component.settings.common.ReportFormCommonPanelControlle
50
42
  },
51
43
 
52
44
  sqlPreviewHandler: function() {
53
- const panel = Ext.create('widget.ReportSqlPreviewPanel');
45
+ const reportProps = this.getViewModel().get('report.properties');
46
+ let isEnabled = false;
47
+ if (Array.isArray(reportProps)) {
48
+ isEnabled = reportProps.find((prop) => prop.key === 'TEMPLATE' && prop.value === 'FREEMARKER');
49
+ }
50
+ const sourceEditor = this.lookup('reportSQLField').editor;
51
+ if (sourceEditor.getValue() === '') {
52
+ Ext.MessageBox.alert('Ошибка', 'Пустой текст запроса.');
53
+ return;
54
+ }
55
+ if (!isEnabled) {
56
+ Ext.MessageBox.alert('Информация', 'Необходимо добавить свойство отчета "TEMPLATE" со значением "FREEMARKER".');
57
+ return;
58
+ }
59
+ const panel = Ext.create('widget.ReportSqlPreviewPanel', {sourceEditor});
54
60
  const win = Ext.widget('WindowWrap', {
55
61
  maximized: true,
56
62
  maximizable: false,
57
- title: 'Предпросмотр SQL запроса',
63
+ title: 'Шаблон запроса',
58
64
  items: panel,
59
65
  });
60
66
  win.show();
@@ -62,25 +68,29 @@ Ext.define('Coon.report.component.settings.common.ReportFormCommonPanelControlle
62
68
  },
63
69
 
64
70
  openBeautifierSettings: function() {
65
- const win = Ext.create('widget.WindowWrap', {items: [{xtype: 'ReportSqlBeautifierPanel'}],
66
- dockedItems: [{
67
- xtype: 'toolbar',
68
- dock: 'bottom',
69
- items: ['->',
70
- {
71
- xtype: 'button',
72
- ui: 'orange-button',
73
- text: 'Сохранить',
74
- handler: () => this.saveBeautifierConfig(win),
75
- },
76
- {
77
- xtype: 'button',
78
- ui: 'orange-button',
79
- text: 'Отмена',
80
- handler: () => win.close(),
81
- }
82
- ],
83
- }]});
71
+ const win = Ext.create('widget.WindowWrap', {
72
+ items: [{xtype: 'ReportSqlBeautifierPanel', viewModel: true}],
73
+ dockedItems: [
74
+ {
75
+ xtype: 'toolbar',
76
+ dock: 'bottom',
77
+ items: [
78
+ '->',
79
+ {
80
+ xtype: 'button',
81
+ ui: 'orange-button',
82
+ text: 'Сохранить',
83
+ handler: () => this.saveBeautifierConfig(win),
84
+ },
85
+ {
86
+ xtype: 'button',
87
+ ui: 'orange-button',
88
+ text: 'Отмена',
89
+ handler: () => win.close(),
90
+ }
91
+ ],
92
+ }],
93
+ });
84
94
  this.setBeautifierConfigFieldsData(win);
85
95
  win.show();
86
96
  },
@@ -115,7 +125,7 @@ Ext.define('Coon.report.component.settings.common.ReportFormCommonPanelControlle
115
125
  try {
116
126
  const editor = this.lookup('reportSQLField').editor;
117
127
  this.beautifierConfig.language = this.defaultBeautifierConfig.language;
118
- editor.getSession().setValue(Ext.formatSQL(editor.getSession().getValue(), this.beautifierConfig));
128
+ editor.setValue(Ext.formatSQL(editor.getSession().getValue(), this.beautifierConfig), -1);
119
129
  } catch (e) {
120
130
  Coon.log.error(e);
121
131
  }
@@ -9,38 +9,137 @@ Ext.define('Coon.report.component.settings.common.ReportSqlPreviewPanel', {
9
9
  type: 'vbox',
10
10
  align: 'stretch',
11
11
  },
12
-
13
12
  items: [
14
13
  {
15
14
  xtype: 'panel',
16
- id: 'filterPanelContainerId',
17
- scrollable: true,
18
- flex: 1,
19
- items: [],
20
- bbar: [{
21
- text: 'Обновить',
22
- ui: 'blue-text-button-border',
23
- itemId: 'showPreview',
24
- }],
15
+ layout: {
16
+ type: 'hbox',
17
+ align: 'stretch',
18
+ },
19
+ items: [
20
+ {
21
+ xtype: 'panel',
22
+ itemId: 'filterPanelContainer',
23
+ scrollable: true,
24
+ flex: 1,
25
+ bodyPadding: 20,
26
+ items: [],
27
+ },
28
+ {
29
+ xtype: 'container',
30
+ maxWidth: 200,
31
+ margin: '10 0',
32
+ autoHeight: true,
33
+ layout: {
34
+ type: 'hbox',
35
+ align: 'end',
36
+ },
37
+ defaults: {
38
+ margin: '0 16 0 0',
39
+ xtype: 'button',
40
+ },
41
+ items: [
42
+ {
43
+ text: 'Обновить шаблон',
44
+ ui: 'blue-text-button-border',
45
+ itemId: 'showPreview',
46
+ }
47
+ ],
48
+ }
49
+ ],
25
50
  },
26
51
  {
27
- xtype: 'textareafield',
28
- xtype: 'UiAceEditor',
29
- mode: 'sql',
30
- id: 'textareafieldId',
31
- cls: 'textareastyle',
32
- reference: 'reportSQLPreviewField',
33
- emptyText: 'Select * from...',
34
- scrollable: true,
52
+ xtype: 'container',
53
+ itemId: 'diffContainer',
35
54
  flex: 2,
36
55
  margin: 5,
37
- readOnly: true,
56
+ layout: {
57
+ type: 'vbox',
58
+ align: 'stretch',
59
+ },
60
+ items: [
61
+ {
62
+ xtype: 'container',
63
+ height: 30,
64
+ layout: {
65
+ type: 'hbox',
66
+ align: 'stretch',
67
+ },
68
+ items: [
69
+ {
70
+ xtype: 'displayfield',
71
+ value: 'Шаблон запроса',
72
+ style: 'text-align:center;',
73
+ flex: 1,
74
+ },
75
+ {
76
+ xtype: 'displayfield',
77
+ value: 'Текст запроса',
78
+ style: 'text-align:center;',
79
+ flex: 1,
80
+ }
81
+ ],
82
+ },
83
+ {
84
+ xtype: 'box',
85
+ flex: 1,
86
+ id: 'diffTarget',
87
+ }
88
+ ],
38
89
  }
39
90
  ],
40
91
 
41
92
  initComponent() {
42
93
  this.callParent();
43
94
  this.down('#showPreview').on('click', this.showPreview, this);
95
+ this.getComponent('diffContainer').on('render', this.renderDiff.bind(this));
96
+ this.on('beforedestroy', this.disposeDiff.bind(this));
97
+ },
98
+
99
+ disposeDiff() {
100
+ this.diff && this.diff.destroy();
101
+ },
102
+ renderDiff(container) {
103
+ if (!this.sourceEditor) {
104
+ Coon.log.error('Не передан параметр "sourceEditor"');
105
+ return;
106
+ }
107
+ this.leftEditor = {
108
+ id: 'ace-diff-left',
109
+ content: '',
110
+ editable: false,
111
+ copyLinkEnabled: false,
112
+ };
113
+ this.diff = new Ext.xAceDiff({
114
+ element: container.el.dom.querySelector('#diffTarget'),
115
+ left: this.leftEditor,
116
+ mode: this.sourceEditor.getSession().getMode()['$id'],
117
+ theme: this.sourceEditor.getTheme(),
118
+ right: {
119
+ id: 'ace-diff-right',
120
+ content: this.sourceEditor.getValue(),
121
+ editable: false,
122
+ copyLinkEnabled: false,
123
+ },
124
+ });
125
+ const left = this.diff.editors.left.ace;
126
+ const right = this.diff.editors.right.ace;
127
+ let rightScrolling = false;
128
+ let leftScrolling = false;
129
+ right.getSession().on('changeScrollTop', function(scroll) {
130
+ if (!rightScrolling) {
131
+ rightScrolling = true;
132
+ left.getSession().setScrollTop(scroll || 0);
133
+ }
134
+ rightScrolling = false;
135
+ });
136
+ left.getSession().on('changeScrollTop', function(scroll) {
137
+ if (!leftScrolling) {
138
+ leftScrolling = true;
139
+ right.getSession().setScrollTop(scroll || 0);
140
+ }
141
+ leftScrolling = false;
142
+ });
44
143
  },
45
144
 
46
145
  doInit(report) {
@@ -71,24 +170,28 @@ Ext.define('Coon.report.component.settings.common.ReportSqlPreviewPanel', {
71
170
  configurationList: configList,
72
171
  plugins: reportPlugins,
73
172
  });
74
- filterPanel.height += 10; // т.к. filterPanel.frame == true
75
-
76
- this.down('#filterPanelContainerId').add(filterPanel);
77
- this.down('#filterPanelContainerId').updateLayout();
173
+ const container = this.down('#filterPanelContainer');
174
+ container.add(filterPanel);
175
+ container.updateLayout();
176
+ this.showPreview();
78
177
  },
79
178
 
80
179
  showPreview() {
81
- const previewField = this.down('#textareafieldId');
82
- previewField.setValue('');
180
+ this.mask();
83
181
  fetch(this.getOptions())
84
- .then((response) => response.text())
85
- .then((text) => previewField.setValue(text))
86
- .catch(Coon.log.error);
182
+ .then((response) => response.text()).then((text) => {
183
+ this.unmask();
184
+ this.diff.editors.left.ace.setValue(text, -1);
185
+ Ext.toast('Шаблон загружен.');
186
+ }).catch((error) => {
187
+ this.unmask();
188
+ Coon.log.error(error);
189
+ });
87
190
  },
88
191
 
89
192
  getOptions() {
90
193
  const parameterList = [];
91
- const currentParamList = Coon.Function.getDataFromForm(this.down('#filterPanelContainerId'), false);
194
+ const currentParamList = Coon.Function.getDataFromForm(this.down('#filterPanelContainer'), false);
92
195
  for (const key in currentParamList) {
93
196
  if (currentParamList.hasOwnProperty(key)) {
94
197
  if (!Ext.isEmpty(currentParamList[key])) {
@@ -49,14 +49,16 @@ Ext.define('Coon.report.component.settings.parameter.ReportFormParameterEditPane
49
49
  filterPanelContainer.removeAll();
50
50
  this.highlightedFilterField = null;
51
51
  const northPanel = Ext.widget('NorthPanel', {
52
- filterItemsOnRow: reportProperties['filterItemsOnRow'] || 4,
53
52
  enableHighlightingRequiredFields: isValidationPlugin || reportProperties['enableHighlightingRequiredFields'],
54
53
  buttonsContainerConfig: {hidden: true},
55
54
  filterPlugins: reportPlugins,
56
55
  docked: 'top',
57
56
  header: false,
58
57
  });
59
- northPanel.configureFilterPanel({parameters: this.getConfigurationList()});
58
+ northPanel.configureFilterPanel({
59
+ parameters: this.getConfigurationList(),
60
+ properties: {filterItemsOnRow: reportProperties['filterItemsOnRow']},
61
+ });
60
62
  this.filterContainer = northPanel.filterContainer;
61
63
  filterPanelContainer.add(northPanel);
62
64
  filterPanelContainer.updateLayout();
@@ -202,11 +202,11 @@ Ext.define('Coon.report.component.settings.property.ReportPropertiesPanelControl
202
202
  }
203
203
  if (record.get('isNew')) {
204
204
  record.remove();
205
- this.lookup('descriptionField').reset();
206
- this.lookup('propertyValueContainer').removeAll();
207
205
  } else {
208
206
  record.set('isDeleted', !record.get('isDeleted'));
209
207
  }
208
+ this.lookup('descriptionField').reset();
209
+ this.lookup('propertyValueContainer').removeAll();
210
210
  },
211
211
 
212
212
  onAddHandler() {