hunk.code_window: import com.appsmith.server.services.ActionCollectionService;
   import com.appsmith.server.services.ActionService;
   import com.appsmith.server.services.ApplicationPageService;
   import com.appsmith.server.services.ApplicationService;
   import com.appsmith.server.services.DatasourceService;
   import com.appsmith.server.services.OrganizationService;
   import com.appsmith.server.services.PageService;
   import com.appsmith.server.services.SessionUserService;
  
hunk.labels: keep keep keep keep add keep keep keep
hunk.after_edit: import com.appsmith.server.services.EncryptionService;
  
hunk.file_path: app/server/appsmith-server/src/test/java/com/appsmith/server/solutions/ExamplesOrganizationClonerTests.java
hunk.type: add
file: import { createReducer } from "utils/AppsmithUtils";
  import {
    ReduxActionTypes,
    UpdateCanvasPayload,
    ReduxAction,
  } from "constants/ReduxActionConstants";
  import { WidgetProps } from "widgets/BaseWidget";
  import { ContainerWidgetProps } from "widgets/ContainerWidget";
  import { UpdateWidgetPropertyPayload } from "actions/controlActions";
  
  const initialState: CanvasWidgetsReduxState = {};
  
  export type FlattenedWidgetProps = ContainerWidgetProps<WidgetProps> & {
    children?: string[];
  };
  
  const canvasWidgetsReducer = createReducer(initialState, {
    [ReduxActionTypes.UPDATE_CANVAS]: (
      state: CanvasWidgetsReduxState,
      action: ReduxAction<UpdateCanvasPayload>,
    ) => {
      return { ...action.payload.widgets };
    },
    [ReduxActionTypes.UPDATE_LAYOUT]: (
      state: CanvasWidgetsReduxState,
      action: ReduxAction<UpdateCanvasPayload>,
    ) => {
      return { ...action.payload.widgets };
    },
    [ReduxActionTypes.UPDATE_WIDGET_PROPERTY]: (
      state: CanvasWidgetsReduxState,
      action: ReduxAction<UpdateWidgetPropertyPayload>,
    ) => {
      const widget = state[action.payload.widgetId];
      return {
        ...state,
        [action.payload.widgetId]: {
          ...widget,
          [action.payload.propertyName]: action.payload.propertyValue,
        },
      };
    },
  });
  
  export interface CanvasWidgetsReduxState {
    [widgetId: string]: FlattenedWidgetProps;
  }
  
  export default canvasWidgetsReducer;
  