Skip to content

Commit

Permalink
Reverted unintended changes
Browse files Browse the repository at this point in the history
Signed-off-by: Dan Dong <danieldong51@gmail.com>
  • Loading branch information
danieldong51 committed Aug 9, 2024
1 parent 89441b5 commit adfda03
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ function AssociatedDetectors({ embeddable, closeFlyout, setMode }) {
const indexPattern = await getSavedObjectsClient().get('index-pattern', indexPatternId);
const refs = indexPattern.references as References[];
const foundDataSourceId = refs.find(ref => ref.type === 'data-source')?.id;
setDataSourceId(foundDataSourceId);
setDataSourceId(foundDataSourceId);
} catch (error) {
console.error("Error fetching index pattern:", error);
}
Expand Down Expand Up @@ -271,7 +271,7 @@ function AssociatedDetectors({ embeddable, closeFlyout, setMode }) {
getDetectorList(
getAllDetectorsQueryParamsWithDataSourceId(dataSourceId)
)
);
);
};

const handleUnlinkDetectorAction = (detector: DetectorListItem) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ function AddAnomalyDetector({
const indexPattern = await getSavedObjectsClient().get('index-pattern', indexPatternId);
const refs = indexPattern.references as References[];
const foundDataSourceId = refs.find(ref => ref.type === 'data-source')?.id;
setDataSourceId(foundDataSourceId);
setDataSourceId(foundDataSourceId);
} catch (error) {
console.error("Error fetching index pattern:", error);
}
Expand All @@ -167,7 +167,7 @@ function AddAnomalyDetector({
}
fetchData();
createEmbeddable();
}, [dataSourceId]);
}, [dataSourceId]);

const [isShowVis, setIsShowVis] = useState(false);
const [accordionsOpen, setAccordionsOpen] = useState({ modelFeatures: true });
Expand Down
6 changes: 3 additions & 3 deletions public/pages/Dashboard/Components/AnomaliesLiveChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -237,9 +237,9 @@ export const AnomaliesLiveChart = (props: AnomaliesLiveChartProps) => {
</h3>
</EuiTitle>
}
subTitle={`Live anomaly results across detectors for the last 30 minutes.
'The results refresh every 1 minute.
'For each detector, if an anomaly occurrence is detected at the end of the detector interval,
subTitle={`Live anomaly results across detectors for the last 30 minutes.
'The results refresh every 1 minute.
'For each detector, if an anomaly occurrence is detected at the end of the detector interval,
'you will see a bar representing its anomaly grade.`}
actions={[fullScreenButton()]}
contentPanelClassName={isFullScreen ? 'full-screen' : undefined}
Expand Down
2 changes: 1 addition & 1 deletion public/pages/DefineDetector/containers/DefineDetector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ export const DefineDetector = (props: DefineDetectorProps) => {
componentType={'DataSourceSelectable'}
componentConfig={{
fullWidth: false,
activeOption: MDSCreateState.selectedDataSourceId !== undefined
activeOption: MDSCreateState.selectedDataSourceId !== undefined
? [{ id: MDSCreateState.selectedDataSourceId }]
: undefined,
savedObjects: getSavedObjectsClient(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export const ListActions = (props: ListActionsProps) => {
onClick={props.onStartDetectors}
size="s"
>
Start real-time
Start real-time detectors
</EuiContextMenuItem>

<EuiContextMenuItem
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ import {
EuiTitle,
EuiLink,
EuiCard,
EuiHorizontalRule, EuiText,
EuiHorizontalRule,
EuiText,
} from '@elastic/eui';
import { PLUGIN_NAME } from '../../../../utils/constants';
import { useLocation } from 'react-router-dom';
Expand Down
8 changes: 4 additions & 4 deletions public/pages/Overview/containers/AnomalyDetectionOverview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,8 @@ export function AnomalyDetectionOverview(props: AnomalyDetectionOverviewProps) {
const queryParams = getDataSourceFromURL(props.location);
const [MDSOverviewState, setMDSOverviewState] = useState<MDSStates>({
queryParams,
selectedDataSourceId: queryParams.dataSourceId === undefined
? undefined
selectedDataSourceId: queryParams.dataSourceId === undefined
? undefined
: queryParams.dataSourceId,
});

Expand All @@ -129,7 +129,7 @@ export function AnomalyDetectionOverview(props: AnomalyDetectionOverviewProps) {
...location,
search: queryString.stringify(updatedParams),
});
}
}
fetchData();
}, [MDSOverviewState]);

Expand Down Expand Up @@ -249,7 +249,7 @@ export function AnomalyDetectionOverview(props: AnomalyDetectionOverviewProps) {
componentType={'DataSourceSelectable'}
componentConfig={{
fullWidth: false,
activeOption: props.landingDataSourceId === undefined
activeOption: props.landingDataSourceId === undefined
|| MDSOverviewState.selectedDataSourceId === undefined
? undefined
: [{ id: MDSOverviewState.selectedDataSourceId }],
Expand Down

0 comments on commit adfda03

Please sign in to comment.