@ws-ui/roles-editor 1.13.0-dev.5 → 1.13.0-dev.7

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.
@@ -1,11 +1,18 @@
1
1
  import { FC } from 'react';
2
2
  import { IContainerProps } from '../Container';
3
+ import { TabType } from '../types';
3
4
  import { THistoryControls } from '../adapter';
4
5
  interface IStandaloneProps extends IContainerProps {
5
6
  initialValue?: string;
6
7
  catalog?: datasources.ICatalog;
7
8
  onChange?: (newValue: string) => void;
8
9
  history?: THistoryControls;
10
+ activeTab?: TabType;
11
+ onTabChange?: (tab: TabType) => void;
12
+ selectedRole?: string | null;
13
+ onSelectRole?: (role: string | null) => void;
14
+ selectedPrivilege?: string | null;
15
+ onSelectPrivilege?: (id: string | null) => void;
9
16
  }
10
17
  declare const StandaloneWithReducerAdapter: FC<IStandaloneProps>;
11
18
  export { StandaloneWithReducerAdapter as Standalone };
@@ -13,6 +13,8 @@ interface IModalsState {
13
13
  */
14
14
  interface IReducerState extends IRolesState {
15
15
  modals: IModalsState;
16
+ selectedRole: string | null;
17
+ selectedPrivilege: string | null;
16
18
  }
17
19
  /**
18
20
  * Action types for the reducer
@@ -33,6 +35,12 @@ type ReducerAction = {
33
35
  } | {
34
36
  type: 'TOGGLE_TAB';
35
37
  payload: 'privileges' | 'roles';
38
+ } | {
39
+ type: 'SELECT_ROLE';
40
+ payload: string | null;
41
+ } | {
42
+ type: 'SELECT_PRIVILEGE';
43
+ payload: string | null;
36
44
  } | {
37
45
  type: 'TOGGLE_FORCE_LOGIN';
38
46
  payload: boolean;
@@ -69,6 +77,12 @@ interface IExternalData {
69
77
  host?: TEditorHost;
70
78
  onSetTabFlags?: (path: string, flags: ITabFlags) => void;
71
79
  history?: THistoryControls;
80
+ selectedTab?: 'privileges' | 'roles';
81
+ onTabChange?: (tab: 'privileges' | 'roles') => void;
82
+ selectedRole?: string | null;
83
+ onSelectRole?: (role: string | null) => void;
84
+ selectedPrivilege?: string | null;
85
+ onSelectPrivilege?: (id: string | null) => void;
72
86
  }
73
87
  interface IReducerAdapterExternalProps {
74
88
  catalog?: datasources.ICatalog | null;
@@ -76,6 +90,12 @@ interface IReducerAdapterExternalProps {
76
90
  host?: TEditorHost;
77
91
  onSetTabFlags?: (path: string, flags: ITabFlags) => void;
78
92
  history?: THistoryControls;
93
+ selectedTab?: 'privileges' | 'roles';
94
+ onTabChange?: (tab: 'privileges' | 'roles') => void;
95
+ selectedRole?: string | null;
96
+ onSelectRole?: (role: string | null) => void;
97
+ selectedPrivilege?: string | null;
98
+ onSelectPrivilege?: (id: string | null) => void;
79
99
  }
80
100
  /**
81
101
  * Reducer value interface
@@ -20,6 +20,8 @@ type TEditorStateGetters = {
20
20
  getCatalog(): datasources.IEnhancedCatalog | null;
21
21
  getQodly(): boolean;
22
22
  getSelectedTab(): 'privileges' | 'roles';
23
+ getSelectedRole(): string | null;
24
+ getSelectedPrivilege(): string | null;
23
25
  getForceLogin(): boolean;
24
26
  getRestrictedByDefault(): boolean;
25
27
  getGuestPrivilege(): TSanitizedPrivilege | null;
@@ -41,6 +43,8 @@ type TEditorStateActions = {
41
43
  flags?: ITabFlags;
42
44
  }): void;
43
45
  toggleTab(tab: 'privileges' | 'roles'): void;
46
+ selectRole(role: string | null): void;
47
+ selectPrivilege(id: string | null): void;
44
48
  toggleForceLogin(value: boolean): void;
45
49
  toggleRestrictedByDefault(value: boolean): void;
46
50
  setTabFlags(path: string, flags: ITabFlags): void;