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

[SIEM][Detections] Value Lists Management Modal #67068

Merged
merged 31 commits into from
Jul 14, 2020

Commits on Jul 1, 2020

  1. Add Frontend components for Value Lists Management Modal

    Imports and uses the hooks provided by the lists plugin. Tests coming
    next.
    rylnd committed Jul 1, 2020
    Configuration menu
    Copy the full SHA
    f807600 View commit details
    Browse the repository at this point in the history
  2. Update value list components to use newest Lists API

    * uses useEffect on a task's state instead of promise chaining
    * handles the fact that API calls can be rejected with strings
    * uses exportList function instead of hook
    rylnd committed Jul 1, 2020
    Configuration menu
    Copy the full SHA
    cc34d86 View commit details
    Browse the repository at this point in the history
  3. Close modal on outside click

    rylnd committed Jul 1, 2020
    Configuration menu
    Copy the full SHA
    af6a86e View commit details
    Browse the repository at this point in the history
  4. Add hook for using a cursor with paged API calls.

    For e.g. findLists, we can send along a cursor to optimize our query. On
    the backend, this cursor is used as part of a search_after query.
    rylnd committed Jul 1, 2020
    Configuration menu
    Copy the full SHA
    bf7fb72 View commit details
    Browse the repository at this point in the history
  5. Better implementation of useCursor

    * Does not require args for setCursor as they're already passed to the
    hook
    * Finds nearest cursor for the same page size
    
    Eventually this logic will also include sortField as part of the
    hash/lookup, but we do not currently use that on the frontend.
    rylnd committed Jul 1, 2020
    Configuration menu
    Copy the full SHA
    38fa27c View commit details
    Browse the repository at this point in the history
  6. Fixes useCursor hook functionality

    We were previously storing the cursor on the _current_ page, when it's
    only truly valid for the _next_ page (and beyond).
    
    This was causing a few issues, but now that it's fixed everything works
    great.
    rylnd committed Jul 1, 2020
    Configuration menu
    Copy the full SHA
    b606f57 View commit details
    Browse the repository at this point in the history
  7. Add cursor to lists query

    This allows us to search_after a previous page's search, if available.
    rylnd committed Jul 1, 2020
    Configuration menu
    Copy the full SHA
    ce1edb2 View commit details
    Browse the repository at this point in the history
  8. Do not validate response of export

    This is just a blob, so we have nothing to validate.
    rylnd committed Jul 1, 2020
    Configuration menu
    Copy the full SHA
    e39116c View commit details
    Browse the repository at this point in the history
  9. Fix double callback post-import

    After uploading a list, the modal was being shown twice. Declaring the
    constituent state dependencies separately fixed the issue.
    rylnd committed Jul 1, 2020
    Configuration menu
    Copy the full SHA
    df70e5c View commit details
    Browse the repository at this point in the history
  10. Update ValueListsForm to manually abort import request

    These hooks no longer care about/expose an abort function. In this one
    case where we need that functionality, we can do it ourselves relatively
    simply.
    rylnd committed Jul 1, 2020
    Configuration menu
    Copy the full SHA
    344b81c View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    23fd1ee View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    e3670ea View commit details
    Browse the repository at this point in the history
  13. Try to fit table contents on a single row

    Dates were wrapping (and raw), and so were wrapped in a FormattedDate
    component. However, since this component didn't wrap, we needed to
    shrink/truncate the uploaded_by field as well as allow the fileName to
    truncate.
    rylnd committed Jul 1, 2020
    Configuration menu
    Copy the full SHA
    c36e959 View commit details
    Browse the repository at this point in the history

Commits on Jul 2, 2020

  1. Add helper function to prevent tests from logging errors

    enzymejs/enzyme#2073 seems to be an ongoing
    issue, and causes components with useEffect to update after the test is
    completed.
    
    waitForUpdates ensures that updates have completed within an act()
    before continuing on.
    rylnd committed Jul 2, 2020
    Configuration menu
    Copy the full SHA
    312fbde View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    9587b7e View commit details
    Browse the repository at this point in the history
  3. Fix translation conflict

    rylnd committed Jul 2, 2020
    Configuration menu
    Copy the full SHA
    ab66483 View commit details
    Browse the repository at this point in the history
  4. Merge branch 'master' into value_lists_ui

     Conflicts:
    	x-pack/plugins/security_solution/public/lists_plugin_deps.ts
    	x-pack/plugins/security_solution/public/overview/pages/overview.test.tsx
    rylnd committed Jul 2, 2020
    Configuration menu
    Copy the full SHA
    7789c91 View commit details
    Browse the repository at this point in the history
  5. Add more waitForUpdates to new overview page tests

    Each of these logs a console.error without them.
    rylnd committed Jul 2, 2020
    Configuration menu
    Copy the full SHA
    f16cf4e View commit details
    Browse the repository at this point in the history
  6. Fix bad merge resolution

    That resulted in duplicate exports.
    rylnd committed Jul 2, 2020
    Configuration menu
    Copy the full SHA
    5be0e87 View commit details
    Browse the repository at this point in the history
  7. Make cursor an optional parameter to findLists

    This param is an optimization and not required for basic functionality.
    rylnd committed Jul 2, 2020
    Configuration menu
    Copy the full SHA
    0e4fee7 View commit details
    Browse the repository at this point in the history
  8. Tweaking Table column sizes

    Makes actions column smaller, leaving more room for everything else.
    rylnd committed Jul 2, 2020
    Configuration menu
    Copy the full SHA
    728b272 View commit details
    Browse the repository at this point in the history

