-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Move entities/IDE/constants (#39064)
## Description Remove the IDE constants from the entities folder and move it to the common IDE folder Create separate buttons exports for sidebar buttons Update the button usages Fixes #39050 ## Automation /ok-to-test tags="@tag.All" ### 🔍 Cypress test results <!-- This is an auto-generated comment: Cypress test results --> > [!TIP] > 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉 > Workflow run: <https://github.com/appsmithorg/appsmith/actions/runs/13191919670> > Commit: 5055b6e > <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=13191919670&attempt=1" target="_blank">Cypress dashboard</a>. > Tags: `@tag.All` > Spec: > <hr>Fri, 07 Feb 2025 05:19:56 UTC <!-- end of auto-generated comment: Cypress test results --> ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [ ] No <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Introduced new editor state definitions and enhanced sidebar configurations with conditional messaging for data source availability. - **Refactor** - Reorganized internal module structures and consolidated type definitions to improve maintainability, consistency, and type safety. - **Tests** - Updated test references to align with the new module organization. These changes streamline the codebase and lay the groundwork for future improvements while maintaining the existing end-user experience. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Ankita Kinger <[email protected]>
- Loading branch information
1 parent
ddc3eae
commit ac41ad2
Showing
111 changed files
with
291 additions
and
280 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
export enum EditorEntityTab { | ||
QUERIES = "queries", | ||
JS = "js", | ||
UI = "ui", | ||
} | ||
|
||
export enum EditorEntityTabState { | ||
List = "List", | ||
Edit = "Edit", | ||
Add = "Add", | ||
} | ||
|
||
export enum EditorViewMode { | ||
FullScreen = "FullScreen", | ||
SplitScreen = "SplitScreen", | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import type { ComponentType } from "react"; | ||
|
||
export type UseRoutes = Array<{ | ||
key: string; | ||
component: ComponentType; | ||
path: string[]; | ||
exact: boolean; | ||
}>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import type { IDESidebarButton } from "@appsmith/ads"; | ||
import { EditorState } from "../enums"; | ||
|
||
const SidebarButtonTitles = { | ||
EDITOR: "Editor", | ||
DATA: "Datasources", | ||
SETTINGS: "Settings", | ||
LIBRARIES: "Libraries", | ||
}; | ||
|
||
export const EditorButton = (urlSuffix: string): IDESidebarButton => ({ | ||
state: EditorState.EDITOR, | ||
icon: "editor-v3", | ||
title: SidebarButtonTitles.EDITOR, | ||
testId: SidebarButtonTitles.EDITOR, | ||
urlSuffix, | ||
}); | ||
|
||
export const DataButton = (urlSuffix: string): IDESidebarButton => ({ | ||
state: EditorState.DATA, | ||
icon: "datasource-v3", | ||
tooltip: SidebarButtonTitles.DATA, | ||
testId: SidebarButtonTitles.DATA, | ||
urlSuffix, | ||
}); | ||
|
||
export const LibrariesButton = (urlSuffix: string): IDESidebarButton => ({ | ||
state: EditorState.LIBRARIES, | ||
icon: "packages-v3", | ||
tooltip: SidebarButtonTitles.LIBRARIES, | ||
testId: SidebarButtonTitles.LIBRARIES, | ||
urlSuffix, | ||
}); | ||
|
||
export const SettingsButton = (urlSuffix: string): IDESidebarButton => ({ | ||
state: EditorState.SETTINGS, | ||
icon: "settings-v3", | ||
tooltip: SidebarButtonTitles.SETTINGS, | ||
testId: SidebarButtonTitles.SETTINGS, | ||
urlSuffix, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import type { PluginType } from "../../../entities/Plugin"; | ||
import type { ReactNode } from "react"; | ||
|
||
export interface EntityItem { | ||
title: string; | ||
type: PluginType; | ||
key: string; | ||
icon?: ReactNode; | ||
group?: string; | ||
userPermissions?: string[]; | ||
} | ||
|
||
export interface GenericEntityItem extends Omit<EntityItem, "type"> {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
export const IDE_TYPE = { | ||
None: "None", | ||
App: "App", | ||
} as const; | ||
|
||
export type IDEType = keyof typeof IDE_TYPE; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import { | ||
ADD_PATH, | ||
API_EDITOR_ID_ADD_PATH, | ||
API_EDITOR_ID_PATH, | ||
BUILDER_CUSTOM_PATH, | ||
BUILDER_PATH, | ||
BUILDER_PATH_DEPRECATED, | ||
DATA_SOURCES_EDITOR_ID_PATH, | ||
ENTITY_PATH, | ||
INTEGRATION_EDITOR_PATH, | ||
JS_COLLECTION_ID_ADD_PATH, | ||
JS_COLLECTION_ID_PATH, | ||
QUERIES_EDITOR_ID_ADD_PATH, | ||
QUERIES_EDITOR_ID_PATH, | ||
WIDGETS_EDITOR_ID_PATH, | ||
} from "ee/constants/routes/appRoutes"; | ||
import { | ||
SAAS_EDITOR_API_ID_ADD_PATH, | ||
SAAS_EDITOR_API_ID_PATH, | ||
SAAS_EDITOR_DATASOURCE_ID_PATH, | ||
} from "pages/Editor/SaaSEditor/constants"; | ||
|
||
import { IDE_TYPE, type IDEType } from "../Interfaces/IDETypes"; | ||
|
||
export const EntityPaths: string[] = [ | ||
API_EDITOR_ID_ADD_PATH, | ||
API_EDITOR_ID_PATH, | ||
QUERIES_EDITOR_ID_ADD_PATH, | ||
QUERIES_EDITOR_ID_PATH, | ||
DATA_SOURCES_EDITOR_ID_PATH, | ||
INTEGRATION_EDITOR_PATH, | ||
SAAS_EDITOR_DATASOURCE_ID_PATH, | ||
SAAS_EDITOR_API_ID_ADD_PATH, | ||
SAAS_EDITOR_API_ID_PATH, | ||
JS_COLLECTION_ID_PATH, | ||
JS_COLLECTION_ID_ADD_PATH, | ||
WIDGETS_EDITOR_ID_PATH, | ||
WIDGETS_EDITOR_ID_PATH + ADD_PATH, | ||
ENTITY_PATH, | ||
]; | ||
export const IDEBasePaths: Readonly<Record<IDEType, string[]>> = { | ||
[IDE_TYPE.None]: [], | ||
[IDE_TYPE.App]: [BUILDER_PATH, BUILDER_PATH_DEPRECATED, BUILDER_CUSTOM_PATH], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
app/client/src/ce/entities/IDE/hooks/useCreateActionsPermissions.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.