* [Maps] refactor isPointsOnly, isLinesOnly, and isPolygonsOnly to make synchronous
* fix jest test
* review feedback
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
* add unimplemented registerAppStatusUpdater & remove observers for apps and legacyApps
* adapt NavLinksService to use new application observables
* merge availableApps$ and availableLegacyApps$
* updating core docs
* adapt the navLink updating methods
* filters the inaccessible apps from availableApps$
* restrict access to navigateToApp depending on app status
* fixes due to merge
* add statusUpdater$ to AppBase
* export new types
* disable navlink depending on app status
* update generated doc
* update snapshots for disabled prop
* Address josh review
* Address review comments
* fix merge conflicts
* adapt changes due to merge
* update generated doc
* add comment and fix navlink url for custom url apps
* add AppNavLinkStatus type to split app/navlink states
* fix typo
* review comments and improvements
* add functional tests
* update generated docs and migration guide
* fix wrong type cast on AppsMenuProvider.readLinks
* properly type return of navigateToApp
* Initial role mappings UI
* apply design edits
* address PR feedback
* fix type cast for number field
* Update x-pack/legacy/plugins/security/public/views/management/role_mappings/edit_role_mapping/components/mapping_info_panel/mapping_info_panel.tsx
Co-Authored-By: Joe Portner <5295965+jportner@users.noreply.github.com>
* Cleanup FTR configuration, and handle role mapping 404 errors properly
* align naming of role mappings feature check
* Apply suggestions from code review
Co-Authored-By: Brandon Kobel <brandon.kobel@gmail.com>
* add missing test assertions
* inlining feature check logic
* switch to using snapshot
* use href instead of onClick
* adding delete unit test
* consolidate href building
* unify page load error handling
* simplify initial loading state
* documenting unconditional catch blocks
* use nodes.info instead of transport.request
* Apply suggestions from code review
Co-Authored-By: Brandon Kobel <brandon.kobel@gmail.com>
* move model out of LP into NP
* convert except_field_rule to except_any_rule
* docs, take 1
* update gif
Co-authored-by: Joe Portner <5295965+jportner@users.noreply.github.com>
Co-authored-by: Brandon Kobel <brandon.kobel@gmail.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
* allow read only user with no CRUD
* use ../../lib/kibana
* fix timeline-template
* add re-routing on page
* bug
* cleanup
* review I
* review II
* a pretty shameful bug I will live thanks Frank
* bug select rule
* only activate deactivate if user has the manage permission
* add permissions rule with manage api key
* bug on batch action for rules
* add permissions to write status on signal
* Added repository cleanup button. Added logic for spinner while loading, added new repository request, type and telemetry metric.
* Added additional bindings for server side to hit the cleanup endpoint.
* fix cleanup request
* Added data test subject to the code editors to differentiate them and fixed a broken inport of RepositoryCleanup.
* Added files for a component integration test. The tests are failing right now so we need to get those green. Added a functional test. Need to set up kbn-es to be able to set up a file repository before being able to run the functional tests.
* Added change to the way data-test-subjects were created for the repository list table so that columns can be individually identified. Added functional test to allow checking the details of repositories.
* Removed the jest tests for repository details until we get jest fixed.
* Fixed jest test to reflect updated test subjects.
* Made changes per feedback in PR comments.
* Fixed i10n issues using <FormattedMessage>. Removed reference to blueBird and used Promise.all(). Fixed all nits in PR comments.
* Added i10n fixes for header.
* Added i10n fixes for header.
* Added name parameter for i18n strings.
* Removed i18n string from JSON.stringify call since it's already a string.
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: Alison Goryachev <alisonmllr20@gmail.com>
* wip
* update timelien select to design
* Rename label to design
Timeline Select match design with favorite
Now, you are able to add mutiple items for url and false positive
Add tm for Mitre Att&ck (tnaks Frank)
And match mitre selection to design
* cleanup with michael
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
* share specific instances of some ui packages
* remove unnecessary eslint changes, every package will define deps anyway
* remove mentions of moment webpackShims in eslint resolver
* remove use of lodash
* list angular as dep for x-pack
* add operations as codeowner of shared-deps pkg
* [APM] Delay rendering invalid license notification
Don't render an invalid license notification if the license information has not been loaded. (Don't render any UI either).
* Show UI if license has not loaded
* converting mocha tests to jest
* adding a few lib tests
* adding more lib tests
* moving test files and adding autocomplete tests
* updating test definition
* fixing import and test definitions
* For the nodes listing page, do not fetch shard data for indices
* Optimize our shard queries for the index and node listing pages
* This change isn't necessary
* Rename file and function
* Use optimized query for ml jobs and es overview
* Apply to node/index detail page, and more renaming
* Unnecessary change
* Fix tests
* Add basic tests
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
* Fix Watcher regression in which a threshold watch's termOrder and hasTermsAgg properties weren't being passed to the serializeThresholdWatch function.
* Remove unused upstreamJson getter method from server models.
* Finish implementing snapshot count redux code.
* Replace GQL-powered Snapshot export with Redux/Rest-powered version.
* Add tests for Snapshot API call.
* Rename new test file from tsx to ts, it has no JSX.
* Rename outdated snapshot file.
* Update filter groups to use redux and add tags dropdown.
* Delete obsolete graphql filter bar query.
* Add fetch effect factory.
* Use generic fetch effect factory to avoid code redundancy.
* Infer isDisabled status from data for filter group buttons and disable when there are no items.
* Fix removal of overview filter from previous rebase.
* Rename generator-related functions from *saga to *effect.
* WIP trying to make filters filterable.
* WIP cleaning up.
* Delete obsolete API test.
* Add API test for filters endpoint.
* Remove obsolete fields from overview filters.
* Add functional testing attributes and delete a comment for filter popover.
* Update obsolete unit test snapshots and test props for filter popover.
* Fix broken types and delete obsolete test snapshots for filters api call.
* Modify filters endpoint to adhere to np routing contracts.
* Add functional test and associated helper functions for filters API.
* Remove obsolete resolver function for filter bar.
* Remove obsolete FilterBar type from graphql schema.
* Delete static types generated for obsolete GQL schema types.
* Delete obsolete fields from default filters state.
* Delete obsolete method from graphql schema.
* Add default values to unit test that requires complete app state mock.
* Extract helper logic to dedicated module.
* Finish working on adapter/helper tests.
* Add state field for overview page search query.
* Apply search kuery to filters.
* Simplify creation of overview filter fetch actions and API call.
* Add tests for overview filter action creators.
* Simplify api query parameterizaton.
* Improve a variable name.
* Update formatting of file.
* Improve a variable name.
* Improve a variable name.
* Simplify API endpoint typing.
* Clean up helper code and rename some functions/vars.
* Clean up parameterization of filter values.
* Move function from dedicated file back to calling file.
* Clean up naming in a function.
* Move function from dedicated file to caller's file.
* Modify interface of function return value.
* Have function throw error when it receives invalid input instead of returning empty object.
* Extract constant value to dedicated function value and remove parameter from function.
* Clean up object declarations.
* Rename a property.
* Fix issue where function was not handling empty input.
* Delete unnecessary snapshots.
* Add message to internal server error response.
* Fix broken type.
* Delete type that was added as a result of a merge error.
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
* Adding placeholder for functionbeat telemetry in test fixture
* Adding placeholder for functionbeat telemetry expectation
* Adding placeholder for aggregating functionbeat telemetry per cluster
* Update test + fixture
* Updating code
Today, apps rely on AppState and GlobalState in the ui/state_management module to deal with internal (app) and shared (global) state. These classes give apps an ability to read/write state, when is then synced to the URL as well as sessionStorage. They also react to changes in the URL and automatically update state & emit events when changes occur.
This PR introduces new state synching utilities, which together with state containers src/plugins/kibana_utils/public/state_containers will be a replacement for AppState and GlobalState in New Platform.
* [ML] Display anomaly actual in chart tooltip when model plot enabled
* [ML] Fixes translations for chart tooltip fixes
* [ML] Edits to chart tooltip div following review
* add onAppLeave to AppMountParameters
* adapt legacy shims of app mount
* update generated doc
* returns properly typed AppLeaveAction from leave handler instead of raw strings
* add openConfirm to modal service and use it instead of window.confirm
* fix unit test
* update querystringinput snapshots
* add integration tests
* nits and review comments
* add functional tests
* Added max tree depth guard
Removed recursive normalizeTimes functions (one fewer iteration through the entire data structure)
Optimizied appliation of tree mutations by taking `if` out of tight loop
Cleaned up types
* Tidy up data being passed into store (and through immer)
* Fix max tree depth logic
* Remove immer from non-test code.
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
## Summary
* Adds Import and Export REST endpoints
* Fixes minor misc issues with types
* Changes camel case from bulk api to become snake_case
For the API and testing it is very similar to the saved objects API
For import:
```ts
POST /api/detection_engine/rules/_import
```
With a ndjson body of:
```ts
{"created_at":"2020-01-09T01:38:00.740Z","updated_at":"2020-01-09T01:38:00.740Z","created_by":"elastic_kibana","description":"Query with a rule_id that acts like an external id","enabled":true,"false_positives":[],"from":"now-6m","id":"6688f367-1aa2-4895-a5a8-b3701eecf57d","immutable":false,"interval":"5m","rule_id":"query-rule-id-1","language":"kuery","output_index":".siem-signals-frank-hassanabad-default","max_signals":100,"risk_score":1,"name":"Query with a rule id Number 1","query":"user.name: root or user.name: admin","references":[],"severity":"high","updated_by":"elastic_kibana","tags":[],"to":"now","type":"query","threats":[],"version":1}
{"created_at":"2020-01-09T01:38:00.745Z","updated_at":"2020-01-09T01:38:00.745Z","created_by":"elastic_kibana","description":"Query with a rule_id that acts like an external id","enabled":true,"false_positives":[],"from":"now-6m","id":"7a912444-6cfa-4c8f-83f4-2b26fb2a2ed9","immutable":false,"interval":"5m","rule_id":"query-rule-id-2","language":"kuery","output_index":".siem-signals-frank-hassanabad-default","max_signals":100,"risk_score":2,"name":"Query with a rule id Number 2","query":"user.name: root or user.name: admin","references":[],"severity":"low","updated_by":"elastic_kibana","tags":[],"to":"now","type":"query","threats":[],"version":1}
{"exported_count":2,"missing_rules":[],"missing_rules_count":0}
```
If you want to overwrite existing objects you can use the overwrite query parameter like so:
```ts
POST /api/detection_engine/rules/_import?overwrite=true
```
See and run the scripts of:
```ts
import_rules.sh
import_rules_no_overwrite.sh
```
For exporting everything:
```ts
POST /api/detection_engine/rules/_export
```
For exporting just a handful of things you would send a body like so:
```ts
POST /api/detection_engine/rules/_export
{
"objects": [
{
"rule_id": "query-rule-id-1"
},
{
"rule_id": "query-rule-id-2"
}
]
}
```
To change either the filename of the file that gets downloaded or to remove the extra appended export details you can do the following:
```ts
POST /api/detection_engine/rules/_export?exclude_export_details=true&file_name=my_file.ndjson"
```
See the scripts of:
```ts
export_rules.sh
export_rules_by_rule_id.sh
export_rules_by_rule_id_to_file.sh
export_rules_to_file.sh
```
### Checklist
Use ~~strikethroughs~~ to remove checklist items you don't feel are applicable to this PR.
~~- [ ] This was checked for cross-browser compatibility, [including a check against IE11](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#cross-browser-compatibility)~~
~~- [ ] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/master/packages/kbn-i18n/README.md)~~
~~- [ ] [Documentation](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#writing-documentation) was added for features that require explanation or tutorials~~
- [x] [Unit or functional tests](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#cross-browser-compatibility) were updated or added to match the most common scenarios
~~- [ ] This was checked for [keyboard-only and screenreader accessibility](https://developer.mozilla.org/en-US/docs/Learn/Tools_and_testing/Cross_browser_testing/Accessibility#Accessibility_testing_checklist)~~
### For maintainers
~~- [ ] This was checked for breaking API changes and was [labeled appropriately](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#release-notes-process)~~
- [x] This includes a feature addition or change that requires a release note and was [labeled appropriately](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#release-notes-process)
resolves https://github.com/elastic/kibana/issues/50522
The alert executor function is now passed these additional alert-specific
properties as parameters:
- spaceId
- namespace
- name
- tags
- createdBy
- updatedBy
* Fix server types
* Remove graphql types from the frontend
* More type cleanup
* Replace more types. Delete unused files
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
* [Reporting] Update some runtime validations
* fix unit test
* i18n
* make warning logging of encryptionKey possible
* update snapshot
* revert unrelated config change
* Add header element to indices page for WCAG
* Add h1 element for WCAG to node page
* Add h1 element for WCAG to stack monitoring overview page
* Add h1 to advanced nodes page in stack monitoring
* Add h1 to nodes page in stack monitoring
* Add h1 header for index advanced page in stack monitoring
* Standarize more on ide for h1 tag
* Give heading element to beats overview
* Update Beats listing page for H1 compat with WAVE
* Modified beat page to comply with heading rules from WCAG
* Kibana instance listing page updated for header WCAG
* Add WCAG header fix to logstash listing page
* Added headings for WCAG to logstash overview page
* Update pipeline listing page for WCAG A headings
* Fix WCAG heading problems in pipeline viewer
* Fix screen reader heading for APM overview page
* Update APM instances page for screen reader headings
* Update APM instance page for screen reader heading
* Update ccr page for screen reader headings
* More a11y fixes for headings in stack monitoring
* Fixup
* Consistant captalization per review
* Removed help text per review comment
* Include Elasticsearch node into screen reader message, per review feedback
* Update snapshots
* Linting
* Implement review suggestion for i8n compat
* Revert back to just plain string
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
* Check for a trial license as well as platinum when loading the map
* Increase the z-index of the controls so clicking on them works
* Rename the styled component to `ControlsContainer` from `Container` to make a less ambiguous class name on the element
This PR optimizes both the snapshot component and the monitor list on the overview page by using the new monitor.timespan field from elastic/beats#14778. Note that the functionality here will work with heartbeats lacking that patch, but the performance improvements will be absent.
This PR adapts the snapshot tests to use synthetically generated data which should be easier to maintain. As a result some of that code is refactored as well.
See #52433 parent issue as well.
* Update button styles, page panel and page title
* Add getJobCreatorTitle function for human readable job type name
* Add formatMessage to Create job title
* Fix translation test
* Update tests
* change create to only have only one form to be open at the same time
* add tick to risk score
* remove compressed
* fix select in schedule
* fix bug to not allow more than one step panel to be open at a time
* Add a color/health indicator to severity selector
* Move and reword tags placeholder to bottom helper text
* fix ux on the index patterns field
* Reorganize MITRE ATT&CK threat
* add url validation + some cleaning to prerp work for UT
* add feature to get back timeline + be able to disable action on timeline modal
* Add option to import the query from a saved timeline.
* wip
* Add timeline template selector
* fix few bugs from last commit
* review I
* fix unit test for timeline_title
* ui review
* fix truncation on timeline selectable
* Update Duration to coerce number strings to numbers (in millis)
* Coerce in a way that's consistent with kbn-config-schema
* Update ByteSizeValue to coerce strings to numbers
* Update Boolean to coerce strings to boolean values
* Fix Jest test
* Address PR review feedback
* Whoops
* Whoops 2
* Whoops 3
* check depVar field type before adding keyword suffix for evaluate endpoint
* update indexPattern type and use FIELD types
* add keyword suffix if field type is keyword
* keyword suffix added if depVar is of type keyword AND text
* expose ES clients without observables
* expose observable-less api to plugins
* update core api and mocks
* update plugins
* NP SO & legacy use updated API
* update SO tests
* update TSDocs
* update types
* update docs
* document createCluster analog in np
* typo
* Set up our react app in the NP way
* Defines the setup() method for our UI plugin
* Renders the app in the NP way within our setup() method
* Defines a legacy file that invokes the plugin manually
Things seem to be mostly working; the app mounts with no immediate
errors, at least.
* Move files into NP structure
Our plugin function and class are both direct children of siem/public.
The app folder contains both our React app and the function to render
it.
* Register SIEM in the feature catalogue via NP format
Unfortunately, this can't live in the plugin for now because it doesn't
get invoked when we need it. For now, it's going to live in the same
spot, and once we're a real NP plugin we can move it.
* Eliminate usage of timezoneBrowser UI setting
This seems to be redundant with dateFormat:tz except that it always
returns a real timezone, not just a preference. By wrapping that logic
in our own hook, useTimeZone, we can remove this weird usage and stick
to the standard dateFormat and dateFormat:tz.
* Clean up tests for FormattedDate components
Mocks our simpler wrapping hooks rather than the entire UI Settings
module.
* Remove remaining uses of UI Settings mocks
These remaining tests can mock settings directly, or otherwise were
misusing the settings mocks to retrieve assertion values.
* Remove unnecessary intermediate `describe` blocks
They were not adding any information to the tests.
* Remove use of kibana version in client requests
We were previously passing this version all over the place for the sake
of our framework-specific request header. The sole advantage of supplying
such a header is that the client will receive an informative error modal
in the case of a version mismatch between the client and server.
We can successfully perform these requests with the `kbn-xsrf` header
instead. Long-term, we can use core.http.fetch to perform the requests
and auto-populate the version header, but it would be nicer to abstract
those requests to the framework level rather than threading the HTTP
client throughout the application.
* Remove newly added uses of kbnVersion
These happened on master in the meantime.
* Use helper to generate test assertion
Allows us to change the implementation of the empty string without
breaking the test.
* Remove guard from date formatting component
We're always going to get back usable values from these hooks; while the
user can unset the dateFormat in their settings, we'll still get an
empty string which is effectively the same as no formatting (as
evidenced in the tests).
* Remove default from byte formatting component
If the user has deleted this default, they presumably meant to do so and
we shouldn't supersede it.
* Refactor bytes formatting to allow use in our charts
We need a formatting function to use with our charts, so this splits out
a hook from the original react component, allowing our charts to be
formatted as specified in the user's UI settings.
* Refer to our constant for APP_ID
* Explicit return values for some UI Settings hooks
This forces accidental changes to the return value to be explicit.
* Remove use of ui/chrome in request header
This is an unnecessary use: kibana works the same no matter what
contents the `kbn-xsrf` header contains (as long as it's there).
* Mock UI Settings values in our TestProvider
When using our TestProvider components, we were previously relying on
platform's UISettings mocks instead of our own, more comprehensive ones.
This worked for the most part, and when we needed real settings we would
mock the UI Settings client manually.
When we removed some app code that defaulted UI Settings values when the
client did not return a value, tests that used TestProviders but also
relied on those defaults broke. This adds that behavior back,
and obviates the need for manual calls to jest.mock except when we're a)
not using TestProviders but b) overriding the platform mocks.
Also removes some of those unneeded uses.
* Remove unused import
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
* Add exclude fields input to df analytics creation form
* rename explain api endpoint to general explainDataFrameAnalytics
* wip: use explain api for exclude fields
* show error message if classification depVar has cardinality of > 2
* update types
* updates after conflict resolution
* prevent creation if more than 2 distinct classes for class job. create form field validation file
* Saving anonymised data to SO
* Add new files
* Hook up usage collector
* Added app start up ui metric tracking
* Only use client side track metrics functionality
* Added comment regarding use of `patterns`, renamed trackMetric -> trackUiMetric
* Fix jest tests
* Slight refactor and fix for functional tests. More defensive tracking logic
* Fix types in test
* Minor refactor to get endpoint description - removed SenseEditor from autocomplete.
Fix bug where cursor at end of line does not get endpoint informaiton
* Send request to es: do not mutate args
Always move cursor to end of line when getting endpoint description
* Create an interface a simple interface to the metrics tracker
Use the new createUiStatsReporter function to create the tracker
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
* Prefer Kibana core http service to other fetch functions, refactor helper functions to hooks.
* Reintroduce newline deleted in previous commit.
* Clean up obsolete import.
* Clean up effect code in new hook.
* Clean up enum usage in new hook.
* Implement PR feedback on new hook.
* Fix eslint error.
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
* Remove task logic. Remove server refs and revise for np. Migrate a few files to ts
* Remove unused reference
* Update mappings
* Test usage collector register
* Update api integration tests to include maps now that telemetry is 'normal' (not using task mgr state)
* Update integration test to use stack stats
* Update integration test to look for 'maps-telemetry' instead of 'maps'
* Update jest test to reflect calls to register
* Follow the same pattern as other int tests and test reliable nested attribute
* Back out np-related changes for separate PR
* timeCaptured hasn't changed but for some reason stopped working. Getting iso string fixes issue
* Back out file shuffling for separate PR
* Remove mappings updates (handled in separate PR)
* Review feedback. Move telemetry type constant to constants file
* Consolidate imports
* Linting fix
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
* [Maps] Allow editing EMS basemap selection
* resync source data when map changes
* remove old sources and layers
* update ownsMbLayerId and ownsMbSourceId so they return true for previous sources when source changes
* review feedback
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
* [Metrics UI] Adding aws.cloudwatch.* fields to group by for aws.metrics in Metrics Explorer
* Ensuring the correct module is used for the field.
* Adding a unique around the fields to prevent potential extra work
* Adding missing file
* Fixing possible missing event.dataset
* clean up for review
* Move fp-ts and immer to "." package.json
* Revert "Move fp-ts and immer to "." package.json"
This reverts commit b876df0d54.
* Second attempt, fp-ts and immer -> root
* fp-ts -> 2.3.1
* Revert x-pack/package.json
* Update fp-ts in x-pack/package.json
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
The AlertsClient API currently returns mixed inferred types instead of a clear strict type, making it harder to work with the client's type signatures.
The root causes for this difficulty is that we have to support the SavedObjects API which allows partial updates of types, and the implementation of code that converts the SavedObject from a RawAlert to an Alert in a non type-strict manner.
To address this we've added concrete types on the AlertsClient APIs, using Partial on update due to the SavedObjects API, and a strict Alert on the other APIs.
* add logic to see if we can show signals or create signal index for user
* fix unit test
* fix spelling set up
* Update msg from review
* review II
* fix type
* review III
* fix bug found by Garrett
* fix snapshot
* Initial work to auto cleanup old API keys
* Fix ESLint error
* Rename confusing variables
* Add test to ensure thrown errors are swallowed
* Add more tests
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
* Scaffold `log_entries/entries` route
* Scaffold a log entry response
* Add `after` pagination
* Add `before` pagination
* Process `query` parameter
* Use pre-existing structure for the columns
* Change type of date ranges
We will move the responsibility to parse the dates to the client. The
API will only take timestamps
* Add `center` parameter
Allows consumers of the API to get log items around a certain cursor
* Change default page size
* Test the defaults of the API
* Add optional `size` parameter
This makes easier to test the pagination. By default it returns a 200
size page.
* Test the pagination
* Test centering around a point
* Handle `0` sizes
Co-Authored-By: Zacqary Adam Xeper <Zacqary@users.noreply.github.com>
* Add highlights endpoint
* Refactor `processCursor`
* Tweak cursor handling in the routes
* Refine `LogEntry` type
* Add tests for highlights endpoint
* Tweak the types for the LogEntry
Co-authored-by: Zacqary Adam Xeper <Zacqary@users.noreply.github.com>
When users are writing UI's they need to see when an alert was created and when it was last updated, to this end we've added these two fields on the alert type.
* Move index patterns: src/legacy/core_plugins/data 👉 src/plugins/data
Closes: #43444
Make sure that all index pattern related imports use NP (and delete index_pattern folder from shim)
* fix JEST tests
* fix CI
* fix PR comments
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
- make the level param optional, defaults to info
- change the actions logger "tag" from "alerting" to "actions"
- remove control characters from message
* Delete uptime eslint rules.
* Update hooks usage to adhere to new eslint rules.
* Delete code accidentally added during rebase.
* WIP trying things.
* Clean up types and hook usage to comply with kibana eslint rules.
* Clean up code.
* Update new useEffect hooks that are missing dependencies.
* Fix edits that broke a page.
* add react router to endpoint app
* linting
* linting
* linting
* correct tests
* change history from hash to browser, add new test util
* remove default values in helper functions
* fix type check, use FunctionComponent as oppsed to FC
* use BrowserRouter component
* use BrowserRouter component lin
* add comments to test framework, change function name to include browserHistory
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
* Remove punctuation from translation
We already had a colon on both uses of this key, resulting in '::' on
the page.
* Ignore 409 errors from our signal creation
In my experience these are always due to a rule being run multiple times
on the same document, generating a duplicate signal with a (correctly)
duplicate id. Only if we encounter non-409 errors do we log a message to
the user.
* Hide 409 errors during signal creation
These are expected and potentially confusing to the user. Instead, we
only show unexpected errors.
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
* [Maps] pull ES_SIZE_LIMIT and top hits limit from index settings
* get fetch working
* get min values from indicies response
* use indexSettings.maxResultWindow in documents request size
* use max_inner_result_window to define top hits max
* update jest test
* update docs
* more docs changes for top hits
* fix line spacing
* Update docs/maps/maps-aggregations.asciidoc
Co-Authored-By: gchaps <33642766+gchaps@users.noreply.github.com>
* Update docs/maps/vector-layer.asciidoc
Co-Authored-By: gchaps <33642766+gchaps@users.noreply.github.com>
* add api integration test for indexSettings route
* eslint fixes
* review feedback
* display toast on first index settings fetch failure
* clean up
Co-authored-by: gchaps <33642766+gchaps@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
* update dfAnalytics routes to use np router
* add route schemas and only show error message
* convert route file to ts and set handlers inline
* update df analytics param type
* update mlClient type and assert mlClient is not null
* handle errors correctly
* ensure error status gets passed correctly to wrapper
As we recently added react-use as a dependency, makes sense to clean up those generic hooks from Kibana repo.
Removed custom hooks from kibana_react and other places:
useObservable
useUnmount
useShallowCompareEffect
react-use should be used instead:
import useObservable from 'react-use/lib/useObservable'
* Removing componentWillReceiveProps from time filter
* Changing expression form to componentDidUpdate
* Updating expression to be key-driven updates and arg_types to use compomentDidUpdate
* temporary
* Revert "temporary"
This reverts commit 255525d65f.
* typo fix
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Adding unit test for new functionality
Fixing type error
Removing unnecessary act statements
Removing unnecessary assertion
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
* Injects all required plugins into our context provider (not just data)
* Sets defaults for two UI settings that the client doesn't know about
(and blow up when trying to retrieve).
* [SIEM] Migrating frontend services to NP (#52783)
* Remove legacy index_patterns import
We'd already brought in the new interface in a previous commit; this was
just used as an unnecessary type assertion.
* Update snapshots following new docLink mocks
* Remove unused manual mocks
These are not picked up by jest; calling
jest.mock('lib/compose/kibana_core') has the same effect whether or not
these files exist.
* WIP: Use kibana core mock everywhere we're doing it manually
The timeline tests are the last place we're explicitly mocking
useKibanaCore; removing the mocks cause tests to hang. I think hey're
relying on the side effects of importing the mock/ui_settings file, but
I'll figure that out next.
* Replace ui/documentation_links with core NP service
In most instances, this meant using the useContext hook with our NP core
context.
This also updates our mocks to leverage the factory so graciously
provided by platform.
There are a few failing tests, mostly due to links being previously
undefined in tests.
* Use new mocks on timeline test that doesn't hang
The rest of these do, though.
* Remove remaining uses of mockUiSettings in useKibanaCore mocks
These have to be evaluated immediately so that we always return the
same core object. Otherwise we get stuck in a loop between
render/useEffect/setState due to the savedObjects client being different
on each invocation.
* Invoke platform's mock factory at mock time
Previously, we were invoking it any time someone called `useKibanaCore`,
getting a new object back each time. This both caused some bugs (looping
with useEffect) and was not representative of how the actual hook
worked.
This also moves that invokation into the mock function, along with
shaping the mocked module so that we don't have to do it in every call
to jest.mock.
* WIP: migrating to use kibana_react's provider and helpers
We're re-exporting these locally to have more control around mocking
them (until platform implements that).
This breaks everything that was using the old mocks. Will fix.
* WIP: Migrating to use kibana_react
Instead of our homegrown hooks we can use these utilities instead.
Unfortunately kibana_react doesn't yet have mocks, so we had to implement
that ourselves. Luckily, we already had local mocks for the settings
service. This migrates to a the new format. For clarity and consistency,
we also re-export new platform's mocks here and use them to populate our
kibana_react mocks.
We started by migrating the UiSettings service to new platform, and let
that drive the rest. With the mocks in place for kibana_react, removing
the usage of useKibanaCore was a natural step as well.
The next step is removing the usage of chrome.getUiSettingsClient with
our useUiSetting$ hook, and with that (and maybe some config setup; I'm
seeing errors at runtime), we should be ready to start migrating other
services.
* Bind a copy of kibana at mock creation
We were previously returning a new copy any time e.g. useKibana was
called, which is not the contract that consumers are expecting. and in
fact caused looping with components employing useEffect etc.
* Remove internal context providers and last usage
We're now using kibana_react fully.
* Fix tests failing due to wrong mocks
Remaining failures are either due to a date format issue, or something
being rendered differently. Those are up next.
Still haven't touched use of chrome.getUiSettingsClient, that's after.
* Fix test failures related to date formatting
* mocks missing UI Setting (DEFAULT_TIMEZONE_BROWSER) which is required
by our formatted_date utilities
* mock timepicker ranges in the one test that uses it (SuperDatePicker)
* Remove unnecessary and/or redundant mocks
Since our TestProvider now mocks new platform, the only tests that
should need to mock uiSettings related stuff (e.g. timezone preferences)
would be the tests that (directly or no) use kibana_react to get it.
* Refactor kibana_react mocks
* adds a mock for the non-observable useUiSetting
* removes the unmockable HOC withKibana
* Replace usage of chrome.getUiSettingsClient with useUiSetting
We're opting for the non-observable behavior here because I believe
that's more analagous.
There are a few remaining usages in non-react code.
Tests are still using the mocks, those'll be removed next.
* Remove ui_settings mocks
Now that we're not using this hook there's no need for the mocks. Tests
are green.
* Remove siem's UI settings hook
We're now using the ones provided by kibana_react.
* Use withKibana HOC on our component classes
React was kind enough to remind me that I can't put hooks in classes.
Whoops.
* Set defaults for some unknown UI settings
The service claims not to know about these settings we're retrieving.
Until I can figure out where they should come from, we're going to
initialize them with what seem to be the defaults at plugin
initialization.
* Remove old hooks
These have now been replaced with kibana_react's equivalents.
* Fix type error on usage of useKibana hook
This is one of the few places where we're using another plugin, which
are not present in the default typings due to their opt-in nature.
* Fix type error on ML call
The indexPattern we get back is actually an array. The endpoint seems to
handle this just fine (at least, it doesn't blow up), but once we
started retrieving a typed value this error surfaced.
* Export a 'bound' version of the useKibana function
Rather than having to type this on each invocation. This requires us to
define which plugins we depend on, which is a good thing.
* Instantiate our mock function
We aren't using these right now I didn't notice, but that wasn't the
right reference.
* Fix test that relies on unmocked service
Our QueryBar component relies very (very, very) indirectly on a storage
service that does not exist in New Platform, nor its corresponding
mocks. To get it passing for now, we're just gonna pretend like it's
there.
* Remove use of ui/chrome in our charts
Replaces with hooks that accomplish the same.
* Remove last use of chrome.getUiSettingsClient
This function is itself a hook, so we should be good here.
* Remove unnecessary non-null assertions
Now that we're using our typed version of the useKibana hook, typescript
knows that these services will be available (once we actually enforce
that in our kibana.json, of course).
* Fix chart tests
These rely on a kibana hook now, so we need to mock it out for these
renders lest we blow up when the context isn't there.
* Replace missing mock
I deleted this in a previous commit, thinking it unneeded.
However, getHostDetailsBreadcrumbs ultimately asks for some
default date parameters for the timerange boundaries.
* Add back tests for our theming hook
* Style: cleanup
* Remove unneeded default UI Settings values
We were previously getting errors due to these values not being known to
the client, but it looks like that was either fixed upstream, or a
temporary issue caused by some improper context setup.
* Simplify kibana_react mocks
Let's leave JSX out of it.
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
* Update references to now-deleted hooks
These hooks were deleted on a recent branch, but new usages were merged
to master in the meantime.
* Fix remaining uses of hooks/chrome that were not merge conflicts
* Use HOC on class component
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
* [NP] Allow custom validations in HTTP Routes apart from @kbn/config-schema
* API docs
* Allow validate function in the route handler (run-code validation)
* Prefix RouteXXX + Params and Body Validation Aliases
* Fix test broken by lodash
* Update API docs
* Add default types for simpler manual declaration
* Add run-time validation of the RouteValidateSpec
* Expose RouteValidationError instead of SchemaTypeError
* RouteValidator as a class to match config-schema interface
* Test for not-inline handler (need to check IRouter for #47047)
* Add preValidation of the input for a safer custom validation
* Better types for RouteHandlers
* [NP] Move route validation to RouteValidator wrapper
* Use the class only internally but maintain the same API
* Fix types
* Ensure RouteValidator instance in KibanaRequest.from
* Fix validator.tests (Buffer.from instead of new Buffer)
* Default precheck should allow null values
* Also allow undefined in preChecks
* MR feedback fixes
* Provide RouteValidationResolver to the validation function
* Add functional tests
* Fix new functional tests
* Fix validator additional test
* Fix test with new resolver
* Remove unused import
* Rename ValidationResolver to ValidationResultFactory and change the interface to look more like the KibanaResponseFactory
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
* register app, create functional test
* formatting
* update tests
* adjust test data for endpoint
* add endpoint tests for testing spaces, app enabled, disabled, etc
* linting
* add read privileges to endpoint
* rename variable since its used now
* remove deprecated context
* remove unused variable
* fix type check
* correct test suite message
Co-Authored-By: Larry Gregory <lgregorydev@gmail.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: Larry Gregory <lgregorydev@gmail.com>
* Implement `log_entries/item` api
* Use endpoint in the `useLogFlyout` hook
* Clean up GraphQL implementation and types
* Extract type for log entries cursor
* fixup! Extract type for log entries cursor
* gives time to the events to be loaded
* gives time to the element to be loaded
* fixes events viewer tests
* fixes inspect tests
* fixes url state tests
* adds fields counts
* fixes fields browser test
* fixes typecheck error
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
When an Alert is updated its interval is stored but isn't applied to the underlying scheduled task.
In this PR we make use of the new runNow api to "refresh" the task whenever the alert's schedule is updated.
* re-structure detection engine + change routing name
* add editing/details feature for a rule
add feature to not edit immutable rule
* review I
* review II
* change constant
* review III
* Remove legacy index_patterns import
We'd already brought in the new interface in a previous commit; this was
just used as an unnecessary type assertion.
* Update snapshots following new docLink mocks
* Remove unused manual mocks
These are not picked up by jest; calling
jest.mock('lib/compose/kibana_core') has the same effect whether or not
these files exist.
* WIP: Use kibana core mock everywhere we're doing it manually
The timeline tests are the last place we're explicitly mocking
useKibanaCore; removing the mocks cause tests to hang. I think hey're
relying on the side effects of importing the mock/ui_settings file, but
I'll figure that out next.
* Replace ui/documentation_links with core NP service
In most instances, this meant using the useContext hook with our NP core
context.
This also updates our mocks to leverage the factory so graciously
provided by platform.
There are a few failing tests, mostly due to links being previously
undefined in tests.
* Use new mocks on timeline test that doesn't hang
The rest of these do, though.
* Remove remaining uses of mockUiSettings in useKibanaCore mocks
These have to be evaluated immediately so that we always return the
same core object. Otherwise we get stuck in a loop between
render/useEffect/setState due to the savedObjects client being different
on each invocation.
* Invoke platform's mock factory at mock time
Previously, we were invoking it any time someone called `useKibanaCore`,
getting a new object back each time. This both caused some bugs (looping
with useEffect) and was not representative of how the actual hook
worked.
This also moves that invokation into the mock function, along with
shaping the mocked module so that we don't have to do it in every call
to jest.mock.
* WIP: migrating to use kibana_react's provider and helpers
We're re-exporting these locally to have more control around mocking
them (until platform implements that).
This breaks everything that was using the old mocks. Will fix.
* WIP: Migrating to use kibana_react
Instead of our homegrown hooks we can use these utilities instead.
Unfortunately kibana_react doesn't yet have mocks, so we had to implement
that ourselves. Luckily, we already had local mocks for the settings
service. This migrates to a the new format. For clarity and consistency,
we also re-export new platform's mocks here and use them to populate our
kibana_react mocks.
We started by migrating the UiSettings service to new platform, and let
that drive the rest. With the mocks in place for kibana_react, removing
the usage of useKibanaCore was a natural step as well.
The next step is removing the usage of chrome.getUiSettingsClient with
our useUiSetting$ hook, and with that (and maybe some config setup; I'm
seeing errors at runtime), we should be ready to start migrating other
services.
* Bind a copy of kibana at mock creation
We were previously returning a new copy any time e.g. useKibana was
called, which is not the contract that consumers are expecting. and in
fact caused looping with components employing useEffect etc.
* Remove internal context providers and last usage
We're now using kibana_react fully.
* Fix tests failing due to wrong mocks
Remaining failures are either due to a date format issue, or something
being rendered differently. Those are up next.
Still haven't touched use of chrome.getUiSettingsClient, that's after.
* Fix test failures related to date formatting
* mocks missing UI Setting (DEFAULT_TIMEZONE_BROWSER) which is required
by our formatted_date utilities
* mock timepicker ranges in the one test that uses it (SuperDatePicker)
* Remove unnecessary and/or redundant mocks
Since our TestProvider now mocks new platform, the only tests that
should need to mock uiSettings related stuff (e.g. timezone preferences)
would be the tests that (directly or no) use kibana_react to get it.
* Refactor kibana_react mocks
* adds a mock for the non-observable useUiSetting
* removes the unmockable HOC withKibana
* Replace usage of chrome.getUiSettingsClient with useUiSetting
We're opting for the non-observable behavior here because I believe
that's more analagous.
There are a few remaining usages in non-react code.
Tests are still using the mocks, those'll be removed next.
* Remove ui_settings mocks
Now that we're not using this hook there's no need for the mocks. Tests
are green.
* Remove siem's UI settings hook
We're now using the ones provided by kibana_react.
* Use withKibana HOC on our component classes
React was kind enough to remind me that I can't put hooks in classes.
Whoops.
* Set defaults for some unknown UI settings
The service claims not to know about these settings we're retrieving.
Until I can figure out where they should come from, we're going to
initialize them with what seem to be the defaults at plugin
initialization.
* Remove old hooks
These have now been replaced with kibana_react's equivalents.
* Fix type error on usage of useKibana hook
This is one of the few places where we're using another plugin, which
are not present in the default typings due to their opt-in nature.
* Fix type error on ML call
The indexPattern we get back is actually an array. The endpoint seems to
handle this just fine (at least, it doesn't blow up), but once we
started retrieving a typed value this error surfaced.
* Export a 'bound' version of the useKibana function
Rather than having to type this on each invocation. This requires us to
define which plugins we depend on, which is a good thing.
* Instantiate our mock function
We aren't using these right now I didn't notice, but that wasn't the
right reference.
* Fix test that relies on unmocked service
Our QueryBar component relies very (very, very) indirectly on a storage
service that does not exist in New Platform, nor its corresponding
mocks. To get it passing for now, we're just gonna pretend like it's
there.
* Remove use of ui/chrome in our charts
Replaces with hooks that accomplish the same.
* Remove last use of chrome.getUiSettingsClient
This function is itself a hook, so we should be good here.
* Remove unnecessary non-null assertions
Now that we're using our typed version of the useKibana hook, typescript
knows that these services will be available (once we actually enforce
that in our kibana.json, of course).
* Fix chart tests
These rely on a kibana hook now, so we need to mock it out for these
renders lest we blow up when the context isn't there.
* Replace missing mock
I deleted this in a previous commit, thinking it unneeded.
However, getHostDetailsBreadcrumbs ultimately asks for some
default date parameters for the timerange boundaries.
* Add back tests for our theming hook
* Style: cleanup
* Remove unneeded default UI Settings values
We were previously getting errors due to these values not being known to
the client, but it looks like that was either fixed upstream, or a
temporary issue caused by some improper context setup.
* Simplify kibana_react mocks
Let's leave JSX out of it.
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
* Added license check for actions server API
* Added license check for alerting server API
* Fixed typecheck errors and duplication tests
* Moved all license checks to New Platform
* Clean up not used shims options
* Update x-pack/legacy/plugins/alerting/server/extend_route_with_license_check.test.ts
Co-Authored-By: Gidi Meir Morris <github@gidi.io>
* Update x-pack/legacy/plugins/actions/server/lib/license_state.ts
Co-Authored-By: Gidi Meir Morris <github@gidi.io>
* Refactored due to comments
* Fixed typo
Co-authored-by: Gidi Meir Morris <github@gidi.io>
## Summary
* Adds Bulk REST API and routes added for create, update, and delete
* Loops over data and calls `alertClient` until alerting team gives us bulk to push down
* Adds Unit tests
Testing/Usage:
Create in bulk:
```ts
POST /api/detection_engine/rules/_bulk_create
[{ ... rule_1}, { ... rule_2}]
```
see script
```ts
./post_rule_bulk.sh
```
Update in bulk:
```ts
PUT /api/detection_engine/rules/_bulk_update
[{ ... rule_1}, { ... rule_2}]
```
see script
```ts
./update_rule_bulk.sh
```
Delete in bulk:
```ts
DELETE /api/detection_engine/rules/_bulk_delete
[{"id": "rule_1"}, {"id": "rule_2"}]
```
or in case your client does not support bodies in DELETE
```ts
POST /api/detection_engine/rules/_bulk_delete
[{"id": "rule_1"}, {"id": "rule_2"}]
```
But try to use DELETE where possible
see script
```ts
./delete_bulk.sh
```
Caveats and error handling....If you do not validate correctly you will still get back a `400` return code. If you do validate correctly but one or more objects have errors involving a conflict or not found, you will get back a 200, but the body message will contain an array of errors or successes.
Examples:
If you delete in bulk for two objects but both do not have any values you get a response of `200` but then these errors in the array:
```ts
./delete_bulk.sh
[
{
"id": "query-rule-id-1",
"error": {
"statusCode": 404,
"message": "rule_id: \"query-rule-id-1\" not found"
}
},
{
"id": "query-rule-id-2",
"error": {
"statusCode": 404,
"message": "rule_id: \"query-rule-id-2\" not found"
}
}
]
```
If one has a valid deleted value but the second does not you get a status of `200` and one object back as being deleted but the second as an error:
```ts
./delete_bulk.sh
[
{
"created_at": "2019-12-19T04:12:26.470Z",
"updated_at": "2019-12-19T04:12:26.470Z",
"created_by": "elastic_kibana",
"description": "Query with a rule_id that acts like an external id",
"enabled": true,
"false_positives": [],
"from": "now-6m",
"id": "46d83e70-982a-4ba8-9ac1-fc386643c014",
"immutable": false,
"interval": "5m",
"rule_id": "query-rule-id-1",
"language": "kuery",
"output_index": ".siem-signals-frank-hassanabad-default",
"max_signals": 100,
"risk_score": 1,
"name": "Query with a rule id Number 1",
"query": "user.name: root or user.name: admin",
"references": [],
"severity": "high",
"updated_by": "elastic_kibana",
"tags": [],
"to": "now",
"type": "query",
"threats": [],
"version": 1
},
{
"id": "query-rule-id-2",
"error": {
"statusCode": 404,
"message": "rule_id: \"query-rule-id-2\" not found"
}
}
]
```
Another example where an update has two errors because it tried to update two docs but both do not exist yet you get back a response of `200` but this array of errors:
```ts
./update_rule_bulk.sh <<<
[
{
"id": "query-rule-id-1",
"error": {
"statusCode": 404,
"message": "rule_id: \"query-rule-id-1\" not found"
}
},
{
"id": "query-rule-id-2",
"error": {
"statusCode": 404,
"message": "rule_id: \"query-rule-id-2\" not found"
}
}
]
```
If one is updatable but the other is not you get back a response of `200` and one update back but the other is an error:
```ts
./update_rule_bulk.sh
[
{
"created_at": "2019-12-19T04:15:43.739Z",
"updated_at": "2019-12-19T04:16:01.633Z",
"created_by": "elastic_kibana",
"description": "Query with a rule_id that acts like an external id",
"enabled": true,
"false_positives": [],
"from": "now-6m",
"id": "c1fcea2c-cbc6-4f28-b7e7-32b4d7cb799d",
"immutable": false,
"interval": "5m",
"rule_id": "query-rule-id-1",
"language": "kuery",
"output_index": ".siem-signals-frank-hassanabad-default",
"max_signals": 100,
"risk_score": 1,
"name": "Rule id Number 1 with an updated name",
"query": "user.name: root or user.name: admin",
"references": [],
"severity": "high",
"updated_by": "elastic_kibana",
"tags": [],
"to": "now",
"type": "query",
"threats": [],
"version": 2
},
{
"id": "query-rule-id-2",
"error": {
"statusCode": 404,
"message": "rule_id: \"query-rule-id-2\" not found"
}
}
]
```
Same thing goes with posts and any other bulk actions.
### Checklist
Use ~~strikethroughs~~ to remove checklist items you don't feel are applicable to this PR.
~~- [ ] This was checked for cross-browser compatibility, [including a check against IE11](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#cross-browser-compatibility)~~
~~- [ ] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/master/packages/kbn-i18n/README.md)~~
~~- [ ] [Documentation](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#writing-documentation) was added for features that require explanation or tutorials~~
- [x] [Unit or functional tests](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#cross-browser-compatibility) were updated or added to match the most common scenarios
~~- [ ] This was checked for [keyboard-only and screenreader accessibility](https://developer.mozilla.org/en-US/docs/Learn/Tools_and_testing/Cross_browser_testing/Accessibility#Accessibility_testing_checklist)~~
### For maintainers
~~- [ ] This was checked for breaking API changes and was [labeled appropriately](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#release-notes-process)~~
- [x] This includes a feature addition or change that requires a release note and was [labeled appropriately](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#release-notes-process)
* text styling
* label style editor UI
* wire up styles to mb
* allow string values
* remove console.log
* default getFields to provide ordinal fields for vector source
* fix vector_style jest test
* add label styles to docs
* fix prettier errors
* use index-pattern field formatter to format label
* rename LABEL to LABEL_TEXT
* review feedback
* fix problem with icons not displaying with labels
* fix functional tests
* fix canno read name of null error
* update jest expect
* fix eslint errors
* do not display label text in legend
* always show all label styling properties in editor
* review feedback
* Add user info on the option of the request
* fix type
* review
* fix test
* fix bug
* add an unauthenticated user concept for timeline
* add favorite flter with unauthenticated user
* provide a list of breaking changes in licensing plugin
* Apply suggestions from code review
Co-Authored-By: Rudolf Meijering <skaapgif@gmail.com>
* add ToC
* fix comment
* introduce core provider plugin for integration tests
* platform functional tests use core_provider_plugin for testing
* add 3 scenario for licensing plugins: server, client, legacy
* remove unused code
* run all licensing_plugin tests on CI
* remove duplicated config
* address comments
* declare global type for core provider
* inOneOf --> hasAtLeast. to follow to licensing hierarchical model
* adopt licensing tests
* add license mock and use it in the tests
* adopt security plugin to hasAtLeast and licensing mocks
* adopt uptime to hasAtLeast
* update readme
* add test for unknown license
* fix import in js test
* fix security plugin merge conflict
* Update x-pack/plugins/security/common/licensing/license_service.ts
Co-Authored-By: Larry Gregory <lgregorydev@gmail.com>
* Update x-pack/plugins/licensing/common/types.ts
Co-Authored-By: Josh Dover <me@joshdover.com>
* simplify tests
* remove unused import
* Shim input_control_vis
* Convert input_control_vis src files to typescript
* Add Required, Optional, Required and Class types to kbn-utility-types
* Collect all ui/* imports into legacy imports file
* Pass down plugin deps from top level
* Add timeout and terminate_after options to SearchSourceFields
Follow up from the #52727 in Task Manager, we want Alerting and Task Manager to align on their schedule api (in the near future, Alerting will actually use Task manager's schedule system to remove this duplication).
* [Maps] gather field formatters in data request so they can be used sync in vector_style
* review feedback
* hasMatchingMetricField
* review feedback
* fix typo in function name
* [APM] Add version annotations to timeseries charts
Closes#51426.
* Don't subdue 'Version' text in tooltip
* Optimize version queries
* Don't pass radius/color to indicator
* migrating nav control to NP
* move licensing service to common
* only retrieve user when necessary
* don't block rendering on user promise
* testing nav control registration
* moving logic to nav_control_service
* register account management in a hack
* update import location
* updating license_service to manage its own subscription to the raw license
* updating mock
* update editProfileUrl to not require full page reload if already within the kibana app
* alternate security license proposal
* adds popover test.
* switchMap -> map
* additional test case.
* Apply suggestions from code review
Co-Authored-By: Aleh Zasypkin <aleh.zasypkin@gmail.com>
* additional testing
* fix merge from master
* fixing es availability check
* fix merge from master
* switch from deprecated route
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
* Scaffold `/logs/summary` endpoint
* Use HTTP API for the log summary
* Handle queries in log summary
* Simplify `useLogSummary` implementation
* Scaffold `/logs/summary/highlights` API
* Use HTTP endpoint for log summary highlights
* Tweak `highlightTerms`
* Deduplicate ES queries for summary endpoints
* Clean GraphQL implementation
* Make tests pass
* Handle server errors
* Pass source to the API
* Cleanup tests
* Future-proof response types
Wrap the existing response into a `{ data: ... }` object to allow adding
metadata in the future.
* Refactor tests with `@testing-library/react-hooks`
* Adapt endpoint to NP
* Tweak types in the test
* Split API methods into separate files
* Flatten highlights API
* Restructure `common/http_api/logs` folder
We will group relevant codecs and types into `log_entries`, splitting
summary and summary_highlights as two individual concepts.
* Reorganize route files
* Resurrect changes in `server/lib/{adapter,domain}`
Replace some of the exported types from GraphQL with io-ts codecs
* Wire the route with the domain library
* Remove dead types
* Clean up test file
* Fix merge mishap
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
* Instrument Kibana with APM RUM agent
* make route-change transaction work with properl url
* extract page-load transaction url from app link
* check if app is hidden and set active:false
* make distributed tracing work and merge config
* remove config/apm.js and address review
* address review comments
* add apm.js to build tassks
* move apm from dev to src
* add @types/hoist-non-react-statics which is required by react rum
* apply changes correctly from master
* Add back in np licensing changes previously pulled out of a separate pr
* Watch license service and update local kibana service const obj. on change. Import new license id in meta
* Update flow for initializing indexPatternServices while in this file
* Clean up setup method. Add conditional subscribe of licensing
* Review feedback. Use license getter instead of obj
* Revert "Update flow for initializing indexPatternServices while in this file"
This reverts commit 022f7ddb87.
* Update meta test
* Move a REST endpoint and the GQL endpoint to NP routing.
* Delete obsolete REST endpoint.
* Update remaining REST routes to work with NP router.
* Remove obsolete code, update some unit tests.
* Simplify route creation.
* Remove tests of API decommissioned API endpoint.
* Rename domain check.
* Make return shape of index pattern endpoint correspond to required NP resp body.
* Move validate to appropriate level of route definition object for monitor details endpoint.
* Update snapshot count route.
* Fix broken lint rule.
* Move a REST endpoint and the GQL endpoint to NP routing.
* Update remaining REST routes to work with NP router.
* Update remaining REST routes to work with NP router.
* Refactor query functions to accept new es client from request contexts.
* WIP updating framework adapter.
* Refactor remaining routes/resolvers to remove usage of legacy Elasticsearch client.
* Fix broken unit tests.
* Fix incorrect user usage for a REST endpoint.
* Fix some broken imports and types.
* Port monitor details REST endpoint to NP.
* Remove some merge errors.
* Update adapters to take a single options parameter.
* Update broken test files.
* Resolve typescript warnings.
* Update resolver types.
* Change GraphQL interface name for es client.
* Delete unused code and fix incorrect type.
* Rename type for REST endpoint creators.
* Nest message values in body object for invalid response messages.
* Reorganize a file and clean up some types.
* Add wrapper function to reduce boilerplate route code.
* adds created_at and updated_at timestamps to rules
* fix missing update to tests
* save created_at and updated_at in rule in signals index
* requires created_at and updated_at in rule
Display a link to platinum license upgrade on the service map.
Also add `useKibanaUrl` and `useLicense` hooks.
Make the `LicenseContext` (which is used in a couple class components and on page load) use the license observable from the NP plugin.
Add missing export of `useObservable` to kibana_react.
This moves the interval field under a generic schedule object field in preparation for the introduction of richer scheduling options (such as cron).
It includes a migration for existing tasks, and we've ensured no existing Task Type Definitions exist in Kibana that rely on Interval.
This includes support for the deprecated interval field (which gets mapped to schedule) but that support will be removed in 8.0.0, as it's a breaking change.