Skip to content

Commit

Permalink
[Feature Anywhere] Various bug fixes (#4245)
Browse files Browse the repository at this point in the history
Signed-off-by: Tyler Ohlsen <[email protected]>
  • Loading branch information
ohltyler authored Jun 5, 2023
1 parent 6eda3ef commit b05c633
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@

import { i18n } from '@osd/i18n';
import { EuiIconType } from '@elastic/eui/src/components/icon/icon';
import { get } from 'lodash';
import { CoreStart } from 'opensearch-dashboards/public';
import { get, isEmpty } from 'lodash';
import { VisualizeEmbeddable } from '../../../../visualizations/public';
import { EmbeddableContext } from '../../../../embeddable/public';
import { Action, IncompatibleActionError } from '../../../../ui_actions/public';
Expand All @@ -24,7 +23,7 @@ export class ViewEventsOptionAction implements Action<EmbeddableContext> {
constructor() {}

public getIconType(): EuiIconType {
return 'apmTrace';
return 'inspect';
}

public getDisplayName() {
Expand All @@ -35,7 +34,11 @@ export class ViewEventsOptionAction implements Action<EmbeddableContext> {

public async isCompatible({ embeddable }: EmbeddableContext) {
const vis = (embeddable as VisualizeEmbeddable).vis;
return vis !== undefined && isEligibleForVisLayers(vis);
return (
vis !== undefined &&
isEligibleForVisLayers(vis) &&
!isEmpty((embeddable as VisualizeEmbeddable).visLayers)
);
}

public async execute({ embeddable }: EmbeddableContext) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ export function EventVisItem(props: Props) {
>
<EuiFlexGroup alignItems="center">
<EuiFlexItem>
<EuiLink href={`${baseUrl.prepend(`${urlPath}`)}`}>{name}</EuiLink>
<EuiLink href={`${baseUrl.prepend(`${urlPath}`)}`} target="_blank">
{name}
</EuiLink>
</EuiFlexItem>
<EventVisItemIcon visLayer={props.item.visLayer} />
</EuiFlexGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
$vis-description-width: 150px;
$vis-description-width: 200px;
$event-vis-height: 55px;
$timeline-panel-height: 100px;
$content-padding-top: 110px; // Padding needed within view events flyout content to sit comfortably below flyout header
Expand All @@ -22,6 +22,7 @@ $base-vis-min-height: 25vh; // Visualizations require the container to have a va
&__visDescription {
min-width: $vis-description-width;
max-width: $vis-description-width;
word-break: break-word;
}

&__content {
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/vis_augmenter/server/capabilities_provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

export const capabilitiesProvider = () => ({
visAugmenter: {
show: true,
show: false,
delete: true,
save: true,
saveQuery: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export const augmentVisSavedObjectType: SavedObjectsType = {
management: {
importableAndExportable: true,
getTitle(obj) {
return obj.attributes.title;
return `augment-vis-${obj?.attributes?.originPlugin}`;
},
getEditUrl(obj) {
return `/management/opensearch-dashboards/objects/savedAugmentVis/${encodeURIComponent(
Expand Down

0 comments on commit b05c633

Please sign in to comment.