Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Dashboard] Use SavedObjectResolve #111040

Merged
merged 9 commits into from
Oct 15, 2021
Merged

Conversation

crob611
Copy link
Contributor

@crob611 crob611 commented Sep 2, 2021

This PR makes Dashboards Share Capable (part of #100489)

Some important highlights of changes here.

  • Changes the saved_dashboard class to use savedObjectsClient.resolve if requested. Will also store the outcome and the aliasId on the resulting saved dashboard object.

  • An Alias Match will redirect and show the notification toast to let the user know the object has moved
    image

  • A conflict match will show the conflict banner.
    image

Testing

To setup your environment for testing, install the ecommerce sample data and then run the contents of this file in dev tools
resolve-staging-data.txt

What to test?

  • /s/test1/app/dashboards#/view/7c0a5590-10e5-11ec-8e89-e5edd366fc1d-test1 should load normally
  • /s/test2/app/dashboards#/view/7c0a5590-10e5-11ec-8e89-e5edd366fc1d-test2 should load and redirect to /s/test2/app/dashboards#/view/7c0a5590-10e5-11ec-8e89-e5edd366fc1d-test2-newid and you should see the "We redirected you toast"
  • /s/test3/app/dashboards#/view/7c0a5590-10e5-11ec-8e89-e5edd366fc1d-test3 should load and show the Conflict Banner. The conflict banner should not show when you go to full screen mode.
  • A report generated for saved object ID 7c0a5590-10e5-11ec-8e89-e5edd366fc1d-test2 should no have the "Redirected" toast show up on the report.

@crob611 crob611 force-pushed the dashboard-resolver branch 2 times, most recently from 4fe0a26 to d98ad63 Compare September 13, 2021 21:17
@crob611 crob611 added impact:high Addressing this issue will have a high level of impact on the quality/strength of our product. loe:medium Medium Level of Effort v7.16.0 v8.0.0 Feature:Dashboard Dashboard related features Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas auto-backport Deprecated - use backport:version if exact versions are needed release_note:skip Skip the PR/issue when compiling release notes review labels Sep 14, 2021
@crob611 crob611 marked this pull request as ready for review September 14, 2021 19:46
@crob611 crob611 requested a review from a team as a code owner September 14, 2021 19:46
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-presentation (Team:Presentation)

Copy link
Contributor

@ThomThomson ThomThomson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested this locally, and everything works as expected. Went over the code again, and couldn't find anything to comment on! It's a clever solution for keeping the Saved Objects class in there for the time being - can't wait until we migrate away. LGTM!

Copy link
Contributor

@jportner jportner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple of minor problems need to be addressed, but overall this looks good!

Perhaps a dumb question, but I noticed that if you navigate to a dashboard with a full URL ( /app/dashboards#/view/foo?_g=(filters:!(),refreshInterval:(pause:!t,value:0),time:(from:now-15m,to:now))), when you get redirected, it drops the _g query parameter and then the URL quickly changes to show it again.
I'm not that familiar with how the global filter works, but is that reliable behavior? Or, should we think about changing the redirect so it includes query params?

if (screenshotModeService?.isScreenshotMode()) {
scopedHistory().replace(savedDashboard.getFullPath());
} else {
spacesService?.ui.redirectLegacyUrl(savedDashboard.getFullPath());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This uses navigateToApp with the current appId under the hood.
That means that when you go to this URL:

/s/test2/app/dashboards#/view/7c0a5590-10e5-11ec-8e89-e5edd366fc1d-test2

Kibana detects the aliasMatch outcome and redirects you here:

/s/test2/app/dashboards/app/dashboards#/view/7c0a5590-10e5-11ec-8e89-e5edd366fc1d-test2-newId

So you're actually at the /app/dashboards/app/dashboards page, which actually loads because of a quirk in our router, but we should change it so we don't have the app show up in the path twice 😅
Perhaps you can expose a getLocalPath() method?

Comment on lines 155 to 156
if (screenshotModeService?.isScreenshotMode()) {
scopedHistory().replace(savedDashboard.getFullPath());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How can I test this? When I load the dashboard and click the "Full screen" button, it doesn't add anything to the URL. And obviously by the point the page has loaded for an aliasMatch, if we aren't already in screenshot mode, the other redirect has already happened.

Do I actually need to generate a report to exercise this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Screenshot mode is a standalone plugin. There's a method on it to set whether you are in screenshot mode or not. Reporting sets it when it's doing its thing so you can generate a report.

Or, I think you can fake it by setting this key in localStorage __KBN_SCREENSHOT_MODE_ENABLED_KEY__ to 'true'

? spacesService?.ui.components.getLegacyUrlConflict({
currentObjectId: dashboardAppState.savedDashboard.id,
otherObjectId: dashboardAppState.savedDashboard.aliasId,
otherObjectPath: dashboardAppState.savedDashboard.getFullPath(),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar to my other comment about the app path --

If I navigate here:

/s/test3/app/dashboards#/view/7c0a5590-10e5-11ec-8e89-e5edd366fc1d-test3

Then I click the "Go to other object" button, I get redirected here:

/joe/s/test3/app/dashboards/app/dashboards#/view/7c0a5590-10e5-11ec-8e89-e5edd366fc1d-test3-newId

So I think we want to use the local path, not the full path here.

@crob611
Copy link
Contributor Author

crob611 commented Oct 4, 2021

@elasticmachine merge upstream

@crob611
Copy link
Contributor Author

crob611 commented Oct 7, 2021

@elasticmachine merge upstream

Copy link
Contributor

@ThomThomson ThomThomson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've encountered two issues while testing this locally.

App State
I tested the redirect using global state and app state, because a lot of users use URLs with both and expect everything to be forwarded correctly. Add the following state onto the ends of the test URLs:

?_g=(filters:!(),refreshInterval:(pause:!t,value:0),time:(from:now-25m,to:now))&_a=(query:(language:kuery,query:'test%20me%20please'))

The time picker should read from 25 minutes ago until now, and the query bar should read "test me please". This works correctly with test1, but test2 forwards the global state, and not the app state, so the query bar is not properly populated.

Conflict on default index pattern
I'm not entirely sure if this is a problem with your PR, or a caveat of the test data, but when creating a new dashboard, the query bar and filters disappear, and I get an error that reads DataViewSavedObjectConflictError. I think this is the default index pattern having a conflict. Lens entirely fails to open as well. I wonder if there is a plan in place to handle conflicts like this @jportner

@jportner
Copy link
Contributor

jportner commented Oct 7, 2021

Conflict on default index pattern
I'm not entirely sure if this is a problem with your PR, or a caveat of the test data, but when creating a new dashboard, the query bar and filters disappear, and I get an error that reads DataViewSavedObjectConflictError. I think this is the default index pattern having a conflict. Lens entirely fails to open as well. I wonder if there is a plan in place to handle conflicts like this @jportner

Yeah, so:

  1. The staging data script generates aliases for a "conflict" scenarios for all objects that are fed into it, in this case that includes the index pattern
  2. The data service intentionally throws an error when it loads an index pattern that results in a conflict, eventually we want it to be able to pass the outcome to consumers instead and allow them to decide what to do, but that won't happen in time for the 8.0 release
  3. The data service intentionally resolves index patterns even when they do not need to be resolved (in this case, when fetching the default index pattern); there is an open issue to improve this, but it won't happen in time for the 8.0 release: Improve data plugin handling of resolve #111196
  4. We are hoping to completely eliminate the possibility of conflict scenarios through normal Kibana usage by implementing Prevent creating legacy URL conflicts #113335; conflict scenarios will still be possible if users tamper with raw ES documents for the saved objects, so we should keep the UI elements in place, but this whole thing is going to be less of a concern now as it hopefully will affect 0% of users

You can test with this subset of the staging data provided above, which will not result in any index pattern conflicts:

POST .kibana/_bulk
{"index":{"_id":"test1:index-pattern:ff959d40-b880-11e8-a6d9-e546fe2bba5f-test1"}}
{"index-pattern":{"fieldAttrs":"{\"products.manufacturer\":{\"count\":1},\"products.price\":{\"count\":1},\"products.product_name\":{\"count\":1},\"total_quantity\":{\"count\":1}}","fieldFormatMap":"{\"taxful_total_price\":{\"id\":\"number\",\"params\":{\"pattern\":\"$0,0.[00]\"}},\"products.price\":{\"id\":\"number\",\"params\":{\"pattern\":\"$0,0.00\"}},\"taxless_total_price\":{\"id\":\"number\",\"params\":{\"pattern\":\"$0,0.00\"}},\"products.taxless_price\":{\"id\":\"number\",\"params\":{\"pattern\":\"$0,0.00\"}},\"products.taxful_price\":{\"id\":\"number\",\"params\":{\"pattern\":\"$0,0.00\"}},\"products.min_price\":{\"id\":\"number\",\"params\":{\"pattern\":\"$0,0.00\"}},\"products.base_unit_price\":{\"id\":\"number\",\"params\":{\"pattern\":\"$0,0.00\"}},\"products.base_price\":{\"id\":\"number\",\"params\":{\"pattern\":\"$0,0.00\"}}}","fields":"[]","runtimeFieldMap":"{}","timeFieldName":"order_date","title":"kibana_sample_data_ecommerce","typeMeta":"{}"},"coreMigrationVersion":"8.0.0","migrationVersion":{"index-pattern":"7.11.0"},"references":[],"type":"index-pattern","updated_at":"2021-09-07T17:17:24.278Z","namespace":"test1"}
{"index":{"_id":"test2:index-pattern:ff959d40-b880-11e8-a6d9-e546fe2bba5f-test2-newId"}}
{"index-pattern":{"fieldAttrs":"{\"products.manufacturer\":{\"count\":1},\"products.price\":{\"count\":1},\"products.product_name\":{\"count\":1},\"total_quantity\":{\"count\":1}}","fieldFormatMap":"{\"taxful_total_price\":{\"id\":\"number\",\"params\":{\"pattern\":\"$0,0.[00]\"}},\"products.price\":{\"id\":\"number\",\"params\":{\"pattern\":\"$0,0.00\"}},\"taxless_total_price\":{\"id\":\"number\",\"params\":{\"pattern\":\"$0,0.00\"}},\"products.taxless_price\":{\"id\":\"number\",\"params\":{\"pattern\":\"$0,0.00\"}},\"products.taxful_price\":{\"id\":\"number\",\"params\":{\"pattern\":\"$0,0.00\"}},\"products.min_price\":{\"id\":\"number\",\"params\":{\"pattern\":\"$0,0.00\"}},\"products.base_unit_price\":{\"id\":\"number\",\"params\":{\"pattern\":\"$0,0.00\"}},\"products.base_price\":{\"id\":\"number\",\"params\":{\"pattern\":\"$0,0.00\"}}}","fields":"[]","runtimeFieldMap":"{}","timeFieldName":"order_date","title":"kibana_sample_data_ecommerce","typeMeta":"{}"},"coreMigrationVersion":"8.0.0","migrationVersion":{"index-pattern":"7.11.0"},"references":[],"type":"index-pattern","updated_at":"2021-09-07T17:17:24.278Z","namespace":"test2"}
{"index":{"_id":"test3:index-pattern:ff959d40-b880-11e8-a6d9-e546fe2bba5f-test3"}}
{"index-pattern":{"fieldAttrs":"{\"products.manufacturer\":{\"count\":1},\"products.price\":{\"count\":1},\"products.product_name\":{\"count\":1},\"total_quantity\":{\"count\":1}}","fieldFormatMap":"{\"taxful_total_price\":{\"id\":\"number\",\"params\":{\"pattern\":\"$0,0.[00]\"}},\"products.price\":{\"id\":\"number\",\"params\":{\"pattern\":\"$0,0.00\"}},\"taxless_total_price\":{\"id\":\"number\",\"params\":{\"pattern\":\"$0,0.00\"}},\"products.taxless_price\":{\"id\":\"number\",\"params\":{\"pattern\":\"$0,0.00\"}},\"products.taxful_price\":{\"id\":\"number\",\"params\":{\"pattern\":\"$0,0.00\"}},\"products.min_price\":{\"id\":\"number\",\"params\":{\"pattern\":\"$0,0.00\"}},\"products.base_unit_price\":{\"id\":\"number\",\"params\":{\"pattern\":\"$0,0.00\"}},\"products.base_price\":{\"id\":\"number\",\"params\":{\"pattern\":\"$0,0.00\"}}}","fields":"[]","runtimeFieldMap":"{}","timeFieldName":"order_date","title":"kibana_sample_data_ecommerce","typeMeta":"{}"},"coreMigrationVersion":"8.0.0","migrationVersion":{"index-pattern":"7.11.0"},"references":[],"type":"index-pattern","updated_at":"2021-09-07T17:17:24.278Z","namespace":"test3"}
{"index":{"_id":"test3:index-pattern:ff959d40-b880-11e8-a6d9-e546fe2bba5f-test3-newId"}}
{"index-pattern":{"fieldAttrs":"{\"products.manufacturer\":{\"count\":1},\"products.price\":{\"count\":1},\"products.product_name\":{\"count\":1},\"total_quantity\":{\"count\":1}}","fieldFormatMap":"{\"taxful_total_price\":{\"id\":\"number\",\"params\":{\"pattern\":\"$0,0.[00]\"}},\"products.price\":{\"id\":\"number\",\"params\":{\"pattern\":\"$0,0.00\"}},\"taxless_total_price\":{\"id\":\"number\",\"params\":{\"pattern\":\"$0,0.00\"}},\"products.taxless_price\":{\"id\":\"number\",\"params\":{\"pattern\":\"$0,0.00\"}},\"products.taxful_price\":{\"id\":\"number\",\"params\":{\"pattern\":\"$0,0.00\"}},\"products.min_price\":{\"id\":\"number\",\"params\":{\"pattern\":\"$0,0.00\"}},\"products.base_unit_price\":{\"id\":\"number\",\"params\":{\"pattern\":\"$0,0.00\"}},\"products.base_price\":{\"id\":\"number\",\"params\":{\"pattern\":\"$0,0.00\"}}}","fields":"[]","runtimeFieldMap":"{}","timeFieldName":"order_date","title":"kibana_sample_data_ecommerce","typeMeta":"{}"},"coreMigrationVersion":"8.0.0","migrationVersion":{"index-pattern":"7.11.0"},"references":[],"type":"index-pattern","updated_at":"2021-09-07T17:17:24.278Z","namespace":"test3"}
{"index":{"_id":"test1:dashboard:7c0a5590-10e5-11ec-8e89-e5edd366fc1d-test1"}}
{"dashboard":{"description":"","hits":0,"kibanaSavedObjectMeta":{"searchSourceJSON":"{\"query\":{\"query\":\"\",\"language\":\"kuery\"},\"filter\":[]}"},"optionsJSON":"{\"useMargins\":true,\"syncColors\":false,\"hidePanelTitles\":false}","panelsJSON":"[{\"version\":\"8.0.0\",\"type\":\"lens\",\"gridData\":{\"x\":0,\"y\":0,\"w\":24,\"h\":15,\"i\":\"b29f0b30-ff36-4cae-adee-5f4d7c10344f\"},\"panelIndex\":\"b29f0b30-ff36-4cae-adee-5f4d7c10344f\",\"embeddableConfig\":{\"attributes\":{\"title\":\"\",\"visualizationType\":\"lnsXY\",\"type\":\"lens\",\"references\":[{\"type\":\"index-pattern\",\"id\":\"ff959d40-b880-11e8-a6d9-e546fe2bba5f\",\"name\":\"indexpattern-datasource-current-indexpattern\"},{\"type\":\"index-pattern\",\"id\":\"ff959d40-b880-11e8-a6d9-e546fe2bba5f\",\"name\":\"indexpattern-datasource-layer-601d5f24-9453-4dcf-8c4c-972f1a9e755a\"}],\"state\":{\"visualization\":{\"legend\":{\"isVisible\":true,\"position\":\"right\"},\"valueLabels\":\"hide\",\"fittingFunction\":\"None\",\"yLeftExtent\":{\"mode\":\"full\"},\"yRightExtent\":{\"mode\":\"full\"},\"axisTitlesVisibilitySettings\":{\"x\":true,\"yLeft\":true,\"yRight\":true},\"tickLabelsVisibilitySettings\":{\"x\":true,\"yLeft\":true,\"yRight\":true},\"labelsOrientation\":{\"x\":0,\"yLeft\":0,\"yRight\":0},\"gridlinesVisibilitySettings\":{\"x\":true,\"yLeft\":true,\"yRight\":true},\"preferredSeriesType\":\"bar_stacked\",\"layers\":[{\"layerId\":\"601d5f24-9453-4dcf-8c4c-972f1a9e755a\",\"accessors\":[\"d96412c4-0e98-42c3-ad07-522cd52b13c9\"],\"position\":\"top\",\"seriesType\":\"bar_stacked\",\"showGridlines\":false,\"layerType\":\"data\",\"xAccessor\":\"70fd835a-3b29-4931-88d5-dc6e70746b13\"}]},\"query\":{\"query\":\"\",\"language\":\"kuery\"},\"filters\":[],\"datasourceStates\":{\"indexpattern\":{\"layers\":{\"601d5f24-9453-4dcf-8c4c-972f1a9e755a\":{\"columns\":{\"70fd835a-3b29-4931-88d5-dc6e70746b13\":{\"label\":\"Top values of currency\",\"dataType\":\"string\",\"operationType\":\"terms\",\"scale\":\"ordinal\",\"sourceField\":\"currency\",\"isBucketed\":true,\"params\":{\"size\":5,\"orderBy\":{\"type\":\"column\",\"columnId\":\"d96412c4-0e98-42c3-ad07-522cd52b13c9\"},\"orderDirection\":\"desc\",\"otherBucket\":true,\"missingBucket\":false}},\"d96412c4-0e98-42c3-ad07-522cd52b13c9\":{\"label\":\"Count of records\",\"dataType\":\"number\",\"operationType\":\"count\",\"isBucketed\":false,\"scale\":\"ratio\",\"sourceField\":\"Records\"}},\"columnOrder\":[\"70fd835a-3b29-4931-88d5-dc6e70746b13\",\"d96412c4-0e98-42c3-ad07-522cd52b13c9\"],\"incompleteColumns\":{}}}}}}},\"enhancements\":{}}}]","timeRestore":false,"title":"my test dashboard","version":1},"coreMigrationVersion":"8.0.0","migrationVersion":{"dashboard":"7.16.0"},"references":[{"id":"ff959d40-b880-11e8-a6d9-e546fe2bba5f-test1","name":"b29f0b30-ff36-4cae-adee-5f4d7c10344f:indexpattern-datasource-current-indexpattern","type":"index-pattern"},{"id":"ff959d40-b880-11e8-a6d9-e546fe2bba5f-test1","name":"b29f0b30-ff36-4cae-adee-5f4d7c10344f:indexpattern-datasource-layer-601d5f24-9453-4dcf-8c4c-972f1a9e755a","type":"index-pattern"}],"type":"dashboard","updated_at":"2021-09-08T20:43:55.629Z","namespace":"test1"}
{"index":{"_id":"test2:dashboard:7c0a5590-10e5-11ec-8e89-e5edd366fc1d-test2-newId"}}
{"dashboard":{"description":"","hits":0,"kibanaSavedObjectMeta":{"searchSourceJSON":"{\"query\":{\"query\":\"\",\"language\":\"kuery\"},\"filter\":[]}"},"optionsJSON":"{\"useMargins\":true,\"syncColors\":false,\"hidePanelTitles\":false}","panelsJSON":"[{\"version\":\"8.0.0\",\"type\":\"lens\",\"gridData\":{\"x\":0,\"y\":0,\"w\":24,\"h\":15,\"i\":\"b29f0b30-ff36-4cae-adee-5f4d7c10344f\"},\"panelIndex\":\"b29f0b30-ff36-4cae-adee-5f4d7c10344f\",\"embeddableConfig\":{\"attributes\":{\"title\":\"\",\"visualizationType\":\"lnsXY\",\"type\":\"lens\",\"references\":[{\"type\":\"index-pattern\",\"id\":\"ff959d40-b880-11e8-a6d9-e546fe2bba5f\",\"name\":\"indexpattern-datasource-current-indexpattern\"},{\"type\":\"index-pattern\",\"id\":\"ff959d40-b880-11e8-a6d9-e546fe2bba5f\",\"name\":\"indexpattern-datasource-layer-601d5f24-9453-4dcf-8c4c-972f1a9e755a\"}],\"state\":{\"visualization\":{\"legend\":{\"isVisible\":true,\"position\":\"right\"},\"valueLabels\":\"hide\",\"fittingFunction\":\"None\",\"yLeftExtent\":{\"mode\":\"full\"},\"yRightExtent\":{\"mode\":\"full\"},\"axisTitlesVisibilitySettings\":{\"x\":true,\"yLeft\":true,\"yRight\":true},\"tickLabelsVisibilitySettings\":{\"x\":true,\"yLeft\":true,\"yRight\":true},\"labelsOrientation\":{\"x\":0,\"yLeft\":0,\"yRight\":0},\"gridlinesVisibilitySettings\":{\"x\":true,\"yLeft\":true,\"yRight\":true},\"preferredSeriesType\":\"bar_stacked\",\"layers\":[{\"layerId\":\"601d5f24-9453-4dcf-8c4c-972f1a9e755a\",\"accessors\":[\"d96412c4-0e98-42c3-ad07-522cd52b13c9\"],\"position\":\"top\",\"seriesType\":\"bar_stacked\",\"showGridlines\":false,\"layerType\":\"data\",\"xAccessor\":\"70fd835a-3b29-4931-88d5-dc6e70746b13\"}]},\"query\":{\"query\":\"\",\"language\":\"kuery\"},\"filters\":[],\"datasourceStates\":{\"indexpattern\":{\"layers\":{\"601d5f24-9453-4dcf-8c4c-972f1a9e755a\":{\"columns\":{\"70fd835a-3b29-4931-88d5-dc6e70746b13\":{\"label\":\"Top values of currency\",\"dataType\":\"string\",\"operationType\":\"terms\",\"scale\":\"ordinal\",\"sourceField\":\"currency\",\"isBucketed\":true,\"params\":{\"size\":5,\"orderBy\":{\"type\":\"column\",\"columnId\":\"d96412c4-0e98-42c3-ad07-522cd52b13c9\"},\"orderDirection\":\"desc\",\"otherBucket\":true,\"missingBucket\":false}},\"d96412c4-0e98-42c3-ad07-522cd52b13c9\":{\"label\":\"Count of records\",\"dataType\":\"number\",\"operationType\":\"count\",\"isBucketed\":false,\"scale\":\"ratio\",\"sourceField\":\"Records\"}},\"columnOrder\":[\"70fd835a-3b29-4931-88d5-dc6e70746b13\",\"d96412c4-0e98-42c3-ad07-522cd52b13c9\"],\"incompleteColumns\":{}}}}}}},\"enhancements\":{}}}]","timeRestore":false,"title":"my test dashboard","version":1},"coreMigrationVersion":"8.0.0","migrationVersion":{"dashboard":"7.16.0"},"references":[{"id":"ff959d40-b880-11e8-a6d9-e546fe2bba5f-test2-newId","name":"b29f0b30-ff36-4cae-adee-5f4d7c10344f:indexpattern-datasource-current-indexpattern","type":"index-pattern"},{"id":"ff959d40-b880-11e8-a6d9-e546fe2bba5f-test2-newId","name":"b29f0b30-ff36-4cae-adee-5f4d7c10344f:indexpattern-datasource-layer-601d5f24-9453-4dcf-8c4c-972f1a9e755a","type":"index-pattern"}],"type":"dashboard","updated_at":"2021-09-08T20:43:55.629Z","namespace":"test2"}
{"index":{"_id":"test3:dashboard:7c0a5590-10e5-11ec-8e89-e5edd366fc1d-test3"}}
{"dashboard":{"description":"","hits":0,"kibanaSavedObjectMeta":{"searchSourceJSON":"{\"query\":{\"query\":\"\",\"language\":\"kuery\"},\"filter\":[]}"},"optionsJSON":"{\"useMargins\":true,\"syncColors\":false,\"hidePanelTitles\":false}","panelsJSON":"[{\"version\":\"8.0.0\",\"type\":\"lens\",\"gridData\":{\"x\":0,\"y\":0,\"w\":24,\"h\":15,\"i\":\"b29f0b30-ff36-4cae-adee-5f4d7c10344f\"},\"panelIndex\":\"b29f0b30-ff36-4cae-adee-5f4d7c10344f\",\"embeddableConfig\":{\"attributes\":{\"title\":\"\",\"visualizationType\":\"lnsXY\",\"type\":\"lens\",\"references\":[{\"type\":\"index-pattern\",\"id\":\"ff959d40-b880-11e8-a6d9-e546fe2bba5f\",\"name\":\"indexpattern-datasource-current-indexpattern\"},{\"type\":\"index-pattern\",\"id\":\"ff959d40-b880-11e8-a6d9-e546fe2bba5f\",\"name\":\"indexpattern-datasource-layer-601d5f24-9453-4dcf-8c4c-972f1a9e755a\"}],\"state\":{\"visualization\":{\"legend\":{\"isVisible\":true,\"position\":\"right\"},\"valueLabels\":\"hide\",\"fittingFunction\":\"None\",\"yLeftExtent\":{\"mode\":\"full\"},\"yRightExtent\":{\"mode\":\"full\"},\"axisTitlesVisibilitySettings\":{\"x\":true,\"yLeft\":true,\"yRight\":true},\"tickLabelsVisibilitySettings\":{\"x\":true,\"yLeft\":true,\"yRight\":true},\"labelsOrientation\":{\"x\":0,\"yLeft\":0,\"yRight\":0},\"gridlinesVisibilitySettings\":{\"x\":true,\"yLeft\":true,\"yRight\":true},\"preferredSeriesType\":\"bar_stacked\",\"layers\":[{\"layerId\":\"601d5f24-9453-4dcf-8c4c-972f1a9e755a\",\"accessors\":[\"d96412c4-0e98-42c3-ad07-522cd52b13c9\"],\"position\":\"top\",\"seriesType\":\"bar_stacked\",\"showGridlines\":false,\"layerType\":\"data\",\"xAccessor\":\"70fd835a-3b29-4931-88d5-dc6e70746b13\"}]},\"query\":{\"query\":\"\",\"language\":\"kuery\"},\"filters\":[],\"datasourceStates\":{\"indexpattern\":{\"layers\":{\"601d5f24-9453-4dcf-8c4c-972f1a9e755a\":{\"columns\":{\"70fd835a-3b29-4931-88d5-dc6e70746b13\":{\"label\":\"Top values of currency\",\"dataType\":\"string\",\"operationType\":\"terms\",\"scale\":\"ordinal\",\"sourceField\":\"currency\",\"isBucketed\":true,\"params\":{\"size\":5,\"orderBy\":{\"type\":\"column\",\"columnId\":\"d96412c4-0e98-42c3-ad07-522cd52b13c9\"},\"orderDirection\":\"desc\",\"otherBucket\":true,\"missingBucket\":false}},\"d96412c4-0e98-42c3-ad07-522cd52b13c9\":{\"label\":\"Count of records\",\"dataType\":\"number\",\"operationType\":\"count\",\"isBucketed\":false,\"scale\":\"ratio\",\"sourceField\":\"Records\"}},\"columnOrder\":[\"70fd835a-3b29-4931-88d5-dc6e70746b13\",\"d96412c4-0e98-42c3-ad07-522cd52b13c9\"],\"incompleteColumns\":{}}}}}}},\"enhancements\":{}}}]","timeRestore":false,"title":"my test dashboard","version":1},"coreMigrationVersion":"8.0.0","migrationVersion":{"dashboard":"7.16.0"},"references":[{"id":"ff959d40-b880-11e8-a6d9-e546fe2bba5f-test3","name":"b29f0b30-ff36-4cae-adee-5f4d7c10344f:indexpattern-datasource-current-indexpattern","type":"index-pattern"},{"id":"ff959d40-b880-11e8-a6d9-e546fe2bba5f-test3","name":"b29f0b30-ff36-4cae-adee-5f4d7c10344f:indexpattern-datasource-layer-601d5f24-9453-4dcf-8c4c-972f1a9e755a","type":"index-pattern"}],"type":"dashboard","updated_at":"2021-09-08T20:43:55.629Z","namespace":"test3"}
{"index":{"_id":"test3:dashboard:7c0a5590-10e5-11ec-8e89-e5edd366fc1d-test3-newId"}}
{"dashboard":{"description":"","hits":0,"kibanaSavedObjectMeta":{"searchSourceJSON":"{\"query\":{\"query\":\"\",\"language\":\"kuery\"},\"filter\":[]}"},"optionsJSON":"{\"useMargins\":true,\"syncColors\":false,\"hidePanelTitles\":false}","panelsJSON":"[{\"version\":\"8.0.0\",\"type\":\"lens\",\"gridData\":{\"x\":0,\"y\":0,\"w\":24,\"h\":15,\"i\":\"b29f0b30-ff36-4cae-adee-5f4d7c10344f\"},\"panelIndex\":\"b29f0b30-ff36-4cae-adee-5f4d7c10344f\",\"embeddableConfig\":{\"attributes\":{\"title\":\"\",\"visualizationType\":\"lnsXY\",\"type\":\"lens\",\"references\":[{\"type\":\"index-pattern\",\"id\":\"ff959d40-b880-11e8-a6d9-e546fe2bba5f\",\"name\":\"indexpattern-datasource-current-indexpattern\"},{\"type\":\"index-pattern\",\"id\":\"ff959d40-b880-11e8-a6d9-e546fe2bba5f\",\"name\":\"indexpattern-datasource-layer-601d5f24-9453-4dcf-8c4c-972f1a9e755a\"}],\"state\":{\"visualization\":{\"legend\":{\"isVisible\":true,\"position\":\"right\"},\"valueLabels\":\"hide\",\"fittingFunction\":\"None\",\"yLeftExtent\":{\"mode\":\"full\"},\"yRightExtent\":{\"mode\":\"full\"},\"axisTitlesVisibilitySettings\":{\"x\":true,\"yLeft\":true,\"yRight\":true},\"tickLabelsVisibilitySettings\":{\"x\":true,\"yLeft\":true,\"yRight\":true},\"labelsOrientation\":{\"x\":0,\"yLeft\":0,\"yRight\":0},\"gridlinesVisibilitySettings\":{\"x\":true,\"yLeft\":true,\"yRight\":true},\"preferredSeriesType\":\"bar_stacked\",\"layers\":[{\"layerId\":\"601d5f24-9453-4dcf-8c4c-972f1a9e755a\",\"accessors\":[\"d96412c4-0e98-42c3-ad07-522cd52b13c9\"],\"position\":\"top\",\"seriesType\":\"bar_stacked\",\"showGridlines\":false,\"layerType\":\"data\",\"xAccessor\":\"70fd835a-3b29-4931-88d5-dc6e70746b13\"}]},\"query\":{\"query\":\"\",\"language\":\"kuery\"},\"filters\":[],\"datasourceStates\":{\"indexpattern\":{\"layers\":{\"601d5f24-9453-4dcf-8c4c-972f1a9e755a\":{\"columns\":{\"70fd835a-3b29-4931-88d5-dc6e70746b13\":{\"label\":\"Top values of currency\",\"dataType\":\"string\",\"operationType\":\"terms\",\"scale\":\"ordinal\",\"sourceField\":\"currency\",\"isBucketed\":true,\"params\":{\"size\":5,\"orderBy\":{\"type\":\"column\",\"columnId\":\"d96412c4-0e98-42c3-ad07-522cd52b13c9\"},\"orderDirection\":\"desc\",\"otherBucket\":true,\"missingBucket\":false}},\"d96412c4-0e98-42c3-ad07-522cd52b13c9\":{\"label\":\"Count of records\",\"dataType\":\"number\",\"operationType\":\"count\",\"isBucketed\":false,\"scale\":\"ratio\",\"sourceField\":\"Records\"}},\"columnOrder\":[\"70fd835a-3b29-4931-88d5-dc6e70746b13\",\"d96412c4-0e98-42c3-ad07-522cd52b13c9\"],\"incompleteColumns\":{}}}}}}},\"enhancements\":{}}}]","timeRestore":false,"title":"my test dashboard","version":1},"coreMigrationVersion":"8.0.0","migrationVersion":{"dashboard":"7.16.0"},"references":[{"id":"ff959d40-b880-11e8-a6d9-e546fe2bba5f-test3-newId","name":"b29f0b30-ff36-4cae-adee-5f4d7c10344f:indexpattern-datasource-current-indexpattern","type":"index-pattern"},{"id":"ff959d40-b880-11e8-a6d9-e546fe2bba5f-test3-newId","name":"b29f0b30-ff36-4cae-adee-5f4d7c10344f:indexpattern-datasource-layer-601d5f24-9453-4dcf-8c4c-972f1a9e755a","type":"index-pattern"}],"type":"dashboard","updated_at":"2021-09-08T20:43:55.629Z","namespace":"test3"}
{"index":{"_id":"legacy-url-alias:test2:dashboard:7c0a5590-10e5-11ec-8e89-e5edd366fc1d-test2"}}
{"legacy-url-alias":{"targetNamespace":"test2","targetType":"dashboard","targetId":"7c0a5590-10e5-11ec-8e89-e5edd366fc1d-test2-newId","sourceId":"7c0a5590-10e5-11ec-8e89-e5edd366fc1d-test2"},"type":"legacy-url-alias","references":[]}
{"index":{"_id":"legacy-url-alias:test3:dashboard:7c0a5590-10e5-11ec-8e89-e5edd366fc1d-test3"}}
{"legacy-url-alias":{"targetNamespace":"test3","targetType":"dashboard","targetId":"7c0a5590-10e5-11ec-8e89-e5edd366fc1d-test3-newId","sourceId":"7c0a5590-10e5-11ec-8e89-e5edd366fc1d-test3"},"type":"legacy-url-alias","references":[]}
{"index":{"_id":"space:test1"}}
{"space":{"name":"Test 1: Resolve Exact Match","initials":"T1","description":"In this space, test object(s) will resolve with an \"exactMatch\" outcome.","disabledFeatures":[]},"type":"space"}
{"index":{"_id":"space:test2"}}
{"space":{"name":"Test 2: Resolve Alias Match","initials":"T2","description":"In this space, test object(s) will resolve with an \"aliasMatch\" outcome.","disabledFeatures":[]},"type":"space"}
{"index":{"_id":"space:test3"}}
{"space":{"name":"Test 3: Resolve Conflict","initials":"T3","description":"In this space, test object(s) will resolve with a \"conflict\" outcome.","disabledFeatures":[]},"type":"space"}

@ThomThomson
Copy link
Contributor

ThomThomson commented Oct 7, 2021

Amazing, thank you for the explanation, Joe! So it looks like only the one problem of forwarding App state is remaining in this PR - will re-review once it's added in!

@crob611
Copy link
Contributor Author

crob611 commented Oct 12, 2021

@elasticmachine merge upstream

@crob611
Copy link
Contributor Author

crob611 commented Oct 14, 2021

@elasticmachine merge upstream

@jportner jportner self-requested a review October 14, 2021 16:35
@crob611
Copy link
Contributor Author

crob611 commented Oct 14, 2021

I've fixed the issue with carrying through url params for the auto redirect case, but still struggling to get it working for the conflict banner case. I'm going to go ahead with this and follow up with an issue outlining what's going on with that conflict case.

Copy link
Contributor

@jportner jportner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested again, all is working great!

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Public APIs missing comments

Total count of every public API that lacks a comment. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats comments for more detailed information.

id before after diff
dashboard 132 134 +2

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
dashboard 135.4KB 136.0KB +663.0B

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
dashboard 181.5KB 182.1KB +632.0B
Unknown metric groups

API count

id before after diff
dashboard 145 147 +2

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@crob611 crob611 merged commit cba8333 into elastic:master Oct 15, 2021
kibanamachine added a commit to kibanamachine/kibana that referenced this pull request Oct 15, 2021
* Switch Dashboard to use savedobjects.resolve when loading

* Don't use LegacyURI Redirect if in screenshot mode

* Pass query string on redirects

* Remove unused import

* Fix carrying query params through redirect

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
@kibanamachine
Copy link
Contributor

💚 Backport successful

Status Branch Result
7.x

This backport PR will be merged automatically after passing CI.

crob611 pushed a commit to crob611/kibana that referenced this pull request Oct 18, 2021
* Switch Dashboard to use savedobjects.resolve when loading

* Don't use LegacyURI Redirect if in screenshot mode

* Pass query string on redirects

* Remove unused import

* Fix carrying query params through redirect

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
crob611 pushed a commit that referenced this pull request Oct 18, 2021
* [Dashboard] Use SavedObjectResolve (#111040)

* Switch Dashboard to use savedobjects.resolve when loading

* Don't use LegacyURI Redirect if in screenshot mode

* Pass query string on redirects

* Remove unused import

* Fix carrying query params through redirect

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>

* Fix issue with importing json dashboards

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
artem-shelkovnikov pushed a commit to artem-shelkovnikov/kibana that referenced this pull request Oct 20, 2021
* Switch Dashboard to use savedobjects.resolve when loading

* Don't use LegacyURI Redirect if in screenshot mode

* Pass query string on redirects

* Remove unused import

* Fix carrying query params through redirect

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-backport Deprecated - use backport:version if exact versions are needed Feature:Dashboard Dashboard related features impact:high Addressing this issue will have a high level of impact on the quality/strength of our product. loe:medium Medium Level of Effort release_note:skip Skip the PR/issue when compiling release notes review Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas v7.16.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants