chore: code split sagas and reducers for abac (#16134)
* chore: code splitted sagas and reducers * chore: add comment instead of disabling rule for empty function
This commit is contained in:
parent
1800a45a85
commit
c7158da79f
27
app/client/src/ce/reducers/aclReducer.ts
Normal file
27
app/client/src/ce/reducers/aclReducer.ts
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
import { createReducer } from "utils/ReducerUtils";
|
||||
|
||||
export const initialState: AclReduxState = {
|
||||
isLoading: false,
|
||||
isSaving: false,
|
||||
users: [],
|
||||
groups: [],
|
||||
roles: [],
|
||||
selectedUser: null,
|
||||
selectedGroup: null,
|
||||
selectedRole: null,
|
||||
};
|
||||
|
||||
export interface AclReduxState {
|
||||
isLoading: boolean;
|
||||
isSaving: boolean;
|
||||
users: any[];
|
||||
groups: any[];
|
||||
roles: any[];
|
||||
selectedUser: any;
|
||||
selectedGroup: any;
|
||||
selectedRole: any;
|
||||
}
|
||||
|
||||
export const handlers = {};
|
||||
|
||||
export default createReducer(initialState, handlers);
|
||||
3
app/client/src/ce/sagas/AclSagas.tsx
Normal file
3
app/client/src/ce/sagas/AclSagas.tsx
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
export default function* AclSagas() {
|
||||
// No sagas for CE yet
|
||||
}
|
||||
5
app/client/src/ee/reducers/aclReducer.ts
Normal file
5
app/client/src/ee/reducers/aclReducer.ts
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
export * from "ce/reducers/aclReducer";
|
||||
import { handlers, initialState } from "ce/reducers/aclReducer";
|
||||
import { createReducer } from "utils/ReducerUtils";
|
||||
|
||||
export default createReducer(initialState, handlers);
|
||||
5
app/client/src/ee/sagas/AclSagas.tsx
Normal file
5
app/client/src/ee/sagas/AclSagas.tsx
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
export * from "ce/sagas/AclSagas";
|
||||
|
||||
export default function* AclSagas() {
|
||||
// No sagas for CE yet
|
||||
}
|
||||
|
|
@ -59,6 +59,7 @@ import { MainCanvasReduxState } from "./uiReducers/mainCanvasReducer";
|
|||
import SettingsReducer, {
|
||||
SettingsReduxState,
|
||||
} from "@appsmith/reducers/settingsReducer";
|
||||
import aclReducer, { AclReduxState } from "@appsmith/reducers/aclReducer";
|
||||
import { TriggerValuesEvaluationState } from "./evaluationReducers/triggerReducer";
|
||||
import { CanvasWidgetStructure } from "widgets/constants";
|
||||
|
||||
|
|
@ -68,6 +69,7 @@ const appReducer = combineReducers({
|
|||
evaluations: evaluationsReducer,
|
||||
form: formReducer,
|
||||
settings: SettingsReducer,
|
||||
acl: aclReducer,
|
||||
});
|
||||
|
||||
export default appReducer;
|
||||
|
|
@ -138,4 +140,5 @@ export interface AppState {
|
|||
[key: string]: any;
|
||||
};
|
||||
settings: SettingsReduxState;
|
||||
acl: AclReduxState;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -42,6 +42,7 @@ import * as sentry from "@sentry/react";
|
|||
import formEvaluationChangeListener from "./FormEvaluationSaga";
|
||||
import SuperUserSagas from "@appsmith/sagas/SuperUserSagas";
|
||||
import { ReduxActionTypes } from "@appsmith/constants/ReduxActionConstants";
|
||||
import AclSagas from "@appsmith/sagas/AclSagas";
|
||||
|
||||
const sagas = [
|
||||
initSagas,
|
||||
|
|
@ -84,6 +85,7 @@ const sagas = [
|
|||
gitSyncSagas,
|
||||
SuperUserSagas,
|
||||
appThemingSaga,
|
||||
AclSagas,
|
||||
];
|
||||
|
||||
export function* rootSaga(sagasToRun = sagas): any {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user