From 0ff0dcd7db722dee149752df0b1fcdb54908eae9 Mon Sep 17 00:00:00 2001 From: Joe Reuter Date: Wed, 13 May 2020 09:19:24 +0200 Subject: [PATCH] Switch to core application service (#63443) --- docs/api/features.asciidoc | 8 +- ...pment-plugin-feature-registration.asciidoc | 4 +- docs/user/dashboard.asciidoc | 2 +- src/core/public/chrome/chrome_service.tsx | 2 +- .../collapsible_nav.test.tsx.snap | 4 + .../chrome/ui/header/collapsible_nav.test.tsx | 1 + .../chrome/ui/header/collapsible_nav.tsx | 16 ++- src/core/public/chrome/ui/header/header.tsx | 2 + .../public/chrome/ui/header/header_logo.tsx | 49 +++++----- .../default_route_provider_config.test.ts | 4 +- src/legacy/core_plugins/kibana/index.js | 44 --------- .../public/__tests__/discover/doc_table.js | 3 + .../public/__tests__/discover/row_headers.js | 3 + .../kibana/public/dev_tools/README.md | 3 - .../core_plugins/kibana/public/index.scss | 3 - .../core_plugins/kibana/public/kibana.js | 10 -- .../local_application_service.ts | 4 +- .../create_index_pattern_wizard.test.tsx.snap | 1 + .../__snapshots__/empty_state.test.tsx.snap | 4 +- .../empty_state/empty_state.test.tsx | 6 +- .../components/empty_state/empty_state.tsx | 13 ++- .../create_index_pattern_wizard.test.tsx | 1 + .../create_index_pattern_wizard.tsx | 9 +- .../create_index_pattern_wizard/index.js | 1 + .../server/lib/__tests__/relationships.js | 24 ++--- .../kibana/server/ui_setting_defaults.js | 2 +- src/legacy/ui/public/_index.scss | 2 - src/legacy/ui/public/autoload/modules.js | 1 - .../ui/public/chrome/api/__tests__/nav.js | 54 ++-------- .../new_platform/new_platform.karma_mock.js | 3 - .../ui/public/new_platform/new_platform.ts | 3 +- .../ui/public/new_platform/set_services.ts | 1 + .../style_compile/__tests__/style_compile.js | 66 ------------- .../ui/public/style_compile/_index.scss | 3 - .../style_compile/style_compile.css.tmpl | 7 -- .../ui/public/style_compile/style_compile.js | 52 ---------- .../ui/public/url/absolute_to_parsed_url.ts | 4 +- src/legacy/ui/public/url/kibana_parsed_url.ts | 8 +- src/legacy/ui/public/url/url.js | 4 +- .../ui/ui_nav_links/__tests__/ui_nav_link.js | 28 +++--- src/plugins/console/public/lib/es/es.ts | 3 + src/plugins/console/public/lib/kb/kb.js | 3 + src/plugins/console/public/plugin.ts | 2 +- .../public/application/application.ts | 16 ++- .../public/application/legacy_app.js | 18 +++- .../public/application/lib/url.test.ts | 12 +-- .../dashboard/public/application/lib/url.ts | 2 +- .../dashboard_listing.test.js.snap | 10 +- .../application/listing/dashboard_listing.js | 8 +- .../dashboard/public/dashboard_constants.ts | 6 +- src/plugins/dashboard/public/plugin.tsx | 98 ++++++++++++++----- .../saved_dashboards/saved_dashboard.ts | 2 +- .../dashboard/public/url_generator.test.ts | 12 +-- src/plugins/dashboard/public/url_generator.ts | 2 +- .../public/url_utils}/url_helper.test.ts | 12 +-- .../public/url_utils}/url_helper.ts | 23 +++-- .../server/saved_objects/dashboard.ts | 2 +- .../field_formats/converters/url.test.ts | 8 +- .../ensure_default_index_pattern.tsx | 29 +++--- .../data/server/saved_objects/query.ts | 2 +- .../data/server/saved_objects/search.ts | 2 +- src/plugins/dev_tools/README.md | 2 +- src/plugins/dev_tools/public/application.tsx | 36 +++++-- src/plugins/dev_tools/public/index.scss | 6 ++ src/plugins/dev_tools/public/plugin.ts | 45 ++++----- .../public/application/_discover.scss | 7 ++ .../public/application/angular/context.html | 1 - .../public/application/angular/context.js | 7 +- .../application/angular/context_app.html | 14 +-- .../public/application/angular/context_app.js | 11 +-- .../public/application/angular/discover.js | 29 +++--- .../public/application/angular/doc.ts | 6 +- .../angular/doc_table/components/table_row.ts | 6 +- .../components/table_row/details.html | 2 +- .../public/application/angular/index.ts | 5 + .../sidebar/discover_field_details.tsx | 7 +- .../sidebar/lib/visualize_url_utils.ts | 26 +++-- .../application/components/sidebar/types.ts | 5 +- .../embeddable/search_embeddable.ts | 14 ++- .../embeddable/search_embeddable_factory.ts | 3 +- .../public/application/helpers/breadcrumbs.ts | 2 +- .../discover/public/get_inner_angular.ts | 5 +- .../discover/public/kibana_services.ts | 6 +- src/plugins/discover/public/plugin.ts | 27 +++-- .../discover/public/register_feature.ts | 2 +- .../public/saved_searches/_saved_search.ts | 2 +- .../public/saved_searches/saved_searches.ts | 2 +- .../public/lib/actions/edit_panel_action.ts | 10 +- .../home/public/application/application.tsx | 12 ++- .../__snapshots__/add_data.test.js.snap | 36 +++---- .../__snapshots__/home.test.js.snap | 22 +++-- .../sample_data_view_data_button.test.js.snap | 6 +- .../public/application/components/add_data.js | 10 +- .../components/app_navigation_handler.ts} | 23 +++-- .../components/feature_directory.js | 2 + .../public/application/components/home.js | 4 +- .../public/application/components/home_app.js | 27 ++--- .../sample_data_view_data_button.js | 12 ++- .../components/tutorial/tutorial.js | 6 +- .../components/tutorial_directory.js | 6 +- .../public/application/components/welcome.tsx | 2 +- .../application/{_index.scss => index.scss} | 0 .../public/application/kibana_services.ts | 6 +- src/plugins/home/public/plugin.ts | 44 +++++++-- .../tutorials/activemq_metrics/index.ts | 2 +- .../tutorials/aerospike_metrics/index.ts | 2 +- .../server/tutorials/azure_metrics/index.ts | 2 +- .../server/tutorials/ceph_metrics/index.ts | 2 +- .../server/tutorials/coredns_metrics/index.ts | 2 +- .../tutorials/couchbase_metrics/index.ts | 2 +- .../tutorials/dropwizard_metrics/index.ts | 2 +- .../tutorials/elasticsearch_logs/index.ts | 2 +- .../tutorials/elasticsearch_metrics/index.ts | 2 +- .../server/tutorials/etcd_metrics/index.ts | 2 +- .../server/tutorials/haproxy_metrics/index.ts | 2 +- .../server/tutorials/ibmmq_metrics/index.ts | 2 +- .../server/tutorials/kafka_metrics/index.ts | 2 +- .../server/tutorials/kibana_metrics/index.ts | 2 +- .../tutorials/logstash_metrics/index.ts | 2 +- .../tutorials/memcached_metrics/index.ts | 2 +- .../server/tutorials/munin_metrics/index.ts | 2 +- .../tutorials/prometheus_metrics/index.ts | 2 +- .../redisenterprise_metrics/index.ts | 2 +- .../server/tutorials/vsphere_metrics/index.ts | 2 +- .../server/tutorials/windows_metrics/index.ts | 2 +- .../tutorials/zookeeper_metrics/index.ts | 2 +- .../__snapshots__/controls_tab.test.tsx.snap | 8 +- .../public/control/list_control_factory.ts | 11 ++- .../input_control_vis/public/plugin.ts | 19 +++- .../public/test_utils/get_deps_mock.tsx | 18 ++-- src/plugins/input_control_vis/server/index.ts | 29 +++++- .../public/angular/angular_config.tsx | 18 +++- .../public/forward_app/forward_app.ts | 52 ++++++++++ .../public/forward_app/index.ts} | 2 +- .../navigate_to_legacy_kibana_url.test.ts | 69 +++++++++++++ .../navigate_to_legacy_kibana_url.ts | 48 +++++++++ src/plugins/kibana_legacy/public/mocks.ts | 1 + .../public/navigate_to_default_app.ts | 55 +++++++++++ .../notify/app_redirect/app_redirect.test.ts | 63 ------------ .../notify/app_redirect/app_redirect.ts | 47 --------- .../kibana_legacy/public/notify/index.ts | 1 - src/plugins/kibana_legacy/public/plugin.ts | 53 ++++++++-- .../index.ts => utils/inject_header_style.ts} | 23 ++++- .../exit_full_screen_button.tsx | 2 + .../{_index.scss => index.scss} | 0 .../public/history/redirect_when_missing.tsx | 55 +++++++++-- .../url/hash_unhash_url.test.ts | 40 ++++---- .../url/kbn_url_tracker.test.ts | 71 ++++++-------- .../state_management/url/kbn_url_tracker.ts | 21 ++-- .../public/legacy/redirect_messages.tsx | 67 +++++++++++++ src/plugins/management/public/plugin.ts | 2 + .../saved_object_save_modal_origin.tsx | 2 +- .../saved_objects_table.test.tsx.snap | 2 +- .../__snapshots__/relationships.test.tsx.snap | 10 +- .../components/relationships.test.tsx | 12 +-- .../saved_objects_table.test.tsx | 2 +- .../share/public/lib/url_shortener.test.ts | 4 +- .../saved_objects/kibana_app_migration.ts | 38 +++++++ src/plugins/share/server/saved_objects/url.ts | 7 +- src/plugins/telemetry/public/plugin.ts | 14 ++- .../public/components/controls/raw_json.tsx | 2 + .../components/sidebar/sidebar_title.tsx | 12 ++- .../public/get_inner_angular.ts | 2 - .../helpers/timelion_request_handler.ts | 2 +- .../create_vis_embeddable_from_object.ts | 4 +- .../public/embeddable/visualize_embeddable.ts | 7 +- .../visualize_embeddable_factory.tsx | 1 + src/plugins/visualizations/public/plugin.ts | 2 + .../public/saved_visualizations/_saved_vis.ts | 2 +- .../saved_visualizations.ts | 4 +- src/plugins/visualizations/public/services.ts | 3 + .../vis_types/vis_type_alias_registry.ts | 4 +- .../__snapshots__/new_vis_modal.test.tsx.snap | 2 + .../public/wizard/new_vis_modal.test.tsx | 36 ++++--- .../public/wizard/new_vis_modal.tsx | 23 +++-- .../public/wizard/show_new_vis.tsx | 18 +++- .../type_selection/new_vis_help.test.tsx | 3 +- .../wizard/type_selection/type_selection.tsx | 8 +- .../server/saved_objects/visualization.ts | 2 +- src/plugins/visualize/kibana.json | 3 +- .../visualize/public/application/_app.scss | 5 + .../public/application/application.ts | 13 ++- .../public/application/editor/editor.js | 18 ++-- .../public/application/editor/lib/index.ts | 2 +- .../visualize/public/application/index.scss | 1 + .../public/application/legacy_app.js | 33 +++++-- .../listing/visualize_listing.html | 2 +- .../application/listing/visualize_listing.js | 38 ++++++- .../listing/visualize_listing_table.js | 13 +-- .../public/application/visualize_constants.ts | 10 +- .../visualize/public/kibana_services.ts | 6 +- src/plugins/visualize/public/plugin.ts | 34 +++++-- test/accessibility/apps/dashboard.ts | 4 +- test/accessibility/apps/dashboard_panel.ts | 4 +- test/accessibility/apps/home.ts | 4 +- test/accessibility/apps/visualize.ts | 2 + .../apis/saved_objects_management/find.ts | 10 +- .../saved_objects_management/relationships.ts | 24 ++--- test/api_integration/apis/shorten/index.js | 6 +- .../apps/dashboard/bwc_shared_urls.js | 17 ++-- .../apps/dashboard/dashboard_snapshots.js | 2 - .../apps/dashboard/dashboard_state.js | 1 + .../apps/dashboard/dashboard_time.js | 4 +- .../apps/dashboard/dashboard_time_picker.js | 7 +- .../functional/apps/discover/_shared_links.js | 8 +- test/functional/apps/home/_add_data.js | 2 +- test/functional/apps/home/_home.js | 7 +- test/functional/apps/home/_navigation.ts | 38 ------- test/functional/apps/home/_newsfeed.ts | 3 +- test/functional/apps/home/_sample_data.ts | 12 ++- .../apps/management/_kibana_settings.js | 2 +- test/functional/apps/visualize/_area_chart.js | 8 +- test/functional/apps/visualize/_lab_mode.js | 2 +- test/functional/config.js | 22 ++--- test/functional/page_objects/common_page.ts | 4 +- .../functional/page_objects/dashboard_page.ts | 2 +- test/functional/page_objects/newsfeed_page.ts | 2 +- .../page_objects/visual_builder_page.ts | 4 +- .../functional/page_objects/visualize_page.ts | 2 +- test/functional/services/apps_menu.ts | 30 +++++- test/ui_capabilities/newsfeed_err/test.ts | 3 +- vars/agentInfo.groovy | 2 +- .../drilldown.tsx | 6 +- x-pack/legacy/plugins/dashboard_mode/index.js | 37 +------ .../dashboard_mode/public/dashboard_viewer.js | 66 ------------- .../dashboard_mode_request_interceptor.js | 71 +++++++++----- .../dashboard_mode_request_interceptor.js | 28 ++++-- .../ServiceOverview.test.tsx.snap | 2 +- .../Links/DiscoverLinks/DiscoverLink.tsx | 4 +- .../DiscoverLinks.integration.test.tsx | 8 +- .../shared/Links/SetupInstructionsLink.tsx | 9 +- .../__test__/sections.test.ts | 6 +- .../renderers/embeddable/embeddable.tsx | 2 +- .../workpad_loader/workpad_loader.js | 2 +- .../drilldown.test.tsx | 4 +- .../drilldown.tsx | 9 +- x-pack/plugins/dashboard_mode/kibana.json | 13 +++ .../public}/index.ts | 3 +- .../plugins/dashboard_mode/public/plugin.ts | 68 +++++++++++++ x-pack/plugins/dashboard_mode/server/index.ts | 20 ++++ .../__snapshots__/oss_features.test.ts.snap | 17 +++- .../plugins/features/server/oss_features.ts | 36 +++---- x-pack/plugins/graph/public/application.ts | 10 +- .../guidance_panel/guidance_panel.tsx | 4 +- .../graph/public/components/listing.tsx | 2 +- x-pack/plugins/graph/public/plugin.ts | 3 + .../public/state_management/url_templates.ts | 4 +- .../graph/server/sample_data/ecommerce.ts | 2 +- .../graph/server/sample_data/flights.ts | 2 +- .../plugins/graph/server/sample_data/logs.ts | 2 +- .../grokdebugger/public/register_feature.ts | 2 +- .../logs/stream/page_no_indices_content.tsx | 4 +- .../pages/metrics/inventory_view/index.tsx | 4 +- .../metric_detail/components/invalid_node.tsx | 4 +- .../helpers/create_tsvb_link.test.ts | 32 +++--- .../components/helpers/create_tsvb_link.ts | 4 +- x-pack/plugins/lens/common/constants.ts | 5 +- x-pack/plugins/lens/kibana.json | 3 +- .../plugins/lens/public/app_plugin/_app.scss | 6 ++ .../lens/public/app_plugin/app.test.tsx | 4 +- x-pack/plugins/lens/public/app_plugin/app.tsx | 6 +- .../lens/public/app_plugin/mounter.tsx | 55 ++++------- .../embeddable/embeddable.test.tsx | 5 + .../embeddable/embeddable.tsx | 5 +- .../embeddable/embeddable_factory.ts | 3 +- .../lens/public/helpers/is_rison_object.ts | 12 --- .../lens/public/helpers/url_helper.test.ts | 49 ---------- .../plugins/lens/public/helpers/url_helper.ts | 47 --------- x-pack/plugins/lens/public/plugin.ts | 8 +- x-pack/plugins/lens/public/vis_type_alias.ts | 4 +- x-pack/plugins/lens/server/saved_objects.ts | 2 +- .../components/no_index_pattern_callout.js | 2 +- .../maps/public/maps_vis_type_alias.js | 5 +- .../components/anomalies_table/links_menu.js | 2 +- .../results_links/results_links.tsx | 2 +- .../__snapshots__/list.test.tsx.snap | 4 +- .../custom_url_editor/editor.test.tsx | 4 +- .../custom_url_editor/list.test.tsx | 4 +- .../components/custom_url_editor/utils.js | 4 +- .../application/util/custom_url_utils.test.ts | 40 ++++---- .../application/util/custom_url_utils.ts | 4 +- .../public/application/util/url_utils.test.ts | 4 +- .../apache_ecs/ml/low_request_rate_ecs.json | 2 +- .../ml/source_ip_request_rate_ecs.json | 4 +- .../ml/source_ip_url_count_ecs.json | 4 +- .../apache_ecs/ml/status_code_rate_ecs.json | 4 +- .../apache_ecs/ml/visitor_rate_ecs.json | 2 +- .../docker_high_count_process_events_ecs.json | 4 +- .../ml/docker_rare_process_activity_ecs.json | 4 +- .../hosts_high_count_process_events_ecs.json | 4 +- .../ml/hosts_rare_process_activity_ecs.json | 4 +- .../ml/high_mean_cpu_iowait_ecs.json | 4 +- .../ml/max_disk_utilization_ecs.json | 4 +- .../ml/metricbeat_outages_ecs.json | 2 +- .../nginx_ecs/ml/low_request_rate_ecs.json | 2 +- .../ml/source_ip_request_rate_ecs.json | 4 +- .../nginx_ecs/ml/source_ip_url_count_ecs.json | 4 +- .../nginx_ecs/ml/status_code_rate_ecs.json | 4 +- .../nginx_ecs/ml/visitor_rate_ecs.json | 2 +- .../ml/high_sum_total_sales.json | 4 +- .../ml/low_request_rate.json | 4 +- .../ml/response_code_rates.json | 4 +- .../sample_data_weblogs/ml/url_scanning.json | 4 +- x-pack/plugins/painless_lab/public/plugin.tsx | 2 +- .../public/components/report_listing.test.tsx | 2 +- .../plugins/searchprofiler/public/plugin.ts | 2 +- .../components/login_form/login_form.test.tsx | 4 +- .../roles/__fixtures__/kibana_features.ts | 2 +- .../public/components/header_global/index.tsx | 2 +- .../detection_engine_empty_page.tsx | 2 +- .../public/pages/hosts/hosts_empty_page.tsx | 2 +- .../pages/network/network_empty_page.tsx | 2 +- .../pages/overview/overview_empty/index.tsx | 2 +- .../siem/public/pages/overview/summary.tsx | 2 +- .../translations/translations/ja-JP.json | 11 +-- .../translations/translations/zh-CN.json | 11 +-- .../__fixtures__/checkup_api_response.json | 8 +- .../__snapshots__/checkup_tab.test.tsx.snap | 12 +-- .../data_or_index_missing.test.tsx.snap | 2 +- .../__snapshots__/empty_state.test.tsx.snap | 12 +-- .../empty_state/data_or_index_missing.tsx | 2 +- x-pack/test/accessibility/apps/home.ts | 7 ++ .../apps/dashboard/_async_dashboard.ts | 8 +- .../feature_controls/dashboard_security.ts | 89 ++++++++++------- .../feature_controls/dashboard_spaces.ts | 50 ++++++---- .../feature_controls/dev_tools_security.ts | 21 ++-- .../feature_controls/dev_tools_spaces.ts | 23 +++-- .../feature_controls/discover_security.ts | 12 ++- .../feature_controls/discover_spaces.ts | 10 +- .../test/functional/apps/maps/sample_data.js | 24 +++-- .../report_delete_pagination.ts | 2 +- .../saved_objects_management_security.ts | 4 +- .../apps/spaces/spaces_selection.ts | 2 +- .../feature_controls/visualize_security.ts | 23 ++--- .../feature_controls/visualize_spaces.ts | 22 ++--- .../functional/apps/visualize/reporting.ts | 2 +- x-pack/test/functional/config.js | 8 +- .../test/functional/page_objects/lens_page.ts | 1 + .../page_objects/space_selector_page.ts | 2 +- 339 files changed, 2239 insertions(+), 1706 deletions(-) delete mode 100644 src/legacy/core_plugins/kibana/public/dev_tools/README.md delete mode 100644 src/legacy/ui/public/style_compile/__tests__/style_compile.js delete mode 100644 src/legacy/ui/public/style_compile/_index.scss delete mode 100644 src/legacy/ui/public/style_compile/style_compile.css.tmpl delete mode 100644 src/legacy/ui/public/style_compile/style_compile.js rename src/plugins/{visualize/public/application/editor/lib => dashboard/public/url_utils}/url_helper.test.ts (53%) rename src/plugins/{visualize/public/application/editor/lib => dashboard/public/url_utils}/url_helper.ts (56%) rename src/{legacy/core_plugins/kibana/public/dev_tools/index.ts => plugins/home/public/application/components/app_navigation_handler.ts} (63%) rename src/plugins/home/public/application/{_index.scss => index.scss} (100%) create mode 100644 src/plugins/kibana_legacy/public/forward_app/forward_app.ts rename src/{legacy/ui/public/style_compile/index.js => plugins/kibana_legacy/public/forward_app/index.ts} (96%) create mode 100644 src/plugins/kibana_legacy/public/forward_app/navigate_to_legacy_kibana_url.test.ts create mode 100644 src/plugins/kibana_legacy/public/forward_app/navigate_to_legacy_kibana_url.ts create mode 100644 src/plugins/kibana_legacy/public/navigate_to_default_app.ts delete mode 100644 src/plugins/kibana_legacy/public/notify/app_redirect/app_redirect.test.ts delete mode 100644 src/plugins/kibana_legacy/public/notify/app_redirect/app_redirect.ts rename src/plugins/kibana_legacy/public/{notify/app_redirect/index.ts => utils/inject_header_style.ts} (52%) rename src/plugins/kibana_react/public/exit_full_screen_button/{_index.scss => index.scss} (100%) create mode 100644 src/plugins/management/public/legacy/redirect_messages.tsx create mode 100644 src/plugins/share/server/saved_objects/kibana_app_migration.ts create mode 100644 src/plugins/visualize/public/application/_app.scss delete mode 100644 x-pack/legacy/plugins/dashboard_mode/public/dashboard_viewer.js create mode 100644 x-pack/plugins/dashboard_mode/kibana.json rename x-pack/plugins/{lens/public/helpers => dashboard_mode/public}/index.ts (66%) create mode 100644 x-pack/plugins/dashboard_mode/public/plugin.ts create mode 100644 x-pack/plugins/dashboard_mode/server/index.ts delete mode 100644 x-pack/plugins/lens/public/helpers/is_rison_object.ts delete mode 100644 x-pack/plugins/lens/public/helpers/url_helper.test.ts delete mode 100644 x-pack/plugins/lens/public/helpers/url_helper.ts diff --git a/docs/api/features.asciidoc b/docs/api/features.asciidoc index da8b0edfe2261..57a87ff6342f9 100644 --- a/docs/api/features.asciidoc +++ b/docs/api/features.asciidoc @@ -29,7 +29,7 @@ The API returns the following: "id": "discover", "name": "Discover", "icon": "discoverApp", - "navLinkId": "kibana:discover", + "navLinkId": "discover", "app": [ "kibana" ], @@ -74,7 +74,7 @@ The API returns the following: "id": "visualize", "name": "Visualize", "icon": "visualizeApp", - "navLinkId": "kibana:visualize", + "navLinkId": "visualize", "app": [ "kibana" ], @@ -121,7 +121,7 @@ The API returns the following: "id": "dashboard", "name": "Dashboard", "icon": "dashboardApp", - "navLinkId": "kibana:dashboard", + "navLinkId": "dashboards", "app": [ "kibana" ], @@ -173,7 +173,7 @@ The API returns the following: "id": "dev_tools", "name": "Dev Tools", "icon": "devToolsApp", - "navLinkId": "kibana:dev_tools", + "navLinkId": "dev_tools", "app": [ "kibana" ], diff --git a/docs/developer/plugin/development-plugin-feature-registration.asciidoc b/docs/developer/plugin/development-plugin-feature-registration.asciidoc index 4702204196bf2..d594a6d4255b2 100644 --- a/docs/developer/plugin/development-plugin-feature-registration.asciidoc +++ b/docs/developer/plugin/development-plugin-feature-registration.asciidoc @@ -153,7 +153,7 @@ init(server) { defaultMessage: 'Dev Tools', }), icon: 'devToolsApp', - navLinkId: 'kibana:dev_tools', + navLinkId: 'dev_tools', app: ['kibana'], catalogue: ['console', 'searchprofiler', 'grokdebugger'], privileges: { @@ -216,7 +216,7 @@ init(server) { }), order: 100, icon: 'discoverApp', - navLinkId: 'kibana:discover', + navLinkId: 'discover', app: ['kibana'], catalogue: ['discover'], privileges: { diff --git a/docs/user/dashboard.asciidoc b/docs/user/dashboard.asciidoc index de714ae40086b..301efb2dfe2c0 100644 --- a/docs/user/dashboard.asciidoc +++ b/docs/user/dashboard.asciidoc @@ -174,7 +174,7 @@ to view an embedded dashboard. * Generate a PNG report TIP: To create a link to a dashboard by title, use: + -`${domain}/${basepath?}/app/kibana#/dashboards?title=${yourdashboardtitle}` +`${domain}/${basepath?}/app/dashboards#/list?title=${yourdashboardtitle}` TIP: When sharing a link to a dashboard snapshot, use the *Short URL*. Snapshot URLs are long and can be problematic for Internet Explorer and other diff --git a/src/core/public/chrome/chrome_service.tsx b/src/core/public/chrome/chrome_service.tsx index 3fc22caaefb04..bf1a764e85882 100644 --- a/src/core/public/chrome/chrome_service.tsx +++ b/src/core/public/chrome/chrome_service.tsx @@ -192,7 +192,7 @@ export class ChromeService { forceAppSwitcherNavigation$={navLinks.getForceAppSwitcherNavigation$()} helpExtension$={helpExtension$.pipe(takeUntil(this.stop$))} helpSupportUrl$={helpSupportUrl$.pipe(takeUntil(this.stop$))} - homeHref={http.basePath.prepend('/app/kibana#/home')} + homeHref={http.basePath.prepend('/app/home')} isVisible$={this.isVisible$} kibanaVersion={injectedMetadata.getKibanaVersion()} legacyMode={injectedMetadata.getLegacyMode()} diff --git a/src/core/public/chrome/ui/header/__snapshots__/collapsible_nav.test.tsx.snap b/src/core/public/chrome/ui/header/__snapshots__/collapsible_nav.test.tsx.snap index 14d5b2e8fdcbb..ed97db020035e 100644 --- a/src/core/public/chrome/ui/header/__snapshots__/collapsible_nav.test.tsx.snap +++ b/src/core/public/chrome/ui/header/__snapshots__/collapsible_nav.test.tsx.snap @@ -116,6 +116,7 @@ exports[`CollapsibleNav renders links grouped by category 1`] = ` }, ] } + navigateToApp={[Function]} onIsLockedUpdate={[Function]} onIsOpenUpdate={[Function]} recentNavLinks={ @@ -2993,6 +2994,7 @@ exports[`CollapsibleNav renders the default nav 1`] = ` isLocked={false} isOpen={false} navLinks={Array []} + navigateToApp={[Function]} onIsLockedUpdate={[Function]} onIsOpenUpdate={[Function]} recentNavLinks={Array []} @@ -3023,6 +3025,7 @@ exports[`CollapsibleNav renders the default nav 2`] = ` isLocked={false} isOpen={true} navLinks={Array []} + navigateToApp={[Function]} onIsLockedUpdate={[Function]} onIsOpenUpdate={[Function]} recentNavLinks={Array []} @@ -3589,6 +3592,7 @@ exports[`CollapsibleNav renders the default nav 3`] = ` isLocked={true} isOpen={true} navLinks={Array []} + navigateToApp={[Function]} onIsLockedUpdate={[Function]} onIsOpenUpdate={[Function]} recentNavLinks={Array []} diff --git a/src/core/public/chrome/ui/header/collapsible_nav.test.tsx b/src/core/public/chrome/ui/header/collapsible_nav.test.tsx index 4a9d3071b93be..0917f47ebe9b1 100644 --- a/src/core/public/chrome/ui/header/collapsible_nav.test.tsx +++ b/src/core/public/chrome/ui/header/collapsible_nav.test.tsx @@ -63,6 +63,7 @@ function mockProps() { storage: new StubBrowserStorage(), onIsOpenUpdate: () => {}, onIsLockedUpdate: () => {}, + navigateToApp: () => {}, }; } diff --git a/src/core/public/chrome/ui/header/collapsible_nav.tsx b/src/core/public/chrome/ui/header/collapsible_nav.tsx index 274195f1917a5..9adcc19b0f0e7 100644 --- a/src/core/public/chrome/ui/header/collapsible_nav.tsx +++ b/src/core/public/chrome/ui/header/collapsible_nav.tsx @@ -78,6 +78,7 @@ interface Props { storage?: Storage; onIsLockedUpdate: OnIsLockedUpdate; onIsOpenUpdate: (isOpen?: boolean) => void; + navigateToApp: (appId: string) => void; } export function CollapsibleNav({ @@ -89,6 +90,7 @@ export function CollapsibleNav({ onIsOpenUpdate, homeHref, id, + navigateToApp, storage = window.localStorage, }: Props) { const lockRef = useRef(null); @@ -124,7 +126,19 @@ export function CollapsibleNav({ label: 'Home', iconType: 'home', href: homeHref, - onClick: () => onIsOpenUpdate(false), + onClick: (event: React.MouseEvent) => { + onIsOpenUpdate(false); + if ( + event.isDefaultPrevented() || + event.altKey || + event.metaKey || + event.ctrlKey + ) { + return; + } + event.preventDefault(); + navigateToApp('home'); + }, }, ]} maxWidth="none" diff --git a/src/core/public/chrome/ui/header/header.tsx b/src/core/public/chrome/ui/header/header.tsx index fb94ef46cdc2c..09bc3972e0e40 100644 --- a/src/core/public/chrome/ui/header/header.tsx +++ b/src/core/public/chrome/ui/header/header.tsx @@ -247,6 +247,7 @@ export class Header extends Component { href={this.props.homeHref} forceNavigation={this.state.forceNavigation} navLinks={navLinks} + navigateToApp={this.props.application.navigateToApp} /> @@ -287,6 +288,7 @@ export class Header extends Component { this.toggleCollapsibleNavRef.current.focus(); } }} + navigateToApp={this.props.application.navigateToApp} /> ) : ( // TODO #64541 diff --git a/src/core/public/chrome/ui/header/header_logo.tsx b/src/core/public/chrome/ui/header/header_logo.tsx index 960ec637178e1..4296064945455 100644 --- a/src/core/public/chrome/ui/header/header_logo.tsx +++ b/src/core/public/chrome/ui/header/header_logo.tsx @@ -41,7 +41,8 @@ function findClosestAnchor(element: HTMLElement): HTMLAnchorElement | void { function onClick( event: React.MouseEvent, forceNavigation: boolean, - navLinks: NavLink[] + navLinks: NavLink[], + navigateToApp: (appId: string) => void ) { const anchor = findClosestAnchor((event as any).nativeEvent.target); if (!anchor) { @@ -54,32 +55,31 @@ function onClick( return; } - if ( - !forceNavigation || - event.isDefaultPrevented() || - event.altKey || - event.metaKey || - event.ctrlKey - ) { + if (event.isDefaultPrevented() || event.altKey || event.metaKey || event.ctrlKey) { return; } - const toParsed = Url.parse(anchor.href); - const fromParsed = Url.parse(document.location.href); - const sameProto = toParsed.protocol === fromParsed.protocol; - const sameHost = toParsed.host === fromParsed.host; - const samePath = toParsed.path === fromParsed.path; + if (forceNavigation) { + const toParsed = Url.parse(anchor.href); + const fromParsed = Url.parse(document.location.href); + const sameProto = toParsed.protocol === fromParsed.protocol; + const sameHost = toParsed.host === fromParsed.host; + const samePath = toParsed.path === fromParsed.path; - if (sameProto && sameHost && samePath) { - if (toParsed.hash) { - document.location.reload(); - } + if (sameProto && sameHost && samePath) { + if (toParsed.hash) { + document.location.reload(); + } - // event.preventDefault() keeps the browser from seeing the new url as an update - // and even setting window.location does not mimic that behavior, so instead - // we use stopPropagation() to prevent angular from seeing the click and - // starting a digest cycle/attempting to handle it in the router. - event.stopPropagation(); + // event.preventDefault() keeps the browser from seeing the new url as an update + // and even setting window.location does not mimic that behavior, so instead + // we use stopPropagation() to prevent angular from seeing the click and + // starting a digest cycle/attempting to handle it in the router. + event.stopPropagation(); + } + } else { + navigateToApp('home'); + event.preventDefault(); } } @@ -87,14 +87,15 @@ interface Props { href: string; navLinks: NavLink[]; forceNavigation: boolean; + navigateToApp: (appId: string) => void; } -export function HeaderLogo({ href, forceNavigation, navLinks }: Props) { +export function HeaderLogo({ href, forceNavigation, navLinks, navigateToApp }: Props) { return ( onClick(e, forceNavigation, navLinks)} + onClick={e => onClick(e, forceNavigation, navLinks, navigateToApp)} href={href} aria-label={i18n.translate('core.ui.chrome.headerGlobalNav.goHomePageIconAriaLabel', { defaultMessage: 'Go to home page', diff --git a/src/core/server/core_app/integration_tests/default_route_provider_config.test.ts b/src/core/server/core_app/integration_tests/default_route_provider_config.test.ts index 221e6fa42471c..2c7efe075152b 100644 --- a/src/core/server/core_app/integration_tests/default_route_provider_config.test.ts +++ b/src/core/server/core_app/integration_tests/default_route_provider_config.test.ts @@ -49,7 +49,7 @@ describe('default route provider', () => { expect(status).toEqual(302); expect(header).toMatchObject({ - location: '/hello/app/kibana', + location: '/hello/app/home', }); }); @@ -71,7 +71,7 @@ describe('default route provider', () => { const { status, header } = await kbnTestServer.request.get(root, '/'); expect(status).toEqual(302); expect(header).toMatchObject({ - location: '/hello/app/kibana', + location: '/hello/app/home', }); }); diff --git a/src/legacy/core_plugins/kibana/index.js b/src/legacy/core_plugins/kibana/index.js index 3a796b3ba520c..5807c439bd277 100644 --- a/src/legacy/core_plugins/kibana/index.js +++ b/src/legacy/core_plugins/kibana/index.js @@ -52,7 +52,6 @@ export default function(kibana) { }, uiExports: { - hacks: ['plugins/kibana/dev_tools'], app: { id: 'kibana', title: 'Kibana', @@ -61,49 +60,6 @@ export default function(kibana) { }, styleSheetPaths: resolve(__dirname, 'public/index.scss'), links: [ - { - id: 'kibana:discover', - title: i18n.translate('kbn.discoverTitle', { - defaultMessage: 'Discover', - }), - order: 2000, - url: `${kbnBaseUrl}#/discover`, - euiIconType: 'discoverApp', - disableSubUrlTracking: true, - category: DEFAULT_APP_CATEGORIES.kibana, - }, - { - id: 'kibana:visualize', - title: i18n.translate('kbn.visualizeTitle', { - defaultMessage: 'Visualize', - }), - order: 7000, - url: `${kbnBaseUrl}#/visualize`, - euiIconType: 'visualizeApp', - disableSubUrlTracking: true, - category: DEFAULT_APP_CATEGORIES.kibana, - }, - { - id: 'kibana:dashboard', - title: i18n.translate('kbn.dashboardTitle', { - defaultMessage: 'Dashboard', - }), - order: 1000, - url: `${kbnBaseUrl}#/dashboards`, - euiIconType: 'dashboardApp', - disableSubUrlTracking: true, - category: DEFAULT_APP_CATEGORIES.kibana, - }, - { - id: 'kibana:dev_tools', - title: i18n.translate('kbn.devToolsTitle', { - defaultMessage: 'Dev Tools', - }), - order: 9001, - url: '/app/kibana#/dev_tools', - euiIconType: 'devToolsApp', - category: DEFAULT_APP_CATEGORIES.management, - }, { id: 'kibana:stack_management', title: i18n.translate('kbn.managementTitle', { diff --git a/src/legacy/core_plugins/kibana/public/__tests__/discover/doc_table.js b/src/legacy/core_plugins/kibana/public/__tests__/discover/doc_table.js index edf65fdb56220..e4ad8a5638fd1 100644 --- a/src/legacy/core_plugins/kibana/public/__tests__/discover/doc_table.js +++ b/src/legacy/core_plugins/kibana/public/__tests__/discover/doc_table.js @@ -24,6 +24,8 @@ import 'ui/private'; import { pluginInstance } from './legacy'; import FixturesStubbedLogstashIndexPatternProvider from 'fixtures/stubbed_logstash_index_pattern'; import hits from 'fixtures/real_hits'; +import { setScopedHistory } from '../../../../../../plugins/discover/public/kibana_services'; +import { createBrowserHistory } from 'history'; let $parentScope; @@ -58,6 +60,7 @@ const destroy = function() { describe('docTable', function() { let $elem; + before(() => setScopedHistory(createBrowserHistory())); beforeEach(() => pluginInstance.initializeInnerAngular()); beforeEach(() => pluginInstance.initializeServices()); beforeEach(ngMock.module('app/discover')); diff --git a/src/legacy/core_plugins/kibana/public/__tests__/discover/row_headers.js b/src/legacy/core_plugins/kibana/public/__tests__/discover/row_headers.js index 5450a4127b63c..2a34ace8f1312 100644 --- a/src/legacy/core_plugins/kibana/public/__tests__/discover/row_headers.js +++ b/src/legacy/core_plugins/kibana/public/__tests__/discover/row_headers.js @@ -25,6 +25,8 @@ import { getFakeRow, getFakeRowVals } from 'fixtures/fake_row'; import $ from 'jquery'; import { pluginInstance } from './legacy'; import FixturesStubbedLogstashIndexPatternProvider from 'fixtures/stubbed_logstash_index_pattern'; +import { setScopedHistory } from '../../../../../../plugins/discover/public/kibana_services'; +import { createBrowserHistory } from 'history'; describe('Doc Table', function() { let $parentScope; @@ -37,6 +39,7 @@ describe('Doc Table', function() { let stubFieldFormatConverter; beforeEach(() => pluginInstance.initializeServices()); beforeEach(() => pluginInstance.initializeInnerAngular()); + before(() => setScopedHistory(createBrowserHistory())); beforeEach(ngMock.module('app/discover')); beforeEach( ngMock.inject(function($rootScope, Private) { diff --git a/src/legacy/core_plugins/kibana/public/dev_tools/README.md b/src/legacy/core_plugins/kibana/public/dev_tools/README.md deleted file mode 100644 index 199ddcc754d04..0000000000000 --- a/src/legacy/core_plugins/kibana/public/dev_tools/README.md +++ /dev/null @@ -1,3 +0,0 @@ -This folder is just a left-over of the things that can't be moved to Kibana platform just yet: - -* Check whether there are no dev tools and hide the link in the nav bar (this can be moved as soon as all dev tools are moved) \ No newline at end of file diff --git a/src/legacy/core_plugins/kibana/public/index.scss b/src/legacy/core_plugins/kibana/public/index.scss index 6a2e65e3a9ff5..56a2543dbca78 100644 --- a/src/legacy/core_plugins/kibana/public/index.scss +++ b/src/legacy/core_plugins/kibana/public/index.scss @@ -11,9 +11,6 @@ // bad cascading in the Editor layout @import '../../../../plugins/maps_legacy/public/index'; -// Home styles -@import '../../../../plugins/home/public/application/index'; - // Management styles @import './management/index'; diff --git a/src/legacy/core_plugins/kibana/public/kibana.js b/src/legacy/core_plugins/kibana/public/kibana.js index 4e97d46ab1773..0bf74edc77cb6 100644 --- a/src/legacy/core_plugins/kibana/public/kibana.js +++ b/src/legacy/core_plugins/kibana/public/kibana.js @@ -21,19 +21,15 @@ // preloading (for faster webpack builds) import routes from 'ui/routes'; -import { uiModules } from 'ui/modules'; import { npSetup } from 'ui/new_platform'; // import the uiExports that we want to "use" -import 'uiExports/home'; -import 'uiExports/visualize'; import 'uiExports/savedObjectTypes'; import 'uiExports/fieldFormatEditors'; import 'uiExports/navbarExtensions'; import 'uiExports/contextMenuActions'; import 'uiExports/managementSections'; import 'uiExports/indexManagement'; -import 'uiExports/docViews'; import 'uiExports/embeddableFactories'; import 'uiExports/embeddableActions'; import 'uiExports/inspectorViews'; @@ -43,8 +39,6 @@ import 'uiExports/interpreter'; import 'ui/autoload/all'; import './management'; -import './dev_tools'; -import { showAppRedirectNotification } from '../../../../plugins/kibana_legacy/public'; import { localApplicationService } from './local_application_service'; npSetup.plugins.kibanaLegacy.registerLegacyAppAlias('doc', 'discover', { keepPrefix: true }); @@ -58,7 +52,3 @@ const { config } = npSetup.plugins.kibanaLegacy; routes.otherwise({ redirectTo: `/${config.defaultAppId || 'discover'}`, }); - -uiModules - .get('kibana') - .run($location => showAppRedirectNotification($location, npSetup.core.notifications.toasts)); diff --git a/src/legacy/core_plugins/kibana/public/local_application_service/local_application_service.ts b/src/legacy/core_plugins/kibana/public/local_application_service/local_application_service.ts index f38c410e6832f..44a3507e57aa5 100644 --- a/src/legacy/core_plugins/kibana/public/local_application_service/local_application_service.ts +++ b/src/legacy/core_plugins/kibana/public/local_application_service/local_application_service.ts @@ -106,7 +106,9 @@ export class LocalApplicationService { template: '', controller($location: ILocationService) { const newPath = forwardDefinition.rewritePath($location.url()); - npStart.core.application.navigateToApp(forwardDefinition.newAppId, { path: newPath }); + window.location.replace( + npStart.core.http.basePath.prepend(`/app/${forwardDefinition.newAppId}${newPath}`) + ); }, }); }); diff --git a/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/create_index_pattern_wizard/__snapshots__/create_index_pattern_wizard.test.tsx.snap b/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/create_index_pattern_wizard/__snapshots__/create_index_pattern_wizard.test.tsx.snap index 1545ab8cb9b1c..9763cd9f638fd 100644 --- a/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/create_index_pattern_wizard/__snapshots__/create_index_pattern_wizard.test.tsx.snap +++ b/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/create_index_pattern_wizard/__snapshots__/create_index_pattern_wizard.test.tsx.snap @@ -111,6 +111,7 @@ exports[`CreateIndexPatternWizard renders the empty state when there are no indi /> , "learnHowLink": { it('should render normally', () => { - const component = shallow( {}} />); + const component = shallow( {}} prependBasePath={x => x} />); expect(component).toMatchSnapshot(); }); @@ -34,7 +34,9 @@ describe('EmptyState', () => { it('is called when refresh button is clicked', () => { const onRefreshHandler = sinon.stub(); - const component = shallow(); + const component = shallow( + x} /> + ); component.find('[data-test-subj="refreshIndicesButton"]').simulate('click'); diff --git a/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/create_index_pattern_wizard/components/empty_state/empty_state.tsx b/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/create_index_pattern_wizard/components/empty_state/empty_state.tsx index 676f4d38f409b..3ee5d1a0e96f1 100644 --- a/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/create_index_pattern_wizard/components/empty_state/empty_state.tsx +++ b/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/create_index_pattern_wizard/components/empty_state/empty_state.tsx @@ -22,8 +22,15 @@ import React from 'react'; import { EuiCallOut, EuiTextColor, EuiLink, EuiButton } from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n/react'; +import { IBasePath } from 'kibana/public'; -export const EmptyState = ({ onRefresh }: { onRefresh: () => void }) => ( +export const EmptyState = ({ + onRefresh, + prependBasePath, +}: { + onRefresh: () => void; + prependBasePath: IBasePath['prepend']; +}) => (
void }) => ( ), learnHowLink: ( - + void }) => ( ), getStartedLink: ( - + x), }; describe('CreateIndexPatternWizard', () => { diff --git a/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/create_index_pattern_wizard/create_index_pattern_wizard.tsx b/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/create_index_pattern_wizard/create_index_pattern_wizard.tsx index 4166d48349d35..a1a263fe88923 100644 --- a/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/create_index_pattern_wizard/create_index_pattern_wizard.tsx +++ b/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/create_index_pattern_wizard/create_index_pattern_wizard.tsx @@ -35,6 +35,7 @@ import { SavedObjectsClient, IUiSettingsClient, OverlayStart, + IBasePath, } from '../../../../../../../../core/public'; import { DataPublicPluginStart } from '../../../../../../../../plugins/data/public'; import { IndexPatternCreationConfig } from '../../../../../../../../plugins/index_pattern_management/public'; @@ -50,6 +51,7 @@ interface CreateIndexPatternWizardProps { uiSettings: IUiSettingsClient; changeUrl: (url: string) => void; openConfirm: OverlayStart['openConfirm']; + prependBasePath: IBasePath['prepend']; }; } @@ -235,7 +237,12 @@ export class CreateIndexPatternWizard extends Component< const hasDataIndices = allIndices.some(({ name }: MatchedIndex) => !name.startsWith('.')); if (!hasDataIndices && !isIncludingSystemIndices && !remoteClustersExist) { - return ; + return ( + + ); } if (step === 1) { diff --git a/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/create_index_pattern_wizard/index.js b/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/create_index_pattern_wizard/index.js index ed1fc026c560c..2762a4f6e8726 100644 --- a/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/create_index_pattern_wizard/index.js +++ b/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/create_index_pattern_wizard/index.js @@ -45,6 +45,7 @@ uiRoutes.when('/management/kibana/index_pattern', { $scope.$evalAsync(() => kbnUrl.changePath(url)); }, openConfirm: npStart.core.overlays.openConfirm, + prependBasePath: npStart.core.http.basePath.prepend, }; const initialQuery = $routeParams.id ? decodeURIComponent($routeParams.id) : undefined; diff --git a/src/legacy/core_plugins/kibana/server/lib/__tests__/relationships.js b/src/legacy/core_plugins/kibana/server/lib/__tests__/relationships.js index b06a5b443e709..e5d43fec4e59c 100644 --- a/src/legacy/core_plugins/kibana/server/lib/__tests__/relationships.js +++ b/src/legacy/core_plugins/kibana/server/lib/__tests__/relationships.js @@ -85,7 +85,7 @@ const savedObjectsManagement = getManagementaMock({ }, getInAppUrl(obj) { return { - path: `/app/kibana#/visualize/edit/${encodeURIComponent(obj.id)}`, + path: `/app/visualize#/edit/${encodeURIComponent(obj.id)}`, uiCapabilitiesPath: 'visualize.show', }; }, @@ -101,7 +101,7 @@ const savedObjectsManagement = getManagementaMock({ }, getInAppUrl(obj) { return { - path: `/app/kibana#/discover/${encodeURIComponent(obj.id)}`, + path: `/app/discover#//${encodeURIComponent(obj.id)}`, uiCapabilitiesPath: 'discover.show', }; }, @@ -200,7 +200,7 @@ describe('findRelationships', () => { title: 'Foo', editUrl: '/management/kibana/objects/savedVisualizations/1', inAppUrl: { - path: '/app/kibana#/visualize/edit/1', + path: '/app/visualize#/edit/1', uiCapabilitiesPath: 'visualize.show', }, }, @@ -214,7 +214,7 @@ describe('findRelationships', () => { title: 'Bar', editUrl: '/management/kibana/objects/savedVisualizations/2', inAppUrl: { - path: '/app/kibana#/visualize/edit/2', + path: '/app/visualize#/edit/2', uiCapabilitiesPath: 'visualize.show', }, }, @@ -228,7 +228,7 @@ describe('findRelationships', () => { title: 'FooBar', editUrl: '/management/kibana/objects/savedVisualizations/3', inAppUrl: { - path: '/app/kibana#/visualize/edit/3', + path: '/app/visualize#/edit/3', uiCapabilitiesPath: 'visualize.show', }, }, @@ -453,7 +453,7 @@ describe('findRelationships', () => { title: 'Foo', editUrl: '/management/kibana/objects/savedVisualizations/1', inAppUrl: { - path: '/app/kibana#/visualize/edit/1', + path: '/app/visualize#/edit/1', uiCapabilitiesPath: 'visualize.show', }, }, @@ -467,7 +467,7 @@ describe('findRelationships', () => { title: 'Bar', editUrl: '/management/kibana/objects/savedVisualizations/2', inAppUrl: { - path: '/app/kibana#/visualize/edit/2', + path: '/app/visualize#/edit/2', uiCapabilitiesPath: 'visualize.show', }, }, @@ -481,7 +481,7 @@ describe('findRelationships', () => { title: 'FooBar', editUrl: '/management/kibana/objects/savedVisualizations/3', inAppUrl: { - path: '/app/kibana#/visualize/edit/3', + path: '/app/visualize#/edit/3', uiCapabilitiesPath: 'visualize.show', }, }, @@ -567,7 +567,7 @@ describe('findRelationships', () => { title: 'Foo', editUrl: '/management/kibana/objects/savedVisualizations/1', inAppUrl: { - path: '/app/kibana#/visualize/edit/1', + path: '/app/visualize#/edit/1', uiCapabilitiesPath: 'visualize.show', }, }, @@ -581,7 +581,7 @@ describe('findRelationships', () => { title: 'Bar', editUrl: '/management/kibana/objects/savedVisualizations/2', inAppUrl: { - path: '/app/kibana#/visualize/edit/2', + path: '/app/visualize#/edit/2', uiCapabilitiesPath: 'visualize.show', }, }, @@ -595,7 +595,7 @@ describe('findRelationships', () => { title: 'FooBar', editUrl: '/management/kibana/objects/savedVisualizations/3', inAppUrl: { - path: '/app/kibana#/visualize/edit/3', + path: '/app/visualize#/edit/3', uiCapabilitiesPath: 'visualize.show', }, }, @@ -609,7 +609,7 @@ describe('findRelationships', () => { title: 'My Saved Search', editUrl: '/management/kibana/objects/savedSearches/1', inAppUrl: { - path: '/app/kibana#/discover/1', + path: '/app/discover#//1', uiCapabilitiesPath: 'discover.show', }, }, diff --git a/src/legacy/core_plugins/kibana/server/ui_setting_defaults.js b/src/legacy/core_plugins/kibana/server/ui_setting_defaults.js index 3ed867d90b6cb..87cfefa8af6b1 100644 --- a/src/legacy/core_plugins/kibana/server/ui_setting_defaults.js +++ b/src/legacy/core_plugins/kibana/server/ui_setting_defaults.js @@ -69,7 +69,7 @@ export function getUiSettingDefaults() { name: i18n.translate('kbn.advancedSettings.defaultRoute.defaultRouteTitle', { defaultMessage: 'Default route', }), - value: '/app/kibana', + value: '/app/home', schema: schema.string({ validate(value) { if (!value.startsWith('/') || !isRelativeUrl(value)) { diff --git a/src/legacy/ui/public/_index.scss b/src/legacy/ui/public/_index.scss index f10718ba58c2c..15a70e0ef7f5a 100644 --- a/src/legacy/ui/public/_index.scss +++ b/src/legacy/ui/public/_index.scss @@ -11,7 +11,5 @@ @import './accessibility/index'; @import './directives/index'; @import './error_url_overflow/index'; -@import './exit_full_screen/index'; @import './field_editor/index'; -@import './style_compile/index'; @import '../../../plugins/management/public/components/index'; diff --git a/src/legacy/ui/public/autoload/modules.js b/src/legacy/ui/public/autoload/modules.js index b40f051a5ec10..94929c8ca26d3 100644 --- a/src/legacy/ui/public/autoload/modules.js +++ b/src/legacy/ui/public/autoload/modules.js @@ -25,7 +25,6 @@ import '../private'; import '../promises'; import '../state_management/app_state'; import '../state_management/global_state'; -import '../style_compile'; import '../url'; import '../directives/watch_multi'; import '../react_components'; diff --git a/src/legacy/ui/public/chrome/api/__tests__/nav.js b/src/legacy/ui/public/chrome/api/__tests__/nav.js index 853ef4ad0b3dc..877da3539828f 100644 --- a/src/legacy/ui/public/chrome/api/__tests__/nav.js +++ b/src/legacy/ui/public/chrome/api/__tests__/nav.js @@ -112,66 +112,28 @@ describe('chrome nav apis', function() { }); }); - describe('internals.trackPossibleSubUrl()', function() { - it('injects the globalState of the current url to all links for the same app', function() { - const appUrlStore = new StubBrowserStorage(); - fakedLinks = [ - { - id: 'kibana:discover', - baseUrl: `${baseUrl}/app/kibana#discover`, - subUrlBase: '/app/kibana#discover', - legacy: true, - }, - { - id: 'kibana:visualize', - baseUrl: `${baseUrl}/app/kibana#visualize`, - subUrlBase: '/app/kibana#visualize', - legacy: true, - }, - { - id: 'kibana:dashboard', - baseUrl: `${baseUrl}/app/kibana#dashboards`, - subUrlBase: '/app/kibana#dashboard', - legacy: true, - }, - ]; - - const { internals } = init({ appUrlStore }); - internals.trackPossibleSubUrl(`${baseUrl}/app/kibana#dashboard?_g=globalstate`); - - expect(fakedLinks[0].url).to.be(`${baseUrl}/app/kibana#discover?_g=globalstate`); - expect(fakedLinks[0].active).to.be(false); - - expect(fakedLinks[1].url).to.be(`${baseUrl}/app/kibana#visualize?_g=globalstate`); - expect(fakedLinks[1].active).to.be(false); - - expect(fakedLinks[2].url).to.be(`${baseUrl}/app/kibana#dashboard?_g=globalstate`); - expect(fakedLinks[2].active).to.be(true); - }); - }); - describe('chrome.trackSubUrlForApp()', function() { it('injects a manual app url', function() { const appUrlStore = new StubBrowserStorage(); fakedLinks = [ { - id: 'kibana:visualize', - baseUrl: `${baseUrl}/app/kibana#visualize`, - url: `${baseUrl}/app/kibana#visualize`, - subUrlBase: '/app/kibana#visualize', + id: 'visualize', + baseUrl: `${baseUrl}/app/visualize#`, + url: `${baseUrl}/app/visualize#`, + subUrlBase: '/app/visualize#', legacy: true, }, ]; const { chrome } = init({ appUrlStore }); const kibanaParsedUrl = absoluteToParsedUrl( - `${baseUrl}/xyz/app/kibana#visualize/1234?_g=globalstate`, + `${baseUrl}/xyz/app/visualize#/1234?_g=globalstate`, '/xyz' ); - chrome.trackSubUrlForApp('kibana:visualize', kibanaParsedUrl); + chrome.trackSubUrlForApp('visualize', kibanaParsedUrl); expect( - coreNavLinks.update.calledWith('kibana:visualize', { - url: `${baseUrl}/xyz/app/kibana#visualize/1234?_g=globalstate`, + coreNavLinks.update.calledWith('visualize', { + url: `${baseUrl}/xyz/app/visualize#/1234?_g=globalstate`, }) ).to.be(true); }); diff --git a/src/legacy/ui/public/new_platform/new_platform.karma_mock.js b/src/legacy/ui/public/new_platform/new_platform.karma_mock.js index 332a0a0f9ca6e..67422fa659439 100644 --- a/src/legacy/ui/public/new_platform/new_platform.karma_mock.js +++ b/src/legacy/ui/public/new_platform/new_platform.karma_mock.js @@ -357,9 +357,6 @@ export const npStart = { registerRenderer: sinon.fake(), registerType: sinon.fake(), }, - devTools: { - getSortedDevTools: () => [], - }, kibanaLegacy: { getApps: () => [], getForwards: () => [], diff --git a/src/legacy/ui/public/new_platform/new_platform.ts b/src/legacy/ui/public/new_platform/new_platform.ts index 1eb46e1a43895..ddf768495a9da 100644 --- a/src/legacy/ui/public/new_platform/new_platform.ts +++ b/src/legacy/ui/public/new_platform/new_platform.ts @@ -39,7 +39,7 @@ import { Start as InspectorStart, } from '../../../../plugins/inspector/public'; import { ChartsPluginSetup, ChartsPluginStart } from '../../../../plugins/charts/public'; -import { DevToolsSetup, DevToolsStart } from '../../../../plugins/dev_tools/public'; +import { DevToolsSetup } from '../../../../plugins/dev_tools/public'; import { KibanaLegacySetup, KibanaLegacyStart } from '../../../../plugins/kibana_legacy/public'; import { HomePublicPluginSetup } from '../../../../plugins/home/public'; import { SharePluginSetup, SharePluginStart } from '../../../../plugins/share/public'; @@ -105,7 +105,6 @@ export interface PluginsStart { inspector: InspectorStart; uiActions: UiActionsStart; navigation: NavigationPublicPluginStart; - devTools: DevToolsStart; kibanaLegacy: KibanaLegacyStart; share: SharePluginStart; management: ManagementStart; diff --git a/src/legacy/ui/public/new_platform/set_services.ts b/src/legacy/ui/public/new_platform/set_services.ts index 9cacb0c09d79a..9d02ad67b3937 100644 --- a/src/legacy/ui/public/new_platform/set_services.ts +++ b/src/legacy/ui/public/new_platform/set_services.ts @@ -64,6 +64,7 @@ export function setStartServices(npStart: NpStart) { ); visualizationsServices.setCapabilities(npStart.core.application.capabilities); visualizationsServices.setHttp(npStart.core.http); + visualizationsServices.setApplication(npStart.core.application); visualizationsServices.setSavedObjects(npStart.core.savedObjects); visualizationsServices.setIndexPatterns(npStart.plugins.data.indexPatterns); visualizationsServices.setFilterManager(npStart.plugins.data.query.filterManager); diff --git a/src/legacy/ui/public/style_compile/__tests__/style_compile.js b/src/legacy/ui/public/style_compile/__tests__/style_compile.js deleted file mode 100644 index 329177f67539b..0000000000000 --- a/src/legacy/ui/public/style_compile/__tests__/style_compile.js +++ /dev/null @@ -1,66 +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 $ from 'jquery'; -import expect from '@kbn/expect'; -import ngMock from 'ng_mock'; -describe('styleCompile directive', function() { - let config; - let $rootScope; - - beforeEach(ngMock.module('kibana')); - beforeEach( - ngMock.inject(function($injector) { - config = $injector.get('config'); - $rootScope = $injector.get('$rootScope'); - }) - ); - - it('exports a few config values as css', function() { - const $style = $('#style-compile'); - - config.set('truncate:maxHeight', 0); - $rootScope.$apply(); - expect($style.html().trim()).to.be( - [ - '.truncate-by-height {', - ' max-height: none;', - ' display: inline-block;', - '}', - '.truncate-by-height:before {', - ' top: -15px;', - '}', - ].join('\n') - ); - - config.set('truncate:maxHeight', 15); - $rootScope.$apply(); - expect($style.html().trim()).to.be( - [ - '.truncate-by-height {', - ' max-height: 15px !important;', - ' display: inline-block;', - '}', - '.truncate-by-height:before {', - ' top: 0px;', - '}', - ].join('\n') - ); - }); -}); diff --git a/src/legacy/ui/public/style_compile/_index.scss b/src/legacy/ui/public/style_compile/_index.scss deleted file mode 100644 index 6dd403d730314..0000000000000 --- a/src/legacy/ui/public/style_compile/_index.scss +++ /dev/null @@ -1,3 +0,0 @@ -style-compile { - display: none; -} diff --git a/src/legacy/ui/public/style_compile/style_compile.css.tmpl b/src/legacy/ui/public/style_compile/style_compile.css.tmpl deleted file mode 100644 index 943b459acc565..0000000000000 --- a/src/legacy/ui/public/style_compile/style_compile.css.tmpl +++ /dev/null @@ -1,7 +0,0 @@ -.truncate-by-height { - max-height: <%= truncateMaxHeight %>; - display: inline-block; -} -.truncate-by-height:before { - top: <%= truncateGradientTop %>; -} diff --git a/src/legacy/ui/public/style_compile/style_compile.js b/src/legacy/ui/public/style_compile/style_compile.js deleted file mode 100644 index 5b53947e6eb00..0000000000000 --- a/src/legacy/ui/public/style_compile/style_compile.js +++ /dev/null @@ -1,52 +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 _ from 'lodash'; -import $ from 'jquery'; -import '../config'; -import { uiModules } from '../modules'; -import cssTmpl from './style_compile.css.tmpl'; - -const $style = $('