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

Commit

Permalink
fix detector configuration page style based on UX review comments (#66)
Browse files Browse the repository at this point in the history
  • Loading branch information
ylwu-amzn authored Apr 30, 2020
1 parent 5a0b940 commit 9cdd2e1
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 44 deletions.
34 changes: 16 additions & 18 deletions public/pages/DetectorConfig/containers/DetectorConfig.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,23 +29,21 @@ interface DetectorConfigProps extends RouteComponentProps {

export const DetectorConfig = (props: DetectorConfigProps) => {
return (
<div>
<EuiPage>
<EuiPageBody>
<EuiSpacer size="l" />
<MetaData
detectorId={props.detectorId}
detector={props.detector}
onEditDetector={props.onEditDetector}
/>
<EuiSpacer />
<Features
detectorId={props.detectorId}
detector={props.detector}
onEditFeatures={props.onEditFeatures}
/>
</EuiPageBody>
</EuiPage>
</div>
<EuiPage style={{ marginTop: '16px', paddingTop: '0px' }}>
<EuiPageBody>
<EuiSpacer size="l" />
<MetaData
detectorId={props.detectorId}
detector={props.detector}
onEditDetector={props.onEditDetector}
/>
<EuiSpacer />
<Features
detectorId={props.detectorId}
detector={props.detector}
onEditFeatures={props.onEditFeatures}
/>
</EuiPageBody>
</EuiPage>
);
};
33 changes: 15 additions & 18 deletions public/pages/DetectorConfig/containers/Features.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export class Features extends Component<FeaturesProps, FeaturesState> {
() => false
),
sortField: 'name',
sortDirection: 'desc',
sortDirection: 'asc',
};
}

Expand Down Expand Up @@ -175,7 +175,6 @@ export class Features extends Component<FeaturesProps, FeaturesState> {

const getCellProps = () => {
return {
className: 'featureText',
textOnly: true,
};
};
Expand All @@ -187,27 +186,25 @@ export class Features extends Component<FeaturesProps, FeaturesState> {
title={`Features (${featureNum})`}
titleSize="s"
subTitle={
<EuiText style={{ padding: '0px 10px' }} className="fieldsSubtitle">
Specify index fields that you want to find anomalies for by defining
features. A detector can discover anomalies across up to 5 features.
Once you define the features, you can preview your anomalies from a
sample feature output.{' '}
<EuiLink
href="https://opendistro.github.io/for-elasticsearch-docs/docs/ad/"
target="_blank"
>
Learn more &nbsp;
<EuiIcon size="s" type="popout" />
</EuiLink>
<EuiText className="anomaly-distribution-subtitle">
<p>
Specify index fields that you want to find anomalies for by
defining features. A detector can discover anomalies for up to 5
features. Once you define the features, you can preview your
anomalies from a sample feature output.{' '}
<EuiLink
href="https://opendistro.github.io/for-elasticsearch-docs/docs/ad/"
target="_blank"
>
Learn more &nbsp;
<EuiIcon size="s" type="popout" />
</EuiLink>
</p>
</EuiText>
}
actions={[
<EuiButton onClick={this.props.onEditFeatures}>Edit</EuiButton>,
]}
panelStyles={{
left: '10px',
width: '1120px',
}}
>
{featureNum == 0 ? (
<EuiEmptyPrompt
Expand Down
9 changes: 2 additions & 7 deletions public/pages/DetectorConfig/containers/MetaData.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ import {
import React, { Component, FunctionComponent } from 'react';
import { displayText } from '../../createDetector/components/DataFilters/utils/helpers';
import { CodeModal } from '../components/CodeModal/CodeModal';
import { renderTime } from '../../DetectorResults/utils/tableUtils';
import { render } from 'enzyme';
import moment from 'moment';

interface MetaDataProps {
detectorId: string;
Expand Down Expand Up @@ -73,7 +72,7 @@ export function toString(obj: any): string {
return period.interval + ' ' + period.unit;
} else if (typeof obj == 'number') {
// epoch
return renderTime(obj);
return moment(obj).format('MM/DD/YY hh:mm A');
}
}
return '-';
Expand Down Expand Up @@ -189,10 +188,6 @@ export const MetaData = (props: MetaDataProps) => {
title="Detector configuration"
titleSize="s"
actions={[<EuiButton onClick={props.onEditDetector}>Edit</EuiButton>]}
panelStyles={{
left: '10px',
width: '1120px',
}}
>
<EuiFlexGrid columns={4} gutterSize="l" style={{ border: 'none' }}>
<EuiFlexItem>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,17 @@ exports[`<DetectorDetail /> spec detector detail renders detector detail compone
</div>
</div>
</div>
<div />
<div
class="euiPage"
style="margin-top: 16px; padding-top: 0px;"
>
<div
class="euiPageBody"
>
<div
class="euiSpacer euiSpacer--l"
/>
</div>
</div>
</div>
`;

0 comments on commit 9cdd2e1

Please sign in to comment.