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

Show facets even when dataset has no fields. #2214

Merged
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
Show facets even when dataset has no fields.
Signed-off-by: Jakub Dardzinski <kuba0221@gmail.com>

Use ternary logic.

Signed-off-by: Jakub Dardzinski <kuba0221@gmail.com>
  • Loading branch information
JDarDagran committed Oct 26, 2022
commit 9e7bc52f2a5f4f15ac2a20b94eb8d312838236b8
7 changes: 3 additions & 4 deletions web/src/components/datasets/DatasetInfo.tsx
Original file line number Diff line number Diff line change
@@ -21,12 +21,10 @@ interface DatasetInfoProps {
const DatasetInfo: FunctionComponent<DatasetInfoProps> = props => {
const { datasetFields, facets, run } = props

if (datasetFields.length === 0) {
return <MqEmpty title={'No Fields'} body={'Try adding dataset fields.'} />
}

return (
<Box>
{datasetFields.length === 0 && <MqEmpty title={'No Fields'} body={'Try adding dataset fields.'} />}
{datasetFields.length > 0 && (
<Table size='small'>
<TableHead>
<TableRow>
@@ -53,6 +51,7 @@ const DatasetInfo: FunctionComponent<DatasetInfoProps> = props => {
})}
</TableBody>
</Table>
)}
{facets && (
<Box mt={2}>
<Box mb={1}>