Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: replaced all edit name with Rename #34570

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ describe(
PageLeftPane.switchSegment(PagePaneSegment.Queries);
ee.ActionContextMenuByEntityName({
entityNameinLeftSidebar: "FirstAPI",
action: "Edit name",
action: "Rename",
});
cy.EditApiNameFromExplorer("SecondAPI");
cy.xpath(apiwidget.popover)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ describe(
cy.get(".t--entity-property-close").click(); //closing Bindings overlay
entityExplorer.ActionContextMenuByEntityName({
entityNameinLeftSidebar: "Query1",
action: "Edit name",
action: "Rename",
});
cy.EditApiNameFromExplorer("MyQuery");
entityExplorer.ActionContextMenuByEntityName({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ describe(
cy.get(`.t--entity-item:contains(${secondApiName})`).within(() => {
cy.get(".t--context-menu").click({ force: true });
});
cy.selectAction("Edit name");
cy.selectAction("Rename");
cy.get(explorer.editEntity).last().type(firstApiName, { force: true });
cy.validateMessage(firstApiName);
agHelper.PressEnter();
Expand Down Expand Up @@ -96,7 +96,7 @@ describe("Entity Naming conflict test", { tags: ["@tag.IDE"] }, function () {
cy.get(`.t--entity-item:contains(${secondApiName})`).within(() => {
cy.get(".t--context-menu").click({ force: true });
});
cy.selectAction("Edit name");
cy.selectAction("Rename");

cy.get(explorer.editEntity).last().type(firstApiName, { force: true });
entityExplorer.ValidateDuplicateMessageToolTip(firstApiName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ describe("Tab widget test", { tags: ["@tag.IDE"] }, function () {
PageLeftPane.expandCollapseItem("Tabs1");
entityExplorer.ActionContextMenuByEntityName({
entityNameinLeftSidebar: "Tab2",
action: "Edit name",
action: "Rename",
});
agHelper.TypeText(locators._entityNameEditing("Tab2"), tabname);
agHelper.Sleep(2000);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ describe(
});
_.entityExplorer.ActionContextMenuByEntityName({
entityNameinLeftSidebar: "Text1",
action: "Edit name",
action: "Rename",
});
cy.EditApiNameFromExplorer("TextUpdated");
_.entityExplorer.ActionContextMenuByEntityName({
Expand Down
2 changes: 1 addition & 1 deletion app/client/cypress/locators/Pages.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"apiEditorIcon": ".t--nav-link-api-editor",
"integrationActiveTab": "button[id$='ACTIVE']",
"popover": "//div[contains(@class,'t--entity page')]//*[last()]//*[local-name()='g' and @id='Icon/Outline/more-vertical']",
"editName": "span:contains('Edit name')",
"editName": "span:contains('Rename')",
"clonePage": "span:contains('Clone')",
"deletePage": "span:contains('Delete')",
"deletePageConfirm": "span:contains('Are you sure?')",
Expand Down
4 changes: 2 additions & 2 deletions app/client/cypress/locators/apiWidgetslocator.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,14 @@
"showrequest": "span:contains('Show Request')",
"Responsetab": "//li//span[text()='Response Body']",
"deleteAPI": ".t--apiFormDeleteBtn",
"editName": ".single-select >div:contains('Edit name')",
"editName": ".single-select >div:contains('Rename')",
"page": ".single-select >div",
"propertyList": ".binding",
"actionlist": ".action div div",
"settings": "span:contains('Settings')",
"headers": "span:contains('Headers')",
"onPageLoad": "[name=executeOnLoad]",
"renameEntity": "div[role='menuitem']:contains('Edit name')",
"renameEntity": "div[role='menuitem']:contains('Rename')",
"paramsTab": "//span[text()='Params']",
"paramKey": ".t--actionConfiguration\\.queryParameters\\[0\\]\\.key\\.0",
"paramValue": ".t--actionConfiguration\\.queryParameters\\[0\\]\\.value\\.0",
Expand Down
2 changes: 1 addition & 1 deletion app/client/cypress/locators/explorerlocators.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"entityExplorer": ".t--entity-explorer",
"popover": "//div[contains(@class,'t--entity page')]//*[local-name()='g' and @id='Icon/Outline/more-vertical']",
"datsourceEntityPopover": "//div[contains(@class,'t--entity datasource')]//*[local-name()='g' and @id='Icon/Outline/more-vertical']",
"editName": ".single-select >div:contains('Edit name')",
"editName": ".single-select >div:contains('Rename')",
"deletePage": ".single-select >div:contains('Delete')",
"refreshStructure": ".single-select >div:contains('Refresh')",
"datasourceStructure": ".t--entity.datasourceStructure",
Expand Down
4 changes: 2 additions & 2 deletions app/client/cypress/support/Pages/EntityExplorer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ interface EntityActionParams {
entityNameinLeftSidebar: string;
action?:
| "Show bindings"
| "Edit name"
| "Rename"
| "Delete"
| "Clone"
| "Settings"
Expand Down Expand Up @@ -271,7 +271,7 @@ export class EntityExplorer {
if (viaMenu)
this.ActionContextMenuByEntityName({
entityNameinLeftSidebar: entityName,
action: "Edit name",
action: "Rename",
entityType,
});
else cy.xpath(PageLeftPane.listItemSelector(entityName)).dblclick();
Expand Down
2 changes: 1 addition & 1 deletion app/client/cypress/support/Pages/JSEditor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ export class JSEditor {
public RenameJSObjFromExplorer(entityName: string, renameVal: string) {
this.ee.ActionContextMenuByEntityName({
entityNameinLeftSidebar: entityName,
action: "Edit name",
action: "Rename",
});
cy.xpath(this.locator._entityNameEditing(entityName)).type(
renameVal + "{enter}",
Expand Down
2 changes: 1 addition & 1 deletion app/client/src/ce/constants/messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1724,7 +1724,7 @@ export const END_DESCRIPTION = () =>
"Inspect properties of queries, components, etc.";
export const END_BUTTON_TEXT = () => "Start building an app";

export const CONTEXT_EDIT_NAME = () => "Edit name";
export const CONTEXT_RENAME = () => "Rename";
export const CONTEXT_SHOW_BINDING = () => "Show bindings";
export const CONTEXT_MOVE = () => "Move to page";
export const CONTEXT_COPY = () => "Copy to page";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {
CONTEXT_COPY,
CONTEXT_DELETE,
CONFIRM_CONTEXT_DELETE,
CONTEXT_EDIT_NAME,
CONTEXT_RENAME,
CONTEXT_MOVE,
CONTEXT_NO_PAGE,
CONTEXT_SHOW_BINDING,
Expand Down Expand Up @@ -106,11 +106,11 @@ export function ActionEntityContextMenu(props: EntityContextMenuProps) {
);

const optionsTree = [
menuItems.includes(ActionEntityContextMenuItemsEnum.EDIT_NAME) &&
menuItems.includes(ActionEntityContextMenuItemsEnum.RENAME) &&
canManageAction && {
value: "rename",
onSelect: editActionName,
label: createMessage(CONTEXT_EDIT_NAME),
label: createMessage(CONTEXT_RENAME),
},
menuItems.includes(ActionEntityContextMenuItemsEnum.SHOW_BINDING) && {
value: "showBinding",
Expand Down
4 changes: 2 additions & 2 deletions app/client/src/pages/Editor/Explorer/ContextMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,11 @@ export default function TreeDropdown(props: TreeDropdownProps) {
const handleSelect = (option: TreeDropdownOption) => {
if (option.onSelect) {
// MenuTrigger takes focus after the Menu closes. For an input to be focused for e.g
// edit name we have to take focus back from it.
// Rename we have to take focus back from it.
// Without this the input takes focus first post which the Menu closes post which MenuTrigger
// takes back focus.
setTimeout(() => {
option.onSelect && option.onSelect(option);
option.onSelect?.(option);
}, 0);
if (option.value === "delete" && !option.confirmDelete) {
handleOpenChange(true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { useDispatch, useSelector } from "react-redux";
import { deleteDatasource } from "actions/datasourceActions";
import { initExplorerEntityNameEdit } from "actions/explorerActions";
import {
CONTEXT_EDIT_NAME,
CONTEXT_RENAME,
CONTEXT_DELETE,
CONFIRM_CONTEXT_DELETE,
createMessage,
Expand Down Expand Up @@ -59,7 +59,7 @@ export function DataSourceContextMenu(props: {
value: "rename",
className: "single-select t--datasource-rename",
onSelect: editDatasourceName,
label: createMessage(CONTEXT_EDIT_NAME),
label: createMessage(CONTEXT_RENAME),
},
canDeleteDatasource && {
confirmDelete: confirmDelete,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, { createContext, useMemo } from "react";
import type { ActionParentEntityTypeInterface } from "@appsmith/entities/Engine/actionHelpers";

export enum ActionEntityContextMenuItemsEnum {
EDIT_NAME = "Edit Name",
RENAME = "Rename",
SHOW_BINDING = "Show Bindings",
CONVERT_QUERY_MODULE_INSTANCE = "Create Module",
COPY = "Copy",
Expand All @@ -11,7 +11,7 @@ export enum ActionEntityContextMenuItemsEnum {
}

export const defaultMenuItems = [
ActionEntityContextMenuItemsEnum.EDIT_NAME,
ActionEntityContextMenuItemsEnum.RENAME,
ActionEntityContextMenuItemsEnum.DELETE,
ActionEntityContextMenuItemsEnum.SHOW_BINDING,
ActionEntityContextMenuItemsEnum.COPY,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
CONTEXT_COPY,
CONTEXT_DELETE,
CONFIRM_CONTEXT_DELETE,
CONTEXT_EDIT_NAME,
CONTEXT_RENAME,
CONTEXT_MOVE,
CONTEXT_NO_PAGE,
CONTEXT_SHOW_BINDING,
Expand Down Expand Up @@ -96,11 +96,11 @@ export function JSCollectionEntityContextMenu(props: EntityContextMenuProps) {
);

const optionsTree = [
menuItems.includes(ActionEntityContextMenuItemsEnum.EDIT_NAME) &&
menuItems.includes(ActionEntityContextMenuItemsEnum.RENAME) &&
canManage && {
value: "rename",
onSelect: editJSCollectionName,
label: createMessage(CONTEXT_EDIT_NAME),
label: createMessage(CONTEXT_RENAME),
},
menuItems.includes(ActionEntityContextMenuItemsEnum.SHOW_BINDING) && {
value: "showBinding",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
import styled from "styled-components";
import { Icon } from "design-system";
import {
CONTEXT_EDIT_NAME,
CONTEXT_RENAME,
CONTEXT_CLONE,
CONTEXT_SET_AS_HOME_PAGE,
CONTEXT_DELETE,
Expand Down Expand Up @@ -156,7 +156,7 @@ export function PageContextMenu(props: {
canManagePages && {
value: "rename",
onSelect: editPageName,
label: createMessage(CONTEXT_EDIT_NAME),
label: createMessage(CONTEXT_RENAME),
},
canCreatePages &&
canManagePages && {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export function WidgetContextMenu(props: {
const option: TreeDropdownOption = {
value: "rename",
onSelect: editWidgetName,
label: "Edit name",
label: "Rename",
};
optionTree.push(option);
}
Expand Down
Loading