Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com> Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
This commit is contained in:
parent
428fba3a32
commit
830e8c8923
|
@ -1594,7 +1594,7 @@ exports[`NewVisModal filter for visualization types should render as expected 1`
|
|||
/>
|
||||
</EuiSpacer>
|
||||
<NewVisHelp
|
||||
addBasePath={[Function]}
|
||||
onPromotionClicked={[Function]}
|
||||
promotedTypes={Array []}
|
||||
>
|
||||
<EuiText>
|
||||
|
@ -3218,7 +3218,7 @@ exports[`NewVisModal should render as expected 1`] = `
|
|||
/>
|
||||
</EuiSpacer>
|
||||
<NewVisHelp
|
||||
addBasePath={[Function]}
|
||||
onPromotionClicked={[Function]}
|
||||
promotedTypes={Array []}
|
||||
>
|
||||
<EuiText>
|
||||
|
|
|
@ -41,7 +41,7 @@ describe('NewVisHelp', () => {
|
|||
stage: 'production',
|
||||
},
|
||||
]}
|
||||
addBasePath={(url: string) => `testbasepath${url}`}
|
||||
onPromotionClicked={() => {}}
|
||||
/>
|
||||
)
|
||||
).toMatchInlineSnapshot(`
|
||||
|
@ -60,9 +60,9 @@ describe('NewVisHelp', () => {
|
|||
</p>
|
||||
<EuiButton
|
||||
fill={true}
|
||||
href="testbasepath/my/fancy/new/thing"
|
||||
iconSide="right"
|
||||
iconType="popout"
|
||||
onClick={[Function]}
|
||||
size="s"
|
||||
>
|
||||
Do it now!
|
||||
|
|
|
@ -21,10 +21,11 @@ import { FormattedMessage } from '@kbn/i18n/react';
|
|||
import React, { Fragment } from 'react';
|
||||
import { EuiText, EuiButton } from '@elastic/eui';
|
||||
import { VisTypeAliasListEntry } from './type_selection';
|
||||
import { VisTypeAlias } from '../../../../../../visualizations/public';
|
||||
|
||||
interface Props {
|
||||
promotedTypes: VisTypeAliasListEntry[];
|
||||
addBasePath: (path: string) => string;
|
||||
onPromotionClicked: (visType: VisTypeAlias) => void;
|
||||
}
|
||||
|
||||
export function NewVisHelp(props: Props) {
|
||||
|
@ -42,7 +43,7 @@ export function NewVisHelp(props: Props) {
|
|||
<strong>{t.promotion!.description}</strong>
|
||||
</p>
|
||||
<EuiButton
|
||||
href={props.addBasePath(t.aliasUrl)}
|
||||
onClick={() => props.onPromotionClicked(t)}
|
||||
fill
|
||||
size="s"
|
||||
iconType="popout"
|
||||
|
|
|
@ -154,7 +154,7 @@ class TypeSelection extends React.Component<TypeSelectionProps, TypeSelectionSta
|
|||
<EuiSpacer size="m" />
|
||||
<NewVisHelp
|
||||
promotedTypes={(visTypes as VisTypeAliasListEntry[]).filter(t => t.promotion)}
|
||||
addBasePath={this.props.addBasePath}
|
||||
onPromotionClicked={this.props.onVisTypeSelected}
|
||||
/>
|
||||
</React.Fragment>
|
||||
)}
|
||||
|
|
Loading…
Reference in a new issue