@@ -12,31 +12,23 @@ import {
1212 QUICKSTART_SEARCH_FILTER_KEY ,
1313 QUICKSTART_STATUS_FILTER_KEY ,
1414 QuickStartCatalogFilterSearchWrapper ,
15- QuickStartCatalogFilterStatusWrapper ,
1615 QuickStartCatalogFilterCountWrapper ,
1716 clearQuickStartFilters ,
1817 QuickStartCatalogHeader ,
1918 QuickStartCatalogToolbar ,
2019 QuickStartCatalogSection ,
2120} from '@patternfly/quickstarts' ;
2221import {
23- PageSection ,
24- PageSectionVariants ,
2522 TextContent ,
2623 Text ,
2724 Divider ,
2825 Gallery ,
2926 GalleryItem ,
30- Toolbar ,
3127 ToolbarContent ,
3228} from '@patternfly/react-core' ;
3329
34- type CustomCatalogProps = {
35- quickStarts : QuickStart [ ] ;
36- } ;
37-
38- export const CustomCatalog : React . FC < CustomCatalogProps > = ( { quickStarts } ) => {
39- const { activeQuickStartID, allQuickStartStates } = React . useContext < QuickStartContextValues > (
30+ export const CustomCatalog : React . FC = ( ) => {
31+ const { activeQuickStartID, allQuickStartStates, allQuickStarts } = React . useContext < QuickStartContextValues > (
4032 QuickStartContext ,
4133 ) ;
4234
@@ -50,7 +42,7 @@ export const CustomCatalog: React.FC<CustomCatalogProps> = ({ quickStarts }) =>
5042 const sortFnc = ( q1 : QuickStart , q2 : QuickStart ) =>
5143 q1 . spec . displayName . localeCompare ( q2 . spec . displayName ) ;
5244 const initialFilteredQuickStarts = filterQuickStarts (
53- quickStarts ,
45+ allQuickStarts ,
5446 initialSearchQuery ,
5547 initialStatusFilters ,
5648 allQuickStartStates ,
@@ -60,12 +52,12 @@ export const CustomCatalog: React.FC<CustomCatalogProps> = ({ quickStarts }) =>
6052 ) ;
6153
6254 const quickStartStatusCount = React . useMemo (
63- ( ) => getQuickStartStatusCount ( allQuickStartStates , quickStarts ) ,
64- [ allQuickStartStates , quickStarts ] ,
55+ ( ) => getQuickStartStatusCount ( allQuickStartStates , allQuickStarts ) ,
56+ [ allQuickStartStates , allQuickStarts ] ,
6557 ) ;
6658 const onSearchInputChange = ( searchValue : string ) => {
6759 const result = filterQuickStarts (
68- quickStarts ,
60+ allQuickStarts ,
6961 searchValue ,
7062 statusFilters ,
7163 allQuickStartStates ,
@@ -75,7 +67,7 @@ export const CustomCatalog: React.FC<CustomCatalogProps> = ({ quickStarts }) =>
7567 } ;
7668 const onStatusChange = ( statusList : string [ ] ) => {
7769 const result = filterQuickStarts (
78- quickStarts ,
70+ allQuickStarts ,
7971 searchInputText ,
8072 statusList ,
8173 allQuickStartStates ,
@@ -92,7 +84,7 @@ export const CustomCatalog: React.FC<CustomCatalogProps> = ({ quickStarts }) =>
9284 < Text component = "p" > Step-by-step instructions and tasks</ Text >
9385 </ TextContent >
9486 < Gallery className = "co-quick-start-catalog__gallery" hasGutter >
95- { quickStarts
87+ { allQuickStarts
9688 . filter (
9789 ( quickStart ) =>
9890 ! quickStart . spec . type || quickStart . spec . type . text !== 'Documentation' ,
@@ -123,7 +115,7 @@ export const CustomCatalog: React.FC<CustomCatalogProps> = ({ quickStarts }) =>
123115 < Text component = "p" > Technical information for using the service</ Text >
124116 </ TextContent >
125117 < Gallery className = "co-quick-start-catalog__gallery" hasGutter >
126- { quickStarts
118+ { allQuickStarts
127119 . filter ( ( quickStart ) => quickStart . spec . type ?. text === 'Documentation' )
128120 . map ( ( quickStart ) => {
129121 const {
@@ -148,7 +140,7 @@ export const CustomCatalog: React.FC<CustomCatalogProps> = ({ quickStarts }) =>
148140 const clearFilters = ( ) => {
149141 clearQuickStartFilters ( ) ;
150142 setFilteredQuickStarts (
151- quickStarts . sort ( ( q1 , q2 ) => q1 . spec . displayName . localeCompare ( q2 . spec . displayName ) ) ,
143+ allQuickStarts . sort ( ( q1 , q2 ) => q1 . spec . displayName . localeCompare ( q2 . spec . displayName ) ) ,
152144 ) ;
153145 } ;
154146
@@ -169,7 +161,7 @@ export const CustomCatalog: React.FC<CustomCatalogProps> = ({ quickStarts }) =>
169161 < Divider component = "div" />
170162 { filteredQuickStarts . length === 0 ? (
171163 < QuickStartCatalogEmptyState clearFilters = { clearFilters } />
172- ) : filteredQuickStarts . length !== quickStarts . length ? (
164+ ) : filteredQuickStarts . length !== allQuickStarts . length ? (
173165 < QuickStartCatalogSection >
174166 < QuickStartCatalog quickStarts = { filteredQuickStarts } />
175167 </ QuickStartCatalogSection >
0 commit comments