Skip to content

Commit

Permalink
Drilldown docs 2 (#69375) (#69410)
Browse files Browse the repository at this point in the history
* docs: ✏️ add drilldown user docs link to REAMDE

* feat: 🎸 wire drilldown docs link into <HelloBar> component

* feat: 🎸 set new page attributes on drilldown docs link

* feat: 🎸 add external prop to link to show icon

* fix: 🐛 remove rel= attribute

* fix: 🐛 add TypeScript type for drilldown docLink
  • Loading branch information
streamich authored Jun 17, 2020
1 parent eec43a1 commit c822d9e
Show file tree
Hide file tree
Showing 10 changed files with 39 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@

```typescript
readonly links: {
readonly dashboard: {
readonly drilldowns: string;
};
readonly filebeat: {
readonly base: string;
readonly installation: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ export interface DocLinksSetup
| --- | --- | --- |
| [DOC\_LINK\_VERSION](./kibana-plugin-core-public.doclinkssetup.doc_link_version.md) | <code>string</code> | |
| [ELASTIC\_WEBSITE\_URL](./kibana-plugin-core-public.doclinkssetup.elastic_website_url.md) | <code>string</code> | |
| [links](./kibana-plugin-core-public.doclinkssetup.links.md) | <code>{</code><br/><code> readonly filebeat: {</code><br/><code> readonly base: string;</code><br/><code> readonly installation: string;</code><br/><code> readonly configuration: string;</code><br/><code> readonly elasticsearchOutput: string;</code><br/><code> readonly startup: string;</code><br/><code> readonly exportedFields: string;</code><br/><code> };</code><br/><code> readonly auditbeat: {</code><br/><code> readonly base: string;</code><br/><code> };</code><br/><code> readonly metricbeat: {</code><br/><code> readonly base: string;</code><br/><code> };</code><br/><code> readonly heartbeat: {</code><br/><code> readonly base: string;</code><br/><code> };</code><br/><code> readonly logstash: {</code><br/><code> readonly base: string;</code><br/><code> };</code><br/><code> readonly functionbeat: {</code><br/><code> readonly base: string;</code><br/><code> };</code><br/><code> readonly winlogbeat: {</code><br/><code> readonly base: string;</code><br/><code> };</code><br/><code> readonly aggs: {</code><br/><code> readonly date_histogram: string;</code><br/><code> readonly date_range: string;</code><br/><code> readonly filter: string;</code><br/><code> readonly filters: string;</code><br/><code> readonly geohash_grid: string;</code><br/><code> readonly histogram: string;</code><br/><code> readonly ip_range: string;</code><br/><code> readonly range: string;</code><br/><code> readonly significant_terms: string;</code><br/><code> readonly terms: string;</code><br/><code> readonly avg: string;</code><br/><code> readonly avg_bucket: string;</code><br/><code> readonly max_bucket: string;</code><br/><code> readonly min_bucket: string;</code><br/><code> readonly sum_bucket: string;</code><br/><code> readonly cardinality: string;</code><br/><code> readonly count: string;</code><br/><code> readonly cumulative_sum: string;</code><br/><code> readonly derivative: string;</code><br/><code> readonly geo_bounds: string;</code><br/><code> readonly geo_centroid: string;</code><br/><code> readonly max: string;</code><br/><code> readonly median: string;</code><br/><code> readonly min: string;</code><br/><code> readonly moving_avg: string;</code><br/><code> readonly percentile_ranks: string;</code><br/><code> readonly serial_diff: string;</code><br/><code> readonly std_dev: string;</code><br/><code> readonly sum: string;</code><br/><code> readonly top_hits: string;</code><br/><code> };</code><br/><code> readonly scriptedFields: {</code><br/><code> readonly scriptFields: string;</code><br/><code> readonly scriptAggs: string;</code><br/><code> readonly painless: string;</code><br/><code> readonly painlessApi: string;</code><br/><code> readonly painlessSyntax: string;</code><br/><code> readonly luceneExpressions: string;</code><br/><code> };</code><br/><code> readonly indexPatterns: {</code><br/><code> readonly loadingData: string;</code><br/><code> readonly introduction: string;</code><br/><code> };</code><br/><code> readonly kibana: string;</code><br/><code> readonly siem: {</code><br/><code> readonly guide: string;</code><br/><code> readonly gettingStarted: string;</code><br/><code> };</code><br/><code> readonly query: {</code><br/><code> readonly luceneQuerySyntax: string;</code><br/><code> readonly queryDsl: string;</code><br/><code> readonly kueryQuerySyntax: string;</code><br/><code> };</code><br/><code> readonly date: {</code><br/><code> readonly dateMath: string;</code><br/><code> };</code><br/><code> readonly management: Record&lt;string, string&gt;;</code><br/><code> }</code> | |
| [links](./kibana-plugin-core-public.doclinkssetup.links.md) | <code>{</code><br/><code> readonly dashboard: {</code><br/><code> readonly drilldowns: string;</code><br/><code> };</code><br/><code> readonly filebeat: {</code><br/><code> readonly base: string;</code><br/><code> readonly installation: string;</code><br/><code> readonly configuration: string;</code><br/><code> readonly elasticsearchOutput: string;</code><br/><code> readonly startup: string;</code><br/><code> readonly exportedFields: string;</code><br/><code> };</code><br/><code> readonly auditbeat: {</code><br/><code> readonly base: string;</code><br/><code> };</code><br/><code> readonly metricbeat: {</code><br/><code> readonly base: string;</code><br/><code> };</code><br/><code> readonly heartbeat: {</code><br/><code> readonly base: string;</code><br/><code> };</code><br/><code> readonly logstash: {</code><br/><code> readonly base: string;</code><br/><code> };</code><br/><code> readonly functionbeat: {</code><br/><code> readonly base: string;</code><br/><code> };</code><br/><code> readonly winlogbeat: {</code><br/><code> readonly base: string;</code><br/><code> };</code><br/><code> readonly aggs: {</code><br/><code> readonly date_histogram: string;</code><br/><code> readonly date_range: string;</code><br/><code> readonly filter: string;</code><br/><code> readonly filters: string;</code><br/><code> readonly geohash_grid: string;</code><br/><code> readonly histogram: string;</code><br/><code> readonly ip_range: string;</code><br/><code> readonly range: string;</code><br/><code> readonly significant_terms: string;</code><br/><code> readonly terms: string;</code><br/><code> readonly avg: string;</code><br/><code> readonly avg_bucket: string;</code><br/><code> readonly max_bucket: string;</code><br/><code> readonly min_bucket: string;</code><br/><code> readonly sum_bucket: string;</code><br/><code> readonly cardinality: string;</code><br/><code> readonly count: string;</code><br/><code> readonly cumulative_sum: string;</code><br/><code> readonly derivative: string;</code><br/><code> readonly geo_bounds: string;</code><br/><code> readonly geo_centroid: string;</code><br/><code> readonly max: string;</code><br/><code> readonly median: string;</code><br/><code> readonly min: string;</code><br/><code> readonly moving_avg: string;</code><br/><code> readonly percentile_ranks: string;</code><br/><code> readonly serial_diff: string;</code><br/><code> readonly std_dev: string;</code><br/><code> readonly sum: string;</code><br/><code> readonly top_hits: string;</code><br/><code> };</code><br/><code> readonly scriptedFields: {</code><br/><code> readonly scriptFields: string;</code><br/><code> readonly scriptAggs: string;</code><br/><code> readonly painless: string;</code><br/><code> readonly painlessApi: string;</code><br/><code> readonly painlessSyntax: string;</code><br/><code> readonly luceneExpressions: string;</code><br/><code> };</code><br/><code> readonly indexPatterns: {</code><br/><code> readonly loadingData: string;</code><br/><code> readonly introduction: string;</code><br/><code> };</code><br/><code> readonly kibana: string;</code><br/><code> readonly siem: {</code><br/><code> readonly guide: string;</code><br/><code> readonly gettingStarted: string;</code><br/><code> };</code><br/><code> readonly query: {</code><br/><code> readonly luceneQuerySyntax: string;</code><br/><code> readonly queryDsl: string;</code><br/><code> readonly kueryQuerySyntax: string;</code><br/><code> };</code><br/><code> readonly date: {</code><br/><code> readonly dateMath: string;</code><br/><code> };</code><br/><code> readonly management: Record&lt;string, string&gt;;</code><br/><code> }</code> | |

6 changes: 6 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 Expand Up @@ -144,6 +147,9 @@ export interface DocLinksSetup {
readonly DOC_LINK_VERSION: string;
readonly ELASTIC_WEBSITE_URL: string;
readonly links: {
readonly dashboard: {
readonly drilldowns: string;
};
readonly filebeat: {
readonly base: string;
readonly installation: string;
Expand Down
3 changes: 3 additions & 0 deletions src/core/public/public.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -607,6 +607,9 @@ export interface DocLinksSetup {
readonly ELASTIC_WEBSITE_URL: string;
// (undocumented)
readonly links: {
readonly dashboard: {
readonly drilldowns: string;
};
readonly filebeat: {
readonly base: string;
readonly installation: string;
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" external>
{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)

0 comments on commit c822d9e

Please sign in to comment.