pierrejeambrun commented on code in PR #51714:
URL: https://github.com/apache/airflow/pull/51714#discussion_r2159186533
##########
airflow-core/src/airflow/ui/src/layouts/Nav/PluginMenus.tsx:
##########
@@ -22,15 +22,15 @@ import { FiChevronRight } from "react-icons/fi";
import { LuPlug } from "react-icons/lu";
import { Link as RouterLink } from "react-router-dom";
-import { usePluginServiceGetPlugins } from "openapi/queries";
import type { AppBuilderMenuItemResponse } from "openapi/requests/types.gen";
import { Menu } from "src/components/ui";
+import { useConfig } from "src/queries/useConfig";
import { NavButton } from "./NavButton";
export const PluginMenus = () => {
const { t: translate } = useTranslation("common");
- const { data } = usePluginServiceGetPlugins();
+ const { data } = useConfig("plugins_extra_menu_items");
Review Comment:
You can't do that, response from `usePluginServiceGetPlugins` and
`useConfig("plugins_extra_menu_items")` are completely different, we should
keep `usePluginServiceGetPlugins();`
You should do the same as you did above. Check if `plugin` views is in the
permissions, if it's not don't render the `<PuginMenus />` in the nav.
--
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]