Skip to content

Commit

Permalink
Allow sending action which is rendered next to tile title (patternfly…
Browse files Browse the repository at this point in the history
…#283)

* Allow sending action which is rendered next to tile title

* Change action to predefined button and add an example

* Fix failing A11 tests

* Use meta ID if present for card IDs

* fix(ascii): Remove ascii doc examples.

* fix(lint): Fixed linting issue.

---------

Co-authored-by: Donald Labaj <[email protected]>
  • Loading branch information
karelhala and dlabaj committed Jun 27, 2024
1 parent bc0bb96 commit d0f53f4
Show file tree
Hide file tree
Showing 40 changed files with 96 additions and 2,484 deletions.
283 changes: 0 additions & 283 deletions packages/dev/quickstart-adoc.js

This file was deleted.

16 changes: 2 additions & 14 deletions packages/dev/src/AppContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,11 @@ import './App.css';
import { Page } from '@patternfly/react-core';
import {
LoadingBox,
QuickStart,
QuickStartContextProvider,
QuickStartContextValues,
QuickStartDrawer,
useLocalStorage,
} from '@patternfly/quickstarts';
import { loadJSONQuickStarts } from './quickstarts-data/asciidoc/quickstartLoader';
import { allQuickStarts as yamlQuickStarts } from './quickstarts-data/quick-start-test-data';
import React from 'react';
import i18n from './i18n/i18n';
Expand All @@ -31,22 +29,12 @@ const App: React.FC<AppProps> = ({ children, showCardFooters }) => {
console.log(allQuickStartStates);
}, [allQuickStartStates]);

const [allQuickStarts, setAllQuickStarts] = React.useState<QuickStart[]>([]);
React.useEffect(() => {
const load = async () => {
const masGuidesQuickstarts = await loadJSONQuickStarts('');
setAllQuickStarts(yamlQuickStarts.concat(masGuidesQuickstarts));
};
setTimeout(() => {
load();
}, 500);
}, []);

const language = localStorage.getItem('bridge/language') || 'en';
const resourceBundle = i18n.getResourceBundle(language, 'quickstart');

const valuesForQuickstartContext: QuickStartContextValues = {
allQuickStarts,
allQuickStarts: yamlQuickStarts,
activeQuickStartID,
setActiveQuickStartID,
allQuickStartStates,
Expand All @@ -65,7 +53,7 @@ const App: React.FC<AppProps> = ({ children, showCardFooters }) => {

return (
<React.Suspense fallback={<LoadingBox />}>
{allQuickStarts && allQuickStarts.length ? (
{yamlQuickStarts && yamlQuickStarts.length ? (
<QuickStartContextProvider value={valuesForQuickstartContext}>
<QuickStartDrawer>
<Page header={AppHeader} sidebar={AppSidebar} isManagedSidebar>
Expand Down
18 changes: 2 additions & 16 deletions packages/dev/src/AppProps.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,13 @@ import './App.css';
import { Page, Button } from '@patternfly/react-core';
import {
LoadingBox,
QuickStart,
QuickStartContainer,
QuickStartContainerProps,
useLocalStorage,
setQueryArgument,
removeQueryArgument,
QUICKSTART_ID_FILTER_KEY,
} from '@patternfly/quickstarts';
import { loadJSONQuickStarts } from './quickstarts-data/asciidoc/quickstartLoader';
import { allQuickStarts as yamlQuickStarts } from './quickstarts-data/quick-start-test-data';
import React from 'react';
import i18n from './i18n/i18n';
Expand All @@ -35,31 +33,19 @@ const App: React.FC<AppProps> = ({ children, showCardFooters }) => {
console.log(allQuickStartStates);
}, [allQuickStartStates]);

const [loading, setLoading] = React.useState(true);
const [quickStarts, setQuickStarts] = React.useState<QuickStart[]>([]);
React.useEffect(() => {
const load = async () => {
const masGuidesQuickstarts = await loadJSONQuickStarts('');
setQuickStarts(yamlQuickStarts.concat(masGuidesQuickstarts));
setLoading(false);
};
setTimeout(() => {
load();
}, 500);
}, []);


const withQueryParams = true;

const drawerProps: QuickStartContainerProps = {
quickStarts,
quickStarts: yamlQuickStarts,
activeQuickStartID,
allQuickStartStates,
setActiveQuickStartID,
setAllQuickStartStates,
resourceBundle,
showCardFooters,
language,
loading,
useQueryParams: withQueryParams,
alwaysShowTaskReview: true,
markdown: {
Expand Down
Loading

0 comments on commit d0f53f4

Please sign in to comment.