ru.coon 2.7.4 → 2.7.5

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,10 @@
1
+ # Version 2.7.5, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/98f5d7b3391db7e90e8818d6071c674b71cb6afd)
2
+ * ## Features
3
+ * <span style='color:green'>feat: TR-67883: reload main navigation on change menu structure</span> ([a6a849], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/a6a849e812bc3988abadc526aa4829830eb89ed2))
4
+
5
+ * HT-7448 fix: Исправление проверки валидности параметров команды ([99c08a], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/99c08a16a68766ece123b717ef48400b14f51d54))
6
+ * update: CHANGELOG.md ([90c0e8], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/90c0e823dcf1d3687c38ada3d6711a84fa15e083))
7
+
1
8
  # Version 2.7.4, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/7becde7cc7cfb8254525c8beca11cbd4604b8181)
2
9
  * ## Features
3
10
  * <span style='color:green'>feat: HT-7823: refactor</span> ([07e9f0], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/07e9f00376ea39fe7888e7d264d291222667ce0f))
@@ -99,17 +106,30 @@
99
106
  * update: CHANGELOG.md ([4e316a], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/4e316ac4c2c96cb4de23ff0dfb73ff4db75ea4ec))
100
107
 
101
108
  # Version 2.6.17, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/a85820f03c44ab7b35ae02ae88209c435f264807)
109
+ * ## Features
110
+ * <span style='color:green'>feat: TR-67883: move main view in ru.coon</span> ([174f7f], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/174f7fa553ce35d1dfbc3f64603ffb1cc3ca50b0))
111
+
102
112
  * ## Fixes
103
113
  * <span style='color:red'> PrintPdfPlugin.handler call parseProperty on 'string'</span> ([8dec18], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/8dec18c777cd4e6f3daf9fb1540726e613639220))
104
114
 
115
+ * Merge remote-tracking branch 'origin/SUE-TR-67883' into SUE-TR-67883 ([99daa5], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/99daa5bd732a99ecc56761a010045548d609c217))
116
+ * Merge remote-tracking branch 'origin/SUE-TR-67883' into SUE-TR-67883 ([186915], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/1869158fbf8745c5659f595e0eed0899f62f0fe2))
117
+ * Merge remote-tracking branch 'origin/SUE-TR-67883' into SUE-TR-67883 ([e4938b], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/e4938b6d9c3c90a67f2172f1f0c02b8bd6650959))
105
118
  * HT-7444: editing contextMenu display and cell data-qtip visibility ([9590ed], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/9590edbc2eb57d22e4de581b1fe6b8f5c82617e7))
106
119
  * update: CHANGELOG.md ([e7aec8], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/e7aec82f66947539e462f813c3d8249a6f071b6f))
107
120
 
108
121
  # Version 2.6.16, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/0fda3b6a033bacf1d07829445c44a4fab42b440d)
122
+ * ## Features
123
+ * <span style='color:green'>feat: SUE-TR-67883: move main view to ru.coon</span> ([64ac15], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/64ac1596034a1f8ae408d69aad695f2a8c9c8f8d))
124
+ * <span style='color:green'>feat: TR-67883: move main view in ru.coon</span> ([5259d4], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/5259d4161eabe864a73a055b0d1396d60c2a7912))
125
+ * <span style='color:green'>feat: TR-67883: move main view in ru.coon</span> ([c5eb55], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/c5eb551a8198e629d2863aad1a397558ab978e39))
126
+
109
127
  * ## Fixes
110
128
  * <span style='color:red'>fix SummaryPluginConfigPanelSummaryGrid, BFL-11632</span> ([c3c46a], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/c3c46a8581698ea75ccebe42105d0b36e59b3f25))
129
+ * <span style='color:red'>fix AppNavigationMenu</span> ([b56e90], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/b56e90f543f264d21c83b82f6fcf0eed15bf438b))
111
130
  * <span style='color:red'>HT-7444 fix rename context menu items</span> ([07fd4d], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/07fd4d89f598b5d54807d280c82133ca6cd98a5a))
112
131
 
132
+ * Merge remote-tracking branch 'origin/SUE-TR-67883' into SUE-TR-67883 ([de8166], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/de8166e822a62b9cb6c9261720536171692805a2))
113
133
  * update: CHANGELOG.md ([5f6155], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/5f615546aaa0efa9b209cb9705cab4af5a958f05))
114
134
 
115
135
  # Version 2.6.15, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/9ad5ed1315f5d90adfe7569f83a8f354025f96dd)
@@ -130,6 +150,9 @@
130
150
  * update: CHANGELOG.md ([122574], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/12257435ce3081dc5641232b789cfa8b2b188e82))
131
151
 
132
152
  # Version 2.6.13, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/b546bb7b481a9dbc4b408c99b9ce158b676a15fa)
153
+ * ## Features
154
+ * <span style='color:green'>feat: SUE-TR-67883: move main view to ru.coon</span> ([f7f75e], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/f7f75e64d2c531050514a323753e80285ed207b8))
155
+
133
156
  * ## Fixes
134
157
  * <span style='color:red'> BFL-11558 ExportReportDataToFilePlugin date format</span> ([109998], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/109998bd10e4fd67d98b88784c008f56c5e965c8))
135
158
 
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "name": "ru.coon"
5
5
  },
6
6
  "description": "",
