michael-s-molina commented on code in PR #32341:
URL: https://github.com/apache/superset/pull/32341#discussion_r1965323709


##########
superset-websocket/src/config.ts:
##########
@@ -142,6 +140,50 @@ function applyEnvOverrides(config: ConfigType): ConfigType 
{
 }
 
 export function buildConfig(): ConfigType {
-  const config = _merge(defaultConfig(), configFromFile());

Review Comment:
   Previous version is way more readable and less error prone.



##########
superset-frontend/src/dashboard/hooks/useDownloadScreenshot.ts:
##########
@@ -44,9 +43,12 @@ export const useDownloadScreenshot = (
   const activeTabs = useSelector(
     (state: RootState) => state.dashboardState.activeTabs || undefined,
   );
-  const anchor = useSelector(
-    (state: RootState) =>
-      last(state.dashboardState.directPathToChild) || undefined,
+  const anchor = useSelector((state: RootState) =>

Review Comment:
   I agree with @kgabryje but don't think we should implement our own function. 
We need to keep in mind that any function that we implement needs to be 
maintained and in general it's best to depend on libraries that are greatly 
supported like Lodash.



##########
superset-frontend/src/components/Select/AsyncSelect.tsx:
##########
@@ -574,7 +574,9 @@ const AsyncSelect = forwardRef(
         }
       } else {
         const token = tokenSeparators.find(token => 
pastedText.includes(token));
-        const array = token ? uniq(pastedText.split(token)) : [pastedText];
+        const array = token

Review Comment:
   Even though we can implement this using simple Javascript, `uniq` still 
offers semantic meaning that helps with readability.



##########
superset-frontend/src/features/home/ChartTable.tsx:
##########
@@ -76,7 +75,7 @@ function ChartTable({
     TableTab.Other,
   );
 
-  const filteredOtherTabData = filter(otherTabData, obj => 'viz_type' in obj);
+  const filteredOtherTabData = otherTabData?.filter(obj => 'viz_type' in obj);

Review Comment:
   👍🏼 



-- 
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]

Reply via email to