Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Commit

Permalink
remove overflowY from modal; fix feature breakdown tab (#84)
Browse files Browse the repository at this point in the history
  • Loading branch information
ylwu-amzn authored May 1, 2020
1 parent 574c720 commit a900e2e
Show file tree
Hide file tree
Showing 6 changed files with 61 additions and 39 deletions.
1 change: 1 addition & 0 deletions public/app.scss
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@
@import 'pages/DetectorConfig/index.scss';
@import 'pages/AnomalyCharts/index.scss';
@import 'pages/DetectorResults/index.scss';
@import 'pages/DetectorDetail/index.scss';
4 changes: 4 additions & 0 deletions public/pages/AnomalyCharts/containers/AnomaliesChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ interface AnomaliesChartProps {
detectorInterval?: number;
unit?: string;
monitor?: Monitor;
children: React.ReactNode | React.ReactNode[];
}
export const AnomaliesChart = React.memo((props: AnomaliesChartProps) => {
const dispatch = useDispatch();
Expand Down Expand Up @@ -405,6 +406,9 @@ export const AnomaliesChart = React.memo((props: AnomaliesChartProps) => {
</EuiFlexItem>
</EuiFlexGroup>
</EuiFlexGroup>
<div style={{ paddingTop: '10px', margin: '0px -20px -30px -20px'}}>
{props.children}
</div>
</ContentPanel>

{showAlertsFlyout ? (
Expand Down
4 changes: 2 additions & 2 deletions public/pages/AnomalyCharts/containers/FeatureBreakDown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@ export const FeatureBreakDown = React.memo((props: FeatureBreakDownProps) => {
<EuiTitle size="s" className="preview-title">
<h4>{props.title}</h4>
</EuiTitle>
<EuiSpacer size="s" />
</EuiFlexItem>
</EuiFlexGroup>
) : null}

<EuiSpacer size="s" />
{get(props, 'detector.featureAttributes', []).map(
(feature: FeatureAttributes, index: number) => (
<React.Fragment key={`${feature.featureName}-${feature.featureId}`}>
Expand Down Expand Up @@ -98,7 +98,7 @@ export const FeatureBreakDown = React.memo((props: FeatureBreakDownProps) => {
focusOnFeatureAccordion(index);
}}
/>
<EuiSpacer />
<EuiSpacer size='m'/>
</React.Fragment>
)
)}
Expand Down
2 changes: 1 addition & 1 deletion public/pages/AnomalyCharts/index.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
* Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
Expand Down
18 changes: 18 additions & 0 deletions public/pages/DetectorDetail/index.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/*
* Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/

.euiModalBody__overflow {
overflow-y: hidden !important;
}
71 changes: 35 additions & 36 deletions public/pages/DetectorResults/containers/AnomalyHistory.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import React, { useState, useEffect, useCallback, Fragment } from 'react';
import {
EuiFlexItem,
EuiFlexGroup,
EuiSpacer,
EuiTabs,
EuiTab,
EuiLoadingSpinner,
Expand Down Expand Up @@ -161,42 +160,42 @@ export const AnomalyHistory = (props: AnomalyHistoryProps) => {
)}
unit={get(props.detector, 'detectionInterval.period.unit')}
monitor={props.monitor}
/>
<EuiTabs>{renderTabs()}</EuiTabs>
<EuiSpacer />
>
<EuiTabs>{renderTabs()}</EuiTabs>

{isLoading ? (
<EuiFlexGroup
justifyContent="spaceAround"
style={{ height: '200px', paddingTop: '100px' }}
>
<EuiFlexItem grow={false}>
<EuiLoadingSpinner size="xl" />
</EuiFlexItem>
</EuiFlexGroup>
) : (
<Fragment>
{selectedTabId === 'featureBreakdown' ? (
<FeatureBreakDown
detector={props.detector}
// @ts-ignore
anomaliesResult={anomalyResults}
annotations={annotations}
isLoading={isLoading}
dateRange={zoomRange}
featureDataSeriesName="Feature output"
/>
) : (
<AnomalyResultsTable
anomalies={filterWithDateRange(
anomalyResults.anomalies,
zoomRange,
'plotTime'
)}
/>
)}
</Fragment>
)}
{isLoading ? (
<EuiFlexGroup
justifyContent="spaceAround"
style={{ height: '200px', paddingTop: '100px' }}
>
<EuiFlexItem grow={false}>
<EuiLoadingSpinner size="xl" />
</EuiFlexItem>
</EuiFlexGroup>
) : (
<div style={{ padding: '20px', backgroundColor: '#F7F7F7' }}>
{selectedTabId === 'featureBreakdown' ? (
<FeatureBreakDown
detector={props.detector}
// @ts-ignore
anomaliesResult={anomalyResults}
annotations={annotations}
isLoading={isLoading}
dateRange={zoomRange}
featureDataSeriesName="Feature output"
/>
) : (
<AnomalyResultsTable
anomalies={filterWithDateRange(
anomalyResults.anomalies,
zoomRange,
'plotTime'
)}
/>
)}
</div>
)}
</AnomaliesChart>
</Fragment>
);
};

0 comments on commit a900e2e

Please sign in to comment.