Commits on Jul 3, 2020

  1. Fix bug where onSuccess is called upon pagination change

    Because fetchLists changes when pagination does, and handleUploadSuccess
    changes with fetchLists, our useEffect in Form was being fired on every
    pagination change due to its onSuccess changing.
    
    The solution in this instance is to remove fetchLists from
    handleUploadSuccess's dependencies, as we merely want to invoke
    fetchLists from it, not change our reference.
    rylnd committed Jul 3, 2020
    Configuration menu
    Copy the full SHA
    0abbfc4 View commit details
    Browse the repository at this point in the history

Commits on Jul 6, 2020

  1. Configuration menu
    Copy the full SHA
    e0cb6a5 View commit details
    Browse the repository at this point in the history

Commits on Jul 8, 2020

  1. Merge branch 'master' into value_lists_ui

     Conflicts:
    	x-pack/plugins/security_solution/public/lists_plugin_deps.ts
    	x-pack/plugins/security_solution/public/overview/pages/overview.test.tsx
    rylnd committed Jul 8, 2020
    Configuration menu
    Copy the full SHA
    18459c1 View commit details
    Browse the repository at this point in the history

Commits on Jul 13, 2020

  1. Merge branch 'master' into value_lists_ui

     Conflicts:
    	x-pack/plugins/lists/public/lists/api.test.ts
    	x-pack/plugins/lists/public/lists/api.ts
    	x-pack/plugins/lists/public/shared_exports.ts
    	x-pack/plugins/security_solution/public/common/lib/kibana/hooks.ts
    	x-pack/plugins/security_solution/public/detections/components/value_lists_management_modal/form.test.tsx
    	x-pack/plugins/security_solution/public/detections/components/value_lists_management_modal/form.tsx
    	x-pack/plugins/security_solution/public/detections/components/value_lists_management_modal/index.tsx
    	x-pack/plugins/security_solution/public/detections/components/value_lists_management_modal/modal.test.tsx
    	x-pack/plugins/security_solution/public/detections/components/value_lists_management_modal/modal.tsx
    	x-pack/plugins/security_solution/public/detections/components/value_lists_management_modal/table.test.tsx
    	x-pack/plugins/security_solution/public/detections/components/value_lists_management_modal/table.tsx
    	x-pack/plugins/security_solution/public/detections/components/value_lists_management_modal/translations.ts
    	x-pack/plugins/security_solution/public/lists_plugin_deps.ts
    rylnd committed Jul 13, 2020
    Configuration menu
    Copy the full SHA
    551a435 View commit details
    Browse the repository at this point in the history
  2. Fix failing test

    It looks like this broke because EuiTable's pagination changed from a
    button to an anchor tag.
    rylnd committed Jul 13, 2020
    Configuration menu
    Copy the full SHA
    8fb7e4c View commit details
    Browse the repository at this point in the history
  3. Hide page size options on ValueLists modal table

    These have style issues, and anything above 5 rows causes the modal to
    scroll, so we're going to disable it for now.
    rylnd committed Jul 13, 2020
    Configuration menu
    Copy the full SHA
    e496614 View commit details
    Browse the repository at this point in the history
  4. Update error callbacks now that we have Errors

    We don't display the nice errors in the case of an ApiError right now,
    but this is better than it was.
    rylnd committed Jul 13, 2020
    Configuration menu
    Copy the full SHA
    3f12007 View commit details
    Browse the repository at this point in the history
  5. Synchronize delete with the subsequent fetch

    Our start() no longer resolves in a meaningful way, so we instead need
    to perform the refetch in an effect watching the result of our delete.
    rylnd committed Jul 13, 2020
    Configuration menu
    Copy the full SHA
    bc984c4 View commit details
    Browse the repository at this point in the history

Commits on Jul 14, 2020

  1. Cast our unknown error to an Error

    useAsync generally does not know how what its tasks are going to be
    rejected with, hence the unknown.
    
    For these API calls we know that it will be an Error, but I don't
    currently have a way to type that generally. For now, we'll cast it
    where we use it.
    rylnd committed Jul 14, 2020
    Configuration menu
    Copy the full SHA
    66d8241 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    59e3b02 View commit details
    Browse the repository at this point in the history