[Fleet] Integration Policies List view#83634
Conversation
…integrations-policies-list
…integrations-policies-list
…integrations-policies-list
…integrations-policies-list
|
Pinging @elastic/ingest-management (Team:Ingest Management) |
| * value is truncated if it is longer than the width of where it is displayed, while the revision | ||
| * always remain visible | ||
| */ | ||
| export const LinkAndRevision = memo<LinkAndRevisionProps>( |
There was a problem hiding this comment.
FYI - I would like to add to this component a isOutdated: boolean prop and then refactor the Agents List view to also use this component. I have a feeling that the outdated indicator will also be wanted in other scenarios.
There was a problem hiding this comment.
this would also be good for our Endpoint list
There was a problem hiding this comment.
yes @kevinlog , we would likely have a similar component in our code base.
| /** | ||
| * Uses URL params for pagination and also persists those to the URL as they are updated | ||
| */ | ||
| export const useUrlPagination = (): UrlPagination => { |
There was a problem hiding this comment.
I thought about changing the existing usePagination() to always persist the page/perPage to the URL, but that could have a large impact in testing to ensure it does not break anything. So for now, I went with a separate hook which could be merged and/or used if the use case calls for these parameters to be persisted in the URL.
…integrations-policies-list
…integrations-policies-list
| import { GetPackagePoliciesResponse } from '../../../../../../../common/types/rest_spec'; | ||
|
|
||
| export interface PackagePolicyEnriched extends PackagePolicy { | ||
| _agentPolicy: GetAgentPoliciesResponseItem | undefined; |
There was a problem hiding this comment.
is the naming convention with _ just to denote that it's an enriched field and not a part of the saved objet?
There was a problem hiding this comment.
yes, exactly. I was looking for a property name that would not collide with any future addition to the object. I went with a prefix of _ but had also thought about using a $ suffix (ex. agentPolicy$)
|
LGTM from a functionality perspective, but needs an Ingest review |
...t/public/applications/fleet/sections/epm/screens/detail/use_get_enriched_package_policies.ts
Outdated
Show resolved
Hide resolved
nchaulet
left a comment
There was a problem hiding this comment.
Just one comment otherwise work as expected 🚀
|
Never mind - I confused this with the other PR I have pending |
…integrations-policies-list
…integrations-policies-list
…integrations-policies-list # Conflicts: # x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/step_select_agent_policy.tsx
| // once parsed, would be an array. In these case, we take the last value defined | ||
| pagination.currentPage = Number( | ||
| (Array.isArray(urlParams.currentPage) | ||
| ? urlParams.currentPage[urlParams.currentPage.length - 1] |
There was a problem hiding this comment.
I believe .pop() will give the same result. If so, I'd prefer it as it's less statements to read.
| ? urlParams.currentPage[urlParams.currentPage.length - 1] | |
| ? urlParams.currentPage.pop() |
There was a problem hiding this comment.
Wow - why did I not think of that 🤦
Thanks @jfsiii . going to merge this in, and will adjust this based on your comments in next PR.
There was a problem hiding this comment.
@paul-tavares no worries, It Depends ™️, right :) .pop() does alter the array. I didn't see it used again so seems it works for now, but there are trade-offs.
I really wish we could urlParams.currentPage[-1] like perl/python.
After writing this I went looking and found that we can't do arr[-2] but arr.at(-2) is coming eventually via .at() method. I don't see anything about it in any of the feature support sites but it is stage 3 now, so 🤞
| pagination.pageSize = | ||
| Number( | ||
| (Array.isArray(urlParams.pageSize) | ||
| ? urlParams.pageSize[urlParams.pageSize.length - 1] |
There was a problem hiding this comment.
same question/comment re: .pop()
💚 Build SucceededMetrics [docs]Module Count
Async chunks
History
To update your PR or re-run it, just comment with: |
* master: (41 commits) [Maps] fix code-owners (elastic#84265) [@kbn/utils] Clean target before build (elastic#84253) [code coverage] collect for oss integration tests (elastic#83907) [APM] Use `asTransactionRate` consistently everywhere (elastic#84213) Attempt to fix incremental build error (elastic#84152) Unskip "Copy dashboards to space" (elastic#84115) Remove expressions.legacy from README (elastic#79681) Expression: Add render mode and use it for canvas interactivity (elastic#83559) [deb/rpm] Move systemd service to /usr/lib/systemd/system (elastic#83571) [Security Solution][Resolver] Allow a configurable entity_id field (elastic#81679) [ML] Space permision checks for job deletion (elastic#83871) [build] Provide ARM build of RE2 (elastic#84163) TSVB should use "histogram:maxBars" and "histogram:barTarget" settings for auto instead of a default 100 buckets (elastic#83628) [Workplace Search] Initial rendering of Org Sources (elastic#84164) update geckodriver to 0.28 (elastic#84085) Fix timelion vis escapes single quotes (elastic#84196) [Security Solution] Fix incorrect time for dns histogram (elastic#83532) [DX] Bump TS version to v4.1 (elastic#83397) [Security Solution] Add endpoint policy revision number (elastic#83982) [Fleet] Integration Policies List view (elastic#83634) ...
Summary
Adds a
Policiestab to the details of an Integration Package that displays the list of all Integration Policies for the given package across all Agent Policies. View allows user to:This view is not shown for Integrations that are not yet installed.
Closes #82485
Checklist