Skip to content

Commit f5b0ac1

Browse files
[Security Solution] Fix few styling issues (#87045) (#87141)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
1 parent 245c8c1 commit f5b0ac1

File tree

9 files changed

+130
-142
lines changed

9 files changed

+130
-142
lines changed

x-pack/plugins/security_solution/public/common/components/event_details/columns.tsx

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,14 @@ const HoverActionsContainer = styled(EuiPanel)`
5151

5252
HoverActionsContainer.displayName = 'HoverActionsContainer';
5353

54+
const FullWidthFlexGroup = styled(EuiFlexGroup)`
55+
width: 100%;
56+
`;
57+
58+
const FullWidthFlexItem = styled(EuiFlexItem)`
59+
width: 100%;
60+
`;
61+
5462
export const getColumns = ({
5563
browserFields,
5664
columnHeaders,
@@ -159,10 +167,15 @@ export const getColumns = ({
159167
sortable: true,
160168
truncateText: false,
161169
render: (values: ToStringArray | null | undefined, data: EventFieldsData) => (
162-
<EuiFlexGroup direction="column" alignItems="flexStart" component="span" gutterSize="none">
170+
<FullWidthFlexGroup
171+
direction="column"
172+
alignItems="flexStart"
173+
component="span"
174+
gutterSize="none"
175+
>
163176
{values != null &&
164177
values.map((value, i) => (
165-
<EuiFlexItem
178+
<FullWidthFlexItem
166179
grow={false}
167180
component="span"
168181
key={`event-details-value-flex-item-${contextId}-${eventId}-${data.field}-${i}-${value}`}
@@ -182,9 +195,9 @@ export const getColumns = ({
182195
/>
183196
)}
184197
</div>
185-
</EuiFlexItem>
198+
</FullWidthFlexItem>
186199
))}
187-
</EuiFlexGroup>
200+
</FullWidthFlexGroup>
188201
),
189202
},
190203
{

x-pack/plugins/security_solution/public/common/components/markdown_editor/plugins/timeline/plugin.tsx

Lines changed: 26 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import React, { useCallback, memo } from 'react';
88
import {
99
EuiSelectableOption,
1010
EuiModalBody,
11+
EuiModalHeader,
1112
EuiMarkdownEditorUiPlugin,
1213
EuiCodeBlock,
1314
} from '@elastic/eui';
@@ -47,24 +48,32 @@ const TimelineEditorComponent: React.FC<TimelineEditorProps> = ({ onClosePopover
4748
[]
4849
);
4950

51+
const handleTimelineChange = useCallback(
52+
(timelineTitle, timelineId, graphEventId) => {
53+
const url = formatUrl(getTimelineUrl(timelineId ?? '', graphEventId), {
54+
absolute: true,
55+
skipSearch: true,
56+
});
57+
onInsert(`[${timelineTitle}](${url})`, {
58+
block: false,
59+
});
60+
},
61+
[formatUrl, onInsert]
62+
);
63+
5064
return (
51-
<EuiModalBody>
52-
<SelectableTimeline
53-
hideUntitled={true}
54-
getSelectableOptions={handleGetSelectableOptions}
55-
onTimelineChange={(timelineTitle, timelineId, graphEventId) => {
56-
const url = formatUrl(getTimelineUrl(timelineId ?? '', graphEventId), {
57-
absolute: true,
58-
skipSearch: true,
59-
});
60-
onInsert(`[${timelineTitle}](${url})`, {
61-
block: false,
62-
});
63-
}}
64-
onClosePopover={onClosePopover}
65-
timelineType={TimelineType.default}
66-
/>
67-
</EuiModalBody>
65+
<>
66+
<EuiModalHeader />
67+
<EuiModalBody>
68+
<SelectableTimeline
69+
hideUntitled={true}
70+
getSelectableOptions={handleGetSelectableOptions}
71+
onTimelineChange={handleTimelineChange}
72+
onClosePopover={onClosePopover}
73+
timelineType={TimelineType.default}
74+
/>
75+
</EuiModalBody>
76+
</>
6877
);
6978
};
7079

x-pack/plugins/security_solution/public/common/components/matrix_histogram/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ const HeaderChildrenFlexItem = styled(EuiFlexItem)`
5858
const HistogramPanel = styled(Panel)<{ height?: number }>`
5959
display: flex;
6060
flex-direction: column;
61-
${({ height }) => (height != null ? `height: ${height}px;` : '')}
61+
${({ height }) => (height != null ? `min-height: ${height}px;` : '')}
6262
`;
6363

6464
export const MatrixHistogramComponent: React.FC<MatrixHistogramComponentProps> = ({

x-pack/plugins/security_solution/public/timelines/components/fields_browser/header.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ export const Header = React.memo<Props>(
156156
onChange={onSearchInputChange}
157157
placeholder={i18n.FILTER_PLACEHOLDER}
158158
value={searchInput}
159+
fullWidth
159160
/>
160161
</SearchContainer>
161162
<CountRow filteredBrowserFields={filteredBrowserFields} />

x-pack/plugins/security_solution/public/timelines/components/timeline/selectable_timeline/index.test.tsx

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,14 @@
33
* or more contributor license agreements. Licensed under the Elastic License;
44
* you may not use this file except in compliance with the Elastic License.
55
*/
6+
7+
import { EuiSelectableProps } from '@elastic/eui';
68
import React from 'react';
79
import { shallow, ShallowWrapper, mount } from 'enzyme';
10+
811
import { TimelineType } from '../../../../../common/types/timeline';
912
import { SortFieldTimeline, Direction } from '../../../../graphql/types';
10-
import { SelectableTimeline, ORIGINAL_PAGE_SIZE, SearchProps } from './';
13+
import { SelectableTimeline, ORIGINAL_PAGE_SIZE } from './';
1114

1215
const mockFetchAllTimeline = jest.fn();
1316
jest.mock('../../../containers/all', () => {
@@ -40,10 +43,10 @@ describe('SelectableTimeline', () => {
4043
});
4144

4245
test('render placeholder', () => {
43-
const searchProps: SearchProps = wrapper
46+
const searchProps: EuiSelectableProps['searchProps'] = wrapper
4447
.find('[data-test-subj="selectable-input"]')
4548
.prop('searchProps');
46-
expect(searchProps.placeholder).toEqual('e.g. Timeline name or description');
49+
expect(searchProps!.placeholder).toEqual('e.g. Timeline name or description');
4750
});
4851
});
4952

@@ -58,10 +61,10 @@ describe('SelectableTimeline', () => {
5861
});
5962

6063
test('render placeholder', () => {
61-
const searchProps: SearchProps = wrapper
64+
const searchProps: EuiSelectableProps['searchProps'] = wrapper
6265
.find('[data-test-subj="selectable-input"]')
6366
.prop('searchProps');
64-
expect(searchProps.placeholder).toEqual('e.g. Timeline template name or description');
67+
expect(searchProps!.placeholder).toEqual('e.g. Timeline template name or description');
6568
});
6669
});
6770
});
@@ -89,7 +92,7 @@ describe('SelectableTimeline', () => {
8992
jest.clearAllMocks();
9093
});
9194

92-
test('shoule be called with correct args', () => {
95+
test('should be called with correct args', () => {
9396
expect(mockFetchAllTimeline).toBeCalledWith(args);
9497
});
9598
});

0 commit comments

Comments
 (0)