Refresh index pattern list before redirecting#63329
Refresh index pattern list before redirecting#63329flash1293 merged 14 commits intoelastic:masterfrom
Conversation
|
@elasticmachine merge upstream |
|
@elasticmachine merge upstream |
…kibana into fix-index-pattern-refresh-bug
| public async clickNewDashboard() { | ||
| await listingTable.clickNewButton('createDashboardPromptButton'); | ||
| // make sure the dashboard page is shown | ||
| await this.waitForRenderComplete(); |
There was a problem hiding this comment.
When switching to a dashboard, we introduce an additional delay with this change because another network roundtrip is necessary. This stabilizes the test so it doesn't fail.
|
Pinging @elastic/kibana-app (Team:KibanaApp) |
|
@kertal Moved the fix for index pattern deletion over here as well. |
| Promise.resolve($scope.indexPattern.destroy()) | ||
| .then(function() { | ||
| npStart.plugins.data.indexPatterns.clearCache(); | ||
| $location.url('/management/kibana/index_patterns'); |
There was a problem hiding this comment.
Wouldn't it be better if we clear the index pattern cache upon arrival to management?
Otherwise, if we get to that route from a different path, we'll have different behaviors.
There was a problem hiding this comment.
I'm just realizing we don't even need this clear cache to fix the bug because it already gets cleared when switching over to discover.
The index pattern listing in management is not affected by this because it's using the raw saved object client.
I will just revert this line.
|
@elasticmachine merge upstream |
|
ACK, will review today |
💚 Build SucceededHistory
To update your PR or re-run it, just comment with: |
* master: (29 commits) [Dashboard] Deangularize navbar, attempt nr. 2 (elastic#61611) refactor action filter creation utils (elastic#62969) Refresh index pattern list before redirecting (elastic#63329) [APM]fixing custom link unit tests (elastic#64045) [Ingest] EPM & Fleet are enabled when Ingest is enabled (elastic#64103) [Alerting] Fixed bug with no possibility to edit the index name after adding (elastic#64033) [Maps] Map settings: min and max zoom (elastic#63714) [kbn-storybook] Use raw loader for text files (elastic#64108) [EPM] /packages/{package} endpoint to support upgrades (elastic#63629) [SIEM] New Platform Saved Objects Registration (elastic#64029) [Endpoint] Hook to handle events needing navigation via Router (elastic#63863) Fixed small issue in clone functionality (elastic#64085) [Endpoint]EMT-146: use ingest agent for status info (elastic#63921) [SIEM] Server NP Followup (elastic#64010) Register uiSettings on New Platform (elastic#64015) [Reporting] Integration polling config with client code (elastic#63754) [Docs]7.7 SIEM doc updates (elastic#63951) [SIEM] [Cases] Tags suggestions (elastic#63878) Include datasource UUID in agent config yaml, adjust overflow height of yaml view (elastic#64027) [DOCS] Add file size setting for Data Visualizer (elastic#64006) ...
…ana into task-manager/cancel-logging * 'task-manager/cancel-logging' of github.com:gmmorris/kibana: (28 commits) [Dashboard] Deangularize navbar, attempt nr. 2 (elastic#61611) refactor action filter creation utils (elastic#62969) Refresh index pattern list before redirecting (elastic#63329) [APM]fixing custom link unit tests (elastic#64045) [Ingest] EPM & Fleet are enabled when Ingest is enabled (elastic#64103) [Alerting] Fixed bug with no possibility to edit the index name after adding (elastic#64033) [Maps] Map settings: min and max zoom (elastic#63714) [kbn-storybook] Use raw loader for text files (elastic#64108) [EPM] /packages/{package} endpoint to support upgrades (elastic#63629) [SIEM] New Platform Saved Objects Registration (elastic#64029) [Endpoint] Hook to handle events needing navigation via Router (elastic#63863) Fixed small issue in clone functionality (elastic#64085) [Endpoint]EMT-146: use ingest agent for status info (elastic#63921) [SIEM] Server NP Followup (elastic#64010) Register uiSettings on New Platform (elastic#64015) [Reporting] Integration polling config with client code (elastic#63754) [Docs]7.7 SIEM doc updates (elastic#63951) [SIEM] [Cases] Tags suggestions (elastic#63878) Include datasource UUID in agent config yaml, adjust overflow height of yaml view (elastic#64027) [DOCS] Add file size setting for Data Visualizer (elastic#64006) ...
Summary
Fixes #63173
Fixes #63180
Fixes #62269
Before redirecting to the management page because no index pattern is available, refresh the cached index pattern list. This prevents a confusing (and unnecessary) redirect to the management page when accessing Discover/Visualize/Dashboard in a bunch of situations because the index pattern cache can become stale e.g. when importing a saved object.
Initially I was refreshing the cache every time the
ensureDefaultIndexPatternhelper was called, but this slows down a lot of page navigations (e.g. switching between visualizations), so I moved it to the mount callbacks of the individual apps.