Skip to content

Commit

Permalink
Add Marketplace plugins data to the list
Browse files Browse the repository at this point in the history
  • Loading branch information
epeicher committed Jan 15, 2025
1 parent b097de7 commit b6cc843
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion client/my-sites/plugins/plugins-dashboard/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ import clsx from 'clsx';
import { useTranslate } from 'i18n-calypso';
import QueryJetpackSitesFeatures from 'calypso/components/data/query-jetpack-sites-features';
import QueryPlugins from 'calypso/components/data/query-plugins';
import QueryProductsList from 'calypso/components/data/query-products-list';
import SidebarNavigation from 'calypso/components/sidebar-navigation';
import { useWPCOMPluginsList } from 'calypso/data/marketplace/use-wpcom-plugins-query';
import Layout from 'calypso/layout/hosting-dashboard';
import LayoutBody from 'calypso/layout/hosting-dashboard/body';
import LayoutColumn from 'calypso/layout/hosting-dashboard/column';
Expand Down Expand Up @@ -108,10 +110,17 @@ const PluginsDashboard = ( {
const isLoading = useSelector(
( state ) => isRequestingForAllSites( state ) || isRequestingSites( state )
);
const dotcomPlugins = useWPCOMPluginsList( 'all' );
const allPlugins = useSelector( ( state ) => getPlugins( state, siteIds, 'all' ) ).map(
( plugin: Plugin ) => {
const pluginData = wporgPlugins?.[ plugin.slug ];
return Object.assign( {}, plugin, pluginData ) as Plugin;
let dotComPluginData = {};
if ( dotcomPlugins.data ) {
dotComPluginData = dotcomPlugins.data.find(
( dotComPlugin ) => dotComPlugin.slug === plugin.slug
);
}
return Object.assign( {}, plugin, pluginData, dotComPluginData ) as Plugin;
}
);
const currentPlugins = useSelector( ( state ) =>
Expand Down Expand Up @@ -323,6 +332,7 @@ const PluginsDashboard = ( {
/>
<QueryJetpackSitesFeatures />
<QueryPlugins />
<QueryProductsList />
<LayoutColumn className="sites-overview" wide>
<LayoutTop withNavigation={ false }>
<LayoutHeader>
Expand Down

0 comments on commit b6cc843

Please sign in to comment.