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:
Sangeeth Sivan 2022-08-22 23:07:59 +05:30 committed by GitHub
parent 1800a45a85
commit c7158da79f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 45 additions and 0 deletions

View 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);

View File

@ -0,0 +1,3 @@
export default function* AclSagas() {
// No sagas for CE yet
}

View 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);

View File

@ -0,0 +1,5 @@
export * from "ce/sagas/AclSagas";
export default function* AclSagas() {
// No sagas for CE yet
}

View File

@ -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;
}

View File

@ -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 {