diff --git a/.ci/Jenkinsfile_coverage b/.ci/Jenkinsfile_coverage index 63798e2e29e44..3f4732f15f334 100644 --- a/.ci/Jenkinsfile_coverage +++ b/.ci/Jenkinsfile_coverage @@ -23,6 +23,8 @@ def handleIngestion(timestamp) { kibanaPipeline.downloadCoverageArtifacts() kibanaCoverage.prokLinks("### Process HTML Links") kibanaCoverage.collectVcsInfo("### Collect VCS Info") + kibanaCoverage.generateReports("### Merge coverage reports") + kibanaCoverage.uploadCombinedReports() kibanaCoverage.ingest(timestamp, '### Injest && Upload') kibanaCoverage.uploadCoverageStaticSite(timestamp) } diff --git a/.ci/packer_cache.sh b/.ci/packer_cache.sh index d47ef93172a9d..11f9ccaeddb1e 100755 --- a/.ci/packer_cache.sh +++ b/.ci/packer_cache.sh @@ -40,7 +40,7 @@ echo "Creating bootstrap_cache archive" # archive cacheable directories mkdir -p "$HOME/.kibana/bootstrap_cache" tar -cf "$HOME/.kibana/bootstrap_cache/$branch.tar" \ - x-pack/legacy/plugins/reporting/.chromium \ + x-pack/plugins/reporting/.chromium \ .es \ .chromedriver \ .geckodriver; diff --git a/.eslintrc.js b/.eslintrc.js index aeaf6e04fdc01..8ec854769f1d0 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -202,6 +202,11 @@ module.exports = { from: ['(src|x-pack)/plugins/*/server/**/*'], errorMessage: `Public code can not import from server, use a common directory.`, }, + { + target: ['(src|x-pack)/plugins/*/common/**/*'], + from: ['(src|x-pack)/plugins/*/(server|public)/**/*'], + errorMessage: `Common code can not import from server or public, use a common directory.`, + }, { target: [ '(src|x-pack)/legacy/**/*', @@ -582,11 +587,11 @@ module.exports = { }, /** - * SIEM overrides + * Security Solution overrides */ { // front end typescript and javascript files only - files: ['x-pack/plugins/siem/public/**/*.{js,ts,tsx}'], + files: ['x-pack/plugins/security_solution/public/**/*.{js,ts,tsx}'], rules: { 'import/no-nodejs-modules': 'error', 'no-restricted-imports': [ @@ -600,7 +605,7 @@ module.exports = { }, { // typescript only for front and back end - files: ['x-pack/{,legacy/}plugins/siem/**/*.{ts,tsx}'], + files: ['x-pack/{,legacy/}plugins/security_solution/**/*.{ts,tsx}'], rules: { // This will be turned on after bug fixes are complete // '@typescript-eslint/explicit-member-accessibility': 'warn', @@ -635,7 +640,7 @@ module.exports = { // { // // will introduced after the other warns are fixed // // typescript and javascript for front end react performance - // files: ['x-pack/plugins/siem/public/**/!(*.test).{js,ts,tsx}'], + // files: ['x-pack/plugins/security_solution/public/**/!(*.test).{js,ts,tsx}'], // plugins: ['react-perf'], // rules: { // // 'react-perf/jsx-no-new-object-as-prop': 'error', @@ -646,7 +651,7 @@ module.exports = { // }, { // typescript and javascript for front and back end - files: ['x-pack/{,legacy/}plugins/siem/**/*.{js,ts,tsx}'], + files: ['x-pack/{,legacy/}plugins/security_solution/**/*.{js,ts,tsx}'], plugins: ['eslint-plugin-node', 'react'], env: { mocha: true, diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 83f4f90b9204d..af8d9cc8dbb43 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -225,12 +225,12 @@ /x-pack/test/plugin_functional/plugins/resolver_test/ @elastic/endpoint-app-team @elastic/siem /x-pack/test/plugin_functional/test_suites/resolver/ @elastic/endpoint-app-team @elastic/siem -# SIEM -/x-pack/plugins/siem/ @elastic/siem @elastic/endpoint-app-team +# Security Solution +/x-pack/plugins/security_solution/ @elastic/siem @elastic/endpoint-app-team /x-pack/test/detection_engine_api_integration @elastic/siem @elastic/endpoint-app-team -/x-pack/test/api_integration/apis/siem @elastic/siem @elastic/endpoint-app-team +/x-pack/test/api_integration/apis/security_solution @elastic/siem @elastic/endpoint-app-team /x-pack/plugins/case @elastic/siem @elastic/endpoint-app-team /x-pack/plugins/lists @elastic/siem @elastic/endpoint-app-team # Security Intelligence And Analytics -/x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules @elastic/security-intelligence-analytics +/x-pack/plugins/security_solution/server/lib/detection_engine/rules/prepackaged_rules @elastic/security-intelligence-analytics diff --git a/Jenkinsfile b/Jenkinsfile index f435b18c6d824..11dca544f3226 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -41,9 +41,9 @@ kibanaPipeline(timeoutMinutes: 155, checkPrChanges: true) { 'xpack-ciGroup9': kibanaPipeline.xpackCiGroupProcess(9), 'xpack-ciGroup10': kibanaPipeline.xpackCiGroupProcess(10), 'xpack-accessibility': kibanaPipeline.functionalTestProcess('xpack-accessibility', './test/scripts/jenkins_xpack_accessibility.sh'), - 'xpack-siemCypress': { processNumber -> - whenChanged(['x-pack/plugins/siem/', 'x-pack/test/siem_cypress/']) { - kibanaPipeline.functionalTestProcess('xpack-siemCypress', './test/scripts/jenkins_siem_cypress.sh')(processNumber) + 'xpack-securitySolutionCypress': { processNumber -> + whenChanged(['x-pack/plugins/security_solution/', 'x-pack/test/security_solution_cypress/']) { + kibanaPipeline.functionalTestProcess('xpack-securitySolutionCypress', './test/scripts/jenkins_security_solution_cypress.sh')(processNumber) } }, diff --git a/docs/apm/deployment-annotations.asciidoc b/docs/apm/deployment-annotations.asciidoc index 9abcd9f6efc74..142b0c0193d74 100644 --- a/docs/apm/deployment-annotations.asciidoc +++ b/docs/apm/deployment-annotations.asciidoc @@ -7,13 +7,40 @@ ++++ For enhanced visibility into your deployments, we offer deployment annotations on all transaction charts. -This feature automatically tags new deployments, so you can easily see if your deploy has increased response times -for an end-user, or if the memory/CPU footprint of your application has changed. -Being able to identify bad deployments quickly enables you to rollback and fix issues without causing costly outages. +This feature enables you to easily determine if your deployment has increased response times for an end-user, +or if the memory/CPU footprint of your application has changed. +Being able to quickly identify bad deployments enables you to rollback and fix issues without causing costly outages. + +By default, automatic deployment annotations are enabled. +This means the APM app will create an annotation on your data when the `service.version` of your application changes. + +Alternatively, you can explicitly create deployment annotations with our annotation API. +The API can integrate into your CI/CD pipeline, +so that each time you deploy, a POST request is sent to the annotation API endpoint: + +[source,console] +---- +curl -X POST \ + http://localhost:5601/api/apm/services/${SERVICE_NAME}/annotation \ <1> +-H 'Content-Type: application/json' \ +-H 'kbn-xsrf: true' \ +-H 'Authorization: Basic ${API_KEY}' \ <2> +-d '{ + "@timestamp": "${DEPLOY_TIME}", <3> + "service": { + "version": "${SERVICE_VERSION}" <4> + }, + "message": "${MESSAGE}" <5> + }' +---- +<1> The `service.name` of your application +<2> An APM app API key with sufficient privileges +<3> The time of the deployment +<4> The `service.version` to be displayed in the annotation +<5> A custom message to be displayed in the annotation + +See the <> reference for more information. -Deployment annotations are enabled by default, and can be created with the <>. -If there are no created annotations for the selected time period, -the APM app will automatically annotate your data if the `service.version` of your application changes. NOTE: If custom annotations have been created for the selected time period, any derived annotations, i.e., those created automatically when `service.version` changes, will not be shown. diff --git a/docs/canvas/canvas-elements.asciidoc b/docs/canvas/canvas-elements.asciidoc index 4149039a3f87b..9c7467bb452fd 100644 --- a/docs/canvas/canvas-elements.asciidoc +++ b/docs/canvas/canvas-elements.asciidoc @@ -27,28 +27,30 @@ By default, most of the elements you create use demo data until you change the d * *Timelion* — Access your time series data using <> queries. To use Timelion queries, you can enter a query using the <>. +Each element can display a different data source. Pages and workpads often contain multiple data sources. + [float] [[canvas-add-object]] ==== Add a saved object -Add a <>, then customize it to fit your display needs. +Add <> to your workpad, such as maps and visualizations. -. Click *Embed object*. +. Click *Add element > Add from Visualize Library*. -. Select the object you want to add. +. Select the saved object you want to add. + [role="screenshot"] image::images/canvas-map-embed.gif[] . To use the customization options, click the panel menu, then select one of the following options: -* *Edit map* — Opens <> so that you can edit the original map. +* *Edit map* — Opens <> or <> so that you can edit the original saved object. -* *Customize panel* — Specifies the object title options. +* *Edit panel title* — Adds a title to the saved object. -* *Inspect* — Allows you to drill down into the element data. +* *Customize time range* — Exposes a time filter dedicated to the saved object. -* *Customize time range* — Exposes a time filter dedicated to the map. +* *Inspect* — Allows you to drill down into the element data. [float] [[canvas-add-image]] @@ -56,7 +58,7 @@ image::images/canvas-map-embed.gif[] To personalize your workpad, add your own logos and graphics. -. Click *Manage assets*. +. Click *Add element > Manage assets*. . On the *Manage workpad assets* window, drag and drop your images. @@ -83,40 +85,25 @@ Move and resize your elements to meet your design needs. [[format-canvas-elements]] ==== Format elements -Align, distribute, and reorder elements for consistency and readability across your workpad pages. - -Access the align, distribute, and reorder options by clicking the *Element options* icon. - -[role="screenshot"] -image::images/canvas_element_options.png[] +For consistency and readability across your workpad pages, align, distribute, and reorder elements. -To align elements: +To align two or more elements: . Press and hold Shift, then select the elements you want to align. -. Click the , then select *Group*. +. Click *Edit > Alignment*, then select the alignment option. -. Click the *Element options* icon, then select *Alignment*. - -. Select the alignment option. - -To distribute elements: +To distribute three or more elements: . Press and hold Shift, then select the elements you want to distribute. -. Click the *Element options* icon, then select *Group*. - -. Click the *Element options* icon, then select *Distribution*. - -. Select the distribution option. +. Click *Edit > Distribution*, then select the distribution option. To reorder elements: . Select the element you want to reorder. -. Click the *Element options* icon, then select *Order*. - -. Select the order option. +. Click *Edit > Order*, then select the order option. [float] [[data-display]] @@ -157,14 +144,14 @@ text.align: center; To use the elements across all workpads, save the elements. -When you're ready to save your element, select the element, then click the *Save as new element* icon. +When you're ready to save your element, select the element, then click *Edit > Save as new element*. [role="screenshot"] image::images/canvas_save_element.png[] -To save a group of elements, press and hold Shift, then select the elements you want to save. +To save a group of elements, press and hold Shift, select the elements you want to save, then click *Edit > Save as new element*. -To access your saved elements, click *Add element*, then select *My elements*. +To access your saved elements, click *Add element > My elements*. [float] [[delete-elements]] @@ -174,9 +161,7 @@ When you no longer need an element, delete it from your workpad. . Select the element you want to delete. -. Click the *Element options* icon. +. Click *Edit > Delete*. + [role="screenshot"] image::images/canvas_element_options.png[] - -. Select *Delete*. diff --git a/docs/canvas/canvas-present-workpad.asciidoc b/docs/canvas/canvas-present-workpad.asciidoc index 9cd4ecc9519e1..e0139ab943104 100644 --- a/docs/canvas/canvas-present-workpad.asciidoc +++ b/docs/canvas/canvas-present-workpad.asciidoc @@ -4,24 +4,20 @@ When you are ready to present your workpad, use and enable the presentation options. -[float] -[[view-fullscreen-mode]] -==== View your workpad in fullscreen mode +. Configure the autoplay options. -Click the *Enter fullscreen mode* icon. +.. From the workpad menu, click *View > Autoplay settings*. +.. Under *Change cycling interval*, select the interval you want to use, or *Set a custom interval*. ++ [role="screenshot"] -image::images/canvas-fullscreen.png[Fullscreen mode] - -[float] -[[enable-autoplay]] -==== Enable autoplay +image::images/canvas-autoplay-interval.png[Element autoplay interval] -Automatically cycle through your workpads pages in fullscreen mode. +. To enable autoplay, click *View > Turn autoplay on*. -. Click the *Control settings* icon. - -. Under *Change cycling interval*, select the interval you want to use. +. To start your presentation, click *View > Enter fullscreen mode*. + [role="screenshot"] -image::images/canvas-refresh-interval.png[Element data refresh interval] +image::images/canvas-fullscreen.png[Fullscreen mode] + +. When you are ready to exit fullscreen mode, press the Esc (Escape) key. diff --git a/docs/canvas/canvas-share-workpad.asciidoc b/docs/canvas/canvas-share-workpad.asciidoc index 5cae3fcc7b531..a095253c6cff3 100644 --- a/docs/canvas/canvas-share-workpad.asciidoc +++ b/docs/canvas/canvas-share-workpad.asciidoc @@ -10,14 +10,12 @@ When you've finished your workpad, you can share it outside of {kib}. Create a JSON file of your workpad that you can export outside of {kib}. -. From your workpad, click the *Share workpad* icon. +Click *Share > Download as JSON*. -. Select *Download as JSON*. -+ [role="screenshot"] image::images/canvas-export-workpad.png[Export single workpad] -Want to export multiple workpads? Go to the *Canvas workpads* view, select the workpads you want to export, then click *Export*. +Want to export multiple workpads? Go to the *Canvas* home page, select the workpads you want to export, then click *Export*. [float] [[create-workpad-pdf]] @@ -25,69 +23,43 @@ Want to export multiple workpads? Go to the *Canvas workpads* view, select the w If you have a license that supports the {report-features}, you can create a PDF copy of your workpad that you can save and share outside {kib}. -For more information, refer to <>. - -. From your workpad, click the *Share workpad* icon, then select *PDF reports*. +Click *Share > PDF reports > Generate PDF*. -. Click *Generate PDF*. -+ [role="screenshot"] image::images/canvas-generate-pdf.gif[Generate PDF] +For more information, refer to <>. + [float] [[create-workpad-URL]] ==== Create a POST URL If you have a license that supports the {report-features}, you can create a POST URL that you can use to automatically generate PDF reports using Watcher or a script. -For more information, refer to <>. - -. From your workpad, click the *Share workpad* icon, then select *PDF reports*. +Click *Share > PDF reports > Copy POST URL*. -. Click *Copy POST URL*. -+ [role="screenshot"] image::images/canvas-create-URL.gif[Create POST URL] +For more information, refer to <>. + [float] [[add-workpad-website]] ==== Share the workpad on a website beta[] Canvas allows you to create _shareables_, which are workpads that you download and securely share on any website. To customize the behavior of the workpad on your website, you can choose to autoplay the pages or hide the workpad toolbar. -. From your workpad, click the *Share this workpad* icon, then select *Share on a website*. +. Click *Share > Share on a website*. -. On the *Share on a website* pane, follow the instructions. +. Follow the *Share on a website* instructions. . To customize the workpad behavior to autoplay the pages or hide the toolbar, use the inline parameters. + To make sure that your data remains secure, the data in the JSON file is not connected to {kib}. Canvas does not display elements that manipulate the data on the workpad. + [role="screenshot"] -image::images/canvas-embed_workpad.gif[Share the workpad on a website] +image::canvas/images/canvas-embed_workpad.gif[Share the workpad on a website] + NOTE: Shareable workpads encode the current state of the workpad in a JSON file. When you make changes to the workpad, the changes do not appear in the shareable workpad on your website. -[float] -[[change-the-workpad-settings]] -==== Change the settings - -After you've added the workpad to your website, you can change the autoplay and toolbar settings. - -To change the autoplay settings: - -. Click the settings icon. - -. Click *Auto Play*, then change the settings. -+ -[role="screenshot"] -image::images/canvas_share_autoplay_480.gif[Autoplay settings] - -To change the toolbar settings: - -. Click the settings icon. - -. Click *Toolbar*, then change the settings. -+ -[role="screenshot"] -image::images/canvas_share_hidetoolbar_480.gif[Hide toolbar settings] +. To change the settings, click the settings icon, then choose the settings you want to use. diff --git a/docs/canvas/canvas-tutorial.asciidoc b/docs/canvas/canvas-tutorial.asciidoc index a38ab4a69598e..9b23817de2767 100644 --- a/docs/canvas/canvas-tutorial.asciidoc +++ b/docs/canvas/canvas-tutorial.asciidoc @@ -10,76 +10,64 @@ To get up and running with Canvas, use the following tutorial where you'll creat For this tutorial, you'll need to add the <>. [float] -=== Create and personalize your workpad +=== Create your workpad Your first step to working with Canvas is to create a workpad. -. Open *Canvas*. +. Open the menu, then click *Kibana > Canvas*. -. Click *Create workpad*. - -. To add a *Name* for your workpad, use the editor. For example, `My Canvas Workpad`. +. On the *Canvas workpads* page, click *Create workpad*. [float] === Customize your workpad with images To customize your workpad to look the way you want, add your own images. -. Click *Add element*, then click *Image*. +. Click *Add element > Image > Image*. + -The default Elastic logo image appears on your page. +The default Elastic logo image appears on the page. . To replace the Elastic logo with your own image, select the image, then use the editor. -. To move the image, click and drag it to your preferred location. - [role="screenshot"] image::images/canvas-image-element.png[] -You'll notice that the image is tagged as an asset, which allows you to reuse the image from *Manage assets*. - [float] === Customize your data with metrics Customize your data by connecting it to the Sample eCommerce orders data. -. Click *Add element*, then click *Metric*. +. Click *Add element > Chart > Metric*. + -By default, the *Metric* element is connected to a demo data source, which enables you to experiment with the element before you connect it to your own data source. - -. To connect the element to your own data source, make sure that the element is selected, then click *Data*. +By default, the element is connected to the demo data, which enables you to experiment with the element before you connect it to your own data source. -.. Click *Change your data source*, then click *Elasticsearch SQL*. +. To connect the element to your own data source, make sure that the element is selected, click *Data > Demo data > Elasticsearch SQL*. -.. In the *Elasticsearch SQL query* field, enter the following query: +.. In the *Query* field, enter the following: + `SELECT sum(taxless_total_price) AS sum_total_price FROM "kibana_sample_data_ecommerce"` -+ -The query selects the total price field and sets it to the sum_total_price field. These fields are pulled from the kibana_sample_data_ecommerce index that you installed. -.. To verify that the data is correct, click *Preview*. If you like what you see, click *Save*. +.. Click *Save*. + -At this point, the element displays an error. +The query selects the total price field and sets it to the sum_total_price field. All fields are pulled from the kibana_sample_data_ecommerce index. -. Specify how to process and display the data. +. At this point, the element appears as an error, so you need to change the element display options. .. Click *Display* -.. Under *Number*, select *Value* from the function drop-down list, then select *sum_total_price* from the column drop-down list. +.. From the *Value* drop-down lists, make sure that *Unique* is selected, then select *sum_total_price*. .. Change the *Label* to `Total sales`. -+ -You'll notice that the error is gone, but the number could use some formatting. -. To format the number, use the Canvas expression language. +. The error is gone, but the element could use some formatting. To format the number, use the Canvas expression language. .. Click *Expression editor*. + You're now looking at the raw data syntax that Canvas uses to display the element. -.. Look for `math "sum_total_price"`, then add `| formatNumber "$0a"`. +.. Change `metricFormat="0,0.[000]"` to `metricFormat="$0a"`. -.. To update the number, click *Run*. +.. Click *Run*. [role="screenshot"] image::images/canvas-metric-element.png[] @@ -89,21 +77,17 @@ image::images/canvas-metric-element.png[] To show what your data can do, add charts, graphs, progress monitors, and more to your workpad. -. Click *Add element*, then click *Area chart*. +. Click *Add element > Chart > Area*. -. To connect the element to your own data source, make sure that the element is selected, then click *Data*. +. Make sure that the element is selected, then click *Data > Demo data > Elasticsearch SQL*. -.. Click *Change your data source*, then click *Elasticsearch SQL*. - -.. To obtain the taxless total price by date, enter the following into the *Elasticsearch SQL query* field: +.. To obtain the taxless total price by date, enter the following in the *Query* field: + `SELECT order_date, taxless_total_price FROM "kibana_sample_data_ecommerce" ORDER BY order_date` -+ -Although you used the Elasticsearch SQL data source for the metric and area chart elements, each element can display a different data source. Pages and workpads often contain multiple data sources. -.. To verify that the data is correct, click *Preview*. If you like what you see, click *Save*. +.. Click *Save*. -. Specify how to display the data. +. Change the display options. .. Click *Display* @@ -117,34 +101,20 @@ image::images/canvas-chart-element.png[] [float] === Show how your data changes over time -To focus your data on a specific time range, add a time filter to your workpad. +To focus your data on a specific time range, add the time filter. -. Click *Add element*, then click *Time filter*. +. Click *Add element > Filter > Time filter*. -. Specify how to display the data. +. Click *Display* -.. Click *Display* - -.. To use the date time field from the sample data, enter `order_date` in the *Column* field, then click *Set*. +. To use the date time field from the sample data, enter `order_date` in the *Column* field, then click *Set*. [role="screenshot"] image::images/canvas-timefilter-element.png[] -To see how the data changes, set the time filter to *Last 7 days*. As you change the time filter options, the metrics dynamically update. - -Your workpad is now complete! From the workpad menu, use the icons to: - -* Configure the refresh rate for your data - -* Refresh the data that displays on your workpad - -* Display your workpad in fullscreen mode - -* Control the zoom options - -* Share your workpad +To see how the data changes, set the time filter to *Last 7 days*. As you change the time filter options, the elements automatically update. -* Hide the editing controls +Your workpad is now complete! [float] === Next steps diff --git a/docs/canvas/canvas-workpad.asciidoc b/docs/canvas/canvas-workpad.asciidoc index 42eedf55c404d..ac2d348920114 100644 --- a/docs/canvas/canvas-workpad.asciidoc +++ b/docs/canvas/canvas-workpad.asciidoc @@ -20,9 +20,7 @@ To create a workpad, choose one of the following options: To use the background colors, images, and data of your choice, start with a blank workpad. -. Open *Canvas*. - -. On the *Canvas workpads* view, click *Create workpad*. +. On the *Canvas workpads* page, click *Create workpad*. . Add a *Name* to your workpad. @@ -35,7 +33,7 @@ For example, click *720p* for a traditional presentation layout. . Click the *Background color* picker, then select the background color for your workpad. + [role="screenshot"] -image::images/canvas-background-color-picker.gif[Canvas color picker] +image::images/canvas-background-color-picker.png[Canvas color picker] [float] [[canvas-template-workpad]] @@ -43,9 +41,7 @@ image::images/canvas-background-color-picker.gif[Canvas color picker] If you're unsure about where to start, you can use one of the preconfigured templates that come with Canvas. -. Open *Canvas*. - -. On the *Canvas workpads* view, select *Templates*. +. On the *Canvas workpads* page, select *Templates*. . Click the preconfigured template that you want to use. @@ -57,9 +53,7 @@ If you're unsure about where to start, you can use one of the preconfigured temp When you want to use a workpad that someone else has already started, import the JSON file into Canvas. -. Open *Canvas*. - -. On the *Canvas workpads* view, click and drag the file to the *Import workpad JSON file* field. +To import a workpad, go to the *Canvas workpads* page, then click and drag the file to the *Import workpad JSON file* field. [float] [[sample-data-workpad]] @@ -96,23 +90,27 @@ background-color: #3990e6; [[configure-auto-refresh-interval]] === Change the auto-refresh interval -Increase or decrease how often the data refreshes on your workpad. +Change how often the data refreshes on your workpad. -. In the top left corner, click the *Control settings* icon. +. Click *View > Auto refresh settings*. -. Under *Change auto-refresh interval*, select the interval you want to use. +. Select the interval you want to use, or *Set a custom interval*. + [role="screenshot"] image::images/canvas-refresh-interval.png[Element data refresh interval] - -TIP: To manually refresh the data, click the *Refresh data* icon. ++ +To manually refresh the data, click image:canvas/images/canvas-refresh-data.png[]. [float] [[zoom-in-out]] === Use the zoom options -In the upper left corner, click the *Zoom controls* icon, then select one of the options. +To get a closer look at a portion of your workpad, use the zoom options. + +. Click *View > Zoom*. +. Select the zoom option. ++ [role="screenshot"] image::images/canvas-zoom-controls.png[Zoom controls] diff --git a/docs/canvas/images/canvas-embed_workpad.gif b/docs/canvas/images/canvas-embed_workpad.gif new file mode 100644 index 0000000000000..1cda5b572acef Binary files /dev/null and b/docs/canvas/images/canvas-embed_workpad.gif differ diff --git a/docs/canvas/images/canvas-refresh-data.png b/docs/canvas/images/canvas-refresh-data.png new file mode 100644 index 0000000000000..7a71686f04491 Binary files /dev/null and b/docs/canvas/images/canvas-refresh-data.png differ diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.plugin._constructor_.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.plugin._constructor_.md index 5ec2d491295bf..64108a7c7be33 100644 --- a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.plugin._constructor_.md +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.plugin._constructor_.md @@ -9,12 +9,12 @@ Constructs a new instance of the `DataPublicPlugin` class Signature: ```typescript -constructor(initializerContext: PluginInitializerContext); +constructor(initializerContext: PluginInitializerContext); ``` ## Parameters | Parameter | Type | Description | | --- | --- | --- | -| initializerContext | PluginInitializerContext | | +| initializerContext | PluginInitializerContext<ConfigSchema> | | diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.plugin.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.plugin.md index 6cbc1f441c048..0dad92a0a27ca 100644 --- a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.plugin.md +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.plugin.md @@ -7,14 +7,14 @@ Signature: ```typescript -export declare function plugin(initializerContext: PluginInitializerContext): DataPublicPlugin; +export declare function plugin(initializerContext: PluginInitializerContext): DataPublicPlugin; ``` ## Parameters | Parameter | Type | Description | | --- | --- | --- | -| initializerContext | PluginInitializerContext | | +| initializerContext | PluginInitializerContext<ConfigSchema> | | Returns: diff --git a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.config.md b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.config.md new file mode 100644 index 0000000000000..49b5f6040fc84 --- /dev/null +++ b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.config.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-server](./kibana-plugin-plugins-data-server.md) > [config](./kibana-plugin-plugins-data-server.config.md) + +## config variable + +Signature: + +```typescript +config: PluginConfigDescriptor +``` diff --git a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.md b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.md index e756eb9b72905..5f4bb8742c1d1 100644 --- a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.md +++ b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.md @@ -55,6 +55,7 @@ | Variable | Description | | --- | --- | | [castEsToKbnFieldTypeName](./kibana-plugin-plugins-data-server.castestokbnfieldtypename.md) | Get the KbnFieldType name for an esType string | +| [config](./kibana-plugin-plugins-data-server.config.md) | | | [esFilters](./kibana-plugin-plugins-data-server.esfilters.md) | | | [esKuery](./kibana-plugin-plugins-data-server.eskuery.md) | | | [esQuery](./kibana-plugin-plugins-data-server.esquery.md) | | diff --git a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.plugin._constructor_.md b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.plugin._constructor_.md index 454d8a059a252..4a0a159310b9d 100644 --- a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.plugin._constructor_.md +++ b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.plugin._constructor_.md @@ -9,12 +9,12 @@ Constructs a new instance of the `DataServerPlugin` class Signature: ```typescript -constructor(initializerContext: PluginInitializerContext); +constructor(initializerContext: PluginInitializerContext); ``` ## Parameters | Parameter | Type | Description | | --- | --- | --- | -| initializerContext | PluginInitializerContext | | +| initializerContext | PluginInitializerContext<ConfigSchema> | | diff --git a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.plugin.md b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.plugin.md index b3ba75ce29ab6..1773871d946a2 100644 --- a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.plugin.md +++ b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.plugin.md @@ -9,14 +9,14 @@ Static code to be shared externally Signature: ```typescript -export declare function plugin(initializerContext: PluginInitializerContext): DataServerPlugin; +export declare function plugin(initializerContext: PluginInitializerContext): DataServerPlugin; ``` ## Parameters | Parameter | Type | Description | | --- | --- | --- | -| initializerContext | PluginInitializerContext | | +| initializerContext | PluginInitializerContext<ConfigSchema> | | Returns: diff --git a/docs/images/canvas-add-image.gif b/docs/images/canvas-add-image.gif index a2263e22c4c49..994ec6e1b4f28 100644 Binary files a/docs/images/canvas-add-image.gif and b/docs/images/canvas-add-image.gif differ diff --git a/docs/images/canvas-add-pages.gif b/docs/images/canvas-add-pages.gif index a1fa228645836..c6e09d6f386ae 100644 Binary files a/docs/images/canvas-add-pages.gif and b/docs/images/canvas-add-pages.gif differ diff --git a/docs/images/canvas-autoplay-interval.png b/docs/images/canvas-autoplay-interval.png new file mode 100644 index 0000000000000..68a7ca248d9ee Binary files /dev/null and b/docs/images/canvas-autoplay-interval.png differ diff --git a/docs/images/canvas-background-color-picker.png b/docs/images/canvas-background-color-picker.png new file mode 100644 index 0000000000000..ec38b5c1c5f7e Binary files /dev/null and b/docs/images/canvas-background-color-picker.png differ diff --git a/docs/images/canvas-chart-element.png b/docs/images/canvas-chart-element.png index d0aa7db375a40..bf5e04bf89af5 100644 Binary files a/docs/images/canvas-chart-element.png and b/docs/images/canvas-chart-element.png differ diff --git a/docs/images/canvas-create-URL.gif b/docs/images/canvas-create-URL.gif index 0c9fbf7201d80..11327224fc897 100644 Binary files a/docs/images/canvas-create-URL.gif and b/docs/images/canvas-create-URL.gif differ diff --git a/docs/images/canvas-element-select.gif b/docs/images/canvas-element-select.gif index bd0e49377262e..1bfd1132f25c7 100644 Binary files a/docs/images/canvas-element-select.gif and b/docs/images/canvas-element-select.gif differ diff --git a/docs/images/canvas-export-workpad.png b/docs/images/canvas-export-workpad.png index fa910daf948d7..213bbaa5a26d3 100644 Binary files a/docs/images/canvas-export-workpad.png and b/docs/images/canvas-export-workpad.png differ diff --git a/docs/images/canvas-fullscreen.png b/docs/images/canvas-fullscreen.png index 7e6ec6ad7e7a8..b8a816d290396 100644 Binary files a/docs/images/canvas-fullscreen.png and b/docs/images/canvas-fullscreen.png differ diff --git a/docs/images/canvas-generate-pdf.gif b/docs/images/canvas-generate-pdf.gif index 9ef16dc1e5017..513f6b3b960f9 100644 Binary files a/docs/images/canvas-generate-pdf.gif and b/docs/images/canvas-generate-pdf.gif differ diff --git a/docs/images/canvas-image-element.png b/docs/images/canvas-image-element.png index f869ccb344a46..13c9090e77c76 100644 Binary files a/docs/images/canvas-image-element.png and b/docs/images/canvas-image-element.png differ diff --git a/docs/images/canvas-map-embed.gif b/docs/images/canvas-map-embed.gif index 59ef97e0ceae8..c6ba5c29df42a 100644 Binary files a/docs/images/canvas-map-embed.gif and b/docs/images/canvas-map-embed.gif differ diff --git a/docs/images/canvas-metric-element.png b/docs/images/canvas-metric-element.png index d9735a2fb3e91..03871dcc81862 100644 Binary files a/docs/images/canvas-metric-element.png and b/docs/images/canvas-metric-element.png differ diff --git a/docs/images/canvas-refresh-interval.png b/docs/images/canvas-refresh-interval.png index 99006a5b8f12d..62e88ad4bf7d0 100644 Binary files a/docs/images/canvas-refresh-interval.png and b/docs/images/canvas-refresh-interval.png differ diff --git a/docs/images/canvas-timefilter-element.png b/docs/images/canvas-timefilter-element.png index 8b8356ff5f7ea..e210b0b3288c6 100644 Binary files a/docs/images/canvas-timefilter-element.png and b/docs/images/canvas-timefilter-element.png differ diff --git a/docs/images/canvas-zoom-controls.png b/docs/images/canvas-zoom-controls.png index 892721b627027..5c72d118041e4 100644 Binary files a/docs/images/canvas-zoom-controls.png and b/docs/images/canvas-zoom-controls.png differ diff --git a/docs/images/canvas_element_options.png b/docs/images/canvas_element_options.png index 191348d919b50..41457bab4ff36 100644 Binary files a/docs/images/canvas_element_options.png and b/docs/images/canvas_element_options.png differ diff --git a/docs/images/canvas_save_element.png b/docs/images/canvas_save_element.png index a63f5135f2a0e..8a601efab874a 100644 Binary files a/docs/images/canvas_save_element.png and b/docs/images/canvas_save_element.png differ diff --git a/docs/user/canvas.asciidoc b/docs/user/canvas.asciidoc index 98033c5a87f6f..355684f7448a1 100644 --- a/docs/user/canvas.asciidoc +++ b/docs/user/canvas.asciidoc @@ -5,7 +5,7 @@ [partintro] -- -Canvas is a data visualization and presentation tool that sits within Kibana. With Canvas, you can pull live data directly from Elasticsearch, and combine the data with colors, images, text, and your imagination to create dynamic, multi-page, pixel-perfect displays. If you are a little bit creative, a little bit technical, and a whole lot curious, then Canvas is for you. +Canvas is a data visualization and presentation tool that sits within {kib}. With Canvas, you can pull live data directly from {es}, and combine the data with colors, images, text, and your imagination to create dynamic, multi-page, pixel-perfect displays. If you are a little bit creative, a little bit technical, and a whole lot curious, then Canvas is for you. With Canvas, you can: @@ -13,9 +13,7 @@ With Canvas, you can: * Customize your workpad with your own visualizations, such as images and text. -* Customize your data by pulling it directly from Elasticsearch. - -* Show off your data with charts, graphs, progress monitors, and more. +* Pull your data directly from Elasticsearch, then show it off with charts, graphs, progress monitors, and more. * Focus the data you want to display with filters. diff --git a/packages/eslint-config-kibana/.eslintrc.js b/packages/eslint-config-kibana/.eslintrc.js index 747c2c14ab25e..c0f8bf0ecb508 100644 --- a/packages/eslint-config-kibana/.eslintrc.js +++ b/packages/eslint-config-kibana/.eslintrc.js @@ -56,6 +56,15 @@ module.exports = { from: 'react-router', to: 'react-router-dom', }, + { + from: '@kbn/ui-shared-deps/monaco', + to: '@kbn/monaco', + }, + { + from: 'monaco-editor', + to: false, + disallowedMessage: `Don't import monaco directly, use or add exports to @kbn/monaco` + }, ], ], }, diff --git a/packages/kbn-monaco/README.md b/packages/kbn-monaco/README.md new file mode 100644 index 0000000000000..c5d7dd7dbfed5 --- /dev/null +++ b/packages/kbn-monaco/README.md @@ -0,0 +1,5 @@ +# @kbn/monaco + +A customized version of monaco that is automatically configured the way we want it to be when imported as `@kbn/monaco`. Additionally, imports to this package are automatically shared with all plugins using `@kbn/ui-shared-deps`. + +Includes custom xjson language support. The `es_ui_shared` plugin has an example of how to use it, in the future we will likely expose helpers from this package to make using it everywhere a little more seamless. \ No newline at end of file diff --git a/packages/kbn-monaco/package.json b/packages/kbn-monaco/package.json new file mode 100644 index 0000000000000..170c014e6e326 --- /dev/null +++ b/packages/kbn-monaco/package.json @@ -0,0 +1,27 @@ +{ + "name": "@kbn/monaco", + "version": "1.0.0", + "private": true, + "main": "./target/index.js", + "license": "Apache-2.0", + "scripts": { + "build": "node ./scripts/build.js", + "kbn:bootstrap": "yarn build --dev" + }, + "dependencies": { + "regenerator-runtime": "^0.13.3", + "monaco-editor": "~0.17.0" + }, + "devDependencies": { + "@kbn/babel-preset": "1.0.0", + "@kbn/dev-utils": "1.0.0", + "babel-loader": "^8.0.6", + "css-loader": "^3.4.2", + "del": "^5.1.0", + "raw-loader": "3.1.0", + "supports-color": "^7.0.0", + "typescript": "3.7.2", + "webpack": "^4.41.5", + "webpack-cli": "^3.3.10" + } +} diff --git a/packages/kbn-monaco/scripts/build.js b/packages/kbn-monaco/scripts/build.js new file mode 100644 index 0000000000000..c5540e3c956c8 --- /dev/null +++ b/packages/kbn-monaco/scripts/build.js @@ -0,0 +1,64 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +const path = require('path'); +const del = require('del'); +const supportsColor = require('supports-color'); +const { run } = require('@kbn/dev-utils'); + +const TARGET_BUILD_DIR = path.resolve(__dirname, '../target'); +const ROOT_DIR = path.resolve(__dirname, '../'); +const WEBPACK_CONFIG_PATH = path.resolve(ROOT_DIR, 'webpack.config.js'); + +run( + async ({ procRunner, log, flags }) => { + log.info('Deleting old output'); + + await del(TARGET_BUILD_DIR); + + const cwd = ROOT_DIR; + const env = { ...process.env }; + if (supportsColor.stdout) { + env.FORCE_COLOR = 'true'; + } + + await procRunner.run('worker', { + cmd: 'webpack', + args: ['--config', WEBPACK_CONFIG_PATH, flags.dev ? '--env.dev' : '--env.prod'], + wait: true, + env, + cwd, + }); + + await procRunner.run('tsc ', { + cmd: 'tsc', + args: [], + wait: true, + env, + cwd, + }); + + log.success('Complete'); + }, + { + flags: { + boolean: ['dev'], + }, + } +); diff --git a/packages/kbn-monaco/src/index.ts b/packages/kbn-monaco/src/index.ts new file mode 100644 index 0000000000000..9213a1bfe1327 --- /dev/null +++ b/packages/kbn-monaco/src/index.ts @@ -0,0 +1,25 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +export { monaco } from './monaco'; +export { XJsonLang } from './xjson'; + +/* eslint-disable-next-line @kbn/eslint/module_migration */ +import * as BarePluginApi from 'monaco-editor/esm/vs/editor/editor.api'; +export { BarePluginApi }; diff --git a/packages/kbn-ui-shared-deps/monaco.ts b/packages/kbn-monaco/src/monaco.ts similarity index 96% rename from packages/kbn-ui-shared-deps/monaco.ts rename to packages/kbn-monaco/src/monaco.ts index 42801c69a3e2c..a40b2212ef0e2 100644 --- a/packages/kbn-ui-shared-deps/monaco.ts +++ b/packages/kbn-monaco/src/monaco.ts @@ -17,6 +17,8 @@ * under the License. */ +/* eslint-disable @kbn/eslint/module_migration */ + import * as monaco from 'monaco-editor/esm/vs/editor/editor.api'; import 'monaco-editor/esm/vs/base/common/worker/simpleWorker'; diff --git a/packages/kbn-monaco/src/xjson/README.md b/packages/kbn-monaco/src/xjson/README.md new file mode 100644 index 0000000000000..8652d0bd776d2 --- /dev/null +++ b/packages/kbn-monaco/src/xjson/README.md @@ -0,0 +1,28 @@ +# README + +This folder contains the language definitions for XJSON used by the Monaco editor. + +## Summary of contents + +Note: All source code. + +### ./worker + +The worker proxy and worker instantiation code used in both the main thread and the worker thread. + +### ./lexer_rules + +Contains the Monarch-specific language tokenization rules for XJSON. Each set of rules registers itself against monaco. + +### ./constants.ts + +Contains the unique language ID. + +### ./language + +Takes care of global setup steps for the language (like registering it against Monaco) and exports a way to load up +the grammar parser. + +### ./worker_proxy_service + +A stateful mechanism for holding a reference to the Monaco-provided proxy getter. diff --git a/scripts/prettier_on_changed.js b/packages/kbn-monaco/src/xjson/constants.ts similarity index 89% rename from scripts/prettier_on_changed.js rename to packages/kbn-monaco/src/xjson/constants.ts index f9598110f91fd..dc107abff4ffe 100644 --- a/scripts/prettier_on_changed.js +++ b/packages/kbn-monaco/src/xjson/constants.ts @@ -17,5 +17,4 @@ * under the License. */ -require('../src/setup_node_env/babel_register'); -require('../src/dev/run_prettier_on_changed'); +export const ID = 'xjson'; diff --git a/packages/kbn-monaco/src/xjson/grammar.ts b/packages/kbn-monaco/src/xjson/grammar.ts new file mode 100644 index 0000000000000..e95059f9ece2d --- /dev/null +++ b/packages/kbn-monaco/src/xjson/grammar.ts @@ -0,0 +1,213 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +export enum AnnoTypes { + error = 'error', + warning = 'warning', +} + +/* eslint-disable */ + +export const createParser = () => { + 'use strict'; + let at: any, + annos: any[], // annotations + ch: any, + text: any, + value: any, + escapee: any = { + '"': '"', + '\\': '\\', + '/': '/', + b: '\b', + f: '\f', + n: '\n', + r: '\r', + t: ' ', + }, + error = function (m: string) { + throw { + at: at, + text: m, + message: m, + }; + }, + warning = function (m: string, idx: number) { + annos.push({ + type: AnnoTypes.warning, + at: idx, + text: m, + }); + }, + reset = function (newAt: number) { + ch = text.charAt(newAt); + at = newAt + 1; + }, + next = function (c?: string) { + return ( + c && c !== ch && error("Expected '" + c + "' instead of '" + ch + "'"), + (ch = text.charAt(at)), + (at += 1), + ch + ); + }, + nextUpTo = function (upTo: any, errorMessage: string) { + let currentAt = at, + i = text.indexOf(upTo, currentAt); + if (i < 0) { + error(errorMessage || "Expected '" + upTo + "'"); + } + reset(i + upTo.length); + return text.substring(currentAt, i); + }, + peek = function (c: string) { + return text.substr(at, c.length) === c; // nocommit - double check + }, + number = function () { + var number, + string = ''; + for ('-' === ch && ((string = '-'), next('-')); ch >= '0' && '9' >= ch; ) + (string += ch), next(); + if ('.' === ch) for (string += '.'; next() && ch >= '0' && '9' >= ch; ) string += ch; + if ('e' === ch || 'E' === ch) + for ( + string += ch, next(), ('-' === ch || '+' === ch) && ((string += ch), next()); + ch >= '0' && '9' >= ch; + + ) + (string += ch), next(); + return (number = +string), isNaN(number) ? (error('Bad number'), void 0) : number; + }, + string = function () { + let hex: any, + i: any, + uffff: any, + string = ''; + if ('"' === ch) { + if (peek('""')) { + // literal + next('"'); + next('"'); + return nextUpTo('"""', 'failed to find closing \'"""\''); + } else { + for (; next(); ) { + if ('"' === ch) return next(), string; + if ('\\' === ch) + if ((next(), 'u' === ch)) { + for ( + uffff = 0, i = 0; + 4 > i && ((hex = parseInt(next(), 16)), isFinite(hex)); + i += 1 + ) + uffff = 16 * uffff + hex; + string += String.fromCharCode(uffff); + } else { + if ('string' != typeof escapee[ch]) break; + string += escapee[ch]; + } + else string += ch; + } + } + } + error('Bad string'); + }, + white = function () { + for (; ch && ' ' >= ch; ) next(); + }, + word = function () { + switch (ch) { + case 't': + return next('t'), next('r'), next('u'), next('e'), !0; + case 'f': + return next('f'), next('a'), next('l'), next('s'), next('e'), !1; + case 'n': + return next('n'), next('u'), next('l'), next('l'), null; + } + error("Unexpected '" + ch + "'"); + }, + array = function () { + var array: any[] = []; + if ('[' === ch) { + if ((next('['), white(), ']' === ch)) return next(']'), array; + for (; ch; ) { + if ((array.push(value()), white(), ']' === ch)) return next(']'), array; + next(','), white(); + } + } + error('Bad array'); + }, + object = function () { + var key, + object: any = {}; + if ('{' === ch) { + if ((next('{'), white(), '}' === ch)) return next('}'), object; + for (; ch; ) { + let latchKeyStart = at; + if ( + ((key = string()), + white(), + next(':'), + Object.hasOwnProperty.call(object, key) && + warning('Duplicate key "' + key + '"', latchKeyStart), + (object[key] = value()), + white(), + '}' === ch) + ) + return next('}'), object; + next(','), white(); + } + } + error('Bad object'); + }; + return ( + (value = function () { + switch ((white(), ch)) { + case '{': + return object(); + case '[': + return array(); + case '"': + return string(); + case '-': + return number(); + default: + return ch >= '0' && '9' >= ch ? number() : word(); + } + }), + function (source: string) { + annos = []; + let errored = false; + text = source; + at = 0; + ch = ' '; + white(); + + try { + value(); + } catch (e) { + errored = true; + annos.push({ type: AnnoTypes.error, at: e.at - 1, text: e.message }); + } + if (!errored && ch) { + error('Syntax error'); + } + return { annotations: annos }; + } + ); +}; diff --git a/packages/kbn-monaco/src/xjson/index.ts b/packages/kbn-monaco/src/xjson/index.ts new file mode 100644 index 0000000000000..35fd35887bc56 --- /dev/null +++ b/packages/kbn-monaco/src/xjson/index.ts @@ -0,0 +1,24 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import { registerGrammarChecker } from './language'; + +import { ID } from './constants'; + +export const XJsonLang = { registerGrammarChecker, ID }; diff --git a/packages/kbn-monaco/src/xjson/language.ts b/packages/kbn-monaco/src/xjson/language.ts new file mode 100644 index 0000000000000..fe505818d3c9a --- /dev/null +++ b/packages/kbn-monaco/src/xjson/language.ts @@ -0,0 +1,89 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +// This file contains a lot of single setup logic for registering a language globally + +import { monaco } from '../monaco'; +import { WorkerProxyService } from './worker_proxy_service'; +import { registerLexerRules } from './lexer_rules'; +import { ID } from './constants'; +// @ts-ignore +import workerSrc from '!!raw-loader!../../target/public/xjson.editor.worker.js'; + +const wps = new WorkerProxyService(); + +// Register rules against shared monaco instance. +registerLexerRules(monaco); + +// In future we will need to make this map languages to workers using "id" and/or "label" values +// that get passed in. +// @ts-ignore +window.MonacoEnvironment = { + getWorker: (id: any, label: any) => { + // In kibana we will probably build this once and then load with raw-loader + const blob = new Blob([workerSrc], { type: 'application/javascript' }); + return new Worker(URL.createObjectURL(blob)); + }, +}; + +monaco.languages.onLanguage(ID, async () => { + return wps.setup(); +}); + +const OWNER = 'XJSON_GRAMMAR_CHECKER'; +export const registerGrammarChecker = (editor: monaco.editor.IEditor) => { + const allDisposables: monaco.IDisposable[] = []; + + const updateAnnos = async () => { + const { annotations } = await wps.getAnnos(); + const model = editor.getModel() as monaco.editor.ITextModel; + monaco.editor.setModelMarkers( + model, + OWNER, + annotations.map(({ at, text, type }) => { + const { column, lineNumber } = model.getPositionAt(at); + return { + startLineNumber: lineNumber, + startColumn: column, + endLineNumber: lineNumber, + endColumn: column, + message: text, + severity: type === 'error' ? monaco.MarkerSeverity.Error : monaco.MarkerSeverity.Warning, + }; + }) + ); + }; + + const onModelAdd = (model: monaco.editor.IModel) => { + allDisposables.push( + model.onDidChangeContent(async () => { + updateAnnos(); + }) + ); + + updateAnnos(); + }; + + allDisposables.push(monaco.editor.onDidCreateModel(onModelAdd)); + monaco.editor.getModels().forEach(onModelAdd); + return () => { + wps.stop(); + allDisposables.forEach((d) => d.dispose()); + }; +}; diff --git a/packages/kbn-monaco/src/xjson/lexer_rules/esql.ts b/packages/kbn-monaco/src/xjson/lexer_rules/esql.ts new file mode 100644 index 0000000000000..e75b1013d3727 --- /dev/null +++ b/packages/kbn-monaco/src/xjson/lexer_rules/esql.ts @@ -0,0 +1,270 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import { monaco } from '../../monaco'; + +export const ID = 'esql'; + +const brackets = [ + { open: '[', close: ']', token: 'delimiter.square' }, + { open: '(', close: ')', token: 'delimiter.parenthesis' }, +]; + +const keywords = [ + 'describe', + 'between', + 'in', + 'like', + 'not', + 'and', + 'or', + 'desc', + 'select', + 'from', + 'where', + 'having', + 'group', + 'by', + 'order', + 'asc', + 'desc', + 'pivot', + 'for', + 'in', + 'as', + 'show', + 'columns', + 'include', + 'frozen', + 'tables', + 'escape', + 'limit', + 'rlike', + 'all', + 'distinct', + 'is', +]; +const builtinFunctions = [ + 'avg', + 'count', + 'first', + 'first_value', + 'last', + 'last_value', + 'max', + 'min', + 'sum', + 'kurtosis', + 'mad', + 'percentile', + 'percentile_rank', + 'skewness', + 'stddev_pop', + 'sum_of_squares', + 'var_pop', + 'histogram', + 'case', + 'coalesce', + 'greatest', + 'ifnull', + 'iif', + 'isnull', + 'least', + 'nullif', + 'nvl', + 'curdate', + 'current_date', + 'current_time', + 'current_timestamp', + 'curtime', + 'dateadd', + 'datediff', + 'datepart', + 'datetrunc', + 'date_add', + 'date_diff', + 'date_part', + 'date_trunc', + 'day', + 'dayname', + 'dayofmonth', + 'dayofweek', + 'dayofyear', + 'day_name', + 'day_of_month', + 'day_of_week', + 'day_of_year', + 'dom', + 'dow', + 'doy', + 'hour', + 'hour_of_day', + 'idow', + 'isodayofweek', + 'isodow', + 'isoweek', + 'isoweekofyear', + 'iso_day_of_week', + 'iso_week_of_year', + 'iw', + 'iwoy', + 'minute', + 'minute_of_day', + 'minute_of_hour', + 'month', + 'monthname', + 'month_name', + 'month_of_year', + 'now', + 'quarter', + 'second', + 'second_of_minute', + 'timestampadd', + 'timestampdiff', + 'timestamp_add', + 'timestamp_diff', + 'today', + 'week', + 'week_of_year', + 'year', + 'abs', + 'acos', + 'asin', + 'atan', + 'atan2', + 'cbrt', + 'ceil', + 'ceiling', + 'cos', + 'cosh', + 'cot', + 'degrees', + 'e', + 'exp', + 'expm1', + 'floor', + 'log', + 'log10', + 'mod', + 'pi', + 'power', + 'radians', + 'rand', + 'random', + 'round', + 'sign', + 'signum|sin', + 'sinh', + 'sqrt', + 'tan', + 'truncate', + 'ascii', + 'bit_length', + 'char', + 'character_length', + 'char_length', + 'concat', + 'insert', + 'lcase', + 'left', + 'length', + 'locate', + 'ltrim', + 'octet_length', + 'position', + 'repeat', + 'replace', + 'right', + 'rtrim', + 'space', + 'substring', + 'ucase', + 'cast', + 'convert', + 'database', + 'user', + 'st_astext', + 'st_aswkt', + 'st_distance', + 'st_geometrytype', + 'st_geomfromtext', + 'st_wkttosql', + 'st_x', + 'st_y', + 'st_z', + 'score', +]; + +export const lexerRules = { + defaultToken: 'invalid', + ignoreCase: true, + tokenPostfix: '', + keywords, + builtinFunctions, + brackets, + tokenizer: { + root: [ + [ + /[a-zA-Z_$][a-zA-Z0-9_$]*\b/, + { + cases: { + '@keywords': 'keyword', + '@builtinFunctions': 'identifier', + '@default': 'identifier', + }, + }, + ], + [/[()]/, '@brackets'], + [/--.*$/, 'comment'], + [/\/\*/, 'comment', '@comment'], + [/\/.*$/, 'comment'], + + [/".*?"/, 'string'], + + [/'.*?'/, 'constant'], + [/`.*?`/, 'string'], + // whitespace + [/[ \t\r\n]+/, { token: '@whitespace' }], + [/[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b/, 'entity.name.function'], + [/⇐|<⇒|\*|\.|\:\:|\+|\-|\/|\/\/|%|&|\^|~|<|>|<=|=>|==|!=|<>|=/, 'keyword.operator'], + [/[\(]/, 'paren.lparen'], + [/[\)]/, 'paren.rparen'], + [/\s+/, 'text'], + ], + numbers: [ + [/0[xX][0-9a-fA-F]*/, 'number'], + [/[$][+-]*\d*(\.\d*)?/, 'number'], + [/((\d+(\.\d*)?)|(\.\d+))([eE][\-+]?\d+)?/, 'number'], + ], + strings: [ + [/N'/, { token: 'string', next: '@string' }], + [/'/, { token: 'string', next: '@string' }], + ], + string: [ + [/[^']+/, 'string'], + [/''/, 'string'], + [/'/, { token: 'string', next: '@pop' }], + ], + comment: [ + [/[^\/*]+/, 'comment'], + [/\*\//, 'comment', '@pop'], + [/[\/*]/, 'comment'], + ], + }, +} as monaco.languages.IMonarchLanguage; diff --git a/packages/kbn-monaco/src/xjson/lexer_rules/index.ts b/packages/kbn-monaco/src/xjson/lexer_rules/index.ts new file mode 100644 index 0000000000000..515de09510a61 --- /dev/null +++ b/packages/kbn-monaco/src/xjson/lexer_rules/index.ts @@ -0,0 +1,33 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +/* eslint-disable-next-line @kbn/eslint/module_migration */ +import * as monaco from 'monaco-editor/esm/vs/editor/editor.api'; +import * as xJson from './xjson'; +import * as esql from './esql'; +import * as painless from './painless'; + +export const registerLexerRules = (m: typeof monaco) => { + m.languages.register({ id: xJson.ID }); + m.languages.setMonarchTokensProvider(xJson.ID, xJson.lexerRules); + m.languages.register({ id: painless.ID }); + m.languages.setMonarchTokensProvider(painless.ID, painless.lexerRules); + m.languages.register({ id: esql.ID }); + m.languages.setMonarchTokensProvider(esql.ID, esql.lexerRules); +}; diff --git a/packages/kbn-monaco/src/xjson/lexer_rules/painless.ts b/packages/kbn-monaco/src/xjson/lexer_rules/painless.ts new file mode 100644 index 0000000000000..676eb3134026a --- /dev/null +++ b/packages/kbn-monaco/src/xjson/lexer_rules/painless.ts @@ -0,0 +1,194 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import { monaco } from '../../monaco'; + +export const ID = 'painless'; + +/** + * Extends the default type for a Monarch language so we can use + * attribute references (like @keywords to reference the keywords list) + * in the defined tokenizer + */ +interface Language extends monaco.languages.IMonarchLanguage { + default: string; + brackets: any; + keywords: string[]; + symbols: RegExp; + escapes: RegExp; + digits: RegExp; + primitives: string[]; + octaldigits: RegExp; + binarydigits: RegExp; + constants: string[]; + operators: string[]; +} + +export const lexerRules = { + default: 'invalid', + tokenPostfix: '', + // painless does not use < >, so we define our own + brackets: [ + ['{', '}', 'delimiter.curly'], + ['[', ']', 'delimiter.square'], + ['(', ')', 'delimiter.parenthesis'], + ], + keywords: [ + 'if', + 'in', + 'else', + 'while', + 'do', + 'for', + 'continue', + 'break', + 'return', + 'new', + 'try', + 'catch', + 'throw', + 'this', + 'instanceof', + ], + primitives: ['void', 'boolean', 'byte', 'short', 'char', 'int', 'long', 'float', 'double', 'def'], + constants: ['true', 'false'], + operators: [ + '=', + '>', + '<', + '!', + '~', + '?', + '?:', + '?.', + ':', + '==', + '===', + '<=', + '>=', + '!=', + '!==', + '&&', + '||', + '++', + '--', + '+', + '-', + '*', + '/', + '&', + '|', + '^', + '%', + '<<', + '>>', + '>>>', + '+=', + '-=', + '*=', + '/=', + '&=', + '|=', + '^=', + '%=', + '<<=', + '>>=', + '>>>=', + '->', + '::', + '=~', + '==~', + ], + symbols: /[=> { + worker.initialize((ctx: any, createData: any) => { + return new XJsonWorker(ctx); + }); +}; diff --git a/packages/kbn-monaco/src/xjson/worker/xjson_worker.ts b/packages/kbn-monaco/src/xjson/worker/xjson_worker.ts new file mode 100644 index 0000000000000..501adcacb6990 --- /dev/null +++ b/packages/kbn-monaco/src/xjson/worker/xjson_worker.ts @@ -0,0 +1,35 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +/* eslint-disable-next-line @kbn/eslint/module_migration */ +import * as monaco from 'monaco-editor/esm/vs/editor/editor.api'; +import { createParser } from '../grammar'; + +export class XJsonWorker { + constructor(private ctx: monaco.worker.IWorkerContext) {} + private parser: any; + + async parse() { + if (!this.parser) { + this.parser = createParser(); + } + const [model] = this.ctx.getMirrorModels(); + return this.parser(model.getValue()); + } +} diff --git a/packages/kbn-monaco/src/xjson/worker_proxy_service.ts b/packages/kbn-monaco/src/xjson/worker_proxy_service.ts new file mode 100644 index 0000000000000..17d6d56e51e59 --- /dev/null +++ b/packages/kbn-monaco/src/xjson/worker_proxy_service.ts @@ -0,0 +1,55 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import { AnnoTypes } from './grammar'; +import { monaco } from '../monaco'; +import { XJsonWorker } from './worker'; +import { ID } from './constants'; + +export interface Annotation { + name?: string; + type: AnnoTypes; + text: string; + at: number; +} + +export interface AnnotationsResponse { + annotations: Annotation[]; +} + +export class WorkerProxyService { + private worker: monaco.editor.MonacoWebWorker | undefined; + + public async getAnnos(): Promise { + if (!this.worker) { + throw new Error('Worker Proxy Service has not been setup!'); + } + await this.worker.withSyncedResources(monaco.editor.getModels().map(({ uri }) => uri)); + const proxy = await this.worker.getProxy(); + return proxy.parse(); + } + + public setup() { + this.worker = monaco.editor.createWebWorker({ label: ID, moduleId: '' }); + } + + public stop() { + if (this.worker) this.worker.dispose(); + } +} diff --git a/packages/kbn-monaco/tsconfig.json b/packages/kbn-monaco/tsconfig.json new file mode 100644 index 0000000000000..95acfd32b24dd --- /dev/null +++ b/packages/kbn-monaco/tsconfig.json @@ -0,0 +1,15 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "outDir": "./target", + "declaration": true, + "sourceMap": true, + "types": [ + "jest", + "node" + ] + }, + "include": [ + "src/**/*" + ] +} diff --git a/packages/kbn-monaco/webpack.config.js b/packages/kbn-monaco/webpack.config.js new file mode 100644 index 0000000000000..1a7d8c031670c --- /dev/null +++ b/packages/kbn-monaco/webpack.config.js @@ -0,0 +1,51 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +const path = require('path'); + +const createLangWorkerConfig = (lang) => ({ + mode: 'production', + entry: path.resolve(__dirname, 'src', lang, 'worker', `${lang}.worker.ts`), + output: { + path: path.resolve(__dirname, 'target/public'), + filename: `${lang}.editor.worker.js`, + }, + resolve: { + modules: ['node_modules'], + extensions: ['.js', '.ts', '.tsx'], + }, + stats: 'errors-only', + module: { + rules: [ + { + test: /\.(js|ts)$/, + exclude: /node_modules/, + use: { + loader: 'babel-loader', + options: { + babelrc: false, + presets: [require.resolve('@kbn/babel-preset/webpack_preset')], + }, + }, + }, + ], + }, +}); + +module.exports = [createLangWorkerConfig('xjson')]; diff --git a/packages/kbn-monaco/yarn.lock b/packages/kbn-monaco/yarn.lock new file mode 120000 index 0000000000000..3f82ebc9cdbae --- /dev/null +++ b/packages/kbn-monaco/yarn.lock @@ -0,0 +1 @@ +../../yarn.lock \ No newline at end of file diff --git a/packages/kbn-ui-shared-deps/entry.js b/packages/kbn-ui-shared-deps/entry.js index ab044a6723da7..88e84fc87ae53 100644 --- a/packages/kbn-ui-shared-deps/entry.js +++ b/packages/kbn-ui-shared-deps/entry.js @@ -30,8 +30,8 @@ export const KbnI18nReact = require('@kbn/i18n/react'); export const Angular = require('angular'); export const Moment = require('moment'); export const MomentTimezone = require('moment-timezone/moment-timezone'); -export const Monaco = require('./monaco.ts'); -export const MonacoBare = require('monaco-editor/esm/vs/editor/editor.api'); +export const KbnMonaco = require('@kbn/monaco'); +export const MonacoBarePluginApi = require('@kbn/monaco').BarePluginApi; export const React = require('react'); export const ReactDom = require('react-dom'); export const ReactDomServer = require('react-dom/server'); diff --git a/packages/kbn-ui-shared-deps/index.js b/packages/kbn-ui-shared-deps/index.js index eb3add68e2866..301d176555847 100644 --- a/packages/kbn-ui-shared-deps/index.js +++ b/packages/kbn-ui-shared-deps/index.js @@ -42,9 +42,9 @@ exports.externals = { 'react-intl': '__kbnSharedDeps__.ReactIntl', 'react-router': '__kbnSharedDeps__.ReactRouter', 'react-router-dom': '__kbnSharedDeps__.ReactRouterDom', - '@kbn/ui-shared-deps/monaco': '__kbnSharedDeps__.Monaco', + '@kbn/monaco': '__kbnSharedDeps__.KbnMonaco', // this is how plugins/consumers from npm load monaco - 'monaco-editor/esm/vs/editor/editor.api': '__kbnSharedDeps__.MonacoBare', + 'monaco-editor/esm/vs/editor/editor.api': '__kbnSharedDeps__.MonacoBarePluginApi', /** * big deps which are locked to a single version diff --git a/packages/kbn-ui-shared-deps/package.json b/packages/kbn-ui-shared-deps/package.json index 93afa303c8cad..744a656c54a7f 100644 --- a/packages/kbn-ui-shared-deps/package.json +++ b/packages/kbn-ui-shared-deps/package.json @@ -13,6 +13,7 @@ "@elastic/eui": "23.3.1", "@elastic/numeral": "^2.5.0", "@kbn/i18n": "1.0.0", + "@kbn/monaco": "1.0.0", "abortcontroller-polyfill": "^1.4.0", "angular": "^1.7.9", "compression-webpack-plugin": "^3.1.0", @@ -22,7 +23,6 @@ "jquery": "^3.5.0", "moment": "^2.24.0", "moment-timezone": "^0.5.27", - "monaco-editor": "~0.17.0", "react": "^16.12.0", "react-dom": "^16.12.0", "react-intl": "^2.8.0", diff --git a/packages/kbn-ui-shared-deps/tsconfig.json b/packages/kbn-ui-shared-deps/tsconfig.json index 5d981c73f1d21..5aa0f45e4100d 100644 --- a/packages/kbn-ui-shared-deps/tsconfig.json +++ b/packages/kbn-ui-shared-deps/tsconfig.json @@ -1,7 +1,4 @@ { "extends": "../../tsconfig.json", - "include": [ - "index.d.ts", - "monaco.ts" - ] + "include": ["index.d.ts", "./monaco"] } diff --git a/packages/kbn-ui-shared-deps/webpack.config.js b/packages/kbn-ui-shared-deps/webpack.config.js index 7295f2e88c530..523927bd64a20 100644 --- a/packages/kbn-ui-shared-deps/webpack.config.js +++ b/packages/kbn-ui-shared-deps/webpack.config.js @@ -78,17 +78,6 @@ exports.getWebpackConfig = ({ dev = false } = {}) => ({ test: /\.css$/, use: [MiniCssExtractPlugin.loader, 'css-loader'], }, - { - include: [require.resolve('./monaco.ts')], - use: [ - { - loader: 'babel-loader', - options: { - presets: [require.resolve('@kbn/babel-preset/webpack_preset')], - }, - }, - ], - }, ], }, @@ -96,6 +85,7 @@ exports.getWebpackConfig = ({ dev = false } = {}) => ({ alias: { moment: MOMENT_SRC, }, + extensions: ['.js', '.ts'], }, optimization: { diff --git a/src/cli/cluster/cluster_manager.ts b/src/cli/cluster/cluster_manager.ts index fc94f8d585a02..09f9bb2333dbe 100644 --- a/src/cli/cluster/cluster_manager.ts +++ b/src/cli/cluster/cluster_manager.ts @@ -261,8 +261,8 @@ export class ClusterManager { /debug\.log$/, ...pluginInternalDirsIgnore, fromRoot('src/legacy/server/sass/__tmp__'), - fromRoot('x-pack/legacy/plugins/reporting/.chromium'), - fromRoot('x-pack/plugins/siem/cypress'), + fromRoot('x-pack/plugins/reporting/.chromium'), + fromRoot('x-pack/plugins/security_solution/cypress'), fromRoot('x-pack/plugins/apm/e2e'), fromRoot('x-pack/plugins/apm/scripts'), fromRoot('x-pack/plugins/canvas/canvas_plugin_src'), // prevents server from restarting twice for Canvas plugin changes, diff --git a/src/core/CONVENTIONS.md b/src/core/CONVENTIONS.md index 798977354f277..a4f50e73f1c57 100644 --- a/src/core/CONVENTIONS.md +++ b/src/core/CONVENTIONS.md @@ -336,7 +336,7 @@ import { SavedObjectsType } from 'src/core/server'; export const myType: SavedObjectsType = { name: 'my-type', hidden: false, - namespaceAgnostic: true, + namespaceType: 'single', mappings: { properties: { someField: { diff --git a/src/core/MIGRATION_EXAMPLES.md b/src/core/MIGRATION_EXAMPLES.md index 5cec20fb900f2..6bb5a845ea2ab 100644 --- a/src/core/MIGRATION_EXAMPLES.md +++ b/src/core/MIGRATION_EXAMPLES.md @@ -850,7 +850,7 @@ import { SavedObjectsType } from 'src/core/server'; export const firstType: SavedObjectsType = { name: 'first-type', hidden: false, - namespaceAgnostic: true, + namespaceType: 'agnostic', mappings: { properties: { someField: { @@ -888,7 +888,7 @@ import { SavedObjectsType } from 'src/core/server'; export const secondType: SavedObjectsType = { name: 'second-type', hidden: true, - namespaceAgnostic: false, + namespaceType: 'single', mappings: { properties: { textField: { @@ -936,7 +936,7 @@ export class MyPlugin implements Plugin { The NP `registerType` expected input is very close to the legacy format. However, there are some minor changes: -- The `schema.isNamespaceAgnostic` property has been renamed: `SavedObjectsType.namespaceAgnostic` +- The `schema.isNamespaceAgnostic` property has been renamed: `SavedObjectsType.namespaceType`. It no longer accepts a boolean but instead an enum of 'single', 'multiple', or 'agnostic' (see [SavedObjectsNamespaceType](/docs/development/core/server/kibana-plugin-core-server.savedobjectsnamespacetype.md)). - The `schema.indexPattern` was accepting either a `string` or a `(config: LegacyConfig) => string`. `SavedObjectsType.indexPattern` only accepts a string, as you can access the configuration during your plugin's setup phase. diff --git a/src/dev/build/tasks/clean_tasks.js b/src/dev/build/tasks/clean_tasks.js index ec38dd8a1195c..31731e392e5cb 100644 --- a/src/dev/build/tasks/clean_tasks.js +++ b/src/dev/build/tasks/clean_tasks.js @@ -206,7 +206,7 @@ export const CleanExtraBrowsersTask = { async run(config, log, build) { const getBrowserPathsForPlatform = (platform) => { - const reportingDir = 'x-pack/legacy/plugins/reporting'; + const reportingDir = 'x-pack/plugins/reporting'; const chromiumDir = '.chromium'; const chromiumPath = (p) => build.resolvePathForPlatform(platform, reportingDir, chromiumDir, p); diff --git a/src/dev/build/tasks/os_packages/service_templates/systemd/etc/systemd/system/kibana.service b/src/dev/build/tasks/os_packages/service_templates/systemd/etc/systemd/system/kibana.service index 1d88ee535fefa..e66e0e7c8dfb5 100644 --- a/src/dev/build/tasks/os_packages/service_templates/systemd/etc/systemd/system/kibana.service +++ b/src/dev/build/tasks/os_packages/service_templates/systemd/etc/systemd/system/kibana.service @@ -10,7 +10,7 @@ Group=kibana # exist, it continues onward. EnvironmentFile=-/etc/default/kibana EnvironmentFile=-/etc/sysconfig/kibana -ExecStart=/usr/share/kibana/bin/kibana "-c /etc/kibana/kibana.yml" +ExecStart=/usr/share/kibana/bin/kibana Restart=on-failure RestartSec=3 StartLimitBurst=3 diff --git a/src/dev/build/tasks/os_packages/service_templates/sysv/etc/init.d/kibana b/src/dev/build/tasks/os_packages/service_templates/sysv/etc/init.d/kibana index a17d15522b45e..ce29fd12b8e3c 100755 --- a/src/dev/build/tasks/os_packages/service_templates/sysv/etc/init.d/kibana +++ b/src/dev/build/tasks/os_packages/service_templates/sysv/etc/init.d/kibana @@ -17,7 +17,6 @@ name=kibana program=/usr/share/kibana/bin/kibana -args=-c\\\ /etc/kibana/kibana.yml pidfile="/var/run/$name.pid" [ -r /etc/default/$name ] && . /etc/default/$name @@ -53,7 +52,7 @@ start() { chroot --userspec "$user":"$group" "$chroot" sh -c " cd \"$chdir\" - exec \"$program\" $args + exec \"$program\" " >> /var/log/kibana/kibana.stdout 2>> /var/log/kibana/kibana.stderr & # Generate the pidfile from here. If we instead made the forked process diff --git a/src/dev/code_coverage/ingest_coverage/__tests__/transforms.test.js b/src/dev/code_coverage/ingest_coverage/__tests__/transforms.test.js index c62a28a2956e1..8c982b792ed3b 100644 --- a/src/dev/code_coverage/ingest_coverage/__tests__/transforms.test.js +++ b/src/dev/code_coverage/ingest_coverage/__tests__/transforms.test.js @@ -35,13 +35,13 @@ describe(`Transform fn`, () => { it(`should remove the jenkins workspace path`, () => { const obj = { staticSiteUrl: - '/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/x-pack/legacy/plugins/reporting/server/browsers/extract/unzip.js', + '/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/x-pack/plugins/reporting/server/browsers/extract/unzip.js', COVERAGE_INGESTION_KIBANA_ROOT: '/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana', }; expect(coveredFilePath(obj)).to.have.property( 'coveredFilePath', - 'x-pack/legacy/plugins/reporting/server/browsers/extract/unzip.js' + 'x-pack/plugins/reporting/server/browsers/extract/unzip.js' ); }); }); diff --git a/src/dev/code_coverage/ingest_coverage/integration_tests/mocks/jest-combined/coverage-summary-manual-mix.json b/src/dev/code_coverage/ingest_coverage/integration_tests/mocks/jest-combined/coverage-summary-manual-mix.json index baf2b6d500679..25cd2fdfb259d 100644 --- a/src/dev/code_coverage/ingest_coverage/integration_tests/mocks/jest-combined/coverage-summary-manual-mix.json +++ b/src/dev/code_coverage/ingest_coverage/integration_tests/mocks/jest-combined/coverage-summary-manual-mix.json @@ -1,5 +1,5 @@ { - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/x-pack/legacy/plugins/reporting/server/browsers/extract/unzip.js": { + "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/x-pack/plugins/reporting/server/browsers/extract/unzip.js": { "lines": { "total": 4, "covered": 4, diff --git a/src/dev/code_coverage/shell_scripts/fix_html_reports_parallel.sh b/src/dev/code_coverage/shell_scripts/fix_html_reports_parallel.sh index bc184301a6831..098737eb2f800 100644 --- a/src/dev/code_coverage/shell_scripts/fix_html_reports_parallel.sh +++ b/src/dev/code_coverage/shell_scripts/fix_html_reports_parallel.sh @@ -7,7 +7,13 @@ COMBINED_EXRACT_DIR=/${EXTRACT_START_DIR}/${EXTRACT_END_DIR} PWD=$(pwd) du -sh $COMBINED_EXRACT_DIR -echo "### Replacing path in json files" +echo "### Jest: replacing path in json files" +for i in coverage-final xpack-coverage-final; do + sed -i "s|/dev/shm/workspace/kibana|${PWD}|g" $COMBINED_EXRACT_DIR/jest/${i}.json & +done +wait + +echo "### Functional: replacing path in json files" for i in {1..9}; do sed -i "s|/dev/shm/workspace/kibana|${PWD}|g" $COMBINED_EXRACT_DIR/functional/${i}*.json & done diff --git a/src/dev/jest/config.js b/src/dev/jest/config.js index 497a639ecab56..64db131f5219a 100644 --- a/src/dev/jest/config.js +++ b/src/dev/jest/config.js @@ -64,7 +64,8 @@ export default { '\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$': '/src/dev/jest/mocks/file_mock.js', '\\.(css|less|scss)$': '/src/dev/jest/mocks/style_mock.js', - '\\.ace\\.worker.js$': '/src/dev/jest/mocks/ace_worker_module_mock.js', + '\\.ace\\.worker.js$': '/src/dev/jest/mocks/worker_module_mock.js', + '\\.editor\\.worker.js$': '/src/dev/jest/mocks/worker_module_mock.js', '^(!!)?file-loader!': '/src/dev/jest/mocks/file_mock.js', }, setupFiles: [ diff --git a/src/dev/jest/mocks/ace_worker_module_mock.js b/src/dev/jest/mocks/worker_module_mock.js similarity index 100% rename from src/dev/jest/mocks/ace_worker_module_mock.js rename to src/dev/jest/mocks/worker_module_mock.js diff --git a/src/dev/precommit_hook/casing_check_config.js b/src/dev/precommit_hook/casing_check_config.js index d968a365e7bb9..253fc104061a8 100644 --- a/src/dev/precommit_hook/casing_check_config.js +++ b/src/dev/precommit_hook/casing_check_config.js @@ -173,12 +173,12 @@ export const TEMPORARILY_IGNORED_PATHS = [ 'x-pack/plugins/monitoring/public/icons/health-green.svg', 'x-pack/plugins/monitoring/public/icons/health-red.svg', 'x-pack/plugins/monitoring/public/icons/health-yellow.svg', - 'x-pack/legacy/plugins/reporting/export_types/printable_pdf/server/lib/pdf/assets/fonts/noto/NotoSansCJKtc-Medium.ttf', - 'x-pack/legacy/plugins/reporting/export_types/printable_pdf/server/lib/pdf/assets/fonts/noto/NotoSansCJKtc-Regular.ttf', - 'x-pack/legacy/plugins/reporting/export_types/printable_pdf/server/lib/pdf/assets/fonts/roboto/Roboto-Italic.ttf', - 'x-pack/legacy/plugins/reporting/export_types/printable_pdf/server/lib/pdf/assets/fonts/roboto/Roboto-Medium.ttf', - 'x-pack/legacy/plugins/reporting/export_types/printable_pdf/server/lib/pdf/assets/fonts/roboto/Roboto-Regular.ttf', - 'x-pack/legacy/plugins/reporting/export_types/printable_pdf/server/lib/pdf/assets/img/logo-grey.png', + 'x-pack/plugins/reporting/server/export_types/printable_pdf/server/lib/pdf/assets/fonts/noto/NotoSansCJKtc-Medium.ttf', + 'x-pack/plugins/reporting/server/export_types/printable_pdf/server/lib/pdf/assets/fonts/noto/NotoSansCJKtc-Regular.ttf', + 'x-pack/plugins/reporting/server/export_types/printable_pdf/server/lib/pdf/assets/fonts/roboto/Roboto-Italic.ttf', + 'x-pack/plugins/reporting/server/export_types/printable_pdf/server/lib/pdf/assets/fonts/roboto/Roboto-Medium.ttf', + 'x-pack/plugins/reporting/server/export_types/printable_pdf/server/lib/pdf/assets/fonts/roboto/Roboto-Regular.ttf', + 'x-pack/plugins/reporting/server/export_types/printable_pdf/server/lib/pdf/assets/img/logo-grey.png', 'x-pack/test/functional/es_archives/monitoring/beats-with-restarted-instance/data.json.gz', 'x-pack/test/functional/es_archives/monitoring/beats-with-restarted-instance/mappings.json', 'x-pack/test/functional/es_archives/monitoring/logstash-pipelines/data.json.gz', diff --git a/src/dev/run_prettier_on_changed.ts b/src/dev/run_prettier_on_changed.ts deleted file mode 100644 index 776d4d5ffd389..0000000000000 --- a/src/dev/run_prettier_on_changed.ts +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import execa from 'execa'; -// @ts-ignore -import SimpleGit from 'simple-git'; -import { run } from '@kbn/dev-utils'; -import dedent from 'dedent'; -import Util from 'util'; - -import pkg from '../../package.json'; -import { REPO_ROOT } from './constants'; -import { File } from './file'; -import * as Eslint from './eslint'; - -run(async function getChangedFiles({ log }) { - const simpleGit = new SimpleGit(REPO_ROOT); - - const getStatus = Util.promisify(simpleGit.status.bind(simpleGit)); - const gitStatus = await getStatus(); - - if (gitStatus.files.length > 0) { - throw new Error( - dedent(`You should run prettier formatter on a clean branch. - Found not committed changes to: - ${gitStatus.files.map((f: { path: string }) => f.path).join('\n')}`) - ); - } - - const revParse = Util.promisify(simpleGit.revparse.bind(simpleGit)); - const currentBranch = await revParse(['--abbrev-ref', 'HEAD']); - const headBranch = pkg.branch; - - const diff = Util.promisify(simpleGit.diff.bind(simpleGit)); - - const changedFileStatuses: string = await diff([ - '--name-status', - `${headBranch}...${currentBranch}`, - ]); - - const changedFiles = changedFileStatuses - .split('\n') - // Ignore blank lines - .filter((line) => line.trim().length > 0) - // git diff --name-status outputs lines with two OR three parts - // separated by a tab character - .map((line) => line.trim().split('\t')) - .map(([status, ...paths]) => { - // ignore deleted files - if (status === 'D') { - return undefined; - } - - // the status is always in the first column - // .. If the file is edited the line will only have two columns - // .. If the file is renamed it will have three columns - // .. In any case, the last column is the CURRENT path to the file - return new File(paths[paths.length - 1]); - }) - .filter((file): file is File => Boolean(file)); - - const pathsToLint = Eslint.pickFilesToLint(log, changedFiles).map((f) => f.getAbsolutePath()); - - if (pathsToLint.length > 0) { - log.debug('[prettier] run on %j files: ', pathsToLint.length, pathsToLint); - } - - while (pathsToLint.length > 0) { - await execa('npx', ['prettier@2.0.4', '--write', ...pathsToLint.splice(0, 100)]); - } -}); diff --git a/src/dev/storybook/aliases.ts b/src/dev/storybook/aliases.ts index 416702c56d852..4ed8f8e7db190 100644 --- a/src/dev/storybook/aliases.ts +++ b/src/dev/storybook/aliases.ts @@ -26,5 +26,5 @@ export const storybookAliases = { drilldowns: 'x-pack/plugins/drilldowns/scripts/storybook.js', embeddable: 'src/plugins/embeddable/scripts/storybook.js', infra: 'x-pack/legacy/plugins/infra/scripts/storybook.js', - siem: 'x-pack/plugins/siem/scripts/storybook.js', + security_solution: 'x-pack/plugins/security_solution/scripts/storybook.js', }; diff --git a/src/dev/typescript/projects.ts b/src/dev/typescript/projects.ts index b368949cc33e1..1e0b631308d9e 100644 --- a/src/dev/typescript/projects.ts +++ b/src/dev/typescript/projects.ts @@ -27,8 +27,8 @@ export const PROJECTS = [ new Project(resolve(REPO_ROOT, 'test/tsconfig.json'), { name: 'kibana/test' }), new Project(resolve(REPO_ROOT, 'x-pack/tsconfig.json')), new Project(resolve(REPO_ROOT, 'x-pack/test/tsconfig.json'), { name: 'x-pack/test' }), - new Project(resolve(REPO_ROOT, 'x-pack/plugins/siem/cypress/tsconfig.json'), { - name: 'siem/cypress', + new Project(resolve(REPO_ROOT, 'x-pack/plugins/security_solution/cypress/tsconfig.json'), { + name: 'security_solution/cypress', }), new Project(resolve(REPO_ROOT, 'x-pack/plugins/apm/e2e/tsconfig.json'), { name: 'apm/cypress', diff --git a/src/plugins/advanced_settings/public/management_app/lib/get_category_name.ts b/src/plugins/advanced_settings/public/management_app/lib/get_category_name.ts index bf3ac9628754a..31df6875c97d9 100644 --- a/src/plugins/advanced_settings/public/management_app/lib/get_category_name.ts +++ b/src/plugins/advanced_settings/public/management_app/lib/get_category_name.ts @@ -46,8 +46,8 @@ const names: Record = { search: i18n.translate('advancedSettings.categoryNames.searchLabel', { defaultMessage: 'Search', }), - siem: i18n.translate('advancedSettings.categoryNames.siemLabel', { - defaultMessage: 'SIEM', + securitySolution: i18n.translate('advancedSettings.categoryNames.securitySolutionLabel', { + defaultMessage: 'Security Solution', }), }; diff --git a/src/plugins/console/server/lib/spec_definitions/js/filter.ts b/src/plugins/console/server/lib/spec_definitions/js/filter.ts index 27e02f7cf1837..b5e99e610b8ba 100644 --- a/src/plugins/console/server/lib/spec_definitions/js/filter.ts +++ b/src/plugins/console/server/lib/spec_definitions/js/filter.ts @@ -58,13 +58,6 @@ filters.limit = { value: 100, }; -filters.type = { - __template: { - value: 'TYPE', - }, - value: '{type}', -}; - filters.geo_bounding_box = { __template: { FIELD: { diff --git a/src/plugins/data/common/es_query/filters/build_filter.test.ts b/src/plugins/data/common/es_query/filters/build_filter.test.ts index 22b44035d6ca8..73a4a4c788863 100644 --- a/src/plugins/data/common/es_query/filters/build_filter.test.ts +++ b/src/plugins/data/common/es_query/filters/build_filter.test.ts @@ -18,7 +18,7 @@ */ import { buildFilter, FilterStateStore, FILTERS } from '.'; -import { stubIndexPattern, stubFields } from '../../../public/stubs'; +import { stubIndexPattern, stubFields } from '../../../common/stubs'; describe('buildFilter', () => { it('should build phrase filters', () => { diff --git a/src/plugins/data/common/es_query/filters/get_index_pattern_from_filter.test.ts b/src/plugins/data/common/es_query/filters/get_index_pattern_from_filter.test.ts index 2f31fafcb74e4..672c0a6db4dd0 100644 --- a/src/plugins/data/common/es_query/filters/get_index_pattern_from_filter.test.ts +++ b/src/plugins/data/common/es_query/filters/get_index_pattern_from_filter.test.ts @@ -17,7 +17,7 @@ * under the License. */ -import { stubIndexPattern, phraseFilter } from 'src/plugins/data/public/stubs'; +import { stubIndexPattern, phraseFilter } from 'src/plugins/data/common/stubs'; import { getIndexPatternFromFilter } from './get_index_pattern_from_filter'; describe('getIndexPatternFromFilter', () => { diff --git a/src/plugins/data/common/es_query/kuery/ast/ast.ts b/src/plugins/data/common/es_query/kuery/ast/ast.ts index 01ce77fa8f578..c6f44ebc437d3 100644 --- a/src/plugins/data/common/es_query/kuery/ast/ast.ts +++ b/src/plugins/data/common/es_query/kuery/ast/ast.ts @@ -24,7 +24,7 @@ import { IIndexPattern } from '../../../index_patterns/types'; // @ts-ignore import { parse as parseKuery } from './_generated_/kuery'; -import { JsonObject } from '../../../../../kibana_utils/public'; +import { JsonObject } from '../../../../../kibana_utils/common'; const fromExpression = ( expression: string | DslQuery, diff --git a/src/plugins/data/common/es_query/kuery/node_types/named_arg.ts b/src/plugins/data/common/es_query/kuery/node_types/named_arg.ts index 398cb1a164415..df1fdd1e0d514 100644 --- a/src/plugins/data/common/es_query/kuery/node_types/named_arg.ts +++ b/src/plugins/data/common/es_query/kuery/node_types/named_arg.ts @@ -21,7 +21,7 @@ import _ from 'lodash'; import * as ast from '../ast'; import { nodeTypes } from '../node_types'; import { NamedArgTypeBuildNode } from './types'; -import { JsonObject } from '../../../../../kibana_utils/public'; +import { JsonObject } from '../../../../../kibana_utils/common'; export function buildNode(name: string, value: any): NamedArgTypeBuildNode { const argumentNode = diff --git a/src/plugins/data/common/es_query/kuery/node_types/types.ts b/src/plugins/data/common/es_query/kuery/node_types/types.ts index 937b5c6e7ef9c..6d3019e75d483 100644 --- a/src/plugins/data/common/es_query/kuery/node_types/types.ts +++ b/src/plugins/data/common/es_query/kuery/node_types/types.ts @@ -22,7 +22,7 @@ */ import { IIndexPattern } from '../../../index_patterns'; -import { JsonValue } from '../../../../../kibana_utils/public'; +import { JsonValue } from '../../../../../kibana_utils/common'; import { KueryNode } from '..'; export type FunctionName = diff --git a/src/plugins/data/public/index_patterns/field.stub.ts b/src/plugins/data/common/index_patterns/field.stub.ts similarity index 96% rename from src/plugins/data/public/index_patterns/field.stub.ts rename to src/plugins/data/common/index_patterns/field.stub.ts index 2e94f4b45f400..cbb3d2fa2ce68 100644 --- a/src/plugins/data/public/index_patterns/field.stub.ts +++ b/src/plugins/data/common/index_patterns/field.stub.ts @@ -17,7 +17,7 @@ * under the License. */ -import { IFieldType } from '../../../../plugins/data/public'; +import { IFieldType } from '.'; export const stubFields: IFieldType[] = [ { diff --git a/src/plugins/data/public/index_patterns/index_pattern.stub.ts b/src/plugins/data/common/index_patterns/index_pattern.stub.ts similarity index 96% rename from src/plugins/data/public/index_patterns/index_pattern.stub.ts rename to src/plugins/data/common/index_patterns/index_pattern.stub.ts index 4f8108575aa15..e7384e09494aa 100644 --- a/src/plugins/data/public/index_patterns/index_pattern.stub.ts +++ b/src/plugins/data/common/index_patterns/index_pattern.stub.ts @@ -17,7 +17,7 @@ * under the License. */ -import { IIndexPattern } from '../../common'; +import { IIndexPattern } from '.'; import { stubFields } from './field.stub'; export const stubIndexPattern: IIndexPattern = { diff --git a/src/plugins/data/common/stubs.ts b/src/plugins/data/common/stubs.ts new file mode 100644 index 0000000000000..aea2b71eec46b --- /dev/null +++ b/src/plugins/data/common/stubs.ts @@ -0,0 +1,22 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +export { stubIndexPattern, stubIndexPatternWithFields } from './index_patterns/index_pattern.stub'; +export { stubFields } from './index_patterns/field.stub'; +export * from './es_query/filters/stubs'; diff --git a/src/plugins/data/config.ts b/src/plugins/data/config.ts new file mode 100644 index 0000000000000..09cb2cb2afeca --- /dev/null +++ b/src/plugins/data/config.ts @@ -0,0 +1,33 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import { schema, TypeOf } from '@kbn/config-schema'; + +export const configSchema = schema.object({ + autocomplete: schema.object({ + querySuggestions: schema.object({ + enabled: schema.boolean({ defaultValue: true }), + }), + valueSuggestions: schema.object({ + enabled: schema.boolean({ defaultValue: true }), + }), + }), +}); + +export type ConfigSchema = TypeOf; diff --git a/src/plugins/data/public/autocomplete/autocomplete_service.ts b/src/plugins/data/public/autocomplete/autocomplete_service.ts index cf248adea0b05..2136a405baad6 100644 --- a/src/plugins/data/public/autocomplete/autocomplete_service.ts +++ b/src/plugins/data/public/autocomplete/autocomplete_service.ts @@ -17,19 +17,30 @@ * under the License. */ -import { CoreSetup } from 'src/core/public'; +import { CoreSetup, PluginInitializerContext } from 'src/core/public'; import { QuerySuggestionGetFn } from './providers/query_suggestion_provider'; import { + getEmptyValueSuggestions, setupValueSuggestionProvider, ValueSuggestionsGetFn, } from './providers/value_suggestion_provider'; +import { ConfigSchema } from '../../config'; + export class AutocompleteService { + autocompleteConfig: ConfigSchema['autocomplete']; + + constructor(initializerContext: PluginInitializerContext) { + const { autocomplete } = initializerContext.config.get(); + + this.autocompleteConfig = autocomplete; + } + private readonly querySuggestionProviders: Map = new Map(); private getValueSuggestions?: ValueSuggestionsGetFn; private addQuerySuggestionProvider = (language: string, provider: QuerySuggestionGetFn): void => { - if (language && provider) { + if (language && provider && this.autocompleteConfig.querySuggestions.enabled) { this.querySuggestionProviders.set(language, provider); } }; @@ -47,7 +58,9 @@ export class AutocompleteService { /** @public **/ public setup(core: CoreSetup) { - this.getValueSuggestions = setupValueSuggestionProvider(core); + this.getValueSuggestions = this.autocompleteConfig.valueSuggestions.enabled + ? setupValueSuggestionProvider(core) + : getEmptyValueSuggestions; return { addQuerySuggestionProvider: this.addQuerySuggestionProvider, diff --git a/src/plugins/data/public/autocomplete/providers/value_suggestion_provider.ts b/src/plugins/data/public/autocomplete/providers/value_suggestion_provider.ts index 5df88000edbd5..ef7a0e8c3a5ad 100644 --- a/src/plugins/data/public/autocomplete/providers/value_suggestion_provider.ts +++ b/src/plugins/data/public/autocomplete/providers/value_suggestion_provider.ts @@ -38,6 +38,8 @@ interface ValueSuggestionsGetFnArgs { signal?: AbortSignal; } +export const getEmptyValueSuggestions = (() => Promise.resolve([])) as ValueSuggestionsGetFn; + export const setupValueSuggestionProvider = (core: CoreSetup): ValueSuggestionsGetFn => { const requestSuggestions = memoize( (index: string, field: IFieldType, query: string, boolFilter: any = [], signal?: AbortSignal) => diff --git a/src/plugins/data/public/index.ts b/src/plugins/data/public/index.ts index 4a5b3fd5714db..0c946fc6e1858 100644 --- a/src/plugins/data/public/index.ts +++ b/src/plugins/data/public/index.ts @@ -20,6 +20,7 @@ import './index.scss'; import { PluginInitializerContext } from '../../../core/public'; +import { ConfigSchema } from '../config'; /* * Filters: @@ -450,7 +451,7 @@ export { import { DataPublicPlugin } from './plugin'; -export function plugin(initializerContext: PluginInitializerContext) { +export function plugin(initializerContext: PluginInitializerContext) { return new DataPublicPlugin(initializerContext); } diff --git a/src/plugins/data/public/plugin.ts b/src/plugins/data/public/plugin.ts index 08796216db1e0..66e8d5a6e739a 100644 --- a/src/plugins/data/public/plugin.ts +++ b/src/plugins/data/public/plugin.ts @@ -24,6 +24,7 @@ import { Plugin, PackageInfo, } from 'src/core/public'; +import { ConfigSchema } from '../config'; import { Storage, IStorageWrapper, createStartServicesGetter } from '../../kibana_utils/public'; import { DataPublicPluginSetup, @@ -83,17 +84,18 @@ declare module '../../ui_actions/public' { } export class DataPublicPlugin implements Plugin { - private readonly autocomplete = new AutocompleteService(); + private readonly autocomplete: AutocompleteService; private readonly searchService: SearchService; private readonly fieldFormatsService: FieldFormatsService; private readonly queryService: QueryService; private readonly storage: IStorageWrapper; private readonly packageInfo: PackageInfo; - constructor(initializerContext: PluginInitializerContext) { + constructor(initializerContext: PluginInitializerContext) { this.searchService = new SearchService(); this.queryService = new QueryService(); this.fieldFormatsService = new FieldFormatsService(); + this.autocomplete = new AutocompleteService(initializerContext); this.storage = new Storage(window.localStorage); this.packageInfo = initializerContext.env.packageInfo; } diff --git a/src/plugins/data/public/public.api.md b/src/plugins/data/public/public.api.md index 142ec9c8c877e..ebb4e9d583bc0 100644 --- a/src/plugins/data/public/public.api.md +++ b/src/plugins/data/public/public.api.md @@ -53,6 +53,7 @@ import { SimpleSavedObject } from 'src/core/public'; import { Subscription } from 'rxjs'; import { Toast } from 'kibana/public'; import { ToastsStart } from 'kibana/public'; +import { TypeOf } from '@kbn/config-schema'; import { UiActionsSetup } from 'src/plugins/ui_actions/public'; import { UiActionsStart } from 'src/plugins/ui_actions/public'; import { Unit } from '@elastic/datemath'; @@ -1319,7 +1320,8 @@ export type PhrasesFilter = Filter & { // // @public (undocumented) export class Plugin implements Plugin_2 { - constructor(initializerContext: PluginInitializerContext_2); + // Warning: (ae-forgotten-export) The symbol "ConfigSchema" needs to be exported by the entry point index.d.ts + constructor(initializerContext: PluginInitializerContext_2); // Warning: (ae-forgotten-export) The symbol "DataSetupDependencies" needs to be exported by the entry point index.d.ts // // (undocumented) @@ -1336,7 +1338,7 @@ export class Plugin implements Plugin_2): Plugin; // Warning: (ae-missing-release-tag) "Query" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // @@ -1798,52 +1800,52 @@ export type TSearchStrategyProvider = (context: ISearc // src/plugins/data/common/es_query/filters/match_all_filter.ts:28:3 - (ae-forgotten-export) The symbol "MatchAllFilterMeta" needs to be exported by the entry point index.d.ts // src/plugins/data/common/es_query/filters/phrase_filter.ts:33:3 - (ae-forgotten-export) The symbol "PhraseFilterMeta" needs to be exported by the entry point index.d.ts // src/plugins/data/common/es_query/filters/phrases_filter.ts:31:3 - (ae-forgotten-export) The symbol "PhrasesFilterMeta" needs to be exported by the entry point index.d.ts -// src/plugins/data/public/index.ts:66:23 - (ae-forgotten-export) The symbol "FilterLabel" needs to be exported by the entry point index.d.ts -// src/plugins/data/public/index.ts:66:23 - (ae-forgotten-export) The symbol "FILTERS" needs to be exported by the entry point index.d.ts -// src/plugins/data/public/index.ts:66:23 - (ae-forgotten-export) The symbol "getDisplayValueFromFilter" needs to be exported by the entry point index.d.ts -// src/plugins/data/public/index.ts:66:23 - (ae-forgotten-export) The symbol "generateFilters" needs to be exported by the entry point index.d.ts -// src/plugins/data/public/index.ts:66:23 - (ae-forgotten-export) The symbol "changeTimeFilter" needs to be exported by the entry point index.d.ts -// src/plugins/data/public/index.ts:66:23 - (ae-forgotten-export) The symbol "convertRangeFilterToTimeRangeString" needs to be exported by the entry point index.d.ts -// src/plugins/data/public/index.ts:66:23 - (ae-forgotten-export) The symbol "extractTimeFilter" needs to be exported by the entry point index.d.ts -// src/plugins/data/public/index.ts:137:21 - (ae-forgotten-export) The symbol "buildEsQuery" needs to be exported by the entry point index.d.ts -// src/plugins/data/public/index.ts:137:21 - (ae-forgotten-export) The symbol "getEsQueryConfig" needs to be exported by the entry point index.d.ts -// src/plugins/data/public/index.ts:137:21 - (ae-forgotten-export) The symbol "luceneStringToDsl" needs to be exported by the entry point index.d.ts -// src/plugins/data/public/index.ts:137:21 - (ae-forgotten-export) The symbol "decorateQuery" needs to be exported by the entry point index.d.ts -// src/plugins/data/public/index.ts:179:26 - (ae-forgotten-export) The symbol "FieldFormatsRegistry" needs to be exported by the entry point index.d.ts -// src/plugins/data/public/index.ts:179:26 - (ae-forgotten-export) The symbol "BoolFormat" needs to be exported by the entry point index.d.ts -// src/plugins/data/public/index.ts:179:26 - (ae-forgotten-export) The symbol "BytesFormat" needs to be exported by the entry point index.d.ts -// src/plugins/data/public/index.ts:179:26 - (ae-forgotten-export) The symbol "ColorFormat" needs to be exported by the entry point index.d.ts -// src/plugins/data/public/index.ts:179:26 - (ae-forgotten-export) The symbol "DateNanosFormat" needs to be exported by the entry point index.d.ts -// src/plugins/data/public/index.ts:179:26 - (ae-forgotten-export) The symbol "DurationFormat" needs to be exported by the entry point index.d.ts -// src/plugins/data/public/index.ts:179:26 - (ae-forgotten-export) The symbol "IpFormat" needs to be exported by the entry point index.d.ts -// src/plugins/data/public/index.ts:179:26 - (ae-forgotten-export) The symbol "NumberFormat" needs to be exported by the entry point index.d.ts -// src/plugins/data/public/index.ts:179:26 - (ae-forgotten-export) The symbol "PercentFormat" needs to be exported by the entry point index.d.ts -// src/plugins/data/public/index.ts:179:26 - (ae-forgotten-export) The symbol "RelativeDateFormat" needs to be exported by the entry point index.d.ts -// src/plugins/data/public/index.ts:179:26 - (ae-forgotten-export) The symbol "SourceFormat" needs to be exported by the entry point index.d.ts -// src/plugins/data/public/index.ts:179:26 - (ae-forgotten-export) The symbol "StaticLookupFormat" needs to be exported by the entry point index.d.ts -// src/plugins/data/public/index.ts:179:26 - (ae-forgotten-export) The symbol "UrlFormat" needs to be exported by the entry point index.d.ts -// src/plugins/data/public/index.ts:179:26 - (ae-forgotten-export) The symbol "StringFormat" needs to be exported by the entry point index.d.ts -// src/plugins/data/public/index.ts:179:26 - (ae-forgotten-export) The symbol "TruncateFormat" needs to be exported by the entry point index.d.ts -// src/plugins/data/public/index.ts:237:27 - (ae-forgotten-export) The symbol "isFilterable" needs to be exported by the entry point index.d.ts -// src/plugins/data/public/index.ts:237:27 - (ae-forgotten-export) The symbol "isNestedField" needs to be exported by the entry point index.d.ts -// src/plugins/data/public/index.ts:237:27 - (ae-forgotten-export) The symbol "validateIndexPattern" needs to be exported by the entry point index.d.ts -// src/plugins/data/public/index.ts:237:27 - (ae-forgotten-export) The symbol "getFromSavedObject" needs to be exported by the entry point index.d.ts -// src/plugins/data/public/index.ts:237:27 - (ae-forgotten-export) The symbol "flattenHitWrapper" needs to be exported by the entry point index.d.ts -// src/plugins/data/public/index.ts:237:27 - (ae-forgotten-export) The symbol "formatHitProvider" needs to be exported by the entry point index.d.ts -// src/plugins/data/public/index.ts:377:20 - (ae-forgotten-export) The symbol "getRequestInspectorStats" needs to be exported by the entry point index.d.ts -// src/plugins/data/public/index.ts:377:20 - (ae-forgotten-export) The symbol "getResponseInspectorStats" needs to be exported by the entry point index.d.ts -// src/plugins/data/public/index.ts:377:20 - (ae-forgotten-export) The symbol "tabifyAggResponse" needs to be exported by the entry point index.d.ts -// src/plugins/data/public/index.ts:377:20 - (ae-forgotten-export) The symbol "tabifyGetColumns" needs to be exported by the entry point index.d.ts -// src/plugins/data/public/index.ts:379:1 - (ae-forgotten-export) The symbol "CidrMask" needs to be exported by the entry point index.d.ts -// src/plugins/data/public/index.ts:380:1 - (ae-forgotten-export) The symbol "dateHistogramInterval" needs to be exported by the entry point index.d.ts -// src/plugins/data/public/index.ts:389:1 - (ae-forgotten-export) The symbol "InvalidEsCalendarIntervalError" needs to be exported by the entry point index.d.ts -// src/plugins/data/public/index.ts:390:1 - (ae-forgotten-export) The symbol "InvalidEsIntervalFormatError" needs to be exported by the entry point index.d.ts -// src/plugins/data/public/index.ts:391:1 - (ae-forgotten-export) The symbol "isDateHistogramBucketAggConfig" needs to be exported by the entry point index.d.ts -// src/plugins/data/public/index.ts:395:1 - (ae-forgotten-export) The symbol "isValidEsInterval" needs to be exported by the entry point index.d.ts -// src/plugins/data/public/index.ts:396:1 - (ae-forgotten-export) The symbol "isValidInterval" needs to be exported by the entry point index.d.ts -// src/plugins/data/public/index.ts:399:1 - (ae-forgotten-export) The symbol "parseInterval" needs to be exported by the entry point index.d.ts -// src/plugins/data/public/index.ts:400:1 - (ae-forgotten-export) The symbol "propFilter" needs to be exported by the entry point index.d.ts -// src/plugins/data/public/index.ts:403:1 - (ae-forgotten-export) The symbol "toAbsoluteDates" needs to be exported by the entry point index.d.ts +// src/plugins/data/public/index.ts:67:23 - (ae-forgotten-export) The symbol "FilterLabel" needs to be exported by the entry point index.d.ts +// src/plugins/data/public/index.ts:67:23 - (ae-forgotten-export) The symbol "FILTERS" needs to be exported by the entry point index.d.ts +// src/plugins/data/public/index.ts:67:23 - (ae-forgotten-export) The symbol "getDisplayValueFromFilter" needs to be exported by the entry point index.d.ts +// src/plugins/data/public/index.ts:67:23 - (ae-forgotten-export) The symbol "generateFilters" needs to be exported by the entry point index.d.ts +// src/plugins/data/public/index.ts:67:23 - (ae-forgotten-export) The symbol "changeTimeFilter" needs to be exported by the entry point index.d.ts +// src/plugins/data/public/index.ts:67:23 - (ae-forgotten-export) The symbol "convertRangeFilterToTimeRangeString" needs to be exported by the entry point index.d.ts +// src/plugins/data/public/index.ts:67:23 - (ae-forgotten-export) The symbol "extractTimeFilter" needs to be exported by the entry point index.d.ts +// src/plugins/data/public/index.ts:138:21 - (ae-forgotten-export) The symbol "buildEsQuery" needs to be exported by the entry point index.d.ts +// src/plugins/data/public/index.ts:138:21 - (ae-forgotten-export) The symbol "getEsQueryConfig" needs to be exported by the entry point index.d.ts +// src/plugins/data/public/index.ts:138:21 - (ae-forgotten-export) The symbol "luceneStringToDsl" needs to be exported by the entry point index.d.ts +// src/plugins/data/public/index.ts:138:21 - (ae-forgotten-export) The symbol "decorateQuery" needs to be exported by the entry point index.d.ts +// src/plugins/data/public/index.ts:180:26 - (ae-forgotten-export) The symbol "FieldFormatsRegistry" needs to be exported by the entry point index.d.ts +// src/plugins/data/public/index.ts:180:26 - (ae-forgotten-export) The symbol "BoolFormat" needs to be exported by the entry point index.d.ts +// src/plugins/data/public/index.ts:180:26 - (ae-forgotten-export) The symbol "BytesFormat" needs to be exported by the entry point index.d.ts +// src/plugins/data/public/index.ts:180:26 - (ae-forgotten-export) The symbol "ColorFormat" needs to be exported by the entry point index.d.ts +// src/plugins/data/public/index.ts:180:26 - (ae-forgotten-export) The symbol "DateNanosFormat" needs to be exported by the entry point index.d.ts +// src/plugins/data/public/index.ts:180:26 - (ae-forgotten-export) The symbol "DurationFormat" needs to be exported by the entry point index.d.ts +// src/plugins/data/public/index.ts:180:26 - (ae-forgotten-export) The symbol "IpFormat" needs to be exported by the entry point index.d.ts +// src/plugins/data/public/index.ts:180:26 - (ae-forgotten-export) The symbol "NumberFormat" needs to be exported by the entry point index.d.ts +// src/plugins/data/public/index.ts:180:26 - (ae-forgotten-export) The symbol "PercentFormat" needs to be exported by the entry point index.d.ts +// src/plugins/data/public/index.ts:180:26 - (ae-forgotten-export) The symbol "RelativeDateFormat" needs to be exported by the entry point index.d.ts +// src/plugins/data/public/index.ts:180:26 - (ae-forgotten-export) The symbol "SourceFormat" needs to be exported by the entry point index.d.ts +// src/plugins/data/public/index.ts:180:26 - (ae-forgotten-export) The symbol "StaticLookupFormat" needs to be exported by the entry point index.d.ts +// src/plugins/data/public/index.ts:180:26 - (ae-forgotten-export) The symbol "UrlFormat" needs to be exported by the entry point index.d.ts +// src/plugins/data/public/index.ts:180:26 - (ae-forgotten-export) The symbol "StringFormat" needs to be exported by the entry point index.d.ts +// src/plugins/data/public/index.ts:180:26 - (ae-forgotten-export) The symbol "TruncateFormat" needs to be exported by the entry point index.d.ts +// src/plugins/data/public/index.ts:238:27 - (ae-forgotten-export) The symbol "isFilterable" needs to be exported by the entry point index.d.ts +// src/plugins/data/public/index.ts:238:27 - (ae-forgotten-export) The symbol "isNestedField" needs to be exported by the entry point index.d.ts +// src/plugins/data/public/index.ts:238:27 - (ae-forgotten-export) The symbol "validateIndexPattern" needs to be exported by the entry point index.d.ts +// src/plugins/data/public/index.ts:238:27 - (ae-forgotten-export) The symbol "getFromSavedObject" needs to be exported by the entry point index.d.ts +// src/plugins/data/public/index.ts:238:27 - (ae-forgotten-export) The symbol "flattenHitWrapper" needs to be exported by the entry point index.d.ts +// src/plugins/data/public/index.ts:238:27 - (ae-forgotten-export) The symbol "formatHitProvider" needs to be exported by the entry point index.d.ts +// src/plugins/data/public/index.ts:378:20 - (ae-forgotten-export) The symbol "getRequestInspectorStats" needs to be exported by the entry point index.d.ts +// src/plugins/data/public/index.ts:378:20 - (ae-forgotten-export) The symbol "getResponseInspectorStats" needs to be exported by the entry point index.d.ts +// src/plugins/data/public/index.ts:378:20 - (ae-forgotten-export) The symbol "tabifyAggResponse" needs to be exported by the entry point index.d.ts +// src/plugins/data/public/index.ts:378:20 - (ae-forgotten-export) The symbol "tabifyGetColumns" needs to be exported by the entry point index.d.ts +// src/plugins/data/public/index.ts:380:1 - (ae-forgotten-export) The symbol "CidrMask" needs to be exported by the entry point index.d.ts +// src/plugins/data/public/index.ts:381:1 - (ae-forgotten-export) The symbol "dateHistogramInterval" needs to be exported by the entry point index.d.ts +// src/plugins/data/public/index.ts:390:1 - (ae-forgotten-export) The symbol "InvalidEsCalendarIntervalError" needs to be exported by the entry point index.d.ts +// src/plugins/data/public/index.ts:391:1 - (ae-forgotten-export) The symbol "InvalidEsIntervalFormatError" needs to be exported by the entry point index.d.ts +// src/plugins/data/public/index.ts:392:1 - (ae-forgotten-export) The symbol "isDateHistogramBucketAggConfig" needs to be exported by the entry point index.d.ts +// src/plugins/data/public/index.ts:396:1 - (ae-forgotten-export) The symbol "isValidEsInterval" needs to be exported by the entry point index.d.ts +// src/plugins/data/public/index.ts:397:1 - (ae-forgotten-export) The symbol "isValidInterval" needs to be exported by the entry point index.d.ts +// src/plugins/data/public/index.ts:400:1 - (ae-forgotten-export) The symbol "parseInterval" needs to be exported by the entry point index.d.ts +// src/plugins/data/public/index.ts:401:1 - (ae-forgotten-export) The symbol "propFilter" needs to be exported by the entry point index.d.ts +// src/plugins/data/public/index.ts:404:1 - (ae-forgotten-export) The symbol "toAbsoluteDates" needs to be exported by the entry point index.d.ts // src/plugins/data/public/query/state_sync/connect_to_query_state.ts:33:33 - (ae-forgotten-export) The symbol "FilterStateStore" needs to be exported by the entry point index.d.ts // src/plugins/data/public/query/state_sync/connect_to_query_state.ts:37:1 - (ae-forgotten-export) The symbol "QueryStateChange" needs to be exported by the entry point index.d.ts // src/plugins/data/public/types.ts:52:5 - (ae-forgotten-export) The symbol "createFiltersFromValueClickAction" needs to be exported by the entry point index.d.ts diff --git a/src/plugins/data/public/stubs.ts b/src/plugins/data/public/stubs.ts index d2519716dd83e..1b44d35addb66 100644 --- a/src/plugins/data/public/stubs.ts +++ b/src/plugins/data/public/stubs.ts @@ -17,6 +17,4 @@ * under the License. */ -export { stubIndexPattern, stubIndexPatternWithFields } from './index_patterns/index_pattern.stub'; -export { stubFields } from './index_patterns/field.stub'; -export * from '../common/es_query/filters/stubs'; +export * from '../common/stubs'; diff --git a/src/plugins/data/server/autocomplete/autocomplete_service.ts b/src/plugins/data/server/autocomplete/autocomplete_service.ts index 412e9b6236195..07f0ce0e7c1e5 100644 --- a/src/plugins/data/server/autocomplete/autocomplete_service.ts +++ b/src/plugins/data/server/autocomplete/autocomplete_service.ts @@ -17,14 +17,23 @@ * under the License. */ +import { TypeOf } from '@kbn/config-schema'; import { CoreSetup, Plugin, PluginInitializerContext } from 'kibana/server'; import { registerRoutes } from './routes'; +import { ConfigSchema, configSchema } from '../../config'; export class AutocompleteService implements Plugin { - constructor(private initializerContext: PluginInitializerContext) {} + private valueSuggestionsEnabled: boolean = true; + + constructor(private initializerContext: PluginInitializerContext) { + initializerContext.config.create>().subscribe((configUpdate) => { + this.valueSuggestionsEnabled = configUpdate.autocomplete.valueSuggestions.enabled; + }); + } public setup(core: CoreSetup) { - registerRoutes(core, this.initializerContext.config.legacy.globalConfig$); + if (this.valueSuggestionsEnabled) + registerRoutes(core, this.initializerContext.config.legacy.globalConfig$); } public start() {} diff --git a/src/plugins/data/server/index.ts b/src/plugins/data/server/index.ts index 47bef4255347c..72a29e377ac54 100644 --- a/src/plugins/data/server/index.ts +++ b/src/plugins/data/server/index.ts @@ -17,7 +17,8 @@ * under the License. */ -import { PluginInitializerContext } from '../../../core/server'; +import { PluginConfigDescriptor, PluginInitializerContext } from '../../../core/server'; +import { ConfigSchema, configSchema } from '../config'; import { DataServerPlugin, DataPluginSetup, DataPluginStart } from './plugin'; import { @@ -213,7 +214,7 @@ export { * @public */ -export function plugin(initializerContext: PluginInitializerContext) { +export function plugin(initializerContext: PluginInitializerContext) { return new DataServerPlugin(initializerContext); } @@ -222,3 +223,10 @@ export { DataPluginSetup as PluginSetup, DataPluginStart as PluginStart, }; + +export const config: PluginConfigDescriptor = { + exposeToBrowser: { + autocomplete: true, + }, + schema: configSchema, +}; diff --git a/src/plugins/data/server/plugin.ts b/src/plugins/data/server/plugin.ts index 83a5358642ce4..df7a7b9cf4d01 100644 --- a/src/plugins/data/server/plugin.ts +++ b/src/plugins/data/server/plugin.ts @@ -18,6 +18,7 @@ */ import { PluginInitializerContext, CoreSetup, CoreStart, Plugin } from '../../../core/server'; +import { ConfigSchema } from '../config'; import { IndexPatternsService } from './index_patterns'; import { ISearchSetup } from './search'; import { SearchService } from './search/search_service'; @@ -51,7 +52,7 @@ export class DataServerPlugin implements Plugin) { this.searchService = new SearchService(initializerContext); this.scriptsService = new ScriptsService(); this.kqlTelemetryService = new KqlTelemetryService(initializerContext); diff --git a/src/plugins/data/server/server.api.md b/src/plugins/data/server/server.api.md index 76eb3b5b87424..cd937818fd3f2 100644 --- a/src/plugins/data/server/server.api.md +++ b/src/plugins/data/server/server.api.md @@ -152,6 +152,13 @@ import { Url } from 'url'; // @public export const castEsToKbnFieldTypeName: (esType: string) => KBN_FIELD_TYPES; +// Warning: (ae-forgotten-export) The symbol "PluginConfigDescriptor" needs to be exported by the entry point index.d.ts +// Warning: (ae-forgotten-export) The symbol "ConfigSchema" needs to be exported by the entry point index.d.ts +// Warning: (ae-missing-release-tag) "config" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export const config: PluginConfigDescriptor; + // @public (undocumented) export enum ES_FIELD_TYPES { // (undocumented) @@ -604,7 +611,7 @@ export function parseInterval(interval: string): moment.Duration | null; // @public (undocumented) export class Plugin implements Plugin_2 { // Warning: (ae-forgotten-export) The symbol "PluginInitializerContext" needs to be exported by the entry point index.d.ts - constructor(initializerContext: PluginInitializerContext); + constructor(initializerContext: PluginInitializerContext); // Warning: (ae-forgotten-export) The symbol "DataPluginSetupDependencies" needs to be exported by the entry point index.d.ts // // (undocumented) @@ -627,7 +634,7 @@ export class Plugin implements Plugin_2 { } // @public -export function plugin(initializerContext: PluginInitializerContext): Plugin; +export function plugin(initializerContext: PluginInitializerContext): Plugin; // Warning: (ae-missing-release-tag) "DataPluginSetup" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // @@ -716,35 +723,35 @@ export type TSearchStrategyProvider = (context: ISearc // Warnings were encountered during analysis: // -// src/plugins/data/server/index.ts:39:23 - (ae-forgotten-export) The symbol "buildCustomFilter" needs to be exported by the entry point index.d.ts -// src/plugins/data/server/index.ts:39:23 - (ae-forgotten-export) The symbol "buildFilter" needs to be exported by the entry point index.d.ts -// src/plugins/data/server/index.ts:70:21 - (ae-forgotten-export) The symbol "getEsQueryConfig" needs to be exported by the entry point index.d.ts -// src/plugins/data/server/index.ts:70:21 - (ae-forgotten-export) The symbol "buildEsQuery" needs to be exported by the entry point index.d.ts -// src/plugins/data/server/index.ts:102:26 - (ae-forgotten-export) The symbol "FieldFormatsRegistry" needs to be exported by the entry point index.d.ts -// src/plugins/data/server/index.ts:102:26 - (ae-forgotten-export) The symbol "FieldFormat" needs to be exported by the entry point index.d.ts -// src/plugins/data/server/index.ts:102:26 - (ae-forgotten-export) The symbol "BoolFormat" needs to be exported by the entry point index.d.ts -// src/plugins/data/server/index.ts:102:26 - (ae-forgotten-export) The symbol "BytesFormat" needs to be exported by the entry point index.d.ts -// src/plugins/data/server/index.ts:102:26 - (ae-forgotten-export) The symbol "ColorFormat" needs to be exported by the entry point index.d.ts -// src/plugins/data/server/index.ts:102:26 - (ae-forgotten-export) The symbol "DateNanosFormat" needs to be exported by the entry point index.d.ts -// src/plugins/data/server/index.ts:102:26 - (ae-forgotten-export) The symbol "DurationFormat" needs to be exported by the entry point index.d.ts -// src/plugins/data/server/index.ts:102:26 - (ae-forgotten-export) The symbol "IpFormat" needs to be exported by the entry point index.d.ts -// src/plugins/data/server/index.ts:102:26 - (ae-forgotten-export) The symbol "NumberFormat" needs to be exported by the entry point index.d.ts -// src/plugins/data/server/index.ts:102:26 - (ae-forgotten-export) The symbol "PercentFormat" needs to be exported by the entry point index.d.ts -// src/plugins/data/server/index.ts:102:26 - (ae-forgotten-export) The symbol "RelativeDateFormat" needs to be exported by the entry point index.d.ts -// src/plugins/data/server/index.ts:102:26 - (ae-forgotten-export) The symbol "SourceFormat" needs to be exported by the entry point index.d.ts -// src/plugins/data/server/index.ts:102:26 - (ae-forgotten-export) The symbol "StaticLookupFormat" needs to be exported by the entry point index.d.ts -// src/plugins/data/server/index.ts:102:26 - (ae-forgotten-export) The symbol "UrlFormat" needs to be exported by the entry point index.d.ts -// src/plugins/data/server/index.ts:102:26 - (ae-forgotten-export) The symbol "StringFormat" needs to be exported by the entry point index.d.ts -// src/plugins/data/server/index.ts:102:26 - (ae-forgotten-export) The symbol "TruncateFormat" needs to be exported by the entry point index.d.ts -// src/plugins/data/server/index.ts:130:27 - (ae-forgotten-export) The symbol "isFilterable" needs to be exported by the entry point index.d.ts -// src/plugins/data/server/index.ts:130:27 - (ae-forgotten-export) The symbol "isNestedField" needs to be exported by the entry point index.d.ts -// src/plugins/data/server/index.ts:182:1 - (ae-forgotten-export) The symbol "dateHistogramInterval" needs to be exported by the entry point index.d.ts -// src/plugins/data/server/index.ts:183:1 - (ae-forgotten-export) The symbol "InvalidEsCalendarIntervalError" needs to be exported by the entry point index.d.ts -// src/plugins/data/server/index.ts:184:1 - (ae-forgotten-export) The symbol "InvalidEsIntervalFormatError" needs to be exported by the entry point index.d.ts -// src/plugins/data/server/index.ts:185:1 - (ae-forgotten-export) The symbol "isValidEsInterval" needs to be exported by the entry point index.d.ts -// src/plugins/data/server/index.ts:186:1 - (ae-forgotten-export) The symbol "isValidInterval" needs to be exported by the entry point index.d.ts -// src/plugins/data/server/index.ts:189:1 - (ae-forgotten-export) The symbol "toAbsoluteDates" needs to be exported by the entry point index.d.ts -// src/plugins/data/server/plugin.ts:65:14 - (ae-forgotten-export) The symbol "ISearchSetup" needs to be exported by the entry point index.d.ts +// src/plugins/data/server/index.ts:40:23 - (ae-forgotten-export) The symbol "buildCustomFilter" needs to be exported by the entry point index.d.ts +// src/plugins/data/server/index.ts:40:23 - (ae-forgotten-export) The symbol "buildFilter" needs to be exported by the entry point index.d.ts +// src/plugins/data/server/index.ts:71:21 - (ae-forgotten-export) The symbol "getEsQueryConfig" needs to be exported by the entry point index.d.ts +// src/plugins/data/server/index.ts:71:21 - (ae-forgotten-export) The symbol "buildEsQuery" needs to be exported by the entry point index.d.ts +// src/plugins/data/server/index.ts:103:26 - (ae-forgotten-export) The symbol "FieldFormatsRegistry" needs to be exported by the entry point index.d.ts +// src/plugins/data/server/index.ts:103:26 - (ae-forgotten-export) The symbol "FieldFormat" needs to be exported by the entry point index.d.ts +// src/plugins/data/server/index.ts:103:26 - (ae-forgotten-export) The symbol "BoolFormat" needs to be exported by the entry point index.d.ts +// src/plugins/data/server/index.ts:103:26 - (ae-forgotten-export) The symbol "BytesFormat" needs to be exported by the entry point index.d.ts +// src/plugins/data/server/index.ts:103:26 - (ae-forgotten-export) The symbol "ColorFormat" needs to be exported by the entry point index.d.ts +// src/plugins/data/server/index.ts:103:26 - (ae-forgotten-export) The symbol "DateNanosFormat" needs to be exported by the entry point index.d.ts +// src/plugins/data/server/index.ts:103:26 - (ae-forgotten-export) The symbol "DurationFormat" needs to be exported by the entry point index.d.ts +// src/plugins/data/server/index.ts:103:26 - (ae-forgotten-export) The symbol "IpFormat" needs to be exported by the entry point index.d.ts +// src/plugins/data/server/index.ts:103:26 - (ae-forgotten-export) The symbol "NumberFormat" needs to be exported by the entry point index.d.ts +// src/plugins/data/server/index.ts:103:26 - (ae-forgotten-export) The symbol "PercentFormat" needs to be exported by the entry point index.d.ts +// src/plugins/data/server/index.ts:103:26 - (ae-forgotten-export) The symbol "RelativeDateFormat" needs to be exported by the entry point index.d.ts +// src/plugins/data/server/index.ts:103:26 - (ae-forgotten-export) The symbol "SourceFormat" needs to be exported by the entry point index.d.ts +// src/plugins/data/server/index.ts:103:26 - (ae-forgotten-export) The symbol "StaticLookupFormat" needs to be exported by the entry point index.d.ts +// src/plugins/data/server/index.ts:103:26 - (ae-forgotten-export) The symbol "UrlFormat" needs to be exported by the entry point index.d.ts +// src/plugins/data/server/index.ts:103:26 - (ae-forgotten-export) The symbol "StringFormat" needs to be exported by the entry point index.d.ts +// src/plugins/data/server/index.ts:103:26 - (ae-forgotten-export) The symbol "TruncateFormat" needs to be exported by the entry point index.d.ts +// src/plugins/data/server/index.ts:131:27 - (ae-forgotten-export) The symbol "isFilterable" needs to be exported by the entry point index.d.ts +// src/plugins/data/server/index.ts:131:27 - (ae-forgotten-export) The symbol "isNestedField" needs to be exported by the entry point index.d.ts +// src/plugins/data/server/index.ts:183:1 - (ae-forgotten-export) The symbol "dateHistogramInterval" needs to be exported by the entry point index.d.ts +// src/plugins/data/server/index.ts:184:1 - (ae-forgotten-export) The symbol "InvalidEsCalendarIntervalError" needs to be exported by the entry point index.d.ts +// src/plugins/data/server/index.ts:185:1 - (ae-forgotten-export) The symbol "InvalidEsIntervalFormatError" needs to be exported by the entry point index.d.ts +// src/plugins/data/server/index.ts:186:1 - (ae-forgotten-export) The symbol "isValidEsInterval" needs to be exported by the entry point index.d.ts +// src/plugins/data/server/index.ts:187:1 - (ae-forgotten-export) The symbol "isValidInterval" needs to be exported by the entry point index.d.ts +// src/plugins/data/server/index.ts:190:1 - (ae-forgotten-export) The symbol "toAbsoluteDates" needs to be exported by the entry point index.d.ts +// src/plugins/data/server/plugin.ts:66:14 - (ae-forgotten-export) The symbol "ISearchSetup" needs to be exported by the entry point index.d.ts // (No @packageDocumentation comment for this package) diff --git a/src/plugins/discover/public/application/angular/discover.js b/src/plugins/discover/public/application/angular/discover.js index 1a2bff8211db5..caba094bd0984 100644 --- a/src/plugins/discover/public/application/angular/discover.js +++ b/src/plugins/discover/public/application/angular/discover.js @@ -750,6 +750,13 @@ function discoverController( // Update defaults so that "reload saved query" functions correctly setAppState(getStateDefaults()); chrome.docTitle.change(savedSearch.lastSavedTitle); + chrome.setBreadcrumbs([ + { + text: discoverBreadcrumbsTitle, + href: '#/', + }, + { text: savedSearch.title }, + ]); } } }); diff --git a/src/plugins/es_ui_shared/__packages_do_not_import__/monaco/index.ts b/src/plugins/es_ui_shared/__packages_do_not_import__/monaco/index.ts new file mode 100644 index 0000000000000..a9c6ea1e01d54 --- /dev/null +++ b/src/plugins/es_ui_shared/__packages_do_not_import__/monaco/index.ts @@ -0,0 +1,20 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +export { useXJsonMode } from './use_xjson_mode'; diff --git a/src/plugins/es_ui_shared/__packages_do_not_import__/monaco/use_xjson_mode.ts b/src/plugins/es_ui_shared/__packages_do_not_import__/monaco/use_xjson_mode.ts new file mode 100644 index 0000000000000..b783045492f05 --- /dev/null +++ b/src/plugins/es_ui_shared/__packages_do_not_import__/monaco/use_xjson_mode.ts @@ -0,0 +1,32 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import { XJsonLang } from '@kbn/monaco'; +import { useXJsonMode as useBaseXJsonMode } from '../xjson'; + +interface ReturnValue extends ReturnType { + XJsonLang: typeof XJsonLang; +} + +export const useXJsonMode = (json: Parameters[0]): ReturnValue => { + return { + ...useBaseXJsonMode(json), + XJsonLang, + }; +}; diff --git a/src/plugins/es_ui_shared/__packages_do_not_import__/xjson/index.ts b/src/plugins/es_ui_shared/__packages_do_not_import__/xjson/index.ts new file mode 100644 index 0000000000000..a9c6ea1e01d54 --- /dev/null +++ b/src/plugins/es_ui_shared/__packages_do_not_import__/xjson/index.ts @@ -0,0 +1,20 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +export { useXJsonMode } from './use_xjson_mode'; diff --git a/src/plugins/es_ui_shared/__packages_do_not_import__/xjson/use_xjson_mode.ts b/src/plugins/es_ui_shared/__packages_do_not_import__/xjson/use_xjson_mode.ts new file mode 100644 index 0000000000000..7dcc7c9ed83bc --- /dev/null +++ b/src/plugins/es_ui_shared/__packages_do_not_import__/xjson/use_xjson_mode.ts @@ -0,0 +1,41 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import { useState, Dispatch } from 'react'; +import { collapseLiteralStrings, expandLiteralStrings } from '../../public'; + +interface ReturnValue { + xJson: string; + setXJson: Dispatch; + convertToJson: typeof collapseLiteralStrings; +} + +export const useXJsonMode = (json: Record | string | null): ReturnValue => { + const [xJson, setXJson] = useState(() => + json === null + ? '' + : expandLiteralStrings(typeof json === 'string' ? json : JSON.stringify(json, null, 2)) + ); + + return { + xJson, + setXJson, + convertToJson: collapseLiteralStrings, + }; +}; diff --git a/src/plugins/es_ui_shared/public/index.ts b/src/plugins/es_ui_shared/public/index.ts index 7e5510d7c9c65..4ab791289dd88 100644 --- a/src/plugins/es_ui_shared/public/index.ts +++ b/src/plugins/es_ui_shared/public/index.ts @@ -47,6 +47,10 @@ export { expandLiteralStrings, } from './console_lang'; +import * as Monaco from './monaco'; + +export { Monaco }; + export { AuthorizationContext, AuthorizationProvider, diff --git a/src/plugins/es_ui_shared/public/monaco/index.ts b/src/plugins/es_ui_shared/public/monaco/index.ts new file mode 100644 index 0000000000000..23ba93e913234 --- /dev/null +++ b/src/plugins/es_ui_shared/public/monaco/index.ts @@ -0,0 +1,20 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +export { useXJsonMode } from '../../__packages_do_not_import__/monaco'; diff --git a/src/plugins/es_ui_shared/static/ace_x_json/hooks/use_x_json.ts b/src/plugins/es_ui_shared/static/ace_x_json/hooks/use_x_json.ts index 2b0bf0c8a3a7c..3a093ac6869d0 100644 --- a/src/plugins/es_ui_shared/static/ace_x_json/hooks/use_x_json.ts +++ b/src/plugins/es_ui_shared/static/ace_x_json/hooks/use_x_json.ts @@ -16,23 +16,18 @@ * specific language governing permissions and limitations * under the License. */ - -import { useState } from 'react'; -import { XJsonMode, collapseLiteralStrings, expandLiteralStrings } from '../../../public'; +import { XJsonMode } from '../../../public'; +import { useXJsonMode as useBaseXJsonMode } from '../../../__packages_do_not_import__/xjson'; const xJsonMode = new XJsonMode(); -export const useXJsonMode = (json: Record | string | null) => { - const [xJson, setXJson] = useState(() => - json === null - ? '' - : expandLiteralStrings(typeof json === 'string' ? json : JSON.stringify(json, null, 2)) - ); +interface ReturnValue extends ReturnType { + xJsonMode: typeof xJsonMode; +} +export const useXJsonMode = (json: Parameters[0]): ReturnValue => { return { - xJson, - setXJson, + ...useBaseXJsonMode(json), xJsonMode, - convertToJson: collapseLiteralStrings, }; }; diff --git a/src/plugins/expressions/common/ast/types.ts b/src/plugins/expressions/common/ast/types.ts index 0b505f117a580..d5039d0adb318 100644 --- a/src/plugins/expressions/common/ast/types.ts +++ b/src/plugins/expressions/common/ast/types.ts @@ -18,7 +18,7 @@ */ import { ExpressionValue, ExpressionValueError } from '../expression_types'; -import { ExpressionFunction } from '../../public'; +import { ExpressionFunction } from '../../common'; export type ExpressionAstNode = | ExpressionAstExpression diff --git a/src/plugins/expressions/common/execution/execution.test.ts b/src/plugins/expressions/common/execution/execution.test.ts index 6a2f4bb269ff3..2e83d16dd778e 100644 --- a/src/plugins/expressions/common/execution/execution.test.ts +++ b/src/plugins/expressions/common/execution/execution.test.ts @@ -20,7 +20,7 @@ import { Execution } from './execution'; import { parseExpression, ExpressionAstExpression } from '../ast'; import { createUnitTestExecutor } from '../test_helpers'; -import { ExpressionFunctionDefinition } from '../../public'; +import { ExpressionFunctionDefinition } from '../../common'; import { ExecutionContract } from './execution_contract'; beforeAll(() => { diff --git a/src/plugins/expressions/common/util/create_error.ts b/src/plugins/expressions/common/util/create_error.ts index bc27b0eda4959..876e7dfec799c 100644 --- a/src/plugins/expressions/common/util/create_error.ts +++ b/src/plugins/expressions/common/util/create_error.ts @@ -17,7 +17,7 @@ * under the License. */ -import { ExpressionValueError } from '../../public'; +import { ExpressionValueError } from '../../common'; type ErrorLike = Partial>; diff --git a/src/plugins/home/server/services/tutorials/lib/tutorial_schema.ts b/src/plugins/home/server/services/tutorials/lib/tutorial_schema.ts index 24f5a39feb4c5..32e5483b8b070 100644 --- a/src/plugins/home/server/services/tutorials/lib/tutorial_schema.ts +++ b/src/plugins/home/server/services/tutorials/lib/tutorial_schema.ts @@ -26,7 +26,7 @@ const PARAM_TYPES = { const TUTORIAL_CATEGORY = { LOGGING: 'logging', - SIEM: 'siem', + SECURITY_SOLUTION: 'security solution', METRICS: 'metrics', OTHER: 'other', }; diff --git a/src/plugins/home/server/services/tutorials/lib/tutorials_registry_types.ts b/src/plugins/home/server/services/tutorials/lib/tutorials_registry_types.ts index 80849513a3fad..3325240147640 100644 --- a/src/plugins/home/server/services/tutorials/lib/tutorials_registry_types.ts +++ b/src/plugins/home/server/services/tutorials/lib/tutorials_registry_types.ts @@ -22,7 +22,7 @@ import { KibanaRequest } from 'src/core/server'; /** @public */ export enum TutorialsCategory { LOGGING = 'logging', - SIEM = 'siem', + SECURITY_SOLUTION = 'security', METRICS = 'metrics', OTHER = 'other', } diff --git a/src/plugins/home/server/tutorials/auditbeat/index.ts b/src/plugins/home/server/tutorials/auditbeat/index.ts index dadbf913d5ed5..214fda5a7cc53 100644 --- a/src/plugins/home/server/tutorials/auditbeat/index.ts +++ b/src/plugins/home/server/tutorials/auditbeat/index.ts @@ -36,7 +36,7 @@ export function auditbeatSpecProvider(context: TutorialContext): TutorialSchema name: i18n.translate('home.tutorials.auditbeat.nameTitle', { defaultMessage: 'Auditbeat', }), - category: TutorialsCategory.SIEM, + category: TutorialsCategory.SECURITY_SOLUTION, shortDescription: i18n.translate('home.tutorials.auditbeat.shortDescription', { defaultMessage: 'Collect audit data from your hosts.', }), @@ -53,9 +53,9 @@ processes, users, logins, sockets information, file accesses, and more. \ artifacts: { dashboards: [], application: { - path: '/app/siem', + path: '/app/security', label: i18n.translate('home.tutorials.auditbeat.artifacts.dashboards.linkLabel', { - defaultMessage: 'SIEM App', + defaultMessage: 'Security App', }), }, exportedFields: { diff --git a/src/plugins/home/server/tutorials/cisco_logs/index.ts b/src/plugins/home/server/tutorials/cisco_logs/index.ts index 4514b61570b07..2322f503b80ce 100644 --- a/src/plugins/home/server/tutorials/cisco_logs/index.ts +++ b/src/plugins/home/server/tutorials/cisco_logs/index.ts @@ -37,7 +37,7 @@ export function ciscoLogsSpecProvider(context: TutorialContext): TutorialSchema name: i18n.translate('home.tutorials.ciscoLogs.nameTitle', { defaultMessage: 'Cisco', }), - category: TutorialsCategory.SIEM, + category: TutorialsCategory.SECURITY_SOLUTION, shortDescription: i18n.translate('home.tutorials.ciscoLogs.shortDescription', { defaultMessage: 'Collect and parse logs received from Cisco ASA firewalls.', }), @@ -54,9 +54,9 @@ supports the "asa" fileset for Cisco ASA firewall logs received over syslog or r artifacts: { dashboards: [], application: { - path: '/app/siem', + path: '/app/security', label: i18n.translate('home.tutorials.ciscoLogs.artifacts.dashboards.linkLabel', { - defaultMessage: 'SIEM App', + defaultMessage: 'Security App', }), }, exportedFields: { diff --git a/src/plugins/home/server/tutorials/coredns_logs/index.ts b/src/plugins/home/server/tutorials/coredns_logs/index.ts index 1c62366251661..4304fb7acb907 100644 --- a/src/plugins/home/server/tutorials/coredns_logs/index.ts +++ b/src/plugins/home/server/tutorials/coredns_logs/index.ts @@ -37,7 +37,7 @@ export function corednsLogsSpecProvider(context: TutorialContext): TutorialSchem name: i18n.translate('home.tutorials.corednsLogs.nameTitle', { defaultMessage: 'CoreDNS logs', }), - category: TutorialsCategory.SIEM, + category: TutorialsCategory.SECURITY_SOLUTION, shortDescription: i18n.translate('home.tutorials.corednsLogs.shortDescription', { defaultMessage: 'Collect the logs created by Coredns.', }), diff --git a/src/plugins/home/server/tutorials/envoyproxy_logs/index.ts b/src/plugins/home/server/tutorials/envoyproxy_logs/index.ts index 3d88cce36d752..a9b9c33d61bdf 100644 --- a/src/plugins/home/server/tutorials/envoyproxy_logs/index.ts +++ b/src/plugins/home/server/tutorials/envoyproxy_logs/index.ts @@ -37,7 +37,7 @@ export function envoyproxyLogsSpecProvider(context: TutorialContext): TutorialSc name: i18n.translate('home.tutorials.envoyproxyLogs.nameTitle', { defaultMessage: 'Envoyproxy', }), - category: TutorialsCategory.SIEM, + category: TutorialsCategory.SECURITY_SOLUTION, shortDescription: i18n.translate('home.tutorials.envoyproxyLogs.shortDescription', { defaultMessage: 'Collect and parse logs received from the Envoy proxy.', }), @@ -54,9 +54,9 @@ It supports both standalone deployment and Envoy proxy deployment in Kubernetes. artifacts: { dashboards: [], application: { - path: '/app/siem', + path: '/app/security', label: i18n.translate('home.tutorials.envoyproxyLogs.artifacts.dashboards.linkLabel', { - defaultMessage: 'SIEM App', + defaultMessage: 'Security App', }), }, exportedFields: { diff --git a/src/plugins/home/server/tutorials/iptables_logs/index.ts b/src/plugins/home/server/tutorials/iptables_logs/index.ts index e72e0ef300e04..fd84894dae850 100644 --- a/src/plugins/home/server/tutorials/iptables_logs/index.ts +++ b/src/plugins/home/server/tutorials/iptables_logs/index.ts @@ -37,7 +37,7 @@ export function iptablesLogsSpecProvider(context: TutorialContext): TutorialSche name: i18n.translate('home.tutorials.iptablesLogs.nameTitle', { defaultMessage: 'Iptables / Ubiquiti', }), - category: TutorialsCategory.SIEM, + category: TutorialsCategory.SECURITY_SOLUTION, shortDescription: i18n.translate('home.tutorials.iptablesLogs.shortDescription', { defaultMessage: 'Collect and parse iptables and ip6tables logs or from Ubiqiti firewalls.', }), @@ -56,9 +56,9 @@ number and the action performed on the traffic (allow/deny).. \ artifacts: { dashboards: [], application: { - path: '/app/siem', + path: '/app/security', label: i18n.translate('home.tutorials.iptablesLogs.artifacts.dashboards.linkLabel', { - defaultMessage: 'SIEM App', + defaultMessage: 'Security App', }), }, exportedFields: { diff --git a/src/plugins/home/server/tutorials/netflow/index.ts b/src/plugins/home/server/tutorials/netflow/index.ts index 7c6fcadcff625..ec0aa8953b146 100644 --- a/src/plugins/home/server/tutorials/netflow/index.ts +++ b/src/plugins/home/server/tutorials/netflow/index.ts @@ -28,7 +28,7 @@ export function netflowSpecProvider() { return { id: 'netflow', name: 'Netflow', - category: TutorialsCategory.SIEM, + category: TutorialsCategory.SECURITY_SOLUTION, shortDescription: i18n.translate('home.tutorials.netflow.tutorialShortDescription', { defaultMessage: 'Collect Netflow records sent by a Netflow exporter.', }), diff --git a/src/plugins/home/server/tutorials/osquery_logs/index.ts b/src/plugins/home/server/tutorials/osquery_logs/index.ts index 34a1b9e7f619d..8781d6201a771 100644 --- a/src/plugins/home/server/tutorials/osquery_logs/index.ts +++ b/src/plugins/home/server/tutorials/osquery_logs/index.ts @@ -37,7 +37,7 @@ export function osqueryLogsSpecProvider(context: TutorialContext): TutorialSchem name: i18n.translate('home.tutorials.osqueryLogs.nameTitle', { defaultMessage: 'Osquery logs', }), - category: TutorialsCategory.SIEM, + category: TutorialsCategory.SECURITY_SOLUTION, shortDescription: i18n.translate('home.tutorials.osqueryLogs.shortDescription', { defaultMessage: 'Collect the result logs created by osqueryd.', }), diff --git a/src/plugins/home/server/tutorials/suricata_logs/index.ts b/src/plugins/home/server/tutorials/suricata_logs/index.ts index c02cb05889ebb..6bcfc1d43a250 100644 --- a/src/plugins/home/server/tutorials/suricata_logs/index.ts +++ b/src/plugins/home/server/tutorials/suricata_logs/index.ts @@ -37,7 +37,7 @@ export function suricataLogsSpecProvider(context: TutorialContext): TutorialSche name: i18n.translate('home.tutorials.suricataLogs.nameTitle', { defaultMessage: 'Suricata logs', }), - category: TutorialsCategory.SIEM, + category: TutorialsCategory.SECURITY_SOLUTION, shortDescription: i18n.translate('home.tutorials.suricataLogs.shortDescription', { defaultMessage: 'Collect the result logs created by Suricata IDS/IPS/NSM.', }), diff --git a/src/plugins/home/server/tutorials/windows_event_logs/index.ts b/src/plugins/home/server/tutorials/windows_event_logs/index.ts index 5349bedb21279..c2ea9ff3015e4 100644 --- a/src/plugins/home/server/tutorials/windows_event_logs/index.ts +++ b/src/plugins/home/server/tutorials/windows_event_logs/index.ts @@ -36,7 +36,7 @@ export function windowsEventLogsSpecProvider(context: TutorialContext): Tutorial defaultMessage: 'Windows Event Log', }), isBeta: false, - category: TutorialsCategory.SIEM, + category: TutorialsCategory.SECURITY_SOLUTION, shortDescription: i18n.translate('home.tutorials.windowsEventLogs.shortDescription', { defaultMessage: 'Fetch logs from the Windows Event Log.', }), diff --git a/src/plugins/home/server/tutorials/zeek_logs/index.ts b/src/plugins/home/server/tutorials/zeek_logs/index.ts index 4bd54c96481b6..c273a93b1b0d5 100644 --- a/src/plugins/home/server/tutorials/zeek_logs/index.ts +++ b/src/plugins/home/server/tutorials/zeek_logs/index.ts @@ -37,7 +37,7 @@ export function zeekLogsSpecProvider(context: TutorialContext): TutorialSchema { name: i18n.translate('home.tutorials.zeekLogs.nameTitle', { defaultMessage: 'Zeek logs', }), - category: TutorialsCategory.SIEM, + category: TutorialsCategory.SECURITY_SOLUTION, shortDescription: i18n.translate('home.tutorials.zeekLogs.shortDescription', { defaultMessage: 'Collect the logs created by Zeek/Bro.', }), diff --git a/src/plugins/kibana_react/public/code_editor/code_editor.examples.tsx b/src/plugins/kibana_react/public/code_editor/code_editor.examples.tsx index b6d5f2c5460f6..892c97e0ffae0 100644 --- a/src/plugins/kibana_react/public/code_editor/code_editor.examples.tsx +++ b/src/plugins/kibana_react/public/code_editor/code_editor.examples.tsx @@ -20,7 +20,7 @@ import { action } from '@storybook/addon-actions'; import { storiesOf } from '@storybook/react'; import React from 'react'; -import { monaco as monacoEditor } from '@kbn/ui-shared-deps/monaco'; +import { monaco as monacoEditor } from '@kbn/monaco'; import { CodeEditor } from './code_editor'; // A sample language definition with a few example tokens diff --git a/src/plugins/kibana_react/public/code_editor/code_editor.test.tsx b/src/plugins/kibana_react/public/code_editor/code_editor.test.tsx index bcb46fac36856..2f0670226cf46 100644 --- a/src/plugins/kibana_react/public/code_editor/code_editor.test.tsx +++ b/src/plugins/kibana_react/public/code_editor/code_editor.test.tsx @@ -19,9 +19,11 @@ import React from 'react'; import { CodeEditor } from './code_editor'; -import { monaco } from '@kbn/ui-shared-deps/monaco'; +import { monaco } from '@kbn/monaco'; import { shallow } from 'enzyme'; +// disabled because this is a test, but also it seems we shouldn't need this? +/* eslint-disable-next-line @kbn/eslint/module_migration */ import 'monaco-editor/esm/vs/basic-languages/html/html.contribution.js'; // A sample language definition with a few example tokens diff --git a/src/plugins/kibana_react/public/code_editor/code_editor.tsx b/src/plugins/kibana_react/public/code_editor/code_editor.tsx index e8b118b804347..f049085ccff61 100644 --- a/src/plugins/kibana_react/public/code_editor/code_editor.tsx +++ b/src/plugins/kibana_react/public/code_editor/code_editor.tsx @@ -21,7 +21,7 @@ import React from 'react'; import ReactResizeDetector from 'react-resize-detector'; import MonacoEditor from 'react-monaco-editor'; -import { monaco } from '@kbn/ui-shared-deps/monaco'; +import { monaco } from '@kbn/monaco'; import { LIGHT_THEME, DARK_THEME } from './editor_theme'; diff --git a/src/plugins/kibana_react/public/code_editor/editor_theme.ts b/src/plugins/kibana_react/public/code_editor/editor_theme.ts index 586b4a568c348..91d66ce8cbf81 100644 --- a/src/plugins/kibana_react/public/code_editor/editor_theme.ts +++ b/src/plugins/kibana_react/public/code_editor/editor_theme.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { monaco } from '@kbn/ui-shared-deps/monaco'; +import { monaco } from '@kbn/monaco'; import darkTheme from '@elastic/eui/dist/eui_theme_dark.json'; import lightTheme from '@elastic/eui/dist/eui_theme_light.json'; diff --git a/src/plugins/vis_type_timelion/public/components/timelion_expression_input.tsx b/src/plugins/vis_type_timelion/public/components/timelion_expression_input.tsx index 8c76b41df0ced..8258b92b096c1 100644 --- a/src/plugins/vis_type_timelion/public/components/timelion_expression_input.tsx +++ b/src/plugins/vis_type_timelion/public/components/timelion_expression_input.tsx @@ -20,7 +20,7 @@ import React, { useEffect, useCallback, useRef, useMemo } from 'react'; import { EuiFormLabel } from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n/react'; -import { monaco } from '@kbn/ui-shared-deps/monaco'; +import { monaco } from '@kbn/monaco'; import { CodeEditor, useKibana } from '../../../kibana_react/public'; import { suggest, getSuggestion } from './timelion_expression_input_helpers'; diff --git a/src/plugins/vis_type_timelion/public/components/timelion_expression_input_helpers.ts b/src/plugins/vis_type_timelion/public/components/timelion_expression_input_helpers.ts index f7b3433105b76..8db057cdb3cc5 100644 --- a/src/plugins/vis_type_timelion/public/components/timelion_expression_input_helpers.ts +++ b/src/plugins/vis_type_timelion/public/components/timelion_expression_input_helpers.ts @@ -19,7 +19,7 @@ import { get, startsWith } from 'lodash'; import { i18n } from '@kbn/i18n'; -import { monaco } from '@kbn/ui-shared-deps/monaco'; +import { monaco } from '@kbn/monaco'; import { Parser } from 'pegjs'; diff --git a/test/functional/apps/discover/_discover.js b/test/functional/apps/discover/_discover.js index 9f3ce667d64b5..ecaa5aa2da97f 100644 --- a/test/functional/apps/discover/_discover.js +++ b/test/functional/apps/discover/_discover.js @@ -69,6 +69,16 @@ export default function ({ getService, getPageObjects }) { }); }); + it('renaming a saved query should modify name in breadcrumb', async function () { + const queryName2 = 'Modified Query # 1'; + await PageObjects.discover.loadSavedSearch(queryName1); + await PageObjects.discover.saveSearch(queryName2); + + await retry.try(async function () { + expect(await PageObjects.discover.getCurrentQueryName()).to.be(queryName2); + }); + }); + it('should show the correct hit count', async function () { const expectedHitCount = '14,004'; await retry.try(async function () { diff --git a/test/scripts/jenkins_siem_cypress.sh b/test/scripts/jenkins_security_solution_cypress.sh similarity index 67% rename from test/scripts/jenkins_siem_cypress.sh rename to test/scripts/jenkins_security_solution_cypress.sh index c7157e97b36cc..23b83cf946d49 100644 --- a/test/scripts/jenkins_siem_cypress.sh +++ b/test/scripts/jenkins_security_solution_cypress.sh @@ -8,14 +8,14 @@ cp -R "$installDir" "$destDir" export KIBANA_INSTALL_DIR="$destDir" -echo " -> Running SIEM cypress tests" +echo " -> Running security solution cypress tests" cd "$XPACK_DIR" -checks-reporter-with-killswitch "SIEM Cypress Tests" \ +checks-reporter-with-killswitch "Security solution Cypress Tests" \ node scripts/functional_tests \ --debug --bail \ --kibana-install-dir "$KIBANA_INSTALL_DIR" \ - --config test/siem_cypress/config.ts + --config test/security_solution_cypress/config.ts echo "" echo "" diff --git a/test/scripts/jenkins_xpack.sh b/test/scripts/jenkins_xpack.sh index 50a92a41e3932..067ed213c49f5 100755 --- a/test/scripts/jenkins_xpack.sh +++ b/test/scripts/jenkins_xpack.sh @@ -17,7 +17,7 @@ if [[ -z "$CODE_COVERAGE" ]] ; then echo " -> Running SIEM cyclic dependency test" cd "$XPACK_DIR" - checks-reporter-with-killswitch "X-Pack SIEM cyclic dependency test" node plugins/siem/scripts/check_circular_deps + checks-reporter-with-killswitch "X-Pack SIEM cyclic dependency test" node plugins/security_solution/scripts/check_circular_deps echo "" echo "" diff --git a/vars/kibanaCoverage.groovy b/vars/kibanaCoverage.groovy index 6ef8f6fc64cd5..0305f86475a9a 100644 --- a/vars/kibanaCoverage.groovy +++ b/vars/kibanaCoverage.groovy @@ -96,7 +96,7 @@ def collectVcsInfo(title) { ) } -def bootMergeAndIngest(buildNum, buildUrl, title) { +def generateReports(title) { kibanaPipeline.bash(""" source src/dev/ci_setup/setup_env.sh # bootstrap from x-pack folder @@ -108,6 +108,28 @@ def bootMergeAndIngest(buildNum, buildUrl, title) { . src/dev/code_coverage/shell_scripts/fix_html_reports_parallel.sh . src/dev/code_coverage/shell_scripts/merge_jest_and_functional.sh . src/dev/code_coverage/shell_scripts/copy_mocha_reports.sh + # zip combined reports + tar -czf kibana-coverage.tar.gz target/kibana-coverage/**/* + """, title) +} + +def uploadCombinedReports() { + kibanaPipeline.bash(""" + ls -laR target/kibana-coverage/ + """, "### List Combined Reports" + ) + + kibanaPipeline.uploadGcsArtifact( + "kibana-ci-artifacts/jobs/${env.JOB_NAME}/${BUILD_NUMBER}/coverage/combined", + 'kibana-coverage.tar.gz' + ) +} + +def ingestData(buildNum, buildUrl, title) { + kibanaPipeline.bash(""" + source src/dev/ci_setup/setup_env.sh + yarn kbn bootstrap --prefer-offline + # Using existing target/kibana-coverage folder . src/dev/code_coverage/shell_scripts/ingest_coverage.sh ${buildNum} ${buildUrl} """, title) } @@ -117,7 +139,7 @@ def ingestWithVault(buildNum, buildUrl, title) { withVaultSecret(secret: vaultSecret, secret_field: 'host', variable_name: 'HOST_FROM_VAULT') { withVaultSecret(secret: vaultSecret, secret_field: 'username', variable_name: 'USER_FROM_VAULT') { withVaultSecret(secret: vaultSecret, secret_field: 'password', variable_name: 'PASS_FROM_VAULT') { - bootMergeAndIngest(buildNum, buildUrl, title) + ingestData(buildNum, buildUrl, title) } } } diff --git a/x-pack/.gitignore b/x-pack/.gitignore index 6bac5e181861d..92597a101c03d 100644 --- a/x-pack/.gitignore +++ b/x-pack/.gitignore @@ -5,11 +5,11 @@ /test/functional/screenshots /test/functional/apps/reporting/reports/session /test/reporting/configs/failure_debug/ -/legacy/plugins/reporting/.chromium/ -/legacy/plugins/reporting/.phantom/ +/plugins/reporting/.chromium/ +/plugins/reporting/.phantom/ /.aws-config.json /.env /.kibana-plugin-helpers.dev.* !/legacy/plugins/infra/**/target .cache -!/legacy/plugins/siem/**/target +!/legacy/plugins/security_solution/**/target diff --git a/x-pack/.i18nrc.json b/x-pack/.i18nrc.json index a479b08ef9069..f2d391ced5ac1 100644 --- a/x-pack/.i18nrc.json +++ b/x-pack/.i18nrc.json @@ -35,12 +35,12 @@ "xpack.monitoring": ["plugins/monitoring", "legacy/plugins/monitoring"], "xpack.remoteClusters": "plugins/remote_clusters", "xpack.painlessLab": "plugins/painless_lab", - "xpack.reporting": ["plugins/reporting", "legacy/plugins/reporting"], + "xpack.reporting": ["plugins/reporting"], "xpack.rollupJobs": ["legacy/plugins/rollup", "plugins/rollup"], "xpack.searchProfiler": "plugins/searchprofiler", "xpack.security": ["legacy/plugins/security", "plugins/security"], "xpack.server": "legacy/server", - "xpack.siem": "plugins/siem", + "xpack.securitySolution": "plugins/security_solution", "xpack.snapshotRestore": "plugins/snapshot_restore", "xpack.spaces": ["legacy/plugins/spaces", "plugins/spaces"], "xpack.taskManager": "legacy/plugins/task_manager", diff --git a/x-pack/.kibana-plugin-helpers.json b/x-pack/.kibana-plugin-helpers.json index ed0b38841c1a8..ca0cae6dd3ca3 100644 --- a/x-pack/.kibana-plugin-helpers.json +++ b/x-pack/.kibana-plugin-helpers.json @@ -13,8 +13,8 @@ "index.js", ".i18nrc.json", "plugins/**/*", - "legacy/plugins/reporting/.phantom/*", - "legacy/plugins/reporting/.chromium/*", + "plugins/reporting/.phantom/*", + "plugins/reporting/.chromium/*", "legacy/common/**/*", "legacy/plugins/**/*", "legacy/server/**/*", diff --git a/x-pack/build_chromium/README.md b/x-pack/build_chromium/README.md index 501136ab0a965..72e41afc80c95 100644 --- a/x-pack/build_chromium/README.md +++ b/x-pack/build_chromium/README.md @@ -110,7 +110,7 @@ To run the build, replace the sha in the following commands with the sha that yo After the build completes, there will be a .zip file and a .md5 file in `~/chromium/chromium/src/out/headless`. These are named like so: `chromium-{first_7_of_SHA}-{platform}`, for example: `chromium-4747cc2-linux`. -The zip files need to be deployed to s3. For testing, I drop them into `headless-shell-dev`, but for production, they need to be in `headless-shell`. And the `x-pack/legacy/plugins/reporting/server/browsers/chromium/paths.js` file needs to be upated to have the correct `archiveChecksum`, `archiveFilename`, `binaryChecksum` and `baseUrl`. Below is a list of what the archive's are: +The zip files need to be deployed to s3. For testing, I drop them into `headless-shell-dev`, but for production, they need to be in `headless-shell`. And the `x-pack/plugins/reporting/server/browsers/chromium/paths.ts` file needs to be upated to have the correct `archiveChecksum`, `archiveFilename`, `binaryChecksum` and `baseUrl`. Below is a list of what the archive's are: - `archiveChecksum`: The contents of the `.md5` file, which is the `md5` checksum of the zip file. - `binaryChecksum`: The `md5` checksum of the `headless_shell` binary itself. diff --git a/x-pack/dev-tools/jest/create_jest_config.js b/x-pack/dev-tools/jest/create_jest_config.js index a222e11d28f4a..01b966ebe359b 100644 --- a/x-pack/dev-tools/jest/create_jest_config.js +++ b/x-pack/dev-tools/jest/create_jest_config.js @@ -24,7 +24,8 @@ export function createJestConfig({ kibanaDirectory, rootDir, xPackKibanaDirector '\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$': fileMockPath, '\\.module.(css|scss)$': `${kibanaDirectory}/src/dev/jest/mocks/css_module_mock.js`, '\\.(css|less|scss)$': `${kibanaDirectory}/src/dev/jest/mocks/style_mock.js`, - '\\.ace\\.worker.js$': `${kibanaDirectory}/src/dev/jest/mocks/ace_worker_module_mock.js`, + '\\.ace\\.worker.js$': `${kibanaDirectory}/src/dev/jest/mocks/worker_module_mock.js`, + '\\.editor\\.worker.js$': `${kibanaDirectory}/src/dev/jest/mocks/worker_module_mock.js`, '^test_utils/enzyme_helpers': `${xPackKibanaDirectory}/test_utils/enzyme_helpers.tsx`, '^test_utils/find_test_subject': `${xPackKibanaDirectory}/test_utils/find_test_subject.ts`, '^test_utils/stub_web_worker': `${xPackKibanaDirectory}/test_utils/stub_web_worker.ts`, diff --git a/x-pack/index.js b/x-pack/index.js index 9cf63854d4093..8096774d7a491 100644 --- a/x-pack/index.js +++ b/x-pack/index.js @@ -6,7 +6,6 @@ import { xpackMain } from './legacy/plugins/xpack_main'; import { monitoring } from './legacy/plugins/monitoring'; -import { reporting } from './legacy/plugins/reporting'; import { security } from './legacy/plugins/security'; import { dashboardMode } from './legacy/plugins/dashboard_mode'; import { beats } from './legacy/plugins/beats_management'; @@ -18,7 +17,6 @@ module.exports = function (kibana) { return [ xpackMain(kibana), monitoring(kibana), - reporting(kibana), spaces(kibana), security(kibana), dashboardMode(kibana), diff --git a/x-pack/legacy/plugins/reporting/index.ts b/x-pack/legacy/plugins/reporting/index.ts deleted file mode 100644 index 1ae971b6566b0..0000000000000 --- a/x-pack/legacy/plugins/reporting/index.ts +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License; - * you may not use this file except in compliance with the Elastic License. - */ - -import { i18n } from '@kbn/i18n'; -import { Legacy } from 'kibana'; -import { resolve } from 'path'; -import { PLUGIN_ID, UI_SETTINGS_CUSTOM_PDF_LOGO } from './common/constants'; -import { legacyInit } from './server/legacy'; - -export type ReportingPluginSpecOptions = Legacy.PluginSpecOptions; - -const kbToBase64Length = (kb: number) => Math.floor((kb * 1024 * 8) / 6); - -export const reporting = (kibana: any) => { - return new kibana.Plugin({ - id: PLUGIN_ID, - publicDir: resolve(__dirname, 'public'), - require: ['kibana', 'elasticsearch', 'xpack_main'], - - uiExports: { - uiSettingDefaults: { - [UI_SETTINGS_CUSTOM_PDF_LOGO]: { - name: i18n.translate('xpack.reporting.pdfFooterImageLabel', { - defaultMessage: 'PDF footer image', - }), - value: null, - description: i18n.translate('xpack.reporting.pdfFooterImageDescription', { - defaultMessage: `Custom image to use in the PDF's footer`, - }), - type: 'image', - validation: { - maxSize: { - length: kbToBase64Length(200), - description: '200 kB', - }, - }, - category: [PLUGIN_ID], - }, - }, - }, - - async init(server: Legacy.Server) { - return legacyInit(server, this); - }, - } as ReportingPluginSpecOptions); -}; diff --git a/x-pack/legacy/plugins/reporting/server/index.ts b/x-pack/legacy/plugins/reporting/server/index.ts deleted file mode 100644 index 2388eac48f8cc..0000000000000 --- a/x-pack/legacy/plugins/reporting/server/index.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License; - * you may not use this file except in compliance with the Elastic License. - */ - -import { PluginInitializerContext } from 'src/core/server'; -import { ReportingConfig } from './config'; -import { ReportingCore } from './core'; -import { ReportingPlugin as Plugin } from './plugin'; - -export const plugin = (context: PluginInitializerContext, config: ReportingConfig) => { - return new Plugin(context, config); -}; - -export { ReportingPlugin } from './plugin'; -export { ReportingConfig, ReportingCore }; diff --git a/x-pack/legacy/plugins/reporting/server/legacy.ts b/x-pack/legacy/plugins/reporting/server/legacy.ts deleted file mode 100644 index 14abd53cc83d9..0000000000000 --- a/x-pack/legacy/plugins/reporting/server/legacy.ts +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License; - * you may not use this file except in compliance with the Elastic License. - */ - -import { Legacy } from 'kibana'; -import { take } from 'rxjs/operators'; -import { PluginInitializerContext } from 'src/core/server'; -import { LicensingPluginSetup } from '../../../../plugins/licensing/server'; -import { ReportingPluginSpecOptions } from '../'; -import { PluginsSetup } from '../../../../plugins/reporting/server'; -import { SecurityPluginSetup } from '../../../../plugins/security/server'; -import { buildConfig } from './config'; -import { plugin } from './index'; -import { LegacySetup, ReportingStartDeps } from './types'; - -const buildLegacyDependencies = ( - server: Legacy.Server, - reportingPlugin: ReportingPluginSpecOptions -): LegacySetup => ({ - route: server.route.bind(server), - plugins: { - xpack_main: server.plugins.xpack_main, - reporting: reportingPlugin, - }, -}); - -/* - * Starts the New Platform instance of Reporting using legacy dependencies - */ -export const legacyInit = async ( - server: Legacy.Server, - reportingLegacyPlugin: ReportingPluginSpecOptions -) => { - const { core: coreSetup } = server.newPlatform.setup; - const { config$ } = (server.newPlatform.setup.plugins.reporting as PluginsSetup).__legacy; - const reportingConfig = await config$.pipe(take(1)).toPromise(); - const __LEGACY = buildLegacyDependencies(server, reportingLegacyPlugin); - - const pluginInstance = plugin( - server.newPlatform.coreContext as PluginInitializerContext, - buildConfig(coreSetup, server, reportingConfig) - ); - - await pluginInstance.setup(coreSetup, { - elasticsearch: coreSetup.elasticsearch, - licensing: server.newPlatform.setup.plugins.licensing as LicensingPluginSetup, - security: server.newPlatform.setup.plugins.security as SecurityPluginSetup, - usageCollection: server.newPlatform.setup.plugins.usageCollection, - __LEGACY, - }); - - // Schedule to call the "start" hook only after start dependencies are ready - coreSetup.getStartServices().then(([core, plugins]) => - pluginInstance.start(core, { - data: (plugins as ReportingStartDeps).data, - __LEGACY, - }) - ); -}; diff --git a/x-pack/legacy/plugins/reporting/server/lib/esqueue/__tests__/fixtures/queue.js b/x-pack/legacy/plugins/reporting/server/lib/esqueue/__tests__/fixtures/queue.js deleted file mode 100644 index 6bdd922555fa9..0000000000000 --- a/x-pack/legacy/plugins/reporting/server/lib/esqueue/__tests__/fixtures/queue.js +++ /dev/null @@ -1,11 +0,0 @@ -import events from 'events'; - -export class QueueMock extends events.EventEmitter { - constructor() { - super(); - } - - setClient(client) { - this.client = client; - } -} diff --git a/x-pack/legacy/plugins/reporting/server/plugin.ts b/x-pack/legacy/plugins/reporting/server/plugin.ts deleted file mode 100644 index 5a407ad3e4c4a..0000000000000 --- a/x-pack/legacy/plugins/reporting/server/plugin.ts +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License; - * you may not use this file except in compliance with the Elastic License. - */ - -import { CoreSetup, CoreStart, Plugin, PluginInitializerContext } from 'src/core/server'; -import { createBrowserDriverFactory } from './browsers'; -import { ReportingConfig } from './config'; -import { ReportingCore } from './core'; -import { registerRoutes } from './routes'; -import { createQueueFactory, enqueueJobFactory, LevelLogger, runValidations } from './lib'; -import { setFieldFormats } from './services'; -import { ReportingSetup, ReportingSetupDeps, ReportingStart, ReportingStartDeps } from './types'; -import { registerReportingUsageCollector } from './usage'; -// @ts-ignore no module definition -import { mirrorPluginStatus } from '../../../server/lib/mirror_plugin_status'; - -export class ReportingPlugin - implements Plugin { - private config: ReportingConfig; - private logger: LevelLogger; - private reportingCore: ReportingCore; - - constructor(context: PluginInitializerContext, config: ReportingConfig) { - this.config = config; - this.logger = new LevelLogger(context.logger.get('reporting')); - this.reportingCore = new ReportingCore(this.config); - } - - public async setup(core: CoreSetup, plugins: ReportingSetupDeps) { - const { config } = this; - const { elasticsearch, __LEGACY, licensing, security } = plugins; - const router = core.http.createRouter(); - const basePath = core.http.basePath.get; - const { xpack_main: xpackMainLegacy, reporting: reportingLegacy } = __LEGACY.plugins; - - // legacy plugin status - mirrorPluginStatus(xpackMainLegacy, reportingLegacy); - - const browserDriverFactory = await createBrowserDriverFactory(config, this.logger); - const deps = { - browserDriverFactory, - elasticsearch, - licensing, - basePath, - router, - security, - }; - - runValidations(config, elasticsearch, browserDriverFactory, this.logger); - - this.reportingCore.pluginSetup(deps); - registerReportingUsageCollector(this.reportingCore, plugins); - registerRoutes(this.reportingCore, this.logger); - - return {}; - } - - public async start(core: CoreStart, plugins: ReportingStartDeps) { - const { reportingCore, logger } = this; - - const esqueue = await createQueueFactory(reportingCore, logger); - const enqueueJob = enqueueJobFactory(reportingCore, logger); - - this.reportingCore.pluginStart({ - savedObjects: core.savedObjects, - uiSettings: core.uiSettings, - esqueue, - enqueueJob, - }); - - setFieldFormats(plugins.data.fieldFormats); - - return {}; - } - - public getReportingCore() { - return this.reportingCore; - } -} diff --git a/x-pack/plugins/apm/common/service_map.ts b/x-pack/plugins/apm/common/service_map.ts index 9f20005c2b189..43f3585d0ebb2 100644 --- a/x-pack/plugins/apm/common/service_map.ts +++ b/x-pack/plugins/apm/common/service_map.ts @@ -6,7 +6,7 @@ import { i18n } from '@kbn/i18n'; import cytoscape from 'cytoscape'; -import { ILicense } from '../../licensing/public'; +import { ILicense } from '../../licensing/common/types'; import { AGENT_NAME, SERVICE_ENVIRONMENT, diff --git a/x-pack/plugins/apm/e2e/run-e2e.sh b/x-pack/plugins/apm/e2e/run-e2e.sh index ae764d171c45c..4bebab8e0c6a8 100755 --- a/x-pack/plugins/apm/e2e/run-e2e.sh +++ b/x-pack/plugins/apm/e2e/run-e2e.sh @@ -23,6 +23,8 @@ APM_IT_DIR="./tmp/apm-integration-testing" cd ${E2E_DIR} +KIBANA_VERSION=$(node -p "require('../../../package.json').version") + # # Ask user to start Kibana ################################################## @@ -63,7 +65,8 @@ fi # Start apm-integration-testing echo "Starting docker-compose" -${APM_IT_DIR}/scripts/compose.py start master \ +echo "Using stack version: ${KIBANA_VERSION}" +${APM_IT_DIR}/scripts/compose.py start $KIBANA_VERSION \ --no-kibana \ --elasticsearch-port $ELASTICSEARCH_PORT \ --apm-server-port=$APM_SERVER_PORT \ diff --git a/x-pack/plugins/canvas/public/components/expression_input/__examples__/expression_input.examples.tsx b/x-pack/plugins/canvas/public/components/expression_input/__examples__/expression_input.examples.tsx index 51caf1db196bc..d010f4a554b87 100644 --- a/x-pack/plugins/canvas/public/components/expression_input/__examples__/expression_input.examples.tsx +++ b/x-pack/plugins/canvas/public/components/expression_input/__examples__/expression_input.examples.tsx @@ -7,7 +7,7 @@ import { action } from '@storybook/addon-actions'; import { storiesOf } from '@storybook/react'; import React from 'react'; -import { monaco } from '@kbn/ui-shared-deps/monaco'; +import { monaco } from '@kbn/monaco'; import { ExpressionInput } from '../expression_input'; import { language, LANGUAGE_ID } from '../../../lib/monaco_language_def'; diff --git a/x-pack/plugins/canvas/public/components/expression_input/expression_input.tsx b/x-pack/plugins/canvas/public/components/expression_input/expression_input.tsx index 99e12b14104be..5ada495208fba 100644 --- a/x-pack/plugins/canvas/public/components/expression_input/expression_input.tsx +++ b/x-pack/plugins/canvas/public/components/expression_input/expression_input.tsx @@ -8,7 +8,7 @@ import React from 'react'; import PropTypes from 'prop-types'; import { EuiFormRow } from '@elastic/eui'; import { debounce } from 'lodash'; -import { monaco } from '@kbn/ui-shared-deps/monaco'; +import { monaco } from '@kbn/monaco'; import { ExpressionFunction } from '../../../types'; import { CodeEditor } from '../../../../../../src/plugins/kibana_react/public'; import { diff --git a/x-pack/plugins/canvas/public/lib/monaco_language_def.ts b/x-pack/plugins/canvas/public/lib/monaco_language_def.ts index 7bd9ea7b6ef9a..5b88658ddcd63 100644 --- a/x-pack/plugins/canvas/public/lib/monaco_language_def.ts +++ b/x-pack/plugins/canvas/public/lib/monaco_language_def.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { monaco } from '@kbn/ui-shared-deps/monaco'; +import { monaco } from '@kbn/monaco'; import { ExpressionFunction } from '../../types'; export const LANGUAGE_ID = 'canvas-expression'; diff --git a/x-pack/plugins/index_management/__jest__/client_integration/helpers/index.ts b/x-pack/plugins/index_management/__jest__/client_integration/helpers/index.ts index 66021b531919a..18e5edb5c2250 100644 --- a/x-pack/plugins/index_management/__jest__/client_integration/helpers/index.ts +++ b/x-pack/plugins/index_management/__jest__/client_integration/helpers/index.ts @@ -4,18 +4,46 @@ * you may not use this file except in compliance with the Elastic License. */ -import { setup as homeSetup } from './home.helpers'; -import { setup as templateCreateSetup } from './template_create.helpers'; -import { setup as templateCloneSetup } from './template_clone.helpers'; -import { setup as templateEditSetup } from './template_edit.helpers'; +import './mocks'; export { nextTick, getRandomString, findTestSubject, TestBed } from '../../../../../test_utils'; -export { setupEnvironment } from './setup_environment'; +export { setupEnvironment, WithAppDependencies, services } from './setup_environment'; -export const pageHelpers = { - home: { setup: homeSetup }, - templateCreate: { setup: templateCreateSetup }, - templateClone: { setup: templateCloneSetup }, - templateEdit: { setup: templateEditSetup }, -}; +export type TestSubjects = + | 'aliasesTab' + | 'appTitle' + | 'cell' + | 'closeDetailsButton' + | 'createTemplateButton' + | 'deleteSystemTemplateCallOut' + | 'deleteTemplateButton' + | 'deleteTemplatesConfirmation' + | 'documentationLink' + | 'emptyPrompt' + | 'manageTemplateButton' + | 'mappingsTab' + | 'noAliasesCallout' + | 'noMappingsCallout' + | 'noSettingsCallout' + | 'indicesList' + | 'indicesTab' + | 'indexTableIncludeHiddenIndicesToggle' + | 'indexTableIndexNameLink' + | 'reloadButton' + | 'reloadIndicesButton' + | 'row' + | 'sectionError' + | 'sectionLoading' + | 'settingsTab' + | 'summaryTab' + | 'summaryTitle' + | 'systemTemplatesSwitch' + | 'templateDetails' + | 'templateDetails.manageTemplateButton' + | 'templateDetails.sectionLoading' + | 'templateDetails.tab' + | 'templateDetails.title' + | 'templateList' + | 'templateTable' + | 'templatesTab'; diff --git a/x-pack/legacy/plugins/reporting/reporting.d.ts b/x-pack/plugins/index_management/__jest__/client_integration/helpers/mocks.ts similarity index 75% rename from x-pack/legacy/plugins/reporting/reporting.d.ts rename to x-pack/plugins/index_management/__jest__/client_integration/helpers/mocks.ts index ec65c15f53864..6260a987e270a 100644 --- a/x-pack/legacy/plugins/reporting/reporting.d.ts +++ b/x-pack/plugins/index_management/__jest__/client_integration/helpers/mocks.ts @@ -4,4 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -export { ReportingPlugin } from './server/plugin'; +(window as any).Worker = class Worker { + onmessage() {} + postMessage() {} +}; diff --git a/x-pack/plugins/index_management/__jest__/client_integration/helpers/setup_environment.tsx b/x-pack/plugins/index_management/__jest__/client_integration/helpers/setup_environment.tsx index 1eaf7efd17395..0a49191fdb149 100644 --- a/x-pack/plugins/index_management/__jest__/client_integration/helpers/setup_environment.tsx +++ b/x-pack/plugins/index_management/__jest__/client_integration/helpers/setup_environment.tsx @@ -3,6 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ + /* eslint-disable @kbn/eslint/no-restricted-paths */ import React from 'react'; import axios from 'axios'; diff --git a/x-pack/plugins/index_management/__jest__/client_integration/home.test.ts b/x-pack/plugins/index_management/__jest__/client_integration/home.test.ts deleted file mode 100644 index f5af11330a6d8..0000000000000 --- a/x-pack/plugins/index_management/__jest__/client_integration/home.test.ts +++ /dev/null @@ -1,587 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License; - * you may not use this file except in compliance with the Elastic License. - */ - -import { act } from 'react-dom/test-utils'; -import * as fixtures from '../../test/fixtures'; -import { setupEnvironment, pageHelpers, nextTick, getRandomString } from './helpers'; -import { IdxMgmtHomeTestBed } from './helpers/home.helpers'; -import { API_BASE_PATH } from '../../common/constants'; - -const { setup } = pageHelpers.home; - -const removeWhiteSpaceOnArrayValues = (array: any[]) => - array.map((value) => { - if (!value.trim) { - return value; - } - return value.trim(); - }); - -jest.mock('ui/new_platform'); - -describe('', () => { - const { server, httpRequestsMockHelpers } = setupEnvironment(); - let testBed: IdxMgmtHomeTestBed; - - afterAll(() => { - server.restore(); - }); - - describe('on component mount', () => { - beforeEach(async () => { - httpRequestsMockHelpers.setLoadIndicesResponse([]); - - testBed = await setup(); - - await act(async () => { - const { component } = testBed; - - await nextTick(); - component.update(); - }); - }); - - test('sets the hash query param base on include hidden indices toggle', () => { - const { actions } = testBed; - expect(actions.getIncludeHiddenIndicesToggleStatus()).toBe(true); - expect(window.location.hash.includes('includeHidden=true')).toBe(true); - actions.clickIncludeHiddenIndicesToggle(); - expect(window.location.hash.includes('includeHidden=true')).toBe(false); - // Note: this test modifies the shared location.hash state, we put it back the way it was - actions.clickIncludeHiddenIndicesToggle(); - expect(actions.getIncludeHiddenIndicesToggleStatus()).toBe(true); - expect(window.location.hash.includes('includeHidden=true')).toBe(true); - }); - - test('should set the correct app title', () => { - const { exists, find } = testBed; - expect(exists('appTitle')).toBe(true); - expect(find('appTitle').text()).toEqual('Index Management'); - }); - - test('should have a link to the documentation', () => { - const { exists, find } = testBed; - expect(exists('documentationLink')).toBe(true); - expect(find('documentationLink').text()).toBe('Index Management docs'); - }); - - describe('tabs', () => { - test('should have 2 tabs', () => { - const { find } = testBed; - const templatesTab = find('templatesTab'); - const indicesTab = find('indicesTab'); - - expect(indicesTab.length).toBe(1); - expect(indicesTab.text()).toEqual('Indices'); - expect(templatesTab.length).toBe(1); - expect(templatesTab.text()).toEqual('Index Templates'); - }); - - test('should navigate to Index Templates tab', async () => { - const { exists, actions, component } = testBed; - - expect(exists('indicesList')).toBe(true); - expect(exists('templateList')).toBe(false); - - httpRequestsMockHelpers.setLoadTemplatesResponse([]); - - actions.selectHomeTab('templatesTab'); - - await act(async () => { - await nextTick(); - component.update(); - }); - - expect(exists('indicesList')).toBe(false); - expect(exists('templateList')).toBe(true); - }); - }); - - describe('index templates', () => { - describe('when there are no index templates', () => { - beforeEach(async () => { - const { actions, component } = testBed; - - httpRequestsMockHelpers.setLoadTemplatesResponse([]); - - actions.selectHomeTab('templatesTab'); - - await act(async () => { - await nextTick(); - component.update(); - }); - }); - - test('should display an empty prompt', async () => { - const { exists } = testBed; - - expect(exists('sectionLoading')).toBe(false); - expect(exists('emptyPrompt')).toBe(true); - }); - }); - - describe('when there are index templates', () => { - const template1 = fixtures.getTemplate({ - name: `a${getRandomString()}`, - indexPatterns: ['template1Pattern1*', 'template1Pattern2'], - template: { - settings: { - index: { - number_of_shards: '1', - lifecycle: { - name: 'my_ilm_policy', - }, - }, - }, - }, - }); - const template2 = fixtures.getTemplate({ - name: `b${getRandomString()}`, - indexPatterns: ['template2Pattern1*'], - }); - const template3 = fixtures.getTemplate({ - name: `.c${getRandomString()}`, // mock system template - indexPatterns: ['template3Pattern1*', 'template3Pattern2', 'template3Pattern3'], - }); - - const templates = [template1, template2, template3]; - - beforeEach(async () => { - const { actions, component } = testBed; - - httpRequestsMockHelpers.setLoadTemplatesResponse(templates); - - actions.selectHomeTab('templatesTab'); - - await act(async () => { - await nextTick(); - component.update(); - }); - }); - - test('should list them in the table', async () => { - const { table } = testBed; - - const { tableCellsValues } = table.getMetaData('templateTable'); - - tableCellsValues.forEach((row, i) => { - const template = templates[i]; - const { name, indexPatterns, order, ilmPolicy } = template; - - const ilmPolicyName = ilmPolicy && ilmPolicy.name ? ilmPolicy.name : ''; - const orderFormatted = order ? order.toString() : order; - - expect(removeWhiteSpaceOnArrayValues(row)).toEqual([ - '', - name, - indexPatterns.join(', '), - ilmPolicyName, - orderFormatted, - '', - '', - '', - '', - ]); - }); - }); - - test('should have a button to reload the index templates', async () => { - const { component, exists, actions } = testBed; - const totalRequests = server.requests.length; - - expect(exists('reloadButton')).toBe(true); - - await act(async () => { - actions.clickReloadButton(); - await nextTick(); - component.update(); - }); - - expect(server.requests.length).toBe(totalRequests + 1); - expect(server.requests[server.requests.length - 1].url).toBe( - `${API_BASE_PATH}/templates` - ); - }); - - test('should have a button to create a new template', () => { - const { exists } = testBed; - expect(exists('createTemplateButton')).toBe(true); - }); - - test('should have a switch to view system templates', async () => { - const { table, exists, component, form } = testBed; - const { rows } = table.getMetaData('templateTable'); - - expect(rows.length).toEqual( - templates.filter((template) => !template.name.startsWith('.')).length - ); - - expect(exists('systemTemplatesSwitch')).toBe(true); - - await act(async () => { - form.toggleEuiSwitch('systemTemplatesSwitch'); - await nextTick(); - component.update(); - }); - - const { rows: updatedRows } = table.getMetaData('templateTable'); - expect(updatedRows.length).toEqual(templates.length); - }); - - test('each row should have a link to the template details panel', async () => { - const { find, exists, actions } = testBed; - - await actions.clickTemplateAt(0); - - expect(exists('templateList')).toBe(true); - expect(exists('templateDetails')).toBe(true); - expect(find('templateDetails.title').text()).toBe(template1.name); - }); - - test('template actions column should have an option to delete', () => { - const { actions, findAction } = testBed; - const { name: templateName } = template1; - - actions.clickActionMenu(templateName); - - const deleteAction = findAction('delete'); - - expect(deleteAction.text()).toEqual('Delete'); - }); - - test('template actions column should have an option to clone', () => { - const { actions, findAction } = testBed; - const { name: templateName } = template1; - - actions.clickActionMenu(templateName); - - const cloneAction = findAction('clone'); - - expect(cloneAction.text()).toEqual('Clone'); - }); - - test('template actions column should have an option to edit', () => { - const { actions, findAction } = testBed; - const { name: templateName } = template1; - - actions.clickActionMenu(templateName); - - const editAction = findAction('edit'); - - expect(editAction.text()).toEqual('Edit'); - }); - - describe('delete index template', () => { - test('should show a confirmation when clicking the delete template button', async () => { - const { actions } = testBed; - const { name: templateName } = template1; - - await actions.clickTemplateAction(templateName, 'delete'); - - // We need to read the document "body" as the modal is added there and not inside - // the component DOM tree. - expect( - document.body.querySelector('[data-test-subj="deleteTemplatesConfirmation"]') - ).not.toBe(null); - - expect( - document.body.querySelector('[data-test-subj="deleteTemplatesConfirmation"]')! - .textContent - ).toContain('Delete template'); - }); - - test('should show a warning message when attempting to delete a system template', async () => { - const { component, form, actions } = testBed; - - await act(async () => { - form.toggleEuiSwitch('systemTemplatesSwitch'); - await nextTick(); - component.update(); - }); - - const { name: systemTemplateName } = template3; - await actions.clickTemplateAction(systemTemplateName, 'delete'); - - expect( - document.body.querySelector('[data-test-subj="deleteSystemTemplateCallOut"]') - ).not.toBe(null); - }); - - test('should send the correct HTTP request to delete an index template', async () => { - const { component, actions, table } = testBed; - const { rows } = table.getMetaData('templateTable'); - - const templateId = rows[0].columns[2].value; - - const { - name: templateName, - _kbnMeta: { formatVersion }, - } = template1; - await actions.clickTemplateAction(templateName, 'delete'); - - const modal = document.body.querySelector( - '[data-test-subj="deleteTemplatesConfirmation"]' - ); - const confirmButton: HTMLButtonElement | null = modal!.querySelector( - '[data-test-subj="confirmModalConfirmButton"]' - ); - - httpRequestsMockHelpers.setDeleteTemplateResponse({ - results: { - successes: [templateId], - errors: [], - }, - }); - - await act(async () => { - confirmButton!.click(); - await nextTick(); - component.update(); - }); - - const latestRequest = server.requests[server.requests.length - 1]; - - expect(latestRequest.method).toBe('POST'); - expect(latestRequest.url).toBe(`${API_BASE_PATH}/delete-templates`); - expect(JSON.parse(JSON.parse(latestRequest.requestBody).body)).toEqual({ - templates: [{ name: template1.name, formatVersion }], - }); - }); - }); - - describe('detail panel', () => { - beforeEach(async () => { - const template = fixtures.getTemplate({ - name: `a${getRandomString()}`, - indexPatterns: ['template1Pattern1*', 'template1Pattern2'], - }); - - httpRequestsMockHelpers.setLoadTemplateResponse(template); - }); - - test('should show details when clicking on a template', async () => { - const { exists, actions } = testBed; - - expect(exists('templateDetails')).toBe(false); - - await actions.clickTemplateAt(0); - - expect(exists('templateDetails')).toBe(true); - }); - - describe('on mount', () => { - beforeEach(async () => { - const { actions } = testBed; - - await actions.clickTemplateAt(0); - }); - - test('should set the correct title', async () => { - const { find } = testBed; - const { name } = template1; - - expect(find('templateDetails.title').text()).toEqual(name); - }); - - it('should have a close button and be able to close flyout', async () => { - const { actions, component, exists } = testBed; - - expect(exists('closeDetailsButton')).toBe(true); - expect(exists('summaryTab')).toBe(true); - - actions.clickCloseDetailsButton(); - - await act(async () => { - await nextTick(); - component.update(); - }); - - expect(exists('summaryTab')).toBe(false); - }); - - it('should have a manage button', async () => { - const { actions, exists } = testBed; - - await actions.clickTemplateAt(0); - - expect(exists('templateDetails.manageTemplateButton')).toBe(true); - }); - }); - - describe('tabs', () => { - test('should have 4 tabs', async () => { - const template = fixtures.getTemplate({ - name: `a${getRandomString()}`, - indexPatterns: ['template1Pattern1*', 'template1Pattern2'], - template: { - settings: { - index: { - number_of_shards: '1', - }, - }, - mappings: { - _source: { - enabled: false, - }, - properties: { - created_at: { - type: 'date', - format: 'EEE MMM dd HH:mm:ss Z yyyy', - }, - }, - }, - aliases: { - alias1: {}, - }, - }, - }); - - const { find, actions, exists } = testBed; - - httpRequestsMockHelpers.setLoadTemplateResponse(template); - - await actions.clickTemplateAt(0); - - expect(find('templateDetails.tab').length).toBe(4); - expect(find('templateDetails.tab').map((t) => t.text())).toEqual([ - 'Summary', - 'Settings', - 'Mappings', - 'Aliases', - ]); - - // Summary tab should be initial active tab - expect(exists('summaryTab')).toBe(true); - - // Navigate and verify all tabs - actions.selectDetailsTab('settings'); - expect(exists('summaryTab')).toBe(false); - expect(exists('settingsTab')).toBe(true); - - actions.selectDetailsTab('aliases'); - expect(exists('summaryTab')).toBe(false); - expect(exists('settingsTab')).toBe(false); - expect(exists('aliasesTab')).toBe(true); - - actions.selectDetailsTab('mappings'); - expect(exists('summaryTab')).toBe(false); - expect(exists('settingsTab')).toBe(false); - expect(exists('aliasesTab')).toBe(false); - expect(exists('mappingsTab')).toBe(true); - }); - - test('should show an info callout if data is not present', async () => { - const templateWithNoOptionalFields = fixtures.getTemplate({ - name: `a${getRandomString()}`, - indexPatterns: ['template1Pattern1*', 'template1Pattern2'], - }); - - const { actions, find, exists, component } = testBed; - - httpRequestsMockHelpers.setLoadTemplateResponse(templateWithNoOptionalFields); - - await actions.clickTemplateAt(0); - - await act(async () => { - await nextTick(); - component.update(); - }); - - expect(find('templateDetails.tab').length).toBe(4); - expect(exists('summaryTab')).toBe(true); - - // Navigate and verify callout message per tab - actions.selectDetailsTab('settings'); - expect(exists('noSettingsCallout')).toBe(true); - - actions.selectDetailsTab('mappings'); - expect(exists('noMappingsCallout')).toBe(true); - - actions.selectDetailsTab('aliases'); - expect(exists('noAliasesCallout')).toBe(true); - }); - }); - - describe('error handling', () => { - it('should render an error message if error fetching template details', async () => { - const { actions, exists } = testBed; - const error = { - status: 404, - error: 'Not found', - message: 'Template not found', - }; - - httpRequestsMockHelpers.setLoadTemplateResponse(undefined, { body: error }); - - await actions.clickTemplateAt(0); - - expect(exists('sectionError')).toBe(true); - // Manage button should not render if error - expect(exists('templateDetails.manageTemplateButton')).toBe(false); - }); - }); - }); - }); - }); - }); - - describe('index detail panel with % character in index name', () => { - const indexName = 'test%'; - beforeEach(async () => { - const index = { - health: 'green', - status: 'open', - primary: 1, - replica: 1, - documents: 10000, - documents_deleted: 100, - size: '156kb', - primary_size: '156kb', - name: indexName, - }; - httpRequestsMockHelpers.setLoadIndicesResponse([index]); - - testBed = await setup(); - const { component, find } = testBed; - - component.update(); - - find('indexTableIndexNameLink').at(0).simulate('click'); - }); - - test('should encode indexName when loading settings in detail panel', async () => { - const { actions } = testBed; - await actions.selectIndexDetailsTab('settings'); - - const latestRequest = server.requests[server.requests.length - 1]; - expect(latestRequest.url).toBe(`${API_BASE_PATH}/settings/${encodeURIComponent(indexName)}`); - }); - - test('should encode indexName when loading mappings in detail panel', async () => { - const { actions } = testBed; - await actions.selectIndexDetailsTab('mappings'); - - const latestRequest = server.requests[server.requests.length - 1]; - expect(latestRequest.url).toBe(`${API_BASE_PATH}/mapping/${encodeURIComponent(indexName)}`); - }); - - test('should encode indexName when loading stats in detail panel', async () => { - const { actions } = testBed; - await actions.selectIndexDetailsTab('stats'); - - const latestRequest = server.requests[server.requests.length - 1]; - expect(latestRequest.url).toBe(`${API_BASE_PATH}/stats/${encodeURIComponent(indexName)}`); - }); - - test('should encode indexName when editing settings in detail panel', async () => { - const { actions } = testBed; - await actions.selectIndexDetailsTab('edit_settings'); - - const latestRequest = server.requests[server.requests.length - 1]; - expect(latestRequest.url).toBe(`${API_BASE_PATH}/settings/${encodeURIComponent(indexName)}`); - }); - }); -}); diff --git a/x-pack/plugins/index_management/__jest__/client_integration/home/home.helpers.ts b/x-pack/plugins/index_management/__jest__/client_integration/home/home.helpers.ts new file mode 100644 index 0000000000000..c58109364890a --- /dev/null +++ b/x-pack/plugins/index_management/__jest__/client_integration/home/home.helpers.ts @@ -0,0 +1,46 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + +import { registerTestBed, TestBed, TestBedConfig } from '../../../../../test_utils'; +import { IndexManagementHome } from '../../../public/application/sections/home'; // eslint-disable-line @kbn/eslint/no-restricted-paths +import { indexManagementStore } from '../../../public/application/store'; // eslint-disable-line @kbn/eslint/no-restricted-paths +import { WithAppDependencies, services, TestSubjects } from '../helpers'; + +const testBedConfig: TestBedConfig = { + store: () => indexManagementStore(services as any), + memoryRouter: { + initialEntries: [`/indices?includeHidden=true`], + componentRoutePath: `/:section(indices|templates)`, + }, + doMountAsync: true, +}; + +const initTestBed = registerTestBed(WithAppDependencies(IndexManagementHome), testBedConfig); + +export interface HomeTestBed extends TestBed { + actions: { + selectHomeTab: (tab: 'indicesTab' | 'templatesTab') => void; + }; +} + +export const setup = async (): Promise => { + const testBed = await initTestBed(); + + /** + * User Actions + */ + + const selectHomeTab = (tab: 'indicesTab' | 'templatesTab') => { + testBed.find(tab).simulate('click'); + }; + + return { + ...testBed, + actions: { + selectHomeTab, + }, + }; +}; diff --git a/x-pack/plugins/index_management/__jest__/client_integration/home/home.test.ts b/x-pack/plugins/index_management/__jest__/client_integration/home/home.test.ts new file mode 100644 index 0000000000000..d195ce46c2f54 --- /dev/null +++ b/x-pack/plugins/index_management/__jest__/client_integration/home/home.test.ts @@ -0,0 +1,79 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + +import { act } from 'react-dom/test-utils'; + +import { setupEnvironment, nextTick } from '../helpers'; + +import { HomeTestBed, setup } from './home.helpers'; + +describe('', () => { + const { server, httpRequestsMockHelpers } = setupEnvironment(); + let testBed: HomeTestBed; + + afterAll(() => { + server.restore(); + }); + + describe('on component mount', () => { + beforeEach(async () => { + httpRequestsMockHelpers.setLoadIndicesResponse([]); + + testBed = await setup(); + + await act(async () => { + const { component } = testBed; + + await nextTick(); + component.update(); + }); + }); + + test('should set the correct app title', () => { + const { exists, find } = testBed; + expect(exists('appTitle')).toBe(true); + expect(find('appTitle').text()).toEqual('Index Management'); + }); + + test('should have a link to the documentation', () => { + const { exists, find } = testBed; + expect(exists('documentationLink')).toBe(true); + expect(find('documentationLink').text()).toBe('Index Management docs'); + }); + + describe('tabs', () => { + test('should have 2 tabs', () => { + const { find } = testBed; + const templatesTab = find('templatesTab'); + const indicesTab = find('indicesTab'); + + expect(indicesTab.length).toBe(1); + expect(indicesTab.text()).toEqual('Indices'); + expect(templatesTab.length).toBe(1); + expect(templatesTab.text()).toEqual('Index Templates'); + }); + + test('should navigate to Index Templates tab', async () => { + const { exists, actions, component } = testBed; + + expect(exists('indicesList')).toBe(true); + expect(exists('templateList')).toBe(false); + + httpRequestsMockHelpers.setLoadTemplatesResponse([]); + + actions.selectHomeTab('templatesTab'); + + await act(async () => { + await nextTick(); + component.update(); + }); + + expect(exists('indicesList')).toBe(false); + expect(exists('templateList')).toBe(true); + }); + }); + }); +}); diff --git a/x-pack/plugins/index_management/__jest__/client_integration/helpers/home.helpers.ts b/x-pack/plugins/index_management/__jest__/client_integration/home/index_templates_tab.helpers.ts similarity index 60% rename from x-pack/plugins/index_management/__jest__/client_integration/helpers/home.helpers.ts rename to x-pack/plugins/index_management/__jest__/client_integration/home/index_templates_tab.helpers.ts index 36d8e1d343b5e..5260dc64d0c91 100644 --- a/x-pack/plugins/index_management/__jest__/client_integration/helpers/home.helpers.ts +++ b/x-pack/plugins/index_management/__jest__/client_integration/home/index_templates_tab.helpers.ts @@ -6,6 +6,7 @@ import { ReactWrapper } from 'enzyme'; import { act } from 'react-dom/test-utils'; + import { registerTestBed, TestBed, @@ -13,15 +14,17 @@ import { findTestSubject, nextTick, } from '../../../../../test_utils'; +// NOTE: We have to use the Home component instead of the TemplateList component because we depend +// upon react router to provide the name of the template to load in the detail panel. import { IndexManagementHome } from '../../../public/application/sections/home'; // eslint-disable-line @kbn/eslint/no-restricted-paths import { indexManagementStore } from '../../../public/application/store'; // eslint-disable-line @kbn/eslint/no-restricted-paths import { TemplateDeserialized } from '../../../common'; -import { WithAppDependencies, services } from './setup_environment'; +import { WithAppDependencies, services, TestSubjects } from '../helpers'; const testBedConfig: TestBedConfig = { store: () => indexManagementStore(services as any), memoryRouter: { - initialEntries: [`/indices?includeHidden=true`], + initialEntries: [`/indices`], componentRoutePath: `/:section(indices|templates)`, }, doMountAsync: true, @@ -29,12 +32,11 @@ const testBedConfig: TestBedConfig = { const initTestBed = registerTestBed(WithAppDependencies(IndexManagementHome), testBedConfig); -export interface IdxMgmtHomeTestBed extends TestBed { +export interface IndexTemplatesTabTestBed extends TestBed { findAction: (action: 'edit' | 'clone' | 'delete') => ReactWrapper; actions: { - selectHomeTab: (tab: 'indicesTab' | 'templatesTab') => void; + goToTemplatesList: () => void; selectDetailsTab: (tab: 'summary' | 'settings' | 'mappings' | 'aliases') => void; - selectIndexDetailsTab: (tab: 'settings' | 'mappings' | 'stats' | 'edit_settings') => void; clickReloadButton: () => void; clickTemplateAction: ( name: TemplateDeserialized['name'], @@ -43,12 +45,10 @@ export interface IdxMgmtHomeTestBed extends TestBed { clickTemplateAt: (index: number) => void; clickCloseDetailsButton: () => void; clickActionMenu: (name: TemplateDeserialized['name']) => void; - getIncludeHiddenIndicesToggleStatus: () => boolean; - clickIncludeHiddenIndicesToggle: () => void; }; } -export const setup = async (): Promise => { +export const setup = async (): Promise => { const testBed = await initTestBed(); /** @@ -65,8 +65,8 @@ export const setup = async (): Promise => { * User Actions */ - const selectHomeTab = (tab: 'indicesTab' | 'templatesTab') => { - testBed.find(tab).simulate('click'); + const goToTemplatesList = () => { + testBed.find('templatesTab').simulate('click'); }; const selectDetailsTab = (tab: 'summary' | 'settings' | 'mappings' | 'aliases') => { @@ -119,82 +119,17 @@ export const setup = async (): Promise => { find('closeDetailsButton').simulate('click'); }; - const clickIncludeHiddenIndicesToggle = () => { - const { find } = testBed; - find('indexTableIncludeHiddenIndicesToggle').simulate('click'); - }; - - const getIncludeHiddenIndicesToggleStatus = () => { - const { find } = testBed; - const props = find('indexTableIncludeHiddenIndicesToggle').props(); - return Boolean(props['aria-checked']); - }; - - const selectIndexDetailsTab = async ( - tab: 'settings' | 'mappings' | 'stats' | 'edit_settings' - ) => { - const indexDetailsTabs = ['settings', 'mappings', 'stats', 'edit_settings']; - const { find, component } = testBed; - await act(async () => { - find('detailPanelTab').at(indexDetailsTabs.indexOf(tab)).simulate('click'); - }); - component.update(); - }; - return { ...testBed, findAction, actions: { - selectHomeTab, + goToTemplatesList, selectDetailsTab, - selectIndexDetailsTab, clickReloadButton, clickTemplateAction, clickTemplateAt, clickCloseDetailsButton, clickActionMenu, - getIncludeHiddenIndicesToggleStatus, - clickIncludeHiddenIndicesToggle, }, }; }; - -type IdxMgmtTestSubjects = TestSubjects; - -export type TestSubjects = - | 'aliasesTab' - | 'appTitle' - | 'cell' - | 'closeDetailsButton' - | 'createTemplateButton' - | 'deleteSystemTemplateCallOut' - | 'deleteTemplateButton' - | 'deleteTemplatesConfirmation' - | 'documentationLink' - | 'emptyPrompt' - | 'manageTemplateButton' - | 'mappingsTab' - | 'noAliasesCallout' - | 'noMappingsCallout' - | 'noSettingsCallout' - | 'indicesList' - | 'indicesTab' - | 'indexTableIncludeHiddenIndicesToggle' - | 'indexTableIndexNameLink' - | 'reloadButton' - | 'reloadIndicesButton' - | 'row' - | 'sectionError' - | 'sectionLoading' - | 'settingsTab' - | 'summaryTab' - | 'summaryTitle' - | 'systemTemplatesSwitch' - | 'templateDetails' - | 'templateDetails.manageTemplateButton' - | 'templateDetails.sectionLoading' - | 'templateDetails.tab' - | 'templateDetails.title' - | 'templateList' - | 'templateTable' - | 'templatesTab'; diff --git a/x-pack/plugins/index_management/__jest__/client_integration/home/index_templates_tab.test.ts b/x-pack/plugins/index_management/__jest__/client_integration/home/index_templates_tab.test.ts new file mode 100644 index 0000000000000..c9a279e90d0e0 --- /dev/null +++ b/x-pack/plugins/index_management/__jest__/client_integration/home/index_templates_tab.test.ts @@ -0,0 +1,463 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + +import { act } from 'react-dom/test-utils'; + +import * as fixtures from '../../../test/fixtures'; +import { API_BASE_PATH } from '../../../common/constants'; +import { setupEnvironment, nextTick, getRandomString } from '../helpers'; + +import { IndexTemplatesTabTestBed, setup } from './index_templates_tab.helpers'; + +const removeWhiteSpaceOnArrayValues = (array: any[]) => + array.map((value) => { + if (!value.trim) { + return value; + } + return value.trim(); + }); + +describe('Index Templates tab', () => { + const { server, httpRequestsMockHelpers } = setupEnvironment(); + let testBed: IndexTemplatesTabTestBed; + + afterAll(() => { + server.restore(); + }); + + beforeEach(async () => { + httpRequestsMockHelpers.setLoadIndicesResponse([]); + + testBed = await setup(); + + await act(async () => { + const { component } = testBed; + + await nextTick(); + component.update(); + }); + }); + + describe('when there are no index templates', () => { + beforeEach(async () => { + const { actions, component } = testBed; + + httpRequestsMockHelpers.setLoadTemplatesResponse([]); + + actions.goToTemplatesList(); + + await act(async () => { + await nextTick(); + component.update(); + }); + }); + + test('should display an empty prompt', async () => { + const { exists } = testBed; + + expect(exists('sectionLoading')).toBe(false); + expect(exists('emptyPrompt')).toBe(true); + }); + }); + + describe('when there are index templates', () => { + const template1 = fixtures.getTemplate({ + name: `a${getRandomString()}`, + indexPatterns: ['template1Pattern1*', 'template1Pattern2'], + template: { + settings: { + index: { + number_of_shards: '1', + lifecycle: { + name: 'my_ilm_policy', + }, + }, + }, + }, + }); + const template2 = fixtures.getTemplate({ + name: `b${getRandomString()}`, + indexPatterns: ['template2Pattern1*'], + }); + const template3 = fixtures.getTemplate({ + name: `.c${getRandomString()}`, // mock system template + indexPatterns: ['template3Pattern1*', 'template3Pattern2', 'template3Pattern3'], + }); + + const templates = [template1, template2, template3]; + + beforeEach(async () => { + const { actions, component } = testBed; + + httpRequestsMockHelpers.setLoadTemplatesResponse(templates); + + actions.goToTemplatesList(); + + await act(async () => { + await nextTick(); + component.update(); + }); + }); + + test('should list them in the table', async () => { + const { table } = testBed; + + const { tableCellsValues } = table.getMetaData('templateTable'); + + tableCellsValues.forEach((row, i) => { + const template = templates[i]; + const { name, indexPatterns, order, ilmPolicy } = template; + + const ilmPolicyName = ilmPolicy && ilmPolicy.name ? ilmPolicy.name : ''; + const orderFormatted = order ? order.toString() : order; + + expect(removeWhiteSpaceOnArrayValues(row)).toEqual([ + '', + name, + indexPatterns.join(', '), + ilmPolicyName, + orderFormatted, + '', + '', + '', + '', + ]); + }); + }); + + test('should have a button to reload the index templates', async () => { + const { component, exists, actions } = testBed; + const totalRequests = server.requests.length; + + expect(exists('reloadButton')).toBe(true); + + await act(async () => { + actions.clickReloadButton(); + await nextTick(); + component.update(); + }); + + expect(server.requests.length).toBe(totalRequests + 1); + expect(server.requests[server.requests.length - 1].url).toBe(`${API_BASE_PATH}/templates`); + }); + + test('should have a button to create a new template', () => { + const { exists } = testBed; + expect(exists('createTemplateButton')).toBe(true); + }); + + test('should have a switch to view system templates', async () => { + const { table, exists, component, form } = testBed; + const { rows } = table.getMetaData('templateTable'); + + expect(rows.length).toEqual( + templates.filter((template) => !template.name.startsWith('.')).length + ); + + expect(exists('systemTemplatesSwitch')).toBe(true); + + await act(async () => { + form.toggleEuiSwitch('systemTemplatesSwitch'); + await nextTick(); + component.update(); + }); + + const { rows: updatedRows } = table.getMetaData('templateTable'); + expect(updatedRows.length).toEqual(templates.length); + }); + + test('each row should have a link to the template details panel', async () => { + const { find, exists, actions } = testBed; + + await actions.clickTemplateAt(0); + + expect(exists('templateList')).toBe(true); + expect(exists('templateDetails')).toBe(true); + expect(find('templateDetails.title').text()).toBe(template1.name); + }); + + test('template actions column should have an option to delete', () => { + const { actions, findAction } = testBed; + const { name: templateName } = template1; + + actions.clickActionMenu(templateName); + + const deleteAction = findAction('delete'); + + expect(deleteAction.text()).toEqual('Delete'); + }); + + test('template actions column should have an option to clone', () => { + const { actions, findAction } = testBed; + const { name: templateName } = template1; + + actions.clickActionMenu(templateName); + + const cloneAction = findAction('clone'); + + expect(cloneAction.text()).toEqual('Clone'); + }); + + test('template actions column should have an option to edit', () => { + const { actions, findAction } = testBed; + const { name: templateName } = template1; + + actions.clickActionMenu(templateName); + + const editAction = findAction('edit'); + + expect(editAction.text()).toEqual('Edit'); + }); + + describe('delete index template', () => { + test('should show a confirmation when clicking the delete template button', async () => { + const { actions } = testBed; + const { name: templateName } = template1; + + await actions.clickTemplateAction(templateName, 'delete'); + + // We need to read the document "body" as the modal is added there and not inside + // the component DOM tree. + expect( + document.body.querySelector('[data-test-subj="deleteTemplatesConfirmation"]') + ).not.toBe(null); + + expect( + document.body.querySelector('[data-test-subj="deleteTemplatesConfirmation"]')!.textContent + ).toContain('Delete template'); + }); + + test('should show a warning message when attempting to delete a system template', async () => { + const { component, form, actions } = testBed; + + await act(async () => { + form.toggleEuiSwitch('systemTemplatesSwitch'); + await nextTick(); + component.update(); + }); + + const { name: systemTemplateName } = template3; + await actions.clickTemplateAction(systemTemplateName, 'delete'); + + expect( + document.body.querySelector('[data-test-subj="deleteSystemTemplateCallOut"]') + ).not.toBe(null); + }); + + test('should send the correct HTTP request to delete an index template', async () => { + const { component, actions, table } = testBed; + const { rows } = table.getMetaData('templateTable'); + + const templateId = rows[0].columns[2].value; + + const { + name: templateName, + _kbnMeta: { formatVersion }, + } = template1; + await actions.clickTemplateAction(templateName, 'delete'); + + const modal = document.body.querySelector('[data-test-subj="deleteTemplatesConfirmation"]'); + const confirmButton: HTMLButtonElement | null = modal!.querySelector( + '[data-test-subj="confirmModalConfirmButton"]' + ); + + httpRequestsMockHelpers.setDeleteTemplateResponse({ + results: { + successes: [templateId], + errors: [], + }, + }); + + await act(async () => { + confirmButton!.click(); + await nextTick(); + component.update(); + }); + + const latestRequest = server.requests[server.requests.length - 1]; + + expect(latestRequest.method).toBe('POST'); + expect(latestRequest.url).toBe(`${API_BASE_PATH}/delete-templates`); + expect(JSON.parse(JSON.parse(latestRequest.requestBody).body)).toEqual({ + templates: [{ name: template1.name, formatVersion }], + }); + }); + }); + + describe('detail panel', () => { + beforeEach(async () => { + const template = fixtures.getTemplate({ + name: `a${getRandomString()}`, + indexPatterns: ['template1Pattern1*', 'template1Pattern2'], + }); + + httpRequestsMockHelpers.setLoadTemplateResponse(template); + }); + + test('should show details when clicking on a template', async () => { + const { exists, actions } = testBed; + + expect(exists('templateDetails')).toBe(false); + + await actions.clickTemplateAt(0); + + expect(exists('templateDetails')).toBe(true); + }); + + describe('on mount', () => { + beforeEach(async () => { + const { actions } = testBed; + + await actions.clickTemplateAt(0); + }); + + test('should set the correct title', async () => { + const { find } = testBed; + const { name } = template1; + + expect(find('templateDetails.title').text()).toEqual(name); + }); + + it('should have a close button and be able to close flyout', async () => { + const { actions, component, exists } = testBed; + + expect(exists('closeDetailsButton')).toBe(true); + expect(exists('summaryTab')).toBe(true); + + actions.clickCloseDetailsButton(); + + await act(async () => { + await nextTick(); + component.update(); + }); + + expect(exists('summaryTab')).toBe(false); + }); + + it('should have a manage button', async () => { + const { actions, exists } = testBed; + + await actions.clickTemplateAt(0); + + expect(exists('templateDetails.manageTemplateButton')).toBe(true); + }); + }); + + describe('tabs', () => { + test('should have 4 tabs', async () => { + const template = fixtures.getTemplate({ + name: `a${getRandomString()}`, + indexPatterns: ['template1Pattern1*', 'template1Pattern2'], + template: { + settings: { + index: { + number_of_shards: '1', + }, + }, + mappings: { + _source: { + enabled: false, + }, + properties: { + created_at: { + type: 'date', + format: 'EEE MMM dd HH:mm:ss Z yyyy', + }, + }, + }, + aliases: { + alias1: {}, + }, + }, + }); + + const { find, actions, exists } = testBed; + + httpRequestsMockHelpers.setLoadTemplateResponse(template); + + await actions.clickTemplateAt(0); + + expect(find('templateDetails.tab').length).toBe(4); + expect(find('templateDetails.tab').map((t) => t.text())).toEqual([ + 'Summary', + 'Settings', + 'Mappings', + 'Aliases', + ]); + + // Summary tab should be initial active tab + expect(exists('summaryTab')).toBe(true); + + // Navigate and verify all tabs + actions.selectDetailsTab('settings'); + expect(exists('summaryTab')).toBe(false); + expect(exists('settingsTab')).toBe(true); + + actions.selectDetailsTab('aliases'); + expect(exists('summaryTab')).toBe(false); + expect(exists('settingsTab')).toBe(false); + expect(exists('aliasesTab')).toBe(true); + + actions.selectDetailsTab('mappings'); + expect(exists('summaryTab')).toBe(false); + expect(exists('settingsTab')).toBe(false); + expect(exists('aliasesTab')).toBe(false); + expect(exists('mappingsTab')).toBe(true); + }); + + test('should show an info callout if data is not present', async () => { + const templateWithNoOptionalFields = fixtures.getTemplate({ + name: `a${getRandomString()}`, + indexPatterns: ['template1Pattern1*', 'template1Pattern2'], + }); + + const { actions, find, exists, component } = testBed; + + httpRequestsMockHelpers.setLoadTemplateResponse(templateWithNoOptionalFields); + + await actions.clickTemplateAt(0); + + await act(async () => { + await nextTick(); + component.update(); + }); + + expect(find('templateDetails.tab').length).toBe(4); + expect(exists('summaryTab')).toBe(true); + + // Navigate and verify callout message per tab + actions.selectDetailsTab('settings'); + expect(exists('noSettingsCallout')).toBe(true); + + actions.selectDetailsTab('mappings'); + expect(exists('noMappingsCallout')).toBe(true); + + actions.selectDetailsTab('aliases'); + expect(exists('noAliasesCallout')).toBe(true); + }); + }); + + describe('error handling', () => { + it('should render an error message if error fetching template details', async () => { + const { actions, exists } = testBed; + const error = { + status: 404, + error: 'Not found', + message: 'Template not found', + }; + + httpRequestsMockHelpers.setLoadTemplateResponse(undefined, { body: error }); + + await actions.clickTemplateAt(0); + + expect(exists('sectionError')).toBe(true); + // Manage button should not render if error + expect(exists('templateDetails.manageTemplateButton')).toBe(false); + }); + }); + }); + }); +}); diff --git a/x-pack/plugins/index_management/__jest__/client_integration/home/indices_tab.helpers.ts b/x-pack/plugins/index_management/__jest__/client_integration/home/indices_tab.helpers.ts new file mode 100644 index 0000000000000..e995932dfa00d --- /dev/null +++ b/x-pack/plugins/index_management/__jest__/client_integration/home/indices_tab.helpers.ts @@ -0,0 +1,70 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + +import { act } from 'react-dom/test-utils'; + +import { registerTestBed, TestBed, TestBedConfig } from '../../../../../test_utils'; +import { IndexList } from '../../../public/application/sections/home/index_list'; // eslint-disable-line @kbn/eslint/no-restricted-paths +import { indexManagementStore } from '../../../public/application/store'; // eslint-disable-line @kbn/eslint/no-restricted-paths +import { WithAppDependencies, services, TestSubjects } from '../helpers'; + +const testBedConfig: TestBedConfig = { + store: () => indexManagementStore(services as any), + memoryRouter: { + initialEntries: [`/indices?includeHiddenIndices=true`], + componentRoutePath: `/:section(indices|templates)`, + }, + doMountAsync: true, +}; + +const initTestBed = registerTestBed(WithAppDependencies(IndexList), testBedConfig); + +export interface IndicesTestBed extends TestBed { + actions: { + selectIndexDetailsTab: (tab: 'settings' | 'mappings' | 'stats' | 'edit_settings') => void; + getIncludeHiddenIndicesToggleStatus: () => boolean; + clickIncludeHiddenIndicesToggle: () => void; + }; +} + +export const setup = async (): Promise => { + const testBed = await initTestBed(); + + /** + * User Actions + */ + + const clickIncludeHiddenIndicesToggle = () => { + const { find } = testBed; + find('indexTableIncludeHiddenIndicesToggle').simulate('click'); + }; + + const getIncludeHiddenIndicesToggleStatus = () => { + const { find } = testBed; + const props = find('indexTableIncludeHiddenIndicesToggle').props(); + return Boolean(props['aria-checked']); + }; + + const selectIndexDetailsTab = async ( + tab: 'settings' | 'mappings' | 'stats' | 'edit_settings' + ) => { + const indexDetailsTabs = ['settings', 'mappings', 'stats', 'edit_settings']; + const { find, component } = testBed; + await act(async () => { + find('detailPanelTab').at(indexDetailsTabs.indexOf(tab)).simulate('click'); + }); + component.update(); + }; + + return { + ...testBed, + actions: { + selectIndexDetailsTab, + getIncludeHiddenIndicesToggleStatus, + clickIncludeHiddenIndicesToggle, + }, + }; +}; diff --git a/x-pack/plugins/index_management/__jest__/client_integration/home/indices_tab.test.ts b/x-pack/plugins/index_management/__jest__/client_integration/home/indices_tab.test.ts new file mode 100644 index 0000000000000..cf00e0f6d14e1 --- /dev/null +++ b/x-pack/plugins/index_management/__jest__/client_integration/home/indices_tab.test.ts @@ -0,0 +1,103 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + +import { act } from 'react-dom/test-utils'; + +import { API_BASE_PATH } from '../../../common/constants'; +import { setupEnvironment, nextTick } from '../helpers'; + +import { IndicesTestBed, setup } from './indices_tab.helpers'; + +describe('', () => { + const { server, httpRequestsMockHelpers } = setupEnvironment(); + let testBed: IndicesTestBed; + + afterAll(() => { + server.restore(); + }); + + describe('on component mount', () => { + beforeEach(async () => { + httpRequestsMockHelpers.setLoadIndicesResponse([]); + + testBed = await setup(); + + await act(async () => { + const { component } = testBed; + + await nextTick(); + component.update(); + }); + }); + + test('toggles the include hidden button through URL hash correctly', () => { + const { actions } = testBed; + expect(actions.getIncludeHiddenIndicesToggleStatus()).toBe(true); + actions.clickIncludeHiddenIndicesToggle(); + expect(actions.getIncludeHiddenIndicesToggleStatus()).toBe(false); + // Note: this test modifies the shared location.hash state, we put it back the way it was + actions.clickIncludeHiddenIndicesToggle(); + expect(actions.getIncludeHiddenIndicesToggleStatus()).toBe(true); + }); + }); + + describe('index detail panel with % character in index name', () => { + const indexName = 'test%'; + beforeEach(async () => { + const index = { + health: 'green', + status: 'open', + primary: 1, + replica: 1, + documents: 10000, + documents_deleted: 100, + size: '156kb', + primary_size: '156kb', + name: indexName, + }; + httpRequestsMockHelpers.setLoadIndicesResponse([index]); + + testBed = await setup(); + const { component, find } = testBed; + + component.update(); + + find('indexTableIndexNameLink').at(0).simulate('click'); + }); + + test('should encode indexName when loading settings in detail panel', async () => { + const { actions } = testBed; + await actions.selectIndexDetailsTab('settings'); + + const latestRequest = server.requests[server.requests.length - 1]; + expect(latestRequest.url).toBe(`${API_BASE_PATH}/settings/${encodeURIComponent(indexName)}`); + }); + + test('should encode indexName when loading mappings in detail panel', async () => { + const { actions } = testBed; + await actions.selectIndexDetailsTab('mappings'); + + const latestRequest = server.requests[server.requests.length - 1]; + expect(latestRequest.url).toBe(`${API_BASE_PATH}/mapping/${encodeURIComponent(indexName)}`); + }); + + test('should encode indexName when loading stats in detail panel', async () => { + const { actions } = testBed; + await actions.selectIndexDetailsTab('stats'); + + const latestRequest = server.requests[server.requests.length - 1]; + expect(latestRequest.url).toBe(`${API_BASE_PATH}/stats/${encodeURIComponent(indexName)}`); + }); + + test('should encode indexName when editing settings in detail panel', async () => { + const { actions } = testBed; + await actions.selectIndexDetailsTab('edit_settings'); + + const latestRequest = server.requests[server.requests.length - 1]; + expect(latestRequest.url).toBe(`${API_BASE_PATH}/settings/${encodeURIComponent(indexName)}`); + }); + }); +}); diff --git a/x-pack/plugins/index_management/__jest__/client_integration/helpers/constants.ts b/x-pack/plugins/index_management/__jest__/client_integration/index_template_wizard/constants.ts similarity index 100% rename from x-pack/plugins/index_management/__jest__/client_integration/helpers/constants.ts rename to x-pack/plugins/index_management/__jest__/client_integration/index_template_wizard/constants.ts diff --git a/x-pack/plugins/index_management/__jest__/client_integration/helpers/template_clone.helpers.ts b/x-pack/plugins/index_management/__jest__/client_integration/index_template_wizard/template_clone.helpers.ts similarity index 76% rename from x-pack/plugins/index_management/__jest__/client_integration/helpers/template_clone.helpers.ts rename to x-pack/plugins/index_management/__jest__/client_integration/index_template_wizard/template_clone.helpers.ts index 36498b99ba143..1a58cfa8fb55e 100644 --- a/x-pack/plugins/index_management/__jest__/client_integration/helpers/template_clone.helpers.ts +++ b/x-pack/plugins/index_management/__jest__/client_integration/index_template_wizard/template_clone.helpers.ts @@ -5,16 +5,16 @@ */ import { registerTestBed, TestBedConfig } from '../../../../../test_utils'; -import { BASE_PATH } from '../../../common/constants'; import { TemplateClone } from '../../../public/application/sections/template_clone'; // eslint-disable-line @kbn/eslint/no-restricted-paths +import { WithAppDependencies } from '../helpers'; + import { formSetup } from './template_form.helpers'; import { TEMPLATE_NAME } from './constants'; -import { WithAppDependencies } from './setup_environment'; const testBedConfig: TestBedConfig = { memoryRouter: { - initialEntries: [`${BASE_PATH}clone_template/${TEMPLATE_NAME}`], - componentRoutePath: `${BASE_PATH}clone_template/:name`, + initialEntries: [`/clone_template/${TEMPLATE_NAME}`], + componentRoutePath: `/clone_template/:name`, }, doMountAsync: true, }; diff --git a/x-pack/plugins/index_management/__jest__/client_integration/template_clone.test.tsx b/x-pack/plugins/index_management/__jest__/client_integration/index_template_wizard/template_clone.test.tsx similarity index 88% rename from x-pack/plugins/index_management/__jest__/client_integration/template_clone.test.tsx rename to x-pack/plugins/index_management/__jest__/client_integration/index_template_wizard/template_clone.test.tsx index fa9d13d1ddd07..e0db9cd58ee23 100644 --- a/x-pack/plugins/index_management/__jest__/client_integration/template_clone.test.tsx +++ b/x-pack/plugins/index_management/__jest__/client_integration/index_template_wizard/template_clone.test.tsx @@ -3,21 +3,16 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ + import React from 'react'; import { act } from 'react-dom/test-utils'; -import { setupEnvironment, pageHelpers, nextTick } from './helpers'; -import { TemplateFormTestBed } from './helpers/template_form.helpers'; -import { getTemplate } from '../../test/fixtures'; -import { - TEMPLATE_NAME, - INDEX_PATTERNS as DEFAULT_INDEX_PATTERNS, - MAPPINGS, -} from './helpers/constants'; - -const { setup } = pageHelpers.templateClone; +import { getTemplate } from '../../../test/fixtures'; +import { setupEnvironment, nextTick } from '../helpers'; -jest.mock('ui/new_platform'); +import { TEMPLATE_NAME, INDEX_PATTERNS as DEFAULT_INDEX_PATTERNS, MAPPINGS } from './constants'; +import { setup } from './template_clone.helpers'; +import { TemplateFormTestBed } from './template_form.helpers'; jest.mock('@elastic/eui', () => ({ ...jest.requireActual('@elastic/eui'), diff --git a/x-pack/plugins/index_management/__jest__/client_integration/helpers/template_create.helpers.ts b/x-pack/plugins/index_management/__jest__/client_integration/index_template_wizard/template_create.helpers.ts similarity index 77% rename from x-pack/plugins/index_management/__jest__/client_integration/helpers/template_create.helpers.ts rename to x-pack/plugins/index_management/__jest__/client_integration/index_template_wizard/template_create.helpers.ts index 14a44968a93c3..ab0a7b8567607 100644 --- a/x-pack/plugins/index_management/__jest__/client_integration/helpers/template_create.helpers.ts +++ b/x-pack/plugins/index_management/__jest__/client_integration/index_template_wizard/template_create.helpers.ts @@ -5,15 +5,15 @@ */ import { registerTestBed, TestBedConfig } from '../../../../../test_utils'; -import { BASE_PATH } from '../../../common/constants'; import { TemplateCreate } from '../../../public/application/sections/template_create'; // eslint-disable-line @kbn/eslint/no-restricted-paths +import { WithAppDependencies } from '../helpers'; + import { formSetup, TestSubjects } from './template_form.helpers'; -import { WithAppDependencies } from './setup_environment'; const testBedConfig: TestBedConfig = { memoryRouter: { - initialEntries: [`${BASE_PATH}create_template`], - componentRoutePath: `${BASE_PATH}create_template`, + initialEntries: [`/create_template`], + componentRoutePath: `/create_template`, }, doMountAsync: true, }; diff --git a/x-pack/plugins/index_management/__jest__/client_integration/template_create.test.tsx b/x-pack/plugins/index_management/__jest__/client_integration/index_template_wizard/template_create.test.tsx similarity index 97% rename from x-pack/plugins/index_management/__jest__/client_integration/template_create.test.tsx rename to x-pack/plugins/index_management/__jest__/client_integration/index_template_wizard/template_create.test.tsx index 8f464987418c0..95545b6c66f54 100644 --- a/x-pack/plugins/index_management/__jest__/client_integration/template_create.test.tsx +++ b/x-pack/plugins/index_management/__jest__/client_integration/index_template_wizard/template_create.test.tsx @@ -3,23 +3,22 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ + import React from 'react'; import { act } from 'react-dom/test-utils'; -import { DEFAULT_INDEX_TEMPLATE_VERSION_FORMAT } from '../../common'; -import { setupEnvironment, pageHelpers, nextTick } from './helpers'; -import { TemplateFormTestBed } from './helpers/template_form.helpers'; +import { DEFAULT_INDEX_TEMPLATE_VERSION_FORMAT } from '../../../common'; +import { setupEnvironment, nextTick } from '../helpers'; + import { TEMPLATE_NAME, SETTINGS, MAPPINGS, ALIASES, INDEX_PATTERNS as DEFAULT_INDEX_PATTERNS, -} from './helpers/constants'; - -const { setup } = pageHelpers.templateCreate; - -jest.mock('ui/new_platform'); +} from './constants'; +import { setup } from './template_create.helpers'; +import { TemplateFormTestBed } from './template_form.helpers'; jest.mock('@elastic/eui', () => ({ ...jest.requireActual('@elastic/eui'), diff --git a/x-pack/plugins/index_management/__jest__/client_integration/helpers/template_edit.helpers.ts b/x-pack/plugins/index_management/__jest__/client_integration/index_template_wizard/template_edit.helpers.ts similarity index 77% rename from x-pack/plugins/index_management/__jest__/client_integration/helpers/template_edit.helpers.ts rename to x-pack/plugins/index_management/__jest__/client_integration/index_template_wizard/template_edit.helpers.ts index af5fa8b79ecad..29ecd84e585ce 100644 --- a/x-pack/plugins/index_management/__jest__/client_integration/helpers/template_edit.helpers.ts +++ b/x-pack/plugins/index_management/__jest__/client_integration/index_template_wizard/template_edit.helpers.ts @@ -5,16 +5,16 @@ */ import { registerTestBed, TestBedConfig } from '../../../../../test_utils'; -import { BASE_PATH } from '../../../common/constants'; import { TemplateEdit } from '../../../public/application/sections/template_edit'; // eslint-disable-line @kbn/eslint/no-restricted-paths +import { WithAppDependencies } from '../helpers'; + import { formSetup, TestSubjects } from './template_form.helpers'; import { TEMPLATE_NAME } from './constants'; -import { WithAppDependencies } from './setup_environment'; const testBedConfig: TestBedConfig = { memoryRouter: { - initialEntries: [`${BASE_PATH}edit_template/${TEMPLATE_NAME}`], - componentRoutePath: `${BASE_PATH}edit_template/:name`, + initialEntries: [`/edit_template/${TEMPLATE_NAME}`], + componentRoutePath: `/edit_template/:name`, }, doMountAsync: true, }; diff --git a/x-pack/plugins/index_management/__jest__/client_integration/template_edit.test.tsx b/x-pack/plugins/index_management/__jest__/client_integration/index_template_wizard/template_edit.test.tsx similarity index 95% rename from x-pack/plugins/index_management/__jest__/client_integration/template_edit.test.tsx rename to x-pack/plugins/index_management/__jest__/client_integration/index_template_wizard/template_edit.test.tsx index 0ed369e9b13f7..6e935a5263301 100644 --- a/x-pack/plugins/index_management/__jest__/client_integration/template_edit.test.tsx +++ b/x-pack/plugins/index_management/__jest__/client_integration/index_template_wizard/template_edit.test.tsx @@ -3,13 +3,16 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ + import React from 'react'; import { act } from 'react-dom/test-utils'; -import { setupEnvironment, pageHelpers, nextTick } from './helpers'; -import { TemplateFormTestBed } from './helpers/template_form.helpers'; -import * as fixtures from '../../test/fixtures'; -import { TEMPLATE_NAME, SETTINGS, ALIASES, MAPPINGS as DEFAULT_MAPPING } from './helpers/constants'; +import * as fixtures from '../../../test/fixtures'; +import { setupEnvironment, nextTick } from '../helpers'; + +import { TEMPLATE_NAME, SETTINGS, ALIASES, MAPPINGS as DEFAULT_MAPPING } from './constants'; +import { setup } from './template_edit.helpers'; +import { TemplateFormTestBed } from './template_form.helpers'; const UPDATED_INDEX_PATTERN = ['updatedIndexPattern']; const UPDATED_MAPPING_TEXT_FIELD_NAME = 'updated_text_datatype'; @@ -22,10 +25,6 @@ const MAPPING = { }, }; -const { setup } = pageHelpers.templateEdit; - -jest.mock('ui/new_platform'); - jest.mock('@elastic/eui', () => ({ ...jest.requireActual('@elastic/eui'), // Mocking EuiComboBox, as it utilizes "react-virtualized" for rendering search suggestions, diff --git a/x-pack/plugins/index_management/__jest__/client_integration/helpers/template_form.helpers.ts b/x-pack/plugins/index_management/__jest__/client_integration/index_template_wizard/template_form.helpers.ts similarity index 99% rename from x-pack/plugins/index_management/__jest__/client_integration/helpers/template_form.helpers.ts rename to x-pack/plugins/index_management/__jest__/client_integration/index_template_wizard/template_form.helpers.ts index 21713428c4316..fdf837a914cf1 100644 --- a/x-pack/plugins/index_management/__jest__/client_integration/helpers/template_form.helpers.ts +++ b/x-pack/plugins/index_management/__jest__/client_integration/index_template_wizard/template_form.helpers.ts @@ -3,9 +3,10 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ + import { TestBed, SetupFunc, UnwrapPromise } from '../../../../../test_utils'; import { TemplateDeserialized } from '../../../common'; -import { nextTick } from './index'; +import { nextTick } from '../helpers'; interface MappingField { name: string; diff --git a/x-pack/plugins/index_management/__jest__/components/index_table.test.js b/x-pack/plugins/index_management/__jest__/components/index_table.test.js index ffd3cbb83c2ce..8e8c2632a2372 100644 --- a/x-pack/plugins/index_management/__jest__/components/index_table.test.js +++ b/x-pack/plugins/index_management/__jest__/components/index_table.test.js @@ -37,8 +37,6 @@ import { findTestSubject } from '@elastic/eui/lib/test'; /* eslint-disable @kbn/eslint/no-restricted-paths */ import { notificationServiceMock } from '../../../../../src/core/public/notifications/notifications_service.mock'; -jest.mock('ui/new_platform'); - const mockHttpClient = axios.create({ adapter: axiosXhrAdapter }); let server = null; diff --git a/x-pack/plugins/index_management/__mocks__/ace.js b/x-pack/plugins/index_management/__mocks__/ace.js deleted file mode 100644 index 40ce7026eee11..0000000000000 --- a/x-pack/plugins/index_management/__mocks__/ace.js +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License; - * you may not use this file except in compliance with the Elastic License. - */ - -export default { - edit: () => { - return { - navigateFileEnd() {}, - destroy() {}, - acequire() { - return { - setCompleters() {}, - }; - }, - setValue() {}, - setOptions() {}, - setTheme() {}, - setFontSize() {}, - setShowPrintMargin() {}, - getSession() { - return { - setUseWrapMode() {}, - setMode() {}, - setValue() {}, - on() {}, - }; - }, - renderer: { - setShowGutter() {}, - setScrollMargin() {}, - }, - setBehavioursEnabled() {}, - }; - }, - acequire() { - return { - setCompleters() {}, - }; - }, - setCompleters() { - return [{}]; - }, -}; diff --git a/x-pack/plugins/index_management/__mocks__/ui/notify.js b/x-pack/plugins/index_management/__mocks__/ui/notify.js deleted file mode 100644 index 3d64a99232bc3..0000000000000 --- a/x-pack/plugins/index_management/__mocks__/ui/notify.js +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License; - * you may not use this file except in compliance with the Elastic License. - */ - -export const toastNotifications = { - addInfo: () => {}, - addSuccess: () => {}, - addDanger: () => {}, - addWarning: () => {}, - addError: () => {}, -}; - -export function fatalError() {} diff --git a/x-pack/plugins/index_management/__jest__/lib/__snapshots__/flatten_object.test.js.snap b/x-pack/plugins/index_management/public/application/lib/__snapshots__/flatten_object.test.js.snap similarity index 100% rename from x-pack/plugins/index_management/__jest__/lib/__snapshots__/flatten_object.test.js.snap rename to x-pack/plugins/index_management/public/application/lib/__snapshots__/flatten_object.test.js.snap diff --git a/x-pack/plugins/index_management/__jest__/lib/flatten_object.test.js b/x-pack/plugins/index_management/public/application/lib/flatten_object.test.js similarity index 90% rename from x-pack/plugins/index_management/__jest__/lib/flatten_object.test.js rename to x-pack/plugins/index_management/public/application/lib/flatten_object.test.js index 0d6d5ee796627..222d172d1ff86 100644 --- a/x-pack/plugins/index_management/__jest__/lib/flatten_object.test.js +++ b/x-pack/plugins/index_management/public/application/lib/flatten_object.test.js @@ -4,7 +4,8 @@ * you may not use this file except in compliance with the Elastic License. */ -import { flattenObject } from '../../public/application/lib/flatten_object'; +import { flattenObject } from './flatten_object'; + describe('flatten_object', () => { test('it flattens an object', () => { const obj = { @@ -17,6 +18,7 @@ describe('flatten_object', () => { }; expect(flattenObject(obj)).toMatchSnapshot(); }); + test('it flattens an object that contains an array in a field', () => { const obj = { foo: { diff --git a/x-pack/plugins/index_management/public/application/sections/home/index_list/index.ts b/x-pack/plugins/index_management/public/application/sections/home/index_list/index.ts index a6d4bfee29d55..cc0e145909e62 100644 --- a/x-pack/plugins/index_management/public/application/sections/home/index_list/index.ts +++ b/x-pack/plugins/index_management/public/application/sections/home/index_list/index.ts @@ -4,4 +4,4 @@ * you may not use this file except in compliance with the Elastic License. */ -export * from './index_list'; +export { IndexList } from './index_list'; diff --git a/x-pack/plugins/index_management/public/application/sections/home/index_list/index_list.js b/x-pack/plugins/index_management/public/application/sections/home/index_list/index_list.js index 4b58ff0de17ee..df5ca7f837d10 100644 --- a/x-pack/plugins/index_management/public/application/sections/home/index_list/index_list.js +++ b/x-pack/plugins/index_management/public/application/sections/home/index_list/index_list.js @@ -8,15 +8,10 @@ import React from 'react'; import { DetailPanel } from './detail_panel'; import { IndexTable } from './index_table'; -export function IndexList({ - match: { - params: { filter }, - }, - location, -}) { +export function IndexList() { return (
- +
); diff --git a/x-pack/plugins/index_management/public/application/sections/home/index_list/index_table/index_table.container.js b/x-pack/plugins/index_management/public/application/sections/home/index_list/index_table/index_table.container.js index 44d811f490d9d..9a44a02a44f87 100644 --- a/x-pack/plugins/index_management/public/application/sections/home/index_list/index_table/index_table.container.js +++ b/x-pack/plugins/index_management/public/application/sections/home/index_list/index_table/index_table.container.js @@ -5,13 +5,13 @@ */ import { connect } from 'react-redux'; +import { withRouter } from 'react-router-dom'; import { getDetailPanelIndexName, getPageOfIndices, getPager, getFilter, isDetailPanelOpen, - showHiddenIndices, getSortField, isSortAscending, getIndicesAsArray, @@ -26,7 +26,6 @@ import { pageChanged, pageSizeChanged, sortChanged, - showHiddenIndicesChanged, loadIndices, reloadIndices, toggleChanged, @@ -34,15 +33,14 @@ import { import { IndexTable as PresentationComponent } from './index_table'; -const mapStateToProps = (state) => { +const mapStateToProps = (state, props) => { return { allIndices: getIndicesAsArray(state), isDetailPanelOpen: isDetailPanelOpen(state), detailPanelIndexName: getDetailPanelIndexName(state), - indices: getPageOfIndices(state), - pager: getPager(state), + indices: getPageOfIndices(state, props), + pager: getPager(state, props), filter: getFilter(state), - showHiddenIndices: showHiddenIndices(state), sortField: getSortField(state), isSortAscending: isSortAscending(state), indicesLoading: indicesLoading(state), @@ -65,9 +63,6 @@ const mapDispatchToProps = (dispatch) => { sortChanged: (sortField, isSortAscending) => { dispatch(sortChanged({ sortField, isSortAscending })); }, - showHiddenIndicesChanged: (showHiddenIndices) => { - dispatch(showHiddenIndicesChanged({ showHiddenIndices })); - }, toggleChanged: (toggleName, toggleValue) => { dispatch(toggleChanged({ toggleName, toggleValue })); }, @@ -80,10 +75,12 @@ const mapDispatchToProps = (dispatch) => { loadIndices: () => { dispatch(loadIndices()); }, - reloadIndices: () => { - dispatch(reloadIndices()); + reloadIndices: (indexNames) => { + dispatch(reloadIndices(indexNames)); }, }; }; -export const IndexTable = connect(mapStateToProps, mapDispatchToProps)(PresentationComponent); +export const IndexTable = withRouter( + connect(mapStateToProps, mapDispatchToProps)(PresentationComponent) +); diff --git a/x-pack/plugins/index_management/public/application/sections/home/index_list/index_table/index_table.js b/x-pack/plugins/index_management/public/application/sections/home/index_list/index_table/index_table.js index 0d005b2864863..f33d486520a29 100644 --- a/x-pack/plugins/index_management/public/application/sections/home/index_list/index_table/index_table.js +++ b/x-pack/plugins/index_management/public/application/sections/home/index_list/index_table/index_table.js @@ -8,7 +8,7 @@ import React, { Component, Fragment } from 'react'; import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n/react'; import { Route } from 'react-router-dom'; -import { parse } from 'query-string'; +import qs from 'query-string'; import { EuiButton, @@ -66,6 +66,9 @@ const HEADERS = { size: i18n.translate('xpack.idxMgmt.indexTable.headers.storageSizeHeader', { defaultMessage: 'Storage size', }), + data_stream: i18n.translate('xpack.idxMgmt.indexTable.headers.dataStreamHeader', { + defaultMessage: 'Data stream', + }), }; export class IndexTable extends Component { @@ -97,17 +100,14 @@ export class IndexTable extends Component { componentDidMount() { this.props.loadIndices(); - this.interval = setInterval(this.props.reloadIndices, REFRESH_RATE_INDEX_LIST); - const { - filterChanged, - filterFromURI, - showHiddenIndicesChanged, - showHiddenIndices, - location, - } = this.props; - - if (filterFromURI) { - const decodedFilter = decodeURIComponent(filterFromURI); + this.interval = setInterval( + () => this.props.reloadIndices(this.props.indices.map((i) => i.name)), + REFRESH_RATE_INDEX_LIST + ); + const { location, filterChanged } = this.props; + const { filter } = qs.parse((location && location.search) || ''); + if (filter) { + const decodedFilter = decodeURIComponent(filter); try { const filter = EuiSearchBar.Query.parse(decodedFilter); @@ -116,17 +116,30 @@ export class IndexTable extends Component { this.setState({ filterError: e }); } } - - // Check if the we have the includeHidden query param - const { includeHidden } = parse((location && location.search) || ''); - const nextValue = includeHidden === 'true'; - if (nextValue !== showHiddenIndices) { - showHiddenIndicesChanged(nextValue); - } } componentWillUnmount() { clearInterval(this.interval); } + + readURLParams() { + const { location } = this.props; + const { includeHiddenIndices } = qs.parse((location && location.search) || ''); + return { + includeHiddenIndices: includeHiddenIndices === 'true', + }; + } + + setIncludeHiddenParam(hidden) { + const { pathname, search } = this.props.location; + const params = qs.parse(search); + if (hidden) { + params.includeHiddenIndices = 'true'; + } else { + delete params.includeHiddenIndices; + } + this.props.history.push(pathname + '?' + qs.stringify(params)); + } + onSort = (column) => { const { sortField, isSortAscending, sortChanged } = this.props; @@ -416,8 +429,6 @@ export class IndexTable extends Component { render() { const { filter, - showHiddenIndices, - showHiddenIndicesChanged, indices, loadIndices, indicesLoading, @@ -426,6 +437,8 @@ export class IndexTable extends Component { pager, } = this.props; + const { includeHiddenIndices } = this.readURLParams(); + let emptyState; if (indicesLoading) { @@ -477,8 +490,8 @@ export class IndexTable extends Component { showHiddenIndicesChanged(event.target.checked)} + checked={includeHiddenIndices} + onChange={(event) => this.setIncludeHiddenParam(event.target.checked)} label={ { diff --git a/x-pack/plugins/index_management/public/application/store/actions/reload_indices.js b/x-pack/plugins/index_management/public/application/store/actions/reload_indices.js index 11329ece8f59f..d70e811ff24e5 100644 --- a/x-pack/plugins/index_management/public/application/store/actions/reload_indices.js +++ b/x-pack/plugins/index_management/public/application/store/actions/reload_indices.js @@ -6,15 +6,13 @@ import { createAction } from 'redux-actions'; import { i18n } from '@kbn/i18n'; -import { getIndexNamesForCurrentPage } from '../selectors'; import { reloadIndices as request } from '../../services'; import { loadIndices } from './load_indices'; import { notificationService } from '../../services/notification'; export const reloadIndicesSuccess = createAction('INDEX_MANAGEMENT_RELOAD_INDICES_SUCCESS'); -export const reloadIndices = (indexNames) => async (dispatch, getState) => { +export const reloadIndices = (indexNames) => async (dispatch) => { let indices; - indexNames = indexNames || getIndexNamesForCurrentPage(getState()); try { indices = await request(indexNames); } catch (error) { diff --git a/x-pack/plugins/index_management/public/application/store/actions/table_state.js b/x-pack/plugins/index_management/public/application/store/actions/table_state.js index 70e0de74d0278..2127d8cd36b1e 100644 --- a/x-pack/plugins/index_management/public/application/store/actions/table_state.js +++ b/x-pack/plugins/index_management/public/application/store/actions/table_state.js @@ -17,8 +17,4 @@ export const pageSizeChanged = createAction('INDEX_MANAGEMENT_PAGE_SIZE_CHANGED' export const sortChanged = createAction('INDEX_MANAGEMENT_SORT_CHANGED'); -export const showHiddenIndicesChanged = createAction( - 'INDEX_MANAGEMENT_SHOW_HIDDEN_INDICES_CHANGED' -); - export const toggleChanged = createAction('INDEX_MANAGEMENT_TOGGLE_CHANGED'); diff --git a/x-pack/plugins/index_management/public/application/store/middlewares/sync_url_hash_query_param.js.ts b/x-pack/plugins/index_management/public/application/store/middlewares/sync_url_hash_query_param.js.ts deleted file mode 100644 index 145b4b6c9a8bc..0000000000000 --- a/x-pack/plugins/index_management/public/application/store/middlewares/sync_url_hash_query_param.js.ts +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License; - * you may not use this file except in compliance with the Elastic License. - */ -import * as q from 'query-string'; -import { Middleware } from 'redux'; -// @ts-ignore -import { showHiddenIndicesChanged } from '../actions'; - -export const syncUrlHashQueryParam: Middleware = () => (next) => (action) => { - if (action.type === String(showHiddenIndicesChanged)) { - const { url, query } = q.parseUrl(window.location.hash); - if (action.payload.showHiddenIndices) { - query.includeHidden = 'true'; - } else { - delete query.includeHidden; - } - window.location.hash = url + '?' + q.stringify(query); - } - next(action); -}; diff --git a/x-pack/plugins/index_management/public/application/store/reducers/table_state.js b/x-pack/plugins/index_management/public/application/store/reducers/table_state.js index e90fa72aa62fe..bfb37aa56b129 100644 --- a/x-pack/plugins/index_management/public/application/store/reducers/table_state.js +++ b/x-pack/plugins/index_management/public/application/store/reducers/table_state.js @@ -10,7 +10,6 @@ import { pageChanged, pageSizeChanged, sortChanged, - showHiddenIndicesChanged, toggleChanged, } from '../actions'; @@ -20,7 +19,6 @@ export const defaultTableState = { currentPage: 0, sortField: 'index.name', isSortAscending: true, - showHiddenIndices: false, }; export const tableState = handleActions( @@ -33,14 +31,6 @@ export const tableState = handleActions( currentPage: 0, }; }, - [showHiddenIndicesChanged](state, action) { - const { showHiddenIndices } = action.payload; - - return { - ...state, - showHiddenIndices, - }; - }, [toggleChanged](state, action) { const { toggleName, toggleValue } = action.payload; const toggleNameToVisibleMap = { ...state.toggleNameToVisibleMap }; diff --git a/x-pack/plugins/index_management/public/application/store/selectors/index.d.ts b/x-pack/plugins/index_management/public/application/store/selectors/index.d.ts index 999b11c5d6665..37aaea0e7e3d8 100644 --- a/x-pack/plugins/index_management/public/application/store/selectors/index.d.ts +++ b/x-pack/plugins/index_management/public/application/store/selectors/index.d.ts @@ -6,3 +6,5 @@ import { ExtensionsService } from '../../../services'; export declare function setExtensionsService(extensionsService: ExtensionsService): any; + +export const getFilteredIndices: (state: any, props: any) => any; diff --git a/x-pack/plugins/index_management/public/application/store/selectors/index.js b/x-pack/plugins/index_management/public/application/store/selectors/index.js index c1011680d4da2..c80658581dbee 100644 --- a/x-pack/plugins/index_management/public/application/store/selectors/index.js +++ b/x-pack/plugins/index_management/public/application/store/selectors/index.js @@ -6,6 +6,7 @@ import { Pager, EuiSearchBar } from '@elastic/eui'; import { createSelector } from 'reselect'; +import * as qs from 'query-string'; import { indexStatusLabels } from '../../lib/index_status_labels'; import { sortTable } from '../../services'; @@ -35,6 +36,7 @@ export const getIndexByIndexName = (state, name) => getIndices(state)[name]; export const getFilteredIds = (state) => state.indices.filteredIds; export const getRowStatuses = (state) => state.rowStatus; export const getTableState = (state) => state.tableState; +export const getTableLocationProp = (_, props) => props.location; export const getAllIds = (state) => state.indices.allIds; export const getIndexStatusByIndexName = (state, indexName) => { const indices = getIndices(state); @@ -79,18 +81,24 @@ const filterByToggles = (indices, toggleNameToVisibleMap) => { }); }); }; -const getFilteredIndices = createSelector( + +export const getFilteredIndices = createSelector( getIndices, getAllIds, getTableState, - (indices, allIds, tableState) => { + getTableLocationProp, + (indices, allIds, tableState, tableLocation) => { let indexArray = allIds.map((indexName) => indices[indexName]); indexArray = filterByToggles(indexArray, tableState.toggleNameToVisibleMap); - const systemFilteredIndexes = tableState.showHiddenIndices + const { includeHiddenIndices: includeHiddenParam } = qs.parse(tableLocation.search); + const includeHidden = includeHiddenParam === 'true'; + const filteredIndices = includeHidden ? indexArray - : indexArray.filter((index) => !(index.name + '').startsWith('.') && !index.hidden); + : indexArray.filter((index) => { + return !(index.name + '').startsWith('.') && !index.hidden; + }); const filter = tableState.filter || EuiSearchBar.Query.MATCH_ALL; - return EuiSearchBar.Query.execute(filter, systemFilteredIndexes, { + return EuiSearchBar.Query.execute(filter, filteredIndices, { defaultFields: defaultFilterFields, }); } @@ -133,29 +141,8 @@ export const getPageOfIndices = createSelector( } ); -export const getIndexNamesForCurrentPage = createSelector(getPageOfIndices, (pageOfIndices) => { - return pageOfIndices.map((index) => index.name); -}); - -export const getHasNextPage = createSelector(getPager, (pager) => { - return pager.hasNextPage; -}); - -export const getHasPreviousPage = createSelector(getPager, (pager) => { - return pager.hasPreviousPage; -}); - -export const getCurrentPage = createSelector(getPager, (pager) => { - return pager.currentPage; -}); - export const getFilter = createSelector(getTableState, ({ filter }) => filter); -export const showHiddenIndices = createSelector( - getTableState, - ({ showHiddenIndices }) => showHiddenIndices -); - export const isSortAscending = createSelector( getTableState, ({ isSortAscending }) => isSortAscending diff --git a/x-pack/plugins/index_management/public/application/store/selectors/indices_filter.test.ts b/x-pack/plugins/index_management/public/application/store/selectors/indices_filter.test.ts new file mode 100644 index 0000000000000..f230ddd18e9eb --- /dev/null +++ b/x-pack/plugins/index_management/public/application/store/selectors/indices_filter.test.ts @@ -0,0 +1,49 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ +import { ExtensionsService } from '../../../services'; +import { getFilteredIndices, setExtensionsService } from '.'; +// @ts-ignore +import { defaultTableState } from '../reducers/table_state'; + +describe('getFilteredIndices selector', () => { + let extensionService: ExtensionsService; + beforeAll(() => { + extensionService = new ExtensionsService(); + extensionService.setup(); + setExtensionsService(extensionService); + }); + + const state = { + tableState: { ...defaultTableState }, + indices: { + byId: { + test: { name: 'index1', hidden: true }, + anotherTest: { name: 'index2', hidden: false }, + aTest: { name: 'index3' }, + aFinalTest: { name: '.index4' }, + }, + allIds: ['test', 'anotherTest', 'aTest', 'aFinalTest'], + }, + }; + + it('filters out hidden indices', () => { + expect(getFilteredIndices(state, { location: { search: '' } })).toEqual([ + { name: 'index2', hidden: false }, + { name: 'index3' }, + ]); + }); + + it('includes hidden indices', () => { + expect( + getFilteredIndices(state, { location: { search: '?includeHiddenIndices=true' } }) + ).toEqual([ + { name: 'index1', hidden: true }, + { name: 'index2', hidden: false }, + { name: 'index3' }, + { name: '.index4' }, + ]); + }); +}); diff --git a/x-pack/plugins/index_management/public/application/store/store.js b/x-pack/plugins/index_management/public/application/store/store.js index d2f24d50941c6..b189a7cf38938 100644 --- a/x-pack/plugins/index_management/public/application/store/store.js +++ b/x-pack/plugins/index_management/public/application/store/store.js @@ -9,7 +9,6 @@ import thunk from 'redux-thunk'; import { defaultTableState } from './reducers/table_state'; import { getReducer } from './reducers/'; -import { syncUrlHashQueryParam } from './middlewares'; export function indexManagementStore(services) { const toggleNameToVisibleMap = {}; @@ -17,7 +16,7 @@ export function indexManagementStore(services) { toggleNameToVisibleMap[toggleExtension.name] = false; }); const initialState = { tableState: { ...defaultTableState, toggleNameToVisibleMap } }; - const enhancers = [applyMiddleware(thunk, syncUrlHashQueryParam)]; + const enhancers = [applyMiddleware(thunk)]; window.__REDUX_DEVTOOLS_EXTENSION__ && enhancers.push(window.__REDUX_DEVTOOLS_EXTENSION__()); return createStore(getReducer(services), initialState, compose(...enhancers)); diff --git a/x-pack/plugins/index_management/server/lib/fetch_indices.ts b/x-pack/plugins/index_management/server/lib/fetch_indices.ts index b52a63a414967..ae10629e069e8 100644 --- a/x-pack/plugins/index_management/server/lib/fetch_indices.ts +++ b/x-pack/plugins/index_management/server/lib/fetch_indices.ts @@ -23,6 +23,7 @@ interface Hit { interface IndexInfo { aliases: { [aliasName: string]: unknown }; mappings: unknown; + data_stream?: string; settings: { index: { hidden: 'true' | 'false'; @@ -87,6 +88,7 @@ async function fetchIndicesCall( isFrozen: hit.sth === 'true', // sth value coming back as a string from ES aliases: aliases.length ? aliases : 'none', hidden: index.settings.index.hidden === 'true', + data_stream: index.data_stream, }; }); } diff --git a/x-pack/plugins/index_management/server/types.ts b/x-pack/plugins/index_management/server/types.ts index b7b1c57b6f04e..b3fb546281f1e 100644 --- a/x-pack/plugins/index_management/server/types.ts +++ b/x-pack/plugins/index_management/server/types.ts @@ -32,6 +32,7 @@ export interface Index { size: any; isFrozen: boolean; aliases: string | string[]; + data_stream?: string; [key: string]: any; } diff --git a/x-pack/plugins/infra/common/http_api/snapshot_api.ts b/x-pack/plugins/infra/common/http_api/snapshot_api.ts index 6b666b39b0094..1c7dfed82783a 100644 --- a/x-pack/plugins/infra/common/http_api/snapshot_api.ts +++ b/x-pack/plugins/infra/common/http_api/snapshot_api.ts @@ -6,6 +6,7 @@ import * as rt from 'io-ts'; import { SnapshotMetricTypeRT, ItemTypeRT } from '../inventory_models/types'; +import { metricsExplorerSeriesRT } from './metrics_explorer'; export const SnapshotNodePathRT = rt.intersection([ rt.type({ @@ -21,6 +22,7 @@ const SnapshotNodeMetricOptionalRT = rt.partial({ value: rt.union([rt.number, rt.null]), avg: rt.union([rt.number, rt.null]), max: rt.union([rt.number, rt.null]), + timeseries: metricsExplorerSeriesRT, }); const SnapshotNodeMetricRequiredRT = rt.type({ @@ -41,11 +43,18 @@ export const SnapshotNodeResponseRT = rt.type({ interval: rt.string, }); -export const InfraTimerangeInputRT = rt.type({ - interval: rt.string, - to: rt.number, - from: rt.number, -}); +export const InfraTimerangeInputRT = rt.intersection([ + rt.type({ + interval: rt.string, + to: rt.number, + from: rt.number, + }), + rt.partial({ + lookbackSize: rt.number, + ignoreLookback: rt.boolean, + forceInterval: rt.boolean, + }), +]); export const SnapshotGroupByRT = rt.array( rt.partial({ @@ -97,6 +106,7 @@ export const SnapshotRequestRT = rt.intersection([ accountId: rt.string, region: rt.string, filterQuery: rt.union([rt.string, rt.null]), + includeTimeseries: rt.boolean, }), ]); diff --git a/x-pack/plugins/infra/common/inventory_models/shared/components/metrics_and_groupby_toolbar_items.tsx b/x-pack/plugins/infra/common/inventory_models/shared/components/metrics_and_groupby_toolbar_items.tsx index fcb29e3eb1c02..9ddf422871d18 100644 --- a/x-pack/plugins/infra/common/inventory_models/shared/components/metrics_and_groupby_toolbar_items.tsx +++ b/x-pack/plugins/infra/common/inventory_models/shared/components/metrics_and_groupby_toolbar_items.tsx @@ -8,6 +8,7 @@ import React, { useMemo } from 'react'; import { EuiFlexItem } from '@elastic/eui'; // eslint-disable-next-line @kbn/eslint/no-restricted-paths import { WaffleSortControls } from '../../../../public/pages/metrics/inventory_view/components/waffle/waffle_sort_controls'; +// eslint-disable-next-line @kbn/eslint/no-restricted-paths import { ToolbarProps } from '../../../../public/pages/metrics/inventory_view/components/toolbars/toolbar'; // eslint-disable-next-line @kbn/eslint/no-restricted-paths import { WaffleMetricControls } from '../../../../public/pages/metrics/inventory_view/components/waffle/metric_control'; diff --git a/x-pack/plugins/infra/public/pages/metrics/inventory_view/hooks/use_snaphot.ts b/x-pack/plugins/infra/public/pages/metrics/inventory_view/hooks/use_snaphot.ts index 3ec63d7b2de28..721a2d5792dca 100644 --- a/x-pack/plugins/infra/public/pages/metrics/inventory_view/hooks/use_snaphot.ts +++ b/x-pack/plugins/infra/public/pages/metrics/inventory_view/hooks/use_snaphot.ts @@ -14,6 +14,8 @@ import { SnapshotNodeResponseRT, SnapshotNodeResponse, SnapshotGroupBy, + SnapshotRequest, + InfraTimerangeInput, } from '../../../../../common/http_api/snapshot_api'; import { InventoryItemType, @@ -37,10 +39,11 @@ export function useSnapshot( ); }; - const timerange = { + const timerange: InfraTimerangeInput = { interval: '1m', to: currentTime, from: currentTime - 360 * 1000, + lookbackSize: 20, }; const { error, loading, response, makeRequest } = useHTTPRequest( @@ -55,7 +58,8 @@ export function useSnapshot( sourceId, accountId, region, - }), + includeTimeseries: true, + } as SnapshotRequest), decodeResponse ); diff --git a/x-pack/plugins/infra/server/lib/snapshot/create_timerange_with_interval.ts b/x-pack/plugins/infra/server/lib/snapshot/create_timerange_with_interval.ts index 924d12bec0c5c..d1a4ed431a2be 100644 --- a/x-pack/plugins/infra/server/lib/snapshot/create_timerange_with_interval.ts +++ b/x-pack/plugins/infra/server/lib/snapshot/create_timerange_with_interval.ts @@ -12,30 +12,48 @@ import { SnapshotModel, SnapshotModelMetricAggRT } from '../../../common/invento import { getDatasetForField } from '../../routes/metrics_explorer/lib/get_dataset_for_field'; import { InfraTimerangeInput } from '../../../common/http_api/snapshot_api'; import { ESSearchClient } from '.'; +import { getIntervalInSeconds } from '../../utils/get_interval_in_seconds'; -export const createTimeRangeWithInterval = async ( - client: ESSearchClient, - options: InfraSnapshotRequestOptions -): Promise => { +const createInterval = async (client: ESSearchClient, options: InfraSnapshotRequestOptions) => { + const { timerange } = options; + if (timerange.forceInterval && timerange.interval) { + return getIntervalInSeconds(timerange.interval); + } const aggregations = getMetricsAggregations(options); const modules = await aggregationsToModules(client, aggregations, options); - const interval = Math.max( + return Math.max( (await calculateMetricInterval( client, { indexPattern: options.sourceConfiguration.metricAlias, timestampField: options.sourceConfiguration.fields.timestamp, - timerange: { from: options.timerange.from, to: options.timerange.to }, + timerange: { from: timerange.from, to: timerange.to }, }, modules, options.nodeType )) || 60, 60 ); +}; + +export const createTimeRangeWithInterval = async ( + client: ESSearchClient, + options: InfraSnapshotRequestOptions +): Promise => { + const { timerange } = options; + const calculatedInterval = await createInterval(client, options); + if (timerange.ignoreLookback) { + return { + interval: `${calculatedInterval}s`, + from: timerange.from, + to: timerange.to, + }; + } + const lookbackSize = Math.max(timerange.lookbackSize || 5, 5); return { - interval: `${interval}s`, - from: options.timerange.to - interval * 5000, // We need at least 5 buckets worth of data - to: options.timerange.to, + interval: `${calculatedInterval}s`, + from: timerange.to - calculatedInterval * lookbackSize * 1000, // We need at least 5 buckets worth of data + to: timerange.to, }; }; diff --git a/x-pack/plugins/infra/server/lib/snapshot/response_helpers.ts b/x-pack/plugins/infra/server/lib/snapshot/response_helpers.ts index 031eb881c91aa..6cb415d8e7ac4 100644 --- a/x-pack/plugins/infra/server/lib/snapshot/response_helpers.ts +++ b/x-pack/plugins/infra/server/lib/snapshot/response_helpers.ts @@ -7,6 +7,7 @@ import { isNumber, last, max, sum, get } from 'lodash'; import moment from 'moment'; +import { MetricsExplorerSeries } from '../../../common/http_api/metrics_explorer'; import { getIntervalInSeconds } from '../../utils/get_interval_in_seconds'; import { InfraSnapshotRequestOptions } from './types'; import { findInventoryModel } from '../../../common/inventory_models'; @@ -127,12 +128,15 @@ export const getNodeMetrics = ( }; } const lastBucket = findLastFullBucket(nodeBuckets, options); - const result = { + const result: SnapshotNodeMetric = { name: options.metric.type, value: getMetricValueFromBucket(options.metric.type, lastBucket), max: calculateMax(nodeBuckets, options.metric.type), avg: calculateAvg(nodeBuckets, options.metric.type), }; + if (options.includeTimeseries) { + result.timeseries = getTimeseriesData(nodeBuckets, options.metric.type); + } return result; }; @@ -164,3 +168,20 @@ function calculateMax(buckets: InfraSnapshotMetricsBucket[], type: SnapshotMetri function calculateAvg(buckets: InfraSnapshotMetricsBucket[], type: SnapshotMetricType) { return sum(buckets.map((bucket) => getMetricValueFromBucket(type, bucket))) / buckets.length || 0; } + +function getTimeseriesData( + buckets: InfraSnapshotMetricsBucket[], + type: SnapshotMetricType +): MetricsExplorerSeries { + return { + id: type, + columns: [ + { name: 'timestamp', type: 'date' }, + { name: 'metric_0', type: 'number' }, + ], + rows: buckets.map((bucket) => ({ + timestamp: bucket.key as number, + metric_0: getMetricValueFromBucket(type, bucket), + })), + }; +} diff --git a/x-pack/plugins/infra/server/routes/snapshot/index.ts b/x-pack/plugins/infra/server/routes/snapshot/index.ts index 2d951d426b03a..3a0326fb6ae84 100644 --- a/x-pack/plugins/infra/server/routes/snapshot/index.ts +++ b/x-pack/plugins/infra/server/routes/snapshot/index.ts @@ -39,6 +39,7 @@ export const initSnapshotRoute = (libs: InfraBackendLibs) => { timerange, accountId, region, + includeTimeseries, } = pipe( SnapshotRequestRT.decode(request.body), fold(throwErrors(Boom.badRequest), identity) @@ -57,6 +58,7 @@ export const initSnapshotRoute = (libs: InfraBackendLibs) => { sourceConfiguration: source.configuration, metric, timerange, + includeTimeseries, }; const searchES = ( diff --git a/x-pack/plugins/ingest_manager/public/applications/ingest_manager/hooks/index.ts b/x-pack/plugins/ingest_manager/public/applications/ingest_manager/hooks/index.ts index 31a511f2d79dc..6ebfd3f28fd9b 100644 --- a/x-pack/plugins/ingest_manager/public/applications/ingest_manager/hooks/index.ts +++ b/x-pack/plugins/ingest_manager/public/applications/ingest_manager/hooks/index.ts @@ -5,7 +5,7 @@ */ export { useCapabilities } from './use_capabilities'; -export { useCore, CoreContext } from './use_core'; +export { useCore } from './use_core'; export { useConfig, ConfigContext } from './use_config'; export { useSetupDeps, useStartDeps, DepsContext } from './use_deps'; export { useBreadcrumbs } from './use_breadcrumbs'; diff --git a/x-pack/plugins/ingest_manager/public/applications/ingest_manager/hooks/use_core.ts b/x-pack/plugins/ingest_manager/public/applications/ingest_manager/hooks/use_core.ts index f4e9a032b925a..9ce1e95aa91d5 100644 --- a/x-pack/plugins/ingest_manager/public/applications/ingest_manager/hooks/use_core.ts +++ b/x-pack/plugins/ingest_manager/public/applications/ingest_manager/hooks/use_core.ts @@ -4,15 +4,13 @@ * you may not use this file except in compliance with the Elastic License. */ -import React, { useContext } from 'react'; -import { CoreStart } from 'src/core/public'; +import { CoreStart } from 'kibana/public'; +import { useKibana } from '../../../../../../../src/plugins/kibana_react/public'; -export const CoreContext = React.createContext(null); - -export function useCore() { - const core = useContext(CoreContext); - if (core === null) { - throw new Error('CoreContext not initialized'); +export function useCore(): CoreStart { + const { services } = useKibana(); + if (services === null) { + throw new Error('KibanaContextProvider not initialized'); } - return core; + return services; } diff --git a/x-pack/plugins/ingest_manager/public/applications/ingest_manager/index.tsx b/x-pack/plugins/ingest_manager/public/applications/ingest_manager/index.tsx index f6a386314272f..ed5a75ce6c991 100644 --- a/x-pack/plugins/ingest_manager/public/applications/ingest_manager/index.tsx +++ b/x-pack/plugins/ingest_manager/public/applications/ingest_manager/index.tsx @@ -22,11 +22,12 @@ import { PAGE_ROUTING_PATHS } from './constants'; import { DefaultLayout, WithoutHeaderLayout } from './layouts'; import { Loading, Error } from './components'; import { IngestManagerOverview, EPMApp, AgentConfigApp, FleetApp, DataStreamApp } from './sections'; -import { CoreContext, DepsContext, ConfigContext, setHttpClient, useConfig } from './hooks'; +import { DepsContext, ConfigContext, setHttpClient, useConfig } from './hooks'; import { PackageInstallProvider } from './sections/epm/hooks'; import { useCore, sendSetup, sendGetPermissionsCheck } from './hooks'; import { FleetStatusProvider } from './hooks/use_fleet_status'; import './index.scss'; +import { KibanaContextProvider } from '../../../../../../src/plugins/kibana_react/public'; export interface ProtectedRouteProps extends RouteProps { isAllowed?: boolean; @@ -229,7 +230,7 @@ const IngestManagerApp = ({ const isDarkMode = useObservable(coreStart.uiSettings.get$('theme:darkMode')); return ( - + @@ -237,7 +238,7 @@ const IngestManagerApp = ({ - + ); }; diff --git a/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/agent_config/create_datasource_page/components/custom_configure_datasource.tsx b/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/agent_config/create_datasource_page/components/custom_configure_datasource.tsx new file mode 100644 index 0000000000000..aff764cb8ba3e --- /dev/null +++ b/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/agent_config/create_datasource_page/components/custom_configure_datasource.tsx @@ -0,0 +1,61 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ +import React from 'react'; +import { FormattedMessage } from '@kbn/i18n/react'; +import { EuiEmptyPrompt, EuiText } from '@elastic/eui'; +import { NewDatasource } from '../../../../types'; +import { CreateDatasourceFrom } from '../types'; + +export interface CustomConfigureDatasourceProps { + packageName: string; + from: CreateDatasourceFrom; + datasource: NewDatasource | (NewDatasource & { id: string }); +} + +/** + * Custom content type that external plugins can provide to Ingest's + * Datasource configuration. + */ +export type CustomConfigureDatasourceContent = React.FC; + +type AllowedDatasourceKey = 'endpoint'; +const ConfigureDatasourceMapping: { + [key: string]: CustomConfigureDatasourceContent; +} = {}; + +/** + * Plugins can call this function from the start lifecycle to + * register a custom component in the Ingest Datasource configuration. + */ +export function registerDatasource( + key: AllowedDatasourceKey, + value: CustomConfigureDatasourceContent +) { + ConfigureDatasourceMapping[key] = value; +} + +const EmptyConfigureDatasource: CustomConfigureDatasourceContent = () => ( + +

+ +

+ + } + /> +); + +export const CustomConfigureDatasource = (props: CustomConfigureDatasourceProps) => { + const ConfigureDatasourceContent = + ConfigureDatasourceMapping[props.packageName] || EmptyConfigureDatasource; + return ; +}; diff --git a/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/agent_config/create_datasource_page/components/index.ts b/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/agent_config/create_datasource_page/components/index.ts index 3bfca75668911..42848cc0f5e41 100644 --- a/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/agent_config/create_datasource_page/components/index.ts +++ b/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/agent_config/create_datasource_page/components/index.ts @@ -6,3 +6,4 @@ export { CreateDatasourcePageLayout } from './layout'; export { DatasourceInputPanel } from './datasource_input_panel'; export { DatasourceInputVarField } from './datasource_input_var_field'; +export { CustomConfigureDatasource } from './custom_configure_datasource'; diff --git a/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/agent_config/create_datasource_page/step_configure_datasource.tsx b/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/agent_config/create_datasource_page/step_configure_datasource.tsx index 58a98f86de426..d9cf0fbfb7987 100644 --- a/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/agent_config/create_datasource_page/step_configure_datasource.tsx +++ b/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/agent_config/create_datasource_page/step_configure_datasource.tsx @@ -5,28 +5,29 @@ */ import React from 'react'; import { FormattedMessage } from '@kbn/i18n/react'; -import { - EuiPanel, - EuiFlexGroup, - EuiFlexItem, - EuiSpacer, - EuiEmptyPrompt, - EuiText, - EuiCallOut, -} from '@elastic/eui'; +import { EuiPanel, EuiFlexGroup, EuiFlexItem, EuiSpacer, EuiCallOut } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import { PackageInfo, NewDatasource, DatasourceInput } from '../../../types'; import { Loading } from '../../../components'; import { DatasourceValidationResults, validationHasErrors } from './services'; -import { DatasourceInputPanel } from './components'; +import { DatasourceInputPanel, CustomConfigureDatasource } from './components'; +import { CreateDatasourceFrom } from './types'; export const StepConfigureDatasource: React.FunctionComponent<{ + from?: CreateDatasourceFrom; packageInfo: PackageInfo; - datasource: NewDatasource; + datasource: NewDatasource | (NewDatasource & { id: string }); updateDatasource: (fields: Partial) => void; validationResults: DatasourceValidationResults; submitAttempted: boolean; -}> = ({ packageInfo, datasource, updateDatasource, validationResults, submitAttempted }) => { +}> = ({ + from = 'config', + packageInfo, + datasource, + updateDatasource, + validationResults, + submitAttempted, +}) => { const hasErrors = validationResults ? validationHasErrors(validationResults) : false; // Configure inputs (and their streams) @@ -68,19 +69,10 @@ export const StepConfigureDatasource: React.FunctionComponent<{ ) : ( - -

- -

- - } +
); diff --git a/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/agent_config/edit_datasource_page/index.tsx b/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/agent_config/edit_datasource_page/index.tsx index 7be955bc9f4f3..4bb42faedf7f6 100644 --- a/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/agent_config/edit_datasource_page/index.tsx +++ b/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/agent_config/edit_datasource_page/index.tsx @@ -69,7 +69,8 @@ export const EditDatasourcePage: React.FunctionComponent = () => { const [loadingError, setLoadingError] = useState(); const [agentConfig, setAgentConfig] = useState(); const [packageInfo, setPackageInfo] = useState(); - const [datasource, setDatasource] = useState({ + const [datasource, setDatasource] = useState({ + id: '', name: '', description: '', config_id: '', @@ -93,7 +94,6 @@ export const EditDatasourcePage: React.FunctionComponent = () => { } if (datasourceData?.item) { const { - id, revision, inputs, created_by, @@ -299,6 +299,7 @@ export const EditDatasourcePage: React.FunctionComponent = () => { ), children: ( { return new IngestManagerPlugin(initializerContext); }; + +export { + CustomConfigureDatasourceContent, + CustomConfigureDatasourceProps, + registerDatasource, +} from './applications/ingest_manager/sections/agent_config/create_datasource_page/components/custom_configure_datasource'; + +export { NewDatasource } from './applications/ingest_manager/types'; diff --git a/x-pack/plugins/ingest_manager/public/plugin.ts b/x-pack/plugins/ingest_manager/public/plugin.ts index fd4e08f619495..3eb2fad339b7d 100644 --- a/x-pack/plugins/ingest_manager/public/plugin.ts +++ b/x-pack/plugins/ingest_manager/public/plugin.ts @@ -18,6 +18,7 @@ import { PLUGIN_ID } from '../common/constants'; import { IngestManagerConfigType } from '../common/types'; import { setupRouteService, appRoutesService } from '../common'; +import { registerDatasource } from './applications/ingest_manager/sections/agent_config/create_datasource_page/components/custom_configure_datasource'; export { IngestManagerConfigType } from '../common/types'; @@ -26,6 +27,7 @@ export type IngestManagerSetup = void; * Describes public IngestManager plugin contract returned at the `start` stage. */ export interface IngestManagerStart { + registerDatasource: typeof registerDatasource; success: boolean; error?: { message: string; @@ -80,12 +82,16 @@ export class IngestManagerPlugin const permissionsResponse = await core.http.get(appRoutesService.getCheckPermissionsPath()); if (permissionsResponse.success) { const { isInitialized: success } = await core.http.post(setupRouteService.getSetupPath()); - return { success }; + return { success, registerDatasource }; } else { throw new Error(permissionsResponse.error); } } catch (error) { - return { success: false, error: { message: error.body?.message || 'Unknown error' } }; + return { + success: false, + error: { message: error.body?.message || 'Unknown error' }, + registerDatasource, + }; } } diff --git a/x-pack/plugins/lists/common/siem_common_deps.ts b/x-pack/plugins/lists/common/siem_common_deps.ts index eb4b393a36da3..9de40e3f72932 100644 --- a/x-pack/plugins/lists/common/siem_common_deps.ts +++ b/x-pack/plugins/lists/common/siem_common_deps.ts @@ -4,5 +4,5 @@ * you may not use this file except in compliance with the Elastic License. */ -export { exactCheck } from '../../siem/common/exact_check'; -export { getPaths, foldLeftRight } from '../../siem/common/test_utils'; +export { exactCheck } from '../../security_solution/common/exact_check'; +export { getPaths, foldLeftRight } from '../../security_solution/common/test_utils'; diff --git a/x-pack/plugins/lists/server/siem_server_deps.ts b/x-pack/plugins/lists/server/siem_server_deps.ts index 81ebe9f17b06f..df4b07fc46322 100644 --- a/x-pack/plugins/lists/server/siem_server_deps.ts +++ b/x-pack/plugins/lists/server/siem_server_deps.ts @@ -18,4 +18,4 @@ export { getIndexExists, buildRouteValidation, validate, -} from '../../siem/server'; +} from '../../security_solution/server'; diff --git a/x-pack/plugins/maps/common/descriptor_types/data_request_descriptor_types.d.ts b/x-pack/plugins/maps/common/descriptor_types/data_request_descriptor_types.d.ts index 4f61d7501f977..c7bfe94742bd6 100644 --- a/x-pack/plugins/maps/common/descriptor_types/data_request_descriptor_types.d.ts +++ b/x-pack/plugins/maps/common/descriptor_types/data_request_descriptor_types.d.ts @@ -7,7 +7,7 @@ import { RENDER_AS, SORT_ORDER, SCALING_TYPES } from '../constants'; import { MapExtent, MapQuery } from './map_descriptor'; -import { Filter, TimeRange } from '../../../../../src/plugins/data/public'; +import { Filter, TimeRange } from '../../../../../src/plugins/data/common'; // Global map state passed to every layer. export type MapFilters = { diff --git a/x-pack/plugins/maps/common/descriptor_types/map_descriptor.ts b/x-pack/plugins/maps/common/descriptor_types/map_descriptor.ts index 798b5f335dda2..00380ca12a486 100644 --- a/x-pack/plugins/maps/common/descriptor_types/map_descriptor.ts +++ b/x-pack/plugins/maps/common/descriptor_types/map_descriptor.ts @@ -5,7 +5,7 @@ */ /* eslint-disable @typescript-eslint/consistent-type-definitions */ -import { Query } from '../../../../../src/plugins/data/public'; +import { Query } from '../../../../../src/plugins/data/common'; import { DRAW_TYPE, ES_GEO_FIELD_TYPE, ES_SPATIAL_RELATIONS } from '../constants'; export type MapExtent = { diff --git a/x-pack/plugins/maps/public/connected_components/gis_map/view.js b/x-pack/plugins/maps/public/connected_components/gis_map/view.js index f733d08cf0b71..122f5cdd45c1c 100644 --- a/x-pack/plugins/maps/public/connected_components/gis_map/view.js +++ b/x-pack/plugins/maps/public/connected_components/gis_map/view.js @@ -64,7 +64,7 @@ export class GisMap extends Component { // - If it's not, then reporting injects a listener into the browser for a custom "renderComplete" event. // - When that event is fired, we snapshot the viz and move on. // Failure to not have the dom attribute, or custom event, will timeout the job. - // See x-pack/legacy/plugins/reporting/export_types/common/lib/screenshots/wait_for_render.ts for more. + // See x-pack/plugins/reporting/export_types/common/lib/screenshots/wait_for_render.ts for more. _onInitialLoadRenderComplete = () => { const el = document.querySelector(`[data-dom-id="${this.state.domId}"]`); diff --git a/x-pack/plugins/ml/common/util/validators.ts b/x-pack/plugins/ml/common/util/validators.ts index 6f959c50219cf..5dcdec0553106 100644 --- a/x-pack/plugins/ml/common/util/validators.ts +++ b/x-pack/plugins/ml/common/util/validators.ts @@ -65,6 +65,8 @@ export function requiredValidator() { }; } +export type ValidationResult = object | null; + export function memoryInputValidator(allowedUnits = ALLOWED_DATA_UNITS) { return (value: any) => { if (typeof value !== 'string' || value === '') { diff --git a/x-pack/plugins/ml/public/application/explorer/explorer_charts/explorer_chart_distribution.js b/x-pack/plugins/ml/public/application/explorer/explorer_charts/explorer_chart_distribution.js index 6c7c3e9040216..7a18914957ba9 100644 --- a/x-pack/plugins/ml/public/application/explorer/explorer_charts/explorer_chart_distribution.js +++ b/x-pack/plugins/ml/public/application/explorer/explorer_charts/explorer_chart_distribution.js @@ -25,6 +25,7 @@ import { getTickValues, numTicksForDateFormat, removeLabelOverlap, + chartExtendedLimits, } from '../../util/chart_utils'; import { LoadingIndicator } from '../../components/loading_indicator/loading_indicator'; import { getTimeBucketsFromCache } from '../../util/time_buckets'; @@ -98,7 +99,7 @@ export class ExplorerChartDistribution extends React.Component { const filteredChartData = init(config); drawRareChart(filteredChartData); - function init({ chartData }) { + function init({ chartData, functionDescription }) { const $el = $('.ml-explorer-chart'); // Clear any existing elements from the visualization, @@ -137,22 +138,24 @@ export class ExplorerChartDistribution extends React.Component { }); if (chartType === CHART_TYPE.POPULATION_DISTRIBUTION) { - const focusData = chartData - .filter((d) => { - return d.entity === highlight; - }) - .map((d) => d.value); - const focusExtent = d3.extent(focusData); - + const focusData = chartData.filter((d) => { + return d.entity === highlight; + }); + // calculate the max y domain based on value, typical, and actual + // also sets the min to be at least 0 if the series function type is `count` + const { min: yScaleDomainMin, max: yScaleDomainMax } = chartExtendedLimits( + focusData, + functionDescription + ); // now again filter chartData to include only the data points within the domain chartData = chartData.filter((d) => { - return d.value <= focusExtent[1]; + return d.value <= yScaleDomainMax; }); lineChartYScale = d3.scale .linear() .range([chartHeight, 0]) - .domain([0, focusExtent[1]]) + .domain([yScaleDomainMin < 0 ? yScaleDomainMin : 0, yScaleDomainMax]) .nice(); } else if (chartType === CHART_TYPE.EVENT_DISTRIBUTION) { // avoid overflowing the border of the highlighted area diff --git a/x-pack/plugins/ml/public/application/util/chart_utils.js b/x-pack/plugins/ml/public/application/util/chart_utils.js index 2caf964cb9774..4ec7c5cb6d819 100644 --- a/x-pack/plugins/ml/public/application/util/chart_utils.js +++ b/x-pack/plugins/ml/public/application/util/chart_utils.js @@ -65,6 +65,44 @@ export function chartLimits(data = []) { return limits; } +export function chartExtendedLimits(data = [], functionDescription) { + let _min = Infinity; + let _max = -Infinity; + data.forEach((d) => { + let metricValue = d.value; + const actualValue = Array.isArray(d.actual) ? d.actual[0] : d.actual; + const typicalValue = Array.isArray(d.typical) ? d.typical[0] : d.typical; + + if (metricValue === null && d.anomalyScore !== undefined && d.actual !== undefined) { + // If an anomaly coincides with a gap in the data, use the anomaly actual value. + metricValue = actualValue; + } + + if (d.anomalyScore !== undefined) { + _min = Math.min(_min, metricValue, actualValue, typicalValue); + _max = Math.max(_max, metricValue, actualValue, typicalValue); + } else { + _min = Math.min(_min, metricValue); + _max = Math.max(_max, metricValue); + } + }); + const limits = { max: _max, min: _min }; + + // add padding of 5% of the difference between max and min + // if we ended up with the same value for both of them + if (limits.max === limits.min) { + const padding = limits.max * 0.05; + limits.max += padding; + limits.min -= padding; + } + + // makes sure the domain starts at 0 if the aggregation is by count + // since the number should always be positive + if (functionDescription === 'count' && limits.min < 0) { + limits.min = 0; + } + return limits; +} export function drawLineChartDots(data, lineChartGroup, lineChartValuesLine, radius = 1.5) { // We need to do this because when creating a line for a chart which has data gaps, // if there are single datapoints without any valid data before and after them, diff --git a/x-pack/plugins/painless_lab/public/application/components/output_pane/parameters_tab.tsx b/x-pack/plugins/painless_lab/public/application/components/output_pane/parameters_tab.tsx index 5a417933e8022..b707fd493bcdd 100644 --- a/x-pack/plugins/painless_lab/public/application/components/output_pane/parameters_tab.tsx +++ b/x-pack/plugins/painless_lab/public/application/components/output_pane/parameters_tab.tsx @@ -14,7 +14,7 @@ import { EuiText, } from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n/react'; -import { monaco } from '@kbn/ui-shared-deps/monaco'; +import { monaco } from '@kbn/monaco'; import { i18n } from '@kbn/i18n'; import { CodeEditor } from '../../../../../../../src/plugins/kibana_react/public'; diff --git a/x-pack/plugins/painless_lab/public/lib/monaco_painless_lang.ts b/x-pack/plugins/painless_lab/public/lib/monaco_painless_lang.ts index 602697064a768..4278c77b4c791 100644 --- a/x-pack/plugins/painless_lab/public/lib/monaco_painless_lang.ts +++ b/x-pack/plugins/painless_lab/public/lib/monaco_painless_lang.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import * as monaco from 'monaco-editor'; +import { monaco } from '@kbn/monaco'; /** * Extends the default type for a Monarch language so we can use diff --git a/x-pack/plugins/painless_lab/public/services/language_service.ts b/x-pack/plugins/painless_lab/public/services/language_service.ts index efff9cd0e78d5..68ac3ca290ad8 100644 --- a/x-pack/plugins/painless_lab/public/services/language_service.ts +++ b/x-pack/plugins/painless_lab/public/services/language_service.ts @@ -7,7 +7,7 @@ // It is important that we use this specific monaco instance so that // editor settings are registered against the instance our React component // uses. -import { monaco } from '@kbn/ui-shared-deps/monaco'; +import { monaco } from '@kbn/monaco'; // @ts-ignore import workerSrc from 'raw-loader!monaco-editor/min/vs/base/worker/workerMain.js'; diff --git a/x-pack/legacy/plugins/reporting/README.md b/x-pack/plugins/reporting/README.md similarity index 100% rename from x-pack/legacy/plugins/reporting/README.md rename to x-pack/plugins/reporting/README.md diff --git a/x-pack/legacy/plugins/reporting/common/constants.ts b/x-pack/plugins/reporting/common/constants.ts similarity index 100% rename from x-pack/legacy/plugins/reporting/common/constants.ts rename to x-pack/plugins/reporting/common/constants.ts diff --git a/x-pack/legacy/plugins/reporting/common/get_absolute_url.test.ts b/x-pack/plugins/reporting/common/get_absolute_url.test.ts similarity index 100% rename from x-pack/legacy/plugins/reporting/common/get_absolute_url.test.ts rename to x-pack/plugins/reporting/common/get_absolute_url.test.ts diff --git a/x-pack/legacy/plugins/reporting/common/get_absolute_url.ts b/x-pack/plugins/reporting/common/get_absolute_url.ts similarity index 100% rename from x-pack/legacy/plugins/reporting/common/get_absolute_url.ts rename to x-pack/plugins/reporting/common/get_absolute_url.ts diff --git a/x-pack/plugins/reporting/common/index.ts b/x-pack/plugins/reporting/common/index.ts index 36c896fb4f7b8..cda8934fc8bf6 100644 --- a/x-pack/plugins/reporting/common/index.ts +++ b/x-pack/plugins/reporting/common/index.ts @@ -5,3 +5,4 @@ */ export { CancellationToken } from './cancellation_token'; +export { Poller } from './poller'; diff --git a/x-pack/plugins/reporting/common/types.ts b/x-pack/plugins/reporting/common/types.ts index 5b9ddfb1bbdea..2b9e9299852f5 100644 --- a/x-pack/plugins/reporting/common/types.ts +++ b/x-pack/plugins/reporting/common/types.ts @@ -5,7 +5,7 @@ */ // eslint-disable-next-line @kbn/eslint/no-restricted-paths -export { ConfigType } from '../server/config'; +export { ReportingConfigType } from '../server/config'; export type JobId = string; export type JobStatus = diff --git a/x-pack/legacy/plugins/reporting/common/validate_urls.test.ts b/x-pack/plugins/reporting/common/validate_urls.test.ts similarity index 100% rename from x-pack/legacy/plugins/reporting/common/validate_urls.test.ts rename to x-pack/plugins/reporting/common/validate_urls.test.ts diff --git a/x-pack/legacy/plugins/reporting/common/validate_urls.ts b/x-pack/plugins/reporting/common/validate_urls.ts similarity index 100% rename from x-pack/legacy/plugins/reporting/common/validate_urls.ts rename to x-pack/plugins/reporting/common/validate_urls.ts diff --git a/x-pack/plugins/reporting/kibana.json b/x-pack/plugins/reporting/kibana.json index e44bd92c42391..bc1a808d500e0 100644 --- a/x-pack/plugins/reporting/kibana.json +++ b/x-pack/plugins/reporting/kibana.json @@ -3,18 +3,18 @@ "version": "8.0.0", "kibanaVersion": "kibana", "optionalPlugins": [ + "security", "usageCollection" ], "configPath": ["xpack", "reporting"], "requiredPlugins": [ + "data", "home", "management", "licensing", "uiActions", "embeddable", - "share", - "kibanaLegacy", - "licensing" + "share" ], "server": true, "ui": true diff --git a/x-pack/plugins/reporting/public/plugin.tsx b/x-pack/plugins/reporting/public/plugin.tsx index 8f59a898b8e35..7dd709b956d12 100644 --- a/x-pack/plugins/reporting/public/plugin.tsx +++ b/x-pack/plugins/reporting/public/plugin.tsx @@ -26,7 +26,7 @@ import { import { ManagementSectionId, ManagementSetup } from '../../../../src/plugins/management/public'; import { SharePluginSetup } from '../../../../src/plugins/share/public'; import { LicensingPluginSetup } from '../../licensing/public'; -import { ConfigType, JobId, JobStatusBuckets } from '../common/types'; +import { ReportingConfigType, JobId, JobStatusBuckets } from '../common/types'; import { JOB_COMPLETION_NOTIFICATIONS_SESSION_KEY } from '../constants'; import { getGeneralErrorToast } from './components'; import { ReportListing } from './components/report_listing'; @@ -37,7 +37,7 @@ import { csvReportingProvider } from './share_context_menu/register_csv_reportin import { reportingPDFPNGProvider } from './share_context_menu/register_pdf_png_reporting'; export interface ClientConfigType { - poll: ConfigType['poll']; + poll: ReportingConfigType['poll']; } function getStored(): JobId[] { diff --git a/x-pack/legacy/plugins/reporting/server/browsers/chromium/driver/chromium_driver.ts b/x-pack/plugins/reporting/server/browsers/chromium/driver/chromium_driver.ts similarity index 99% rename from x-pack/legacy/plugins/reporting/server/browsers/chromium/driver/chromium_driver.ts rename to x-pack/plugins/reporting/server/browsers/chromium/driver/chromium_driver.ts index 6480fb4413f04..898b123e976fd 100644 --- a/x-pack/legacy/plugins/reporting/server/browsers/chromium/driver/chromium_driver.ts +++ b/x-pack/plugins/reporting/server/browsers/chromium/driver/chromium_driver.ts @@ -9,7 +9,7 @@ import { map, trunc } from 'lodash'; import open from 'opn'; import { ElementHandle, EvaluateFn, Page, Response, SerializableOrJSHandle } from 'puppeteer'; import { parse as parseUrl } from 'url'; -import { ViewZoomWidthHeight } from '../../../../export_types/common/layouts/layout'; +import { ViewZoomWidthHeight } from '../../../export_types/common/layouts/layout'; import { LevelLogger } from '../../../lib'; import { ConditionalHeaders, ElementPosition } from '../../../types'; import { allowRequest, NetworkPolicy } from '../../network_policy'; diff --git a/x-pack/legacy/plugins/reporting/server/browsers/chromium/driver/index.ts b/x-pack/plugins/reporting/server/browsers/chromium/driver/index.ts similarity index 100% rename from x-pack/legacy/plugins/reporting/server/browsers/chromium/driver/index.ts rename to x-pack/plugins/reporting/server/browsers/chromium/driver/index.ts diff --git a/x-pack/legacy/plugins/reporting/server/browsers/chromium/driver_factory/args.ts b/x-pack/plugins/reporting/server/browsers/chromium/driver_factory/args.ts similarity index 100% rename from x-pack/legacy/plugins/reporting/server/browsers/chromium/driver_factory/args.ts rename to x-pack/plugins/reporting/server/browsers/chromium/driver_factory/args.ts diff --git a/x-pack/legacy/plugins/reporting/server/browsers/chromium/driver_factory/index.ts b/x-pack/plugins/reporting/server/browsers/chromium/driver_factory/index.ts similarity index 100% rename from x-pack/legacy/plugins/reporting/server/browsers/chromium/driver_factory/index.ts rename to x-pack/plugins/reporting/server/browsers/chromium/driver_factory/index.ts diff --git a/x-pack/legacy/plugins/reporting/server/browsers/chromium/index.ts b/x-pack/plugins/reporting/server/browsers/chromium/index.ts similarity index 100% rename from x-pack/legacy/plugins/reporting/server/browsers/chromium/index.ts rename to x-pack/plugins/reporting/server/browsers/chromium/index.ts diff --git a/x-pack/legacy/plugins/reporting/server/browsers/chromium/paths.ts b/x-pack/plugins/reporting/server/browsers/chromium/paths.ts similarity index 100% rename from x-pack/legacy/plugins/reporting/server/browsers/chromium/paths.ts rename to x-pack/plugins/reporting/server/browsers/chromium/paths.ts diff --git a/x-pack/legacy/plugins/reporting/server/browsers/chromium/puppeteer.ts b/x-pack/plugins/reporting/server/browsers/chromium/puppeteer.ts similarity index 100% rename from x-pack/legacy/plugins/reporting/server/browsers/chromium/puppeteer.ts rename to x-pack/plugins/reporting/server/browsers/chromium/puppeteer.ts diff --git a/x-pack/legacy/plugins/reporting/server/browsers/create_browser_driver_factory.ts b/x-pack/plugins/reporting/server/browsers/create_browser_driver_factory.ts similarity index 89% rename from x-pack/legacy/plugins/reporting/server/browsers/create_browser_driver_factory.ts rename to x-pack/plugins/reporting/server/browsers/create_browser_driver_factory.ts index 7b4407890652c..f3486a48ba7b1 100644 --- a/x-pack/legacy/plugins/reporting/server/browsers/create_browser_driver_factory.ts +++ b/x-pack/plugins/reporting/server/browsers/create_browser_driver_factory.ts @@ -4,6 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ +import { first } from 'rxjs/operators'; import { ReportingConfig } from '../'; import { LevelLogger } from '../lib'; import { HeadlessChromiumDriverFactory } from './chromium/driver_factory'; @@ -19,13 +20,13 @@ export async function createBrowserDriverFactory( const browserConfig = captureConfig.browser.chromium; const browserAutoDownload = captureConfig.browser.autoDownload; const browserType = captureConfig.browser.type; - const dataDir = config.kbnConfig.get('path', 'data'); + const dataDir = await config.kbnConfig.get('path', 'data').pipe(first()).toPromise(); if (browserConfig.disableSandbox) { logger.warning(`Enabling the Chromium sandbox provides an additional layer of protection.`); } if (browserAutoDownload) { - await ensureBrowserDownloaded(browserType); + await ensureBrowserDownloaded(browserType, logger); } try { diff --git a/x-pack/legacy/plugins/reporting/server/browsers/download/checksum.ts b/x-pack/plugins/reporting/server/browsers/download/checksum.ts similarity index 100% rename from x-pack/legacy/plugins/reporting/server/browsers/download/checksum.ts rename to x-pack/plugins/reporting/server/browsers/download/checksum.ts diff --git a/x-pack/legacy/plugins/reporting/server/browsers/download/clean.ts b/x-pack/plugins/reporting/server/browsers/download/clean.ts similarity index 85% rename from x-pack/legacy/plugins/reporting/server/browsers/download/clean.ts rename to x-pack/plugins/reporting/server/browsers/download/clean.ts index 8988cbd1c9ec2..8558b001e8174 100644 --- a/x-pack/legacy/plugins/reporting/server/browsers/download/clean.ts +++ b/x-pack/plugins/reporting/server/browsers/download/clean.ts @@ -4,17 +4,16 @@ * you may not use this file except in compliance with the Elastic License. */ +import del from 'del'; import { readdirSync } from 'fs'; import { resolve as resolvePath } from 'path'; - -import del from 'del'; - -import { log, asyncMap } from './util'; +import { LevelLogger } from '../../lib'; +import { asyncMap } from './util'; /** * Delete any file in the `dir` that is not in the expectedPaths */ -export async function clean(dir: string, expectedPaths: string[]) { +export async function clean(dir: string, expectedPaths: string[], logger: LevelLogger) { let filenames: string[]; try { filenames = await readdirSync(dir); @@ -30,7 +29,7 @@ export async function clean(dir: string, expectedPaths: string[]) { await asyncMap(filenames, async (filename) => { const path = resolvePath(dir, filename); if (!expectedPaths.includes(path)) { - log(`Deleting unexpected file ${path}`); + logger.warn(`Deleting unexpected file ${path}`); await del(path, { force: true }); } }); diff --git a/x-pack/legacy/plugins/reporting/server/browsers/download/download.test.ts b/x-pack/plugins/reporting/server/browsers/download/download.test.ts similarity index 82% rename from x-pack/legacy/plugins/reporting/server/browsers/download/download.test.ts rename to x-pack/plugins/reporting/server/browsers/download/download.test.ts index 05ee2862f017b..b33dfa721d038 100644 --- a/x-pack/legacy/plugins/reporting/server/browsers/download/download.test.ts +++ b/x-pack/plugins/reporting/server/browsers/download/download.test.ts @@ -5,11 +5,11 @@ */ import { createHash } from 'crypto'; -import { resolve as resolvePath } from 'path'; +import del from 'del'; import { readFileSync } from 'fs'; +import { resolve as resolvePath } from 'path'; import { Readable } from 'stream'; - -import del from 'del'; +import { LevelLogger } from '../../lib'; import { download } from './download'; const TEMP_DIR = resolvePath(__dirname, '__tmp__'); @@ -29,6 +29,12 @@ class ReadableOf extends Readable { jest.mock('axios'); const request: jest.Mock = jest.requireMock('axios').request; +const mockLogger = ({ + error: jest.fn(), + warn: jest.fn(), + info: jest.fn(), +} as unknown) as LevelLogger; + test('downloads the url to the path', async () => { const BODY = 'abdcefg'; request.mockImplementationOnce(async () => { @@ -37,7 +43,7 @@ test('downloads the url to the path', async () => { }; }); - await download('url', TEMP_FILE); + await download('url', TEMP_FILE, mockLogger); expect(readFileSync(TEMP_FILE, 'utf8')).toEqual(BODY); }); @@ -50,7 +56,7 @@ test('returns the md5 hex hash of the http body', async () => { }; }); - const returned = await download('url', TEMP_FILE); + const returned = await download('url', TEMP_FILE, mockLogger); expect(returned).toEqual(HASH); }); @@ -59,7 +65,7 @@ test('throws if request emits an error', async () => { throw new Error('foo'); }); - return expect(download('url', TEMP_FILE)).rejects.toThrow('foo'); + return expect(download('url', TEMP_FILE, mockLogger)).rejects.toThrow('foo'); }); afterEach(async () => await del(TEMP_DIR)); diff --git a/x-pack/legacy/plugins/reporting/server/browsers/download/download.ts b/x-pack/plugins/reporting/server/browsers/download/download.ts similarity index 68% rename from x-pack/legacy/plugins/reporting/server/browsers/download/download.ts rename to x-pack/plugins/reporting/server/browsers/download/download.ts index a5ad69b46e46d..30b50c32a7402 100644 --- a/x-pack/legacy/plugins/reporting/server/browsers/download/download.ts +++ b/x-pack/plugins/reporting/server/browsers/download/download.ts @@ -4,13 +4,11 @@ * you may not use this file except in compliance with the Elastic License. */ -import { openSync, writeSync, closeSync, mkdirSync } from 'fs'; +import Axios from 'axios'; import { createHash } from 'crypto'; +import { closeSync, mkdirSync, openSync, writeSync } from 'fs'; import { dirname } from 'path'; - -import Axios from 'axios'; - -import { log } from './util'; +import { LevelLogger } from '../../lib'; /** * Download a url and calculate it's checksum @@ -18,8 +16,8 @@ import { log } from './util'; * @param {String} path * @return {Promise} checksum of the downloaded file */ -export async function download(url: string, path: string) { - log(`Downloading ${url}`); +export async function download(url: string, path: string, logger: LevelLogger) { + logger.info(`Downloading ${url} to ${path}`); const hash = createHash('md5'); @@ -39,7 +37,15 @@ export async function download(url: string, path: string) { }); await new Promise((resolve, reject) => { - resp.data.on('error', reject).on('end', resolve); + resp.data + .on('error', (err: Error) => { + logger.error(err); + reject(err); + }) + .on('end', () => { + logger.info(`Downloaded ${url}`); + resolve(); + }); }); } finally { closeSync(handle); diff --git a/x-pack/legacy/plugins/reporting/server/browsers/download/ensure_downloaded.ts b/x-pack/plugins/reporting/server/browsers/download/ensure_downloaded.ts similarity index 74% rename from x-pack/legacy/plugins/reporting/server/browsers/download/ensure_downloaded.ts rename to x-pack/plugins/reporting/server/browsers/download/ensure_downloaded.ts index f1f609ed5607b..b334510d71947 100644 --- a/x-pack/legacy/plugins/reporting/server/browsers/download/ensure_downloaded.ts +++ b/x-pack/plugins/reporting/server/browsers/download/ensure_downloaded.ts @@ -8,6 +8,7 @@ import { existsSync } from 'fs'; import { resolve as resolvePath } from 'path'; import { BrowserDownload, chromium } from '../'; import { BROWSER_TYPE } from '../../../common/constants'; +import { LevelLogger } from '../../lib'; import { md5 } from './checksum'; import { clean } from './clean'; import { download } from './download'; @@ -19,16 +20,17 @@ import { asyncMap } from './util'; * @param {String} browserType * @return {Promise} */ -export async function ensureBrowserDownloaded(browserType = BROWSER_TYPE) { - await ensureDownloaded([chromium]); +export async function ensureBrowserDownloaded(browserType = BROWSER_TYPE, logger: LevelLogger) { + await ensureDownloaded([chromium], logger); } /** - * Like ensureBrowserDownloaded(), except it applies to all browsers + * Check for the downloaded archive of each requested browser type and + * download them if they are missing or their checksum is invalid* * @return {Promise} */ -export async function ensureAllBrowsersDownloaded() { - await ensureDownloaded([chromium]); +export async function ensureAllBrowsersDownloaded(logger: LevelLogger) { + await ensureDownloaded([chromium], logger); } /** @@ -38,13 +40,14 @@ export async function ensureAllBrowsersDownloaded() { * @param {BrowserSpec} browsers * @return {Promise} */ -async function ensureDownloaded(browsers: BrowserDownload[]) { +async function ensureDownloaded(browsers: BrowserDownload[], logger: LevelLogger) { await asyncMap(browsers, async (browser) => { const { archivesPath } = browser.paths; await clean( archivesPath, - browser.paths.packages.map((p) => resolvePath(archivesPath, p.archiveFilename)) + browser.paths.packages.map((p) => resolvePath(archivesPath, p.archiveFilename)), + logger ); const invalidChecksums: string[] = []; @@ -53,21 +56,24 @@ async function ensureDownloaded(browsers: BrowserDownload[]) { const path = resolvePath(archivesPath, archiveFilename); if (existsSync(path) && (await md5(path)) === archiveChecksum) { + logger.info(`Browser archive exists in ${path}`); return; } - const downloadedChecksum = await download(url, path); + const downloadedChecksum = await download(url, path, logger); if (downloadedChecksum !== archiveChecksum) { invalidChecksums.push(`${url} => ${path}`); } }); if (invalidChecksums.length) { - throw new Error( + const err = new Error( `Error downloading browsers, checksums incorrect for:\n - ${invalidChecksums.join( '\n - ' )}` ); + logger.error(err); + throw err; } }); } diff --git a/x-pack/legacy/plugins/reporting/server/browsers/download/index.ts b/x-pack/plugins/reporting/server/browsers/download/index.ts similarity index 100% rename from x-pack/legacy/plugins/reporting/server/browsers/download/index.ts rename to x-pack/plugins/reporting/server/browsers/download/index.ts diff --git a/x-pack/legacy/plugins/reporting/server/browsers/download/util.ts b/x-pack/plugins/reporting/server/browsers/download/util.ts similarity index 70% rename from x-pack/legacy/plugins/reporting/server/browsers/download/util.ts rename to x-pack/plugins/reporting/server/browsers/download/util.ts index 679106742e3d0..99267664be766 100644 --- a/x-pack/legacy/plugins/reporting/server/browsers/download/util.ts +++ b/x-pack/plugins/reporting/server/browsers/download/util.ts @@ -6,17 +6,6 @@ import { Readable } from 'stream'; -/** - * Log a message if the DEBUG environment variable is set - */ -export function log(...args: any[]) { - if (process.env.DEBUG) { - // allow console log since this is off by default and only for debugging - // eslint-disable-next-line no-console - console.log(...args); - } -} - /** * Iterate an array asynchronously and in parallel */ diff --git a/x-pack/legacy/plugins/reporting/server/browsers/extract/__tests__/__fixtures__/file.md b/x-pack/plugins/reporting/server/browsers/extract/__tests__/__fixtures__/file.md similarity index 100% rename from x-pack/legacy/plugins/reporting/server/browsers/extract/__tests__/__fixtures__/file.md rename to x-pack/plugins/reporting/server/browsers/extract/__tests__/__fixtures__/file.md diff --git a/x-pack/legacy/plugins/reporting/server/browsers/extract/__tests__/__fixtures__/file.md.zip b/x-pack/plugins/reporting/server/browsers/extract/__tests__/__fixtures__/file.md.zip similarity index 100% rename from x-pack/legacy/plugins/reporting/server/browsers/extract/__tests__/__fixtures__/file.md.zip rename to x-pack/plugins/reporting/server/browsers/extract/__tests__/__fixtures__/file.md.zip diff --git a/x-pack/legacy/plugins/reporting/server/browsers/extract/__tests__/extract.js b/x-pack/plugins/reporting/server/browsers/extract/__tests__/extract.js similarity index 100% rename from x-pack/legacy/plugins/reporting/server/browsers/extract/__tests__/extract.js rename to x-pack/plugins/reporting/server/browsers/extract/__tests__/extract.js diff --git a/x-pack/legacy/plugins/reporting/server/browsers/extract/extract.js b/x-pack/plugins/reporting/server/browsers/extract/extract.js similarity index 100% rename from x-pack/legacy/plugins/reporting/server/browsers/extract/extract.js rename to x-pack/plugins/reporting/server/browsers/extract/extract.js diff --git a/x-pack/legacy/plugins/reporting/server/browsers/extract/extract_error.js b/x-pack/plugins/reporting/server/browsers/extract/extract_error.js similarity index 100% rename from x-pack/legacy/plugins/reporting/server/browsers/extract/extract_error.js rename to x-pack/plugins/reporting/server/browsers/extract/extract_error.js diff --git a/x-pack/legacy/plugins/reporting/server/browsers/extract/index.js b/x-pack/plugins/reporting/server/browsers/extract/index.js similarity index 100% rename from x-pack/legacy/plugins/reporting/server/browsers/extract/index.js rename to x-pack/plugins/reporting/server/browsers/extract/index.js diff --git a/x-pack/legacy/plugins/reporting/server/browsers/extract/unzip.js b/x-pack/plugins/reporting/server/browsers/extract/unzip.js similarity index 100% rename from x-pack/legacy/plugins/reporting/server/browsers/extract/unzip.js rename to x-pack/plugins/reporting/server/browsers/extract/unzip.js diff --git a/x-pack/legacy/plugins/reporting/server/browsers/index.ts b/x-pack/plugins/reporting/server/browsers/index.ts similarity index 100% rename from x-pack/legacy/plugins/reporting/server/browsers/index.ts rename to x-pack/plugins/reporting/server/browsers/index.ts diff --git a/x-pack/legacy/plugins/reporting/server/browsers/install.ts b/x-pack/plugins/reporting/server/browsers/install.ts similarity index 100% rename from x-pack/legacy/plugins/reporting/server/browsers/install.ts rename to x-pack/plugins/reporting/server/browsers/install.ts diff --git a/x-pack/legacy/plugins/reporting/server/browsers/network_policy.test.ts b/x-pack/plugins/reporting/server/browsers/network_policy.test.ts similarity index 100% rename from x-pack/legacy/plugins/reporting/server/browsers/network_policy.test.ts rename to x-pack/plugins/reporting/server/browsers/network_policy.test.ts diff --git a/x-pack/legacy/plugins/reporting/server/browsers/network_policy.ts b/x-pack/plugins/reporting/server/browsers/network_policy.ts similarity index 100% rename from x-pack/legacy/plugins/reporting/server/browsers/network_policy.ts rename to x-pack/plugins/reporting/server/browsers/network_policy.ts diff --git a/x-pack/legacy/plugins/reporting/server/browsers/safe_child_process.ts b/x-pack/plugins/reporting/server/browsers/safe_child_process.ts similarity index 100% rename from x-pack/legacy/plugins/reporting/server/browsers/safe_child_process.ts rename to x-pack/plugins/reporting/server/browsers/safe_child_process.ts diff --git a/x-pack/legacy/plugins/reporting/server/config/index.ts b/x-pack/plugins/reporting/server/config/config.ts similarity index 84% rename from x-pack/legacy/plugins/reporting/server/config/index.ts rename to x-pack/plugins/reporting/server/config/config.ts index 3ec5aab4d451b..4142ab6f0ae43 100644 --- a/x-pack/legacy/plugins/reporting/server/config/index.ts +++ b/x-pack/plugins/reporting/server/config/config.ts @@ -4,10 +4,11 @@ * you may not use this file except in compliance with the Elastic License. */ -import { Legacy } from 'kibana'; +import { Observable } from 'rxjs'; import { get } from 'lodash'; -import { CoreSetup } from 'src/core/server'; -import { ConfigType as ReportingConfigType } from '../../../../../plugins/reporting/server'; +import { map } from 'rxjs/operators'; +import { CoreSetup, PluginInitializerContext } from 'src/core/server'; +import { ReportingConfigType } from './schema'; // make config.get() aware of the value type it returns interface Config { @@ -39,7 +40,7 @@ interface Config { } interface KbnServerConfigType { - path: { data: string }; + path: { data: Observable }; server: { basePath: string; host: string; @@ -55,17 +56,16 @@ export interface ReportingConfig extends Config { } export const buildConfig = ( + initContext: PluginInitializerContext, core: CoreSetup, - server: Legacy.Server, reportingConfig: ReportingConfigType ): ReportingConfig => { - const config = server.config(); const { http } = core; const serverInfo = http.getServerInfo(); const kbnConfig = { path: { - data: config.get('path.data'), + data: initContext.config.legacy.globalConfig$.pipe(map((c) => c.path.data)), }, server: { basePath: core.http.basePath.serverBasePath, @@ -84,5 +84,3 @@ export const buildConfig = ( }, }; }; - -export { ReportingConfigType }; diff --git a/x-pack/plugins/reporting/server/config/create_config.test.ts b/x-pack/plugins/reporting/server/config/create_config.test.ts index 3107866be6496..1c4c840cfa312 100644 --- a/x-pack/plugins/reporting/server/config/create_config.test.ts +++ b/x-pack/plugins/reporting/server/config/create_config.test.ts @@ -5,9 +5,10 @@ */ import * as Rx from 'rxjs'; -import { CoreSetup, Logger, PluginInitializerContext } from 'src/core/server'; -import { ConfigType as ReportingConfigType } from './schema'; +import { CoreSetup, PluginInitializerContext } from 'src/core/server'; +import { LevelLogger } from '../lib'; import { createConfig$ } from './create_config'; +import { ReportingConfigType } from './schema'; interface KibanaServer { host?: string; @@ -37,14 +38,14 @@ const makeMockCoreSetup = (serverInfo: KibanaServer): CoreSetup => describe('Reporting server createConfig$', () => { let mockCoreSetup: CoreSetup; let mockInitContext: PluginInitializerContext; - let mockLogger: Logger; + let mockLogger: LevelLogger; beforeEach(() => { mockCoreSetup = makeMockCoreSetup({ host: 'kibanaHost', port: 5601, protocol: 'http' }); mockInitContext = makeMockInitContext({ kibanaServer: {}, }); - mockLogger = ({ warn: jest.fn(), debug: jest.fn() } as unknown) as Logger; + mockLogger = ({ warn: jest.fn(), debug: jest.fn() } as unknown) as LevelLogger; }); afterEach(() => { @@ -52,7 +53,8 @@ describe('Reporting server createConfig$', () => { }); it('creates random encryption key and default config using host, protocol, and port from server info', async () => { - const result = await createConfig$(mockCoreSetup, mockInitContext, mockLogger).toPromise(); + const mockConfig$: any = mockInitContext.config.create(); + const result = await createConfig$(mockCoreSetup, mockConfig$, mockLogger).toPromise(); expect(result.encryptionKey).toMatch(/\S{32,}/); // random 32 characters expect(result.kibanaServer).toMatchInlineSnapshot(` @@ -73,8 +75,8 @@ describe('Reporting server createConfig$', () => { encryptionKey: 'iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii', kibanaServer: {}, }); - const result = await createConfig$(mockCoreSetup, mockInitContext, mockLogger).toPromise(); - + const mockConfig$: any = mockInitContext.config.create(); + const result = await createConfig$(mockCoreSetup, mockConfig$, mockLogger).toPromise(); expect(result.encryptionKey).toMatch('iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii'); expect((mockLogger.warn as any).mock.calls.length).toBe(0); }); @@ -88,7 +90,8 @@ describe('Reporting server createConfig$', () => { protocol: 'httpsa', }, }); - const result = await createConfig$(mockCoreSetup, mockInitContext, mockLogger).toPromise(); + const mockConfig$: any = mockInitContext.config.create(); + const result = await createConfig$(mockCoreSetup, mockConfig$, mockLogger).toPromise(); expect(result).toMatchInlineSnapshot(` Object { @@ -115,7 +118,8 @@ describe('Reporting server createConfig$', () => { encryptionKey: 'aaaaaaaaaaaaabbbbbbbbbbbbaaaaaaaaa', kibanaServer: { hostname: '0' }, }); - const result = await createConfig$(mockCoreSetup, mockInitContext, mockLogger).toPromise(); + const mockConfig$: any = mockInitContext.config.create(); + const result = await createConfig$(mockCoreSetup, mockConfig$, mockLogger).toPromise(); expect(result.kibanaServer).toMatchInlineSnapshot(` Object { @@ -136,7 +140,8 @@ describe('Reporting server createConfig$', () => { encryptionKey: '888888888888888888888888888888888', capture: { browser: { chromium: { disableSandbox: false } } }, } as ReportingConfigType); - const result = await createConfig$(mockCoreSetup, mockInitContext, mockLogger).toPromise(); + const mockConfig$: any = mockInitContext.config.create(); + const result = await createConfig$(mockCoreSetup, mockConfig$, mockLogger).toPromise(); expect(result.capture.browser.chromium).toMatchObject({ disableSandbox: false }); expect((mockLogger.warn as any).mock.calls.length).toBe(0); @@ -147,7 +152,8 @@ describe('Reporting server createConfig$', () => { encryptionKey: '888888888888888888888888888888888', capture: { browser: { chromium: { disableSandbox: true } } }, } as ReportingConfigType); - const result = await createConfig$(mockCoreSetup, mockInitContext, mockLogger).toPromise(); + const mockConfig$: any = mockInitContext.config.create(); + const result = await createConfig$(mockCoreSetup, mockConfig$, mockLogger).toPromise(); expect(result.capture.browser.chromium).toMatchObject({ disableSandbox: true }); expect((mockLogger.warn as any).mock.calls.length).toBe(0); @@ -157,7 +163,8 @@ describe('Reporting server createConfig$', () => { mockInitContext = makeMockInitContext({ encryptionKey: '888888888888888888888888888888888', } as ReportingConfigType); - const result = await createConfig$(mockCoreSetup, mockInitContext, mockLogger).toPromise(); + const mockConfig$: any = mockInitContext.config.create(); + const result = await createConfig$(mockCoreSetup, mockConfig$, mockLogger).toPromise(); expect(result.capture.browser.chromium).toMatchObject({ disableSandbox: expect.any(Boolean) }); expect((mockLogger.warn as any).mock.calls.length).toBe(0); diff --git a/x-pack/plugins/reporting/server/config/create_config.ts b/x-pack/plugins/reporting/server/config/create_config.ts index d363494ddb9a6..67df7dacc77ab 100644 --- a/x-pack/plugins/reporting/server/config/create_config.ts +++ b/x-pack/plugins/reporting/server/config/create_config.ts @@ -5,13 +5,14 @@ */ import { i18n } from '@kbn/i18n/'; -import { TypeOf } from '@kbn/config-schema'; import crypto from 'crypto'; import { capitalize } from 'lodash'; +import { Observable } from 'rxjs'; import { map, mergeMap } from 'rxjs/operators'; -import { CoreSetup, Logger, PluginInitializerContext } from 'src/core/server'; +import { CoreSetup } from 'src/core/server'; +import { LevelLogger } from '../lib'; import { getDefaultChromiumSandboxDisabled } from './default_chromium_sandbox_disabled'; -import { ConfigSchema } from './schema'; +import { ReportingConfigType } from './schema'; /* * Set up dynamic config defaults @@ -19,8 +20,12 @@ import { ConfigSchema } from './schema'; * - xpack.kibanaServer * - xpack.reporting.encryptionKey */ -export function createConfig$(core: CoreSetup, context: PluginInitializerContext, logger: Logger) { - return context.config.create>().pipe( +export function createConfig$( + core: CoreSetup, + config$: Observable, + logger: LevelLogger +) { + return config$.pipe( map((config) => { // encryption key let encryptionKey = config.encryptionKey; diff --git a/x-pack/plugins/reporting/server/config/index.ts b/x-pack/plugins/reporting/server/config/index.ts index a0d7618322c65..caa64a7414005 100644 --- a/x-pack/plugins/reporting/server/config/index.ts +++ b/x-pack/plugins/reporting/server/config/index.ts @@ -5,11 +5,12 @@ */ import { PluginConfigDescriptor } from 'kibana/server'; -import { ConfigSchema, ConfigType } from './schema'; - +import { ConfigSchema, ReportingConfigType } from './schema'; +export { buildConfig } from './config'; export { createConfig$ } from './create_config'; +export { ConfigSchema, ReportingConfigType }; -export const config: PluginConfigDescriptor = { +export const config: PluginConfigDescriptor = { exposeToBrowser: { poll: true }, schema: ConfigSchema, deprecations: ({ unused }) => [ @@ -20,5 +21,3 @@ export const config: PluginConfigDescriptor = { unused('kibanaApp'), ], }; - -export { ConfigSchema, ConfigType }; diff --git a/x-pack/plugins/reporting/server/config/schema.ts b/x-pack/plugins/reporting/server/config/schema.ts index 402fddcb5e014..dfabfa98f8cbf 100644 --- a/x-pack/plugins/reporting/server/config/schema.ts +++ b/x-pack/plugins/reporting/server/config/schema.ts @@ -172,4 +172,4 @@ export const ConfigSchema = schema.object({ poll: PollSchema, }); -export type ConfigType = TypeOf; +export type ReportingConfigType = TypeOf; diff --git a/x-pack/legacy/plugins/reporting/server/core.ts b/x-pack/plugins/reporting/server/core.ts similarity index 92% rename from x-pack/legacy/plugins/reporting/server/core.ts rename to x-pack/plugins/reporting/server/core.ts index b89ef9e06b961..e7786b3b753fb 100644 --- a/x-pack/legacy/plugins/reporting/server/core.ts +++ b/x-pack/plugins/reporting/server/core.ts @@ -5,22 +5,22 @@ */ import * as Rx from 'rxjs'; -import { first, mapTo, map } from 'rxjs/operators'; +import { first, map, mapTo } from 'rxjs/operators'; import { + BasePath, ElasticsearchServiceSetup, + IRouter, KibanaRequest, + SavedObjectsClientContract, SavedObjectsServiceStart, UiSettingsServiceStart, - IRouter, - SavedObjectsClientContract, - BasePath, } from 'src/core/server'; -import { SecurityPluginSetup } from '../../../../plugins/security/server'; -import { LicensingPluginSetup } from '../../../../plugins/licensing/server'; -import { screenshotsObservableFactory } from '../export_types/common/lib/screenshots'; +import { LicensingPluginSetup } from '../../licensing/server'; +import { SecurityPluginSetup } from '../../security/server'; import { ScreenshotsObservableFn } from '../server/types'; import { ReportingConfig } from './'; import { HeadlessChromiumDriverFactory } from './browsers/chromium/driver_factory'; +import { screenshotsObservableFactory } from './export_types/common/lib/screenshots'; import { checkLicense, getExportTypesRegistry } from './lib'; import { ESQueueInstance } from './lib/create_queue'; import { EnqueueJobFn } from './lib/enqueue_job'; @@ -31,7 +31,7 @@ export interface ReportingInternalSetup { licensing: LicensingPluginSetup; basePath: BasePath['get']; router: IRouter; - security: SecurityPluginSetup; + security?: SecurityPluginSetup; } interface ReportingInternalStart { diff --git a/x-pack/legacy/plugins/reporting/export_types/common/constants.ts b/x-pack/plugins/reporting/server/export_types/common/constants.ts similarity index 100% rename from x-pack/legacy/plugins/reporting/export_types/common/constants.ts rename to x-pack/plugins/reporting/server/export_types/common/constants.ts diff --git a/x-pack/legacy/plugins/reporting/export_types/common/execute_job/decrypt_job_headers.test.ts b/x-pack/plugins/reporting/server/export_types/common/execute_job/decrypt_job_headers.test.ts similarity index 96% rename from x-pack/legacy/plugins/reporting/export_types/common/execute_job/decrypt_job_headers.test.ts rename to x-pack/plugins/reporting/server/export_types/common/execute_job/decrypt_job_headers.test.ts index fe3ac16b79fe0..4998d936c9b16 100644 --- a/x-pack/legacy/plugins/reporting/export_types/common/execute_job/decrypt_job_headers.test.ts +++ b/x-pack/plugins/reporting/server/export_types/common/execute_job/decrypt_job_headers.test.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { cryptoFactory, LevelLogger } from '../../../server/lib'; +import { cryptoFactory, LevelLogger } from '../../../lib'; import { decryptJobHeaders } from './decrypt_job_headers'; const encryptHeaders = async (encryptionKey: string, headers: Record) => { diff --git a/x-pack/legacy/plugins/reporting/export_types/common/execute_job/decrypt_job_headers.ts b/x-pack/plugins/reporting/server/export_types/common/execute_job/decrypt_job_headers.ts similarity index 95% rename from x-pack/legacy/plugins/reporting/export_types/common/execute_job/decrypt_job_headers.ts rename to x-pack/plugins/reporting/server/export_types/common/execute_job/decrypt_job_headers.ts index a13c1fa2a9efb..e5124c80601d7 100644 --- a/x-pack/legacy/plugins/reporting/export_types/common/execute_job/decrypt_job_headers.ts +++ b/x-pack/plugins/reporting/server/export_types/common/execute_job/decrypt_job_headers.ts @@ -5,7 +5,7 @@ */ import { i18n } from '@kbn/i18n'; -import { cryptoFactory, LevelLogger } from '../../../server/lib'; +import { cryptoFactory, LevelLogger } from '../../../lib'; interface HasEncryptedHeaders { headers?: string; diff --git a/x-pack/legacy/plugins/reporting/export_types/common/execute_job/get_conditional_headers.test.ts b/x-pack/plugins/reporting/server/export_types/common/execute_job/get_conditional_headers.test.ts similarity index 97% rename from x-pack/legacy/plugins/reporting/export_types/common/execute_job/get_conditional_headers.test.ts rename to x-pack/plugins/reporting/server/export_types/common/execute_job/get_conditional_headers.test.ts index 5067d5f5e5dd8..5d651ad5f8aea 100644 --- a/x-pack/legacy/plugins/reporting/export_types/common/execute_job/get_conditional_headers.test.ts +++ b/x-pack/plugins/reporting/server/export_types/common/execute_job/get_conditional_headers.test.ts @@ -5,9 +5,10 @@ */ import sinon from 'sinon'; -import { ReportingConfig, ReportingCore } from '../../../server'; -import { JobDocPayload } from '../../../server/types'; +import { ReportingConfig } from '../../../'; +import { ReportingCore } from '../../../core'; import { createMockReportingCore } from '../../../test_helpers'; +import { JobDocPayload } from '../../../types'; import { JobDocPayloadPDF } from '../../printable_pdf/types'; import { getConditionalHeaders, getCustomLogo } from './index'; diff --git a/x-pack/legacy/plugins/reporting/export_types/common/execute_job/get_conditional_headers.ts b/x-pack/plugins/reporting/server/export_types/common/execute_job/get_conditional_headers.ts similarity index 89% rename from x-pack/legacy/plugins/reporting/export_types/common/execute_job/get_conditional_headers.ts rename to x-pack/plugins/reporting/server/export_types/common/execute_job/get_conditional_headers.ts index 808d5db5c57d5..6854f678aa975 100644 --- a/x-pack/legacy/plugins/reporting/export_types/common/execute_job/get_conditional_headers.ts +++ b/x-pack/plugins/reporting/server/export_types/common/execute_job/get_conditional_headers.ts @@ -4,8 +4,8 @@ * you may not use this file except in compliance with the Elastic License. */ -import { ReportingConfig } from '../../../server'; -import { ConditionalHeaders } from '../../../server/types'; +import { ReportingConfig } from '../../../'; +import { ConditionalHeaders } from '../../../types'; export const getConditionalHeaders = ({ config, diff --git a/x-pack/legacy/plugins/reporting/export_types/common/execute_job/get_custom_logo.test.ts b/x-pack/plugins/reporting/server/export_types/common/execute_job/get_custom_logo.test.ts similarity index 97% rename from x-pack/legacy/plugins/reporting/export_types/common/execute_job/get_custom_logo.test.ts rename to x-pack/plugins/reporting/server/export_types/common/execute_job/get_custom_logo.test.ts index 2cbde69c81316..bd6eb4644d87f 100644 --- a/x-pack/legacy/plugins/reporting/export_types/common/execute_job/get_custom_logo.test.ts +++ b/x-pack/plugins/reporting/server/export_types/common/execute_job/get_custom_logo.test.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { ReportingCore } from '../../../server'; +import { ReportingCore } from '../../../core'; import { createMockReportingCore } from '../../../test_helpers'; import { JobDocPayloadPDF } from '../../printable_pdf/types'; import { getConditionalHeaders, getCustomLogo } from './index'; diff --git a/x-pack/legacy/plugins/reporting/export_types/common/execute_job/get_custom_logo.ts b/x-pack/plugins/reporting/server/export_types/common/execute_job/get_custom_logo.ts similarity index 87% rename from x-pack/legacy/plugins/reporting/export_types/common/execute_job/get_custom_logo.ts rename to x-pack/plugins/reporting/server/export_types/common/execute_job/get_custom_logo.ts index 777de317af41e..85d1272fc22ce 100644 --- a/x-pack/legacy/plugins/reporting/export_types/common/execute_job/get_custom_logo.ts +++ b/x-pack/plugins/reporting/server/export_types/common/execute_job/get_custom_logo.ts @@ -4,9 +4,9 @@ * you may not use this file except in compliance with the Elastic License. */ -import { UI_SETTINGS_CUSTOM_PDF_LOGO } from '../../../common/constants'; -import { ReportingConfig, ReportingCore } from '../../../server'; -import { ConditionalHeaders } from '../../../server/types'; +import { ReportingConfig, ReportingCore } from '../../../'; +import { UI_SETTINGS_CUSTOM_PDF_LOGO } from '../../../../common/constants'; +import { ConditionalHeaders } from '../../../types'; import { JobDocPayloadPDF } from '../../printable_pdf/types'; // Logo is PDF only export const getCustomLogo = async ({ diff --git a/x-pack/legacy/plugins/reporting/export_types/common/execute_job/get_full_urls.test.ts b/x-pack/plugins/reporting/server/export_types/common/execute_job/get_full_urls.test.ts similarity index 99% rename from x-pack/legacy/plugins/reporting/export_types/common/execute_job/get_full_urls.test.ts rename to x-pack/plugins/reporting/server/export_types/common/execute_job/get_full_urls.test.ts index 5f55617724ff6..cacea41477ea4 100644 --- a/x-pack/legacy/plugins/reporting/export_types/common/execute_job/get_full_urls.test.ts +++ b/x-pack/plugins/reporting/server/export_types/common/execute_job/get_full_urls.test.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { ReportingConfig } from '../../../server'; +import { ReportingConfig } from '../../../'; import { JobDocPayloadPNG } from '../../png/types'; import { JobDocPayloadPDF } from '../../printable_pdf/types'; import { getFullUrls } from './get_full_urls'; diff --git a/x-pack/legacy/plugins/reporting/export_types/common/execute_job/get_full_urls.ts b/x-pack/plugins/reporting/server/export_types/common/execute_job/get_full_urls.ts similarity index 93% rename from x-pack/legacy/plugins/reporting/export_types/common/execute_job/get_full_urls.ts rename to x-pack/plugins/reporting/server/export_types/common/execute_job/get_full_urls.ts index 90f3a3b2c9c24..bcd7f122748cb 100644 --- a/x-pack/legacy/plugins/reporting/export_types/common/execute_job/get_full_urls.ts +++ b/x-pack/plugins/reporting/server/export_types/common/execute_job/get_full_urls.ts @@ -7,12 +7,12 @@ import { format as urlFormat, parse as urlParse, - UrlWithStringQuery, UrlWithParsedQuery, + UrlWithStringQuery, } from 'url'; -import { getAbsoluteUrlFactory } from '../../../common/get_absolute_url'; -import { validateUrls } from '../../../common/validate_urls'; -import { ReportingConfig } from '../../../server'; +import { ReportingConfig } from '../../..'; +import { getAbsoluteUrlFactory } from '../../../../common/get_absolute_url'; +import { validateUrls } from '../../../../common/validate_urls'; import { JobDocPayloadPNG } from '../../png/types'; import { JobDocPayloadPDF } from '../../printable_pdf/types'; diff --git a/x-pack/legacy/plugins/reporting/export_types/common/execute_job/index.ts b/x-pack/plugins/reporting/server/export_types/common/execute_job/index.ts similarity index 100% rename from x-pack/legacy/plugins/reporting/export_types/common/execute_job/index.ts rename to x-pack/plugins/reporting/server/export_types/common/execute_job/index.ts diff --git a/x-pack/legacy/plugins/reporting/export_types/common/execute_job/omit_blacklisted_headers.test.ts b/x-pack/plugins/reporting/server/export_types/common/execute_job/omit_blacklisted_headers.test.ts similarity index 100% rename from x-pack/legacy/plugins/reporting/export_types/common/execute_job/omit_blacklisted_headers.test.ts rename to x-pack/plugins/reporting/server/export_types/common/execute_job/omit_blacklisted_headers.test.ts diff --git a/x-pack/legacy/plugins/reporting/export_types/common/execute_job/omit_blacklisted_headers.ts b/x-pack/plugins/reporting/server/export_types/common/execute_job/omit_blacklisted_headers.ts similarity index 95% rename from x-pack/legacy/plugins/reporting/export_types/common/execute_job/omit_blacklisted_headers.ts rename to x-pack/plugins/reporting/server/export_types/common/execute_job/omit_blacklisted_headers.ts index 0e5974225b932..5147881a980ea 100644 --- a/x-pack/legacy/plugins/reporting/export_types/common/execute_job/omit_blacklisted_headers.ts +++ b/x-pack/plugins/reporting/server/export_types/common/execute_job/omit_blacklisted_headers.ts @@ -7,7 +7,7 @@ import { omit } from 'lodash'; import { KBN_SCREENSHOT_HEADER_BLACKLIST, KBN_SCREENSHOT_HEADER_BLACKLIST_STARTS_WITH_PATTERN, -} from '../../../common/constants'; +} from '../../../../common/constants'; export const omitBlacklistedHeaders = ({ job, diff --git a/x-pack/legacy/plugins/reporting/export_types/common/layouts/create_layout.ts b/x-pack/plugins/reporting/server/export_types/common/layouts/create_layout.ts similarity index 93% rename from x-pack/legacy/plugins/reporting/export_types/common/layouts/create_layout.ts rename to x-pack/plugins/reporting/server/export_types/common/layouts/create_layout.ts index d33760fcb4f89..216a59d41cec0 100644 --- a/x-pack/legacy/plugins/reporting/export_types/common/layouts/create_layout.ts +++ b/x-pack/plugins/reporting/server/export_types/common/layouts/create_layout.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { CaptureConfig } from '../../../server/types'; +import { CaptureConfig } from '../../../types'; import { LayoutParams, LayoutTypes } from './'; import { Layout } from './layout'; import { PreserveLayout } from './preserve_layout'; diff --git a/x-pack/legacy/plugins/reporting/export_types/common/layouts/index.ts b/x-pack/plugins/reporting/server/export_types/common/layouts/index.ts similarity index 93% rename from x-pack/legacy/plugins/reporting/export_types/common/layouts/index.ts rename to x-pack/plugins/reporting/server/export_types/common/layouts/index.ts index 993b8f6cdc9ab..23e4c095afe61 100644 --- a/x-pack/legacy/plugins/reporting/export_types/common/layouts/index.ts +++ b/x-pack/plugins/reporting/server/export_types/common/layouts/index.ts @@ -4,8 +4,8 @@ * you may not use this file except in compliance with the Elastic License. */ -import { HeadlessChromiumDriver } from '../../../server/browsers'; -import { LevelLogger } from '../../../server/lib'; +import { HeadlessChromiumDriver } from '../../../browsers'; +import { LevelLogger } from '../../../lib'; import { Layout } from './layout'; export { createLayout } from './create_layout'; diff --git a/x-pack/legacy/plugins/reporting/export_types/common/layouts/layout.ts b/x-pack/plugins/reporting/server/export_types/common/layouts/layout.ts similarity index 100% rename from x-pack/legacy/plugins/reporting/export_types/common/layouts/layout.ts rename to x-pack/plugins/reporting/server/export_types/common/layouts/layout.ts diff --git a/x-pack/legacy/plugins/reporting/export_types/common/layouts/preserve_layout.css b/x-pack/plugins/reporting/server/export_types/common/layouts/preserve_layout.css similarity index 100% rename from x-pack/legacy/plugins/reporting/export_types/common/layouts/preserve_layout.css rename to x-pack/plugins/reporting/server/export_types/common/layouts/preserve_layout.css diff --git a/x-pack/legacy/plugins/reporting/export_types/common/layouts/preserve_layout.ts b/x-pack/plugins/reporting/server/export_types/common/layouts/preserve_layout.ts similarity index 100% rename from x-pack/legacy/plugins/reporting/export_types/common/layouts/preserve_layout.ts rename to x-pack/plugins/reporting/server/export_types/common/layouts/preserve_layout.ts diff --git a/x-pack/legacy/plugins/reporting/export_types/common/layouts/print.css b/x-pack/plugins/reporting/server/export_types/common/layouts/print.css similarity index 100% rename from x-pack/legacy/plugins/reporting/export_types/common/layouts/print.css rename to x-pack/plugins/reporting/server/export_types/common/layouts/print.css diff --git a/x-pack/legacy/plugins/reporting/export_types/common/layouts/print_layout.ts b/x-pack/plugins/reporting/server/export_types/common/layouts/print_layout.ts similarity index 94% rename from x-pack/legacy/plugins/reporting/export_types/common/layouts/print_layout.ts rename to x-pack/plugins/reporting/server/export_types/common/layouts/print_layout.ts index 759f07a33e2b6..30c83771aa3c9 100644 --- a/x-pack/legacy/plugins/reporting/export_types/common/layouts/print_layout.ts +++ b/x-pack/plugins/reporting/server/export_types/common/layouts/print_layout.ts @@ -6,9 +6,9 @@ import path from 'path'; import { EvaluateFn, SerializableOrJSHandle } from 'puppeteer'; -import { LevelLogger } from '../../../server/lib'; -import { HeadlessChromiumDriver } from '../../../server/browsers'; -import { CaptureConfig } from '../../../server/types'; +import { CaptureConfig } from '../../../types'; +import { HeadlessChromiumDriver } from '../../../browsers'; +import { LevelLogger } from '../../../lib'; import { getDefaultLayoutSelectors, LayoutSelectorDictionary, Size, LayoutTypes } from './'; import { Layout } from './layout'; diff --git a/x-pack/legacy/plugins/reporting/export_types/common/lib/screenshots/constants.ts b/x-pack/plugins/reporting/server/export_types/common/lib/screenshots/constants.ts similarity index 100% rename from x-pack/legacy/plugins/reporting/export_types/common/lib/screenshots/constants.ts rename to x-pack/plugins/reporting/server/export_types/common/lib/screenshots/constants.ts diff --git a/x-pack/legacy/plugins/reporting/export_types/common/lib/screenshots/get_element_position_data.ts b/x-pack/plugins/reporting/server/export_types/common/lib/screenshots/get_element_position_data.ts similarity index 94% rename from x-pack/legacy/plugins/reporting/export_types/common/lib/screenshots/get_element_position_data.ts rename to x-pack/plugins/reporting/server/export_types/common/lib/screenshots/get_element_position_data.ts index d02e852a3c1b6..140d76f8d1cd6 100644 --- a/x-pack/legacy/plugins/reporting/export_types/common/lib/screenshots/get_element_position_data.ts +++ b/x-pack/plugins/reporting/server/export_types/common/lib/screenshots/get_element_position_data.ts @@ -5,9 +5,9 @@ */ import { i18n } from '@kbn/i18n'; -import { HeadlessChromiumDriver } from '../../../../server/browsers'; -import { LevelLogger, startTrace } from '../../../../server/lib'; -import { AttributesMap, ElementsPositionAndAttribute } from '../../../../server/types'; +import { HeadlessChromiumDriver } from '../../../../browsers'; +import { LevelLogger, startTrace } from '../../../../lib'; +import { AttributesMap, ElementsPositionAndAttribute } from '../../../../types'; import { LayoutInstance } from '../../layouts'; import { CONTEXT_ELEMENTATTRIBUTES } from './constants'; diff --git a/x-pack/legacy/plugins/reporting/export_types/common/lib/screenshots/get_number_of_items.ts b/x-pack/plugins/reporting/server/export_types/common/lib/screenshots/get_number_of_items.ts similarity index 93% rename from x-pack/legacy/plugins/reporting/export_types/common/lib/screenshots/get_number_of_items.ts rename to x-pack/plugins/reporting/server/export_types/common/lib/screenshots/get_number_of_items.ts index 9e446f499ab3a..42eb91ecba830 100644 --- a/x-pack/legacy/plugins/reporting/export_types/common/lib/screenshots/get_number_of_items.ts +++ b/x-pack/plugins/reporting/server/export_types/common/lib/screenshots/get_number_of_items.ts @@ -5,9 +5,9 @@ */ import { i18n } from '@kbn/i18n'; -import { LevelLogger, startTrace } from '../../../../server/lib'; -import { HeadlessChromiumDriver } from '../../../../server/browsers'; -import { CaptureConfig } from '../../../../server/types'; +import { HeadlessChromiumDriver } from '../../../../browsers'; +import { LevelLogger, startTrace } from '../../../../lib'; +import { CaptureConfig } from '../../../../types'; import { LayoutInstance } from '../../layouts'; import { CONTEXT_GETNUMBEROFITEMS, CONTEXT_READMETADATA } from './constants'; diff --git a/x-pack/legacy/plugins/reporting/export_types/common/lib/screenshots/get_screenshots.ts b/x-pack/plugins/reporting/server/export_types/common/lib/screenshots/get_screenshots.ts similarity index 89% rename from x-pack/legacy/plugins/reporting/export_types/common/lib/screenshots/get_screenshots.ts rename to x-pack/plugins/reporting/server/export_types/common/lib/screenshots/get_screenshots.ts index 578a4dd0b975c..05c315b8341a3 100644 --- a/x-pack/legacy/plugins/reporting/export_types/common/lib/screenshots/get_screenshots.ts +++ b/x-pack/plugins/reporting/server/export_types/common/lib/screenshots/get_screenshots.ts @@ -5,9 +5,9 @@ */ import { i18n } from '@kbn/i18n'; -import { HeadlessChromiumDriver } from '../../../../server/browsers'; -import { LevelLogger, startTrace } from '../../../../server/lib'; -import { ElementsPositionAndAttribute, Screenshot } from '../../../../server/types'; +import { HeadlessChromiumDriver } from '../../../../browsers'; +import { LevelLogger, startTrace } from '../../../../lib'; +import { ElementsPositionAndAttribute, Screenshot } from '../../../../types'; export const getScreenshots = async ( browser: HeadlessChromiumDriver, diff --git a/x-pack/legacy/plugins/reporting/export_types/common/lib/screenshots/get_time_range.ts b/x-pack/plugins/reporting/server/export_types/common/lib/screenshots/get_time_range.ts similarity index 90% rename from x-pack/legacy/plugins/reporting/export_types/common/lib/screenshots/get_time_range.ts rename to x-pack/plugins/reporting/server/export_types/common/lib/screenshots/get_time_range.ts index 74926918584fe..ba68a5fec4e4c 100644 --- a/x-pack/legacy/plugins/reporting/export_types/common/lib/screenshots/get_time_range.ts +++ b/x-pack/plugins/reporting/server/export_types/common/lib/screenshots/get_time_range.ts @@ -4,8 +4,8 @@ * you may not use this file except in compliance with the Elastic License. */ -import { LevelLogger, startTrace } from '../../../../server/lib'; -import { HeadlessChromiumDriver } from '../../../../server/browsers'; +import { HeadlessChromiumDriver } from '../../../../browsers'; +import { LevelLogger, startTrace } from '../../../../lib'; import { LayoutInstance } from '../../layouts'; import { CONTEXT_GETTIMERANGE } from './constants'; diff --git a/x-pack/legacy/plugins/reporting/export_types/common/lib/screenshots/index.ts b/x-pack/plugins/reporting/server/export_types/common/lib/screenshots/index.ts similarity index 100% rename from x-pack/legacy/plugins/reporting/export_types/common/lib/screenshots/index.ts rename to x-pack/plugins/reporting/server/export_types/common/lib/screenshots/index.ts diff --git a/x-pack/legacy/plugins/reporting/export_types/common/lib/screenshots/inject_css.ts b/x-pack/plugins/reporting/server/export_types/common/lib/screenshots/inject_css.ts similarity index 92% rename from x-pack/legacy/plugins/reporting/export_types/common/lib/screenshots/inject_css.ts rename to x-pack/plugins/reporting/server/export_types/common/lib/screenshots/inject_css.ts index 8a198880a7768..d72afacc1bef3 100644 --- a/x-pack/legacy/plugins/reporting/export_types/common/lib/screenshots/inject_css.ts +++ b/x-pack/plugins/reporting/server/export_types/common/lib/screenshots/inject_css.ts @@ -7,8 +7,8 @@ import { i18n } from '@kbn/i18n'; import fs from 'fs'; import { promisify } from 'util'; -import { LevelLogger, startTrace } from '../../../../server/lib'; -import { HeadlessChromiumDriver } from '../../../../server/browsers'; +import { HeadlessChromiumDriver } from '../../../../browsers'; +import { LevelLogger, startTrace } from '../../../../lib'; import { Layout } from '../../layouts/layout'; import { CONTEXT_INJECTCSS } from './constants'; diff --git a/x-pack/legacy/plugins/reporting/export_types/common/lib/screenshots/observable.test.ts b/x-pack/plugins/reporting/server/export_types/common/lib/screenshots/observable.test.ts similarity index 97% rename from x-pack/legacy/plugins/reporting/export_types/common/lib/screenshots/observable.test.ts rename to x-pack/plugins/reporting/server/export_types/common/lib/screenshots/observable.test.ts index cc8b438310430..2ddb4a5d5b994 100644 --- a/x-pack/legacy/plugins/reporting/export_types/common/lib/screenshots/observable.test.ts +++ b/x-pack/plugins/reporting/server/export_types/common/lib/screenshots/observable.test.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -jest.mock('../../../../server/browsers/chromium/puppeteer', () => ({ +jest.mock('../../../../browsers/chromium/puppeteer', () => ({ puppeteerLaunch: () => ({ // Fixme needs event emitters newPage: () => ({ @@ -18,14 +18,10 @@ jest.mock('../../../../server/browsers/chromium/puppeteer', () => ({ import * as Rx from 'rxjs'; // eslint-disable-next-line @kbn/eslint/no-restricted-paths import { loggingServiceMock } from '../../../../../../../../src/core/server/mocks'; -import { HeadlessChromiumDriver } from '../../../../server/browsers'; -import { LevelLogger } from '../../../../server/lib'; -import { - CaptureConfig, - ConditionalHeaders, - ElementsPositionAndAttribute, -} from '../../../../server/types'; +import { HeadlessChromiumDriver } from '../../../../browsers'; +import { LevelLogger } from '../../../../lib'; import { createMockBrowserDriverFactory, createMockLayoutInstance } from '../../../../test_helpers'; +import { CaptureConfig, ConditionalHeaders, ElementsPositionAndAttribute } from '../../../../types'; import * as contexts from './constants'; import { screenshotsObservableFactory } from './observable'; diff --git a/x-pack/legacy/plugins/reporting/export_types/common/lib/screenshots/observable.ts b/x-pack/plugins/reporting/server/export_types/common/lib/screenshots/observable.ts similarity index 98% rename from x-pack/legacy/plugins/reporting/export_types/common/lib/screenshots/observable.ts rename to x-pack/plugins/reporting/server/export_types/common/lib/screenshots/observable.ts index bb11d1d3b7b63..028bff4aaa5ee 100644 --- a/x-pack/legacy/plugins/reporting/export_types/common/lib/screenshots/observable.ts +++ b/x-pack/plugins/reporting/server/export_types/common/lib/screenshots/observable.ts @@ -16,14 +16,14 @@ import { tap, toArray, } from 'rxjs/operators'; -import { HeadlessChromiumDriverFactory } from '../../../../server/browsers'; +import { HeadlessChromiumDriverFactory } from '../../../../browsers'; import { CaptureConfig, ElementsPositionAndAttribute, ScreenshotObservableOpts, ScreenshotResults, ScreenshotsObservableFn, -} from '../../../../server/types'; +} from '../../../../types'; import { DEFAULT_PAGELOAD_SELECTOR } from '../../constants'; import { getElementPositionAndAttributes } from './get_element_position_data'; import { getNumberOfItems } from './get_number_of_items'; diff --git a/x-pack/legacy/plugins/reporting/export_types/common/lib/screenshots/open_url.ts b/x-pack/plugins/reporting/server/export_types/common/lib/screenshots/open_url.ts similarity index 83% rename from x-pack/legacy/plugins/reporting/export_types/common/lib/screenshots/open_url.ts rename to x-pack/plugins/reporting/server/export_types/common/lib/screenshots/open_url.ts index 3cf962b8178fd..bd7e8c508c118 100644 --- a/x-pack/legacy/plugins/reporting/export_types/common/lib/screenshots/open_url.ts +++ b/x-pack/plugins/reporting/server/export_types/common/lib/screenshots/open_url.ts @@ -5,9 +5,9 @@ */ import { i18n } from '@kbn/i18n'; -import { HeadlessChromiumDriver } from '../../../../server/browsers'; -import { LevelLogger, startTrace } from '../../../../server/lib'; -import { CaptureConfig, ConditionalHeaders } from '../../../../server/types'; +import { HeadlessChromiumDriver } from '../../../../browsers'; +import { LevelLogger, startTrace } from '../../../../lib'; +import { CaptureConfig, ConditionalHeaders } from '../../../../types'; export const openUrl = async ( captureConfig: CaptureConfig, diff --git a/x-pack/legacy/plugins/reporting/export_types/common/lib/screenshots/wait_for_render.ts b/x-pack/plugins/reporting/server/export_types/common/lib/screenshots/wait_for_render.ts similarity index 93% rename from x-pack/legacy/plugins/reporting/export_types/common/lib/screenshots/wait_for_render.ts rename to x-pack/plugins/reporting/server/export_types/common/lib/screenshots/wait_for_render.ts index c31c55ea8dec6..b6519e914430a 100644 --- a/x-pack/legacy/plugins/reporting/export_types/common/lib/screenshots/wait_for_render.ts +++ b/x-pack/plugins/reporting/server/export_types/common/lib/screenshots/wait_for_render.ts @@ -5,9 +5,9 @@ */ import { i18n } from '@kbn/i18n'; -import { LevelLogger, startTrace } from '../../../../server/lib'; -import { HeadlessChromiumDriver } from '../../../../server/browsers'; -import { CaptureConfig } from '../../../../server/types'; +import { HeadlessChromiumDriver } from '../../../../browsers'; +import { LevelLogger, startTrace } from '../../../../lib'; +import { CaptureConfig } from '../../../../types'; import { LayoutInstance } from '../../layouts'; import { CONTEXT_WAITFORRENDER } from './constants'; diff --git a/x-pack/legacy/plugins/reporting/export_types/common/lib/screenshots/wait_for_visualizations.ts b/x-pack/plugins/reporting/server/export_types/common/lib/screenshots/wait_for_visualizations.ts similarity index 91% rename from x-pack/legacy/plugins/reporting/export_types/common/lib/screenshots/wait_for_visualizations.ts rename to x-pack/plugins/reporting/server/export_types/common/lib/screenshots/wait_for_visualizations.ts index ff84d06956dbc..75a7b6516473c 100644 --- a/x-pack/legacy/plugins/reporting/export_types/common/lib/screenshots/wait_for_visualizations.ts +++ b/x-pack/plugins/reporting/server/export_types/common/lib/screenshots/wait_for_visualizations.ts @@ -5,9 +5,9 @@ */ import { i18n } from '@kbn/i18n'; -import { LevelLogger, startTrace } from '../../../../server/lib'; -import { HeadlessChromiumDriver } from '../../../../server/browsers'; -import { CaptureConfig } from '../../../../server/types'; +import { HeadlessChromiumDriver } from '../../../../browsers'; +import { LevelLogger, startTrace } from '../../../../lib'; +import { CaptureConfig } from '../../../../types'; import { LayoutInstance } from '../../layouts'; import { CONTEXT_WAITFORELEMENTSTOBEINDOM } from './constants'; diff --git a/x-pack/legacy/plugins/reporting/export_types/csv/index.ts b/x-pack/plugins/reporting/server/export_types/csv/index.ts similarity index 85% rename from x-pack/legacy/plugins/reporting/export_types/csv/index.ts rename to x-pack/plugins/reporting/server/export_types/csv/index.ts index cdb4c36dba3df..8642a6d5758a8 100644 --- a/x-pack/legacy/plugins/reporting/export_types/csv/index.ts +++ b/x-pack/plugins/reporting/server/export_types/csv/index.ts @@ -5,19 +5,15 @@ */ import { - CSV_JOB_TYPE as jobType, LICENSE_TYPE_BASIC, LICENSE_TYPE_ENTERPRISE, LICENSE_TYPE_GOLD, LICENSE_TYPE_PLATINUM, LICENSE_TYPE_STANDARD, LICENSE_TYPE_TRIAL, -} from '../../common/constants'; -import { - ESQueueCreateJobFn, - ESQueueWorkerExecuteFn, - ExportTypeDefinition, -} from '../../server/types'; +} from '../../../common/constants'; +import { CSV_JOB_TYPE as jobType } from '../../../constants'; +import { ESQueueCreateJobFn, ESQueueWorkerExecuteFn, ExportTypeDefinition } from '../../types'; import { metadata } from './metadata'; import { createJobFactory } from './server/create_job'; import { executeJobFactory } from './server/execute_job'; diff --git a/x-pack/legacy/plugins/reporting/export_types/csv/metadata.ts b/x-pack/plugins/reporting/server/export_types/csv/metadata.ts similarity index 100% rename from x-pack/legacy/plugins/reporting/export_types/csv/metadata.ts rename to x-pack/plugins/reporting/server/export_types/csv/metadata.ts diff --git a/x-pack/legacy/plugins/reporting/export_types/csv/server/create_job.ts b/x-pack/plugins/reporting/server/export_types/csv/server/create_job.ts similarity index 87% rename from x-pack/legacy/plugins/reporting/export_types/csv/server/create_job.ts rename to x-pack/plugins/reporting/server/export_types/csv/server/create_job.ts index c76b4afe727da..acf7f0505a735 100644 --- a/x-pack/legacy/plugins/reporting/export_types/csv/server/create_job.ts +++ b/x-pack/plugins/reporting/server/export_types/csv/server/create_job.ts @@ -5,9 +5,9 @@ */ import { KibanaRequest, RequestHandlerContext } from 'src/core/server'; -import { ReportingCore } from '../../../server'; -import { cryptoFactory } from '../../../server/lib'; -import { CreateJobFactory, ESQueueCreateJobFn } from '../../../server/types'; +import { ReportingCore } from '../../../'; +import { cryptoFactory } from '../../../lib'; +import { CreateJobFactory, ESQueueCreateJobFn } from '../../../types'; import { JobParamsDiscoverCsv } from '../types'; export const createJobFactory: CreateJobFactory Promise.resolve(mockUiSettingsClient); - mockReportingPlugin.getElasticsearchService = () => Promise.resolve(mockElasticsearch); + mockReportingCore = await createMockReportingCore(mockReportingConfig); + mockReportingCore.getUiSettingsServiceFactory = () => Promise.resolve(mockUiSettingsClient); + mockReportingCore.getElasticsearchService = () => Promise.resolve(mockElasticsearch); + mockReportingCore.config = mockReportingConfig; cancellationToken = new CancellationToken(); @@ -116,7 +117,7 @@ describe('CSV Execute Job', function () { describe('basic Elasticsearch call behavior', function () { it('should decrypt encrypted headers and pass to callAsCurrentUser', async function () { - const executeJob = await executeJobFactory(mockReportingPlugin, mockLogger); + const executeJob = await executeJobFactory(mockReportingCore, mockLogger); await executeJob( 'job456', getJobDocPayload({ @@ -136,7 +137,7 @@ describe('CSV Execute Job', function () { testBody: true, }; - const executeJob = await executeJobFactory(mockReportingPlugin, mockLogger); + const executeJob = await executeJobFactory(mockReportingCore, mockLogger); const job = getJobDocPayload({ headers: encryptedHeaders, fields: [], @@ -163,7 +164,7 @@ describe('CSV Execute Job', function () { _scroll_id: scrollId, }); callAsCurrentUserStub.onSecondCall().resolves(defaultElasticsearchResponse); - const executeJob = await executeJobFactory(mockReportingPlugin, mockLogger); + const executeJob = await executeJobFactory(mockReportingCore, mockLogger); await executeJob( 'job456', getJobDocPayload({ @@ -181,7 +182,7 @@ describe('CSV Execute Job', function () { }); it('should not execute scroll if there are no hits from the search', async function () { - const executeJob = await executeJobFactory(mockReportingPlugin, mockLogger); + const executeJob = await executeJobFactory(mockReportingCore, mockLogger); await executeJob( 'job456', getJobDocPayload({ @@ -215,7 +216,7 @@ describe('CSV Execute Job', function () { _scroll_id: 'scrollId', }); - const executeJob = await executeJobFactory(mockReportingPlugin, mockLogger); + const executeJob = await executeJobFactory(mockReportingCore, mockLogger); await executeJob( 'job456', getJobDocPayload({ @@ -254,7 +255,7 @@ describe('CSV Execute Job', function () { _scroll_id: lastScrollId, }); - const executeJob = await executeJobFactory(mockReportingPlugin, mockLogger); + const executeJob = await executeJobFactory(mockReportingCore, mockLogger); await executeJob( 'job456', getJobDocPayload({ @@ -286,7 +287,7 @@ describe('CSV Execute Job', function () { _scroll_id: lastScrollId, }); - const executeJob = await executeJobFactory(mockReportingPlugin, mockLogger); + const executeJob = await executeJobFactory(mockReportingCore, mockLogger); const jobParams = getJobDocPayload({ headers: encryptedHeaders, fields: ['one', 'two'], @@ -313,7 +314,7 @@ describe('CSV Execute Job', function () { _scroll_id: 'scrollId', }); - const executeJob = await executeJobFactory(mockReportingPlugin, mockLogger); + const executeJob = await executeJobFactory(mockReportingCore, mockLogger); const jobParams = getJobDocPayload({ headers: encryptedHeaders, fields: ['one', 'two'], @@ -338,7 +339,7 @@ describe('CSV Execute Job', function () { _scroll_id: 'scrollId', }); - const executeJob = await executeJobFactory(mockReportingPlugin, mockLogger); + const executeJob = await executeJobFactory(mockReportingCore, mockLogger); const jobParams = getJobDocPayload({ headers: encryptedHeaders, fields: ['=SUM(A1:A2)', 'two'], @@ -364,7 +365,7 @@ describe('CSV Execute Job', function () { _scroll_id: 'scrollId', }); - const executeJob = await executeJobFactory(mockReportingPlugin, mockLogger); + const executeJob = await executeJobFactory(mockReportingCore, mockLogger); const jobParams = getJobDocPayload({ headers: encryptedHeaders, fields: ['one', 'two'], @@ -390,7 +391,7 @@ describe('CSV Execute Job', function () { _scroll_id: 'scrollId', }); - const executeJob = await executeJobFactory(mockReportingPlugin, mockLogger); + const executeJob = await executeJobFactory(mockReportingCore, mockLogger); const jobParams = getJobDocPayload({ headers: encryptedHeaders, fields: ['=SUM(A1:A2)', 'two'], @@ -416,7 +417,7 @@ describe('CSV Execute Job', function () { _scroll_id: 'scrollId', }); - const executeJob = await executeJobFactory(mockReportingPlugin, mockLogger); + const executeJob = await executeJobFactory(mockReportingCore, mockLogger); const jobParams = getJobDocPayload({ headers: encryptedHeaders, fields: ['one', 'two'], @@ -443,7 +444,7 @@ describe('CSV Execute Job', function () { _scroll_id: 'scrollId', }); - const executeJob = await executeJobFactory(mockReportingPlugin, mockLogger); + const executeJob = await executeJobFactory(mockReportingCore, mockLogger); const jobParams = getJobDocPayload({ headers: encryptedHeaders, fields: ['one', 'two'], @@ -464,7 +465,7 @@ describe('CSV Execute Job', function () { _scroll_id: 'scrollId', }); - const executeJob = await executeJobFactory(mockReportingPlugin, mockLogger); + const executeJob = await executeJobFactory(mockReportingCore, mockLogger); const jobParams = getJobDocPayload({ headers: encryptedHeaders, fields: ['one', 'two'], @@ -487,7 +488,7 @@ describe('CSV Execute Job', function () { _scroll_id: 'scrollId', }); - const executeJob = await executeJobFactory(mockReportingPlugin, mockLogger); + const executeJob = await executeJobFactory(mockReportingCore, mockLogger); const jobParams = getJobDocPayload({ headers: encryptedHeaders, fields: ['one', 'two'], @@ -508,7 +509,7 @@ describe('CSV Execute Job', function () { _scroll_id: 'scrollId', }); - const executeJob = await executeJobFactory(mockReportingPlugin, mockLogger); + const executeJob = await executeJobFactory(mockReportingCore, mockLogger); const jobParams = getJobDocPayload({ headers: encryptedHeaders, fields: ['one', 'two'], @@ -524,7 +525,7 @@ describe('CSV Execute Job', function () { describe('Elasticsearch call errors', function () { it('should reject Promise if search call errors out', async function () { callAsCurrentUserStub.rejects(new Error()); - const executeJob = await executeJobFactory(mockReportingPlugin, mockLogger); + const executeJob = await executeJobFactory(mockReportingCore, mockLogger); const jobParams = getJobDocPayload({ headers: encryptedHeaders, fields: [], @@ -543,7 +544,7 @@ describe('CSV Execute Job', function () { _scroll_id: 'scrollId', }); callAsCurrentUserStub.onSecondCall().rejects(new Error()); - const executeJob = await executeJobFactory(mockReportingPlugin, mockLogger); + const executeJob = await executeJobFactory(mockReportingCore, mockLogger); const jobParams = getJobDocPayload({ headers: encryptedHeaders, fields: [], @@ -564,7 +565,7 @@ describe('CSV Execute Job', function () { _scroll_id: undefined, }); - const executeJob = await executeJobFactory(mockReportingPlugin, mockLogger); + const executeJob = await executeJobFactory(mockReportingCore, mockLogger); const jobParams = getJobDocPayload({ headers: encryptedHeaders, fields: [], @@ -585,7 +586,7 @@ describe('CSV Execute Job', function () { _scroll_id: undefined, }); - const executeJob = await executeJobFactory(mockReportingPlugin, mockLogger); + const executeJob = await executeJobFactory(mockReportingCore, mockLogger); const jobParams = getJobDocPayload({ headers: encryptedHeaders, fields: [], @@ -613,7 +614,7 @@ describe('CSV Execute Job', function () { _scroll_id: undefined, }); - const executeJob = await executeJobFactory(mockReportingPlugin, mockLogger); + const executeJob = await executeJobFactory(mockReportingCore, mockLogger); const jobParams = getJobDocPayload({ headers: encryptedHeaders, fields: [], @@ -641,7 +642,7 @@ describe('CSV Execute Job', function () { _scroll_id: undefined, }); - const executeJob = await executeJobFactory(mockReportingPlugin, mockLogger); + const executeJob = await executeJobFactory(mockReportingCore, mockLogger); const jobParams = getJobDocPayload({ headers: encryptedHeaders, fields: [], @@ -677,7 +678,7 @@ describe('CSV Execute Job', function () { }); it('should stop calling Elasticsearch when cancellationToken.cancel is called', async function () { - const executeJob = await executeJobFactory(mockReportingPlugin, mockLogger); + const executeJob = await executeJobFactory(mockReportingCore, mockLogger); executeJob( 'job345', getJobDocPayload({ @@ -696,7 +697,7 @@ describe('CSV Execute Job', function () { }); it(`shouldn't call clearScroll if it never got a scrollId`, async function () { - const executeJob = await executeJobFactory(mockReportingPlugin, mockLogger); + const executeJob = await executeJobFactory(mockReportingCore, mockLogger); executeJob( 'job345', getJobDocPayload({ @@ -714,7 +715,7 @@ describe('CSV Execute Job', function () { }); it('should call clearScroll if it got a scrollId', async function () { - const executeJob = await executeJobFactory(mockReportingPlugin, mockLogger); + const executeJob = await executeJobFactory(mockReportingCore, mockLogger); executeJob( 'job345', getJobDocPayload({ @@ -736,7 +737,7 @@ describe('CSV Execute Job', function () { describe('csv content', function () { it('should write column headers to output, even if there are no results', async function () { - const executeJob = await executeJobFactory(mockReportingPlugin, mockLogger); + const executeJob = await executeJobFactory(mockReportingCore, mockLogger); const jobParams = getJobDocPayload({ headers: encryptedHeaders, fields: ['one', 'two'], @@ -748,7 +749,7 @@ describe('CSV Execute Job', function () { it('should use custom uiSettings csv:separator for header', async function () { mockUiSettingsClient.get.withArgs('csv:separator').returns(';'); - const executeJob = await executeJobFactory(mockReportingPlugin, mockLogger); + const executeJob = await executeJobFactory(mockReportingCore, mockLogger); const jobParams = getJobDocPayload({ headers: encryptedHeaders, fields: ['one', 'two'], @@ -760,7 +761,7 @@ describe('CSV Execute Job', function () { it('should escape column headers if uiSettings csv:quoteValues is true', async function () { mockUiSettingsClient.get.withArgs('csv:quoteValues').returns(true); - const executeJob = await executeJobFactory(mockReportingPlugin, mockLogger); + const executeJob = await executeJobFactory(mockReportingCore, mockLogger); const jobParams = getJobDocPayload({ headers: encryptedHeaders, fields: ['one and a half', 'two', 'three-and-four', 'five & six'], @@ -772,7 +773,7 @@ describe('CSV Execute Job', function () { it(`shouldn't escape column headers if uiSettings csv:quoteValues is false`, async function () { mockUiSettingsClient.get.withArgs('csv:quoteValues').returns(false); - const executeJob = await executeJobFactory(mockReportingPlugin, mockLogger); + const executeJob = await executeJobFactory(mockReportingCore, mockLogger); const jobParams = getJobDocPayload({ headers: encryptedHeaders, fields: ['one and a half', 'two', 'three-and-four', 'five & six'], @@ -783,7 +784,7 @@ describe('CSV Execute Job', function () { }); it('should write column headers to output, when there are results', async function () { - const executeJob = await executeJobFactory(mockReportingPlugin, mockLogger); + const executeJob = await executeJobFactory(mockReportingCore, mockLogger); callAsCurrentUserStub.onFirstCall().resolves({ hits: { hits: [{ one: '1', two: '2' }], @@ -803,7 +804,7 @@ describe('CSV Execute Job', function () { }); it('should use comma separated values of non-nested fields from _source', async function () { - const executeJob = await executeJobFactory(mockReportingPlugin, mockLogger); + const executeJob = await executeJobFactory(mockReportingCore, mockLogger); callAsCurrentUserStub.onFirstCall().resolves({ hits: { hits: [{ _source: { one: 'foo', two: 'bar' } }], @@ -824,7 +825,7 @@ describe('CSV Execute Job', function () { }); it('should concatenate the hits from multiple responses', async function () { - const executeJob = await executeJobFactory(mockReportingPlugin, mockLogger); + const executeJob = await executeJobFactory(mockReportingCore, mockLogger); callAsCurrentUserStub.onFirstCall().resolves({ hits: { hits: [{ _source: { one: 'foo', two: 'bar' } }], @@ -852,7 +853,7 @@ describe('CSV Execute Job', function () { }); it('should use field formatters to format fields', async function () { - const executeJob = await executeJobFactory(mockReportingPlugin, mockLogger); + const executeJob = await executeJobFactory(mockReportingCore, mockLogger); callAsCurrentUserStub.onFirstCall().resolves({ hits: { hits: [{ _source: { one: 'foo', two: 'bar' } }], @@ -894,7 +895,7 @@ describe('CSV Execute Job', function () { beforeEach(async function () { configGetStub.withArgs('csv', 'maxSizeBytes').returns(1); - const executeJob = await executeJobFactory(mockReportingPlugin, mockLogger); + const executeJob = await executeJobFactory(mockReportingCore, mockLogger); const jobParams = getJobDocPayload({ headers: encryptedHeaders, fields: ['one', 'two'], @@ -924,7 +925,7 @@ describe('CSV Execute Job', function () { beforeEach(async function () { configGetStub.withArgs('csv', 'maxSizeBytes').returns(9); - const executeJob = await executeJobFactory(mockReportingPlugin, mockLogger); + const executeJob = await executeJobFactory(mockReportingCore, mockLogger); const jobParams = getJobDocPayload({ headers: encryptedHeaders, fields: ['one', 'two'], @@ -961,7 +962,7 @@ describe('CSV Execute Job', function () { _scroll_id: 'scrollId', }); - const executeJob = await executeJobFactory(mockReportingPlugin, mockLogger); + const executeJob = await executeJobFactory(mockReportingCore, mockLogger); const jobParams = getJobDocPayload({ headers: encryptedHeaders, fields: ['one', 'two'], @@ -990,7 +991,7 @@ describe('CSV Execute Job', function () { let maxSizeReached: boolean; beforeEach(async function () { - mockReportingPlugin.getUiSettingsServiceFactory = () => mockUiSettingsClient; + mockReportingCore.getUiSettingsServiceFactory = () => mockUiSettingsClient; configGetStub.withArgs('csv', 'maxSizeBytes').returns(18); callAsCurrentUserStub.onFirstCall().returns({ @@ -1000,7 +1001,7 @@ describe('CSV Execute Job', function () { _scroll_id: 'scrollId', }); - const executeJob = await executeJobFactory(mockReportingPlugin, mockLogger); + const executeJob = await executeJobFactory(mockReportingCore, mockLogger); const jobParams = getJobDocPayload({ headers: encryptedHeaders, fields: ['one', 'two'], @@ -1037,7 +1038,7 @@ describe('CSV Execute Job', function () { _scroll_id: 'scrollId', }); - const executeJob = await executeJobFactory(mockReportingPlugin, mockLogger); + const executeJob = await executeJobFactory(mockReportingCore, mockLogger); const jobParams = getJobDocPayload({ headers: encryptedHeaders, fields: ['one', 'two'], @@ -1063,7 +1064,7 @@ describe('CSV Execute Job', function () { _scroll_id: 'scrollId', }); - const executeJob = await executeJobFactory(mockReportingPlugin, mockLogger); + const executeJob = await executeJobFactory(mockReportingCore, mockLogger); const jobParams = getJobDocPayload({ headers: encryptedHeaders, fields: ['one', 'two'], @@ -1089,7 +1090,7 @@ describe('CSV Execute Job', function () { _scroll_id: 'scrollId', }); - const executeJob = await executeJobFactory(mockReportingPlugin, mockLogger); + const executeJob = await executeJobFactory(mockReportingCore, mockLogger); const jobParams = getJobDocPayload({ headers: encryptedHeaders, fields: ['one', 'two'], diff --git a/x-pack/legacy/plugins/reporting/export_types/csv/server/execute_job.ts b/x-pack/plugins/reporting/server/export_types/csv/server/execute_job.ts similarity index 95% rename from x-pack/legacy/plugins/reporting/export_types/csv/server/execute_job.ts rename to x-pack/plugins/reporting/server/export_types/csv/server/execute_job.ts index a6b2b0d0561d0..de5ddb2503b2f 100644 --- a/x-pack/legacy/plugins/reporting/export_types/csv/server/execute_job.ts +++ b/x-pack/plugins/reporting/server/export_types/csv/server/execute_job.ts @@ -7,11 +7,11 @@ import { i18n } from '@kbn/i18n'; import Hapi from 'hapi'; import { IUiSettingsClient, KibanaRequest } from '../../../../../../../src/core/server'; -import { CSV_BOM_CHARS, CSV_JOB_TYPE } from '../../../common/constants'; -import { ReportingCore } from '../../../server'; -import { cryptoFactory, LevelLogger } from '../../../server/lib'; -import { getFieldFormats } from '../../../server/services'; -import { ESQueueWorkerExecuteFn, ExecuteJobFactory } from '../../../server/types'; +import { ReportingCore } from '../../..'; +import { CSV_BOM_CHARS, CSV_JOB_TYPE } from '../../../../common/constants'; +import { getFieldFormats } from '../../../../server/services'; +import { cryptoFactory, LevelLogger } from '../../../lib'; +import { ESQueueWorkerExecuteFn, ExecuteJobFactory } from '../../../types'; import { JobDocPayloadDiscoverCsv } from '../types'; import { fieldFormatMapFactory } from './lib/field_format_map'; import { createGenerateCsv } from './lib/generate_csv'; diff --git a/x-pack/legacy/plugins/reporting/export_types/csv/server/lib/cell_has_formula.ts b/x-pack/plugins/reporting/server/export_types/csv/server/lib/cell_has_formula.ts similarity index 85% rename from x-pack/legacy/plugins/reporting/export_types/csv/server/lib/cell_has_formula.ts rename to x-pack/plugins/reporting/server/export_types/csv/server/lib/cell_has_formula.ts index 1433d852ce630..659aef85ed593 100644 --- a/x-pack/legacy/plugins/reporting/export_types/csv/server/lib/cell_has_formula.ts +++ b/x-pack/plugins/reporting/server/export_types/csv/server/lib/cell_has_formula.ts @@ -5,7 +5,7 @@ */ import { startsWith } from 'lodash'; -import { CSV_FORMULA_CHARS } from '../../../../common/constants'; +import { CSV_FORMULA_CHARS } from '../../../../../common/constants'; export const cellHasFormulas = (val: string) => CSV_FORMULA_CHARS.some((formulaChar) => startsWith(val, formulaChar)); diff --git a/x-pack/legacy/plugins/reporting/export_types/csv/server/lib/check_cells_for_formulas.test.ts b/x-pack/plugins/reporting/server/export_types/csv/server/lib/check_cells_for_formulas.test.ts similarity index 100% rename from x-pack/legacy/plugins/reporting/export_types/csv/server/lib/check_cells_for_formulas.test.ts rename to x-pack/plugins/reporting/server/export_types/csv/server/lib/check_cells_for_formulas.test.ts diff --git a/x-pack/legacy/plugins/reporting/export_types/csv/server/lib/check_cells_for_formulas.ts b/x-pack/plugins/reporting/server/export_types/csv/server/lib/check_cells_for_formulas.ts similarity index 100% rename from x-pack/legacy/plugins/reporting/export_types/csv/server/lib/check_cells_for_formulas.ts rename to x-pack/plugins/reporting/server/export_types/csv/server/lib/check_cells_for_formulas.ts diff --git a/x-pack/legacy/plugins/reporting/export_types/csv/server/lib/escape_value.test.ts b/x-pack/plugins/reporting/server/export_types/csv/server/lib/escape_value.test.ts similarity index 100% rename from x-pack/legacy/plugins/reporting/export_types/csv/server/lib/escape_value.test.ts rename to x-pack/plugins/reporting/server/export_types/csv/server/lib/escape_value.test.ts diff --git a/x-pack/legacy/plugins/reporting/export_types/csv/server/lib/escape_value.ts b/x-pack/plugins/reporting/server/export_types/csv/server/lib/escape_value.ts similarity index 100% rename from x-pack/legacy/plugins/reporting/export_types/csv/server/lib/escape_value.ts rename to x-pack/plugins/reporting/server/export_types/csv/server/lib/escape_value.ts diff --git a/x-pack/legacy/plugins/reporting/export_types/csv/server/lib/field_format_map.test.ts b/x-pack/plugins/reporting/server/export_types/csv/server/lib/field_format_map.test.ts similarity index 100% rename from x-pack/legacy/plugins/reporting/export_types/csv/server/lib/field_format_map.test.ts rename to x-pack/plugins/reporting/server/export_types/csv/server/lib/field_format_map.test.ts diff --git a/x-pack/legacy/plugins/reporting/export_types/csv/server/lib/field_format_map.ts b/x-pack/plugins/reporting/server/export_types/csv/server/lib/field_format_map.ts similarity index 100% rename from x-pack/legacy/plugins/reporting/export_types/csv/server/lib/field_format_map.ts rename to x-pack/plugins/reporting/server/export_types/csv/server/lib/field_format_map.ts diff --git a/x-pack/legacy/plugins/reporting/export_types/csv/server/lib/flatten_hit.test.ts b/x-pack/plugins/reporting/server/export_types/csv/server/lib/flatten_hit.test.ts similarity index 100% rename from x-pack/legacy/plugins/reporting/export_types/csv/server/lib/flatten_hit.test.ts rename to x-pack/plugins/reporting/server/export_types/csv/server/lib/flatten_hit.test.ts diff --git a/x-pack/legacy/plugins/reporting/export_types/csv/server/lib/flatten_hit.ts b/x-pack/plugins/reporting/server/export_types/csv/server/lib/flatten_hit.ts similarity index 100% rename from x-pack/legacy/plugins/reporting/export_types/csv/server/lib/flatten_hit.ts rename to x-pack/plugins/reporting/server/export_types/csv/server/lib/flatten_hit.ts diff --git a/x-pack/legacy/plugins/reporting/export_types/csv/server/lib/format_csv_values.test.ts b/x-pack/plugins/reporting/server/export_types/csv/server/lib/format_csv_values.test.ts similarity index 100% rename from x-pack/legacy/plugins/reporting/export_types/csv/server/lib/format_csv_values.test.ts rename to x-pack/plugins/reporting/server/export_types/csv/server/lib/format_csv_values.test.ts diff --git a/x-pack/legacy/plugins/reporting/export_types/csv/server/lib/format_csv_values.ts b/x-pack/plugins/reporting/server/export_types/csv/server/lib/format_csv_values.ts similarity index 100% rename from x-pack/legacy/plugins/reporting/export_types/csv/server/lib/format_csv_values.ts rename to x-pack/plugins/reporting/server/export_types/csv/server/lib/format_csv_values.ts diff --git a/x-pack/legacy/plugins/reporting/export_types/csv/server/lib/generate_csv.ts b/x-pack/plugins/reporting/server/export_types/csv/server/lib/generate_csv.ts similarity index 98% rename from x-pack/legacy/plugins/reporting/export_types/csv/server/lib/generate_csv.ts rename to x-pack/plugins/reporting/server/export_types/csv/server/lib/generate_csv.ts index a8fdd8d1a5bbc..019fa3c9c8e9d 100644 --- a/x-pack/legacy/plugins/reporting/export_types/csv/server/lib/generate_csv.ts +++ b/x-pack/plugins/reporting/server/export_types/csv/server/lib/generate_csv.ts @@ -5,7 +5,7 @@ */ import { i18n } from '@kbn/i18n'; -import { LevelLogger } from '../../../../server/lib'; +import { LevelLogger } from '../../../../lib'; import { GenerateCsvParams, SavedSearchGeneratorResult } from '../../types'; import { createFlattenHit } from './flatten_hit'; import { createFormatCsvValues } from './format_csv_values'; diff --git a/x-pack/legacy/plugins/reporting/export_types/csv/server/lib/hit_iterator.test.ts b/x-pack/plugins/reporting/server/export_types/csv/server/lib/hit_iterator.test.ts similarity index 95% rename from x-pack/legacy/plugins/reporting/export_types/csv/server/lib/hit_iterator.test.ts rename to x-pack/plugins/reporting/server/export_types/csv/server/lib/hit_iterator.test.ts index 7ef4f502b34a3..479879e3c8b01 100644 --- a/x-pack/legacy/plugins/reporting/export_types/csv/server/lib/hit_iterator.test.ts +++ b/x-pack/plugins/reporting/server/export_types/csv/server/lib/hit_iterator.test.ts @@ -6,9 +6,9 @@ import expect from '@kbn/expect'; import sinon from 'sinon'; -import { CancellationToken } from '../../../../../../../plugins/reporting/common'; -import { LevelLogger } from '../../../../server/lib'; -import { ScrollConfig } from '../../../../server/types'; +import { CancellationToken } from '../../../../../common'; +import { LevelLogger } from '../../../../lib'; +import { ScrollConfig } from '../../../../types'; import { createHitIterator } from './hit_iterator'; const mockLogger = { diff --git a/x-pack/legacy/plugins/reporting/export_types/csv/server/lib/hit_iterator.ts b/x-pack/plugins/reporting/server/export_types/csv/server/lib/hit_iterator.ts similarity index 93% rename from x-pack/legacy/plugins/reporting/export_types/csv/server/lib/hit_iterator.ts rename to x-pack/plugins/reporting/server/export_types/csv/server/lib/hit_iterator.ts index 803161910443e..38b28573d602d 100644 --- a/x-pack/legacy/plugins/reporting/export_types/csv/server/lib/hit_iterator.ts +++ b/x-pack/plugins/reporting/server/export_types/csv/server/lib/hit_iterator.ts @@ -6,9 +6,9 @@ import { i18n } from '@kbn/i18n'; import { SearchParams, SearchResponse } from 'elasticsearch'; -import { CancellationToken } from '../../../../../../../plugins/reporting/common'; -import { LevelLogger } from '../../../../server/lib'; -import { ScrollConfig } from '../../../../server/types'; +import { CancellationToken } from '../../../../../common'; +import { LevelLogger } from '../../../../lib'; +import { ScrollConfig } from '../../../../types'; async function parseResponse(request: SearchResponse) { const response = await request; diff --git a/x-pack/legacy/plugins/reporting/export_types/csv/server/lib/max_size_string_builder.test.ts b/x-pack/plugins/reporting/server/export_types/csv/server/lib/max_size_string_builder.test.ts similarity index 100% rename from x-pack/legacy/plugins/reporting/export_types/csv/server/lib/max_size_string_builder.test.ts rename to x-pack/plugins/reporting/server/export_types/csv/server/lib/max_size_string_builder.test.ts diff --git a/x-pack/legacy/plugins/reporting/export_types/csv/server/lib/max_size_string_builder.ts b/x-pack/plugins/reporting/server/export_types/csv/server/lib/max_size_string_builder.ts similarity index 100% rename from x-pack/legacy/plugins/reporting/export_types/csv/server/lib/max_size_string_builder.ts rename to x-pack/plugins/reporting/server/export_types/csv/server/lib/max_size_string_builder.ts diff --git a/x-pack/legacy/plugins/reporting/export_types/csv/types.d.ts b/x-pack/plugins/reporting/server/export_types/csv/types.d.ts similarity index 93% rename from x-pack/legacy/plugins/reporting/export_types/csv/types.d.ts rename to x-pack/plugins/reporting/server/export_types/csv/types.d.ts index 0f6223d8553de..c80cd5fd24fe5 100644 --- a/x-pack/legacy/plugins/reporting/export_types/csv/types.d.ts +++ b/x-pack/plugins/reporting/server/export_types/csv/types.d.ts @@ -4,8 +4,8 @@ * you may not use this file except in compliance with the Elastic License. */ -import { CancellationToken } from '../../../../../plugins/reporting/common'; -import { JobDocPayload, JobParamPostPayload, ScrollConfig } from '../../server/types'; +import { CancellationToken } from '../../../common'; +import { JobParamPostPayload, JobDocPayload, ScrollConfig } from '../../types'; export type RawValue = string | object | null | undefined; diff --git a/x-pack/legacy/plugins/reporting/export_types/csv_from_savedobject/index.ts b/x-pack/plugins/reporting/server/export_types/csv_from_savedobject/index.ts similarity index 89% rename from x-pack/legacy/plugins/reporting/export_types/csv_from_savedobject/index.ts rename to x-pack/plugins/reporting/server/export_types/csv_from_savedobject/index.ts index 570b91600cbe0..65802ee5bb7fb 100644 --- a/x-pack/legacy/plugins/reporting/export_types/csv_from_savedobject/index.ts +++ b/x-pack/plugins/reporting/server/export_types/csv_from_savedobject/index.ts @@ -5,15 +5,15 @@ */ import { - CSV_FROM_SAVEDOBJECT_JOB_TYPE, LICENSE_TYPE_BASIC, LICENSE_TYPE_ENTERPRISE, LICENSE_TYPE_GOLD, LICENSE_TYPE_PLATINUM, LICENSE_TYPE_STANDARD, LICENSE_TYPE_TRIAL, -} from '../../common/constants'; -import { ExportTypeDefinition } from '../../server/types'; +} from '../../../common/constants'; +import { CSV_FROM_SAVEDOBJECT_JOB_TYPE } from '../../../constants'; +import { ExportTypeDefinition } from '../../types'; import { metadata } from './metadata'; import { createJobFactory, ImmediateCreateJobFn } from './server/create_job'; import { executeJobFactory, ImmediateExecuteFn } from './server/execute_job'; diff --git a/x-pack/legacy/plugins/reporting/export_types/csv_from_savedobject/metadata.ts b/x-pack/plugins/reporting/server/export_types/csv_from_savedobject/metadata.ts similarity index 82% rename from x-pack/legacy/plugins/reporting/export_types/csv_from_savedobject/metadata.ts rename to x-pack/plugins/reporting/server/export_types/csv_from_savedobject/metadata.ts index fcef889e52fe4..a0fd8a29fdcc4 100644 --- a/x-pack/legacy/plugins/reporting/export_types/csv_from_savedobject/metadata.ts +++ b/x-pack/plugins/reporting/server/export_types/csv_from_savedobject/metadata.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { CSV_FROM_SAVEDOBJECT_JOB_TYPE } from '../../common/constants'; +import { CSV_FROM_SAVEDOBJECT_JOB_TYPE } from '../../../constants'; export const metadata = { id: CSV_FROM_SAVEDOBJECT_JOB_TYPE, diff --git a/x-pack/legacy/plugins/reporting/export_types/csv_from_savedobject/server/create_job/create_job.ts b/x-pack/plugins/reporting/server/export_types/csv_from_savedobject/server/create_job/create_job.ts similarity index 92% rename from x-pack/legacy/plugins/reporting/export_types/csv_from_savedobject/server/create_job/create_job.ts rename to x-pack/plugins/reporting/server/export_types/csv_from_savedobject/server/create_job/create_job.ts index d23f60d9c2480..c187da5104d3f 100644 --- a/x-pack/legacy/plugins/reporting/export_types/csv_from_savedobject/server/create_job/create_job.ts +++ b/x-pack/plugins/reporting/server/export_types/csv_from_savedobject/server/create_job/create_job.ts @@ -7,10 +7,10 @@ import { notFound, notImplemented } from 'boom'; import { get } from 'lodash'; import { KibanaRequest, RequestHandlerContext } from 'src/core/server'; -import { CSV_FROM_SAVEDOBJECT_JOB_TYPE } from '../../../../common/constants'; -import { ReportingCore } from '../../../../server'; -import { cryptoFactory, LevelLogger } from '../../../../server/lib'; -import { CreateJobFactory, TimeRangeParams } from '../../../../server/types'; +import { ReportingCore } from '../../../..'; +import { CSV_FROM_SAVEDOBJECT_JOB_TYPE } from '../../../../../common/constants'; +import { cryptoFactory, LevelLogger } from '../../../../lib'; +import { CreateJobFactory, TimeRangeParams } from '../../../../types'; import { JobDocPayloadPanelCsv, JobParamsPanelCsv, diff --git a/x-pack/legacy/plugins/reporting/export_types/csv_from_savedobject/server/create_job/create_job_search.ts b/x-pack/plugins/reporting/server/export_types/csv_from_savedobject/server/create_job/create_job_search.ts similarity index 95% rename from x-pack/legacy/plugins/reporting/export_types/csv_from_savedobject/server/create_job/create_job_search.ts rename to x-pack/plugins/reporting/server/export_types/csv_from_savedobject/server/create_job/create_job_search.ts index 19204ef81c5eb..02abfb90091a1 100644 --- a/x-pack/legacy/plugins/reporting/export_types/csv_from_savedobject/server/create_job/create_job_search.ts +++ b/x-pack/plugins/reporting/server/export_types/csv_from_savedobject/server/create_job/create_job_search.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { TimeRangeParams } from '../../../../server/types'; +import { TimeRangeParams } from '../../../../types'; import { SavedObjectMeta, SavedObjectReference, diff --git a/x-pack/legacy/plugins/reporting/export_types/csv_from_savedobject/server/create_job/index.ts b/x-pack/plugins/reporting/server/export_types/csv_from_savedobject/server/create_job/index.ts similarity index 100% rename from x-pack/legacy/plugins/reporting/export_types/csv_from_savedobject/server/create_job/index.ts rename to x-pack/plugins/reporting/server/export_types/csv_from_savedobject/server/create_job/index.ts diff --git a/x-pack/legacy/plugins/reporting/export_types/csv_from_savedobject/server/execute_job.ts b/x-pack/plugins/reporting/server/export_types/csv_from_savedobject/server/execute_job.ts similarity index 96% rename from x-pack/legacy/plugins/reporting/export_types/csv_from_savedobject/server/execute_job.ts rename to x-pack/plugins/reporting/server/export_types/csv_from_savedobject/server/execute_job.ts index 4ef7b8514b363..d555100b6320d 100644 --- a/x-pack/legacy/plugins/reporting/export_types/csv_from_savedobject/server/execute_job.ts +++ b/x-pack/plugins/reporting/server/export_types/csv_from_savedobject/server/execute_job.ts @@ -6,10 +6,10 @@ import { i18n } from '@kbn/i18n'; import { KibanaRequest, RequestHandlerContext } from 'src/core/server'; -import { CONTENT_TYPE_CSV, CSV_FROM_SAVEDOBJECT_JOB_TYPE } from '../../../common/constants'; -import { ReportingCore } from '../../../server'; -import { cryptoFactory, LevelLogger } from '../../../server/lib'; -import { ExecuteJobFactory, JobDocOutput, JobDocPayload } from '../../../server/types'; +import { ReportingCore } from '../../..'; +import { CONTENT_TYPE_CSV, CSV_FROM_SAVEDOBJECT_JOB_TYPE } from '../../../../common/constants'; +import { cryptoFactory, LevelLogger } from '../../../lib'; +import { ExecuteJobFactory, JobDocOutput, JobDocPayload } from '../../../types'; import { CsvResultFromSearch } from '../../csv/types'; import { FakeRequest, JobDocPayloadPanelCsv, JobParamsPanelCsv, SearchPanel } from '../types'; import { createGenerateCsv } from './lib'; diff --git a/x-pack/legacy/plugins/reporting/export_types/csv_from_savedobject/server/lib/generate_csv.ts b/x-pack/plugins/reporting/server/export_types/csv_from_savedobject/server/lib/generate_csv.ts similarity index 92% rename from x-pack/legacy/plugins/reporting/export_types/csv_from_savedobject/server/lib/generate_csv.ts rename to x-pack/plugins/reporting/server/export_types/csv_from_savedobject/server/lib/generate_csv.ts index 2397da9337890..dd0fb34668e9e 100644 --- a/x-pack/legacy/plugins/reporting/export_types/csv_from_savedobject/server/lib/generate_csv.ts +++ b/x-pack/plugins/reporting/server/export_types/csv_from_savedobject/server/lib/generate_csv.ts @@ -6,8 +6,8 @@ import { badRequest } from 'boom'; import { KibanaRequest, RequestHandlerContext } from 'src/core/server'; -import { LevelLogger } from '../../../../server/lib'; -import { ReportingCore } from '../../../../server'; +import { ReportingCore } from '../../../..'; +import { LevelLogger } from '../../../../lib'; import { FakeRequest, JobParamsPanelCsv, SearchPanel, VisPanel } from '../../types'; import { generateCsvSearch } from './generate_csv_search'; diff --git a/x-pack/legacy/plugins/reporting/export_types/csv_from_savedobject/server/lib/generate_csv_search.ts b/x-pack/plugins/reporting/server/export_types/csv_from_savedobject/server/lib/generate_csv_search.ts similarity index 96% rename from x-pack/legacy/plugins/reporting/export_types/csv_from_savedobject/server/lib/generate_csv_search.ts rename to x-pack/plugins/reporting/server/export_types/csv_from_savedobject/server/lib/generate_csv_search.ts index 848623ede5b2f..a9e4366f4eda6 100644 --- a/x-pack/legacy/plugins/reporting/export_types/csv_from_savedobject/server/lib/generate_csv_search.ts +++ b/x-pack/plugins/reporting/server/export_types/csv_from_savedobject/server/lib/generate_csv_search.ts @@ -4,6 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ +import { ReportingCore } from '../../../../'; import { IUiSettingsClient, KibanaRequest, @@ -16,9 +17,8 @@ import { IIndexPattern, Query, } from '../../../../../../../../src/plugins/data/server'; -import { CancellationToken } from '../../../../../../../plugins/reporting/common'; -import { LevelLogger } from '../../../../server/lib'; -import { ReportingCore } from '../../../../server'; +import { CancellationToken } from '../../../../../common'; +import { LevelLogger } from '../../../../lib'; import { createGenerateCsv } from '../../../csv/server/lib/generate_csv'; import { CsvResultFromSearch, diff --git a/x-pack/legacy/plugins/reporting/export_types/csv_from_savedobject/server/lib/get_data_source.ts b/x-pack/plugins/reporting/server/export_types/csv_from_savedobject/server/lib/get_data_source.ts similarity index 100% rename from x-pack/legacy/plugins/reporting/export_types/csv_from_savedobject/server/lib/get_data_source.ts rename to x-pack/plugins/reporting/server/export_types/csv_from_savedobject/server/lib/get_data_source.ts diff --git a/x-pack/legacy/plugins/reporting/export_types/csv_from_savedobject/server/lib/get_filters.test.ts b/x-pack/plugins/reporting/server/export_types/csv_from_savedobject/server/lib/get_filters.test.ts similarity index 98% rename from x-pack/legacy/plugins/reporting/export_types/csv_from_savedobject/server/lib/get_filters.test.ts rename to x-pack/plugins/reporting/server/export_types/csv_from_savedobject/server/lib/get_filters.test.ts index 110ce91ddfd79..b5d564d93d0d6 100644 --- a/x-pack/legacy/plugins/reporting/export_types/csv_from_savedobject/server/lib/get_filters.test.ts +++ b/x-pack/plugins/reporting/server/export_types/csv_from_savedobject/server/lib/get_filters.test.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { TimeRangeParams } from '../../../../server/types'; +import { TimeRangeParams } from '../../../../types'; import { QueryFilter, SavedSearchObjectAttributes, SearchSourceFilter } from '../../types'; import { getFilters } from './get_filters'; diff --git a/x-pack/legacy/plugins/reporting/export_types/csv_from_savedobject/server/lib/get_filters.ts b/x-pack/plugins/reporting/server/export_types/csv_from_savedobject/server/lib/get_filters.ts similarity index 96% rename from x-pack/legacy/plugins/reporting/export_types/csv_from_savedobject/server/lib/get_filters.ts rename to x-pack/plugins/reporting/server/export_types/csv_from_savedobject/server/lib/get_filters.ts index 4695bbd922581..26631548cc797 100644 --- a/x-pack/legacy/plugins/reporting/export_types/csv_from_savedobject/server/lib/get_filters.ts +++ b/x-pack/plugins/reporting/server/export_types/csv_from_savedobject/server/lib/get_filters.ts @@ -6,7 +6,7 @@ import { badRequest } from 'boom'; import moment from 'moment-timezone'; -import { TimeRangeParams } from '../../../../server/types'; +import { TimeRangeParams } from '../../../../types'; import { Filter, QueryFilter, SavedSearchObjectAttributes, SearchSourceFilter } from '../../types'; export function getFilters( diff --git a/x-pack/legacy/plugins/reporting/export_types/csv_from_savedobject/server/lib/get_job_params_from_request.ts b/x-pack/plugins/reporting/server/export_types/csv_from_savedobject/server/lib/get_job_params_from_request.ts similarity index 100% rename from x-pack/legacy/plugins/reporting/export_types/csv_from_savedobject/server/lib/get_job_params_from_request.ts rename to x-pack/plugins/reporting/server/export_types/csv_from_savedobject/server/lib/get_job_params_from_request.ts diff --git a/x-pack/legacy/plugins/reporting/export_types/csv_from_savedobject/server/lib/index.ts b/x-pack/plugins/reporting/server/export_types/csv_from_savedobject/server/lib/index.ts similarity index 100% rename from x-pack/legacy/plugins/reporting/export_types/csv_from_savedobject/server/lib/index.ts rename to x-pack/plugins/reporting/server/export_types/csv_from_savedobject/server/lib/index.ts diff --git a/x-pack/legacy/plugins/reporting/export_types/csv_from_savedobject/types.d.ts b/x-pack/plugins/reporting/server/export_types/csv_from_savedobject/types.d.ts similarity index 95% rename from x-pack/legacy/plugins/reporting/export_types/csv_from_savedobject/types.d.ts rename to x-pack/plugins/reporting/server/export_types/csv_from_savedobject/types.d.ts index f838268078503..36ae5b1dac05e 100644 --- a/x-pack/legacy/plugins/reporting/export_types/csv_from_savedobject/types.d.ts +++ b/x-pack/plugins/reporting/server/export_types/csv_from_savedobject/types.d.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { JobDocPayload, JobParamPostPayload, TimeRangeParams } from '../../server/types'; +import { JobParamPostPayload, JobDocPayload, TimeRangeParams } from '../../types'; export interface FakeRequest { headers: Record; @@ -101,7 +101,6 @@ export interface SavedObject { /* This object is passed to different helpers in different parts of the code - packages/kbn-es-query/src/es_query/build_es_query - - x-pack/legacy/plugins/reporting/export_types/csv/server/lib/field_format_map The structure has redundant parts and json-parsed / json-unparsed versions of the same data */ export interface IndexPatternSavedObject { diff --git a/x-pack/legacy/plugins/reporting/export_types/png/index.ts b/x-pack/plugins/reporting/server/export_types/png/index.ts similarity index 88% rename from x-pack/legacy/plugins/reporting/export_types/png/index.ts rename to x-pack/plugins/reporting/server/export_types/png/index.ts index 04f56185d4910..a3b51e365e772 100644 --- a/x-pack/legacy/plugins/reporting/export_types/png/index.ts +++ b/x-pack/plugins/reporting/server/export_types/png/index.ts @@ -11,12 +11,8 @@ import { LICENSE_TYPE_STANDARD, LICENSE_TYPE_TRIAL, PNG_JOB_TYPE as jobType, -} from '../../common/constants'; -import { - ESQueueCreateJobFn, - ESQueueWorkerExecuteFn, - ExportTypeDefinition, -} from '../../server/types'; +} from '../../../common/constants'; +import { ESQueueCreateJobFn, ESQueueWorkerExecuteFn, ExportTypeDefinition } from '../..//types'; import { metadata } from './metadata'; import { createJobFactory } from './server/create_job'; import { executeJobFactory } from './server/execute_job'; diff --git a/x-pack/legacy/plugins/reporting/export_types/png/metadata.ts b/x-pack/plugins/reporting/server/export_types/png/metadata.ts similarity index 100% rename from x-pack/legacy/plugins/reporting/export_types/png/metadata.ts rename to x-pack/plugins/reporting/server/export_types/png/metadata.ts diff --git a/x-pack/legacy/plugins/reporting/export_types/png/server/create_job/index.ts b/x-pack/plugins/reporting/server/export_types/png/server/create_job/index.ts similarity index 88% rename from x-pack/legacy/plugins/reporting/export_types/png/server/create_job/index.ts rename to x-pack/plugins/reporting/server/export_types/png/server/create_job/index.ts index ab492c21256eb..3f1556fb29782 100644 --- a/x-pack/legacy/plugins/reporting/export_types/png/server/create_job/index.ts +++ b/x-pack/plugins/reporting/server/export_types/png/server/create_job/index.ts @@ -4,9 +4,9 @@ * you may not use this file except in compliance with the Elastic License. */ -import { validateUrls } from '../../../../common/validate_urls'; -import { cryptoFactory } from '../../../../server/lib'; -import { CreateJobFactory, ESQueueCreateJobFn } from '../../../../server/types'; +import { validateUrls } from '../../../../../common/validate_urls'; +import { cryptoFactory } from '../../../../lib'; +import { CreateJobFactory, ESQueueCreateJobFn } from '../../../../types'; import { JobParamsPNG } from '../../types'; export const createJobFactory: CreateJobFactory ({ generatePngObservableFactory: jest.fn() })); @@ -68,6 +68,8 @@ beforeEach(async () => { const mockGetElasticsearch = jest.fn(); mockGetElasticsearch.mockImplementation(() => Promise.resolve(mockElasticsearch)); mockReporting.getElasticsearchService = mockGetElasticsearch; + // @ts-ignore over-riding config method + mockReporting.config = mockReportingConfig; (generatePngObservableFactory as jest.Mock).mockReturnValue(jest.fn()); }); diff --git a/x-pack/legacy/plugins/reporting/export_types/png/server/execute_job/index.ts b/x-pack/plugins/reporting/server/export_types/png/server/execute_job/index.ts similarity index 93% rename from x-pack/legacy/plugins/reporting/export_types/png/server/execute_job/index.ts rename to x-pack/plugins/reporting/server/export_types/png/server/execute_job/index.ts index 0d0a9e748682a..ea4c4b1d106ae 100644 --- a/x-pack/legacy/plugins/reporting/export_types/png/server/execute_job/index.ts +++ b/x-pack/plugins/reporting/server/export_types/png/server/execute_job/index.ts @@ -7,10 +7,10 @@ import apm from 'elastic-apm-node'; import * as Rx from 'rxjs'; import { catchError, map, mergeMap, takeUntil } from 'rxjs/operators'; -import { PNG_JOB_TYPE } from '../../../../common/constants'; -import { ReportingCore } from '../../../../server'; -import { LevelLogger } from '../../../../server/lib'; -import { ESQueueWorkerExecuteFn, ExecuteJobFactory, JobDocOutput } from '../../../../server/types'; +import { ReportingCore } from '../../../..'; +import { PNG_JOB_TYPE } from '../../../../../common/constants'; +import { ESQueueWorkerExecuteFn, ExecuteJobFactory, JobDocOutput } from '../../../..//types'; +import { LevelLogger } from '../../../../lib'; import { decryptJobHeaders, getConditionalHeaders, diff --git a/x-pack/legacy/plugins/reporting/export_types/png/server/lib/generate_png.ts b/x-pack/plugins/reporting/server/export_types/png/server/lib/generate_png.ts similarity index 94% rename from x-pack/legacy/plugins/reporting/export_types/png/server/lib/generate_png.ts rename to x-pack/plugins/reporting/server/export_types/png/server/lib/generate_png.ts index 0ad381885f4c4..d7e9d0f812b37 100644 --- a/x-pack/legacy/plugins/reporting/export_types/png/server/lib/generate_png.ts +++ b/x-pack/plugins/reporting/server/export_types/png/server/lib/generate_png.ts @@ -7,9 +7,9 @@ import apm from 'elastic-apm-node'; import * as Rx from 'rxjs'; import { map } from 'rxjs/operators'; -import { ReportingCore } from '../../../../server'; -import { LevelLogger } from '../../../../server/lib'; -import { ConditionalHeaders, ScreenshotResults } from '../../../../server/types'; +import { ReportingCore } from '../../../../'; +import { LevelLogger } from '../../../../lib'; +import { ConditionalHeaders, ScreenshotResults } from '../../../../types'; import { LayoutParams } from '../../../common/layouts'; import { PreserveLayout } from '../../../common/layouts/preserve_layout'; diff --git a/x-pack/legacy/plugins/reporting/export_types/png/types.d.ts b/x-pack/plugins/reporting/server/export_types/png/types.d.ts similarity index 93% rename from x-pack/legacy/plugins/reporting/export_types/png/types.d.ts rename to x-pack/plugins/reporting/server/export_types/png/types.d.ts index 80a2a1899a075..486a8e91a722f 100644 --- a/x-pack/legacy/plugins/reporting/export_types/png/types.d.ts +++ b/x-pack/plugins/reporting/server/export_types/png/types.d.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { JobDocPayload } from '../../server/types'; +import { JobDocPayload } from '../../../server/types'; import { LayoutInstance, LayoutParams } from '../common/layouts'; // Job params: structure of incoming user request data diff --git a/x-pack/legacy/plugins/reporting/export_types/printable_pdf/index.ts b/x-pack/plugins/reporting/server/export_types/printable_pdf/index.ts similarity index 88% rename from x-pack/legacy/plugins/reporting/export_types/printable_pdf/index.ts rename to x-pack/plugins/reporting/server/export_types/printable_pdf/index.ts index ec537b52244c2..39a0cbd5270a1 100644 --- a/x-pack/legacy/plugins/reporting/export_types/printable_pdf/index.ts +++ b/x-pack/plugins/reporting/server/export_types/printable_pdf/index.ts @@ -11,12 +11,8 @@ import { LICENSE_TYPE_STANDARD, LICENSE_TYPE_TRIAL, PDF_JOB_TYPE as jobType, -} from '../../common/constants'; -import { - ESQueueCreateJobFn, - ESQueueWorkerExecuteFn, - ExportTypeDefinition, -} from '../../server/types'; +} from '../../../common/constants'; +import { ESQueueCreateJobFn, ESQueueWorkerExecuteFn, ExportTypeDefinition } from '../../types'; import { metadata } from './metadata'; import { createJobFactory } from './server/create_job'; import { executeJobFactory } from './server/execute_job'; diff --git a/x-pack/legacy/plugins/reporting/export_types/printable_pdf/metadata.ts b/x-pack/plugins/reporting/server/export_types/printable_pdf/metadata.ts similarity index 100% rename from x-pack/legacy/plugins/reporting/export_types/printable_pdf/metadata.ts rename to x-pack/plugins/reporting/server/export_types/printable_pdf/metadata.ts diff --git a/x-pack/legacy/plugins/reporting/export_types/printable_pdf/server/create_job/index.ts b/x-pack/plugins/reporting/server/export_types/printable_pdf/server/create_job/index.ts similarity index 89% rename from x-pack/legacy/plugins/reporting/export_types/printable_pdf/server/create_job/index.ts rename to x-pack/plugins/reporting/server/export_types/printable_pdf/server/create_job/index.ts index ef597cfb45f78..06a0902a56954 100644 --- a/x-pack/legacy/plugins/reporting/export_types/printable_pdf/server/create_job/index.ts +++ b/x-pack/plugins/reporting/server/export_types/printable_pdf/server/create_job/index.ts @@ -4,9 +4,9 @@ * you may not use this file except in compliance with the Elastic License. */ -import { validateUrls } from '../../../../common/validate_urls'; -import { cryptoFactory } from '../../../../server/lib'; -import { CreateJobFactory, ESQueueCreateJobFn } from '../../../../server/types'; +import { validateUrls } from '../../../../../common/validate_urls'; +import { cryptoFactory } from '../../../../lib'; +import { CreateJobFactory, ESQueueCreateJobFn } from '../../../../types'; import { JobParamsPDF } from '../../types'; export const createJobFactory: CreateJobFactory ({ generatePdfObservableFactory: jest.fn() })); import * as Rx from 'rxjs'; -import { CancellationToken } from '../../../../../../../plugins/reporting/common'; -import { ReportingCore } from '../../../../server'; -import { cryptoFactory, LevelLogger } from '../../../../server/lib'; +import { ReportingCore } from '../../../../'; +import { CancellationToken } from '../../../../../common'; +import { cryptoFactory, LevelLogger } from '../../../../lib'; import { createMockReportingCore } from '../../../../test_helpers'; import { JobDocPayloadPDF } from '../../types'; import { generatePdfObservableFactory } from '../lib/generate_pdf'; -import { executeJobFactory } from './index'; +import { executeJobFactory } from './'; let mockReporting: ReportingCore; @@ -66,6 +66,8 @@ beforeEach(async () => { const mockGetElasticsearch = jest.fn(); mockGetElasticsearch.mockImplementation(() => Promise.resolve(mockElasticsearch)); mockReporting.getElasticsearchService = mockGetElasticsearch; + // @ts-ignore over-riding config + mockReporting.config = mockReportingConfig; (generatePdfObservableFactory as jest.Mock).mockReturnValue(jest.fn()); }); diff --git a/x-pack/legacy/plugins/reporting/export_types/printable_pdf/server/execute_job/index.ts b/x-pack/plugins/reporting/server/export_types/printable_pdf/server/execute_job/index.ts similarity index 92% rename from x-pack/legacy/plugins/reporting/export_types/printable_pdf/server/execute_job/index.ts rename to x-pack/plugins/reporting/server/export_types/printable_pdf/server/execute_job/index.ts index b0b2d02305b9b..a4d84b2f9f1e0 100644 --- a/x-pack/legacy/plugins/reporting/export_types/printable_pdf/server/execute_job/index.ts +++ b/x-pack/plugins/reporting/server/export_types/printable_pdf/server/execute_job/index.ts @@ -7,17 +7,17 @@ import apm from 'elastic-apm-node'; import * as Rx from 'rxjs'; import { catchError, map, mergeMap, takeUntil } from 'rxjs/operators'; -import { PDF_JOB_TYPE } from '../../../../common/constants'; -import { ReportingCore } from '../../../../server'; -import { LevelLogger } from '../../../../server/lib'; -import { ESQueueWorkerExecuteFn, ExecuteJobFactory, JobDocOutput } from '../../../../server/types'; +import { ReportingCore } from '../../../..'; +import { PDF_JOB_TYPE } from '../../../../../common/constants'; +import { LevelLogger } from '../../../../lib'; +import { ESQueueWorkerExecuteFn, ExecuteJobFactory, JobDocOutput } from '../../../../types'; import { decryptJobHeaders, getConditionalHeaders, getCustomLogo, getFullUrls, omitBlacklistedHeaders, -} from '../../../common/execute_job/'; +} from '../../../common/execute_job'; import { JobDocPayloadPDF } from '../../types'; import { generatePdfObservableFactory } from '../lib/generate_pdf'; diff --git a/x-pack/legacy/plugins/reporting/export_types/printable_pdf/server/lib/generate_pdf.ts b/x-pack/plugins/reporting/server/export_types/printable_pdf/server/lib/generate_pdf.ts similarity index 96% rename from x-pack/legacy/plugins/reporting/export_types/printable_pdf/server/lib/generate_pdf.ts rename to x-pack/plugins/reporting/server/export_types/printable_pdf/server/lib/generate_pdf.ts index 3b626c8f0da44..366949a033757 100644 --- a/x-pack/legacy/plugins/reporting/export_types/printable_pdf/server/lib/generate_pdf.ts +++ b/x-pack/plugins/reporting/server/export_types/printable_pdf/server/lib/generate_pdf.ts @@ -7,9 +7,9 @@ import { groupBy } from 'lodash'; import * as Rx from 'rxjs'; import { mergeMap } from 'rxjs/operators'; -import { ReportingCore } from '../../../../server'; -import { LevelLogger } from '../../../../server/lib'; -import { ConditionalHeaders, ScreenshotResults } from '../../../../server/types'; +import { ReportingCore } from '../../../../'; +import { LevelLogger } from '../../../../lib'; +import { ConditionalHeaders, ScreenshotResults } from '../../../../types'; import { createLayout, LayoutInstance, LayoutParams } from '../../../common/layouts'; // @ts-ignore untyped module import { pdf } from './pdf'; diff --git a/x-pack/legacy/plugins/reporting/export_types/printable_pdf/server/lib/pdf/assets/fonts/noto/LICENSE_OFL.txt b/x-pack/plugins/reporting/server/export_types/printable_pdf/server/lib/pdf/assets/fonts/noto/LICENSE_OFL.txt similarity index 100% rename from x-pack/legacy/plugins/reporting/export_types/printable_pdf/server/lib/pdf/assets/fonts/noto/LICENSE_OFL.txt rename to x-pack/plugins/reporting/server/export_types/printable_pdf/server/lib/pdf/assets/fonts/noto/LICENSE_OFL.txt diff --git a/x-pack/legacy/plugins/reporting/export_types/printable_pdf/server/lib/pdf/assets/fonts/noto/NotoSansCJKtc-Medium.ttf b/x-pack/plugins/reporting/server/export_types/printable_pdf/server/lib/pdf/assets/fonts/noto/NotoSansCJKtc-Medium.ttf similarity index 100% rename from x-pack/legacy/plugins/reporting/export_types/printable_pdf/server/lib/pdf/assets/fonts/noto/NotoSansCJKtc-Medium.ttf rename to x-pack/plugins/reporting/server/export_types/printable_pdf/server/lib/pdf/assets/fonts/noto/NotoSansCJKtc-Medium.ttf diff --git a/x-pack/legacy/plugins/reporting/export_types/printable_pdf/server/lib/pdf/assets/fonts/noto/NotoSansCJKtc-Regular.ttf b/x-pack/plugins/reporting/server/export_types/printable_pdf/server/lib/pdf/assets/fonts/noto/NotoSansCJKtc-Regular.ttf similarity index 100% rename from x-pack/legacy/plugins/reporting/export_types/printable_pdf/server/lib/pdf/assets/fonts/noto/NotoSansCJKtc-Regular.ttf rename to x-pack/plugins/reporting/server/export_types/printable_pdf/server/lib/pdf/assets/fonts/noto/NotoSansCJKtc-Regular.ttf diff --git a/x-pack/legacy/plugins/reporting/export_types/printable_pdf/server/lib/pdf/assets/fonts/noto/index.js b/x-pack/plugins/reporting/server/export_types/printable_pdf/server/lib/pdf/assets/fonts/noto/index.js similarity index 100% rename from x-pack/legacy/plugins/reporting/export_types/printable_pdf/server/lib/pdf/assets/fonts/noto/index.js rename to x-pack/plugins/reporting/server/export_types/printable_pdf/server/lib/pdf/assets/fonts/noto/index.js diff --git a/x-pack/legacy/plugins/reporting/export_types/printable_pdf/server/lib/pdf/assets/fonts/roboto/LICENSE.txt b/x-pack/plugins/reporting/server/export_types/printable_pdf/server/lib/pdf/assets/fonts/roboto/LICENSE.txt similarity index 100% rename from x-pack/legacy/plugins/reporting/export_types/printable_pdf/server/lib/pdf/assets/fonts/roboto/LICENSE.txt rename to x-pack/plugins/reporting/server/export_types/printable_pdf/server/lib/pdf/assets/fonts/roboto/LICENSE.txt diff --git a/x-pack/legacy/plugins/reporting/export_types/printable_pdf/server/lib/pdf/assets/fonts/roboto/Roboto-Italic.ttf b/x-pack/plugins/reporting/server/export_types/printable_pdf/server/lib/pdf/assets/fonts/roboto/Roboto-Italic.ttf similarity index 100% rename from x-pack/legacy/plugins/reporting/export_types/printable_pdf/server/lib/pdf/assets/fonts/roboto/Roboto-Italic.ttf rename to x-pack/plugins/reporting/server/export_types/printable_pdf/server/lib/pdf/assets/fonts/roboto/Roboto-Italic.ttf diff --git a/x-pack/legacy/plugins/reporting/export_types/printable_pdf/server/lib/pdf/assets/fonts/roboto/Roboto-Medium.ttf b/x-pack/plugins/reporting/server/export_types/printable_pdf/server/lib/pdf/assets/fonts/roboto/Roboto-Medium.ttf similarity index 100% rename from x-pack/legacy/plugins/reporting/export_types/printable_pdf/server/lib/pdf/assets/fonts/roboto/Roboto-Medium.ttf rename to x-pack/plugins/reporting/server/export_types/printable_pdf/server/lib/pdf/assets/fonts/roboto/Roboto-Medium.ttf diff --git a/x-pack/legacy/plugins/reporting/export_types/printable_pdf/server/lib/pdf/assets/fonts/roboto/Roboto-Regular.ttf b/x-pack/plugins/reporting/server/export_types/printable_pdf/server/lib/pdf/assets/fonts/roboto/Roboto-Regular.ttf similarity index 100% rename from x-pack/legacy/plugins/reporting/export_types/printable_pdf/server/lib/pdf/assets/fonts/roboto/Roboto-Regular.ttf rename to x-pack/plugins/reporting/server/export_types/printable_pdf/server/lib/pdf/assets/fonts/roboto/Roboto-Regular.ttf diff --git a/x-pack/legacy/plugins/reporting/export_types/printable_pdf/server/lib/pdf/assets/img/logo-grey.png b/x-pack/plugins/reporting/server/export_types/printable_pdf/server/lib/pdf/assets/img/logo-grey.png similarity index 100% rename from x-pack/legacy/plugins/reporting/export_types/printable_pdf/server/lib/pdf/assets/img/logo-grey.png rename to x-pack/plugins/reporting/server/export_types/printable_pdf/server/lib/pdf/assets/img/logo-grey.png diff --git a/x-pack/legacy/plugins/reporting/export_types/printable_pdf/server/lib/pdf/index.js b/x-pack/plugins/reporting/server/export_types/printable_pdf/server/lib/pdf/index.js similarity index 100% rename from x-pack/legacy/plugins/reporting/export_types/printable_pdf/server/lib/pdf/index.js rename to x-pack/plugins/reporting/server/export_types/printable_pdf/server/lib/pdf/index.js diff --git a/x-pack/legacy/plugins/reporting/export_types/printable_pdf/server/lib/tracker.ts b/x-pack/plugins/reporting/server/export_types/printable_pdf/server/lib/tracker.ts similarity index 100% rename from x-pack/legacy/plugins/reporting/export_types/printable_pdf/server/lib/tracker.ts rename to x-pack/plugins/reporting/server/export_types/printable_pdf/server/lib/tracker.ts diff --git a/x-pack/legacy/plugins/reporting/export_types/printable_pdf/server/lib/uri_encode.js b/x-pack/plugins/reporting/server/export_types/printable_pdf/server/lib/uri_encode.js similarity index 100% rename from x-pack/legacy/plugins/reporting/export_types/printable_pdf/server/lib/uri_encode.js rename to x-pack/plugins/reporting/server/export_types/printable_pdf/server/lib/uri_encode.js diff --git a/x-pack/legacy/plugins/reporting/export_types/printable_pdf/types.d.ts b/x-pack/plugins/reporting/server/export_types/printable_pdf/types.d.ts similarity index 94% rename from x-pack/legacy/plugins/reporting/export_types/printable_pdf/types.d.ts rename to x-pack/plugins/reporting/server/export_types/printable_pdf/types.d.ts index 0df01fdc16d1c..087ef5a6ca82c 100644 --- a/x-pack/legacy/plugins/reporting/export_types/printable_pdf/types.d.ts +++ b/x-pack/plugins/reporting/server/export_types/printable_pdf/types.d.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { JobDocPayload } from '../../server/types'; +import { JobDocPayload } from '../../../server/types'; import { LayoutInstance, LayoutParams } from '../common/layouts'; // Job params: structure of incoming user request data, after being parsed from RISON diff --git a/x-pack/plugins/reporting/server/index.ts b/x-pack/plugins/reporting/server/index.ts index 9d34eba70d0f4..c78e042d019e8 100644 --- a/x-pack/plugins/reporting/server/index.ts +++ b/x-pack/plugins/reporting/server/index.ts @@ -4,11 +4,18 @@ * you may not use this file except in compliance with the Elastic License. */ -import { PluginInitializerContext } from 'src/core/server'; +import { PluginInitializerContext } from 'kibana/server'; import { ReportingPlugin } from './plugin'; +import { ReportingConfigType } from './config'; -export { config, ConfigSchema, ConfigType } from './config'; -export { PluginsSetup } from './plugin'; +export const plugin = (initContext: PluginInitializerContext) => + new ReportingPlugin(initContext); -export const plugin = (initializerContext: PluginInitializerContext) => - new ReportingPlugin(initializerContext); +export { ReportingPlugin as Plugin }; +export { config } from './config'; +export { ReportingSetupDeps as PluginSetup } from './types'; +export { ReportingStartDeps as PluginStart } from './types'; + +// internal imports +export { ReportingCore } from './core'; +export { ReportingConfig } from './config/config'; diff --git a/x-pack/legacy/plugins/reporting/server/lib/__tests__/export_types_registry.js b/x-pack/plugins/reporting/server/lib/__tests__/export_types_registry.js similarity index 100% rename from x-pack/legacy/plugins/reporting/server/lib/__tests__/export_types_registry.js rename to x-pack/plugins/reporting/server/lib/__tests__/export_types_registry.js diff --git a/x-pack/legacy/plugins/reporting/server/lib/check_license.test.ts b/x-pack/plugins/reporting/server/lib/check_license.test.ts similarity index 99% rename from x-pack/legacy/plugins/reporting/server/lib/check_license.test.ts rename to x-pack/plugins/reporting/server/lib/check_license.test.ts index 366a8d94286f1..aa9f86533ef61 100644 --- a/x-pack/legacy/plugins/reporting/server/lib/check_license.test.ts +++ b/x-pack/plugins/reporting/server/lib/check_license.test.ts @@ -5,7 +5,7 @@ */ import { checkLicense } from './check_license'; -import { ILicense } from '../../../../../plugins/licensing/server'; +import { ILicense } from '../../../licensing/server'; import { ExportTypesRegistry } from './export_types_registry'; describe('check_license', () => { diff --git a/x-pack/legacy/plugins/reporting/server/lib/check_license.ts b/x-pack/plugins/reporting/server/lib/check_license.ts similarity index 97% rename from x-pack/legacy/plugins/reporting/server/lib/check_license.ts rename to x-pack/plugins/reporting/server/lib/check_license.ts index 1b4eeaa0bae3e..a764aa1f1eec6 100644 --- a/x-pack/legacy/plugins/reporting/server/lib/check_license.ts +++ b/x-pack/plugins/reporting/server/lib/check_license.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { ILicense } from '../../../../../plugins/licensing/server'; +import { ILicense } from '../../../licensing/server'; import { ExportTypeDefinition } from '../types'; import { ExportTypesRegistry } from './export_types_registry'; diff --git a/x-pack/legacy/plugins/reporting/server/lib/create_queue.ts b/x-pack/plugins/reporting/server/lib/create_queue.ts similarity index 100% rename from x-pack/legacy/plugins/reporting/server/lib/create_queue.ts rename to x-pack/plugins/reporting/server/lib/create_queue.ts diff --git a/x-pack/legacy/plugins/reporting/server/lib/create_tagged_logger.ts b/x-pack/plugins/reporting/server/lib/create_tagged_logger.ts similarity index 100% rename from x-pack/legacy/plugins/reporting/server/lib/create_tagged_logger.ts rename to x-pack/plugins/reporting/server/lib/create_tagged_logger.ts diff --git a/x-pack/legacy/plugins/reporting/server/lib/create_worker.test.ts b/x-pack/plugins/reporting/server/lib/create_worker.test.ts similarity index 96% rename from x-pack/legacy/plugins/reporting/server/lib/create_worker.test.ts rename to x-pack/plugins/reporting/server/lib/create_worker.test.ts index 1193091075e3e..8e1174e01aa7f 100644 --- a/x-pack/legacy/plugins/reporting/server/lib/create_worker.test.ts +++ b/x-pack/plugins/reporting/server/lib/create_worker.test.ts @@ -6,7 +6,7 @@ import * as sinon from 'sinon'; import { ReportingConfig, ReportingCore } from '../../server'; -import { createMockReportingCore } from '../../test_helpers'; +import { createMockReportingCore } from '../test_helpers'; import { createWorkerFactory } from './create_worker'; // @ts-ignore import { Esqueue } from './esqueue'; @@ -42,6 +42,8 @@ describe('Create Worker', () => { mockConfig = { get: configGetStub, kbnConfig: { get: configGetStub } }; mockReporting = await createMockReportingCore(mockConfig); mockReporting.getExportTypesRegistry = () => getMockExportTypesRegistry(); + // @ts-ignore over-riding config manually + mockReporting.config = mockConfig; client = new ClientMock(); queue = new Esqueue('reporting-queue', { client }); executeJobFactoryStub.reset(); diff --git a/x-pack/legacy/plugins/reporting/server/lib/create_worker.ts b/x-pack/plugins/reporting/server/lib/create_worker.ts similarity index 97% rename from x-pack/legacy/plugins/reporting/server/lib/create_worker.ts rename to x-pack/plugins/reporting/server/lib/create_worker.ts index 57bd61aee7195..c9e865668bb30 100644 --- a/x-pack/legacy/plugins/reporting/server/lib/create_worker.ts +++ b/x-pack/plugins/reporting/server/lib/create_worker.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { CancellationToken } from '../../../../../plugins/reporting/common'; +import { CancellationToken } from '../../common'; import { PLUGIN_ID } from '../../common/constants'; import { ReportingCore } from '../../server'; import { LevelLogger } from '../../server/lib'; diff --git a/x-pack/legacy/plugins/reporting/server/lib/crypto.ts b/x-pack/plugins/reporting/server/lib/crypto.ts similarity index 100% rename from x-pack/legacy/plugins/reporting/server/lib/crypto.ts rename to x-pack/plugins/reporting/server/lib/crypto.ts diff --git a/x-pack/legacy/plugins/reporting/server/lib/enqueue_job.ts b/x-pack/plugins/reporting/server/lib/enqueue_job.ts similarity index 97% rename from x-pack/legacy/plugins/reporting/server/lib/enqueue_job.ts rename to x-pack/plugins/reporting/server/lib/enqueue_job.ts index 6367c8a1da98a..3837f593df5b2 100644 --- a/x-pack/legacy/plugins/reporting/server/lib/enqueue_job.ts +++ b/x-pack/plugins/reporting/server/lib/enqueue_job.ts @@ -6,7 +6,7 @@ import { EventEmitter } from 'events'; import { KibanaRequest, RequestHandlerContext } from 'src/core/server'; -import { AuthenticatedUser } from '../../../../../plugins/security/server'; +import { AuthenticatedUser } from '../../../security/server'; import { ESQueueCreateJobFn } from '../../server/types'; import { ReportingCore } from '../core'; // @ts-ignore diff --git a/x-pack/legacy/plugins/reporting/server/lib/esqueue/__tests__/fixtures/job.js b/x-pack/plugins/reporting/server/lib/esqueue/__tests__/fixtures/job.js similarity index 57% rename from x-pack/legacy/plugins/reporting/server/lib/esqueue/__tests__/fixtures/job.js rename to x-pack/plugins/reporting/server/lib/esqueue/__tests__/fixtures/job.js index 2d0ac86fd96f1..9cc62800d439f 100644 --- a/x-pack/legacy/plugins/reporting/server/lib/esqueue/__tests__/fixtures/job.js +++ b/x-pack/plugins/reporting/server/lib/esqueue/__tests__/fixtures/job.js @@ -1,3 +1,9 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + import events from 'events'; export class JobMock extends events.EventEmitter { diff --git a/x-pack/legacy/plugins/reporting/server/lib/esqueue/__tests__/fixtures/legacy_elasticsearch.js b/x-pack/plugins/reporting/server/lib/esqueue/__tests__/fixtures/legacy_elasticsearch.js similarity index 100% rename from x-pack/legacy/plugins/reporting/server/lib/esqueue/__tests__/fixtures/legacy_elasticsearch.js rename to x-pack/plugins/reporting/server/lib/esqueue/__tests__/fixtures/legacy_elasticsearch.js diff --git a/x-pack/plugins/siem/public/common/components/empty_value/translations.ts b/x-pack/plugins/reporting/server/lib/esqueue/__tests__/fixtures/queue.js similarity index 58% rename from x-pack/plugins/siem/public/common/components/empty_value/translations.ts rename to x-pack/plugins/reporting/server/lib/esqueue/__tests__/fixtures/queue.js index 985cb1ef1a1f5..974cb4a5e2a6e 100644 --- a/x-pack/plugins/siem/public/common/components/empty_value/translations.ts +++ b/x-pack/plugins/reporting/server/lib/esqueue/__tests__/fixtures/queue.js @@ -4,8 +4,14 @@ * you may not use this file except in compliance with the Elastic License. */ -import { i18n } from '@kbn/i18n'; +import events from 'events'; -export const EMPTY_STRING = i18n.translate('xpack.siem.emptyString.emptyStringDescription', { - defaultMessage: 'Empty String', -}); +export class QueueMock extends events.EventEmitter { + constructor() { + super(); + } + + setClient(client) { + this.client = client; + } +} diff --git a/x-pack/legacy/plugins/reporting/server/lib/esqueue/__tests__/fixtures/worker.js b/x-pack/plugins/reporting/server/lib/esqueue/__tests__/fixtures/worker.js similarity index 55% rename from x-pack/legacy/plugins/reporting/server/lib/esqueue/__tests__/fixtures/worker.js rename to x-pack/plugins/reporting/server/lib/esqueue/__tests__/fixtures/worker.js index 09c94b44a8145..fe8a859ccb445 100644 --- a/x-pack/legacy/plugins/reporting/server/lib/esqueue/__tests__/fixtures/worker.js +++ b/x-pack/plugins/reporting/server/lib/esqueue/__tests__/fixtures/worker.js @@ -1,3 +1,9 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + import events from 'events'; export class WorkerMock extends events.EventEmitter { diff --git a/x-pack/legacy/plugins/reporting/server/lib/esqueue/__tests__/helpers/create_index.js b/x-pack/plugins/reporting/server/lib/esqueue/__tests__/helpers/create_index.js similarity index 100% rename from x-pack/legacy/plugins/reporting/server/lib/esqueue/__tests__/helpers/create_index.js rename to x-pack/plugins/reporting/server/lib/esqueue/__tests__/helpers/create_index.js diff --git a/x-pack/legacy/plugins/reporting/server/lib/esqueue/__tests__/helpers/errors.js b/x-pack/plugins/reporting/server/lib/esqueue/__tests__/helpers/errors.js similarity index 100% rename from x-pack/legacy/plugins/reporting/server/lib/esqueue/__tests__/helpers/errors.js rename to x-pack/plugins/reporting/server/lib/esqueue/__tests__/helpers/errors.js diff --git a/x-pack/legacy/plugins/reporting/server/lib/esqueue/__tests__/helpers/index_timestamp.js b/x-pack/plugins/reporting/server/lib/esqueue/__tests__/helpers/index_timestamp.js similarity index 100% rename from x-pack/legacy/plugins/reporting/server/lib/esqueue/__tests__/helpers/index_timestamp.js rename to x-pack/plugins/reporting/server/lib/esqueue/__tests__/helpers/index_timestamp.js diff --git a/x-pack/legacy/plugins/reporting/server/lib/esqueue/__tests__/index.js b/x-pack/plugins/reporting/server/lib/esqueue/__tests__/index.js similarity index 100% rename from x-pack/legacy/plugins/reporting/server/lib/esqueue/__tests__/index.js rename to x-pack/plugins/reporting/server/lib/esqueue/__tests__/index.js diff --git a/x-pack/legacy/plugins/reporting/server/lib/esqueue/__tests__/job.js b/x-pack/plugins/reporting/server/lib/esqueue/__tests__/job.js similarity index 100% rename from x-pack/legacy/plugins/reporting/server/lib/esqueue/__tests__/job.js rename to x-pack/plugins/reporting/server/lib/esqueue/__tests__/job.js diff --git a/x-pack/legacy/plugins/reporting/server/lib/esqueue/__tests__/worker.js b/x-pack/plugins/reporting/server/lib/esqueue/__tests__/worker.js similarity index 100% rename from x-pack/legacy/plugins/reporting/server/lib/esqueue/__tests__/worker.js rename to x-pack/plugins/reporting/server/lib/esqueue/__tests__/worker.js diff --git a/x-pack/legacy/plugins/reporting/server/lib/esqueue/constants/default_settings.js b/x-pack/plugins/reporting/server/lib/esqueue/constants/default_settings.js similarity index 100% rename from x-pack/legacy/plugins/reporting/server/lib/esqueue/constants/default_settings.js rename to x-pack/plugins/reporting/server/lib/esqueue/constants/default_settings.js diff --git a/x-pack/legacy/plugins/reporting/server/lib/esqueue/constants/events.js b/x-pack/plugins/reporting/server/lib/esqueue/constants/events.js similarity index 100% rename from x-pack/legacy/plugins/reporting/server/lib/esqueue/constants/events.js rename to x-pack/plugins/reporting/server/lib/esqueue/constants/events.js diff --git a/x-pack/legacy/plugins/reporting/server/lib/esqueue/constants/index.js b/x-pack/plugins/reporting/server/lib/esqueue/constants/index.js similarity index 100% rename from x-pack/legacy/plugins/reporting/server/lib/esqueue/constants/index.js rename to x-pack/plugins/reporting/server/lib/esqueue/constants/index.js diff --git a/x-pack/legacy/plugins/reporting/server/lib/esqueue/constants/statuses.ts b/x-pack/plugins/reporting/server/lib/esqueue/constants/statuses.ts similarity index 100% rename from x-pack/legacy/plugins/reporting/server/lib/esqueue/constants/statuses.ts rename to x-pack/plugins/reporting/server/lib/esqueue/constants/statuses.ts diff --git a/x-pack/legacy/plugins/reporting/server/lib/esqueue/helpers/create_index.js b/x-pack/plugins/reporting/server/lib/esqueue/helpers/create_index.js similarity index 100% rename from x-pack/legacy/plugins/reporting/server/lib/esqueue/helpers/create_index.js rename to x-pack/plugins/reporting/server/lib/esqueue/helpers/create_index.js diff --git a/x-pack/legacy/plugins/reporting/server/lib/esqueue/helpers/errors.js b/x-pack/plugins/reporting/server/lib/esqueue/helpers/errors.js similarity index 100% rename from x-pack/legacy/plugins/reporting/server/lib/esqueue/helpers/errors.js rename to x-pack/plugins/reporting/server/lib/esqueue/helpers/errors.js diff --git a/x-pack/legacy/plugins/reporting/server/lib/esqueue/helpers/index_timestamp.js b/x-pack/plugins/reporting/server/lib/esqueue/helpers/index_timestamp.js similarity index 100% rename from x-pack/legacy/plugins/reporting/server/lib/esqueue/helpers/index_timestamp.js rename to x-pack/plugins/reporting/server/lib/esqueue/helpers/index_timestamp.js diff --git a/x-pack/legacy/plugins/reporting/server/lib/esqueue/index.js b/x-pack/plugins/reporting/server/lib/esqueue/index.js similarity index 100% rename from x-pack/legacy/plugins/reporting/server/lib/esqueue/index.js rename to x-pack/plugins/reporting/server/lib/esqueue/index.js diff --git a/x-pack/legacy/plugins/reporting/server/lib/esqueue/job.js b/x-pack/plugins/reporting/server/lib/esqueue/job.js similarity index 100% rename from x-pack/legacy/plugins/reporting/server/lib/esqueue/job.js rename to x-pack/plugins/reporting/server/lib/esqueue/job.js diff --git a/x-pack/legacy/plugins/reporting/server/lib/esqueue/worker.js b/x-pack/plugins/reporting/server/lib/esqueue/worker.js similarity index 99% rename from x-pack/legacy/plugins/reporting/server/lib/esqueue/worker.js rename to x-pack/plugins/reporting/server/lib/esqueue/worker.js index f852ac9c92404..b26ed731c6831 100644 --- a/x-pack/legacy/plugins/reporting/server/lib/esqueue/worker.js +++ b/x-pack/plugins/reporting/server/lib/esqueue/worker.js @@ -7,8 +7,7 @@ import events from 'events'; import moment from 'moment'; import Puid from 'puid'; -import { CancellationToken } from '../../../../../../plugins/reporting/common'; -import { Poller } from '../../../../../common/poller'; +import { CancellationToken, Poller } from '../../../common'; import { constants } from './constants'; import { UnspecifiedWorkerError, WorkerTimeoutError } from './helpers/errors'; diff --git a/x-pack/legacy/plugins/reporting/server/lib/export_types_registry.ts b/x-pack/plugins/reporting/server/lib/export_types_registry.ts similarity index 91% rename from x-pack/legacy/plugins/reporting/server/lib/export_types_registry.ts rename to x-pack/plugins/reporting/server/lib/export_types_registry.ts index 0d5459a7c106b..893a2635561ff 100644 --- a/x-pack/legacy/plugins/reporting/server/lib/export_types_registry.ts +++ b/x-pack/plugins/reporting/server/lib/export_types_registry.ts @@ -6,10 +6,10 @@ import { isString } from 'lodash'; import memoizeOne from 'memoize-one'; -import { getExportType as getTypeCsv } from '../../export_types/csv'; -import { getExportType as getTypeCsvFromSavedObject } from '../../export_types/csv_from_savedobject'; -import { getExportType as getTypePng } from '../../export_types/png'; -import { getExportType as getTypePrintablePdf } from '../../export_types/printable_pdf'; +import { getExportType as getTypeCsv } from '../export_types/csv'; +import { getExportType as getTypeCsvFromSavedObject } from '../export_types/csv_from_savedobject'; +import { getExportType as getTypePng } from '../export_types/png'; +import { getExportType as getTypePrintablePdf } from '../export_types/printable_pdf'; import { ExportTypeDefinition } from '../types'; type GetCallbackFn = ( diff --git a/x-pack/legacy/plugins/reporting/server/lib/get_user.ts b/x-pack/plugins/reporting/server/lib/get_user.ts similarity index 74% rename from x-pack/legacy/plugins/reporting/server/lib/get_user.ts rename to x-pack/plugins/reporting/server/lib/get_user.ts index 164ffc5742d04..49d15a7c55100 100644 --- a/x-pack/legacy/plugins/reporting/server/lib/get_user.ts +++ b/x-pack/plugins/reporting/server/lib/get_user.ts @@ -4,8 +4,8 @@ * you may not use this file except in compliance with the Elastic License. */ -import { SecurityPluginSetup } from '../../../../../plugins/security/server'; -import { KibanaRequest } from '../../../../../../src/core/server'; +import { KibanaRequest } from 'kibana/server'; +import { SecurityPluginSetup } from '../../../security/server'; export function getUserFactory(security?: SecurityPluginSetup) { return (request: KibanaRequest) => { diff --git a/x-pack/legacy/plugins/reporting/server/lib/index.ts b/x-pack/plugins/reporting/server/lib/index.ts similarity index 100% rename from x-pack/legacy/plugins/reporting/server/lib/index.ts rename to x-pack/plugins/reporting/server/lib/index.ts diff --git a/x-pack/legacy/plugins/reporting/server/lib/jobs_query.ts b/x-pack/plugins/reporting/server/lib/jobs_query.ts similarity index 98% rename from x-pack/legacy/plugins/reporting/server/lib/jobs_query.ts rename to x-pack/plugins/reporting/server/lib/jobs_query.ts index 06c4a7714099e..8784d8ff35d25 100644 --- a/x-pack/legacy/plugins/reporting/server/lib/jobs_query.ts +++ b/x-pack/plugins/reporting/server/lib/jobs_query.ts @@ -8,7 +8,7 @@ import { i18n } from '@kbn/i18n'; import { errors as elasticsearchErrors } from 'elasticsearch'; import { ElasticsearchServiceSetup } from 'kibana/server'; import { get } from 'lodash'; -import { AuthenticatedUser } from '../../../../../plugins/security/server'; +import { AuthenticatedUser } from '../../../security/server'; import { ReportingConfig } from '../'; import { JobSource } from '../types'; diff --git a/x-pack/legacy/plugins/reporting/server/lib/level_logger.ts b/x-pack/plugins/reporting/server/lib/level_logger.ts similarity index 100% rename from x-pack/legacy/plugins/reporting/server/lib/level_logger.ts rename to x-pack/plugins/reporting/server/lib/level_logger.ts diff --git a/x-pack/legacy/plugins/reporting/server/lib/trace.ts b/x-pack/plugins/reporting/server/lib/trace.ts similarity index 100% rename from x-pack/legacy/plugins/reporting/server/lib/trace.ts rename to x-pack/plugins/reporting/server/lib/trace.ts diff --git a/x-pack/legacy/plugins/reporting/server/lib/validate/index.ts b/x-pack/plugins/reporting/server/lib/validate/index.ts similarity index 100% rename from x-pack/legacy/plugins/reporting/server/lib/validate/index.ts rename to x-pack/plugins/reporting/server/lib/validate/index.ts diff --git a/x-pack/legacy/plugins/reporting/server/lib/validate/validate_browser.ts b/x-pack/plugins/reporting/server/lib/validate/validate_browser.ts similarity index 100% rename from x-pack/legacy/plugins/reporting/server/lib/validate/validate_browser.ts rename to x-pack/plugins/reporting/server/lib/validate/validate_browser.ts diff --git a/x-pack/legacy/plugins/reporting/server/lib/validate/validate_max_content_length.test.js b/x-pack/plugins/reporting/server/lib/validate/validate_max_content_length.test.js similarity index 100% rename from x-pack/legacy/plugins/reporting/server/lib/validate/validate_max_content_length.test.js rename to x-pack/plugins/reporting/server/lib/validate/validate_max_content_length.test.js diff --git a/x-pack/legacy/plugins/reporting/server/lib/validate/validate_max_content_length.ts b/x-pack/plugins/reporting/server/lib/validate/validate_max_content_length.ts similarity index 100% rename from x-pack/legacy/plugins/reporting/server/lib/validate/validate_max_content_length.ts rename to x-pack/plugins/reporting/server/lib/validate/validate_max_content_length.ts diff --git a/x-pack/plugins/reporting/server/plugin.ts b/x-pack/plugins/reporting/server/plugin.ts index 905ed2b237c86..d0d25f6d9e0ae 100644 --- a/x-pack/plugins/reporting/server/plugin.ts +++ b/x-pack/plugins/reporting/server/plugin.ts @@ -6,33 +6,85 @@ import { Observable } from 'rxjs'; import { first } from 'rxjs/operators'; -import { CoreSetup, Logger, Plugin, PluginInitializerContext } from 'src/core/server'; -import { ConfigType, createConfig$ } from './config'; - -export interface PluginsSetup { - /** @deprecated */ - __legacy: { - config$: Observable; - }; -} +import { CoreSetup, CoreStart, Plugin, PluginInitializerContext } from 'src/core/server'; +import { ReportingCore } from './core'; +import { ReportingConfigType } from './config'; +import { createBrowserDriverFactory } from './browsers'; +import { buildConfig, createConfig$ } from './config'; +import { createQueueFactory, enqueueJobFactory, LevelLogger, runValidations } from './lib'; +import { registerRoutes } from './routes'; +import { setFieldFormats } from './services'; +import { ReportingSetup, ReportingSetupDeps, ReportingStart, ReportingStartDeps } from './types'; +import { registerReportingUsageCollector } from './usage'; -export class ReportingPlugin implements Plugin { - private readonly log: Logger; +export class ReportingPlugin + implements Plugin { + private readonly initializerContext: PluginInitializerContext; + private logger: LevelLogger; + private reportingCore?: ReportingCore; + private config$: Observable; - constructor(private readonly initializerContext: PluginInitializerContext) { - this.log = this.initializerContext.logger.get(); + constructor(context: PluginInitializerContext) { + this.logger = new LevelLogger(context.logger.get()); + this.initializerContext = context; + this.config$ = context.config.create(); } - public async setup(core: CoreSetup): Promise { - return { - __legacy: { - config$: createConfig$(core, this.initializerContext, this.log).pipe(first()), - }, - }; + public async setup(core: CoreSetup, plugins: ReportingSetupDeps) { + const { elasticsearch, http } = core; + const { licensing, security } = plugins; + const { initializerContext: initContext } = this; + const router = http.createRouter(); + const basePath = http.basePath.get; + + const coreConfig = await createConfig$(core, this.config$, this.logger) + .pipe(first()) + .toPromise(); // apply computed defaults to config + const reportingConfig = buildConfig(initContext, core, coreConfig); // combine kbnServer configs + this.reportingCore = new ReportingCore(reportingConfig); + + const browserDriverFactory = await createBrowserDriverFactory(reportingConfig, this.logger); + + this.reportingCore.pluginSetup({ + browserDriverFactory, + elasticsearch, + licensing, + basePath, + router, + security, + }); + + runValidations(reportingConfig, elasticsearch, browserDriverFactory, this.logger); + registerReportingUsageCollector(this.reportingCore, plugins); + registerRoutes(this.reportingCore, this.logger); + + return {}; } - public start() {} - public stop() {} -} + public async start(core: CoreStart, plugins: ReportingStartDeps) { + const { logger } = this; + const reportingCore = this.getReportingCore(); -export { ConfigType }; + const esqueue = await createQueueFactory(reportingCore, logger); + const enqueueJob = enqueueJobFactory(reportingCore, logger); + + reportingCore.pluginStart({ + savedObjects: core.savedObjects, + uiSettings: core.uiSettings, + esqueue, + enqueueJob, + }); + + setFieldFormats(plugins.data.fieldFormats); + logger.info('reporting plugin started'); + + return {}; + } + + public getReportingCore() { + if (!this.reportingCore) { + throw new Error('Setup is not ready'); + } + return this.reportingCore; + } +} diff --git a/x-pack/legacy/plugins/reporting/server/routes/generate_from_jobparams.ts b/x-pack/plugins/reporting/server/routes/generate_from_jobparams.ts similarity index 100% rename from x-pack/legacy/plugins/reporting/server/routes/generate_from_jobparams.ts rename to x-pack/plugins/reporting/server/routes/generate_from_jobparams.ts diff --git a/x-pack/legacy/plugins/reporting/server/routes/generate_from_savedobject.ts b/x-pack/plugins/reporting/server/routes/generate_from_savedobject.ts similarity index 96% rename from x-pack/legacy/plugins/reporting/server/routes/generate_from_savedobject.ts rename to x-pack/plugins/reporting/server/routes/generate_from_savedobject.ts index 4bc143b911572..b8326406743b7 100644 --- a/x-pack/legacy/plugins/reporting/server/routes/generate_from_savedobject.ts +++ b/x-pack/plugins/reporting/server/routes/generate_from_savedobject.ts @@ -9,7 +9,7 @@ import { get } from 'lodash'; import { HandlerErrorFunction, HandlerFunction, QueuedJobPayload } from './types'; import { ReportingCore } from '../'; import { API_BASE_GENERATE_V1, CSV_FROM_SAVEDOBJECT_JOB_TYPE } from '../../common/constants'; -import { getJobParamsFromRequest } from '../../export_types/csv_from_savedobject/server/lib/get_job_params_from_request'; +import { getJobParamsFromRequest } from '../export_types/csv_from_savedobject/server/lib/get_job_params_from_request'; import { authorizedUserPreRoutingFactory } from './lib/authorized_user_pre_routing'; /* diff --git a/x-pack/legacy/plugins/reporting/server/routes/generate_from_savedobject_immediate.ts b/x-pack/plugins/reporting/server/routes/generate_from_savedobject_immediate.ts similarity index 90% rename from x-pack/legacy/plugins/reporting/server/routes/generate_from_savedobject_immediate.ts rename to x-pack/plugins/reporting/server/routes/generate_from_savedobject_immediate.ts index 8a6d4553dfa9c..1221f67855410 100644 --- a/x-pack/legacy/plugins/reporting/server/routes/generate_from_savedobject_immediate.ts +++ b/x-pack/plugins/reporting/server/routes/generate_from_savedobject_immediate.ts @@ -6,14 +6,15 @@ import { schema } from '@kbn/config-schema'; import { ReportingCore } from '../'; -import { HandlerErrorFunction } from './types'; import { API_BASE_GENERATE_V1 } from '../../common/constants'; -import { createJobFactory, executeJobFactory } from '../../export_types/csv_from_savedobject'; -import { getJobParamsFromRequest } from '../../export_types/csv_from_savedobject/server/lib/get_job_params_from_request'; -import { JobDocPayloadPanelCsv } from '../../export_types/csv_from_savedobject/types'; +import { createJobFactory } from '../export_types/csv_from_savedobject/server/create_job'; +import { executeJobFactory } from '../export_types/csv_from_savedobject/server/execute_job'; +import { getJobParamsFromRequest } from '../export_types/csv_from_savedobject/server/lib/get_job_params_from_request'; +import { JobDocPayloadPanelCsv } from '../export_types/csv_from_savedobject/types'; import { LevelLogger as Logger } from '../lib'; import { JobDocOutput } from '../types'; import { authorizedUserPreRoutingFactory } from './lib/authorized_user_pre_routing'; +import { HandlerErrorFunction } from './types'; /* * This function registers API Endpoints for immediate Reporting jobs. The API inputs are: diff --git a/x-pack/legacy/plugins/reporting/server/routes/generation.test.ts b/x-pack/plugins/reporting/server/routes/generation.test.ts similarity index 98% rename from x-pack/legacy/plugins/reporting/server/routes/generation.test.ts rename to x-pack/plugins/reporting/server/routes/generation.test.ts index 87ac71e250d0c..eb75109c704c7 100644 --- a/x-pack/legacy/plugins/reporting/server/routes/generation.test.ts +++ b/x-pack/plugins/reporting/server/routes/generation.test.ts @@ -9,7 +9,7 @@ import { UnwrapPromise } from '@kbn/utility-types'; // eslint-disable-next-line @kbn/eslint/no-restricted-paths import { setupServer } from 'src/core/server/saved_objects/routes/integration_tests/test_utils'; import { registerJobGenerationRoutes } from './generation'; -import { createMockReportingCore } from '../../test_helpers'; +import { createMockReportingCore } from '../test_helpers'; import { ReportingCore } from '..'; import { ExportTypesRegistry } from '../lib/export_types_registry'; import { ExportTypeDefinition } from '../types'; diff --git a/x-pack/legacy/plugins/reporting/server/routes/generation.ts b/x-pack/plugins/reporting/server/routes/generation.ts similarity index 100% rename from x-pack/legacy/plugins/reporting/server/routes/generation.ts rename to x-pack/plugins/reporting/server/routes/generation.ts diff --git a/x-pack/legacy/plugins/reporting/server/routes/index.ts b/x-pack/plugins/reporting/server/routes/index.ts similarity index 100% rename from x-pack/legacy/plugins/reporting/server/routes/index.ts rename to x-pack/plugins/reporting/server/routes/index.ts diff --git a/x-pack/legacy/plugins/reporting/server/routes/jobs.test.ts b/x-pack/plugins/reporting/server/routes/jobs.test.ts similarity index 99% rename from x-pack/legacy/plugins/reporting/server/routes/jobs.test.ts rename to x-pack/plugins/reporting/server/routes/jobs.test.ts index 0911f48f82ca4..d13b3e72ca8e7 100644 --- a/x-pack/legacy/plugins/reporting/server/routes/jobs.test.ts +++ b/x-pack/plugins/reporting/server/routes/jobs.test.ts @@ -4,18 +4,18 @@ * you may not use this file except in compliance with the Elastic License. */ -import supertest from 'supertest'; import { UnwrapPromise } from '@kbn/utility-types'; +import { of } from 'rxjs'; // eslint-disable-next-line @kbn/eslint/no-restricted-paths import { setupServer } from 'src/core/server/saved_objects/routes/integration_tests/test_utils'; -import { registerJobInfoRoutes } from './jobs'; -import { createMockReportingCore } from '../../test_helpers'; +import supertest from 'supertest'; import { ReportingCore } from '..'; +import { ReportingInternalSetup } from '../core'; +import { LevelLogger } from '../lib'; import { ExportTypesRegistry } from '../lib/export_types_registry'; +import { createMockReportingCore } from '../test_helpers'; import { ExportTypeDefinition } from '../types'; -import { LevelLogger } from '../lib'; -import { ReportingInternalSetup } from '../core'; -import { of } from 'rxjs'; +import { registerJobInfoRoutes } from './jobs'; type setupServerReturn = UnwrapPromise>; diff --git a/x-pack/legacy/plugins/reporting/server/routes/jobs.ts b/x-pack/plugins/reporting/server/routes/jobs.ts similarity index 100% rename from x-pack/legacy/plugins/reporting/server/routes/jobs.ts rename to x-pack/plugins/reporting/server/routes/jobs.ts diff --git a/x-pack/legacy/plugins/reporting/server/routes/lib/authorized_user_pre_routing.test.ts b/x-pack/plugins/reporting/server/routes/lib/authorized_user_pre_routing.test.ts similarity index 85% rename from x-pack/legacy/plugins/reporting/server/routes/lib/authorized_user_pre_routing.test.ts rename to x-pack/plugins/reporting/server/routes/lib/authorized_user_pre_routing.test.ts index 4cb7af3d0d409..b218f9e4607dd 100644 --- a/x-pack/legacy/plugins/reporting/server/routes/lib/authorized_user_pre_routing.test.ts +++ b/x-pack/plugins/reporting/server/routes/lib/authorized_user_pre_routing.test.ts @@ -5,20 +5,23 @@ */ import { KibanaRequest, RequestHandlerContext, KibanaResponseFactory } from 'kibana/server'; -import sinon from 'sinon'; import { coreMock, httpServerMock } from 'src/core/server/mocks'; -import { ReportingConfig, ReportingCore } from '../../'; -import { createMockReportingCore } from '../../../test_helpers'; +import { ReportingCore } from '../../'; +import { createMockReportingCore } from '../../test_helpers'; import { authorizedUserPreRoutingFactory } from './authorized_user_pre_routing'; import { ReportingInternalSetup } from '../../core'; -let mockConfig: ReportingConfig; let mockCore: ReportingCore; - -const getMockConfig = (mockConfigGet: sinon.SinonStub) => ({ - get: mockConfigGet, - kbnConfig: { get: mockConfigGet }, -}); +const kbnConfig = { + 'server.basePath': '/sbp', +}; +const reportingConfig = { + 'roles.allow': ['reporting_user'], +}; +const mockReportingConfig = { + get: (...keys: string[]) => (reportingConfig as any)[keys.join('.')] || 'whoah!', + kbnConfig: { get: (...keys: string[]) => (kbnConfig as any)[keys.join('.')] }, +}; const getMockContext = () => (({ @@ -38,13 +41,11 @@ const getMockResponseFactory = () => unauthorized: (obj: unknown) => obj, } as unknown) as KibanaResponseFactory); -beforeEach(async () => { - const mockConfigGet = sinon.stub().withArgs('roles', 'allow').returns(['reporting_user']); - mockConfig = getMockConfig(mockConfigGet); - mockCore = await createMockReportingCore(mockConfig); -}); - describe('authorized_user_pre_routing', function () { + beforeEach(async () => { + mockCore = await createMockReportingCore(mockReportingConfig); + }); + it('should return from handler with null user when security is disabled', async function () { mockCore.getPluginSetupDeps = () => (({ @@ -106,7 +107,7 @@ describe('authorized_user_pre_routing', function () { ).toMatchObject({ body: `Sorry, you don't have access to Reporting` }); }); - it('should return from handler when security is enabled and user has explicitly allowed role', async function () { + it('should return from handler when security is enabled and user has explicitly allowed role', async function (done) { mockCore.getPluginSetupDeps = () => (({ // @ts-ignore @@ -117,17 +118,16 @@ describe('authorized_user_pre_routing', function () { }, }, } as unknown) as ReportingInternalSetup); + // @ts-ignore overloading config getter + mockCore.config = mockReportingConfig; const authorizedUserPreRouting = authorizedUserPreRoutingFactory(mockCore); const mockResponseFactory = getMockResponseFactory(); - let handlerCalled = false; - authorizedUserPreRouting((user: unknown) => { + authorizedUserPreRouting((user) => { expect(user).toMatchObject({ roles: ['reporting_user'], username: 'friendlyuser' }); - handlerCalled = true; + done(); return Promise.resolve({ status: 200, options: {} }); })(getMockContext(), getMockRequest(), mockResponseFactory); - - expect(handlerCalled).toBe(true); }); it('should return from handler when security is enabled and user has superuser role', async function () {}); diff --git a/x-pack/legacy/plugins/reporting/server/routes/lib/authorized_user_pre_routing.ts b/x-pack/plugins/reporting/server/routes/lib/authorized_user_pre_routing.ts similarity index 95% rename from x-pack/legacy/plugins/reporting/server/routes/lib/authorized_user_pre_routing.ts rename to x-pack/plugins/reporting/server/routes/lib/authorized_user_pre_routing.ts index 87582ca3ca239..2ad974c9dd8e1 100644 --- a/x-pack/legacy/plugins/reporting/server/routes/lib/authorized_user_pre_routing.ts +++ b/x-pack/plugins/reporting/server/routes/lib/authorized_user_pre_routing.ts @@ -5,7 +5,7 @@ */ import { RequestHandler, RouteMethod } from 'src/core/server'; -import { AuthenticatedUser } from '../../../../../../plugins/security/server'; +import { AuthenticatedUser } from '../../../../security/server'; import { getUserFactory } from '../../lib/get_user'; import { ReportingCore } from '../../core'; diff --git a/x-pack/legacy/plugins/reporting/server/routes/lib/get_document_payload.ts b/x-pack/plugins/reporting/server/routes/lib/get_document_payload.ts similarity index 100% rename from x-pack/legacy/plugins/reporting/server/routes/lib/get_document_payload.ts rename to x-pack/plugins/reporting/server/routes/lib/get_document_payload.ts diff --git a/x-pack/legacy/plugins/reporting/server/routes/lib/job_response_handler.ts b/x-pack/plugins/reporting/server/routes/lib/job_response_handler.ts similarity index 97% rename from x-pack/legacy/plugins/reporting/server/routes/lib/job_response_handler.ts rename to x-pack/plugins/reporting/server/routes/lib/job_response_handler.ts index 990af2d0aca80..1a2e10cf355a2 100644 --- a/x-pack/legacy/plugins/reporting/server/routes/lib/job_response_handler.ts +++ b/x-pack/plugins/reporting/server/routes/lib/job_response_handler.ts @@ -5,7 +5,7 @@ */ import { ElasticsearchServiceSetup, kibanaResponseFactory } from 'kibana/server'; -import { AuthenticatedUser } from '../../../../../../plugins/security/server'; +import { AuthenticatedUser } from '../../../../security/server'; import { ReportingConfig } from '../../'; import { WHITELISTED_JOB_CONTENT_TYPES } from '../../../common/constants'; import { ExportTypesRegistry } from '../../lib/export_types_registry'; diff --git a/x-pack/legacy/plugins/reporting/server/routes/types.d.ts b/x-pack/plugins/reporting/server/routes/types.d.ts similarity index 82% rename from x-pack/legacy/plugins/reporting/server/routes/types.d.ts rename to x-pack/plugins/reporting/server/routes/types.d.ts index afa3fd3358fc1..5eceed0a7f2ab 100644 --- a/x-pack/legacy/plugins/reporting/server/routes/types.d.ts +++ b/x-pack/plugins/reporting/server/routes/types.d.ts @@ -4,8 +4,8 @@ * you may not use this file except in compliance with the Elastic License. */ -import { KibanaResponseFactory, KibanaRequest, RequestHandlerContext } from 'src/core/server'; -import { AuthenticatedUser } from '../../../../../plugins/security/common/model/authenticated_user'; +import { KibanaRequest, KibanaResponseFactory, RequestHandlerContext } from 'src/core/server'; +import { AuthenticatedUser } from '../../../security/server'; import { JobDocPayload } from '../types'; export type HandlerFunction = ( diff --git a/x-pack/legacy/plugins/reporting/server/services.ts b/x-pack/plugins/reporting/server/services.ts similarity index 67% rename from x-pack/legacy/plugins/reporting/server/services.ts rename to x-pack/plugins/reporting/server/services.ts index 7d15d2e1af1ae..9f4897a69f4ed 100644 --- a/x-pack/legacy/plugins/reporting/server/services.ts +++ b/x-pack/plugins/reporting/server/services.ts @@ -4,8 +4,8 @@ * you may not use this file except in compliance with the Elastic License. */ -import { createGetterSetter } from '../../../../../src/plugins/kibana_utils/server'; -import { PluginStart as DataPluginStart } from '../../../../../src/plugins/data/server'; +import { createGetterSetter } from '../../../../src/plugins/kibana_utils/server'; +import { PluginStart as DataPluginStart } from '../../../../src/plugins/data/server'; export const [getFieldFormats, setFieldFormats] = createGetterSetter< DataPluginStart['fieldFormats'] diff --git a/x-pack/legacy/plugins/reporting/test_helpers/create_mock_browserdriverfactory.ts b/x-pack/plugins/reporting/server/test_helpers/create_mock_browserdriverfactory.ts similarity index 96% rename from x-pack/legacy/plugins/reporting/test_helpers/create_mock_browserdriverfactory.ts rename to x-pack/plugins/reporting/server/test_helpers/create_mock_browserdriverfactory.ts index 260c94c31df1c..5b0d740e031ab 100644 --- a/x-pack/legacy/plugins/reporting/test_helpers/create_mock_browserdriverfactory.ts +++ b/x-pack/plugins/reporting/server/test_helpers/create_mock_browserdriverfactory.ts @@ -6,11 +6,11 @@ import { Page } from 'puppeteer'; import * as Rx from 'rxjs'; +import { HeadlessChromiumDriver, HeadlessChromiumDriverFactory } from '../browsers'; +import { createDriverFactory } from '../browsers/chromium'; import * as contexts from '../export_types/common/lib/screenshots/constants'; -import { HeadlessChromiumDriver, HeadlessChromiumDriverFactory } from '../server/browsers'; -import { createDriverFactory } from '../server/browsers/chromium'; -import { LevelLogger } from '../server/lib'; -import { CaptureConfig, ElementsPositionAndAttribute } from '../server/types'; +import { LevelLogger } from '../lib'; +import { CaptureConfig, ElementsPositionAndAttribute } from '../types'; interface CreateMockBrowserDriverFactoryOpts { evaluate: jest.Mock, any[]>; diff --git a/x-pack/legacy/plugins/reporting/test_helpers/create_mock_layoutinstance.ts b/x-pack/plugins/reporting/server/test_helpers/create_mock_layoutinstance.ts similarity index 94% rename from x-pack/legacy/plugins/reporting/test_helpers/create_mock_layoutinstance.ts rename to x-pack/plugins/reporting/server/test_helpers/create_mock_layoutinstance.ts index 7f4330e7f6bc6..22da9eb418e9a 100644 --- a/x-pack/legacy/plugins/reporting/test_helpers/create_mock_layoutinstance.ts +++ b/x-pack/plugins/reporting/server/test_helpers/create_mock_layoutinstance.ts @@ -5,7 +5,7 @@ */ import { createLayout, LayoutInstance, LayoutTypes } from '../export_types/common/layouts'; -import { CaptureConfig } from '../server/types'; +import { CaptureConfig } from '../types'; export const createMockLayoutInstance = (captureConfig: CaptureConfig) => { const mockLayout = createLayout(captureConfig, { diff --git a/x-pack/legacy/plugins/reporting/test_helpers/create_mock_reportingplugin.ts b/x-pack/plugins/reporting/server/test_helpers/create_mock_reportingplugin.ts similarity index 67% rename from x-pack/legacy/plugins/reporting/test_helpers/create_mock_reportingplugin.ts rename to x-pack/plugins/reporting/server/test_helpers/create_mock_reportingplugin.ts index f6dbccdfe3980..b04e697d0a118 100644 --- a/x-pack/legacy/plugins/reporting/test_helpers/create_mock_reportingplugin.ts +++ b/x-pack/plugins/reporting/server/test_helpers/create_mock_reportingplugin.ts @@ -4,42 +4,52 @@ * you may not use this file except in compliance with the Elastic License. */ -jest.mock('../server/routes'); -jest.mock('../server/usage'); -jest.mock('../server/browsers'); -jest.mock('../server/browsers'); -jest.mock('../server/lib/create_queue'); -jest.mock('../server/lib/enqueue_job'); -jest.mock('../server/lib/validate'); +jest.mock('../routes'); +jest.mock('../usage'); +jest.mock('../browsers'); +jest.mock('../browsers'); +jest.mock('../lib/create_queue'); +jest.mock('../lib/enqueue_job'); +jest.mock('../lib/validate'); import { of } from 'rxjs'; -import { EventEmitter } from 'events'; -// eslint-disable-next-line @kbn/eslint/no-restricted-paths import { coreMock } from 'src/core/server/mocks'; -import { ReportingConfig, ReportingCore, ReportingPlugin } from '../server'; -import { ReportingSetupDeps, ReportingStartDeps } from '../server/types'; -import { ReportingInternalSetup } from '../server/core'; +import { ReportingConfig, ReportingCore } from '../'; +import { ReportingInternalSetup } from '../core'; +import { ReportingPlugin } from '../plugin'; +import { ReportingSetupDeps, ReportingStartDeps } from '../types'; const createMockSetupDeps = (setupMock?: any): ReportingSetupDeps => { return { - elasticsearch: setupMock.elasticsearch, security: setupMock.security, licensing: { license$: of({ isAvailable: true, isActive: true, type: 'basic' }), } as any, usageCollection: {} as any, - __LEGACY: { plugins: { xpack_main: { status: new EventEmitter() } } } as any, }; }; export const createMockStartDeps = (startMock?: any): ReportingStartDeps => ({ data: startMock.data, - __LEGACY: {} as any, }); const createMockReportingPlugin = async (config: ReportingConfig): Promise => { - config = config || {}; - const plugin = new ReportingPlugin(coreMock.createPluginInitializerContext(config), config); + const mockConfig = { + index: '.reporting', + kibanaServer: { + hostname: 'localhost', + port: '80', + }, + capture: { + browser: { + chromium: { + disableSandbox: true, + }, + }, + }, + ...config, + }; + const plugin = new ReportingPlugin(coreMock.createPluginInitializerContext(mockConfig)); const setupMock = coreMock.createSetup(); const coreStartMock = coreMock.createStart(); const startMock = { diff --git a/x-pack/legacy/plugins/reporting/test_helpers/create_mock_server.ts b/x-pack/plugins/reporting/server/test_helpers/create_mock_server.ts similarity index 100% rename from x-pack/legacy/plugins/reporting/test_helpers/create_mock_server.ts rename to x-pack/plugins/reporting/server/test_helpers/create_mock_server.ts diff --git a/x-pack/legacy/plugins/reporting/test_helpers/index.ts b/x-pack/plugins/reporting/server/test_helpers/index.ts similarity index 100% rename from x-pack/legacy/plugins/reporting/test_helpers/index.ts rename to x-pack/plugins/reporting/server/test_helpers/index.ts diff --git a/x-pack/legacy/plugins/reporting/server/types.ts b/x-pack/plugins/reporting/server/types.ts similarity index 83% rename from x-pack/legacy/plugins/reporting/server/types.ts rename to x-pack/plugins/reporting/server/types.ts index 2ccc209c3ce50..409a89899bee0 100644 --- a/x-pack/legacy/plugins/reporting/server/types.ts +++ b/x-pack/plugins/reporting/server/types.ts @@ -4,22 +4,18 @@ * you may not use this file except in compliance with the Elastic License. */ -import { Legacy } from 'kibana'; -import { KibanaRequest, RequestHandlerContext } from 'src/core/server'; -import { ElasticsearchServiceSetup } from 'kibana/server'; import * as Rx from 'rxjs'; +import { KibanaRequest, RequestHandlerContext } from 'src/core/server'; // eslint-disable-next-line @kbn/eslint/no-restricted-paths import { DataPluginStart } from 'src/plugins/data/server/plugin'; import { UsageCollectionSetup } from 'src/plugins/usage_collection/server'; -import { LicensingPluginSetup } from '../../../../plugins/licensing/server'; -import { ReportingPluginSpecOptions } from '../'; -import { CancellationToken } from '../../../../plugins/reporting/common'; -import { JobStatus } from '../../../../plugins/reporting/common/types'; -import { SecurityPluginSetup } from '../../../../plugins/security/server'; -import { XPackMainPlugin } from '../../xpack_main/server/xpack_main'; -import { LayoutInstance } from '../export_types/common/layouts'; +import { CancellationToken } from '../../../plugins/reporting/common'; +import { LicensingPluginSetup } from '../../licensing/server'; +import { SecurityPluginSetup } from '../../security/server'; +import { JobStatus } from '../common/types'; import { ReportingConfigType } from './config'; import { ReportingCore } from './core'; +import { LayoutInstance } from './export_types/common/layouts'; import { LevelLogger } from './lib'; /* @@ -161,31 +157,18 @@ export type ScreenshotsObservableFn = ({ */ export interface ReportingSetupDeps { - elasticsearch: ElasticsearchServiceSetup; licensing: LicensingPluginSetup; - security: SecurityPluginSetup; + security?: SecurityPluginSetup; usageCollection?: UsageCollectionSetup; - __LEGACY: LegacySetup; } export interface ReportingStartDeps { data: DataPluginStart; - __LEGACY: LegacySetup; } export type ReportingStart = object; export type ReportingSetup = object; -export interface LegacySetup { - plugins: { - xpack_main: XPackMainPlugin & { - status?: any; - }; - reporting: ReportingPluginSpecOptions; - }; - route: Legacy.Server['route']; -} - /* * Internal Types */ @@ -202,8 +185,6 @@ export type ESQueueWorkerExecuteFn = ( cancellationToken?: CancellationToken ) => Promise; -export type ServerFacade = LegacySetup; - export type CaptureConfig = ReportingConfigType['capture']; export type ScrollConfig = ReportingConfigType['csv']['scroll']; diff --git a/x-pack/legacy/plugins/reporting/server/usage/__snapshots__/reporting_usage_collector.test.ts.snap b/x-pack/plugins/reporting/server/usage/__snapshots__/reporting_usage_collector.test.ts.snap similarity index 100% rename from x-pack/legacy/plugins/reporting/server/usage/__snapshots__/reporting_usage_collector.test.ts.snap rename to x-pack/plugins/reporting/server/usage/__snapshots__/reporting_usage_collector.test.ts.snap diff --git a/x-pack/legacy/plugins/reporting/server/usage/decorate_range_stats.ts b/x-pack/plugins/reporting/server/usage/decorate_range_stats.ts similarity index 100% rename from x-pack/legacy/plugins/reporting/server/usage/decorate_range_stats.ts rename to x-pack/plugins/reporting/server/usage/decorate_range_stats.ts diff --git a/x-pack/legacy/plugins/reporting/server/usage/get_export_type_handler.ts b/x-pack/plugins/reporting/server/usage/get_export_type_handler.ts similarity index 100% rename from x-pack/legacy/plugins/reporting/server/usage/get_export_type_handler.ts rename to x-pack/plugins/reporting/server/usage/get_export_type_handler.ts diff --git a/x-pack/legacy/plugins/reporting/server/usage/get_reporting_usage.ts b/x-pack/plugins/reporting/server/usage/get_reporting_usage.ts similarity index 100% rename from x-pack/legacy/plugins/reporting/server/usage/get_reporting_usage.ts rename to x-pack/plugins/reporting/server/usage/get_reporting_usage.ts diff --git a/x-pack/legacy/plugins/reporting/server/usage/index.ts b/x-pack/plugins/reporting/server/usage/index.ts similarity index 87% rename from x-pack/legacy/plugins/reporting/server/usage/index.ts rename to x-pack/plugins/reporting/server/usage/index.ts index d00a8570a024f..a426451db2282 100644 --- a/x-pack/legacy/plugins/reporting/server/usage/index.ts +++ b/x-pack/plugins/reporting/server/usage/index.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { LicenseType } from '../../../../../plugins/licensing/server'; +import { LicenseType } from '../../../licensing/server'; export interface FeaturesAvailability { isAvailable: () => boolean; diff --git a/x-pack/legacy/plugins/reporting/server/usage/reporting_usage_collector.test.ts b/x-pack/plugins/reporting/server/usage/reporting_usage_collector.test.ts similarity index 99% rename from x-pack/legacy/plugins/reporting/server/usage/reporting_usage_collector.test.ts rename to x-pack/plugins/reporting/server/usage/reporting_usage_collector.test.ts index 830c6275cd96a..d5dccaca3042a 100644 --- a/x-pack/legacy/plugins/reporting/server/usage/reporting_usage_collector.test.ts +++ b/x-pack/plugins/reporting/server/usage/reporting_usage_collector.test.ts @@ -8,7 +8,7 @@ import * as Rx from 'rxjs'; import sinon from 'sinon'; import { UsageCollectionSetup } from 'src/plugins/usage_collection/server'; import { ReportingConfig } from '../'; -import { createMockReportingCore } from '../../test_helpers'; +import { createMockReportingCore } from '../test_helpers'; import { getExportTypesRegistry } from '../lib/export_types_registry'; import { ReportingSetupDeps } from '../types'; import { FeaturesAvailability } from './'; diff --git a/x-pack/legacy/plugins/reporting/server/usage/reporting_usage_collector.ts b/x-pack/plugins/reporting/server/usage/reporting_usage_collector.ts similarity index 100% rename from x-pack/legacy/plugins/reporting/server/usage/reporting_usage_collector.ts rename to x-pack/plugins/reporting/server/usage/reporting_usage_collector.ts diff --git a/x-pack/legacy/plugins/reporting/server/usage/types.ts b/x-pack/plugins/reporting/server/usage/types.ts similarity index 100% rename from x-pack/legacy/plugins/reporting/server/usage/types.ts rename to x-pack/plugins/reporting/server/usage/types.ts diff --git a/x-pack/plugins/security/common/licensing/license_service.test.ts b/x-pack/plugins/security/common/licensing/license_service.test.ts index 77e6460b7669a..564b71a2e0fac 100644 --- a/x-pack/plugins/security/common/licensing/license_service.test.ts +++ b/x-pack/plugins/security/common/licensing/license_service.test.ts @@ -5,7 +5,7 @@ */ import { of, BehaviorSubject } from 'rxjs'; -import { licensingMock } from '../../../licensing/public/mocks'; +import { licenseMock } from '../../../licensing/common/licensing.mock'; import { SecurityLicenseService } from './license_service'; describe('license features', function () { @@ -29,7 +29,7 @@ describe('license features', function () { }); it('should display error when X-Pack is unavailable', () => { - const rawLicenseMock = licensingMock.createLicenseMock(); + const rawLicenseMock = licenseMock.createLicenseMock(); rawLicenseMock.isAvailable = false; const serviceSetup = new SecurityLicenseService().setup({ license$: of(rawLicenseMock), @@ -50,7 +50,7 @@ describe('license features', function () { }); it('should notify consumers of licensed feature changes', () => { - const rawLicenseMock = licensingMock.createLicenseMock(); + const rawLicenseMock = licenseMock.createLicenseMock(); rawLicenseMock.isAvailable = false; const rawLicense$ = new BehaviorSubject(rawLicenseMock); const serviceSetup = new SecurityLicenseService().setup({ @@ -79,7 +79,7 @@ describe('license features', function () { ] `); - rawLicense$.next(licensingMock.createLicenseMock()); + rawLicense$.next(licenseMock.createLicenseMock()); expect(subscriptionHandler).toHaveBeenCalledTimes(2); expect(subscriptionHandler.mock.calls[1]).toMatchInlineSnapshot(` Array [ @@ -103,7 +103,7 @@ describe('license features', function () { }); it('should show login page and other security elements, allow RBAC but forbid paid features if license is basic.', () => { - const mockRawLicense = licensingMock.createLicense({ + const mockRawLicense = licenseMock.createLicense({ features: { security: { isEnabled: true, isAvailable: true } }, }); @@ -129,7 +129,7 @@ describe('license features', function () { }); it('should not show login page or other security elements if security is disabled in Elasticsearch.', () => { - const mockRawLicense = licensingMock.createLicense({ + const mockRawLicense = licenseMock.createLicense({ features: { security: { isEnabled: false, isAvailable: true } }, }); @@ -151,7 +151,7 @@ describe('license features', function () { }); it('should allow role mappings, access agreement and sub-feature privileges, but not DLS/FLS if license = gold', () => { - const mockRawLicense = licensingMock.createLicense({ + const mockRawLicense = licenseMock.createLicense({ license: { mode: 'gold', type: 'gold' }, features: { security: { isEnabled: true, isAvailable: true } }, }); @@ -174,7 +174,7 @@ describe('license features', function () { }); it('should allow to login, allow RBAC, role mappings, access agreement, sub-feature privileges, and DLS if license >= platinum', () => { - const mockRawLicense = licensingMock.createLicense({ + const mockRawLicense = licenseMock.createLicense({ license: { mode: 'platinum', type: 'platinum' }, features: { security: { isEnabled: true, isAvailable: true } }, }); @@ -197,7 +197,7 @@ describe('license features', function () { }); it('should allow all basic features + audit logging for standard license', () => { - const mockRawLicense = licensingMock.createLicense({ + const mockRawLicense = licenseMock.createLicense({ license: { mode: 'standard', type: 'standard' }, features: { security: { isEnabled: true, isAvailable: true } }, }); diff --git a/x-pack/plugins/security_solution/.gitattributes b/x-pack/plugins/security_solution/.gitattributes new file mode 100644 index 0000000000000..431f25be5e78e --- /dev/null +++ b/x-pack/plugins/security_solution/.gitattributes @@ -0,0 +1,6 @@ +# Auto-collapse generated files in GitHub +# https://help.github.com/en/articles/customizing-how-changed-files-appear-on-github +x-pack/plugins/security_solution/server/graphql/types.ts linguist-generated=true +x-pack/plugins/security_solution/public/graphql/types.ts linguist-generated=true +x-pack/plugins/security_solution/public/graphql/introspection.json linguist-generated=true + diff --git a/x-pack/plugins/siem/common/constants.ts b/x-pack/plugins/security_solution/common/constants.ts similarity index 86% rename from x-pack/plugins/siem/common/constants.ts rename to x-pack/plugins/security_solution/common/constants.ts index a80f7f04fbfa0..b5cd8f2dec0a3 100644 --- a/x-pack/plugins/siem/common/constants.ts +++ b/x-pack/plugins/security_solution/common/constants.ts @@ -4,24 +4,24 @@ * you may not use this file except in compliance with the Elastic License. */ -export const APP_ID = 'siem'; -export const APP_NAME = 'SIEM'; +export const APP_ID = 'securitySolution'; +export const APP_NAME = 'Security'; export const APP_ICON = 'securityAnalyticsApp'; -export const APP_PATH = `/app/${APP_ID}`; +export const APP_PATH = `/app/security`; export const DEFAULT_BYTES_FORMAT = 'format:bytes:defaultPattern'; export const DEFAULT_DATE_FORMAT = 'dateFormat'; export const DEFAULT_DATE_FORMAT_TZ = 'dateFormat:tz'; export const DEFAULT_DARK_MODE = 'theme:darkMode'; -export const DEFAULT_INDEX_KEY = 'siem:defaultIndex'; +export const DEFAULT_INDEX_KEY = 'securitySolution:defaultIndex'; export const DEFAULT_NUMBER_FORMAT = 'format:number:defaultPattern'; export const DEFAULT_TIME_RANGE = 'timepicker:timeDefaults'; export const DEFAULT_REFRESH_RATE_INTERVAL = 'timepicker:refreshIntervalDefaults'; -export const DEFAULT_SIEM_TIME_RANGE = 'siem:timeDefaults'; -export const DEFAULT_SIEM_REFRESH_INTERVAL = 'siem:refreshIntervalDefaults'; +export const DEFAULT_APP_TIME_RANGE = 'securitySolution:timeDefaults'; +export const DEFAULT_APP_REFRESH_INTERVAL = 'securitySolution:refreshIntervalDefaults'; export const DEFAULT_SIGNALS_INDEX = '.siem-signals'; export const DEFAULT_MAX_SIGNALS = 100; export const DEFAULT_SEARCH_AFTER_PAGE_SIZE = 100; -export const DEFAULT_ANOMALY_SCORE = 'siem:defaultAnomalyScore'; +export const DEFAULT_ANOMALY_SCORE = 'securitySolution:defaultAnomalyScore'; export const DEFAULT_MAX_TABLE_QUERY_SIZE = 10000; export const DEFAULT_SCALE_DATE_FORMAT = 'dateFormat:scaled'; export const DEFAULT_FROM = 'now-24h'; @@ -42,16 +42,16 @@ export const DEFAULT_INDEX_PATTERN = [ ]; /** This Kibana Advanced Setting enables the `Security news` feed widget */ -export const ENABLE_NEWS_FEED_SETTING = 'siem:enableNewsFeed'; +export const ENABLE_NEWS_FEED_SETTING = 'securitySolution:enableNewsFeed'; /** This Kibana Advanced Setting specifies the URL of the News feed widget */ -export const NEWS_FEED_URL_SETTING = 'siem:newsFeedUrl'; +export const NEWS_FEED_URL_SETTING = 'securitySolution:newsFeedUrl'; /** The default value for News feed widget */ export const NEWS_FEED_URL_SETTING_DEFAULT = 'https://feeds.elastic.co/security-solution'; /** This Kibana Advanced Setting specifies the URLs of `IP Reputation Links`*/ -export const IP_REPUTATION_LINKS_SETTING = 'siem:ipReputationLinks'; +export const IP_REPUTATION_LINKS_SETTING = 'securitySolution:ipReputationLinks'; /** The default value for `IP Reputation Links` */ export const IP_REPUTATION_LINKS_SETTING_DEFAULT = `[ @@ -62,12 +62,12 @@ export const IP_REPUTATION_LINKS_SETTING_DEFAULT = `[ /** * Id for the signals alerting type */ -export const SIGNALS_ID = `${APP_ID}.signals`; +export const SIGNALS_ID = `siem.signals`; /** * Id for the notifications alerting type */ -export const NOTIFICATIONS_ID = `${APP_ID}.notifications`; +export const NOTIFICATIONS_ID = `siem.notifications`; /** * Special internal structure for tags for signals. This is used diff --git a/x-pack/plugins/siem/common/detection_engine/schemas/common/schemas.ts b/x-pack/plugins/security_solution/common/detection_engine/schemas/common/schemas.ts similarity index 100% rename from x-pack/plugins/siem/common/detection_engine/schemas/common/schemas.ts rename to x-pack/plugins/security_solution/common/detection_engine/schemas/common/schemas.ts diff --git a/x-pack/plugins/siem/common/detection_engine/schemas/response/__mocks__/utils.ts b/x-pack/plugins/security_solution/common/detection_engine/schemas/response/__mocks__/utils.ts similarity index 100% rename from x-pack/plugins/siem/common/detection_engine/schemas/response/__mocks__/utils.ts rename to x-pack/plugins/security_solution/common/detection_engine/schemas/response/__mocks__/utils.ts diff --git a/x-pack/plugins/siem/common/detection_engine/schemas/response/error_schema.test.ts b/x-pack/plugins/security_solution/common/detection_engine/schemas/response/error_schema.test.ts similarity index 100% rename from x-pack/plugins/siem/common/detection_engine/schemas/response/error_schema.test.ts rename to x-pack/plugins/security_solution/common/detection_engine/schemas/response/error_schema.test.ts diff --git a/x-pack/plugins/siem/common/detection_engine/schemas/response/error_schema.ts b/x-pack/plugins/security_solution/common/detection_engine/schemas/response/error_schema.ts similarity index 100% rename from x-pack/plugins/siem/common/detection_engine/schemas/response/error_schema.ts rename to x-pack/plugins/security_solution/common/detection_engine/schemas/response/error_schema.ts diff --git a/x-pack/plugins/siem/common/detection_engine/schemas/response/find_rules_schema.test.ts b/x-pack/plugins/security_solution/common/detection_engine/schemas/response/find_rules_schema.test.ts similarity index 100% rename from x-pack/plugins/siem/common/detection_engine/schemas/response/find_rules_schema.test.ts rename to x-pack/plugins/security_solution/common/detection_engine/schemas/response/find_rules_schema.test.ts diff --git a/x-pack/plugins/siem/common/detection_engine/schemas/response/find_rules_schema.ts b/x-pack/plugins/security_solution/common/detection_engine/schemas/response/find_rules_schema.ts similarity index 100% rename from x-pack/plugins/siem/common/detection_engine/schemas/response/find_rules_schema.ts rename to x-pack/plugins/security_solution/common/detection_engine/schemas/response/find_rules_schema.ts diff --git a/x-pack/plugins/siem/common/detection_engine/schemas/response/import_rules_schema.test.ts b/x-pack/plugins/security_solution/common/detection_engine/schemas/response/import_rules_schema.test.ts similarity index 100% rename from x-pack/plugins/siem/common/detection_engine/schemas/response/import_rules_schema.test.ts rename to x-pack/plugins/security_solution/common/detection_engine/schemas/response/import_rules_schema.test.ts diff --git a/x-pack/plugins/siem/common/detection_engine/schemas/response/import_rules_schema.ts b/x-pack/plugins/security_solution/common/detection_engine/schemas/response/import_rules_schema.ts similarity index 100% rename from x-pack/plugins/siem/common/detection_engine/schemas/response/import_rules_schema.ts rename to x-pack/plugins/security_solution/common/detection_engine/schemas/response/import_rules_schema.ts diff --git a/x-pack/plugins/siem/common/detection_engine/schemas/response/prepackaged_rules_schema.test.ts b/x-pack/plugins/security_solution/common/detection_engine/schemas/response/prepackaged_rules_schema.test.ts similarity index 100% rename from x-pack/plugins/siem/common/detection_engine/schemas/response/prepackaged_rules_schema.test.ts rename to x-pack/plugins/security_solution/common/detection_engine/schemas/response/prepackaged_rules_schema.test.ts diff --git a/x-pack/plugins/siem/common/detection_engine/schemas/response/prepackaged_rules_schema.ts b/x-pack/plugins/security_solution/common/detection_engine/schemas/response/prepackaged_rules_schema.ts similarity index 100% rename from x-pack/plugins/siem/common/detection_engine/schemas/response/prepackaged_rules_schema.ts rename to x-pack/plugins/security_solution/common/detection_engine/schemas/response/prepackaged_rules_schema.ts diff --git a/x-pack/plugins/siem/common/detection_engine/schemas/response/prepackaged_rules_status_schema.test.ts b/x-pack/plugins/security_solution/common/detection_engine/schemas/response/prepackaged_rules_status_schema.test.ts similarity index 100% rename from x-pack/plugins/siem/common/detection_engine/schemas/response/prepackaged_rules_status_schema.test.ts rename to x-pack/plugins/security_solution/common/detection_engine/schemas/response/prepackaged_rules_status_schema.test.ts diff --git a/x-pack/plugins/siem/common/detection_engine/schemas/response/prepackaged_rules_status_schema.ts b/x-pack/plugins/security_solution/common/detection_engine/schemas/response/prepackaged_rules_status_schema.ts similarity index 100% rename from x-pack/plugins/siem/common/detection_engine/schemas/response/prepackaged_rules_status_schema.ts rename to x-pack/plugins/security_solution/common/detection_engine/schemas/response/prepackaged_rules_status_schema.ts diff --git a/x-pack/plugins/siem/common/detection_engine/schemas/response/rules_bulk_schema.test.ts b/x-pack/plugins/security_solution/common/detection_engine/schemas/response/rules_bulk_schema.test.ts similarity index 100% rename from x-pack/plugins/siem/common/detection_engine/schemas/response/rules_bulk_schema.test.ts rename to x-pack/plugins/security_solution/common/detection_engine/schemas/response/rules_bulk_schema.test.ts diff --git a/x-pack/plugins/siem/common/detection_engine/schemas/response/rules_bulk_schema.ts b/x-pack/plugins/security_solution/common/detection_engine/schemas/response/rules_bulk_schema.ts similarity index 100% rename from x-pack/plugins/siem/common/detection_engine/schemas/response/rules_bulk_schema.ts rename to x-pack/plugins/security_solution/common/detection_engine/schemas/response/rules_bulk_schema.ts diff --git a/x-pack/plugins/siem/common/detection_engine/schemas/response/rules_schema.test.ts b/x-pack/plugins/security_solution/common/detection_engine/schemas/response/rules_schema.test.ts similarity index 100% rename from x-pack/plugins/siem/common/detection_engine/schemas/response/rules_schema.test.ts rename to x-pack/plugins/security_solution/common/detection_engine/schemas/response/rules_schema.test.ts diff --git a/x-pack/plugins/siem/common/detection_engine/schemas/response/rules_schema.ts b/x-pack/plugins/security_solution/common/detection_engine/schemas/response/rules_schema.ts similarity index 100% rename from x-pack/plugins/siem/common/detection_engine/schemas/response/rules_schema.ts rename to x-pack/plugins/security_solution/common/detection_engine/schemas/response/rules_schema.ts diff --git a/x-pack/plugins/siem/common/detection_engine/schemas/response/type_timeline_only_schema.test.ts b/x-pack/plugins/security_solution/common/detection_engine/schemas/response/type_timeline_only_schema.test.ts similarity index 100% rename from x-pack/plugins/siem/common/detection_engine/schemas/response/type_timeline_only_schema.test.ts rename to x-pack/plugins/security_solution/common/detection_engine/schemas/response/type_timeline_only_schema.test.ts diff --git a/x-pack/plugins/siem/common/detection_engine/schemas/response/type_timeline_only_schema.ts b/x-pack/plugins/security_solution/common/detection_engine/schemas/response/type_timeline_only_schema.ts similarity index 100% rename from x-pack/plugins/siem/common/detection_engine/schemas/response/type_timeline_only_schema.ts rename to x-pack/plugins/security_solution/common/detection_engine/schemas/response/type_timeline_only_schema.ts diff --git a/x-pack/plugins/siem/common/detection_engine/schemas/types/iso_date_string.test.ts b/x-pack/plugins/security_solution/common/detection_engine/schemas/types/iso_date_string.test.ts similarity index 100% rename from x-pack/plugins/siem/common/detection_engine/schemas/types/iso_date_string.test.ts rename to x-pack/plugins/security_solution/common/detection_engine/schemas/types/iso_date_string.test.ts diff --git a/x-pack/plugins/siem/common/detection_engine/schemas/types/iso_date_string.ts b/x-pack/plugins/security_solution/common/detection_engine/schemas/types/iso_date_string.ts similarity index 100% rename from x-pack/plugins/siem/common/detection_engine/schemas/types/iso_date_string.ts rename to x-pack/plugins/security_solution/common/detection_engine/schemas/types/iso_date_string.ts diff --git a/x-pack/plugins/siem/common/detection_engine/schemas/types/lists_default_array.test.ts b/x-pack/plugins/security_solution/common/detection_engine/schemas/types/lists_default_array.test.ts similarity index 100% rename from x-pack/plugins/siem/common/detection_engine/schemas/types/lists_default_array.test.ts rename to x-pack/plugins/security_solution/common/detection_engine/schemas/types/lists_default_array.test.ts diff --git a/x-pack/plugins/siem/common/detection_engine/schemas/types/lists_default_array.ts b/x-pack/plugins/security_solution/common/detection_engine/schemas/types/lists_default_array.ts similarity index 100% rename from x-pack/plugins/siem/common/detection_engine/schemas/types/lists_default_array.ts rename to x-pack/plugins/security_solution/common/detection_engine/schemas/types/lists_default_array.ts diff --git a/x-pack/plugins/siem/common/detection_engine/schemas/types/positive_integer.ts b/x-pack/plugins/security_solution/common/detection_engine/schemas/types/positive_integer.ts similarity index 100% rename from x-pack/plugins/siem/common/detection_engine/schemas/types/positive_integer.ts rename to x-pack/plugins/security_solution/common/detection_engine/schemas/types/positive_integer.ts diff --git a/x-pack/plugins/siem/common/detection_engine/schemas/types/positive_integer_greater_than_zero.test.ts b/x-pack/plugins/security_solution/common/detection_engine/schemas/types/positive_integer_greater_than_zero.test.ts similarity index 100% rename from x-pack/plugins/siem/common/detection_engine/schemas/types/positive_integer_greater_than_zero.test.ts rename to x-pack/plugins/security_solution/common/detection_engine/schemas/types/positive_integer_greater_than_zero.test.ts diff --git a/x-pack/plugins/siem/common/detection_engine/schemas/types/positive_integer_greater_than_zero.ts b/x-pack/plugins/security_solution/common/detection_engine/schemas/types/positive_integer_greater_than_zero.ts similarity index 100% rename from x-pack/plugins/siem/common/detection_engine/schemas/types/positive_integer_greater_than_zero.ts rename to x-pack/plugins/security_solution/common/detection_engine/schemas/types/positive_integer_greater_than_zero.ts diff --git a/x-pack/plugins/siem/common/detection_engine/schemas/types/postive_integer.test.ts b/x-pack/plugins/security_solution/common/detection_engine/schemas/types/postive_integer.test.ts similarity index 100% rename from x-pack/plugins/siem/common/detection_engine/schemas/types/postive_integer.test.ts rename to x-pack/plugins/security_solution/common/detection_engine/schemas/types/postive_integer.test.ts diff --git a/x-pack/plugins/siem/common/detection_engine/schemas/types/references_default_array.test.ts b/x-pack/plugins/security_solution/common/detection_engine/schemas/types/references_default_array.test.ts similarity index 100% rename from x-pack/plugins/siem/common/detection_engine/schemas/types/references_default_array.test.ts rename to x-pack/plugins/security_solution/common/detection_engine/schemas/types/references_default_array.test.ts diff --git a/x-pack/plugins/siem/common/detection_engine/schemas/types/references_default_array.ts b/x-pack/plugins/security_solution/common/detection_engine/schemas/types/references_default_array.ts similarity index 100% rename from x-pack/plugins/siem/common/detection_engine/schemas/types/references_default_array.ts rename to x-pack/plugins/security_solution/common/detection_engine/schemas/types/references_default_array.ts diff --git a/x-pack/plugins/siem/common/detection_engine/schemas/types/risk_score.test.ts b/x-pack/plugins/security_solution/common/detection_engine/schemas/types/risk_score.test.ts similarity index 100% rename from x-pack/plugins/siem/common/detection_engine/schemas/types/risk_score.test.ts rename to x-pack/plugins/security_solution/common/detection_engine/schemas/types/risk_score.test.ts diff --git a/x-pack/plugins/siem/common/detection_engine/schemas/types/risk_score.ts b/x-pack/plugins/security_solution/common/detection_engine/schemas/types/risk_score.ts similarity index 100% rename from x-pack/plugins/siem/common/detection_engine/schemas/types/risk_score.ts rename to x-pack/plugins/security_solution/common/detection_engine/schemas/types/risk_score.ts diff --git a/x-pack/plugins/siem/common/detection_engine/schemas/types/uuid.test.ts b/x-pack/plugins/security_solution/common/detection_engine/schemas/types/uuid.test.ts similarity index 100% rename from x-pack/plugins/siem/common/detection_engine/schemas/types/uuid.test.ts rename to x-pack/plugins/security_solution/common/detection_engine/schemas/types/uuid.test.ts diff --git a/x-pack/plugins/siem/common/detection_engine/schemas/types/uuid.ts b/x-pack/plugins/security_solution/common/detection_engine/schemas/types/uuid.ts similarity index 100% rename from x-pack/plugins/siem/common/detection_engine/schemas/types/uuid.ts rename to x-pack/plugins/security_solution/common/detection_engine/schemas/types/uuid.ts diff --git a/x-pack/plugins/siem/common/detection_engine/transform_actions.test.ts b/x-pack/plugins/security_solution/common/detection_engine/transform_actions.test.ts similarity index 100% rename from x-pack/plugins/siem/common/detection_engine/transform_actions.test.ts rename to x-pack/plugins/security_solution/common/detection_engine/transform_actions.test.ts diff --git a/x-pack/plugins/siem/common/detection_engine/transform_actions.ts b/x-pack/plugins/security_solution/common/detection_engine/transform_actions.ts similarity index 100% rename from x-pack/plugins/siem/common/detection_engine/transform_actions.ts rename to x-pack/plugins/security_solution/common/detection_engine/transform_actions.ts diff --git a/x-pack/plugins/siem/common/detection_engine/types.ts b/x-pack/plugins/security_solution/common/detection_engine/types.ts similarity index 100% rename from x-pack/plugins/siem/common/detection_engine/types.ts rename to x-pack/plugins/security_solution/common/detection_engine/types.ts diff --git a/x-pack/plugins/siem/common/endpoint/generate_data.test.ts b/x-pack/plugins/security_solution/common/endpoint/generate_data.test.ts similarity index 100% rename from x-pack/plugins/siem/common/endpoint/generate_data.test.ts rename to x-pack/plugins/security_solution/common/endpoint/generate_data.test.ts diff --git a/x-pack/plugins/siem/common/endpoint/generate_data.ts b/x-pack/plugins/security_solution/common/endpoint/generate_data.ts similarity index 95% rename from x-pack/plugins/siem/common/endpoint/generate_data.ts rename to x-pack/plugins/security_solution/common/endpoint/generate_data.ts index 597ad4df64dfe..57d41b6554907 100644 --- a/x-pack/plugins/siem/common/endpoint/generate_data.ts +++ b/x-pack/plugins/security_solution/common/endpoint/generate_data.ts @@ -445,6 +445,41 @@ export class EndpointDocGenerator { }; } + /** + * Wrapper generator for fullResolverTreeGenerator to make it easier to quickly stream + * many resolver trees to Elasticsearch. + * @param numAlerts - number of alerts to generate + * @param alertAncestors - number of ancestor generations to create relative to the alert + * @param childGenerations - number of child generations to create relative to the alert + * @param maxChildrenPerNode - maximum number of children for any given node in the tree + * @param relatedEventsPerNode - number of related events (file, registry, etc) to create for each process event in the tree + * @param percentNodesWithRelated - percent of nodes which should have related events + * @param percentTerminated - percent of nodes which will have process termination events + * @param alwaysGenMaxChildrenPerNode - flag to always return the max children per node instead of it being a random number of children + */ + public *alertsGenerator( + numAlerts: number, + alertAncestors?: number, + childGenerations?: number, + maxChildrenPerNode?: number, + relatedEventsPerNode?: number, + percentNodesWithRelated?: number, + percentTerminated?: number, + alwaysGenMaxChildrenPerNode?: boolean + ) { + for (let i = 0; i < numAlerts; i++) { + yield* this.fullResolverTreeGenerator( + alertAncestors, + childGenerations, + maxChildrenPerNode, + relatedEventsPerNode, + percentNodesWithRelated, + percentTerminated, + alwaysGenMaxChildrenPerNode + ); + } + } + /** * Generator function that creates the full set of events needed to render resolver. * The number of nodes grows exponentially with the number of generations and children per node. diff --git a/x-pack/plugins/siem/common/endpoint/models/event.ts b/x-pack/plugins/security_solution/common/endpoint/models/event.ts similarity index 100% rename from x-pack/plugins/siem/common/endpoint/models/event.ts rename to x-pack/plugins/security_solution/common/endpoint/models/event.ts diff --git a/x-pack/plugins/siem/common/endpoint/models/policy_config.ts b/x-pack/plugins/security_solution/common/endpoint/models/policy_config.ts similarity index 100% rename from x-pack/plugins/siem/common/endpoint/models/policy_config.ts rename to x-pack/plugins/security_solution/common/endpoint/models/policy_config.ts diff --git a/x-pack/plugins/siem/common/endpoint/schema/policy.ts b/x-pack/plugins/security_solution/common/endpoint/schema/policy.ts similarity index 100% rename from x-pack/plugins/siem/common/endpoint/schema/policy.ts rename to x-pack/plugins/security_solution/common/endpoint/schema/policy.ts diff --git a/x-pack/plugins/siem/common/endpoint/schema/resolver.ts b/x-pack/plugins/security_solution/common/endpoint/schema/resolver.ts similarity index 100% rename from x-pack/plugins/siem/common/endpoint/schema/resolver.ts rename to x-pack/plugins/security_solution/common/endpoint/schema/resolver.ts diff --git a/x-pack/plugins/siem/common/endpoint/types.ts b/x-pack/plugins/security_solution/common/endpoint/types.ts similarity index 100% rename from x-pack/plugins/siem/common/endpoint/types.ts rename to x-pack/plugins/security_solution/common/endpoint/types.ts diff --git a/x-pack/plugins/siem/common/endpoint_alerts/alert_constants.ts b/x-pack/plugins/security_solution/common/endpoint_alerts/alert_constants.ts similarity index 100% rename from x-pack/plugins/siem/common/endpoint_alerts/alert_constants.ts rename to x-pack/plugins/security_solution/common/endpoint_alerts/alert_constants.ts diff --git a/x-pack/plugins/siem/common/endpoint_alerts/schema/alert_index.ts b/x-pack/plugins/security_solution/common/endpoint_alerts/schema/alert_index.ts similarity index 84% rename from x-pack/plugins/siem/common/endpoint_alerts/schema/alert_index.ts rename to x-pack/plugins/security_solution/common/endpoint_alerts/schema/alert_index.ts index 6794eea20066b..bf57a366f341d 100644 --- a/x-pack/plugins/siem/common/endpoint_alerts/schema/alert_index.ts +++ b/x-pack/plugins/security_solution/common/endpoint_alerts/schema/alert_index.ts @@ -47,7 +47,7 @@ export const alertingIndexGetQuerySchema = schema.object( try { decode(value); } catch (err) { - return i18n.translate('xpack.siem.endpoint.alerts.errors.bad_rison', { + return i18n.translate('xpack.securitySolution.endpoint.alerts.errors.bad_rison', { defaultMessage: 'must be a valid rison-encoded string', }); } @@ -62,7 +62,7 @@ export const alertingIndexGetQuerySchema = schema.object( try { decode(value); } catch (err) { - return i18n.translate('xpack.siem.endpoint.alerts.errors.bad_rison', { + return i18n.translate('xpack.securitySolution.endpoint.alerts.errors.bad_rison', { defaultMessage: 'must be a valid rison-encoded string', }); } @@ -77,7 +77,7 @@ export const alertingIndexGetQuerySchema = schema.object( try { decode(value); } catch (err) { - return i18n.translate('xpack.siem.endpoint.alerts.errors.bad_rison', { + return i18n.translate('xpack.securitySolution.endpoint.alerts.errors.bad_rison', { defaultMessage: 'must be a valid rison-encoded string', }); } @@ -89,7 +89,7 @@ export const alertingIndexGetQuerySchema = schema.object( validate(value) { if (value.after !== undefined && value.page_index !== undefined) { return i18n.translate( - 'xpack.siem.endpoint.alerts.errors.page_index_cannot_be_used_with_after', + 'xpack.securitySolution.endpoint.alerts.errors.page_index_cannot_be_used_with_after', { defaultMessage: '[page_index] cannot be used with [after]', } @@ -97,7 +97,7 @@ export const alertingIndexGetQuerySchema = schema.object( } if (value.before !== undefined && value.page_index !== undefined) { return i18n.translate( - 'xpack.siem.endpoint.alerts.errors.page_index_cannot_be_used_with_before', + 'xpack.securitySolution.endpoint.alerts.errors.page_index_cannot_be_used_with_before', { defaultMessage: '[page_index] cannot be used with [before]', } @@ -105,7 +105,7 @@ export const alertingIndexGetQuerySchema = schema.object( } if (value.before !== undefined && value.after !== undefined) { return i18n.translate( - 'xpack.siem.endpoint.alerts.errors.before_cannot_be_used_with_after', + 'xpack.securitySolution.endpoint.alerts.errors.before_cannot_be_used_with_after', { defaultMessage: '[before] cannot be used with [after]', } diff --git a/x-pack/plugins/siem/common/endpoint_alerts/schema/index_pattern.ts b/x-pack/plugins/security_solution/common/endpoint_alerts/schema/index_pattern.ts similarity index 100% rename from x-pack/plugins/siem/common/endpoint_alerts/schema/index_pattern.ts rename to x-pack/plugins/security_solution/common/endpoint_alerts/schema/index_pattern.ts diff --git a/x-pack/plugins/siem/common/endpoint_alerts/types.ts b/x-pack/plugins/security_solution/common/endpoint_alerts/types.ts similarity index 100% rename from x-pack/plugins/siem/common/endpoint_alerts/types.ts rename to x-pack/plugins/security_solution/common/endpoint_alerts/types.ts diff --git a/x-pack/plugins/siem/common/exact_check.test.ts b/x-pack/plugins/security_solution/common/exact_check.test.ts similarity index 100% rename from x-pack/plugins/siem/common/exact_check.test.ts rename to x-pack/plugins/security_solution/common/exact_check.test.ts diff --git a/x-pack/plugins/siem/common/exact_check.ts b/x-pack/plugins/security_solution/common/exact_check.ts similarity index 100% rename from x-pack/plugins/siem/common/exact_check.ts rename to x-pack/plugins/security_solution/common/exact_check.ts diff --git a/x-pack/plugins/siem/common/format_errors.test.ts b/x-pack/plugins/security_solution/common/format_errors.test.ts similarity index 100% rename from x-pack/plugins/siem/common/format_errors.test.ts rename to x-pack/plugins/security_solution/common/format_errors.test.ts diff --git a/x-pack/plugins/siem/common/format_errors.ts b/x-pack/plugins/security_solution/common/format_errors.ts similarity index 100% rename from x-pack/plugins/siem/common/format_errors.ts rename to x-pack/plugins/security_solution/common/format_errors.ts diff --git a/x-pack/plugins/siem/common/graphql/root/index.ts b/x-pack/plugins/security_solution/common/graphql/root/index.ts similarity index 100% rename from x-pack/plugins/siem/common/graphql/root/index.ts rename to x-pack/plugins/security_solution/common/graphql/root/index.ts diff --git a/x-pack/plugins/siem/common/graphql/root/schema.gql.ts b/x-pack/plugins/security_solution/common/graphql/root/schema.gql.ts similarity index 100% rename from x-pack/plugins/siem/common/graphql/root/schema.gql.ts rename to x-pack/plugins/security_solution/common/graphql/root/schema.gql.ts diff --git a/x-pack/plugins/siem/common/graphql/shared/index.ts b/x-pack/plugins/security_solution/common/graphql/shared/index.ts similarity index 100% rename from x-pack/plugins/siem/common/graphql/shared/index.ts rename to x-pack/plugins/security_solution/common/graphql/shared/index.ts diff --git a/x-pack/plugins/siem/common/graphql/shared/schema.gql.ts b/x-pack/plugins/security_solution/common/graphql/shared/schema.gql.ts similarity index 100% rename from x-pack/plugins/siem/common/graphql/shared/schema.gql.ts rename to x-pack/plugins/security_solution/common/graphql/shared/schema.gql.ts diff --git a/x-pack/plugins/siem/common/machine_learning/empty_ml_capabilities.ts b/x-pack/plugins/security_solution/common/machine_learning/empty_ml_capabilities.ts similarity index 100% rename from x-pack/plugins/siem/common/machine_learning/empty_ml_capabilities.ts rename to x-pack/plugins/security_solution/common/machine_learning/empty_ml_capabilities.ts diff --git a/x-pack/plugins/siem/common/machine_learning/has_ml_admin_permissions.test.ts b/x-pack/plugins/security_solution/common/machine_learning/has_ml_admin_permissions.test.ts similarity index 100% rename from x-pack/plugins/siem/common/machine_learning/has_ml_admin_permissions.test.ts rename to x-pack/plugins/security_solution/common/machine_learning/has_ml_admin_permissions.test.ts diff --git a/x-pack/plugins/siem/common/machine_learning/has_ml_admin_permissions.ts b/x-pack/plugins/security_solution/common/machine_learning/has_ml_admin_permissions.ts similarity index 100% rename from x-pack/plugins/siem/common/machine_learning/has_ml_admin_permissions.ts rename to x-pack/plugins/security_solution/common/machine_learning/has_ml_admin_permissions.ts diff --git a/x-pack/plugins/siem/common/machine_learning/has_ml_user_permissions.test.ts b/x-pack/plugins/security_solution/common/machine_learning/has_ml_user_permissions.test.ts similarity index 100% rename from x-pack/plugins/siem/common/machine_learning/has_ml_user_permissions.test.ts rename to x-pack/plugins/security_solution/common/machine_learning/has_ml_user_permissions.test.ts diff --git a/x-pack/plugins/siem/common/machine_learning/has_ml_user_permissions.ts b/x-pack/plugins/security_solution/common/machine_learning/has_ml_user_permissions.ts similarity index 100% rename from x-pack/plugins/siem/common/machine_learning/has_ml_user_permissions.ts rename to x-pack/plugins/security_solution/common/machine_learning/has_ml_user_permissions.ts diff --git a/x-pack/plugins/siem/common/machine_learning/helpers.test.ts b/x-pack/plugins/security_solution/common/machine_learning/helpers.test.ts similarity index 100% rename from x-pack/plugins/siem/common/machine_learning/helpers.test.ts rename to x-pack/plugins/security_solution/common/machine_learning/helpers.test.ts diff --git a/x-pack/plugins/siem/common/machine_learning/helpers.ts b/x-pack/plugins/security_solution/common/machine_learning/helpers.ts similarity index 100% rename from x-pack/plugins/siem/common/machine_learning/helpers.ts rename to x-pack/plugins/security_solution/common/machine_learning/helpers.ts diff --git a/x-pack/plugins/siem/common/test_utils.ts b/x-pack/plugins/security_solution/common/test_utils.ts similarity index 100% rename from x-pack/plugins/siem/common/test_utils.ts rename to x-pack/plugins/security_solution/common/test_utils.ts diff --git a/x-pack/plugins/siem/common/typed_json.ts b/x-pack/plugins/security_solution/common/typed_json.ts similarity index 98% rename from x-pack/plugins/siem/common/typed_json.ts rename to x-pack/plugins/security_solution/common/typed_json.ts index 62e7319e091cb..61c1093002192 100644 --- a/x-pack/plugins/siem/common/typed_json.ts +++ b/x-pack/plugins/security_solution/common/typed_json.ts @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -import { JsonObject } from '../../../../src/plugins/kibana_utils/public'; +import { JsonObject } from '../../../../src/plugins/kibana_utils/common'; export type ESQuery = ESRangeQuery | ESQueryStringQuery | ESMatchQuery | ESTermQuery | JsonObject; diff --git a/x-pack/plugins/siem/common/types/timeline/index.ts b/x-pack/plugins/security_solution/common/types/timeline/index.ts similarity index 100% rename from x-pack/plugins/siem/common/types/timeline/index.ts rename to x-pack/plugins/security_solution/common/types/timeline/index.ts diff --git a/x-pack/plugins/siem/common/types/timeline/note/index.ts b/x-pack/plugins/security_solution/common/types/timeline/note/index.ts similarity index 100% rename from x-pack/plugins/siem/common/types/timeline/note/index.ts rename to x-pack/plugins/security_solution/common/types/timeline/note/index.ts diff --git a/x-pack/plugins/siem/common/types/timeline/pinned_event/index.ts b/x-pack/plugins/security_solution/common/types/timeline/pinned_event/index.ts similarity index 100% rename from x-pack/plugins/siem/common/types/timeline/pinned_event/index.ts rename to x-pack/plugins/security_solution/common/types/timeline/pinned_event/index.ts diff --git a/x-pack/plugins/siem/common/utility_types.ts b/x-pack/plugins/security_solution/common/utility_types.ts similarity index 100% rename from x-pack/plugins/siem/common/utility_types.ts rename to x-pack/plugins/security_solution/common/utility_types.ts diff --git a/x-pack/plugins/siem/cypress/.eslintrc.json b/x-pack/plugins/security_solution/cypress/.eslintrc.json similarity index 100% rename from x-pack/plugins/siem/cypress/.eslintrc.json rename to x-pack/plugins/security_solution/cypress/.eslintrc.json diff --git a/x-pack/plugins/siem/cypress/.gitignore b/x-pack/plugins/security_solution/cypress/.gitignore similarity index 100% rename from x-pack/plugins/siem/cypress/.gitignore rename to x-pack/plugins/security_solution/cypress/.gitignore diff --git a/x-pack/plugins/siem/cypress/README.md b/x-pack/plugins/security_solution/cypress/README.md similarity index 87% rename from x-pack/plugins/siem/cypress/README.md rename to x-pack/plugins/security_solution/cypress/README.md index b50924532726c..ad3af2aaa4e8a 100644 --- a/x-pack/plugins/siem/cypress/README.md +++ b/x-pack/plugins/security_solution/cypress/README.md @@ -1,6 +1,6 @@ # Cypress Tests -The `siem/cypress` directory contains end to end tests, (plus a few tests +The `security_solution/cypress` directory contains end to end tests, (plus a few tests that rely on mocked API calls), that execute via [Cypress](https://www.cypress.io/). Cypress tests may be run against: @@ -20,7 +20,7 @@ automatically when you submit a PR. ## Smoke Tests -Smoke Tests are located in `siem/cypress/integration/smoke_tests` +Smoke Tests are located in `security_solution/cypress/integration/smoke_tests` ## Structure @@ -53,7 +53,7 @@ it's necessary because a test must assert that a specific value is rendered, and it's not possible to derive that value based on the data in the environment where tests are running. -Mocked responses API from the server are located in `siem/cypress/fixtures`. +Mocked responses API from the server are located in `security_solution/cypress/fixtures`. ## Speeding up test execution time @@ -124,20 +124,20 @@ yarn kbn bootstrap 2. Launch Cypress command line test runner: ```sh -cd x-pack/plugins/siem +cd x-pack/plugins/security_solution yarn cypress:run-as-ci ``` Note that with this type of execution you don't need to have running a kibana and elasticsearch instance. This is because the command, as it would happen in the CI, will launch the instances. The elasticsearch instance will be fed data - found in: `x-pack/test/siem_cypress/es_archives` + found in: `x-pack/test/security_solution_cypress/es_archives` As in this case we want to mimic a CI execution we want to execute the tests with the same set of data, this is why in this case does not make sense to override Cypress environment variables. ### Test data -As mentioned above, when running the tests as Jenkins the tests are populated with data ("archives") found in: `x-pack/test/siem_cypress/es_archives`. +As mentioned above, when running the tests as Jenkins the tests are populated with data ("archives") found in: `x-pack/test/security_solution_cypress/es_archives`. By default, each test is populated with some base data: an empty kibana index and a set of auditbeat data (the `empty_kibana` and `auditbeat` archives, respectively). This is usually enough to cover most of the scenarios that we are testing. @@ -168,7 +168,7 @@ Note that loading and unloading data take a significant amount of time, so try t ### Current archives -The current archives can be found in `x-pack/test/siem_cypress/es_archives/`. +The current archives can be found in `x-pack/test/security_solution_cypress/es_archives/`. - auditbeat - Auditbeat data generated in Sep, 2019 with the following hosts present: @@ -193,15 +193,15 @@ We are using es_archiver in order to manage the data that our Cypress tests need 1. Setup if possible a clean instance of kibana and elasticsearch (if not, possible please try to clean the data that you are going to generate). 2. With the kibana and elasticsearch instance up and running, create the data that you need for your test. -3. When you are sure that you have all the data you need run the following command from: `x-pack/plugins/siem` +3. When you are sure that you have all the data you need run the following command from: `x-pack/plugins/security_solution` ```sh -node ../../../scripts/es_archiver save --dir ../../test/siem_cypress/es_archives --config ../../../test/functional/config.js --es-url http://:@: +node ../../../scripts/es_archiver save --dir ../../test/security_solution_cypress/es_archives --config ../../../test/functional/config.js --es-url http://:@: ``` Example: ```sh -node ../../../scripts/es_archiver save custom_rules ".kibana",".siem-signal*" --dir ../../test/siem_cypress/es_archives --config ../../../test/functional/config.js --es-url http://elastic:changeme@localhost:9220 +node ../../../scripts/es_archiver save custom_rules ".kibana",".siem-signal*" --dir ../../test/security_solution_cypress/es_archives --config ../../../test/functional/config.js --es-url http://elastic:changeme@localhost:9220 ``` Note that the command is going to create the folder if does not exist in the directory with the imported data. @@ -233,10 +233,10 @@ yarn start --no-base-path 4. Launch the Cypress interactive test runner via one of the following options: - To run tests interactively against the default (local) host specified by -`baseUrl`, as configured in `plugins/siem/cypress.json`: +`baseUrl`, as configured in `plugins/security_solution/cypress.json`: ```sh -cd x-pack/plugins/siem +cd x-pack/plugins/security_solution yarn cypress:open ``` @@ -245,7 +245,7 @@ yarn cypress:open test runner, as shown in the following example: ```sh -cd x-pack/plugins/siem +cd x-pack/plugins/security_solution CYPRESS_baseUrl=http://localhost:5601 yarn cypress:open ``` @@ -253,7 +253,7 @@ CYPRESS_baseUrl=http://localhost:5601 yarn cypress:open running tests interactively: ```sh -cd x-pack/plugins/siem +cd x-pack/plugins/security_solution CYPRESS_baseUrl=http://localhost:5601 CYPRESS_ELASTICSEARCH_USERNAME=elastic CYPRESS_ELASTICSEARCH_PASSWORD= yarn cypress:open ``` @@ -282,10 +282,10 @@ yarn start --no-base-path 4. Launch the Cypress command line test runner via one of the following options: - To run tests on the command line against the default (local) host specified by -`baseUrl`, as configured in `plugins/siem/cypress.json`: +`baseUrl`, as configured in `plugins/security_solution/cypress.json`: ```sh -cd x-pack/plugins/siem +cd x-pack/plugins/security_solution yarn cypress:run ``` @@ -294,7 +294,7 @@ yarn cypress:run the following example: ```sh -cd x-pack/plugins/siem +cd x-pack/plugins/security_solution CYPRESS_baseUrl=http://localhost:5601 yarn cypress:run ``` @@ -302,7 +302,7 @@ CYPRESS_baseUrl=http://localhost:5601 yarn cypress:run running via the command line: ```sh -cd x-pack/plugins/siem +cd x-pack/plugins/security_solution CYPRESS_baseUrl=http://localhost:5601 CYPRESS_ELASTICSEARCH_USERNAME=elastic CYPRESS_ELASTICSEARCH_PASSWORD= yarn cypress:run ``` @@ -317,7 +317,7 @@ of the Kibana, as detailed for each artifact type in the sections below. An HTML report (e.g. for email notifications) is output to: ``` -target/kibana-siem/cypress/results/output.html +target/kibana-security-solution/cypress/results/output.html ``` ### Screenshots @@ -325,14 +325,14 @@ target/kibana-siem/cypress/results/output.html Screenshots of failed tests are output to: ``` -target/kibana-siem/cypress/screenshots +target/kibana-security-solution/cypress/screenshots ``` ### `junit` Reports The Kibana CI process reports `junit` test results from the `target/junit` directory. -Cypress `junit` reports are generated in `target/kibana-siem/cypress/results` +Cypress `junit` reports are generated in `target/kibana-security-solution/cypress/results` and copied to the `target/junit` directory. ### Videos (optional) @@ -347,7 +347,7 @@ CYPRESS_video=true yarn cypress:run Videos are (optionally) output to: ``` -target/kibana-siem/cypress/videos +target/kibana-security-solution/cypress/videos ``` ## Linting diff --git a/x-pack/plugins/security_solution/cypress/cypress.json b/x-pack/plugins/security_solution/cypress/cypress.json new file mode 100644 index 0000000000000..b097b0432e75d --- /dev/null +++ b/x-pack/plugins/security_solution/cypress/cypress.json @@ -0,0 +1,8 @@ +{ + "baseUrl": "http://localhost:5601", + "defaultCommandTimeout": 120000, + "screenshotsFolder": "../../../target/kibana-security-solution/cypress/screenshots", + "trashAssetsBeforeRuns": false, + "video": false, + "videosFolder": "../../../target/kibana-security-solution/cypress/videos" +} diff --git a/x-pack/plugins/siem/cypress/fixtures/overview.json b/x-pack/plugins/security_solution/cypress/fixtures/overview.json similarity index 100% rename from x-pack/plugins/siem/cypress/fixtures/overview.json rename to x-pack/plugins/security_solution/cypress/fixtures/overview.json diff --git a/x-pack/plugins/siem/cypress/integration/cases.spec.ts b/x-pack/plugins/security_solution/cypress/integration/cases.spec.ts similarity index 100% rename from x-pack/plugins/siem/cypress/integration/cases.spec.ts rename to x-pack/plugins/security_solution/cypress/integration/cases.spec.ts diff --git a/x-pack/plugins/siem/cypress/integration/cases_connectors.spec.ts b/x-pack/plugins/security_solution/cypress/integration/cases_connectors.spec.ts similarity index 100% rename from x-pack/plugins/siem/cypress/integration/cases_connectors.spec.ts rename to x-pack/plugins/security_solution/cypress/integration/cases_connectors.spec.ts diff --git a/x-pack/plugins/siem/cypress/integration/detections.spec.ts b/x-pack/plugins/security_solution/cypress/integration/detections.spec.ts similarity index 100% rename from x-pack/plugins/siem/cypress/integration/detections.spec.ts rename to x-pack/plugins/security_solution/cypress/integration/detections.spec.ts diff --git a/x-pack/plugins/siem/cypress/integration/detections_timeline.spec.ts b/x-pack/plugins/security_solution/cypress/integration/detections_timeline.spec.ts similarity index 100% rename from x-pack/plugins/siem/cypress/integration/detections_timeline.spec.ts rename to x-pack/plugins/security_solution/cypress/integration/detections_timeline.spec.ts diff --git a/x-pack/plugins/siem/cypress/integration/events_viewer.spec.ts b/x-pack/plugins/security_solution/cypress/integration/events_viewer.spec.ts similarity index 100% rename from x-pack/plugins/siem/cypress/integration/events_viewer.spec.ts rename to x-pack/plugins/security_solution/cypress/integration/events_viewer.spec.ts diff --git a/x-pack/plugins/siem/cypress/integration/fields_browser.spec.ts b/x-pack/plugins/security_solution/cypress/integration/fields_browser.spec.ts similarity index 100% rename from x-pack/plugins/siem/cypress/integration/fields_browser.spec.ts rename to x-pack/plugins/security_solution/cypress/integration/fields_browser.spec.ts diff --git a/x-pack/plugins/siem/cypress/integration/inspect.spec.ts b/x-pack/plugins/security_solution/cypress/integration/inspect.spec.ts similarity index 100% rename from x-pack/plugins/siem/cypress/integration/inspect.spec.ts rename to x-pack/plugins/security_solution/cypress/integration/inspect.spec.ts diff --git a/x-pack/plugins/siem/cypress/integration/ml_conditional_links.spec.ts b/x-pack/plugins/security_solution/cypress/integration/ml_conditional_links.spec.ts similarity index 59% rename from x-pack/plugins/siem/cypress/integration/ml_conditional_links.spec.ts rename to x-pack/plugins/security_solution/cypress/integration/ml_conditional_links.spec.ts index 328ff7582efd6..e96c1fe691966 100644 --- a/x-pack/plugins/siem/cypress/integration/ml_conditional_links.spec.ts +++ b/x-pack/plugins/security_solution/cypress/integration/ml_conditional_links.spec.ts @@ -101,7 +101,7 @@ describe('ml conditional links', () => { loginAndWaitForPageWithoutDateRange(mlNetworkSingleIpNullKqlQuery); cy.url().should( 'include', - '/app/siem#/network/ip/127.0.0.1/source?timerange=(global:(linkTo:!(timeline),timerange:(from:1566990000000,kind:absolute,to:1567000799999)),timeline:(linkTo:!(global),timerange:(from:1566990000000,kind:absolute,to:1567000799999)))' + '/app/security#/network/ip/127.0.0.1/source?timerange=(global:(linkTo:!(timeline),timerange:(from:1566990000000,kind:absolute,to:1567000799999)),timeline:(linkTo:!(global),timerange:(from:1566990000000,kind:absolute,to:1567000799999)))' ); }); @@ -109,7 +109,7 @@ describe('ml conditional links', () => { loginAndWaitForPageWithoutDateRange(mlNetworkSingleIpKqlQuery); cy.url().should( 'include', - "/app/siem#/network/ip/127.0.0.1/source?query=(language:kuery,query:'(process.name:%20%22conhost.exe%22%20or%20process.name:%20%22sc.exe%22)')&timerange=(global:(linkTo:!(timeline),timerange:(from:1566990000000,kind:absolute,to:1567000799999)),timeline:(linkTo:!(global),timerange:(from:1566990000000,kind:absolute,to:1567000799999)))" + "/app/security#/network/ip/127.0.0.1/source?query=(language:kuery,query:'(process.name:%20%22conhost.exe%22%20or%20process.name:%20%22sc.exe%22)')&timerange=(global:(linkTo:!(timeline),timerange:(from:1566990000000,kind:absolute,to:1567000799999)),timeline:(linkTo:!(global),timerange:(from:1566990000000,kind:absolute,to:1567000799999)))" ); }); @@ -117,7 +117,7 @@ describe('ml conditional links', () => { loginAndWaitForPageWithoutDateRange(mlNetworkMultipleIpNullKqlQuery); cy.url().should( 'include', - "app/siem#/network/flows?query=(language:kuery,query:'((source.ip:%20%22127.0.0.1%22%20or%20destination.ip:%20%22127.0.0.1%22)%20or%20(source.ip:%20%22127.0.0.2%22%20or%20destination.ip:%20%22127.0.0.2%22))')&timerange=(global:(linkTo:!(timeline),timerange:(from:1566990000000,kind:absolute,to:1567000799999)),timeline:(linkTo:!(global),timerange:(from:1566990000000,kind:absolute,to:1567000799999))" + "app/security#/network/flows?query=(language:kuery,query:'((source.ip:%20%22127.0.0.1%22%20or%20destination.ip:%20%22127.0.0.1%22)%20or%20(source.ip:%20%22127.0.0.2%22%20or%20destination.ip:%20%22127.0.0.2%22))')&timerange=(global:(linkTo:!(timeline),timerange:(from:1566990000000,kind:absolute,to:1567000799999)),timeline:(linkTo:!(global),timerange:(from:1566990000000,kind:absolute,to:1567000799999))" ); }); @@ -125,7 +125,7 @@ describe('ml conditional links', () => { loginAndWaitForPageWithoutDateRange(mlNetworkMultipleIpKqlQuery); cy.url().should( 'include', - "/app/siem#/network/flows?query=(language:kuery,query:'((source.ip:%20%22127.0.0.1%22%20or%20destination.ip:%20%22127.0.0.1%22)%20or%20(source.ip:%20%22127.0.0.2%22%20or%20destination.ip:%20%22127.0.0.2%22))%20and%20((process.name:%20%22conhost.exe%22%20or%20process.name:%20%22sc.exe%22))')&timerange=(global:(linkTo:!(timeline),timerange:(from:1566990000000,kind:absolute,to:1567000799999)),timeline:(linkTo:!(global),timerange:(from:1566990000000,kind:absolute,to:1567000799999)))" + "/app/security#/network/flows?query=(language:kuery,query:'((source.ip:%20%22127.0.0.1%22%20or%20destination.ip:%20%22127.0.0.1%22)%20or%20(source.ip:%20%22127.0.0.2%22%20or%20destination.ip:%20%22127.0.0.2%22))%20and%20((process.name:%20%22conhost.exe%22%20or%20process.name:%20%22sc.exe%22))')&timerange=(global:(linkTo:!(timeline),timerange:(from:1566990000000,kind:absolute,to:1567000799999)),timeline:(linkTo:!(global),timerange:(from:1566990000000,kind:absolute,to:1567000799999)))" ); }); @@ -133,7 +133,7 @@ describe('ml conditional links', () => { loginAndWaitForPageWithoutDateRange(mlNetworkNullKqlQuery); cy.url().should( 'include', - '/app/siem#/network/flows?timerange=(global:(linkTo:!(timeline),timerange:(from:1566990000000,kind:absolute,to:1567000799999)),timeline:(linkTo:!(global),timerange:(from:1566990000000,kind:absolute,to:1567000799999)))' + '/app/security#/network/flows?timerange=(global:(linkTo:!(timeline),timerange:(from:1566990000000,kind:absolute,to:1567000799999)),timeline:(linkTo:!(global),timerange:(from:1566990000000,kind:absolute,to:1567000799999)))' ); }); @@ -141,7 +141,7 @@ describe('ml conditional links', () => { loginAndWaitForPageWithoutDateRange(mlNetworkKqlQuery); cy.url().should( 'include', - "/app/siem#/network/flows?query=(language:kuery,query:'(process.name:%20%22conhost.exe%22%20or%20process.name:%20%22sc.exe%22)')&timerange=(global:(linkTo:!(timeline),timerange:(from:1566990000000,kind:absolute,to:1567000799999)),timeline:(linkTo:!(global),timerange:(from:1566990000000,kind:absolute,to:1567000799999)))" + "/app/security#/network/flows?query=(language:kuery,query:'(process.name:%20%22conhost.exe%22%20or%20process.name:%20%22sc.exe%22)')&timerange=(global:(linkTo:!(timeline),timerange:(from:1566990000000,kind:absolute,to:1567000799999)),timeline:(linkTo:!(global),timerange:(from:1566990000000,kind:absolute,to:1567000799999)))" ); }); @@ -149,7 +149,7 @@ describe('ml conditional links', () => { loginAndWaitForPageWithoutDateRange(mlHostSingleHostNullKqlQuery); cy.url().should( 'include', - '/app/siem#/hosts/siem-windows/anomalies?timerange=(global:(linkTo:!(timeline),timerange:(from:1559800800000,kind:absolute,to:1559887199999)),timeline:(linkTo:!(global),timerange:(from:1559800800000,kind:absolute,to:1559887199999)))' + '/app/security#/hosts/siem-windows/anomalies?timerange=(global:(linkTo:!(timeline),timerange:(from:1559800800000,kind:absolute,to:1559887199999)),timeline:(linkTo:!(global),timerange:(from:1559800800000,kind:absolute,to:1559887199999)))' ); }); @@ -157,7 +157,7 @@ describe('ml conditional links', () => { loginAndWaitForPageWithoutDateRange(mlHostSingleHostKqlQueryVariable); cy.url().should( 'include', - '/app/siem#/hosts/siem-windows/anomalies?timerange=(global:(linkTo:!(timeline),timerange:(from:1559800800000,kind:absolute,to:1559887199999)),timeline:(linkTo:!(global),timerange:(from:1559800800000,kind:absolute,to:1559887199999)))' + '/app/security#/hosts/siem-windows/anomalies?timerange=(global:(linkTo:!(timeline),timerange:(from:1559800800000,kind:absolute,to:1559887199999)),timeline:(linkTo:!(global),timerange:(from:1559800800000,kind:absolute,to:1559887199999)))' ); }); @@ -165,7 +165,7 @@ describe('ml conditional links', () => { loginAndWaitForPageWithoutDateRange(mlHostSingleHostKqlQuery); cy.url().should( 'include', - "/app/siem#/hosts/siem-windows/anomalies?query=(language:kuery,query:'(process.name:%20%22conhost.exe%22%20or%20process.name:%20%22sc.exe%22)')&timerange=(global:(linkTo:!(timeline),timerange:(from:1559800800000,kind:absolute,to:1559887199999)),timeline:(linkTo:!(global),timerange:(from:1559800800000,kind:absolute,to:1559887199999)))" + "/app/security#/hosts/siem-windows/anomalies?query=(language:kuery,query:'(process.name:%20%22conhost.exe%22%20or%20process.name:%20%22sc.exe%22)')&timerange=(global:(linkTo:!(timeline),timerange:(from:1559800800000,kind:absolute,to:1559887199999)),timeline:(linkTo:!(global),timerange:(from:1559800800000,kind:absolute,to:1559887199999)))" ); }); @@ -173,7 +173,7 @@ describe('ml conditional links', () => { loginAndWaitForPageWithoutDateRange(mlHostMultiHostNullKqlQuery); cy.url().should( 'include', - "/app/siem#/hosts/anomalies?query=(language:kuery,query:'(host.name:%20%22siem-windows%22%20or%20host.name:%20%22siem-suricata%22)')&timerange=(global:(linkTo:!(timeline),timerange:(from:1559800800000,kind:absolute,to:1559887199999)),timeline:(linkTo:!(global),timerange:(from:1559800800000,kind:absolute,to:1559887199999)))" + "/app/security#/hosts/anomalies?query=(language:kuery,query:'(host.name:%20%22siem-windows%22%20or%20host.name:%20%22siem-suricata%22)')&timerange=(global:(linkTo:!(timeline),timerange:(from:1559800800000,kind:absolute,to:1559887199999)),timeline:(linkTo:!(global),timerange:(from:1559800800000,kind:absolute,to:1559887199999)))" ); }); @@ -181,7 +181,7 @@ describe('ml conditional links', () => { loginAndWaitForPageWithoutDateRange(mlHostMultiHostKqlQuery); cy.url().should( 'include', - "/app/siem#/hosts/anomalies?query=(language:kuery,query:'(host.name:%20%22siem-windows%22%20or%20host.name:%20%22siem-suricata%22)%20and%20((process.name:%20%22conhost.exe%22%20or%20process.name:%20%22sc.exe%22))')&timerange=(global:(linkTo:!(timeline),timerange:(from:1559800800000,kind:absolute,to:1559887199999)),timeline:(linkTo:!(global),timerange:(from:1559800800000,kind:absolute,to:1559887199999)))" + "/app/security#/hosts/anomalies?query=(language:kuery,query:'(host.name:%20%22siem-windows%22%20or%20host.name:%20%22siem-suricata%22)%20and%20((process.name:%20%22conhost.exe%22%20or%20process.name:%20%22sc.exe%22))')&timerange=(global:(linkTo:!(timeline),timerange:(from:1559800800000,kind:absolute,to:1559887199999)),timeline:(linkTo:!(global),timerange:(from:1559800800000,kind:absolute,to:1559887199999)))" ); }); @@ -189,7 +189,7 @@ describe('ml conditional links', () => { loginAndWaitForPageWithoutDateRange(mlHostVariableHostNullKqlQuery); cy.url().should( 'include', - '/app/siem#/hosts/anomalies?timerange=(global:(linkTo:!(timeline),timerange:(from:1559800800000,kind:absolute,to:1559887199999)),timeline:(linkTo:!(global),timerange:(from:1559800800000,kind:absolute,to:1559887199999)))' + '/app/security#/hosts/anomalies?timerange=(global:(linkTo:!(timeline),timerange:(from:1559800800000,kind:absolute,to:1559887199999)),timeline:(linkTo:!(global),timerange:(from:1559800800000,kind:absolute,to:1559887199999)))' ); }); @@ -197,7 +197,7 @@ describe('ml conditional links', () => { loginAndWaitForPageWithoutDateRange(mlHostVariableHostKqlQuery); cy.url().should( 'include', - "/app/siem#/hosts/anomalies?query=(language:kuery,query:'(process.name:%20%22conhost.exe%22%20or%20process.name:%20%22sc.exe%22)')&timerange=(global:(linkTo:!(timeline),timerange:(from:1559800800000,kind:absolute,to:1559887199999)),timeline:(linkTo:!(global),timerange:(from:1559800800000,kind:absolute,to:1559887199999)))" + "/app/security#/hosts/anomalies?query=(language:kuery,query:'(process.name:%20%22conhost.exe%22%20or%20process.name:%20%22sc.exe%22)')&timerange=(global:(linkTo:!(timeline),timerange:(from:1559800800000,kind:absolute,to:1559887199999)),timeline:(linkTo:!(global),timerange:(from:1559800800000,kind:absolute,to:1559887199999)))" ); }); }); diff --git a/x-pack/plugins/siem/cypress/integration/navigation.spec.ts b/x-pack/plugins/security_solution/cypress/integration/navigation.spec.ts similarity index 79% rename from x-pack/plugins/siem/cypress/integration/navigation.spec.ts rename to x-pack/plugins/security_solution/cypress/integration/navigation.spec.ts index bebd5f7d679cf..a9e5a848d54a8 100644 --- a/x-pack/plugins/siem/cypress/integration/navigation.spec.ts +++ b/x-pack/plugins/security_solution/cypress/integration/navigation.spec.ts @@ -16,26 +16,26 @@ describe('top-level navigation common to all pages in the SIEM app', () => { }); it('navigates to the Overview page', () => { navigateFromHeaderTo(OVERVIEW); - cy.url().should('include', '/siem#/overview'); + cy.url().should('include', '/security#/overview'); }); it('navigates to the Hosts page', () => { navigateFromHeaderTo(HOSTS); - cy.url().should('include', '/siem#/hosts'); + cy.url().should('include', '/security#/hosts'); }); it('navigates to the Network page', () => { navigateFromHeaderTo(NETWORK); - cy.url().should('include', '/siem#/network'); + cy.url().should('include', '/security#/network'); }); it('navigates to the Detections page', () => { navigateFromHeaderTo(DETECTIONS); - cy.url().should('include', '/siem#/detections'); + cy.url().should('include', '/security#/detections'); }); it('navigates to the Timelines page', () => { navigateFromHeaderTo(TIMELINES); - cy.url().should('include', '/siem#/timelines'); + cy.url().should('include', '/security#/timelines'); }); }); diff --git a/x-pack/plugins/siem/cypress/integration/overview.spec.ts b/x-pack/plugins/security_solution/cypress/integration/overview.spec.ts similarity index 100% rename from x-pack/plugins/siem/cypress/integration/overview.spec.ts rename to x-pack/plugins/security_solution/cypress/integration/overview.spec.ts diff --git a/x-pack/plugins/siem/cypress/integration/pagination.spec.ts b/x-pack/plugins/security_solution/cypress/integration/pagination.spec.ts similarity index 100% rename from x-pack/plugins/siem/cypress/integration/pagination.spec.ts rename to x-pack/plugins/security_solution/cypress/integration/pagination.spec.ts diff --git a/x-pack/plugins/siem/cypress/integration/signal_detection_rules.spec.ts b/x-pack/plugins/security_solution/cypress/integration/signal_detection_rules.spec.ts similarity index 100% rename from x-pack/plugins/siem/cypress/integration/signal_detection_rules.spec.ts rename to x-pack/plugins/security_solution/cypress/integration/signal_detection_rules.spec.ts diff --git a/x-pack/plugins/siem/cypress/integration/signal_detection_rules_custom.spec.ts b/x-pack/plugins/security_solution/cypress/integration/signal_detection_rules_custom.spec.ts similarity index 100% rename from x-pack/plugins/siem/cypress/integration/signal_detection_rules_custom.spec.ts rename to x-pack/plugins/security_solution/cypress/integration/signal_detection_rules_custom.spec.ts diff --git a/x-pack/plugins/siem/cypress/integration/signal_detection_rules_export.spec.ts b/x-pack/plugins/security_solution/cypress/integration/signal_detection_rules_export.spec.ts similarity index 100% rename from x-pack/plugins/siem/cypress/integration/signal_detection_rules_export.spec.ts rename to x-pack/plugins/security_solution/cypress/integration/signal_detection_rules_export.spec.ts diff --git a/x-pack/plugins/siem/cypress/integration/signal_detection_rules_ml.spec.ts b/x-pack/plugins/security_solution/cypress/integration/signal_detection_rules_ml.spec.ts similarity index 100% rename from x-pack/plugins/siem/cypress/integration/signal_detection_rules_ml.spec.ts rename to x-pack/plugins/security_solution/cypress/integration/signal_detection_rules_ml.spec.ts diff --git a/x-pack/plugins/siem/cypress/integration/signal_detection_rules_prebuilt.spec.ts b/x-pack/plugins/security_solution/cypress/integration/signal_detection_rules_prebuilt.spec.ts similarity index 100% rename from x-pack/plugins/siem/cypress/integration/signal_detection_rules_prebuilt.spec.ts rename to x-pack/plugins/security_solution/cypress/integration/signal_detection_rules_prebuilt.spec.ts diff --git a/x-pack/plugins/siem/cypress/integration/timeline_data_providers.spec.ts b/x-pack/plugins/security_solution/cypress/integration/timeline_data_providers.spec.ts similarity index 100% rename from x-pack/plugins/siem/cypress/integration/timeline_data_providers.spec.ts rename to x-pack/plugins/security_solution/cypress/integration/timeline_data_providers.spec.ts diff --git a/x-pack/plugins/siem/cypress/integration/timeline_flyout_button.spec.ts b/x-pack/plugins/security_solution/cypress/integration/timeline_flyout_button.spec.ts similarity index 100% rename from x-pack/plugins/siem/cypress/integration/timeline_flyout_button.spec.ts rename to x-pack/plugins/security_solution/cypress/integration/timeline_flyout_button.spec.ts diff --git a/x-pack/plugins/siem/cypress/integration/timeline_search_or_filter.spec.ts b/x-pack/plugins/security_solution/cypress/integration/timeline_search_or_filter.spec.ts similarity index 100% rename from x-pack/plugins/siem/cypress/integration/timeline_search_or_filter.spec.ts rename to x-pack/plugins/security_solution/cypress/integration/timeline_search_or_filter.spec.ts diff --git a/x-pack/plugins/siem/cypress/integration/timeline_toggle_column.spec.ts b/x-pack/plugins/security_solution/cypress/integration/timeline_toggle_column.spec.ts similarity index 100% rename from x-pack/plugins/siem/cypress/integration/timeline_toggle_column.spec.ts rename to x-pack/plugins/security_solution/cypress/integration/timeline_toggle_column.spec.ts diff --git a/x-pack/plugins/siem/cypress/integration/url_state.spec.ts b/x-pack/plugins/security_solution/cypress/integration/url_state.spec.ts similarity index 98% rename from x-pack/plugins/siem/cypress/integration/url_state.spec.ts rename to x-pack/plugins/security_solution/cypress/integration/url_state.spec.ts index 5625e1812f696..cf69a83dbf951 100644 --- a/x-pack/plugins/siem/cypress/integration/url_state.spec.ts +++ b/x-pack/plugins/security_solution/cypress/integration/url_state.spec.ts @@ -255,8 +255,8 @@ describe('url state', () => { expect(matched).to.have.lengthOf(1); closeTimeline(); cy.visit('/app/kibana'); - cy.visit(`/app/siem#/overview?timeline\=(id:'${newTimelineId}',isOpen:!t)`); - cy.contains('a', 'SIEM'); + cy.visit(`/app/security#/overview?timeline\=(id:'${newTimelineId}',isOpen:!t)`); + cy.contains('a', 'Security'); cy.get(DATE_PICKER_APPLY_BUTTON_TIMELINE).invoke('text').should('not.equal', 'Updating'); cy.get(TIMELINE_TITLE).should('have.attr', 'value', timelineName); }); diff --git a/x-pack/plugins/siem/cypress/objects/case.ts b/x-pack/plugins/security_solution/cypress/objects/case.ts similarity index 100% rename from x-pack/plugins/siem/cypress/objects/case.ts rename to x-pack/plugins/security_solution/cypress/objects/case.ts diff --git a/x-pack/plugins/siem/cypress/objects/rule.ts b/x-pack/plugins/security_solution/cypress/objects/rule.ts similarity index 100% rename from x-pack/plugins/siem/cypress/objects/rule.ts rename to x-pack/plugins/security_solution/cypress/objects/rule.ts diff --git a/x-pack/plugins/siem/cypress/objects/timeline.ts b/x-pack/plugins/security_solution/cypress/objects/timeline.ts similarity index 100% rename from x-pack/plugins/siem/cypress/objects/timeline.ts rename to x-pack/plugins/security_solution/cypress/objects/timeline.ts diff --git a/x-pack/plugins/siem/cypress/plugins/index.js b/x-pack/plugins/security_solution/cypress/plugins/index.js similarity index 100% rename from x-pack/plugins/siem/cypress/plugins/index.js rename to x-pack/plugins/security_solution/cypress/plugins/index.js diff --git a/x-pack/plugins/security_solution/cypress/reporter_config.json b/x-pack/plugins/security_solution/cypress/reporter_config.json new file mode 100644 index 0000000000000..b72a5cf077c6a --- /dev/null +++ b/x-pack/plugins/security_solution/cypress/reporter_config.json @@ -0,0 +1,10 @@ +{ + "reporterEnabled": "mochawesome, mocha-junit-reporter", + "reporterOptions": { + "html": false, + "json": true, + "mochaFile": "../../../target/kibana-security-solution/cypress/results/TEST-security-solution-cypress-[hash].xml", + "overwrite": false, + "reportDir": "../../../target/kibana-security-solution/cypress/results" + } +} diff --git a/x-pack/plugins/siem/cypress/screens/alert_detection_rules.ts b/x-pack/plugins/security_solution/cypress/screens/alert_detection_rules.ts similarity index 100% rename from x-pack/plugins/siem/cypress/screens/alert_detection_rules.ts rename to x-pack/plugins/security_solution/cypress/screens/alert_detection_rules.ts diff --git a/x-pack/plugins/siem/cypress/screens/all_cases.ts b/x-pack/plugins/security_solution/cypress/screens/all_cases.ts similarity index 100% rename from x-pack/plugins/siem/cypress/screens/all_cases.ts rename to x-pack/plugins/security_solution/cypress/screens/all_cases.ts diff --git a/x-pack/plugins/siem/cypress/screens/case_details.ts b/x-pack/plugins/security_solution/cypress/screens/case_details.ts similarity index 100% rename from x-pack/plugins/siem/cypress/screens/case_details.ts rename to x-pack/plugins/security_solution/cypress/screens/case_details.ts diff --git a/x-pack/plugins/siem/cypress/screens/configure_cases.ts b/x-pack/plugins/security_solution/cypress/screens/configure_cases.ts similarity index 100% rename from x-pack/plugins/siem/cypress/screens/configure_cases.ts rename to x-pack/plugins/security_solution/cypress/screens/configure_cases.ts diff --git a/x-pack/plugins/siem/cypress/screens/create_new_case.ts b/x-pack/plugins/security_solution/cypress/screens/create_new_case.ts similarity index 100% rename from x-pack/plugins/siem/cypress/screens/create_new_case.ts rename to x-pack/plugins/security_solution/cypress/screens/create_new_case.ts diff --git a/x-pack/plugins/siem/cypress/screens/create_new_rule.ts b/x-pack/plugins/security_solution/cypress/screens/create_new_rule.ts similarity index 100% rename from x-pack/plugins/siem/cypress/screens/create_new_rule.ts rename to x-pack/plugins/security_solution/cypress/screens/create_new_rule.ts diff --git a/x-pack/plugins/siem/cypress/screens/date_picker.ts b/x-pack/plugins/security_solution/cypress/screens/date_picker.ts similarity index 100% rename from x-pack/plugins/siem/cypress/screens/date_picker.ts rename to x-pack/plugins/security_solution/cypress/screens/date_picker.ts diff --git a/x-pack/plugins/siem/cypress/screens/detections.ts b/x-pack/plugins/security_solution/cypress/screens/detections.ts similarity index 100% rename from x-pack/plugins/siem/cypress/screens/detections.ts rename to x-pack/plugins/security_solution/cypress/screens/detections.ts diff --git a/x-pack/plugins/siem/cypress/screens/fields_browser.ts b/x-pack/plugins/security_solution/cypress/screens/fields_browser.ts similarity index 100% rename from x-pack/plugins/siem/cypress/screens/fields_browser.ts rename to x-pack/plugins/security_solution/cypress/screens/fields_browser.ts diff --git a/x-pack/plugins/siem/cypress/screens/hosts/all_hosts.ts b/x-pack/plugins/security_solution/cypress/screens/hosts/all_hosts.ts similarity index 100% rename from x-pack/plugins/siem/cypress/screens/hosts/all_hosts.ts rename to x-pack/plugins/security_solution/cypress/screens/hosts/all_hosts.ts diff --git a/x-pack/plugins/siem/cypress/screens/hosts/authentications.ts b/x-pack/plugins/security_solution/cypress/screens/hosts/authentications.ts similarity index 100% rename from x-pack/plugins/siem/cypress/screens/hosts/authentications.ts rename to x-pack/plugins/security_solution/cypress/screens/hosts/authentications.ts diff --git a/x-pack/plugins/siem/cypress/screens/hosts/events.ts b/x-pack/plugins/security_solution/cypress/screens/hosts/events.ts similarity index 100% rename from x-pack/plugins/siem/cypress/screens/hosts/events.ts rename to x-pack/plugins/security_solution/cypress/screens/hosts/events.ts diff --git a/x-pack/plugins/siem/cypress/screens/hosts/main.ts b/x-pack/plugins/security_solution/cypress/screens/hosts/main.ts similarity index 100% rename from x-pack/plugins/siem/cypress/screens/hosts/main.ts rename to x-pack/plugins/security_solution/cypress/screens/hosts/main.ts diff --git a/x-pack/plugins/siem/cypress/screens/hosts/uncommon_processes.ts b/x-pack/plugins/security_solution/cypress/screens/hosts/uncommon_processes.ts similarity index 100% rename from x-pack/plugins/siem/cypress/screens/hosts/uncommon_processes.ts rename to x-pack/plugins/security_solution/cypress/screens/hosts/uncommon_processes.ts diff --git a/x-pack/plugins/siem/cypress/screens/inspect.ts b/x-pack/plugins/security_solution/cypress/screens/inspect.ts similarity index 100% rename from x-pack/plugins/siem/cypress/screens/inspect.ts rename to x-pack/plugins/security_solution/cypress/screens/inspect.ts diff --git a/x-pack/plugins/siem/cypress/screens/network/flows.ts b/x-pack/plugins/security_solution/cypress/screens/network/flows.ts similarity index 100% rename from x-pack/plugins/siem/cypress/screens/network/flows.ts rename to x-pack/plugins/security_solution/cypress/screens/network/flows.ts diff --git a/x-pack/plugins/siem/cypress/screens/overview.ts b/x-pack/plugins/security_solution/cypress/screens/overview.ts similarity index 100% rename from x-pack/plugins/siem/cypress/screens/overview.ts rename to x-pack/plugins/security_solution/cypress/screens/overview.ts diff --git a/x-pack/plugins/siem/cypress/screens/pagination.ts b/x-pack/plugins/security_solution/cypress/screens/pagination.ts similarity index 100% rename from x-pack/plugins/siem/cypress/screens/pagination.ts rename to x-pack/plugins/security_solution/cypress/screens/pagination.ts diff --git a/x-pack/plugins/siem/cypress/screens/rule_details.ts b/x-pack/plugins/security_solution/cypress/screens/rule_details.ts similarity index 100% rename from x-pack/plugins/siem/cypress/screens/rule_details.ts rename to x-pack/plugins/security_solution/cypress/screens/rule_details.ts diff --git a/x-pack/plugins/siem/cypress/screens/siem_header.ts b/x-pack/plugins/security_solution/cypress/screens/siem_header.ts similarity index 100% rename from x-pack/plugins/siem/cypress/screens/siem_header.ts rename to x-pack/plugins/security_solution/cypress/screens/siem_header.ts diff --git a/x-pack/plugins/siem/cypress/screens/siem_main.ts b/x-pack/plugins/security_solution/cypress/screens/siem_main.ts similarity index 100% rename from x-pack/plugins/siem/cypress/screens/siem_main.ts rename to x-pack/plugins/security_solution/cypress/screens/siem_main.ts diff --git a/x-pack/plugins/siem/cypress/screens/timeline.ts b/x-pack/plugins/security_solution/cypress/screens/timeline.ts similarity index 100% rename from x-pack/plugins/siem/cypress/screens/timeline.ts rename to x-pack/plugins/security_solution/cypress/screens/timeline.ts diff --git a/x-pack/plugins/siem/cypress/support/commands.js b/x-pack/plugins/security_solution/cypress/support/commands.js similarity index 94% rename from x-pack/plugins/siem/cypress/support/commands.js rename to x-pack/plugins/security_solution/cypress/support/commands.js index 4bc62da22aca7..d086981cb98f7 100644 --- a/x-pack/plugins/siem/cypress/support/commands.js +++ b/x-pack/plugins/security_solution/cypress/support/commands.js @@ -37,5 +37,5 @@ Cypress.Commands.add('stubSIEMapi', function (dataFileName) { }); cy.server(); cy.fixture(dataFileName).as(`${dataFileName}JSON`); - cy.route('POST', 'api/siem/graphql', `@${dataFileName}JSON`); + cy.route('POST', 'api/solutions/security/graphql', `@${dataFileName}JSON`); }); diff --git a/x-pack/plugins/siem/cypress/support/index.d.ts b/x-pack/plugins/security_solution/cypress/support/index.d.ts similarity index 100% rename from x-pack/plugins/siem/cypress/support/index.d.ts rename to x-pack/plugins/security_solution/cypress/support/index.d.ts diff --git a/x-pack/plugins/siem/cypress/support/index.js b/x-pack/plugins/security_solution/cypress/support/index.js similarity index 100% rename from x-pack/plugins/siem/cypress/support/index.js rename to x-pack/plugins/security_solution/cypress/support/index.js diff --git a/x-pack/plugins/siem/cypress/tasks/alert_detection_rules.ts b/x-pack/plugins/security_solution/cypress/tasks/alert_detection_rules.ts similarity index 100% rename from x-pack/plugins/siem/cypress/tasks/alert_detection_rules.ts rename to x-pack/plugins/security_solution/cypress/tasks/alert_detection_rules.ts diff --git a/x-pack/plugins/siem/cypress/tasks/all_cases.ts b/x-pack/plugins/security_solution/cypress/tasks/all_cases.ts similarity index 100% rename from x-pack/plugins/siem/cypress/tasks/all_cases.ts rename to x-pack/plugins/security_solution/cypress/tasks/all_cases.ts diff --git a/x-pack/plugins/siem/cypress/tasks/case_details.ts b/x-pack/plugins/security_solution/cypress/tasks/case_details.ts similarity index 100% rename from x-pack/plugins/siem/cypress/tasks/case_details.ts rename to x-pack/plugins/security_solution/cypress/tasks/case_details.ts diff --git a/x-pack/plugins/siem/cypress/tasks/common.ts b/x-pack/plugins/security_solution/cypress/tasks/common.ts similarity index 100% rename from x-pack/plugins/siem/cypress/tasks/common.ts rename to x-pack/plugins/security_solution/cypress/tasks/common.ts diff --git a/x-pack/plugins/siem/cypress/tasks/configure_cases.ts b/x-pack/plugins/security_solution/cypress/tasks/configure_cases.ts similarity index 100% rename from x-pack/plugins/siem/cypress/tasks/configure_cases.ts rename to x-pack/plugins/security_solution/cypress/tasks/configure_cases.ts diff --git a/x-pack/plugins/siem/cypress/tasks/create_new_case.ts b/x-pack/plugins/security_solution/cypress/tasks/create_new_case.ts similarity index 100% rename from x-pack/plugins/siem/cypress/tasks/create_new_case.ts rename to x-pack/plugins/security_solution/cypress/tasks/create_new_case.ts diff --git a/x-pack/plugins/siem/cypress/tasks/create_new_rule.ts b/x-pack/plugins/security_solution/cypress/tasks/create_new_rule.ts similarity index 100% rename from x-pack/plugins/siem/cypress/tasks/create_new_rule.ts rename to x-pack/plugins/security_solution/cypress/tasks/create_new_rule.ts diff --git a/x-pack/plugins/siem/cypress/tasks/date_picker.ts b/x-pack/plugins/security_solution/cypress/tasks/date_picker.ts similarity index 100% rename from x-pack/plugins/siem/cypress/tasks/date_picker.ts rename to x-pack/plugins/security_solution/cypress/tasks/date_picker.ts diff --git a/x-pack/plugins/siem/cypress/tasks/detections.ts b/x-pack/plugins/security_solution/cypress/tasks/detections.ts similarity index 100% rename from x-pack/plugins/siem/cypress/tasks/detections.ts rename to x-pack/plugins/security_solution/cypress/tasks/detections.ts diff --git a/x-pack/plugins/siem/cypress/tasks/es_archiver.ts b/x-pack/plugins/security_solution/cypress/tasks/es_archiver.ts similarity index 74% rename from x-pack/plugins/siem/cypress/tasks/es_archiver.ts rename to x-pack/plugins/security_solution/cypress/tasks/es_archiver.ts index 8a4ab8c819457..5a09a2f753dc4 100644 --- a/x-pack/plugins/siem/cypress/tasks/es_archiver.ts +++ b/x-pack/plugins/security_solution/cypress/tasks/es_archiver.ts @@ -6,7 +6,7 @@ export const esArchiverLoadEmptyKibana = () => { cy.exec( - `node ../../../scripts/es_archiver empty_kibana load empty--dir ../../test/siem_cypress/es_archives --config ../../../test/functional/config.js --es-url ${Cypress.env( + `node ../../../scripts/es_archiver empty_kibana load empty--dir ../../test/security_solution_cypress/es_archives --config ../../../test/functional/config.js --es-url ${Cypress.env( 'ELASTICSEARCH_URL' )} --kibana-url ${Cypress.config().baseUrl}` ); @@ -14,7 +14,7 @@ export const esArchiverLoadEmptyKibana = () => { export const esArchiverLoad = (folder: string) => { cy.exec( - `node ../../../scripts/es_archiver load ${folder} --dir ../../test/siem_cypress/es_archives --config ../../../test/functional/config.js --es-url ${Cypress.env( + `node ../../../scripts/es_archiver load ${folder} --dir ../../test/security_solution_cypress/es_archives --config ../../../test/functional/config.js --es-url ${Cypress.env( 'ELASTICSEARCH_URL' )} --kibana-url ${Cypress.config().baseUrl}` ); @@ -22,7 +22,7 @@ export const esArchiverLoad = (folder: string) => { export const esArchiverUnload = (folder: string) => { cy.exec( - `node ../../../scripts/es_archiver unload ${folder} --dir ../../test/siem_cypress/es_archives --config ../../../test/functional/config.js --es-url ${Cypress.env( + `node ../../../scripts/es_archiver unload ${folder} --dir ../../test/security_solution_cypress/es_archives --config ../../../test/functional/config.js --es-url ${Cypress.env( 'ELASTICSEARCH_URL' )} --kibana-url ${Cypress.config().baseUrl}` ); @@ -30,7 +30,7 @@ export const esArchiverUnload = (folder: string) => { export const esArchiverUnloadEmptyKibana = () => { cy.exec( - `node ../../../scripts/es_archiver unload empty_kibana empty--dir ../../test/siem_cypress/es_archives --config ../../../test/functional/config.js --es-url ${Cypress.env( + `node ../../../scripts/es_archiver unload empty_kibana empty--dir ../../test/security_solution_cypress/es_archives --config ../../../test/functional/config.js --es-url ${Cypress.env( 'ELASTICSEARCH_URL' )} --kibana-url ${Cypress.config().baseUrl}` ); diff --git a/x-pack/plugins/siem/cypress/tasks/fields_browser.ts b/x-pack/plugins/security_solution/cypress/tasks/fields_browser.ts similarity index 100% rename from x-pack/plugins/siem/cypress/tasks/fields_browser.ts rename to x-pack/plugins/security_solution/cypress/tasks/fields_browser.ts diff --git a/x-pack/plugins/siem/cypress/tasks/hosts/all_hosts.ts b/x-pack/plugins/security_solution/cypress/tasks/hosts/all_hosts.ts similarity index 100% rename from x-pack/plugins/siem/cypress/tasks/hosts/all_hosts.ts rename to x-pack/plugins/security_solution/cypress/tasks/hosts/all_hosts.ts diff --git a/x-pack/plugins/siem/cypress/tasks/hosts/authentications.ts b/x-pack/plugins/security_solution/cypress/tasks/hosts/authentications.ts similarity index 100% rename from x-pack/plugins/siem/cypress/tasks/hosts/authentications.ts rename to x-pack/plugins/security_solution/cypress/tasks/hosts/authentications.ts diff --git a/x-pack/plugins/siem/cypress/tasks/hosts/events.ts b/x-pack/plugins/security_solution/cypress/tasks/hosts/events.ts similarity index 100% rename from x-pack/plugins/siem/cypress/tasks/hosts/events.ts rename to x-pack/plugins/security_solution/cypress/tasks/hosts/events.ts diff --git a/x-pack/plugins/siem/cypress/tasks/hosts/main.ts b/x-pack/plugins/security_solution/cypress/tasks/hosts/main.ts similarity index 100% rename from x-pack/plugins/siem/cypress/tasks/hosts/main.ts rename to x-pack/plugins/security_solution/cypress/tasks/hosts/main.ts diff --git a/x-pack/plugins/siem/cypress/tasks/hosts/uncommon_processes.ts b/x-pack/plugins/security_solution/cypress/tasks/hosts/uncommon_processes.ts similarity index 100% rename from x-pack/plugins/siem/cypress/tasks/hosts/uncommon_processes.ts rename to x-pack/plugins/security_solution/cypress/tasks/hosts/uncommon_processes.ts diff --git a/x-pack/plugins/siem/cypress/tasks/inspect.ts b/x-pack/plugins/security_solution/cypress/tasks/inspect.ts similarity index 100% rename from x-pack/plugins/siem/cypress/tasks/inspect.ts rename to x-pack/plugins/security_solution/cypress/tasks/inspect.ts diff --git a/x-pack/plugins/siem/cypress/tasks/login.ts b/x-pack/plugins/security_solution/cypress/tasks/login.ts similarity index 98% rename from x-pack/plugins/siem/cypress/tasks/login.ts rename to x-pack/plugins/security_solution/cypress/tasks/login.ts index 13580037b3d7c..4479c8d9d1fbe 100644 --- a/x-pack/plugins/siem/cypress/tasks/login.ts +++ b/x-pack/plugins/security_solution/cypress/tasks/login.ts @@ -124,12 +124,12 @@ export const loginAndWaitForPage = (url: string) => { cy.visit( `${url}?timerange=(global:(linkTo:!(timeline),timerange:(from:1547914976217,fromStr:'2019-01-19T16:22:56.217Z',kind:relative,to:1579537385745,toStr:now)),timeline:(linkTo:!(global),timerange:(from:1547914976217,fromStr:'2019-01-19T16:22:56.217Z',kind:relative,to:1579537385745,toStr:now)))` ); - cy.contains('a', 'SIEM'); + cy.contains('a', 'Security'); }; export const loginAndWaitForPageWithoutDateRange = (url: string) => { login(); cy.viewport('macbook-15'); cy.visit(url); - cy.contains('a', 'SIEM', { timeout: 120000 }); + cy.contains('a', 'Security', { timeout: 120000 }); }; diff --git a/x-pack/plugins/siem/cypress/tasks/network/flows.ts b/x-pack/plugins/security_solution/cypress/tasks/network/flows.ts similarity index 100% rename from x-pack/plugins/siem/cypress/tasks/network/flows.ts rename to x-pack/plugins/security_solution/cypress/tasks/network/flows.ts diff --git a/x-pack/plugins/siem/cypress/tasks/overview.ts b/x-pack/plugins/security_solution/cypress/tasks/overview.ts similarity index 100% rename from x-pack/plugins/siem/cypress/tasks/overview.ts rename to x-pack/plugins/security_solution/cypress/tasks/overview.ts diff --git a/x-pack/plugins/siem/cypress/tasks/pagination.ts b/x-pack/plugins/security_solution/cypress/tasks/pagination.ts similarity index 100% rename from x-pack/plugins/siem/cypress/tasks/pagination.ts rename to x-pack/plugins/security_solution/cypress/tasks/pagination.ts diff --git a/x-pack/plugins/siem/cypress/tasks/siem_header.ts b/x-pack/plugins/security_solution/cypress/tasks/siem_header.ts similarity index 100% rename from x-pack/plugins/siem/cypress/tasks/siem_header.ts rename to x-pack/plugins/security_solution/cypress/tasks/siem_header.ts diff --git a/x-pack/plugins/siem/cypress/tasks/siem_main.ts b/x-pack/plugins/security_solution/cypress/tasks/siem_main.ts similarity index 100% rename from x-pack/plugins/siem/cypress/tasks/siem_main.ts rename to x-pack/plugins/security_solution/cypress/tasks/siem_main.ts diff --git a/x-pack/plugins/siem/cypress/tasks/timeline.ts b/x-pack/plugins/security_solution/cypress/tasks/timeline.ts similarity index 100% rename from x-pack/plugins/siem/cypress/tasks/timeline.ts rename to x-pack/plugins/security_solution/cypress/tasks/timeline.ts diff --git a/x-pack/plugins/siem/cypress/test_files/expected_rules_export.ndjson b/x-pack/plugins/security_solution/cypress/test_files/expected_rules_export.ndjson similarity index 100% rename from x-pack/plugins/siem/cypress/test_files/expected_rules_export.ndjson rename to x-pack/plugins/security_solution/cypress/test_files/expected_rules_export.ndjson diff --git a/x-pack/plugins/siem/cypress/tsconfig.json b/x-pack/plugins/security_solution/cypress/tsconfig.json similarity index 100% rename from x-pack/plugins/siem/cypress/tsconfig.json rename to x-pack/plugins/security_solution/cypress/tsconfig.json diff --git a/x-pack/plugins/security_solution/cypress/urls/ml_conditional_links.ts b/x-pack/plugins/security_solution/cypress/urls/ml_conditional_links.ts new file mode 100644 index 0000000000000..cfa18099e5888 --- /dev/null +++ b/x-pack/plugins/security_solution/cypress/urls/ml_conditional_links.ts @@ -0,0 +1,76 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + +/* + * These links are for different test scenarios that try and capture different drill downs into + * ml-network and ml-hosts and are of the flavor of testing: + * A filter being null: (query:!n) + * A filter being set with single values: query=(query:%27process.name%20:%20%22conhost.exe%22%27,language:kuery) + * A filter being set with multiple values: query=(query:%27process.name%20:%20%22conhost.exe,sc.exe%22%27,language:kuery) + * A filter containing variables not replaced: query=(query:%27process.name%20:%20%$process.name$%22%27,language:kuery) + * + * In different combination with: + * network not being set: $ip$ + * host not being set: $host.name$ + * ...or... + * network being set normally: 127.0.0.1 + * host being set normally: suricata-iowa + * ...or... + * network having multiple values: 127.0.0.1,127.0.0.2 + * host having multiple values: suricata-iowa,siem-windows + */ + +// Single IP with a null for the Query: +export const mlNetworkSingleIpNullKqlQuery = + "/app/security#/ml-network/ip/127.0.0.1?query=!n&timerange=(global:(linkTo:!(timeline),timerange:(from:'2019-08-28T11:00:00.000Z',kind:absolute,to:'2019-08-28T13:59:59.999Z')),timeline:(linkTo:!(global),timerange:(from:'2019-08-28T11:00:00.000Z',kind:absolute,to:'2019-08-28T13:59:59.999Z')))"; + +// Single IP with a value for the Query: +export const mlNetworkSingleIpKqlQuery = + "/app/security#/ml-network/ip/127.0.0.1?query=(language:kuery,query:'process.name%20:%20%22conhost.exe,sc.exe%22')&timerange=(global:(linkTo:!(timeline),timerange:(from:'2019-08-28T11:00:00.000Z',kind:absolute,to:'2019-08-28T13:59:59.999Z')),timeline:(linkTo:!(global),timerange:(from:'2019-08-28T11:00:00.000Z',kind:absolute,to:'2019-08-28T13:59:59.999Z')))"; + +// Multiple IPs with a null for the Query: +export const mlNetworkMultipleIpNullKqlQuery = + "/app/security#/ml-network/ip/127.0.0.1,127.0.0.2?query=!n&timerange=(global:(linkTo:!(timeline),timerange:(from:'2019-08-28T11:00:00.000Z',kind:absolute,to:'2019-08-28T13:59:59.999Z')),timeline:(linkTo:!(global),timerange:(from:'2019-08-28T11:00:00.000Z',kind:absolute,to:'2019-08-28T13:59:59.999Z')))"; + +// Multiple IPs with a value for the Query: +export const mlNetworkMultipleIpKqlQuery = + "/app/security#/ml-network/ip/127.0.0.1,127.0.0.2?query=(language:kuery,query:'process.name%20:%20%22conhost.exe,sc.exe%22')&timerange=(global:(linkTo:!(timeline),timerange:(from:'2019-08-28T11:00:00.000Z',kind:absolute,to:'2019-08-28T13:59:59.999Z')),timeline:(linkTo:!(global),timerange:(from:'2019-08-28T11:00:00.000Z',kind:absolute,to:'2019-08-28T13:59:59.999Z')))"; + +// $ip$ with a null Query: +export const mlNetworkNullKqlQuery = + "/app/security#/ml-network/ip/$ip$?query=!n&timerange=(global:(linkTo:!(timeline),timerange:(from:'2019-08-28T11:00:00.000Z',kind:absolute,to:'2019-08-28T13:59:59.999Z')),timeline:(linkTo:!(global),timerange:(from:'2019-08-28T11:00:00.000Z',kind:absolute,to:'2019-08-28T13:59:59.999Z')))"; + +// $ip$ with a value for the Query: +export const mlNetworkKqlQuery = + "/app/security#/ml-network/ip/$ip$?query=(language:kuery,query:'process.name%20:%20%22conhost.exe,sc.exe%22')&timerange=(global:(linkTo:!(timeline),timerange:(from:'2019-08-28T11:00:00.000Z',kind:absolute,to:'2019-08-28T13:59:59.999Z')),timeline:(linkTo:!(global),timerange:(from:'2019-08-28T11:00:00.000Z',kind:absolute,to:'2019-08-28T13:59:59.999Z')))"; + +// Single host name with a null for the Query: +export const mlHostSingleHostNullKqlQuery = + "/app/security#/ml-hosts/siem-windows?query=!n&timerange=(global:(linkTo:!(timeline),timerange:(from:'2019-06-06T06:00:00.000Z',kind:absolute,to:'2019-06-07T05:59:59.999Z')),timeline:(linkTo:!(global),timerange:(from:'2019-06-06T06:00:00.000Z',kind:absolute,to:'2019-06-07T05:59:59.999Z')))"; + +// Single host name with a variable in the Query: +export const mlHostSingleHostKqlQueryVariable = + "/app/security#/ml-hosts/siem-windows?query=(language:kuery,query:'process.name%20:%20%22$process.name$%22')&timerange=(global:(linkTo:!(timeline),timerange:(from:'2019-06-06T06:00:00.000Z',kind:absolute,to:'2019-06-07T05:59:59.999Z')),timeline:(linkTo:!(global),timerange:(from:'2019-06-06T06:00:00.000Z',kind:absolute,to:'2019-06-07T05:59:59.999Z')))"; + +// Single host name with a value for Query: +export const mlHostSingleHostKqlQuery = + "/app/security#/ml-hosts/siem-windows?query=(language:kuery,query:'process.name%20:%20%22conhost.exe,sc.exe%22')&timerange=(global:(linkTo:!(timeline),timerange:(from:'2019-06-06T06:00:00.000Z',kind:absolute,to:'2019-06-07T05:59:59.999Z')),timeline:(linkTo:!(global),timerange:(from:'2019-06-06T06:00:00.000Z',kind:absolute,to:'2019-06-07T05:59:59.999Z')))"; + +// Multiple host names with null for Query: +export const mlHostMultiHostNullKqlQuery = + "/app/security#/ml-hosts/siem-windows,siem-suricata?query=!n&&timerange=(global:(linkTo:!(timeline),timerange:(from:'2019-06-06T06:00:00.000Z',kind:absolute,to:'2019-06-07T05:59:59.999Z')),timeline:(linkTo:!(global),timerange:(from:'2019-06-06T06:00:00.000Z',kind:absolute,to:'2019-06-07T05:59:59.999Z')))"; + +// Multiple host names with a value for Query: +export const mlHostMultiHostKqlQuery = + "/app/security#/ml-hosts/siem-windows,siem-suricata?query=(language:kuery,query:'process.name%20:%20%22conhost.exe,sc.exe%22')&timerange=(global:(linkTo:!(timeline),timerange:(from:'2019-06-06T06:00:00.000Z',kind:absolute,to:'2019-06-07T05:59:59.999Z')),timeline:(linkTo:!(global),timerange:(from:'2019-06-06T06:00:00.000Z',kind:absolute,to:'2019-06-07T05:59:59.999Z')))"; + +// Undefined/null host name with a null for the KQL: +export const mlHostVariableHostNullKqlQuery = + "/app/security#/ml-hosts/$host.name$?query=!n&timerange=(global:(linkTo:!(timeline),timerange:(from:'2019-06-06T06:00:00.000Z',kind:absolute,to:'2019-06-07T05:59:59.999Z')),timeline:(linkTo:!(global),timerange:(from:'2019-06-06T06:00:00.000Z',kind:absolute,to:'2019-06-07T05:59:59.999Z')))"; + +// Undefined/null host name but with a value for Query: +export const mlHostVariableHostKqlQuery = + "/app/security#/ml-hosts/$host.name$?query=(language:kuery,query:'process.name%20:%20%22conhost.exe,sc.exe%22')&timerange=(global:(linkTo:!(timeline),timerange:(from:'2019-06-06T06:00:00.000Z',kind:absolute,to:'2019-06-07T05:59:59.999Z')),timeline:(linkTo:!(global),timerange:(from:'2019-06-06T06:00:00.000Z',kind:absolute,to:'2019-06-07T05:59:59.999Z')))"; diff --git a/x-pack/plugins/security_solution/cypress/urls/navigation.ts b/x-pack/plugins/security_solution/cypress/urls/navigation.ts new file mode 100644 index 0000000000000..9bfe2e9e5102e --- /dev/null +++ b/x-pack/plugins/security_solution/cypress/urls/navigation.ts @@ -0,0 +1,19 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + +export const CASES = '/app/security#/case'; +export const DETECTIONS = 'app/security#/detections'; +export const HOSTS_PAGE = '/app/security#/hosts/allHosts'; +export const HOSTS_PAGE_TAB_URLS = { + allHosts: '/app/security#/hosts/allHosts', + anomalies: '/app/security#/hosts/anomalies', + authentications: '/app/security#/hosts/authentications', + events: '/app/security#/hosts/events', + uncommonProcesses: '/app/security#/hosts/uncommonProcesses', +}; +export const NETWORK_PAGE = '/app/security#/network'; +export const OVERVIEW_PAGE = '/app/security#/overview'; +export const TIMELINES_PAGE = '/app/security#/timelines'; diff --git a/x-pack/plugins/security_solution/cypress/urls/state.ts b/x-pack/plugins/security_solution/cypress/urls/state.ts new file mode 100644 index 0000000000000..6de30fdafdaf8 --- /dev/null +++ b/x-pack/plugins/security_solution/cypress/urls/state.ts @@ -0,0 +1,21 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + +export const ABSOLUTE_DATE_RANGE = { + url: + '/app/security#/network/?timerange=(global:(linkTo:!(timeline),timerange:(from:1564689809186,kind:absolute,to:1564691609186)),timeline:(linkTo:!(global),timerange:(from:1564689809186,kind:absolute,to:1564691609186)))', + + urlUnlinked: + '/app/security#/network/?timerange=(global:(linkTo:!(),timerange:(from:1564689809186,kind:absolute,to:1564691609186)),timeline:(linkTo:!(),timerange:(from:1564776209186,kind:absolute,to:1564779809186)))', + urlKqlNetworkNetwork: `/app/security#/network/?query=(language:kuery,query:'source.ip:%20"10.142.0.9"')&timerange=(global:(linkTo:!(timeline),timerange:(from:1564689809186,kind:absolute,to:1564691609186)),timeline:(linkTo:!(global),timerange:(from:1564689809186,kind:absolute,to:1564691609186)))`, + urlKqlNetworkHosts: `/app/security#/network/?query=(language:kuery,query:'source.ip:%20"10.142.0.9"')&timerange=(global:(linkTo:!(timeline),timerange:(from:1564689809186,kind:absolute,to:1564691609186)),timeline:(linkTo:!(global),timerange:(from:1564689809186,kind:absolute,to:1564691609186)))`, + urlKqlHostsNetwork: `/app/security#/hosts/allHosts?query=(language:kuery,query:'source.ip:%20"10.142.0.9"')&timerange=(global:(linkTo:!(timeline),timerange:(from:1564689809186,kind:absolute,to:1564691609186)),timeline:(linkTo:!(global),timerange:(from:1564689809186,kind:absolute,to:1564691609186)))`, + urlKqlHostsHosts: `/app/security#/hosts/allHosts?query=(language:kuery,query:'source.ip:%20"10.142.0.9"')&timerange=(global:(linkTo:!(timeline),timerange:(from:1564689809186,kind:absolute,to:1564691609186)),timeline:(linkTo:!(global),timerange:(from:1564689809186,kind:absolute,to:1564691609186)))`, + urlHost: + '/app/security#/hosts/authentications?timerange=(global:(linkTo:!(timeline),timerange:(from:1564689809186,kind:absolute,to:1564691609186)),timeline:(linkTo:!(global),timerange:(from:1564689809186,kind:absolute,to:1564691609186)))', + urlHostNew: + '/app/security#/hosts/authentications?timerange=(global:(linkTo:!(timeline),timerange:(from:1564689809186,kind:absolute,to:1577914409186)),timeline:(linkTo:!(global),timerange:(from:1564689809186,kind:absolute,to:1577914409186)))', +}; diff --git a/x-pack/plugins/siem/kibana.json b/x-pack/plugins/security_solution/kibana.json similarity index 86% rename from x-pack/plugins/siem/kibana.json rename to x-pack/plugins/security_solution/kibana.json index df40ad4650f45..8ce8820a8e57d 100644 --- a/x-pack/plugins/siem/kibana.json +++ b/x-pack/plugins/security_solution/kibana.json @@ -1,8 +1,8 @@ { - "id": "siem", + "id": "securitySolution", "version": "8.0.0", "kibanaVersion": "kibana", - "configPath": ["xpack", "siem"], + "configPath": ["xpack", "securitySolution"], "requiredPlugins": [ "actions", "alerts", diff --git a/x-pack/plugins/siem/package.json b/x-pack/plugins/security_solution/package.json similarity index 68% rename from x-pack/plugins/siem/package.json rename to x-pack/plugins/security_solution/package.json index f61ab8e946b15..73347e00e6b34 100644 --- a/x-pack/plugins/siem/package.json +++ b/x-pack/plugins/security_solution/package.json @@ -1,6 +1,6 @@ { "author": "Elastic", - "name": "siem", + "name": "security_solution", "version": "8.0.0", "private": true, "license": "Elastic-License", @@ -8,8 +8,8 @@ "extract-mitre-attacks": "node scripts/extract_tactics_techniques_mitre.js && node ../../../scripts/eslint ./public/pages/detection_engine/mitre/mitre_tactics_techniques.ts --fix", "build-graphql-types": "node scripts/generate_types_from_graphql.js", "cypress:open": "cypress open --config-file ./cypress/cypress.json", - "cypress:run": "cypress run --browser chrome --headless --spec ./cypress/integration/**/*.spec.ts --config-file ./cypress/cypress.json --reporter ../../node_modules/cypress-multi-reporters --reporter-options configFile=./cypress/reporter_config.json; status=$?; ../../node_modules/.bin/mochawesome-merge --reportDir ../../../target/kibana-siem/cypress/results > ../../../target/kibana-siem/cypress/results/output.json; ../../../node_modules/.bin/marge ../../../target/kibana-siem/cypress/results/output.json --reportDir ../../../target/kibana-siem/cypress/results; mkdir -p ../../../target/junit && cp ../../../target/kibana-siem/cypress/results/*.xml ../../../target/junit/ && exit $status;", - "cypress:run-as-ci": "node ../../../scripts/functional_tests --config ../../test/siem_cypress/config.ts", + "cypress:run": "cypress run --browser chrome --headless --spec ./cypress/integration/**/*.spec.ts --config-file ./cypress/cypress.json --reporter ../../node_modules/cypress-multi-reporters --reporter-options configFile=./cypress/reporter_config.json; status=$?; ../../node_modules/.bin/mochawesome-merge --reportDir ../../../target/kibana-security-solution/cypress/results > ../../../target/kibana-security-solution/cypress/results/output.json; ../../../node_modules/.bin/marge ../../../target/kibana-security-solution/cypress/results/output.json --reportDir ../../../target/kibana-security-solution/cypress/results; mkdir -p ../../../target/junit && cp ../../../target/kibana-security-solution/cypress/results/*.xml ../../../target/junit/ && exit $status;", + "cypress:run-as-ci": "node ../../../scripts/functional_tests --config ../../test/security_solution_cypress/config.ts", "test:generate": "ts-node --project scripts/endpoint/cli_tsconfig.json scripts/endpoint/resolver_generator.ts" }, "devDependencies": { diff --git a/x-pack/plugins/siem/public/alerts/components/activity_monitor/columns.tsx b/x-pack/plugins/security_solution/public/alerts/components/activity_monitor/columns.tsx similarity index 100% rename from x-pack/plugins/siem/public/alerts/components/activity_monitor/columns.tsx rename to x-pack/plugins/security_solution/public/alerts/components/activity_monitor/columns.tsx diff --git a/x-pack/plugins/siem/public/alerts/components/activity_monitor/index.test.tsx b/x-pack/plugins/security_solution/public/alerts/components/activity_monitor/index.test.tsx similarity index 100% rename from x-pack/plugins/siem/public/alerts/components/activity_monitor/index.test.tsx rename to x-pack/plugins/security_solution/public/alerts/components/activity_monitor/index.test.tsx diff --git a/x-pack/plugins/siem/public/alerts/components/activity_monitor/index.tsx b/x-pack/plugins/security_solution/public/alerts/components/activity_monitor/index.tsx similarity index 100% rename from x-pack/plugins/siem/public/alerts/components/activity_monitor/index.tsx rename to x-pack/plugins/security_solution/public/alerts/components/activity_monitor/index.tsx diff --git a/x-pack/plugins/siem/public/alerts/components/activity_monitor/types.ts b/x-pack/plugins/security_solution/public/alerts/components/activity_monitor/types.ts similarity index 100% rename from x-pack/plugins/siem/public/alerts/components/activity_monitor/types.ts rename to x-pack/plugins/security_solution/public/alerts/components/activity_monitor/types.ts diff --git a/x-pack/plugins/siem/public/alerts/components/alerts_histogram_panel/alerts_histogram.test.tsx b/x-pack/plugins/security_solution/public/alerts/components/alerts_histogram_panel/alerts_histogram.test.tsx similarity index 100% rename from x-pack/plugins/siem/public/alerts/components/alerts_histogram_panel/alerts_histogram.test.tsx rename to x-pack/plugins/security_solution/public/alerts/components/alerts_histogram_panel/alerts_histogram.test.tsx diff --git a/x-pack/plugins/siem/public/alerts/components/alerts_histogram_panel/alerts_histogram.tsx b/x-pack/plugins/security_solution/public/alerts/components/alerts_histogram_panel/alerts_histogram.tsx similarity index 100% rename from x-pack/plugins/siem/public/alerts/components/alerts_histogram_panel/alerts_histogram.tsx rename to x-pack/plugins/security_solution/public/alerts/components/alerts_histogram_panel/alerts_histogram.tsx diff --git a/x-pack/plugins/siem/public/alerts/components/alerts_histogram_panel/config.ts b/x-pack/plugins/security_solution/public/alerts/components/alerts_histogram_panel/config.ts similarity index 100% rename from x-pack/plugins/siem/public/alerts/components/alerts_histogram_panel/config.ts rename to x-pack/plugins/security_solution/public/alerts/components/alerts_histogram_panel/config.ts diff --git a/x-pack/plugins/siem/public/alerts/components/alerts_histogram_panel/helpers.test.tsx b/x-pack/plugins/security_solution/public/alerts/components/alerts_histogram_panel/helpers.test.tsx similarity index 100% rename from x-pack/plugins/siem/public/alerts/components/alerts_histogram_panel/helpers.test.tsx rename to x-pack/plugins/security_solution/public/alerts/components/alerts_histogram_panel/helpers.test.tsx diff --git a/x-pack/plugins/siem/public/alerts/components/alerts_histogram_panel/helpers.tsx b/x-pack/plugins/security_solution/public/alerts/components/alerts_histogram_panel/helpers.tsx similarity index 100% rename from x-pack/plugins/siem/public/alerts/components/alerts_histogram_panel/helpers.tsx rename to x-pack/plugins/security_solution/public/alerts/components/alerts_histogram_panel/helpers.tsx diff --git a/x-pack/plugins/siem/public/alerts/components/alerts_histogram_panel/index.test.tsx b/x-pack/plugins/security_solution/public/alerts/components/alerts_histogram_panel/index.test.tsx similarity index 100% rename from x-pack/plugins/siem/public/alerts/components/alerts_histogram_panel/index.test.tsx rename to x-pack/plugins/security_solution/public/alerts/components/alerts_histogram_panel/index.test.tsx diff --git a/x-pack/plugins/siem/public/alerts/components/alerts_histogram_panel/index.tsx b/x-pack/plugins/security_solution/public/alerts/components/alerts_histogram_panel/index.tsx similarity index 100% rename from x-pack/plugins/siem/public/alerts/components/alerts_histogram_panel/index.tsx rename to x-pack/plugins/security_solution/public/alerts/components/alerts_histogram_panel/index.tsx diff --git a/x-pack/plugins/siem/public/alerts/components/alerts_histogram_panel/translations.ts b/x-pack/plugins/security_solution/public/alerts/components/alerts_histogram_panel/translations.ts similarity index 58% rename from x-pack/plugins/siem/public/alerts/components/alerts_histogram_panel/translations.ts rename to x-pack/plugins/security_solution/public/alerts/components/alerts_histogram_panel/translations.ts index 91345e3d989f1..6eaa0ba3fc4ec 100644 --- a/x-pack/plugins/siem/public/alerts/components/alerts_histogram_panel/translations.ts +++ b/x-pack/plugins/security_solution/public/alerts/components/alerts_histogram_panel/translations.ts @@ -7,104 +7,104 @@ import { i18n } from '@kbn/i18n'; export const STACK_BY_LABEL = i18n.translate( - 'xpack.siem.detectionEngine.alerts.histogram.stackByOptions.stackByLabel', + 'xpack.securitySolution.detectionEngine.alerts.histogram.stackByOptions.stackByLabel', { defaultMessage: 'Stack by', } ); export const STACK_BY_RISK_SCORES = i18n.translate( - 'xpack.siem.detectionEngine.alerts.histogram.stackByOptions.riskScoresDropDown', + 'xpack.securitySolution.detectionEngine.alerts.histogram.stackByOptions.riskScoresDropDown', { defaultMessage: 'Risk scores', } ); export const STACK_BY_SEVERITIES = i18n.translate( - 'xpack.siem.detectionEngine.alerts.histogram.stackByOptions.severitiesDropDown', + 'xpack.securitySolution.detectionEngine.alerts.histogram.stackByOptions.severitiesDropDown', { defaultMessage: 'Severities', } ); export const STACK_BY_DESTINATION_IPS = i18n.translate( - 'xpack.siem.detectionEngine.alerts.histogram.stackByOptions.destinationIpsDropDown', + 'xpack.securitySolution.detectionEngine.alerts.histogram.stackByOptions.destinationIpsDropDown', { defaultMessage: 'Top destination IPs', } ); export const STACK_BY_SOURCE_IPS = i18n.translate( - 'xpack.siem.detectionEngine.alerts.histogram.stackByOptions.sourceIpsDropDown', + 'xpack.securitySolution.detectionEngine.alerts.histogram.stackByOptions.sourceIpsDropDown', { defaultMessage: 'Top source IPs', } ); export const STACK_BY_ACTIONS = i18n.translate( - 'xpack.siem.detectionEngine.alerts.histogram.stackByOptions.eventActionsDropDown', + 'xpack.securitySolution.detectionEngine.alerts.histogram.stackByOptions.eventActionsDropDown', { defaultMessage: 'Top event actions', } ); export const STACK_BY_CATEGORIES = i18n.translate( - 'xpack.siem.detectionEngine.alerts.histogram.stackByOptions.eventCategoriesDropDown', + 'xpack.securitySolution.detectionEngine.alerts.histogram.stackByOptions.eventCategoriesDropDown', { defaultMessage: 'Top event categories', } ); export const STACK_BY_HOST_NAMES = i18n.translate( - 'xpack.siem.detectionEngine.alerts.histogram.stackByOptions.hostNamesDropDown', + 'xpack.securitySolution.detectionEngine.alerts.histogram.stackByOptions.hostNamesDropDown', { defaultMessage: 'Top host names', } ); export const STACK_BY_RULE_TYPES = i18n.translate( - 'xpack.siem.detectionEngine.alerts.histogram.stackByOptions.ruleTypesDropDown', + 'xpack.securitySolution.detectionEngine.alerts.histogram.stackByOptions.ruleTypesDropDown', { defaultMessage: 'Top rule types', } ); export const STACK_BY_RULE_NAMES = i18n.translate( - 'xpack.siem.detectionEngine.alerts.histogram.stackByOptions.rulesDropDown', + 'xpack.securitySolution.detectionEngine.alerts.histogram.stackByOptions.rulesDropDown', { defaultMessage: 'Top rules', } ); export const STACK_BY_USERS = i18n.translate( - 'xpack.siem.detectionEngine.alerts.histogram.stackByOptions.usersDropDown', + 'xpack.securitySolution.detectionEngine.alerts.histogram.stackByOptions.usersDropDown', { defaultMessage: 'Top users', } ); export const TOP = (fieldName: string) => - i18n.translate('xpack.siem.detectionEngine.alerts.histogram.topNLabel', { + i18n.translate('xpack.securitySolution.detectionEngine.alerts.histogram.topNLabel', { values: { fieldName }, defaultMessage: `Top {fieldName}`, }); export const HISTOGRAM_HEADER = i18n.translate( - 'xpack.siem.detectionEngine.alerts.histogram.headerTitle', + 'xpack.securitySolution.detectionEngine.alerts.histogram.headerTitle', { defaultMessage: 'Alert count', } ); export const ALL_OTHERS = i18n.translate( - 'xpack.siem.detectionEngine.alerts.histogram.allOthersGroupingLabel', + 'xpack.securitySolution.detectionEngine.alerts.histogram.allOthersGroupingLabel', { defaultMessage: 'All others', } ); export const VIEW_ALERTS = i18n.translate( - 'xpack.siem.detectionEngine.alerts.histogram.viewAlertsButtonLabel', + 'xpack.securitySolution.detectionEngine.alerts.histogram.viewAlertsButtonLabel', { defaultMessage: 'View alerts', } @@ -115,7 +115,7 @@ export const SHOWING_ALERTS = ( totalAlerts: number, modifier: string ) => - i18n.translate('xpack.siem.detectionEngine.alerts.histogram.showingAlertsTitle', { + i18n.translate('xpack.securitySolution.detectionEngine.alerts.histogram.showingAlertsTitle', { values: { totalAlertsFormatted, totalAlerts, modifier }, defaultMessage: 'Showing: {modifier}{totalAlertsFormatted} {totalAlerts, plural, =1 {alert} other {alerts}}', diff --git a/x-pack/plugins/siem/public/alerts/components/alerts_histogram_panel/types.ts b/x-pack/plugins/security_solution/public/alerts/components/alerts_histogram_panel/types.ts similarity index 100% rename from x-pack/plugins/siem/public/alerts/components/alerts_histogram_panel/types.ts rename to x-pack/plugins/security_solution/public/alerts/components/alerts_histogram_panel/types.ts diff --git a/x-pack/plugins/siem/public/alerts/components/alerts_info/index.tsx b/x-pack/plugins/security_solution/public/alerts/components/alerts_info/index.tsx similarity index 100% rename from x-pack/plugins/siem/public/alerts/components/alerts_info/index.tsx rename to x-pack/plugins/security_solution/public/alerts/components/alerts_info/index.tsx diff --git a/x-pack/plugins/siem/public/alerts/components/alerts_info/query.dsl.ts b/x-pack/plugins/security_solution/public/alerts/components/alerts_info/query.dsl.ts similarity index 100% rename from x-pack/plugins/siem/public/alerts/components/alerts_info/query.dsl.ts rename to x-pack/plugins/security_solution/public/alerts/components/alerts_info/query.dsl.ts diff --git a/x-pack/plugins/siem/public/alerts/components/alerts_info/types.ts b/x-pack/plugins/security_solution/public/alerts/components/alerts_info/types.ts similarity index 100% rename from x-pack/plugins/siem/public/alerts/components/alerts_info/types.ts rename to x-pack/plugins/security_solution/public/alerts/components/alerts_info/types.ts diff --git a/x-pack/plugins/siem/public/alerts/components/alerts_table/actions.test.tsx b/x-pack/plugins/security_solution/public/alerts/components/alerts_table/actions.test.tsx similarity index 100% rename from x-pack/plugins/siem/public/alerts/components/alerts_table/actions.test.tsx rename to x-pack/plugins/security_solution/public/alerts/components/alerts_table/actions.test.tsx diff --git a/x-pack/plugins/siem/public/alerts/components/alerts_table/actions.tsx b/x-pack/plugins/security_solution/public/alerts/components/alerts_table/actions.tsx similarity index 100% rename from x-pack/plugins/siem/public/alerts/components/alerts_table/actions.tsx rename to x-pack/plugins/security_solution/public/alerts/components/alerts_table/actions.tsx diff --git a/x-pack/plugins/siem/public/alerts/components/alerts_table/alerts_filter_group/index.test.tsx b/x-pack/plugins/security_solution/public/alerts/components/alerts_table/alerts_filter_group/index.test.tsx similarity index 100% rename from x-pack/plugins/siem/public/alerts/components/alerts_table/alerts_filter_group/index.test.tsx rename to x-pack/plugins/security_solution/public/alerts/components/alerts_table/alerts_filter_group/index.test.tsx diff --git a/x-pack/plugins/siem/public/alerts/components/alerts_table/alerts_filter_group/index.tsx b/x-pack/plugins/security_solution/public/alerts/components/alerts_table/alerts_filter_group/index.tsx similarity index 100% rename from x-pack/plugins/siem/public/alerts/components/alerts_table/alerts_filter_group/index.tsx rename to x-pack/plugins/security_solution/public/alerts/components/alerts_table/alerts_filter_group/index.tsx diff --git a/x-pack/plugins/siem/public/alerts/components/alerts_table/alerts_utility_bar/index.test.tsx b/x-pack/plugins/security_solution/public/alerts/components/alerts_table/alerts_utility_bar/index.test.tsx similarity index 100% rename from x-pack/plugins/siem/public/alerts/components/alerts_table/alerts_utility_bar/index.test.tsx rename to x-pack/plugins/security_solution/public/alerts/components/alerts_table/alerts_utility_bar/index.test.tsx diff --git a/x-pack/plugins/siem/public/alerts/components/alerts_table/alerts_utility_bar/index.tsx b/x-pack/plugins/security_solution/public/alerts/components/alerts_table/alerts_utility_bar/index.tsx similarity index 100% rename from x-pack/plugins/siem/public/alerts/components/alerts_table/alerts_utility_bar/index.tsx rename to x-pack/plugins/security_solution/public/alerts/components/alerts_table/alerts_utility_bar/index.tsx diff --git a/x-pack/plugins/siem/public/alerts/components/alerts_table/alerts_utility_bar/translations.ts b/x-pack/plugins/security_solution/public/alerts/components/alerts_table/alerts_utility_bar/translations.ts similarity index 66% rename from x-pack/plugins/siem/public/alerts/components/alerts_table/alerts_utility_bar/translations.ts rename to x-pack/plugins/security_solution/public/alerts/components/alerts_table/alerts_utility_bar/translations.ts index ae5070efc21e1..9427464e23726 100644 --- a/x-pack/plugins/siem/public/alerts/components/alerts_table/alerts_utility_bar/translations.ts +++ b/x-pack/plugins/security_solution/public/alerts/components/alerts_table/alerts_utility_bar/translations.ts @@ -7,70 +7,70 @@ import { i18n } from '@kbn/i18n'; export const SHOWING_ALERTS = (totalAlertsFormatted: string, totalAlerts: number) => - i18n.translate('xpack.siem.detectionEngine.alerts.utilityBar.showingAlertsTitle', { + i18n.translate('xpack.securitySolution.detectionEngine.alerts.utilityBar.showingAlertsTitle', { values: { totalAlertsFormatted, totalAlerts }, defaultMessage: 'Showing {totalAlertsFormatted} {totalAlerts, plural, =1 {alert} other {alerts}}', }); export const SELECTED_ALERTS = (selectedAlertsFormatted: string, selectedAlerts: number) => - i18n.translate('xpack.siem.detectionEngine.alerts.utilityBar.selectedAlertsTitle', { + i18n.translate('xpack.securitySolution.detectionEngine.alerts.utilityBar.selectedAlertsTitle', { values: { selectedAlertsFormatted, selectedAlerts }, defaultMessage: 'Selected {selectedAlertsFormatted} {selectedAlerts, plural, =1 {alert} other {alerts}}', }); export const SELECT_ALL_ALERTS = (totalAlertsFormatted: string, totalAlerts: number) => - i18n.translate('xpack.siem.detectionEngine.alerts.utilityBar.selectAllAlertsTitle', { + i18n.translate('xpack.securitySolution.detectionEngine.alerts.utilityBar.selectAllAlertsTitle', { values: { totalAlertsFormatted, totalAlerts }, defaultMessage: 'Select all {totalAlertsFormatted} {totalAlerts, plural, =1 {alert} other {alerts}}', }); export const CLEAR_SELECTION = i18n.translate( - 'xpack.siem.detectionEngine.alerts.utilityBar.clearSelectionTitle', + 'xpack.securitySolution.detectionEngine.alerts.utilityBar.clearSelectionTitle', { defaultMessage: 'Clear selection', } ); export const BATCH_ACTIONS = i18n.translate( - 'xpack.siem.detectionEngine.alerts.utilityBar.batchActionsTitle', + 'xpack.securitySolution.detectionEngine.alerts.utilityBar.batchActionsTitle', { defaultMessage: 'Batch actions', } ); export const BATCH_ACTION_VIEW_SELECTED_IN_HOSTS = i18n.translate( - 'xpack.siem.detectionEngine.alerts.utilityBar.batchActions.viewSelectedInHostsTitle', + 'xpack.securitySolution.detectionEngine.alerts.utilityBar.batchActions.viewSelectedInHostsTitle', { defaultMessage: 'View selected in hosts', } ); export const BATCH_ACTION_VIEW_SELECTED_IN_NETWORK = i18n.translate( - 'xpack.siem.detectionEngine.alerts.utilityBar.batchActions.viewSelectedInNetworkTitle', + 'xpack.securitySolution.detectionEngine.alerts.utilityBar.batchActions.viewSelectedInNetworkTitle', { defaultMessage: 'View selected in network', } ); export const BATCH_ACTION_VIEW_SELECTED_IN_TIMELINE = i18n.translate( - 'xpack.siem.detectionEngine.alerts.utilityBar.batchActions.viewSelectedInTimelineTitle', + 'xpack.securitySolution.detectionEngine.alerts.utilityBar.batchActions.viewSelectedInTimelineTitle', { defaultMessage: 'View selected in timeline', } ); export const BATCH_ACTION_OPEN_SELECTED = i18n.translate( - 'xpack.siem.detectionEngine.alerts.utilityBar.batchActions.openSelectedTitle', + 'xpack.securitySolution.detectionEngine.alerts.utilityBar.batchActions.openSelectedTitle', { defaultMessage: 'Open selected', } ); export const BATCH_ACTION_CLOSE_SELECTED = i18n.translate( - 'xpack.siem.detectionEngine.alerts.utilityBar.batchActions.closeSelectedTitle', + 'xpack.securitySolution.detectionEngine.alerts.utilityBar.batchActions.closeSelectedTitle', { defaultMessage: 'Close selected', } diff --git a/x-pack/plugins/security_solution/public/alerts/components/alerts_table/default_config.test.tsx b/x-pack/plugins/security_solution/public/alerts/components/alerts_table/default_config.test.tsx new file mode 100644 index 0000000000000..1b9070ff83ac7 --- /dev/null +++ b/x-pack/plugins/security_solution/public/alerts/components/alerts_table/default_config.test.tsx @@ -0,0 +1,195 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + +import { Filter } from '../../../../../../../src/plugins/data/common/es_query'; +import { buildAlertsRuleIdFilter } from './default_config'; + +jest.mock('./actions'); + +describe('alerts default_config', () => { + describe('buildAlertsRuleIdFilter', () => { + test('given a rule id this will return an array with a single filter', () => { + const filters: Filter[] = buildAlertsRuleIdFilter('rule-id-1'); + const expectedFilter: Filter = { + meta: { + alias: null, + negate: false, + disabled: false, + type: 'phrase', + key: 'signal.rule.id', + params: { + query: 'rule-id-1', + }, + }, + query: { + match_phrase: { + 'signal.rule.id': 'rule-id-1', + }, + }, + }; + expect(filters).toHaveLength(1); + expect(filters[0]).toEqual(expectedFilter); + }); + }); + // TODO: move these tests to ../timelines/components/timeline/body/events/event_column_view.tsx + // describe.skip('getAlertActions', () => { + // let setEventsLoading: ({ eventIds, isLoading }: SetEventsLoadingProps) => void; + // let setEventsDeleted: ({ eventIds, isDeleted }: SetEventsDeletedProps) => void; + // let createTimeline: CreateTimeline; + // let updateTimelineIsLoading: UpdateTimelineLoading; + // + // let onAlertStatusUpdateSuccess: (count: number, status: string) => void; + // let onAlertStatusUpdateFailure: (status: string, error: Error) => void; + // + // beforeEach(() => { + // setEventsLoading = jest.fn(); + // setEventsDeleted = jest.fn(); + // createTimeline = jest.fn(); + // updateTimelineIsLoading = jest.fn(); + // onAlertStatusUpdateSuccess = jest.fn(); + // onAlertStatusUpdateFailure = jest.fn(); + // }); + // + // describe('timeline tooltip', () => { + // test('it invokes sendAlertToTimelineAction when button clicked', () => { + // const alertsActions = getAlertActions({ + // canUserCRUD: true, + // hasIndexWrite: true, + // setEventsLoading, + // setEventsDeleted, + // createTimeline, + // status: 'open', + // updateTimelineIsLoading, + // onAlertStatusUpdateSuccess, + // onAlertStatusUpdateFailure, + // }); + // const timelineAction = alertsActions[0].getAction({ + // eventId: 'even-id', + // ecsData: mockEcsDataWithAlert, + // }); + // const wrapper = mount(timelineAction as React.ReactElement); + // wrapper.find(EuiButtonIcon).simulate('click'); + // + // expect(sendAlertToTimelineAction).toHaveBeenCalled(); + // }); + // }); + // + // describe('alert open action', () => { + // let alertsActions: TimelineAction[]; + // let alertOpenAction: JSX.Element; + // let wrapper: ReactWrapper; + // + // beforeEach(() => { + // alertsActions = getAlertActions({ + // canUserCRUD: true, + // hasIndexWrite: true, + // setEventsLoading, + // setEventsDeleted, + // createTimeline, + // status: 'open', + // updateTimelineIsLoading, + // onAlertStatusUpdateSuccess, + // onAlertStatusUpdateFailure, + // }); + // + // alertOpenAction = alertsActions[1].getAction({ + // eventId: 'event-id', + // ecsData: mockEcsDataWithAlert, + // }); + // + // wrapper = mount(alertOpenAction as React.ReactElement); + // }); + // + // afterEach(() => { + // wrapper.unmount(); + // }); + // + // test('it invokes updateAlertStatusAction when button clicked', () => { + // wrapper.find(EuiButtonIcon).simulate('click'); + // + // expect(updateAlertStatusAction).toHaveBeenCalledWith({ + // alertIds: ['event-id'], + // status: 'open', + // setEventsLoading, + // setEventsDeleted, + // onAlertStatusUpdateSuccess, + // onAlertStatusUpdateFailure, + // }); + // }); + // + // test('it displays expected text on hover', () => { + // const openAlert = wrapper.find(EuiToolTip); + // openAlert.simulate('mouseOver'); + // const tooltip = wrapper.find('.euiToolTipPopover').text(); + // + // expect(tooltip).toEqual(i18n.ACTION_OPEN_ALERT); + // }); + // + // test('it displays expected icon', () => { + // const icon = wrapper.find(EuiButtonIcon).props().iconType; + // + // expect(icon).toEqual('securityAlertDetected'); + // }); + // }); + // + // describe('alert close action', () => { + // let alertsActions: TimelineAction[]; + // let alertCloseAction: JSX.Element; + // let wrapper: ReactWrapper; + // + // beforeEach(() => { + // alertsActions = getAlertActions({ + // canUserCRUD: true, + // hasIndexWrite: true, + // setEventsLoading, + // setEventsDeleted, + // createTimeline, + // status: 'closed', + // updateTimelineIsLoading, + // onAlertStatusUpdateSuccess, + // onAlertStatusUpdateFailure, + // }); + // + // alertCloseAction = alertsActions[1].getAction({ + // eventId: 'event-id', + // ecsData: mockEcsDataWithAlert, + // }); + // + // wrapper = mount(alertCloseAction as React.ReactElement); + // }); + // + // afterEach(() => { + // wrapper.unmount(); + // }); + // + // test('it invokes updateAlertStatusAction when status button clicked', () => { + // wrapper.find(EuiButtonIcon).simulate('click'); + // + // expect(updateAlertStatusAction).toHaveBeenCalledWith({ + // alertIds: ['event-id'], + // status: 'closed', + // setEventsLoading, + // setEventsDeleted, + // onAlertStatusUpdateSuccess, + // onAlertStatusUpdateFailure, + // }); + // }); + // + // test('it displays expected text on hover', () => { + // const closeAlert = wrapper.find(EuiToolTip); + // closeAlert.simulate('mouseOver'); + // const tooltip = wrapper.find('.euiToolTipPopover').text(); + // expect(tooltip).toEqual(i18n.ACTION_CLOSE_ALERT); + // }); + // + // test('it displays expected icon', () => { + // const icon = wrapper.find(EuiButtonIcon).props().iconType; + // + // expect(icon).toEqual('securityAlertResolved'); + // }); + // }); + // }); +}); diff --git a/x-pack/plugins/siem/public/alerts/components/alerts_table/default_config.tsx b/x-pack/plugins/security_solution/public/alerts/components/alerts_table/default_config.tsx similarity index 75% rename from x-pack/plugins/siem/public/alerts/components/alerts_table/default_config.tsx rename to x-pack/plugins/security_solution/public/alerts/components/alerts_table/default_config.tsx index 6cef2e7c53c46..201c46068458b 100644 --- a/x-pack/plugins/siem/public/alerts/components/alerts_table/default_config.tsx +++ b/x-pack/plugins/security_solution/public/alerts/components/alerts_table/default_config.tsx @@ -6,14 +6,12 @@ /* eslint-disable react/display-name */ -import { EuiButtonIcon, EuiToolTip } from '@elastic/eui'; import ApolloClient from 'apollo-client'; -import React from 'react'; import { Filter } from '../../../../../../../src/plugins/data/common/es_query'; import { - TimelineAction, - TimelineActionProps, + TimelineRowAction, + TimelineRowActionOnClick, } from '../../../timelines/components/timeline/body/actions'; import { defaultColumnHeaderType } from '../../../timelines/components/timeline/body/column_headers/default_headers'; import { @@ -97,7 +95,7 @@ export const alertsHeaders: ColumnHeaderOptions[] = [ { columnHeaderType: defaultColumnHeaderType, id: '@timestamp', - width: DEFAULT_DATE_COLUMN_MIN_WIDTH, + width: DEFAULT_DATE_COLUMN_MIN_WIDTH + 5, }, { columnHeaderType: defaultColumnHeaderType, @@ -110,7 +108,7 @@ export const alertsHeaders: ColumnHeaderOptions[] = [ columnHeaderType: defaultColumnHeaderType, id: 'signal.rule.version', label: i18n.ALERTS_HEADERS_VERSION, - width: 100, + width: 95, }, { columnHeaderType: defaultColumnHeaderType, @@ -192,75 +190,59 @@ export const requiredFieldsForActions = [ export const getAlertActions = ({ apolloClient, canUserCRUD, + createTimeline, hasIndexWrite, - setEventsLoading, + onAlertStatusUpdateFailure, + onAlertStatusUpdateSuccess, setEventsDeleted, - createTimeline, + setEventsLoading, status, updateTimelineIsLoading, - onAlertStatusUpdateSuccess, - onAlertStatusUpdateFailure, }: { apolloClient?: ApolloClient<{}>; canUserCRUD: boolean; + createTimeline: CreateTimeline; hasIndexWrite: boolean; - setEventsLoading: ({ eventIds, isLoading }: SetEventsLoadingProps) => void; + onAlertStatusUpdateFailure: (status: string, error: Error) => void; + onAlertStatusUpdateSuccess: (count: number, status: string) => void; setEventsDeleted: ({ eventIds, isDeleted }: SetEventsDeletedProps) => void; - createTimeline: CreateTimeline; + setEventsLoading: ({ eventIds, isLoading }: SetEventsLoadingProps) => void; status: 'open' | 'closed'; updateTimelineIsLoading: UpdateTimelineLoading; - onAlertStatusUpdateSuccess: (count: number, status: string) => void; - onAlertStatusUpdateFailure: (status: string, error: Error) => void; -}): TimelineAction[] => [ +}): TimelineRowAction[] => [ { - getAction: ({ ecsData }: TimelineActionProps): JSX.Element => ( - - - sendAlertToTimelineAction({ - apolloClient, - createTimeline, - ecsData, - updateTimelineIsLoading, - }) - } - iconType="timeline" - aria-label="Next" - /> - - ), + ariaLabel: 'Send alert to timeline', + content: i18n.ACTION_INVESTIGATE_IN_TIMELINE, + dataTestSubj: 'send-alert-to-timeline', + displayType: 'icon', + iconType: 'timeline', id: 'sendAlertToTimeline', + onClick: ({ ecsData }: TimelineRowActionOnClick) => + sendAlertToTimelineAction({ + apolloClient, + createTimeline, + ecsData, + updateTimelineIsLoading, + }), width: 26, }, { - getAction: ({ eventId }: TimelineActionProps): JSX.Element => ( - - - updateAlertStatusAction({ - alertIds: [eventId], - status, - setEventsLoading, - setEventsDeleted, - onAlertStatusUpdateSuccess, - onAlertStatusUpdateFailure, - }) - } - isDisabled={!canUserCRUD || !hasIndexWrite} - iconType={status === FILTER_OPEN ? 'securityAlertDetected' : 'securityAlertResolved'} - aria-label="Next" - /> - - ), + ariaLabel: 'Update alert status', + content: status === FILTER_OPEN ? i18n.ACTION_OPEN_ALERT : i18n.ACTION_CLOSE_ALERT, + dataTestSubj: 'update-alert-status', + displayType: 'icon', + iconType: status === FILTER_OPEN ? 'securitySignalDetected' : 'securitySignalResolved', id: 'updateAlertStatus', + isActionDisabled: !canUserCRUD || !hasIndexWrite, + onClick: ({ eventId }: TimelineRowActionOnClick) => + updateAlertStatusAction({ + alertIds: [eventId], + onAlertStatusUpdateFailure, + onAlertStatusUpdateSuccess, + setEventsDeleted, + setEventsLoading, + status, + }), width: 26, }, ]; diff --git a/x-pack/plugins/siem/public/alerts/components/alerts_table/helpers.test.ts b/x-pack/plugins/security_solution/public/alerts/components/alerts_table/helpers.test.ts similarity index 100% rename from x-pack/plugins/siem/public/alerts/components/alerts_table/helpers.test.ts rename to x-pack/plugins/security_solution/public/alerts/components/alerts_table/helpers.test.ts diff --git a/x-pack/plugins/siem/public/alerts/components/alerts_table/helpers.ts b/x-pack/plugins/security_solution/public/alerts/components/alerts_table/helpers.ts similarity index 100% rename from x-pack/plugins/siem/public/alerts/components/alerts_table/helpers.ts rename to x-pack/plugins/security_solution/public/alerts/components/alerts_table/helpers.ts diff --git a/x-pack/plugins/siem/public/alerts/components/alerts_table/index.test.tsx b/x-pack/plugins/security_solution/public/alerts/components/alerts_table/index.test.tsx similarity index 100% rename from x-pack/plugins/siem/public/alerts/components/alerts_table/index.test.tsx rename to x-pack/plugins/security_solution/public/alerts/components/alerts_table/index.test.tsx diff --git a/x-pack/plugins/siem/public/alerts/components/alerts_table/index.tsx b/x-pack/plugins/security_solution/public/alerts/components/alerts_table/index.tsx similarity index 96% rename from x-pack/plugins/siem/public/alerts/components/alerts_table/index.tsx rename to x-pack/plugins/security_solution/public/alerts/components/alerts_table/index.tsx index 05c811d8e19bd..685e66e73ced2 100644 --- a/x-pack/plugins/siem/public/alerts/components/alerts_table/index.tsx +++ b/x-pack/plugins/security_solution/public/alerts/components/alerts_table/index.tsx @@ -20,6 +20,7 @@ import { inputsSelectors, State, inputsModel } from '../../../common/store'; import { timelineActions, timelineSelectors } from '../../../timelines/store/timeline'; import { TimelineModel } from '../../../timelines/store/timeline/model'; import { timelineDefaults } from '../../../timelines/store/timeline/defaults'; +import { useManageTimeline } from '../../../timelines/components/manage_timeline'; import { useApolloClient } from '../../../common/utils/apollo_context'; import { updateAlertStatusAction } from './actions'; @@ -291,7 +292,6 @@ export const AlertsTableComponent: React.FC = ({ onAlertStatusUpdateFailure, ] ); - const defaultIndices = useMemo(() => [signalsIndex], [signalsIndex]); const defaultFiltersMemo = useMemo(() => { if (isEmpty(defaultFilters)) { @@ -303,20 +303,25 @@ export const AlertsTableComponent: React.FC = ({ ]; } }, [defaultFilters, filterGroup]); + const { initializeTimeline, setTimelineRowActions } = useManageTimeline(); - const timelineTypeContext = useMemo( - () => ({ + useEffect(() => { + initializeTimeline({ + id: ALERTS_TABLE_TIMELINE_ID, documentType: i18n.ALERTS_DOCUMENT_TYPE, footerText: i18n.TOTAL_COUNT_OF_ALERTS, loadingText: i18n.LOADING_ALERTS, - queryFields: requiredFieldsForActions, - timelineActions: additionalActions, title: i18n.ALERTS_TABLE_TITLE, selectAll: canUserCRUD ? selectAll : false, - }), - [additionalActions, canUserCRUD, selectAll] - ); - + }); + }, []); + useEffect(() => { + setTimelineRowActions({ + id: ALERTS_TABLE_TIMELINE_ID, + queryFields: requiredFieldsForActions, + timelineRowActions: additionalActions, + }); + }, [additionalActions]); const headerFilterGroup = useMemo( () => , [onFilterGroupChangedCallback] @@ -340,7 +345,6 @@ export const AlertsTableComponent: React.FC = ({ headerFilterGroup={headerFilterGroup} id={ALERTS_TABLE_TIMELINE_ID} start={from} - timelineTypeContext={timelineTypeContext} utilityBar={utilityBarCallback} /> ); diff --git a/x-pack/plugins/siem/public/alerts/components/alerts_table/translations.ts b/x-pack/plugins/security_solution/public/alerts/components/alerts_table/translations.ts similarity index 54% rename from x-pack/plugins/siem/public/alerts/components/alerts_table/translations.ts rename to x-pack/plugins/security_solution/public/alerts/components/alerts_table/translations.ts index 4f34e9d031eed..07cc28681387d 100644 --- a/x-pack/plugins/siem/public/alerts/components/alerts_table/translations.ts +++ b/x-pack/plugins/security_solution/public/alerts/components/alerts_table/translations.ts @@ -6,122 +6,131 @@ import { i18n } from '@kbn/i18n'; -export const PAGE_TITLE = i18n.translate('xpack.siem.detectionEngine.pageTitle', { +export const PAGE_TITLE = i18n.translate('xpack.securitySolution.detectionEngine.pageTitle', { defaultMessage: 'Detection engine', }); -export const ALERTS_TABLE_TITLE = i18n.translate('xpack.siem.detectionEngine.alerts.tableTitle', { - defaultMessage: 'Alert list', -}); +export const ALERTS_TABLE_TITLE = i18n.translate( + 'xpack.securitySolution.detectionEngine.alerts.tableTitle', + { + defaultMessage: 'Alert list', + } +); export const ALERTS_DOCUMENT_TYPE = i18n.translate( - 'xpack.siem.detectionEngine.alerts.documentTypeTitle', + 'xpack.securitySolution.detectionEngine.alerts.documentTypeTitle', { defaultMessage: 'Alerts', } ); -export const OPEN_ALERTS = i18n.translate('xpack.siem.detectionEngine.alerts.openAlertsTitle', { - defaultMessage: 'Open alerts', -}); +export const OPEN_ALERTS = i18n.translate( + 'xpack.securitySolution.detectionEngine.alerts.openAlertsTitle', + { + defaultMessage: 'Open alerts', + } +); -export const CLOSED_ALERTS = i18n.translate('xpack.siem.detectionEngine.alerts.closedAlertsTitle', { - defaultMessage: 'Closed alerts', -}); +export const CLOSED_ALERTS = i18n.translate( + 'xpack.securitySolution.detectionEngine.alerts.closedAlertsTitle', + { + defaultMessage: 'Closed alerts', + } +); export const LOADING_ALERTS = i18n.translate( - 'xpack.siem.detectionEngine.alerts.loadingAlertsTitle', + 'xpack.securitySolution.detectionEngine.alerts.loadingAlertsTitle', { defaultMessage: 'Loading Alerts', } ); export const TOTAL_COUNT_OF_ALERTS = i18n.translate( - 'xpack.siem.detectionEngine.alerts.totalCountOfAlertsTitle', + 'xpack.securitySolution.detectionEngine.alerts.totalCountOfAlertsTitle', { defaultMessage: 'alerts match the search criteria', } ); export const ALERTS_HEADERS_RULE = i18n.translate( - 'xpack.siem.eventsViewer.alerts.defaultHeaders.ruleTitle', + 'xpack.securitySolution.eventsViewer.alerts.defaultHeaders.ruleTitle', { defaultMessage: 'Rule', } ); export const ALERTS_HEADERS_VERSION = i18n.translate( - 'xpack.siem.eventsViewer.alerts.defaultHeaders.versionTitle', + 'xpack.securitySolution.eventsViewer.alerts.defaultHeaders.versionTitle', { defaultMessage: 'Version', } ); export const ALERTS_HEADERS_METHOD = i18n.translate( - 'xpack.siem.eventsViewer.alerts.defaultHeaders.methodTitle', + 'xpack.securitySolution.eventsViewer.alerts.defaultHeaders.methodTitle', { defaultMessage: 'Method', } ); export const ALERTS_HEADERS_SEVERITY = i18n.translate( - 'xpack.siem.eventsViewer.alerts.defaultHeaders.severityTitle', + 'xpack.securitySolution.eventsViewer.alerts.defaultHeaders.severityTitle', { defaultMessage: 'Severity', } ); export const ALERTS_HEADERS_RISK_SCORE = i18n.translate( - 'xpack.siem.eventsViewer.alerts.defaultHeaders.riskScoreTitle', + 'xpack.securitySolution.eventsViewer.alerts.defaultHeaders.riskScoreTitle', { defaultMessage: 'Risk Score', } ); export const ACTION_OPEN_ALERT = i18n.translate( - 'xpack.siem.detectionEngine.alerts.actions.openAlertTitle', + 'xpack.securitySolution.detectionEngine.alerts.actions.openAlertTitle', { defaultMessage: 'Open alert', } ); export const ACTION_CLOSE_ALERT = i18n.translate( - 'xpack.siem.detectionEngine.alerts.actions.closeAlertTitle', + 'xpack.securitySolution.detectionEngine.alerts.actions.closeAlertTitle', { defaultMessage: 'Close alert', } ); export const ACTION_INVESTIGATE_IN_TIMELINE = i18n.translate( - 'xpack.siem.detectionEngine.alerts.actions.investigateInTimelineTitle', + 'xpack.securitySolution.detectionEngine.alerts.actions.investigateInTimelineTitle', { defaultMessage: 'Investigate in timeline', } ); export const CLOSED_ALERT_SUCCESS_TOAST = (totalAlerts: number) => - i18n.translate('xpack.siem.detectionEngine.alerts.closedAlertSuccessToastMessage', { + i18n.translate('xpack.securitySolution.detectionEngine.alerts.closedAlertSuccessToastMessage', { values: { totalAlerts }, defaultMessage: 'Successfully closed {totalAlerts} {totalAlerts, plural, =1 {alert} other {alerts}}.', }); export const OPENED_ALERT_SUCCESS_TOAST = (totalAlerts: number) => - i18n.translate('xpack.siem.detectionEngine.alerts.openedAlertSuccessToastMessage', { + i18n.translate('xpack.securitySolution.detectionEngine.alerts.openedAlertSuccessToastMessage', { values: { totalAlerts }, defaultMessage: 'Successfully opened {totalAlerts} {totalAlerts, plural, =1 {alert} other {alerts}}.', }); export const CLOSED_ALERT_FAILED_TOAST = i18n.translate( - 'xpack.siem.detectionEngine.alerts.closedAlertFailedToastMessage', + 'xpack.securitySolution.detectionEngine.alerts.closedAlertFailedToastMessage', { defaultMessage: 'Failed to close alert(s).', } ); export const OPENED_ALERT_FAILED_TOAST = i18n.translate( - 'xpack.siem.detectionEngine.alerts.openedAlertFailedToastMessage', + 'xpack.securitySolution.detectionEngine.alerts.openedAlertFailedToastMessage', { defaultMessage: 'Failed to open alert(s)', } diff --git a/x-pack/plugins/siem/public/alerts/components/alerts_table/types.ts b/x-pack/plugins/security_solution/public/alerts/components/alerts_table/types.ts similarity index 100% rename from x-pack/plugins/siem/public/alerts/components/alerts_table/types.ts rename to x-pack/plugins/security_solution/public/alerts/components/alerts_table/types.ts diff --git a/x-pack/plugins/siem/public/alerts/components/detection_engine_header_page/index.test.tsx b/x-pack/plugins/security_solution/public/alerts/components/detection_engine_header_page/index.test.tsx similarity index 100% rename from x-pack/plugins/siem/public/alerts/components/detection_engine_header_page/index.test.tsx rename to x-pack/plugins/security_solution/public/alerts/components/detection_engine_header_page/index.test.tsx diff --git a/x-pack/plugins/siem/public/alerts/components/detection_engine_header_page/index.tsx b/x-pack/plugins/security_solution/public/alerts/components/detection_engine_header_page/index.tsx similarity index 100% rename from x-pack/plugins/siem/public/alerts/components/detection_engine_header_page/index.tsx rename to x-pack/plugins/security_solution/public/alerts/components/detection_engine_header_page/index.tsx diff --git a/x-pack/plugins/siem/public/alerts/components/detection_engine_header_page/translations.ts b/x-pack/plugins/security_solution/public/alerts/components/detection_engine_header_page/translations.ts similarity index 79% rename from x-pack/plugins/siem/public/alerts/components/detection_engine_header_page/translations.ts rename to x-pack/plugins/security_solution/public/alerts/components/detection_engine_header_page/translations.ts index 651faf0b17318..f59be16923805 100644 --- a/x-pack/plugins/siem/public/alerts/components/detection_engine_header_page/translations.ts +++ b/x-pack/plugins/security_solution/public/alerts/components/detection_engine_header_page/translations.ts @@ -7,14 +7,14 @@ import { i18n } from '@kbn/i18n'; export const PAGE_BADGE_LABEL = i18n.translate( - 'xpack.siem.detectionEngine.headerPage.pageBadgeLabel', + 'xpack.securitySolution.detectionEngine.headerPage.pageBadgeLabel', { defaultMessage: 'Beta', } ); export const PAGE_BADGE_TOOLTIP = i18n.translate( - 'xpack.siem.detectionEngine.headerPage.pageBadgeTooltip', + 'xpack.securitySolution.detectionEngine.headerPage.pageBadgeTooltip', { defaultMessage: 'Alerts is still in beta. Please help us improve by reporting issues or bugs in the Kibana repo.', diff --git a/x-pack/plugins/siem/public/alerts/components/no_api_integration_callout/index.test.tsx b/x-pack/plugins/security_solution/public/alerts/components/no_api_integration_callout/index.test.tsx similarity index 100% rename from x-pack/plugins/siem/public/alerts/components/no_api_integration_callout/index.test.tsx rename to x-pack/plugins/security_solution/public/alerts/components/no_api_integration_callout/index.test.tsx diff --git a/x-pack/plugins/siem/public/alerts/components/no_api_integration_callout/index.tsx b/x-pack/plugins/security_solution/public/alerts/components/no_api_integration_callout/index.tsx similarity index 100% rename from x-pack/plugins/siem/public/alerts/components/no_api_integration_callout/index.tsx rename to x-pack/plugins/security_solution/public/alerts/components/no_api_integration_callout/index.tsx diff --git a/x-pack/plugins/siem/public/alerts/components/no_api_integration_callout/translations.ts b/x-pack/plugins/security_solution/public/alerts/components/no_api_integration_callout/translations.ts similarity index 80% rename from x-pack/plugins/siem/public/alerts/components/no_api_integration_callout/translations.ts rename to x-pack/plugins/security_solution/public/alerts/components/no_api_integration_callout/translations.ts index 84804af8840f9..bc08a13c8b5d1 100644 --- a/x-pack/plugins/siem/public/alerts/components/no_api_integration_callout/translations.ts +++ b/x-pack/plugins/security_solution/public/alerts/components/no_api_integration_callout/translations.ts @@ -7,21 +7,21 @@ import { i18n } from '@kbn/i18n'; export const NO_API_INTEGRATION_KEY_CALLOUT_TITLE = i18n.translate( - 'xpack.siem.detectionEngine.noApiIntegrationKeyCallOutTitle', + 'xpack.securitySolution.detectionEngine.noApiIntegrationKeyCallOutTitle', { defaultMessage: 'API integration key required', } ); export const NO_API_INTEGRATION_KEY_CALLOUT_MSG = i18n.translate( - 'xpack.siem.detectionEngine.noApiIntegrationKeyCallOutMsg', + 'xpack.securitySolution.detectionEngine.noApiIntegrationKeyCallOutMsg', { defaultMessage: `A new encryption key is generated for saved objects each time you start Kibana. Without a persistent key, you cannot delete or modify rules after Kibana restarts. To set a persistent key, add the xpack.encryptedSavedObjects.encryptionKey setting with any text value of 32 or more characters to the kibana.yml file.`, } ); export const DISMISS_CALLOUT = i18n.translate( - 'xpack.siem.detectionEngine.dismissNoApiIntegrationKeyButton', + 'xpack.securitySolution.detectionEngine.dismissNoApiIntegrationKeyButton', { defaultMessage: 'Dismiss', } diff --git a/x-pack/plugins/siem/public/alerts/components/no_write_alerts_callout/index.test.tsx b/x-pack/plugins/security_solution/public/alerts/components/no_write_alerts_callout/index.test.tsx similarity index 100% rename from x-pack/plugins/siem/public/alerts/components/no_write_alerts_callout/index.test.tsx rename to x-pack/plugins/security_solution/public/alerts/components/no_write_alerts_callout/index.test.tsx diff --git a/x-pack/plugins/siem/public/alerts/components/no_write_alerts_callout/index.tsx b/x-pack/plugins/security_solution/public/alerts/components/no_write_alerts_callout/index.tsx similarity index 100% rename from x-pack/plugins/siem/public/alerts/components/no_write_alerts_callout/index.tsx rename to x-pack/plugins/security_solution/public/alerts/components/no_write_alerts_callout/index.tsx diff --git a/x-pack/plugins/siem/public/alerts/components/no_write_alerts_callout/translations.ts b/x-pack/plugins/security_solution/public/alerts/components/no_write_alerts_callout/translations.ts similarity index 77% rename from x-pack/plugins/siem/public/alerts/components/no_write_alerts_callout/translations.ts rename to x-pack/plugins/security_solution/public/alerts/components/no_write_alerts_callout/translations.ts index f79ede56ef9ae..d036c422b2fb9 100644 --- a/x-pack/plugins/siem/public/alerts/components/no_write_alerts_callout/translations.ts +++ b/x-pack/plugins/security_solution/public/alerts/components/no_write_alerts_callout/translations.ts @@ -7,14 +7,14 @@ import { i18n } from '@kbn/i18n'; export const NO_WRITE_ALERTS_CALLOUT_TITLE = i18n.translate( - 'xpack.siem.detectionEngine.noWriteAlertsCallOutTitle', + 'xpack.securitySolution.detectionEngine.noWriteAlertsCallOutTitle', { defaultMessage: 'Alerts index permissions required', } ); export const NO_WRITE_ALERTS_CALLOUT_MSG = i18n.translate( - 'xpack.siem.detectionEngine.noWriteAlertsCallOutMsg', + 'xpack.securitySolution.detectionEngine.noWriteAlertsCallOutMsg', { defaultMessage: 'You are currently missing the required permissions to update alerts. Please contact your administrator for further assistance.', @@ -22,7 +22,7 @@ export const NO_WRITE_ALERTS_CALLOUT_MSG = i18n.translate( ); export const DISMISS_CALLOUT = i18n.translate( - 'xpack.siem.detectionEngine.dismissNoWriteAlertButton', + 'xpack.securitySolution.detectionEngine.dismissNoWriteAlertButton', { defaultMessage: 'Dismiss', } diff --git a/x-pack/plugins/siem/public/alerts/components/rules/accordion_title/index.test.tsx b/x-pack/plugins/security_solution/public/alerts/components/rules/accordion_title/index.test.tsx similarity index 100% rename from x-pack/plugins/siem/public/alerts/components/rules/accordion_title/index.test.tsx rename to x-pack/plugins/security_solution/public/alerts/components/rules/accordion_title/index.test.tsx diff --git a/x-pack/plugins/siem/public/alerts/components/rules/accordion_title/index.tsx b/x-pack/plugins/security_solution/public/alerts/components/rules/accordion_title/index.tsx similarity index 100% rename from x-pack/plugins/siem/public/alerts/components/rules/accordion_title/index.tsx rename to x-pack/plugins/security_solution/public/alerts/components/rules/accordion_title/index.tsx diff --git a/x-pack/plugins/siem/public/alerts/components/rules/add_item_form/index.test.tsx b/x-pack/plugins/security_solution/public/alerts/components/rules/add_item_form/index.test.tsx similarity index 100% rename from x-pack/plugins/siem/public/alerts/components/rules/add_item_form/index.test.tsx rename to x-pack/plugins/security_solution/public/alerts/components/rules/add_item_form/index.test.tsx diff --git a/x-pack/plugins/siem/public/alerts/components/rules/add_item_form/index.tsx b/x-pack/plugins/security_solution/public/alerts/components/rules/add_item_form/index.tsx similarity index 100% rename from x-pack/plugins/siem/public/alerts/components/rules/add_item_form/index.tsx rename to x-pack/plugins/security_solution/public/alerts/components/rules/add_item_form/index.tsx diff --git a/x-pack/plugins/siem/public/alerts/components/rules/all_rules_tables/index.test.tsx b/x-pack/plugins/security_solution/public/alerts/components/rules/all_rules_tables/index.test.tsx similarity index 100% rename from x-pack/plugins/siem/public/alerts/components/rules/all_rules_tables/index.test.tsx rename to x-pack/plugins/security_solution/public/alerts/components/rules/all_rules_tables/index.test.tsx diff --git a/x-pack/plugins/siem/public/alerts/components/rules/all_rules_tables/index.tsx b/x-pack/plugins/security_solution/public/alerts/components/rules/all_rules_tables/index.tsx similarity index 100% rename from x-pack/plugins/siem/public/alerts/components/rules/all_rules_tables/index.tsx rename to x-pack/plugins/security_solution/public/alerts/components/rules/all_rules_tables/index.tsx diff --git a/x-pack/plugins/siem/public/alerts/components/rules/anomaly_threshold_slider/index.test.tsx b/x-pack/plugins/security_solution/public/alerts/components/rules/anomaly_threshold_slider/index.test.tsx similarity index 100% rename from x-pack/plugins/siem/public/alerts/components/rules/anomaly_threshold_slider/index.test.tsx rename to x-pack/plugins/security_solution/public/alerts/components/rules/anomaly_threshold_slider/index.test.tsx diff --git a/x-pack/plugins/siem/public/alerts/components/rules/anomaly_threshold_slider/index.tsx b/x-pack/plugins/security_solution/public/alerts/components/rules/anomaly_threshold_slider/index.tsx similarity index 100% rename from x-pack/plugins/siem/public/alerts/components/rules/anomaly_threshold_slider/index.tsx rename to x-pack/plugins/security_solution/public/alerts/components/rules/anomaly_threshold_slider/index.tsx diff --git a/x-pack/plugins/siem/public/alerts/components/rules/description_step/__snapshots__/index.test.tsx.snap b/x-pack/plugins/security_solution/public/alerts/components/rules/description_step/__snapshots__/index.test.tsx.snap similarity index 100% rename from x-pack/plugins/siem/public/alerts/components/rules/description_step/__snapshots__/index.test.tsx.snap rename to x-pack/plugins/security_solution/public/alerts/components/rules/description_step/__snapshots__/index.test.tsx.snap diff --git a/x-pack/plugins/siem/public/alerts/components/rules/description_step/actions_description.tsx b/x-pack/plugins/security_solution/public/alerts/components/rules/description_step/actions_description.tsx similarity index 100% rename from x-pack/plugins/siem/public/alerts/components/rules/description_step/actions_description.tsx rename to x-pack/plugins/security_solution/public/alerts/components/rules/description_step/actions_description.tsx diff --git a/x-pack/plugins/siem/public/alerts/components/rules/description_step/assets/list_tree_icon.svg b/x-pack/plugins/security_solution/public/alerts/components/rules/description_step/assets/list_tree_icon.svg similarity index 100% rename from x-pack/plugins/siem/public/alerts/components/rules/description_step/assets/list_tree_icon.svg rename to x-pack/plugins/security_solution/public/alerts/components/rules/description_step/assets/list_tree_icon.svg diff --git a/x-pack/plugins/siem/public/alerts/components/rules/description_step/helpers.test.tsx b/x-pack/plugins/security_solution/public/alerts/components/rules/description_step/helpers.test.tsx similarity index 100% rename from x-pack/plugins/siem/public/alerts/components/rules/description_step/helpers.test.tsx rename to x-pack/plugins/security_solution/public/alerts/components/rules/description_step/helpers.test.tsx diff --git a/x-pack/plugins/siem/public/alerts/components/rules/description_step/helpers.tsx b/x-pack/plugins/security_solution/public/alerts/components/rules/description_step/helpers.tsx similarity index 100% rename from x-pack/plugins/siem/public/alerts/components/rules/description_step/helpers.tsx rename to x-pack/plugins/security_solution/public/alerts/components/rules/description_step/helpers.tsx diff --git a/x-pack/plugins/siem/public/alerts/components/rules/description_step/index.test.tsx b/x-pack/plugins/security_solution/public/alerts/components/rules/description_step/index.test.tsx similarity index 100% rename from x-pack/plugins/siem/public/alerts/components/rules/description_step/index.test.tsx rename to x-pack/plugins/security_solution/public/alerts/components/rules/description_step/index.test.tsx diff --git a/x-pack/plugins/siem/public/alerts/components/rules/description_step/index.tsx b/x-pack/plugins/security_solution/public/alerts/components/rules/description_step/index.tsx similarity index 100% rename from x-pack/plugins/siem/public/alerts/components/rules/description_step/index.tsx rename to x-pack/plugins/security_solution/public/alerts/components/rules/description_step/index.tsx diff --git a/x-pack/plugins/siem/public/alerts/components/rules/description_step/ml_job_description.test.tsx b/x-pack/plugins/security_solution/public/alerts/components/rules/description_step/ml_job_description.test.tsx similarity index 100% rename from x-pack/plugins/siem/public/alerts/components/rules/description_step/ml_job_description.test.tsx rename to x-pack/plugins/security_solution/public/alerts/components/rules/description_step/ml_job_description.test.tsx diff --git a/x-pack/plugins/siem/public/alerts/components/rules/description_step/ml_job_description.tsx b/x-pack/plugins/security_solution/public/alerts/components/rules/description_step/ml_job_description.tsx similarity index 100% rename from x-pack/plugins/siem/public/alerts/components/rules/description_step/ml_job_description.tsx rename to x-pack/plugins/security_solution/public/alerts/components/rules/description_step/ml_job_description.tsx diff --git a/x-pack/plugins/siem/public/alerts/components/rules/description_step/throttle_description.tsx b/x-pack/plugins/security_solution/public/alerts/components/rules/description_step/throttle_description.tsx similarity index 100% rename from x-pack/plugins/siem/public/alerts/components/rules/description_step/throttle_description.tsx rename to x-pack/plugins/security_solution/public/alerts/components/rules/description_step/throttle_description.tsx diff --git a/x-pack/plugins/security_solution/public/alerts/components/rules/description_step/translations.tsx b/x-pack/plugins/security_solution/public/alerts/components/rules/description_step/translations.tsx new file mode 100644 index 0000000000000..3e639ede7a18b --- /dev/null +++ b/x-pack/plugins/security_solution/public/alerts/components/rules/description_step/translations.tsx @@ -0,0 +1,56 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + +import { i18n } from '@kbn/i18n'; + +export const FILTERS_LABEL = i18n.translate( + 'xpack.securitySolution.detectionEngine.createRule.filtersLabel', + { + defaultMessage: 'Filters', + } +); + +export const QUERY_LABEL = i18n.translate( + 'xpack.securitySolution.detectionEngine.createRule.QueryLabel', + { + defaultMessage: 'Custom query', + } +); + +export const SAVED_ID_LABEL = i18n.translate( + 'xpack.securitySolution.detectionEngine.createRule.savedIdLabel', + { + defaultMessage: 'Saved query name', + } +); + +export const ML_TYPE_DESCRIPTION = i18n.translate( + 'xpack.securitySolution.detectionEngine.createRule.mlRuleTypeDescription', + { + defaultMessage: 'Machine Learning', + } +); + +export const QUERY_TYPE_DESCRIPTION = i18n.translate( + 'xpack.securitySolution.detectionEngine.createRule.queryRuleTypeDescription', + { + defaultMessage: 'Query', + } +); + +export const ML_JOB_STARTED = i18n.translate( + 'xpack.securitySolution.detectionEngine.ruleDescription.mlJobStartedDescription', + { + defaultMessage: 'Started', + } +); + +export const ML_JOB_STOPPED = i18n.translate( + 'xpack.securitySolution.detectionEngine.ruleDescription.mlJobStoppedDescription', + { + defaultMessage: 'Stopped', + } +); diff --git a/x-pack/plugins/siem/public/alerts/components/rules/description_step/types.ts b/x-pack/plugins/security_solution/public/alerts/components/rules/description_step/types.ts similarity index 100% rename from x-pack/plugins/siem/public/alerts/components/rules/description_step/types.ts rename to x-pack/plugins/security_solution/public/alerts/components/rules/description_step/types.ts diff --git a/x-pack/plugins/siem/public/alerts/components/rules/mitre/helpers.test.tsx b/x-pack/plugins/security_solution/public/alerts/components/rules/mitre/helpers.test.tsx similarity index 100% rename from x-pack/plugins/siem/public/alerts/components/rules/mitre/helpers.test.tsx rename to x-pack/plugins/security_solution/public/alerts/components/rules/mitre/helpers.test.tsx diff --git a/x-pack/plugins/siem/public/alerts/components/rules/mitre/helpers.ts b/x-pack/plugins/security_solution/public/alerts/components/rules/mitre/helpers.ts similarity index 100% rename from x-pack/plugins/siem/public/alerts/components/rules/mitre/helpers.ts rename to x-pack/plugins/security_solution/public/alerts/components/rules/mitre/helpers.ts diff --git a/x-pack/plugins/siem/public/alerts/components/rules/mitre/index.test.tsx b/x-pack/plugins/security_solution/public/alerts/components/rules/mitre/index.test.tsx similarity index 100% rename from x-pack/plugins/siem/public/alerts/components/rules/mitre/index.test.tsx rename to x-pack/plugins/security_solution/public/alerts/components/rules/mitre/index.test.tsx diff --git a/x-pack/plugins/siem/public/alerts/components/rules/mitre/index.tsx b/x-pack/plugins/security_solution/public/alerts/components/rules/mitre/index.tsx similarity index 100% rename from x-pack/plugins/siem/public/alerts/components/rules/mitre/index.tsx rename to x-pack/plugins/security_solution/public/alerts/components/rules/mitre/index.tsx diff --git a/x-pack/plugins/security_solution/public/alerts/components/rules/mitre/translations.ts b/x-pack/plugins/security_solution/public/alerts/components/rules/mitre/translations.ts new file mode 100644 index 0000000000000..704f950cfb4b9 --- /dev/null +++ b/x-pack/plugins/security_solution/public/alerts/components/rules/mitre/translations.ts @@ -0,0 +1,42 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + +import { i18n } from '@kbn/i18n'; + +export const TACTIC = i18n.translate( + 'xpack.securitySolution.detectionEngine.mitreAttack.tacticsDescription', + { + defaultMessage: 'tactic', + } +); + +export const TECHNIQUE = i18n.translate( + 'xpack.securitySolution.detectionEngine.mitreAttack.techniquesDescription', + { + defaultMessage: 'techniques', + } +); + +export const ADD_MITRE_ATTACK = i18n.translate( + 'xpack.securitySolution.detectionEngine.mitreAttack.addTitle', + { + defaultMessage: 'Add MITRE ATT&CK\\u2122 threat', + } +); + +export const TECHNIQUES_PLACEHOLDER = i18n.translate( + 'xpack.securitySolution.detectionEngine.mitreAttack.techniquesPlaceHolderDescription', + { + defaultMessage: 'Select techniques ...', + } +); + +export const TACTIC_PLACEHOLDER = i18n.translate( + 'xpack.securitySolution.detectionEngine.mitreAttack.tacticPlaceHolderDescription', + { + defaultMessage: 'Select tactic ...', + } +); diff --git a/x-pack/plugins/siem/public/alerts/components/rules/ml_job_select/index.test.tsx b/x-pack/plugins/security_solution/public/alerts/components/rules/ml_job_select/index.test.tsx similarity index 100% rename from x-pack/plugins/siem/public/alerts/components/rules/ml_job_select/index.test.tsx rename to x-pack/plugins/security_solution/public/alerts/components/rules/ml_job_select/index.test.tsx diff --git a/x-pack/plugins/siem/public/alerts/components/rules/ml_job_select/index.tsx b/x-pack/plugins/security_solution/public/alerts/components/rules/ml_job_select/index.tsx similarity index 95% rename from x-pack/plugins/siem/public/alerts/components/rules/ml_job_select/index.tsx rename to x-pack/plugins/security_solution/public/alerts/components/rules/ml_job_select/index.tsx index 0d88242178225..cb084d4daa782 100644 --- a/x-pack/plugins/siem/public/alerts/components/rules/ml_job_select/index.tsx +++ b/x-pack/plugins/security_solution/public/alerts/components/rules/ml_job_select/index.tsx @@ -40,13 +40,13 @@ const HelpText: React.FC<{ href: string; showEnableWarning: boolean }> = ({ }) => ( <> diff --git a/x-pack/plugins/siem/public/alerts/components/rules/next_step/__snapshots__/index.test.tsx.snap b/x-pack/plugins/security_solution/public/alerts/components/rules/next_step/__snapshots__/index.test.tsx.snap similarity index 100% rename from x-pack/plugins/siem/public/alerts/components/rules/next_step/__snapshots__/index.test.tsx.snap rename to x-pack/plugins/security_solution/public/alerts/components/rules/next_step/__snapshots__/index.test.tsx.snap diff --git a/x-pack/plugins/siem/public/alerts/components/rules/next_step/index.test.tsx b/x-pack/plugins/security_solution/public/alerts/components/rules/next_step/index.test.tsx similarity index 100% rename from x-pack/plugins/siem/public/alerts/components/rules/next_step/index.test.tsx rename to x-pack/plugins/security_solution/public/alerts/components/rules/next_step/index.test.tsx diff --git a/x-pack/plugins/siem/public/alerts/components/rules/next_step/index.tsx b/x-pack/plugins/security_solution/public/alerts/components/rules/next_step/index.tsx similarity index 100% rename from x-pack/plugins/siem/public/alerts/components/rules/next_step/index.tsx rename to x-pack/plugins/security_solution/public/alerts/components/rules/next_step/index.tsx diff --git a/x-pack/plugins/siem/public/alerts/components/rules/optional_field_label/index.test.tsx b/x-pack/plugins/security_solution/public/alerts/components/rules/optional_field_label/index.test.tsx similarity index 100% rename from x-pack/plugins/siem/public/alerts/components/rules/optional_field_label/index.test.tsx rename to x-pack/plugins/security_solution/public/alerts/components/rules/optional_field_label/index.test.tsx diff --git a/x-pack/plugins/siem/public/alerts/components/rules/optional_field_label/index.tsx b/x-pack/plugins/security_solution/public/alerts/components/rules/optional_field_label/index.tsx similarity index 100% rename from x-pack/plugins/siem/public/alerts/components/rules/optional_field_label/index.tsx rename to x-pack/plugins/security_solution/public/alerts/components/rules/optional_field_label/index.tsx diff --git a/x-pack/plugins/siem/public/alerts/components/rules/pick_timeline/index.test.tsx b/x-pack/plugins/security_solution/public/alerts/components/rules/pick_timeline/index.test.tsx similarity index 100% rename from x-pack/plugins/siem/public/alerts/components/rules/pick_timeline/index.test.tsx rename to x-pack/plugins/security_solution/public/alerts/components/rules/pick_timeline/index.test.tsx diff --git a/x-pack/plugins/siem/public/alerts/components/rules/pick_timeline/index.tsx b/x-pack/plugins/security_solution/public/alerts/components/rules/pick_timeline/index.tsx similarity index 100% rename from x-pack/plugins/siem/public/alerts/components/rules/pick_timeline/index.tsx rename to x-pack/plugins/security_solution/public/alerts/components/rules/pick_timeline/index.tsx diff --git a/x-pack/plugins/siem/public/alerts/components/rules/pre_packaged_rules/load_empty_prompt.test.tsx b/x-pack/plugins/security_solution/public/alerts/components/rules/pre_packaged_rules/load_empty_prompt.test.tsx similarity index 100% rename from x-pack/plugins/siem/public/alerts/components/rules/pre_packaged_rules/load_empty_prompt.test.tsx rename to x-pack/plugins/security_solution/public/alerts/components/rules/pre_packaged_rules/load_empty_prompt.test.tsx diff --git a/x-pack/plugins/siem/public/alerts/components/rules/pre_packaged_rules/load_empty_prompt.tsx b/x-pack/plugins/security_solution/public/alerts/components/rules/pre_packaged_rules/load_empty_prompt.tsx similarity index 100% rename from x-pack/plugins/siem/public/alerts/components/rules/pre_packaged_rules/load_empty_prompt.tsx rename to x-pack/plugins/security_solution/public/alerts/components/rules/pre_packaged_rules/load_empty_prompt.tsx diff --git a/x-pack/plugins/siem/public/alerts/components/rules/pre_packaged_rules/translations.ts b/x-pack/plugins/security_solution/public/alerts/components/rules/pre_packaged_rules/translations.ts similarity index 71% rename from x-pack/plugins/siem/public/alerts/components/rules/pre_packaged_rules/translations.ts rename to x-pack/plugins/security_solution/public/alerts/components/rules/pre_packaged_rules/translations.ts index 9b36d96cef9ca..b43ef8c615003 100644 --- a/x-pack/plugins/siem/public/alerts/components/rules/pre_packaged_rules/translations.ts +++ b/x-pack/plugins/security_solution/public/alerts/components/rules/pre_packaged_rules/translations.ts @@ -7,14 +7,14 @@ import { i18n } from '@kbn/i18n'; export const PRE_BUILT_TITLE = i18n.translate( - 'xpack.siem.detectionEngine.rules.prePackagedRules.emptyPromptTitle', + 'xpack.securitySolution.detectionEngine.rules.prePackagedRules.emptyPromptTitle', { defaultMessage: 'Load Elastic prebuilt detection rules', } ); export const PRE_BUILT_MSG = i18n.translate( - 'xpack.siem.detectionEngine.rules.prePackagedRules.emptyPromptMessage', + 'xpack.securitySolution.detectionEngine.rules.prePackagedRules.emptyPromptMessage', { defaultMessage: 'Elastic SIEM comes with prebuilt detection rules that run in the background and create alerts when their conditions are met. By default, all prebuilt rules are disabled and you select which rules you want to activate.', @@ -22,42 +22,42 @@ export const PRE_BUILT_MSG = i18n.translate( ); export const PRE_BUILT_ACTION = i18n.translate( - 'xpack.siem.detectionEngine.rules.prePackagedRules.loadPreBuiltButton', + 'xpack.securitySolution.detectionEngine.rules.prePackagedRules.loadPreBuiltButton', { defaultMessage: 'Load prebuilt detection rules', } ); export const CREATE_RULE_ACTION = i18n.translate( - 'xpack.siem.detectionEngine.rules.prePackagedRules.createOwnRuletButton', + 'xpack.securitySolution.detectionEngine.rules.prePackagedRules.createOwnRuletButton', { defaultMessage: 'Create your own rules', } ); export const UPDATE_PREPACKAGED_RULES_TITLE = i18n.translate( - 'xpack.siem.detectionEngine.rules.updatePrePackagedRulesTitle', + 'xpack.securitySolution.detectionEngine.rules.updatePrePackagedRulesTitle', { defaultMessage: 'Update available for Elastic prebuilt rules', } ); export const UPDATE_PREPACKAGED_RULES_MSG = (updateRules: number) => - i18n.translate('xpack.siem.detectionEngine.rules.updatePrePackagedRulesMsg', { + i18n.translate('xpack.securitySolution.detectionEngine.rules.updatePrePackagedRulesMsg', { values: { updateRules }, defaultMessage: 'You can update {updateRules} Elastic prebuilt {updateRules, plural, =1 {rule} other {rules}}. Note that this will reload deleted Elastic prebuilt rules.', }); export const UPDATE_PREPACKAGED_RULES = (updateRules: number) => - i18n.translate('xpack.siem.detectionEngine.rules.updatePrePackagedRulesButton', { + i18n.translate('xpack.securitySolution.detectionEngine.rules.updatePrePackagedRulesButton', { values: { updateRules }, defaultMessage: 'Update {updateRules} Elastic prebuilt {updateRules, plural, =1 {rule} other {rules}} ', }); export const RELEASE_NOTES_HELP = i18n.translate( - 'xpack.siem.detectionEngine.rules.releaseNotesHelp', + 'xpack.securitySolution.detectionEngine.rules.releaseNotesHelp', { defaultMessage: 'Release notes', } diff --git a/x-pack/plugins/siem/public/alerts/components/rules/pre_packaged_rules/update_callout.test.tsx b/x-pack/plugins/security_solution/public/alerts/components/rules/pre_packaged_rules/update_callout.test.tsx similarity index 100% rename from x-pack/plugins/siem/public/alerts/components/rules/pre_packaged_rules/update_callout.test.tsx rename to x-pack/plugins/security_solution/public/alerts/components/rules/pre_packaged_rules/update_callout.test.tsx diff --git a/x-pack/plugins/siem/public/alerts/components/rules/pre_packaged_rules/update_callout.tsx b/x-pack/plugins/security_solution/public/alerts/components/rules/pre_packaged_rules/update_callout.tsx similarity index 100% rename from x-pack/plugins/siem/public/alerts/components/rules/pre_packaged_rules/update_callout.tsx rename to x-pack/plugins/security_solution/public/alerts/components/rules/pre_packaged_rules/update_callout.tsx diff --git a/x-pack/plugins/siem/public/alerts/components/rules/query_bar/index.test.tsx b/x-pack/plugins/security_solution/public/alerts/components/rules/query_bar/index.test.tsx similarity index 100% rename from x-pack/plugins/siem/public/alerts/components/rules/query_bar/index.test.tsx rename to x-pack/plugins/security_solution/public/alerts/components/rules/query_bar/index.test.tsx diff --git a/x-pack/plugins/siem/public/alerts/components/rules/query_bar/index.tsx b/x-pack/plugins/security_solution/public/alerts/components/rules/query_bar/index.tsx similarity index 100% rename from x-pack/plugins/siem/public/alerts/components/rules/query_bar/index.tsx rename to x-pack/plugins/security_solution/public/alerts/components/rules/query_bar/index.tsx diff --git a/x-pack/plugins/siem/public/alerts/components/rules/query_bar/translations.tsx b/x-pack/plugins/security_solution/public/alerts/components/rules/query_bar/translations.tsx similarity index 80% rename from x-pack/plugins/siem/public/alerts/components/rules/query_bar/translations.tsx rename to x-pack/plugins/security_solution/public/alerts/components/rules/query_bar/translations.tsx index 9b14e4f8599da..756b0c05f435a 100644 --- a/x-pack/plugins/siem/public/alerts/components/rules/query_bar/translations.tsx +++ b/x-pack/plugins/security_solution/public/alerts/components/rules/query_bar/translations.tsx @@ -7,7 +7,7 @@ import { i18n } from '@kbn/i18n'; export const IMPORT_TIMELINE_MODAL = i18n.translate( - 'xpack.siem.detectionEngine.createRule.stepDefineRule.importTimelineModalTitle', + 'xpack.securitySolution.detectionEngine.createRule.stepDefineRule.importTimelineModalTitle', { defaultMessage: 'Import query from saved timeline', } diff --git a/x-pack/plugins/siem/public/alerts/components/rules/read_only_callout/index.test.tsx b/x-pack/plugins/security_solution/public/alerts/components/rules/read_only_callout/index.test.tsx similarity index 100% rename from x-pack/plugins/siem/public/alerts/components/rules/read_only_callout/index.test.tsx rename to x-pack/plugins/security_solution/public/alerts/components/rules/read_only_callout/index.test.tsx diff --git a/x-pack/plugins/siem/public/alerts/components/rules/read_only_callout/index.tsx b/x-pack/plugins/security_solution/public/alerts/components/rules/read_only_callout/index.tsx similarity index 100% rename from x-pack/plugins/siem/public/alerts/components/rules/read_only_callout/index.tsx rename to x-pack/plugins/security_solution/public/alerts/components/rules/read_only_callout/index.tsx diff --git a/x-pack/plugins/siem/public/alerts/components/rules/read_only_callout/translations.ts b/x-pack/plugins/security_solution/public/alerts/components/rules/read_only_callout/translations.ts similarity index 69% rename from x-pack/plugins/siem/public/alerts/components/rules/read_only_callout/translations.ts rename to x-pack/plugins/security_solution/public/alerts/components/rules/read_only_callout/translations.ts index c3429f4365031..26b6bb83a145d 100644 --- a/x-pack/plugins/siem/public/alerts/components/rules/read_only_callout/translations.ts +++ b/x-pack/plugins/security_solution/public/alerts/components/rules/read_only_callout/translations.ts @@ -7,20 +7,23 @@ import { i18n } from '@kbn/i18n'; export const READ_ONLY_CALLOUT_TITLE = i18n.translate( - 'xpack.siem.detectionEngine.readOnlyCallOutTitle', + 'xpack.securitySolution.detectionEngine.readOnlyCallOutTitle', { defaultMessage: 'Rule permissions required', } ); export const READ_ONLY_CALLOUT_MSG = i18n.translate( - 'xpack.siem.detectionEngine.readOnlyCallOutMsg', + 'xpack.securitySolution.detectionEngine.readOnlyCallOutMsg', { defaultMessage: 'You are currently missing the required permissions to create/edit detection engine rule. Please contact your administrator for further assistance.', } ); -export const DISMISS_CALLOUT = i18n.translate('xpack.siem.detectionEngine.dismissButton', { - defaultMessage: 'Dismiss', -}); +export const DISMISS_CALLOUT = i18n.translate( + 'xpack.securitySolution.detectionEngine.dismissButton', + { + defaultMessage: 'Dismiss', + } +); diff --git a/x-pack/plugins/siem/public/alerts/components/rules/rule_actions_field/index.test.tsx b/x-pack/plugins/security_solution/public/alerts/components/rules/rule_actions_field/index.test.tsx similarity index 100% rename from x-pack/plugins/siem/public/alerts/components/rules/rule_actions_field/index.test.tsx rename to x-pack/plugins/security_solution/public/alerts/components/rules/rule_actions_field/index.test.tsx diff --git a/x-pack/plugins/siem/public/alerts/components/rules/rule_actions_field/index.tsx b/x-pack/plugins/security_solution/public/alerts/components/rules/rule_actions_field/index.tsx similarity index 100% rename from x-pack/plugins/siem/public/alerts/components/rules/rule_actions_field/index.tsx rename to x-pack/plugins/security_solution/public/alerts/components/rules/rule_actions_field/index.tsx diff --git a/x-pack/plugins/siem/public/alerts/components/rules/rule_actions_field/translations.tsx b/x-pack/plugins/security_solution/public/alerts/components/rules/rule_actions_field/translations.tsx similarity index 79% rename from x-pack/plugins/siem/public/alerts/components/rules/rule_actions_field/translations.tsx rename to x-pack/plugins/security_solution/public/alerts/components/rules/rule_actions_field/translations.tsx index 8bf8e39685dfd..8e467307cb6da 100644 --- a/x-pack/plugins/siem/public/alerts/components/rules/rule_actions_field/translations.tsx +++ b/x-pack/plugins/security_solution/public/alerts/components/rules/rule_actions_field/translations.tsx @@ -7,7 +7,7 @@ import { i18n } from '@kbn/i18n'; export const FORM_ERRORS_TITLE = i18n.translate( - 'xpack.siem.detectionEngine.createRule.ruleActionsField.ruleActionsFormErrorsTitle', + 'xpack.securitySolution.detectionEngine.createRule.ruleActionsField.ruleActionsFormErrorsTitle', { defaultMessage: 'Please fix issues listed below', } diff --git a/x-pack/plugins/siem/public/alerts/components/rules/rule_actions_overflow/__snapshots__/index.test.tsx.snap b/x-pack/plugins/security_solution/public/alerts/components/rules/rule_actions_overflow/__snapshots__/index.test.tsx.snap similarity index 100% rename from x-pack/plugins/siem/public/alerts/components/rules/rule_actions_overflow/__snapshots__/index.test.tsx.snap rename to x-pack/plugins/security_solution/public/alerts/components/rules/rule_actions_overflow/__snapshots__/index.test.tsx.snap diff --git a/x-pack/plugins/siem/public/alerts/components/rules/rule_actions_overflow/index.test.tsx b/x-pack/plugins/security_solution/public/alerts/components/rules/rule_actions_overflow/index.test.tsx similarity index 100% rename from x-pack/plugins/siem/public/alerts/components/rules/rule_actions_overflow/index.test.tsx rename to x-pack/plugins/security_solution/public/alerts/components/rules/rule_actions_overflow/index.test.tsx diff --git a/x-pack/plugins/siem/public/alerts/components/rules/rule_actions_overflow/index.tsx b/x-pack/plugins/security_solution/public/alerts/components/rules/rule_actions_overflow/index.tsx similarity index 100% rename from x-pack/plugins/siem/public/alerts/components/rules/rule_actions_overflow/index.tsx rename to x-pack/plugins/security_solution/public/alerts/components/rules/rule_actions_overflow/index.tsx diff --git a/x-pack/plugins/siem/public/alerts/components/rules/rule_actions_overflow/translations.ts b/x-pack/plugins/security_solution/public/alerts/components/rules/rule_actions_overflow/translations.ts similarity index 79% rename from x-pack/plugins/siem/public/alerts/components/rules/rule_actions_overflow/translations.ts rename to x-pack/plugins/security_solution/public/alerts/components/rules/rule_actions_overflow/translations.ts index 631fbe41870d6..862d78936e9d5 100644 --- a/x-pack/plugins/siem/public/alerts/components/rules/rule_actions_overflow/translations.ts +++ b/x-pack/plugins/security_solution/public/alerts/components/rules/rule_actions_overflow/translations.ts @@ -7,7 +7,7 @@ import { i18n } from '@kbn/i18n'; export const ALL_ACTIONS = i18n.translate( - 'xpack.siem.detectionEngine.rules.components.ruleActionsOverflow.allActionsTitle', + 'xpack.securitySolution.detectionEngine.rules.components.ruleActionsOverflow.allActionsTitle', { defaultMessage: 'All actions', } diff --git a/x-pack/plugins/siem/public/alerts/components/rules/rule_status/helpers.test.tsx b/x-pack/plugins/security_solution/public/alerts/components/rules/rule_status/helpers.test.tsx similarity index 100% rename from x-pack/plugins/siem/public/alerts/components/rules/rule_status/helpers.test.tsx rename to x-pack/plugins/security_solution/public/alerts/components/rules/rule_status/helpers.test.tsx diff --git a/x-pack/plugins/siem/public/alerts/components/rules/rule_status/helpers.ts b/x-pack/plugins/security_solution/public/alerts/components/rules/rule_status/helpers.ts similarity index 100% rename from x-pack/plugins/siem/public/alerts/components/rules/rule_status/helpers.ts rename to x-pack/plugins/security_solution/public/alerts/components/rules/rule_status/helpers.ts diff --git a/x-pack/plugins/siem/public/alerts/components/rules/rule_status/index.test.tsx b/x-pack/plugins/security_solution/public/alerts/components/rules/rule_status/index.test.tsx similarity index 100% rename from x-pack/plugins/siem/public/alerts/components/rules/rule_status/index.test.tsx rename to x-pack/plugins/security_solution/public/alerts/components/rules/rule_status/index.test.tsx diff --git a/x-pack/plugins/siem/public/alerts/components/rules/rule_status/index.tsx b/x-pack/plugins/security_solution/public/alerts/components/rules/rule_status/index.tsx similarity index 100% rename from x-pack/plugins/siem/public/alerts/components/rules/rule_status/index.tsx rename to x-pack/plugins/security_solution/public/alerts/components/rules/rule_status/index.tsx diff --git a/x-pack/plugins/security_solution/public/alerts/components/rules/rule_status/translations.ts b/x-pack/plugins/security_solution/public/alerts/components/rules/rule_status/translations.ts new file mode 100644 index 0000000000000..30a352a83a324 --- /dev/null +++ b/x-pack/plugins/security_solution/public/alerts/components/rules/rule_status/translations.ts @@ -0,0 +1,35 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + +import { i18n } from '@kbn/i18n'; + +export const STATUS = i18n.translate( + 'xpack.securitySolution.detectionEngine.ruleStatus.statusDescription', + { + defaultMessage: 'Last response', + } +); + +export const STATUS_AT = i18n.translate( + 'xpack.securitySolution.detectionEngine.ruleStatus.statusAtDescription', + { + defaultMessage: 'at', + } +); + +export const STATUS_DATE = i18n.translate( + 'xpack.securitySolution.detectionEngine.ruleStatus.statusDateDescription', + { + defaultMessage: 'Status date', + } +); + +export const REFRESH = i18n.translate( + 'xpack.securitySolution.detectionEngine.ruleStatus.refreshButton', + { + defaultMessage: 'Refresh', + } +); diff --git a/x-pack/plugins/siem/public/alerts/components/rules/rule_switch/__snapshots__/index.test.tsx.snap b/x-pack/plugins/security_solution/public/alerts/components/rules/rule_switch/__snapshots__/index.test.tsx.snap similarity index 100% rename from x-pack/plugins/siem/public/alerts/components/rules/rule_switch/__snapshots__/index.test.tsx.snap rename to x-pack/plugins/security_solution/public/alerts/components/rules/rule_switch/__snapshots__/index.test.tsx.snap diff --git a/x-pack/plugins/siem/public/alerts/components/rules/rule_switch/index.test.tsx b/x-pack/plugins/security_solution/public/alerts/components/rules/rule_switch/index.test.tsx similarity index 100% rename from x-pack/plugins/siem/public/alerts/components/rules/rule_switch/index.test.tsx rename to x-pack/plugins/security_solution/public/alerts/components/rules/rule_switch/index.test.tsx diff --git a/x-pack/plugins/siem/public/alerts/components/rules/rule_switch/index.tsx b/x-pack/plugins/security_solution/public/alerts/components/rules/rule_switch/index.tsx similarity index 100% rename from x-pack/plugins/siem/public/alerts/components/rules/rule_switch/index.tsx rename to x-pack/plugins/security_solution/public/alerts/components/rules/rule_switch/index.tsx diff --git a/x-pack/plugins/siem/public/alerts/components/rules/schedule_item_form/index.test.tsx b/x-pack/plugins/security_solution/public/alerts/components/rules/schedule_item_form/index.test.tsx similarity index 100% rename from x-pack/plugins/siem/public/alerts/components/rules/schedule_item_form/index.test.tsx rename to x-pack/plugins/security_solution/public/alerts/components/rules/schedule_item_form/index.test.tsx diff --git a/x-pack/plugins/siem/public/alerts/components/rules/schedule_item_form/index.tsx b/x-pack/plugins/security_solution/public/alerts/components/rules/schedule_item_form/index.tsx similarity index 100% rename from x-pack/plugins/siem/public/alerts/components/rules/schedule_item_form/index.tsx rename to x-pack/plugins/security_solution/public/alerts/components/rules/schedule_item_form/index.tsx diff --git a/x-pack/plugins/siem/public/alerts/components/rules/schedule_item_form/translations.ts b/x-pack/plugins/security_solution/public/alerts/components/rules/schedule_item_form/translations.ts similarity index 60% rename from x-pack/plugins/siem/public/alerts/components/rules/schedule_item_form/translations.ts rename to x-pack/plugins/security_solution/public/alerts/components/rules/schedule_item_form/translations.ts index 1bc983814c330..66bc6ea900925 100644 --- a/x-pack/plugins/siem/public/alerts/components/rules/schedule_item_form/translations.ts +++ b/x-pack/plugins/security_solution/public/alerts/components/rules/schedule_item_form/translations.ts @@ -7,28 +7,28 @@ import { i18n } from '@kbn/i18n'; export const SECONDS = i18n.translate( - 'xpack.siem.detectionEngine.createRule.stepScheduleRuleForm.secondsOptionDescription', + 'xpack.securitySolution.detectionEngine.createRule.stepScheduleRuleForm.secondsOptionDescription', { defaultMessage: 'Seconds', } ); export const MINUTES = i18n.translate( - 'xpack.siem.detectionEngine.createRule.stepScheduleRuleForm.minutesOptionDescription', + 'xpack.securitySolution.detectionEngine.createRule.stepScheduleRuleForm.minutesOptionDescription', { defaultMessage: 'Minutes', } ); export const HOURS = i18n.translate( - 'xpack.siem.detectionEngine.createRule.stepScheduleRuleForm.hoursOptionDescription', + 'xpack.securitySolution.detectionEngine.createRule.stepScheduleRuleForm.hoursOptionDescription', { defaultMessage: 'Hours', } ); export const INVALID_TIME = i18n.translate( - 'xpack.siem.detectionEngine.createRule.stepScheduleRuleForm.invalidTimeMessageDescription', + 'xpack.securitySolution.detectionEngine.createRule.stepScheduleRuleForm.invalidTimeMessageDescription', { defaultMessage: 'A time is required.', } diff --git a/x-pack/plugins/siem/public/alerts/components/rules/select_rule_type/index.test.tsx b/x-pack/plugins/security_solution/public/alerts/components/rules/select_rule_type/index.test.tsx similarity index 100% rename from x-pack/plugins/siem/public/alerts/components/rules/select_rule_type/index.test.tsx rename to x-pack/plugins/security_solution/public/alerts/components/rules/select_rule_type/index.test.tsx diff --git a/x-pack/plugins/siem/public/alerts/components/rules/select_rule_type/index.tsx b/x-pack/plugins/security_solution/public/alerts/components/rules/select_rule_type/index.tsx similarity index 94% rename from x-pack/plugins/siem/public/alerts/components/rules/select_rule_type/index.tsx rename to x-pack/plugins/security_solution/public/alerts/components/rules/select_rule_type/index.tsx index 4a21eb0fbcf23..3dad53f532a5b 100644 --- a/x-pack/plugins/siem/public/alerts/components/rules/select_rule_type/index.tsx +++ b/x-pack/plugins/security_solution/public/alerts/components/rules/select_rule_type/index.tsx @@ -34,13 +34,13 @@ const MlCardDescription = ({ i18n.ML_TYPE_DESCRIPTION ) : ( diff --git a/x-pack/plugins/siem/public/alerts/components/rules/select_rule_type/translations.ts b/x-pack/plugins/security_solution/public/alerts/components/rules/select_rule_type/translations.ts similarity index 64% rename from x-pack/plugins/siem/public/alerts/components/rules/select_rule_type/translations.ts rename to x-pack/plugins/security_solution/public/alerts/components/rules/select_rule_type/translations.ts index 4dc0a89af4a49..8b92d20616f7c 100644 --- a/x-pack/plugins/siem/public/alerts/components/rules/select_rule_type/translations.ts +++ b/x-pack/plugins/security_solution/public/alerts/components/rules/select_rule_type/translations.ts @@ -7,28 +7,28 @@ import { i18n } from '@kbn/i18n'; export const QUERY_TYPE_TITLE = i18n.translate( - 'xpack.siem.detectionEngine.createRule.stepDefineRule.ruleTypeField.queryTypeTitle', + 'xpack.securitySolution.detectionEngine.createRule.stepDefineRule.ruleTypeField.queryTypeTitle', { defaultMessage: 'Custom query', } ); export const QUERY_TYPE_DESCRIPTION = i18n.translate( - 'xpack.siem.detectionEngine.createRule.stepDefineRule.ruleTypeField.queryTypeDescription', + 'xpack.securitySolution.detectionEngine.createRule.stepDefineRule.ruleTypeField.queryTypeDescription', { defaultMessage: 'Use KQL or Lucene to detect issues across indices.', } ); export const ML_TYPE_TITLE = i18n.translate( - 'xpack.siem.detectionEngine.createRule.stepDefineRule.ruleTypeField.mlTypeTitle', + 'xpack.securitySolution.detectionEngine.createRule.stepDefineRule.ruleTypeField.mlTypeTitle', { defaultMessage: 'Machine Learning', } ); export const ML_TYPE_DESCRIPTION = i18n.translate( - 'xpack.siem.detectionEngine.createRule.stepDefineRule.ruleTypeField.mlTypeDescription', + 'xpack.securitySolution.detectionEngine.createRule.stepDefineRule.ruleTypeField.mlTypeDescription', { defaultMessage: 'Select ML job to detect anomalous activity.', } diff --git a/x-pack/plugins/siem/public/alerts/components/rules/severity_badge/index.test.tsx b/x-pack/plugins/security_solution/public/alerts/components/rules/severity_badge/index.test.tsx similarity index 100% rename from x-pack/plugins/siem/public/alerts/components/rules/severity_badge/index.test.tsx rename to x-pack/plugins/security_solution/public/alerts/components/rules/severity_badge/index.test.tsx diff --git a/x-pack/plugins/siem/public/alerts/components/rules/severity_badge/index.tsx b/x-pack/plugins/security_solution/public/alerts/components/rules/severity_badge/index.tsx similarity index 100% rename from x-pack/plugins/siem/public/alerts/components/rules/severity_badge/index.tsx rename to x-pack/plugins/security_solution/public/alerts/components/rules/severity_badge/index.tsx diff --git a/x-pack/plugins/siem/public/alerts/components/rules/status_icon/index.test.tsx b/x-pack/plugins/security_solution/public/alerts/components/rules/status_icon/index.test.tsx similarity index 100% rename from x-pack/plugins/siem/public/alerts/components/rules/status_icon/index.test.tsx rename to x-pack/plugins/security_solution/public/alerts/components/rules/status_icon/index.test.tsx diff --git a/x-pack/plugins/siem/public/alerts/components/rules/status_icon/index.tsx b/x-pack/plugins/security_solution/public/alerts/components/rules/status_icon/index.tsx similarity index 100% rename from x-pack/plugins/siem/public/alerts/components/rules/status_icon/index.tsx rename to x-pack/plugins/security_solution/public/alerts/components/rules/status_icon/index.tsx diff --git a/x-pack/plugins/siem/public/alerts/components/rules/step_about_rule/data.tsx b/x-pack/plugins/security_solution/public/alerts/components/rules/step_about_rule/data.tsx similarity index 100% rename from x-pack/plugins/siem/public/alerts/components/rules/step_about_rule/data.tsx rename to x-pack/plugins/security_solution/public/alerts/components/rules/step_about_rule/data.tsx diff --git a/x-pack/plugins/siem/public/alerts/components/rules/step_about_rule/default_value.ts b/x-pack/plugins/security_solution/public/alerts/components/rules/step_about_rule/default_value.ts similarity index 100% rename from x-pack/plugins/siem/public/alerts/components/rules/step_about_rule/default_value.ts rename to x-pack/plugins/security_solution/public/alerts/components/rules/step_about_rule/default_value.ts diff --git a/x-pack/plugins/siem/public/alerts/components/rules/step_about_rule/index.test.tsx b/x-pack/plugins/security_solution/public/alerts/components/rules/step_about_rule/index.test.tsx similarity index 100% rename from x-pack/plugins/siem/public/alerts/components/rules/step_about_rule/index.test.tsx rename to x-pack/plugins/security_solution/public/alerts/components/rules/step_about_rule/index.test.tsx diff --git a/x-pack/plugins/siem/public/alerts/components/rules/step_about_rule/index.tsx b/x-pack/plugins/security_solution/public/alerts/components/rules/step_about_rule/index.tsx similarity index 100% rename from x-pack/plugins/siem/public/alerts/components/rules/step_about_rule/index.tsx rename to x-pack/plugins/security_solution/public/alerts/components/rules/step_about_rule/index.tsx diff --git a/x-pack/plugins/siem/public/alerts/components/rules/step_about_rule/schema.tsx b/x-pack/plugins/security_solution/public/alerts/components/rules/step_about_rule/schema.tsx similarity index 68% rename from x-pack/plugins/siem/public/alerts/components/rules/step_about_rule/schema.tsx rename to x-pack/plugins/security_solution/public/alerts/components/rules/step_about_rule/schema.tsx index 69e8ed10d1b34..42ffab10ff469 100644 --- a/x-pack/plugins/siem/public/alerts/components/rules/step_about_rule/schema.tsx +++ b/x-pack/plugins/security_solution/public/alerts/components/rules/step_about_rule/schema.tsx @@ -24,14 +24,17 @@ const { emptyField } = fieldValidators; export const schema: FormSchema = { name: { type: FIELD_TYPES.TEXT, - label: i18n.translate('xpack.siem.detectionEngine.createRule.stepAboutRule.fieldNameLabel', { - defaultMessage: 'Name', - }), + label: i18n.translate( + 'xpack.securitySolution.detectionEngine.createRule.stepAboutRule.fieldNameLabel', + { + defaultMessage: 'Name', + } + ), validations: [ { validator: emptyField( i18n.translate( - 'xpack.siem.detectionEngine.createRule.stepAboutRule.nameFieldRequiredError', + 'xpack.securitySolution.detectionEngine.createRule.stepAboutRule.nameFieldRequiredError', { defaultMessage: 'A name is required.', } @@ -43,7 +46,7 @@ export const schema: FormSchema = { description: { type: FIELD_TYPES.TEXTAREA, label: i18n.translate( - 'xpack.siem.detectionEngine.createRule.stepAboutRule.fieldDescriptionLabel', + 'xpack.securitySolution.detectionEngine.createRule.stepAboutRule.fieldDescriptionLabel', { defaultMessage: 'Description', } @@ -52,7 +55,7 @@ export const schema: FormSchema = { { validator: emptyField( i18n.translate( - 'xpack.siem.detectionEngine.createRule.stepAboutRule.descriptionFieldRequiredError', + 'xpack.securitySolution.detectionEngine.createRule.stepAboutRule.descriptionFieldRequiredError', { defaultMessage: 'A description is required.', } @@ -64,7 +67,7 @@ export const schema: FormSchema = { severity: { type: FIELD_TYPES.SUPER_SELECT, label: i18n.translate( - 'xpack.siem.detectionEngine.createRule.stepAboutRule.fieldSeverityLabel', + 'xpack.securitySolution.detectionEngine.createRule.stepAboutRule.fieldSeverityLabel', { defaultMessage: 'Severity', } @@ -73,7 +76,7 @@ export const schema: FormSchema = { { validator: emptyField( i18n.translate( - 'xpack.siem.detectionEngine.createRule.stepAboutRule.severityFieldRequiredError', + 'xpack.securitySolution.detectionEngine.createRule.stepAboutRule.severityFieldRequiredError', { defaultMessage: 'A severity is required.', } @@ -85,7 +88,7 @@ export const schema: FormSchema = { riskScore: { type: FIELD_TYPES.RANGE, label: i18n.translate( - 'xpack.siem.detectionEngine.createRule.stepAboutRule.fieldRiskScoreLabel', + 'xpack.securitySolution.detectionEngine.createRule.stepAboutRule.fieldRiskScoreLabel', { defaultMessage: 'Risk score', } @@ -93,7 +96,7 @@ export const schema: FormSchema = { }, references: { label: i18n.translate( - 'xpack.siem.detectionEngine.createRule.stepAboutRule.fieldReferenceUrlsLabel', + 'xpack.securitySolution.detectionEngine.createRule.stepAboutRule.fieldReferenceUrlsLabel', { defaultMessage: 'Reference URLs', } @@ -124,7 +127,7 @@ export const schema: FormSchema = { }, falsePositives: { label: i18n.translate( - 'xpack.siem.detectionEngine.createRule.stepAboutRule.fieldFalsePositiveLabel', + 'xpack.securitySolution.detectionEngine.createRule.stepAboutRule.fieldFalsePositiveLabel', { defaultMessage: 'False positive examples', } @@ -133,7 +136,7 @@ export const schema: FormSchema = { }, threat: { label: i18n.translate( - 'xpack.siem.detectionEngine.createRule.stepAboutRule.fieldMitreThreatLabel', + 'xpack.securitySolution.detectionEngine.createRule.stepAboutRule.fieldMitreThreatLabel', { defaultMessage: 'MITRE ATT&CK\\u2122', } @@ -164,11 +167,14 @@ export const schema: FormSchema = { }, tags: { type: FIELD_TYPES.COMBO_BOX, - label: i18n.translate('xpack.siem.detectionEngine.createRule.stepAboutRule.fieldTagsLabel', { - defaultMessage: 'Tags', - }), + label: i18n.translate( + 'xpack.securitySolution.detectionEngine.createRule.stepAboutRule.fieldTagsLabel', + { + defaultMessage: 'Tags', + } + ), helpText: i18n.translate( - 'xpack.siem.detectionEngine.createRule.stepAboutRule.fieldTagsHelpText', + 'xpack.securitySolution.detectionEngine.createRule.stepAboutRule.fieldTagsHelpText', { defaultMessage: 'Type one or more custom identifying tags for this rule. Press enter after each tag to begin a new one.', @@ -178,13 +184,19 @@ export const schema: FormSchema = { }, note: { type: FIELD_TYPES.TEXTAREA, - label: i18n.translate('xpack.siem.detectionEngine.createRule.stepAboutRule.guideLabel', { - defaultMessage: 'Investigation guide', - }), - helpText: i18n.translate('xpack.siem.detectionEngine.createRule.stepAboutRule.guideHelpText', { - defaultMessage: - 'Provide helpful information for analysts that are performing an alert investigation. This guide will appear on both the rule details page and in timelines created from alerts generated by this rule.', - }), + label: i18n.translate( + 'xpack.securitySolution.detectionEngine.createRule.stepAboutRule.guideLabel', + { + defaultMessage: 'Investigation guide', + } + ), + helpText: i18n.translate( + 'xpack.securitySolution.detectionEngine.createRule.stepAboutRule.guideHelpText', + { + defaultMessage: + 'Provide helpful information for analysts that are performing a signal investigation. This guide will appear on both the rule details page and in timelines created from alerts generated by this rule.', + } + ), labelAppend: OptionalFieldLabel, }, }; diff --git a/x-pack/plugins/siem/public/alerts/components/rules/step_about_rule/translations.ts b/x-pack/plugins/security_solution/public/alerts/components/rules/step_about_rule/translations.ts similarity index 56% rename from x-pack/plugins/siem/public/alerts/components/rules/step_about_rule/translations.ts rename to x-pack/plugins/security_solution/public/alerts/components/rules/step_about_rule/translations.ts index 0b1e712c663f3..c179128c56d92 100644 --- a/x-pack/plugins/siem/public/alerts/components/rules/step_about_rule/translations.ts +++ b/x-pack/plugins/security_solution/public/alerts/components/rules/step_about_rule/translations.ts @@ -7,70 +7,70 @@ import { i18n } from '@kbn/i18n'; export const ADVANCED_SETTINGS = i18n.translate( - 'xpack.siem.detectionEngine.createRule.stepAboutRuleForm.advancedSettingsButton', + 'xpack.securitySolution.detectionEngine.createRule.stepAboutRuleForm.advancedSettingsButton', { defaultMessage: 'Advanced settings', } ); export const ADD_REFERENCE = i18n.translate( - 'xpack.siem.detectionEngine.createRule.stepAboutRuleForm.addReferenceDescription', + 'xpack.securitySolution.detectionEngine.createRule.stepAboutRuleForm.addReferenceDescription', { defaultMessage: 'Add reference URL', } ); export const ADD_FALSE_POSITIVE = i18n.translate( - 'xpack.siem.detectionEngine.createRule.stepAboutRuleForm.addFalsePositiveDescription', + 'xpack.securitySolution.detectionEngine.createRule.stepAboutRuleForm.addFalsePositiveDescription', { defaultMessage: 'Add false positive example', } ); export const LOW = i18n.translate( - 'xpack.siem.detectionEngine.createRule.stepAboutRuleForm.severityOptionLowDescription', + 'xpack.securitySolution.detectionEngine.createRule.stepAboutRuleForm.severityOptionLowDescription', { defaultMessage: 'Low', } ); export const MEDIUM = i18n.translate( - 'xpack.siem.detectionEngine.createRule.stepAboutRuleForm.severityOptionMediumDescription', + 'xpack.securitySolution.detectionEngine.createRule.stepAboutRuleForm.severityOptionMediumDescription', { defaultMessage: 'Medium', } ); export const HIGH = i18n.translate( - 'xpack.siem.detectionEngine.createRule.stepAboutRuleForm.severityOptionHighDescription', + 'xpack.securitySolution.detectionEngine.createRule.stepAboutRuleForm.severityOptionHighDescription', { defaultMessage: 'High', } ); export const CRITICAL = i18n.translate( - 'xpack.siem.detectionEngine.createRule.stepAboutRuleForm.severityOptionCriticalDescription', + 'xpack.securitySolution.detectionEngine.createRule.stepAboutRuleForm.severityOptionCriticalDescription', { defaultMessage: 'Critical', } ); export const CUSTOM_MITRE_ATTACK_TECHNIQUES_REQUIRED = i18n.translate( - 'xpack.siem.detectionEngine.createRule.stepDefineRule.customMitreAttackTechniquesFieldRequiredError', + 'xpack.securitySolution.detectionEngine.createRule.stepDefineRule.customMitreAttackTechniquesFieldRequiredError', { defaultMessage: 'At least one Technique is required with a Tactic.', } ); export const URL_FORMAT_INVALID = i18n.translate( - 'xpack.siem.detectionEngine.createRule.stepDefineRule.referencesUrlInvalidError', + 'xpack.securitySolution.detectionEngine.createRule.stepDefineRule.referencesUrlInvalidError', { defaultMessage: 'Url is invalid format', } ); export const ADD_RULE_NOTE_HELP_TEXT = i18n.translate( - 'xpack.siem.detectionEngine.createRule.stepAboutrule.noteHelpText', + 'xpack.securitySolution.detectionEngine.createRule.stepAboutrule.noteHelpText', { defaultMessage: 'Add rule investigation guide...', } diff --git a/x-pack/plugins/siem/public/alerts/components/rules/step_about_rule_details/index.test.tsx b/x-pack/plugins/security_solution/public/alerts/components/rules/step_about_rule_details/index.test.tsx similarity index 100% rename from x-pack/plugins/siem/public/alerts/components/rules/step_about_rule_details/index.test.tsx rename to x-pack/plugins/security_solution/public/alerts/components/rules/step_about_rule_details/index.test.tsx diff --git a/x-pack/plugins/siem/public/alerts/components/rules/step_about_rule_details/index.tsx b/x-pack/plugins/security_solution/public/alerts/components/rules/step_about_rule_details/index.tsx similarity index 100% rename from x-pack/plugins/siem/public/alerts/components/rules/step_about_rule_details/index.tsx rename to x-pack/plugins/security_solution/public/alerts/components/rules/step_about_rule_details/index.tsx diff --git a/x-pack/plugins/siem/public/alerts/components/rules/step_about_rule_details/translations.ts b/x-pack/plugins/security_solution/public/alerts/components/rules/step_about_rule_details/translations.ts similarity index 69% rename from x-pack/plugins/siem/public/alerts/components/rules/step_about_rule_details/translations.ts rename to x-pack/plugins/security_solution/public/alerts/components/rules/step_about_rule_details/translations.ts index 79c5eb12d4663..e1b89b1ec8ce2 100644 --- a/x-pack/plugins/siem/public/alerts/components/rules/step_about_rule_details/translations.ts +++ b/x-pack/plugins/security_solution/public/alerts/components/rules/step_about_rule_details/translations.ts @@ -6,21 +6,21 @@ import { i18n } from '@kbn/i18n'; export const ABOUT_PANEL_DETAILS_TAB = i18n.translate( - 'xpack.siem.detectionEngine.details.stepAboutRule.detailsLabel', + 'xpack.securitySolution.detectionEngine.details.stepAboutRule.detailsLabel', { defaultMessage: 'Details', } ); export const ABOUT_TEXT = i18n.translate( - 'xpack.siem.detectionEngine.details.stepAboutRule.aboutText', + 'xpack.securitySolution.detectionEngine.details.stepAboutRule.aboutText', { defaultMessage: 'About', } ); export const ABOUT_PANEL_NOTES_TAB = i18n.translate( - 'xpack.siem.detectionEngine.details.stepAboutRule.investigationGuideLabel', + 'xpack.securitySolution.detectionEngine.details.stepAboutRule.investigationGuideLabel', { defaultMessage: 'Investigation guide', } diff --git a/x-pack/plugins/siem/public/alerts/components/rules/step_content_wrapper/index.test.tsx b/x-pack/plugins/security_solution/public/alerts/components/rules/step_content_wrapper/index.test.tsx similarity index 100% rename from x-pack/plugins/siem/public/alerts/components/rules/step_content_wrapper/index.test.tsx rename to x-pack/plugins/security_solution/public/alerts/components/rules/step_content_wrapper/index.test.tsx diff --git a/x-pack/plugins/siem/public/alerts/components/rules/step_content_wrapper/index.tsx b/x-pack/plugins/security_solution/public/alerts/components/rules/step_content_wrapper/index.tsx similarity index 100% rename from x-pack/plugins/siem/public/alerts/components/rules/step_content_wrapper/index.tsx rename to x-pack/plugins/security_solution/public/alerts/components/rules/step_content_wrapper/index.tsx diff --git a/x-pack/plugins/siem/public/alerts/components/rules/step_define_rule/index.test.tsx b/x-pack/plugins/security_solution/public/alerts/components/rules/step_define_rule/index.test.tsx similarity index 100% rename from x-pack/plugins/siem/public/alerts/components/rules/step_define_rule/index.test.tsx rename to x-pack/plugins/security_solution/public/alerts/components/rules/step_define_rule/index.test.tsx diff --git a/x-pack/plugins/siem/public/alerts/components/rules/step_define_rule/index.tsx b/x-pack/plugins/security_solution/public/alerts/components/rules/step_define_rule/index.tsx similarity index 100% rename from x-pack/plugins/siem/public/alerts/components/rules/step_define_rule/index.tsx rename to x-pack/plugins/security_solution/public/alerts/components/rules/step_define_rule/index.tsx diff --git a/x-pack/plugins/siem/public/alerts/components/rules/step_define_rule/schema.tsx b/x-pack/plugins/security_solution/public/alerts/components/rules/step_define_rule/schema.tsx similarity index 82% rename from x-pack/plugins/siem/public/alerts/components/rules/step_define_rule/schema.tsx rename to x-pack/plugins/security_solution/public/alerts/components/rules/step_define_rule/schema.tsx index 0c309c8c51a15..190d4484b156b 100644 --- a/x-pack/plugins/siem/public/alerts/components/rules/step_define_rule/schema.tsx +++ b/x-pack/plugins/security_solution/public/alerts/components/rules/step_define_rule/schema.tsx @@ -25,7 +25,7 @@ export const schema: FormSchema = { index: { type: FIELD_TYPES.COMBO_BOX, label: i18n.translate( - 'xpack.siem.detectionEngine.createRule.stepAboutRule.fiedIndexPatternsLabel', + 'xpack.securitySolution.detectionEngine.createRule.stepAboutRule.fiedIndexPatternsLabel', { defaultMessage: 'Index patterns', } @@ -45,7 +45,7 @@ export const schema: FormSchema = { return fieldValidators.emptyField( i18n.translate( - 'xpack.siem.detectionEngine.createRule.stepDefineRule.outputIndiceNameFieldRequiredError', + 'xpack.securitySolution.detectionEngine.createRule.stepDefineRule.outputIndiceNameFieldRequiredError', { defaultMessage: 'A minimum of one index pattern is required.', } @@ -57,7 +57,7 @@ export const schema: FormSchema = { }, queryBar: { label: i18n.translate( - 'xpack.siem.detectionEngine.createRule.stepDefineRule.fieldQuerBarLabel', + 'xpack.securitySolution.detectionEngine.createRule.stepDefineRule.fieldQuerBarLabel', { defaultMessage: 'Custom query', } @@ -111,7 +111,7 @@ export const schema: FormSchema = { }, ruleType: { label: i18n.translate( - 'xpack.siem.detectionEngine.createRule.stepDefineRule.fieldRuleTypeLabel', + 'xpack.securitySolution.detectionEngine.createRule.stepDefineRule.fieldRuleTypeLabel', { defaultMessage: 'Rule type', } @@ -120,7 +120,7 @@ export const schema: FormSchema = { }, anomalyThreshold: { label: i18n.translate( - 'xpack.siem.detectionEngine.createRule.stepDefineRule.fieldAnomalyThresholdLabel', + 'xpack.securitySolution.detectionEngine.createRule.stepDefineRule.fieldAnomalyThresholdLabel', { defaultMessage: 'Anomaly score threshold', } @@ -129,7 +129,7 @@ export const schema: FormSchema = { }, machineLearningJobId: { label: i18n.translate( - 'xpack.siem.detectionEngine.createRule.stepDefineRule.fieldMachineLearningJobIdLabel', + 'xpack.securitySolution.detectionEngine.createRule.stepDefineRule.fieldMachineLearningJobIdLabel', { defaultMessage: 'Machine Learning job', } @@ -148,7 +148,7 @@ export const schema: FormSchema = { return fieldValidators.emptyField( i18n.translate( - 'xpack.siem.detectionEngine.createRule.stepDefineRule.machineLearningJobIdRequired', + 'xpack.securitySolution.detectionEngine.createRule.stepDefineRule.machineLearningJobIdRequired', { defaultMessage: 'A Machine Learning job is required.', } @@ -160,13 +160,13 @@ export const schema: FormSchema = { }, timeline: { label: i18n.translate( - 'xpack.siem.detectionEngine.createRule.stepAboutRule.fieldTimelineTemplateLabel', + 'xpack.securitySolution.detectionEngine.createRule.stepAboutRule.fieldTimelineTemplateLabel', { defaultMessage: 'Timeline template', } ), helpText: i18n.translate( - 'xpack.siem.detectionEngine.createRule.stepAboutRule.fieldTimelineTemplateHelpText', + 'xpack.securitySolution.detectionEngine.createRule.stepAboutRule.fieldTimelineTemplateHelpText', { defaultMessage: 'Select which timeline to use when investigating generated alerts.', } diff --git a/x-pack/plugins/siem/public/alerts/components/rules/step_define_rule/translations.tsx b/x-pack/plugins/security_solution/public/alerts/components/rules/step_define_rule/translations.tsx similarity index 64% rename from x-pack/plugins/siem/public/alerts/components/rules/step_define_rule/translations.tsx rename to x-pack/plugins/security_solution/public/alerts/components/rules/step_define_rule/translations.tsx index bbdb2130ce298..a371db72d2ee1 100644 --- a/x-pack/plugins/siem/public/alerts/components/rules/step_define_rule/translations.tsx +++ b/x-pack/plugins/security_solution/public/alerts/components/rules/step_define_rule/translations.tsx @@ -7,35 +7,35 @@ import { i18n } from '@kbn/i18n'; export const CUSTOM_QUERY_REQUIRED = i18n.translate( - 'xpack.siem.detectionEngine.createRule.stepDefineRule.customQueryFieldRequiredError', + 'xpack.securitySolution.detectionEngine.createRule.stepDefineRule.customQueryFieldRequiredError', { defaultMessage: 'A custom query is required.', } ); export const INVALID_CUSTOM_QUERY = i18n.translate( - 'xpack.siem.detectionEngine.createRule.stepDefineRule.customQueryFieldInvalidError', + 'xpack.securitySolution.detectionEngine.createRule.stepDefineRule.customQueryFieldInvalidError', { defaultMessage: 'The KQL is invalid', } ); export const CONFIG_INDICES = i18n.translate( - 'xpack.siem.detectionEngine.createRule.stepDefineRule.indicesFromConfigDescription', + 'xpack.securitySolution.detectionEngine.createRule.stepDefineRule.indicesFromConfigDescription', { defaultMessage: 'Use Elasticsearch indices from SIEM advanced settings', } ); export const CUSTOM_INDICES = i18n.translate( - 'xpack.siem.detectionEngine.createRule.stepDefineRule.indicesCustomDescription', + 'xpack.securitySolution.detectionEngine.createRule.stepDefineRule.indicesCustomDescription', { defaultMessage: 'Provide custom list of indices', } ); export const INDEX_HELPER_TEXT = i18n.translate( - 'xpack.siem.detectionEngine.createRule.stepDefineRule.indicesHelperDescription', + 'xpack.securitySolution.detectionEngine.createRule.stepDefineRule.indicesHelperDescription', { defaultMessage: 'Enter the pattern of Elasticsearch indices where you would like this rule to run. By default, these will include index patterns defined in SIEM advanced settings.', @@ -43,28 +43,28 @@ export const INDEX_HELPER_TEXT = i18n.translate( ); export const RESET_DEFAULT_INDEX = i18n.translate( - 'xpack.siem.detectionEngine.createRule.stepDefineRule.resetDefaultIndicesButton', + 'xpack.securitySolution.detectionEngine.createRule.stepDefineRule.resetDefaultIndicesButton', { defaultMessage: 'Reset to default index patterns', } ); export const IMPORT_TIMELINE_QUERY = i18n.translate( - 'xpack.siem.detectionEngine.createRule.stepDefineRule.importTimelineQueryButton', + 'xpack.securitySolution.detectionEngine.createRule.stepDefineRule.importTimelineQueryButton', { defaultMessage: 'Import query from saved timeline', } ); export const ML_JOB_SELECT_PLACEHOLDER_TEXT = i18n.translate( - 'xpack.siem.detectionEngine.createRule.stepDefineRule.mlJobSelectPlaceholderText', + 'xpack.securitySolution.detectionEngine.createRule.stepDefineRule.mlJobSelectPlaceholderText', { defaultMessage: 'Select a job', } ); export const ENABLE_ML_JOB_WARNING = i18n.translate( - 'xpack.siem.detectionEngine.createRule.stepDefineRule.mlEnableJobWarningTitle', + 'xpack.securitySolution.detectionEngine.createRule.stepDefineRule.mlEnableJobWarningTitle', { defaultMessage: 'This ML job is not currently running. Please set this job to run via "ML job settings" before activating this rule.', diff --git a/x-pack/plugins/siem/public/alerts/components/rules/step_define_rule/types.ts b/x-pack/plugins/security_solution/public/alerts/components/rules/step_define_rule/types.ts similarity index 100% rename from x-pack/plugins/siem/public/alerts/components/rules/step_define_rule/types.ts rename to x-pack/plugins/security_solution/public/alerts/components/rules/step_define_rule/types.ts diff --git a/x-pack/plugins/siem/public/alerts/components/rules/step_panel/index.test.tsx b/x-pack/plugins/security_solution/public/alerts/components/rules/step_panel/index.test.tsx similarity index 100% rename from x-pack/plugins/siem/public/alerts/components/rules/step_panel/index.test.tsx rename to x-pack/plugins/security_solution/public/alerts/components/rules/step_panel/index.test.tsx diff --git a/x-pack/plugins/siem/public/alerts/components/rules/step_panel/index.tsx b/x-pack/plugins/security_solution/public/alerts/components/rules/step_panel/index.tsx similarity index 100% rename from x-pack/plugins/siem/public/alerts/components/rules/step_panel/index.tsx rename to x-pack/plugins/security_solution/public/alerts/components/rules/step_panel/index.tsx diff --git a/x-pack/plugins/siem/public/alerts/components/rules/step_rule_actions/index.test.tsx b/x-pack/plugins/security_solution/public/alerts/components/rules/step_rule_actions/index.test.tsx similarity index 100% rename from x-pack/plugins/siem/public/alerts/components/rules/step_rule_actions/index.test.tsx rename to x-pack/plugins/security_solution/public/alerts/components/rules/step_rule_actions/index.test.tsx diff --git a/x-pack/plugins/siem/public/alerts/components/rules/step_rule_actions/index.tsx b/x-pack/plugins/security_solution/public/alerts/components/rules/step_rule_actions/index.tsx similarity index 100% rename from x-pack/plugins/siem/public/alerts/components/rules/step_rule_actions/index.tsx rename to x-pack/plugins/security_solution/public/alerts/components/rules/step_rule_actions/index.tsx diff --git a/x-pack/plugins/siem/public/alerts/components/rules/step_rule_actions/schema.test.tsx b/x-pack/plugins/security_solution/public/alerts/components/rules/step_rule_actions/schema.test.tsx similarity index 100% rename from x-pack/plugins/siem/public/alerts/components/rules/step_rule_actions/schema.test.tsx rename to x-pack/plugins/security_solution/public/alerts/components/rules/step_rule_actions/schema.test.tsx diff --git a/x-pack/plugins/siem/public/alerts/components/rules/step_rule_actions/schema.tsx b/x-pack/plugins/security_solution/public/alerts/components/rules/step_rule_actions/schema.tsx similarity index 92% rename from x-pack/plugins/siem/public/alerts/components/rules/step_rule_actions/schema.tsx rename to x-pack/plugins/security_solution/public/alerts/components/rules/step_rule_actions/schema.tsx index a211a93bd1461..a093f991afaf7 100644 --- a/x-pack/plugins/siem/public/alerts/components/rules/step_rule_actions/schema.tsx +++ b/x-pack/plugins/security_solution/public/alerts/components/rules/step_rule_actions/schema.tsx @@ -73,13 +73,13 @@ export const getSchema = ({ kibanaSiemAppUrl: {}, throttle: { label: i18n.translate( - 'xpack.siem.detectionEngine.createRule.stepRuleActions.fieldThrottleLabel', + 'xpack.securitySolution.detectionEngine.createRule.stepRuleActions.fieldThrottleLabel', { defaultMessage: 'Actions frequency', } ), helpText: i18n.translate( - 'xpack.siem.detectionEngine.createRule.stepRuleActions.fieldThrottleHelpText', + 'xpack.securitySolution.detectionEngine.createRule.stepRuleActions.fieldThrottleHelpText', { defaultMessage: 'Select when automated actions should be performed if a rule evaluates as true.', diff --git a/x-pack/plugins/siem/public/alerts/components/rules/step_rule_actions/translations.tsx b/x-pack/plugins/security_solution/public/alerts/components/rules/step_rule_actions/translations.tsx similarity index 68% rename from x-pack/plugins/siem/public/alerts/components/rules/step_rule_actions/translations.tsx rename to x-pack/plugins/security_solution/public/alerts/components/rules/step_rule_actions/translations.tsx index d0c990df81ffe..a276cb17e95f5 100644 --- a/x-pack/plugins/siem/public/alerts/components/rules/step_rule_actions/translations.tsx +++ b/x-pack/plugins/security_solution/public/alerts/components/rules/step_rule_actions/translations.tsx @@ -8,21 +8,21 @@ import { i18n } from '@kbn/i18n'; import { startCase } from 'lodash/fp'; export const COMPLETE_WITHOUT_ACTIVATING = i18n.translate( - 'xpack.siem.detectionEngine.createRule.stepScheduleRule.completeWithoutActivatingTitle', + 'xpack.securitySolution.detectionEngine.createRule.stepScheduleRule.completeWithoutActivatingTitle', { defaultMessage: 'Create rule without activating it', } ); export const COMPLETE_WITH_ACTIVATING = i18n.translate( - 'xpack.siem.detectionEngine.createRule.stepScheduleRule.completeWithActivatingTitle', + 'xpack.securitySolution.detectionEngine.createRule.stepScheduleRule.completeWithActivatingTitle', { defaultMessage: 'Create & activate rule', } ); export const NO_CONNECTOR_SELECTED = i18n.translate( - 'xpack.siem.detectionEngine.createRule.stepRuleActions.noConnectorSelectedErrorMessage', + 'xpack.securitySolution.detectionEngine.createRule.stepRuleActions.noConnectorSelectedErrorMessage', { defaultMessage: 'No connector selected', } @@ -30,7 +30,7 @@ export const NO_CONNECTOR_SELECTED = i18n.translate( export const INVALID_MUSTACHE_TEMPLATE = (paramKey: string) => i18n.translate( - 'xpack.siem.detectionEngine.createRule.stepRuleActions.invalidMustacheTemplateErrorMessage', + 'xpack.securitySolution.detectionEngine.createRule.stepRuleActions.invalidMustacheTemplateErrorMessage', { defaultMessage: '{key} is not valid mustache template', values: { diff --git a/x-pack/plugins/siem/public/alerts/components/rules/step_rule_actions/utils.test.ts b/x-pack/plugins/security_solution/public/alerts/components/rules/step_rule_actions/utils.test.ts similarity index 100% rename from x-pack/plugins/siem/public/alerts/components/rules/step_rule_actions/utils.test.ts rename to x-pack/plugins/security_solution/public/alerts/components/rules/step_rule_actions/utils.test.ts diff --git a/x-pack/plugins/siem/public/alerts/components/rules/step_rule_actions/utils.ts b/x-pack/plugins/security_solution/public/alerts/components/rules/step_rule_actions/utils.ts similarity index 100% rename from x-pack/plugins/siem/public/alerts/components/rules/step_rule_actions/utils.ts rename to x-pack/plugins/security_solution/public/alerts/components/rules/step_rule_actions/utils.ts diff --git a/x-pack/plugins/siem/public/alerts/components/rules/step_schedule_rule/index.test.tsx b/x-pack/plugins/security_solution/public/alerts/components/rules/step_schedule_rule/index.test.tsx similarity index 100% rename from x-pack/plugins/siem/public/alerts/components/rules/step_schedule_rule/index.test.tsx rename to x-pack/plugins/security_solution/public/alerts/components/rules/step_schedule_rule/index.test.tsx diff --git a/x-pack/plugins/siem/public/alerts/components/rules/step_schedule_rule/index.tsx b/x-pack/plugins/security_solution/public/alerts/components/rules/step_schedule_rule/index.tsx similarity index 100% rename from x-pack/plugins/siem/public/alerts/components/rules/step_schedule_rule/index.tsx rename to x-pack/plugins/security_solution/public/alerts/components/rules/step_schedule_rule/index.tsx diff --git a/x-pack/plugins/siem/public/alerts/components/rules/step_schedule_rule/schema.tsx b/x-pack/plugins/security_solution/public/alerts/components/rules/step_schedule_rule/schema.tsx similarity index 71% rename from x-pack/plugins/siem/public/alerts/components/rules/step_schedule_rule/schema.tsx rename to x-pack/plugins/security_solution/public/alerts/components/rules/step_schedule_rule/schema.tsx index d010a3128b24d..f4c371a2364f6 100644 --- a/x-pack/plugins/siem/public/alerts/components/rules/step_schedule_rule/schema.tsx +++ b/x-pack/plugins/security_solution/public/alerts/components/rules/step_schedule_rule/schema.tsx @@ -14,13 +14,13 @@ import { FormSchema } from '../../../../shared_imports'; export const schema: FormSchema = { interval: { label: i18n.translate( - 'xpack.siem.detectionEngine.createRule.stepScheduleRule.fieldIntervalLabel', + 'xpack.securitySolution.detectionEngine.createRule.stepScheduleRule.fieldIntervalLabel', { defaultMessage: 'Runs every', } ), helpText: i18n.translate( - 'xpack.siem.detectionEngine.createRule.stepScheduleRule.fieldIntervalHelpText', + 'xpack.securitySolution.detectionEngine.createRule.stepScheduleRule.fieldIntervalHelpText', { defaultMessage: 'Rules run periodically and detect alerts within the specified time frame.', } @@ -28,14 +28,14 @@ export const schema: FormSchema = { }, from: { label: i18n.translate( - 'xpack.siem.detectionEngine.createRule.stepScheduleRule.fieldAdditionalLookBackLabel', + 'xpack.securitySolution.detectionEngine.createRule.stepScheduleRule.fieldAdditionalLookBackLabel', { defaultMessage: 'Additional look-back time', } ), labelAppend: OptionalFieldLabel, helpText: i18n.translate( - 'xpack.siem.detectionEngine.createRule.stepScheduleRule.fieldAdditionalLookBackHelpText', + 'xpack.securitySolution.detectionEngine.createRule.stepScheduleRule.fieldAdditionalLookBackHelpText', { defaultMessage: 'Adds time to the look-back period to prevent missed alerts.', } diff --git a/x-pack/plugins/siem/public/alerts/components/rules/step_schedule_rule/translations.tsx b/x-pack/plugins/security_solution/public/alerts/components/rules/step_schedule_rule/translations.tsx similarity index 71% rename from x-pack/plugins/siem/public/alerts/components/rules/step_schedule_rule/translations.tsx rename to x-pack/plugins/security_solution/public/alerts/components/rules/step_schedule_rule/translations.tsx index 67bcc1af8150b..d49e7396f4c87 100644 --- a/x-pack/plugins/siem/public/alerts/components/rules/step_schedule_rule/translations.tsx +++ b/x-pack/plugins/security_solution/public/alerts/components/rules/step_schedule_rule/translations.tsx @@ -7,14 +7,14 @@ import { i18n } from '@kbn/i18n'; export const COMPLETE_WITHOUT_ACTIVATING = i18n.translate( - 'xpack.siem.detectionEngine.createRule. stepScheduleRule.completeWithoutActivatingTitle', + 'xpack.securitySolution.detectionEngine.createRule. stepScheduleRule.completeWithoutActivatingTitle', { defaultMessage: 'Create rule without activating it', } ); export const COMPLETE_WITH_ACTIVATING = i18n.translate( - 'xpack.siem.detectionEngine.createRule. stepScheduleRule.completeWithActivatingTitle', + 'xpack.securitySolution.detectionEngine.createRule. stepScheduleRule.completeWithActivatingTitle', { defaultMessage: 'Create & activate rule', } diff --git a/x-pack/plugins/siem/public/alerts/components/rules/throttle_select_field/index.test.tsx b/x-pack/plugins/security_solution/public/alerts/components/rules/throttle_select_field/index.test.tsx similarity index 100% rename from x-pack/plugins/siem/public/alerts/components/rules/throttle_select_field/index.test.tsx rename to x-pack/plugins/security_solution/public/alerts/components/rules/throttle_select_field/index.test.tsx diff --git a/x-pack/plugins/siem/public/alerts/components/rules/throttle_select_field/index.tsx b/x-pack/plugins/security_solution/public/alerts/components/rules/throttle_select_field/index.tsx similarity index 100% rename from x-pack/plugins/siem/public/alerts/components/rules/throttle_select_field/index.tsx rename to x-pack/plugins/security_solution/public/alerts/components/rules/throttle_select_field/index.tsx diff --git a/x-pack/plugins/siem/public/alerts/components/user_info/index.test.tsx b/x-pack/plugins/security_solution/public/alerts/components/user_info/index.test.tsx similarity index 98% rename from x-pack/plugins/siem/public/alerts/components/user_info/index.test.tsx rename to x-pack/plugins/security_solution/public/alerts/components/user_info/index.test.tsx index b01edac2605eb..1d0f0e2e24f77 100644 --- a/x-pack/plugins/siem/public/alerts/components/user_info/index.test.tsx +++ b/x-pack/plugins/security_solution/public/alerts/components/user_info/index.test.tsx @@ -22,7 +22,7 @@ describe('useUserInfo', () => { services: { application: { capabilities: { - siem: { + securitySolution: { crud: true, }, }, diff --git a/x-pack/plugins/siem/public/alerts/components/user_info/index.tsx b/x-pack/plugins/security_solution/public/alerts/components/user_info/index.tsx similarity index 98% rename from x-pack/plugins/siem/public/alerts/components/user_info/index.tsx rename to x-pack/plugins/security_solution/public/alerts/components/user_info/index.tsx index 049463d4066d8..8753064751f76 100644 --- a/x-pack/plugins/siem/public/alerts/components/user_info/index.tsx +++ b/x-pack/plugins/security_solution/public/alerts/components/user_info/index.tsx @@ -163,7 +163,9 @@ export const useUserInfo = (): State => { const uiCapabilities = useKibana().services.application.capabilities; const capabilitiesCanUserCRUD: boolean = - typeof uiCapabilities.siem.crud === 'boolean' ? uiCapabilities.siem.crud : false; + typeof uiCapabilities.securitySolution.crud === 'boolean' + ? uiCapabilities.securitySolution.crud + : false; useEffect(() => { if (loading !== privilegeLoading || indexNameLoading) { diff --git a/x-pack/plugins/siem/public/alerts/containers/detection_engine/alerts/__mocks__/api.ts b/x-pack/plugins/security_solution/public/alerts/containers/detection_engine/alerts/__mocks__/api.ts similarity index 100% rename from x-pack/plugins/siem/public/alerts/containers/detection_engine/alerts/__mocks__/api.ts rename to x-pack/plugins/security_solution/public/alerts/containers/detection_engine/alerts/__mocks__/api.ts diff --git a/x-pack/plugins/siem/public/alerts/containers/detection_engine/alerts/api.test.ts b/x-pack/plugins/security_solution/public/alerts/containers/detection_engine/alerts/api.test.ts similarity index 100% rename from x-pack/plugins/siem/public/alerts/containers/detection_engine/alerts/api.test.ts rename to x-pack/plugins/security_solution/public/alerts/containers/detection_engine/alerts/api.test.ts diff --git a/x-pack/plugins/siem/public/alerts/containers/detection_engine/alerts/api.ts b/x-pack/plugins/security_solution/public/alerts/containers/detection_engine/alerts/api.ts similarity index 100% rename from x-pack/plugins/siem/public/alerts/containers/detection_engine/alerts/api.ts rename to x-pack/plugins/security_solution/public/alerts/containers/detection_engine/alerts/api.ts diff --git a/x-pack/plugins/siem/public/alerts/containers/detection_engine/alerts/mock.ts b/x-pack/plugins/security_solution/public/alerts/containers/detection_engine/alerts/mock.ts similarity index 100% rename from x-pack/plugins/siem/public/alerts/containers/detection_engine/alerts/mock.ts rename to x-pack/plugins/security_solution/public/alerts/containers/detection_engine/alerts/mock.ts diff --git a/x-pack/plugins/siem/public/alerts/containers/detection_engine/alerts/translations.ts b/x-pack/plugins/security_solution/public/alerts/containers/detection_engine/alerts/translations.ts similarity index 67% rename from x-pack/plugins/siem/public/alerts/containers/detection_engine/alerts/translations.ts rename to x-pack/plugins/security_solution/public/alerts/containers/detection_engine/alerts/translations.ts index 2f3ebccdb14cd..41f6a129d1b5e 100644 --- a/x-pack/plugins/siem/public/alerts/containers/detection_engine/alerts/translations.ts +++ b/x-pack/plugins/security_solution/public/alerts/containers/detection_engine/alerts/translations.ts @@ -7,28 +7,28 @@ import { i18n } from '@kbn/i18n'; export const ALERT_FETCH_FAILURE = i18n.translate( - 'xpack.siem.containers.detectionEngine.alerts.errorFetchingAlertsDescription', + 'xpack.securitySolution.containers.detectionEngine.alerts.errorFetchingAlertsDescription', { defaultMessage: 'Failed to query alerts', } ); export const PRIVILEGE_FETCH_FAILURE = i18n.translate( - 'xpack.siem.containers.detectionEngine.alerts.errorFetchingAlertsDescription', + 'xpack.securitySolution.containers.detectionEngine.alerts.errorFetchingAlertsDescription', { defaultMessage: 'Failed to query alerts', } ); export const SIGNAL_GET_NAME_FAILURE = i18n.translate( - 'xpack.siem.containers.detectionEngine.alerts.errorGetAlertDescription', + 'xpack.securitySolution.containers.detectionEngine.alerts.errorGetAlertDescription', { defaultMessage: 'Failed to get signal index name', } ); export const SIGNAL_POST_FAILURE = i18n.translate( - 'xpack.siem.containers.detectionEngine.alerts.errorPostAlertDescription', + 'xpack.securitySolution.containers.detectionEngine.alerts.errorPostAlertDescription', { defaultMessage: 'Failed to create signal index', } diff --git a/x-pack/plugins/siem/public/alerts/containers/detection_engine/alerts/types.ts b/x-pack/plugins/security_solution/public/alerts/containers/detection_engine/alerts/types.ts similarity index 100% rename from x-pack/plugins/siem/public/alerts/containers/detection_engine/alerts/types.ts rename to x-pack/plugins/security_solution/public/alerts/containers/detection_engine/alerts/types.ts diff --git a/x-pack/plugins/siem/public/alerts/containers/detection_engine/alerts/use_privilege_user.test.tsx b/x-pack/plugins/security_solution/public/alerts/containers/detection_engine/alerts/use_privilege_user.test.tsx similarity index 100% rename from x-pack/plugins/siem/public/alerts/containers/detection_engine/alerts/use_privilege_user.test.tsx rename to x-pack/plugins/security_solution/public/alerts/containers/detection_engine/alerts/use_privilege_user.test.tsx diff --git a/x-pack/plugins/siem/public/alerts/containers/detection_engine/alerts/use_privilege_user.tsx b/x-pack/plugins/security_solution/public/alerts/containers/detection_engine/alerts/use_privilege_user.tsx similarity index 100% rename from x-pack/plugins/siem/public/alerts/containers/detection_engine/alerts/use_privilege_user.tsx rename to x-pack/plugins/security_solution/public/alerts/containers/detection_engine/alerts/use_privilege_user.tsx diff --git a/x-pack/plugins/siem/public/alerts/containers/detection_engine/alerts/use_query.test.tsx b/x-pack/plugins/security_solution/public/alerts/containers/detection_engine/alerts/use_query.test.tsx similarity index 100% rename from x-pack/plugins/siem/public/alerts/containers/detection_engine/alerts/use_query.test.tsx rename to x-pack/plugins/security_solution/public/alerts/containers/detection_engine/alerts/use_query.test.tsx diff --git a/x-pack/plugins/siem/public/alerts/containers/detection_engine/alerts/use_query.tsx b/x-pack/plugins/security_solution/public/alerts/containers/detection_engine/alerts/use_query.tsx similarity index 100% rename from x-pack/plugins/siem/public/alerts/containers/detection_engine/alerts/use_query.tsx rename to x-pack/plugins/security_solution/public/alerts/containers/detection_engine/alerts/use_query.tsx diff --git a/x-pack/plugins/siem/public/alerts/containers/detection_engine/alerts/use_signal_index.test.tsx b/x-pack/plugins/security_solution/public/alerts/containers/detection_engine/alerts/use_signal_index.test.tsx similarity index 100% rename from x-pack/plugins/siem/public/alerts/containers/detection_engine/alerts/use_signal_index.test.tsx rename to x-pack/plugins/security_solution/public/alerts/containers/detection_engine/alerts/use_signal_index.test.tsx diff --git a/x-pack/plugins/siem/public/alerts/containers/detection_engine/alerts/use_signal_index.tsx b/x-pack/plugins/security_solution/public/alerts/containers/detection_engine/alerts/use_signal_index.tsx similarity index 100% rename from x-pack/plugins/siem/public/alerts/containers/detection_engine/alerts/use_signal_index.tsx rename to x-pack/plugins/security_solution/public/alerts/containers/detection_engine/alerts/use_signal_index.tsx diff --git a/x-pack/plugins/siem/public/alerts/containers/detection_engine/rules/__mocks__/api.ts b/x-pack/plugins/security_solution/public/alerts/containers/detection_engine/rules/__mocks__/api.ts similarity index 100% rename from x-pack/plugins/siem/public/alerts/containers/detection_engine/rules/__mocks__/api.ts rename to x-pack/plugins/security_solution/public/alerts/containers/detection_engine/rules/__mocks__/api.ts diff --git a/x-pack/plugins/siem/public/alerts/containers/detection_engine/rules/api.test.ts b/x-pack/plugins/security_solution/public/alerts/containers/detection_engine/rules/api.test.ts similarity index 100% rename from x-pack/plugins/siem/public/alerts/containers/detection_engine/rules/api.test.ts rename to x-pack/plugins/security_solution/public/alerts/containers/detection_engine/rules/api.test.ts diff --git a/x-pack/plugins/siem/public/alerts/containers/detection_engine/rules/api.ts b/x-pack/plugins/security_solution/public/alerts/containers/detection_engine/rules/api.ts similarity index 100% rename from x-pack/plugins/siem/public/alerts/containers/detection_engine/rules/api.ts rename to x-pack/plugins/security_solution/public/alerts/containers/detection_engine/rules/api.ts diff --git a/x-pack/plugins/siem/public/alerts/containers/detection_engine/rules/fetch_index_patterns.test.tsx b/x-pack/plugins/security_solution/public/alerts/containers/detection_engine/rules/fetch_index_patterns.test.tsx similarity index 100% rename from x-pack/plugins/siem/public/alerts/containers/detection_engine/rules/fetch_index_patterns.test.tsx rename to x-pack/plugins/security_solution/public/alerts/containers/detection_engine/rules/fetch_index_patterns.test.tsx diff --git a/x-pack/plugins/siem/public/alerts/containers/detection_engine/rules/fetch_index_patterns.tsx b/x-pack/plugins/security_solution/public/alerts/containers/detection_engine/rules/fetch_index_patterns.tsx similarity index 100% rename from x-pack/plugins/siem/public/alerts/containers/detection_engine/rules/fetch_index_patterns.tsx rename to x-pack/plugins/security_solution/public/alerts/containers/detection_engine/rules/fetch_index_patterns.tsx diff --git a/x-pack/plugins/siem/public/alerts/containers/detection_engine/rules/index.ts b/x-pack/plugins/security_solution/public/alerts/containers/detection_engine/rules/index.ts similarity index 100% rename from x-pack/plugins/siem/public/alerts/containers/detection_engine/rules/index.ts rename to x-pack/plugins/security_solution/public/alerts/containers/detection_engine/rules/index.ts diff --git a/x-pack/plugins/siem/public/alerts/containers/detection_engine/rules/mock.ts b/x-pack/plugins/security_solution/public/alerts/containers/detection_engine/rules/mock.ts similarity index 100% rename from x-pack/plugins/siem/public/alerts/containers/detection_engine/rules/mock.ts rename to x-pack/plugins/security_solution/public/alerts/containers/detection_engine/rules/mock.ts diff --git a/x-pack/plugins/siem/public/alerts/containers/detection_engine/rules/persist_rule.test.tsx b/x-pack/plugins/security_solution/public/alerts/containers/detection_engine/rules/persist_rule.test.tsx similarity index 100% rename from x-pack/plugins/siem/public/alerts/containers/detection_engine/rules/persist_rule.test.tsx rename to x-pack/plugins/security_solution/public/alerts/containers/detection_engine/rules/persist_rule.test.tsx diff --git a/x-pack/plugins/siem/public/alerts/containers/detection_engine/rules/persist_rule.tsx b/x-pack/plugins/security_solution/public/alerts/containers/detection_engine/rules/persist_rule.tsx similarity index 100% rename from x-pack/plugins/siem/public/alerts/containers/detection_engine/rules/persist_rule.tsx rename to x-pack/plugins/security_solution/public/alerts/containers/detection_engine/rules/persist_rule.tsx diff --git a/x-pack/plugins/siem/public/alerts/containers/detection_engine/rules/translations.ts b/x-pack/plugins/security_solution/public/alerts/containers/detection_engine/rules/translations.ts similarity index 59% rename from x-pack/plugins/siem/public/alerts/containers/detection_engine/rules/translations.ts rename to x-pack/plugins/security_solution/public/alerts/containers/detection_engine/rules/translations.ts index 84e008312fefe..2b4b32bce9c7b 100644 --- a/x-pack/plugins/siem/public/alerts/containers/detection_engine/rules/translations.ts +++ b/x-pack/plugins/security_solution/public/alerts/containers/detection_engine/rules/translations.ts @@ -6,33 +6,36 @@ import { i18n } from '@kbn/i18n'; -export const RULE_FETCH_FAILURE = i18n.translate('xpack.siem.containers.detectionEngine.rules', { - defaultMessage: 'Failed to fetch Rules', -}); +export const RULE_FETCH_FAILURE = i18n.translate( + 'xpack.securitySolution.containers.detectionEngine.rules', + { + defaultMessage: 'Failed to fetch Rules', + } +); export const RULE_ADD_FAILURE = i18n.translate( - 'xpack.siem.containers.detectionEngine.addRuleFailDescription', + 'xpack.securitySolution.containers.detectionEngine.addRuleFailDescription', { defaultMessage: 'Failed to add Rule', } ); export const RULE_PREPACKAGED_FAILURE = i18n.translate( - 'xpack.siem.containers.detectionEngine.createPrePackagedRuleFailDescription', + 'xpack.securitySolution.containers.detectionEngine.createPrePackagedRuleFailDescription', { defaultMessage: 'Failed to installed pre-packaged rules from elastic', } ); export const RULE_PREPACKAGED_SUCCESS = i18n.translate( - 'xpack.siem.containers.detectionEngine.createPrePackagedRuleSuccesDescription', + 'xpack.securitySolution.containers.detectionEngine.createPrePackagedRuleSuccesDescription', { defaultMessage: 'Installed pre-packaged rules from elastic', } ); export const TAG_FETCH_FAILURE = i18n.translate( - 'xpack.siem.containers.detectionEngine.tagFetchFailDescription', + 'xpack.securitySolution.containers.detectionEngine.tagFetchFailDescription', { defaultMessage: 'Failed to fetch Tags', } diff --git a/x-pack/plugins/siem/public/alerts/containers/detection_engine/rules/types.ts b/x-pack/plugins/security_solution/public/alerts/containers/detection_engine/rules/types.ts similarity index 100% rename from x-pack/plugins/siem/public/alerts/containers/detection_engine/rules/types.ts rename to x-pack/plugins/security_solution/public/alerts/containers/detection_engine/rules/types.ts diff --git a/x-pack/plugins/siem/public/alerts/containers/detection_engine/rules/use_pre_packaged_rules.test.tsx b/x-pack/plugins/security_solution/public/alerts/containers/detection_engine/rules/use_pre_packaged_rules.test.tsx similarity index 100% rename from x-pack/plugins/siem/public/alerts/containers/detection_engine/rules/use_pre_packaged_rules.test.tsx rename to x-pack/plugins/security_solution/public/alerts/containers/detection_engine/rules/use_pre_packaged_rules.test.tsx diff --git a/x-pack/plugins/siem/public/alerts/containers/detection_engine/rules/use_pre_packaged_rules.tsx b/x-pack/plugins/security_solution/public/alerts/containers/detection_engine/rules/use_pre_packaged_rules.tsx similarity index 100% rename from x-pack/plugins/siem/public/alerts/containers/detection_engine/rules/use_pre_packaged_rules.tsx rename to x-pack/plugins/security_solution/public/alerts/containers/detection_engine/rules/use_pre_packaged_rules.tsx diff --git a/x-pack/plugins/siem/public/alerts/containers/detection_engine/rules/use_rule.test.tsx b/x-pack/plugins/security_solution/public/alerts/containers/detection_engine/rules/use_rule.test.tsx similarity index 100% rename from x-pack/plugins/siem/public/alerts/containers/detection_engine/rules/use_rule.test.tsx rename to x-pack/plugins/security_solution/public/alerts/containers/detection_engine/rules/use_rule.test.tsx diff --git a/x-pack/plugins/siem/public/alerts/containers/detection_engine/rules/use_rule.tsx b/x-pack/plugins/security_solution/public/alerts/containers/detection_engine/rules/use_rule.tsx similarity index 100% rename from x-pack/plugins/siem/public/alerts/containers/detection_engine/rules/use_rule.tsx rename to x-pack/plugins/security_solution/public/alerts/containers/detection_engine/rules/use_rule.tsx diff --git a/x-pack/plugins/siem/public/alerts/containers/detection_engine/rules/use_rule_status.test.tsx b/x-pack/plugins/security_solution/public/alerts/containers/detection_engine/rules/use_rule_status.test.tsx similarity index 100% rename from x-pack/plugins/siem/public/alerts/containers/detection_engine/rules/use_rule_status.test.tsx rename to x-pack/plugins/security_solution/public/alerts/containers/detection_engine/rules/use_rule_status.test.tsx diff --git a/x-pack/plugins/siem/public/alerts/containers/detection_engine/rules/use_rule_status.tsx b/x-pack/plugins/security_solution/public/alerts/containers/detection_engine/rules/use_rule_status.tsx similarity index 100% rename from x-pack/plugins/siem/public/alerts/containers/detection_engine/rules/use_rule_status.tsx rename to x-pack/plugins/security_solution/public/alerts/containers/detection_engine/rules/use_rule_status.tsx diff --git a/x-pack/plugins/siem/public/alerts/containers/detection_engine/rules/use_rules.test.tsx b/x-pack/plugins/security_solution/public/alerts/containers/detection_engine/rules/use_rules.test.tsx similarity index 100% rename from x-pack/plugins/siem/public/alerts/containers/detection_engine/rules/use_rules.test.tsx rename to x-pack/plugins/security_solution/public/alerts/containers/detection_engine/rules/use_rules.test.tsx diff --git a/x-pack/plugins/siem/public/alerts/containers/detection_engine/rules/use_rules.tsx b/x-pack/plugins/security_solution/public/alerts/containers/detection_engine/rules/use_rules.tsx similarity index 100% rename from x-pack/plugins/siem/public/alerts/containers/detection_engine/rules/use_rules.tsx rename to x-pack/plugins/security_solution/public/alerts/containers/detection_engine/rules/use_rules.tsx diff --git a/x-pack/plugins/siem/public/alerts/containers/detection_engine/rules/use_tags.test.tsx b/x-pack/plugins/security_solution/public/alerts/containers/detection_engine/rules/use_tags.test.tsx similarity index 100% rename from x-pack/plugins/siem/public/alerts/containers/detection_engine/rules/use_tags.test.tsx rename to x-pack/plugins/security_solution/public/alerts/containers/detection_engine/rules/use_tags.test.tsx diff --git a/x-pack/plugins/siem/public/alerts/containers/detection_engine/rules/use_tags.tsx b/x-pack/plugins/security_solution/public/alerts/containers/detection_engine/rules/use_tags.tsx similarity index 100% rename from x-pack/plugins/siem/public/alerts/containers/detection_engine/rules/use_tags.tsx rename to x-pack/plugins/security_solution/public/alerts/containers/detection_engine/rules/use_tags.tsx diff --git a/x-pack/plugins/siem/public/alerts/index.ts b/x-pack/plugins/security_solution/public/alerts/index.ts similarity index 100% rename from x-pack/plugins/siem/public/alerts/index.ts rename to x-pack/plugins/security_solution/public/alerts/index.ts diff --git a/x-pack/plugins/siem/public/alerts/mitre/mitre_tactics_techniques.ts b/x-pack/plugins/security_solution/public/alerts/mitre/mitre_tactics_techniques.ts similarity index 79% rename from x-pack/plugins/siem/public/alerts/mitre/mitre_tactics_techniques.ts rename to x-pack/plugins/security_solution/public/alerts/mitre/mitre_tactics_techniques.ts index 16ab73365222b..fb8deeec8309c 100644 --- a/x-pack/plugins/siem/public/alerts/mitre/mitre_tactics_techniques.ts +++ b/x-pack/plugins/security_solution/public/alerts/mitre/mitre_tactics_techniques.ts @@ -76,9 +76,12 @@ export const tacticsOptions: MitreTacticsOptions[] = [ id: 'TA0009', name: 'Collection', reference: 'https://attack.mitre.org/tactics/TA0009', - text: i18n.translate('xpack.siem.detectionEngine.mitreAttackTactics.collectionDescription', { - defaultMessage: 'Collection (TA0009)', - }), + text: i18n.translate( + 'xpack.securitySolution.detectionEngine.mitreAttackTactics.collectionDescription', + { + defaultMessage: 'Collection (TA0009)', + } + ), value: 'collection', }, { @@ -86,7 +89,7 @@ export const tacticsOptions: MitreTacticsOptions[] = [ name: 'Command and Control', reference: 'https://attack.mitre.org/tactics/TA0011', text: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTactics.commandAndControlDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTactics.commandAndControlDescription', { defaultMessage: 'Command and Control (TA0011)' } ), value: 'commandAndControl', @@ -96,7 +99,7 @@ export const tacticsOptions: MitreTacticsOptions[] = [ name: 'Credential Access', reference: 'https://attack.mitre.org/tactics/TA0006', text: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTactics.credentialAccessDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTactics.credentialAccessDescription', { defaultMessage: 'Credential Access (TA0006)' } ), value: 'credentialAccess', @@ -106,7 +109,7 @@ export const tacticsOptions: MitreTacticsOptions[] = [ name: 'Defense Evasion', reference: 'https://attack.mitre.org/tactics/TA0005', text: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTactics.defenseEvasionDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTactics.defenseEvasionDescription', { defaultMessage: 'Defense Evasion (TA0005)' } ), value: 'defenseEvasion', @@ -115,45 +118,60 @@ export const tacticsOptions: MitreTacticsOptions[] = [ id: 'TA0007', name: 'Discovery', reference: 'https://attack.mitre.org/tactics/TA0007', - text: i18n.translate('xpack.siem.detectionEngine.mitreAttackTactics.discoveryDescription', { - defaultMessage: 'Discovery (TA0007)', - }), + text: i18n.translate( + 'xpack.securitySolution.detectionEngine.mitreAttackTactics.discoveryDescription', + { + defaultMessage: 'Discovery (TA0007)', + } + ), value: 'discovery', }, { id: 'TA0002', name: 'Execution', reference: 'https://attack.mitre.org/tactics/TA0002', - text: i18n.translate('xpack.siem.detectionEngine.mitreAttackTactics.executionDescription', { - defaultMessage: 'Execution (TA0002)', - }), + text: i18n.translate( + 'xpack.securitySolution.detectionEngine.mitreAttackTactics.executionDescription', + { + defaultMessage: 'Execution (TA0002)', + } + ), value: 'execution', }, { id: 'TA0010', name: 'Exfiltration', reference: 'https://attack.mitre.org/tactics/TA0010', - text: i18n.translate('xpack.siem.detectionEngine.mitreAttackTactics.exfiltrationDescription', { - defaultMessage: 'Exfiltration (TA0010)', - }), + text: i18n.translate( + 'xpack.securitySolution.detectionEngine.mitreAttackTactics.exfiltrationDescription', + { + defaultMessage: 'Exfiltration (TA0010)', + } + ), value: 'exfiltration', }, { id: 'TA0040', name: 'Impact', reference: 'https://attack.mitre.org/tactics/TA0040', - text: i18n.translate('xpack.siem.detectionEngine.mitreAttackTactics.impactDescription', { - defaultMessage: 'Impact (TA0040)', - }), + text: i18n.translate( + 'xpack.securitySolution.detectionEngine.mitreAttackTactics.impactDescription', + { + defaultMessage: 'Impact (TA0040)', + } + ), value: 'impact', }, { id: 'TA0001', name: 'Initial Access', reference: 'https://attack.mitre.org/tactics/TA0001', - text: i18n.translate('xpack.siem.detectionEngine.mitreAttackTactics.initialAccessDescription', { - defaultMessage: 'Initial Access (TA0001)', - }), + text: i18n.translate( + 'xpack.securitySolution.detectionEngine.mitreAttackTactics.initialAccessDescription', + { + defaultMessage: 'Initial Access (TA0001)', + } + ), value: 'initialAccess', }, { @@ -161,7 +179,7 @@ export const tacticsOptions: MitreTacticsOptions[] = [ name: 'Lateral Movement', reference: 'https://attack.mitre.org/tactics/TA0008', text: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTactics.lateralMovementDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTactics.lateralMovementDescription', { defaultMessage: 'Lateral Movement (TA0008)' } ), value: 'lateralMovement', @@ -170,9 +188,12 @@ export const tacticsOptions: MitreTacticsOptions[] = [ id: 'TA0003', name: 'Persistence', reference: 'https://attack.mitre.org/tactics/TA0003', - text: i18n.translate('xpack.siem.detectionEngine.mitreAttackTactics.persistenceDescription', { - defaultMessage: 'Persistence (TA0003)', - }), + text: i18n.translate( + 'xpack.securitySolution.detectionEngine.mitreAttackTactics.persistenceDescription', + { + defaultMessage: 'Persistence (TA0003)', + } + ), value: 'persistence', }, { @@ -180,7 +201,7 @@ export const tacticsOptions: MitreTacticsOptions[] = [ name: 'Privilege Escalation', reference: 'https://attack.mitre.org/tactics/TA0004', text: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTactics.privilegeEscalationDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTactics.privilegeEscalationDescription', { defaultMessage: 'Privilege Escalation (TA0004)' } ), value: 'privilegeEscalation', @@ -1789,7 +1810,7 @@ export const technique = [ export const techniquesOptions: MitreTechniquesOptions[] = [ { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.bashProfileAndBashrcDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.bashProfileAndBashrcDescription', { defaultMessage: '.bash_profile and .bashrc (T1156)' } ), id: 'T1156', @@ -1800,7 +1821,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.accessTokenManipulationDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.accessTokenManipulationDescription', { defaultMessage: 'Access Token Manipulation (T1134)' } ), id: 'T1134', @@ -1811,7 +1832,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.accessibilityFeaturesDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.accessibilityFeaturesDescription', { defaultMessage: 'Accessibility Features (T1015)' } ), id: 'T1015', @@ -1822,7 +1843,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.accountAccessRemovalDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.accountAccessRemovalDescription', { defaultMessage: 'Account Access Removal (T1531)' } ), id: 'T1531', @@ -1833,7 +1854,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.accountDiscoveryDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.accountDiscoveryDescription', { defaultMessage: 'Account Discovery (T1087)' } ), id: 'T1087', @@ -1844,7 +1865,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.accountManipulationDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.accountManipulationDescription', { defaultMessage: 'Account Manipulation (T1098)' } ), id: 'T1098', @@ -1855,7 +1876,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.appCertDlLsDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.appCertDlLsDescription', { defaultMessage: 'AppCert DLLs (T1182)' } ), id: 'T1182', @@ -1866,7 +1887,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.appInitDlLsDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.appInitDlLsDescription', { defaultMessage: 'AppInit DLLs (T1103)' } ), id: 'T1103', @@ -1877,7 +1898,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.appleScriptDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.appleScriptDescription', { defaultMessage: 'AppleScript (T1155)' } ), id: 'T1155', @@ -1888,7 +1909,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.applicationAccessTokenDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.applicationAccessTokenDescription', { defaultMessage: 'Application Access Token (T1527)' } ), id: 'T1527', @@ -1899,7 +1920,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.applicationDeploymentSoftwareDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.applicationDeploymentSoftwareDescription', { defaultMessage: 'Application Deployment Software (T1017)' } ), id: 'T1017', @@ -1910,7 +1931,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.applicationShimmingDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.applicationShimmingDescription', { defaultMessage: 'Application Shimming (T1138)' } ), id: 'T1138', @@ -1921,7 +1942,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.applicationWindowDiscoveryDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.applicationWindowDiscoveryDescription', { defaultMessage: 'Application Window Discovery (T1010)' } ), id: 'T1010', @@ -1932,7 +1953,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.audioCaptureDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.audioCaptureDescription', { defaultMessage: 'Audio Capture (T1123)' } ), id: 'T1123', @@ -1943,7 +1964,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.authenticationPackageDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.authenticationPackageDescription', { defaultMessage: 'Authentication Package (T1131)' } ), id: 'T1131', @@ -1954,7 +1975,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.automatedCollectionDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.automatedCollectionDescription', { defaultMessage: 'Automated Collection (T1119)' } ), id: 'T1119', @@ -1965,7 +1986,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.automatedExfiltrationDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.automatedExfiltrationDescription', { defaultMessage: 'Automated Exfiltration (T1020)' } ), id: 'T1020', @@ -1975,9 +1996,12 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ value: 'automatedExfiltration', }, { - label: i18n.translate('xpack.siem.detectionEngine.mitreAttackTechniques.bitsJobsDescription', { - defaultMessage: 'BITS Jobs (T1197)', - }), + label: i18n.translate( + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.bitsJobsDescription', + { + defaultMessage: 'BITS Jobs (T1197)', + } + ), id: 'T1197', name: 'BITS Jobs', reference: 'https://attack.mitre.org/techniques/T1197', @@ -1986,7 +2010,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.bashHistoryDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.bashHistoryDescription', { defaultMessage: 'Bash History (T1139)' } ), id: 'T1139', @@ -1997,7 +2021,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.binaryPaddingDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.binaryPaddingDescription', { defaultMessage: 'Binary Padding (T1009)' } ), id: 'T1009', @@ -2007,9 +2031,12 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ value: 'binaryPadding', }, { - label: i18n.translate('xpack.siem.detectionEngine.mitreAttackTechniques.bootkitDescription', { - defaultMessage: 'Bootkit (T1067)', - }), + label: i18n.translate( + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.bootkitDescription', + { + defaultMessage: 'Bootkit (T1067)', + } + ), id: 'T1067', name: 'Bootkit', reference: 'https://attack.mitre.org/techniques/T1067', @@ -2018,7 +2045,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.browserBookmarkDiscoveryDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.browserBookmarkDiscoveryDescription', { defaultMessage: 'Browser Bookmark Discovery (T1217)' } ), id: 'T1217', @@ -2029,7 +2056,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.browserExtensionsDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.browserExtensionsDescription', { defaultMessage: 'Browser Extensions (T1176)' } ), id: 'T1176', @@ -2040,7 +2067,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.bruteForceDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.bruteForceDescription', { defaultMessage: 'Brute Force (T1110)' } ), id: 'T1110', @@ -2051,7 +2078,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.bypassUserAccountControlDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.bypassUserAccountControlDescription', { defaultMessage: 'Bypass User Account Control (T1088)' } ), id: 'T1088', @@ -2061,9 +2088,12 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ value: 'bypassUserAccountControl', }, { - label: i18n.translate('xpack.siem.detectionEngine.mitreAttackTechniques.cmstpDescription', { - defaultMessage: 'CMSTP (T1191)', - }), + label: i18n.translate( + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.cmstpDescription', + { + defaultMessage: 'CMSTP (T1191)', + } + ), id: 'T1191', name: 'CMSTP', reference: 'https://attack.mitre.org/techniques/T1191', @@ -2072,7 +2102,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.changeDefaultFileAssociationDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.changeDefaultFileAssociationDescription', { defaultMessage: 'Change Default File Association (T1042)' } ), id: 'T1042', @@ -2083,7 +2113,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.clearCommandHistoryDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.clearCommandHistoryDescription', { defaultMessage: 'Clear Command History (T1146)' } ), id: 'T1146', @@ -2094,7 +2124,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.clipboardDataDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.clipboardDataDescription', { defaultMessage: 'Clipboard Data (T1115)' } ), id: 'T1115', @@ -2105,7 +2135,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.cloudInstanceMetadataApiDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.cloudInstanceMetadataApiDescription', { defaultMessage: 'Cloud Instance Metadata API (T1522)' } ), id: 'T1522', @@ -2116,7 +2146,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.cloudServiceDashboardDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.cloudServiceDashboardDescription', { defaultMessage: 'Cloud Service Dashboard (T1538)' } ), id: 'T1538', @@ -2127,7 +2157,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.cloudServiceDiscoveryDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.cloudServiceDiscoveryDescription', { defaultMessage: 'Cloud Service Discovery (T1526)' } ), id: 'T1526', @@ -2138,7 +2168,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.codeSigningDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.codeSigningDescription', { defaultMessage: 'Code Signing (T1116)' } ), id: 'T1116', @@ -2149,7 +2179,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.commandLineInterfaceDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.commandLineInterfaceDescription', { defaultMessage: 'Command-Line Interface (T1059)' } ), id: 'T1059', @@ -2160,7 +2190,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.commonlyUsedPortDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.commonlyUsedPortDescription', { defaultMessage: 'Commonly Used Port (T1043)' } ), id: 'T1043', @@ -2171,7 +2201,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.communicationThroughRemovableMediaDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.communicationThroughRemovableMediaDescription', { defaultMessage: 'Communication Through Removable Media (T1092)' } ), id: 'T1092', @@ -2182,7 +2212,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.compileAfterDeliveryDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.compileAfterDeliveryDescription', { defaultMessage: 'Compile After Delivery (T1500)' } ), id: 'T1500', @@ -2193,7 +2223,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.compiledHtmlFileDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.compiledHtmlFileDescription', { defaultMessage: 'Compiled HTML File (T1223)' } ), id: 'T1223', @@ -2204,7 +2234,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.componentFirmwareDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.componentFirmwareDescription', { defaultMessage: 'Component Firmware (T1109)' } ), id: 'T1109', @@ -2215,7 +2245,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.componentObjectModelHijackingDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.componentObjectModelHijackingDescription', { defaultMessage: 'Component Object Model Hijacking (T1122)' } ), id: 'T1122', @@ -2226,7 +2256,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.componentObjectModelAndDistributedComDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.componentObjectModelAndDistributedComDescription', { defaultMessage: 'Component Object Model and Distributed COM (T1175)' } ), id: 'T1175', @@ -2237,7 +2267,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.connectionProxyDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.connectionProxyDescription', { defaultMessage: 'Connection Proxy (T1090)' } ), id: 'T1090', @@ -2248,7 +2278,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.controlPanelItemsDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.controlPanelItemsDescription', { defaultMessage: 'Control Panel Items (T1196)' } ), id: 'T1196', @@ -2259,7 +2289,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.createAccountDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.createAccountDescription', { defaultMessage: 'Create Account (T1136)' } ), id: 'T1136', @@ -2270,7 +2300,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.credentialDumpingDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.credentialDumpingDescription', { defaultMessage: 'Credential Dumping (T1003)' } ), id: 'T1003', @@ -2281,7 +2311,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.credentialsFromWebBrowsersDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.credentialsFromWebBrowsersDescription', { defaultMessage: 'Credentials from Web Browsers (T1503)' } ), id: 'T1503', @@ -2292,7 +2322,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.credentialsInFilesDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.credentialsInFilesDescription', { defaultMessage: 'Credentials in Files (T1081)' } ), id: 'T1081', @@ -2303,7 +2333,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.credentialsInRegistryDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.credentialsInRegistryDescription', { defaultMessage: 'Credentials in Registry (T1214)' } ), id: 'T1214', @@ -2314,7 +2344,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.customCommandAndControlProtocolDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.customCommandAndControlProtocolDescription', { defaultMessage: 'Custom Command and Control Protocol (T1094)' } ), id: 'T1094', @@ -2325,7 +2355,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.customCryptographicProtocolDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.customCryptographicProtocolDescription', { defaultMessage: 'Custom Cryptographic Protocol (T1024)' } ), id: 'T1024', @@ -2335,9 +2365,12 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ value: 'customCryptographicProtocol', }, { - label: i18n.translate('xpack.siem.detectionEngine.mitreAttackTechniques.dcShadowDescription', { - defaultMessage: 'DCShadow (T1207)', - }), + label: i18n.translate( + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.dcShadowDescription', + { + defaultMessage: 'DCShadow (T1207)', + } + ), id: 'T1207', name: 'DCShadow', reference: 'https://attack.mitre.org/techniques/T1207', @@ -2346,7 +2379,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.dllSearchOrderHijackingDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.dllSearchOrderHijackingDescription', { defaultMessage: 'DLL Search Order Hijacking (T1038)' } ), id: 'T1038', @@ -2357,7 +2390,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.dllSideLoadingDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.dllSideLoadingDescription', { defaultMessage: 'DLL Side-Loading (T1073)' } ), id: 'T1073', @@ -2368,7 +2401,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.dataCompressedDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.dataCompressedDescription', { defaultMessage: 'Data Compressed (T1002)' } ), id: 'T1002', @@ -2379,7 +2412,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.dataDestructionDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.dataDestructionDescription', { defaultMessage: 'Data Destruction (T1485)' } ), id: 'T1485', @@ -2390,7 +2423,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.dataEncodingDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.dataEncodingDescription', { defaultMessage: 'Data Encoding (T1132)' } ), id: 'T1132', @@ -2401,7 +2434,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.dataEncryptedDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.dataEncryptedDescription', { defaultMessage: 'Data Encrypted (T1022)' } ), id: 'T1022', @@ -2412,7 +2445,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.dataEncryptedForImpactDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.dataEncryptedForImpactDescription', { defaultMessage: 'Data Encrypted for Impact (T1486)' } ), id: 'T1486', @@ -2423,7 +2456,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.dataObfuscationDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.dataObfuscationDescription', { defaultMessage: 'Data Obfuscation (T1001)' } ), id: 'T1001', @@ -2434,7 +2467,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.dataStagedDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.dataStagedDescription', { defaultMessage: 'Data Staged (T1074)' } ), id: 'T1074', @@ -2445,7 +2478,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.dataTransferSizeLimitsDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.dataTransferSizeLimitsDescription', { defaultMessage: 'Data Transfer Size Limits (T1030)' } ), id: 'T1030', @@ -2456,7 +2489,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.dataFromCloudStorageObjectDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.dataFromCloudStorageObjectDescription', { defaultMessage: 'Data from Cloud Storage Object (T1530)' } ), id: 'T1530', @@ -2467,7 +2500,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.dataFromInformationRepositoriesDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.dataFromInformationRepositoriesDescription', { defaultMessage: 'Data from Information Repositories (T1213)' } ), id: 'T1213', @@ -2478,7 +2511,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.dataFromLocalSystemDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.dataFromLocalSystemDescription', { defaultMessage: 'Data from Local System (T1005)' } ), id: 'T1005', @@ -2489,7 +2522,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.dataFromNetworkSharedDriveDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.dataFromNetworkSharedDriveDescription', { defaultMessage: 'Data from Network Shared Drive (T1039)' } ), id: 'T1039', @@ -2500,7 +2533,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.dataFromRemovableMediaDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.dataFromRemovableMediaDescription', { defaultMessage: 'Data from Removable Media (T1025)' } ), id: 'T1025', @@ -2511,7 +2544,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.defacementDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.defacementDescription', { defaultMessage: 'Defacement (T1491)' } ), id: 'T1491', @@ -2522,7 +2555,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.deobfuscateDecodeFilesOrInformationDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.deobfuscateDecodeFilesOrInformationDescription', { defaultMessage: 'Deobfuscate/Decode Files or Information (T1140)' } ), id: 'T1140', @@ -2533,7 +2566,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.disablingSecurityToolsDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.disablingSecurityToolsDescription', { defaultMessage: 'Disabling Security Tools (T1089)' } ), id: 'T1089', @@ -2544,7 +2577,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.diskContentWipeDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.diskContentWipeDescription', { defaultMessage: 'Disk Content Wipe (T1488)' } ), id: 'T1488', @@ -2555,7 +2588,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.diskStructureWipeDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.diskStructureWipeDescription', { defaultMessage: 'Disk Structure Wipe (T1487)' } ), id: 'T1487', @@ -2566,7 +2599,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.domainFrontingDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.domainFrontingDescription', { defaultMessage: 'Domain Fronting (T1172)' } ), id: 'T1172', @@ -2577,7 +2610,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.domainGenerationAlgorithmsDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.domainGenerationAlgorithmsDescription', { defaultMessage: 'Domain Generation Algorithms (T1483)' } ), id: 'T1483', @@ -2588,7 +2621,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.domainTrustDiscoveryDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.domainTrustDiscoveryDescription', { defaultMessage: 'Domain Trust Discovery (T1482)' } ), id: 'T1482', @@ -2599,7 +2632,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.driveByCompromiseDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.driveByCompromiseDescription', { defaultMessage: 'Drive-by Compromise (T1189)' } ), id: 'T1189', @@ -2610,7 +2643,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.dylibHijackingDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.dylibHijackingDescription', { defaultMessage: 'Dylib Hijacking (T1157)' } ), id: 'T1157', @@ -2621,7 +2654,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.dynamicDataExchangeDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.dynamicDataExchangeDescription', { defaultMessage: 'Dynamic Data Exchange (T1173)' } ), id: 'T1173', @@ -2632,7 +2665,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.elevatedExecutionWithPromptDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.elevatedExecutionWithPromptDescription', { defaultMessage: 'Elevated Execution with Prompt (T1514)' } ), id: 'T1514', @@ -2643,7 +2676,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.emailCollectionDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.emailCollectionDescription', { defaultMessage: 'Email Collection (T1114)' } ), id: 'T1114', @@ -2653,9 +2686,12 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ value: 'emailCollection', }, { - label: i18n.translate('xpack.siem.detectionEngine.mitreAttackTechniques.emondDescription', { - defaultMessage: 'Emond (T1519)', - }), + label: i18n.translate( + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.emondDescription', + { + defaultMessage: 'Emond (T1519)', + } + ), id: 'T1519', name: 'Emond', reference: 'https://attack.mitre.org/techniques/T1519', @@ -2664,7 +2700,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.endpointDenialOfServiceDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.endpointDenialOfServiceDescription', { defaultMessage: 'Endpoint Denial of Service (T1499)' } ), id: 'T1499', @@ -2675,7 +2711,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.executionGuardrailsDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.executionGuardrailsDescription', { defaultMessage: 'Execution Guardrails (T1480)' } ), id: 'T1480', @@ -2686,7 +2722,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.executionThroughApiDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.executionThroughApiDescription', { defaultMessage: 'Execution through API (T1106)' } ), id: 'T1106', @@ -2697,7 +2733,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.executionThroughModuleLoadDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.executionThroughModuleLoadDescription', { defaultMessage: 'Execution through Module Load (T1129)' } ), id: 'T1129', @@ -2708,7 +2744,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.exfiltrationOverAlternativeProtocolDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.exfiltrationOverAlternativeProtocolDescription', { defaultMessage: 'Exfiltration Over Alternative Protocol (T1048)' } ), id: 'T1048', @@ -2719,7 +2755,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.exfiltrationOverCommandAndControlChannelDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.exfiltrationOverCommandAndControlChannelDescription', { defaultMessage: 'Exfiltration Over Command and Control Channel (T1041)' } ), id: 'T1041', @@ -2730,7 +2766,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.exfiltrationOverOtherNetworkMediumDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.exfiltrationOverOtherNetworkMediumDescription', { defaultMessage: 'Exfiltration Over Other Network Medium (T1011)' } ), id: 'T1011', @@ -2741,7 +2777,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.exfiltrationOverPhysicalMediumDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.exfiltrationOverPhysicalMediumDescription', { defaultMessage: 'Exfiltration Over Physical Medium (T1052)' } ), id: 'T1052', @@ -2752,7 +2788,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.exploitPublicFacingApplicationDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.exploitPublicFacingApplicationDescription', { defaultMessage: 'Exploit Public-Facing Application (T1190)' } ), id: 'T1190', @@ -2763,7 +2799,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.exploitationForClientExecutionDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.exploitationForClientExecutionDescription', { defaultMessage: 'Exploitation for Client Execution (T1203)' } ), id: 'T1203', @@ -2774,7 +2810,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.exploitationForCredentialAccessDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.exploitationForCredentialAccessDescription', { defaultMessage: 'Exploitation for Credential Access (T1212)' } ), id: 'T1212', @@ -2785,7 +2821,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.exploitationForDefenseEvasionDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.exploitationForDefenseEvasionDescription', { defaultMessage: 'Exploitation for Defense Evasion (T1211)' } ), id: 'T1211', @@ -2796,7 +2832,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.exploitationForPrivilegeEscalationDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.exploitationForPrivilegeEscalationDescription', { defaultMessage: 'Exploitation for Privilege Escalation (T1068)' } ), id: 'T1068', @@ -2807,7 +2843,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.exploitationOfRemoteServicesDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.exploitationOfRemoteServicesDescription', { defaultMessage: 'Exploitation of Remote Services (T1210)' } ), id: 'T1210', @@ -2818,7 +2854,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.externalRemoteServicesDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.externalRemoteServicesDescription', { defaultMessage: 'External Remote Services (T1133)' } ), id: 'T1133', @@ -2829,7 +2865,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.extraWindowMemoryInjectionDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.extraWindowMemoryInjectionDescription', { defaultMessage: 'Extra Window Memory Injection (T1181)' } ), id: 'T1181', @@ -2840,7 +2876,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.fallbackChannelsDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.fallbackChannelsDescription', { defaultMessage: 'Fallback Channels (T1008)' } ), id: 'T1008', @@ -2851,7 +2887,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.fileDeletionDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.fileDeletionDescription', { defaultMessage: 'File Deletion (T1107)' } ), id: 'T1107', @@ -2862,7 +2898,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.fileSystemLogicalOffsetsDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.fileSystemLogicalOffsetsDescription', { defaultMessage: 'File System Logical Offsets (T1006)' } ), id: 'T1006', @@ -2873,7 +2909,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.fileSystemPermissionsWeaknessDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.fileSystemPermissionsWeaknessDescription', { defaultMessage: 'File System Permissions Weakness (T1044)' } ), id: 'T1044', @@ -2884,7 +2920,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.fileAndDirectoryDiscoveryDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.fileAndDirectoryDiscoveryDescription', { defaultMessage: 'File and Directory Discovery (T1083)' } ), id: 'T1083', @@ -2895,7 +2931,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.fileAndDirectoryPermissionsModificationDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.fileAndDirectoryPermissionsModificationDescription', { defaultMessage: 'File and Directory Permissions Modification (T1222)' } ), id: 'T1222', @@ -2906,7 +2942,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.firmwareCorruptionDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.firmwareCorruptionDescription', { defaultMessage: 'Firmware Corruption (T1495)' } ), id: 'T1495', @@ -2917,7 +2953,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.forcedAuthenticationDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.forcedAuthenticationDescription', { defaultMessage: 'Forced Authentication (T1187)' } ), id: 'T1187', @@ -2928,7 +2964,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.gatekeeperBypassDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.gatekeeperBypassDescription', { defaultMessage: 'Gatekeeper Bypass (T1144)' } ), id: 'T1144', @@ -2939,7 +2975,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.graphicalUserInterfaceDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.graphicalUserInterfaceDescription', { defaultMessage: 'Graphical User Interface (T1061)' } ), id: 'T1061', @@ -2950,7 +2986,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.groupPolicyModificationDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.groupPolicyModificationDescription', { defaultMessage: 'Group Policy Modification (T1484)' } ), id: 'T1484', @@ -2961,7 +2997,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.histcontrolDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.histcontrolDescription', { defaultMessage: 'HISTCONTROL (T1148)' } ), id: 'T1148', @@ -2972,7 +3008,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.hardwareAdditionsDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.hardwareAdditionsDescription', { defaultMessage: 'Hardware Additions (T1200)' } ), id: 'T1200', @@ -2983,7 +3019,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.hiddenFilesAndDirectoriesDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.hiddenFilesAndDirectoriesDescription', { defaultMessage: 'Hidden Files and Directories (T1158)' } ), id: 'T1158', @@ -2994,7 +3030,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.hiddenUsersDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.hiddenUsersDescription', { defaultMessage: 'Hidden Users (T1147)' } ), id: 'T1147', @@ -3005,7 +3041,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.hiddenWindowDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.hiddenWindowDescription', { defaultMessage: 'Hidden Window (T1143)' } ), id: 'T1143', @@ -3015,9 +3051,12 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ value: 'hiddenWindow', }, { - label: i18n.translate('xpack.siem.detectionEngine.mitreAttackTechniques.hookingDescription', { - defaultMessage: 'Hooking (T1179)', - }), + label: i18n.translate( + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.hookingDescription', + { + defaultMessage: 'Hooking (T1179)', + } + ), id: 'T1179', name: 'Hooking', reference: 'https://attack.mitre.org/techniques/T1179', @@ -3026,7 +3065,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.hypervisorDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.hypervisorDescription', { defaultMessage: 'Hypervisor (T1062)' } ), id: 'T1062', @@ -3037,7 +3076,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.imageFileExecutionOptionsInjectionDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.imageFileExecutionOptionsInjectionDescription', { defaultMessage: 'Image File Execution Options Injection (T1183)' } ), id: 'T1183', @@ -3048,7 +3087,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.implantContainerImageDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.implantContainerImageDescription', { defaultMessage: 'Implant Container Image (T1525)' } ), id: 'T1525', @@ -3059,7 +3098,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.indicatorBlockingDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.indicatorBlockingDescription', { defaultMessage: 'Indicator Blocking (T1054)' } ), id: 'T1054', @@ -3070,7 +3109,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.indicatorRemovalFromToolsDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.indicatorRemovalFromToolsDescription', { defaultMessage: 'Indicator Removal from Tools (T1066)' } ), id: 'T1066', @@ -3081,7 +3120,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.indicatorRemovalOnHostDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.indicatorRemovalOnHostDescription', { defaultMessage: 'Indicator Removal on Host (T1070)' } ), id: 'T1070', @@ -3092,7 +3131,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.indirectCommandExecutionDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.indirectCommandExecutionDescription', { defaultMessage: 'Indirect Command Execution (T1202)' } ), id: 'T1202', @@ -3103,7 +3142,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.inhibitSystemRecoveryDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.inhibitSystemRecoveryDescription', { defaultMessage: 'Inhibit System Recovery (T1490)' } ), id: 'T1490', @@ -3114,7 +3153,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.inputCaptureDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.inputCaptureDescription', { defaultMessage: 'Input Capture (T1056)' } ), id: 'T1056', @@ -3125,7 +3164,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.inputPromptDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.inputPromptDescription', { defaultMessage: 'Input Prompt (T1141)' } ), id: 'T1141', @@ -3136,7 +3175,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.installRootCertificateDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.installRootCertificateDescription', { defaultMessage: 'Install Root Certificate (T1130)' } ), id: 'T1130', @@ -3147,7 +3186,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.installUtilDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.installUtilDescription', { defaultMessage: 'InstallUtil (T1118)' } ), id: 'T1118', @@ -3158,7 +3197,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.internalSpearphishingDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.internalSpearphishingDescription', { defaultMessage: 'Internal Spearphishing (T1534)' } ), id: 'T1534', @@ -3169,7 +3208,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.kerberoastingDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.kerberoastingDescription', { defaultMessage: 'Kerberoasting (T1208)' } ), id: 'T1208', @@ -3180,7 +3219,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.kernelModulesAndExtensionsDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.kernelModulesAndExtensionsDescription', { defaultMessage: 'Kernel Modules and Extensions (T1215)' } ), id: 'T1215', @@ -3190,9 +3229,12 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ value: 'kernelModulesAndExtensions', }, { - label: i18n.translate('xpack.siem.detectionEngine.mitreAttackTechniques.keychainDescription', { - defaultMessage: 'Keychain (T1142)', - }), + label: i18n.translate( + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.keychainDescription', + { + defaultMessage: 'Keychain (T1142)', + } + ), id: 'T1142', name: 'Keychain', reference: 'https://attack.mitre.org/techniques/T1142', @@ -3201,7 +3243,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.lcLoadDylibAdditionDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.lcLoadDylibAdditionDescription', { defaultMessage: 'LC_LOAD_DYLIB Addition (T1161)' } ), id: 'T1161', @@ -3212,7 +3254,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.lcMainHijackingDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.lcMainHijackingDescription', { defaultMessage: 'LC_MAIN Hijacking (T1149)' } ), id: 'T1149', @@ -3223,7 +3265,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.llmnrNbtNsPoisoningAndRelayDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.llmnrNbtNsPoisoningAndRelayDescription', { defaultMessage: 'LLMNR/NBT-NS Poisoning and Relay (T1171)' } ), id: 'T1171', @@ -3234,7 +3276,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.lsassDriverDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.lsassDriverDescription', { defaultMessage: 'LSASS Driver (T1177)' } ), id: 'T1177', @@ -3245,7 +3287,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.launchAgentDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.launchAgentDescription', { defaultMessage: 'Launch Agent (T1159)' } ), id: 'T1159', @@ -3256,7 +3298,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.launchDaemonDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.launchDaemonDescription', { defaultMessage: 'Launch Daemon (T1160)' } ), id: 'T1160', @@ -3266,9 +3308,12 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ value: 'launchDaemon', }, { - label: i18n.translate('xpack.siem.detectionEngine.mitreAttackTechniques.launchctlDescription', { - defaultMessage: 'Launchctl (T1152)', - }), + label: i18n.translate( + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.launchctlDescription', + { + defaultMessage: 'Launchctl (T1152)', + } + ), id: 'T1152', name: 'Launchctl', reference: 'https://attack.mitre.org/techniques/T1152', @@ -3277,7 +3322,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.localJobSchedulingDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.localJobSchedulingDescription', { defaultMessage: 'Local Job Scheduling (T1168)' } ), id: 'T1168', @@ -3287,9 +3332,12 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ value: 'localJobScheduling', }, { - label: i18n.translate('xpack.siem.detectionEngine.mitreAttackTechniques.loginItemDescription', { - defaultMessage: 'Login Item (T1162)', - }), + label: i18n.translate( + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.loginItemDescription', + { + defaultMessage: 'Login Item (T1162)', + } + ), id: 'T1162', name: 'Login Item', reference: 'https://attack.mitre.org/techniques/T1162', @@ -3298,7 +3346,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.logonScriptsDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.logonScriptsDescription', { defaultMessage: 'Logon Scripts (T1037)' } ), id: 'T1037', @@ -3309,7 +3357,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.manInTheBrowserDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.manInTheBrowserDescription', { defaultMessage: 'Man in the Browser (T1185)' } ), id: 'T1185', @@ -3320,7 +3368,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.masqueradingDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.masqueradingDescription', { defaultMessage: 'Masquerading (T1036)' } ), id: 'T1036', @@ -3331,7 +3379,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.modifyExistingServiceDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.modifyExistingServiceDescription', { defaultMessage: 'Modify Existing Service (T1031)' } ), id: 'T1031', @@ -3342,7 +3390,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.modifyRegistryDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.modifyRegistryDescription', { defaultMessage: 'Modify Registry (T1112)' } ), id: 'T1112', @@ -3352,9 +3400,12 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ value: 'modifyRegistry', }, { - label: i18n.translate('xpack.siem.detectionEngine.mitreAttackTechniques.mshtaDescription', { - defaultMessage: 'Mshta (T1170)', - }), + label: i18n.translate( + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.mshtaDescription', + { + defaultMessage: 'Mshta (T1170)', + } + ), id: 'T1170', name: 'Mshta', reference: 'https://attack.mitre.org/techniques/T1170', @@ -3363,7 +3414,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.multiStageChannelsDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.multiStageChannelsDescription', { defaultMessage: 'Multi-Stage Channels (T1104)' } ), id: 'T1104', @@ -3374,7 +3425,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.multiHopProxyDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.multiHopProxyDescription', { defaultMessage: 'Multi-hop Proxy (T1188)' } ), id: 'T1188', @@ -3385,7 +3436,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.multibandCommunicationDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.multibandCommunicationDescription', { defaultMessage: 'Multiband Communication (T1026)' } ), id: 'T1026', @@ -3396,7 +3447,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.multilayerEncryptionDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.multilayerEncryptionDescription', { defaultMessage: 'Multilayer Encryption (T1079)' } ), id: 'T1079', @@ -3407,7 +3458,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.ntfsFileAttributesDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.ntfsFileAttributesDescription', { defaultMessage: 'NTFS File Attributes (T1096)' } ), id: 'T1096', @@ -3418,7 +3469,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.netshHelperDllDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.netshHelperDllDescription', { defaultMessage: 'Netsh Helper DLL (T1128)' } ), id: 'T1128', @@ -3429,7 +3480,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.networkDenialOfServiceDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.networkDenialOfServiceDescription', { defaultMessage: 'Network Denial of Service (T1498)' } ), id: 'T1498', @@ -3440,7 +3491,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.networkServiceScanningDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.networkServiceScanningDescription', { defaultMessage: 'Network Service Scanning (T1046)' } ), id: 'T1046', @@ -3451,7 +3502,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.networkShareConnectionRemovalDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.networkShareConnectionRemovalDescription', { defaultMessage: 'Network Share Connection Removal (T1126)' } ), id: 'T1126', @@ -3462,7 +3513,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.networkShareDiscoveryDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.networkShareDiscoveryDescription', { defaultMessage: 'Network Share Discovery (T1135)' } ), id: 'T1135', @@ -3473,7 +3524,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.networkSniffingDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.networkSniffingDescription', { defaultMessage: 'Network Sniffing (T1040)' } ), id: 'T1040', @@ -3484,7 +3535,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.newServiceDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.newServiceDescription', { defaultMessage: 'New Service (T1050)' } ), id: 'T1050', @@ -3495,7 +3546,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.obfuscatedFilesOrInformationDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.obfuscatedFilesOrInformationDescription', { defaultMessage: 'Obfuscated Files or Information (T1027)' } ), id: 'T1027', @@ -3506,7 +3557,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.officeApplicationStartupDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.officeApplicationStartupDescription', { defaultMessage: 'Office Application Startup (T1137)' } ), id: 'T1137', @@ -3517,7 +3568,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.parentPidSpoofingDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.parentPidSpoofingDescription', { defaultMessage: 'Parent PID Spoofing (T1502)' } ), id: 'T1502', @@ -3528,7 +3579,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.passTheHashDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.passTheHashDescription', { defaultMessage: 'Pass the Hash (T1075)' } ), id: 'T1075', @@ -3539,7 +3590,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.passTheTicketDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.passTheTicketDescription', { defaultMessage: 'Pass the Ticket (T1097)' } ), id: 'T1097', @@ -3550,7 +3601,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.passwordFilterDllDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.passwordFilterDllDescription', { defaultMessage: 'Password Filter DLL (T1174)' } ), id: 'T1174', @@ -3561,7 +3612,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.passwordPolicyDiscoveryDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.passwordPolicyDiscoveryDescription', { defaultMessage: 'Password Policy Discovery (T1201)' } ), id: 'T1201', @@ -3572,7 +3623,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.pathInterceptionDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.pathInterceptionDescription', { defaultMessage: 'Path Interception (T1034)' } ), id: 'T1034', @@ -3583,7 +3634,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.peripheralDeviceDiscoveryDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.peripheralDeviceDiscoveryDescription', { defaultMessage: 'Peripheral Device Discovery (T1120)' } ), id: 'T1120', @@ -3594,7 +3645,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.permissionGroupsDiscoveryDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.permissionGroupsDiscoveryDescription', { defaultMessage: 'Permission Groups Discovery (T1069)' } ), id: 'T1069', @@ -3605,7 +3656,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.plistModificationDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.plistModificationDescription', { defaultMessage: 'Plist Modification (T1150)' } ), id: 'T1150', @@ -3616,7 +3667,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.portKnockingDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.portKnockingDescription', { defaultMessage: 'Port Knocking (T1205)' } ), id: 'T1205', @@ -3627,7 +3678,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.portMonitorsDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.portMonitorsDescription', { defaultMessage: 'Port Monitors (T1013)' } ), id: 'T1013', @@ -3638,7 +3689,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.powerShellDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.powerShellDescription', { defaultMessage: 'PowerShell (T1086)' } ), id: 'T1086', @@ -3649,7 +3700,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.powerShellProfileDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.powerShellProfileDescription', { defaultMessage: 'PowerShell Profile (T1504)' } ), id: 'T1504', @@ -3660,7 +3711,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.privateKeysDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.privateKeysDescription', { defaultMessage: 'Private Keys (T1145)' } ), id: 'T1145', @@ -3671,7 +3722,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.processDiscoveryDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.processDiscoveryDescription', { defaultMessage: 'Process Discovery (T1057)' } ), id: 'T1057', @@ -3682,7 +3733,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.processDoppelgangingDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.processDoppelgangingDescription', { defaultMessage: 'Process Doppelgänging (T1186)' } ), id: 'T1186', @@ -3693,7 +3744,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.processHollowingDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.processHollowingDescription', { defaultMessage: 'Process Hollowing (T1093)' } ), id: 'T1093', @@ -3704,7 +3755,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.processInjectionDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.processInjectionDescription', { defaultMessage: 'Process Injection (T1055)' } ), id: 'T1055', @@ -3715,7 +3766,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.queryRegistryDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.queryRegistryDescription', { defaultMessage: 'Query Registry (T1012)' } ), id: 'T1012', @@ -3725,9 +3776,12 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ value: 'queryRegistry', }, { - label: i18n.translate('xpack.siem.detectionEngine.mitreAttackTechniques.rcCommonDescription', { - defaultMessage: 'Rc.common (T1163)', - }), + label: i18n.translate( + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.rcCommonDescription', + { + defaultMessage: 'Rc.common (T1163)', + } + ), id: 'T1163', name: 'Rc.common', reference: 'https://attack.mitre.org/techniques/T1163', @@ -3736,7 +3790,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.reOpenedApplicationsDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.reOpenedApplicationsDescription', { defaultMessage: 'Re-opened Applications (T1164)' } ), id: 'T1164', @@ -3747,7 +3801,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.redundantAccessDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.redundantAccessDescription', { defaultMessage: 'Redundant Access (T1108)' } ), id: 'T1108', @@ -3758,7 +3812,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.registryRunKeysStartupFolderDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.registryRunKeysStartupFolderDescription', { defaultMessage: 'Registry Run Keys / Startup Folder (T1060)' } ), id: 'T1060', @@ -3769,7 +3823,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.regsvcsRegasmDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.regsvcsRegasmDescription', { defaultMessage: 'Regsvcs/Regasm (T1121)' } ), id: 'T1121', @@ -3779,9 +3833,12 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ value: 'regsvcsRegasm', }, { - label: i18n.translate('xpack.siem.detectionEngine.mitreAttackTechniques.regsvr32Description', { - defaultMessage: 'Regsvr32 (T1117)', - }), + label: i18n.translate( + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.regsvr32Description', + { + defaultMessage: 'Regsvr32 (T1117)', + } + ), id: 'T1117', name: 'Regsvr32', reference: 'https://attack.mitre.org/techniques/T1117', @@ -3790,7 +3847,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.remoteAccessToolsDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.remoteAccessToolsDescription', { defaultMessage: 'Remote Access Tools (T1219)' } ), id: 'T1219', @@ -3801,7 +3858,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.remoteDesktopProtocolDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.remoteDesktopProtocolDescription', { defaultMessage: 'Remote Desktop Protocol (T1076)' } ), id: 'T1076', @@ -3812,7 +3869,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.remoteFileCopyDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.remoteFileCopyDescription', { defaultMessage: 'Remote File Copy (T1105)' } ), id: 'T1105', @@ -3823,7 +3880,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.remoteServicesDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.remoteServicesDescription', { defaultMessage: 'Remote Services (T1021)' } ), id: 'T1021', @@ -3834,7 +3891,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.remoteSystemDiscoveryDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.remoteSystemDiscoveryDescription', { defaultMessage: 'Remote System Discovery (T1018)' } ), id: 'T1018', @@ -3845,7 +3902,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.replicationThroughRemovableMediaDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.replicationThroughRemovableMediaDescription', { defaultMessage: 'Replication Through Removable Media (T1091)' } ), id: 'T1091', @@ -3856,7 +3913,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.resourceHijackingDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.resourceHijackingDescription', { defaultMessage: 'Resource Hijacking (T1496)' } ), id: 'T1496', @@ -3867,7 +3924,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.revertCloudInstanceDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.revertCloudInstanceDescription', { defaultMessage: 'Revert Cloud Instance (T1536)' } ), id: 'T1536', @@ -3877,9 +3934,12 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ value: 'revertCloudInstance', }, { - label: i18n.translate('xpack.siem.detectionEngine.mitreAttackTechniques.rootkitDescription', { - defaultMessage: 'Rootkit (T1014)', - }), + label: i18n.translate( + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.rootkitDescription', + { + defaultMessage: 'Rootkit (T1014)', + } + ), id: 'T1014', name: 'Rootkit', reference: 'https://attack.mitre.org/techniques/T1014', @@ -3887,9 +3947,12 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ value: 'rootkit', }, { - label: i18n.translate('xpack.siem.detectionEngine.mitreAttackTechniques.rundll32Description', { - defaultMessage: 'Rundll32 (T1085)', - }), + label: i18n.translate( + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.rundll32Description', + { + defaultMessage: 'Rundll32 (T1085)', + } + ), id: 'T1085', name: 'Rundll32', reference: 'https://attack.mitre.org/techniques/T1085', @@ -3898,7 +3961,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.runtimeDataManipulationDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.runtimeDataManipulationDescription', { defaultMessage: 'Runtime Data Manipulation (T1494)' } ), id: 'T1494', @@ -3909,7 +3972,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.sidHistoryInjectionDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.sidHistoryInjectionDescription', { defaultMessage: 'SID-History Injection (T1178)' } ), id: 'T1178', @@ -3920,7 +3983,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.sipAndTrustProviderHijackingDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.sipAndTrustProviderHijackingDescription', { defaultMessage: 'SIP and Trust Provider Hijacking (T1198)' } ), id: 'T1198', @@ -3931,7 +3994,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.sshHijackingDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.sshHijackingDescription', { defaultMessage: 'SSH Hijacking (T1184)' } ), id: 'T1184', @@ -3942,7 +4005,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.scheduledTaskDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.scheduledTaskDescription', { defaultMessage: 'Scheduled Task (T1053)' } ), id: 'T1053', @@ -3953,7 +4016,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.scheduledTransferDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.scheduledTransferDescription', { defaultMessage: 'Scheduled Transfer (T1029)' } ), id: 'T1029', @@ -3964,7 +4027,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.screenCaptureDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.screenCaptureDescription', { defaultMessage: 'Screen Capture (T1113)' } ), id: 'T1113', @@ -3975,7 +4038,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.screensaverDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.screensaverDescription', { defaultMessage: 'Screensaver (T1180)' } ), id: 'T1180', @@ -3985,9 +4048,12 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ value: 'screensaver', }, { - label: i18n.translate('xpack.siem.detectionEngine.mitreAttackTechniques.scriptingDescription', { - defaultMessage: 'Scripting (T1064)', - }), + label: i18n.translate( + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.scriptingDescription', + { + defaultMessage: 'Scripting (T1064)', + } + ), id: 'T1064', name: 'Scripting', reference: 'https://attack.mitre.org/techniques/T1064', @@ -3996,7 +4062,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.securitySoftwareDiscoveryDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.securitySoftwareDiscoveryDescription', { defaultMessage: 'Security Software Discovery (T1063)' } ), id: 'T1063', @@ -4007,7 +4073,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.securitySupportProviderDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.securitySupportProviderDescription', { defaultMessage: 'Security Support Provider (T1101)' } ), id: 'T1101', @@ -4018,7 +4084,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.securitydMemoryDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.securitydMemoryDescription', { defaultMessage: 'Securityd Memory (T1167)' } ), id: 'T1167', @@ -4029,7 +4095,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.serverSoftwareComponentDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.serverSoftwareComponentDescription', { defaultMessage: 'Server Software Component (T1505)' } ), id: 'T1505', @@ -4040,7 +4106,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.serviceExecutionDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.serviceExecutionDescription', { defaultMessage: 'Service Execution (T1035)' } ), id: 'T1035', @@ -4051,7 +4117,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.serviceRegistryPermissionsWeaknessDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.serviceRegistryPermissionsWeaknessDescription', { defaultMessage: 'Service Registry Permissions Weakness (T1058)' } ), id: 'T1058', @@ -4062,7 +4128,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.serviceStopDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.serviceStopDescription', { defaultMessage: 'Service Stop (T1489)' } ), id: 'T1489', @@ -4073,7 +4139,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.setuidAndSetgidDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.setuidAndSetgidDescription', { defaultMessage: 'Setuid and Setgid (T1166)' } ), id: 'T1166', @@ -4084,7 +4150,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.sharedWebrootDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.sharedWebrootDescription', { defaultMessage: 'Shared Webroot (T1051)' } ), id: 'T1051', @@ -4095,7 +4161,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.shortcutModificationDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.shortcutModificationDescription', { defaultMessage: 'Shortcut Modification (T1023)' } ), id: 'T1023', @@ -4106,7 +4172,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.signedBinaryProxyExecutionDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.signedBinaryProxyExecutionDescription', { defaultMessage: 'Signed Binary Proxy Execution (T1218)' } ), id: 'T1218', @@ -4117,7 +4183,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.signedScriptProxyExecutionDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.signedScriptProxyExecutionDescription', { defaultMessage: 'Signed Script Proxy Execution (T1216)' } ), id: 'T1216', @@ -4128,7 +4194,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.softwareDiscoveryDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.softwareDiscoveryDescription', { defaultMessage: 'Software Discovery (T1518)' } ), id: 'T1518', @@ -4139,7 +4205,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.softwarePackingDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.softwarePackingDescription', { defaultMessage: 'Software Packing (T1045)' } ), id: 'T1045', @@ -4149,9 +4215,12 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ value: 'softwarePacking', }, { - label: i18n.translate('xpack.siem.detectionEngine.mitreAttackTechniques.sourceDescription', { - defaultMessage: 'Source (T1153)', - }), + label: i18n.translate( + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.sourceDescription', + { + defaultMessage: 'Source (T1153)', + } + ), id: 'T1153', name: 'Source', reference: 'https://attack.mitre.org/techniques/T1153', @@ -4160,7 +4229,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.spaceAfterFilenameDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.spaceAfterFilenameDescription', { defaultMessage: 'Space after Filename (T1151)' } ), id: 'T1151', @@ -4171,7 +4240,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.spearphishingAttachmentDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.spearphishingAttachmentDescription', { defaultMessage: 'Spearphishing Attachment (T1193)' } ), id: 'T1193', @@ -4182,7 +4251,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.spearphishingLinkDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.spearphishingLinkDescription', { defaultMessage: 'Spearphishing Link (T1192)' } ), id: 'T1192', @@ -4193,7 +4262,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.spearphishingViaServiceDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.spearphishingViaServiceDescription', { defaultMessage: 'Spearphishing via Service (T1194)' } ), id: 'T1194', @@ -4204,7 +4273,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.standardApplicationLayerProtocolDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.standardApplicationLayerProtocolDescription', { defaultMessage: 'Standard Application Layer Protocol (T1071)' } ), id: 'T1071', @@ -4215,7 +4284,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.standardCryptographicProtocolDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.standardCryptographicProtocolDescription', { defaultMessage: 'Standard Cryptographic Protocol (T1032)' } ), id: 'T1032', @@ -4226,7 +4295,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.standardNonApplicationLayerProtocolDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.standardNonApplicationLayerProtocolDescription', { defaultMessage: 'Standard Non-Application Layer Protocol (T1095)' } ), id: 'T1095', @@ -4237,7 +4306,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.startupItemsDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.startupItemsDescription', { defaultMessage: 'Startup Items (T1165)' } ), id: 'T1165', @@ -4248,7 +4317,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.stealApplicationAccessTokenDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.stealApplicationAccessTokenDescription', { defaultMessage: 'Steal Application Access Token (T1528)' } ), id: 'T1528', @@ -4259,7 +4328,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.stealWebSessionCookieDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.stealWebSessionCookieDescription', { defaultMessage: 'Steal Web Session Cookie (T1539)' } ), id: 'T1539', @@ -4270,7 +4339,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.storedDataManipulationDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.storedDataManipulationDescription', { defaultMessage: 'Stored Data Manipulation (T1492)' } ), id: 'T1492', @@ -4280,9 +4349,12 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ value: 'storedDataManipulation', }, { - label: i18n.translate('xpack.siem.detectionEngine.mitreAttackTechniques.sudoDescription', { - defaultMessage: 'Sudo (T1169)', - }), + label: i18n.translate( + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.sudoDescription', + { + defaultMessage: 'Sudo (T1169)', + } + ), id: 'T1169', name: 'Sudo', reference: 'https://attack.mitre.org/techniques/T1169', @@ -4291,7 +4363,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.sudoCachingDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.sudoCachingDescription', { defaultMessage: 'Sudo Caching (T1206)' } ), id: 'T1206', @@ -4302,7 +4374,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.supplyChainCompromiseDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.supplyChainCompromiseDescription', { defaultMessage: 'Supply Chain Compromise (T1195)' } ), id: 'T1195', @@ -4313,7 +4385,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.systemFirmwareDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.systemFirmwareDescription', { defaultMessage: 'System Firmware (T1019)' } ), id: 'T1019', @@ -4324,7 +4396,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.systemInformationDiscoveryDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.systemInformationDiscoveryDescription', { defaultMessage: 'System Information Discovery (T1082)' } ), id: 'T1082', @@ -4335,7 +4407,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.systemNetworkConfigurationDiscoveryDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.systemNetworkConfigurationDiscoveryDescription', { defaultMessage: 'System Network Configuration Discovery (T1016)' } ), id: 'T1016', @@ -4346,7 +4418,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.systemNetworkConnectionsDiscoveryDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.systemNetworkConnectionsDiscoveryDescription', { defaultMessage: 'System Network Connections Discovery (T1049)' } ), id: 'T1049', @@ -4357,7 +4429,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.systemOwnerUserDiscoveryDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.systemOwnerUserDiscoveryDescription', { defaultMessage: 'System Owner/User Discovery (T1033)' } ), id: 'T1033', @@ -4368,7 +4440,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.systemServiceDiscoveryDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.systemServiceDiscoveryDescription', { defaultMessage: 'System Service Discovery (T1007)' } ), id: 'T1007', @@ -4379,7 +4451,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.systemShutdownRebootDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.systemShutdownRebootDescription', { defaultMessage: 'System Shutdown/Reboot (T1529)' } ), id: 'T1529', @@ -4390,7 +4462,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.systemTimeDiscoveryDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.systemTimeDiscoveryDescription', { defaultMessage: 'System Time Discovery (T1124)' } ), id: 'T1124', @@ -4401,7 +4473,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.systemdServiceDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.systemdServiceDescription', { defaultMessage: 'Systemd Service (T1501)' } ), id: 'T1501', @@ -4412,7 +4484,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.taintSharedContentDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.taintSharedContentDescription', { defaultMessage: 'Taint Shared Content (T1080)' } ), id: 'T1080', @@ -4423,7 +4495,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.templateInjectionDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.templateInjectionDescription', { defaultMessage: 'Template Injection (T1221)' } ), id: 'T1221', @@ -4434,7 +4506,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.thirdPartySoftwareDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.thirdPartySoftwareDescription', { defaultMessage: 'Third-party Software (T1072)' } ), id: 'T1072', @@ -4445,7 +4517,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.timeProvidersDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.timeProvidersDescription', { defaultMessage: 'Time Providers (T1209)' } ), id: 'T1209', @@ -4455,9 +4527,12 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ value: 'timeProviders', }, { - label: i18n.translate('xpack.siem.detectionEngine.mitreAttackTechniques.timestompDescription', { - defaultMessage: 'Timestomp (T1099)', - }), + label: i18n.translate( + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.timestompDescription', + { + defaultMessage: 'Timestomp (T1099)', + } + ), id: 'T1099', name: 'Timestomp', reference: 'https://attack.mitre.org/techniques/T1099', @@ -4466,7 +4541,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.transferDataToCloudAccountDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.transferDataToCloudAccountDescription', { defaultMessage: 'Transfer Data to Cloud Account (T1537)' } ), id: 'T1537', @@ -4477,7 +4552,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.transmittedDataManipulationDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.transmittedDataManipulationDescription', { defaultMessage: 'Transmitted Data Manipulation (T1493)' } ), id: 'T1493', @@ -4487,9 +4562,12 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ value: 'transmittedDataManipulation', }, { - label: i18n.translate('xpack.siem.detectionEngine.mitreAttackTechniques.trapDescription', { - defaultMessage: 'Trap (T1154)', - }), + label: i18n.translate( + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.trapDescription', + { + defaultMessage: 'Trap (T1154)', + } + ), id: 'T1154', name: 'Trap', reference: 'https://attack.mitre.org/techniques/T1154', @@ -4498,7 +4576,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.trustedDeveloperUtilitiesDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.trustedDeveloperUtilitiesDescription', { defaultMessage: 'Trusted Developer Utilities (T1127)' } ), id: 'T1127', @@ -4509,7 +4587,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.trustedRelationshipDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.trustedRelationshipDescription', { defaultMessage: 'Trusted Relationship (T1199)' } ), id: 'T1199', @@ -4520,7 +4598,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.twoFactorAuthenticationInterceptionDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.twoFactorAuthenticationInterceptionDescription', { defaultMessage: 'Two-Factor Authentication Interception (T1111)' } ), id: 'T1111', @@ -4531,7 +4609,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.uncommonlyUsedPortDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.uncommonlyUsedPortDescription', { defaultMessage: 'Uncommonly Used Port (T1065)' } ), id: 'T1065', @@ -4542,7 +4620,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.unusedUnsupportedCloudRegionsDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.unusedUnsupportedCloudRegionsDescription', { defaultMessage: 'Unused/Unsupported Cloud Regions (T1535)' } ), id: 'T1535', @@ -4553,7 +4631,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.userExecutionDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.userExecutionDescription', { defaultMessage: 'User Execution (T1204)' } ), id: 'T1204', @@ -4564,7 +4642,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.validAccountsDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.validAccountsDescription', { defaultMessage: 'Valid Accounts (T1078)' } ), id: 'T1078', @@ -4575,7 +4653,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.videoCaptureDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.videoCaptureDescription', { defaultMessage: 'Video Capture (T1125)' } ), id: 'T1125', @@ -4586,7 +4664,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.virtualizationSandboxEvasionDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.virtualizationSandboxEvasionDescription', { defaultMessage: 'Virtualization/Sandbox Evasion (T1497)' } ), id: 'T1497', @@ -4597,7 +4675,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.webServiceDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.webServiceDescription', { defaultMessage: 'Web Service (T1102)' } ), id: 'T1102', @@ -4608,7 +4686,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.webSessionCookieDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.webSessionCookieDescription', { defaultMessage: 'Web Session Cookie (T1506)' } ), id: 'T1506', @@ -4618,9 +4696,12 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ value: 'webSessionCookie', }, { - label: i18n.translate('xpack.siem.detectionEngine.mitreAttackTechniques.webShellDescription', { - defaultMessage: 'Web Shell (T1100)', - }), + label: i18n.translate( + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.webShellDescription', + { + defaultMessage: 'Web Shell (T1100)', + } + ), id: 'T1100', name: 'Web Shell', reference: 'https://attack.mitre.org/techniques/T1100', @@ -4629,7 +4710,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.windowsAdminSharesDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.windowsAdminSharesDescription', { defaultMessage: 'Windows Admin Shares (T1077)' } ), id: 'T1077', @@ -4640,7 +4721,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.windowsManagementInstrumentationDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.windowsManagementInstrumentationDescription', { defaultMessage: 'Windows Management Instrumentation (T1047)' } ), id: 'T1047', @@ -4651,7 +4732,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.windowsManagementInstrumentationEventSubscriptionDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.windowsManagementInstrumentationEventSubscriptionDescription', { defaultMessage: 'Windows Management Instrumentation Event Subscription (T1084)' } ), id: 'T1084', @@ -4662,7 +4743,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.windowsRemoteManagementDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.windowsRemoteManagementDescription', { defaultMessage: 'Windows Remote Management (T1028)' } ), id: 'T1028', @@ -4673,7 +4754,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.winlogonHelperDllDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.winlogonHelperDllDescription', { defaultMessage: 'Winlogon Helper DLL (T1004)' } ), id: 'T1004', @@ -4684,7 +4765,7 @@ export const techniquesOptions: MitreTechniquesOptions[] = [ }, { label: i18n.translate( - 'xpack.siem.detectionEngine.mitreAttackTechniques.xslScriptProcessingDescription', + 'xpack.securitySolution.detectionEngine.mitreAttackTechniques.xslScriptProcessingDescription', { defaultMessage: 'XSL Script Processing (T1220)' } ), id: 'T1220', diff --git a/x-pack/plugins/siem/public/alerts/mitre/types.ts b/x-pack/plugins/security_solution/public/alerts/mitre/types.ts similarity index 100% rename from x-pack/plugins/siem/public/alerts/mitre/types.ts rename to x-pack/plugins/security_solution/public/alerts/mitre/types.ts diff --git a/x-pack/plugins/siem/public/alerts/pages/detection_engine/detection_engine.test.tsx b/x-pack/plugins/security_solution/public/alerts/pages/detection_engine/detection_engine.test.tsx similarity index 100% rename from x-pack/plugins/siem/public/alerts/pages/detection_engine/detection_engine.test.tsx rename to x-pack/plugins/security_solution/public/alerts/pages/detection_engine/detection_engine.test.tsx diff --git a/x-pack/plugins/siem/public/alerts/pages/detection_engine/detection_engine.tsx b/x-pack/plugins/security_solution/public/alerts/pages/detection_engine/detection_engine.tsx similarity index 100% rename from x-pack/plugins/siem/public/alerts/pages/detection_engine/detection_engine.tsx rename to x-pack/plugins/security_solution/public/alerts/pages/detection_engine/detection_engine.tsx diff --git a/x-pack/plugins/siem/public/alerts/pages/detection_engine/detection_engine_empty_page.test.tsx b/x-pack/plugins/security_solution/public/alerts/pages/detection_engine/detection_engine_empty_page.test.tsx similarity index 100% rename from x-pack/plugins/siem/public/alerts/pages/detection_engine/detection_engine_empty_page.test.tsx rename to x-pack/plugins/security_solution/public/alerts/pages/detection_engine/detection_engine_empty_page.test.tsx diff --git a/x-pack/plugins/siem/public/alerts/pages/detection_engine/detection_engine_empty_page.tsx b/x-pack/plugins/security_solution/public/alerts/pages/detection_engine/detection_engine_empty_page.tsx similarity index 100% rename from x-pack/plugins/siem/public/alerts/pages/detection_engine/detection_engine_empty_page.tsx rename to x-pack/plugins/security_solution/public/alerts/pages/detection_engine/detection_engine_empty_page.tsx diff --git a/x-pack/plugins/siem/public/alerts/pages/detection_engine/detection_engine_no_signal_index.test.tsx b/x-pack/plugins/security_solution/public/alerts/pages/detection_engine/detection_engine_no_signal_index.test.tsx similarity index 100% rename from x-pack/plugins/siem/public/alerts/pages/detection_engine/detection_engine_no_signal_index.test.tsx rename to x-pack/plugins/security_solution/public/alerts/pages/detection_engine/detection_engine_no_signal_index.test.tsx diff --git a/x-pack/plugins/siem/public/alerts/pages/detection_engine/detection_engine_no_signal_index.tsx b/x-pack/plugins/security_solution/public/alerts/pages/detection_engine/detection_engine_no_signal_index.tsx similarity index 100% rename from x-pack/plugins/siem/public/alerts/pages/detection_engine/detection_engine_no_signal_index.tsx rename to x-pack/plugins/security_solution/public/alerts/pages/detection_engine/detection_engine_no_signal_index.tsx diff --git a/x-pack/plugins/siem/public/alerts/pages/detection_engine/detection_engine_user_unauthenticated.test.tsx b/x-pack/plugins/security_solution/public/alerts/pages/detection_engine/detection_engine_user_unauthenticated.test.tsx similarity index 100% rename from x-pack/plugins/siem/public/alerts/pages/detection_engine/detection_engine_user_unauthenticated.test.tsx rename to x-pack/plugins/security_solution/public/alerts/pages/detection_engine/detection_engine_user_unauthenticated.test.tsx diff --git a/x-pack/plugins/siem/public/alerts/pages/detection_engine/detection_engine_user_unauthenticated.tsx b/x-pack/plugins/security_solution/public/alerts/pages/detection_engine/detection_engine_user_unauthenticated.tsx similarity index 100% rename from x-pack/plugins/siem/public/alerts/pages/detection_engine/detection_engine_user_unauthenticated.tsx rename to x-pack/plugins/security_solution/public/alerts/pages/detection_engine/detection_engine_user_unauthenticated.tsx diff --git a/x-pack/plugins/siem/public/alerts/pages/detection_engine/index.test.tsx b/x-pack/plugins/security_solution/public/alerts/pages/detection_engine/index.test.tsx similarity index 100% rename from x-pack/plugins/siem/public/alerts/pages/detection_engine/index.test.tsx rename to x-pack/plugins/security_solution/public/alerts/pages/detection_engine/index.test.tsx diff --git a/x-pack/plugins/siem/public/alerts/pages/detection_engine/index.tsx b/x-pack/plugins/security_solution/public/alerts/pages/detection_engine/index.tsx similarity index 100% rename from x-pack/plugins/siem/public/alerts/pages/detection_engine/index.tsx rename to x-pack/plugins/security_solution/public/alerts/pages/detection_engine/index.tsx diff --git a/x-pack/plugins/siem/public/alerts/pages/detection_engine/rules/all/__mocks__/mock.ts b/x-pack/plugins/security_solution/public/alerts/pages/detection_engine/rules/all/__mocks__/mock.ts similarity index 100% rename from x-pack/plugins/siem/public/alerts/pages/detection_engine/rules/all/__mocks__/mock.ts rename to x-pack/plugins/security_solution/public/alerts/pages/detection_engine/rules/all/__mocks__/mock.ts diff --git a/x-pack/plugins/siem/public/alerts/pages/detection_engine/rules/all/actions.tsx b/x-pack/plugins/security_solution/public/alerts/pages/detection_engine/rules/all/actions.tsx similarity index 100% rename from x-pack/plugins/siem/public/alerts/pages/detection_engine/rules/all/actions.tsx rename to x-pack/plugins/security_solution/public/alerts/pages/detection_engine/rules/all/actions.tsx diff --git a/x-pack/plugins/siem/public/alerts/pages/detection_engine/rules/all/batch_actions.tsx b/x-pack/plugins/security_solution/public/alerts/pages/detection_engine/rules/all/batch_actions.tsx similarity index 100% rename from x-pack/plugins/siem/public/alerts/pages/detection_engine/rules/all/batch_actions.tsx rename to x-pack/plugins/security_solution/public/alerts/pages/detection_engine/rules/all/batch_actions.tsx diff --git a/x-pack/plugins/siem/public/alerts/pages/detection_engine/rules/all/columns.test.tsx b/x-pack/plugins/security_solution/public/alerts/pages/detection_engine/rules/all/columns.test.tsx similarity index 100% rename from x-pack/plugins/siem/public/alerts/pages/detection_engine/rules/all/columns.test.tsx rename to x-pack/plugins/security_solution/public/alerts/pages/detection_engine/rules/all/columns.test.tsx diff --git a/x-pack/plugins/siem/public/alerts/pages/detection_engine/rules/all/columns.tsx b/x-pack/plugins/security_solution/public/alerts/pages/detection_engine/rules/all/columns.tsx similarity index 100% rename from x-pack/plugins/siem/public/alerts/pages/detection_engine/rules/all/columns.tsx rename to x-pack/plugins/security_solution/public/alerts/pages/detection_engine/rules/all/columns.tsx diff --git a/x-pack/plugins/siem/public/alerts/pages/detection_engine/rules/all/helpers.test.tsx b/x-pack/plugins/security_solution/public/alerts/pages/detection_engine/rules/all/helpers.test.tsx similarity index 100% rename from x-pack/plugins/siem/public/alerts/pages/detection_engine/rules/all/helpers.test.tsx rename to x-pack/plugins/security_solution/public/alerts/pages/detection_engine/rules/all/helpers.test.tsx diff --git a/x-pack/plugins/siem/public/alerts/pages/detection_engine/rules/all/helpers.ts b/x-pack/plugins/security_solution/public/alerts/pages/detection_engine/rules/all/helpers.ts similarity index 100% rename from x-pack/plugins/siem/public/alerts/pages/detection_engine/rules/all/helpers.ts rename to x-pack/plugins/security_solution/public/alerts/pages/detection_engine/rules/all/helpers.ts diff --git a/x-pack/plugins/siem/public/alerts/pages/detection_engine/rules/all/index.test.tsx b/x-pack/plugins/security_solution/public/alerts/pages/detection_engine/rules/all/index.test.tsx similarity index 100% rename from x-pack/plugins/siem/public/alerts/pages/detection_engine/rules/all/index.test.tsx rename to x-pack/plugins/security_solution/public/alerts/pages/detection_engine/rules/all/index.test.tsx diff --git a/x-pack/plugins/siem/public/alerts/pages/detection_engine/rules/all/index.tsx b/x-pack/plugins/security_solution/public/alerts/pages/detection_engine/rules/all/index.tsx similarity index 100% rename from x-pack/plugins/siem/public/alerts/pages/detection_engine/rules/all/index.tsx rename to x-pack/plugins/security_solution/public/alerts/pages/detection_engine/rules/all/index.tsx diff --git a/x-pack/plugins/siem/public/alerts/pages/detection_engine/rules/all/reducer.ts b/x-pack/plugins/security_solution/public/alerts/pages/detection_engine/rules/all/reducer.ts similarity index 100% rename from x-pack/plugins/siem/public/alerts/pages/detection_engine/rules/all/reducer.ts rename to x-pack/plugins/security_solution/public/alerts/pages/detection_engine/rules/all/reducer.ts diff --git a/x-pack/plugins/siem/public/alerts/pages/detection_engine/rules/all/rules_table_filters/rules_table_filters.test.tsx b/x-pack/plugins/security_solution/public/alerts/pages/detection_engine/rules/all/rules_table_filters/rules_table_filters.test.tsx similarity index 100% rename from x-pack/plugins/siem/public/alerts/pages/detection_engine/rules/all/rules_table_filters/rules_table_filters.test.tsx rename to x-pack/plugins/security_solution/public/alerts/pages/detection_engine/rules/all/rules_table_filters/rules_table_filters.test.tsx diff --git a/x-pack/plugins/siem/public/alerts/pages/detection_engine/rules/all/rules_table_filters/rules_table_filters.tsx b/x-pack/plugins/security_solution/public/alerts/pages/detection_engine/rules/all/rules_table_filters/rules_table_filters.tsx similarity index 100% rename from x-pack/plugins/siem/public/alerts/pages/detection_engine/rules/all/rules_table_filters/rules_table_filters.tsx rename to x-pack/plugins/security_solution/public/alerts/pages/detection_engine/rules/all/rules_table_filters/rules_table_filters.tsx diff --git a/x-pack/plugins/siem/public/alerts/pages/detection_engine/rules/all/rules_table_filters/tags_filter_popover.test.tsx b/x-pack/plugins/security_solution/public/alerts/pages/detection_engine/rules/all/rules_table_filters/tags_filter_popover.test.tsx similarity index 100% rename from x-pack/plugins/siem/public/alerts/pages/detection_engine/rules/all/rules_table_filters/tags_filter_popover.test.tsx rename to x-pack/plugins/security_solution/public/alerts/pages/detection_engine/rules/all/rules_table_filters/tags_filter_popover.test.tsx diff --git a/x-pack/plugins/siem/public/alerts/pages/detection_engine/rules/all/rules_table_filters/tags_filter_popover.tsx b/x-pack/plugins/security_solution/public/alerts/pages/detection_engine/rules/all/rules_table_filters/tags_filter_popover.tsx similarity index 100% rename from x-pack/plugins/siem/public/alerts/pages/detection_engine/rules/all/rules_table_filters/tags_filter_popover.tsx rename to x-pack/plugins/security_solution/public/alerts/pages/detection_engine/rules/all/rules_table_filters/tags_filter_popover.tsx diff --git a/x-pack/plugins/siem/public/alerts/pages/detection_engine/rules/create/helpers.test.ts b/x-pack/plugins/security_solution/public/alerts/pages/detection_engine/rules/create/helpers.test.ts similarity index 100% rename from x-pack/plugins/siem/public/alerts/pages/detection_engine/rules/create/helpers.test.ts rename to x-pack/plugins/security_solution/public/alerts/pages/detection_engine/rules/create/helpers.test.ts diff --git a/x-pack/plugins/siem/public/alerts/pages/detection_engine/rules/create/helpers.ts b/x-pack/plugins/security_solution/public/alerts/pages/detection_engine/rules/create/helpers.ts similarity index 100% rename from x-pack/plugins/siem/public/alerts/pages/detection_engine/rules/create/helpers.ts rename to x-pack/plugins/security_solution/public/alerts/pages/detection_engine/rules/create/helpers.ts diff --git a/x-pack/plugins/siem/public/alerts/pages/detection_engine/rules/create/index.test.tsx b/x-pack/plugins/security_solution/public/alerts/pages/detection_engine/rules/create/index.test.tsx similarity index 100% rename from x-pack/plugins/siem/public/alerts/pages/detection_engine/rules/create/index.test.tsx rename to x-pack/plugins/security_solution/public/alerts/pages/detection_engine/rules/create/index.test.tsx diff --git a/x-pack/plugins/siem/public/alerts/pages/detection_engine/rules/create/index.tsx b/x-pack/plugins/security_solution/public/alerts/pages/detection_engine/rules/create/index.tsx similarity index 100% rename from x-pack/plugins/siem/public/alerts/pages/detection_engine/rules/create/index.tsx rename to x-pack/plugins/security_solution/public/alerts/pages/detection_engine/rules/create/index.tsx diff --git a/x-pack/plugins/security_solution/public/alerts/pages/detection_engine/rules/create/translations.ts b/x-pack/plugins/security_solution/public/alerts/pages/detection_engine/rules/create/translations.ts new file mode 100644 index 0000000000000..dbcd05470b5cd --- /dev/null +++ b/x-pack/plugins/security_solution/public/alerts/pages/detection_engine/rules/create/translations.ts @@ -0,0 +1,37 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + +import { i18n } from '@kbn/i18n'; + +export const PAGE_TITLE = i18n.translate( + 'xpack.securitySolution.detectionEngine.createRule.pageTitle', + { + defaultMessage: 'Create new rule', + } +); + +export const BACK_TO_RULES = i18n.translate( + 'xpack.securitySolution.detectionEngine.createRule.backToRulesDescription', + { + defaultMessage: 'Back to detection rules', + } +); + +export const EDIT_RULE = i18n.translate( + 'xpack.securitySolution.detectionEngine.createRule.editRuleButton', + { + defaultMessage: 'Edit', + } +); + +export const SUCCESSFULLY_CREATED_RULES = (ruleName: string) => + i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.create.successfullyCreatedRuleTitle', + { + values: { ruleName }, + defaultMessage: '{ruleName} was created', + } + ); diff --git a/x-pack/plugins/siem/public/alerts/pages/detection_engine/rules/details/failure_history.test.tsx b/x-pack/plugins/security_solution/public/alerts/pages/detection_engine/rules/details/failure_history.test.tsx similarity index 100% rename from x-pack/plugins/siem/public/alerts/pages/detection_engine/rules/details/failure_history.test.tsx rename to x-pack/plugins/security_solution/public/alerts/pages/detection_engine/rules/details/failure_history.test.tsx diff --git a/x-pack/plugins/siem/public/alerts/pages/detection_engine/rules/details/failure_history.tsx b/x-pack/plugins/security_solution/public/alerts/pages/detection_engine/rules/details/failure_history.tsx similarity index 100% rename from x-pack/plugins/siem/public/alerts/pages/detection_engine/rules/details/failure_history.tsx rename to x-pack/plugins/security_solution/public/alerts/pages/detection_engine/rules/details/failure_history.tsx diff --git a/x-pack/plugins/siem/public/alerts/pages/detection_engine/rules/details/index.test.tsx b/x-pack/plugins/security_solution/public/alerts/pages/detection_engine/rules/details/index.test.tsx similarity index 100% rename from x-pack/plugins/siem/public/alerts/pages/detection_engine/rules/details/index.test.tsx rename to x-pack/plugins/security_solution/public/alerts/pages/detection_engine/rules/details/index.test.tsx diff --git a/x-pack/plugins/siem/public/alerts/pages/detection_engine/rules/details/index.tsx b/x-pack/plugins/security_solution/public/alerts/pages/detection_engine/rules/details/index.tsx similarity index 98% rename from x-pack/plugins/siem/public/alerts/pages/detection_engine/rules/details/index.tsx rename to x-pack/plugins/security_solution/public/alerts/pages/detection_engine/rules/details/index.tsx index 7197ed397717c..ebd6ed118f937 100644 --- a/x-pack/plugins/siem/public/alerts/pages/detection_engine/rules/details/index.tsx +++ b/x-pack/plugins/security_solution/public/alerts/pages/detection_engine/rules/details/index.tsx @@ -132,7 +132,7 @@ export const RuleDetailsPageComponent: FC = ({ ) : ( [ = ({ />, rule?.updated_by != null ? ( { {tabHasError.length > 0 && ( + i18n.translate('xpack.securitySolution.detectionEngine.rules.update.successfullySavedRuleTitle', { + values: { ruleName }, + defaultMessage: '{ruleName} was saved', + }); diff --git a/x-pack/plugins/siem/public/alerts/pages/detection_engine/rules/helpers.test.tsx b/x-pack/plugins/security_solution/public/alerts/pages/detection_engine/rules/helpers.test.tsx similarity index 100% rename from x-pack/plugins/siem/public/alerts/pages/detection_engine/rules/helpers.test.tsx rename to x-pack/plugins/security_solution/public/alerts/pages/detection_engine/rules/helpers.test.tsx diff --git a/x-pack/plugins/siem/public/alerts/pages/detection_engine/rules/helpers.tsx b/x-pack/plugins/security_solution/public/alerts/pages/detection_engine/rules/helpers.tsx similarity index 100% rename from x-pack/plugins/siem/public/alerts/pages/detection_engine/rules/helpers.tsx rename to x-pack/plugins/security_solution/public/alerts/pages/detection_engine/rules/helpers.tsx diff --git a/x-pack/plugins/siem/public/alerts/pages/detection_engine/rules/index.test.tsx b/x-pack/plugins/security_solution/public/alerts/pages/detection_engine/rules/index.test.tsx similarity index 100% rename from x-pack/plugins/siem/public/alerts/pages/detection_engine/rules/index.test.tsx rename to x-pack/plugins/security_solution/public/alerts/pages/detection_engine/rules/index.test.tsx diff --git a/x-pack/plugins/siem/public/alerts/pages/detection_engine/rules/index.tsx b/x-pack/plugins/security_solution/public/alerts/pages/detection_engine/rules/index.tsx similarity index 100% rename from x-pack/plugins/siem/public/alerts/pages/detection_engine/rules/index.tsx rename to x-pack/plugins/security_solution/public/alerts/pages/detection_engine/rules/index.tsx diff --git a/x-pack/plugins/security_solution/public/alerts/pages/detection_engine/rules/translations.ts b/x-pack/plugins/security_solution/public/alerts/pages/detection_engine/rules/translations.ts new file mode 100644 index 0000000000000..32f59093e6a04 --- /dev/null +++ b/x-pack/plugins/security_solution/public/alerts/pages/detection_engine/rules/translations.ts @@ -0,0 +1,530 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + +import { i18n } from '@kbn/i18n'; + +export const BACK_TO_ALERTS = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.backOptionsHeader', + { + defaultMessage: 'Back to alerts', + } +); + +export const IMPORT_RULE = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.importRuleTitle', + { + defaultMessage: 'Import rule…', + } +); + +export const ADD_NEW_RULE = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.addNewRuleTitle', + { + defaultMessage: 'Create new rule', + } +); + +export const PAGE_TITLE = i18n.translate('xpack.securitySolution.detectionEngine.rules.pageTitle', { + defaultMessage: 'Detection rules', +}); + +export const ADD_PAGE_TITLE = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.addPageTitle', + { + defaultMessage: 'Create', + } +); + +export const EDIT_PAGE_TITLE = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.editPageTitle', + { + defaultMessage: 'Edit', + } +); + +export const REFRESH = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.allRules.refreshTitle', + { + defaultMessage: 'Refresh', + } +); + +export const BATCH_ACTIONS = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.allRules.batchActionsTitle', + { + defaultMessage: 'Bulk actions', + } +); + +export const ACTIVE = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.allRules.activeRuleDescription', + { + defaultMessage: 'active', + } +); + +export const INACTIVE = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.allRules.inactiveRuleDescription', + { + defaultMessage: 'inactive', + } +); + +export const BATCH_ACTION_ACTIVATE_SELECTED = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.allRules.batchActions.activateSelectedTitle', + { + defaultMessage: 'Activate selected', + } +); + +export const BATCH_ACTION_ACTIVATE_SELECTED_ERROR = (totalRules: number) => + i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.allRules.batchActions.activateSelectedErrorTitle', + { + values: { totalRules }, + defaultMessage: 'Error activating {totalRules, plural, =1 {rule} other {rules}}…', + } + ); + +export const BATCH_ACTION_DEACTIVATE_SELECTED = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.allRules.batchActions.deactivateSelectedTitle', + { + defaultMessage: 'Deactivate selected', + } +); + +export const BATCH_ACTION_DEACTIVATE_SELECTED_ERROR = (totalRules: number) => + i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.allRules.batchActions.deactivateSelectedErrorTitle', + { + values: { totalRules }, + defaultMessage: 'Error deactivating {totalRules, plural, =1 {rule} other {rules}}…', + } + ); + +export const BATCH_ACTION_EXPORT_SELECTED = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.allRules.batchActions.exportSelectedTitle', + { + defaultMessage: 'Export selected', + } +); + +export const BATCH_ACTION_DUPLICATE_SELECTED = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.allRules.batchActions.duplicateSelectedTitle', + { + defaultMessage: 'Duplicate selected…', + } +); + +export const BATCH_ACTION_DELETE_SELECTED = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.allRules.batchActions.deleteSelectedTitle', + { + defaultMessage: 'Delete selected…', + } +); + +export const BATCH_ACTION_DELETE_SELECTED_IMMUTABLE = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.allRules.batchActions.deleteSelectedImmutableTitle', + { + defaultMessage: 'Selection contains immutable rules which cannot be deleted', + } +); + +export const BATCH_ACTION_DELETE_SELECTED_ERROR = (totalRules: number) => + i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.allRules.batchActions.deleteSelectedErrorTitle', + { + values: { totalRules }, + defaultMessage: 'Error deleting {totalRules, plural, =1 {rule} other {rules}}…', + } + ); + +export const EXPORT_FILENAME = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.allRules.exportFilenameTitle', + { + defaultMessage: 'rules_export', + } +); + +export const SUCCESSFULLY_EXPORTED_RULES = (totalRules: number) => + i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.allRules.successfullyExportedRulesTitle', + { + values: { totalRules }, + defaultMessage: + 'Successfully exported {totalRules, plural, =0 {all rules} =1 {{totalRules} rule} other {{totalRules} rules}}', + } + ); + +export const ALL_RULES = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.allRules.tableTitle', + { + defaultMessage: 'All rules', + } +); + +export const SEARCH_RULES = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.allRules.searchAriaLabel', + { + defaultMessage: 'Search rules', + } +); + +export const SEARCH_PLACEHOLDER = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.allRules.searchPlaceholder', + { + defaultMessage: 'e.g. rule name', + } +); + +export const SHOWING_RULES = (totalRules: number) => + i18n.translate('xpack.securitySolution.detectionEngine.rules.allRules.showingRulesTitle', { + values: { totalRules }, + defaultMessage: 'Showing {totalRules} {totalRules, plural, =1 {rule} other {rules}}', + }); + +export const SELECTED_RULES = (selectedRules: number) => + i18n.translate('xpack.securitySolution.detectionEngine.rules.allRules.selectedRulesTitle', { + values: { selectedRules }, + defaultMessage: 'Selected {selectedRules} {selectedRules, plural, =1 {rule} other {rules}}', + }); + +export const EDIT_RULE_SETTINGS = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.allRules.actions.editRuleSettingsDescription', + { + defaultMessage: 'Edit rule settings', + } +); + +export const DUPLICATE = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.allRules.actions.duplicateTitle', + { + defaultMessage: 'Duplicate', + } +); + +export const DUPLICATE_RULE = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.allRules.actions.duplicateRuleDescription', + { + defaultMessage: 'Duplicate rule…', + } +); + +export const SUCCESSFULLY_DUPLICATED_RULES = (totalRules: number) => + i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.allRules.successfullyDuplicatedRulesTitle', + { + values: { totalRules }, + defaultMessage: + 'Successfully duplicated {totalRules, plural, =1 {{totalRules} rule} other {{totalRules} rules}}', + } + ); + +export const DUPLICATE_RULE_ERROR = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.allRules.actions.duplicateRuleErrorDescription', + { + defaultMessage: 'Error duplicating rule…', + } +); + +export const EXPORT_RULE = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.allRules.actions.exportRuleDescription', + { + defaultMessage: 'Export rule', + } +); + +export const DELETE_RULE = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.allRules.actions.deleteeRuleDescription', + { + defaultMessage: 'Delete rule…', + } +); + +export const COLUMN_RULE = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.allRules.columns.ruleTitle', + { + defaultMessage: 'Rule', + } +); + +export const COLUMN_RISK_SCORE = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.allRules.columns.riskScoreTitle', + { + defaultMessage: 'Risk score', + } +); + +export const COLUMN_SEVERITY = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.allRules.columns.severityTitle', + { + defaultMessage: 'Severity', + } +); + +export const COLUMN_LAST_COMPLETE_RUN = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.allRules.columns.lastRunTitle', + { + defaultMessage: 'Last run', + } +); + +export const COLUMN_LAST_RESPONSE = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.allRules.columns.lastResponseTitle', + { + defaultMessage: 'Last response', + } +); + +export const COLUMN_TAGS = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.allRules.columns.tagsTitle', + { + defaultMessage: 'Tags', + } +); + +export const COLUMN_ACTIVATE = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.allRules.columns.activateTitle', + { + defaultMessage: 'Activated', + } +); + +export const COLUMN_INDEXING_TIMES = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.allRules.columns.indexingTimes', + { + defaultMessage: 'Indexing Time (ms)', + } +); + +export const COLUMN_QUERY_TIMES = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.allRules.columns.queryTimes', + { + defaultMessage: 'Query Time (ms)', + } +); + +export const COLUMN_GAP = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.allRules.columns.gap', + { + defaultMessage: 'Gap (if any)', + } +); + +export const COLUMN_LAST_LOOKBACK_DATE = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.allRules.columns.lastLookBackDate', + { + defaultMessage: 'Last Look-Back Date', + } +); + +export const RULES_TAB = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.allRules.tabs.rules', + { + defaultMessage: 'Rules', + } +); + +export const MONITORING_TAB = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.allRules.tabs.monitoring', + { + defaultMessage: 'Monitoring', + } +); + +export const CUSTOM_RULES = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.allRules.filters.customRulesTitle', + { + defaultMessage: 'Custom rules', + } +); + +export const ELASTIC_RULES = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.allRules.filters.elasticRulesTitle', + { + defaultMessage: 'Elastic rules', + } +); + +export const TAGS = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.allRules.filters.tagsLabel', + { + defaultMessage: 'Tags', + } +); + +export const NO_TAGS_AVAILABLE = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.allRules.filters.noTagsAvailableDescription', + { + defaultMessage: 'No tags available', + } +); + +export const NO_RULES = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.allRules.filters.noRulesTitle', + { + defaultMessage: 'No rules found', + } +); + +export const NO_RULES_BODY = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.allRules.filters.noRulesBodyTitle', + { + defaultMessage: "We weren't able to find any rules with the above filters.", + } +); + +export const DEFINE_RULE = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.defineRuleTitle', + { + defaultMessage: 'Define rule', + } +); + +export const ABOUT_RULE = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.aboutRuleTitle', + { + defaultMessage: 'About rule', + } +); + +export const SCHEDULE_RULE = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.scheduleRuleTitle', + { + defaultMessage: 'Schedule rule', + } +); + +export const RULE_ACTIONS = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.ruleActionsTitle', + { + defaultMessage: 'Rule actions', + } +); + +export const DEFINITION = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.stepDefinitionTitle', + { + defaultMessage: 'Definition', + } +); + +export const ABOUT = i18n.translate('xpack.securitySolution.detectionEngine.rules.stepAboutTitle', { + defaultMessage: 'About', +}); + +export const SCHEDULE = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.stepScheduleTitle', + { + defaultMessage: 'Schedule', + } +); + +export const ACTIONS = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.stepActionsTitle', + { + defaultMessage: 'Actions', + } +); + +export const OPTIONAL_FIELD = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.optionalFieldDescription', + { + defaultMessage: 'Optional', + } +); + +export const CONTINUE = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.continueButtonTitle', + { + defaultMessage: 'Continue', + } +); + +export const UPDATE = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.updateButtonTitle', + { + defaultMessage: 'Update', + } +); + +export const DELETE = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.deleteDescription', + { + defaultMessage: 'Delete', + } +); + +export const LOAD_PREPACKAGED_RULES = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.loadPrePackagedRulesButton', + { + defaultMessage: 'Load Elastic prebuilt rules', + } +); + +export const RELOAD_MISSING_PREPACKAGED_RULES = (missingRules: number) => + i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.reloadMissingPrePackagedRulesButton', + { + values: { missingRules }, + defaultMessage: + 'Install {missingRules} Elastic prebuilt {missingRules, plural, =1 {rule} other {rules}} ', + } + ); + +export const IMPORT_RULE_BTN_TITLE = i18n.translate( + 'xpack.securitySolution.detectionEngine.components.importRuleModal.importRuleTitle', + { + defaultMessage: 'Import rule', + } +); + +export const SELECT_RULE = i18n.translate( + 'xpack.securitySolution.detectionEngine.components.importRuleModal.selectRuleDescription', + { + defaultMessage: 'Select a SIEM rule (as exported from the Detection Engine view) to import', + } +); + +export const INITIAL_PROMPT_TEXT = i18n.translate( + 'xpack.securitySolution.detectionEngine.components.importRuleModal.initialPromptTextDescription', + { + defaultMessage: 'Select or drag and drop a valid rules_export.ndjson file', + } +); + +export const OVERWRITE_WITH_SAME_NAME = i18n.translate( + 'xpack.securitySolution.detectionEngine.components.importRuleModal.overwriteDescription', + { + defaultMessage: 'Automatically overwrite saved objects with the same rule ID', + } +); + +export const SUCCESSFULLY_IMPORTED_RULES = (totalRules: number) => + i18n.translate( + 'xpack.securitySolution.detectionEngine.components.importRuleModal.successfullyImportedRulesTitle', + { + values: { totalRules }, + defaultMessage: + 'Successfully imported {totalRules} {totalRules, plural, =1 {rule} other {rules}}', + } + ); + +export const IMPORT_FAILED = i18n.translate( + 'xpack.securitySolution.detectionEngine.components.importRuleModal.importFailedTitle', + { + defaultMessage: 'Failed to import rules', + } +); + +export const IMPORT_FAILED_DETAILED = (ruleId: string, statusCode: number, message: string) => + i18n.translate( + 'xpack.securitySolution.detectionEngine.components.importRuleModal.importFailedDetailedTitle', + { + values: { ruleId, statusCode, message }, + defaultMessage: 'Rule ID: {ruleId}\n Status Code: {statusCode}\n Message: {message}', + } + ); diff --git a/x-pack/plugins/siem/public/alerts/pages/detection_engine/rules/types.ts b/x-pack/plugins/security_solution/public/alerts/pages/detection_engine/rules/types.ts similarity index 100% rename from x-pack/plugins/siem/public/alerts/pages/detection_engine/rules/types.ts rename to x-pack/plugins/security_solution/public/alerts/pages/detection_engine/rules/types.ts diff --git a/x-pack/plugins/siem/public/alerts/pages/detection_engine/rules/utils.test.ts b/x-pack/plugins/security_solution/public/alerts/pages/detection_engine/rules/utils.test.ts similarity index 100% rename from x-pack/plugins/siem/public/alerts/pages/detection_engine/rules/utils.test.ts rename to x-pack/plugins/security_solution/public/alerts/pages/detection_engine/rules/utils.test.ts diff --git a/x-pack/plugins/siem/public/alerts/pages/detection_engine/rules/utils.ts b/x-pack/plugins/security_solution/public/alerts/pages/detection_engine/rules/utils.ts similarity index 100% rename from x-pack/plugins/siem/public/alerts/pages/detection_engine/rules/utils.ts rename to x-pack/plugins/security_solution/public/alerts/pages/detection_engine/rules/utils.ts diff --git a/x-pack/plugins/security_solution/public/alerts/pages/detection_engine/translations.ts b/x-pack/plugins/security_solution/public/alerts/pages/detection_engine/translations.ts new file mode 100644 index 0000000000000..a19422d0de2c1 --- /dev/null +++ b/x-pack/plugins/security_solution/public/alerts/pages/detection_engine/translations.ts @@ -0,0 +1,117 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + +import { i18n } from '@kbn/i18n'; + +export const PAGE_TITLE = i18n.translate( + 'xpack.securitySolution.detectionEngine.detectionsPageTitle', + { + defaultMessage: 'Alerts', + } +); + +export const LAST_ALERT = i18n.translate('xpack.securitySolution.detectionEngine.lastSignalTitle', { + defaultMessage: 'Last alert', +}); + +export const TOTAL_SIGNAL = i18n.translate( + 'xpack.securitySolution.detectionEngine.totalSignalTitle', + { + defaultMessage: 'Total', + } +); + +export const SIGNAL = i18n.translate('xpack.securitySolution.detectionEngine.signalTitle', { + defaultMessage: 'Detected alerts', +}); + +export const ALERT = i18n.translate('xpack.securitySolution.detectionEngine.alertTitle', { + defaultMessage: 'External alerts', +}); + +export const BUTTON_MANAGE_RULES = i18n.translate( + 'xpack.securitySolution.detectionEngine.buttonManageRules', + { + defaultMessage: 'Manage detection rules', + } +); + +export const PANEL_SUBTITLE_SHOWING = i18n.translate( + 'xpack.securitySolution.detectionEngine.panelSubtitleShowing', + { + defaultMessage: 'Showing', + } +); + +export const EMPTY_TITLE = i18n.translate('xpack.securitySolution.detectionEngine.emptyTitle', { + defaultMessage: + 'It looks like you don’t have any indices relevant to the detection engine in the SIEM application', +}); + +export const EMPTY_ACTION_PRIMARY = i18n.translate( + 'xpack.securitySolution.detectionEngine.emptyActionPrimary', + { + defaultMessage: 'View setup instructions', + } +); + +export const EMPTY_ACTION_SECONDARY = i18n.translate( + 'xpack.securitySolution.detectionEngine.emptyActionSecondary', + { + defaultMessage: 'Go to documentation', + } +); + +export const NO_INDEX_TITLE = i18n.translate( + 'xpack.securitySolution.detectionEngine.noIndexTitle', + { + defaultMessage: 'Let’s set up your detection engine', + } +); + +export const NO_INDEX_MSG_BODY = i18n.translate( + 'xpack.securitySolution.detectionEngine.noIndexMsgBody', + { + defaultMessage: + 'To use the detection engine, a user with the required cluster and index privileges must first access this page. For more help, contact your administrator.', + } +); + +export const GO_TO_DOCUMENTATION = i18n.translate( + 'xpack.securitySolution.detectionEngine.goToDocumentationButton', + { + defaultMessage: 'View documentation', + } +); + +export const USER_UNAUTHENTICATED_TITLE = i18n.translate( + 'xpack.securitySolution.detectionEngine.userUnauthenticatedTitle', + { + defaultMessage: 'Detection engine permissions required', + } +); + +export const USER_UNAUTHENTICATED_MSG_BODY = i18n.translate( + 'xpack.securitySolution.detectionEngine.userUnauthenticatedMsgBody', + { + defaultMessage: + 'You do not have the required permissions for viewing the detection engine. For more help, contact your administrator.', + } +); + +export const ML_RULES_DISABLED_MESSAGE = i18n.translate( + 'xpack.securitySolution.detectionEngine.mlRulesDisabledMessageTitle', + { + defaultMessage: 'ML rules require Platinum License and ML Admin Permissions', + } +); + +export const ML_RULES_UNAVAILABLE = (totalRules: number) => + i18n.translate('xpack.securitySolution.detectionEngine.mlUnavailableTitle', { + values: { totalRules }, + defaultMessage: + '{totalRules} {totalRules, plural, =1 {rule requires} other {rules require}} Machine Learning to enable.', + }); diff --git a/x-pack/plugins/index_management/public/application/store/middlewares/index.ts b/x-pack/plugins/security_solution/public/alerts/pages/detection_engine/types.ts similarity index 75% rename from x-pack/plugins/index_management/public/application/store/middlewares/index.ts rename to x-pack/plugins/security_solution/public/alerts/pages/detection_engine/types.ts index 06d77a9c3d348..d529d99ad3ad4 100644 --- a/x-pack/plugins/index_management/public/application/store/middlewares/index.ts +++ b/x-pack/plugins/security_solution/public/alerts/pages/detection_engine/types.ts @@ -4,4 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -export { syncUrlHashQueryParam } from './sync_url_hash_query_param.js'; +export enum DetectionEngineTab { + signals = 'signals', + alerts = 'alerts', +} diff --git a/x-pack/plugins/siem/public/alerts/routes.tsx b/x-pack/plugins/security_solution/public/alerts/routes.tsx similarity index 100% rename from x-pack/plugins/siem/public/alerts/routes.tsx rename to x-pack/plugins/security_solution/public/alerts/routes.tsx diff --git a/x-pack/plugins/siem/public/app/404.tsx b/x-pack/plugins/security_solution/public/app/404.tsx similarity index 88% rename from x-pack/plugins/siem/public/app/404.tsx rename to x-pack/plugins/security_solution/public/app/404.tsx index 6a1b5c56dc853..b24cad5ad5b4b 100644 --- a/x-pack/plugins/siem/public/app/404.tsx +++ b/x-pack/plugins/security_solution/public/app/404.tsx @@ -12,7 +12,7 @@ import { WrapperPage } from '../common/components/wrapper_page'; export const NotFoundPage = React.memo(() => ( diff --git a/x-pack/plugins/siem/public/app/app.tsx b/x-pack/plugins/security_solution/public/app/app.tsx similarity index 84% rename from x-pack/plugins/siem/public/app/app.tsx rename to x-pack/plugins/security_solution/public/app/app.tsx index 732b1883b9b77..50a24ef012b8b 100644 --- a/x-pack/plugins/siem/public/app/app.tsx +++ b/x-pack/plugins/security_solution/public/app/app.tsx @@ -29,6 +29,7 @@ import { PageRouter } from './routes'; import { createStore, createInitialState } from '../common/store'; import { GlobalToaster, ManageGlobalToaster } from '../common/components/toasters'; import { MlCapabilitiesProvider } from '../common/components/ml/permissions/ml_capabilities_provider'; +import { ManageGlobalTimeline } from '../timelines/components/manage_timeline'; import { ApolloClientContext } from '../common/utils/apollo_context'; import { SecuritySubPlugins } from './types'; @@ -49,19 +50,21 @@ const AppPluginRootComponent: React.FC = ({ history, }) => ( - - - - - - - - - - - - - + + + + + + + + + + + + + + + ); diff --git a/x-pack/plugins/siem/public/app/home/home_navigations.tsx b/x-pack/plugins/security_solution/public/app/home/home_navigations.tsx similarity index 100% rename from x-pack/plugins/siem/public/app/home/home_navigations.tsx rename to x-pack/plugins/security_solution/public/app/home/home_navigations.tsx diff --git a/x-pack/plugins/siem/public/app/home/index.tsx b/x-pack/plugins/security_solution/public/app/home/index.tsx similarity index 100% rename from x-pack/plugins/siem/public/app/home/index.tsx rename to x-pack/plugins/security_solution/public/app/home/index.tsx diff --git a/x-pack/plugins/siem/public/app/home/setup.tsx b/x-pack/plugins/security_solution/public/app/home/setup.tsx similarity index 90% rename from x-pack/plugins/siem/public/app/home/setup.tsx rename to x-pack/plugins/security_solution/public/app/home/setup.tsx index a88b6a36100db..5b977a83302a9 100644 --- a/x-pack/plugins/siem/public/app/home/setup.tsx +++ b/x-pack/plugins/security_solution/public/app/home/setup.tsx @@ -13,11 +13,11 @@ export const Setup: React.FunctionComponent<{ notifications: NotificationsStart; }> = ({ ingestManager, notifications }) => { React.useEffect(() => { - const defaultText = i18n.translate('xpack.siem.endpoint.ingestToastMessage', { + const defaultText = i18n.translate('xpack.securitySolution.endpoint.ingestToastMessage', { defaultMessage: 'Ingest Manager failed during its setup.', }); - const title = i18n.translate('xpack.siem.endpoint.ingestToastTitle', { + const title = i18n.translate('xpack.securitySolution.endpoint.ingestToastTitle', { defaultMessage: 'App failed to initialize', }); diff --git a/x-pack/plugins/security_solution/public/app/home/translations.ts b/x-pack/plugins/security_solution/public/app/home/translations.ts new file mode 100644 index 0000000000000..ccf927eba20c9 --- /dev/null +++ b/x-pack/plugins/security_solution/public/app/home/translations.ts @@ -0,0 +1,38 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + +import { i18n } from '@kbn/i18n'; + +export const OVERVIEW = i18n.translate('xpack.securitySolution.navigation.overview', { + defaultMessage: 'Overview', +}); + +export const HOSTS = i18n.translate('xpack.securitySolution.navigation.hosts', { + defaultMessage: 'Hosts', +}); + +export const NETWORK = i18n.translate('xpack.securitySolution.navigation.network', { + defaultMessage: 'Network', +}); + +export const DETECTION_ENGINE = i18n.translate( + 'xpack.securitySolution.navigation.detectionEngine', + { + defaultMessage: 'Detections', + } +); + +export const TIMELINES = i18n.translate('xpack.securitySolution.navigation.timelines', { + defaultMessage: 'Timelines', +}); + +export const CASE = i18n.translate('xpack.securitySolution.navigation.case', { + defaultMessage: 'Cases', +}); + +export const MANAGEMENT = i18n.translate('xpack.securitySolution.navigation.management', { + defaultMessage: 'Management', +}); diff --git a/x-pack/plugins/siem/public/app/index.tsx b/x-pack/plugins/security_solution/public/app/index.tsx similarity index 100% rename from x-pack/plugins/siem/public/app/index.tsx rename to x-pack/plugins/security_solution/public/app/index.tsx diff --git a/x-pack/plugins/siem/public/app/routes.tsx b/x-pack/plugins/security_solution/public/app/routes.tsx similarity index 100% rename from x-pack/plugins/siem/public/app/routes.tsx rename to x-pack/plugins/security_solution/public/app/routes.tsx diff --git a/x-pack/plugins/siem/public/app/types.ts b/x-pack/plugins/security_solution/public/app/types.ts similarity index 100% rename from x-pack/plugins/siem/public/app/types.ts rename to x-pack/plugins/security_solution/public/app/types.ts diff --git a/x-pack/plugins/siem/public/cases/components/__mock__/form.ts b/x-pack/plugins/security_solution/public/cases/components/__mock__/form.ts similarity index 100% rename from x-pack/plugins/siem/public/cases/components/__mock__/form.ts rename to x-pack/plugins/security_solution/public/cases/components/__mock__/form.ts diff --git a/x-pack/plugins/siem/public/cases/components/__mock__/router.ts b/x-pack/plugins/security_solution/public/cases/components/__mock__/router.ts similarity index 100% rename from x-pack/plugins/siem/public/cases/components/__mock__/router.ts rename to x-pack/plugins/security_solution/public/cases/components/__mock__/router.ts diff --git a/x-pack/plugins/siem/public/cases/components/add_comment/index.test.tsx b/x-pack/plugins/security_solution/public/cases/components/add_comment/index.test.tsx similarity index 100% rename from x-pack/plugins/siem/public/cases/components/add_comment/index.test.tsx rename to x-pack/plugins/security_solution/public/cases/components/add_comment/index.test.tsx diff --git a/x-pack/plugins/siem/public/cases/components/add_comment/index.tsx b/x-pack/plugins/security_solution/public/cases/components/add_comment/index.tsx similarity index 100% rename from x-pack/plugins/siem/public/cases/components/add_comment/index.tsx rename to x-pack/plugins/security_solution/public/cases/components/add_comment/index.tsx diff --git a/x-pack/plugins/siem/public/cases/components/add_comment/schema.tsx b/x-pack/plugins/security_solution/public/cases/components/add_comment/schema.tsx similarity index 100% rename from x-pack/plugins/siem/public/cases/components/add_comment/schema.tsx rename to x-pack/plugins/security_solution/public/cases/components/add_comment/schema.tsx diff --git a/x-pack/plugins/siem/public/cases/components/add_comment/translations.ts b/x-pack/plugins/security_solution/public/cases/components/add_comment/translations.ts similarity index 100% rename from x-pack/plugins/siem/public/cases/components/add_comment/translations.ts rename to x-pack/plugins/security_solution/public/cases/components/add_comment/translations.ts diff --git a/x-pack/plugins/siem/public/cases/components/all_cases/actions.tsx b/x-pack/plugins/security_solution/public/cases/components/all_cases/actions.tsx similarity index 100% rename from x-pack/plugins/siem/public/cases/components/all_cases/actions.tsx rename to x-pack/plugins/security_solution/public/cases/components/all_cases/actions.tsx diff --git a/x-pack/plugins/siem/public/cases/components/all_cases/columns.test.tsx b/x-pack/plugins/security_solution/public/cases/components/all_cases/columns.test.tsx similarity index 100% rename from x-pack/plugins/siem/public/cases/components/all_cases/columns.test.tsx rename to x-pack/plugins/security_solution/public/cases/components/all_cases/columns.test.tsx diff --git a/x-pack/plugins/siem/public/cases/components/all_cases/columns.tsx b/x-pack/plugins/security_solution/public/cases/components/all_cases/columns.tsx similarity index 100% rename from x-pack/plugins/siem/public/cases/components/all_cases/columns.tsx rename to x-pack/plugins/security_solution/public/cases/components/all_cases/columns.tsx diff --git a/x-pack/plugins/siem/public/cases/components/all_cases/index.test.tsx b/x-pack/plugins/security_solution/public/cases/components/all_cases/index.test.tsx similarity index 100% rename from x-pack/plugins/siem/public/cases/components/all_cases/index.test.tsx rename to x-pack/plugins/security_solution/public/cases/components/all_cases/index.test.tsx diff --git a/x-pack/plugins/siem/public/cases/components/all_cases/index.tsx b/x-pack/plugins/security_solution/public/cases/components/all_cases/index.tsx similarity index 100% rename from x-pack/plugins/siem/public/cases/components/all_cases/index.tsx rename to x-pack/plugins/security_solution/public/cases/components/all_cases/index.tsx diff --git a/x-pack/plugins/siem/public/cases/components/all_cases/table_filters.test.tsx b/x-pack/plugins/security_solution/public/cases/components/all_cases/table_filters.test.tsx similarity index 100% rename from x-pack/plugins/siem/public/cases/components/all_cases/table_filters.test.tsx rename to x-pack/plugins/security_solution/public/cases/components/all_cases/table_filters.test.tsx diff --git a/x-pack/plugins/siem/public/cases/components/all_cases/table_filters.tsx b/x-pack/plugins/security_solution/public/cases/components/all_cases/table_filters.tsx similarity index 100% rename from x-pack/plugins/siem/public/cases/components/all_cases/table_filters.tsx rename to x-pack/plugins/security_solution/public/cases/components/all_cases/table_filters.tsx diff --git a/x-pack/plugins/security_solution/public/cases/components/all_cases/translations.ts b/x-pack/plugins/security_solution/public/cases/components/all_cases/translations.ts new file mode 100644 index 0000000000000..9198aaceb96f9 --- /dev/null +++ b/x-pack/plugins/security_solution/public/cases/components/all_cases/translations.ts @@ -0,0 +1,110 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + +import { i18n } from '@kbn/i18n'; + +export * from '../../translations'; + +export const NO_CASES = i18n.translate('xpack.securitySolution.case.caseTable.noCases.title', { + defaultMessage: 'No Cases', +}); +export const NO_CASES_BODY = i18n.translate('xpack.securitySolution.case.caseTable.noCases.body', { + defaultMessage: + 'There are no cases to display. Please create a new case or change your filter settings above.', +}); + +export const ADD_NEW_CASE = i18n.translate('xpack.securitySolution.case.caseTable.addNewCase', { + defaultMessage: 'Add New Case', +}); + +export const SHOWING_SELECTED_CASES = (totalRules: number) => + i18n.translate('xpack.securitySolution.case.caseTable.selectedCasesTitle', { + values: { totalRules }, + defaultMessage: 'Selected {totalRules} {totalRules, plural, =1 {case} other {cases}}', + }); + +export const SHOWING_CASES = (totalRules: number) => + i18n.translate('xpack.securitySolution.case.caseTable.showingCasesTitle', { + values: { totalRules }, + defaultMessage: 'Showing {totalRules} {totalRules, plural, =1 {case} other {cases}}', + }); + +export const UNIT = (totalCount: number) => + i18n.translate('xpack.securitySolution.case.caseTable.unit', { + values: { totalCount }, + defaultMessage: `{totalCount, plural, =1 {case} other {cases}}`, + }); + +export const SEARCH_CASES = i18n.translate( + 'xpack.securitySolution.case.caseTable.searchAriaLabel', + { + defaultMessage: 'Search cases', + } +); + +export const BULK_ACTIONS = i18n.translate('xpack.securitySolution.case.caseTable.bulkActions', { + defaultMessage: 'Bulk actions', +}); + +export const EXTERNAL_INCIDENT = i18n.translate( + 'xpack.securitySolution.case.caseTable.snIncident', + { + defaultMessage: 'External Incident', + } +); + +export const INCIDENT_MANAGEMENT_SYSTEM = i18n.translate( + 'xpack.securitySolution.case.caseTable.incidentSystem', + { + defaultMessage: 'Incident Management System', + } +); + +export const SEARCH_PLACEHOLDER = i18n.translate( + 'xpack.securitySolution.case.caseTable.searchPlaceholder', + { + defaultMessage: 'e.g. case name', + } +); +export const OPEN_CASES = i18n.translate('xpack.securitySolution.case.caseTable.openCases', { + defaultMessage: 'Open cases', +}); +export const CLOSED_CASES = i18n.translate('xpack.securitySolution.case.caseTable.closedCases', { + defaultMessage: 'Closed cases', +}); + +export const CLOSED = i18n.translate('xpack.securitySolution.case.caseTable.closed', { + defaultMessage: 'Closed', +}); + +export const DELETE = i18n.translate('xpack.securitySolution.case.caseTable.delete', { + defaultMessage: 'Delete', +}); + +export const REQUIRES_UPDATE = i18n.translate( + 'xpack.securitySolution.case.caseTable.requiresUpdate', + { + defaultMessage: ' requires update', + } +); + +export const UP_TO_DATE = i18n.translate('xpack.securitySolution.case.caseTable.upToDate', { + defaultMessage: ' is up to date', +}); +export const NOT_PUSHED = i18n.translate('xpack.securitySolution.case.caseTable.notPushed', { + defaultMessage: 'Not pushed', +}); + +export const REFRESH = i18n.translate('xpack.securitySolution.case.caseTable.refreshTitle', { + defaultMessage: 'Refresh', +}); + +export const SERVICENOW_LINK_ARIA = i18n.translate( + 'xpack.securitySolution.case.caseTable.serviceNowLinkAria', + { + defaultMessage: 'click to view the incident on servicenow', + } +); diff --git a/x-pack/plugins/siem/public/cases/components/bulk_actions/index.tsx b/x-pack/plugins/security_solution/public/cases/components/bulk_actions/index.tsx similarity index 100% rename from x-pack/plugins/siem/public/cases/components/bulk_actions/index.tsx rename to x-pack/plugins/security_solution/public/cases/components/bulk_actions/index.tsx diff --git a/x-pack/plugins/siem/public/cases/components/bulk_actions/translations.ts b/x-pack/plugins/security_solution/public/cases/components/bulk_actions/translations.ts similarity index 73% rename from x-pack/plugins/siem/public/cases/components/bulk_actions/translations.ts rename to x-pack/plugins/security_solution/public/cases/components/bulk_actions/translations.ts index 97045c8ebaf8b..25e22aebb6a0b 100644 --- a/x-pack/plugins/siem/public/cases/components/bulk_actions/translations.ts +++ b/x-pack/plugins/security_solution/public/cases/components/bulk_actions/translations.ts @@ -7,21 +7,21 @@ import { i18n } from '@kbn/i18n'; export const BULK_ACTION_CLOSE_SELECTED = i18n.translate( - 'xpack.siem.case.caseTable.bulkActions.closeSelectedTitle', + 'xpack.securitySolution.case.caseTable.bulkActions.closeSelectedTitle', { defaultMessage: 'Close selected', } ); export const BULK_ACTION_OPEN_SELECTED = i18n.translate( - 'xpack.siem.case.caseTable.bulkActions.openSelectedTitle', + 'xpack.securitySolution.case.caseTable.bulkActions.openSelectedTitle', { defaultMessage: 'Reopen selected', } ); export const BULK_ACTION_DELETE_SELECTED = i18n.translate( - 'xpack.siem.case.caseTable.bulkActions.deleteSelectedTitle', + 'xpack.securitySolution.case.caseTable.bulkActions.deleteSelectedTitle', { defaultMessage: 'Delete selected', } diff --git a/x-pack/plugins/siem/public/cases/components/callout/helpers.tsx b/x-pack/plugins/security_solution/public/cases/components/callout/helpers.tsx similarity index 100% rename from x-pack/plugins/siem/public/cases/components/callout/helpers.tsx rename to x-pack/plugins/security_solution/public/cases/components/callout/helpers.tsx diff --git a/x-pack/plugins/siem/public/cases/components/callout/index.test.tsx b/x-pack/plugins/security_solution/public/cases/components/callout/index.test.tsx similarity index 100% rename from x-pack/plugins/siem/public/cases/components/callout/index.test.tsx rename to x-pack/plugins/security_solution/public/cases/components/callout/index.test.tsx diff --git a/x-pack/plugins/siem/public/cases/components/callout/index.tsx b/x-pack/plugins/security_solution/public/cases/components/callout/index.tsx similarity index 100% rename from x-pack/plugins/siem/public/cases/components/callout/index.tsx rename to x-pack/plugins/security_solution/public/cases/components/callout/index.tsx diff --git a/x-pack/plugins/siem/public/cases/components/callout/translations.ts b/x-pack/plugins/security_solution/public/cases/components/callout/translations.ts similarity index 78% rename from x-pack/plugins/siem/public/cases/components/callout/translations.ts rename to x-pack/plugins/security_solution/public/cases/components/callout/translations.ts index f70225b841162..01956ca942997 100644 --- a/x-pack/plugins/siem/public/cases/components/callout/translations.ts +++ b/x-pack/plugins/security_solution/public/cases/components/callout/translations.ts @@ -7,14 +7,14 @@ import { i18n } from '@kbn/i18n'; export const READ_ONLY_SAVED_OBJECT_TITLE = i18n.translate( - 'xpack.siem.case.readOnlySavedObjectTitle', + 'xpack.securitySolution.case.readOnlySavedObjectTitle', { defaultMessage: 'You have read-only feature privileges', } ); export const READ_ONLY_SAVED_OBJECT_MSG = i18n.translate( - 'xpack.siem.case.readOnlySavedObjectDescription', + 'xpack.securitySolution.case.readOnlySavedObjectDescription', { defaultMessage: 'You are only allowed to view cases. If you need to open and update cases, contact your Kibana administrator', @@ -22,7 +22,7 @@ export const READ_ONLY_SAVED_OBJECT_MSG = i18n.translate( ); export const DISMISS_CALLOUT = i18n.translate( - 'xpack.siem.case.dismissErrorsPushServiceCallOutTitle', + 'xpack.securitySolution.case.dismissErrorsPushServiceCallOutTitle', { defaultMessage: 'Dismiss', } diff --git a/x-pack/plugins/siem/public/cases/components/case_header_page/index.tsx b/x-pack/plugins/security_solution/public/cases/components/case_header_page/index.tsx similarity index 100% rename from x-pack/plugins/siem/public/cases/components/case_header_page/index.tsx rename to x-pack/plugins/security_solution/public/cases/components/case_header_page/index.tsx diff --git a/x-pack/plugins/security_solution/public/cases/components/case_header_page/translations.ts b/x-pack/plugins/security_solution/public/cases/components/case_header_page/translations.ts new file mode 100644 index 0000000000000..8cdc287b1584c --- /dev/null +++ b/x-pack/plugins/security_solution/public/cases/components/case_header_page/translations.ts @@ -0,0 +1,22 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + +import { i18n } from '@kbn/i18n'; + +export const PAGE_BADGE_LABEL = i18n.translate( + 'xpack.securitySolution.case.caseView.pageBadgeLabel', + { + defaultMessage: 'Beta', + } +); + +export const PAGE_BADGE_TOOLTIP = i18n.translate( + 'xpack.securitySolution.case.caseView.pageBadgeTooltip', + { + defaultMessage: + 'Case Workflow is still in beta. Please help us improve by reporting issues or bugs in the Kibana repo.', + } +); diff --git a/x-pack/plugins/siem/public/cases/components/case_status/index.tsx b/x-pack/plugins/security_solution/public/cases/components/case_status/index.tsx similarity index 100% rename from x-pack/plugins/siem/public/cases/components/case_status/index.tsx rename to x-pack/plugins/security_solution/public/cases/components/case_status/index.tsx diff --git a/x-pack/plugins/siem/public/cases/components/case_view/actions.test.tsx b/x-pack/plugins/security_solution/public/cases/components/case_view/actions.test.tsx similarity index 100% rename from x-pack/plugins/siem/public/cases/components/case_view/actions.test.tsx rename to x-pack/plugins/security_solution/public/cases/components/case_view/actions.test.tsx diff --git a/x-pack/plugins/siem/public/cases/components/case_view/actions.tsx b/x-pack/plugins/security_solution/public/cases/components/case_view/actions.tsx similarity index 100% rename from x-pack/plugins/siem/public/cases/components/case_view/actions.tsx rename to x-pack/plugins/security_solution/public/cases/components/case_view/actions.tsx diff --git a/x-pack/plugins/siem/public/cases/components/case_view/index.test.tsx b/x-pack/plugins/security_solution/public/cases/components/case_view/index.test.tsx similarity index 100% rename from x-pack/plugins/siem/public/cases/components/case_view/index.test.tsx rename to x-pack/plugins/security_solution/public/cases/components/case_view/index.test.tsx diff --git a/x-pack/plugins/siem/public/cases/components/case_view/index.tsx b/x-pack/plugins/security_solution/public/cases/components/case_view/index.tsx similarity index 100% rename from x-pack/plugins/siem/public/cases/components/case_view/index.tsx rename to x-pack/plugins/security_solution/public/cases/components/case_view/index.tsx diff --git a/x-pack/plugins/security_solution/public/cases/components/case_view/translations.ts b/x-pack/plugins/security_solution/public/cases/components/case_view/translations.ts new file mode 100644 index 0000000000000..9523e2485a610 --- /dev/null +++ b/x-pack/plugins/security_solution/public/cases/components/case_view/translations.ts @@ -0,0 +1,156 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + +import { i18n } from '@kbn/i18n'; + +export * from '../../translations'; + +export const SHOWING_CASES = (actionDate: string, actionName: string, userName: string) => + i18n.translate('xpack.securitySolution.case.caseView.actionHeadline', { + values: { + actionDate, + actionName, + userName, + }, + defaultMessage: '{userName} {actionName} on {actionDate}', + }); + +export const ADDED_FIELD = i18n.translate( + 'xpack.securitySolution.case.caseView.actionLabel.addedField', + { + defaultMessage: 'added', + } +); + +export const CHANGED_FIELD = i18n.translate( + 'xpack.securitySolution.case.caseView.actionLabel.changededField', + { + defaultMessage: 'changed', + } +); + +export const SELECTED_THIRD_PARTY = (thirdParty: string) => + i18n.translate('xpack.securitySolution.case.caseView.actionLabel.selectedThirdParty', { + values: { + thirdParty, + }, + defaultMessage: 'selected { thirdParty } as incident management system', + }); + +export const REMOVED_THIRD_PARTY = i18n.translate( + 'xpack.securitySolution.case.caseView.actionLabel.removedThirdParty', + { + defaultMessage: 'removed external incident management system', + } +); + +export const EDITED_FIELD = i18n.translate( + 'xpack.securitySolution.case.caseView.actionLabel.editedField', + { + defaultMessage: 'edited', + } +); + +export const REMOVED_FIELD = i18n.translate( + 'xpack.securitySolution.case.caseView.actionLabel.removedField', + { + defaultMessage: 'removed', + } +); + +export const VIEW_INCIDENT = (incidentNumber: string) => + i18n.translate('xpack.securitySolution.case.caseView.actionLabel.viewIncident', { + defaultMessage: 'View {incidentNumber}', + values: { + incidentNumber, + }, + }); + +export const PUSHED_NEW_INCIDENT = i18n.translate( + 'xpack.securitySolution.case.caseView.actionLabel.pushedNewIncident', + { + defaultMessage: 'pushed as new incident', + } +); + +export const UPDATE_INCIDENT = i18n.translate( + 'xpack.securitySolution.case.caseView.actionLabel.updateIncident', + { + defaultMessage: 'updated incident', + } +); + +export const ADDED_DESCRIPTION = i18n.translate( + 'xpack.securitySolution.case.caseView.actionLabel.addDescription', + { + defaultMessage: 'added description', + } +); + +export const EDIT_DESCRIPTION = i18n.translate( + 'xpack.securitySolution.case.caseView.edit.description', + { + defaultMessage: 'Edit description', + } +); + +export const QUOTE = i18n.translate('xpack.securitySolution.case.caseView.edit.quote', { + defaultMessage: 'Quote', +}); + +export const EDIT_COMMENT = i18n.translate('xpack.securitySolution.case.caseView.edit.comment', { + defaultMessage: 'Edit comment', +}); + +export const ON = i18n.translate('xpack.securitySolution.case.caseView.actionLabel.on', { + defaultMessage: 'on', +}); + +export const ADDED_COMMENT = i18n.translate( + 'xpack.securitySolution.case.caseView.actionLabel.addComment', + { + defaultMessage: 'added comment', + } +); + +export const STATUS = i18n.translate('xpack.securitySolution.case.caseView.statusLabel', { + defaultMessage: 'Status', +}); + +export const CASE = i18n.translate('xpack.securitySolution.case.caseView.case', { + defaultMessage: 'case', +}); + +export const COMMENT = i18n.translate('xpack.securitySolution.case.caseView.comment', { + defaultMessage: 'comment', +}); + +export const CASE_OPENED = i18n.translate('xpack.securitySolution.case.caseView.caseOpened', { + defaultMessage: 'Case opened', +}); + +export const CASE_CLOSED = i18n.translate('xpack.securitySolution.case.caseView.caseClosed', { + defaultMessage: 'Case closed', +}); + +export const CASE_REFRESH = i18n.translate('xpack.securitySolution.case.caseView.caseRefresh', { + defaultMessage: 'Refresh case', +}); + +export const EMAIL_SUBJECT = (caseTitle: string) => + i18n.translate('xpack.securitySolution.case.caseView.emailSubject', { + values: { caseTitle }, + defaultMessage: 'SIEM Case - {caseTitle}', + }); + +export const EMAIL_BODY = (caseUrl: string) => + i18n.translate('xpack.securitySolution.case.caseView.emailBody', { + values: { caseUrl }, + defaultMessage: 'Case reference: {caseUrl}', + }); +export const UNKNOWN = i18n.translate('xpack.securitySolution.case.caseView.unknown', { + defaultMessage: 'Unknown', +}); diff --git a/x-pack/plugins/siem/public/cases/components/configure_cases/__mock__/index.tsx b/x-pack/plugins/security_solution/public/cases/components/configure_cases/__mock__/index.tsx similarity index 100% rename from x-pack/plugins/siem/public/cases/components/configure_cases/__mock__/index.tsx rename to x-pack/plugins/security_solution/public/cases/components/configure_cases/__mock__/index.tsx diff --git a/x-pack/plugins/siem/public/cases/components/configure_cases/button.test.tsx b/x-pack/plugins/security_solution/public/cases/components/configure_cases/button.test.tsx similarity index 100% rename from x-pack/plugins/siem/public/cases/components/configure_cases/button.test.tsx rename to x-pack/plugins/security_solution/public/cases/components/configure_cases/button.test.tsx diff --git a/x-pack/plugins/siem/public/cases/components/configure_cases/button.tsx b/x-pack/plugins/security_solution/public/cases/components/configure_cases/button.tsx similarity index 100% rename from x-pack/plugins/siem/public/cases/components/configure_cases/button.tsx rename to x-pack/plugins/security_solution/public/cases/components/configure_cases/button.tsx diff --git a/x-pack/plugins/siem/public/cases/components/configure_cases/closure_options.test.tsx b/x-pack/plugins/security_solution/public/cases/components/configure_cases/closure_options.test.tsx similarity index 100% rename from x-pack/plugins/siem/public/cases/components/configure_cases/closure_options.test.tsx rename to x-pack/plugins/security_solution/public/cases/components/configure_cases/closure_options.test.tsx diff --git a/x-pack/plugins/siem/public/cases/components/configure_cases/closure_options.tsx b/x-pack/plugins/security_solution/public/cases/components/configure_cases/closure_options.tsx similarity index 100% rename from x-pack/plugins/siem/public/cases/components/configure_cases/closure_options.tsx rename to x-pack/plugins/security_solution/public/cases/components/configure_cases/closure_options.tsx diff --git a/x-pack/plugins/siem/public/cases/components/configure_cases/closure_options_radio.test.tsx b/x-pack/plugins/security_solution/public/cases/components/configure_cases/closure_options_radio.test.tsx similarity index 100% rename from x-pack/plugins/siem/public/cases/components/configure_cases/closure_options_radio.test.tsx rename to x-pack/plugins/security_solution/public/cases/components/configure_cases/closure_options_radio.test.tsx diff --git a/x-pack/plugins/siem/public/cases/components/configure_cases/closure_options_radio.tsx b/x-pack/plugins/security_solution/public/cases/components/configure_cases/closure_options_radio.tsx similarity index 100% rename from x-pack/plugins/siem/public/cases/components/configure_cases/closure_options_radio.tsx rename to x-pack/plugins/security_solution/public/cases/components/configure_cases/closure_options_radio.tsx diff --git a/x-pack/plugins/siem/public/cases/components/configure_cases/connectors.test.tsx b/x-pack/plugins/security_solution/public/cases/components/configure_cases/connectors.test.tsx similarity index 100% rename from x-pack/plugins/siem/public/cases/components/configure_cases/connectors.test.tsx rename to x-pack/plugins/security_solution/public/cases/components/configure_cases/connectors.test.tsx diff --git a/x-pack/plugins/siem/public/cases/components/configure_cases/connectors.tsx b/x-pack/plugins/security_solution/public/cases/components/configure_cases/connectors.tsx similarity index 100% rename from x-pack/plugins/siem/public/cases/components/configure_cases/connectors.tsx rename to x-pack/plugins/security_solution/public/cases/components/configure_cases/connectors.tsx diff --git a/x-pack/plugins/siem/public/cases/components/configure_cases/connectors_dropdown.test.tsx b/x-pack/plugins/security_solution/public/cases/components/configure_cases/connectors_dropdown.test.tsx similarity index 100% rename from x-pack/plugins/siem/public/cases/components/configure_cases/connectors_dropdown.test.tsx rename to x-pack/plugins/security_solution/public/cases/components/configure_cases/connectors_dropdown.test.tsx diff --git a/x-pack/plugins/siem/public/cases/components/configure_cases/connectors_dropdown.tsx b/x-pack/plugins/security_solution/public/cases/components/configure_cases/connectors_dropdown.tsx similarity index 100% rename from x-pack/plugins/siem/public/cases/components/configure_cases/connectors_dropdown.tsx rename to x-pack/plugins/security_solution/public/cases/components/configure_cases/connectors_dropdown.tsx diff --git a/x-pack/plugins/siem/public/cases/components/configure_cases/field_mapping.test.tsx b/x-pack/plugins/security_solution/public/cases/components/configure_cases/field_mapping.test.tsx similarity index 100% rename from x-pack/plugins/siem/public/cases/components/configure_cases/field_mapping.test.tsx rename to x-pack/plugins/security_solution/public/cases/components/configure_cases/field_mapping.test.tsx diff --git a/x-pack/plugins/siem/public/cases/components/configure_cases/field_mapping.tsx b/x-pack/plugins/security_solution/public/cases/components/configure_cases/field_mapping.tsx similarity index 100% rename from x-pack/plugins/siem/public/cases/components/configure_cases/field_mapping.tsx rename to x-pack/plugins/security_solution/public/cases/components/configure_cases/field_mapping.tsx diff --git a/x-pack/plugins/siem/public/cases/components/configure_cases/field_mapping_row.test.tsx b/x-pack/plugins/security_solution/public/cases/components/configure_cases/field_mapping_row.test.tsx similarity index 100% rename from x-pack/plugins/siem/public/cases/components/configure_cases/field_mapping_row.test.tsx rename to x-pack/plugins/security_solution/public/cases/components/configure_cases/field_mapping_row.test.tsx diff --git a/x-pack/plugins/siem/public/cases/components/configure_cases/field_mapping_row.tsx b/x-pack/plugins/security_solution/public/cases/components/configure_cases/field_mapping_row.tsx similarity index 100% rename from x-pack/plugins/siem/public/cases/components/configure_cases/field_mapping_row.tsx rename to x-pack/plugins/security_solution/public/cases/components/configure_cases/field_mapping_row.tsx diff --git a/x-pack/plugins/siem/public/cases/components/configure_cases/index.test.tsx b/x-pack/plugins/security_solution/public/cases/components/configure_cases/index.test.tsx similarity index 100% rename from x-pack/plugins/siem/public/cases/components/configure_cases/index.test.tsx rename to x-pack/plugins/security_solution/public/cases/components/configure_cases/index.test.tsx diff --git a/x-pack/plugins/siem/public/cases/components/configure_cases/index.tsx b/x-pack/plugins/security_solution/public/cases/components/configure_cases/index.tsx similarity index 100% rename from x-pack/plugins/siem/public/cases/components/configure_cases/index.tsx rename to x-pack/plugins/security_solution/public/cases/components/configure_cases/index.tsx diff --git a/x-pack/plugins/siem/public/cases/components/configure_cases/mapping.test.tsx b/x-pack/plugins/security_solution/public/cases/components/configure_cases/mapping.test.tsx similarity index 100% rename from x-pack/plugins/siem/public/cases/components/configure_cases/mapping.test.tsx rename to x-pack/plugins/security_solution/public/cases/components/configure_cases/mapping.test.tsx diff --git a/x-pack/plugins/siem/public/cases/components/configure_cases/mapping.tsx b/x-pack/plugins/security_solution/public/cases/components/configure_cases/mapping.tsx similarity index 100% rename from x-pack/plugins/siem/public/cases/components/configure_cases/mapping.tsx rename to x-pack/plugins/security_solution/public/cases/components/configure_cases/mapping.tsx diff --git a/x-pack/plugins/siem/public/cases/components/configure_cases/translations.ts b/x-pack/plugins/security_solution/public/cases/components/configure_cases/translations.ts similarity index 61% rename from x-pack/plugins/siem/public/cases/components/configure_cases/translations.ts rename to x-pack/plugins/security_solution/public/cases/components/configure_cases/translations.ts index 1e5a47d3f50fa..c256c6dedb918 100644 --- a/x-pack/plugins/siem/public/cases/components/configure_cases/translations.ts +++ b/x-pack/plugins/security_solution/public/cases/components/configure_cases/translations.ts @@ -7,14 +7,14 @@ import { i18n } from '@kbn/i18n'; export const INCIDENT_MANAGEMENT_SYSTEM_TITLE = i18n.translate( - 'xpack.siem.case.configureCases.incidentManagementSystemTitle', + 'xpack.securitySolution.case.configureCases.incidentManagementSystemTitle', { defaultMessage: 'Connect to external incident management system', } ); export const INCIDENT_MANAGEMENT_SYSTEM_DESC = i18n.translate( - 'xpack.siem.case.configureCases.incidentManagementSystemDesc', + 'xpack.securitySolution.case.configureCases.incidentManagementSystemDesc', { defaultMessage: 'You may optionally connect SIEM cases to an external incident management system of your choosing. This will allow you to push case data as an incident in your chosen third-party system.', @@ -22,29 +22,35 @@ export const INCIDENT_MANAGEMENT_SYSTEM_DESC = i18n.translate( ); export const INCIDENT_MANAGEMENT_SYSTEM_LABEL = i18n.translate( - 'xpack.siem.case.configureCases.incidentManagementSystemLabel', + 'xpack.securitySolution.case.configureCases.incidentManagementSystemLabel', { defaultMessage: 'Incident management system', } ); -export const NO_CONNECTOR = i18n.translate('xpack.siem.case.configureCases.noConnector', { - defaultMessage: 'No connector selected', -}); +export const NO_CONNECTOR = i18n.translate( + 'xpack.securitySolution.case.configureCases.noConnector', + { + defaultMessage: 'No connector selected', + } +); -export const ADD_NEW_CONNECTOR = i18n.translate('xpack.siem.case.configureCases.addNewConnector', { - defaultMessage: 'Add new connector', -}); +export const ADD_NEW_CONNECTOR = i18n.translate( + 'xpack.securitySolution.case.configureCases.addNewConnector', + { + defaultMessage: 'Add new connector', + } +); export const CASE_CLOSURE_OPTIONS_TITLE = i18n.translate( - 'xpack.siem.case.configureCases.caseClosureOptionsTitle', + 'xpack.securitySolution.case.configureCases.caseClosureOptionsTitle', { defaultMessage: 'Case Closures', } ); export const CASE_CLOSURE_OPTIONS_DESC = i18n.translate( - 'xpack.siem.case.configureCases.caseClosureOptionsDesc', + 'xpack.securitySolution.case.configureCases.caseClosureOptionsDesc', { defaultMessage: 'Define how you wish SIEM cases to be closed. Automated case closures require an established connection to an external incident management system.', @@ -52,42 +58,42 @@ export const CASE_CLOSURE_OPTIONS_DESC = i18n.translate( ); export const CASE_CLOSURE_OPTIONS_LABEL = i18n.translate( - 'xpack.siem.case.configureCases.caseClosureOptionsLabel', + 'xpack.securitySolution.case.configureCases.caseClosureOptionsLabel', { defaultMessage: 'Case closure options', } ); export const CASE_CLOSURE_OPTIONS_MANUAL = i18n.translate( - 'xpack.siem.case.configureCases.caseClosureOptionsManual', + 'xpack.securitySolution.case.configureCases.caseClosureOptionsManual', { defaultMessage: 'Manually close SIEM cases', } ); export const CASE_CLOSURE_OPTIONS_NEW_INCIDENT = i18n.translate( - 'xpack.siem.case.configureCases.caseClosureOptionsNewIncident', + 'xpack.securitySolution.case.configureCases.caseClosureOptionsNewIncident', { defaultMessage: 'Automatically close SIEM cases when pushing new incident to external system', } ); export const CASE_CLOSURE_OPTIONS_CLOSED_INCIDENT = i18n.translate( - 'xpack.siem.case.configureCases.caseClosureOptionsClosedIncident', + 'xpack.securitySolution.case.configureCases.caseClosureOptionsClosedIncident', { defaultMessage: 'Automatically close SIEM cases when incident is closed in external system', } ); export const FIELD_MAPPING_TITLE = i18n.translate( - 'xpack.siem.case.configureCases.fieldMappingTitle', + 'xpack.securitySolution.case.configureCases.fieldMappingTitle', { defaultMessage: 'Field mappings', } ); export const FIELD_MAPPING_DESC = i18n.translate( - 'xpack.siem.case.configureCases.fieldMappingDesc', + 'xpack.securitySolution.case.configureCases.fieldMappingDesc', { defaultMessage: 'Map SIEM case fields when pushing data to a third-party. Field mappings require an established connection to an external incident management system.', @@ -95,60 +101,60 @@ export const FIELD_MAPPING_DESC = i18n.translate( ); export const FIELD_MAPPING_FIRST_COL = i18n.translate( - 'xpack.siem.case.configureCases.fieldMappingFirstCol', + 'xpack.securitySolution.case.configureCases.fieldMappingFirstCol', { defaultMessage: 'SIEM case field', } ); export const FIELD_MAPPING_SECOND_COL = i18n.translate( - 'xpack.siem.case.configureCases.fieldMappingSecondCol', + 'xpack.securitySolution.case.configureCases.fieldMappingSecondCol', { defaultMessage: 'External incident field', } ); export const FIELD_MAPPING_THIRD_COL = i18n.translate( - 'xpack.siem.case.configureCases.fieldMappingThirdCol', + 'xpack.securitySolution.case.configureCases.fieldMappingThirdCol', { defaultMessage: 'On edit and update', } ); export const FIELD_MAPPING_EDIT_NOTHING = i18n.translate( - 'xpack.siem.case.configureCases.fieldMappingEditNothing', + 'xpack.securitySolution.case.configureCases.fieldMappingEditNothing', { defaultMessage: 'Nothing', } ); export const FIELD_MAPPING_EDIT_OVERWRITE = i18n.translate( - 'xpack.siem.case.configureCases.fieldMappingEditOverwrite', + 'xpack.securitySolution.case.configureCases.fieldMappingEditOverwrite', { defaultMessage: 'Overwrite', } ); export const FIELD_MAPPING_EDIT_APPEND = i18n.translate( - 'xpack.siem.case.configureCases.fieldMappingEditAppend', + 'xpack.securitySolution.case.configureCases.fieldMappingEditAppend', { defaultMessage: 'Append', } ); -export const CANCEL = i18n.translate('xpack.siem.case.configureCases.cancelButton', { +export const CANCEL = i18n.translate('xpack.securitySolution.case.configureCases.cancelButton', { defaultMessage: 'Cancel', }); export const WARNING_NO_CONNECTOR_TITLE = i18n.translate( - 'xpack.siem.case.configureCases.warningTitle', + 'xpack.securitySolution.case.configureCases.warningTitle', { defaultMessage: 'Warning', } ); export const WARNING_NO_CONNECTOR_MESSAGE = i18n.translate( - 'xpack.siem.case.configureCases.warningMessage', + 'xpack.securitySolution.case.configureCases.warningMessage', { defaultMessage: 'The selected connector has been deleted. Either select a different connector or create a new one.', @@ -156,18 +162,21 @@ export const WARNING_NO_CONNECTOR_MESSAGE = i18n.translate( ); export const MAPPING_FIELD_NOT_MAPPED = i18n.translate( - 'xpack.siem.case.configureCases.mappingFieldNotMapped', + 'xpack.securitySolution.case.configureCases.mappingFieldNotMapped', { defaultMessage: 'Not mapped', } ); -export const UPDATE_CONNECTOR = i18n.translate('xpack.siem.case.configureCases.updateConnector', { - defaultMessage: 'Update connector', -}); +export const UPDATE_CONNECTOR = i18n.translate( + 'xpack.securitySolution.case.configureCases.updateConnector', + { + defaultMessage: 'Update connector', + } +); export const UPDATE_SELECTED_CONNECTOR = (connectorName: string): string => { - return i18n.translate('xpack.siem.case.configureCases.updateSelectedConnector', { + return i18n.translate('xpack.securitySolution.case.configureCases.updateSelectedConnector', { values: { connectorName }, defaultMessage: 'Update { connectorName }', }); diff --git a/x-pack/plugins/siem/public/cases/components/configure_cases/utils.test.tsx b/x-pack/plugins/security_solution/public/cases/components/configure_cases/utils.test.tsx similarity index 100% rename from x-pack/plugins/siem/public/cases/components/configure_cases/utils.test.tsx rename to x-pack/plugins/security_solution/public/cases/components/configure_cases/utils.test.tsx diff --git a/x-pack/plugins/siem/public/cases/components/configure_cases/utils.ts b/x-pack/plugins/security_solution/public/cases/components/configure_cases/utils.ts similarity index 100% rename from x-pack/plugins/siem/public/cases/components/configure_cases/utils.ts rename to x-pack/plugins/security_solution/public/cases/components/configure_cases/utils.ts diff --git a/x-pack/plugins/siem/public/cases/components/confirm_delete_case/index.tsx b/x-pack/plugins/security_solution/public/cases/components/confirm_delete_case/index.tsx similarity index 100% rename from x-pack/plugins/siem/public/cases/components/confirm_delete_case/index.tsx rename to x-pack/plugins/security_solution/public/cases/components/confirm_delete_case/index.tsx diff --git a/x-pack/plugins/siem/public/cases/components/confirm_delete_case/translations.ts b/x-pack/plugins/security_solution/public/cases/components/confirm_delete_case/translations.ts similarity index 79% rename from x-pack/plugins/siem/public/cases/components/confirm_delete_case/translations.ts rename to x-pack/plugins/security_solution/public/cases/components/confirm_delete_case/translations.ts index a535286e7e8e5..ad51d13206809 100644 --- a/x-pack/plugins/siem/public/cases/components/confirm_delete_case/translations.ts +++ b/x-pack/plugins/security_solution/public/cases/components/confirm_delete_case/translations.ts @@ -8,27 +8,27 @@ import { i18n } from '@kbn/i18n'; export * from '../../translations'; export const DELETE_TITLE = (caseTitle: string) => - i18n.translate('xpack.siem.case.confirmDeleteCase.deleteTitle', { + i18n.translate('xpack.securitySolution.case.confirmDeleteCase.deleteTitle', { values: { caseTitle }, defaultMessage: 'Delete "{caseTitle}"', }); export const CONFIRM_QUESTION = i18n.translate( - 'xpack.siem.case.confirmDeleteCase.confirmQuestion', + 'xpack.securitySolution.case.confirmDeleteCase.confirmQuestion', { defaultMessage: 'By deleting this case, all related case data will be permanently removed and you will no longer be able to push data to an external incident management system. Are you sure you wish to proceed?', } ); export const DELETE_SELECTED_CASES = i18n.translate( - 'xpack.siem.case.confirmDeleteCase.selectedCases', + 'xpack.securitySolution.case.confirmDeleteCase.selectedCases', { defaultMessage: 'Delete selected cases', } ); export const CONFIRM_QUESTION_PLURAL = i18n.translate( - 'xpack.siem.case.confirmDeleteCase.confirmQuestionPlural', + 'xpack.securitySolution.case.confirmDeleteCase.confirmQuestionPlural', { defaultMessage: 'By deleting these cases, all related case data will be permanently removed and you will no longer be able to push data to an external incident management system. Are you sure you wish to proceed?', diff --git a/x-pack/plugins/siem/public/cases/components/connector_selector/form.tsx b/x-pack/plugins/security_solution/public/cases/components/connector_selector/form.tsx similarity index 100% rename from x-pack/plugins/siem/public/cases/components/connector_selector/form.tsx rename to x-pack/plugins/security_solution/public/cases/components/connector_selector/form.tsx diff --git a/x-pack/plugins/siem/public/cases/components/create/index.test.tsx b/x-pack/plugins/security_solution/public/cases/components/create/index.test.tsx similarity index 100% rename from x-pack/plugins/siem/public/cases/components/create/index.test.tsx rename to x-pack/plugins/security_solution/public/cases/components/create/index.test.tsx diff --git a/x-pack/plugins/siem/public/cases/components/create/index.tsx b/x-pack/plugins/security_solution/public/cases/components/create/index.tsx similarity index 100% rename from x-pack/plugins/siem/public/cases/components/create/index.tsx rename to x-pack/plugins/security_solution/public/cases/components/create/index.tsx diff --git a/x-pack/plugins/siem/public/cases/components/create/optional_field_label/index.tsx b/x-pack/plugins/security_solution/public/cases/components/create/optional_field_label/index.tsx similarity index 100% rename from x-pack/plugins/siem/public/cases/components/create/optional_field_label/index.tsx rename to x-pack/plugins/security_solution/public/cases/components/create/optional_field_label/index.tsx diff --git a/x-pack/plugins/siem/public/cases/components/create/schema.tsx b/x-pack/plugins/security_solution/public/cases/components/create/schema.tsx similarity index 100% rename from x-pack/plugins/siem/public/cases/components/create/schema.tsx rename to x-pack/plugins/security_solution/public/cases/components/create/schema.tsx diff --git a/x-pack/plugins/siem/public/cases/components/edit_connector/index.test.tsx b/x-pack/plugins/security_solution/public/cases/components/edit_connector/index.test.tsx similarity index 100% rename from x-pack/plugins/siem/public/cases/components/edit_connector/index.test.tsx rename to x-pack/plugins/security_solution/public/cases/components/edit_connector/index.test.tsx diff --git a/x-pack/plugins/siem/public/cases/components/edit_connector/index.tsx b/x-pack/plugins/security_solution/public/cases/components/edit_connector/index.tsx similarity index 100% rename from x-pack/plugins/siem/public/cases/components/edit_connector/index.tsx rename to x-pack/plugins/security_solution/public/cases/components/edit_connector/index.tsx diff --git a/x-pack/plugins/siem/public/cases/components/edit_connector/schema.tsx b/x-pack/plugins/security_solution/public/cases/components/edit_connector/schema.tsx similarity index 100% rename from x-pack/plugins/siem/public/cases/components/edit_connector/schema.tsx rename to x-pack/plugins/security_solution/public/cases/components/edit_connector/schema.tsx diff --git a/x-pack/plugins/siem/public/cases/components/filter_popover/index.tsx b/x-pack/plugins/security_solution/public/cases/components/filter_popover/index.tsx similarity index 100% rename from x-pack/plugins/siem/public/cases/components/filter_popover/index.tsx rename to x-pack/plugins/security_solution/public/cases/components/filter_popover/index.tsx diff --git a/x-pack/plugins/siem/public/cases/components/open_closed_stats/index.tsx b/x-pack/plugins/security_solution/public/cases/components/open_closed_stats/index.tsx similarity index 100% rename from x-pack/plugins/siem/public/cases/components/open_closed_stats/index.tsx rename to x-pack/plugins/security_solution/public/cases/components/open_closed_stats/index.tsx diff --git a/x-pack/plugins/siem/public/cases/components/property_actions/constants.ts b/x-pack/plugins/security_solution/public/cases/components/property_actions/constants.ts similarity index 100% rename from x-pack/plugins/siem/public/cases/components/property_actions/constants.ts rename to x-pack/plugins/security_solution/public/cases/components/property_actions/constants.ts diff --git a/x-pack/plugins/siem/public/cases/components/property_actions/index.tsx b/x-pack/plugins/security_solution/public/cases/components/property_actions/index.tsx similarity index 100% rename from x-pack/plugins/siem/public/cases/components/property_actions/index.tsx rename to x-pack/plugins/security_solution/public/cases/components/property_actions/index.tsx diff --git a/x-pack/plugins/security_solution/public/cases/components/property_actions/translations.ts b/x-pack/plugins/security_solution/public/cases/components/property_actions/translations.ts new file mode 100644 index 0000000000000..a00abcc7845b0 --- /dev/null +++ b/x-pack/plugins/security_solution/public/cases/components/property_actions/translations.ts @@ -0,0 +1,14 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + +import { i18n } from '@kbn/i18n'; + +export const ACTIONS_ARIA = i18n.translate( + 'xpack.securitySolution.case.caseView.editActionsLinkAria', + { + defaultMessage: 'click to see all actions', + } +); diff --git a/x-pack/plugins/siem/public/cases/components/tag_list/index.test.tsx b/x-pack/plugins/security_solution/public/cases/components/tag_list/index.test.tsx similarity index 100% rename from x-pack/plugins/siem/public/cases/components/tag_list/index.test.tsx rename to x-pack/plugins/security_solution/public/cases/components/tag_list/index.test.tsx diff --git a/x-pack/plugins/siem/public/cases/components/tag_list/index.tsx b/x-pack/plugins/security_solution/public/cases/components/tag_list/index.tsx similarity index 100% rename from x-pack/plugins/siem/public/cases/components/tag_list/index.tsx rename to x-pack/plugins/security_solution/public/cases/components/tag_list/index.tsx diff --git a/x-pack/plugins/siem/public/cases/components/tag_list/schema.tsx b/x-pack/plugins/security_solution/public/cases/components/tag_list/schema.tsx similarity index 100% rename from x-pack/plugins/siem/public/cases/components/tag_list/schema.tsx rename to x-pack/plugins/security_solution/public/cases/components/tag_list/schema.tsx diff --git a/x-pack/plugins/siem/public/cases/components/tag_list/translations.ts b/x-pack/plugins/security_solution/public/cases/components/tag_list/translations.ts similarity index 66% rename from x-pack/plugins/siem/public/cases/components/tag_list/translations.ts rename to x-pack/plugins/security_solution/public/cases/components/tag_list/translations.ts index f7f215248dad8..3aeb6391267f6 100644 --- a/x-pack/plugins/siem/public/cases/components/tag_list/translations.ts +++ b/x-pack/plugins/security_solution/public/cases/components/tag_list/translations.ts @@ -8,6 +8,9 @@ import { i18n } from '@kbn/i18n'; export * from '../../translations'; -export const EDIT_TAGS_ARIA = i18n.translate('xpack.siem.case.caseView.editTagsLinkAria', { - defaultMessage: 'click to edit tags', -}); +export const EDIT_TAGS_ARIA = i18n.translate( + 'xpack.securitySolution.case.caseView.editTagsLinkAria', + { + defaultMessage: 'click to edit tags', + } +); diff --git a/x-pack/plugins/siem/public/cases/components/use_push_to_service/helpers.tsx b/x-pack/plugins/security_solution/public/cases/components/use_push_to_service/helpers.tsx similarity index 91% rename from x-pack/plugins/siem/public/cases/components/use_push_to_service/helpers.tsx rename to x-pack/plugins/security_solution/public/cases/components/use_push_to_service/helpers.tsx index f0ded815fce43..919231d2f6034 100644 --- a/x-pack/plugins/siem/public/cases/components/use_push_to_service/helpers.tsx +++ b/x-pack/plugins/security_solution/public/cases/components/use_push_to_service/helpers.tsx @@ -16,7 +16,7 @@ export const getLicenseError = () => ({ description: ( @@ -33,7 +33,7 @@ export const getKibanaConfigError = () => ({ description: ( diff --git a/x-pack/plugins/siem/public/cases/components/use_push_to_service/index.test.tsx b/x-pack/plugins/security_solution/public/cases/components/use_push_to_service/index.test.tsx similarity index 100% rename from x-pack/plugins/siem/public/cases/components/use_push_to_service/index.test.tsx rename to x-pack/plugins/security_solution/public/cases/components/use_push_to_service/index.test.tsx diff --git a/x-pack/plugins/siem/public/cases/components/use_push_to_service/index.tsx b/x-pack/plugins/security_solution/public/cases/components/use_push_to_service/index.tsx similarity index 94% rename from x-pack/plugins/siem/public/cases/components/use_push_to_service/index.tsx rename to x-pack/plugins/security_solution/public/cases/components/use_push_to_service/index.tsx index 63b808eed3c92..2e9e3cce4306a 100644 --- a/x-pack/plugins/siem/public/cases/components/use_push_to_service/index.tsx +++ b/x-pack/plugins/security_solution/public/cases/components/use_push_to_service/index.tsx @@ -83,7 +83,7 @@ export const usePushToService = ({ description: ( @@ -103,7 +103,7 @@ export const usePushToService = ({ description: ( ), }, @@ -116,7 +116,7 @@ export const usePushToService = ({ description: ( ), errorType: 'danger', @@ -131,7 +131,7 @@ export const usePushToService = ({ description: ( ), }, diff --git a/x-pack/plugins/siem/public/cases/components/use_push_to_service/translations.ts b/x-pack/plugins/security_solution/public/cases/components/use_push_to_service/translations.ts similarity index 65% rename from x-pack/plugins/siem/public/cases/components/use_push_to_service/translations.ts rename to x-pack/plugins/security_solution/public/cases/components/use_push_to_service/translations.ts index 4b55aa83ef726..f4539b8019d43 100644 --- a/x-pack/plugins/siem/public/cases/components/use_push_to_service/translations.ts +++ b/x-pack/plugins/security_solution/public/cases/components/use_push_to_service/translations.ts @@ -7,19 +7,19 @@ import { i18n } from '@kbn/i18n'; export const ERROR_PUSH_SERVICE_CALLOUT_TITLE = i18n.translate( - 'xpack.siem.case.caseView.errorsPushServiceCallOutTitle', + 'xpack.securitySolution.case.caseView.errorsPushServiceCallOutTitle', { defaultMessage: 'To send cases to external systems, you need to:', } ); export const PUSH_THIRD = (thirdParty: string) => { if (thirdParty === 'none') { - return i18n.translate('xpack.siem.case.caseView.pushThirdPartyIncident', { + return i18n.translate('xpack.securitySolution.case.caseView.pushThirdPartyIncident', { defaultMessage: 'Push as external incident', }); } - return i18n.translate('xpack.siem.case.caseView.pushNamedIncident', { + return i18n.translate('xpack.securitySolution.case.caseView.pushNamedIncident', { values: { thirdParty }, defaultMessage: 'Push as { thirdParty } incident', }); @@ -27,61 +27,61 @@ export const PUSH_THIRD = (thirdParty: string) => { export const UPDATE_THIRD = (thirdParty: string) => { if (thirdParty === 'none') { - return i18n.translate('xpack.siem.case.caseView.updateThirdPartyIncident', { + return i18n.translate('xpack.securitySolution.case.caseView.updateThirdPartyIncident', { defaultMessage: 'Update external incident', }); } - return i18n.translate('xpack.siem.case.caseView.updateNamedIncident', { + return i18n.translate('xpack.securitySolution.case.caseView.updateNamedIncident', { values: { thirdParty }, defaultMessage: 'Update { thirdParty } incident', }); }; export const PUSH_DISABLE_BY_NO_CONFIG_TITLE = i18n.translate( - 'xpack.siem.case.caseView.pushToServiceDisableByNoConfigTitle', + 'xpack.securitySolution.case.caseView.pushToServiceDisableByNoConfigTitle', { defaultMessage: 'Configure external connector', } ); export const PUSH_DISABLE_BY_NO_CASE_CONFIG_TITLE = i18n.translate( - 'xpack.siem.case.caseView.pushToServiceDisableByNoCaseConfigTitle', + 'xpack.securitySolution.case.caseView.pushToServiceDisableByNoCaseConfigTitle', { defaultMessage: 'Select external connector', } ); export const PUSH_DISABLE_BECAUSE_CASE_CLOSED_TITLE = i18n.translate( - 'xpack.siem.case.caseView.pushToServiceDisableBecauseCaseClosedTitle', + 'xpack.securitySolution.case.caseView.pushToServiceDisableBecauseCaseClosedTitle', { defaultMessage: 'Reopen the case', } ); export const PUSH_DISABLE_BY_KIBANA_CONFIG_TITLE = i18n.translate( - 'xpack.siem.case.caseView.pushToServiceDisableByConfigTitle', + 'xpack.securitySolution.case.caseView.pushToServiceDisableByConfigTitle', { defaultMessage: 'Enable external service in Kibana configuration file', } ); export const PUSH_DISABLE_BY_LICENSE_TITLE = i18n.translate( - 'xpack.siem.case.caseView.pushToServiceDisableByLicenseTitle', + 'xpack.securitySolution.case.caseView.pushToServiceDisableByLicenseTitle', { defaultMessage: 'Upgrade to Elastic Platinum', } ); export const LINK_CLOUD_DEPLOYMENT = i18n.translate( - 'xpack.siem.case.caseView.cloudDeploymentLink', + 'xpack.securitySolution.case.caseView.cloudDeploymentLink', { defaultMessage: 'cloud deployment', } ); export const LINK_CONNECTOR_CONFIGURE = i18n.translate( - 'xpack.siem.case.caseView.connectorConfigureLink', + 'xpack.securitySolution.case.caseView.connectorConfigureLink', { defaultMessage: 'connector', } diff --git a/x-pack/plugins/siem/public/cases/components/user_action_tree/helpers.test.tsx b/x-pack/plugins/security_solution/public/cases/components/user_action_tree/helpers.test.tsx similarity index 100% rename from x-pack/plugins/siem/public/cases/components/user_action_tree/helpers.test.tsx rename to x-pack/plugins/security_solution/public/cases/components/user_action_tree/helpers.test.tsx diff --git a/x-pack/plugins/siem/public/cases/components/user_action_tree/helpers.tsx b/x-pack/plugins/security_solution/public/cases/components/user_action_tree/helpers.tsx similarity index 100% rename from x-pack/plugins/siem/public/cases/components/user_action_tree/helpers.tsx rename to x-pack/plugins/security_solution/public/cases/components/user_action_tree/helpers.tsx diff --git a/x-pack/plugins/siem/public/cases/components/user_action_tree/index.test.tsx b/x-pack/plugins/security_solution/public/cases/components/user_action_tree/index.test.tsx similarity index 100% rename from x-pack/plugins/siem/public/cases/components/user_action_tree/index.test.tsx rename to x-pack/plugins/security_solution/public/cases/components/user_action_tree/index.test.tsx diff --git a/x-pack/plugins/siem/public/cases/components/user_action_tree/index.tsx b/x-pack/plugins/security_solution/public/cases/components/user_action_tree/index.tsx similarity index 100% rename from x-pack/plugins/siem/public/cases/components/user_action_tree/index.tsx rename to x-pack/plugins/security_solution/public/cases/components/user_action_tree/index.tsx diff --git a/x-pack/plugins/siem/public/cases/components/user_action_tree/schema.ts b/x-pack/plugins/security_solution/public/cases/components/user_action_tree/schema.ts similarity index 100% rename from x-pack/plugins/siem/public/cases/components/user_action_tree/schema.ts rename to x-pack/plugins/security_solution/public/cases/components/user_action_tree/schema.ts diff --git a/x-pack/plugins/siem/public/cases/components/user_action_tree/translations.ts b/x-pack/plugins/security_solution/public/cases/components/user_action_tree/translations.ts similarity index 66% rename from x-pack/plugins/siem/public/cases/components/user_action_tree/translations.ts rename to x-pack/plugins/security_solution/public/cases/components/user_action_tree/translations.ts index e655329562d41..73c94477b4e73 100644 --- a/x-pack/plugins/siem/public/cases/components/user_action_tree/translations.ts +++ b/x-pack/plugins/security_solution/public/cases/components/user_action_tree/translations.ts @@ -9,23 +9,26 @@ import { i18n } from '@kbn/i18n'; export * from '../case_view/translations'; export const ALREADY_PUSHED_TO_SERVICE = (externalService: string) => - i18n.translate('xpack.siem.case.caseView.alreadyPushedToExternalService', { + i18n.translate('xpack.securitySolution.case.caseView.alreadyPushedToExternalService', { values: { externalService }, defaultMessage: 'Already pushed to { externalService } incident', }); export const REQUIRED_UPDATE_TO_SERVICE = (externalService: string) => - i18n.translate('xpack.siem.case.caseView.requiredUpdateToExternalService', { + i18n.translate('xpack.securitySolution.case.caseView.requiredUpdateToExternalService', { values: { externalService }, defaultMessage: 'Requires update to { externalService } incident', }); -export const COPY_REFERENCE_LINK = i18n.translate('xpack.siem.case.caseView.copyCommentLinkAria', { - defaultMessage: 'Copy reference link', -}); +export const COPY_REFERENCE_LINK = i18n.translate( + 'xpack.securitySolution.case.caseView.copyCommentLinkAria', + { + defaultMessage: 'Copy reference link', + } +); export const MOVE_TO_ORIGINAL_COMMENT = i18n.translate( - 'xpack.siem.case.caseView.moveToCommentAria', + 'xpack.securitySolution.case.caseView.moveToCommentAria', { defaultMessage: 'Highlight the referenced comment', } diff --git a/x-pack/plugins/siem/public/cases/components/user_action_tree/user_action_avatar.tsx b/x-pack/plugins/security_solution/public/cases/components/user_action_tree/user_action_avatar.tsx similarity index 100% rename from x-pack/plugins/siem/public/cases/components/user_action_tree/user_action_avatar.tsx rename to x-pack/plugins/security_solution/public/cases/components/user_action_tree/user_action_avatar.tsx diff --git a/x-pack/plugins/siem/public/cases/components/user_action_tree/user_action_item.tsx b/x-pack/plugins/security_solution/public/cases/components/user_action_tree/user_action_item.tsx similarity index 100% rename from x-pack/plugins/siem/public/cases/components/user_action_tree/user_action_item.tsx rename to x-pack/plugins/security_solution/public/cases/components/user_action_tree/user_action_item.tsx diff --git a/x-pack/plugins/siem/public/cases/components/user_action_tree/user_action_markdown.test.tsx b/x-pack/plugins/security_solution/public/cases/components/user_action_tree/user_action_markdown.test.tsx similarity index 100% rename from x-pack/plugins/siem/public/cases/components/user_action_tree/user_action_markdown.test.tsx rename to x-pack/plugins/security_solution/public/cases/components/user_action_tree/user_action_markdown.test.tsx diff --git a/x-pack/plugins/siem/public/cases/components/user_action_tree/user_action_markdown.tsx b/x-pack/plugins/security_solution/public/cases/components/user_action_tree/user_action_markdown.tsx similarity index 100% rename from x-pack/plugins/siem/public/cases/components/user_action_tree/user_action_markdown.tsx rename to x-pack/plugins/security_solution/public/cases/components/user_action_tree/user_action_markdown.tsx diff --git a/x-pack/plugins/siem/public/cases/components/user_action_tree/user_action_title.test.tsx b/x-pack/plugins/security_solution/public/cases/components/user_action_tree/user_action_title.test.tsx similarity index 100% rename from x-pack/plugins/siem/public/cases/components/user_action_tree/user_action_title.test.tsx rename to x-pack/plugins/security_solution/public/cases/components/user_action_tree/user_action_title.test.tsx diff --git a/x-pack/plugins/siem/public/cases/components/user_action_tree/user_action_title.tsx b/x-pack/plugins/security_solution/public/cases/components/user_action_tree/user_action_title.tsx similarity index 100% rename from x-pack/plugins/siem/public/cases/components/user_action_tree/user_action_title.tsx rename to x-pack/plugins/security_solution/public/cases/components/user_action_tree/user_action_title.tsx diff --git a/x-pack/plugins/siem/public/cases/components/user_list/index.test.tsx b/x-pack/plugins/security_solution/public/cases/components/user_list/index.test.tsx similarity index 100% rename from x-pack/plugins/siem/public/cases/components/user_list/index.test.tsx rename to x-pack/plugins/security_solution/public/cases/components/user_list/index.test.tsx diff --git a/x-pack/plugins/siem/public/cases/components/user_list/index.tsx b/x-pack/plugins/security_solution/public/cases/components/user_list/index.tsx similarity index 100% rename from x-pack/plugins/siem/public/cases/components/user_list/index.tsx rename to x-pack/plugins/security_solution/public/cases/components/user_list/index.tsx diff --git a/x-pack/plugins/siem/public/cases/components/user_list/translations.ts b/x-pack/plugins/security_solution/public/cases/components/user_list/translations.ts similarity index 84% rename from x-pack/plugins/siem/public/cases/components/user_list/translations.ts rename to x-pack/plugins/security_solution/public/cases/components/user_list/translations.ts index 4d50d11f39101..3439d58eb41f0 100644 --- a/x-pack/plugins/siem/public/cases/components/user_list/translations.ts +++ b/x-pack/plugins/security_solution/public/cases/components/user_list/translations.ts @@ -7,7 +7,7 @@ import { i18n } from '@kbn/i18n'; export const SEND_EMAIL_ARIA = (user: string) => - i18n.translate('xpack.siem.case.caseView.sendEmalLinkAria', { + i18n.translate('xpack.securitySolution.case.caseView.sendEmalLinkAria', { values: { user }, defaultMessage: 'click to send an email to {user}', }); diff --git a/x-pack/plugins/siem/public/cases/components/wrappers/index.tsx b/x-pack/plugins/security_solution/public/cases/components/wrappers/index.tsx similarity index 100% rename from x-pack/plugins/siem/public/cases/components/wrappers/index.tsx rename to x-pack/plugins/security_solution/public/cases/components/wrappers/index.tsx diff --git a/x-pack/plugins/siem/public/cases/containers/__mocks__/api.ts b/x-pack/plugins/security_solution/public/cases/containers/__mocks__/api.ts similarity index 100% rename from x-pack/plugins/siem/public/cases/containers/__mocks__/api.ts rename to x-pack/plugins/security_solution/public/cases/containers/__mocks__/api.ts diff --git a/x-pack/plugins/siem/public/cases/containers/api.test.tsx b/x-pack/plugins/security_solution/public/cases/containers/api.test.tsx similarity index 100% rename from x-pack/plugins/siem/public/cases/containers/api.test.tsx rename to x-pack/plugins/security_solution/public/cases/containers/api.test.tsx diff --git a/x-pack/plugins/siem/public/cases/containers/api.ts b/x-pack/plugins/security_solution/public/cases/containers/api.ts similarity index 100% rename from x-pack/plugins/siem/public/cases/containers/api.ts rename to x-pack/plugins/security_solution/public/cases/containers/api.ts diff --git a/x-pack/plugins/siem/public/cases/containers/configure/__mocks__/api.ts b/x-pack/plugins/security_solution/public/cases/containers/configure/__mocks__/api.ts similarity index 100% rename from x-pack/plugins/siem/public/cases/containers/configure/__mocks__/api.ts rename to x-pack/plugins/security_solution/public/cases/containers/configure/__mocks__/api.ts diff --git a/x-pack/plugins/siem/public/cases/containers/configure/api.test.ts b/x-pack/plugins/security_solution/public/cases/containers/configure/api.test.ts similarity index 100% rename from x-pack/plugins/siem/public/cases/containers/configure/api.test.ts rename to x-pack/plugins/security_solution/public/cases/containers/configure/api.test.ts diff --git a/x-pack/plugins/siem/public/cases/containers/configure/api.ts b/x-pack/plugins/security_solution/public/cases/containers/configure/api.ts similarity index 100% rename from x-pack/plugins/siem/public/cases/containers/configure/api.ts rename to x-pack/plugins/security_solution/public/cases/containers/configure/api.ts diff --git a/x-pack/plugins/siem/public/cases/containers/configure/mock.ts b/x-pack/plugins/security_solution/public/cases/containers/configure/mock.ts similarity index 100% rename from x-pack/plugins/siem/public/cases/containers/configure/mock.ts rename to x-pack/plugins/security_solution/public/cases/containers/configure/mock.ts diff --git a/x-pack/plugins/siem/public/cases/containers/configure/translations.ts b/x-pack/plugins/security_solution/public/cases/containers/configure/translations.ts similarity index 63% rename from x-pack/plugins/siem/public/cases/containers/configure/translations.ts rename to x-pack/plugins/security_solution/public/cases/containers/configure/translations.ts index dbd618f40155d..ee21167021e19 100644 --- a/x-pack/plugins/siem/public/cases/containers/configure/translations.ts +++ b/x-pack/plugins/security_solution/public/cases/containers/configure/translations.ts @@ -8,6 +8,9 @@ import { i18n } from '@kbn/i18n'; export * from '../translations'; -export const SUCCESS_CONFIGURE = i18n.translate('xpack.siem.case.configure.successSaveToast', { - defaultMessage: 'Saved external connection settings', -}); +export const SUCCESS_CONFIGURE = i18n.translate( + 'xpack.securitySolution.case.configure.successSaveToast', + { + defaultMessage: 'Saved external connection settings', + } +); diff --git a/x-pack/plugins/siem/public/cases/containers/configure/types.ts b/x-pack/plugins/security_solution/public/cases/containers/configure/types.ts similarity index 100% rename from x-pack/plugins/siem/public/cases/containers/configure/types.ts rename to x-pack/plugins/security_solution/public/cases/containers/configure/types.ts diff --git a/x-pack/plugins/siem/public/cases/containers/configure/use_configure.test.tsx b/x-pack/plugins/security_solution/public/cases/containers/configure/use_configure.test.tsx similarity index 100% rename from x-pack/plugins/siem/public/cases/containers/configure/use_configure.test.tsx rename to x-pack/plugins/security_solution/public/cases/containers/configure/use_configure.test.tsx diff --git a/x-pack/plugins/siem/public/cases/containers/configure/use_configure.tsx b/x-pack/plugins/security_solution/public/cases/containers/configure/use_configure.tsx similarity index 100% rename from x-pack/plugins/siem/public/cases/containers/configure/use_configure.tsx rename to x-pack/plugins/security_solution/public/cases/containers/configure/use_configure.tsx diff --git a/x-pack/plugins/siem/public/cases/containers/configure/use_connectors.test.tsx b/x-pack/plugins/security_solution/public/cases/containers/configure/use_connectors.test.tsx similarity index 100% rename from x-pack/plugins/siem/public/cases/containers/configure/use_connectors.test.tsx rename to x-pack/plugins/security_solution/public/cases/containers/configure/use_connectors.test.tsx diff --git a/x-pack/plugins/siem/public/cases/containers/configure/use_connectors.tsx b/x-pack/plugins/security_solution/public/cases/containers/configure/use_connectors.tsx similarity index 100% rename from x-pack/plugins/siem/public/cases/containers/configure/use_connectors.tsx rename to x-pack/plugins/security_solution/public/cases/containers/configure/use_connectors.tsx diff --git a/x-pack/plugins/siem/public/cases/containers/constants.ts b/x-pack/plugins/security_solution/public/cases/containers/constants.ts similarity index 100% rename from x-pack/plugins/siem/public/cases/containers/constants.ts rename to x-pack/plugins/security_solution/public/cases/containers/constants.ts diff --git a/x-pack/plugins/siem/public/cases/containers/mock.ts b/x-pack/plugins/security_solution/public/cases/containers/mock.ts similarity index 100% rename from x-pack/plugins/siem/public/cases/containers/mock.ts rename to x-pack/plugins/security_solution/public/cases/containers/mock.ts diff --git a/x-pack/plugins/siem/public/cases/containers/translations.ts b/x-pack/plugins/security_solution/public/cases/containers/translations.ts similarity index 67% rename from x-pack/plugins/siem/public/cases/containers/translations.ts rename to x-pack/plugins/security_solution/public/cases/containers/translations.ts index 79edcc56b0362..96d2ec2f874db 100644 --- a/x-pack/plugins/siem/public/cases/containers/translations.ts +++ b/x-pack/plugins/security_solution/public/cases/containers/translations.ts @@ -6,22 +6,25 @@ import { i18n } from '@kbn/i18n'; -export const ERROR_TITLE = i18n.translate('xpack.siem.containers.case.errorTitle', { +export const ERROR_TITLE = i18n.translate('xpack.securitySolution.containers.case.errorTitle', { defaultMessage: 'Error fetching data', }); -export const ERROR_DELETING = i18n.translate('xpack.siem.containers.case.errorDeletingTitle', { - defaultMessage: 'Error deleting data', -}); +export const ERROR_DELETING = i18n.translate( + 'xpack.securitySolution.containers.case.errorDeletingTitle', + { + defaultMessage: 'Error deleting data', + } +); export const UPDATED_CASE = (caseTitle: string) => - i18n.translate('xpack.siem.containers.case.updatedCase', { + i18n.translate('xpack.securitySolution.containers.case.updatedCase', { values: { caseTitle }, defaultMessage: 'Updated "{caseTitle}"', }); export const DELETED_CASES = (totalCases: number, caseTitle?: string) => - i18n.translate('xpack.siem.containers.case.deletedCases', { + i18n.translate('xpack.securitySolution.containers.case.deletedCases', { values: { caseTitle, totalCases }, defaultMessage: 'Deleted {totalCases, plural, =1 {"{caseTitle}"} other {{totalCases} cases}}', }); @@ -33,7 +36,7 @@ export const CLOSED_CASES = ({ totalCases: number; caseTitle?: string; }) => - i18n.translate('xpack.siem.containers.case.closedCases', { + i18n.translate('xpack.securitySolution.containers.case.closedCases', { values: { caseTitle, totalCases }, defaultMessage: 'Closed {totalCases, plural, =1 {"{caseTitle}"} other {{totalCases} cases}}', }); @@ -45,19 +48,19 @@ export const REOPENED_CASES = ({ totalCases: number; caseTitle?: string; }) => - i18n.translate('xpack.siem.containers.case.reopenedCases', { + i18n.translate('xpack.securitySolution.containers.case.reopenedCases', { values: { caseTitle, totalCases }, defaultMessage: 'Reopened {totalCases, plural, =1 {"{caseTitle}"} other {{totalCases} cases}}', }); export const SUCCESS_SEND_TO_EXTERNAL_SERVICE = (serviceName: string) => - i18n.translate('xpack.siem.containers.case.pushToExternalService', { + i18n.translate('xpack.securitySolution.containers.case.pushToExternalService', { values: { serviceName }, defaultMessage: 'Successfully sent to { serviceName }', }); export const ERROR_PUSH_TO_SERVICE = i18n.translate( - 'xpack.siem.case.configure.errorPushingToService', + 'xpack.securitySolution.case.configure.errorPushingToService', { defaultMessage: 'Error pushing to service', } diff --git a/x-pack/plugins/siem/public/cases/containers/types.ts b/x-pack/plugins/security_solution/public/cases/containers/types.ts similarity index 100% rename from x-pack/plugins/siem/public/cases/containers/types.ts rename to x-pack/plugins/security_solution/public/cases/containers/types.ts diff --git a/x-pack/plugins/siem/public/cases/containers/use_bulk_update_case.test.tsx b/x-pack/plugins/security_solution/public/cases/containers/use_bulk_update_case.test.tsx similarity index 100% rename from x-pack/plugins/siem/public/cases/containers/use_bulk_update_case.test.tsx rename to x-pack/plugins/security_solution/public/cases/containers/use_bulk_update_case.test.tsx diff --git a/x-pack/plugins/siem/public/cases/containers/use_bulk_update_case.tsx b/x-pack/plugins/security_solution/public/cases/containers/use_bulk_update_case.tsx similarity index 100% rename from x-pack/plugins/siem/public/cases/containers/use_bulk_update_case.tsx rename to x-pack/plugins/security_solution/public/cases/containers/use_bulk_update_case.tsx diff --git a/x-pack/plugins/siem/public/cases/containers/use_delete_cases.test.tsx b/x-pack/plugins/security_solution/public/cases/containers/use_delete_cases.test.tsx similarity index 100% rename from x-pack/plugins/siem/public/cases/containers/use_delete_cases.test.tsx rename to x-pack/plugins/security_solution/public/cases/containers/use_delete_cases.test.tsx diff --git a/x-pack/plugins/siem/public/cases/containers/use_delete_cases.tsx b/x-pack/plugins/security_solution/public/cases/containers/use_delete_cases.tsx similarity index 100% rename from x-pack/plugins/siem/public/cases/containers/use_delete_cases.tsx rename to x-pack/plugins/security_solution/public/cases/containers/use_delete_cases.tsx diff --git a/x-pack/plugins/siem/public/cases/containers/use_get_action_license.test.tsx b/x-pack/plugins/security_solution/public/cases/containers/use_get_action_license.test.tsx similarity index 100% rename from x-pack/plugins/siem/public/cases/containers/use_get_action_license.test.tsx rename to x-pack/plugins/security_solution/public/cases/containers/use_get_action_license.test.tsx diff --git a/x-pack/plugins/siem/public/cases/containers/use_get_action_license.tsx b/x-pack/plugins/security_solution/public/cases/containers/use_get_action_license.tsx similarity index 100% rename from x-pack/plugins/siem/public/cases/containers/use_get_action_license.tsx rename to x-pack/plugins/security_solution/public/cases/containers/use_get_action_license.tsx diff --git a/x-pack/plugins/siem/public/cases/containers/use_get_case.test.tsx b/x-pack/plugins/security_solution/public/cases/containers/use_get_case.test.tsx similarity index 100% rename from x-pack/plugins/siem/public/cases/containers/use_get_case.test.tsx rename to x-pack/plugins/security_solution/public/cases/containers/use_get_case.test.tsx diff --git a/x-pack/plugins/siem/public/cases/containers/use_get_case.tsx b/x-pack/plugins/security_solution/public/cases/containers/use_get_case.tsx similarity index 100% rename from x-pack/plugins/siem/public/cases/containers/use_get_case.tsx rename to x-pack/plugins/security_solution/public/cases/containers/use_get_case.tsx diff --git a/x-pack/plugins/siem/public/cases/containers/use_get_case_user_actions.test.tsx b/x-pack/plugins/security_solution/public/cases/containers/use_get_case_user_actions.test.tsx similarity index 100% rename from x-pack/plugins/siem/public/cases/containers/use_get_case_user_actions.test.tsx rename to x-pack/plugins/security_solution/public/cases/containers/use_get_case_user_actions.test.tsx diff --git a/x-pack/plugins/siem/public/cases/containers/use_get_case_user_actions.tsx b/x-pack/plugins/security_solution/public/cases/containers/use_get_case_user_actions.tsx similarity index 100% rename from x-pack/plugins/siem/public/cases/containers/use_get_case_user_actions.tsx rename to x-pack/plugins/security_solution/public/cases/containers/use_get_case_user_actions.tsx diff --git a/x-pack/plugins/siem/public/cases/containers/use_get_cases.test.tsx b/x-pack/plugins/security_solution/public/cases/containers/use_get_cases.test.tsx similarity index 100% rename from x-pack/plugins/siem/public/cases/containers/use_get_cases.test.tsx rename to x-pack/plugins/security_solution/public/cases/containers/use_get_cases.test.tsx diff --git a/x-pack/plugins/siem/public/cases/containers/use_get_cases.tsx b/x-pack/plugins/security_solution/public/cases/containers/use_get_cases.tsx similarity index 100% rename from x-pack/plugins/siem/public/cases/containers/use_get_cases.tsx rename to x-pack/plugins/security_solution/public/cases/containers/use_get_cases.tsx diff --git a/x-pack/plugins/siem/public/cases/containers/use_get_cases_status.test.tsx b/x-pack/plugins/security_solution/public/cases/containers/use_get_cases_status.test.tsx similarity index 100% rename from x-pack/plugins/siem/public/cases/containers/use_get_cases_status.test.tsx rename to x-pack/plugins/security_solution/public/cases/containers/use_get_cases_status.test.tsx diff --git a/x-pack/plugins/siem/public/cases/containers/use_get_cases_status.tsx b/x-pack/plugins/security_solution/public/cases/containers/use_get_cases_status.tsx similarity index 100% rename from x-pack/plugins/siem/public/cases/containers/use_get_cases_status.tsx rename to x-pack/plugins/security_solution/public/cases/containers/use_get_cases_status.tsx diff --git a/x-pack/plugins/siem/public/cases/containers/use_get_reporters.test.tsx b/x-pack/plugins/security_solution/public/cases/containers/use_get_reporters.test.tsx similarity index 100% rename from x-pack/plugins/siem/public/cases/containers/use_get_reporters.test.tsx rename to x-pack/plugins/security_solution/public/cases/containers/use_get_reporters.test.tsx diff --git a/x-pack/plugins/siem/public/cases/containers/use_get_reporters.tsx b/x-pack/plugins/security_solution/public/cases/containers/use_get_reporters.tsx similarity index 100% rename from x-pack/plugins/siem/public/cases/containers/use_get_reporters.tsx rename to x-pack/plugins/security_solution/public/cases/containers/use_get_reporters.tsx diff --git a/x-pack/plugins/siem/public/cases/containers/use_get_tags.test.tsx b/x-pack/plugins/security_solution/public/cases/containers/use_get_tags.test.tsx similarity index 100% rename from x-pack/plugins/siem/public/cases/containers/use_get_tags.test.tsx rename to x-pack/plugins/security_solution/public/cases/containers/use_get_tags.test.tsx diff --git a/x-pack/plugins/siem/public/cases/containers/use_get_tags.tsx b/x-pack/plugins/security_solution/public/cases/containers/use_get_tags.tsx similarity index 100% rename from x-pack/plugins/siem/public/cases/containers/use_get_tags.tsx rename to x-pack/plugins/security_solution/public/cases/containers/use_get_tags.tsx diff --git a/x-pack/plugins/siem/public/cases/containers/use_post_case.test.tsx b/x-pack/plugins/security_solution/public/cases/containers/use_post_case.test.tsx similarity index 100% rename from x-pack/plugins/siem/public/cases/containers/use_post_case.test.tsx rename to x-pack/plugins/security_solution/public/cases/containers/use_post_case.test.tsx diff --git a/x-pack/plugins/siem/public/cases/containers/use_post_case.tsx b/x-pack/plugins/security_solution/public/cases/containers/use_post_case.tsx similarity index 100% rename from x-pack/plugins/siem/public/cases/containers/use_post_case.tsx rename to x-pack/plugins/security_solution/public/cases/containers/use_post_case.tsx diff --git a/x-pack/plugins/siem/public/cases/containers/use_post_comment.test.tsx b/x-pack/plugins/security_solution/public/cases/containers/use_post_comment.test.tsx similarity index 100% rename from x-pack/plugins/siem/public/cases/containers/use_post_comment.test.tsx rename to x-pack/plugins/security_solution/public/cases/containers/use_post_comment.test.tsx diff --git a/x-pack/plugins/siem/public/cases/containers/use_post_comment.tsx b/x-pack/plugins/security_solution/public/cases/containers/use_post_comment.tsx similarity index 100% rename from x-pack/plugins/siem/public/cases/containers/use_post_comment.tsx rename to x-pack/plugins/security_solution/public/cases/containers/use_post_comment.tsx diff --git a/x-pack/plugins/siem/public/cases/containers/use_post_push_to_service.test.tsx b/x-pack/plugins/security_solution/public/cases/containers/use_post_push_to_service.test.tsx similarity index 100% rename from x-pack/plugins/siem/public/cases/containers/use_post_push_to_service.test.tsx rename to x-pack/plugins/security_solution/public/cases/containers/use_post_push_to_service.test.tsx diff --git a/x-pack/plugins/siem/public/cases/containers/use_post_push_to_service.tsx b/x-pack/plugins/security_solution/public/cases/containers/use_post_push_to_service.tsx similarity index 100% rename from x-pack/plugins/siem/public/cases/containers/use_post_push_to_service.tsx rename to x-pack/plugins/security_solution/public/cases/containers/use_post_push_to_service.tsx diff --git a/x-pack/plugins/siem/public/cases/containers/use_update_case.test.tsx b/x-pack/plugins/security_solution/public/cases/containers/use_update_case.test.tsx similarity index 100% rename from x-pack/plugins/siem/public/cases/containers/use_update_case.test.tsx rename to x-pack/plugins/security_solution/public/cases/containers/use_update_case.test.tsx diff --git a/x-pack/plugins/siem/public/cases/containers/use_update_case.tsx b/x-pack/plugins/security_solution/public/cases/containers/use_update_case.tsx similarity index 100% rename from x-pack/plugins/siem/public/cases/containers/use_update_case.tsx rename to x-pack/plugins/security_solution/public/cases/containers/use_update_case.tsx diff --git a/x-pack/plugins/siem/public/cases/containers/use_update_comment.test.tsx b/x-pack/plugins/security_solution/public/cases/containers/use_update_comment.test.tsx similarity index 100% rename from x-pack/plugins/siem/public/cases/containers/use_update_comment.test.tsx rename to x-pack/plugins/security_solution/public/cases/containers/use_update_comment.test.tsx diff --git a/x-pack/plugins/siem/public/cases/containers/use_update_comment.tsx b/x-pack/plugins/security_solution/public/cases/containers/use_update_comment.tsx similarity index 100% rename from x-pack/plugins/siem/public/cases/containers/use_update_comment.tsx rename to x-pack/plugins/security_solution/public/cases/containers/use_update_comment.tsx diff --git a/x-pack/plugins/siem/public/cases/containers/utils.ts b/x-pack/plugins/security_solution/public/cases/containers/utils.ts similarity index 100% rename from x-pack/plugins/siem/public/cases/containers/utils.ts rename to x-pack/plugins/security_solution/public/cases/containers/utils.ts diff --git a/x-pack/plugins/siem/public/cases/index.ts b/x-pack/plugins/security_solution/public/cases/index.ts similarity index 100% rename from x-pack/plugins/siem/public/cases/index.ts rename to x-pack/plugins/security_solution/public/cases/index.ts diff --git a/x-pack/plugins/siem/public/cases/pages/case.tsx b/x-pack/plugins/security_solution/public/cases/pages/case.tsx similarity index 100% rename from x-pack/plugins/siem/public/cases/pages/case.tsx rename to x-pack/plugins/security_solution/public/cases/pages/case.tsx diff --git a/x-pack/plugins/siem/public/cases/pages/case_details.tsx b/x-pack/plugins/security_solution/public/cases/pages/case_details.tsx similarity index 100% rename from x-pack/plugins/siem/public/cases/pages/case_details.tsx rename to x-pack/plugins/security_solution/public/cases/pages/case_details.tsx diff --git a/x-pack/plugins/siem/public/cases/pages/configure_cases.tsx b/x-pack/plugins/security_solution/public/cases/pages/configure_cases.tsx similarity index 100% rename from x-pack/plugins/siem/public/cases/pages/configure_cases.tsx rename to x-pack/plugins/security_solution/public/cases/pages/configure_cases.tsx diff --git a/x-pack/plugins/siem/public/cases/pages/create_case.tsx b/x-pack/plugins/security_solution/public/cases/pages/create_case.tsx similarity index 100% rename from x-pack/plugins/siem/public/cases/pages/create_case.tsx rename to x-pack/plugins/security_solution/public/cases/pages/create_case.tsx diff --git a/x-pack/plugins/siem/public/cases/pages/index.tsx b/x-pack/plugins/security_solution/public/cases/pages/index.tsx similarity index 100% rename from x-pack/plugins/siem/public/cases/pages/index.tsx rename to x-pack/plugins/security_solution/public/cases/pages/index.tsx diff --git a/x-pack/plugins/siem/public/cases/pages/saved_object_no_permissions.tsx b/x-pack/plugins/security_solution/public/cases/pages/saved_object_no_permissions.tsx similarity index 100% rename from x-pack/plugins/siem/public/cases/pages/saved_object_no_permissions.tsx rename to x-pack/plugins/security_solution/public/cases/pages/saved_object_no_permissions.tsx diff --git a/x-pack/plugins/security_solution/public/cases/pages/translations.ts b/x-pack/plugins/security_solution/public/cases/pages/translations.ts new file mode 100644 index 0000000000000..5b595c5892ef2 --- /dev/null +++ b/x-pack/plugins/security_solution/public/cases/pages/translations.ts @@ -0,0 +1,232 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + +import { i18n } from '@kbn/i18n'; + +export const SAVED_OBJECT_NO_PERMISSIONS_TITLE = i18n.translate( + 'xpack.securitySolution.case.caseSavedObjectNoPermissionsTitle', + { + defaultMessage: 'Kibana feature privileges required', + } +); + +export const SAVED_OBJECT_NO_PERMISSIONS_MSG = i18n.translate( + 'xpack.securitySolution.case.caseSavedObjectNoPermissionsMessage', + { + defaultMessage: + 'To view cases, you must have privileges for the Saved Object Management feature in the Kibana space. For more information, contact your Kibana administrator.', + } +); + +export const BACK_TO_ALL = i18n.translate('xpack.securitySolution.case.caseView.backLabel', { + defaultMessage: 'Back to cases', +}); + +export const CANCEL = i18n.translate('xpack.securitySolution.case.caseView.cancel', { + defaultMessage: 'Cancel', +}); + +export const DELETE_CASE = i18n.translate( + 'xpack.securitySolution.case.confirmDeleteCase.deleteCase', + { + defaultMessage: 'Delete case', + } +); + +export const DELETE_CASES = i18n.translate( + 'xpack.securitySolution.case.confirmDeleteCase.deleteCases', + { + defaultMessage: 'Delete cases', + } +); + +export const NAME = i18n.translate('xpack.securitySolution.case.caseView.name', { + defaultMessage: 'Name', +}); + +export const OPENED_ON = i18n.translate('xpack.securitySolution.case.caseView.openedOn', { + defaultMessage: 'Opened on', +}); + +export const CLOSED_ON = i18n.translate('xpack.securitySolution.case.caseView.closedOn', { + defaultMessage: 'Closed on', +}); + +export const REPORTER = i18n.translate('xpack.securitySolution.case.caseView.reporterLabel', { + defaultMessage: 'Reporter', +}); + +export const PARTICIPANTS = i18n.translate( + 'xpack.securitySolution.case.caseView.particpantsLabel', + { + defaultMessage: 'Participants', + } +); + +export const CREATE_BC_TITLE = i18n.translate('xpack.securitySolution.case.caseView.breadcrumb', { + defaultMessage: 'Create', +}); + +export const CREATE_TITLE = i18n.translate('xpack.securitySolution.case.caseView.create', { + defaultMessage: 'Create new case', +}); + +export const DESCRIPTION = i18n.translate('xpack.securitySolution.case.caseView.description', { + defaultMessage: 'Description', +}); + +export const DESCRIPTION_REQUIRED = i18n.translate( + 'xpack.securitySolution.case.createCase.descriptionFieldRequiredError', + { + defaultMessage: 'A description is required.', + } +); + +export const COMMENT_REQUIRED = i18n.translate( + 'xpack.securitySolution.case.caseView.commentFieldRequiredError', + { + defaultMessage: 'A comment is required.', + } +); + +export const REQUIRED_FIELD = i18n.translate( + 'xpack.securitySolution.case.caseView.fieldRequiredError', + { + defaultMessage: 'Required field', + } +); + +export const EDIT = i18n.translate('xpack.securitySolution.case.caseView.edit', { + defaultMessage: 'Edit', +}); + +export const OPTIONAL = i18n.translate('xpack.securitySolution.case.caseView.optional', { + defaultMessage: 'Optional', +}); + +export const PAGE_TITLE = i18n.translate('xpack.securitySolution.case.pageTitle', { + defaultMessage: 'Cases', +}); + +export const CREATE_CASE = i18n.translate('xpack.securitySolution.case.caseView.createCase', { + defaultMessage: 'Create case', +}); + +export const CLOSED_CASE = i18n.translate('xpack.securitySolution.case.caseView.closedCase', { + defaultMessage: 'Closed case', +}); + +export const CLOSE_CASE = i18n.translate('xpack.securitySolution.case.caseView.closeCase', { + defaultMessage: 'Close case', +}); + +export const REOPEN_CASE = i18n.translate('xpack.securitySolution.case.caseView.reopenCase', { + defaultMessage: 'Reopen case', +}); + +export const REOPENED_CASE = i18n.translate('xpack.securitySolution.case.caseView.reopenedCase', { + defaultMessage: 'Reopened case', +}); + +export const CASE_NAME = i18n.translate('xpack.securitySolution.case.caseView.caseName', { + defaultMessage: 'Case name', +}); + +export const TO = i18n.translate('xpack.securitySolution.case.caseView.to', { + defaultMessage: 'to', +}); + +export const TAGS = i18n.translate('xpack.securitySolution.case.caseView.tags', { + defaultMessage: 'Tags', +}); + +export const ACTIONS = i18n.translate('xpack.securitySolution.case.allCases.actions', { + defaultMessage: 'Actions', +}); + +export const NO_TAGS_AVAILABLE = i18n.translate( + 'xpack.securitySolution.case.allCases.noTagsAvailable', + { + defaultMessage: 'No tags available', + } +); + +export const NO_REPORTERS_AVAILABLE = i18n.translate( + 'xpack.securitySolution.case.caseView.noReportersAvailable', + { + defaultMessage: 'No reporters available.', + } +); + +export const COMMENTS = i18n.translate('xpack.securitySolution.case.allCases.comments', { + defaultMessage: 'Comments', +}); + +export const TAGS_HELP = i18n.translate( + 'xpack.securitySolution.case.createCase.fieldTagsHelpText', + { + defaultMessage: + 'Type one or more custom identifying tags for this case. Press enter after each tag to begin a new one.', + } +); + +export const NO_TAGS = i18n.translate('xpack.securitySolution.case.caseView.noTags', { + defaultMessage: 'No tags are currently assigned to this case.', +}); + +export const TITLE_REQUIRED = i18n.translate( + 'xpack.securitySolution.case.createCase.titleFieldRequiredError', + { + defaultMessage: 'A title is required.', + } +); + +export const CONFIGURE_CASES_PAGE_TITLE = i18n.translate( + 'xpack.securitySolution.case.configureCases.headerTitle', + { + defaultMessage: 'Configure cases', + } +); + +export const CONFIGURE_CASES_BUTTON = i18n.translate( + 'xpack.securitySolution.case.configureCasesButton', + { + defaultMessage: 'Edit external connection', + } +); + +export const ADD_COMMENT = i18n.translate( + 'xpack.securitySolution.case.caseView.comment.addComment', + { + defaultMessage: 'Add comment', + } +); + +export const ADD_COMMENT_HELP_TEXT = i18n.translate( + 'xpack.securitySolution.case.caseView.comment.addCommentHelpText', + { + defaultMessage: 'Add a new comment...', + } +); + +export const SAVE = i18n.translate('xpack.securitySolution.case.caseView.description.save', { + defaultMessage: 'Save', +}); + +export const GO_TO_DOCUMENTATION = i18n.translate( + 'xpack.securitySolution.case.caseView.goToDocumentationButton', + { + defaultMessage: 'View documentation', + } +); + +export const CONNECTORS = i18n.translate('xpack.securitySolution.case.caseView.connectors', { + defaultMessage: 'External incident management system', +}); + +export const EDIT_CONNECTOR = i18n.translate('xpack.securitySolution.case.caseView.editConnector', { + defaultMessage: 'Change external incident management system', +}); diff --git a/x-pack/plugins/siem/public/cases/pages/utils.ts b/x-pack/plugins/security_solution/public/cases/pages/utils.ts similarity index 100% rename from x-pack/plugins/siem/public/cases/pages/utils.ts rename to x-pack/plugins/security_solution/public/cases/pages/utils.ts diff --git a/x-pack/plugins/siem/public/cases/routes.tsx b/x-pack/plugins/security_solution/public/cases/routes.tsx similarity index 100% rename from x-pack/plugins/siem/public/cases/routes.tsx rename to x-pack/plugins/security_solution/public/cases/routes.tsx diff --git a/x-pack/plugins/security_solution/public/cases/translations.ts b/x-pack/plugins/security_solution/public/cases/translations.ts new file mode 100644 index 0000000000000..5b595c5892ef2 --- /dev/null +++ b/x-pack/plugins/security_solution/public/cases/translations.ts @@ -0,0 +1,232 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + +import { i18n } from '@kbn/i18n'; + +export const SAVED_OBJECT_NO_PERMISSIONS_TITLE = i18n.translate( + 'xpack.securitySolution.case.caseSavedObjectNoPermissionsTitle', + { + defaultMessage: 'Kibana feature privileges required', + } +); + +export const SAVED_OBJECT_NO_PERMISSIONS_MSG = i18n.translate( + 'xpack.securitySolution.case.caseSavedObjectNoPermissionsMessage', + { + defaultMessage: + 'To view cases, you must have privileges for the Saved Object Management feature in the Kibana space. For more information, contact your Kibana administrator.', + } +); + +export const BACK_TO_ALL = i18n.translate('xpack.securitySolution.case.caseView.backLabel', { + defaultMessage: 'Back to cases', +}); + +export const CANCEL = i18n.translate('xpack.securitySolution.case.caseView.cancel', { + defaultMessage: 'Cancel', +}); + +export const DELETE_CASE = i18n.translate( + 'xpack.securitySolution.case.confirmDeleteCase.deleteCase', + { + defaultMessage: 'Delete case', + } +); + +export const DELETE_CASES = i18n.translate( + 'xpack.securitySolution.case.confirmDeleteCase.deleteCases', + { + defaultMessage: 'Delete cases', + } +); + +export const NAME = i18n.translate('xpack.securitySolution.case.caseView.name', { + defaultMessage: 'Name', +}); + +export const OPENED_ON = i18n.translate('xpack.securitySolution.case.caseView.openedOn', { + defaultMessage: 'Opened on', +}); + +export const CLOSED_ON = i18n.translate('xpack.securitySolution.case.caseView.closedOn', { + defaultMessage: 'Closed on', +}); + +export const REPORTER = i18n.translate('xpack.securitySolution.case.caseView.reporterLabel', { + defaultMessage: 'Reporter', +}); + +export const PARTICIPANTS = i18n.translate( + 'xpack.securitySolution.case.caseView.particpantsLabel', + { + defaultMessage: 'Participants', + } +); + +export const CREATE_BC_TITLE = i18n.translate('xpack.securitySolution.case.caseView.breadcrumb', { + defaultMessage: 'Create', +}); + +export const CREATE_TITLE = i18n.translate('xpack.securitySolution.case.caseView.create', { + defaultMessage: 'Create new case', +}); + +export const DESCRIPTION = i18n.translate('xpack.securitySolution.case.caseView.description', { + defaultMessage: 'Description', +}); + +export const DESCRIPTION_REQUIRED = i18n.translate( + 'xpack.securitySolution.case.createCase.descriptionFieldRequiredError', + { + defaultMessage: 'A description is required.', + } +); + +export const COMMENT_REQUIRED = i18n.translate( + 'xpack.securitySolution.case.caseView.commentFieldRequiredError', + { + defaultMessage: 'A comment is required.', + } +); + +export const REQUIRED_FIELD = i18n.translate( + 'xpack.securitySolution.case.caseView.fieldRequiredError', + { + defaultMessage: 'Required field', + } +); + +export const EDIT = i18n.translate('xpack.securitySolution.case.caseView.edit', { + defaultMessage: 'Edit', +}); + +export const OPTIONAL = i18n.translate('xpack.securitySolution.case.caseView.optional', { + defaultMessage: 'Optional', +}); + +export const PAGE_TITLE = i18n.translate('xpack.securitySolution.case.pageTitle', { + defaultMessage: 'Cases', +}); + +export const CREATE_CASE = i18n.translate('xpack.securitySolution.case.caseView.createCase', { + defaultMessage: 'Create case', +}); + +export const CLOSED_CASE = i18n.translate('xpack.securitySolution.case.caseView.closedCase', { + defaultMessage: 'Closed case', +}); + +export const CLOSE_CASE = i18n.translate('xpack.securitySolution.case.caseView.closeCase', { + defaultMessage: 'Close case', +}); + +export const REOPEN_CASE = i18n.translate('xpack.securitySolution.case.caseView.reopenCase', { + defaultMessage: 'Reopen case', +}); + +export const REOPENED_CASE = i18n.translate('xpack.securitySolution.case.caseView.reopenedCase', { + defaultMessage: 'Reopened case', +}); + +export const CASE_NAME = i18n.translate('xpack.securitySolution.case.caseView.caseName', { + defaultMessage: 'Case name', +}); + +export const TO = i18n.translate('xpack.securitySolution.case.caseView.to', { + defaultMessage: 'to', +}); + +export const TAGS = i18n.translate('xpack.securitySolution.case.caseView.tags', { + defaultMessage: 'Tags', +}); + +export const ACTIONS = i18n.translate('xpack.securitySolution.case.allCases.actions', { + defaultMessage: 'Actions', +}); + +export const NO_TAGS_AVAILABLE = i18n.translate( + 'xpack.securitySolution.case.allCases.noTagsAvailable', + { + defaultMessage: 'No tags available', + } +); + +export const NO_REPORTERS_AVAILABLE = i18n.translate( + 'xpack.securitySolution.case.caseView.noReportersAvailable', + { + defaultMessage: 'No reporters available.', + } +); + +export const COMMENTS = i18n.translate('xpack.securitySolution.case.allCases.comments', { + defaultMessage: 'Comments', +}); + +export const TAGS_HELP = i18n.translate( + 'xpack.securitySolution.case.createCase.fieldTagsHelpText', + { + defaultMessage: + 'Type one or more custom identifying tags for this case. Press enter after each tag to begin a new one.', + } +); + +export const NO_TAGS = i18n.translate('xpack.securitySolution.case.caseView.noTags', { + defaultMessage: 'No tags are currently assigned to this case.', +}); + +export const TITLE_REQUIRED = i18n.translate( + 'xpack.securitySolution.case.createCase.titleFieldRequiredError', + { + defaultMessage: 'A title is required.', + } +); + +export const CONFIGURE_CASES_PAGE_TITLE = i18n.translate( + 'xpack.securitySolution.case.configureCases.headerTitle', + { + defaultMessage: 'Configure cases', + } +); + +export const CONFIGURE_CASES_BUTTON = i18n.translate( + 'xpack.securitySolution.case.configureCasesButton', + { + defaultMessage: 'Edit external connection', + } +); + +export const ADD_COMMENT = i18n.translate( + 'xpack.securitySolution.case.caseView.comment.addComment', + { + defaultMessage: 'Add comment', + } +); + +export const ADD_COMMENT_HELP_TEXT = i18n.translate( + 'xpack.securitySolution.case.caseView.comment.addCommentHelpText', + { + defaultMessage: 'Add a new comment...', + } +); + +export const SAVE = i18n.translate('xpack.securitySolution.case.caseView.description.save', { + defaultMessage: 'Save', +}); + +export const GO_TO_DOCUMENTATION = i18n.translate( + 'xpack.securitySolution.case.caseView.goToDocumentationButton', + { + defaultMessage: 'View documentation', + } +); + +export const CONNECTORS = i18n.translate('xpack.securitySolution.case.caseView.connectors', { + defaultMessage: 'External incident management system', +}); + +export const EDIT_CONNECTOR = i18n.translate('xpack.securitySolution.case.caseView.editConnector', { + defaultMessage: 'Change external incident management system', +}); diff --git a/x-pack/plugins/siem/public/common/components/add_filter_to_global_search_bar/__snapshots__/index.test.tsx.snap b/x-pack/plugins/security_solution/public/common/components/add_filter_to_global_search_bar/__snapshots__/index.test.tsx.snap similarity index 100% rename from x-pack/plugins/siem/public/common/components/add_filter_to_global_search_bar/__snapshots__/index.test.tsx.snap rename to x-pack/plugins/security_solution/public/common/components/add_filter_to_global_search_bar/__snapshots__/index.test.tsx.snap diff --git a/x-pack/plugins/siem/public/common/components/add_filter_to_global_search_bar/helpers.test.tsx b/x-pack/plugins/security_solution/public/common/components/add_filter_to_global_search_bar/helpers.test.tsx similarity index 100% rename from x-pack/plugins/siem/public/common/components/add_filter_to_global_search_bar/helpers.test.tsx rename to x-pack/plugins/security_solution/public/common/components/add_filter_to_global_search_bar/helpers.test.tsx diff --git a/x-pack/plugins/siem/public/common/components/add_filter_to_global_search_bar/helpers.ts b/x-pack/plugins/security_solution/public/common/components/add_filter_to_global_search_bar/helpers.ts similarity index 100% rename from x-pack/plugins/siem/public/common/components/add_filter_to_global_search_bar/helpers.ts rename to x-pack/plugins/security_solution/public/common/components/add_filter_to_global_search_bar/helpers.ts diff --git a/x-pack/plugins/siem/public/common/components/add_filter_to_global_search_bar/index.test.tsx b/x-pack/plugins/security_solution/public/common/components/add_filter_to_global_search_bar/index.test.tsx similarity index 100% rename from x-pack/plugins/siem/public/common/components/add_filter_to_global_search_bar/index.test.tsx rename to x-pack/plugins/security_solution/public/common/components/add_filter_to_global_search_bar/index.test.tsx diff --git a/x-pack/plugins/siem/public/common/components/add_filter_to_global_search_bar/index.tsx b/x-pack/plugins/security_solution/public/common/components/add_filter_to_global_search_bar/index.tsx similarity index 100% rename from x-pack/plugins/siem/public/common/components/add_filter_to_global_search_bar/index.tsx rename to x-pack/plugins/security_solution/public/common/components/add_filter_to_global_search_bar/index.tsx diff --git a/x-pack/plugins/siem/public/common/components/add_filter_to_global_search_bar/translations.ts b/x-pack/plugins/security_solution/public/common/components/add_filter_to_global_search_bar/translations.ts similarity index 73% rename from x-pack/plugins/siem/public/common/components/add_filter_to_global_search_bar/translations.ts rename to x-pack/plugins/security_solution/public/common/components/add_filter_to_global_search_bar/translations.ts index f192c5c26fa49..c4f36bd7dd881 100644 --- a/x-pack/plugins/siem/public/common/components/add_filter_to_global_search_bar/translations.ts +++ b/x-pack/plugins/security_solution/public/common/components/add_filter_to_global_search_bar/translations.ts @@ -7,14 +7,14 @@ import { i18n } from '@kbn/i18n'; export const FILTER_FOR_VALUE = i18n.translate( - 'xpack.siem.add_filter_to_global_search_bar.filterForValueHoverAction', + 'xpack.securitySolution.add_filter_to_global_search_bar.filterForValueHoverAction', { defaultMessage: 'Filter for value', } ); export const FILTER_OUT_VALUE = i18n.translate( - 'xpack.siem.add_filter_to_global_search_bar.filterOutValueHoverAction', + 'xpack.securitySolution.add_filter_to_global_search_bar.filterOutValueHoverAction', { defaultMessage: 'Filter out value', } diff --git a/x-pack/plugins/siem/public/common/components/alerts_viewer/alerts_table.tsx b/x-pack/plugins/security_solution/public/common/components/alerts_viewer/alerts_table.tsx similarity index 86% rename from x-pack/plugins/siem/public/common/components/alerts_viewer/alerts_table.tsx rename to x-pack/plugins/security_solution/public/common/components/alerts_viewer/alerts_table.tsx index dd608babef48f..b19343a9f4a5c 100644 --- a/x-pack/plugins/siem/public/common/components/alerts_viewer/alerts_table.tsx +++ b/x-pack/plugins/security_solution/public/common/components/alerts_viewer/alerts_table.tsx @@ -4,13 +4,13 @@ * you may not use this file except in compliance with the Elastic License. */ -import React, { useMemo } from 'react'; +import React, { useEffect, useMemo } from 'react'; import { Filter } from '../../../../../../../src/plugins/data/public'; import { StatefulEventsViewer } from '../events_viewer'; -import * as i18n from './translations'; import { alertsDefaultModel } from './default_headers'; - +import { useManageTimeline } from '../../../timelines/components/manage_timeline'; +import * as i18n from './translations'; export interface OwnProps { end: number; id: string; @@ -59,16 +59,17 @@ interface Props { const AlertsTableComponent: React.FC = ({ endDate, startDate, pageFilters = [] }) => { const alertsFilter = useMemo(() => [...defaultAlertsFilters, ...pageFilters], [pageFilters]); - const timelineTypeContext = useMemo( - () => ({ + const { initializeTimeline } = useManageTimeline(); + + useEffect(() => { + initializeTimeline({ + id: ALERTS_TABLE_ID, documentType: i18n.ALERTS_DOCUMENT_TYPE, footerText: i18n.TOTAL_COUNT_OF_ALERTS, title: i18n.ALERTS_TABLE_TITLE, unit: i18n.UNIT, - }), - [] - ); - + }); + }, []); return ( = ({ endDate, startDate, pageFilters end={endDate} id={ALERTS_TABLE_ID} start={startDate} - timelineTypeContext={timelineTypeContext} /> ); }; diff --git a/x-pack/plugins/siem/public/common/components/alerts_viewer/default_headers.ts b/x-pack/plugins/security_solution/public/common/components/alerts_viewer/default_headers.ts similarity index 100% rename from x-pack/plugins/siem/public/common/components/alerts_viewer/default_headers.ts rename to x-pack/plugins/security_solution/public/common/components/alerts_viewer/default_headers.ts diff --git a/x-pack/plugins/siem/public/common/components/alerts_viewer/histogram_configs.ts b/x-pack/plugins/security_solution/public/common/components/alerts_viewer/histogram_configs.ts similarity index 100% rename from x-pack/plugins/siem/public/common/components/alerts_viewer/histogram_configs.ts rename to x-pack/plugins/security_solution/public/common/components/alerts_viewer/histogram_configs.ts diff --git a/x-pack/plugins/siem/public/common/components/alerts_viewer/index.tsx b/x-pack/plugins/security_solution/public/common/components/alerts_viewer/index.tsx similarity index 100% rename from x-pack/plugins/siem/public/common/components/alerts_viewer/index.tsx rename to x-pack/plugins/security_solution/public/common/components/alerts_viewer/index.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/alerts_viewer/translations.ts b/x-pack/plugins/security_solution/public/common/components/alerts_viewer/translations.ts new file mode 100644 index 0000000000000..8403050a13114 --- /dev/null +++ b/x-pack/plugins/security_solution/public/common/components/alerts_viewer/translations.ts @@ -0,0 +1,67 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + +import { i18n } from '@kbn/i18n'; + +export const ALERTS_DOCUMENT_TYPE = i18n.translate( + 'xpack.securitySolution.alertsView.alertsDocumentType', + { + defaultMessage: 'External alerts', + } +); + +export const TOTAL_COUNT_OF_ALERTS = i18n.translate( + 'xpack.securitySolution.alertsView.totalCountOfAlerts', + { + defaultMessage: 'external alerts match the search criteria', + } +); + +export const ALERTS_TABLE_TITLE = i18n.translate( + 'xpack.securitySolution.alertsView.alertsTableTitle', + { + defaultMessage: 'External alerts', + } +); + +export const ALERTS_GRAPH_TITLE = i18n.translate( + 'xpack.securitySolution.alertsView.alertsGraphTitle', + { + defaultMessage: 'External alert count', + } +); + +export const ALERTS_STACK_BY_MODULE = i18n.translate( + 'xpack.securitySolution.alertsView.alertsStackByOptions.module', + { + defaultMessage: 'module', + } +); + +export const SHOWING = i18n.translate('xpack.securitySolution.alertsView.showing', { + defaultMessage: 'Showing', +}); + +export const UNIT = (totalCount: number) => + i18n.translate('xpack.securitySolution.alertsView.unit', { + values: { totalCount }, + defaultMessage: `external {totalCount, plural, =1 {alert} other {alerts}}`, + }); + +export const ERROR_FETCHING_ALERTS_DATA = i18n.translate( + 'xpack.securitySolution.alertsView.errorFetchingAlertsData', + { + defaultMessage: 'Failed to query alerts data', + } +); + +export const CATEGORY = i18n.translate('xpack.securitySolution.alertsView.categoryLabel', { + defaultMessage: 'category', +}); + +export const MODULE = i18n.translate('xpack.securitySolution.alertsView.moduleLabel', { + defaultMessage: 'module', +}); diff --git a/x-pack/plugins/siem/public/common/components/alerts_viewer/types.ts b/x-pack/plugins/security_solution/public/common/components/alerts_viewer/types.ts similarity index 100% rename from x-pack/plugins/siem/public/common/components/alerts_viewer/types.ts rename to x-pack/plugins/security_solution/public/common/components/alerts_viewer/types.ts diff --git a/x-pack/plugins/siem/public/common/components/autocomplete_field/__examples__/index.stories.tsx b/x-pack/plugins/security_solution/public/common/components/autocomplete_field/__examples__/index.stories.tsx similarity index 100% rename from x-pack/plugins/siem/public/common/components/autocomplete_field/__examples__/index.stories.tsx rename to x-pack/plugins/security_solution/public/common/components/autocomplete_field/__examples__/index.stories.tsx diff --git a/x-pack/plugins/siem/public/common/components/autocomplete_field/__snapshots__/index.test.tsx.snap b/x-pack/plugins/security_solution/public/common/components/autocomplete_field/__snapshots__/index.test.tsx.snap similarity index 100% rename from x-pack/plugins/siem/public/common/components/autocomplete_field/__snapshots__/index.test.tsx.snap rename to x-pack/plugins/security_solution/public/common/components/autocomplete_field/__snapshots__/index.test.tsx.snap diff --git a/x-pack/plugins/siem/public/common/components/autocomplete_field/index.test.tsx b/x-pack/plugins/security_solution/public/common/components/autocomplete_field/index.test.tsx similarity index 100% rename from x-pack/plugins/siem/public/common/components/autocomplete_field/index.test.tsx rename to x-pack/plugins/security_solution/public/common/components/autocomplete_field/index.test.tsx diff --git a/x-pack/plugins/siem/public/common/components/autocomplete_field/index.tsx b/x-pack/plugins/security_solution/public/common/components/autocomplete_field/index.tsx similarity index 100% rename from x-pack/plugins/siem/public/common/components/autocomplete_field/index.tsx rename to x-pack/plugins/security_solution/public/common/components/autocomplete_field/index.tsx diff --git a/x-pack/plugins/siem/public/common/components/autocomplete_field/suggestion_item.tsx b/x-pack/plugins/security_solution/public/common/components/autocomplete_field/suggestion_item.tsx similarity index 100% rename from x-pack/plugins/siem/public/common/components/autocomplete_field/suggestion_item.tsx rename to x-pack/plugins/security_solution/public/common/components/autocomplete_field/suggestion_item.tsx diff --git a/x-pack/plugins/siem/public/common/components/charts/__snapshots__/areachart.test.tsx.snap b/x-pack/plugins/security_solution/public/common/components/charts/__snapshots__/areachart.test.tsx.snap similarity index 100% rename from x-pack/plugins/siem/public/common/components/charts/__snapshots__/areachart.test.tsx.snap rename to x-pack/plugins/security_solution/public/common/components/charts/__snapshots__/areachart.test.tsx.snap diff --git a/x-pack/plugins/siem/public/common/components/charts/__snapshots__/barchart.test.tsx.snap b/x-pack/plugins/security_solution/public/common/components/charts/__snapshots__/barchart.test.tsx.snap similarity index 100% rename from x-pack/plugins/siem/public/common/components/charts/__snapshots__/barchart.test.tsx.snap rename to x-pack/plugins/security_solution/public/common/components/charts/__snapshots__/barchart.test.tsx.snap diff --git a/x-pack/plugins/siem/public/common/components/charts/areachart.test.tsx b/x-pack/plugins/security_solution/public/common/components/charts/areachart.test.tsx similarity index 100% rename from x-pack/plugins/siem/public/common/components/charts/areachart.test.tsx rename to x-pack/plugins/security_solution/public/common/components/charts/areachart.test.tsx diff --git a/x-pack/plugins/siem/public/common/components/charts/areachart.tsx b/x-pack/plugins/security_solution/public/common/components/charts/areachart.tsx similarity index 100% rename from x-pack/plugins/siem/public/common/components/charts/areachart.tsx rename to x-pack/plugins/security_solution/public/common/components/charts/areachart.tsx diff --git a/x-pack/plugins/siem/public/common/components/charts/barchart.test.tsx b/x-pack/plugins/security_solution/public/common/components/charts/barchart.test.tsx similarity index 100% rename from x-pack/plugins/siem/public/common/components/charts/barchart.test.tsx rename to x-pack/plugins/security_solution/public/common/components/charts/barchart.test.tsx diff --git a/x-pack/plugins/siem/public/common/components/charts/barchart.tsx b/x-pack/plugins/security_solution/public/common/components/charts/barchart.tsx similarity index 100% rename from x-pack/plugins/siem/public/common/components/charts/barchart.tsx rename to x-pack/plugins/security_solution/public/common/components/charts/barchart.tsx diff --git a/x-pack/plugins/siem/public/common/components/charts/chart_place_holder.test.tsx b/x-pack/plugins/security_solution/public/common/components/charts/chart_place_holder.test.tsx similarity index 100% rename from x-pack/plugins/siem/public/common/components/charts/chart_place_holder.test.tsx rename to x-pack/plugins/security_solution/public/common/components/charts/chart_place_holder.test.tsx diff --git a/x-pack/plugins/siem/public/common/components/charts/chart_place_holder.tsx b/x-pack/plugins/security_solution/public/common/components/charts/chart_place_holder.tsx similarity index 100% rename from x-pack/plugins/siem/public/common/components/charts/chart_place_holder.tsx rename to x-pack/plugins/security_solution/public/common/components/charts/chart_place_holder.tsx diff --git a/x-pack/plugins/siem/public/common/components/charts/common.test.tsx b/x-pack/plugins/security_solution/public/common/components/charts/common.test.tsx similarity index 100% rename from x-pack/plugins/siem/public/common/components/charts/common.test.tsx rename to x-pack/plugins/security_solution/public/common/components/charts/common.test.tsx diff --git a/x-pack/plugins/siem/public/common/components/charts/common.tsx b/x-pack/plugins/security_solution/public/common/components/charts/common.tsx similarity index 100% rename from x-pack/plugins/siem/public/common/components/charts/common.tsx rename to x-pack/plugins/security_solution/public/common/components/charts/common.tsx diff --git a/x-pack/plugins/siem/public/common/components/charts/draggable_legend.test.tsx b/x-pack/plugins/security_solution/public/common/components/charts/draggable_legend.test.tsx similarity index 100% rename from x-pack/plugins/siem/public/common/components/charts/draggable_legend.test.tsx rename to x-pack/plugins/security_solution/public/common/components/charts/draggable_legend.test.tsx diff --git a/x-pack/plugins/siem/public/common/components/charts/draggable_legend.tsx b/x-pack/plugins/security_solution/public/common/components/charts/draggable_legend.tsx similarity index 100% rename from x-pack/plugins/siem/public/common/components/charts/draggable_legend.tsx rename to x-pack/plugins/security_solution/public/common/components/charts/draggable_legend.tsx diff --git a/x-pack/plugins/siem/public/common/components/charts/draggable_legend_item.test.tsx b/x-pack/plugins/security_solution/public/common/components/charts/draggable_legend_item.test.tsx similarity index 100% rename from x-pack/plugins/siem/public/common/components/charts/draggable_legend_item.test.tsx rename to x-pack/plugins/security_solution/public/common/components/charts/draggable_legend_item.test.tsx diff --git a/x-pack/plugins/siem/public/common/components/charts/draggable_legend_item.tsx b/x-pack/plugins/security_solution/public/common/components/charts/draggable_legend_item.tsx similarity index 100% rename from x-pack/plugins/siem/public/common/components/charts/draggable_legend_item.tsx rename to x-pack/plugins/security_solution/public/common/components/charts/draggable_legend_item.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/charts/translation.ts b/x-pack/plugins/security_solution/public/common/components/charts/translation.ts new file mode 100644 index 0000000000000..68b90af65aefa --- /dev/null +++ b/x-pack/plugins/security_solution/public/common/components/charts/translation.ts @@ -0,0 +1,25 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + +import { i18n } from '@kbn/i18n'; + +export const ALL_VALUES_ZEROS_TITLE = i18n.translate( + 'xpack.securitySolution.chart.dataAllValuesZerosTitle', + { + defaultMessage: 'All values returned zero', + } +); + +export const DATA_NOT_AVAILABLE_TITLE = i18n.translate( + 'xpack.securitySolution.chart.dataNotAvailableTitle', + { + defaultMessage: 'Chart Data Not Available', + } +); + +export const ALL_OTHERS = i18n.translate('xpack.securitySolution.chart.allOthersGroupingLabel', { + defaultMessage: 'All others', +}); diff --git a/x-pack/plugins/siem/public/common/components/drag_and_drop/__snapshots__/drag_drop_context_wrapper.test.tsx.snap b/x-pack/plugins/security_solution/public/common/components/drag_and_drop/__snapshots__/drag_drop_context_wrapper.test.tsx.snap similarity index 100% rename from x-pack/plugins/siem/public/common/components/drag_and_drop/__snapshots__/drag_drop_context_wrapper.test.tsx.snap rename to x-pack/plugins/security_solution/public/common/components/drag_and_drop/__snapshots__/drag_drop_context_wrapper.test.tsx.snap diff --git a/x-pack/plugins/siem/public/common/components/drag_and_drop/__snapshots__/draggable_wrapper.test.tsx.snap b/x-pack/plugins/security_solution/public/common/components/drag_and_drop/__snapshots__/draggable_wrapper.test.tsx.snap similarity index 100% rename from x-pack/plugins/siem/public/common/components/drag_and_drop/__snapshots__/draggable_wrapper.test.tsx.snap rename to x-pack/plugins/security_solution/public/common/components/drag_and_drop/__snapshots__/draggable_wrapper.test.tsx.snap diff --git a/x-pack/plugins/siem/public/common/components/drag_and_drop/__snapshots__/droppable_wrapper.test.tsx.snap b/x-pack/plugins/security_solution/public/common/components/drag_and_drop/__snapshots__/droppable_wrapper.test.tsx.snap similarity index 100% rename from x-pack/plugins/siem/public/common/components/drag_and_drop/__snapshots__/droppable_wrapper.test.tsx.snap rename to x-pack/plugins/security_solution/public/common/components/drag_and_drop/__snapshots__/droppable_wrapper.test.tsx.snap diff --git a/x-pack/plugins/siem/public/common/components/drag_and_drop/drag_drop_context.tsx b/x-pack/plugins/security_solution/public/common/components/drag_and_drop/drag_drop_context.tsx similarity index 100% rename from x-pack/plugins/siem/public/common/components/drag_and_drop/drag_drop_context.tsx rename to x-pack/plugins/security_solution/public/common/components/drag_and_drop/drag_drop_context.tsx diff --git a/x-pack/plugins/siem/public/common/components/drag_and_drop/drag_drop_context_wrapper.test.tsx b/x-pack/plugins/security_solution/public/common/components/drag_and_drop/drag_drop_context_wrapper.test.tsx similarity index 100% rename from x-pack/plugins/siem/public/common/components/drag_and_drop/drag_drop_context_wrapper.test.tsx rename to x-pack/plugins/security_solution/public/common/components/drag_and_drop/drag_drop_context_wrapper.test.tsx diff --git a/x-pack/plugins/siem/public/common/components/drag_and_drop/drag_drop_context_wrapper.tsx b/x-pack/plugins/security_solution/public/common/components/drag_and_drop/drag_drop_context_wrapper.tsx similarity index 100% rename from x-pack/plugins/siem/public/common/components/drag_and_drop/drag_drop_context_wrapper.tsx rename to x-pack/plugins/security_solution/public/common/components/drag_and_drop/drag_drop_context_wrapper.tsx diff --git a/x-pack/plugins/siem/public/common/components/drag_and_drop/draggable_wrapper.test.tsx b/x-pack/plugins/security_solution/public/common/components/drag_and_drop/draggable_wrapper.test.tsx similarity index 100% rename from x-pack/plugins/siem/public/common/components/drag_and_drop/draggable_wrapper.test.tsx rename to x-pack/plugins/security_solution/public/common/components/drag_and_drop/draggable_wrapper.test.tsx diff --git a/x-pack/plugins/siem/public/common/components/drag_and_drop/draggable_wrapper.tsx b/x-pack/plugins/security_solution/public/common/components/drag_and_drop/draggable_wrapper.tsx similarity index 100% rename from x-pack/plugins/siem/public/common/components/drag_and_drop/draggable_wrapper.tsx rename to x-pack/plugins/security_solution/public/common/components/drag_and_drop/draggable_wrapper.tsx diff --git a/x-pack/plugins/siem/public/common/components/drag_and_drop/draggable_wrapper_hover_content.test.tsx b/x-pack/plugins/security_solution/public/common/components/drag_and_drop/draggable_wrapper_hover_content.test.tsx similarity index 82% rename from x-pack/plugins/siem/public/common/components/drag_and_drop/draggable_wrapper_hover_content.test.tsx rename to x-pack/plugins/security_solution/public/common/components/drag_and_drop/draggable_wrapper_hover_content.test.tsx index 91ef4f3ac9925..aa5efe3ccfe6a 100644 --- a/x-pack/plugins/siem/public/common/components/drag_and_drop/draggable_wrapper_hover_content.test.tsx +++ b/x-pack/plugins/security_solution/public/common/components/drag_and_drop/draggable_wrapper_hover_content.test.tsx @@ -14,10 +14,13 @@ import { useKibana } from '../../lib/kibana'; import { TestProviders } from '../../mock'; import { createKibanaCoreStartMock } from '../../mock/kibana_core'; import { FilterManager } from '../../../../../../../src/plugins/data/public'; -import { TimelineContext } from '../../../timelines/components/timeline/timeline_context'; import { useAddToTimeline } from '../../hooks/use_add_to_timeline'; import { DraggableWrapperHoverContent } from './draggable_wrapper_hover_content'; +import { + ManageGlobalTimeline, + timelineDefaults, +} from '../../../timelines/components/manage_timeline'; jest.mock('../../lib/kibana'); @@ -31,8 +34,17 @@ jest.mock('uuid', () => { jest.mock('../../hooks/use_add_to_timeline'); const mockUiSettingsForFilterManager = createKibanaCoreStartMock().uiSettings; +const timelineId = 'cool-id'; const field = 'process.name'; const value = 'nice'; +const toggleTopN = jest.fn(); +const defaultProps = { + field, + showTopN: false, + timelineId, + toggleTopN, + value, +}; describe('DraggableWrapperHoverContent', () => { beforeAll(() => { @@ -44,6 +56,9 @@ describe('DraggableWrapperHoverContent', () => { /* eslint-disable no-console */ const originalError = console.error; const originalWarn = console.warn; + beforeEach(() => { + jest.clearAllMocks(); + }); beforeAll(() => { console.warn = jest.fn(); console.error = jest.fn(); @@ -64,12 +79,7 @@ describe('DraggableWrapperHoverContent', () => { test(`it renders the 'Filter ${hoverAction} value' button when showTopN is false`, () => { const wrapper = mount( - + ); @@ -81,12 +91,7 @@ describe('DraggableWrapperHoverContent', () => { test(`it does NOT render the 'Filter ${hoverAction} value' button when showTopN is true`, () => { const wrapper = mount( - + ); @@ -104,22 +109,22 @@ describe('DraggableWrapperHoverContent', () => { filterManager = new FilterManager(mockUiSettingsForFilterManager); filterManager.addFilters = jest.fn(); onFilterAdded = jest.fn(); + const manageTimelineForTesting = { + [timelineId]: { + ...timelineDefaults, + id: timelineId, + filterManager, + }, + }; wrapper = mount( - - - + + + ); }); - test('when clicked, it adds a filter to the timeline when running in the context of a timeline', () => { wrapper.find(`[data-test-subj="filter-${hoverAction}-value"]`).first().simulate('click'); wrapper.update(); @@ -157,13 +162,7 @@ describe('DraggableWrapperHoverContent', () => { wrapper = mount( - + ); }); @@ -204,17 +203,19 @@ describe('DraggableWrapperHoverContent', () => { filterManager.addFilters = jest.fn(); onFilterAdded = jest.fn(); + const manageTimelineForTesting = { + [timelineId]: { + ...timelineDefaults, + id: timelineId, + filterManager, + }, + }; + wrapper = mount( - - - + + + ); }); @@ -265,13 +266,7 @@ describe('DraggableWrapperHoverContent', () => { wrapper = mount( - + ); }); @@ -328,11 +323,13 @@ describe('DraggableWrapperHoverContent', () => { @@ -351,11 +348,11 @@ describe('DraggableWrapperHoverContent', () => { @@ -383,10 +380,10 @@ describe('DraggableWrapperHoverContent', () => { @@ -404,10 +401,10 @@ describe('DraggableWrapperHoverContent', () => { @@ -425,10 +422,10 @@ describe('DraggableWrapperHoverContent', () => { @@ -441,16 +438,15 @@ describe('DraggableWrapperHoverContent', () => { }); test(`invokes the toggleTopN function when the 'Show top field' button is clicked`, async () => { - const toggleTopN = jest.fn(); const whitelistedField = 'signal.rule.name'; const wrapper = mount( @@ -471,10 +467,10 @@ describe('DraggableWrapperHoverContent', () => { @@ -494,10 +490,11 @@ describe('DraggableWrapperHoverContent', () => { @@ -515,10 +512,11 @@ describe('DraggableWrapperHoverContent', () => { @@ -537,12 +535,7 @@ describe('DraggableWrapperHoverContent', () => { test(`it renders the 'Copy to Clipboard' button when showTopN is false`, () => { const wrapper = mount( - + ); @@ -553,10 +546,10 @@ describe('DraggableWrapperHoverContent', () => { const wrapper = mount( ); diff --git a/x-pack/plugins/siem/public/common/components/drag_and_drop/draggable_wrapper_hover_content.tsx b/x-pack/plugins/security_solution/public/common/components/drag_and_drop/draggable_wrapper_hover_content.tsx similarity index 87% rename from x-pack/plugins/siem/public/common/components/drag_and_drop/draggable_wrapper_hover_content.tsx rename to x-pack/plugins/security_solution/public/common/components/drag_and_drop/draggable_wrapper_hover_content.tsx index a0546dc64113c..998d18291f638 100644 --- a/x-pack/plugins/siem/public/common/components/drag_and_drop/draggable_wrapper_hover_content.tsx +++ b/x-pack/plugins/security_solution/public/common/components/drag_and_drop/draggable_wrapper_hover_content.tsx @@ -13,17 +13,18 @@ import { useAddToTimeline } from '../../hooks/use_add_to_timeline'; import { WithCopyToClipboard } from '../../lib/clipboard/with_copy_to_clipboard'; import { useKibana } from '../../lib/kibana'; import { createFilter } from '../add_filter_to_global_search_bar'; -import { useTimelineContext } from '../../../timelines/components/timeline/timeline_context'; import { StatefulTopN } from '../top_n'; import { allowTopN } from './helpers'; import * as i18n from './translations'; +import { useManageTimeline } from '../../../timelines/components/manage_timeline'; interface Props { draggableId?: DraggableId; field: string; onFilterAdded?: () => void; showTopN: boolean; + timelineId?: string; toggleTopN: () => void; value?: string[] | string | null; } @@ -33,20 +34,27 @@ const DraggableWrapperHoverContentComponent: React.FC = ({ field, onFilterAdded, showTopN, + timelineId, toggleTopN, value, }) => { const startDragToTimeline = useAddToTimeline({ draggableId, fieldName: field }); const kibana = useKibana(); - const { filterManager: timelineFilterManager } = useTimelineContext(); - const filterManager = useMemo(() => kibana.services.data.query.filterManager, [ + const filterManagerBackup = useMemo(() => kibana.services.data.query.filterManager, [ kibana.services.data.query.filterManager, ]); - + const { getTimelineFilterManager } = useManageTimeline(); + const filterManager = useMemo( + () => + timelineId + ? getTimelineFilterManager(timelineId) ?? filterManagerBackup + : filterManagerBackup, + [timelineId, getTimelineFilterManager, filterManagerBackup] + ); const filterForValue = useCallback(() => { const filter = value?.length === 0 ? createFilter(field, undefined) : createFilter(field, value); - const activeFilterManager = timelineFilterManager ?? filterManager; + const activeFilterManager = filterManager; if (activeFilterManager != null) { activeFilterManager.addFilters(filter); @@ -55,12 +63,12 @@ const DraggableWrapperHoverContentComponent: React.FC = ({ onFilterAdded(); } } - }, [field, value, timelineFilterManager, filterManager, onFilterAdded]); + }, [field, value, filterManager, onFilterAdded]); const filterOutValue = useCallback(() => { const filter = value?.length === 0 ? createFilter(field, null, false) : createFilter(field, value, true); - const activeFilterManager = timelineFilterManager ?? filterManager; + const activeFilterManager = filterManager; if (activeFilterManager != null) { activeFilterManager.addFilters(filter); @@ -69,7 +77,7 @@ const DraggableWrapperHoverContentComponent: React.FC = ({ onFilterAdded(); } } - }, [field, value, timelineFilterManager, filterManager, onFilterAdded]); + }, [field, value, filterManager, onFilterAdded]); return ( <> diff --git a/x-pack/plugins/siem/public/common/components/drag_and_drop/droppable_wrapper.test.tsx b/x-pack/plugins/security_solution/public/common/components/drag_and_drop/droppable_wrapper.test.tsx similarity index 100% rename from x-pack/plugins/siem/public/common/components/drag_and_drop/droppable_wrapper.test.tsx rename to x-pack/plugins/security_solution/public/common/components/drag_and_drop/droppable_wrapper.test.tsx diff --git a/x-pack/plugins/siem/public/common/components/drag_and_drop/droppable_wrapper.tsx b/x-pack/plugins/security_solution/public/common/components/drag_and_drop/droppable_wrapper.tsx similarity index 100% rename from x-pack/plugins/siem/public/common/components/drag_and_drop/droppable_wrapper.tsx rename to x-pack/plugins/security_solution/public/common/components/drag_and_drop/droppable_wrapper.tsx diff --git a/x-pack/plugins/siem/public/common/components/drag_and_drop/helpers.test.ts b/x-pack/plugins/security_solution/public/common/components/drag_and_drop/helpers.test.ts similarity index 99% rename from x-pack/plugins/siem/public/common/components/drag_and_drop/helpers.test.ts rename to x-pack/plugins/security_solution/public/common/components/drag_and_drop/helpers.test.ts index be58381fbca1b..afdfde6e08224 100644 --- a/x-pack/plugins/siem/public/common/components/drag_and_drop/helpers.test.ts +++ b/x-pack/plugins/security_solution/public/common/components/drag_and_drop/helpers.test.ts @@ -960,7 +960,7 @@ describe('helpers', () => { }, ], }, - type: 'x-pack/siem/local/timeline/UPDATE_PROVIDERS', + type: 'x-pack/security_solution/local/timeline/UPDATE_PROVIDERS', }); }); @@ -981,7 +981,7 @@ describe('helpers', () => { payload: { id: 'hosts-table-hostName-ENDPOINT-W-0-01', }, - type: 'x-pack/siem/local/drag_and_drop/NO_PROVIDER_FOUND', + type: 'x-pack/security_solution/local/drag_and_drop/NO_PROVIDER_FOUND', }); }); }); diff --git a/x-pack/plugins/siem/public/common/components/drag_and_drop/helpers.ts b/x-pack/plugins/security_solution/public/common/components/drag_and_drop/helpers.ts similarity index 100% rename from x-pack/plugins/siem/public/common/components/drag_and_drop/helpers.ts rename to x-pack/plugins/security_solution/public/common/components/drag_and_drop/helpers.ts diff --git a/x-pack/plugins/siem/public/common/components/drag_and_drop/provider_container.tsx b/x-pack/plugins/security_solution/public/common/components/drag_and_drop/provider_container.tsx similarity index 100% rename from x-pack/plugins/siem/public/common/components/drag_and_drop/provider_container.tsx rename to x-pack/plugins/security_solution/public/common/components/drag_and_drop/provider_container.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/drag_and_drop/translations.ts b/x-pack/plugins/security_solution/public/common/components/drag_and_drop/translations.ts new file mode 100644 index 0000000000000..574b2c190e1db --- /dev/null +++ b/x-pack/plugins/security_solution/public/common/components/drag_and_drop/translations.ts @@ -0,0 +1,46 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + +import { i18n } from '@kbn/i18n'; + +export const ADD_TO_TIMELINE = i18n.translate('xpack.securitySolution.dragAndDrop.addToTimeline', { + defaultMessage: 'Add to timeline investigation', +}); + +export const COPY_TO_CLIPBOARD = i18n.translate( + 'xpack.securitySolution.dragAndDrop.copyToClipboardTooltip', + { + defaultMessage: 'Copy to Clipboard', + } +); + +export const FIELD = i18n.translate('xpack.securitySolution.dragAndDrop.fieldLabel', { + defaultMessage: 'Field', +}); + +export const FILTER_FOR_VALUE = i18n.translate( + 'xpack.securitySolution.dragAndDrop.filterForValueHoverAction', + { + defaultMessage: 'Filter for value', + } +); + +export const FILTER_OUT_VALUE = i18n.translate( + 'xpack.securitySolution.dragAndDrop.filterOutValueHoverAction', + { + defaultMessage: 'Filter out value', + } +); + +export const CLOSE = i18n.translate('xpack.securitySolution.dragAndDrop.closeButtonLabel', { + defaultMessage: 'Close', +}); + +export const SHOW_TOP = (fieldName: string) => + i18n.translate('xpack.securitySolution.overview.showTopTooltip', { + values: { fieldName }, + defaultMessage: `Show top {fieldName}`, + }); diff --git a/x-pack/plugins/siem/public/common/components/draggables/__snapshots__/index.test.tsx.snap b/x-pack/plugins/security_solution/public/common/components/draggables/__snapshots__/index.test.tsx.snap similarity index 100% rename from x-pack/plugins/siem/public/common/components/draggables/__snapshots__/index.test.tsx.snap rename to x-pack/plugins/security_solution/public/common/components/draggables/__snapshots__/index.test.tsx.snap diff --git a/x-pack/plugins/siem/public/common/components/draggables/field_badge/index.tsx b/x-pack/plugins/security_solution/public/common/components/draggables/field_badge/index.tsx similarity index 100% rename from x-pack/plugins/siem/public/common/components/draggables/field_badge/index.tsx rename to x-pack/plugins/security_solution/public/common/components/draggables/field_badge/index.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/draggables/field_badge/translations.ts b/x-pack/plugins/security_solution/public/common/components/draggables/field_badge/translations.ts new file mode 100644 index 0000000000000..8d378c9a05a70 --- /dev/null +++ b/x-pack/plugins/security_solution/public/common/components/draggables/field_badge/translations.ts @@ -0,0 +1,33 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + +import { i18n } from '@kbn/i18n'; + +export const CATEGORY = i18n.translate('xpack.securitySolution.draggables.field.categoryLabel', { + defaultMessage: 'Category', +}); + +export const COPY_TO_CLIPBOARD = i18n.translate( + 'xpack.securitySolution.eventDetails.copyToClipboardTooltip', + { + defaultMessage: 'Copy to Clipboard', + } +); + +export const FIELD = i18n.translate('xpack.securitySolution.draggables.field.fieldLabel', { + defaultMessage: 'Field', +}); + +export const TYPE = i18n.translate('xpack.securitySolution.draggables.field.typeLabel', { + defaultMessage: 'Type', +}); + +export const VIEW_CATEGORY = i18n.translate( + 'xpack.securitySolution.draggables.field.viewCategoryTooltip', + { + defaultMessage: 'View Category', + } +); diff --git a/x-pack/plugins/siem/public/common/components/draggables/index.test.tsx b/x-pack/plugins/security_solution/public/common/components/draggables/index.test.tsx similarity index 100% rename from x-pack/plugins/siem/public/common/components/draggables/index.test.tsx rename to x-pack/plugins/security_solution/public/common/components/draggables/index.test.tsx diff --git a/x-pack/plugins/siem/public/common/components/draggables/index.tsx b/x-pack/plugins/security_solution/public/common/components/draggables/index.tsx similarity index 100% rename from x-pack/plugins/siem/public/common/components/draggables/index.tsx rename to x-pack/plugins/security_solution/public/common/components/draggables/index.tsx diff --git a/x-pack/plugins/siem/public/common/components/empty_page/__snapshots__/index.test.tsx.snap b/x-pack/plugins/security_solution/public/common/components/empty_page/__snapshots__/index.test.tsx.snap similarity index 100% rename from x-pack/plugins/siem/public/common/components/empty_page/__snapshots__/index.test.tsx.snap rename to x-pack/plugins/security_solution/public/common/components/empty_page/__snapshots__/index.test.tsx.snap diff --git a/x-pack/plugins/siem/public/common/components/empty_page/index.test.tsx b/x-pack/plugins/security_solution/public/common/components/empty_page/index.test.tsx similarity index 100% rename from x-pack/plugins/siem/public/common/components/empty_page/index.test.tsx rename to x-pack/plugins/security_solution/public/common/components/empty_page/index.test.tsx diff --git a/x-pack/plugins/siem/public/common/components/empty_page/index.tsx b/x-pack/plugins/security_solution/public/common/components/empty_page/index.tsx similarity index 100% rename from x-pack/plugins/siem/public/common/components/empty_page/index.tsx rename to x-pack/plugins/security_solution/public/common/components/empty_page/index.tsx diff --git a/x-pack/plugins/siem/public/common/components/empty_value/__snapshots__/empty_value.test.tsx.snap b/x-pack/plugins/security_solution/public/common/components/empty_value/__snapshots__/empty_value.test.tsx.snap similarity index 100% rename from x-pack/plugins/siem/public/common/components/empty_value/__snapshots__/empty_value.test.tsx.snap rename to x-pack/plugins/security_solution/public/common/components/empty_value/__snapshots__/empty_value.test.tsx.snap diff --git a/x-pack/plugins/siem/public/common/components/empty_value/empty_value.test.tsx b/x-pack/plugins/security_solution/public/common/components/empty_value/empty_value.test.tsx similarity index 100% rename from x-pack/plugins/siem/public/common/components/empty_value/empty_value.test.tsx rename to x-pack/plugins/security_solution/public/common/components/empty_value/empty_value.test.tsx diff --git a/x-pack/plugins/siem/public/common/components/empty_value/index.tsx b/x-pack/plugins/security_solution/public/common/components/empty_value/index.tsx similarity index 100% rename from x-pack/plugins/siem/public/common/components/empty_value/index.tsx rename to x-pack/plugins/security_solution/public/common/components/empty_value/index.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/empty_value/translations.ts b/x-pack/plugins/security_solution/public/common/components/empty_value/translations.ts new file mode 100644 index 0000000000000..afcf21505103d --- /dev/null +++ b/x-pack/plugins/security_solution/public/common/components/empty_value/translations.ts @@ -0,0 +1,14 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + +import { i18n } from '@kbn/i18n'; + +export const EMPTY_STRING = i18n.translate( + 'xpack.securitySolution.emptyString.emptyStringDescription', + { + defaultMessage: 'Empty String', + } +); diff --git a/x-pack/plugins/siem/public/common/components/endpoint/__snapshots__/link_to_app.test.tsx.snap b/x-pack/plugins/security_solution/public/common/components/endpoint/__snapshots__/link_to_app.test.tsx.snap similarity index 100% rename from x-pack/plugins/siem/public/common/components/endpoint/__snapshots__/link_to_app.test.tsx.snap rename to x-pack/plugins/security_solution/public/common/components/endpoint/__snapshots__/link_to_app.test.tsx.snap diff --git a/x-pack/plugins/siem/public/common/components/endpoint/__snapshots__/page_view.test.tsx.snap b/x-pack/plugins/security_solution/public/common/components/endpoint/__snapshots__/page_view.test.tsx.snap similarity index 100% rename from x-pack/plugins/siem/public/common/components/endpoint/__snapshots__/page_view.test.tsx.snap rename to x-pack/plugins/security_solution/public/common/components/endpoint/__snapshots__/page_view.test.tsx.snap diff --git a/x-pack/plugins/siem/public/common/components/endpoint/formatted_date_time.tsx b/x-pack/plugins/security_solution/public/common/components/endpoint/formatted_date_time.tsx similarity index 100% rename from x-pack/plugins/siem/public/common/components/endpoint/formatted_date_time.tsx rename to x-pack/plugins/security_solution/public/common/components/endpoint/formatted_date_time.tsx diff --git a/x-pack/plugins/siem/public/common/components/endpoint/link_to_app.test.tsx b/x-pack/plugins/security_solution/public/common/components/endpoint/link_to_app.test.tsx similarity index 100% rename from x-pack/plugins/siem/public/common/components/endpoint/link_to_app.test.tsx rename to x-pack/plugins/security_solution/public/common/components/endpoint/link_to_app.test.tsx diff --git a/x-pack/plugins/siem/public/common/components/endpoint/link_to_app.tsx b/x-pack/plugins/security_solution/public/common/components/endpoint/link_to_app.tsx similarity index 100% rename from x-pack/plugins/siem/public/common/components/endpoint/link_to_app.tsx rename to x-pack/plugins/security_solution/public/common/components/endpoint/link_to_app.tsx diff --git a/x-pack/plugins/siem/public/common/components/endpoint/page_view.test.tsx b/x-pack/plugins/security_solution/public/common/components/endpoint/page_view.test.tsx similarity index 100% rename from x-pack/plugins/siem/public/common/components/endpoint/page_view.test.tsx rename to x-pack/plugins/security_solution/public/common/components/endpoint/page_view.test.tsx diff --git a/x-pack/plugins/siem/public/common/components/endpoint/page_view.tsx b/x-pack/plugins/security_solution/public/common/components/endpoint/page_view.tsx similarity index 100% rename from x-pack/plugins/siem/public/common/components/endpoint/page_view.tsx rename to x-pack/plugins/security_solution/public/common/components/endpoint/page_view.tsx diff --git a/x-pack/plugins/siem/public/common/components/endpoint/route_capture.tsx b/x-pack/plugins/security_solution/public/common/components/endpoint/route_capture.tsx similarity index 100% rename from x-pack/plugins/siem/public/common/components/endpoint/route_capture.tsx rename to x-pack/plugins/security_solution/public/common/components/endpoint/route_capture.tsx diff --git a/x-pack/plugins/siem/public/common/components/error_toast_dispatcher/__snapshots__/index.test.tsx.snap b/x-pack/plugins/security_solution/public/common/components/error_toast_dispatcher/__snapshots__/index.test.tsx.snap similarity index 100% rename from x-pack/plugins/siem/public/common/components/error_toast_dispatcher/__snapshots__/index.test.tsx.snap rename to x-pack/plugins/security_solution/public/common/components/error_toast_dispatcher/__snapshots__/index.test.tsx.snap diff --git a/x-pack/plugins/siem/public/common/components/error_toast_dispatcher/index.test.tsx b/x-pack/plugins/security_solution/public/common/components/error_toast_dispatcher/index.test.tsx similarity index 100% rename from x-pack/plugins/siem/public/common/components/error_toast_dispatcher/index.test.tsx rename to x-pack/plugins/security_solution/public/common/components/error_toast_dispatcher/index.test.tsx diff --git a/x-pack/plugins/siem/public/common/components/error_toast_dispatcher/index.tsx b/x-pack/plugins/security_solution/public/common/components/error_toast_dispatcher/index.tsx similarity index 100% rename from x-pack/plugins/siem/public/common/components/error_toast_dispatcher/index.tsx rename to x-pack/plugins/security_solution/public/common/components/error_toast_dispatcher/index.tsx diff --git a/x-pack/plugins/siem/public/common/components/event_details/__snapshots__/event_details.test.tsx.snap b/x-pack/plugins/security_solution/public/common/components/event_details/__snapshots__/event_details.test.tsx.snap similarity index 100% rename from x-pack/plugins/siem/public/common/components/event_details/__snapshots__/event_details.test.tsx.snap rename to x-pack/plugins/security_solution/public/common/components/event_details/__snapshots__/event_details.test.tsx.snap diff --git a/x-pack/plugins/siem/public/common/components/event_details/__snapshots__/json_view.test.tsx.snap b/x-pack/plugins/security_solution/public/common/components/event_details/__snapshots__/json_view.test.tsx.snap similarity index 100% rename from x-pack/plugins/siem/public/common/components/event_details/__snapshots__/json_view.test.tsx.snap rename to x-pack/plugins/security_solution/public/common/components/event_details/__snapshots__/json_view.test.tsx.snap diff --git a/x-pack/plugins/siem/public/common/components/event_details/columns.tsx b/x-pack/plugins/security_solution/public/common/components/event_details/columns.tsx similarity index 99% rename from x-pack/plugins/siem/public/common/components/event_details/columns.tsx rename to x-pack/plugins/security_solution/public/common/components/event_details/columns.tsx index 7b6e9fb21a3e3..e01ccf1e544bb 100644 --- a/x-pack/plugins/siem/public/common/components/event_details/columns.tsx +++ b/x-pack/plugins/security_solution/public/common/components/event_details/columns.tsx @@ -147,6 +147,7 @@ export const getColumns = ({ data-test-subj="field-name" fieldId={field} onUpdateColumns={onUpdateColumns} + timelineId={contextId} /> )} diff --git a/x-pack/plugins/siem/public/common/components/event_details/event_details.test.tsx b/x-pack/plugins/security_solution/public/common/components/event_details/event_details.test.tsx similarity index 100% rename from x-pack/plugins/siem/public/common/components/event_details/event_details.test.tsx rename to x-pack/plugins/security_solution/public/common/components/event_details/event_details.test.tsx diff --git a/x-pack/plugins/siem/public/common/components/event_details/event_details.tsx b/x-pack/plugins/security_solution/public/common/components/event_details/event_details.tsx similarity index 100% rename from x-pack/plugins/siem/public/common/components/event_details/event_details.tsx rename to x-pack/plugins/security_solution/public/common/components/event_details/event_details.tsx diff --git a/x-pack/plugins/siem/public/common/components/event_details/event_fields_browser.test.tsx b/x-pack/plugins/security_solution/public/common/components/event_details/event_fields_browser.test.tsx similarity index 100% rename from x-pack/plugins/siem/public/common/components/event_details/event_fields_browser.test.tsx rename to x-pack/plugins/security_solution/public/common/components/event_details/event_fields_browser.test.tsx diff --git a/x-pack/plugins/siem/public/common/components/event_details/event_fields_browser.tsx b/x-pack/plugins/security_solution/public/common/components/event_details/event_fields_browser.tsx similarity index 100% rename from x-pack/plugins/siem/public/common/components/event_details/event_fields_browser.tsx rename to x-pack/plugins/security_solution/public/common/components/event_details/event_fields_browser.tsx diff --git a/x-pack/plugins/siem/public/common/components/event_details/event_id.ts b/x-pack/plugins/security_solution/public/common/components/event_details/event_id.ts similarity index 100% rename from x-pack/plugins/siem/public/common/components/event_details/event_id.ts rename to x-pack/plugins/security_solution/public/common/components/event_details/event_id.ts diff --git a/x-pack/plugins/siem/public/common/components/event_details/helpers.test.tsx b/x-pack/plugins/security_solution/public/common/components/event_details/helpers.test.tsx similarity index 100% rename from x-pack/plugins/siem/public/common/components/event_details/helpers.test.tsx rename to x-pack/plugins/security_solution/public/common/components/event_details/helpers.test.tsx diff --git a/x-pack/plugins/siem/public/common/components/event_details/helpers.tsx b/x-pack/plugins/security_solution/public/common/components/event_details/helpers.tsx similarity index 100% rename from x-pack/plugins/siem/public/common/components/event_details/helpers.tsx rename to x-pack/plugins/security_solution/public/common/components/event_details/helpers.tsx diff --git a/x-pack/plugins/siem/public/common/components/event_details/json_view.test.tsx b/x-pack/plugins/security_solution/public/common/components/event_details/json_view.test.tsx similarity index 100% rename from x-pack/plugins/siem/public/common/components/event_details/json_view.test.tsx rename to x-pack/plugins/security_solution/public/common/components/event_details/json_view.test.tsx diff --git a/x-pack/plugins/siem/public/common/components/event_details/json_view.tsx b/x-pack/plugins/security_solution/public/common/components/event_details/json_view.tsx similarity index 100% rename from x-pack/plugins/siem/public/common/components/event_details/json_view.tsx rename to x-pack/plugins/security_solution/public/common/components/event_details/json_view.tsx diff --git a/x-pack/plugins/siem/public/common/components/event_details/stateful_event_details.tsx b/x-pack/plugins/security_solution/public/common/components/event_details/stateful_event_details.tsx similarity index 100% rename from x-pack/plugins/siem/public/common/components/event_details/stateful_event_details.tsx rename to x-pack/plugins/security_solution/public/common/components/event_details/stateful_event_details.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/event_details/translations.ts b/x-pack/plugins/security_solution/public/common/components/event_details/translations.ts new file mode 100644 index 0000000000000..19e71e0f37da6 --- /dev/null +++ b/x-pack/plugins/security_solution/public/common/components/event_details/translations.ts @@ -0,0 +1,52 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + +import { i18n } from '@kbn/i18n'; + +export const TABLE = i18n.translate('xpack.securitySolution.eventDetails.table', { + defaultMessage: 'Table', +}); + +export const JSON_VIEW = i18n.translate('xpack.securitySolution.eventDetails.jsonView', { + defaultMessage: 'JSON View', +}); + +export const FIELD = i18n.translate('xpack.securitySolution.eventDetails.field', { + defaultMessage: 'Field', +}); + +export const VALUE = i18n.translate('xpack.securitySolution.eventDetails.value', { + defaultMessage: 'Value', +}); + +export const DESCRIPTION = i18n.translate('xpack.securitySolution.eventDetails.description', { + defaultMessage: 'Description', +}); + +export const BLANK = i18n.translate('xpack.securitySolution.eventDetails.blank', { + defaultMessage: ' ', +}); + +export const PLACEHOLDER = i18n.translate( + 'xpack.securitySolution.eventDetails.filter.placeholder', + { + defaultMessage: 'Filter by Field, Value, or Description...', + } +); + +export const COPY_TO_CLIPBOARD = i18n.translate( + 'xpack.securitySolution.eventDetails.copyToClipboard', + { + defaultMessage: 'Copy to Clipboard', + } +); + +export const TOGGLE_COLUMN_TOOLTIP = i18n.translate( + 'xpack.securitySolution.eventDetails.toggleColumnTooltip', + { + defaultMessage: 'Toggle column', + } +); diff --git a/x-pack/plugins/siem/public/common/components/event_details/types.ts b/x-pack/plugins/security_solution/public/common/components/event_details/types.ts similarity index 100% rename from x-pack/plugins/siem/public/common/components/event_details/types.ts rename to x-pack/plugins/security_solution/public/common/components/event_details/types.ts diff --git a/x-pack/plugins/siem/public/common/components/events_viewer/default_headers.tsx b/x-pack/plugins/security_solution/public/common/components/events_viewer/default_headers.tsx similarity index 100% rename from x-pack/plugins/siem/public/common/components/events_viewer/default_headers.tsx rename to x-pack/plugins/security_solution/public/common/components/events_viewer/default_headers.tsx diff --git a/x-pack/plugins/siem/public/common/components/events_viewer/default_model.tsx b/x-pack/plugins/security_solution/public/common/components/events_viewer/default_model.tsx similarity index 100% rename from x-pack/plugins/siem/public/common/components/events_viewer/default_model.tsx rename to x-pack/plugins/security_solution/public/common/components/events_viewer/default_model.tsx diff --git a/x-pack/plugins/siem/public/common/components/events_viewer/event_details_width_context.tsx b/x-pack/plugins/security_solution/public/common/components/events_viewer/event_details_width_context.tsx similarity index 100% rename from x-pack/plugins/siem/public/common/components/events_viewer/event_details_width_context.tsx rename to x-pack/plugins/security_solution/public/common/components/events_viewer/event_details_width_context.tsx diff --git a/x-pack/plugins/siem/public/common/components/events_viewer/events_viewer.test.tsx b/x-pack/plugins/security_solution/public/common/components/events_viewer/events_viewer.test.tsx similarity index 100% rename from x-pack/plugins/siem/public/common/components/events_viewer/events_viewer.test.tsx rename to x-pack/plugins/security_solution/public/common/components/events_viewer/events_viewer.test.tsx diff --git a/x-pack/plugins/siem/public/common/components/events_viewer/events_viewer.tsx b/x-pack/plugins/security_solution/public/common/components/events_viewer/events_viewer.tsx similarity index 69% rename from x-pack/plugins/siem/public/common/components/events_viewer/events_viewer.tsx rename to x-pack/plugins/security_solution/public/common/components/events_viewer/events_viewer.tsx index 9d8a554e6fd63..d0bd87188e541 100644 --- a/x-pack/plugins/siem/public/common/components/events_viewer/events_viewer.tsx +++ b/x-pack/plugins/security_solution/public/common/components/events_viewer/events_viewer.tsx @@ -6,7 +6,7 @@ import { EuiPanel } from '@elastic/eui'; import { getOr, isEmpty, union } from 'lodash/fp'; -import React, { useMemo } from 'react'; +import React, { useEffect, useMemo, useState } from 'react'; import styled from 'styled-components'; import deepEqual from 'fast-deep-equal'; @@ -24,10 +24,6 @@ import { OnChangeItemsPerPage } from '../../../timelines/components/timeline/eve import { Footer, footerHeight } from '../../../timelines/components/timeline/footer'; import { combineQueries } from '../../../timelines/components/timeline/helpers'; import { TimelineRefetch } from '../../../timelines/components/timeline/refetch_timeline'; -import { - ManageTimelineContext, - TimelineTypeContextProps, -} from '../../../timelines/components/timeline/timeline_context'; import { EventDetailsWidthProvider } from './event_details_width_context'; import * as i18n from './translations'; import { @@ -37,6 +33,7 @@ import { Query, } from '../../../../../../../src/plugins/data/public'; import { inputsModel } from '../../store'; +import { useManageTimeline } from '../../../timelines/components/manage_timeline'; const DEFAULT_EVENTS_VIEWER_HEIGHT = 500; @@ -68,7 +65,6 @@ interface Props { query: Query; start: number; sort: Sort; - timelineTypeContext: TimelineTypeContextProps; toggleColumn: (column: ColumnHeaderOptions) => void; utilityBar?: (refetch: inputsModel.Refetch, totalCount: number) => React.ReactNode; } @@ -92,13 +88,31 @@ const EventsViewerComponent: React.FC = ({ query, start, sort, - timelineTypeContext, toggleColumn, utilityBar, }) => { const columnsHeader = isEmpty(columns) ? defaultHeaders : columns; const kibana = useKibana(); const { filterManager } = useKibana().services.data.query; + const [isQueryLoading, setIsQueryLoading] = useState(false); + + const { + getManageTimelineById, + setIsTimelineLoading, + setTimelineFilterManager, + } = useManageTimeline(); + useEffect(() => { + setIsTimelineLoading({ id, isLoading: isQueryLoading }); + }, [isQueryLoading]); + useEffect(() => { + setTimelineFilterManager({ id, filterManager }); + }, [filterManager]); + + const { queryFields, title, unit } = useMemo(() => getManageTimelineById(id), [ + getManageTimelineById, + id, + ]); + const combinedQueries = combineQueries({ config: esQuery.getEsQueryConfig(kibana.services.uiSettings), dataProviders, @@ -111,13 +125,13 @@ const EventsViewerComponent: React.FC = ({ end, isEventViewer: true, }); - const queryFields = useMemo( + const fields = useMemo( () => union( columnsHeader.map((c) => c.id), - timelineTypeContext.queryFields ?? [] + queryFields ?? [] ), - [columnsHeader, timelineTypeContext.queryFields] + [columnsHeader, queryFields] ); const sortField = useMemo( () => ({ @@ -132,7 +146,7 @@ const EventsViewerComponent: React.FC = ({ {combinedQueries != null ? ( = ({ refetch, totalCount = 0, }) => { + setIsQueryLoading(loading); const totalCountMinusDeleted = totalCount > 0 ? totalCount - deletedEventIds.length : 0; - const subtitle = `${i18n.SHOWING}: ${totalCountMinusDeleted.toLocaleString()} ${ - timelineTypeContext.unit?.(totalCountMinusDeleted) ?? - i18n.UNIT(totalCountMinusDeleted) - }`; + const subtitle = `${i18n.SHOWING}: ${totalCountMinusDeleted.toLocaleString()} ${unit( + totalCountMinusDeleted + )}`; return ( <> - + {headerFilterGroup} {utilityBar?.(refetch, totalCountMinusDeleted)} - - - - !deletedEventIds.includes(e._id))} - id={id} - isEventViewer={true} - height={height} - sort={sort} - toggleColumn={toggleColumn} - /> - -