EnxDev commented on code in PR #44955:
URL: https://github.com/apache/superset/pull/44955#discussion_r4353719141
##########
superset-frontend/packages/superset-ui-chart-controls/src/utils/headerGroups.ts:
##########
@@ -61,6 +63,33 @@ export type HeaderGroupCell = {
export const TIME_COMPARE_MAIN_KEY = 'Main';
+/** English msgid for `__timestamp`; `COLUMN_NAME_ALIASES` holds `t('Time')`.
*/
+const DTTM_ALIAS_SOURCE_LABEL = 'Time';
+
+function getColumnNameAliasLabels(col: string): string[] {
+ const translated = COLUMN_NAME_ALIASES[col];
+ const source = col === DTTM_ALIAS ? DTTM_ALIAS_SOURCE_LABEL : undefined;
+ return [
+ ...new Set(
+ [source, translated].filter((label): label is string => Boolean(label)),
+ ),
+ ];
+}
+
+export function getKnownColumnConfigKeys(
Review Comment:
Nit, take it or leave it. This is exported from chart-controls and three
control panels plus both transformProps depend on it, so a one-line docstring
saying why datasource columns and metrics count as known (they block the `Time`
alias remap) would save the next reader a trip through the review threads.
--
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]