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

[Fleet] UI to edit custom pipeline|mappings #134760

Merged
merged 17 commits into from
Jun 26, 2022

Conversation

nchaulet
Copy link
Member

@nchaulet nchaulet commented Jun 20, 2022

Summary

Related to #133740
In 8.4.0 we plan to allow user to specify custom ingest pipeline for their Fleet managed datastream, that PR allow to show and edit these pipeline in the Fleet UI.

For this we now show two table in the advanced options section of the datastream in the package policy editor:

  • one for ingest pipeline
  • one for mappings

The link to the mappings are not redirecting bath to the editor it's waiting on that PR to land #134910

In a following PRs I will add:

  • a confirm modal to block user to navigate outside the policy editor if they did not save the policy
  • reopen the datastream when navigating back to Fleet

Usage by custom package policy editor

We are going to expose DatastreamPipeline and DatastreamMappings name and props still subject to change that could be used by integration with custom policy editor to bring back that functionality.

<EuiFlexGroup>
    <EuiFlexItem>
      <PackagePolicyEditorDatastreamPipelines
        dataStream={packageInputStream.data_stream}
        packageInfo={packageInfo}
      />
    </EuiFlexItem>
    <EuiFlexItem>
      <PackagePolicyEditorDatastreamMappings
        dataStream={packageInputStream.data_stream}
        packageInfo={packageInfo}
      />
    </EuiFlexItem>
</EuiFlexGroup>

UI Changes

Screen Shot 2022-06-23 at 10 18 18 AM

@nchaulet nchaulet added release_note:skip Skip the PR/issue when compiling release notes Team:Fleet Team label for Observability Data Collection Fleet team v8.4.0 labels Jun 20, 2022
@nchaulet nchaulet self-assigned this Jun 20, 2022
@nchaulet nchaulet added the ci:no-auto-commit Disable auto-committing changes on CI label Jun 20, 2022
Comment on lines 10 to 11
export { DatastreamPipeline } from './datastream_pipelines';
export { DatastreamMappings } from './datastream_mappings';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to do anything else to export this for other plugins?

Copy link
Member Author

@nchaulet nchaulet Jun 21, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will need to be in the plugin public/index file, I exposed them in the plugin public index file

@nchaulet nchaulet force-pushed the feature-custom-pipeline-ui branch from 17755e7 to 555f073 Compare June 21, 2022 18:50
@nchaulet nchaulet force-pushed the feature-custom-pipeline-ui branch from 67b2e1e to b1eca36 Compare June 22, 2022 17:58
@nchaulet nchaulet marked this pull request as ready for review June 23, 2022 14:22
@nchaulet nchaulet requested a review from a team as a code owner June 23, 2022 14:22
@elasticmachine
Copy link
Contributor

Pinging @elastic/fleet (Team:Fleet)

@nchaulet nchaulet requested a review from joshdover June 23, 2022 14:22
const requiredVars: RegistryVarsEntry[] = [];
// eslint-disable-next-line react-hooks/exhaustive-deps
const advancedVars: RegistryVarsEntry[] = [];
const [requiredVars, advancedVars] = useMemo(() => {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not related to that PR but I add to put this in a useMemo otherwise eslint was complaining

@nchaulet nchaulet requested a review from kpollich June 23, 2022 16:45
Copy link
Member

@kpollich kpollich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code all LGTM, but I have one question below.

When I click the "edit" icon for mappings on the first integration policy created (e.g. I haven't installed Nginx yet, but I'm creating my first policy), I get an error page.

image

image

Do you think there's a way to disable the button(s) if we haven't installed the package yet? Or maybe a better solution?

@nchaulet
Copy link
Member Author

When I click the "edit" icon for mappings on the first integration policy created (e.g. I haven't installed Nginx yet, but I'm creating my first policy), I get an error page.

@kpollich good catch here, I am wondering if we should maybe not display that panel at all on package policy creation, in a coming PR I will add a confirm modal to block the user to navigate if it does not save the integration, and it seems the experience will be better if only show this on edition what do you think?

@kpollich
Copy link
Member

When I click the "edit" icon for mappings on the first integration policy created (e.g. I haven't installed Nginx yet, but I'm creating my first policy), I get an error page.

@kpollich good catch here, I am wondering if we should maybe not display that panel at all on package policy creation, in a coming PR I will add a confirm modal to block the user to navigate if it does not save the integration, and it seems the experience will be better if only show this on edition what do you think?

This makes sense. So we'd only show these panels on edit view, not create view?

@nchaulet
Copy link
Member Author

This makes sense. So we'd only show these panels on edit view, not create view?

Yes I think it will make more sense

@nchaulet nchaulet requested a review from a team as a code owner June 23, 2022 17:48
@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
fleet 723 728 +5

Public APIs missing comments

Total count of every public API that lacks a comment. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats comments for more detailed information.

id before after diff
fleet 1341 1368 +27

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
fleet 839.9KB 833.5KB -6.3KB

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
fleet 95.9KB 110.2KB +14.3KB
Unknown metric groups

API count

id before after diff
fleet 1468 1499 +31

ESLint disabled line counts

id before after diff
fleet 53 52 -1

Total ESLint disabled count

id before after diff
fleet 61 60 -1

History

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

cc @nchaulet

@nchaulet nchaulet merged commit e6c35a6 into elastic:main Jun 26, 2022
@nchaulet nchaulet deleted the feature-custom-pipeline-ui branch June 26, 2022 21:40
@kibanamachine kibanamachine added the backport:skip This commit does not require backporting label Jun 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting ci:no-auto-commit Disable auto-committing changes on CI release_note:skip Skip the PR/issue when compiling release notes Team:Fleet Team label for Observability Data Collection Fleet team v8.4.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants