Skip to content

Conversation

@jen-huang
Copy link
Contributor

@jen-huang jen-huang commented Apr 6, 2023

Summary

Please review with whitespace ignore!

In #143097 the conditional for showing Advanced options was removed as we introduced experimental indexing toggles which are always shown. However in #148418 (8.7) we put the indexing toggles behind a feature flag. This caused the Advanced options toggle to always be shown regardless of there is any content underneath. I spotted this while testing something unrelated.

This PR fixes that by adding a condition back that is based on aggregating the conditionals of everything underneath (existence of advanced vars, whether pipelines & mappings are shown, and if experimental indexing toggles are enabled).

@jen-huang jen-huang added release_note:fix Team:Fleet Team label for Observability Data Collection Fleet team backport:prev-minor labels Apr 6, 2023
@jen-huang jen-huang self-assigned this Apr 6, 2023
@ghost
Copy link

ghost commented Apr 6, 2023

🤖 GitHub comments

Expand to view the GitHub comments

Just comment with:

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

@jen-huang jen-huang marked this pull request as ready for review April 6, 2023 23:15
@jen-huang jen-huang requested a review from a team as a code owner April 6, 2023 23:15
@elasticmachine
Copy link
Contributor

Pinging @elastic/fleet (Team:Fleet)

@kibana-ci
Copy link

💚 Build Succeeded

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 942.2KB 942.3KB +70.0B
Unknown metric groups

ESLint disabled line counts

id before after diff
securitySolution 433 436 +3

Total ESLint disabled count

id before after diff
securitySolution 513 516 +3

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

cc @jen-huang

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.

LGTM 🚀

@jen-huang jen-huang merged commit 2636262 into elastic:main Apr 11, 2023
@jen-huang jen-huang deleted the fix/policy-editor-advanced-settings branch April 11, 2023 18:32
@kibanamachine
Copy link
Contributor

💔 All backports failed

Status Branch Result
8.7 Backport failed because of merge conflicts

Manual backport

To create the backport manually run:

node scripts/backport --pr 154612

Questions ?

Please refer to the Backport tool documentation

jen-huang added a commit to jen-huang/kibana that referenced this pull request Apr 11, 2023
…elastic#154612)

## Summary

_Please review with [whitespace
ignore](https://github.com/elastic/kibana/pull/154612/files?diff=unified&w=1)!_

In elastic#143097 the conditional for showing `Advanced options` was removed as
we introduced experimental indexing toggles which are always shown.
However in elastic#148418 (8.7) we put the indexing toggles behind a feature
flag. This caused the `Advanced options` toggle to always be shown
regardless of there is any content underneath. I spotted this while
testing something unrelated.

This PR fixes that by adding a condition back that is based on
aggregating the conditionals of everything underneath (existence of
advanced vars, whether pipelines & mappings are shown, and if
experimental indexing toggles are enabled).

(cherry picked from commit 2636262)

# Conflicts:
#	x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/components/steps/components/package_policy_input_stream.tsx
jen-huang added a commit that referenced this pull request Apr 11, 2023
…howing (#154612) (#154784)

# Backport

This will backport the following commits from `main` to `8.7`:
- [[Fleet] Fix "Advanced options" toggle in policy editor always showing
(#154612)](#154612)

<!--- Backport version: 8.9.7 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Jen
Huang","email":"[email protected]"},"sourceCommit":{"committedDate":"2023-04-11T18:32:05Z","message":"[Fleet]
Fix \"Advanced options\" toggle in policy editor always showing
(#154612)\n\n## Summary\r\n\r\n_Please review with
[whitespace\r\nignore](https://github.com/elastic/kibana/pull/154612/files?diff=unified&w=1)!_\r\n\r\nIn
#143097 the conditional for showing `Advanced options` was removed
as\r\nwe introduced experimental indexing toggles which are always
shown.\r\nHowever in #148418 (8.7) we put the indexing toggles behind a
feature\r\nflag. This caused the `Advanced options` toggle to always be
shown\r\nregardless of there is any content underneath. I spotted this
while\r\ntesting something unrelated.\r\n\r\nThis PR fixes that by
adding a condition back that is based on\r\naggregating the conditionals
of everything underneath (existence of\r\nadvanced vars, whether
pipelines & mappings are shown, and if\r\nexperimental indexing toggles
are
enabled).","sha":"2636262e093f188e4937d192d302607eeaafff85","branchLabelMapping":{"^v8.8.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Team:Fleet","backport:prev-minor","v8.8.0"],"number":154612,"url":"https://github.com/elastic/kibana/pull/154612","mergeCommit":{"message":"[Fleet]
Fix \"Advanced options\" toggle in policy editor always showing
(#154612)\n\n## Summary\r\n\r\n_Please review with
[whitespace\r\nignore](https://github.com/elastic/kibana/pull/154612/files?diff=unified&w=1)!_\r\n\r\nIn
#143097 the conditional for showing `Advanced options` was removed
as\r\nwe introduced experimental indexing toggles which are always
shown.\r\nHowever in #148418 (8.7) we put the indexing toggles behind a
feature\r\nflag. This caused the `Advanced options` toggle to always be
shown\r\nregardless of there is any content underneath. I spotted this
while\r\ntesting something unrelated.\r\n\r\nThis PR fixes that by
adding a condition back that is based on\r\naggregating the conditionals
of everything underneath (existence of\r\nadvanced vars, whether
pipelines & mappings are shown, and if\r\nexperimental indexing toggles
are
enabled).","sha":"2636262e093f188e4937d192d302607eeaafff85"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v8.8.0","labelRegex":"^v8.8.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/154612","number":154612,"mergeCommit":{"message":"[Fleet]
Fix \"Advanced options\" toggle in policy editor always showing
(#154612)\n\n## Summary\r\n\r\n_Please review with
[whitespace\r\nignore](https://github.com/elastic/kibana/pull/154612/files?diff=unified&w=1)!_\r\n\r\nIn
#143097 the conditional for showing `Advanced options` was removed
as\r\nwe introduced experimental indexing toggles which are always
shown.\r\nHowever in #148418 (8.7) we put the indexing toggles behind a
feature\r\nflag. This caused the `Advanced options` toggle to always be
shown\r\nregardless of there is any content underneath. I spotted this
while\r\ntesting something unrelated.\r\n\r\nThis PR fixes that by
adding a condition back that is based on\r\naggregating the conditionals
of everything underneath (existence of\r\nadvanced vars, whether
pipelines & mappings are shown, and if\r\nexperimental indexing toggles
are enabled).","sha":"2636262e093f188e4937d192d302607eeaafff85"}}]}]
BACKPORT-->

---------

Co-authored-by: kibanamachine <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release_note:fix Team:Fleet Team label for Observability Data Collection Fleet team v8.7.1 v8.8.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants