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

Expose active app name to plugins #44868

Closed
mshustov opened this issue Sep 5, 2019 · 9 comments
Closed

Expose active app name to plugins #44868

mshustov opened this issue Sep 5, 2019 · 9 comments
Labels
Feature:New Platform Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc

Comments

@mshustov
Copy link
Contributor

mshustov commented Sep 5, 2019

from Slack conversation with @lizozom

In a lot of places we use the current app name for aria messages.

i.e. "Enter a query to search in **** app"
At the moment, these are passed by each app to components in the appName field.
For example, you can see that kbn-top-nav in each app has the name of the app hardcoded. 

A name would preferably be a human readable string.

ATM we havecurrentAppId$ in ApplicationService, but don't export it to the plugins.

Probably we should expose something like applicationService.currentApp$: Observable<{ id: string, name: string;}>

@mshustov mshustov added Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc Feature:New Platform labels Sep 5, 2019
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-platform

@epixa
Copy link
Contributor

epixa commented Sep 5, 2019

Rather than exposing the observable to plugins, what do you think about exposing the current app name itself to the app mount handler? I think that would solve the use cases that were brought up at least.

@joshdover
Copy link
Contributor

I agree it could be provided by the app mount handler as well. We could still eliminate the boilerplate of passing props down for that field to shared components (eg. filter bar, timepicker) by leveraging React Context to populate it.

@lizozom Can you think of any usecase this wouldn't work for?

@mshustov
Copy link
Contributor Author

mshustov commented Sep 5, 2019

New platform plugins instantiated and run even if they aren't rendered on the screen. For me, it's a valid case when a plugin (Monitoring, for example) wants to know what a plugin is visible on the screen. Active plugin already knows own name and there are no needs to pass it in the mount handler. Doesn't it?

@joshdover
Copy link
Contributor

Monitoring and telemetry are both good examples of plugins that may want this information without each app having to integrate with them. Seems like a valid use case to me.

@epixa
Copy link
Contributor

epixa commented Sep 5, 2019

I guess it comes down to this: at this point in time do we create extension points that we think might be useful or focus only on those that are known to be needed? That's a broader question that the platform team should be in agreement about one way or the other.

@lizozom
Copy link
Contributor

lizozom commented Nov 28, 2019

@joshdover my intention was to add the application name, once you provide it, to the KibanaContextProvider we're using.

@joshdover
Copy link
Contributor

@lizozom Each application that depends on that context provider should know what app it is. Do we have an actual known feature requirement that would benefit from this?

@joshdover
Copy link
Contributor

This was solved in #56285

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:New Platform Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc
Projects
None yet
Development

No branches or pull requests

5 participants