Skip to content
Open
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
14 changes: 3 additions & 11 deletions src/components/ExplorerResults.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import {useSelector} from "react-redux";
import {useSettings} from "../hooks/settings";
import {useTranslation} from "../hooks/translation";
import {selectCurrentQueryItem, selectIsPreviewMode} from "../state/queries";
import type {QueryResult} from "../utils/structs";
import type {PanelDescriptor, ViewProps} from "../utils/types";
import AddColumnsDrawer from "./DrawerMenu";
import {ExplorerTabs} from "./ExplorerTabs";
Expand Down Expand Up @@ -221,16 +222,7 @@ function SuccessResult(
cube
});

if (data?.length === 0 && !isLoading && !isError) {
return (
<FailureResult
className={cx(classes.container, props.className)}
icon={<IconBox color="orange" size="5rem" />}
title={t("results.error_emptyresult_title")}
description={t("results.error_emptyresult_detail")}
/>
);
}


return (
<Flex
Expand Down Expand Up @@ -312,7 +304,7 @@ function SuccessResult(
cube={cube}
params={params}
data={data as TData[]}
result={result}
result={result as QueryResult<TData> | undefined}
table={table}
isError={isError}
isLoading={isLoading}
Expand Down
7 changes: 4 additions & 3 deletions src/components/TableView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1073,10 +1073,11 @@ const MultiFilter = ({header}: {header: MRT_Header<TData>}) => {
};

const NoRecords = React.memo(() => {
const {translate: t} = useTranslation();
return (
<Center style={{height: "calc(100% - 210px)"}}>
<Text size="xl" color="gray" italic>
No records to display.
<Center style={{height: "calc(100% - 210px)"}} my="xl">
<Text size="md" color="gray" italic>
{t("results.error_emptyresult_detail")}
</Text>
</Center>
);
Expand Down
1 change: 1 addition & 0 deletions src/utils/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ export interface ViewProps<TData extends Record<string, any> = Record<string, st
table?: MRT_TableInstance<TData & Record<string, any>>;
isError?: boolean;
isLoading?: boolean;
isFetching?: boolean;
data?: Record<string, string | number>[];
columns?: MRT_ColumnDef<TData>[];
pagination?: MRT_PaginationState;
Expand Down