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

[Discover] Fix link from dashboard saved search to Discover #92937

Merged
merged 9 commits into from
Mar 3, 2021

Conversation

wylieconlon
Copy link
Contributor

@wylieconlon wylieconlon commented Feb 25, 2021

Steps to test:

  1. Add a saved search to a dashboard
  2. Expand the row and click "view surrounding"
  3. No errors

Also, test:

  1. Add a saved search to a dashboard
  2. Expand the row and click "view single doc"
  3. No errors

Fixes #92904

Checklist

@wylieconlon wylieconlon added Feature:Discover Discover Application release_note:fix Team:Visualizations Visualization editors, elastic-charts and infrastructure v8.0.0 v7.12.0 v7.13.0 labels Feb 25, 2021
@wylieconlon wylieconlon requested review from kertal and a team February 25, 2021 23:34
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-app (Team:KibanaApp)

@@ -94,5 +103,25 @@ export default function ({ getService, getPageObjects }) {
await PageObjects.discover.waitForDiscoverAppOnScreen();
await PageObjects.discover.waitForDocTableLoadingComplete();
});

it('navigates to context view from embeddable', async () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

thanx for adding a functional test!

Copy link
Member

@kertal kertal Mar 2, 2021

Choose a reason for hiding this comment

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

Thanks!! It also tests the doc view of Discover which seems to be a blind spot in functional testing of Discover (Might be because it was a separate plugin without coverage, migrated to the Discover folder). I think the title should be navigate to doc view from embeddable

@@ -78,5 +86,26 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
}
expect(disabledFilterCounter).to.be(TEST_FILTER_COLUMN_NAMES.length);
});

// Skipped because there is a bug in the data grid row expansion
it.skip('navigates to context view from embeddable', async () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

Copy link
Member

@kertal kertal Mar 2, 2021

Choose a reason for hiding this comment

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

should now be safe to unskip (and change to the title to navigate to doc view), since it was resolved in #92999

Copy link
Contributor

@majagrubic majagrubic left a comment

Choose a reason for hiding this comment

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

Tested in Chrome on Mac OS and works as expected. Not sure what the functional test failure is, I haven't found any issues with the context view as such. It there are no actual issues, feel free to merge once that's settled

@wylieconlon
Copy link
Contributor Author

I figured out the issue in the tests. There were two problems in the functional test as written:

  1. The test passed before navigating, even though the whole point was to navigate away from dashboard
  2. Even though the next test starts with a navigateToContext section, this section was written using outdated code style and was not actually functioning. So I fixed this first, and then fixed the test itself.

@wylieconlon
Copy link
Contributor Author

I previously commented about the outdated code style of the context navigation, but I tried a few variants that didn't work either. So I'm reverting that part of the change. The tests now pass because I fixed the behavior of the Dashboard -> Single doc view, which sets up the next test so it can pass too.

@@ -44,6 +44,7 @@
index-pattern="indexPattern"
filter="filter"
class="kbnDocTable__row"
data-test-subj="docTableRow{{ row['$$_isAnchor'] ? ' docTableAnchorRow' : ''}}"
Copy link
Member

Choose a reason for hiding this comment

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

Nit: docTableAnchorRow should not be necessary here, it's just used in context view and there infinite-scroll is set to true. It's here added to the paginated doc table that's used in the embeddable.

@@ -12,19 +12,32 @@ const filterManager = ({
getGlobalFilters: () => [],
getAppFilters: () => [],
} as unknown) as FilterManager;
const addBasePath = (path: string) => `/base/${path}`;
Copy link
Member

Choose a reason for hiding this comment

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

Nit: /base/${path} -> /base${path} and the expected url would be /base/app/....

Copy link
Member

@kertal kertal left a comment

Choose a reason for hiding this comment

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

Thanks a lot for fixing this! 👍 Code LGTM, just a few minor comments, tested locally in Safari. works as expected.

@kertal
Copy link
Member

kertal commented Mar 3, 2021

QQ: @flash1293 there were some redirects for context and doc implemented when we moved this to NP, do you know, were they removed on purpose, because this links used to work recently.

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Async chunks

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

id before after diff
discover 401.2KB 401.6KB +370.0B
triggersActionsUi 1.6MB 1.5MB -23.9KB
total -23.5KB

Page load bundle

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

id before after diff
triggersActionsUi 104.0KB 104.1KB +82.0B
Unknown metric groups

async chunk count

id before after diff
triggersActionsUi 41 42 +1

History

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

@wylieconlon wylieconlon merged commit 799c05e into elastic:master Mar 3, 2021
@wylieconlon wylieconlon deleted the discover/fix-context-url branch March 3, 2021 19:47
wylieconlon pushed a commit to wylieconlon/kibana that referenced this pull request Mar 3, 2021
…92937)

