[Fleet] Hide many actions for hosted agent policies#96160
[Fleet] Hide many actions for hosted agent policies#96160jfsiii merged 10 commits intoelastic:masterfrom jfsiii:managed-policy-hide-restricted-actions
Conversation
|
Pinging @elastic/fleet (Team:Fleet) |
|
@elasticmachine merge upstream |
💛 Build succeeded, but was flaky
Test FailuresKibana Pipeline / general / Chrome UI Functional Tests.test/functional/apps/discover/_huge_fields·ts.discover app test large number of fields in sidebar "before all" hook for "test_huge data should have expected number of fields"Standard OutStack TraceMetrics [docs]Async chunks
History
To update your PR or re-run it, just comment with: cc @jfsiii |
| const isAgentSelectable = (agent: Agent) => { | ||
| if (!agent.active) return false; | ||
|
|
||
| const agentPolicy = agentPolicies.find((p) => p.id === agent.policy_id); |
There was a problem hiding this comment.
I am wondering if we should index policy per id at some point we are going to loop a lot of time over this policy list
There was a problem hiding this comment.
actually looks like we do agentPoliciesIndexedById
There was a problem hiding this comment.
Good eyes. Thanks! This replaced a few instances of .find with byId but looks likes it missed one (some?). I'll review and fix as a part of the next PR in this series.
nchaulet
left a comment
There was a problem hiding this comment.
a small comment but nothing blocking 🚀
## Summary Fixes items 2a, 4a, 5c2, and 6 from elastic#91906 ### 2a - On the agents table, remove all actions except for "View agent" [code commit](elastic@a93dd8c) <img width="1090" alt="Screen Shot 2021-04-02 at 2 00 34 PM" src="https://user-images.githubusercontent.com/57655/113446102-1b40bd00-93c5-11eb-804b-2afec37a176b.png"> <img width="1100" alt="Screen Shot 2021-04-02 at 2 00 41 PM" src="https://user-images.githubusercontent.com/57655/113446103-1b40bd00-93c5-11eb-8aba-daa1aa539955.png"> ### 4a & 5c2 On the agent policy list page, remove the "add agent" & "copy policy" actions which appears in the [...] actions menu [code commit](elastic@f0c267f) <img width="1067" alt="Screen Shot 2021-04-02 at 2 36 57 PM" src="https://user-images.githubusercontent.com/57655/113446281-7b376380-93c5-11eb-9f82-03e957e6656c.png"> <img width="1104" alt="Screen Shot 2021-04-02 at 2 37 02 PM" src="https://user-images.githubusercontent.com/57655/113446282-7bcffa00-93c5-11eb-942c-1a98ebbab385.png"> ### 6 - Do not show the the "revoke token" trash icon [code commit](elastic@cd05cd0) <img width="1088" alt="Screen Shot 2021-04-02 at 2 15 54 PM" src="https://user-images.githubusercontent.com/57655/113446176-4a572e80-93c5-11eb-9740-9723c1cb9f50.png"> Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
## Summary Fixes items 2a, 4a, 5c2, and 6 from #91906 ### 2a - On the agents table, remove all actions except for "View agent" [code commit](a93dd8c) <img width="1090" alt="Screen Shot 2021-04-02 at 2 00 34 PM" src="https://user-images.githubusercontent.com/57655/113446102-1b40bd00-93c5-11eb-804b-2afec37a176b.png"> <img width="1100" alt="Screen Shot 2021-04-02 at 2 00 41 PM" src="https://user-images.githubusercontent.com/57655/113446103-1b40bd00-93c5-11eb-8aba-daa1aa539955.png"> ### 4a & 5c2 On the agent policy list page, remove the "add agent" & "copy policy" actions which appears in the [...] actions menu [code commit](f0c267f) <img width="1067" alt="Screen Shot 2021-04-02 at 2 36 57 PM" src="https://user-images.githubusercontent.com/57655/113446281-7b376380-93c5-11eb-9f82-03e957e6656c.png"> <img width="1104" alt="Screen Shot 2021-04-02 at 2 37 02 PM" src="https://user-images.githubusercontent.com/57655/113446282-7bcffa00-93c5-11eb-942c-1a98ebbab385.png"> ### 6 - Do not show the the "revoke token" trash icon [code commit](cd05cd0) <img width="1088" alt="Screen Shot 2021-04-02 at 2 15 54 PM" src="https://user-images.githubusercontent.com/57655/113446176-4a572e80-93c5-11eb-9740-9723c1cb9f50.png"> Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: John Schulz <john.schulz@elastic.co>
|
Hi @EricDavisX We have validated above merges on latest 8.0 snapshot environment and found them working fine. After converting a user created policy under which agent was installed to Managed policy using API, we have observed following changes working fine.
Build details: Thanks |
Summary
Fixes items 2a, 4a, 5c2, and 6 from #91906
2a - On the agents table, remove all actions except for "View agent"
code commit
4a & 5c2 On the agent policy list page, remove the "add agent" & "copy policy" actions which appears in the [...] actions menu
code commit


6 - Do not show the the "revoke token" trash icon
code commit
