Skip to content

Commit

Permalink
update deprecated eui components in reportin_example plugin (#164071)
Browse files Browse the repository at this point in the history
## Summary

Partially addresses #161422

Co-authored-by: Kibana Machine <[email protected]>
  • Loading branch information
vadimkibana and kibanamachine authored Aug 17, 2023
1 parent a96785c commit 2f79a62
Showing 1 changed file with 75 additions and 78 deletions.
153 changes: 75 additions & 78 deletions x-pack/examples/reporting_example/public/containers/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ import {
EuiLink,
EuiPage,
EuiPageBody,
EuiPageContent_Deprecated as EuiPageContent,
EuiPageContentBody_Deprecated as EuiPageContentBody,
EuiPageSection,
EuiPageHeader,
EuiPopover,
EuiSpacer,
Expand Down Expand Up @@ -292,86 +291,84 @@ export const Main = ({ basename, reporting, screenshotMode }: ReportingExampleAp
<h1>Reporting Example</h1>
</EuiTitle>
</EuiPageHeader>
<EuiPageContent>
<EuiPageContentBody>
<EuiTitle>
<h2>Example of a Sharing menu using components from Reporting</h2>
</EuiTitle>
<EuiSpacer />
<EuiText>
<EuiFlexGroup alignItems="center" gutterSize="l">
<EuiFlexItem grow={false}>
<EuiPopover
id="contextMenuExample"
button={
<EuiButton data-test-subj="shareButton" onClick={onButtonClick}>
Share
</EuiButton>
}
isOpen={isPopoverOpen}
closePopover={closePopover}
panelPaddingSize="none"
anchorPosition="downLeft"
>
<EuiContextMenu initialPanelId={0} panels={panels} />
</EuiPopover>
</EuiFlexItem>
<EuiFlexItem grow={false}>
<EuiText size="s">
<EuiLink href={history.createHref(parsePath(ROUTES.captureTest))}>
Go to capture test
</EuiLink>
</EuiText>
</EuiFlexItem>
</EuiFlexGroup>
<EuiPageSection>
<EuiTitle>
<h2>Example of a Sharing menu using components from Reporting</h2>
</EuiTitle>
<EuiSpacer />
<EuiText>
<EuiFlexGroup alignItems="center" gutterSize="l">
<EuiFlexItem grow={false}>
<EuiPopover
id="contextMenuExample"
button={
<EuiButton data-test-subj="shareButton" onClick={onButtonClick}>
Share
</EuiButton>
}
isOpen={isPopoverOpen}
closePopover={closePopover}
panelPaddingSize="none"
anchorPosition="downLeft"
>
<EuiContextMenu initialPanelId={0} panels={panels} />
</EuiPopover>
</EuiFlexItem>
<EuiFlexItem grow={false}>
<EuiText size="s">
<EuiLink href={history.createHref(parsePath(ROUTES.captureTest))}>
Go to capture test
</EuiLink>
</EuiText>
</EuiFlexItem>
</EuiFlexGroup>

<EuiHorizontalRule />
<EuiHorizontalRule />

<div data-shared-items-container data-shared-items-count="5">
<EuiFlexGroup gutterSize="l">
<EuiFlexItem data-shared-item>
{forwardedState ? (
<>
<EuiText>
<p>
<strong>Forwarded app state</strong>
</p>
</EuiText>
<EuiCodeBlock>{JSON.stringify(forwardedState)}</EuiCodeBlock>
</>
) : (
<>
<EuiText>
<p>
<strong>No forwarded app state found</strong>
</p>
</EuiText>
<EuiCodeBlock>{'{}'}</EuiCodeBlock>
</>
)}
<div data-shared-items-container data-shared-items-count="5">
<EuiFlexGroup gutterSize="l">
<EuiFlexItem data-shared-item>
{forwardedState ? (
<>
<EuiText>
<p>
<strong>Forwarded app state</strong>
</p>
</EuiText>
<EuiCodeBlock>{JSON.stringify(forwardedState)}</EuiCodeBlock>
</>
) : (
<>
<EuiText>
<p>
<strong>No forwarded app state found</strong>
</p>
</EuiText>
<EuiCodeBlock>{'{}'}</EuiCodeBlock>
</>
)}
</EuiFlexItem>
{logos.map((item, index) => (
<EuiFlexItem
key={index}
data-shared-item
data-shared-render-error
data-render-error="This is an example error"
>
<EuiCard
icon={<EuiIcon size="xxl" type={`logo${item}`} />}
title={`Elastic ${item}`}
description="Example of a card's description. Stick to one or two sentences."
onClick={() => {}}
/>
</EuiFlexItem>
{logos.map((item, index) => (
<EuiFlexItem
key={index}
data-shared-item
data-shared-render-error
data-render-error="This is an example error"
>
<EuiCard
icon={<EuiIcon size="xxl" type={`logo${item}`} />}
title={`Elastic ${item}`}
description="Example of a card's description. Stick to one or two sentences."
onClick={() => {}}
/>
</EuiFlexItem>
))}
</EuiFlexGroup>
))}
</EuiFlexGroup>

<p>Screenshot Mode is {screenshotMode.isScreenshotMode() ? 'ON' : 'OFF'}!</p>
</div>
</EuiText>
</EuiPageContentBody>
</EuiPageContent>
<p>Screenshot Mode is {screenshotMode.isScreenshotMode() ? 'ON' : 'OFF'}!</p>
</div>
</EuiText>
</EuiPageSection>
</EuiPageBody>
</EuiPage>
</I18nProvider>
Expand Down

0 comments on commit 2f79a62

Please sign in to comment.