From 6e76e7f622854abe867a02b69a8762db3fa02374 Mon Sep 17 00:00:00 2001 From: Joachim Schuler Date: Mon, 21 Jun 2021 16:40:12 -0400 Subject: [PATCH] status checkbox on init --- packages/dev/package.json | 2 +- packages/dev/src/App.tsx | 21 +++++++------------ packages/module/package.json | 2 +- .../Toolbar/QuickStartCatalogFilterItems.tsx | 4 ++-- .../module/src/utils/quick-start-context.tsx | 6 ------ 5 files changed, 11 insertions(+), 24 deletions(-) diff --git a/packages/dev/package.json b/packages/dev/package.json index 7af95a7e..331ea6d6 100644 --- a/packages/dev/package.json +++ b/packages/dev/package.json @@ -9,7 +9,7 @@ "serve": "serve public" }, "dependencies": { - "@patternfly/quickstarts": "1.0.0-rc.15", + "@patternfly/quickstarts": "1.0.0-rc.16", "@patternfly/react-core": "^4.101.3", "asciidoctor": "^2.2.1", "react": "^16.14.0", diff --git a/packages/dev/src/App.tsx b/packages/dev/src/App.tsx index 063ff9d3..b2aa4478 100755 --- a/packages/dev/src/App.tsx +++ b/packages/dev/src/App.tsx @@ -53,16 +53,11 @@ const App: React.FC = ({ children, showCardFooters }) => { console.log(allQuickStartStates); }, [allQuickStartStates]); - const [ - allQuickStartsLoaded, - setAllQuickStartsLoaded, - ] = React.useState(false); const [allQuickStarts, setAllQuickStarts] = React.useState([]); React.useEffect(() => { const load = async () => { const masGuidesQuickstarts = await loadJSONQuickStarts(""); setAllQuickStarts(yamlQuickStarts.concat(masGuidesQuickstarts)); - setAllQuickStartsLoaded(true); }; load(); }, []); @@ -131,15 +126,13 @@ const App: React.FC = ({ children, showCardFooters }) => { return ( }> - {allQuickStartsLoaded && ( - - - - {children} - - - - )} + {allQuickStarts && allQuickStarts.length && + + + {children} + + + } ); }; diff --git a/packages/module/package.json b/packages/module/package.json index c9e87afe..4fe868ff 100644 --- a/packages/module/package.json +++ b/packages/module/package.json @@ -1,6 +1,6 @@ { "name": "@patternfly/quickstarts", - "version": "1.0.0-rc.15", + "version": "1.0.0-rc.16", "description": "PatternFly quick starts", "files": [ "dist" diff --git a/packages/module/src/catalog/Toolbar/QuickStartCatalogFilterItems.tsx b/packages/module/src/catalog/Toolbar/QuickStartCatalogFilterItems.tsx index af611a54..373a98a5 100644 --- a/packages/module/src/catalog/Toolbar/QuickStartCatalogFilterItems.tsx +++ b/packages/module/src/catalog/Toolbar/QuickStartCatalogFilterItems.tsx @@ -163,7 +163,7 @@ export const QuickStartCatalogFilterStatusWrapper: React.FC ( - + {val} )); return ( @@ -171,7 +171,7 @@ export const QuickStartCatalogFilterStatusWrapper: React.FC ); diff --git a/packages/module/src/utils/quick-start-context.tsx b/packages/module/src/utils/quick-start-context.tsx index 0dcba25f..854142c9 100644 --- a/packages/module/src/utils/quick-start-context.tsx +++ b/packages/module/src/utils/quick-start-context.tsx @@ -52,7 +52,6 @@ export type QuickStartContextValues = { status?: { statusTypes?: any; statusFilters?: any; - selectedFilters?: any; } } setFilter?: any; @@ -124,9 +123,6 @@ export const QuickStartContextProvider: React.FC<{ [QuickStartStatus.NOT_STARTED]: findResource('Not started ({{statusCount, number}})').replace('{{statusCount, number}}', quickStartStatusCount[QuickStartStatus.NOT_STARTED]), }); const [statusFilters, setStatusFilters] = React.useState(initialStatusFilters); - const [selectedFilters, setSelectedFilters] = React.useState( - initialStatusFilters.map((filter) => statusTypes[filter]), - ); const [filterKeyword, setFilterKeyword] = React.useState(initialSearchQuery); @@ -135,7 +131,6 @@ export const QuickStartContextProvider: React.FC<{ setFilterKeyword(value); } else if (type === 'status') { setStatusFilters(value); - setSelectedFilters(value.map((filterKey) => statusTypes[filterKey])); } }; @@ -362,7 +357,6 @@ export const QuickStartContextProvider: React.FC<{ status: { statusTypes, statusFilters, - selectedFilters, } }, setFilter,