-
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: Update JS Editor Run designs (#36998)
## Description - Update the icons in ADS - Override the Menu Title text styles ## Automation /ok-to-test tags="@tag.JS" ### 🔍 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/11440728547> > Commit: 1df24c6 > <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=11440728547&attempt=1" target="_blank">Cypress dashboard</a>. > Tags: `@tag.JS` > Spec: > <hr>Mon, 21 Oct 2024 13:43:16 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 a new styled component, `MenuTitle`, for improved dropdown menu item labeling. - Enhanced the `JSFunctionRun` component with a new button icon and improved function selection handling. - **Bug Fixes** - Updated the callback function to ensure it correctly responds to changes in the `onSelect` prop. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
- Loading branch information
Showing
11 changed files
with
99 additions
and
53 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
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
22 changes: 22 additions & 0 deletions
22
app/client/src/pages/Editor/JSEditor/JSEditorToolbar/components/JSFunctionItem.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,22 @@ | ||
import React, { useCallback } from "react"; | ||
import { MenuItem } from "@appsmith/ads"; | ||
import type { JSActionDropdownOption } from "../types"; | ||
import * as Styled from "./styles"; | ||
|
||
export const JSFunctionItem = ({ | ||
onSelect, | ||
option, | ||
}: { | ||
option: JSActionDropdownOption; | ||
onSelect: (option: JSActionDropdownOption) => void; | ||
}) => { | ||
const onFunctionSelect = useCallback(() => { | ||
onSelect(option); | ||
}, [onSelect, option]); | ||
|
||
return ( | ||
<MenuItem onSelect={onFunctionSelect} size="sm"> | ||
<Styled.MenuTitle>{option.label}</Styled.MenuTitle> | ||
</MenuItem> | ||
); | ||
}; |
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
9 changes: 9 additions & 0 deletions
9
app/client/src/pages/Editor/JSEditor/JSEditorToolbar/components/styles.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,9 @@ | ||
import styled from "styled-components"; | ||
import { Text } from "@appsmith/ads"; | ||
|
||
export const MenuTitle = styled(Text)` | ||
--button-font-weight: bold; | ||
overflow: hidden; | ||
text-overflow: ellipsis; | ||
max-width: 30ch; | ||
`; |