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] Allow global data tags to be readonly #187161

Merged
merged 2 commits into from
Jul 2, 2024

Conversation

nchaulet
Copy link
Member

@nchaulet nchaulet commented Jun 28, 2024

Summary

Resolve #187045

Implement a disabled state for global data tags.

UI Changes

With a user that has read only access to agent policies

Screenshot 2024-06-28 at 10 22 29 AM Screenshot 2024-06-28 at 10 20 12 AM

Test

This change is covered by unit tests

Further discusssions

@elastic/fleet, @cmacknz had a really good point on how we can prevent this kind of bugs to appear? this one is a little specific as it is a really custom component, but in general maybe we could benefits of unifying a little how we build our forms and support disabled forms, consider using a form library something like formik? it looks like there is so many ways form are implemented in Kibana

@nchaulet nchaulet added bug Fixes for quality problems that affect the customer experience release_note:skip Skip the PR/issue when compiling release notes Team:Fleet Team label for Observability Data Collection Fleet team labels Jun 28, 2024
@nchaulet nchaulet self-assigned this Jun 28, 2024
@nchaulet nchaulet requested a review from a team as a code owner June 28, 2024 14:45
@obltmachine
Copy link

🤖 GitHub comments

Expand to view the GitHub comments

Just comment with:

  • /oblt-deploy : Deploy a Kibana instance using the Observability test environments.
  • run docs-build : Re-trigger the docs validation. (use unformatted text in the comment!)

@jen-huang
Copy link
Contributor

@elastic/fleet, @cmacknz had a really good point on how we can prevent this kind of bugs to appear? this one is a little specific as it is a really custom component, but in general maybe we could benefits of unifying a little how we build our forms and support disabled forms, consider using a form library something like formik? it looks like there is so many ways form are implemented in Kibana

Forms are complex. IMO it's a losing battle trying to engineer a comprehensive solution against all possible permutations. That said, we do have enough usage examples of "disable entire form" to give to the EUI team for them to brainstorm possible EUI solutions that could work across Kibana.

Copy link
Contributor

@jen-huang jen-huang left a comment

Choose a reason for hiding this comment

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

Code LGTM

@kpollich
Copy link
Member

had a really good point on how we can prevent this kind of bugs to appear? this one is a little specific as it is a really custom component, but in general maybe we could benefits of unifying a little how we build our forms and support disabled forms, consider using a form library something like formik? it looks like there is so many ways form are implemented in Kibana

The form implementation provided by EUI is opinionated in some ways, but is generally not opinionated with how form state is handled. This is where libraries like Formik or https://react-hook-form.com/ could be considered useful. We'd still need to build meaningful abstractions around whatever library we put in place to do things like disabling forms when certain permissions are not met, so I think we'd still need new patterns in place to prevent things like this in the future.

I agree with the sentiment though that any time we build a CRUD form for a particular resource it should be impossible for the form to be editable without the core permissions required to edit that resource.

@nchaulet
Copy link
Member Author

nchaulet commented Jul 2, 2024

@elasticmachine merge upstream

@nchaulet nchaulet enabled auto-merge (squash) July 2, 2024 13:45
@nchaulet nchaulet merged commit ae30c30 into elastic:main Jul 2, 2024
24 of 25 checks passed
@kibana-ci
Copy link
Collaborator

💛 Build succeeded, but was flaky

Failed CI Steps

Metrics [docs]

Async chunks

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

id before after diff
fleet 1.8MB 1.8MB +308.0B

History

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

cc @nchaulet

@kibanamachine kibanamachine added v8.15.0 backport:skip This commit does not require backporting labels Jul 2, 2024
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 bug Fixes for quality problems that affect the customer experience release_note:skip Skip the PR/issue when compiling release notes Team:Fleet Team label for Observability Data Collection Fleet team v8.15.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Fleet]: Custom Field is editable under Agent policy settings with user role Fleet: Read.
7 participants