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

[SECURITY_SOLUTION] Trusted apps list expand/collapse details #78601

Merged
merged 13 commits into from
Sep 30, 2020

Conversation

efreeti
Copy link
Contributor

@efreeti efreeti commented Sep 28, 2020

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.

trusted app details

Checklist

Delete any items that are not applicable to this PR.

@kevinlog
Copy link
Contributor

initial pass through LGTM. I like the storybook and the code is written in a way to make change component data input easy.

@efreeti efreeti self-assigned this Sep 29, 2020
@efreeti efreeti added Feature:Endpoint Elastic Endpoint feature release_note:skip Skip the PR/issue when compiling release notes Team:Endpoint Management v7.10.0 v8.0.0 labels Sep 29, 2020
@efreeti efreeti marked this pull request as ready for review September 29, 2020 12:47
@efreeti efreeti requested review from a team as code owners September 29, 2020 12:47
@elasticmachine
Copy link
Contributor

Pinging @elastic/endpoint-app-team (Feature:Endpoint)

@elasticmachine
Copy link
Contributor

Pinging @elastic/endpoint-management (Team:Endpoint Management)

@kevinlog
Copy link
Contributor

pulled it down and tried it out, flow feels good and table looks good!

image

Copy link
Contributor

@kevinlog kevinlog left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@paul-tavares paul-tavares left a comment

Choose a reason for hiding this comment

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

Looks good.
Minor questions/comments - none of which should hold this up

PropsForButton,
} from '@elastic/eui';

const OTHER_NODES = {};
Copy link
Contributor

Choose a reason for hiding this comment

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

You are only using this object as a key to the Map() right? If so, consider using a Symbol() instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will do that as part of my next story.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed this in a follow up PR.


ItemDetailsAction.displayName = 'ItemDetailsAction';

export const ItemDetailsCard: FC = memo(({ children }) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

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?

Copy link
Contributor

Choose a reason for hiding this comment

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

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes.

changedMap[item.id] = (
<TrustedAppCard
trustedApp={item}
onDelete={() => {
Copy link
Contributor

Choose a reason for hiding this comment

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

is there a way you can memoize this callback?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

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]
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this really being memoized? I think children will always be new JSX, no?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll be honest I have no clue :D

Copy link
Contributor

@paul-tavares paul-tavares left a comment

Choose a reason for hiding this comment

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

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.

@kevinlog
Copy link
Contributor

merging for @efreeti

@kevinlog kevinlog merged commit b6db62e into elastic:master Sep 30, 2020
@kevinlog kevinlog changed the title Trusted apps list expand/collapse details [SECURITY_SOLUTION] Trusted apps list expand/collapse details Sep 30, 2020
kevinlog pushed a commit to kevinlog/kibana that referenced this pull request Sep 30, 2020
@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

@kbn/optimizer bundle module count

id value diff baseline
securitySolution 1973 +3 1970

async chunks size

id value diff baseline
securitySolution 10.2MB +30.2KB 10.2MB

History

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

gmmorris added a commit to gmmorris/kibana that referenced this pull request Sep 30, 2020
* 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)
  ...
kevinlog added a commit that referenced this pull request Sep 30, 2020
#78989)

Co-authored-by: Bohdan Tsymbala <bohdan.tsymbala@elastic.co>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Endpoint Elastic Endpoint feature release_note:skip Skip the PR/issue when compiling release notes v7.10.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants