Skip to content

[ES|QL] Navigate to create new policy page from the editor#167012

Merged
stratoula merged 9 commits intoelastic:mainfrom
stratoula:esql-enrich-app-connection
Sep 27, 2023
Merged

[ES|QL] Navigate to create new policy page from the editor#167012
stratoula merged 9 commits intoelastic:mainfrom
stratoula:esql-enrich-app-connection

Conversation

@stratoula
Copy link
Copy Markdown
Contributor

@stratoula stratoula commented Sep 22, 2023

Summary

When a user is writing am ES|QL query with the enrich command and doesn't have a policy then we want to navigate them from the editor to the index management page to create one.

In the future the same action can open a flyout in order for the users to not change context but we don't have it atm.

enrich

@stratoula stratoula added Feature:ES|QL ES|QL related features in Kibana release_note:skip Skip the PR/issue when compiling release notes backport:skip This PR does not require backporting labels Sep 22, 2023
@stratoula stratoula marked this pull request as ready for review September 22, 2023 10:18
@stratoula stratoula requested review from a team as code owners September 22, 2023 10:18
@stratoula stratoula added the Team:Visualizations Team label for Lens, elastic-charts, Graph, legacy editors (TSVB, Visualize, Timelion) t// label Sep 22, 2023
@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/kibana-visualizations (Team:Visualizations)

Copy link
Copy Markdown
Contributor

@dej611 dej611 left a comment

Choose a reason for hiding this comment

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

Had a first review round

// Registers a command to redirect users to the index management page
// to create a new policy. The command is called by the buildNoPoliciesAvailableDefinition
monaco.editor.registerCommand('esql.policies.create', (...args) => {
application?.navigateToApp('management', {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

So I'm a bit two mind here: if I type

from index | enrich _

at this point hitting enter will exit Discover and navigate to the Policy page. I'm not clicking and everything I've done so far (the ES|QL query) will be lost.

Perhaps a confirm modal would help? Or perhaps open it in another tab?
I'm all in for make it easy, but the transition feels too brutal to me.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I hear it, I changed it to open in a new tab. I am not a fan of modals and the goal is to have a flyout so opening in a new tab is a good one for the initial release

Copy link
Copy Markdown
Contributor

@dej611 dej611 left a comment

Choose a reason for hiding this comment

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

Tested and it works great now! 🎉

@stratoula stratoula enabled auto-merge (squash) September 27, 2023 09:45
@stratoula stratoula merged commit 32562aa into elastic:main Sep 27, 2023
@kibana-ci
Copy link
Copy Markdown

💚 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
textBasedLanguages 148.5KB 148.7KB +211.0B

Page load bundle

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

id before after diff
kbnUiSharedDeps-srcJs 2.2MB 2.2MB +137.0B

History

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:skip This PR does not require backporting Feature:ES|QL ES|QL related features in Kibana release_note:skip Skip the PR/issue when compiling release notes Team:Visualizations Team label for Lens, elastic-charts, Graph, legacy editors (TSVB, Visualize, Timelion) t// v8.11.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants