You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@devlake.apache.org by GitBox <gi...@apache.org> on 2022/10/28 01:53:08 UTC

[GitHub] [incubator-devlake] likyh commented on a diff in pull request #2886: feat: setup configuration-ui plugin registry

likyh commented on code in PR #2886:
URL: https://github.com/apache/incubator-devlake/pull/2886#discussion_r1007529291


##########
config-ui/src/components/Sidebar.jsx:
##########
@@ -29,35 +35,46 @@ import { ReactComponent as Logo } from '@/images/devlake-logo.svg'
 import { ReactComponent as LogoText } from '@/images/devlake-textmark.svg'
 
 import '@/styles/sidebar.scss'
-import UIContext from '../store/UIContext'
+import UIContext from '@/store/UIContext'
 
-const Sidebar = () => {
+const Sidebar = (props) => {
+  const { integrations = [] } = props
   const activeRoute = useRouteMatch()
   const uiContext = useContext(UIContext)
 
-  const [menu, setMenu] = useState(MenuConfiguration(activeRoute))
+  const getMenu = useCallback(
+    () => MenuConfiguration(activeRoute, integrations),
+    [activeRoute, integrations]
+  )
+
+  const ActiveMenu = useMemo(() => getMenu(), [getMenu])
+
+  const [menu, setMenu] = useState(ActiveMenu)
   const [versionTag, setVersionTag] = useState('')
 
-  useEffect(() => {
-    setMenu(MenuConfiguration(activeRoute))
-  }, [activeRoute])
+  // useEffect(() => {
+  //   setMenu(ActiveMenu)
+  // }, [ActiveMenu])
 
   useEffect(() => {
-    const fetchVersion = async () => {
-      try {
-        const versionUrl = `${DEVLAKE_ENDPOINT}/version`

Review Comment:
   this API has been deleted? @klesh 



-- 
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: commits-unsubscribe@devlake.apache.org

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