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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user