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

Added shift+enter to run query in raw query editor #971

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

Conversation

nadav-dav
Copy link
Contributor

@nadav-dav nadav-dav commented Jul 31, 2024

Added shift+enter to run query in raw query editor :)

@nadav-dav nadav-dav requested a review from a team as a code owner July 31, 2024 09:02
@CLAassistant
Copy link

CLAassistant commented Jul 31, 2024

CLA assistant check
All committers have signed the CLA.

@nadav-dav
Copy link
Contributor Author

Hey guys! :) any news about this?

@aangelisc
Copy link
Contributor

Hey @nadav-dav - apologies for the delay, there were some unexpected side-effects that we're looking at before we can give a full review here 😊 thank you for the contribution and for checking in!

@nadav-dav
Copy link
Contributor Author

Any update?

if (e.key === 'Enter' && e.shiftKey) {
e.preventDefault();
e.stopPropagation();
onRawQueryChange();
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
onRawQueryChange();
onRawQueryChange(editorRef.current?.getValue() || '');


const onRawQueryChange = (kql: string) => {
const onRawQueryChange = () => {
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
const onRawQueryChange = () => {
const onRawQueryChange = useCallback(
(kql: string) => {
reportInteraction('grafana_ds_adx_raw_editor_query_blurred');
if (kql !== props.query.query) {
props.setDirty();
props.onChange({
...props.query,
query: kql,
});
props.onRunQuery();
}
},
[props]
);

Copy link
Contributor

@aangelisc aangelisc left a comment

Choose a reason for hiding this comment

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

Hi @nadav-dav, apologies for the delay in reviewing this. I've suggested some changes as the current implementation has some lint issues.

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.

3 participants