You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by ep...@apache.org on 2023/01/11 21:26:05 UTC
[airflow] 24/27: Fix UI caret direction (#28624)
This is an automated email from the ASF dual-hosted git repository.
ephraimanierobi pushed a commit to branch v2-5-test
in repository https://gitbox.apache.org/repos/asf/airflow.git
commit 9a30100c63afd5f89a419b5510af88780d015259
Author: Victor Chiapaikeo <vc...@gmail.com>
AuthorDate: Mon Jan 2 16:01:28 2023 -0500
Fix UI caret direction (#28624)
* Fix UI caret direction
* Rename ids and fix tests
(cherry picked from commit 0ab881a4ab78ca7d30712c893a6f01b83eb60e9e)
---
airflow/www/static/css/flash.css | 8 ++++----
airflow/www/static/js/dag/grid/TaskName.test.tsx | 2 +-
airflow/www/static/js/dag/grid/TaskName.tsx | 2 +-
airflow/www/static/js/dag/grid/index.test.tsx | 14 +++++++-------
4 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/airflow/www/static/css/flash.css b/airflow/www/static/css/flash.css
index c121bc0e62..272d46c79f 100644
--- a/airflow/www/static/css/flash.css
+++ b/airflow/www/static/css/flash.css
@@ -20,7 +20,7 @@
.panel-heading #alerts-accordion-toggle::after {
/* symbol for "opening" panels */
font-family: FontAwesome;/* stylelint-disable-line font-family-no-missing-generic-family-keyword */
- content: "\f078";
+ content: "\f077";
float: right;
color: grey;
}
@@ -28,7 +28,7 @@
.panel-heading #alerts-accordion-toggle.collapsed::after {
/* symbol for "closing" panels */
font-family: FontAwesome;/* stylelint-disable-line font-family-no-missing-generic-family-keyword */
- content: "\f054";
+ content: "\f078";
float: right;
color: grey;
}
@@ -53,7 +53,7 @@
.dag-import-error::after {
/* symbol for "opening" panels */
font-family: FontAwesome;/* stylelint-disable-line font-family-no-missing-generic-family-keyword */
- content: "\f054";
+ content: "\f078";
float: right;
color: #e43921;
position: absolute;
@@ -63,5 +63,5 @@
.dag-import-error.expanded-error::after {
/* symbol for "closing" panels */
- content: "\f078";
+ content: "\f077";
}
diff --git a/airflow/www/static/js/dag/grid/TaskName.test.tsx b/airflow/www/static/js/dag/grid/TaskName.test.tsx
index b5e869add5..d2d8f4a775 100644
--- a/airflow/www/static/js/dag/grid/TaskName.test.tsx
+++ b/airflow/www/static/js/dag/grid/TaskName.test.tsx
@@ -43,6 +43,6 @@ describe('Test TaskName', () => {
const { getByText, getByTestId } = render(<TaskName level={0} label="test" isGroup onToggle={() => {}} />, { wrapper: ChakraWrapper });
expect(getByText('test')).toBeDefined();
- expect(getByTestId('closed-group')).toBeDefined();
+ expect(getByTestId('open-group')).toBeDefined();
});
});
diff --git a/airflow/www/static/js/dag/grid/TaskName.tsx b/airflow/www/static/js/dag/grid/TaskName.tsx
index d7c074bfa1..ae0c0acb6a 100644
--- a/airflow/www/static/js/dag/grid/TaskName.tsx
+++ b/airflow/www/static/js/dag/grid/TaskName.tsx
@@ -57,7 +57,7 @@ const TaskName = ({
)}
</Text>
{isGroup && (
- isOpen ? <FiChevronDown data-testid="open-group" /> : <FiChevronUp data-testid="closed-group" />
+ isOpen ? <FiChevronUp data-testid="close-group" /> : <FiChevronDown data-testid="open-group" />
)}
</Flex>
);
diff --git a/airflow/www/static/js/dag/grid/index.test.tsx b/airflow/www/static/js/dag/grid/index.test.tsx
index 3e6f4536bb..4475a75a34 100644
--- a/airflow/www/static/js/dag/grid/index.test.tsx
+++ b/airflow/www/static/js/dag/grid/index.test.tsx
@@ -144,7 +144,7 @@ describe('Test ToggleGroups', () => {
expect(getAllByTestId('task-instance')).toHaveLength(1);
expect(groupName).toBeInTheDocument();
- expect(getByTestId('closed-group')).toBeInTheDocument();
+ expect(getByTestId('open-group')).toBeInTheDocument();
});
test('Buttons are disabled if all groups are expanded or collapsed', () => {
@@ -179,21 +179,21 @@ describe('Test ToggleGroups', () => {
expect(queryAllByTestId('task-instance')).toHaveLength(3);
expect(groupName).toBeInTheDocument();
- expect(queryAllByTestId('open-group')).toHaveLength(2);
- expect(queryAllByTestId('closed-group')).toHaveLength(0);
+ expect(queryAllByTestId('close-group')).toHaveLength(2);
+ expect(queryAllByTestId('open-group')).toHaveLength(0);
fireEvent.click(collapseButton);
await waitFor(() => expect(queryAllByTestId('task-instance')).toHaveLength(1));
- expect(queryAllByTestId('open-group')).toHaveLength(0);
+ expect(queryAllByTestId('close-group')).toHaveLength(0);
// Since the groups are nested, only the parent row is rendered
- expect(queryAllByTestId('closed-group')).toHaveLength(1);
+ expect(queryAllByTestId('open-group')).toHaveLength(1);
fireEvent.click(expandButton);
await waitFor(() => expect(queryAllByTestId('task-instance')).toHaveLength(3));
- expect(queryAllByTestId('open-group')).toHaveLength(2);
- expect(queryAllByTestId('closed-group')).toHaveLength(0);
+ expect(queryAllByTestId('close-group')).toHaveLength(2);
+ expect(queryAllByTestId('open-group')).toHaveLength(0);
});
test('Hovered effect on task state', async () => {