### **PR Type** Bug fix, Enhancement ___ ### **Description** - Validate dashboard JSON before import - Handle duplicate panel IDs in retrieval - Refine GridStack layout update logic - Improve error and import messages ___ ### **Changes diagram** ```mermaid flowchart LR node1["getDashboard called"] node2["fixDuplicatePanelIds"] node3["duplicates?"] node4["updateDashboard & re-fetch"] node5["return dashboard"] node1 --> node2 node2 --> node3 node3 -- "true" --> node4 node3 -- "false" --> node5 node4 --> node5 ``` ___ ### **Changes walkthrough** 📝 <table><thead><tr><th></th><th align="left">Relevant files</th></tr></thead><tbody><tr><td><strong>Error handling</strong></td><td><table> <tr> <td> <details> <summary><strong>ImportDashboard.vue</strong><dd><code>Add dashboard JSON validation before import</code> </dd></summary> <hr> web/src/views/Dashboards/ImportDashboard.vue <li>Imported <code>validateDashboardJson</code> utility<br> <li> Added schema validation before each import step<br> <li> Extended error <code><span></code> for <code>dashboard_validation</code><br> <li> Reformatted promise and notification code </details> </td> <td><a href="https://github.com/openobserve/openobserve/pull/7558/files#diff-660ac197e10735b4f08fc4b5a39744187d16c14156ced00eefde09dbaec323f0">+85/-25</a> </td> </tr> </table></td></tr><tr><td><strong>Enhancement</strong></td><td><table> <tr> <td> <details> <summary><strong>RenderDashboardCharts.vue</strong><dd><code>Improve GridStack layout update logic</code> </dd></summary> <hr> web/src/views/Dashboards/RenderDashboardCharts.vue <li>Included <code>selectedTabId</code> in panel <code>:key</code><br> <li> Added <code>gridStackUpdateInProgress</code> guard<br> <li> Optimized <code>refreshGridStack</code> clearing logic<br> <li> Added console error logs on save and widget add </details> </td> <td><a href="https://github.com/openobserve/openobserve/pull/7558/files#diff-313f7c69102161242c893c863c50f1f1cd1fc19b68b5c99bf840b4b5c72f0f2e">+51/-42</a> </td> </tr> </table></td></tr><tr><td><strong>Bug fix</strong></td><td><table> <tr> <td> <details> <summary><strong>commons.ts</strong><dd><code>Handle duplicate panel IDs on retrieval</code> </dd></summary> <hr> web/src/utils/commons.ts <li>Added <code>fixDuplicatePanelIds</code> to dedupe panel IDs<br> <li> Called dedupe in <code>getDashboard</code> flow<br> <li> Saved and re-fetched dashboard when duplicates found<br> <li> Implemented <code>generateUniquePanelId</code> helper </details> </td> <td><a href="https://github.com/openobserve/openobserve/pull/7558/files#diff-17cb74f8142984fc46bbfecdeaacccc118fd5d4ab7f040a55695caaa309d104f">+81/-14</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> --------- Co-authored-by: Kirtan Thakkar <kirtan@kiara.tech>
web
This template should help get you started developing with Vue 3 in Vite.
Recommended IDE Setup
VSCode + Volar (and disable Vetur) + TypeScript Vue Plugin (Volar).
Type Support for .vue Imports in TS
TypeScript cannot handle type information for .vue imports by default, so we replace the tsc CLI with vue-tsc for type checking. In editors, we need TypeScript Vue Plugin (Volar) to make the TypeScript language service aware of .vue types.
If the standalone TypeScript plugin doesn't feel fast enough to you, Volar has also implemented a Take Over Mode that is more performant. You can enable it by the following steps:
- Disable the built-in TypeScript Extension
- Run
Extensions: Show Built-in Extensionsfrom VSCode's command palette - Find
TypeScript and JavaScript Language Features, right click and selectDisable (Workspace)
- Run
- Reload the VSCode window by running
Developer: Reload Windowfrom the command palette.
Customize configuration
See Vite Configuration Reference.
Project Setup
npm install
Compile and Hot-Reload for Development
For stand-alone UI development environment, create .env file and which contains below environment variable
VITE_OPENOBSERVE_ENDPOINT=http://localhost:5080/
npm run dev
Type-Check, Compile and Minify for Production
npm run build
Run Unit Tests with Vitest
npm run test:unit
Run End-to-End Tests with Cypress
npm run test:e2e:dev
This runs the end-to-end tests against the Vite development server. It is much faster than the production build.
But it's still recommended to test the production build with test:e2e before deploying (e.g. in CI environments):
npm run build
npm run test:e2e
Lint with ESLint
npm run lint