Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Security Solution][Detections] Rule Form Fixes #84169

Merged
merged 6 commits into from
Nov 24, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ import {
SCHEDULE_INTERVAL_AMOUNT_INPUT,
SCHEDULE_INTERVAL_UNITS_INPUT,
SEVERITY_DROPDOWN,
TAGS_CLEAR_BUTTON,
TAGS_FIELD,
} from '../screens/create_new_rule';
import {
Expand Down Expand Up @@ -215,8 +216,7 @@ describe('Custom detection rules creation', () => {
});
});

// FLAKY: https://github.com/elastic/kibana/issues/83772
describe.skip('Custom detection rules deletion and edition', () => {
describe('Custom detection rules deletion and edition', () => {
spong marked this conversation as resolved.
Show resolved Hide resolved
beforeEach(() => {
esArchiverLoad('custom_rules');
loginAndWaitForPageWithoutDateRange(DETECTIONS_URL);
Expand Down Expand Up @@ -328,6 +328,7 @@ describe.skip('Custom detection rules deletion and edition', () => {
cy.get(ACTIONS_THROTTLE_INPUT).invoke('val').should('eql', 'no_actions');

goToAboutStepTab();
cy.get(TAGS_CLEAR_BUTTON).click({ force: true });
fillAboutRule(editedRule);
saveEditedRule();

Expand Down
1 change: 1 addition & 0 deletions x-pack/plugins/security_solution/cypress/objects/rule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -265,4 +265,5 @@ export const editedRule = {
...existingRule,
severity: 'Medium',
description: 'Edited Rule description',
tags: [...existingRule.tags, 'edited'],
};
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,9 @@ export const TAGS_FIELD =
export const TAGS_INPUT =
'[data-test-subj="detectionEngineStepAboutRuleTags"] [data-test-subj="comboBoxSearchInput"]';

export const TAGS_CLEAR_BUTTON =
'[data-test-subj="detectionEngineStepAboutRuleTags"] [data-test-subj="comboBoxClearButton"]';

export const THRESHOLD_FIELD_SELECTION = '.euiFilterSelectItem';

export const THRESHOLD_INPUT_AREA = '[data-test-subj="thresholdInput"]';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,11 @@ const JobName = ({ id, description, basePath }: JobNameProps) => {

return (
<JobNameWrapper>
<EuiLink data-test-subj="jobs-table-link" href={jobUrl} target="_blank">
<EuiText size="s">{id}</EuiText>
</EuiLink>
<EuiText size="s">
<EuiLink data-test-subj="jobs-table-link" href={jobUrl} target="_blank">
{id}
</EuiLink>
</EuiText>
<EuiText color="subdued" size="xs">
{description.length > truncateThreshold
? `${description.substring(0, truncateThreshold)}...`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ export const useFetchIndex = (
const { data, notifications } = useKibana().services;
const abortCtrl = useRef(new AbortController());
const previousIndexesName = useRef<string[]>([]);
const [isLoading, setLoading] = useState(true);
const [isLoading, setLoading] = useState(false);
spong marked this conversation as resolved.
Show resolved Hide resolved

const [state, setState] = useState<FetchIndexReturn>({
browserFields: DEFAULT_BROWSER_FIELDS,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,13 @@ export const DEFAULT_THROTTLE_OPTION = THROTTLE_OPTIONS[0];
type ThrottleSelectField = typeof SelectField;

export const ThrottleSelectField: ThrottleSelectField = (props) => {
const { setValue } = props.field;
const onChange = useCallback(
(e) => {
const throttle = e.target.value;
props.field.setValue(throttle);
props.handleChange(throttle);
setValue(throttle);
},
// eslint-disable-next-line react-hooks/exhaustive-deps
[props.field.setValue, props.handleChange]
[setValue]
);
const newEuiFieldProps = { ...props.euiFieldProps, onChange };
return <SelectField {...props} euiFieldProps={newEuiFieldProps} />;
Expand Down