Skip to content

Commit 84adb56

Browse files
opensearch-trigger-bot[bot]amsiglan
authored andcommitted
Made minor changes to polish the UI (opensearch-project#247) (opensearch-project#252)
* polished UI Signed-off-by: Amardeepsingh Siglani <[email protected]> * updated legend for alert severity Signed-off-by: Amardeepsingh Siglani <[email protected]> * updated cypress test Signed-off-by: Amardeepsingh Siglani <[email protected]> * use prepend prop for vis group by control Signed-off-by: Amardeepsingh Siglani <[email protected]> Signed-off-by: Amardeepsingh Siglani <[email protected]> (cherry picked from commit 30a5657) Co-authored-by: Amardeepsingh Siglani <[email protected]> Signed-off-by: AWSHurneyt <[email protected]>
1 parent 18a9a71 commit 84adb56

File tree

10 files changed

+25
-36
lines changed

10 files changed

+25
-36
lines changed

cypress/integration/1_detectors.spec.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ describe('Detectors', () => {
204204
cy.contains('test detector').click({ force: true });
205205

206206
// Confirm number of rules before edit
207-
cy.contains('Detection rules (1)');
207+
cy.contains('Active rules (1)');
208208

209209
// Click "Edit" button in Detector rules panel
210210
cy.get(`[data-test-subj="edit-detector-rules"]`).click({ force: true });
@@ -229,7 +229,7 @@ describe('Detectors', () => {
229229
cy.get(`[data-test-subj="save-detector-rules-edits"]`).click({ force: true });
230230

231231
// Confirm 1 rule has been removed from detector
232-
cy.contains('Detection rules (0)');
232+
cy.contains('Active rules (0)');
233233

234234
// Click "Edit" button in Detector rules panel
235235
cy.get(`[data-test-subj="edit-detector-rules"]`).click({ force: true });
@@ -253,7 +253,7 @@ describe('Detectors', () => {
253253
cy.get(`[data-test-subj="save-detector-rules-edits"]`).click({ force: true });
254254

255255
// Confirm 1 rule has been added to detector
256-
cy.contains('Detection rules (1)');
256+
cy.contains('Active rules (1)');
257257
});
258258

259259
it('...can be deleted', () => {

public/pages/Alerts/containers/Alerts/Alerts.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ import {
77
DurationRange,
88
EuiBasicTableColumn,
99
EuiButton,
10-
EuiButtonEmpty,
1110
EuiButtonIcon,
1211
EuiFlexGroup,
1312
EuiFlexItem,
1413
EuiInMemoryTable,
14+
EuiLink,
1515
EuiPanel,
1616
EuiSpacer,
1717
EuiSuperDatePicker,
@@ -34,7 +34,6 @@ import {
3434
DEFAULT_DATE_RANGE,
3535
DEFAULT_EMPTY_DATA,
3636
MAX_RECENTLY_USED_TIME_RANGES,
37-
ROUTES,
3837
} from '../../../../utils/constants';
3938
import { CoreServicesContext } from '../../../../components/core_services';
4039
import AlertsService from '../../../../services/AlertsService';
@@ -146,7 +145,7 @@ class Alerts extends Component<AlertsProps, AlertsState> {
146145
sortable: false,
147146
dataType: 'string',
148147
render: (triggerName: string, alertItem: AlertItem) => (
149-
<EuiButtonEmpty onClick={() => this.setFlyout(alertItem)}>{triggerName}</EuiButtonEmpty>
148+
<EuiLink onClick={() => this.setFlyout(alertItem)}>{triggerName}</EuiLink>
150149
),
151150
},
152151
{
@@ -224,7 +223,7 @@ class Alerts extends Component<AlertsProps, AlertsState> {
224223
alert: 1,
225224
time,
226225
status: alert.state,
227-
severity: alert.severity,
226+
severity: parseAlertSeverityToOption(alert.severity)?.label || alert.severity,
228227
};
229228
});
230229

public/pages/Detectors/components/DetectorRulesView/DetectorRulesView.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ export const DetectorRulesView: React.FC<DetectorRulesViewProps> = (props) => {
139139
{rules}
140140
</EuiAccordion>
141141
) : (
142-
<ContentPanel title={`Detection rules (${totalSelected})`} actions={actions}>
142+
<ContentPanel title={`Active rules (${totalSelected})`} actions={actions}>
143143
{rules}
144144
</ContentPanel>
145145
);

public/pages/Detectors/containers/Detectors/Detectors.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ export default class Detectors extends Component<DetectorsProps, DetectorsState>
277277
},
278278
{
279279
field: 'rulesCount',
280-
name: 'Rules',
280+
name: 'Active rules',
281281
sortable: true,
282282
dataType: 'number',
283283
align: 'left',

public/pages/Overview/components/GettingStarted/GetStartedStep.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ export const GetStartedStep: React.FC<GetStartedStepProps> = ({ buttons, title }
2626
</EuiText>
2727
<EuiSpacer size="s" />
2828
<EuiFlexGroup gutterSize="s">
29-
{buttons.map((btn: GetStartedStepButton) => (
30-
<EuiFlexItem grow={false}>
29+
{buttons.map((btn: GetStartedStepButton, index: number) => (
30+
<EuiFlexItem grow={false} key={index}>
3131
<EuiButton {...btn.opts} onClick={btn.onClick}>
3232
{btn.text}
3333
</EuiButton>

public/pages/Overview/components/GettingStarted/GettingStartedPopup.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,7 @@ export const GettingStartedPopup: React.FC<GettingStartedPopupProps> = ({
129129
<EuiHorizontalRule />
130130
<EuiText>
131131
<p>
132-
Security analytics generates critical security insights from existing security event
133-
logs.&nbsp;
132+
Generates critical security insights from your event logs.&nbsp;
134133
<EuiLink href={moreLink} target="_blank">
135134
Learn more
136135
</EuiLink>

public/pages/Overview/components/Widgets/RecentAlertsWidget.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,7 @@ export const RecentAlertsWidget: React.FC<RecentAlertsWidgetProps> = ({
6161
);
6262

6363
return (
64-
<WidgetContainer
65-
title={`Top ${alertItems.length < 20 ? '' : 20} recent alerts`}
66-
actions={actions}
67-
>
64+
<WidgetContainer title={'Recent alerts'} actions={actions}>
6865
<TableWidget columns={columns} items={alertItems} loading={loading} />
6966
</WidgetContainer>
7067
);

public/pages/Overview/components/Widgets/RecentFindingsWidget.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,7 @@ export const RecentFindingsWidget: React.FC<RecentFindingsWidgetProps> = ({
6666
);
6767

6868
return (
69-
<WidgetContainer
70-
title={`Top ${findingItems.length < 20 ? '' : 20} recent findings`}
71-
actions={actions}
72-
>
69+
<WidgetContainer title={'Recent findings'} actions={actions}>
7370
<TableWidget columns={columns} items={findingItems} loading={loading} />
7471
</WidgetContainer>
7572
);

public/pages/Overview/containers/Overview/Overview.tsx

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -125,23 +125,23 @@ export const Overview: React.FC<OverviewProps> = (props) => {
125125

126126
return (
127127
<EuiFlexGroup direction="column">
128-
<EuiFlexItem style={{ alignSelf: 'flex-end' }}>
129-
<EuiPopover
130-
button={button}
131-
isOpen={isPopoverOpen}
132-
anchorPosition="downRight"
133-
closePopover={closePopover}
134-
>
135-
<GettingStartedPopup dismissPopup={closePopover} history={props.history} />
136-
</EuiPopover>
137-
</EuiFlexItem>
138128
<EuiFlexItem>
139129
<EuiFlexGroup justifyContent="spaceBetween">
140-
<EuiFlexItem>
130+
<EuiFlexItem grow={false}>
141131
<EuiTitle size="m">
142132
<h1>Overview</h1>
143133
</EuiTitle>
144134
</EuiFlexItem>
135+
<EuiFlexItem>
136+
<EuiPopover
137+
button={button}
138+
isOpen={isPopoverOpen}
139+
anchorPosition="downRight"
140+
closePopover={closePopover}
141+
>
142+
<GettingStartedPopup dismissPopup={closePopover} history={props.history} />
143+
</EuiPopover>
144+
</EuiFlexItem>
145145
<EuiFlexItem grow={false}>
146146
<EuiSuperDatePicker
147147
start={startTime}

public/utils/helpers.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -181,10 +181,7 @@ export function createSelectComponent(
181181
return (
182182
<EuiFlexGroup justifyContent="flexEnd" alignItems="center">
183183
<EuiFlexItem grow={false}>
184-
<h5>Group by</h5>
185-
</EuiFlexItem>
186-
<EuiFlexItem grow={false}>
187-
<EuiSelect id={id} options={options} value={value} onChange={onChange} />
184+
<EuiSelect id={id} options={options} value={value} onChange={onChange} prepend="Group by" />
188185
</EuiFlexItem>
189186
</EuiFlexGroup>
190187
);

0 commit comments

Comments
 (0)