Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
7 changes: 5 additions & 2 deletions opensearch_dashboards.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,15 @@
"opensearchDashboardsVersion": "3.0.0",
"configPath": ["anomaly_detection_dashboards"],
"requiredPlugins": [
"navigation",
"uiActions",
"dashboard",
"embeddable",
"opensearchDashboardsReact",
"savedObjects"
"savedObjects",
"visAugmenter",
"opensearchDashboardsUtils",
"data",
"expressions"
],
"optionalPlugins": [],
"server": true,
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@
"babel-polyfill": "^6.26.0",
"eslint-plugin-no-unsanitized": "^3.0.2",
"eslint-plugin-prefer-object-spread": "^1.2.1",
"lint-staged": "^9.2.0",
"lint-staged": "^10.0.0",
"moment": "^2.24.0",
"redux-mock-store": "^1.5.3",
"start-server-and-test": "^1.11.7"
},
"dependencies": {
"babel-polyfill": "^6.26.0",
"brace": "0.11.1",
"formik": "^2.2.5",
"formik": "^2.2.6",
"plotly.js-dist": "^1.57.1",
"prettier": "^2.1.1",
"react-plotly.js": "^2.4.0",
Expand Down
2 changes: 1 addition & 1 deletion public/action/ad_dashboard_action.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,4 @@ export const createADAction = ({

onClick({ embeddable });
},
});
});
91 changes: 0 additions & 91 deletions public/components/ContextMenu/CreateAnomalyDetector/index.tsx

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/

import React, { useState } from 'react';
import {
EuiText,
EuiOverlayMask,
EuiButton,
EuiButtonEmpty,
EuiModal,
EuiModalHeader,
EuiModalFooter,
EuiModalBody,
EuiModalHeaderTitle,
} from '@elastic/eui';
import { DetectorListItem } from '../../../../../models/interfaces';
import { EuiSpacer } from '@elastic/eui';

interface ConfirmUnlinkDetectorModalProps {
detector: DetectorListItem;
onUnlinkDetector(): void;
onHide(): void;
onConfirm(): void;
isListLoading: boolean;
}

export const ConfirmUnlinkDetectorModal = (
props: ConfirmUnlinkDetectorModalProps
) => {
const [isModalLoading, setIsModalLoading] = useState<boolean>(false);
const isLoading = isModalLoading || props.isListLoading;
return (
<EuiOverlayMask>
<EuiModal
data-test-subj="startDetectorsModal"
onClose={props.onHide}
maxWidth={450}
>
<EuiModalHeader>
<EuiModalHeaderTitle>
{'Remove association?'}&nbsp;
</EuiModalHeaderTitle>
</EuiModalHeader>
<EuiModalBody>
<EuiText>
Removing association unlinks {props.detector.name} detector from the
visualization but does not delete it. The detector association can
be restored.
</EuiText>
<EuiSpacer size="s" />
</EuiModalBody>
<EuiModalFooter>
{isLoading ? null : (
<EuiButtonEmpty
data-test-subj="cancelButton"
onClick={props.onHide}
>
Cancel
</EuiButtonEmpty>
)}
<EuiButton
data-test-subj="confirmButton"
color="primary"
fill
isLoading={isLoading}
onClick={async () => {
setIsModalLoading(true);
props.onUnlinkDetector();
props.onConfirm();
}}
>
{'Remove association'}
</EuiButton>
</EuiModalFooter>
</EuiModal>
</EuiOverlayMask>
);
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/

import { EuiEmptyPrompt, EuiText } from '@elastic/eui';
import React from 'react';

const FILTER_TEXT = 'There are no detectors matching your search';

interface EmptyDetectorProps {
isFilterApplied: boolean;
embeddableTitle: string;
}

export const EmptyAssociatedDetectorFlyoutMessage = (
props: EmptyDetectorProps
) => (
<EuiEmptyPrompt
title={<h3>No anomaly detectors to display</h3>}
titleSize="s"
data-test-subj="emptyAssociatedDetectorFlyoutMessage"
style={{ maxWidth: '45em' }}
body={
<EuiText>
<p>
{props.isFilterApplied
? FILTER_TEXT
: `There are no anomaly detectors associated with ${props.embeddableTitle} visualization.`}
</p>
</EuiText>
}
/>
);
Loading