semohr commented on code in PR #37396:
URL: https://github.com/apache/superset/pull/37396#discussion_r2731257647
##########
superset-frontend/src/explore/components/DataTableControl/index.tsx:
##########
@@ -222,6 +222,31 @@ const DataTableTemporalHeaderCell = ({
);
};
+const DataTableHeaderCell = ({
+ columnName,
+ columnLabel,
+}: {
+ columnName: string;
+ columnLabel?: string;
+}) => {
+ // Use label if provided, otherwise use column name
+ // as header
+ const displayText = columnLabel || columnName;
+ if (columnLabel && columnLabel !== columnName) {
+ return (
+ <Popover
+ content={`${t('Column name')}: ${columnName}`}
+ placement="bottomLeft"
+ arrow={{ pointAtCenter: true }}
+ >
+ <span>{displayText}</span>
+ </Popover>
+ );
+ }
+
+ return <span>{displayText}</span>;
+};
+
Review Comment:
Im not too well versed in the notation used here. It is a functional
component afaik. Do you mean move it into its own file?
There are a few other components in this file that are related to
cell/header logic that could be moved too.
Would be a bit bigger refactor tho. If you want I can add it here. Although
we are properly better of doing that in a followup PR to not muddy the water
too much.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]