ru.coon 2.7.32 → 2.7.34
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 +47 -0
- package/package.json +1 -1
- package/src/common/panel/MainUploadPanel.js +16 -1
- package/src/nav/AppNavigationMenu.js +2 -2
- package/src/nav/AppNavigationMenu.scss +11 -5
- package/src/nav/menu/WorkspaceMenuView.js +7 -0
- package/src/report/component/EXTJSReportUploadForm.js +1 -0
- package/src/report/component/ReportPanel.js +2 -0
- package/src/report/plugin/configPanel/CopyRowsFromGridConfigPanel.js +1 -0
- package/src/security/component/RoleAccessPanel.js +5 -1
- package/src/security/component/ui/UiCPRestrictionEditor.js +31 -8
- package/src/security/component/ui/UiCPRestrictionEditorController.js +53 -18
- package/src/security/component/url/UrlRestrictionEditor.js +55 -0
- package/src/security/component/url/UrlRestrictionEditorController.js +5 -0
- package/src/security/securitySettingComponent/RoleEditPanel.js +83 -0
- package/src/security/securitySettingComponent/RoleEditPanel.scss +17 -0
- package/src/security/securitySettingComponent/RoleEditPanelController.js +211 -0
- package/src/security/securitySettingComponent/RoleListPanel.js +35 -0
- package/src/security/securitySettingComponent/RoleListPanelController.js +240 -0
- package/src/security/securitySettingComponent/command/GitOpaDownloadCommand.js +33 -0
- package/src/security/securitySettingComponent/menu/RoleEditMenuController.js +171 -0
- package/src/security/securitySettingComponent/menu/RoleEditMenuPanel.js +72 -0
- package/src/security/securitySettingComponent/report/RoleEditReportController.js +111 -0
- package/src/security/securitySettingComponent/report/RoleEditReportPanel.js +88 -0
- package/src/security/securitySettingComponent/uiCP/RoleEditUiCPController.js +139 -0
- package/src/security/securitySettingComponent/uiCP/RoleEditUiCPPanel.js +88 -0
- package/src/security/securitySettingComponent/url/RoleEditUrlController.js +40 -0
- package/src/security/securitySettingComponent/url/RoleEditUrlPanel.js +53 -0
- package/src/security/securitySettingComponent/user/RoleEditUserController.js +61 -0
- package/src/security/securitySettingComponent/user/RoleEditUserPanel.js +49 -0
- package/src/uielement/component/EXTJSUiPanelUploadForm.js +1 -0
- package/src/uielement/component/formchips/FilterConditionToolbar.js +3 -6
- package/src/uielement/component/formchips/FilterConditionToolbarController.js +10 -1
- package/src/version.js +1 -1
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
Ext.define('Coon.security.securitySettingComponent.url.RoleEditUrlController', {
|
|
2
|
+
extend: 'Ext.app.ViewController',
|
|
3
|
+
|
|
4
|
+
alias: 'controller.RoleEditUrlController',
|
|
5
|
+
|
|
6
|
+
loadUrlData(data, role) {
|
|
7
|
+
this.urlGitDataContent = data;
|
|
8
|
+
this.role = role;
|
|
9
|
+
this.getView().getStore().loadData(this.urlGitDataContent[this.role]);
|
|
10
|
+
},
|
|
11
|
+
|
|
12
|
+
getData(newRoleName, shouldDeleteCurrentRole) {
|
|
13
|
+
const urlData = this.getView().getStore().getRange();
|
|
14
|
+
this.urlGitDataContent[this.role] = urlData.map((el) => {
|
|
15
|
+
return {pattern: el.get('pattern'), allow: el.get('allow')};
|
|
16
|
+
});
|
|
17
|
+
if (newRoleName) {
|
|
18
|
+
this.urlGitDataContent[newRoleName] = urlData.map((el) => {
|
|
19
|
+
return {pattern: el.get('pattern'), allow: el.get('allow') || false};
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
if (shouldDeleteCurrentRole) {
|
|
23
|
+
delete this.urlGitDataContent[this.role];
|
|
24
|
+
}
|
|
25
|
+
return JSON.stringify(this.urlGitDataContent);
|
|
26
|
+
},
|
|
27
|
+
|
|
28
|
+
addUrlRecordHandler() {
|
|
29
|
+
this.getView().getStore().add({});
|
|
30
|
+
},
|
|
31
|
+
|
|
32
|
+
deleteUrlRecordHandler() {
|
|
33
|
+
const selectedRecord = this.getView().selection;
|
|
34
|
+
if (!selectedRecord) {
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
this.getView().getStore().remove(selectedRecord);
|
|
38
|
+
},
|
|
39
|
+
|
|
40
|
+
});
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
Ext.define('Coon.security.securitySettingComponent.url.RoleEditUrlPanel', {
|
|
2
|
+
extend: 'Ext.grid.Panel',
|
|
3
|
+
alias: 'widget.RoleEditUrlPanel',
|
|
4
|
+
controller: 'RoleEditUrlController',
|
|
5
|
+
uses: [],
|
|
6
|
+
requires: [],
|
|
7
|
+
|
|
8
|
+
store: {},
|
|
9
|
+
flex: 1,
|
|
10
|
+
|
|
11
|
+
tbar: {
|
|
12
|
+
items: [
|
|
13
|
+
{
|
|
14
|
+
text: 'Добавить',
|
|
15
|
+
ui: 'orange-button',
|
|
16
|
+
handler: 'addUrlRecordHandler',
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
text: 'Удалить',
|
|
20
|
+
ui: 'green-button',
|
|
21
|
+
handler: 'deleteUrlRecordHandler',
|
|
22
|
+
disabled: true,
|
|
23
|
+
bind: {
|
|
24
|
+
disabled: '{!urlGrid.selection}',
|
|
25
|
+
},
|
|
26
|
+
}
|
|
27
|
+
],
|
|
28
|
+
},
|
|
29
|
+
|
|
30
|
+
columns: {
|
|
31
|
+
defaults: {
|
|
32
|
+
flex: 1,
|
|
33
|
+
editor: {
|
|
34
|
+
xtype: 'textfield',
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
items: [
|
|
38
|
+
{
|
|
39
|
+
xtype: 'hintColumn',
|
|
40
|
+
dataIndex: 'pattern',
|
|
41
|
+
text: 'Url',
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
xtype: 'checkcolumn',
|
|
45
|
+
dataIndex: 'allow',
|
|
46
|
+
text: 'allow',
|
|
47
|
+
}
|
|
48
|
+
],
|
|
49
|
+
},
|
|
50
|
+
plugins: [
|
|
51
|
+
'cellediting'
|
|
52
|
+
],
|
|
53
|
+
});
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
Ext.define('Coon.security.securitySettingComponent.user.RoleEditUserController', {
|
|
2
|
+
extend: 'Ext.app.ViewController',
|
|
3
|
+
|
|
4
|
+
alias: 'controller.RoleEditUserController',
|
|
5
|
+
|
|
6
|
+
loadUserData(data, role) {
|
|
7
|
+
this.userRoleGitDataContent = data;
|
|
8
|
+
this.role = role;
|
|
9
|
+
const userRoleGitData = Object.entries(this.userRoleGitDataContent).reduce((acc, [userName, roles]) => {
|
|
10
|
+
if (roles.find((role) => this.role === role)) {
|
|
11
|
+
acc.push({'userName': userName});
|
|
12
|
+
}
|
|
13
|
+
return acc;
|
|
14
|
+
}, []);
|
|
15
|
+
this.getView().getStore().loadData(userRoleGitData);
|
|
16
|
+
},
|
|
17
|
+
|
|
18
|
+
getData(newRoleName, shouldDeleteCurrentRole) {
|
|
19
|
+
const userNameGrid = this.getView().getStore().getRange();
|
|
20
|
+
userNameGrid.map((el) => {
|
|
21
|
+
const userName = el.get('userName');
|
|
22
|
+
this.userRoleGitDataContent[userName] = this.userRoleGitDataContent[userName] || [];
|
|
23
|
+
if (!this.userRoleGitDataContent[userName].includes(this.role)) {
|
|
24
|
+
this.userRoleGitDataContent[userName].push(this.role);
|
|
25
|
+
}
|
|
26
|
+
if (newRoleName && !this.userRoleGitDataContent[userName].includes(newRoleName)) {
|
|
27
|
+
this.userRoleGitDataContent[userName].push(newRoleName);
|
|
28
|
+
}
|
|
29
|
+
if (shouldDeleteCurrentRole) {
|
|
30
|
+
const index = this.userRoleGitDataContent[userName].findIndex((role) => role === this.role);
|
|
31
|
+
if (index !== -1) {
|
|
32
|
+
this.userRoleGitDataContent[userName].splice(index, 1);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
return JSON.stringify(this.userRoleGitDataContent);
|
|
37
|
+
},
|
|
38
|
+
|
|
39
|
+
addUserRecordHandler() {
|
|
40
|
+
this.getView().getStore().add({});
|
|
41
|
+
},
|
|
42
|
+
|
|
43
|
+
beforeEditUserNameGridHandler(editor, context) {
|
|
44
|
+
if (context.value) {
|
|
45
|
+
this.deleteUserNameRecordHandler();
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
|
|
49
|
+
deleteUserNameRecordHandler() {
|
|
50
|
+
const selectedUserRecord = this.getView().getSelection()[0];
|
|
51
|
+
const userName = selectedUserRecord.get('userName');
|
|
52
|
+
const index = this.userRoleGitDataContent[userName].findIndex((el) => el === this.role);
|
|
53
|
+
index !== -1 && this.userRoleGitDataContent[userName].splice(index, 1);
|
|
54
|
+
this.getView().getStore().remove(selectedUserRecord);
|
|
55
|
+
},
|
|
56
|
+
|
|
57
|
+
getUserRoleGitDataContent() {
|
|
58
|
+
return this.userRoleGitDataContent;
|
|
59
|
+
},
|
|
60
|
+
|
|
61
|
+
});
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
Ext.define('Coon.security.securitySettingComponent.user.RoleEditUserPanel', {
|
|
2
|
+
extend: 'Ext.grid.Panel',
|
|
3
|
+
alias: 'widget.RoleEditUserPanel',
|
|
4
|
+
controller: 'RoleEditUserController',
|
|
5
|
+
uses: [],
|
|
6
|
+
requires: [],
|
|
7
|
+
publishes: 'selection',
|
|
8
|
+
|
|
9
|
+
store: {},
|
|
10
|
+
flex: 1,
|
|
11
|
+
|
|
12
|
+
tbar: {
|
|
13
|
+
items: [
|
|
14
|
+
{
|
|
15
|
+
text: 'Добавить',
|
|
16
|
+
ui: 'orange-button',
|
|
17
|
+
handler: 'addUserRecordHandler',
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
text: 'Удалить',
|
|
21
|
+
ui: 'green-button',
|
|
22
|
+
handler: 'deleteUserNameRecordHandler',
|
|
23
|
+
disabled: true,
|
|
24
|
+
bind: {
|
|
25
|
+
disabled: '{!userNameGrid.selection}',
|
|
26
|
+
},
|
|
27
|
+
}
|
|
28
|
+
],
|
|
29
|
+
},
|
|
30
|
+
columns: [
|
|
31
|
+
{
|
|
32
|
+
dataIndex: 'userName',
|
|
33
|
+
text: 'Логин пользователя',
|
|
34
|
+
flex: 1,
|
|
35
|
+
editor: {
|
|
36
|
+
xtype: 'textfield',
|
|
37
|
+
},
|
|
38
|
+
}
|
|
39
|
+
],
|
|
40
|
+
plugins: [
|
|
41
|
+
{
|
|
42
|
+
ptype: 'cellediting',
|
|
43
|
+
listeners: {
|
|
44
|
+
beforeEdit: 'beforeEditUserNameGridHandler',
|
|
45
|
+
},
|
|
46
|
+
}
|
|
47
|
+
],
|
|
48
|
+
|
|
49
|
+
});
|
|
@@ -75,6 +75,9 @@ Ext.define('Coon.uielement.component.formchips.FilterConditionToolbar', {
|
|
|
75
75
|
dock: 'bottom',
|
|
76
76
|
config: {
|
|
77
77
|
searchForm: null,
|
|
78
|
+
/**
|
|
79
|
+
* @param {boolean} Если true, то ЧИП, по которому был произведен поиск, можно закрывать. Что приведет к очистке поля, связанного с чипом.
|
|
80
|
+
*/
|
|
78
81
|
closableFilterCondition: false,
|
|
79
82
|
},
|
|
80
83
|
listeners: {
|
|
@@ -122,12 +125,6 @@ Ext.define('Coon.uielement.component.formchips.FilterConditionToolbar', {
|
|
|
122
125
|
],
|
|
123
126
|
}*/
|
|
124
127
|
],
|
|
125
|
-
config: {
|
|
126
|
-
/**
|
|
127
|
-
* @param {boolean} Если true, то ЧИП, по которому был произведен поиск, можно закрывать. Что приведет к очистке поля, связанного с чипом.
|
|
128
|
-
*/
|
|
129
|
-
closableFilterCondition: false,
|
|
130
|
-
},
|
|
131
128
|
|
|
132
129
|
statics: {
|
|
133
130
|
/**
|
|
@@ -201,8 +201,11 @@ Ext.define('Coon.uielement.component.formchips.FilterConditionToolbarController'
|
|
|
201
201
|
const value = Ext.isFunction(field.getRawValue) ? field.getRawValue(): field.getValue();
|
|
202
202
|
const isInitiallyHidden = field.initialConfig && field.initialConfig.hidden;
|
|
203
203
|
if (!isInitiallyHidden && value) {
|
|
204
|
-
const label = field.fieldLabel || field.boxLabel;
|
|
204
|
+
const label = (field.fieldLabel || field.boxLabel || '').replaceAll(/<br>|<\/br>/g, ' ');
|
|
205
205
|
const chipLabel = ['Y', 'N'].includes(value);
|
|
206
|
+
if (field.isCheckbox && !field.checked) {
|
|
207
|
+
continue;
|
|
208
|
+
}
|
|
206
209
|
result.push({
|
|
207
210
|
fieldLink: field,
|
|
208
211
|
label,
|
|
@@ -220,6 +223,12 @@ Ext.define('Coon.uielement.component.formchips.FilterConditionToolbarController'
|
|
|
220
223
|
if (!this.searchForm) {
|
|
221
224
|
return;
|
|
222
225
|
}
|
|
226
|
+
const reportPanel = this.getView().up('ReportPanel');
|
|
227
|
+
// Если в отчете еще не было поиска, то чипы не отображаем.
|
|
228
|
+
if (!reportPanel.filtered) {
|
|
229
|
+
return;
|
|
230
|
+
}
|
|
231
|
+
|
|
223
232
|
this.removeAllChips();
|
|
224
233
|
this.fillChipsHandler();
|
|
225
234
|
},
|
package/src/version.js
CHANGED