From 7e23d8f7fbd645f5a9ce08aac6204763a84af839 Mon Sep 17 00:00:00 2001 From: "Ricardo M." Date: Mon, 25 Nov 2024 11:24:24 +0100 Subject: [PATCH] feat(FlowsList): Toggle all flows visibility Currently, there's no meechanism to toggle all flows visibility. This commit enables that functionality by adding a top `Eye` icon to show or hide all flows. fix: https://github.com/KaotoIO/kaoto/issues/1655 --- .../components/InlineEdit/InlineEdit.test.tsx | 14 +++ .../src/components/InlineEdit/InlineEdit.tsx | 5 + .../Visualization/Canvas/Canvas.test.tsx | 18 +-- .../Canvas/Form/CanvasForm.test.tsx | 16 ++- .../ContextToolbar/Flows/FlowsList.scss | 17 ++- .../ContextToolbar/Flows/FlowsList.test.tsx | 104 +++++++++++++++++- .../ContextToolbar/Flows/FlowsList.tsx | 41 ++++++- .../ContextToolbar/Flows/FlowsMenu.scss | 19 ++-- .../ContextToolbar/Flows/FlowsMenu.test.tsx | 10 +- .../ContextToolbar/Flows/FlowsMenu.tsx | 32 +++--- .../src/providers/visible-flows.provider.tsx | 9 +- .../ui/src/stubs/TestProvidersWrapper.tsx | 7 +- 12 files changed, 224 insertions(+), 68 deletions(-) diff --git a/packages/ui/src/components/InlineEdit/InlineEdit.test.tsx b/packages/ui/src/components/InlineEdit/InlineEdit.test.tsx index 4af7e5858..e17b3c147 100644 --- a/packages/ui/src/components/InlineEdit/InlineEdit.test.tsx +++ b/packages/ui/src/components/InlineEdit/InlineEdit.test.tsx @@ -270,5 +270,19 @@ describe('InlineEdit', () => { expect(preventDefaultSpy).toHaveBeenCalled(); }); + + it('should set the edit icon title', () => { + const wrapper = render(); + + const editButton = wrapper.getByTestId('inline--edit'); + expect(editButton).toHaveAttribute('title', 'Edit'); + }); + + it('should set the text title', () => { + const wrapper = render(); + + const textSpan = wrapper.getByTestId(DATA_TESTID); + expect(textSpan).toHaveAttribute('title', 'Edit'); + }); }); }); diff --git a/packages/ui/src/components/InlineEdit/InlineEdit.tsx b/packages/ui/src/components/InlineEdit/InlineEdit.tsx index ac82ce0e7..33c32cd79 100644 --- a/packages/ui/src/components/InlineEdit/InlineEdit.tsx +++ b/packages/ui/src/components/InlineEdit/InlineEdit.tsx @@ -22,6 +22,8 @@ import { IDataTestID, ValidationResult, ValidationStatus } from '../../models'; import './InlineEdit.scss'; interface IInlineEdit extends IDataTestID { + editTitle?: string; + textTitle?: string; value?: string; validator?: (value: string) => ValidationResult; onChange?: (value: string) => void; @@ -116,6 +118,8 @@ export const InlineEdit: FunctionComponent = (props) => { {isReadOnly ? ( <> = (props) => {