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

Chore: fix deprecation issues #1063

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

Chore: fix deprecation issues #1063

wants to merge 5 commits into from

Conversation

ckbedwell
Copy link
Contributor

Problem

A few places in the app are using deprecated methods and functions.

Solution

Update the deprecated methods and remove the unused ones.

@ckbedwell ckbedwell requested a review from a team as a code owner February 10, 2025 10:54
@ckbedwell ckbedwell requested a review from w1kman February 10, 2025 10:54
Copy link
Contributor

@w1kman w1kman left a comment

Choose a reason for hiding this comment

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

I'm glad I didn't say anything when you did the "noise" PR. I guess you saw the same stuff and had the same feeling, regarding the PR legacy warnings :D

LGTM 😍

font-weight: 500;
min-height: ${theme.spacing(3)};
line-height: 1.21em; // To make wrapped text look nice

&::after {
display: 'block' : 'none';
display: 'block';
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
display: 'block';
display: block;

Copy link
Contributor

Choose a reason for hiding this comment

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

On line 142: display: 'none' => display: none;

Copy link
Contributor

Choose a reason for hiding this comment

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

On line 152: background-image: gray; => background-color: gray;

@@ -172,5 +172,6 @@ const getStyles = (theme: GrafanaTheme2) => ({
});

function isMac() {
// eslint-disable-next-line deprecation/deprecation -- doesn't seem to be a stable alternative yet
Copy link
Contributor

Choose a reason for hiding this comment

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

One alternative is to listen to both keys.
"Hold ctrl/cmd to ..."

OR use kbar (used int grafana/grafana). Psst! kbar uses navigator.platform to detect Mac 😅

Either way, I'd modify the code so that navigator.platform can be undefined without the app exploding. With the simplest way being a try-catch.

@w1kman w1kman self-requested a review February 14, 2025 10:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants