Skip to content

Commit

Permalink
getResource default
Browse files Browse the repository at this point in the history
  • Loading branch information
jschuler committed Jun 21, 2021
1 parent 7531c26 commit ac40fa4
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 11 deletions.
2 changes: 1 addition & 1 deletion packages/dev/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"serve": "serve public"
},
"dependencies": {
"@patternfly/quickstarts": "1.0.0-rc.12",
"@patternfly/quickstarts": "1.0.0-rc.13",
"@patternfly/react-core": "^4.101.3",
"asciidoctor": "^2.2.1",
"react": "^16.14.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/module/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@patternfly/quickstarts",
"version": "1.0.0-rc.12",
"version": "1.0.0-rc.13",
"description": "PatternFly quick starts",
"files": [
"dist"
Expand Down
7 changes: 0 additions & 7 deletions packages/module/src/QuickStartCatalogPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,6 @@ export const QuickStartCatalogPage: React.FC<QuickStartCatalogPageProps> = ({
}) => {
const { allQuickStarts = quickStarts, allQuickStartStates, getResource, filter, setFilter } = React.useContext<QuickStartContextValues>(QuickStartContext);

// const initialQueryParams = new URLSearchParams(window.location.search);
// const initialSearchQuery = initialQueryParams.get(QUICKSTART_SEARCH_FILTER_KEY) || '';
// const [searchInputText, setSearchInputText] = React.useState<string>(initialSearchQuery);
// const initialStatusFilters =
// initialQueryParams.get(QUICKSTART_STATUS_FILTER_KEY)?.split(',') || [];
// const [statusFilters, setStatusFilters] = React.useState<string[]>(initialStatusFilters);

const initialFilteredQuickStarts = showFilter
? filterQuickStarts(
allQuickStarts,
Expand Down
4 changes: 2 additions & 2 deletions packages/module/src/utils/quick-start-context.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export const QuickStartContextDefaults = {
startQuickStart: () => {},
restartQuickStart: () => {},
resourceBundle: en,
getResource: () => {},
getResource: () => '',
lng: 'en',
useQueryParams: true,
setFilter: () => {},
Expand All @@ -81,7 +81,7 @@ export const getResource = (resource: string, options: any, resourceBundle: any,
return resourceBundle[`${resource}_${suffix}`];
}
}
return resourceBundle[resource];
return resourceBundle && resourceBundle[resource] || '';
}

export const QuickStartContextProvider: React.FC<{
Expand Down

0 comments on commit ac40fa4

Please sign in to comment.