ru.coon 2.7.75 → 2.8.0

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.8.0, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/74558cb55135099e1cc4ba5ec585ac75e12cbd83)
2
+ * update: CHANGELOG.md ([46e9bc], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/46e9bc47a9ddb94057c101cc12e5061ba7cf22ce))
3
+
4
+ # Version 2.7.77, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/ed565df4038dd160f1166e689d81d359feb3003c)
5
+ * update: CHANGELOG.md ([ae6b28], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/ae6b28704a00eeaf40f433bba41ae4a6eaaa99f8))
6
+
7
+ # Version 2.7.76, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/aba7291e49ef3d047503bdb2b8dae078d617a8f2)
8
+ * ## Fixes
9
+ * <span style='color:red'>fix precision in CopyRowsFromGrid, HT-9263</span> ([a02eb9], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/a02eb9443ebf6794e35abdc924c45763c815b245))
10
+
11
+ * update: CHANGELOG.md ([a0b693], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/a0b693884f48f4d3489f7511c01c5f85e6d7a798))
12
+
1
13
  # Version 2.7.75, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/07c180f0c622d325ab34f62f832e1ee801609fdc)
2
14
  * ## Features
3
15
  * <span style='color:green'>feat: HT-10115: chain plugin return result, log unified buttons call handlers result</span> ([408dab], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/408dab15c6afc49e47bd80729bf55e1a541522cc))
@@ -339,16 +351,24 @@ fix: restore version of custom panel in editor</span> ([53a300], [link](http://g
339
351
 
340
352
  # Version 2.7.30, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/a72ce199d2d79b7a5dcb52cc81cd68e46f34829a)
341
353
  * ## Features
354
+ * <span style='color:green'>feat: TR-68867: fix undefined elems in main view</span> ([3e38e7], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/3e38e74f415961b3aa87b86e646bdc5e253c0398))
342
355
  * <span style='color:green'>feat: HT-6760 компонент для управления правами кастомных панелей</span> ([97cda5], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/97cda502cccce84bd63fd23a9f4b82fb42caa65b))
356
+ * <span style='color:green'>feat: TR-68867: create coon application for all projects</span> ([1206ec], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/1206ecc140735a0ddc99120be3283e5e1dfc0bf5))
357
+ * <span style='color:green'>feat: TR-68867: create coon application for all projects</span> ([85563b], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/85563b717f0cd6a5a79fd4f78262b6a4375dc8c9))
343
358
 
344
359
  * ## Fixes
345
360
  * <span style='color:red'> HT-8422: set filter panel height on afterlayout</span> ([d65a92], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/d65a9277c2fcedaba912ff40ba7a912049bdd7f7))
361
+ * <span style='color:red'> TR-68867 fix for label fields on filterPanel</span> ([740ac7], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/740ac7bbb89794e46b5bca99bd6d279350e2672f))
346
362
  * <span style='color:red'> HT-8131 add universal button for collapse/expand report lines in a hierarchy</span> ([0a7edf], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/0a7edf4357213fd7872ecb361ce47261b3102b4c))
347
363
  * <span style='color:red'> HT-8131 refactoring</span> ([f2b72a], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/f2b72a804d99b23988f0e25d2f5e0ec831c694bb))
348
364
 
349
365
  * update: CHANGELOG.md ([880435], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/88043579448bda38f9c2b2ec4d159a2d502dba5a))
350
366
 
351
367
  # Version 2.7.29, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/567513e38f7c7e6b90e1873785d5fb69e9fb9f4b)
368
+ * ## Features
369
+ * <span style='color:green'>feat: TR-68867: create coon application for all projects</span> ([e815bf], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/e815bf50e927dfa8ee863f0c51243ef51d034818))
370
+ * <span style='color:green'>feat: TR-68867: create coon application for all projects</span> ([795acd], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/795acd7893676751680af5a74a6a3b4467abc215))
371
+
352
372
  * ## Fixes
353
373
  * <span style='color:red'> HT-8131 set new menu</span> ([19b735], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/19b73537c87c685cdf11156c4cc95e120b7eb89e))
354
374
  * <span style='color:red'> HT-8131 renaming</span> ([6a84ad], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/6a84ad2ca12ee556278e9f2bb25a9fe94b8ae38e))
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "name": "ru.coon"
5
5
  },
6
6
  "description": "",
