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

Dashboards: Add alert and panel icon for dashboards that use Angular plugins #70951

Merged
merged 34 commits into from
Aug 29, 2023

Conversation

xnyo
Copy link
Member

@xnyo xnyo commented Jun 30, 2023

What is this feature?

  • Adds a feature flag angularDeprecationUI which enables the UI changes described below
  • Adds a yellow warning icon next to panels that use an Angular panel plugin or Angular datasource plugin
  • Adds a dismissable alert at the top of the dashboard if any Angular panels or Angular datasources are detected in the current dashboard.
    • The alert dismissable state is saved per dashboard and per browser, using the browser's localstorage.

Angular panel/datasource icon

image

Tooltip on hover

Angular panels:
image

Angular datasources:
image

Dashboard alert (complete example)

image

Why do we need this feature?

To notify users about Angular panels and Angular datasources in their dashboards

Who is this feature for?

Grafana users who rely on Angular panels and datasources

Which issue(s) does this PR fix?:

Related to #68974

Special notes for your reviewer:

Please check that:

  • It works as expected from a user's perspective.
  • If this is a pre-GA feature, it is behind a feature toggle.
  • The docs are updated, and if this is a notable improvement, it's added to our What's New doc.

@xnyo xnyo added area/dashboard area/plugins area/frontend add to changelog javascript Pull requests that update Javascript code no-backport Skip backport of PR labels Jun 30, 2023
@xnyo xnyo added this to the 10.1.x milestone Jun 30, 2023
@xnyo xnyo self-assigned this Jun 30, 2023
@xnyo xnyo changed the title WIP: Dashboards: Angular deprecation: Add alert to dashboard and icon to panels WIP: Dashboards: Angular deprecation: Add UI elements in dashboards that use Angular plugins Jun 30, 2023
@xnyo xnyo changed the title WIP: Dashboards: Angular deprecation: Add UI elements in dashboards that use Angular plugins WIP: Dashboards: Add alert and panel icons for dashboards that use Angular plugins Jun 30, 2023
@sympatheticmoose
Copy link
Contributor

Feedback from UX included a suggestion to keep the deprecation warning messaging consistent, but also to ensure it was appropriate for the target audience and best advertised appropriate action.

In terms of consistency, we have introduced:

  • "This plugin uses a deprecated, legacy platform based on AngularJS and [ will stop working in future releases of Grafana | is incompatible with your current Grafana configuration]" as our "long" message with a link to https://grafana.com/docs/grafana/latest/developers/angular_deprecation/.
  • "This plugin uses deprecated functionality, support for which is being removed" as our "short" message under an Angular title

Current "long" message for the dashboard notification:

Title: This dashboard is using deprecated plugin APIs
Details: There are panels or datasources in this dashboard that are using deprecated plugin APIs

Current "short" message in panel warning:

This panel or its datasource is using deprecated plugin APIs

We likely need to explicitly reference Angular, and definitely need provide a link to the deprecation notice, wdyt about:

Dashboard Notification:
Title: This dashboard depends on Angular which is deprecated and [ will stop working in future releases of Grafana | is incompatible with your current Grafana configuration].

Description: Read our deprecation notice and migration advice.

Panel Warning:
This panel or its datasource requires Angular (deprecated).

Copy link
Contributor

@mckn mckn left a comment

Choose a reason for hiding this comment

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

I still think this becomes a bit noisy but I don't have any better suggestions so 👍🏻 from me! Great work on this!

Copy link
Member

@torkelo torkelo left a comment

Choose a reason for hiding this comment

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

Not sure about showing the dashboard banner to all users and linking the dismissed state to uid and every user (local storage). Means a heck of a lot of showings & dismiss actions


export function AngularDeprecationNotice({ dashboardUid }: Props) {
return (
<LocalStorageValueProvider<boolean> storageKey={localStorageKey(dashboardUid)} defaultValue={false}>
Copy link
Member

Choose a reason for hiding this comment

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

having the storage key include uid means it could show up on all dashboards potentially and have to be dismissed A LOT by every user.

@@ -387,6 +388,9 @@ export class UnthemedDashboardPage extends PureComponent<Props, State> {
<SubMenu dashboard={dashboard} annotations={dashboard.annotations.list} links={dashboard.links} />
</section>
)}
{config.featureToggles.angularDeprecationUI && dashboard.hasAngularPlugins() && dashboard.uid !== null && (
Copy link
Member

Choose a reason for hiding this comment

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

Maybe we should have a check here that this is only shown to dashboard users who have edit permissions?

Copy link
Contributor

Choose a reason for hiding this comment

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

we could but then it makes it difficult for a viewer to discover that a dashboard they rely on has this issue

@xnyo xnyo force-pushed the giuseppe/angular-deprecation/dashboard branch from 11e7108 to e41d759 Compare August 2, 2023 12:32
@xnyo xnyo modified the milestones: 10.1.x, 10.2.x Aug 2, 2023
@xnyo
Copy link
Member Author

xnyo commented Aug 28, 2023

cc @sympatheticmoose

We would like to merge this PR in the current state. It is also behind a feature flag, so it won't be visible by default for now. Our plan is to slowly roll this out to HG and see the impact/feedback on it, and refine if necessary.

@mckn please can you review the few changes I made after your PR review so we can merge?

@xnyo xnyo requested a review from mckn August 28, 2023 08:46
Copy link
Contributor

@mckn mckn left a comment

Choose a reason for hiding this comment

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

LGTM!

@xnyo xnyo merged commit bf4d025 into main Aug 29, 2023
19 checks passed
@xnyo xnyo deleted the giuseppe/angular-deprecation/dashboard branch August 29, 2023 14:05
chauchausoup pushed a commit to chauchausoup/grafana that referenced this pull request Sep 15, 2023
…plugins (grafana#70951)

* Add angularDeprecationUI feature toggle

* Add angular notice in angular panel header

* Show angular notice for angular datasources

* Show angular notice at the top of the dashboard

* Changed Angular deprecation messages

* Fix angular deprecation alert displayed for new dashboards

* re-generate feature flags

* Removed unnecessary changes

* Add angular deprecation dashboard notice tests

* Add test for angular deprecation panel icon

* Update test suite name

* Moved isAngularDatasourcePlugin to app/features/plugins/angularDeprecation

* Add hasAngularPlugins to DashboardModel

* re-generate feature toggles

* Fix tests

* Fix data source spelling

* Fix typing issues

* Extract plugin type into a separate function

* re-generate feature flags

* reportInteraction on angular dashboard notice dismiss

* re-generate feature flags

* Re-generate feature flags

* lint
rwwiv pushed a commit that referenced this pull request Oct 2, 2023
…plugins (#70951)

* Add angularDeprecationUI feature toggle

* Add angular notice in angular panel header

* Show angular notice for angular datasources

* Show angular notice at the top of the dashboard

* Changed Angular deprecation messages

* Fix angular deprecation alert displayed for new dashboards

* re-generate feature flags

* Removed unnecessary changes

* Add angular deprecation dashboard notice tests

* Add test for angular deprecation panel icon

* Update test suite name

* Moved isAngularDatasourcePlugin to app/features/plugins/angularDeprecation

* Add hasAngularPlugins to DashboardModel

* re-generate feature toggles

* Fix tests

* Fix data source spelling

* Fix typing issues

* Extract plugin type into a separate function

* re-generate feature flags

* reportInteraction on angular dashboard notice dismiss

* re-generate feature flags

* Re-generate feature flags

* lint
@zerok zerok modified the milestones: 10.2.x, 10.2.0 Oct 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging this pull request may close these issues.

None yet

6 participants