Skip to content
Merged
11 changes: 4 additions & 7 deletions app/client/src/actions/propertyPaneActions.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import { ReduxActionTypes } from "ee/constants/ReduxActionConstants";
import type { SelectedPropertyPanel } from "reducers/uiReducers/propertyPaneReducer";
import type {
SelectedPropertyPanel,
ShowPropertyPanePayload,
} from "reducers/uiReducers/propertyPaneReducer";

export const updateWidgetName = (widgetId: string, newName: string) => {
return {
Expand Down Expand Up @@ -115,12 +118,6 @@ export const createNewQueryFromActionCreator = (
};
};

export interface ShowPropertyPanePayload {
widgetId?: string;
callForDragOrResize?: boolean;
force: boolean;
}

export const showPropertyPane = (payload: ShowPropertyPanePayload) => {
return {
type: ReduxActionTypes.SHOW_PROPERTY_PANE,
Expand Down
77 changes: 0 additions & 77 deletions app/client/src/ce/entities/IDE/utils.ts

This file was deleted.

6 changes: 6 additions & 0 deletions app/client/src/ce/entities/IDE/utils/getBaseUrlsForIDEType.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { IDEBasePaths } from "ee/IDE/constants/routes";
import type { IDEType } from "ee/IDE/Interfaces/IDETypes";

export function getBaseUrlsForIDEType(type: IDEType): string[] {
return IDEBasePaths[type];
}
29 changes: 29 additions & 0 deletions app/client/src/ce/entities/IDE/utils/getEditableTabPermissions.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import {
BUILDER_CUSTOM_PATH,
BUILDER_PATH,
BUILDER_PATH_DEPRECATED,
} from "ee/constants/routes/appRoutes";

import type { EntityItem } from "ee/IDE/Interfaces/EntityItem";
import { getHasManageActionPermission } from "ee/utils/BusinessFeatures/permissionPageHelpers";

export const EDITOR_PATHS = [
BUILDER_CUSTOM_PATH,
BUILDER_PATH,
BUILDER_PATH_DEPRECATED,
];

export interface EditableTabPermissions {
isFeatureEnabled: boolean;
entity?: EntityItem;
}

export const getEditableTabPermissions = ({
entity,
isFeatureEnabled,
}: EditableTabPermissions) => {
return getHasManageActionPermission(
isFeatureEnabled,
entity?.userPermissions || [],
);
};
15 changes: 15 additions & 0 deletions app/client/src/ce/entities/IDE/utils/getIDETypeByUrl.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { IDEBasePaths } from "ee/IDE/constants/routes";
import { IDE_TYPE, type IDEType } from "ee/IDE/Interfaces/IDETypes";
import { matchPath } from "react-router-dom";

export function getIDETypeByUrl(path: string): IDEType {
for (const type in IDEBasePaths) {
const basePaths = IDEBasePaths[type as IDEType];

if (matchPath(path, { path: basePaths })) {
return type as IDEType;
}
}

return IDE_TYPE.None;
}
4 changes: 4 additions & 0 deletions app/client/src/ce/entities/IDE/utils/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export { getBaseUrlsForIDEType } from "./getBaseUrlsForIDEType";
export { getIDETypeByUrl } from "./getIDETypeByUrl";
export { saveEntityName } from "./saveEntityName";
export * from "./getEditableTabPermissions";
23 changes: 23 additions & 0 deletions app/client/src/ce/entities/IDE/utils/saveEntityName.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { saveActionName } from "actions/pluginActionActions";
import { EditorEntityTab } from "IDE/Interfaces/EditorTypes";
import type { EntityItem } from "ee/IDE/Interfaces/EntityItem";
import { saveJSObjectName } from "actions/jsActionActions";

interface SaveEntityName {
params: {
name: string;
id: string;
};
segment: EditorEntityTab;
entity?: EntityItem;
}

export const saveEntityName = ({ params, segment }: SaveEntityName) => {
let saveNameAction = saveActionName(params);

if (EditorEntityTab.JS === segment) {
saveNameAction = saveJSObjectName(params);
}

return saveNameAction;
};
32 changes: 1 addition & 31 deletions app/client/src/ce/selectors/applicationSelectors.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,7 @@ import type { ApplicationPayload } from "entities/Application";
import Fuse from "fuse.js";
import type { GitApplicationMetadata } from "ee/api/ApplicationApi";
import { getApplicationsOfWorkspace } from "ee/selectors/selectedWorkspaceSelectors";
import {
NAVIGATION_SETTINGS,
SIDEBAR_WIDTH,
type ThemeSetting,
defaultThemeSetting,
} from "constants/AppConstants";
import { type ThemeSetting, defaultThemeSetting } from "constants/AppConstants";
import { DEFAULT_EVALUATION_VERSION } from "constants/EvalConstants";

const fuzzySearchOptions = {
Expand Down Expand Up @@ -148,31 +143,6 @@ export const getAppSidebarPinned = (state: AppState) => {
return state.ui.applications.isAppSidebarPinned;
};

/**
* Return the width of the sidbar depending on the sidebar style.
* If there isn't any sidebar or it is unpinned, return 0.
*/
export const getSidebarWidth = (state: AppState) => {
const navigationSetting =
state.ui.applications.currentApplication?.applicationDetail
?.navigationSetting;
const isAppSidebarPinned = state.ui.applications.isAppSidebarPinned;

if (
navigationSetting?.showNavbar !== false &&
navigationSetting?.orientation === NAVIGATION_SETTINGS.ORIENTATION.SIDE &&
isAppSidebarPinned
) {
if (navigationSetting?.navStyle === NAVIGATION_SETTINGS.NAV_STYLE.MINIMAL) {
return SIDEBAR_WIDTH.MINIMAL;
} else {
return SIDEBAR_WIDTH.REGULAR;
}
}

return 0;
};

export const getIsUploadingNavigationLogo = (state: AppState) => {
return state.ui.applications.isUploadingNavigationLogo;
};
Expand Down
Loading
Loading