diff --git a/x-pack/plugins/fleet/public/applications/integrations/sections/epm/components/package_list_grid/grid.tsx b/x-pack/plugins/fleet/public/applications/integrations/sections/epm/components/package_list_grid/grid.tsx index 4338cfb2bc918..80cb14dcfb16c 100644 --- a/x-pack/plugins/fleet/public/applications/integrations/sections/epm/components/package_list_grid/grid.tsx +++ b/x-pack/plugins/fleet/public/applications/integrations/sections/epm/components/package_list_grid/grid.tsx @@ -68,7 +68,6 @@ export const GridColumn = ({ }: GridColumnProps) => { const itemsSizeRefs = useRef(new Map()); const listRef = useRef(null); - const onHeightChange = useCallback((index: number, size: number) => { itemsSizeRefs.current.set(index, size); if (listRef.current) { diff --git a/x-pack/plugins/fleet/public/applications/integrations/sections/epm/components/package_list_grid/index.tsx b/x-pack/plugins/fleet/public/applications/integrations/sections/epm/components/package_list_grid/index.tsx index be2b873c317db..ba90ed6509f95 100644 --- a/x-pack/plugins/fleet/public/applications/integrations/sections/epm/components/package_list_grid/index.tsx +++ b/x-pack/plugins/fleet/public/applications/integrations/sections/epm/components/package_list_grid/index.tsx @@ -61,6 +61,8 @@ export interface PackageListGridProps { setUrlandReplaceHistory: (params: IntegrationsURLParameters) => void; setUrlandPushHistory: (params: IntegrationsURLParameters) => void; callout?: JSX.Element | null; + // Props to decide the size of the spacer above callout. Security Solution uses this prop to customize the size of the spacer + calloutTopSpacerSize?: 's' | 'm' | 'xs' | 'l' | 'xl' | 'xxl'; // Props used only in AvailablePackages component: showCardLabels?: boolean; title?: string; @@ -70,6 +72,8 @@ export interface PackageListGridProps { showMissingIntegrationMessage?: boolean; showControls?: boolean; showSearchTools?: boolean; + // Customizing whether to sort by the default featured integrations' categories. Security Solution has custom sorting logic + sortByFeaturedIntegrations?: boolean; spacer?: boolean; // Security Solution sends the id to determine which element to scroll when the user interacting with the package list scrollElementId?: string; @@ -92,7 +96,9 @@ export const PackageListGrid: FunctionComponent = ({ setUrlandReplaceHistory, setUrlandPushHistory, showMissingIntegrationMessage = false, + sortByFeaturedIntegrations = true, callout, + calloutTopSpacerSize = 'l', // Default EUI spacer size showCardLabels = true, showControls = true, showSearchTools = true, @@ -141,9 +147,10 @@ export const PackageListGrid: FunctionComponent = ({ ) : list; - return promoteFeaturedIntegrations(filteredList, selectedCategory); - }, [isLoading, list, localSearchRef, searchTerm, selectedCategory]); - + return sortByFeaturedIntegrations + ? promoteFeaturedIntegrations(filteredList, selectedCategory) + : filteredList; + }, [isLoading, list, localSearchRef, searchTerm, selectedCategory, sortByFeaturedIntegrations]); const splitSubcategories = ( subcategories: CategoryFacet[] | undefined ): { visibleSubCategories?: CategoryFacet[]; hiddenSubCategories?: CategoryFacet[] } => { @@ -270,7 +277,7 @@ export const PackageListGrid: FunctionComponent = ({ ) : null} {callout ? ( <> - + {callout} ) : null}