mirror of
https://github.com/openobserve/openobserve.git
synced 2026-11-05 00:09:35 +00:00
### **PR Type** Enhancement, Bug fix ___ ### **Description** - Replace CodeMirror with Monaco editor - Add Monaco autocomplete and markers - Update build to bundle Monaco - Remove re-render key from logs UI ___ ### Diagram Walkthrough ```mermaid flowchart LR CM["CodeMirror-based editor"] -- Replaced by --> ME["Monaco editor integration"] ME -- Autocomplete/Markers --> UX["Improved editor UX"] Build["Vite config"] -- Add monaco plugin/chunks --> Bundle["Optimized bundles"] UI["Logs and SearchBar"] -- Minor fixes/cleanup --> Stability["Reduced re-renders"] ``` <details> <summary><h3> File Walkthrough</h3></summary> <table><thead><tr><th></th><th align="left">Relevant files</th></tr></thead><tbody><tr><td><strong>Enhancement</strong></td><td><details><summary>3 files</summary><table> <tr> <td><strong>CodeQueryEditor.vue</strong><dd><code>Replace CodeMirror with Monaco, add features</code> </dd></td> <td><a href="https://github.com/openobserve/openobserve/pull/8047/files#diff-52a36bf2d64e590036ed1c1f89b07a4a6b971a84e4fae9b4272cbc69d63f9bef">+369/-980</a></td> </tr> <tr> <td><strong>Index.vue</strong><dd><code>Cleanups, visualization flow, formatting tweaks</code> </dd></td> <td><a href="https://github.com/openobserve/openobserve/pull/8047/files#diff-0323c3da69b369843c5d72bf4df5b00ca6b5147192a213baf331659ecf92af62">+105/-78</a></td> </tr> <tr> <td><strong>SearchBar.vue</strong><dd><code>Editor placeholder, menus, toggle guards</code> </dd></td> <td><a href="https://github.com/openobserve/openobserve/pull/8047/files#diff-81893de4edf186b0556f610acb280c87baa2ffe67d3b48a60a866094c7635baf">+148/-82</a></td> </tr> </table></details></td></tr><tr><td><strong>Dependencies</strong></td><td><details><summary>3 files</summary><table> <tr> <td><strong>CodeQueryEditorDarkTheme.ts</strong><dd><code>Remove legacy CodeMirror dark theme</code> </dd></td> <td><a href="https://github.com/openobserve/openobserve/pull/8047/files#diff-4ee0166b549a9a7d6a91e72d546dffd2d031b0ad6015ef5f735b67742e13c66d">+0/-230</a> </td> </tr> <tr> <td><strong>CodeQueryEditorLightTheme.ts</strong><dd><code>Remove legacy CodeMirror light theme</code> </dd></td> <td><a href="https://github.com/openobserve/openobserve/pull/8047/files#diff-4e80117fff859d80b9dde6898e8026f2c2514c43244e48e2b639527409d38682">+0/-246</a> </td> </tr> <tr> <td><strong>package.json</strong><dd><code>Remove CodeMirror deps; add Monaco and plugin</code> </dd></td> <td><a href="https://github.com/openobserve/openobserve/pull/8047/files#diff-b861012a5dd72b8a9f3281b7cf09f5a779c98569d040b1bbc1db50f1b15e7cce">+2/-16</a> </td> </tr> </table></details></td></tr><tr><td><strong>Configuration changes</strong></td><td><details><summary>1 files</summary><table> <tr> <td><strong>vite.config.ts</strong><dd><code>Integrate Monaco plugin and chunking</code> </dd></td> <td><a href="https://github.com/openobserve/openobserve/pull/8047/files#diff-9430906049744cbbfe5d0b382b2466843a42cfebf755ff86fec850b0712258ef">+25/-15</a> </td> </tr> </table></details></td></tr></tr></tbody></table> </details> ___ --------- Co-authored-by: ktx-abhay <abhay.padamani@kiara.tech> Co-authored-by: Bhargav <BJP232004@GMAIL.COM>
71 lines
2.4 KiB
JavaScript
71 lines
2.4 KiB
JavaScript
import { expect } from '@playwright/test';
|
|
|
|
export class LogsQueryPage {
|
|
constructor(page) {
|
|
this.page = page;
|
|
this.queryEditor = '[data-test="logs-search-bar-query-editor"]';
|
|
this.dateTimeButton = '[data-test="date-time-btn"]';
|
|
this.relative15MinButton = '[data-test="date-time-relative-15-m-btn"] > .q-btn__content > .block';
|
|
this.refreshButton = '[data-test="logs-search-bar-refresh-btn"]';
|
|
this.errorMessage = '[data-test="logs-search-error-message"]';
|
|
this.resetFiltersButton = '[data-test="logs-search-bar-reset-filters-btn"]';
|
|
this.noDataFoundText = 'warning No data found for';
|
|
this.resultDetail = '[data-test="logs-search-result-detail-undefined"]';
|
|
this.histogramToggle = '[data-test="logs-search-bar-show-histogram-toggle-btn"]';
|
|
}
|
|
|
|
async setDateTimeFilter() {
|
|
await this.page.locator(this.dateTimeButton).click({ force: true });
|
|
await this.page.locator(this.relative15MinButton).click({ force: true });
|
|
}
|
|
|
|
async typeQuery(query) {
|
|
const queryEditor = this.page.locator(this.queryEditor);
|
|
await expect(queryEditor).toBeVisible();
|
|
await queryEditor.locator(".inputarea").fill(query);
|
|
}
|
|
|
|
async clickRefresh() {
|
|
await this.page.locator(this.refreshButton).click();
|
|
}
|
|
|
|
async clickErrorMessage() {
|
|
await expect(this.page.locator(this.errorMessage).getByText('No events found')).toBeVisible();
|
|
await this.page.locator(this.errorMessage).click();
|
|
}
|
|
|
|
async clickResetFilters() {
|
|
await this.page.locator(this.resetFiltersButton).click();
|
|
}
|
|
|
|
async clickNoDataFound() {
|
|
const noDataFoundLocator = this.page.getByText(this.noDataFoundText);
|
|
await expect(noDataFoundLocator).toBeVisible({ timeout: 10000 });
|
|
await noDataFoundLocator.click();
|
|
}
|
|
|
|
async clickResultDetail() {
|
|
await this.page.locator(this.resultDetail).click();
|
|
}
|
|
|
|
async waitForTimeout(milliseconds) {
|
|
await this.page.waitForTimeout(milliseconds);
|
|
}
|
|
|
|
async toggleHistogram() {
|
|
await this.page.waitForSelector(this.histogramToggle);
|
|
await this.page.locator(`${this.histogramToggle} div`).nth(2).click();
|
|
}
|
|
|
|
async isHistogramOn() {
|
|
const histogramToggle = this.page.locator(this.histogramToggle);
|
|
return await histogramToggle.evaluate(el => el.getAttribute('aria-checked') === 'true');
|
|
}
|
|
|
|
async ensureHistogramState(desiredState) {
|
|
const isOn = await this.isHistogramOn();
|
|
if (isOn !== desiredState) {
|
|
await this.toggleHistogram();
|
|
}
|
|
}
|
|
}
|