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

[ENDPOINT] Initial version of new page layout. #71687

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

efreeti
Copy link
Contributor

@efreeti efreeti commented Jul 14, 2020

Summary

Attempt to implement new list page layout. Done based on the same approach used in Observability -> Overview and Ingest Manager views.

New layout:
new layout

@efreeti efreeti self-assigned this Jul 14, 2020
direction="column"
gutterSize="none"
data-test-subj="wrapped-by-auto-sizer"
style={{ minHeight: 'calc(100vh - 48px)' }}
Copy link
Contributor Author

Choose a reason for hiding this comment

The 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.

@@ -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);
Copy link
Contributor Author

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.

<WrappedByAutoSizer data-test-subj="wrapped-by-auto-sizer" ref={measureRef}>
<HeaderGlobal />

<Main data-test-subj="pageContainer">
Copy link
Contributor Author

Choose a reason for hiding this comment

The 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.


<HelpMenu />
</WrappedByAutoSizer>
</EuiFlexGroup>
Copy link
Contributor Author

Choose a reason for hiding this comment

The 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?).

@@ -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%;
Copy link
Contributor Author

Choose a reason for hiding this comment

The 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.

border-right: none;
border: none;
box-shadow: none;
border-radius: 0;
Copy link
Contributor Author

Choose a reason for hiding this comment

The 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.

@kibanamachine
Copy link
Contributor

💔 Build Failed

Failed CI Steps


Test Failures

Kibana Pipeline / x-pack-intake-agent / X-Pack Jest Tests.x-pack/plugins/security_solution/public/common/components/endpoint.PageView component should display only body if not header props used

Link to Jenkins

Standard Out

Failed Tests Reporter:
  - Test has not failed recently on tracked branches


Stack Trace

Error: expect(received).toMatchSnapshot()

Snapshot name: `PageView component should display only body if not header props used 1`

- Snapshot  - 10
+ Received  + 14

@@ -1,31 +1,35 @@
  .c0.endpoint--isListView {
-   padding: 0 24px;
+   padding: 0;
+   -webkit-flex: 1 1 100%;
+   -ms-flex: 1 1 100%;
+   flex: 1 1 100%;
  }

  .c0.endpoint--isListView .endpoint-header {
-   padding: 24px;
-   margin-bottom: 0;
+   padding: 24px;
+   margin-bottom: 0;
  }

  .c0.endpoint--isListView .endpoint-page-content {
-   border-left: none;
-   border-right: none;
+   border: none;
+   box-shadow: none;
+   border-radius: 0;
  }

  .c0.endpoint--isDetailsView .endpoint-page-content {
-   padding: 0;
-   border: none;
-   background: none;
+   padding: 0;
+   border: none;
+   background: none;
  }

  .c0 .endpoint-navTabs {
-   margin-left: 12px;
+   padding-left: 12px;
  }

  .c0 .endpoint-header-leftSection {
-   overflow: hidden;
+   overflow: hidden;
  }

  <PageView
    viewType="list"
  >
    at Object.it (/dev/shm/workspace/kibana/x-pack/plugins/security_solution/public/common/components/endpoint/page_view.test.tsx:17:75)
    at Promise (/dev/shm/workspace/kibana/node_modules/jest-circus/build/utils.js:198:28)
    at new Promise (<anonymous>)
    at callAsyncCircusFn (/dev/shm/workspace/kibana/node_modules/jest-circus/build/utils.js:162:10)
    at _callCircusTest (/dev/shm/workspace/kibana/node_modules/jest-circus/build/run.js:205:40)
    at process._tickCallback (internal/process/next_tick.js:68:7)

Kibana Pipeline / x-pack-intake-agent / X-Pack Jest Tests.x-pack/plugins/security_solution/public/common/components/endpoint.PageView component should display header left and right

Link to Jenkins

Standard Out

Failed Tests Reporter:
  - Test has not failed recently on tracked branches


Stack Trace

Error: expect(received).toMatchSnapshot()

Snapshot name: `PageView component should display header left and right 1`

