## Description Replace entities in entity explorer with new ADS templates Fixes [#38286](https://github.com/appsmithorg/appsmith/issues/38286) [#39289](https://github.com/appsmithorg/appsmith/issues/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: bf508e2291441102ab2260f39118e269022650b3 > <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 -->
32 lines
824 B
TypeScript
32 lines
824 B
TypeScript
import React, { useCallback } from "react";
|
|
import { MenuItem } from "@appsmith/ads";
|
|
import { useDispatch } from "react-redux";
|
|
import { setRenameEntity } from "actions/ideActions";
|
|
import { CONTEXT_RENAME, createMessage } from "ee/constants/messages";
|
|
|
|
interface Props {
|
|
disabled?: boolean;
|
|
entityId: string;
|
|
}
|
|
|
|
export const RenameMenuItem = ({ disabled, entityId }: Props) => {
|
|
const dispatch = useDispatch();
|
|
|
|
const setRename = useCallback(() => {
|
|
// We add a delay to avoid having the focus stuck in the menu trigger
|
|
setTimeout(() => {
|
|
dispatch(setRenameEntity(entityId));
|
|
}, 100);
|
|
}, [dispatch, entityId]);
|
|
|
|
return (
|
|
<MenuItem
|
|
disabled={disabled}
|
|
onSelect={setRename}
|
|
startIcon="input-cursor-move"
|
|
>
|
|
{createMessage(CONTEXT_RENAME)}
|
|
</MenuItem>
|
|
);
|
|
};
|