mirror of
https://github.com/openobserve/openobserve.git
synced 2026-11-05 00:09:35 +00:00
### **User description** - Config to enable escape quotes.  - Needs to enable it if variable value contains single quote. For example variable value is `EFhoAf&fugy=P'fG;LR;Hr=jTe3fr).p%"` then will require to escape single quote from value.  - For custom typed variables, added some validations: 1. At least one option must there. 2. At lease one option should be selected as default value. ___ ### **PR Type** Enhancement, Bug fix ___ ### **Description** - Add `escapeSingleQuotes` flag to variable config - Provide UI toggle with explanatory tooltip - Update query loader to escape quotes conditionally - Prevent removing last option and enforce default selection ___ ### **Changes walkthrough** 📝 <table><thead><tr><th></th><th align="left">Relevant files</th></tr></thead><tbody><tr><td><strong>Enhancement</strong></td><td><table> <tr> <td> <details> <summary><strong>mod.rs</strong><dd><code>Add escape_single_quotes field to config</code> </dd></summary> <hr> src/config/src/meta/dashboards/v5/mod.rs <li>Introduce <code>escape_single_quotes</code> boolean field<br> <li> Mark field as optional in <code>VariableList</code> struct </details> </td> <td><a href="https://github.com/openobserve/openobserve/pull/7134/files#diff-da49585bbcb02bf0f737bb68739ebc248edd15c7ad9427c0e68f7728bb4a8c17">+2/-0</a> </td> </tr> <tr> <td> <details> <summary><strong>AddSettingVariable.vue</strong><dd><code>Enhance variable settings UI for quote escaping</code> </dd></summary> <hr> web/src/components/dashboards/settings/AddSettingVariable.vue <li>Add <code>escapeSingleQuotes</code> toggle with tooltip<br> <li> Initialize default <code>escapeSingleQuotes</code> value to false<br> <li> Disable remove button when only one option remains<br> <li> Validate at least one default selection for custom variables </details> </td> <td><a href="https://github.com/openobserve/openobserve/pull/7134/files#diff-e622f54c1f7629ee67d29ed2fc87008d07eb9246767a05435cc42c3c17ce459a">+53/-1</a> </td> </tr> <tr> <td> <details> <summary><strong>usePanelDataLoader.ts</strong><dd><code>Implement conditional quote escaping in loader</code> </dd></summary> <hr> web/src/composables/dashboard/usePanelDataLoader.ts <li>Import <code>escapeSingleQuotes</code> utility<br> <li> Conditionally escape single quotes in variable values<br> <li> Apply escaping for both array and scalar values </details> </td> <td><a href="https://github.com/openobserve/openobserve/pull/7134/files#diff-5a42e9493a7bcd722b88e61fd38883c4f61001bc9cafa399f65f8eafda3aace9">+14/-2</a> </td> </tr> </table></td></tr><tr><td><strong>Documentation</strong></td><td><table> <tr> <td> <details> <summary><strong>en.json</strong><dd><code>Add translation for escapeSingleQuotes</code> </dd></summary> <hr> web/src/locales/languages/en.json - Add `"escapeSingleQuotes": "Escape Single Quotes"` entry </details> </td> <td><a href="https://github.com/openobserve/openobserve/pull/7134/files#diff-892aa3d75ab6e129ef9116aa21bec1b9a15ba69ce5366d2a19128078c690d824">+1/-0</a> </td> </tr> </table></td></tr></tr></tbody></table> ___ > <details> <summary> Need help?</summary><li>Type <code>/help how to ...</code> in the comments thread for any questions about PR-Agent usage.</li><li>Check out the <a href="https://qodo-merge-docs.qodo.ai/usage-guide/">documentation</a> for more information.</li></details>
zinc-observe-ui-automation
#Install cypress in project directory npm install cypress --save-dev
To run Tests from local
npx cypress open
To run Tests from local and push result in cypress cloud
./node_modules/.bin/cypress run --record --key cef585a4-1439-4580-bfce-d62230663b22