-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Replace entities in entity explorer with new ADS templates (#3…
…8750) ## Description Replace entities in entity explorer with new ADS templates Fixes [#38286](#38286) [#39289](#38289) ## 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/12945261277> > Commit: bf508e2 > <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=12945261277&attempt=2" target="_blank">Cypress dashboard</a>. > Tags: `@tag.All` > Spec: > <hr>Fri, 24 Jan 2025 08:55:33 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 ## Summary by CodeRabbit ## Release Notes - **New Features** - Added new context menu components for JavaScript and Query entities. - Introduced enhanced entity item rendering for JavaScript and Query collections. - Implemented more granular permission-based context menu actions. - Added new components: `Rename`, `Copy`, `Move`, `Delete`, `ShowBindings`, `Prettify`, and `EntityContextMenu`. - **Improvements** - Streamlined context menu functionality across editor interfaces. - Enhanced user permissions handling for entity actions. - Improved modularity of editor components. - Updated rendering logic for JavaScript and Query lists based on feature flags. - **Bug Fixes** - Refined component prop management. - Updated navigation and analytics event logging for entity interactions. - **Refactoring** - Simplified component structures. - Removed deprecated prop usage. - Consolidated import and export statements. These changes primarily focus on improving the user experience and developer flexibility within the application's editor interfaces. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
- Loading branch information
1 parent
eb72ece
commit 8f5aad9
Showing
42 changed files
with
1,104 additions
and
525 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
26 changes: 3 additions & 23 deletions
26
app/client/src/ce/pages/Editor/IDE/EditorPane/JS/ListItem.tsx
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 |
---|---|---|
@@ -1,27 +1,7 @@ | ||
import React from "react"; | ||
import ExplorerJSCollectionEntity from "pages/Editor/Explorer/JSActions/JSActionEntity"; | ||
import { Flex } from "@appsmith/ads"; | ||
import type { EntityItem } from "ee/entities/IDE/constants"; | ||
import { JSEntityItem } from "pages/Editor/IDE/EditorPane/JS/EntityItem/JSEntityItem"; | ||
|
||
export interface JSListItemProps { | ||
item: EntityItem; | ||
isActive: boolean; | ||
parentEntityId: string; | ||
} | ||
|
||
export const JSListItem = (props: JSListItemProps) => { | ||
const { isActive, item, parentEntityId } = props; | ||
|
||
return ( | ||
<Flex data-testid="t--ide-list-item" flexDirection={"column"}> | ||
<ExplorerJSCollectionEntity | ||
baseCollectionId={item.key} | ||
isActive={isActive} | ||
key={item.key} | ||
parentEntityId={parentEntityId} | ||
searchKeyword={""} | ||
step={1} | ||
/> | ||
</Flex> | ||
); | ||
export const JSEntity = (props: { item: EntityItem }) => { | ||
return <JSEntityItem {...props} />; | ||
}; |
27 changes: 27 additions & 0 deletions
27
app/client/src/ce/pages/Editor/IDE/EditorPane/JS/old/ListItem.tsx
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,27 @@ | ||
import React from "react"; | ||
import ExplorerJSCollectionEntity from "pages/Editor/Explorer/JSActions/JSActionEntity"; | ||
import { Flex } from "@appsmith/ads"; | ||
import type { EntityItem } from "ee/entities/IDE/constants"; | ||
|
||
export interface JSListItemProps { | ||
item: EntityItem; | ||
isActive: boolean; | ||
parentEntityId: string; | ||
} | ||
|
||
export const JSListItem = (props: JSListItemProps) => { | ||
const { isActive, item, parentEntityId } = props; | ||
|
||
return ( | ||
<Flex data-testid="t--ide-list-item" flexDirection={"column"}> | ||
<ExplorerJSCollectionEntity | ||
baseCollectionId={item.key} | ||
isActive={isActive} | ||
key={item.key} | ||
parentEntityId={parentEntityId} | ||
searchKeyword={""} | ||
step={1} | ||
/> | ||
</Flex> | ||
); | ||
}; |
20 changes: 20 additions & 0 deletions
20
app/client/src/ce/pages/Editor/IDE/EditorPane/JS/utils/getJSContextMenuByIdeType.tsx
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,20 @@ | ||
import React from "react"; | ||
import { IDE_TYPE, type IDEType } from "ee/entities/IDE/constants"; | ||
import EntityContextMenu from "pages/Editor/IDE/EditorPane/components/EntityContextMenu"; | ||
import { AppJSContextMenuItems } from "pages/Editor/IDE/EditorPane/JS/EntityItem/AppJSContextMenuItems"; | ||
import type { JSCollection } from "entities/JSCollection"; | ||
|
||
export const getJSContextMenuByIdeType = ( | ||
ideType: IDEType, | ||
jsAction: JSCollection, | ||
) => { | ||
switch (ideType) { | ||
case IDE_TYPE.App: { | ||
return ( | ||
<EntityContextMenu> | ||
<AppJSContextMenuItems jsAction={jsAction} /> | ||
</EntityContextMenu> | ||
); | ||
} | ||
} | ||
}; |
24 changes: 3 additions & 21 deletions
24
app/client/src/ce/pages/Editor/IDE/EditorPane/Query/ListItem.tsx
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 |
---|---|---|
@@ -1,25 +1,7 @@ | ||
import React from "react"; | ||
import ExplorerActionEntity from "pages/Editor/Explorer/Actions/ActionEntity"; | ||
import { QueryEntityItem } from "pages/Editor/IDE/EditorPane/Query/EntityItem/QueryEntityItem"; | ||
import type { EntityItem } from "ee/entities/IDE/constants"; | ||
|
||
export interface QueryListItemProps { | ||
item: EntityItem; | ||
isActive: boolean; | ||
parentEntityId: string; | ||
} | ||
|
||
export const QueryListItem = (props: QueryListItemProps) => { | ||
const { isActive, item, parentEntityId } = props; | ||
|
||
return ( | ||
<ExplorerActionEntity | ||
baseId={item.key} | ||
isActive={isActive} | ||
key={item.key} | ||
parentEntityId={parentEntityId} | ||
searchKeyword={""} | ||
step={1} | ||
type={item.type} | ||
/> | ||
); | ||
export const ActionEntityItem = (props: { item: EntityItem }) => { | ||
return <QueryEntityItem {...props} />; | ||
}; |
25 changes: 25 additions & 0 deletions
25
app/client/src/ce/pages/Editor/IDE/EditorPane/Query/old/ListItem.tsx
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,25 @@ | ||
import React from "react"; | ||
import ExplorerActionEntity from "pages/Editor/Explorer/Actions/ActionEntity"; | ||
import type { EntityItem } from "ee/entities/IDE/constants"; | ||
|
||
export interface QueryListItemProps { | ||
item: EntityItem; | ||
isActive: boolean; | ||
parentEntityId: string; | ||
} | ||
|
||
export const QueryListItem = (props: QueryListItemProps) => { | ||
const { isActive, item, parentEntityId } = props; | ||
|
||
return ( | ||
<ExplorerActionEntity | ||
baseId={item.key} | ||
isActive={isActive} | ||
key={item.key} | ||
parentEntityId={parentEntityId} | ||
searchKeyword={""} | ||
step={1} | ||
type={item.type} | ||
/> | ||
); | ||
}; |
20 changes: 20 additions & 0 deletions
20
app/client/src/ce/pages/Editor/IDE/EditorPane/Query/utils/getQueryContextMenuByIdeType.tsx
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,20 @@ | ||
import React from "react"; | ||
import { IDE_TYPE, type IDEType } from "ee/entities/IDE/constants"; | ||
import type { Action } from "entities/Action"; | ||
import { AppQueryContextMenuItems } from "pages/Editor/IDE/EditorPane/Query/EntityItem/AppQueryContextMenuItems"; | ||
import EntityContextMenu from "pages/Editor/IDE/EditorPane/components/EntityContextMenu"; | ||
|
||
export const getQueryContextMenuByIdeType = ( | ||
ideType: IDEType, | ||
action: Action, | ||
) => { | ||
switch (ideType) { | ||
case IDE_TYPE.App: { | ||
return ( | ||
<EntityContextMenu> | ||
<AppQueryContextMenuItems action={action} /> | ||
</EntityContextMenu> | ||
); | ||
} | ||
} | ||
}; |
1 change: 1 addition & 0 deletions
1
app/client/src/ee/pages/Editor/IDE/EditorPane/JS/old/ListItem.tsx
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 @@ | ||
export * from "ce/pages/Editor/IDE/EditorPane/JS/old/ListItem"; |
1 change: 1 addition & 0 deletions
1
app/client/src/ee/pages/Editor/IDE/EditorPane/JS/utils/getJSContextMenuByIdeType.tsx
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 @@ | ||
export * from "ce/pages/Editor/IDE/EditorPane/JS/utils/getJSContextMenuByIdeType"; |
1 change: 1 addition & 0 deletions
1
app/client/src/ee/pages/Editor/IDE/EditorPane/Query/old/ListItem.tsx
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 @@ | ||
export * from "ce/pages/Editor/IDE/EditorPane/Query/old/ListItem"; |
1 change: 1 addition & 0 deletions
1
app/client/src/ee/pages/Editor/IDE/EditorPane/Query/utils/getQueryContextMenuByIdeType.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from "ce/pages/Editor/IDE/EditorPane/Query/utils/getQueryContextMenuByIdeType"; |
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.