bujjibabukatta commented on code in PR #8922:
URL: https://github.com/apache/devlake/pull/8922#discussion_r3408151850


##########
config-ui/src/plugins/components/scope-config-select/index.tsx:
##########
@@ -37,13 +37,14 @@ export const ScopeConfigSelect = ({ plugin, connectionId, 
scopeConfigId, onCance
   const [version, setVersion] = useState(1);
   const [trId, setTrId] = useState<ID>();
   const [open, setOpen] = useState(false);
+  const [showAll, setShowAll] = useState(false);
+  
+  const { ready, data } = useRefreshData(() => showAll ? 
API.scopeConfig.listAll(plugin) : API.scopeConfig.list(plugin, 
connectionId),[version, showAll],);
 
-  const { ready, data } = useRefreshData(() => API.scopeConfig.list(plugin, 
connectionId), [version]);
-
-  const dataSource = useMemo(
-    () => (data ? (scopeConfigId ? [{ id: 'None', name: 'No Scope Config' 
}].concat(data) : data) : []),
-    [data, scopeConfigId],
-  );
+  const dataSource = useMemo(() => {
+  const filtered = showAll ? data : data;

Review Comment:
   Thanks for the feedback! You're right — I've removed the dead ternary and 
showAll from the memo deps. The filtering is handled server-side in 
useRefreshData which already switches between listAll and list based on 
showAll, so no client-side filtering is needed in the memo.



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

Reply via email to