[SECURITY_SOLUTION] Trusted apps list expand/collapse details#78601
[SECURITY_SOLUTION] Trusted apps list expand/collapse details#78601kevinlog merged 13 commits intoelastic:masterfrom
Conversation
…e is more than one item.
...ck/plugins/security_solution/public/management/pages/trusted_apps/view/trusted_apps_list.tsx
Show resolved
Hide resolved
|
initial pass through LGTM. I like the storybook and the code is written in a way to make change component data input easy. |
|
Pinging @elastic/endpoint-app-team (Feature:Endpoint) |
|
Pinging @elastic/endpoint-management (Team:Endpoint Management) |
x-pack/plugins/security_solution/public/common/components/item_details_card/index.tsx
Show resolved
Hide resolved
paul-tavares
left a comment
There was a problem hiding this comment.
Looks good.
Minor questions/comments - none of which should hold this up
| PropsForButton, | ||
| } from '@elastic/eui'; | ||
|
|
||
| const OTHER_NODES = {}; |
There was a problem hiding this comment.
You are only using this object as a key to the Map() right? If so, consider using a Symbol() instead.
There was a problem hiding this comment.
Will do that as part of my next story.
There was a problem hiding this comment.
Fixed this in a follow up PR.
|
|
||
| ItemDetailsAction.displayName = 'ItemDetailsAction'; | ||
|
|
||
| export const ItemDetailsCard: FC = memo(({ children }) => { |
There was a problem hiding this comment.
Its the first time I'm seeing this type of component, so let just see if I got this right:
this Component can take in any type of children allowed by React.Children type, and then it groups those components up by Type (a specific React component type) and uses those groupings to actually build the returned card.
Do I have that right?
There was a problem hiding this comment.
One other request. Because the approach taken with this component is so different from existing ones, can you add TS typings to the children prop so that consumers of this can have a bit of help understanding how to use it?
| changedMap[item.id] = ( | ||
| <TrustedAppCard | ||
| trustedApp={item} | ||
| onDelete={() => { |
There was a problem hiding this comment.
is there a way you can memoize this callback?
There was a problem hiding this comment.
Will do that as part of my next story, somehow slipped through.
| export const ItemDetailsCard: FC = memo(({ children }) => { | ||
| const childElements = useMemo( | ||
| () => groupChildrenByType(children, [ItemDetailsPropertySummary, ItemDetailsAction]), | ||
| [children] |
There was a problem hiding this comment.
Is this really being memoized? I think children will always be new JSX, no?
There was a problem hiding this comment.
I'll be honest I have no clue :D
paul-tavares
left a comment
There was a problem hiding this comment.
I posted another two comments, but still maintaint that none are reuqired or should block this PR from being merged. They can be followed up on post-merge.
|
merging for @efreeti |
💚 Build SucceededMetrics [docs]@kbn/optimizer bundle module count
async chunks size
History
To update your PR or re-run it, just comment with: |
* master: (97 commits) [Actions] Adds a "Test Connector" button on the Connectors List to make discovery of the Test tab easier (elastic#78746) [Discover] Fix functional time picker test permissions (elastic#78564) [ML] Fixing module datafeed overrides (elastic#78925) Adds some missing licenses to the CSV export (elastic#78719) [dev/cli] ensure plugins/ and all watch source dirs exist (elastic#78973) [Lens] Stop using scripted metric to collect telemetry (elastic#78687) [Lens] fix wrong message in fields accordion (elastic#78924) [Enterprise Search][App Search] Credentials Logic updates (elastic#78644) [Monitoring] Disk usage alerting (elastic#75419) [SECURITY_SOLUTION] Trusted apps list expand/collapse details (elastic#78601) Update content on interstitial page (elastic#78881) chore(NA): include hjson as a prod dependency (elastic#78941) Fix empty meta fields input in Advanced Settings (elastic#78576) [Lens] Maintain order of operations in dimension panel (elastic#78864) Fix plugin doc title (elastic#78880) load apm-rum agent lazily (elastic#78760) [ML] Skip full ML access permission test Optimize charts plugin (elastic#78922) ui_actions service initial docs (elastic#78902) skip failing suite (elastic#78942) ...
#78989) Co-authored-by: Bohdan Tsymbala <bohdan.tsymbala@elastic.co>

Summary
Added a component to visualise trusted app as a card (with some generic components extracted out). Integrated card component into the list as expand/collapse functionality.
Checklist
Delete any items that are not applicable to this PR.