Plugins: Angular deprecation: Fix AngularDeprecationNotice not being rendered on first page load (#83221)

* Plugins: Angular deprecation: Wait for plugins to be inizialized before rendering AngularDeprecationNotice

* use then

* fix tests

* mockCleanUpDashboardAndVariables.mockReset();

* Handle plugin not found

* PR review feedback

* Add comment

* removed unnecessary return

* PR review feedback

* Use grafanaBootData

* Removed comments

* fix tests

* Use config for hideDeprecation as well
This commit is contained in:
Giuseppe Guerra 2024-02-27 15:14:23 +01:00 committed by GitHub
parent a8574226bb
commit e068804a9e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1338,7 +1338,9 @@ export class DashboardModel implements TimeModel {
hasAngularPlugins(): boolean {
return this.panels.some((panel) => {
// Return false for plugins that are angular but have angular.hideDeprecation = false
const isAngularPanel = panel.isAngularPlugin() && !panel.plugin?.meta.angular?.hideDeprecation;
// We cannot use panel.plugin.isAngularPlugin() because panel.plugin may not be initialized at this stage.
const isAngularPanel =
config.panels[panel.type]?.angular?.detected && !config.panels[panel.type]?.angular?.hideDeprecation;
let isAngularDs = false;
if (panel.datasource?.uid) {
isAngularDs = isAngularDatasourcePluginAndNotHidden(panel.datasource?.uid);