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][Extension] Document Viewer #185940

Merged
merged 15 commits into from
Jun 17, 2024

Conversation

jughosta
Copy link
Contributor

@jughosta jughosta commented Jun 11, 2024

Summary

This PR adds extension points to Doc Viewer flyout:

  • title
  • docViewsRegistry.

Example:

profile: {
    getDocViewer: (prev) => (params) => {
      const recordId = params.record.id;
      const prevValue = prev(params);
      return {
        title: `${prevValue.title} #${recordId}`,
        docViewsRegistry: (registry) => {
          registry.enableById('doc_view_logs_overview');
          return prevValue.docViewsRegistry(registry);
        },
      };
    },
  },

Checklist

@jughosta jughosta added release_note:skip Skip the PR/issue when compiling release notes backport:skip This commit does not require backporting Team:DataDiscovery Discover, search (e.g. data plugin and KQL), data views, saved searches. For ES|QL, use Team:ES|QL. Project:OneDiscover Enrich Discover with contextual awareness labels Jun 11, 2024
@jughosta jughosta self-assigned this Jun 11, 2024
@jughosta
Copy link
Contributor Author

/ci

@jughosta jughosta marked this pull request as ready for review June 11, 2024 14:26
@jughosta jughosta requested a review from a team as a code owner June 11, 2024 14:26
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-data-discovery (Team:DataDiscovery)

Copy link
Contributor

@davismcphee davismcphee left a comment

Choose a reason for hiding this comment

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

Code changes look and work great! I'll have some minor conflicts to resolve in #185905 once this is merged since I've removed example_profiles.tsx, but should be pretty straightforward. Thanks and LGTM 👍

I would like us to add some example functional tests for this once #185905 is merged though, so I'd recommend we either don't resolve #184084 until those are added, or create a followup issue specifically for the functional tests. Either way is fine for me.

src/plugins/discover/public/context_awareness/types.ts Outdated Show resolved Hide resolved
src/plugins/discover/public/context_awareness/types.ts Outdated Show resolved Hide resolved
@jughosta
Copy link
Contributor Author

Thanks, @davismcphee, for the review!

I am going to add functional tests separately #186265 as this PR is otherwise delaying #175787

@jughosta jughosta enabled auto-merge (squash) June 17, 2024 07:36
@kibana-ci
Copy link
Collaborator

💛 Build succeeded, but was flaky

Failed CI Steps

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 809.3KB 809.5KB +204.0B

History

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

cc @jughosta

@jughosta jughosta merged commit e78c722 into elastic:main Jun 17, 2024
27 of 28 checks passed
@jughosta jughosta deleted the 184084-extensions-for-doc-viewer branch July 12, 2024 16:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting Project:OneDiscover Enrich Discover with contextual awareness release_note:skip Skip the PR/issue when compiling release notes Team:DataDiscovery Discover, search (e.g. data plugin and KQL), data views, saved searches. For ES|QL, use Team:ES|QL. v8.15.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Discover][Extension] Document Viewer
5 participants