7
- "version": "2.7.75",
7
+ "version": "2.8.0",
8
8
  "repository": {
9
9
  "type": "git",
10
10
  "url": "git+http://gitlab-dbr.sigma-it.local/dbr/ru.coon"
@@ -0,0 +1,224 @@
1
+ Ext.define('Coon.app.Application', {
2
+ extend: 'Ext.app.Application',
3
+ name: 'CoonApplication',
4
+ requires: ['Iconpack.*', 'Coon.*', 'Ext.*'],
5
+ config: {
6
+ applicationMainView: null,
7
+ },
8
+
9
+ appRouter: Coon.app.Router,
10
+
11
+ onLogout: function() {
12
+ Ext.Msg.show({
13
+ title: 'Сообщение системы',
14
+ msg: 'Вы действительно хотите выйти?',
15
+ buttons: Ext.Msg.YESNO,
16
+ fn: function(btn) {
17
+ if (btn === 'yes') {
18
+ Ext.getBody().mask();
19
+ this.setUserData();
20
+ sessionStorage.clear();
21
+ window.location.href = '/logout';
22
+ }
23
+ },
24
+ scope: this,
25
+ });
26
+ },
27
+
28
+ isAuthenticated() {
29
+ const userData = this.getUserData();
30
+ return userData && userData.authenticated === true;
31
+ },
32
+
33
+ getUserData() {
34
+ return localStorage.getJson('userData') || {};
35
+ },
36
+
37
+ setUserData(data) {
38
+ localStorage.setItem('userData', data || null);
39
+ },
40
+
41
+ clearUserData() {
42
+ this.processNotAuthorizedAction();
43
+ },
44
+
45
+ processNotAuthorizedAction() {
46
+ sessionStorage.clear();
47
+ this.setUserData();
48
+ window.location.reload();
49
+ },
50
+
51
+ createFxAnim(view, showFlag, callback) {
52
+ const cfg = showFlag ?
53
+ {
54
+ from: {hidden: false, style: {background: 'transparent'}, opacity: 0},
55
+ to: {opacity: 1},
56
+ } :
57
+ {
58
+ from: {hidden: false, opacity: 1},
59
+ to: {opacity: 0, hidden: true},
60
+
61
+ };
62
+ const cmp = Ext.create('Ext.fx.Anim', Ext.apply(cfg, {
63
+ target: view,
64
+ duration: 1000,
65
+ }));
66
+ if (callback) {
67
+ cmp.on('afteranimate', callback, this, {single: true});
68
+ }
69
+ },
70
+
71
+ onLoginSuccessful() {
72
+ this.createFxAnim(this.getApplicationMainView(), false, async function() {
73
+ this.getApplicationMainView().destroy();
74
+ this.setApplicationMainView(Ext.create({
75
+ xtype: 'mainview',
76
+ plugins: 'viewport',
77
+ hidden: true,
78
+ }));
79
+ this.createFxAnim(this.getApplicationMainView(), true);
80
+ this.getApplicationMainView().show();
81
+ this.afterAuthorized();
82
+ });
83
+ this.getApplicationMainView().show();
84
+ },
85
+
86
+ afterLoad: async function() {
87
+ this.appRouter.onBeforeRouteEnterFailedFn = this.processNotAuthorizedAction;
88
+ Ext.on('auth:loginSuccessful', this.onLoginSuccessful, this);
89
+
90
+ const {authenticated, requireTwoFactorAuthentication} = this.getUserData();
91
+ if (authenticated && requireTwoFactorAuthentication) {
92
+ this.setUserData();
93
+ }
94
+ const isAuthValid = authenticated === true && !requireTwoFactorAuthentication;
95
+ let view = isAuthValid ? 'mainview' : 'loginview';
96
+
97
+ if (window.location.href.indexOf('customForm') > -1) {
98
+ view = 'frameview';
99
+ }
100
+
101
+ this.setApplicationMainView(Ext.create({
102
+ xtype: view,
103
+ plugins: 'viewport',
104
+ hidden: true,
105
+ workspace: null,
106
+ }));
107
+
108
+
109
+ Ext.get('splash').destroy();
110
+
111
+ this.createFxAnim(this.getApplicationMainView(), true, () => {
112
+ Ext.getBody().removeCls('launching');
113
+ });
114
+ this.getApplicationMainView().show();
115
+
116
+ if (isAuthValid) {
117
+ this.afterAuthorized();
118
+ }
119
+ },
120
+ getErrorMessage(response) {
121
+ if (response.responseType === 'json') {
122
+ return response.responseJson;
123
+ }
124
+ const responseText = this.getResponseText(response);
125
+ try {
126
+ return Ext.decode(responseText);
127
+ } catch (ex) {
128
+ return responseText;
129
+ }
130
+ },
131
+
132
+ getResponseText: function(response) {
133
+ if (typeof response.responseText !== 'undefined') {
134
+ return response.responseText;
135
+ }
136
+ if (typeof response.responseBytes !== 'undefined') {
137
+ return new TextDecoder().decode(response.responseBytes);
138
+ }
139
+ return Ext.encode({
140
+ message: 'Неизвестная ошибка',
141
+ });
142
+ },
143
+
144
+ /**
145
+ * @method resendModifiedRequest
146
+ * resend request with additional parameters
147
+ *
148
+ * @param {Ext.data.Connection} conn
149
+ * @param {Object} responseData
150
+ * @param {Object} options
151
+ * @param {number} messageCategory
152
+ * @param {number} messageCode
153
+ */
154
+ resendModifiedRequest(conn, responseData, options, messageCategory, messageCode) {
155
+ const billingIgnoredValidation = responseData.billingIgnoredValidation || '';
156
+
157
+ // modify options with category and code
158
+ options.params.billingIgnoredValidation =
159
+ `${billingIgnoredValidation}${messageCategory},${messageCode};`,
160
+
161
+ conn.request(options);
162
+ },
163
+
164
+ onAppUpdate: function() {
165
+ Ext.Msg.show({
166
+ title: 'Сообщение системы',
167
+ closable: false,
168
+ message: 'Доступна новая версия, приложение будет обновлено',
169
+ cls: 'simplestInfoMsg',
170
+ buttons: Ext.Msg.OK,
171
+ left: 0,
172
+ icon: Ext.Msg.INFO,
173
+ fn: function(btn) {
174
+ if (btn === 'ok') {
175
+ Ext.fireEvent('application:onAppUpdate');
176
+ window.location.reload();
177
+ }
178
+ },
179
+ });
180
+ },
181
+
182
+ checkAuth() {
183
+ return Ext.Ajax.request({
184
+ url: '/info',
185
+ headers: {'X-CSRF-Token': localStorage.getItem('CSRFToken')},
186
+ method: 'GET',
187
+ }).then((res) => {
188
+ if (Ext.isString(res.responseText)) {
189
+ this.setUserData(res.responseText);
190
+ }
191
+ }).catch((res) => {
192
+ if (res.status === 401) {
193
+ this.processNotAuthorizedAction();
194
+ }
195
+ Ext.Msg.alert('ошибка', res.responseText, this.getErrorMessage(res));
196
+ });
197
+ },
198
+
199
+
200
+ launch: function() {
201
+ this.appRouter.onBeforeRouteEnterFn = this.isAuthenticated.bind(this);
202
+ Ext.on('auth:logout', this.onLogout, this);
203
+ this.checkAuth().then(() => {
204
+ Ext.get('splash').fadeOut({
205
+ duration: 1000,
206
+ listeners: {
207
+ afteranimate: {
208
+ fn: this.afterLoad,
209
+ single: true,
210
+ scope: this,
211
+ },
212
+ },
213
+ });
214
+ this.afterCheckAuth();
215
+ });
216
+ this.afterLaunch();
217
+ },
218
+ afterAuthorized() {},
219
+
220
+ afterLaunch() {},
221
+
222
+ afterCheckAuth() {},
223
+
224
+ });
@@ -0,0 +1,9 @@
1
+ .simplestInfoMsg {
2
+ .x-btn-default-small {
3
+ width: 100px;
4
+ left: 40% !important;
5
+ }
6
+ .x-window-item .x-box-layout-ct {
7
+ top: 15px !important;
8
+ }
9
+ }
package/src/app/Router.js CHANGED
@@ -1,27 +1,61 @@
1
1
  Ext.define('Coon.app.Router', {
2
2
  mixins: ['Ext.route.Mixin'],
3
- routes: {
4
- ':{type}/:{id}': {
5
- action: 'onRouteEnter',
6
- },
7
- ':{id}': {
8
- action: 'onRouteEnter',
9
- },
10
- ':{type}/:{id}/:{params...}': {
11
- action: 'onRouteEnter',
12
- types: {
13
- '...': {
14
- re: '(.+)?',
15
- split: '/',
16
- parse: (value) => value,
3
+ singleton: true,
4
+ constructor() {
5
+ this.setRoutes({
6
+ ':{type}/:{id}': {
7
+ action: 'onRouteEnter',
8
+ },
9
+ ':{id}': {
10
+ action: 'onRouteEnter',
11
+ },
12
+ ':{type}/:{id}/:{params...}': {
13
+ action: 'onRouteEnter',
14
+ types: {
15
+ '...': {
16
+ re: '(.+)?',
17
+ split: '/',
18
+ parse: (value) => value,
19
+ },
17
20
  },
18
21
  },
19
- },
22
+ });
23
+ Ext.on('router:goToLastRoute', () => {
24
+ this.onRouteEnter(this.lastRoute);
25
+ }, this);
26
+ },
27
+
28
+ lastRoute: null,
29
+
30
+ onBeforeRouteEnterFn: null,
31
+
32
+ onBeforeRouteEnter() {
33
+ if (typeof this.onBeforeRouteEnterFn === 'function') {
34
+ return this.onBeforeRouteEnterFn();
35
+ }
36
+ return true;
37
+ },
38
+
39
+ onBeforeRouteEnterFailedFn: null,
40
+
41
+ onBeforeRouteEnterFailed() {
42
+ if (typeof this.onBeforeRouteEnterFailedFn === 'function') {
43
+ return this.onBeforeRouteEnterFailedFn();
44
+ }
45
+ return true;
20
46
  },
21
- onClassMixedIn() {
22
- this.prototype.setRoutes(this.prototype.config.routes);
47
+
48
+
49
+ getLastRoute() {
50
+ return this.lastRoute;
23
51
  },
52
+
24
53
  onRouteEnter(route) {
54
+ this.lastRoute = route;
55
+ if (!this.onBeforeRouteEnter()) {
56
+ this.onBeforeRouteEnterFailed();
57
+ return;
58
+ }
25
59
  const app = Ext.getApplication();
26
60
  if (!app.initialRoute) {
27
61
  app.initialRoute = route;
@@ -41,4 +75,5 @@ Ext.define('Coon.app.Router', {
41
75
  const routerView = this.getRouterView();
42
76
  return routerView && routerView.getLayout().getActiveItem();
43
77
  },
78
+
44
79
  });
@@ -1,4 +1,4 @@
1
- Ext.define('Coon.app.component.CenterView', {
1
+ Ext.define('Coon.app.viewPort.CenterView', {
2
2
  extend: 'Ext.container.Container',
3
3
  xtype: 'centerview',
4
4
  requires: ['Coon.util'],
@@ -1,4 +1,4 @@
1
- Ext.define('Coon.app.component.CenterViewController', {
1
+ Ext.define('Coon.app.viewPort.CenterViewController', {
2
2
  extend: 'Ext.app.ViewController',
3
3
  alias: 'controller.CenterViewController',
4
4
  requires: ['Coon.util', 'Coon.Function'],
@@ -18,7 +18,7 @@ Ext.define('Coon.app.viewPort.Main', {
18
18
  },
19
19
  items: [
20
20
  {
21
- xtype: 'CoonAppTopView',
21
+ xtype: 'panel',
22
22
  height: 48,
23
23
  },
24
24
  {
@@ -28,7 +28,7 @@ Ext.define('Coon.app.viewPort.Main', {
28
28
  dockedItems: [
29
29
  {
30
30
  dock: 'bottom',
31
- xtype: 'CoonAppBottomView',
31
+ xtype: 'panel',
32
32
  }
33
33
  ],
34
34
  }
@@ -52,13 +52,10 @@ Ext.define('Coon.app.viewPort.Main', {
52
52
  {
53
53
  xtype: 'AppNavigationBar',
54
54
  flex: 1,
55
- },
56
- {
57
- xtype: 'CoonAppHeaderUserBlock',
58
55
  }
59
56
  ],
60
57
  },
61
- {xtype: 'CoonAppFooterView', reference: 'footerview', region: 'south', docked: 'bottom', weight: -2},
58
+ {xtype: 'panel', reference: 'footerview', region: 'south', docked: 'bottom', weight: -2},
62
59
  {xtype: 'centerview', reference: 'centerview', region: 'center', weight: -1},
63
60
  {
64
61
  xtype: 'panel',
@@ -24,6 +24,9 @@ Ext.define('Coon.common.plugin.form.RequiredFlagPlugin', {
24
24
  },
25
25
 
26
26
  init: function(field) {
27
+ if (typeof field.getValue !== 'function' || typeof field.isValid !== 'function') {
28
+ return;
29
+ }
27
30
  this.field = field;
28
31
  this.field.setEnableHighlightingRequiredFields = this.setEnableHighlightingRequiredFields.bind(this);
29
32
  this.field.getEnableHighlightingRequiredFields = this.getEnableHighlightingRequiredFields.bind(this);
@@ -10,6 +10,7 @@ Ext.define('Coon.nav.AppNavigationMenuController', {
10
10
  selectThenMenuReady: undefined,
11
11
  addWorkspaceToUrl: false,
12
12
  menuUpdate: false,
13
+ lastRoute: false,
13
14
  init: function(view) {
14
15
  view.updateSelection = this.updateSelection.bind(this);
15
16
  view.getMenuReady = this.getMenuReady.bind(this);
@@ -17,7 +18,8 @@ Ext.define('Coon.nav.AppNavigationMenuController', {
17
18
  view.changeMicro = this.changeMicro.bind(this);
18
19
  view.changeWorkspace = this.changeWorkspace.bind(this);
19
20
  this.view.on('selectionchange', this.onSelectMenuItem, this);
20
- this.loadMenu();
21
+ this.lastRoute = Ext.getApplication().appRouter.lastRoute || false;
22
+ this.loadMenu(false, !!this.lastRoute);
21
23
  Ext.on('route:initial', (route) => {
22
24
  this.selectThenMenuReady = route.id;
23
25
  });
@@ -178,7 +180,7 @@ Ext.define('Coon.nav.AppNavigationMenuController', {
178
180
 
179
181
  return node;
180
182
  },
181
- loadMenu(uiElementCd) {
183
+ loadMenu(uiElementCd, lastRoute) {
182
184
  Coon.nav.MenuEntity.get().then((menu) => {
183
185
  if (Array.isArray(menu)) {
184
186
  const dataList = this.prepareMenuData(menu);
@@ -236,7 +238,11 @@ Ext.define('Coon.nav.AppNavigationMenuController', {
236
238
  this.changeWorkspace(this.getViewModel().get('workspace'), false);
237
239
  this.selectMenuItem(uiElementCd, true);
238
240
  } else {
239
- this.onMenuReady();
241
+ if (!lastRoute) {
242
+ this.onMenuReady();
243
+ } else {
244
+ Ext.fireEvent('router:goToLastRoute');
245
+ }
240
246
  }
241
247
  }
242
248
  });
@@ -7,6 +7,7 @@ Ext.define('Coon.report.plugin.grid.CopyRowsFromGrid', {
7
7
  'Sigma.common.grid.plugin.CopyRowsFromGrid',
8
8
  'Sigma.common.plugin.grid.CopyRowsFromGrid'
9
9
  ],
10
+ defaultFloatPrecision: 2,
10
11
  configurePanelWizard: 'CopyRowsFromGridConfigPanel',
11
12
  position: -1,
12
13
  allowAddRowOnPaste: false,
@@ -1058,9 +1059,12 @@ Ext.define('Coon.report.plugin.grid.CopyRowsFromGrid', {
1058
1059
  this.getRowStyleXlsx(grid, record, workbook)
1059
1060
  );
1060
1061
  if (valueType === 'float') {
1061
- const precision = Number(columnConfig.precision) || this.getConfig('floatPrecision') || 2;
1062
+ let precision = Number(columnConfig.precision);
1063
+ if (!Number.isInteger(precision)) {
1064
+ precision = Number(this.getConfig('floatPrecision') || this.defaultFloatPrecision);
1065
+ }
1062
1066
  col['styleId'] = workbook.addCellStyle({
1063
- format: '0.'.padEnd(Number(precision) + 2, '0'),
1067
+ format: precision !== 0 ? '0.'.padEnd(precision + 2, '0') : '0',
1064
1068
  });
1065
1069
  if (col['value'].length) {
1066
1070
  col['value'] = parseFloat(col['value'].replace(/\s/g, '').replace(',', '.'));
package/src/version.js CHANGED
@@ -1,4 +1,4 @@
1
1
  Ext.define('Coon.version', {
2
2
  singleton: true,
3
- number: '2.7.75',
3
+ number: '2.8.0',
4
4
  });