You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2022/11/29 16:54:37 UTC

[GitHub] [superset] geido commented on a diff in pull request #22173: feat: Uses new table component in Drill to Detail

geido commented on code in PR #22173:
URL: https://github.com/apache/superset/pull/22173#discussion_r1034958592


##########
superset-frontend/src/components/Chart/DrillDetail/DrillDetailPane.tsx:
##########
@@ -89,30 +102,64 @@ export default function DrillDetailPane({
     return resultsPages.get(lastPageIndex.current);
   }, [pageIndex, resultsPages]);
 
-  // this is to preserve the order of the columns, even if there are integer values,
-  // while also only grabbing the first column's keys
-  const columns = useTableColumns(
-    resultsPage?.colNames,
-    resultsPage?.colTypes,
-    resultsPage?.data,
-    formData.datasource,
+  const mappedColumns: ColumnsType<DataType> = useMemo(
+    () =>
+      resultsPage?.colNames.map((column, index) => ({
+        key: column,
+        dataIndex: column,
+        title:
+          resultsPage?.colTypes[index] === GenericDataType.TEMPORAL ? (
+            <HeaderWithRadioGroup
+              headerTitle={column}
+              groupTitle={t('Formatting')}
+              groupOptions={[
+                { label: t('Original value'), value: 'original' },
+                { label: t('Formatted value'), value: 'formatted' },
+              ]}
+              value={
+                timeFormatting[column] === 'original' ? 'original' : 'formatted'

Review Comment:
   What do you think about using an Enum for these two values?



-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org