From 90bc061d34929cefbde56164001c51d0bb2012ef Mon Sep 17 00:00:00 2001 From: Lucas Oliveira <62335616+lucaseduoli@users.noreply.github.com> Date: Thu, 5 Dec 2024 18:24:39 -0300 Subject: [PATCH] fix: changed advanced settings to controls (#5069) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Changed Advanced Settings to Controls and implemented DisplayName on shortcuts * fix: validate 'streaming' vertex connections in graph (#5067) * feat: Table Input for tools metadata (tool name and description) in component as tools (#4961) * ✨ (endpoints.py): Add support for tool_mode field in custom component update πŸ”§ (schemas.py): Add tool_mode field to UpdateCustomComponentRequest schema ♻️ (component.py): Refactor run_and_validate_update_outputs method to handle tool_mode field πŸ”§ (index.tsx): Add tool_mode property to NodeInputField component πŸ”§ (index.tsx): Refactor hasToolMode logic to use checkHasToolMode utility function πŸ”§ (mutate-template.ts): Add callback parameter to mutateTemplate function πŸ”§ (use-handle-new-value.tsx): Add tool_mode property to useHandleOnNewValue hook πŸ”§ (popover/index.tsx): Add console.log for placeholder, value, and id πŸ”§ (inputGlobalComponent/index.tsx): Add tool_mode property to InputGlobalComponent πŸ”§ (refreshParameterComponent/index.tsx): Add tool_mode property to RefreshParameterComponent πŸ”§ (use-post-template-value.ts): Add tool_mode parameter to usePostTemplateValue function πŸ”§ (nodeToolbarComponent/index.tsx): Add support for tool_mode functionality in NodeToolbarComponent πŸ”§ (reactflowUtils.ts): Add checkHasToolMode utility function to check for tool_mode field in template * fix: Set default value for tool_mode in UpdateCustomComponentRequest schema * adding table input in tool mode adding table input * Update component.py update real-time refresh * added dynamic tool description input added dynamic tool description input * [autofix.ci] apply automated fixes * Update component.py simplifying the tool mode logic * Update component_tool.py updated logic to be more readable * Update component.py * adding tool table schema as constant --------- Co-authored-by: cristhianzl Co-authored-by: Gabriel Luiz Freitas Almeida Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> * fix: update drag and drop test (#5048) * refactor: Improve wait time for modal in drag and drop test * ✨ (dragAndDrop.spec.ts): update file path to read collection.json from the correct location πŸ› (dragAndDrop.spec.ts): increase timeout for waiting for "uploaded successfully" text to prevent test failures * ✨ (dragAndDrop.spec.ts): Add tests for drag and drop functionality to ensure users can drag and drop collections and flows without crashing the application πŸ“ (simulate-drag-and-drop.ts): Add utility function to simulate drag and drop events in tests for improved test coverage and functionality * add debouncing time on file upload * [autofix.ci] apply automated fixes --------- Co-authored-by: cristhianzl Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> * fix: add hover state on folder button when moving flow to it (#4999) * ✨ (index.tsx): Refactor SideBarFoldersButtonsComponent to improve code readability and maintainability. Add new functionalities such as drag and drop, folder hovering effects, and folder actions like upload, download, add, update, and delete. Update folder state management and handle loading states for various folder operations. * ✨ (add-folder-button.tsx): Add a new component for adding folders to the sidebar ✨ (folder-select-item.tsx): Add a new component for displaying folder select items in the sidebar ✨ (header-buttons.tsx): Add a new component for displaying header buttons in the sidebar ✨ (input-edit-folder-name.tsx): Add a new component for editing folder names in the sidebar ✨ (select-options.tsx): Add a new component for displaying select options in the sidebar ✨ (upload-folder-button.tsx): Add a new component for uploading folders to the sidebar ✨ (handle-select-change.ts): Add a new helper function for handling select changes in the sidebar πŸ”§ (index.tsx): Refactor sidebar folder buttons component to use new components and helpers for better organization and functionality * ✨ (use-on-file-drop.tsx): add support for fetching and using flows specific to the current folder in the file drop functionality πŸ“ (use-get-folder.ts): update the get folder query to set and use flows specific to the current folder πŸ“ (foldersStore.tsx): add state management for storing and setting flows specific to the current folder in the store πŸ“ (index.ts): add FlowType import for flows specific to the current folder in the store types * ✨ (flows.py): Add description field to the returned flow object in read_flows function for better data representation ♻️ (use-on-file-drop.tsx): Refactor code to use new centralized store for flows instead of accessing flowsFromCurrentFolder directly πŸ”§ (use-get-folder.ts): Remove setFlowsFromCurrentFolder function and directly update flows in the store within getFolderFn πŸ”§ (foldersStore.tsx): Remove flowsFromCurrentFolder state and setFlowsFromCurrentFolder function from the store as they are no longer needed * fix: Fix test_get_and_cache_all_types_dict (#5054) * fix: add condition to not block component from building when input is filled by tool mode (#5039) Fixed frontend blocking build when component is disabled because of tool mode * feat: Enhance Observability with ArizePhoenixTracer Integration (#5058) * Added ArizePhoenixTracer * [autofix.ci] apply automated fixes * Fixed Ruff Style Check Errors * add Arize icon * Fixed Mypy Errors * Refactor ArizeIcon component to use arrow function syntax Co-authored-by: Jeff Carpenter Co-authored-by: Ítalo Johnny Co-authored-by: anovazzi1 * refactor: Remove footer from TableModal component (#5036) * Refactor: update curlApiGeneration test (#5046) refactor: Update wait time for modal to appear in curlApiGeneration.spec.ts * Refactor: Remove unnecessary value rendering in EmptyParameterComponent (#4955) * feat: Persist locked state for flows (#4459) * persist locked state for flows * [autofix.ci] apply automated fixes * [autofix.ci] apply automated fixes (attempt 2/3) * πŸ“ (popover.tsx): Remove duplicate declaration of PopoverAnchor in popover.tsx ✨ (lock-flow.spec.ts): Add test for locking and unlocking a flow in the application to ensure proper functionality and saving of the flow. --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: cristhianzl * Refactor actionsMainPage-shard-0.spec.ts (#5043) * refactor: Add missing import and update assertions in actionsMainPage-shard-0.spec.ts * refactor: Adjust chat view layout for responsiveness (#5061) * refactor: Adjust chat view layout for responsiveness The code changes in this commit adjust the layout of the chat view component to improve responsiveness. Specifically, the CSS classes for the chat container and input container have been modified to make them responsive on different screen sizes. This ensures that the chat view is displayed properly on both desktop and mobile devices. Refactoring the layout in this way enhances the user experience by making the chat view more accessible and user-friendly across different devices. * fix: Fix: improve error in InputFileComponent when displaying invalid file types (#5064) * fix: Fix error in InputFileComponent when displaying invalid file types The code changes in this commit fix an issue in the InputFileComponent where an error was not being displayed correctly when the file type was not allowed. The commit adds a fix to properly display the error message with the list of invalid file types. * refactor: Improve wait times and visibility checks in auto-save-off tests (#5044) * refactor: Improve wait times and visibility checks in auto-save-off tests * Refactor: refactor wait times and selectors in filterEdge-shard-1.spec.ts (#5049) * refactor: Update wait times and selectors in filterEdge-shard-1.spec.ts * Refactor: update autoLogin.spec.ts to use waitForSelector (#5045) refactor: Update autoLogin.spec.ts to use waitForSelector instead of waitForTimeout * feat: improve whitespace handling in NodeDescription component (#5096) * πŸ“ (NodeDescription/index.tsx): update CSS classes to improve text formatting and readability in NodeDescription component * ♻️ (NodeDescription/index.tsx): refactor NodeDescription component styles to improve readability and remove redundant classnames * refactor: use Inspector for column checks in locked state migration (#5097) πŸ› (add_persistent_locked_state.py): fix migration script to correctly check for existing 'locked' column before adding or dropping it * fix: changed parameter name of agent component (#4992) * Changed Add tool Current Date to only Current Date * [autofix.ci] apply automated fixes --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> * fix: re-activated playground page and made it full screen (#5066) * Re-activated playground page * Added full-screen to show entire content instead of modal * Added full screen page on new Modal * Made app wrapper page be full width and height * fix: apply variables to fields automatically, remove password truncation from variable fields (#5031) * Change default type to be Credential on Global Variabel Modal * Removed clipping on input password * Updated StrRenderComponent to receive display_name * Updated InputGlobal and StrRender to receive display_name * Update InputGlobalComponent to handle fields already applied * Passed display name from strRender to inputglobal * Update updateGroupRecursion to not need updateGlobalVariables since it's already dealt with by the InputGlobalComponent * fix: clear chat input when sending from play button (#5071) Fix newChatView to clear chat input if the component runs before --------- Co-authored-by: Ítalo Johnny Co-authored-by: Edwin Jose Co-authored-by: cristhianzl Co-authored-by: Gabriel Luiz Freitas Almeida Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: anovazzi1 Co-authored-by: Christophe Bornet Co-authored-by: Ali Saleh Co-authored-by: Jeff Carpenter Co-authored-by: Mike Fortman --- src/frontend/src/constants/constants.ts | 26 +++++++++++++++++++ .../shortcutDisplay/index.tsx | 10 +++---- .../pages/ShortcutsPage/index.tsx | 2 +- src/frontend/src/types/store/index.ts | 7 ++++- .../extended/features/userSettings.spec.ts | 4 +-- 5 files changed, 39 insertions(+), 10 deletions(-) diff --git a/src/frontend/src/constants/constants.ts b/src/frontend/src/constants/constants.ts index 8de6c3eb1..94bc0c0e3 100644 --- a/src/frontend/src/constants/constants.ts +++ b/src/frontend/src/constants/constants.ts @@ -760,106 +760,132 @@ export const IS_MAC = navigator.userAgent.toUpperCase().includes("MAC"); export const defaultShortcuts = [ { + display_name: "Controls", name: "Advanced Settings", shortcut: "mod+shift+a", }, { + display_name: "Minimize", name: "Minimize", shortcut: "mod+.", }, { + display_name: "Code", name: "Code", shortcut: "space", }, { + display_name: "Copy", name: "Copy", shortcut: "mod+c", }, { + display_name: "Duplicate", name: "Duplicate", shortcut: "mod+d", }, { + display_name: "Component Share", name: "Component Share", shortcut: "mod+shift+s", }, { + display_name: "Docs", name: "Docs", shortcut: "mod+shift+d", }, { + display_name: "Changes Save", name: "Changes Save", shortcut: "mod+s", }, { + display_name: "Save Component", name: "Save Component", shortcut: "mod+alt+s", }, { + display_name: "Delete", name: "Delete", shortcut: "backspace", }, { + display_name: "Open playground", name: "Open playground", shortcut: "mod+k", }, { + display_name: "Undo", name: "Undo", shortcut: "mod+z", }, { + display_name: "Redo", name: "Redo", shortcut: "mod+y", }, { + display_name: "Group", name: "Group", shortcut: "mod+g", }, { + display_name: "Cut", name: "Cut", shortcut: "mod+x", }, { + display_name: "Paste", name: "Paste", shortcut: "mod+v", }, { + display_name: "API", name: "API", shortcut: "r", }, { + display_name: "Download", name: "Download", shortcut: "mod+j", }, { + display_name: "Update", name: "Update", shortcut: "mod+u", }, { + display_name: "Freeze", name: "Freeze", shortcut: "mod+f", }, { + display_name: "Freeze Path", name: "Freeze Path", shortcut: "mod+shift+f", }, { + display_name: "Flow Share", name: "Flow Share", shortcut: "mod+shift+b", }, { + display_name: "Play", name: "Play", shortcut: "p", }, { + display_name: "Output Inspection", name: "Output Inspection", shortcut: "o", }, { + display_name: "Tool Mode", name: "Tool Mode", shortcut: "mod+shift+m", }, { + display_name: "Toggle Sidebar", name: "Toggle Sidebar", shortcut: "mod+b", }, diff --git a/src/frontend/src/pages/FlowPage/components/nodeToolbarComponent/shortcutDisplay/index.tsx b/src/frontend/src/pages/FlowPage/components/nodeToolbarComponent/shortcutDisplay/index.tsx index f10b4d283..8badd89f5 100644 --- a/src/frontend/src/pages/FlowPage/components/nodeToolbarComponent/shortcutDisplay/index.tsx +++ b/src/frontend/src/pages/FlowPage/components/nodeToolbarComponent/shortcutDisplay/index.tsx @@ -2,11 +2,11 @@ import RenderIcons from "@/components/common/renderIconComponent"; import { cn } from "@/utils/utils"; export default function ShortcutDisplay({ - name, + display_name, shortcut, sidebar = false, }: { - name?: string; + display_name?: string; shortcut: string; sidebar?: boolean; }): JSX.Element { @@ -15,11 +15,11 @@ export default function ShortcutDisplay({ <> {sidebar ? (
- {name && {name} } + {display_name && {display_name} } @@ -27,7 +27,7 @@ export default function ShortcutDisplay({
) : (
- {name} + {display_name} diff --git a/src/frontend/src/pages/SettingsPage/pages/ShortcutsPage/index.tsx b/src/frontend/src/pages/SettingsPage/pages/ShortcutsPage/index.tsx index 04415db31..263efc51d 100644 --- a/src/frontend/src/pages/SettingsPage/pages/ShortcutsPage/index.tsx +++ b/src/frontend/src/pages/SettingsPage/pages/ShortcutsPage/index.tsx @@ -18,7 +18,7 @@ export default function ShortcutsPage() { const colDefs: ColDef[] = [ { headerName: "Functionality", - field: "name", + field: "display_name", flex: 1, editable: false, resizable: false, diff --git a/src/frontend/src/types/store/index.ts b/src/frontend/src/types/store/index.ts index e26f100c0..8c7370e7e 100644 --- a/src/frontend/src/types/store/index.ts +++ b/src/frontend/src/types/store/index.ts @@ -49,10 +49,15 @@ export type shortcutsStoreType = { toolMode: string; shortcuts: Array<{ name: string; + display_name: string; shortcut: string; }>; setShortcuts: ( - newShortcuts: Array<{ name: string; shortcut: string }>, + newShortcuts: Array<{ + name: string; + display_name: string; + shortcut: string; + }>, ) => void; getShortcutsFromStorage: () => void; }; diff --git a/src/frontend/tests/extended/features/userSettings.spec.ts b/src/frontend/tests/extended/features/userSettings.spec.ts index 3f518d091..dc1925656 100644 --- a/src/frontend/tests/extended/features/userSettings.spec.ts +++ b/src/frontend/tests/extended/features/userSettings.spec.ts @@ -136,9 +136,7 @@ test("should see shortcuts", { tag: ["@release"] }, async ({ page }) => { await page.getByText("General").nth(2).isVisible(); await page.getByText("Shortcuts").nth(0).click(); await page.getByText("Shortcuts", { exact: true }).nth(1).isVisible(); - await page - .getByText("Advanced Settings Component", { exact: true }) - .isVisible(); + await page.getByText("Controls Component", { exact: true }).isVisible(); await page.getByText("Minimize Component", { exact: true }).isVisible(); await page.getByText("Code Component", { exact: true }).isVisible(); await page.getByText("Copy Component", { exact: true }).isVisible();