* [Discover] Fix link from dashboard saved search to Discover

* Fix tests that weren't fully testing the navigation

* Fix snapshot

* Fix test navigation to context app by reverting to previous

* Unskip functional test and fix issue in data grid

* Respond to review comments
wylieconlon pushed a commit to wylieconlon/kibana that referenced this pull request Mar 3, 2021
…92937)

* [Discover] Fix link from dashboard saved search to Discover

* Fix tests that weren't fully testing the navigation

* Fix snapshot

* Fix test navigation to context app by reverting to previous

* Unskip functional test and fix issue in data grid

* Respond to review comments
wylieconlon pushed a commit that referenced this pull request Mar 4, 2021
…93500)

* [Discover] Fix link from dashboard saved search to Discover

* Fix tests that weren't fully testing the navigation

* Fix snapshot

* Fix test navigation to context app by reverting to previous

* Unskip functional test and fix issue in data grid

* Respond to review comments

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
wylieconlon pushed a commit that referenced this pull request Mar 4, 2021
…93499)

* [Discover] Fix link from dashboard saved search to Discover

* Fix tests that weren't fully testing the navigation

* Fix snapshot

* Fix test navigation to context app by reverting to previous

* Unskip functional test and fix issue in data grid

* Respond to review comments

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
gmmorris added a commit to gmmorris/kibana that referenced this pull request Mar 4, 2021
* master: (48 commits)
  Fix wrong import in data plugin causing 100kB bundle increase (elastic#93448)
  [Fleet] Correctly track install status of an integration (elastic#93464)
  Reviews data frame analytics UI text (elastic#93033)
  Display multiple copyable fields for process.args in resolver node detail panel (elastic#93280)
  [Security Solution][Detections] ML Popover overflow fix (elastic#93525)
  chore(NA): do not use execa on bazel workspace status update script (elastic#93532)
  Bump dependencies (elastic#93511)
  [dev/build_ts_refs] support disabling the ts-refs build completely (elastic#93529)
  [Security Solution] fix data provider cypress test (elastic#93465)
  Fix service map for All environment single service (elastic#93517)
  [Fleet] Fix package version comparaison in the UI (elastic#93498)
  [alerting] adds doc on JSON-expanded action variables and task manager max_workers (elastic#92720)
  [dev/build_ts_refs] ignore type checking failures when building ts refs (elastic#93473)
  [core-new-docs] Adds a dev-doc for core documentation (elastic#92976)
  remove opacity from maps legacy style (elastic#93456)
  [Security Solution][Lists] Escape quotes in list ids and quote the id in KQL query (elastic#93176)
  Revert "Make tests deterministic by providing unique timestamps (elastic#93350)"
  [Discover] Fix link from dashboard saved search to Discover (elastic#92937)
  update public api docs
  App Search - Polishing Analytics Views (elastic#92939)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Discover Discover Application release_note:fix Team:Visualizations Visualization editors, elastic-charts and infrastructure v7.12.0 v7.13.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Discover] unable to view single document or context from Dashboard
5 participants