- Snapshot  - 10
+ Received  + 14

@@ -1,31 +1,35 @@
  .c0.endpoint--isListView {
-   padding: 0 24px;
+   padding: 0;
+   -webkit-flex: 1 1 100%;
+   -ms-flex: 1 1 100%;
+   flex: 1 1 100%;
  }

  .c0.endpoint--isListView .endpoint-header {
-   padding: 24px;
-   margin-bottom: 0;
+   padding: 24px;
+   margin-bottom: 0;
  }

  .c0.endpoint--isListView .endpoint-page-content {
-   border-left: none;
-   border-right: none;
+   border: none;
+   box-shadow: none;
+   border-radius: 0;
  }

  .c0.endpoint--isDetailsView .endpoint-page-content {
-   padding: 0;
-   border: none;
-   background: none;
+   padding: 0;
+   border: none;
+   background: none;
  }

  .c0 .endpoint-navTabs {
-   margin-left: 12px;
+   padding-left: 12px;
  }

  .c0 .endpoint-header-leftSection {
-   overflow: hidden;
+   overflow: hidden;
  }

  <PageView
    headerLeft="page title"
    headerRight="right side actions"
    at Object.it (/dev/shm/workspace/kibana/x-pack/plugins/security_solution/public/common/components/endpoint/page_view.test.tsx:26:7)
    at Promise (/dev/shm/workspace/kibana/node_modules/jest-circus/build/utils.js:198:28)
    at new Promise (<anonymous>)
    at callAsyncCircusFn (/dev/shm/workspace/kibana/node_modules/jest-circus/build/utils.js:162:10)
    at _callCircusTest (/dev/shm/workspace/kibana/node_modules/jest-circus/build/run.js:205:40)
    at process._tickCallback (internal/process/next_tick.js:68:7)

Kibana Pipeline / x-pack-intake-agent / X-Pack Jest Tests.x-pack/plugins/security_solution/public/common/components/endpoint.PageView component should display only header left

Link to Jenkins

Standard Out

Failed Tests Reporter:
  - Test has not failed recently on tracked branches


Stack Trace

Error: expect(received).toMatchSnapshot()

Snapshot name: `PageView component should display only header left 1`

- Snapshot  - 10
+ Received  + 14

@@ -1,31 +1,35 @@
  .c0.endpoint--isListView {
-   padding: 0 24px;
+   padding: 0;
+   -webkit-flex: 1 1 100%;
+   -ms-flex: 1 1 100%;
+   flex: 1 1 100%;
  }

  .c0.endpoint--isListView .endpoint-header {
-   padding: 24px;
-   margin-bottom: 0;
+   padding: 24px;
+   margin-bottom: 0;
  }

  .c0.endpoint--isListView .endpoint-page-content {
-   border-left: none;
-   border-right: none;
+   border: none;
+   box-shadow: none;
+   border-radius: 0;
  }

  .c0.endpoint--isDetailsView .endpoint-page-content {
-   padding: 0;
-   border: none;
-   background: none;
+   padding: 0;
+   border: none;
+   background: none;
  }

  .c0 .endpoint-navTabs {
-   margin-left: 12px;
+   padding-left: 12px;
  }

  .c0 .endpoint-header-leftSection {
-   overflow: hidden;
+   overflow: hidden;
  }

  <PageView
    headerLeft="page title"
    viewType="list"
    at Object.it (/dev/shm/workspace/kibana/x-pack/plugins/security_solution/public/common/components/endpoint/page_view.test.tsx:35:7)
    at Promise (/dev/shm/workspace/kibana/node_modules/jest-circus/build/utils.js:198:28)
    at new Promise (<anonymous>)
    at callAsyncCircusFn (/dev/shm/workspace/kibana/node_modules/jest-circus/build/utils.js:162:10)
    at _callCircusTest (/dev/shm/workspace/kibana/node_modules/jest-circus/build/run.js:205:40)
    at process._tickCallback (internal/process/next_tick.js:68:7)

and 6 more failures, only showing the first 3.

Build metrics

✅ unchanged

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants