Skip to content

Commit

Permalink
[Create detector] Update data source selection label and help text (#…
Browse files Browse the repository at this point in the history
…1100) (#1101)

* update data source selection label and help text



* updated snapshots



---------


(cherry picked from commit 62ab170)

Signed-off-by: Amardeepsingh Siglani <[email protected]>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
1 parent 85d1c2d commit dac6504
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 8 deletions.
2 changes: 1 addition & 1 deletion cypress/integration/1_detectors.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const validateAlertPanel = (alertName) =>
.eq(2)
.within(() => cy.getElementByText('button', alertName));

const dataSourceLabel = 'Select or input source indexes or index patterns';
const dataSourceLabel = 'Select indexes/aliases';

const getDataSourceField = () => cy.getFieldByLabel(dataSourceLabel);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,7 @@ exports[`<Alerts /> spec renders the component 1`] = `
},
]
}
compressed={false}
dateFormat="MMM D, YYYY @ HH:mm:ss.SSS"
end="now"
isAutoRefreshOnly={false}
Expand Down Expand Up @@ -330,6 +331,7 @@ exports[`<Alerts /> spec renders the component 1`] = `
>
<EuiFormControlLayout
className="euiSuperDatePicker"
compressed={false}
isDisabled={false}
prepend={
<EuiQuickSelectPopover
Expand Down Expand Up @@ -595,7 +597,9 @@ exports[`<Alerts /> spec renders the component 1`] = `
</button>
</div>
</EuiDatePickerRange>
<EuiFormControlLayoutIcons />
<EuiFormControlLayoutIcons
compressed={false}
/>
</div>
</div>
</EuiFormControlLayout>
Expand All @@ -608,6 +612,7 @@ exports[`<Alerts /> spec renders the component 1`] = `
className="euiFlexItem euiFlexItem--flexGrowZero"
>
<EuiSuperUpdateButton
compressed={false}
data-test-subj="superDatePickerApplyTimeButton"
fill={false}
isDisabled={false}
Expand Down Expand Up @@ -637,6 +642,7 @@ exports[`<Alerts /> spec renders the component 1`] = `
onBlur={[Function]}
onClick={[Function]}
onFocus={[Function]}
size="m"
textProps={
Object {
"className": "euiSuperUpdateButton__text",
Expand All @@ -657,6 +663,7 @@ exports[`<Alerts /> spec renders the component 1`] = `
onBlur={[Function]}
onClick={[Function]}
onFocus={[Function]}
size="m"
textProps={
Object {
"className": "euiSuperUpdateButton__text",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
EuiCallOut,
EuiTextColor,
EuiTitle,
EuiLink,
} from '@elastic/eui';
import { FormFieldHeader } from '../../../../../../components/FormFieldHeader/FormFieldHeader';
import { IndexOption } from '../../../../../Detectors/models/interfaces';
Expand Down Expand Up @@ -155,11 +156,17 @@ export default class DetectorDataSource extends Component<
</EuiTitle>
<EuiSpacer size={'m'} />
<EuiFormRow
label={
<FormFieldHeader headerTitle={'Select or input source indexes or index patterns'} />
}
label={<FormFieldHeader headerTitle={'Select indexes/aliases'} />}
isInvalid={isInvalid}
error={isInvalid && (errorMessage || 'Select an input source.')}
helpText={
<span>
<a href="https://opensearch.org/docs/latest/im-plugin/index-alias" target="_blank">
Aliases
</a>{' '}
are recommended for optimal functioning of detectors.
</span>
}
>
<EuiComboBox
placeholder={'Select an input source for the detector.'}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -710,10 +710,22 @@ exports[`<UpdateDetectorBasicDetails /> spec renders the component 1`] = `
fullWidth={false}
hasChildLabel={true}
hasEmptyLabelSpace={false}
helpText={
<span>
<a
href="https://opensearch.org/docs/latest/im-plugin/index-alias"
target="_blank"
>
Aliases
</a>
are recommended for optimal functioning of detectors.
</span>
}
isInvalid={false}
label={
<FormFieldHeader
headerTitle="Select or input source indexes or index patterns"
headerTitle="Select indexes/aliases"
/>
}
labelType="label"
Expand All @@ -739,7 +751,7 @@ exports[`<UpdateDetectorBasicDetails /> spec renders the component 1`] = `
htmlFor="some_html_id"
>
<FormFieldHeader
headerTitle="Select or input source indexes or index patterns"
headerTitle="Select indexes/aliases"
>
<EuiText
size="s"
Expand All @@ -748,7 +760,7 @@ exports[`<UpdateDetectorBasicDetails /> spec renders the component 1`] = `
className="euiText euiText--small"
>
<strong>
Select or input source indexes or index patterns
Select indexes/aliases
</strong>
</div>
</EuiText>
Expand All @@ -760,6 +772,7 @@ exports[`<UpdateDetectorBasicDetails /> spec renders the component 1`] = `
className="euiFormRow__fieldWrapper"
>
<EuiComboBox
aria-describedby="some_html_id-help-0"
async={false}
compressed={false}
data-test-subj="define-detector-select-data-source"
Expand Down Expand Up @@ -797,6 +810,7 @@ exports[`<UpdateDetectorBasicDetails /> spec renders the component 1`] = `
sortMatchesBy="none"
>
<div
aria-describedby="some_html_id-help-0"
aria-expanded={false}
aria-haspopup="listbox"
className="euiComboBox"
Expand Down Expand Up @@ -1083,6 +1097,27 @@ exports[`<UpdateDetectorBasicDetails /> spec renders the component 1`] = `
</EuiComboBoxInput>
</div>
</EuiComboBox>
<EuiFormHelpText
className="euiFormRow__text"
id="some_html_id-help-0"
key="0"
>
<div
className="euiFormHelpText euiFormRow__text"
id="some_html_id-help-0"
>
<span>
<a
href="https://opensearch.org/docs/latest/im-plugin/index-alias"
target="_blank"
>
Aliases
</a>
are recommended for optimal functioning of detectors.
</span>
</div>
</EuiFormHelpText>
</div>
</div>
</EuiFormRow>
Expand Down

0 comments on commit dac6504

Please sign in to comment.