From 4d413e592dc6aab7faffd1667aed64a1add127dc Mon Sep 17 00:00:00 2001 From: "boyan.tonchev" Date: Wed, 15 Feb 2023 18:19:19 +0200 Subject: [PATCH] Adds patch "2023-02-15-patches_yasqe_to_add_tooltip_to_run_query_button_.patch" --- ..._to_add_tooltip_to_run_query_button_.patch | 58 +++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 yasgui-patches/2023-02-15-patches_yasqe_to_add_tooltip_to_run_query_button_.patch diff --git a/yasgui-patches/2023-02-15-patches_yasqe_to_add_tooltip_to_run_query_button_.patch b/yasgui-patches/2023-02-15-patches_yasqe_to_add_tooltip_to_run_query_button_.patch new file mode 100644 index 00000000..048cdce1 --- /dev/null +++ b/yasgui-patches/2023-02-15-patches_yasqe_to_add_tooltip_to_run_query_button_.patch @@ -0,0 +1,58 @@ +Subject: [PATCH] Patches yasqe to add tooltip to run query button. Fixes translation of run query button +--- +Index: Yasgui/packages/yasqe/src/index.ts +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/Yasgui/packages/yasqe/src/index.ts b/Yasgui/packages/yasqe/src/index.ts +--- a/Yasgui/packages/yasqe/src/index.ts (revision b1b98bbe5cea22ce1336e74618a46ec2a7a0cb24) ++++ b/Yasgui/packages/yasqe/src/index.ts (revision 843859f4518a71f6b3c05f7d5a00ce6cd8096bd5) +@@ -349,7 +349,10 @@ + * Draw query btn + */ + if (this.config.showQueryButton) { ++ const runButtonTooltip = document.createElement("yasgui-tooltip"); ++ runButtonTooltip.setAttribute("placement", "top"); + this.queryBtn = document.createElement("button"); ++ runButtonTooltip.appendChild(this.queryBtn); + this.queryBtn.innerText = this.translationService.translate("yasqe.action.run_query.btn.label"); + addClass(this.queryBtn, "yasqe_queryButton"); + +@@ -372,11 +375,8 @@ + this.query().catch(() => {}); //catch this to avoid unhandled rejection + } + }; +- let runQueryLabel = this.translationService.translate("yasqe.action.run_query.btn.tooltip"); +- this.queryBtn.title = runQueryLabel; +- this.queryBtn.setAttribute("aria-label", runQueryLabel); + +- buttons.appendChild(this.queryBtn); ++ buttons.appendChild(runButtonTooltip); + this.updateQueryButton(); + } + } +@@ -435,15 +435,19 @@ + /** + * Set query status (valid vs invalid) + */ ++ let queryButtonTooltip: string; + if (this.config.queryingDisabled) { + addClass(this.queryBtn, "query_disabled"); +- this.queryBtn.title = this.config.queryingDisabled; ++ queryButtonTooltip = this.translationService.translate("yasqe.action.run_query.btn.disabled.tooltip"); + } else { + removeClass(this.queryBtn, "query_disabled"); +- let runQueryLabel = this.translationService.translate("yasqe.action.run_query.btn.tooltip"); +- this.queryBtn.title = runQueryLabel; +- this.queryBtn.setAttribute("aria-label", runQueryLabel); ++ queryButtonTooltip = this.translationService.translate("yasqe.action.run_query.btn.tooltip"); + } ++ ++ this.queryBtn.parentElement?.setAttribute("data-tooltip", queryButtonTooltip); ++ this.queryBtn.parentElement?.setAttribute("aria-label", queryButtonTooltip); ++ this.queryBtn.innerText = this.translationService.translate("yasqe.action.run_query.btn.label"); ++ + if (!status) { + status = this.queryValid ? "valid" : "error"; + }