ru.coon 2.8.37 → 2.8.38

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,9 @@
1
+ # Version 2.8.38, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/417f68b0efcf11c655faed67a57506362b09873e)
2
+ * ## Features
3
+ * <span style='color:green'>feat: opa show user roles in roleEditPanel</span> ([3e4b47], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/3e4b47dd951b1869d3bf3814dad6a035c6607fc2))
4
+
5
+ * update: CHANGELOG.md ([73d1e1], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/73d1e1c828d201e6ae53c19106feed024cfb6c56))
6
+
1
7
  # Version 2.8.37, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/c1a016edfea1ebf863a02984d5a9589c69d75de3)
2
8
  * ## Fixes
3
9
  * <span style='color:red'>fix edit user roles</span> ([e034fb], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/e034fb3df5b31733e39f07c33ebc5b9404b757fe))
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "name": "ru.coon"
5
5
  },
6
6
  "description": "",
7
- "version": "2.8.37",
7
+ "version": "2.8.38",
8
8
  "repository": {
9
9
  "type": "git",
10
10
  "url": "git+http://gitlab-dbr.sigma-it.local/dbr/ru.coon"
@@ -38,7 +38,7 @@ Ext.define('Coon.security.component.ui.UiCPRestrictionEditorController', {
38
38
  },
39
39
 
40
40
  onTabChange(_, component) {
41
- const record = this.lookup('mainTabPanel').getActiveTab().grid.selection;
41
+ const record = this.lookup('mainTabPanel').getActiveTab().grid.getSelection()[0];
42
42
  record && component.fireEvent('select', record);
43
43
  },
44
44
 
@@ -177,7 +177,7 @@ Ext.define('Coon.security.securitySettingComponent.RoleListPanelController', {
177
177
  },
178
178
 
179
179
  editRole() {
180
- const selection = this.view.selection;
180
+ const selection = this.view.getSelection()[0];
181
181
  if (!selection) {
182
182
  return;
183
183
  }
@@ -40,7 +40,7 @@ Ext.define('Coon.security.securitySettingComponent.report.RoleEditReportControll
40
40
  },
41
41
 
42
42
  onEditReportGridButtonHandler(store) {
43
- const selection = this.lookup('reportsGrid').selection;
43
+ const selection = this.lookup('reportsGrid').getSelection()[0];
44
44
  if (!selection) {
45
45
  return;
46
46
  }
@@ -92,14 +92,14 @@ Ext.define('Coon.security.securitySettingComponent.report.RoleEditReportControll
92
92
 
93
93
  deleteReportRecordHandler() {
94
94
  const reportsGrid = this.lookup('reportsGrid');
95
- const selectedRecord = reportsGrid.selection;
95
+ const selectedRecord = reportsGrid.getSelection()[0];
96
96
  delete this.reportGitDataContent[selectedRecord.get('report')][this.role];
97
97
  reportsGrid.getStore().remove(selectedRecord);
98
98
  },
99
99
 
100
100
  deleteReportPluginRecordHandler() {
101
- const selectedReportPluginRecord = this.lookup('reportPluginsGrid').selection;
102
- const masterReport = this.lookup('reportsGrid').selection && this.lookup('reportsGrid').selection.get('report');
101
+ const selectedReportPluginRecord = this.lookup('reportPluginsGrid').getSelection()[0];
102
+ const masterReport = this.lookup('reportsGrid').getSelection()[0] && this.lookup('reportsGrid').getSelection()[0].get('report');
103
103
  const plugin = selectedReportPluginRecord.get('plugin');
104
104
  const pluginArray = this.reportGitDataContent[masterReport][this.role];
105
105
  if (pluginArray && pluginArray.length) {
@@ -58,7 +58,7 @@ Ext.define('Coon.security.securitySettingComponent.uiCP.RoleEditUiCPController',
58
58
  },
59
59
 
60
60
  onEditUICPGridButtonHandler(store) {
61
- const selection = this.lookup('uiCpGrid').selection;
61
+ const selection = this.lookup('uiCpGrid').getSelection()[0];
62
62
  if (!selection) {
63
63
  return;
64
64
  }
@@ -119,14 +119,14 @@ Ext.define('Coon.security.securitySettingComponent.uiCP.RoleEditUiCPController',
119
119
 
120
120
  deleteUICPRecordHandler() {
121
121
  const uiCpGrid = this.lookup('uiCpGrid');
122
- const selectedRecord = uiCpGrid.selection;
122
+ const selectedRecord = uiCpGrid.getSelection()[0];
123
123
  delete this.uiCpGitDataContent[selectedRecord.get('uiElement')];
124
124
  uiCpGrid.getStore().remove(selectedRecord);
125
125
  },
126
126
 
127
127
  removeUICPButtonFromGitObject() {
128
- const selectedUICPButtonRecord = this.lookup('UICPButtonsGrid').selection;
129
- const masterUiElement = this.lookup('uiCpGrid').selection && this.lookup('uiCpGrid').selection.get('uiElement');
128
+ const selectedUICPButtonRecord = this.lookup('UICPButtonsGrid').getSelection()[0];
129
+ const masterUiElement = this.lookup('uiCpGrid').getSelection()[0] && this.lookup('uiCpGrid').getSelection()[0].get('uiElement');
130
130
  const button = selectedUICPButtonRecord.get('button');
131
131
  const buttonArray = this.uiCpGitDataContent[masterUiElement] && this.uiCpGitDataContent[masterUiElement]['buttons'][button];
132
132
  if (buttonArray && buttonArray.length) {
@@ -142,7 +142,7 @@ Ext.define('Coon.security.securitySettingComponent.uiCP.RoleEditUiCPController',
142
142
  },
143
143
 
144
144
  deleteUICPButtonRecordHandler() {
145
- const selectedUICPButtonRecord = this.lookup('UICPButtonsGrid').selection;
145
+ const selectedUICPButtonRecord = this.lookup('UICPButtonsGrid').getSelection()[0];
146
146
  this.removeUICPButtonFromGitObject();
147
147
  this.lookup('UICPButtonsGrid').getStore().remove(selectedUICPButtonRecord);
148
148
  },
@@ -38,7 +38,7 @@ Ext.define('Coon.security.securitySettingComponent.url.RoleEditUrlController', {
38
38
  },
39
39
 
40
40
  deleteUrlRecordHandler() {
41
- const selectedRecord = this.getView().selection;
41
+ const selectedRecord = this.getView().getSelection()[0];
42
42
  if (!selectedRecord) {
43
43
  return;
44
44
  }
@@ -17,11 +17,23 @@ Ext.define('Coon.security.securitySettingComponent.user.RoleEditUserController',
17
17
  }
18
18
  return acc;
19
19
  }, []);
20
- this.getView().getStore().loadData(userRoleGitData);
20
+ this.lookup('userNameGrid').getStore().loadData(userRoleGitData);
21
+ },
22
+
23
+ showUserRoles(grid, selected) {
24
+ const userRolesPanel = this.lookup('userRoles');
25
+ userRolesPanel.getStore().removeAll();
26
+ if (!selected.length) {
27
+ return;
28
+ }
29
+ const selectedUser = selected[0].get('userName');
30
+ userRolesPanel.getStore().loadData(this.userRoleGitDataContent[selectedUser].map((role) => {
31
+ return {role: role};
32
+ }));
21
33
  },
22
34
 
23
35
  getData(newRoleName, shouldDeleteCurrentRole) {
24
- const userNameGrid = this.getView().getStore().getRange();
36
+ const userNameGrid = this.lookup('userNameGrid').getStore().getRange();
25
37
  userNameGrid.map((el) => {
26
38
  const userName = el.get('userName');
27
39
  this.userRoleGitDataContent[userName] = this.userRoleGitDataContent[userName] || [];
@@ -42,7 +54,7 @@ Ext.define('Coon.security.securitySettingComponent.user.RoleEditUserController',
42
54
  },
43
55
 
44
56
  addUserRecordHandler() {
45
- this.getView().getStore().add({});
57
+ this.lookup('userNameGrid').getStore().add({});
46
58
  },
47
59
 
48
60
  // чтобы исходная запись удалилась из объекта userRoleGitDataContent
@@ -53,7 +65,7 @@ Ext.define('Coon.security.securitySettingComponent.user.RoleEditUserController',
53
65
  },
54
66
 
55
67
  removeUserNameFromGitObject() {
56
- const selectedUserRecord = this.getView().selection;
68
+ const selectedUserRecord = this.lookup('userNameGrid').getSelection()[0];
57
69
  const userName = selectedUserRecord.get('userName');
58
70
  if (!this.userRoleGitDataContent[userName]) {
59
71
  return;
@@ -63,9 +75,9 @@ Ext.define('Coon.security.securitySettingComponent.user.RoleEditUserController',
63
75
  },
64
76
 
65
77
  deleteUserNameRecordHandler() {
66
- const selectedUserRecord = this.getView().selection;
78
+ const selectedUserRecord = this.lookup('userNameGrid').getSelection()[0];
67
79
  this.removeUserNameFromGitObject();
68
- this.getView().getStore().remove(selectedUserRecord);
80
+ this.lookup('userNameGrid').getStore().remove(selectedUserRecord);
69
81
  },
70
82
 
71
83
  getUserRoleGitDataContent() {
@@ -1,14 +1,14 @@
1
1
  Ext.define('Coon.security.securitySettingComponent.user.RoleEditUserPanel', {
2
- extend: 'Ext.grid.Panel',
2
+ extend: 'Ext.Panel',
3
3
  alias: 'widget.RoleEditUserPanel',
4
4
  controller: 'RoleEditUserController',
5
5
  uses: [],
6
6
  requires: [],
7
- publishes: 'selection',
8
-
9
- store: {},
10
- flex: 1,
11
7
 
8
+ layout: {
9
+ type: 'hbox',
10
+ align: 'stretch',
11
+ },
12
12
  tbar: {
13
13
  items: [
14
14
  {
@@ -27,23 +27,51 @@ Ext.define('Coon.security.securitySettingComponent.user.RoleEditUserPanel', {
27
27
  }
28
28
  ],
29
29
  },
30
- columns: [
30
+ items: [
31
31
  {
32
- dataIndex: 'userName',
33
- text: 'Логин пользователя',
32
+ xtype: 'grid',
33
+ reference: 'userNameGrid',
34
+ publishes: 'selection',
35
+
36
+ store: {},
34
37
  flex: 1,
35
- editor: {
36
- xtype: 'textfield',
37
- },
38
- }
39
- ],
40
- plugins: [
41
- {
42
- ptype: 'cellediting',
38
+ columns: [
39
+ {
40
+ dataIndex: 'userName',
41
+ text: 'Логин пользователя',
42
+ flex: 1,
43
+ editor: {
44
+ xtype: 'textfield',
45
+ },
46
+ }
47
+ ],
43
48
  listeners: {
44
- beforeEdit: 'beforeEditUserNameGridHandler',
49
+ selectionChange: 'showUserRoles',
45
50
  },
51
+ plugins: [
52
+ {
53
+ ptype: 'cellediting',
54
+ listeners: {
55
+ beforeEdit: 'beforeEditUserNameGridHandler',
56
+ },
57
+ }
58
+ ],
59
+ },
60
+ {
61
+ xtype: 'grid',
62
+ flex: 1,
63
+ reference: 'userRoles',
64
+ store: {},
65
+ columns: [
66
+ {
67
+ dataIndex: 'role',
68
+ text: 'Роли пользователя',
69
+ flex: 1,
70
+ editor: {
71
+ xtype: 'textfield',
72
+ },
73
+ }
74
+ ],
46
75
  }
47
76
  ],
48
-
49
77
  });
package/src/version.js CHANGED
@@ -1,4 +1,4 @@
1
1
  Ext.define('Coon.version', {
2
2
  singleton: true,
3
- number: '2.8.37',
3
+ number: '2.8.38',
4
4
  });