Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drilldown docs 2 #69375

Merged
merged 6 commits into from
Jun 17, 2020
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/core/public/doc_links/doc_links_service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ export class DocLinksService {
DOC_LINK_VERSION,
ELASTIC_WEBSITE_URL,
links: {
dashboard: {
drilldowns: `${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/drilldowns.html`,
},
filebeat: {
base: `${ELASTIC_WEBSITE_URL}guide/en/beats/filebeat/${DOC_LINK_VERSION}`,
installation: `${ELASTIC_WEBSITE_URL}guide/en/beats/filebeat/${DOC_LINK_VERSION}/filebeat-installation.html`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,12 @@ export function createFlyoutManageDrilldowns({
uiActionsEnhanced,
storage,
notifications,
docsLink,
}: {
uiActionsEnhanced: AdvancedUiActionsStart;
storage: IStorageWrapper;
notifications: NotificationsStart;
docsLink?: string;
}) {
// fine to assume this is static,
// because all action factories should be registered in setup phase
Expand Down Expand Up @@ -145,6 +147,7 @@ export function createFlyoutManageDrilldowns({
case Routes.Edit:
return (
<FlyoutDrilldownWizard
docsLink={docsLink}
showWelcomeMessage={shouldShowWelcomeMessage}
onWelcomeHideClick={onHideWelcomeMessage}
drilldownActionFactories={actionFactories}
Expand Down Expand Up @@ -197,6 +200,7 @@ export function createFlyoutManageDrilldowns({
default:
return (
<FlyoutListManageDrilldowns
docsLink={docsLink}
showWelcomeMessage={shouldShowWelcomeMessage}
onWelcomeHideClick={onHideWelcomeMessage}
drilldowns={drilldowns.map(mapToDrilldownToDrilldownListItem)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ export const DrilldownHelloBar: React.FC<DrilldownHelloBarProps> = ({
{docsLink && (
<>
<EuiSpacer size={'xs'} />
<EuiLink href={docsLink}>{txtViewDocsLinkLabel}</EuiLink>
<EuiLink href={docsLink} target="_blank" rel="noopener">
streamich marked this conversation as resolved.
Show resolved Hide resolved
{txtViewDocsLinkLabel}
</EuiLink>
</>
)}
</EuiFlexItem>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ export interface FlyoutDrilldownWizardProps<CurrentActionConfig extends object =
onWelcomeHideClick?: () => void;

actionFactoryContext?: object;

docsLink?: string;
}

function useWizardConfigState(
Expand Down Expand Up @@ -118,6 +120,7 @@ export function FlyoutDrilldownWizard<CurrentActionConfig extends object = objec
onWelcomeHideClick,
drilldownActionFactories,
actionFactoryContext,
docsLink,
}: FlyoutDrilldownWizardProps<CurrentActionConfig>) {
const [wizardConfig, { setActionFactory, setActionConfig, setName }] = useWizardConfigState(
initialDrilldownWizardConfig
Expand Down Expand Up @@ -154,7 +157,11 @@ export function FlyoutDrilldownWizard<CurrentActionConfig extends object = objec
footer={footer}
onClose={onClose}
onBack={onBack}
banner={showWelcomeMessage && <DrilldownHelloBar onHideClick={onWelcomeHideClick} />}
banner={
showWelcomeMessage && (
<DrilldownHelloBar docsLink={docsLink} onHideClick={onWelcomeHideClick} />
)
}
>
<FormDrilldownWizard
name={wizardConfig.name}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { txtManageDrilldowns } from './i18n';
import { DrilldownHelloBar } from '../drilldown_hello_bar';

export interface FlyoutListManageDrilldownsProps {
docsLink?: string;
drilldowns: DrilldownListItem[];
onClose?: () => void;
onCreate?: () => void;
Expand All @@ -21,6 +22,7 @@ export interface FlyoutListManageDrilldownsProps {
}

export function FlyoutListManageDrilldowns({
docsLink,
drilldowns,
onClose = () => {},
onCreate,
Expand All @@ -33,7 +35,11 @@ export function FlyoutListManageDrilldowns({
<FlyoutFrame
title={txtManageDrilldowns}
onClose={onClose}
banner={showWelcomeMessage && <DrilldownHelloBar onHideClick={onWelcomeHideClick} />}
banner={
showWelcomeMessage && (
<DrilldownHelloBar docsLink={docsLink} onHideClick={onWelcomeHideClick} />
)
}
>
<ListManageDrilldowns
drilldowns={drilldowns}
Expand Down
1 change: 1 addition & 0 deletions x-pack/plugins/drilldowns/public/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ export class DrilldownsPlugin
uiActionsEnhanced: plugins.uiActionsEnhanced,
storage: new Storage(localStorage),
notifications: core.notifications,
docsLink: core.docLinks.links.dashboard.drilldowns,
}),
};
}
Expand Down
3 changes: 3 additions & 0 deletions x-pack/plugins/ui_actions_enhanced/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# `ui_actions_enhanced`

- [__Dashboard drilldown user docs__](https://www.elastic.co/guide/en/kibana/master/drilldowns.html)