ru.coon 2.8.72 → 2.8.74
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 +12 -0
- package/package.json +1 -1
- package/src/app/router/CoonRouter.js +19 -0
- package/src/app/router/action.js +8 -0
- package/src/app/router/actions/MenuItemAction.js +41 -0
- package/src/app/router/actions/OcpbAction.js +22 -0
- package/src/report/component/reportpanel/ReportTreeStore.js +3 -3
- package/src/uielement/command/GetUIElementCommand.js +1 -1
- package/src/uielement/component/UiCustomController.js +47 -32
- package/src/version.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
# Version 2.8.74, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/03f252993ff5fe140d9d4d7c932568938495c2f8)
|
|
2
|
+
* ## Fixes
|
|
3
|
+
* <span style='color:red'>fix csrf in ReportTreeStore</span> ([676398], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/67639846c3cd9c26080176d8df48b751877ee128))
|
|
4
|
+
|
|
5
|
+
* update: CHANGELOG.md ([9146a2], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/9146a22751066fdcbb7df9295b52a61a6c5fa025))
|
|
6
|
+
|
|
7
|
+
# Version 2.8.73, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/f97bb01382aad65df2b647ad444e17832801b2b4)
|
|
8
|
+
* ## Fixes
|
|
9
|
+
* <span style='color:red'> UiCustomController.processAccessDecision on [boxready, afterrender]</span> ([869ca8], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/869ca8f1e3c130533b820feee6dab0d75e778810))
|
|
10
|
+
|
|
11
|
+
* update: CHANGELOG.md ([116a19], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/116a197b861a06d314893c3d0b6e26e5a17e6ac3))
|
|
12
|
+
|
|
1
13
|
# Version 2.8.72, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/a1eeb12f31b999e7392be579f66ab4708402f925)
|
|
2
14
|
* ## Fixes
|
|
3
15
|
* <span style='color:red'>fix zero date</span> ([e4bac1], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/e4bac11fa1b2e186857a9b2032745053ffa0eaa3))
|
package/package.json
CHANGED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
Ext.define('Coon.app.router.CoonRouter', {
|
|
2
|
+
// mixins: ['Ext.route.Mixin'],
|
|
3
|
+
extend: 'Ext.app.Controller',
|
|
4
|
+
|
|
5
|
+
constructor() {
|
|
6
|
+
console.log('CoonRouter', this);
|
|
7
|
+
this.setRoutes(
|
|
8
|
+
Object.fromEntries(
|
|
9
|
+
Object.entries(this.routes).map(([key, route]) => {
|
|
10
|
+
if (route.routeaction) {
|
|
11
|
+
return Ext.create(`routeaction.${route.routeaction}`).get(route);
|
|
12
|
+
} else {
|
|
13
|
+
return [key, route];
|
|
14
|
+
}
|
|
15
|
+
})
|
|
16
|
+
)
|
|
17
|
+
);
|
|
18
|
+
},
|
|
19
|
+
});
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
Ext.define('Coon.app.router.actions.MenuItemAction', {
|
|
2
|
+
extend: 'Coon.app.router.action',
|
|
3
|
+
|
|
4
|
+
alias: 'routeaction.MenuItemAction',
|
|
5
|
+
|
|
6
|
+
action(route) {
|
|
7
|
+
this.lastRoute = route;
|
|
8
|
+
const app = Ext.getApplication();
|
|
9
|
+
if (!app.initialRoute) {
|
|
10
|
+
app.initialRoute = route;
|
|
11
|
+
}
|
|
12
|
+
Ext.fireEvent('route:change', route);
|
|
13
|
+
},
|
|
14
|
+
|
|
15
|
+
async before(route) {
|
|
16
|
+
Coon.log.debug('validateMenuItem.run', route.id);
|
|
17
|
+
try {
|
|
18
|
+
route.menuItem = await Coon.nav.MenuEntity.getMenuItem(route.id);
|
|
19
|
+
if (!route.menuItem) {
|
|
20
|
+
Coon.log.debug('validateMenuItem: miss menuItem', route.id);
|
|
21
|
+
route.stop();
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
route.uiElement = await Coon.util.promisifyCmd(
|
|
25
|
+
'Coon.uielement.command.GetUIElementCommand',
|
|
26
|
+
route.menuItem.UI_ELEMENT_CD
|
|
27
|
+
);
|
|
28
|
+
if (!route.uiElement) {
|
|
29
|
+
Coon.log.debug('validateMenuItem: miss uiElement');
|
|
30
|
+
route.stop();
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
route.urlHash = window.location.hash;
|
|
34
|
+
return true;
|
|
35
|
+
} catch (ex) {
|
|
36
|
+
route.stop();
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
|
|
41
|
+
});
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
Ext.define('Coon.app.router.actions.OcpbAction', {
|
|
2
|
+
extend: 'Coon.app.router.action',
|
|
3
|
+
|
|
4
|
+
alias: 'routeaction.OcpbAction',
|
|
5
|
+
action(route) {
|
|
6
|
+
route.urlHash = window.location.hash;
|
|
7
|
+
if (route.urlHash.length > Coon.app.Router.maxUrlLength) {
|
|
8
|
+
return;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
if (Coon.app.Router.getRouterView()) {
|
|
12
|
+
Ext.create('Coon.common.component.OpenComponent', {})
|
|
13
|
+
.loadUIElement(route.cmpId, route.parameters, {urlHash: route.urlHash});
|
|
14
|
+
} else {
|
|
15
|
+
Ext.getApplication().on('centerview:init', () => {
|
|
16
|
+
Ext.create('Coon.common.component.OpenComponent', {})
|
|
17
|
+
.loadUIElement(route.cmpId, route.parameters, {urlHash: route.urlHash});
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
|
|
22
|
+
});
|
|
@@ -12,13 +12,13 @@ Ext.define('Coon.report.component.reportpanel.ReportTreeStore', {
|
|
|
12
12
|
filterer: 'bottomup',
|
|
13
13
|
proxy: {
|
|
14
14
|
type: 'ajax',
|
|
15
|
-
headers: {
|
|
16
|
-
'X-CSRF-Token': localStorage.getItem('CSRFToken'),
|
|
17
|
-
},
|
|
18
15
|
$configStrict: false,
|
|
19
16
|
getMethod: function() {
|
|
20
17
|
return 'POST';
|
|
21
18
|
},
|
|
19
|
+
getHeaders: function() {
|
|
20
|
+
return {'X-CSRF-Token': localStorage.getItem('CSRFToken')};
|
|
21
|
+
},
|
|
22
22
|
url: 'ReportFormData/get',
|
|
23
23
|
reader: {
|
|
24
24
|
type: 'json',
|
|
@@ -24,7 +24,7 @@ Ext.define('Coon.uielement.command.GetUIElementCommand', {
|
|
|
24
24
|
}
|
|
25
25
|
props.uiElementCd = this.uiElementCd;
|
|
26
26
|
props.accessDecision = data.accessDecision;
|
|
27
|
-
Coon.log.debug('GetUIElementCommand.props', props);
|
|
27
|
+
// Coon.log.debug('GetUIElementCommand.props', props);
|
|
28
28
|
data.propertyData = JSON5.stringify(props);
|
|
29
29
|
} catch (ex) {
|
|
30
30
|
Coon.log.error('GetUIElementCommand.UiCustomPanel: invalid propertyData JSON5');
|
|
@@ -5,51 +5,66 @@ Ext.define('Coon.uielement.component.UiCustomController', {
|
|
|
5
5
|
|
|
6
6
|
locals: {},
|
|
7
7
|
|
|
8
|
+
control: {
|
|
9
|
+
'#': {
|
|
10
|
+
boxready: 'processAccessDecision',
|
|
11
|
+
afterrender: 'processAccessDecision',
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
|
|
8
15
|
init: function(view) {
|
|
9
16
|
if (this.isTracePluginsEnabled()) {
|
|
10
17
|
this.getTraceBuffer();
|
|
11
18
|
}
|
|
19
|
+
},
|
|
20
|
+
|
|
21
|
+
processAccessDecision() {
|
|
22
|
+
if (this.isAccessDecisionProcessed) {
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
this.isAccessDecisionProcessed = true;
|
|
26
|
+
const view = this.getView();
|
|
12
27
|
const config = view.propertyData || view.initialConfig;
|
|
13
28
|
if (!view || typeof view.on !== 'function') {
|
|
14
29
|
Coon.log.debug(` [Error]UiCustomController.init - view not found or view.on is not a function`);
|
|
15
30
|
return;
|
|
16
31
|
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
32
|
+
Coon.log.debug('UiCustomController.config', config);
|
|
33
|
+
|
|
34
|
+
const {accessDecision, securePoints} = config;
|
|
35
|
+
Coon.log.debug('UiCustomController.accessProps', {accessDecision, securePoints});
|
|
36
|
+
if (!Ext.isObject(accessDecision) || accessDecision.allow) {
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
const viewButtons = view.query('button');
|
|
40
|
+
const allowedMap = new Set(accessDecision.allowedItems);
|
|
41
|
+
if (Ext.isObject(securePoints.buttons) && Object.keys(securePoints.buttons).length) {
|
|
42
|
+
Coon.log.debug(`used securePoints, allowed: ${accessDecision.allowedItems},\nsecureButtons: ${Object.keys(securePoints.buttons)}`);
|
|
43
|
+
viewButtons.forEach((btn) => {
|
|
44
|
+
const id = Coon.util.translit(btn.text || btn.iconCls);
|
|
45
|
+
if (securePoints.buttons[id] && !allowedMap.has(id)) {
|
|
46
|
+
btn.hide();
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
} else {
|
|
50
|
+
const excludeBtns = [].concat(
|
|
51
|
+
view.query('tabpanel > tabbar > button').map((btn) => btn.id),
|
|
52
|
+
view.query('ReportPanel button').map((btn) => btn.id),
|
|
53
|
+
view.query('CharacteristicGridEditor button').map((btn) => btn.id)
|
|
54
|
+
);
|
|
55
|
+
const excludeIds = new Set(excludeBtns);
|
|
56
|
+
view.query('button')
|
|
57
|
+
.filter((btn) => btn.text && !excludeIds.has(btn.id))
|
|
58
|
+
.forEach((btn) => {
|
|
28
59
|
const id = Coon.util.translit(btn.text || btn.iconCls);
|
|
29
|
-
if (
|
|
60
|
+
if (allowedMap.has(id)) {
|
|
61
|
+
Coon.log.debug('PASSED: view.button.id', id);
|
|
62
|
+
} else {
|
|
30
63
|
btn.hide();
|
|
64
|
+
Coon.log.debug('HIDE: view.button.id', id);
|
|
31
65
|
}
|
|
32
66
|
});
|
|
33
|
-
|
|
34
|
-
const excludeBtns = [].concat(
|
|
35
|
-
view.query('tabpanel > tabbar > button').map((btn) => btn.id),
|
|
36
|
-
view.query('ReportPanel button').map((btn) => btn.id),
|
|
37
|
-
view.query('CharacteristicGridEditor button').map((btn) => btn.id)
|
|
38
|
-
);
|
|
39
|
-
const excludeIds = new Set(excludeBtns);
|
|
40
|
-
view.query('button')
|
|
41
|
-
.filter((btn) => btn.text && !excludeIds.has(btn.id))
|
|
42
|
-
.forEach((btn) => {
|
|
43
|
-
const id = Coon.util.translit(btn.text || btn.iconCls);
|
|
44
|
-
if (allowedMap.has(id)) {
|
|
45
|
-
Coon.log.debug('PASSED: view.button.id', id);
|
|
46
|
-
} else {
|
|
47
|
-
btn.hide();
|
|
48
|
-
Coon.log.debug('HIDE: view.button.id', id);
|
|
49
|
-
}
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
}, this);
|
|
67
|
+
}
|
|
53
68
|
},
|
|
54
69
|
|
|
55
70
|
getData(view) {
|
package/src/version.js
CHANGED