Skip to content

Commit

Permalink
Make promotion behave the same as alias button (elastic#54608) (elast…
Browse files Browse the repository at this point in the history
…ic#54704)

Co-authored-by: Elastic Machine <[email protected]>

Co-authored-by: Elastic Machine <[email protected]>
  • Loading branch information
Tim Roes and elasticmachine authored Jan 14, 2020
1 parent 428fba3 commit 830e8c8
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ describe('NewVisHelp', () => {
stage: 'production',
},
]}
addBasePath={(url: string) => `testbasepath${url}`}
onPromotionClicked={() => {}}
/>
)
).toMatchInlineSnapshot(`
Expand All @@ -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!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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>
)}
Expand Down

0 comments on commit 830e8c8

Please sign in to comment.