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

chore: Remove TimeTable.less #19463

Merged
merged 3 commits into from
Apr 6, 2022
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
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ describe('Visualization > Time TableViz', () => {
waitAlias: '@getJson',
querySubstring: NUM_METRIC.label,
});
cy.get('.time-table').within(() => {
cy.get('[data-test="time-table"]').within(() => {
cy.get('span').contains('Sum(num)');
cy.get('span').contains('COUNT(*)');
});
Expand Down Expand Up @@ -75,7 +75,7 @@ describe('Visualization > Time TableViz', () => {
waitAlias: '@getJson',
querySubstring: NUM_METRIC.label,
});
cy.get('.time-table').within(() => {
cy.get('[data-test="time-table"]').within(() => {
cy.get('td').contains('boy');
cy.get('td').contains('girl');
});
Expand Down Expand Up @@ -112,7 +112,7 @@ describe('Visualization > Time TableViz', () => {
waitAlias: '@getJson',
querySubstring: NUM_METRIC.label,
});
cy.get('.time-table').within(() => {
cy.get('[data-test="time-table"]').within(() => {
cy.get('th').contains('Current');
cy.get('th').contains('Last Year');
cy.get('th').contains('YoY');
Expand Down
8 changes: 6 additions & 2 deletions superset-frontend/src/visualizations/TimeTable/TimeTable.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ import sortNumericValues from 'src/utils/sortNumericValues';

import FormattedNumber from './FormattedNumber';
import SparklineCell from './SparklineCell';
import './TimeTable.less';

const ACCESSIBLE_COLOR_BOUNDS = ['#ca0020', '#0571b0'];

Expand Down Expand Up @@ -101,6 +100,7 @@ const defaultProps = {

const TimeTableStyles = styled.div`
height: ${props => props.height}px;
overflow: auto;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You also need to remove the time-table class in line 328:

<TimeTableStyles className={`time-table ${className}`} height={height}>

<TimeTableStyles className={className} height={height}>

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@michael-s-molina this one as well is used by some Cypress tests

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we change the Cypress tests to query by role or an id? Leaving the class name misleads the developers when maintaining the style because they need to look for the class definition to avoid conflicts.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @michael-s-molina updated


th {
z-index: 1; // to cover sparkline
Expand Down Expand Up @@ -325,7 +325,11 @@ const TimeTable = ({
: [];

return (
<TimeTableStyles className={`time-table ${className}`} height={height}>
<TimeTableStyles
data-test="time-table"
className={className}
height={height}
>
<TableView
className="table-no-hover"
columns={memoizedColumns}
Expand Down
21 changes: 0 additions & 21 deletions superset-frontend/src/visualizations/TimeTable/TimeTable.less

This file was deleted.