Skip to content

Commit b10198b

Browse files
committed
Description for Groub By fields - #153
1 parent ec5c7de commit b10198b

File tree

3 files changed

+34
-18
lines changed

3 files changed

+34
-18
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ All notable changes to this project will be documented in this file.
1010
* Bump graylog-plugin-logging-alert version to 6.1.2 ([issue #54](https://github.com/airbus-cyber/graylog-plugin-logging-alert/issues/54))
1111

1212
### Bug Fixes
13+
* Description for Group By fields ([issue #153](https://github.com/airbus-cyber/graylog-plugin-alert-wizard/issues/153))
1314
* Remove load message ([issue #146](https://github.com/airbus-cyber/graylog-plugin-alert-wizard/issues/146))
1415
* Open Search in new tab ([issue #147](https://github.com/airbus-cyber/graylog-plugin-alert-wizard/issues/147))
1516

src/web/translations/fr.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@
7272
"wizard.groupBy": "Condition de regroupement",
7373
"wizard.distinctBy": "Condition de différenciation",
7474
"wizard.groupByLabel": "Les messages doivent être groupés par",
75+
"wizard.groupByDescription": "Note : Ces champs sont utilisés pour regrouper les alertes",
7576
"wizard.distinctByLabel": "Les messages doivent être distincts par",
7677
"wizard.the": "La",
7778
"wizard.of": "de",

src/web/wizard/components/inputs/GroupByInput.jsx

Lines changed: 32 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ import React from 'react';
2121
import createReactClass from 'create-react-class';
2222
import { FormattedMessage } from 'react-intl';
2323
import { Input, Row, Col } from 'components/bootstrap';
24-
import { MultiSelect } from 'components/common';
24+
import { MultiSelect, Text } from 'components/common';
25+
import styled, { css } from 'styled-components';
2526

2627
import withFormattedFields from './withFormattedFields';
2728

@@ -44,26 +45,39 @@ const GroupByInput = createReactClass({
4445
},
4546

4647
render() {
48+
const StyledText = styled(Text)(({ theme }) => css`
49+
color: ${theme.colors.gray[50]};
50+
padding-left: 10px;
51+
`);
4752
const { formattedFields } = this.props;
4853

4954
return (
50-
<Row>
51-
<Col md={2} style={{ marginTop: 5, marginBottom: 0 }}>
52-
<label className="pull-right" ><FormattedMessage id= "wizard.groupBy" defaultMessage= "Group by Condition" /></label>
53-
</Col>
54-
<Col md={10}>
55-
<label><FormattedMessage id= "wizard.groupByLabel" defaultMessage= "Messages must be grouped by" /></label>
56-
<Input ref="grouping_fields" id="grouping_fields" name="grouping_fields">
57-
<div style={{minWidth:'300px'}}>
58-
<MultiSelect autoFocus={false}
59-
options={formattedFields}
60-
value={this.state.grouping_fields ? (Array.isArray(this.state.grouping_fields) ? this.state.grouping_fields.join(',') : this.state.grouping_fields) : undefined}
61-
onChange={this._onGroupingFieldsChange}
62-
allowCreate={true}/>
63-
</div>
64-
</Input>
65-
</Col>
66-
</Row>
55+
<>
56+
<Row>
57+
<Col md={2} style={{ marginTop: 5, marginBottom: 0 }}>
58+
<label className="pull-right" ><FormattedMessage id= "wizard.groupBy" defaultMessage= "Group by Condition" /></label>
59+
</Col>
60+
<Col md={10}>
61+
<label><FormattedMessage id= "wizard.groupByLabel" defaultMessage= "Messages must be grouped by" /></label>
62+
<Input ref="grouping_fields" id="grouping_fields" name="grouping_fields">
63+
<div style={{minWidth:'300px'}}>
64+
<MultiSelect autoFocus={false}
65+
options={formattedFields}
66+
value={this.state.grouping_fields ? (Array.isArray(this.state.grouping_fields) ? this.state.grouping_fields.join(',') : this.state.grouping_fields) : undefined}
67+
onChange={this._onGroupingFieldsChange}
68+
allowCreate={true}/>
69+
</div>
70+
</Input>
71+
</Col>
72+
</Row>
73+
<Row>
74+
<Col>
75+
<StyledText>
76+
<FormattedMessage id="wizard.groupByDescription" defaultMessage="Note: These fields will be used to aggregate alerts"/>
77+
</StyledText>
78+
</Col>
79+
</Row>
80+
</>
6781
);
6882
},
6983
});

0 commit comments

Comments
 (0)