### **PR Type** Tests, Enhancement ___ ### **Description** - Add extensive RUM component unit tests - Harden dashboard layout null checks - Initialize variables state safely - Minor UI/typing/import fixes ___ ### Diagram Walkthrough ```mermaid flowchart LR specs["Add RUM component specs"] -- validate --> dashboards["Dashboards (API/Errors/WebVitals)"] dashboards -- safer init --> vars["Variables default state"] dashboards -- guard --> layout["Ref layoutUpdate null-checks"] SearchBar["SearchBar.vue"] -- disable guard --> btn["Run Query button"] utilsDate["utils/date.ts"] -- lint fix --> commas["Trailing commas"] ``` <details> <summary><h3> File Walkthrough</h3></summary> <table><thead><tr><th></th><th align="left">Relevant files</th></tr></thead><tbody><tr><td><strong>Tests</strong></td><td><details><summary>19 files</summary><table> <tr> <td><strong>ApiDashboard.spec.ts</strong><dd><code>Add comprehensive tests for API dashboard</code> </dd></td> <td><a href="https://github.com/openobserve/openobserve/pull/8194/files#diff-53095dbafa0cb9c6eed90240cb8af9f89d118168f6af76bdf51267a667ccff2d">+1481/-0</a></td> </tr> <tr> <td><strong>SearchBar.spec.ts</strong><dd><code>Add unit tests for RUM SearchBar</code> </dd></td> <td><a href="https://github.com/openobserve/openobserve/pull/8194/files#diff-8665e9741021e1ce49dcf12426e74107f678bd5708125104d95f82798f1a33a1">+715/-0</a> </td> </tr> <tr> <td><strong>SessionsList.spec.ts</strong><dd><code>Add tests for sessions list table</code> </dd></td> <td><a href="https://github.com/openobserve/openobserve/pull/8194/files#diff-d4b43b6d94727c8fe42479141a58908fc490227bd1e87eec6d64c9351efbdcc8">+615/-0</a> </td> </tr> <tr> <td><strong>ErrorEvents.spec.ts</strong><dd><code>Add tests for error events table</code> </dd></td> <td><a href="https://github.com/openobserve/openobserve/pull/8194/files#diff-81b9f9fcb1fd9a2f50bb512de7de11353519d95d7c276999eb8efa9e315a91d2">+567/-0</a> </td> </tr> <tr> <td><strong>ErrorTags.spec.ts</strong><dd><code>Add tests for error tags view</code> </dd></td> <td><a href="https://github.com/openobserve/openobserve/pull/8194/files#diff-c6f52cc79dd03d5b9bb6fb66a7c2ca29b66cd2e8bcaf1fa071d52cd43f388f59">+622/-0</a> </td> </tr> <tr> <td><strong>PlayerEventsSidebar.spec.ts</strong><dd><code>Add tests for player events sidebar</code> </dd></td> <td><a href="https://github.com/openobserve/openobserve/pull/8194/files#diff-89b65487bce928cbff9e6f17ea7b2288a5b44918c408d48f17e834454d8f6c60">+570/-0</a> </td> </tr> <tr> <td><strong>ErrorsList.spec.ts</strong><dd><code>Add tests for errors list</code> </dd></td> <td><a href="https://github.com/openobserve/openobserve/pull/8194/files#diff-e65880c9658bdfd0cc8c6dc2144760f924ef4cf6919010e5f48b2ed47f134745">+491/-0</a> </td> </tr> <tr> <td><strong>WebVitalsDashboard.spec.ts</strong><dd><code>Add tests for Web Vitals dashboard</code> </dd></td> <td><a href="https://github.com/openobserve/openobserve/pull/8194/files#diff-62eb2eceb30d2aa28e78d4ee898d09aae3d1f0fa176d4bca91055b50024e6c9f">+546/-0</a> </td> </tr> <tr> <td><strong>ErrorHeader.spec.ts</strong><dd><code>Add tests for error header</code> </dd></td> <td><a href="https://github.com/openobserve/openobserve/pull/8194/files#diff-4b0143e04fd73e173ae4e9696d2654543eaf0c0a85e6610d267a3b2ec3f145d8">+459/-0</a> </td> </tr> <tr> <td><strong>VideoPlayer.spec.ts</strong><dd><code>Add tests for RUM video player</code> </dd></td> <td><a href="https://github.com/openobserve/openobserve/pull/8194/files#diff-ee567bd4fd196facb768c7a15cbd7e14feff6be027d3bb78e65ae811319ca82c">+485/-0</a> </td> </tr> <tr> <td><strong>ErrorSessionReplay.spec.ts</strong><dd><code>Add tests for error session replay</code> </dd></td> <td><a href="https://github.com/openobserve/openobserve/pull/8194/files#diff-40ee2b3a9b103e5c6e5e431609444f0296d2bee46f3f1dd2c606c86e22d8ffe5">+482/-0</a> </td> </tr> <tr> <td><strong>ErrorStackTrace.spec.ts</strong><dd><code>Add tests for error stack trace view</code> </dd></td> <td><a href="https://github.com/openobserve/openobserve/pull/8194/files#diff-a52e17d1791c4e34e92e7e5953d4df509f4dc8a49910865efc0f13bffc9b2096">+423/-0</a> </td> </tr> <tr> <td><strong>ErrorEventDescription.spec.ts</strong><dd><code>Add tests for error event description</code> </dd></td> <td><a href="https://github.com/openobserve/openobserve/pull/8194/files#diff-f3a969642703ccec1b54c32c7ef3c2a85d9e9ea15f322ef362eefe71ae736acd">+495/-0</a> </td> </tr> <tr> <td><strong>ErrorDetail.spec.ts</strong><dd><code>Add tests for error detail view</code> </dd></td> <td><a href="https://github.com/openobserve/openobserve/pull/8194/files#diff-8517542d07e62e45104db342cc69f85a1c07776aecbee8279456d3000f8dd2da">+420/-0</a> </td> </tr> <tr> <td><strong>AppTable.spec.ts</strong><dd><code>Add tests for generic AppTable</code> </dd></td> <td><a href="https://github.com/openobserve/openobserve/pull/8194/files#diff-37e20196ead408438033e30d909300ef1c02b01fa690e2d4b8cd21472202e4da">+425/-0</a> </td> </tr> <tr> <td><strong>ErrorsDashboard.spec.ts</strong><dd><code>Add tests for Errors dashboard</code> </dd></td> <td><a href="https://github.com/openobserve/openobserve/pull/8194/files#diff-1330edb3964758b7c9cfbdfb077eac5fcce30b8b4d2f204d69ab71c4041d37c5">+383/-0</a> </td> </tr> <tr> <td><strong>ErrorTypeIcons.spec.ts</strong><dd><code>Add tests for error type icons</code> </dd></td> <td><a href="https://github.com/openobserve/openobserve/pull/8194/files#diff-737652a4154b05c932a34cf218c3c1432ff8efc557d512813a6879830baf668b">+368/-0</a> </td> </tr> <tr> <td><strong>ErrorTag.spec.ts</strong><dd><code>Add tests for single error tag</code> </dd></td> <td><a href="https://github.com/openobserve/openobserve/pull/8194/files#diff-d4bf1e6d4e71451a9ce8ead11328edff5064cb3693b01b53ce653694710045ef">+355/-0</a> </td> </tr> <tr> <td><strong>SessionLocationColumn.spec.ts</strong><dd><code>Add tests for session location column</code> </dd></td> <td><a href="https://github.com/openobserve/openobserve/pull/8194/files#diff-b853b01be9d14931163c1ae8f5287c28f1d43df2a45e113519d853d3a14c1b41">+346/-0</a> </td> </tr> </table></details></td></tr><tr><td><strong>Enhancement</strong></td><td><details><summary>5 files</summary><table> <tr> <td><strong>date.ts</strong><dd><code>Add debug log and lint fixes</code> </dd></td> <td><a href="https://github.com/openobserve/openobserve/pull/8194/files#diff-b178bce26d7ddb8d02569fa666e3250abbc1f269d7b7a1068a4bd026f4bdcd26">+3/-2</a> </td> </tr> <tr> <td><strong>ApiDashboard.vue</strong><dd><code>Safer variables init and layout guards</code> </dd></td> <td><a href="https://github.com/openobserve/openobserve/pull/8194/files#diff-52c091831fcfb625a54f7b56a08c10694a024daa44b6b337d66260461254389e">+24/-12</a> </td> </tr> <tr> <td><strong>SearchBar.vue</strong><dd><code>Guard stream list access; import cleanup</code> </dd></td> <td><a href="https://github.com/openobserve/openobserve/pull/8194/files#diff-d20c6ba53e6a9adfe67b2f83fe76357fb541b2764dd40cb16627599e0c80e63f">+3/-30</a> </td> </tr> <tr> <td><strong>ErrorsDashboard.vue</strong><dd><code>Initialize variables and guard layout updates</code> </dd></td> <td><a href="https://github.com/openobserve/openobserve/pull/8194/files#diff-46138c05241c5e0911a0feba39a21dbb8452453c0e26a1d00c3493cc579f07b2">+14/-8</a> </td> </tr> <tr> <td><strong>WebVitalsDashboard.vue</strong><dd><code>Add layout null-checks and exports</code> </dd></td> <td><a href="https://github.com/openobserve/openobserve/pull/8194/files#diff-bbb15649f6ecf4b2968a8173091ef8b2a21bfe39bff8e08f91566bca189cca09">+10/-5</a> </td> </tr> </table></details></td></tr><tr><td><strong>Miscellaneous</strong></td><td><details><summary>1 files</summary><table> <tr> <td><strong>WebVitalsDashboard.spec.ts.backup</strong><dd><code>Backup spec file for Web Vitals</code> </dd></td> <td><a href="https://github.com/openobserve/openobserve/pull/8194/files#diff-407d197787cb019e97f989a21530c722baf103aab5583cf85b3f7113b9543e88">+1308/-0</a></td> </tr> </table></details></td></tr></tr></tbody></table> </details> ___
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