7
- "version": "2.7.4",
7
+ "version": "2.7.5",
8
8
  "repository": {
9
9
  "type": "git",
10
10
  "url": "git+http://gitlab-dbr.sigma-it.local/dbr/ru.coon"
File without changes
@@ -0,0 +1,44 @@
1
+ Ext.define('Coon.app.Router', {
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,
17
+ },
18
+ },
19
+ },
20
+ },
21
+ onClassMixedIn() {
22
+ this.prototype.setRoutes(this.prototype.config.routes);
23
+ },
24
+ onRouteEnter(route) {
25
+ const app = Ext.getApplication();
26
+ if (!app.initialRoute) {
27
+ app.initialRoute = route;
28
+ }
29
+ Coon.nav.MenuEntity.isValid(route.id).then(async (valid) => {
30
+ if (valid === true) {
31
+ Ext.fireEvent('route:change', route);
32
+ } else {
33
+ Ext.fireEvent('route:unmatched', route);
34
+ }
35
+ });
36
+ },
37
+ getRouterView() {
38
+ return Ext.ComponentQuery.query('centerview').shift();
39
+ },
40
+ getActiveComponent() {
41
+ const routerView = this.getRouterView();
42
+ return routerView && routerView.getLayout().getActiveItem();
43
+ },
44
+ });
@@ -0,0 +1,65 @@
1
+ Ext.define('Coon.app.component.CenterView', {
2
+ extend: 'Ext.container.Container',
3
+ xtype: 'centerview',
4
+ requires: ['Coon.util'],
5
+ controller: 'CenterViewController',
6
+ layout: 'card',
7
+ viewModel: true,
8
+ defaultComponentType: 'panel',
9
+ style: {
10
+ backgroundColor: 'white',
11
+ },
12
+ constructor() {
13
+ this.callParent(arguments);
14
+ this.app = Ext.getApplication();
15
+ Ext.on('route:change', this.display.bind(this));
16
+ },
17
+ onRender() {
18
+ this.callParent(arguments);
19
+ const {initialRoute} = Ext.getApplication();
20
+ if (initialRoute) {
21
+ this.display(initialRoute);
22
+ }
23
+ },
24
+ findComponent(config) {
25
+ return (
26
+ this.items &&
27
+ this.items.findBy((item) =>
28
+ Coon.util.objectsIsEqual(item.initialConfig, config)
29
+ )
30
+ );
31
+ },
32
+ resolveComponentType(token) {
33
+ let type;
34
+ switch (String(token).toUpperCase()) {
35
+ case 'R':
36
+ type = 'report';
37
+ break;
38
+ case 'P':
39
+ type = 'panel';
40
+ break;
41
+ }
42
+ return type || token;
43
+ },
44
+ display(cmp) {
45
+ if (!cmp.id) {
46
+ return;
47
+ }
48
+ Coon.nav.MenuEntity.isValid(cmp.id).then(async (valid) => {
49
+ if (valid === true) {
50
+ const type = this.resolveComponentType(cmp.type) || this.defaultComponentType;
51
+ const config = await this.getController().create(cmp.id, type, cmp.params);
52
+ if (config) {
53
+ Ext.fireEvent('nav:hide', !!config._preferFullScreen);
54
+ const cmp = this.findComponent(config);
55
+ const active = this.setActiveItem(
56
+ cmp && !cmp.destroyed ? cmp : Ext.create(config)
57
+ );
58
+ active && active.fireEvent('router:activate', active);
59
+ } else {
60
+ Ext.fireEvent('route:unmatched');
61
+ }
62
+ }
63
+ });
64
+ },
65
+ });
@@ -0,0 +1,152 @@
1
+ Ext.define('Coon.app.component.CenterViewController', {
2
+ extend: 'Ext.app.ViewController',
3
+ alias: 'controller.CenterViewController',
4
+ requires: ['Coon.util', 'Coon.Function'],
5
+ cache: new Map(),
6
+ privates: {
7
+ paramsToObject(params) {
8
+ const entries = [];
9
+ if (Array.isArray(params) && params.length > 1) {
10
+ for (let i = 0; i < Math.floor(params.length / 2); i++) {
11
+ entries.push([params[i * 2], params[i * 2 + 1]]);
12
+ }
13
+ }
14
+ return entries.length ? Object.fromEntries(entries) : null;
15
+ },
16
+ triggerPlugin(pluginId, target) {
17
+ if (target && Array.isArray(target.plugins)) {
18
+ const triggerPlugin = target.plugins.find((p) => p.pluginId === pluginId);
19
+ if (triggerPlugin && typeof triggerPlugin.handler === 'function') {
20
+ triggerPlugin.handler.call(triggerPlugin);
21
+ }
22
+ }
23
+ },
24
+ onActivateComponent(params, cmp) {
25
+ if (cmp.xtype === 'ReportPanel') {
26
+ if (params) {
27
+ cmp.updateFilterDefaults(params);
28
+ if (params.plugin) {
29
+ if (!cmp.grid) {
30
+ cmp.on('gridReady', (reportPanel) => {
31
+ this.triggerPlugin(params.plugin, reportPanel.grid);
32
+ });
33
+ } else {
34
+ this.triggerPlugin(params.plugin, cmp.grid);
35
+ }
36
+ }
37
+ }
38
+ }
39
+ },
40
+ onRenderEditor(editor, id) {
41
+ const c = editor.getController();
42
+ typeof c.doInit === 'function' && c.doInit.call(c, id);
43
+ },
44
+ },
45
+ async create(id, type = 'panel', params = [], useCache = true) {
46
+ const cacheKey = useCache && JSON.stringify({id, type, params});
47
+ let config;
48
+ if (!id) {
49
+ return config;
50
+ }
51
+ if (cacheKey) {
52
+ const cached = this.cache.get(cacheKey);
53
+ if (cached) {
54
+ return cached;
55
+ }
56
+ }
57
+
58
+ const paramsObject = this.paramsToObject(params);
59
+ const filterDefaults =
60
+ (paramsObject && Object.assign(paramsObject, {doFilter: true})) || {};
61
+ switch (String(type).toUpperCase()) {
62
+ case 'REPORT':
63
+ config = {
64
+ xtype: 'ReportPanel',
65
+ reportID: id,
66
+ filterDefaults,
67
+ listeners: {
68
+ 'router:activate': this.onActivateComponent.bind(
69
+ this,
70
+ paramsObject
71
+ ),
72
+ },
73
+ };
74
+ break;
75
+ case 'PANEL':
76
+ try {
77
+ config = await Coon.util.promisifyCmd(
78
+ 'Coon.uielement.command.GetUIElementCommand',
79
+ id
80
+ );
81
+ if (typeof config === 'object') {
82
+ if (typeof config.propertyData === 'string') {
83
+ config.propertyData = JSON5.parse(
84
+ config.propertyData,
85
+ (key, value) => {
86
+ if (value === 'true') {
87
+ return true;
88
+ }
89
+ if (value === 'false') {
90
+ return false;
91
+ }
92
+ return value;
93
+ }
94
+ );
95
+ }
96
+ config = Object.assign(
97
+ {xtype: config.xtype},
98
+ config.propertyData
99
+ );
100
+ if (config.xtype === 'ReportPanel') {
101
+ Object.assign(config, {
102
+ filterDefaults,
103
+ listeners: {
104
+ 'router:activate': this.onActivateComponent.bind(
105
+ this,
106
+ paramsObject
107
+ ),
108
+ },
109
+ });
110
+ }
111
+ if (config.xtype === 'UiCustomPanel') {
112
+ Object.assign(config, {
113
+ listeners: {
114
+ 'router:activate': this.onActivateComponent.bind(
115
+ this,
116
+ paramsObject
117
+ ),
118
+ 'afterrender': (panel) =>
119
+ Coon.Function.executeComponentDoInit(panel, paramsObject),
120
+ },
121
+ });
122
+ }
123
+ }
124
+ } catch (e) {
125
+ Coon.log.error(e.message);
126
+ }
127
+ break;
128
+ case 'EDIT-REPORT':
129
+ config = {
130
+ _preferFullScreen: true,
131
+ _allowRedirect: false,
132
+ xtype: 'ReportFormEditPanel',
133
+ listeners: {
134
+ 'afterrender': (panel) => this.onRenderEditor.call(this, panel, id),
135
+ },
136
+ };
137
+ break;
138
+ case 'EDIT-PANEL':
139
+ config = {
140
+ _preferFullScreen: true,
141
+ _allowRedirect: false,
142
+ xtype: 'UiCustomPanelEditor',
143
+ listeners: {
144
+ 'afterrender': (panel) => this.onRenderEditor.call(this, panel, id),
145
+ },
146
+ };
147
+ break;
148
+ }
149
+ cacheKey && this.cache.set(cacheKey, config);
150
+ return config;
151
+ },
152
+ });
@@ -0,0 +1,76 @@
1
+ Ext.define('Coon.app.viewPort.Main', {
2
+ extend: 'Ext.Container',
3
+ xtype: 'CoonAppMainViewPort',
4
+ layout: 'border',
5
+ viewModel: {
6
+ data: {
7
+ navCollapsed: false,
8
+ },
9
+ },
10
+ items: [
11
+ {
12
+ xtype: 'container',
13
+ region: 'west',
14
+ weight: -1,
15
+ layout: {
16
+ type: 'vbox',
17
+ align: 'stretch',
18
+ },
19
+ items: [
20
+ {
21
+ xtype: 'CoonAppTopView',
22
+ height: 48,
23
+ },
24
+ {
25
+ xtype: 'AppNavigationMenu',
26
+ reference: 'NavView',
27
+ flex: 1,
28
+ dockedItems: [
29
+ {
30
+ dock: 'bottom',
31
+ xtype: 'CoonAppBottomView',
32
+ }
33
+ ],
34
+ }
35
+ ],
36
+ },
37
+ {
38
+ xtype: 'panel',
39
+ reference: 'headerview',
40
+ cls: 'coon-app-header-view',
41
+ region: 'north',
42
+ docked: 'top',
43
+ weight: -2,
44
+ layout: {
45
+ type: 'hbox',
46
+ align: 'stretch',
47
+ },
48
+ items: [
49
+ {
50
+ xtype: 'AppNavigationToggleButton',
51
+ },
52
+ {
53
+ xtype: 'AppNavigationBar',
54
+ flex: 1,
55
+ },
56
+ {
57
+ xtype: 'CoonAppHeaderUserBlock',
58
+ }
59
+ ],
60
+ },
61
+ {xtype: 'CoonAppFooterView', reference: 'footerview', region: 'south', docked: 'bottom', weight: -2},
62
+ {xtype: 'centerview', reference: 'centerview', region: 'center', weight: -1},
63
+ {
64
+ xtype: 'panel',
65
+ reference: 'detailview',
66
+ region: 'east',
67
+ docked: 'right', /* , bind: {width: '{detailview_width}'}*/
68
+ }
69
+ ],
70
+
71
+ onRender() {
72
+ this.callParent(arguments);
73
+ const {initialRoute} = Ext.getApplication();
74
+ initialRoute && Ext.fireEvent('route:initial', initialRoute);
75
+ },
76
+ });
@@ -0,0 +1,133 @@
1
+ .coon-app-header-view {
2
+ //font-size: 14px;
3
+ border: none;
4
+ color: $base-color-dark;
5
+ background-color: white;
6
+
7
+ .user-button {
8
+ $user-icon-color: #BCCAD2;
9
+ &.x-btn-pressed, &.x-btn-focus{
10
+ background-color: darken($user-icon-color, 5%)!important;
11
+ }
12
+ &.x-btn-over:not(&.x-btn-focus) {
13
+ background-color: lighten($user-icon-color, 0%)!important;
14
+ }
15
+ }
16
+
17
+ &.x-toolbar-default {
18
+ padding: 0;
19
+ }
20
+
21
+ .header-user-block {
22
+ .x-panel-body-default {
23
+ .x-btn-toolbutton-toolbar-small {
24
+ padding: 2px 18px 2px 18px;
25
+ }
26
+ }
27
+
28
+ .blue-text-button {
29
+ .x-btn-icon-el-toolbutton-toolbar-small {
30
+ color: $base-color;
31
+ }
32
+ }
33
+ }
34
+
35
+ .imgAll {
36
+ display: inline-block;
37
+ background-repeat: no-repeat;
38
+ background-size: 104%;
39
+ background-position: 50%;
40
+ border-radius: 50%;
41
+ }
42
+
43
+ .fio {
44
+ float: right;
45
+ line-height: 25px;
46
+ padding-left: 5px;
47
+ cursor: pointer;
48
+ }
49
+
50
+ .imgSmall {
51
+ width: 25px;
52
+ height: 25px;
53
+ }
54
+
55
+ .header-flex {
56
+ img {
57
+ width: 100%;
58
+ position: relative;
59
+ top: 30px;
60
+ height: 25px;
61
+ }
62
+ }
63
+
64
+ .header-bottom {
65
+ .x-panel-body-default {
66
+ background-color: $base-color;
67
+ color: white;
68
+
69
+ .x-btn-toolbutton-toolbar-small {
70
+ margin: 0 12px 0 12px;
71
+ }
72
+ }
73
+ }
74
+
75
+ .header-bottom-line {
76
+ background-color: $base-color;
77
+ }
78
+
79
+ .x-panel-body-default {
80
+ color: $base-color-dark;
81
+ }
82
+
83
+ .x-btn-default-small {
84
+ //width: 120px;
85
+
86
+ .x-box-target {
87
+ .x-btn-default-small {
88
+ background-color: $base-color-dark;
89
+ color: $base-color-dark;
90
+ }
91
+ }
92
+ }
93
+
94
+ .x-btn-icon-el {
95
+ &.svg-icon {
96
+ background-color: $base-color;
97
+ width: 33px;
98
+ height: 24px;
99
+ }
100
+
101
+ &.svg-icon:hover {
102
+ background-color: $base-color-dark;
103
+
104
+ }
105
+ }
106
+
107
+ .header-bottom .x-panel-body-default .x-btn-toolbutton-toolbar-small {
108
+ .x-btn-icon-el {
109
+ &.svg-icon {
110
+ background-color: lighten(lightgray, 5%);
111
+ }
112
+
113
+ &.svg-icon:hover {
114
+ background-color: white;
115
+
116
+ }
117
+ }
118
+ }
119
+ }
120
+
121
+ .x-edge {
122
+ .coon-app-header-view {
123
+ .svg-icon {
124
+ height: 24px;
125
+ width: 24px;
126
+ background-size: 70%;
127
+
128
+ .svg-icon-chat {
129
+ background-size: 80%;
130
+ }
131
+ }
132
+ }
133
+ }
@@ -1,43 +1,42 @@
1
1
  Ext.define('Coon.nav.AppNavigationMenu', {
2
2
  extend: 'Ext.Panel',
3
3
  xtype: 'AppNavigationMenu',
4
-
5
4
  // mixins: ['Coon.mixin.RelayMethods'],
6
-
7
5
  requires: [
8
6
  'Coon.nav.menu.WorkspaceMenuView',
9
7
  'Coon.nav.AppNavigationMenuController'
10
8
  ],
9
+ scrollable: 'y',
10
+ selectFirstOnLoad: true,
11
11
  controller: 'AppNavigationMenuController',
12
-
13
- cls: 'AppNavigationMenu',
14
-
15
- updateSelection: function(selection) {
16
- return this.getController().selectMenuItem(selection);
17
- },
18
-
19
- getMenuReady: function() {
20
- return this.getController().getMenuReady();
21
- },
22
-
23
- getFirstAvailable: function() {
24
- return this.getController().getFirstAvailable();
25
- },
26
-
27
- changeMicro: function(micro) {
28
- this.lookup('WorkspaceMenuView').setMicro(micro);
12
+ viewModel: {
13
+ data: {
14
+ workspace_descr: null,
15
+ workspace_list: null,
16
+ workspace_icon: null,
17
+ navCollapsed: false,
18
+ collapsedWidth: 44,
19
+ fullWidth: 260,
20
+ },
29
21
  },
30
-
31
- changeWorkspace: function(workspace, selectFirst) {
32
- return this.getController().changeWorkspace(workspace, selectFirst);
22
+ fullWidth: 260,
23
+ cls: 'AppNavigationMenu',
24
+ layout: {
25
+ type: 'vbox',
26
+ align: 'stretch',
33
27
  },
34
-
35
- initComponent: function() {
36
- this.layout = {
37
- type: 'vbox',
38
- align: 'stretch',
28
+ items: [
29
+ {
30
+ xtype: 'button',
31
+ textAlign: 'left',
32
+ bind: {
33
+ text: '{workspace_descr}',
34
+ menu: '{workspace_list}',
35
+ iconCls: '{workspace_icon}',
36
+ arrowVisible: '{!navCollapsed}',
37
+ },
39
38
  },
40
- this.workspaceMenuView = Ext.create({
39
+ {
41
40
  xtype: 'WorkspaceMenuView',
42
41
  reference: 'WorkspaceMenuView',
43
42
  store: {
@@ -46,23 +45,15 @@ Ext.define('Coon.nav.AppNavigationMenu', {
46
45
  children: null,
47
46
  },
48
47
  },
49
- });
50
- this.items = [
51
- {
52
- xtype: 'button',
53
- textAlign: 'left',
54
- bind: {
55
- text: '{workspace_descr}',
56
- menu: '{workspace_list}',
57
- iconCls: '{workspace_icon}',
58
- arrowVisible: '{!navCollapsed}',
59
- },
60
- },
61
- this.workspaceMenuView
62
- ];
63
- this.relayEvents(this.workspaceMenuView, ['selectionchange']);
64
- // this.relayMethods(this, ['getFirstAvailable', 'getMenuReady', 'updateSelection']);
48
+ }
49
+ ],
50
+
51
+ bind: {
52
+ width: `{!navCollapsed ? fullWidth : collapsedWidth}`,
53
+ },
54
+ initComponent: function() {
65
55
  this.callParent();
56
+ this.relayEvents(this.lookup('WorkspaceMenuView'), ['selectionchange']);
66
57
  },
67
58
 
68
59
  });
@@ -6,13 +6,52 @@ Ext.define('Coon.nav.AppNavigationMenuController', {
6
6
  data: null,
7
7
  },
8
8
  menuReady: false,
9
-
9
+ selectThenMenuReady: undefined,
10
+ addWorkspaceToUrl: false,
10
11
  init: function(view) {
12
+ view.updateSelection = this.updateSelection.bind(this);
13
+ view.getMenuReady = this.getMenuReady.bind(this);
14
+ view.getFirstAvailable = this.getFirstAvailable.bind(this);
15
+ view.changeMicro = this.changeMicro.bind(this);
16
+ view.changeWorkspace = this.changeWorkspace.bind(this);
17
+ this.view.on('selectionchange', this.onSelectMenuItem, this);
11
18
  this.loadMenu();
12
19
  view.getFirstAvailable = this.getFirstAvailable.bind(this);
20
+ Ext.on('route:initial', (route) => {
21
+ this.selectThenMenuReady = route.id;
22
+ });
23
+ Ext.on('route:change', (route) => this.selectMenuItem.call(this, route.id));
24
+ Ext.on('route:unmatched', () => this.goTo(this.getFirstAvailable()));
25
+ const vm = this.getViewModel();
26
+ Ext.on('nav:toggle', () => {
27
+ vm.set('navCollapsed', !vm.get('navCollapsed'));
28
+ vm.getParent().set('navCollapsed', vm.get('navCollapsed'));
29
+ this.changeMicro(vm.get('navCollapsed'));
30
+ });
31
+ Ext.on('nav:reload', () => this.updateMenu());
32
+ },
33
+ initViewModel(vm) {
34
+ vm.set('fullWidth', this.getView().fullWidth);
35
+ },
36
+ onMenuReady() {
37
+ const ws = this.locals.data.ws.entries().next().value.at(0);
38
+ this.changeWorkspace(ws, false);
39
+ if (this.selectThenMenuReady) {
40
+ this.selectMenuItem(this.selectThenMenuReady);
41
+ } else {
42
+ this.view.selectFirstOnLoad && this.goTo(this.getFirstAvailable(), true);
43
+ }
44
+ },
45
+ updateSelection: function(selection) {
46
+ return this.selectMenuItem(selection);
47
+ },
48
+
49
+ changeMicro: function(micro) {
50
+ this.lookup('WorkspaceMenuView').setMicro(micro);
13
51
  },
14
52
 
15
53
  updateMenu: function() {
54
+ Coon.nav.MenuEntity.menuItems = null;
16
55
  this.loadMenu();
17
56
  },
18
57
 
@@ -74,6 +113,21 @@ Ext.define('Coon.nav.AppNavigationMenuController', {
74
113
  return Object.values(menu);
75
114
  },
76
115
 
116
+ goTo(id, force = false) {
117
+ if (id) {
118
+ let prefix = '';
119
+ if (this.addWorkspaceToUrl) {
120
+ const ws = this.getViewModel().get('workspace') || this.getFirstAvailable().ws.ws;
121
+ prefix = ws && ws + '/';
122
+ }
123
+ this.redirectTo(prefix + id, {force});
124
+ }
125
+ },
126
+
127
+ onSelectMenuItem: function(navCmp, item) {
128
+ this.goTo(item && item.get('UI_ELEMENT_CD'));
129
+ },
130
+
77
131
  selectMenuItem: function(uiElementCd) {
78
132
  if (!this.menuReady) {
79
133
  return;
@@ -90,6 +144,7 @@ Ext.define('Coon.nav.AppNavigationMenuController', {
90
144
 
91
145
  if (!menuItem) {
92
146
  console.error('unmatchedRoute: ' + uiElementCd);
147
+ this.goTo(this.getFirstAvailable());
93
148
  return;
94
149
  }
95
150
 
@@ -111,65 +166,64 @@ Ext.define('Coon.nav.AppNavigationMenuController', {
111
166
  this.fireViewEvent('select', node);
112
167
  return node;
113
168
  },
114
- loadMenu: function() {
115
- return Coon.util.promisifyCmd('command.GetDynamicReportDataCommand', 'MENU_ALLITEMS')
116
- .then((data) => {
117
- if (Array.isArray(data.list)) {
118
- const transformData = data.list.map((el) => {
119
- return Coon.Function.convertObjectByMapping(el, {
120
- MENU_ENTRY_ICON: 'iconCls',
121
- MENU_ENTRY_DESCR: 'text',
122
- });
169
+ loadMenu() {
170
+ Coon.nav.MenuEntity.get().then((menu) => {
171
+ if (Array.isArray(menu)) {
172
+ const dataList = this.prepareMenuData(menu);
173
+ const transformData = dataList.map((el) => {
174
+ return Coon.Function.convertObjectByMapping(el, {
175
+ MENU_ENTRY_ICON: 'iconCls',
176
+ MENU_ENTRY_DESCR: 'text',
177
+ });
178
+ });
179
+ this.locals.data = transformData.reduce((acc, el) => {
180
+ acc.ws.set(el.WORKSPACE_CD, {
181
+ ws: el.WORKSPACE_CD,
182
+ text: el.WORKSPACE_DESCR,
183
+ iconCls: el.WORKSPACE_ICON,
123
184
  });
124
- this.locals.data = transformData.reduce((acc, el) => {
125
- acc.ws.set(el.WORKSPACE_CD, {
126
- ws: el.WORKSPACE_CD,
127
- text: el.WORKSPACE_DESCR,
128
- iconCls: el.WORKSPACE_ICON,
129
- });
130
- acc.items[el.WORKSPACE_CD] = acc.items[el.WORKSPACE_CD] || {};
131
- acc.items[el.WORKSPACE_CD][el.MENU_ENTRY_CD] = el;
132
- acc.menu.push(el);
133
- return acc;
134
- }, {ws: new Map(), items: {}, menu: []});
135
-
136
- const items = [];
137
- const me = this;
138
- this.locals.data.ws.forEach((item) => {
139
- items.push({
140
- text: item.text,
141
- width: 260,
142
- value: item.ws,
143
- iconCls: item.iconCls,
144
- handler: function() {
145
- me.changeWorkspace(this.value, true);
146
- },
147
- });
185
+ acc.items[el.WORKSPACE_CD] = acc.items[el.WORKSPACE_CD] || {};
186
+ acc.items[el.WORKSPACE_CD][el.MENU_ENTRY_CD] = el;
187
+ acc.menu.push(el);
188
+ return acc;
189
+ }, {ws: new Map(), items: {}, menu: []});
190
+
191
+ const items = [];
192
+ const me = this;
193
+ this.locals.data.ws.forEach((item) => {
194
+ items.push({
195
+ text: item.text,
196
+ width: this.getView().fullWidth,
197
+ value: item.ws,
198
+ iconCls: item.iconCls,
199
+ handler: function() {
200
+ me.changeWorkspace(this.value, true);
201
+ },
148
202
  });
149
- this.getViewModel().set('workspace_list', items);
150
-
151
- Object.entries(this.locals.data.items).forEach(function(workspace) {
152
- const [workspaceId, workspaceItems] = workspace;
153
- Object.values(workspaceItems).forEach(function(el) {
154
- el.leaf = el.LEAF_SW === 'Y';
155
- if (el.PARENT_MENU_ENTRY_CD) { // значит вложенный
156
- const parent = this.locals.data.items[workspaceId][el.PARENT_MENU_ENTRY_CD];
157
- if (parent) {
158
- parent.children = parent.children || [];
159
- parent.children.push(el);
160
- }
203
+ });
204
+ this.getViewModel().set('workspace_list', items);
205
+
206
+ Object.entries(this.locals.data.items).forEach(function(workspace) {
207
+ const [workspaceId, workspaceItems] = workspace;
208
+ Object.values(workspaceItems).forEach(function(el) {
209
+ el.leaf = el.LEAF_SW === 'Y';
210
+ if (el.PARENT_MENU_ENTRY_CD) { // значит вложенный
211
+ const parent = this.locals.data.items[workspaceId][el.PARENT_MENU_ENTRY_CD];
212
+ if (parent) {
213
+ parent.children = parent.children || [];
214
+ parent.children.push(el);
161
215
  }
162
- }, this);
216
+ }
163
217
  }, this);
164
- this.menuReady = true;
165
- this.fireViewEvent('menuReady');
166
- } else {
167
- Ext.Msg.alert('ошибка', 'некорректный формат ответа или нет данных');
168
- }
169
- });
218
+ }, this);
219
+ this.menuReady = true;
220
+ this.fireViewEvent('menuReady');
221
+ Ext.fireEvent('nav:ready');
222
+ this.onMenuReady();
223
+ }
224
+ });
170
225
  },
171
-
172
- onToggleNavigationSize: function(micro) {
173
- this.getViewModel().set('micro', micro);
226
+ prepareMenuData(data) {
227
+ return data;
174
228
  },
175
229
  });
@@ -0,0 +1,9 @@
1
+ Ext.define('Coon.nav.AppNavigationToggleButton', {
2
+ extend: 'Ext.button.Button',
3
+ xtype: 'AppNavigationToggleButton',
4
+ cls: 'AppNavigationToggleButton',
5
+ iconCls: 'svg-icon svg-icon-menu-open',
6
+ handler() {
7
+ Ext.fireEvent('nav:toggle');
8
+ },
9
+ });
@@ -0,0 +1,6 @@
1
+ .AppNavigationToggleButton{
2
+ .x-btn-icon-el.svg-icon{
3
+ width: 33px;
4
+ height: 24px;
5
+ }
6
+ }
@@ -0,0 +1,35 @@
1
+ Ext.define('Coon.nav.MenuEntity', {
2
+ singleton: true,
3
+ menuItems: null,
4
+ isLoading: false,
5
+ promise: null,
6
+ get() {
7
+ if (typeof this.menuItems === 'object' && Array.isArray(this.menuItems) && this.isLoading === false) {
8
+ return new Promise((resolve) => {
9
+ resolve(this.menuItems);
10
+ });
11
+ } else if (!this.promise) {
12
+ this.isLoading = true;
13
+ this.promise = Coon.util.promisifyCmd('command.GetDynamicReportDataCommand', 'MENU_ALLITEMS')
14
+ .then((data) => {
15
+ if (Array.isArray(data.list)) {
16
+ this.menuItems = data.list;
17
+ } else {
18
+ Ext.Msg.alert('ошибка', 'некорректный формат ответа или нет данных');
19
+ }
20
+ this.isLoading = false;
21
+ return this.menuItems;
22
+ }).finally(() => {
23
+ this.promise = null;
24
+ });
25
+ }
26
+ return this.promise;
27
+ },
28
+
29
+ isValid(uiElement) {
30
+ return this.get().then((data) => {
31
+ return !!data.find((i) => i.UI_ELEMENT_CD === uiElement);
32
+ });
33
+ },
34
+
35
+ });
@@ -188,6 +188,7 @@ Ext.define('Coon.nav.editor.menu.NavMenuTreeController', {
188
188
  Coon.util.promisifyCmd('command.DeleteMenuCommand', menu)
189
189
  .then(() => {
190
190
  this.reloadMenu();
191
+ Ext.fireEvent('nav:reload');
191
192
  Ext.Msg.alert('Сообщение', 'Меню успешно удалено');
192
193
  })
193
194
  .catch((error) => {
@@ -96,6 +96,7 @@ Ext.define('Coon.nav.editor.menu.form.NavMenuFormViewController', {
96
96
  .then((menuBean) => {
97
97
  vm.set('menu', menuBean);
98
98
  this.getView().close();
99
+ Ext.fireEvent('nav:reload');
99
100
  })
100
101
  .catch((error) => {
101
102
  Coon.log.debug(error);
@@ -1,5 +1,9 @@
1
1
  Ext.define('Coon.uielement.component.MenuItemList', {
2
- extend: 'Ext.panel.Panel',
2
+ extend: 'Ext.window.Window',
3
+ title: 'Меню',
4
+ height: '100%',
5
+ width: '100%',
6
+ modal: true,
3
7
  cls: 'MenuItemList',
4
8
  alias: 'widget.MenuItemList',
5
9
  xtype: 'MenuItemList',
@@ -21,6 +25,7 @@ Ext.define('Coon.uielement.component.MenuItemList', {
21
25
  this.getController().updateView();
22
26
  },
23
27
  controller: {
28
+ // addWorkspaceToUrl: false,
24
29
  loadedData: null, itemsTotalCount: 0, updateView: function() {
25
30
  if (!this.loadedData) {
26
31
  this.loadData();
@@ -42,6 +47,23 @@ Ext.define('Coon.uielement.component.MenuItemList', {
42
47
  });
43
48
  return tree;
44
49
  },
50
+ onItemClick(navCmp, context) {
51
+ const id = context && context.node && context.node.get('uiElementCd');
52
+ if (id) {
53
+ this.goTo(id);
54
+ this.getView().close();
55
+ }
56
+ },
57
+ goTo(id, force = false) {
58
+ if (id) {
59
+ /* let prefix = '';
60
+ if (this.addWorkspaceToUrl) {
61
+ const ws = this.getViewModel().get('workspace') || this.getFirstAvailable().ws.ws;
62
+ prefix = ws && ws + '/';
63
+ }*/
64
+ this.redirectTo(id, {force});
65
+ }
66
+ },
45
67
  renderView: function() {
46
68
  if (this.itemsTotalCount > 0) {
47
69
  const itemsInColumn = Number(Number(this.itemsTotalCount) / Number(this.getView().columnsCount));
@@ -62,6 +84,9 @@ Ext.define('Coon.uielement.component.MenuItemList', {
62
84
  cls: 'list-box',
63
85
  rootVisible: true,
64
86
  selectionModel: null,
87
+ listeners: {
88
+ itemclick: 'onItemClick',
89
+ },
65
90
  store: {
66
91
  type: 'tree', root: {
67
92
  text: 'Root', expanded: true,
@@ -131,11 +156,14 @@ Ext.define('Coon.uielement.component.MenuItemList', {
131
156
  }
132
157
  return resultList;
133
158
  },
134
-
135
- loadData: function() {
136
- Coon.util.promisifyCmd('command.GetDynamicReportDataCommand', 'MENU_ALLITEMS', '[]').then((resp) => {
137
- if (resp && resp.list) {
138
- this.loadedData = resp.list.reduce((obj, item) => {
159
+ prepareMenuData(data) {
160
+ return data;
161
+ },
162
+ loadData() {
163
+ Coon.nav.MenuEntity.get().then((menu) => {
164
+ if (Array.isArray(menu)) {
165
+ const dataList = this.prepareMenuData(menu);
166
+ this.loadedData = dataList.reduce((obj, item) => {
139
167
  if (Object.keys(obj).indexOf(item.WORKSPACE_CD) < 0) {
140
168
  obj[item.WORKSPACE_CD] = {
141
169
  id: item.WORKSPACE_CD, text: item.WORKSPACE_DESCR, items: [],
@@ -157,6 +185,7 @@ Ext.define('Coon.uielement.component.MenuItemList', {
157
185
  id: item.MENU_ENTRY_CD,
158
186
  parentId: item.PARENT_MENU_ENTRY_CD ? item.PARENT_MENU_ENTRY_CD : item.WORKSPACE_CD,
159
187
  expanded: true,
188
+ uiElementCd: item.UI_ELEMENT_CD,
160
189
  text: item.MENU_ENTRY_DESCR,
161
190
  iconCls: 'svg-icon svg-icon-star-16 icon-orange',
162
191
  expandable: false,
@@ -125,11 +125,15 @@ Ext.define('Coon.uielement.plugin.configPanel.executeCommand.ExecuteCommandPlugi
125
125
  const vm = this.getViewModel();
126
126
  this.prepareDataMapping();
127
127
  const comProp = this.lookup('reportPropertiesGrid').getData();
128
- if (this.lookup('parametersRef').links.editor.isJSON5Valid()) {
129
- vm.set('parameters', this.lookup('parametersRef').getValue());
130
- } else {
131
- Ext.Msg.alert('Ошибка', 'В параметрах присутствуют ошибки. Параметры прошлого плагина не сохранены');
128
+
129
+ if (this.lookup('parametersRef').rendered) {
130
+ if (this.lookup('parametersRef').links.editor.isJSON5Valid()) {
131
+ vm.set('parameters', this.lookup('parametersRef').getValue());
132
+ } else {
133
+ Ext.Msg.alert('Ошибка', 'В параметрах присутствуют ошибки. Параметры прошлого плагина не сохранены');
134
+ }
132
135
  }
136
+
133
137
  result['parameters'] = JSON5.parse(vm.get('parameters'));
134
138
  result['parameters']['_commandProperties'] = comProp;
135
139
  if (vm.get('mappingMode') === 'map') {
@@ -328,7 +332,10 @@ Ext.define('Coon.uielement.plugin.configPanel.executeCommand.ExecuteCommandPlugi
328
332
  },
329
333
  {
330
334
  xtype: 'ReportPropertiesGrid',
331
- title: 'Свойства',
335
+ title: 'Свойства команды',
336
+ bind: {
337
+ title: 'Свойства команды {ctype}',
338
+ },
332
339
  reference: 'reportPropertiesGrid',
333
340
  loadPropertiesSource: {
334
341
  field: undefined,
@@ -337,14 +344,10 @@ Ext.define('Coon.uielement.plugin.configPanel.executeCommand.ExecuteCommandPlugi
337
344
  ],
338
345
  },
339
346
  {
340
- title: 'Параметры',
341
- tooltip: 'Настройка свойств и параметров команды',
342
347
  xtype: 'panel',
343
- layout: 'fit',
344
- // layout: {
345
- // type: 'vbox', align: 'stretch',
346
- // },
347
348
  title: 'Параметры',
349
+ tooltip: 'Настройка параметров команды',
350
+ layout: 'fit',
348
351
  tbar: [
349
352
  {
350
353
  text: 'Загрузить параметры',
package/src/version.js CHANGED
@@ -1,4 +1,4 @@
1
1
  Ext.define('Coon.version', {
2
2
  singleton: true,
3
- number: '2.7.4',
3
+ number: '2.7.5',
4
4
  });