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

[APM] Removes action menus #24748

Merged
merged 2 commits into from
Oct 30, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,23 @@ interface ActionMenuState {
readonly isOpen: boolean;
}

export const DiscoverTransactionLink: React.SFC<ActionMenuProps> = ({
transaction,
children
}) => {
return (
<KibanaLink
pathname="/app/kibana"
hash="/discover"
query={getDiscoverQuery(
transaction.transaction.id,
transaction.version === 'v2' ? transaction.trace.id : undefined
)}
children={children}
/>
);
};

export class ActionMenu extends React.Component<
ActionMenuProps,
ActionMenuState
Expand Down Expand Up @@ -114,16 +131,9 @@ export class ActionMenu extends React.Component<

const items = [
<EuiContextMenuItem icon="discoverApp" key="discover-transaction">
<KibanaLink
pathname="/app/kibana"
hash="/discover"
query={getDiscoverQuery(
transaction.transaction.id,
transaction.version === 'v2' ? transaction.trace.id : undefined
)}
>
<DiscoverTransactionLink transaction={transaction}>
View sample document
</KibanaLink>
</DiscoverTransactionLink>
</EuiContextMenuItem>,
...this.getInfraActions(transaction)
];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
*/

import {
EuiButton,
EuiFlexGroup,
EuiFlexItem,
EuiFlyout,
Expand All @@ -17,7 +18,7 @@ import {
import React from 'react';
import { IUrlParams } from 'x-pack/plugins/apm/public/store/urlParams';
import { Transaction } from 'x-pack/plugins/apm/typings/Transaction';
import { ActionMenu } from '../../../ActionMenu';
import { DiscoverTransactionLink } from '../../../ActionMenu';
import { StickyTransactionProperties } from '../../../StickyTransactionProperties';
import { TransactionPropertiesTableForFlyout } from '../../../TransactionPropertiesTableForFlyout';
import { FlyoutTopLevelProperties } from '../FlyoutTopLevelProperties';
Expand Down Expand Up @@ -54,7 +55,11 @@ export function TransactionFlyout({
</EuiFlexItem>

<EuiFlexItem grow={false}>
<ActionMenu transaction={transactionDoc} />
<DiscoverTransactionLink transaction={transactionDoc}>
<EuiButton iconType="discoverApp">
View transaction in Discover
</EuiButton>
</DiscoverTransactionLink>
</EuiFlexItem>
</EuiFlexGroup>
</EuiFlyoutHeader>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import { Transaction as ITransaction } from '../../../../../typings/Transaction'
import { IUrlParams } from '../../../../store/urlParams';
import EmptyMessage from '../../../shared/EmptyMessage';
import { TransactionLink } from '../../../shared/TransactionLink';
import { ActionMenu } from './ActionMenu';
import { DiscoverTransactionLink } from './ActionMenu';
import { StickyTransactionProperties } from './StickyTransactionProperties';
// @ts-ignore
import { TransactionPropertiesTable } from './TransactionPropertiesTable';
Expand Down Expand Up @@ -89,7 +89,11 @@ export const Transaction: React.SFC<Props> = ({
<EuiFlexItem>
<EuiFlexGroup justifyContent="flexEnd">
<EuiFlexItem grow={false}>
<ActionMenu transaction={transaction} />
<DiscoverTransactionLink transaction={transaction}>
<EuiButton iconType="discoverApp">
View transaction in Discover
</EuiButton>
</DiscoverTransactionLink>
</EuiFlexItem>
<MaybeViewTraceLink transaction={transaction} root={root} />
</EuiFlexGroup>
Expand Down