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 UI caret direction #28624

Merged
merged 2 commits into from
Jan 2, 2023
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
8 changes: 4 additions & 4 deletions airflow/www/static/css/flash.css
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@
.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;
}

.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;
}
Expand All @@ -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;
Expand All @@ -63,5 +63,5 @@

.dag-import-error.expanded-error::after {
/* symbol for "closing" panels */
content: "\f078";
content: "\f077";
}
2 changes: 1 addition & 1 deletion airflow/www/static/js/dag/grid/TaskName.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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();
});
});
2 changes: 1 addition & 1 deletion airflow/www/static/js/dag/grid/TaskName.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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>
);
Expand Down
14 changes: 7 additions & 7 deletions airflow/www/static/js/dag/grid/index.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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', () => {
Expand Down Expand Up @@ -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 () => {
Expand Down