Skip to content

Commit

Permalink
Merge branch 'main' into re-direction-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
sumukhswamy authored Oct 19, 2024
2 parents 0b00ea0 + 6edd8ef commit 72f5946
Show file tree
Hide file tree
Showing 36 changed files with 2,351 additions and 969 deletions.
3 changes: 1 addition & 2 deletions common/constants/overview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,5 @@
* SPDX-License-Identifier: Apache-2.0
*/

export const alertsPluginID = 'alerting';
export const anomalyPluginID = 'anomalyDetection';
export const observabilityDashboardsKey = 'observability:defaultDashboard';
export const observabilityShowCardsKey = 'observability:overviewCardsDisplay';
2 changes: 1 addition & 1 deletion common/constants/shared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ export const DEFAULT_CHART_STYLES: DefaultChartStylesProps = {
MarkerSize: 25,
ShowLegend: 'show',
LegendPosition: 'v',
LabelAngle: 0,
LabelAngle: -45,
DefaultSortSectors: 'largest_to_smallest',
DefaultModeScatter: 'markers',
};
Expand Down
2 changes: 2 additions & 0 deletions common/utils/core_services.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
SavedObjectsClientContract,
ToastInput,
} from '../../../../src/core/public';
import { Page } from '../../../../src/plugins/content_management/public';
import { createGetterSetter } from '../../../../src/plugins/opensearch_dashboards_utils/common';
import PPLService from '../../public/services/requests/ppl';
import { QueryManager } from '../query_manager';
Expand Down Expand Up @@ -39,3 +40,4 @@ export const [getOSDSavedObjectsClient, setOSDSavedObjectsClient] = createGetter
SavedObjectsClientContract
>('SavedObjectsClient');
export const [getQueryManager, setQueryManager] = createGetterSetter<QueryManager>('QueryManager');
export const [getOverviewPage, setOverviewPage] = createGetterSetter<Page>('Page');
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ exports[`Utils helper functions renders displayVisualization function 1`] = `
},
Object {
"component": [Function],
"defaultState": 0,
"defaultState": -45,
"eleType": "slider",
"mapTo": "rotateBarLabels",
"name": "Rotate bar labels",
Expand Down Expand Up @@ -419,7 +419,7 @@ exports[`Utils helper functions renders displayVisualization function 1`] = `
"icontype": "visBarVerticalStacked",
"id": "bar",
"label": "Vertical bar",
"labelangle": 0,
"labelangle": -45,
"legendposition": "v",
"linewidth": 0,
"mode": "group",
Expand Down Expand Up @@ -775,7 +775,7 @@ exports[`Utils helper functions renders displayVisualization function 1`] = `
},
Object {
"component": [Function],
"defaultState": 0,
"defaultState": -45,
"eleType": "slider",
"mapTo": "rotateBarLabels",
"name": "Rotate bar labels",
Expand Down Expand Up @@ -874,7 +874,7 @@ exports[`Utils helper functions renders displayVisualization function 1`] = `
"icontype": "visBarVerticalStacked",
"id": "bar",
"label": "Vertical bar",
"labelangle": 0,
"labelangle": -45,
"legendposition": "v",
"linewidth": 0,
"mode": "group",
Expand Down Expand Up @@ -1253,7 +1253,7 @@ exports[`Utils helper functions renders displayVisualization function 1`] = `
},
Object {
"component": [Function],
"defaultState": 0,
"defaultState": -45,
"eleType": "slider",
"mapTo": "rotateBarLabels",
"name": "Rotate bar labels",
Expand Down Expand Up @@ -1352,7 +1352,7 @@ exports[`Utils helper functions renders displayVisualization function 1`] = `
"icontype": "visBarVerticalStacked",
"id": "bar",
"label": "Vertical bar",
"labelangle": 0,
"labelangle": -45,
"legendposition": "v",
"linewidth": 0,
"mode": "group",
Expand Down Expand Up @@ -1467,7 +1467,7 @@ exports[`Utils helper functions renders displayVisualization function 1`] = `
"title": "",
"xaxis": Object {
"automargin": true,
"tickangle": 0,
"tickangle": -45,
"tickfont": Object {
"size": 12,
},
Expand Down Expand Up @@ -1570,7 +1570,7 @@ exports[`Utils helper functions renders displayVisualization function 1`] = `
"title": "",
"xaxis": Object {
"automargin": true,
"tickangle": 0,
"tickangle": -45,
"tickfont": Object {
"size": 12,
},
Expand Down Expand Up @@ -2008,7 +2008,7 @@ exports[`Utils helper functions renders displayVisualization function 2`] = `
},
Object {
"component": [Function],
"defaultState": 0,
"defaultState": -45,
"eleType": "slider",
"mapTo": "rotateLabels",
"name": "Rotate labels",
Expand Down Expand Up @@ -2524,7 +2524,7 @@ exports[`Utils helper functions renders displayVisualization function 2`] = `
},
Object {
"component": [Function],
"defaultState": 0,
"defaultState": -45,
"eleType": "slider",
"mapTo": "rotateLabels",
"name": "Rotate labels",
Expand Down Expand Up @@ -3094,7 +3094,7 @@ exports[`Utils helper functions renders displayVisualization function 2`] = `
},
Object {
"component": [Function],
"defaultState": 0,
"defaultState": -45,
"eleType": "slider",
"mapTo": "rotateLabels",
"name": "Rotate labels",
Expand Down Expand Up @@ -3304,7 +3304,7 @@ exports[`Utils helper functions renders displayVisualization function 2`] = `
"title": "",
"xaxis": Object {
"automargin": true,
"tickangle": 0,
"tickangle": -45,
"tickfont": Object {},
},
"yaxis": Object {
Expand Down Expand Up @@ -3419,7 +3419,7 @@ exports[`Utils helper functions renders displayVisualization function 2`] = `
"title": "",
"xaxis": Object {
"automargin": true,
"tickangle": 0,
"tickangle": -45,
"tickfont": Object {},
},
"yaxis": Object {
Expand Down Expand Up @@ -3773,7 +3773,7 @@ exports[`Utils helper functions renders displayVisualization function 3`] = `
},
Object {
"component": [Function],
"defaultState": 0,
"defaultState": -45,
"eleType": "slider",
"mapTo": "rotateBarLabels",
"name": "Rotate bar labels",
Expand Down Expand Up @@ -3872,7 +3872,7 @@ exports[`Utils helper functions renders displayVisualization function 3`] = `
"icontype": "visBarHorizontalStacked",
"id": "horizontal_bar",
"label": "Horizontal bar",
"labelangle": 0,
"labelangle": -45,
"legendposition": "v",
"linewidth": 0,
"mode": "group",
Expand Down Expand Up @@ -4228,7 +4228,7 @@ exports[`Utils helper functions renders displayVisualization function 3`] = `
},
Object {
"component": [Function],
"defaultState": 0,
"defaultState": -45,
"eleType": "slider",
"mapTo": "rotateBarLabels",
"name": "Rotate bar labels",
Expand Down Expand Up @@ -4327,7 +4327,7 @@ exports[`Utils helper functions renders displayVisualization function 3`] = `
"icontype": "visBarHorizontalStacked",
"id": "horizontal_bar",
"label": "Horizontal bar",
"labelangle": 0,
"labelangle": -45,
"legendposition": "v",
"linewidth": 0,
"mode": "group",
Expand Down Expand Up @@ -4706,7 +4706,7 @@ exports[`Utils helper functions renders displayVisualization function 3`] = `
},
Object {
"component": [Function],
"defaultState": 0,
"defaultState": -45,
"eleType": "slider",
"mapTo": "rotateBarLabels",
"name": "Rotate bar labels",
Expand Down Expand Up @@ -4805,7 +4805,7 @@ exports[`Utils helper functions renders displayVisualization function 3`] = `
"icontype": "visBarHorizontalStacked",
"id": "horizontal_bar",
"label": "Horizontal bar",
"labelangle": 0,
"labelangle": -45,
"legendposition": "v",
"linewidth": 0,
"mode": "group",
Expand Down Expand Up @@ -4926,7 +4926,7 @@ exports[`Utils helper functions renders displayVisualization function 3`] = `
},
"yaxis": Object {
"automargin": true,
"tickangle": 0,
"tickangle": -45,
"tickfont": Object {
"size": 12,
},
Expand Down Expand Up @@ -5029,7 +5029,7 @@ exports[`Utils helper functions renders displayVisualization function 3`] = `
},
"yaxis": Object {
"automargin": true,
"tickangle": 0,
"tickangle": -45,
"tickfont": Object {
"size": 12,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,48 +94,6 @@ exports[`Visualization Container Component renders add visualization container 1
</EuiText>
</div>
</EuiFlexItem>
<EuiFlexItem
className="visualization-action-button"
grow={false}
>
<div
className="euiFlexItem euiFlexItem--flexGrowZero visualization-action-button"
>
<EuiIcon
data-test-subj="removeVisualizationButton"
onClick={[Function]}
type="crossInACircleFilled"
>
<EuiIconBeaker
aria-hidden={true}
className="euiIcon euiIcon--medium euiIcon-isLoading"
data-test-subj="removeVisualizationButton"
focusable="false"
onClick={[Function]}
role="img"
style={null}
>
<svg
aria-hidden={true}
className="euiIcon euiIcon--medium euiIcon-isLoading"
data-test-subj="removeVisualizationButton"
focusable="false"
height={16}
onClick={[Function]}
role="img"
style={null}
viewBox="0 0 16 16"
width={16}
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M5.277 10.088c.02.014.04.03.057.047.582.55 1.134.812 1.666.812.586 0 1.84-.293 3.713-.88L9 6.212V2H7v4.212l-1.723 3.876Zm-.438.987L3.539 14h8.922l-1.32-2.969C9.096 11.677 7.733 12 7 12c-.74 0-1.463-.315-2.161-.925ZM6 2H5V1h6v1h-1v4l3.375 7.594A1 1 0 0 1 12.461 15H3.54a1 1 0 0 1-.914-1.406L6 6V2Z"
/>
</svg>
</EuiIconBeaker>
</EuiIcon>
</div>
</EuiFlexItem>
</div>
</EuiFlexGroup>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@

import {
EuiSmallButton,
EuiSmallButtonIcon,
EuiCodeBlock,
EuiContextMenuItem,
EuiContextMenuPanel,
EuiFlexGroup,
EuiFlexItem,
EuiIcon,
Expand All @@ -19,7 +17,6 @@ import {
EuiModalHeader,
EuiModalHeaderTitle,
EuiPanel,
EuiPopover,
EuiSpacer,
EuiText,
EuiToolTip,
Expand Down Expand Up @@ -103,7 +100,6 @@ export const VisualizationContainer = ({
onEditClick,
cloneVisualization,
showFlyout,
removeVisualization,
catalogVisualization,
inlineEditor,
actionMenuType,
Expand All @@ -116,7 +112,6 @@ export const VisualizationContainer = ({
const [visualizationData, setVisualizationData] = useState<Plotly.Data[]>([]);
const [isLoading, setIsLoading] = useState(true);
const [isError, setIsError] = useState({} as VizContainerError);
const onActionsMenuClick = () => setIsPopoverOpen((currPopoverOpen) => !currPopoverOpen);
const closeActionsMenu = () => setIsPopoverOpen(false);
const { http, pplService } = coreRefs;
const { setToast } = useToast();
Expand Down Expand Up @@ -373,37 +368,6 @@ export const VisualizationContainer = ({
</EuiToolTip>
</EuiText>
</EuiFlexItem>
<EuiFlexItem grow={false} className="visualization-action-button">
{editMode ? (
<EuiIcon
data-test-subj="removeVisualizationButton"
type="crossInACircleFilled"
onClick={() => {
removeVisualization(visualizationId);
}}
/>
) : (
<EuiPopover
button={
<EuiSmallButtonIcon
aria-label="actionMenuButton"
iconType="boxesHorizontal"
onClick={onActionsMenuClick}
/>
}
isOpen={isPopoverOpen}
closePopover={closeActionsMenu}
anchorPosition="downLeft"
panelPaddingSize="none"
>
<EuiContextMenuPanel
items={popoverPanel}
data-test-subj="panelViz__popoverPanel"
size="s"
/>
</EuiPopover>
)}
</EuiFlexItem>
</EuiFlexGroup>
{inlineEditor}
</div>
Expand Down
Loading

0 comments on commit 72f5946

Please sign in to comment.