diff --git a/cypress/integration/1_detectors.spec.js b/cypress/integration/1_detectors.spec.js
index a01dc4c8c..c1908f7b3 100644
--- a/cypress/integration/1_detectors.spec.js
+++ b/cypress/integration/1_detectors.spec.js
@@ -236,139 +236,139 @@ describe('Detectors', () => {
}).should('have.property', 'status', 200);
});
- // describe('...should validate form fields', () => {
- // beforeEach(() => {
- // cy.intercept('/_plugins/_security_analytics/detectors/_search').as('detectorsSearch');
-
- // // Visit Detectors page before any test
- // cy.visit(`${OPENSEARCH_DASHBOARDS_URL}/detectors`);
- // cy.wait('@detectorsSearch').should('have.property', 'state', 'Complete');
-
- // openCreateForm();
- // });
-
- // it('...should validate name field', () => {
- // getNameField().should('be.empty');
- // getNameField().focus().blur();
- // getNameField().parentsUntil('.euiFormRow__fieldWrapper').siblings().contains('Enter a name.');
-
- // getNameField().type('text').focus().blur();
-
- // getNameField()
- // .parents('.euiFormRow__fieldWrapper')
- // .find('.euiFormErrorText')
- // .contains(
- // 'Name should only consist of upper and lowercase letters, numbers 0-9, hyphens, spaces, and underscores. Use between 5 and 50 characters.'
- // );
-
- // getNameField().type('{selectall}').type('{backspace}').type('tex&').focus().blur();
-
- // getNameField()
- // .parents('.euiFormRow__fieldWrapper')
- // .find('.euiFormErrorText')
- // .contains(
- // 'Name should only consist of upper and lowercase letters, numbers 0-9, hyphens, spaces, and underscores. Use between 5 and 50 characters.'
- // );
-
- // getNameField()
- // .type('{selectall}')
- // .type('{backspace}')
- // .type('Detector name')
- // .focus()
- // .blur()
- // .parents('.euiFormRow__fieldWrapper')
- // .find('.euiFormErrorText')
- // .should('not.exist');
- // });
-
- // it('...should validate description field', () => {
- // const longDescriptionText =
- // 'This is a long text. This is a long text. This is a long text. This is a long text. This is a long text. This is a long text. This is a long text. This is a long text. This is a long text. This is a long text. This is a long text. This is a long text. This is a long text. This is a long text. This is a long text. This is a long text. This is a long text. This is a long text. This is a long text. This is a long text. This is a long text. This is a long text. This is a long text. This is a long text. This is a long text.';
-
- // getDescriptionField().should('be.empty');
-
- // getDescriptionField().type(longDescriptionText).focus().blur();
-
- // getDescriptionField()
- // .parents('.euiFormRow__fieldWrapper')
- // .find('.euiFormErrorText')
- // .contains(
- // 'Description should only consist of upper and lowercase letters, numbers 0-9, commas, hyphens, periods, spaces, and underscores. Max limit of 500 characters.'
- // );
-
- // getDescriptionField()
- // .type('{selectall}')
- // .type('{backspace}')
- // .type('Detector description...')
- // .focus()
- // .blur();
-
- // getDescriptionField()
- // .type('{selectall}')
- // .type('{backspace}')
- // .type('Detector name')
- // .focus()
- // .blur()
- // .parents('.euiFormRow__fieldWrapper')
- // .find('.euiFormErrorText')
- // .should('not.exist');
- // });
-
- // it('...should validate data source field', () => {
- // getDataSourceField()
- // .focus()
- // .blur()
- // .parentsUntil('.euiFormRow__fieldWrapper')
- // .siblings()
- // .contains('Select an input source.');
-
- // getDataSourceField().selectComboboxItem(cypressIndexDns);
- // getDataSourceField()
- // .focus()
- // .blur()
- // .parentsUntil('.euiFormRow__fieldWrapper')
- // .find('.euiFormErrorText')
- // .should('not.exist');
- // });
-
- // it('...should validate next button', () => {
- // getNextButton().should('be.disabled');
-
- // fillDetailsForm(detectorName, cypressIndexDns);
- // getNextButton().should('be.enabled');
- // });
-
- // it('...should validate alerts page', () => {
- // fillDetailsForm(detectorName, cypressIndexDns);
- // getNextButton().click({ force: true });
- // // Open the trigger details accordion
- // cy.get('[data-test-subj="trigger-details-btn"]').click({ force: true });
- // getTriggerNameField().should('have.value', 'Trigger 1');
- // getTriggerNameField()
- // .parents('.euiFormRow__fieldWrapper')
- // .find('.euiFormErrorText')
- // .should('not.exist');
-
- // getTriggerNameField().type('{selectall}').type('{backspace}').focus().blur();
- // getCreateDetectorButton().should('be.disabled');
-
- // cy.getButtonByText('Remove').click({ force: true });
- // getCreateDetectorButton().should('be.enabled');
- // });
-
- // it('...should show mappings warning', () => {
- // fillDetailsForm(detectorName, cypressIndexDns);
-
- // getDataSourceField().selectComboboxItem(cypressIndexWindows);
- // getDataSourceField().focus().blur();
-
- // cy.get('[data-test-subj="define-detector-diff-log-types-warning"]')
- // .should('be.visible')
- // .contains(
- // 'To avoid issues with field mappings, we recommend creating separate detectors for different log types.'
- // );
- // });
- // });
+ describe('...should validate form fields', () => {
+ beforeEach(() => {
+ cy.intercept('/_plugins/_security_analytics/detectors/_search').as('detectorsSearch');
+
+ // Visit Detectors page before any test
+ cy.visit(`${OPENSEARCH_DASHBOARDS_URL}/detectors`);
+ cy.wait('@detectorsSearch').should('have.property', 'state', 'Complete');
+
+ openCreateForm();
+ });
+
+ it('...should validate name field', () => {
+ getNameField().should('be.empty');
+ getNameField().focus().blur();
+ getNameField().parentsUntil('.euiFormRow__fieldWrapper').siblings().contains('Enter a name.');
+
+ getNameField().type('text').focus().blur();
+
+ getNameField()
+ .parents('.euiFormRow__fieldWrapper')
+ .find('.euiFormErrorText')
+ .contains(
+ 'Name should only consist of upper and lowercase letters, numbers 0-9, hyphens, spaces, and underscores. Use between 5 and 50 characters.'
+ );
+
+ getNameField().type('{selectall}').type('{backspace}').type('tex&').focus().blur();
+
+ getNameField()
+ .parents('.euiFormRow__fieldWrapper')
+ .find('.euiFormErrorText')
+ .contains(
+ 'Name should only consist of upper and lowercase letters, numbers 0-9, hyphens, spaces, and underscores. Use between 5 and 50 characters.'
+ );
+
+ getNameField()
+ .type('{selectall}')
+ .type('{backspace}')
+ .type('Detector name')
+ .focus()
+ .blur()
+ .parents('.euiFormRow__fieldWrapper')
+ .find('.euiFormErrorText')
+ .should('not.exist');
+ });
+
+ it('...should validate description field', () => {
+ const longDescriptionText =
+ 'This is a long text. This is a long text. This is a long text. This is a long text. This is a long text. This is a long text. This is a long text. This is a long text. This is a long text. This is a long text. This is a long text. This is a long text. This is a long text. This is a long text. This is a long text. This is a long text. This is a long text. This is a long text. This is a long text. This is a long text. This is a long text. This is a long text. This is a long text. This is a long text. This is a long text.';
+
+ getDescriptionField().should('be.empty');
+
+ getDescriptionField().type(longDescriptionText).focus().blur();
+
+ getDescriptionField()
+ .parents('.euiFormRow__fieldWrapper')
+ .find('.euiFormErrorText')
+ .contains(
+ 'Description should only consist of upper and lowercase letters, numbers 0-9, commas, hyphens, periods, spaces, and underscores. Max limit of 500 characters.'
+ );
+
+ getDescriptionField()
+ .type('{selectall}')
+ .type('{backspace}')
+ .type('Detector description...')
+ .focus()
+ .blur();
+
+ getDescriptionField()
+ .type('{selectall}')
+ .type('{backspace}')
+ .type('Detector name')
+ .focus()
+ .blur()
+ .parents('.euiFormRow__fieldWrapper')
+ .find('.euiFormErrorText')
+ .should('not.exist');
+ });
+
+ it('...should validate data source field', () => {
+ getDataSourceField()
+ .focus()
+ .blur()
+ .parentsUntil('.euiFormRow__fieldWrapper')
+ .siblings()
+ .contains('Select an input source.');
+
+ getDataSourceField().selectComboboxItem(cypressIndexDns);
+ getDataSourceField()
+ .focus()
+ .blur()
+ .parentsUntil('.euiFormRow__fieldWrapper')
+ .find('.euiFormErrorText')
+ .should('not.exist');
+ });
+
+ it('...should validate next button', () => {
+ getNextButton().should('be.disabled');
+
+ fillDetailsForm(detectorName, cypressIndexDns);
+ getNextButton().should('be.enabled');
+ });
+
+ it('...should validate alerts page', () => {
+ fillDetailsForm(detectorName, cypressIndexDns);
+ getNextButton().click({ force: true });
+ // Open the trigger details accordion
+ cy.get('[data-test-subj="trigger-details-btn"]').click({ force: true });
+ getTriggerNameField().should('have.value', 'Trigger 1');
+ getTriggerNameField()
+ .parents('.euiFormRow__fieldWrapper')
+ .find('.euiFormErrorText')
+ .should('not.exist');
+
+ getTriggerNameField().type('{selectall}').type('{backspace}').focus().blur();
+ getCreateDetectorButton().should('be.disabled');
+
+ cy.getButtonByText('Remove').click({ force: true });
+ getCreateDetectorButton().should('be.enabled');
+ });
+
+ it('...should show mappings warning', () => {
+ fillDetailsForm(detectorName, cypressIndexDns);
+
+ getDataSourceField().selectComboboxItem(cypressIndexWindows);
+ getDataSourceField().focus().blur();
+
+ cy.get('[data-test-subj="define-detector-diff-log-types-warning"]')
+ .should('be.visible')
+ .contains(
+ 'To avoid issues with field mappings, we recommend creating separate detectors for different log types.'
+ );
+ });
+ });
describe('...validate create detector flow', () => {
beforeEach(() => {
diff --git a/public/pages/CreateDetector/components/ConfigureAlerts/components/AlertCondition/AlertConditionPanel.tsx b/public/pages/CreateDetector/components/ConfigureAlerts/components/AlertCondition/AlertConditionPanel.tsx
index 3a2f244ce..9e8087586 100644
--- a/public/pages/CreateDetector/components/ConfigureAlerts/components/AlertCondition/AlertConditionPanel.tsx
+++ b/public/pages/CreateDetector/components/ConfigureAlerts/components/AlertCondition/AlertConditionPanel.tsx
@@ -56,7 +56,6 @@ interface AlertConditionPanelState {
showNotificationDetails: boolean;
detectionRulesTriggerEnabled: boolean;
threatIntelTriggerEnabled: boolean;
- notificationError: string;
}
export default class AlertConditionPanel extends Component<
@@ -73,7 +72,6 @@ export default class AlertConditionPanel extends Component<
showNotificationDetails: true,
detectionRulesTriggerEnabled: props.alertCondition.detection_types.includes('rules'),
threatIntelTriggerEnabled: props.alertCondition.detection_types.includes('threat_intel'),
- notificationError: '',
};
}
@@ -211,7 +209,6 @@ export default class AlertConditionPanel extends Component<
const actions = alertCondition.actions;
if (selectedOptions.length > 0) {
actions[0].destination_id = selectedOptions[0].value!;
- this.setState({ notificationError: '' });
} else {
actions[0].destination_id = '';
}
@@ -291,7 +288,6 @@ export default class AlertConditionPanel extends Component<
showNotificationDetails,
detectionRulesTriggerEnabled,
threatIntelTriggerEnabled,
- notificationError,
} = this.state;
const { name, sev_levels: ruleSeverityLevels, tags, severity } = alertCondition;
const uniqueTagsOptions = new Set(
@@ -537,7 +533,7 @@ export default class AlertConditionPanel extends Component<