Skip to content

Commit

Permalink
[8.9] [Discover] Refresh fields when entering Discover (#160195) (#16…
Browse files Browse the repository at this point in the history
…1154)

# Backport

This will backport the following commits from `main` to `8.9`:
- [[Discover] Refresh fields when entering Discover
(#160195)](#160195)

<!--- Backport version: 8.9.7 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Julia
Rechkunova","email":"[email protected]"},"sourceCommit":{"committedDate":"2023-07-04T08:19:30Z","message":"[Discover]
Refresh fields when entering Discover (#160195)\n\n- Closes
https://github.com/elastic/kibana/issues/156556\r\n- Probably also
addresses\r\nhttps://github.com//issues/157239\r\n\r\n##
Summary\r\n\r\nThis PR allows to refresh fields list when revisiting
Discover page.\r\n\r\n## For testing\r\n\r\n1. Open discover\r\n2. In a
separate tab open Dev Tools and create documents which include\r\nnew
field names\r\n3. Press \"Refresh\" in the unified search bar on
Discover and notice that\r\nnew fields appear under Unmapped
section\r\n4. Navigate to another Kibana app (for example Home
page)\r\n5. Navigate back to Discover and notice that new fields are now
under\r\nAvailable section and have a proper
icon.","sha":"4819efa8eb16529db807043d36a1214070e10c79","branchLabelMapping":{"^v8.10.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Team:DataDiscovery","backport:prev-minor","v8.10.0"],"number":160195,"url":"https://github.com/elastic/kibana/pull/160195","mergeCommit":{"message":"[Discover]
Refresh fields when entering Discover (#160195)\n\n- Closes
https://github.com/elastic/kibana/issues/156556\r\n- Probably also
addresses\r\nhttps://github.com//issues/157239\r\n\r\n##
Summary\r\n\r\nThis PR allows to refresh fields list when revisiting
Discover page.\r\n\r\n## For testing\r\n\r\n1. Open discover\r\n2. In a
separate tab open Dev Tools and create documents which include\r\nnew
field names\r\n3. Press \"Refresh\" in the unified search bar on
Discover and notice that\r\nnew fields appear under Unmapped
section\r\n4. Navigate to another Kibana app (for example Home
page)\r\n5. Navigate back to Discover and notice that new fields are now
under\r\nAvailable section and have a proper
icon.","sha":"4819efa8eb16529db807043d36a1214070e10c79"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v8.10.0","labelRegex":"^v8.10.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/160195","number":160195,"mergeCommit":{"message":"[Discover]
Refresh fields when entering Discover (#160195)\n\n- Closes
https://github.com/elastic/kibana/issues/156556\r\n- Probably also
addresses\r\nhttps://github.com//issues/157239\r\n\r\n##
Summary\r\n\r\nThis PR allows to refresh fields list when revisiting
Discover page.\r\n\r\n## For testing\r\n\r\n1. Open discover\r\n2. In a
separate tab open Dev Tools and create documents which include\r\nnew
field names\r\n3. Press \"Refresh\" in the unified search bar on
Discover and notice that\r\nnew fields appear under Unmapped
section\r\n4. Navigate to another Kibana app (for example Home
page)\r\n5. Navigate back to Discover and notice that new fields are now
under\r\nAvailable section and have a proper
icon.","sha":"4819efa8eb16529db807043d36a1214070e10c79"}}]}] BACKPORT-->

Co-authored-by: Julia Rechkunova <[email protected]>
  • Loading branch information
kibanamachine and jughosta authored Jul 4, 2023
1 parent b94d041 commit 64a465c
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export async function loadDataView({
let fetchedDataView: DataView | null = null;
// try to fetch adhoc data view first
try {
fetchedDataView = fetchId ? await dataViews.get(fetchId, false) : null;
fetchedDataView = fetchId ? await dataViews.get(fetchId, false, true) : null;
if (fetchedDataView && !fetchedDataView.isPersisted()) {
return {
list: dataViewList || [],
Expand All @@ -88,7 +88,10 @@ export async function loadDataView({
let defaultDataView: DataView | null = null;
if (!fetchedDataView) {
try {
defaultDataView = await dataViews.getDefaultDataView({ displayErrors: false });
defaultDataView = await dataViews.getDefaultDataView({
displayErrors: false,
refreshFields: true,
});
} catch (e) {
//
}
Expand Down

0 comments on commit 64a465c

Please sign in to comment.