bbovenzi commented on code in PR #52408:
URL: https://github.com/apache/airflow/pull/52408#discussion_r2175693944
##########
airflow-core/src/airflow/ui/src/layouts/Nav/PluginMenus.tsx:
##########
@@ -30,32 +30,27 @@ import { PluginMenuItem } from "./PluginMenuItem";
export const PluginMenus = () => {
const { t: translate } = useTranslation("common");
- const { data } = usePluginServiceGetPlugins();
+ const menuPlugins = (useConfig("plugins_extra_menu_items") as
Array<ExternalViewResponse>) ?? [];
- const menuPlugins =
- data?.plugins.flatMap((plugin) => plugin.external_views).filter((view) =>
view.destination === "nav") ??
- [];
+ const directExternalViews = menuPlugins.filter((p: ExternalViewResponse) =>
!p.is_menu_item);
+ const menuExternalViews = menuPlugins.filter((p: ExternalViewResponse) =>
p.is_menu_item);
- // Only show external plugins in menu if there are more than 2
- const menuExternalViews = menuPlugins.length > 2 ? menuPlugins : [];
- const directExternalViews = menuPlugins.length <= 2 ? menuPlugins : [];
Review Comment:
Did we lose the code to consolidate plugin views into a menu when there are
many of them?
--
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]