mirror of
https://github.com/apache/superset.git
synced 2026-06-02 06:09:21 +00:00
feat(dashboard): show dataset column labels in View as table (#37140)
This commit is contained in:
@@ -55,6 +55,7 @@ export const ResultsPaneOnDashboard = ({
|
||||
isVisible,
|
||||
dataSize = 50,
|
||||
canDownload,
|
||||
columnDisplayNames,
|
||||
}: ResultsPaneProps) => {
|
||||
const resultsPanes = useResultsPane({
|
||||
errorMessage,
|
||||
@@ -66,6 +67,7 @@ export const ResultsPaneOnDashboard = ({
|
||||
dataSize,
|
||||
isVisible,
|
||||
canDownload,
|
||||
columnDisplayNames,
|
||||
});
|
||||
|
||||
if (resultsPanes.length === 1) {
|
||||
|
||||
@@ -39,6 +39,7 @@ export const SingleQueryResultPane = ({
|
||||
dataSize = 50,
|
||||
isVisible,
|
||||
canDownload,
|
||||
columnDisplayNames,
|
||||
}: SingleQueryResultPaneProp) => {
|
||||
const [filterText, setFilterText] = useState('');
|
||||
|
||||
@@ -52,6 +53,7 @@ export const SingleQueryResultPane = ({
|
||||
isVisible,
|
||||
{}, // moreConfig
|
||||
true, // allowHTML
|
||||
columnDisplayNames,
|
||||
);
|
||||
const filteredData = useFilteredTableData(filterText, data);
|
||||
|
||||
|
||||
@@ -55,6 +55,7 @@ export const useResultsPane = ({
|
||||
isVisible,
|
||||
dataSize = 50,
|
||||
canDownload,
|
||||
columnDisplayNames,
|
||||
}: ResultsPaneProps): ReactElement[] => {
|
||||
const metadata = getChartMetadataRegistry().get(
|
||||
queryFormData?.viz_type || queryFormData?.vizType,
|
||||
@@ -164,6 +165,7 @@ export const useResultsPane = ({
|
||||
datasourceId={queryFormData.datasource}
|
||||
isVisible={isVisible}
|
||||
canDownload={canDownload}
|
||||
columnDisplayNames={columnDisplayNames}
|
||||
/>
|
||||
</StyledDiv>
|
||||
));
|
||||
|
||||
@@ -49,6 +49,8 @@ export interface ResultsPaneProps {
|
||||
// reload OriginalFormattedTimeColumns from localStorage when isVisible is true
|
||||
isVisible: boolean;
|
||||
canDownload: boolean;
|
||||
// Optional map of column/metric name -> verbose label
|
||||
columnDisplayNames?: Record<string, string>;
|
||||
}
|
||||
|
||||
export interface SamplesPaneProps {
|
||||
@@ -88,4 +90,6 @@ export interface SingleQueryResultPaneProp extends QueryResultInterface {
|
||||
// reload OriginalFormattedTimeColumns from localStorage when isVisible is true
|
||||
isVisible: boolean;
|
||||
canDownload: boolean;
|
||||
// Optional map of column/metric name -> verbose label
|
||||
columnDisplayNames?: Record<string, string>;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user