Skip to content

Commit 48780c4

Browse files
authored
Separate out data flow lineage for each node from the dimensions graph (#1865)
* Separate out data flow lineage for each node from the dimensions graph * Add tests * Fix
1 parent dc08816 commit 48780c4

File tree

11 files changed

+1555
-29
lines changed

11 files changed

+1555
-29
lines changed

datajunction-ui/src/app/components/Tab.jsx

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,18 @@ import { Component } from 'react';
33
export default class Tab extends Component {
44
render() {
55
const { id, onClick, selectedTab } = this.props;
6+
const isActive = selectedTab === id;
67
return (
7-
<div className={selectedTab === id ? 'col active' : 'col'}>
8-
<div className="header-tabs nav-overflow nav nav-tabs">
9-
<div className="nav-item">
10-
<button
11-
id={id}
12-
className="nav-link"
13-
tabIndex="0"
14-
onClick={onClick}
15-
aria-label={this.props.name}
16-
aria-hidden="false"
17-
>
18-
{this.props.name}
19-
</button>
20-
</div>
21-
</div>
22-
</div>
8+
<button
9+
id={id}
10+
className={isActive ? 'dj-tab dj-tab--active' : 'dj-tab'}
11+
tabIndex="0"
12+
onClick={onClick}
13+
aria-label={this.props.name}
14+
aria-hidden="false"
15+
>
16+
{this.props.name}
17+
</button>
2318
);
2419
}
2520
}

datajunction-ui/src/app/components/__tests__/Tab.test.jsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,14 @@ describe('<Tab />', () => {
1010

1111
it('has the active class when selectedTab matches id', () => {
1212
const { container } = render(<Tab id="1" selectedTab="1" />);
13-
expect(container.querySelector('.col')).toHaveClass('active');
13+
expect(container.querySelector('.dj-tab')).toHaveClass('dj-tab--active');
1414
});
1515

1616
it('does not have the active class when selectedTab does not match id', () => {
1717
const { container } = render(<Tab id="1" selectedTab="2" />);
18-
expect(container.querySelector('.col')).not.toHaveClass('active');
18+
expect(container.querySelector('.dj-tab')).not.toHaveClass(
19+
'dj-tab--active',
20+
);
1921
});
2022

2123
it('calls onClick when the button is clicked', () => {

0 commit comments

Comments
 (0)