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
[ENDPOINT] Initial version of new page layout. #71687
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,7 @@ | |
import React, { useMemo } from 'react'; | ||
import styled from 'styled-components'; | ||
|
||
import { EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; | ||
import { useThrottledResizeObserver } from '../../common/components/utils'; | ||
import { DragDropContextWrapper } from '../../common/components/drag_and_drop/drag_drop_context_wrapper'; | ||
import { Flyout } from '../../timelines/components/flyout'; | ||
|
@@ -20,7 +21,7 @@ import { navTabs } from './home_navigations'; | |
import { useSignalIndex } from '../../detections/containers/detection_engine/alerts/use_signal_index'; | ||
|
||
const WrappedByAutoSizer = styled.div` | ||
height: 100%; | ||
min-height: calc(100vh - 48px); | ||
`; | ||
WrappedByAutoSizer.displayName = 'WrappedByAutoSizer'; | ||
|
||
|
@@ -69,10 +70,17 @@ export const HomePage: React.FC<HomePageProps> = ({ children }) => { | |
const { browserFields, indexPattern, indicesExist } = useWithSource('default', indexToAdd); | ||
|
||
return ( | ||
<WrappedByAutoSizer data-test-subj="wrapped-by-auto-sizer" ref={measureRef}> | ||
<HeaderGlobal /> | ||
|
||
<Main data-test-subj="pageContainer"> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is one part where I was not sure - do we strive for semantic markup? I removed the main tag because I used EUI layout components (EuiFlexGroup and EuiFlexItem), but instead I can just use EUI classes on HTML elements. |
||
<EuiFlexGroup | ||
direction="column" | ||
gutterSize="none" | ||
data-test-subj="wrapped-by-auto-sizer" | ||
style={{ minHeight: 'calc(100vh - 48px)' }} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Never mind that it's inline style, it was result of a lot of experimenting, will fix it when we agree on this solution. |
||
> | ||
<EuiFlexItem grow={false}> | ||
<HeaderGlobal className="euiFlexItem" /> | ||
</EuiFlexItem> | ||
|
||
<EuiFlexItem data-test-subj="pageContainer"> | ||
<DragDropContextWrapper browserFields={browserFields}> | ||
<UseUrlState indexPattern={indexPattern} navTabs={navTabs} /> | ||
{indicesExist && showTimeline && ( | ||
|
@@ -88,10 +96,10 @@ export const HomePage: React.FC<HomePageProps> = ({ children }) => { | |
|
||
{children} | ||
</DragDropContextWrapper> | ||
</Main> | ||
</EuiFlexItem> | ||
|
||
<HelpMenu /> | ||
</WrappedByAutoSizer> | ||
</EuiFlexGroup> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So this changes the file shared between all the apps (it's a bit confusing that it's named HomePage). I did a very shallow test but would need to be tested a bit more thoroughly. I guess I should align this change with other teams (maybe Rob?). |
||
); | ||
}; | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,15 +25,17 @@ import { EuiTabProps } from '@elastic/eui/src/components/tabs/tab'; | |
|
||
const StyledEuiPage = styled(EuiPage)` | ||
&.endpoint--isListView { | ||
padding: 0 ${(props) => props.theme.eui.euiSizeL}; | ||
padding: 0; | ||
flex: 1 1 100%; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure if I want to use flex directly, I'd rather find a way to use EUI classes but not sure it's as easy. |
||
|
||
.endpoint-header { | ||
padding: ${(props) => props.theme.eui.euiSizeL}; | ||
margin-bottom: 0; | ||
} | ||
.endpoint-page-content { | ||
border-left: none; | ||
border-right: none; | ||
border: none; | ||
box-shadow: none; | ||
border-radius: 0; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I discussed with Kevin that it feels like we use EuiPage component but then we actually overwrite a lot of it's styling so it's not clear if that component is helping much. I think it would be nice to have this type of layout supported by EUI. |
||
} | ||
} | ||
&.endpoint--isDetailsView { | ||
|
@@ -44,7 +46,7 @@ const StyledEuiPage = styled(EuiPage)` | |
} | ||
} | ||
.endpoint-navTabs { | ||
margin-left: ${(props) => props.theme.eui.euiSizeM}; | ||
padding-left: ${(props) => props.theme.eui.euiSizeM}; | ||
} | ||
.endpoint-header-leftSection { | ||
overflow: hidden; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This whole styling might end up being removed if we decide to go with EuiFlexGroup and EuiFlexItem.