Table: Fixes not data warning style (#33603)

* Table: Fixes not data warning style

* Update Table.test.tsx
This commit is contained in:
Torkel Ödegaard 2021-05-03 09:43:42 +02:00 committed by GitHub
parent f2e4f41f69
commit b165bfabc1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 3 deletions

View File

@ -104,7 +104,7 @@ describe('Table', () => {
getTestContext({ data: toDataFrame([]) });
expect(getTable()).toBeInTheDocument();
expect(screen.queryByRole('row')).not.toBeInTheDocument();
expect(screen.getByText(/no data to show/i)).toBeInTheDocument();
expect(screen.getByText(/No data/i)).toBeInTheDocument();
});
});

View File

@ -223,7 +223,7 @@ export const Table: FC<Props> = memo((props: Props) => {
</FixedSizeList>
) : (
<div style={{ height: height - headerHeight }} className={tableStyles.noData}>
No data to show
No data
</div>
)}
</div>

View File

@ -108,7 +108,7 @@ export class TablePanel extends Component<Props> {
const hasFields = data.series[0]?.fields.length;
if (!count || !hasFields) {
return <div>No data</div>;
return <div className={tableStyles.noData}>No data</div>;
}
if (count > 1) {
@ -143,6 +143,13 @@ const tableStyles = {
justify-content: space-between;
height: 100%;
`,
noData: css`
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
height: 100%;
`,
selectWrapper: css`
padding: 8px;
`,