* Fixed assertion to check through all indices before making assertion.
* Restored yarn.lock file.
* Removed only from describe.
* Fixed linting issue.
* Fixed nits that were in the PR conversation.
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
### Summary
This PR creates the bulk functionality of the exception builder. The exception builder is the component that will be used to create exception list items. It does not deal with the actual API creation/deletion/update of exceptions, it does contain an `onChange` handler that can be used to access the exceptions. The builder is able to:
- accept `ExceptionListItem` and render them correctly
- allow user to add exception list item and exception list item entries
- accept an `indexPattern` and use it to fetch relevant field and autocomplete field values
- disable `Or` button if user is only allowed to edit/add to exception list item (not add additional exception list items)
- displays `Add new exception` button if no exception items exist
- An exception item can be created without entries, the `add new exception` button will show in the case that an exception list contains exception list item(s) with an empty `entries` array (as long as there is one exception list item with an item in `entries`, button does not show)
- debounces field value autocomplete searches
- bubble up exceptions to parent component, stripping out any empty entries
* Rename `datasource` saved object to `package_config` (SO type `ingest-datasource` to `ingest-package-config`) and adjust mappings:
- Remove unused `processors` field on input & stream levels
- Remove unnecessary `enabled` field on package config & input levels
- Rename `agent_stream` field to `compiled_stream`
- Reorder other fields so that important fields are closer to top & similar fields are grouped together
Also,
- Remove 7.9.0 migrations as we are not supporting an upgrade path from experimental to beta release
* Pluralize `ingest-package-configs` for consistency
* Rename `Datasource`-related types to `PackageConfig`, update all references (does not include actual type definition changes yet)
* Rename `Datasource` schemas and rest spec typings to `PackageConfig` (does not include actual schema changes yet)
* Change `datasources` on agent config typings and schemas to `package_configs` and update all references
* Add back `enabled` field on package config and input levels. They are needed for current & future UI features. Also:
- Match types and schemas with saved object mappings (`agent_stream` to `compiled_stream`, removal of `processors`)
- Set `namespace` to be a required property on agent config and package config types, add validation support for it on UI
* Rename server-side datasource references in file names, variable names, and routes
* Update spec file and schema file
* Update doc wording
* Rename all instances of datasource in file paths and variable names on client sides, and for Endpoint too
* Minor copy adjustments, fix i18n check
* Replace datasource references in tests and fixtures; remove unused `ingest/policies` es archiver data
* Fix tests
* Fix test field name
* Fix test fixtures fields again
* Fix i18n
* Use modern mount context in Dev Tools and Console, and clean up plugin definitions of Grok Debugger, Search Profiler, and Painless Lab.
* Remove return value from Console lifecycle method.
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
* Refactor generator for ancestry support
* Adding optional ancestry array
* Fixing tests and type errors
* Removing useAncestry field
* Fixing test
* An empty array will be returned because that's how ES will do it too
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
* Add wrapper function to make an AbortSignal arg optional
Components commonly do not care about aborting a request, but are
required to pass `{ signal: new AbortController().signal }` anyway. This
addresses that use case.
* Adds hook for retrieving the component's mount status
This is useful for dealing with asynchronous tasks that may complete
after the invoking component has been unmounted. Using this hook,
callbacks can determine whether they're currently unmounted, i.e.
whether it's safe to set state or not.
* Add our own implemetation of useAsync
This does not suffer from the Typescript issues that the react-use
implementation had, and is generally a cleaner hook than useAsyncTask as
it makes no assumptions about the underlying function.
* Update exported Lists API hooks to use useAsync and withOptionalSignal
Removes the now-unused useAsyncTask as well.
* Add some JSDoc for our new functions
* add _meta field to index templates
* fix typescript issue
* make package an object
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
* refactor: 💡 rename folder to "explore_data"
* style: 💄 check for "share" plugin in more semantic way
"explore data" actions use Discover URL generator, which is registered
in "share" plugin, which is optional plugin, so we check for its
existance, because otherwise URL generator is not available.
* refactor: 💡 move KibanaURL to a separate file
* feat: 🎸 add "Explore underlying data" in-chart action
* fix: 🐛 fix imports after refactor
* feat: 🎸 add start.filtersFromContext to embeddable plugin
* feat: 🎸 add type checkers to data plugin
* feat: 🎸 better handle empty filters in Discover URL generator
* feat: 🎸 implement .getUrl() method of explore data in-chart act
* feat: 🎸 add embeddable.filtersAndTimeRangeFromContext()
* feat: 🎸 improve getUrl() method of explore data action
* test: 💍 update test mock
* fix possible stale hashHistory.location in discover
* style: 💄 ensureHashHistoryLocation -> syncHistoryLocations
* docs: ✏️ update autogenerated docs
* test: 💍 add in-chart "Explore underlying data" unit tests
* test: 💍 add in-chart "Explore underlying data" functional tests
* test: 💍 clean-up custom time range after panel action tests
* chore: 🤖 fix embeddable plugin mocks
* chore: 🤖 fix another mock
* test: 💍 add support for new action to pie chart service
* feat: 🎸 enable "Explore underlying data" action for Lens vis
* test: 💍 make tests green again
* refactor: 💡 rename trigger contexts
* chore: 🤖 fix TypeScript errors
Co-authored-by: Anton Dosov <anton.dosov@elastic.co>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
* remove unused piece of state
* Move related event total calculation to selector
* rename xScale
* remove `let`
* Move `dispatch` call out of HTTP try-catch
* add POC logic to modify the 'from' param in the search
* fixes formatting for appending gap diff to from
* computes new max signals based on how many intervals of rule runs were missed when gap in consecutive rule runs is detected
* adds logging, fixes bug where we could end up with negative values for diff, adds calculatedFrom to the search after query
* remove console.log and for some reason two eslint disables were added so i removed one of them
* rename variables, add test based on log message - need to figure out a better way to test this
* remove unused import
* fully re-worked the algorithm for searching discrete time periods, still need search_after because a user could submit a rule with a custom maxSignals so that would still serve a purpose. This needs heavy refactoring though, and tests.
* updated loop to include maxSignals per time interval tuple, this way we guarantee maxSignals per full rule interval. Needs some refactoring though.
* move logic into utils function, utils function still needs refactoring
* adds unit tests and cleans up new util function for determining time intervals for searching to occur
* more code cleanup
* remove more logging statements
* fix type errors
* updates unit tests and fixes bug where search result would return 0 hits but we were accessing property on non-existent hit item
* fix rebase conflict
* fixes a bug where a negative gap could exist if a rule ran before the lookback time, also fixes a bug where the search and bulk loop would return false when successful.
* gap is a duration, not a number.
* remove logging variable
* remove logging function from test
* fix type import from rebase with master
* updates missed test when rebased with master, removes unused import
* modify log statements to include meta information for logged rule events, adds tests
* remove unnecessary ts-ignores
* indentation on stringify
* adds a test to ensure we are parsing the elapsed time correctly