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

[Alerting] Avoid invalid characters in copied rule expression #57839

Merged
merged 2 commits into from
Oct 28, 2022

Conversation

VikaCep
Copy link
Contributor

@VikaCep VikaCep commented Oct 28, 2022

What is this feature?

Allows to copy rule expressions without adding invalid characters in the pasted text.

Why do we need this feature?

Copying an expression and pasting it resulted in text that contained unwanted UTF-8 byte order mark characters.

Which issue(s) does this PR fix?:

Fixes #57610

Special notes for your reviewer:

Before:

2022-10-28 13 12 07

After:

2022-10-28 13 12 41

The issue happened when the slate-react's Editor had the readOnly=true prop. Setting it to false prevents it from happening, but the editor is still non-editable regardless of that. The issue is reported in the Slate repo: ianstormtaylor/slate#2597

@VikaCep VikaCep added the area/alerting Grafana Alerting label Oct 28, 2022
@VikaCep VikaCep added this to the 9.2.3 milestone Oct 28, 2022
@VikaCep VikaCep self-assigned this Oct 28, 2022
@VikaCep VikaCep requested a review from a team October 28, 2022 16:21
@gillesdemey
Copy link
Member

Nice one! Should we add code comment saying we shouldn’t pass the readOnly prop and link it to this PR in case the next person who looks at this wants to add it? :)

Copy link
Contributor

@konrad147 konrad147 left a comment

Choose a reason for hiding this comment

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

Nice finding! LGTM

@VikaCep
Copy link
Contributor Author

VikaCep commented Oct 28, 2022

Nice one! Should we add code comment saying we shouldn’t pass the readOnly prop and link it to this PR in case the next person who looks at this wants to add it? :)

Good idea! Done.

@VikaCep VikaCep added no-changelog Skip including change in changelog/release notes no-backport Skip backport of PR labels Oct 28, 2022
@grafanabot
Copy link
Contributor

@VikaCep VikaCep merged commit c73b499 into main Oct 28, 2022
@VikaCep VikaCep deleted the 57610-copy-alert-rule-expr branch October 28, 2022 18:40
@marefr marefr modified the milestones: 9.2.3, 9.3.0 Oct 31, 2022
@marefr
Copy link
Contributor

marefr commented Oct 31, 2022

@VikaCep changed the milestone to 9.3.0 since targeting main without any backports.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/alerting Grafana Alerting area/frontend enterprise-failed no-backport Skip backport of PR no-changelog Skip including change in changelog/release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Alert rule expression copied from 'Alert rules' page contains several UTF-8 BOMs
6 participants