Compare commits
34 Commits
fix/dashbo
...
chore/dead
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ecc35e4a02 | ||
|
|
241a1ac16b | ||
|
|
3dd4f65734 | ||
|
|
d1c63f0084 | ||
|
|
e0bafef7c4 | ||
|
|
d7dd3069e2 | ||
|
|
ffe752a25d | ||
|
|
1b73d0ff28 | ||
|
|
f31fe730dd | ||
|
|
027254a5d9 | ||
|
|
74b887677e | ||
|
|
01e6410a41 | ||
|
|
ff07f4e722 | ||
|
|
ad7208c165 | ||
|
|
199c4edee2 | ||
|
|
9fd52fe1d0 | ||
|
|
a8967f6877 | ||
|
|
51caf0ae7d | ||
|
|
1d260084e2 | ||
|
|
aa4ea62994 | ||
|
|
c65a73001d | ||
|
|
a6be4d894c | ||
|
|
b1f271a505 | ||
|
|
c92bb94caf | ||
|
|
8e3a4f8775 | ||
|
|
a8433ad9e0 | ||
|
|
d07b0f1d82 | ||
|
|
a02330438f | ||
|
|
cb2b3db771 | ||
|
|
40ee169d94 | ||
|
|
865e1c97b3 | ||
|
|
5f24193de6 | ||
|
|
3d63ed6353 | ||
|
|
3af06adabc |
@@ -20,12 +20,16 @@ You are the Playwright Test Generator for the SigNoz frontend. You take a plan w
|
||||
await expect(routing.activeRouteTab(PATH.metricsSummary)).toBeVisible();
|
||||
});
|
||||
```
|
||||
- A driver is a function closing over the page that returns `Locator` getters and async actions. Actions wait inside themselves (e.g. `run()` pairs the click with `waitForResponse(/query_range/)`), so specs don't.
|
||||
- A driver is a function closing over the page that returns `Locator` getters and async actions. Actions wait inside themselves (e.g. `run()` pairs the click with `waitForResponse(/query_range/)`), so specs don't. A wait for "the request the action fired" skips aborted requests, which have no response: Run after a cancel re-sends the cancelled query and aborts it, and `query-builder/run` TC-34 read that one.
|
||||
- A page action that opens an explorer waits for the content pane's scrollbar viewport (`quick-filters-layout-content [data-overlayscrollbars-viewport]`) before anything types. The scrollbar starts on idle and re-parents the editors, so keys typed across it land at the start of the text. Typing into a CodeMirror editor retypes until the editor holds exactly the text, as `editorAt(...).type` and `querySearch.apply` do: `query-builder/aggregation` TC-17 sent `c()` for `count()`.
|
||||
- `driver(name, build, dispose?)` in `drivers/kit.ts` makes it a test-scoped fixture on `authedPage`; `dispose` deletes what it seeded. `seeded(name, open, close)` makes a worker-scoped seed.
|
||||
- Read [tests/e2e/tests/dashboards/editor/query.spec.ts](../../tests/e2e/tests/dashboards/editor/query.spec.ts) and [drivers/panel-editor.ts](../../tests/e2e/drivers/panel-editor.ts) for the canonical shape.
|
||||
- **Seeds are layers on the feature's `test`.** A spec destructures the seed it needs (`alertList`, `ownedRules`, `resolvedHistory` for alerts) instead of importing a fixtures module. A new seed goes in the feature's driver directory: `seeded()` for read-only data shared by a worker, a test-scoped layer for anything a test mutates.
|
||||
- **Test titles:** `TC-NN <short description>` — matches the planner's IDs.
|
||||
- **Self-contained state.** The bootstrap creates a fresh stack with **zero** dashboards / alerts / etc. Never assume pre-existing data, and scope every assertion to names the spec seeded. Pick the scope per the Seeding table in [tests/e2e/AGENTS.md](../../tests/e2e/AGENTS.md): test scope (a test-scoped layer, or `try / finally` through the driver) for mutations, worker scope (`seeded()`) for read-only data, suite `beforeAll` for a dataset only one file uses.
|
||||
- **A seed adds to org-wide settings, never replaces them.** Quick filters, org preferences and similar settings are shared by every spec on the stack, and `fullyParallel` runs those specs at once. Read the stored value and write a superset with only the missing entries, as `quickFilters.seed` does. A seed that replaced the logs filters made `query-builder/filter` TC-16 fail later on the same stack, and a restore in teardown races a parallel spec that seeded the same setting.
|
||||
- **Close a multiple combobox from its trigger, never with Escape.** A multi-select stays open after a pick, and Escape also closes the dialog or page around it; `onboarding/get-started` TC-09 landed on `/home`. `comboboxAt(...).pick` already does this.
|
||||
- **A context you open yourself drops its routes before closing.** Call `page.unrouteAll({ behavior: 'ignoreErrors' })` before `ctx.close()`, as `authedPage` does; a handler still inside `route.fetch` otherwise fails a test that already passed.
|
||||
- **Drive everything through the feature's driver** in `tests/e2e/drivers/`. A spec that reaches for `page.locator(...)` or `page.getByTestId(...)` is missing a driver method — add the method instead. `onAdminPage(browser, …)` from `drivers/kit.ts` is what suite hooks use, because `authedPage` is test-scoped and not visible to them.
|
||||
- **Seed through the kit when the UI flow is not under test.** Control-plane objects go through the feature driver (`dashboards.seed`, `alerts.seed.threshold`), which uses `apiDriver(page)` from `drivers/api.ts`; telemetry goes to the seeder. `page.request.*` does **not** carry the token, so never seed with it.
|
||||
- **Golden telemetry is pre-seeded.** `bootstrap/global.setup.ts` loads logs, traces and metrics over the last 6h (constants in `GOLDEN`, `drivers/dashboard-spec.ts`). Query within ≤ 6h and assert structure (series, rows, request payload), never exact counts.
|
||||
|
||||
@@ -50,6 +50,9 @@ Don't try to start the stack yourself — it can take ~4 minutes on a cold build
|
||||
- **Auth.** `tests/e2e/drivers/auth.ts` logs in once per worker and caches `storageState` (localStorage with `AUTH_TOKEN`). For API-driven seeding and cleanup use `apiDriver(page)` from `drivers/api.ts`, which attaches the header for you. Never re-implement login.
|
||||
- **Seeds.** Feature seeds are layers on the feature's `test`, e.g. `alertList`, `ownedRules` and `resolvedHistory` in `drivers/alerts/seeds.ts`. When a test fails on missing data, check which seed it destructures and whether it scopes to that seed's names.
|
||||
- **Timeouts.** Never add `test.slow()` to a driver: it triples the remaining budget per call and compounds in loops. Use `allowFor(floor)` from `drivers/kit.ts`. Budgets and their measurements are in `tests/e2e/docs/flake-notes.md`.
|
||||
- **A failure that shows only late in a long local run.** Run that spec's shard alone on a freshly seeded stack before fixing it, as CI does. A setting another spec changed and never restored, or golden telemetry aging past a query window, fails it only after the rest of the suite.
|
||||
- **`route.fetch: Target page, context or browser has been closed` after the test passed.** A route handler was still fetching when the context closed. Unroute with `page.unrouteAll({ behavior: 'ignoreErrors' })` before `ctx.close()` in the fixture that opened the context.
|
||||
- **Escape after a multi-select pick lands on another page.** Escape closed the dialog around the combobox too. Close it from its trigger (`comboboxAt(...).pick` does), never with another Escape.
|
||||
- **CI-only failures.** Reproduce with `STRESS=1 CI=1 pnpm test <path>` from `tests/e2e/` before calling it a product bug.
|
||||
- **Commits.** Driver fixes and spec fixes go in separate commits (see Commits in `tests/e2e/AGENTS.md`).
|
||||
- **Ant Design popovers** (sort menu, action menu) are click-toggle. The trigger element is often an inline `<svg>` with a `data-testid` — clicking it opens the popover; clicking it again closes. After selecting an option, the popover auto-closes. If a test interacts with the popover twice, wait for the menu items to be visible explicitly between toggles.
|
||||
|
||||
@@ -11,6 +11,7 @@ Examples and the harness API live in [`frontend/src/tests/README.md`](../../fron
|
||||
- **Import from the harness.** `render`, `screen`, `userEvent`, `waitFor` and the rest come from `tests/test-utils`, never from `@testing-library/react`. The harness mounts the router, React Query, Redux, app context and preferences. When it can't do what a test needs, extend `tests/test-utils` instead of importing around it.
|
||||
- **Find elements by test ID.** Query with `getByTestId`/`findByTestId` on the `data-testid` or `testId` the component exposes, and add one to the component when it has none. Fall back to role or text only for markup the app doesn't own. A test ID matches exactly one element and survives copy and markup changes; `getByRole` checks the computed style of every element it visits and is the slowest query. Always go through Testing Library (`screen`, `within`), never the DOM: no `querySelector`, `closest`, `container` or `document.body`. `signoz/no-dom-node-access` flags the DOM calls in test files; a test that checks DOM structure on purpose disables it on that line with a reason. Never call a `*ByRole` query inside `waitFor` or a loop: `waitFor` re-runs its callback every 50 ms. Wait with `findByTestId`, then query.
|
||||
- **Interact like a user.** `const user = userEvent.setup()`, then an awaited `user.click`, `hover`, `keyboard` or `type`. The harness turns off the pointer-events check: Base UI popups sit inside an element with an inline `pointer-events: none`, and the stylesheet that turns it back on for the popup never loads in jsdom, so the check would block every click on them. Never turn it back on. `fireEvent` only for events `userEvent` has no equivalent for: scroll, resize, setting `scrollTop`.
|
||||
- **Drop user-event's pause: `userEvent.setup(NO_DELAY_USER_EVENT)`** from `tests/test-utils`; spread it when the test needs other options. The default `delay: 0` waits a `setTimeout` after every key and click, so typing 40 characters waits 40 timer turns, each slower on a busy CI runner. With `delay: null` the actions run back to back. For a long value, click the field and `user.paste(text)` instead of typing it. Keep the default when the test checks what happens between two actions, such as a debounce per key or an update on a timer or `requestAnimationFrame` between steps: with `null` that code runs only after the whole action. Under `null` the Jest timeout can't fire mid-action, so judge a slow test by its `--verbose` time, not by whether it fails.
|
||||
- **Fake timers per test only**, for debounce or throttle, with `userEvent.setup({ advanceTimers: (ms) => jest.advanceTimersByTime(ms) })`. Never global.
|
||||
- **Network through MSW.** The global server runs for every test; override per test with `server.use(...)` from `mocks-server/server`. Large fixtures go in `mocks-server/__mockdata__`.
|
||||
- **Router through the harness.** Pass `initialRoute`/`routePath` to `render` and assert with `getCurrentLocation()` from `lib/router/navigation`. Never mock `react-router`, `react-router-dom` or `lib/history`; when a test can't render at a route, use the `lib/router` spies in `tests/router-mocks`.
|
||||
|
||||
@@ -10,5 +10,6 @@
|
||||
- **Use convensional commit format** for commits and PR title.
|
||||
- **Do not amend the commits once pushed.** Always create a new commit once changes are pushed to remote.
|
||||
- **Review fixes are new commits too.** A force push hides what changed from human reviewers and makes Greptile post its findings again. Bring in `main` with a merge; only a stacked branch (`gh stack`) rebases, since the stack moves as a unit.
|
||||
- **A review fix to an AI-owned file fixes its generator too.** A file with the AI-owned banner (story mocks and plays, `tests/e2e/drivers/`) is rewritten by the skill or agent that made it, so a fix made only in the file comes back on the next run. In the same PR, add the lesson to that skill or agent as a concrete case.
|
||||
- **Answer every Greptile thread.** Reply with the commit that fixes it (`Fixed in 4df6f3198d: <what changed>`) or the reason it stays, then resolve. Never resolve one with neither: Greptile withdraws a finding, and remembers it, only when told why.
|
||||
- **Leave human review threads to the author.** Fix the code they ask for, but never reply to or resolve a human reviewer's thread.
|
||||
|
||||
@@ -110,8 +110,9 @@ await expect(toggle.getAttribute('aria-checked')).toBe(before);
|
||||
|
||||
CI runs each play once, with its story's own args. Anyone can flip a control in the panel, and nothing runs the play against that value, so a play that breaks on it goes unnoticed. Write each play so it cannot.
|
||||
|
||||
Before writing the clicks, list what has to be on screen for the play's target to exist, and return early when the args take it away. These are the cases plays have missed:
|
||||
Before writing the clicks, list what has to be on screen for the play's target to exist. Then walk every control the story exposes, the page's own as well as the shared ones, and return early for each value that takes something on that list away. These are the cases plays have missed:
|
||||
|
||||
- An arg the story sets. The story sets it because the play needs what that value renders, and the panel can flip it. On the `mine` view the dashboards Created-by filter opens with a tag to remove; on the other views it opens empty and there is no × to click. Check the tag is there by parsing the route the view resolves to.
|
||||
- The controls every story has. `State` on loading or error renders no rows and no filter suggestions. `Access`, `Permissions` and `Revoked` remove rows, row actions and gated buttons, and the `editor` and `viewer` presets grant telemetry reads only, so a page gated on its own resource shows them nothing. `Check state` on loading disables every gated control, and on error an `AuthZButton` stays enabled while an `AuthZGuardContent` set to fail closed hides what it wraps. `License` and `Banner` decide the plan, so a cloud-only form is gone on the others. `Hold tooltips open` shows a label a second time, inside its tooltip.
|
||||
- A count at 0. The page can swap its whole list for an empty state, and the header, filters and column picker go with it.
|
||||
- A view, filter or invalid query that leaves no rows, even when the count is above 0.
|
||||
@@ -122,10 +123,11 @@ Before writing the clicks, list what has to be on screen for the play's target t
|
||||
|
||||
Make those checks with the page's own code instead of restating a condition. Build the rows with the builder the handler uses and the view's own filter, and check a permission with the page's own check through `accessFor(...).allows(...)`, or the role against the constant the page gates on, such as `componentPermission.action`. Export the checks from the mocks module, next to the handlers, so a handler change moves them too. The alert rules page has `listedRules`, `hasRowMenu`, `showsNoRulesPage` and `listsSavedViews`; the dashboards list has `listedDashboards`, `canList`, `canCreate` and `canUpdate`.
|
||||
|
||||
Two habits cover the rest:
|
||||
Three habits cover the rest:
|
||||
|
||||
- Use `findAllBy*` and take the first whenever the text can appear twice, such as in a tooltip or a popover title.
|
||||
- Wrap `toBeVisible` in `waitFor` for anything that fades in. A tooltip or toast found the moment it mounts is not visible yet.
|
||||
- Wait for what a click depends on before clicking. A control can do something else until a request answers: in the cloud account setup, Cancel closes the drawer outright until the agent command exists, and asks to confirm only after. Clicking Cancel straight after Generate raced the account POST on CI; find `<provider>-agent-command` first.
|
||||
|
||||
## Rules
|
||||
|
||||
|
||||
12
.github/workflows/goci.yaml
vendored
@@ -63,7 +63,7 @@ jobs:
|
||||
- name: self-checkout
|
||||
uses: actions/checkout@v4
|
||||
- name: go-install
|
||||
uses: actions/setup-go@v5
|
||||
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
|
||||
with:
|
||||
go-version: "1.25"
|
||||
- name: check-semconv-generated-files
|
||||
@@ -78,7 +78,7 @@ jobs:
|
||||
- name: self-checkout
|
||||
uses: actions/checkout@v4
|
||||
- name: go-install
|
||||
uses: actions/setup-go@v5
|
||||
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
|
||||
with:
|
||||
go-version: "1.25"
|
||||
- name: qemu-install
|
||||
@@ -114,7 +114,7 @@ jobs:
|
||||
- name: self-checkout
|
||||
uses: actions/checkout@v4
|
||||
- name: go-install
|
||||
uses: actions/setup-go@v5
|
||||
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
|
||||
with:
|
||||
go-version: "1.25"
|
||||
- name: generate-openapi
|
||||
@@ -131,7 +131,7 @@ jobs:
|
||||
- name: self-checkout
|
||||
uses: actions/checkout@v4
|
||||
- name: go-install
|
||||
uses: actions/setup-go@v5
|
||||
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
|
||||
with:
|
||||
go-version: "1.25"
|
||||
- name: generate-authz
|
||||
@@ -148,7 +148,7 @@ jobs:
|
||||
- name: self-checkout
|
||||
uses: actions/checkout@v4
|
||||
- name: go-install
|
||||
uses: actions/setup-go@v5
|
||||
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
|
||||
with:
|
||||
go-version: "1.25"
|
||||
- name: generate-web-settings
|
||||
@@ -165,7 +165,7 @@ jobs:
|
||||
- name: self-checkout
|
||||
uses: actions/checkout@v4
|
||||
- name: go-install
|
||||
uses: actions/setup-go@v5
|
||||
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
|
||||
with:
|
||||
go-version: "1.25"
|
||||
- name: generate-transaction-groups
|
||||
|
||||
@@ -131,6 +131,10 @@ func runGenerateAuthz(_ context.Context) error {
|
||||
coretypes.NewResourceRef(coretypes.ResourceMetaResourceNotificationChannel).String(): true,
|
||||
coretypes.NewResourceRef(coretypes.ResourceUser).String(): true,
|
||||
coretypes.NewResourceRef(coretypes.ResourceMetaResourceFactorPassword).String(): true,
|
||||
coretypes.NewResourceRef(coretypes.ResourceMetaResourceIngestionKey).String(): true,
|
||||
coretypes.NewResourceRef(coretypes.ResourceMetaResourceIngestionLimit).String(): true,
|
||||
coretypes.NewResourceRef(coretypes.ResourceMetaResourceAuthDomain).String(): true,
|
||||
coretypes.NewResourceRef(coretypes.ResourceOrganization).String(): true,
|
||||
}
|
||||
|
||||
allowedTypes := map[string]bool{}
|
||||
|
||||
@@ -318,6 +318,11 @@
|
||||
"name": "redux",
|
||||
"message": "[State mgmt] redux is deprecated. Migrate to Zustand, nuqs, or react-query."
|
||||
},
|
||||
{
|
||||
"name": "@signozhq/design-tokens",
|
||||
"importNames": ["Style"],
|
||||
"message": "[bundle] Style is a large object of CSS variable strings and is not tree-shaken. Write the CSS variable directly, for example 'var(--l3-foreground)'."
|
||||
},
|
||||
{
|
||||
"name": "react-redux",
|
||||
"message": "[State mgmt] react-redux is deprecated. Migrate to Zustand, nuqs, or react-query."
|
||||
@@ -340,6 +345,11 @@
|
||||
"importNames": ["patchDashboardV2", "usePatchDashboardV2"],
|
||||
"message": "[dashboard-v2] Don't call patchDashboardV2/usePatchDashboardV2 directly — use useOptimisticPatch().patchAsync so spec edits update the react-query cache optimistically and reconcile on settle."
|
||||
},
|
||||
{
|
||||
"name": "antd/lib",
|
||||
"allowTypeImports": true,
|
||||
"message": "[bundle] antd/lib is the CommonJS root and bundles every antd component. Import from 'antd' instead."
|
||||
},
|
||||
{
|
||||
"name": "motion/react-client",
|
||||
"message": "[motion] motion/react-client is for React Server Components only. Use 'motion/react' instead — it provides the same exports and works correctly in client-side SPAs."
|
||||
@@ -508,7 +518,6 @@
|
||||
"ignorePatterns": [
|
||||
"src/parser/*.ts",
|
||||
"scripts/update-registry.cjs",
|
||||
"scripts/generate-permissions-type.cjs",
|
||||
"**/node_modules",
|
||||
"**/build",
|
||||
"**/*.typegen.ts",
|
||||
|
||||
@@ -197,7 +197,9 @@ const preview: Preview = {
|
||||
['Overview', 'Authz'],
|
||||
'Service Accounts',
|
||||
'Ingestion',
|
||||
['Overview', 'Authz'],
|
||||
'Single Sign-on',
|
||||
['Overview', 'Authz'],
|
||||
'Keyboard Shortcuts',
|
||||
],
|
||||
'Auth',
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
||||
<link rel="preconnect" href="https://cdn.vercel.com" crossorigin />
|
||||
|
||||
<title data-react-helmet="true">
|
||||
Open source Observability platform | SigNoz
|
||||
|
||||
@@ -19,9 +19,8 @@ const config: Config.InitialOptions = {
|
||||
// it, so redirect any import of it to a stub.
|
||||
'(^|/)iconAssets$': '<rootDir>/__mocks__/iconAssetsMock.ts',
|
||||
'^@/(.*)$': '<rootDir>/src/$1',
|
||||
'\\.(css|less|scss)$': '<rootDir>/__mocks__/cssMock.ts',
|
||||
'\\.(css|scss)$': '<rootDir>/__mocks__/cssMock.ts',
|
||||
'\\.module\\.mjs$': '<rootDir>/__mocks__/cssMock.ts',
|
||||
'\\.md$': '<rootDir>/__mocks__/cssMock.ts',
|
||||
'^uplot$': '<rootDir>/__mocks__/uplotMock.ts',
|
||||
'^motion/react$': '<rootDir>/__mocks__/motionMock.tsx',
|
||||
'^hooks/useSafeNavigate$': USE_SAFE_NAVIGATE_MOCK_PATH,
|
||||
@@ -56,12 +55,11 @@ const config: Config.InitialOptions = {
|
||||
},
|
||||
// TODO: https://github.com/SigNoz/engineering-pod/issues/5334
|
||||
transformIgnorePatterns: [
|
||||
// @chenglou/pretext is ESM-only; @signozhq/ui pulls it in via text-ellipsis.
|
||||
// Pattern 1: allow .pnpm virtual store through (handled by pattern 2), plus root-level ESM packages.
|
||||
'node_modules/(?!(\\.pnpm|react-json-tree|react-base16-styling|lodash-es|react-dnd|core-dnd|@react-dnd|dnd-core|react-dnd-html5-backend|axios|@chenglou/pretext|@signozhq/design-tokens|@signozhq|date-fns|d3-interpolate|d3-color|d3-geo|d3-array|internmap|ol|rbush|quickselect|earcut|api|@codemirror|@lezer|@marijn|@grafana|nuqs|uuid|copy-text-to-clipboard|react-markdown|vfile|vfile-message|unist-util-stringify-position|unified|bail|is-plain-obj|trough|remark-parse|remark-gfm|mdast-util-gfm|mdast-util-gfm-autolink-literal|mdast-util-gfm-footnote|mdast-util-gfm-strikethrough|mdast-util-gfm-table|mdast-util-gfm-task-list-item|mdast-util-find-and-replace|mdast-util-phrasing|mdast-util-to-markdown|markdown-table|longest-streak|ccount|escape-string-regexp|mdast-util-from-markdown|mdast-util-to-string|micromark|micromark-core-commonmark|micromark-extension-gfm|micromark-extension-gfm-autolink-literal|micromark-extension-gfm-footnote|micromark-extension-gfm-strikethrough|micromark-extension-gfm-table|micromark-extension-gfm-tagfilter|micromark-extension-gfm-task-list-item|micromark-factory-destination|micromark-factory-label|micromark-factory-space|micromark-factory-title|micromark-factory-whitespace|micromark-util-character|micromark-util-chunked|micromark-util-classify-character|micromark-util-combine-extensions|micromark-util-decode-numeric-character-reference|micromark-util-decode-string|micromark-util-encode|micromark-util-html-tag-name|micromark-util-normalize-identifier|micromark-util-resolve-all|micromark-util-sanitize-uri|micromark-util-subtokenize|micromark-util-symbol|micromark-util-types|decode-named-character-reference|remark-rehype|mdast-util-to-hast|unist-util-position|trim-lines|unist-util-visit|unist-util-visit-parents|unist-util-is|unist-util-generated|mdast-util-definitions|property-information|hast-util-whitespace|space-separated-tokens|comma-separated-tokens|rehype-raw|hast-util-raw|hast-util-from-parse5|devlop|hastscript|hast-util-parse-selector|vfile-location|web-namespaces|hast-util-to-parse5|zwitch|html-void-elements)/)',
|
||||
'node_modules/(?!(\\.pnpm|react-json-tree|react-base16-styling|lodash-es|react-dnd|@react-dnd|dnd-core|react-dnd-html5-backend|axios|@signozhq/design-tokens|@signozhq|date-fns|d3-interpolate|d3-color|d3-geo|d3-array|internmap|ol|rbush|quickselect|earcut|@codemirror|@lezer|@marijn|@grafana|nuqs|uuid|react-markdown|vfile|vfile-message|unist-util-stringify-position|unified|bail|is-plain-obj|trough|remark-parse|remark-gfm|mdast-util-gfm|mdast-util-gfm-autolink-literal|mdast-util-gfm-footnote|mdast-util-gfm-strikethrough|mdast-util-gfm-table|mdast-util-gfm-task-list-item|mdast-util-find-and-replace|mdast-util-phrasing|mdast-util-to-markdown|markdown-table|longest-streak|ccount|escape-string-regexp|mdast-util-from-markdown|mdast-util-to-string|micromark|micromark-core-commonmark|micromark-extension-gfm|micromark-extension-gfm-autolink-literal|micromark-extension-gfm-footnote|micromark-extension-gfm-strikethrough|micromark-extension-gfm-table|micromark-extension-gfm-tagfilter|micromark-extension-gfm-task-list-item|micromark-factory-destination|micromark-factory-label|micromark-factory-space|micromark-factory-title|micromark-factory-whitespace|micromark-util-character|micromark-util-chunked|micromark-util-classify-character|micromark-util-combine-extensions|micromark-util-decode-numeric-character-reference|micromark-util-decode-string|micromark-util-encode|micromark-util-html-tag-name|micromark-util-normalize-identifier|micromark-util-resolve-all|micromark-util-sanitize-uri|micromark-util-subtokenize|micromark-util-symbol|micromark-util-types|decode-named-character-reference|remark-rehype|mdast-util-to-hast|unist-util-position|trim-lines|unist-util-visit|unist-util-visit-parents|unist-util-is|unist-util-generated|mdast-util-definitions|property-information|hast-util-whitespace|space-separated-tokens|comma-separated-tokens|rehype-raw|hast-util-raw|hast-util-from-parse5|devlop|hastscript|hast-util-parse-selector|vfile-location|web-namespaces|hast-util-to-parse5|zwitch|html-void-elements)/)',
|
||||
// Pattern 2: pnpm virtual store — ignore everything except ESM-only packages.
|
||||
// pnpm encodes scoped packages as @scope+name@version, so match on scope prefix.
|
||||
'node_modules/\\.pnpm/(?!(react-json-tree|react-base16-styling|lodash-es|react-dnd|core-dnd|@react-dnd|dnd-core|react-dnd-html5-backend|axios|@chenglou|@signozhq|date-fns|d3-interpolate|d3-color|d3-geo|d3-array|internmap|ol|rbush|quickselect|earcut|api|@codemirror|@lezer|@marijn|@grafana|nuqs|uuid|copy-text-to-clipboard|react-markdown|vfile|vfile-message|unist-util-stringify-position|unified|bail|is-plain-obj|trough|remark-parse|remark-gfm|mdast-util-gfm|mdast-util-gfm-autolink-literal|mdast-util-gfm-footnote|mdast-util-gfm-strikethrough|mdast-util-gfm-table|mdast-util-gfm-task-list-item|mdast-util-find-and-replace|mdast-util-phrasing|mdast-util-to-markdown|markdown-table|longest-streak|ccount|escape-string-regexp|mdast-util-from-markdown|mdast-util-to-string|micromark|decode-named-character-reference|remark-rehype|mdast-util-to-hast|unist-util-position|trim-lines|unist-util-visit|unist-util-visit-parents|unist-util-is|unist-util-generated|mdast-util-definitions|property-information|hast-util-whitespace|space-separated-tokens|comma-separated-tokens|rehype-raw|hast-util-raw|hast-util-from-parse5|devlop|hastscript|hast-util-parse-selector|vfile-location|web-namespaces|hast-util-to-parse5|zwitch|html-void-elements)[^/]*/node_modules)',
|
||||
'node_modules/\\.pnpm/(?!(react-json-tree|react-base16-styling|lodash-es|react-dnd|@react-dnd|dnd-core|react-dnd-html5-backend|axios|@signozhq|date-fns|d3-interpolate|d3-color|d3-geo|d3-array|internmap|ol|rbush|quickselect|earcut|@codemirror|@lezer|@marijn|@grafana|nuqs|uuid|react-markdown|vfile|vfile-message|unist-util-stringify-position|unified|bail|is-plain-obj|trough|remark-parse|remark-gfm|mdast-util-gfm|mdast-util-gfm-autolink-literal|mdast-util-gfm-footnote|mdast-util-gfm-strikethrough|mdast-util-gfm-table|mdast-util-gfm-task-list-item|mdast-util-find-and-replace|mdast-util-phrasing|mdast-util-to-markdown|markdown-table|longest-streak|ccount|escape-string-regexp|mdast-util-from-markdown|mdast-util-to-string|micromark|decode-named-character-reference|remark-rehype|mdast-util-to-hast|unist-util-position|trim-lines|unist-util-visit|unist-util-visit-parents|unist-util-is|unist-util-generated|mdast-util-definitions|property-information|hast-util-whitespace|space-separated-tokens|comma-separated-tokens|rehype-raw|hast-util-raw|hast-util-from-parse5|devlop|hastscript|hast-util-parse-selector|vfile-location|web-namespaces|hast-util-to-parse5|zwitch|html-void-elements)[^/]*/node_modules)',
|
||||
],
|
||||
setupFilesAfterEnv: ['<rootDir>/jest.setup.ts'],
|
||||
testPathIgnorePatterns: ['/node_modules/', '/public/'],
|
||||
|
||||
@@ -8,12 +8,10 @@
|
||||
import { TextDecoder, TextEncoder } from 'node:util';
|
||||
|
||||
import '@testing-library/jest-dom';
|
||||
import '@testing-library/jest-dom/extend-expect';
|
||||
import 'jest-styled-components';
|
||||
|
||||
import { server } from './src/mocks-server/server';
|
||||
|
||||
import './src/styles.scss';
|
||||
// Establish API mocking before all tests.
|
||||
|
||||
// react-router@7's entry point pulls in its server-runtime cookie signing,
|
||||
@@ -52,8 +50,8 @@ if (!Range.prototype.getClientRects) {
|
||||
document.body.getBoundingClientRect();
|
||||
}
|
||||
|
||||
// jsdom doesn't implement the Pointer Capture API, which Radix UI primitives
|
||||
// (e.g. @signozhq/ui Select) call when opening. Stub them so those components
|
||||
// jsdom doesn't implement the Pointer Capture API, which Base UI primitives
|
||||
// (e.g. @signozhq/ui Slider and Toast) call. Stub them so those components
|
||||
// can be exercised in tests.
|
||||
if (!HTMLElement.prototype.hasPointerCapture) {
|
||||
HTMLElement.prototype.hasPointerCapture = function (): boolean {
|
||||
|
||||
@@ -1,8 +1,18 @@
|
||||
{
|
||||
"$schema": "https://unpkg.com/knip@5/schema.json",
|
||||
"entry": [
|
||||
"scripts/**/*.{mjs,cjs}",
|
||||
"src/storybook/mocks/*.mock.{ts,tsx}",
|
||||
"src/tests/userEventWithDefaults.ts"
|
||||
],
|
||||
"project": ["src/**/*.ts", "src/**/*.tsx"],
|
||||
"ignore": ["src/api/generated/**/*.ts", "src/typings/*.ts"],
|
||||
"ignore": [
|
||||
"src/api/generated/**/*.ts",
|
||||
"src/typings/*.ts",
|
||||
"src/constants/generated/semconvFamilies.gen.ts",
|
||||
".storybook/public/**"
|
||||
],
|
||||
"ignoreDependencies": [
|
||||
"@typescript/native-preview"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,8 +17,7 @@ const BANNED_COMPONENTS = {
|
||||
Typography:
|
||||
'Use @signozhq/ui/typography Typography instead of antd Typography.',
|
||||
Switch: 'Use @signozhq/ui/switch Switch instead of antd Switch.',
|
||||
Dropdown:
|
||||
'Use @signozhq/ui DropdownMenuSimple (or the composable DropdownMenu primitives) from @signozhq/ui/dropdown-menu instead of antd Dropdown.',
|
||||
Dropdown: 'Use @signozhq/ui/dropdown Dropdown instead of antd Dropdown.',
|
||||
Badge: 'Use @signozhq/ui/badge instead of antd Badge.',
|
||||
Radio:
|
||||
'Use @signozhq/ui/radio-group RadioGroup (dots) or @signozhq/ui/toggle-group ToggleGroup (segmented buttons) instead of antd Radio.',
|
||||
|
||||
@@ -12,10 +12,10 @@
|
||||
* And expects:
|
||||
* import { Typography } from '@signozhq/ui/typography'
|
||||
* import { Button } from '@signozhq/ui/button'
|
||||
* import { toast } from '@signozhq/ui/sonner'
|
||||
* import { toast } from '@signozhq/ui/toast'
|
||||
*
|
||||
* Why: the barrel eagerly require()s every component (~90 of them) along with
|
||||
* their Radix/cmdk/motion/react-day-picker dependencies. Under Jest this caused
|
||||
* Why: the barrel eagerly require()s every component along with their
|
||||
* Base UI/react-day-picker dependencies. Under Jest this caused
|
||||
* 5s timeouts and flaky tests after the Antd→@signozhq/ui Typography migration
|
||||
* (#11199). Subpath imports (added in @signozhq/ui@0.0.18) load only what's
|
||||
* used.
|
||||
@@ -198,7 +198,7 @@ export default {
|
||||
const report = {
|
||||
node: node.source,
|
||||
message:
|
||||
"Do not import from the '@signozhq/ui' barrel. Use the matching subpath instead (e.g. '@signozhq/ui/typography', '@signozhq/ui/button', '@signozhq/ui/sonner'). The barrel eagerly loads ~90 components and slows tests substantially.",
|
||||
"Do not import from the '@signozhq/ui' barrel. Use the matching subpath instead (e.g. '@signozhq/ui/typography', '@signozhq/ui/button', '@signozhq/ui/toast'). The barrel eagerly loads every component and slows tests substantially.",
|
||||
};
|
||||
if (replacement) {
|
||||
report.fix = (fixer) => fixer.replaceText(node, replacement);
|
||||
|
||||
@@ -28,4 +28,6 @@ until curl -sf http://127.0.0.1:6006/index.json >/dev/null 2>&1; do
|
||||
sleep 1
|
||||
done
|
||||
|
||||
pnpm exec test-storybook --ci --maxWorkers=2 --testTimeout 30000 "$@"
|
||||
# The first story of a heavy page compiles it on the cold dev server inside its
|
||||
# own test, which outlasts 30s on a loaded runner.
|
||||
pnpm exec test-storybook --ci --maxWorkers=2 --testTimeout 60000 "$@"
|
||||
|
||||
@@ -175,8 +175,8 @@ function PrivateRoute({ children }: PrivateRouteProps): JSX.Element {
|
||||
pathname === ROUTES.SETTINGS ||
|
||||
pathname === ROUTES.BILLING ||
|
||||
pathname === ROUTES.MEMBERS_SETTINGS ||
|
||||
(isAdmin &&
|
||||
(pathname === ROUTES.ORG_SETTINGS || pathname === ROUTES.MY_SETTINGS));
|
||||
pathname === ROUTES.ORG_SETTINGS ||
|
||||
(isAdmin && pathname === ROUTES.MY_SETTINGS);
|
||||
|
||||
if (
|
||||
pathname !== ROUTES.WORKSPACE_LOCKED &&
|
||||
|
||||
@@ -808,7 +808,7 @@ describe('PrivateRoute', () => {
|
||||
assertStaysOnRoute(ROUTES.BILLING);
|
||||
});
|
||||
|
||||
it('should redirect VIEWER to workspace locked when trying to access org-settings', async () => {
|
||||
it('should allow VIEWER to access org-settings when workspace is blocked', () => {
|
||||
renderPrivateRoute({
|
||||
initialRoute: ROUTES.ORG_SETTINGS,
|
||||
appContext: {
|
||||
@@ -821,7 +821,7 @@ describe('PrivateRoute', () => {
|
||||
isCloudUser: true,
|
||||
});
|
||||
|
||||
await assertRedirectsTo(ROUTES.WORKSPACE_LOCKED);
|
||||
assertStaysOnRoute(ROUTES.ORG_SETTINGS);
|
||||
});
|
||||
|
||||
it('should allow VIEWER to access members settings when workspace is blocked', () => {
|
||||
@@ -1707,6 +1707,7 @@ describe('PrivateRoute', () => {
|
||||
// Everything under /settings resolves to the non-exact SETTINGS route
|
||||
SETTINGS: { path: ROUTES.SETTINGS, deniedRoles: DENIED_ROLES },
|
||||
MY_SETTINGS: { path: ROUTES.MY_SETTINGS, deniedRoles: DENIED_ROLES },
|
||||
ORG_SETTINGS: { path: ROUTES.ORG_SETTINGS, deniedRoles: DENIED_ROLES },
|
||||
ROLES_SETTINGS: { path: ROUTES.ROLES_SETTINGS, deniedRoles: DENIED_ROLES },
|
||||
ROLE_CREATE: { path: ROUTES.ROLE_CREATE, deniedRoles: DENIED_ROLES },
|
||||
ROLE_DETAILS: {
|
||||
|
||||
@@ -129,18 +129,6 @@ export const StatusPage = Loadable(
|
||||
() => import(/* webpackChunkName: "All Status" */ 'pages/Status'),
|
||||
);
|
||||
|
||||
export const OrganizationSettings = Loadable(
|
||||
() => import(/* webpackChunkName: "All Settings" */ 'pages/Settings'),
|
||||
);
|
||||
|
||||
export const IngestionSettings = Loadable(
|
||||
() => import(/* webpackChunkName: "Ingestion Settings" */ 'pages/Settings'),
|
||||
);
|
||||
|
||||
export const MySettings = Loadable(
|
||||
() => import(/* webpackChunkName: "All MySettings" */ 'pages/Settings'),
|
||||
);
|
||||
|
||||
export const Logs = Loadable(
|
||||
() => import(/* webpackChunkName: "Logs" */ 'pages/LogsModulePage'),
|
||||
);
|
||||
@@ -181,10 +169,6 @@ export const LogsIndexToFields = Loadable(
|
||||
import(/* webpackChunkName: "LogsIndexToFields Page" */ 'pages/LogsSettings'),
|
||||
);
|
||||
|
||||
export const BillingPage = Loadable(
|
||||
() => import(/* webpackChunkName: "BillingPage" */ 'pages/Settings'),
|
||||
);
|
||||
|
||||
export const SupportPage = Loadable(
|
||||
() => import(/* webpackChunkName: "SupportPage" */ 'pages/Support'),
|
||||
);
|
||||
@@ -208,10 +192,6 @@ export const WorkspaceAccessRestricted = Loadable(
|
||||
),
|
||||
);
|
||||
|
||||
export const ShortcutsPage = Loadable(
|
||||
() => import(/* webpackChunkName: "ShortcutsPage" */ 'pages/Settings'),
|
||||
);
|
||||
|
||||
export const Integrations = Loadable(
|
||||
() =>
|
||||
import(
|
||||
@@ -230,13 +210,6 @@ export const MessagingQueuesMainPage = Loadable(
|
||||
import(/* webpackChunkName: "MessagingQueues" */ 'pages/MessagingQueues'),
|
||||
);
|
||||
|
||||
export const MQDetailPage = Loadable(
|
||||
() =>
|
||||
import(
|
||||
/* webpackChunkName: "MQDetailPage" */ 'pages/MessagingQueues/MQDetailPage'
|
||||
),
|
||||
);
|
||||
|
||||
export const InfrastructureMonitoring = Loadable(
|
||||
() =>
|
||||
import(
|
||||
@@ -244,20 +217,6 @@ export const InfrastructureMonitoring = Loadable(
|
||||
),
|
||||
);
|
||||
|
||||
export const CeleryTask = Loadable(
|
||||
() =>
|
||||
import(
|
||||
/* webpackChunkName: "CeleryTask" */ 'pages/Celery/CeleryTask/CeleryTask'
|
||||
),
|
||||
);
|
||||
|
||||
export const CeleryOverview = Loadable(
|
||||
() =>
|
||||
import(
|
||||
/* webpackChunkName: "CeleryOverview" */ 'pages/Celery/CeleryOverview/CeleryOverview'
|
||||
),
|
||||
);
|
||||
|
||||
export const MetricsExplorer = Loadable(
|
||||
() =>
|
||||
import(/* webpackChunkName: "MetricsExplorer" */ 'pages/MetricsExplorer'),
|
||||
|
||||
@@ -35,7 +35,6 @@ import type {
|
||||
ClarifyResponseDTO,
|
||||
CreateMessageResponseDTO,
|
||||
CreateThreadResponseDTO,
|
||||
ExecutionStateDTO,
|
||||
FeedbackRatingDTO,
|
||||
ListThreadsApiV1AssistantThreadsGetArchived,
|
||||
ListThreadsApiV1AssistantThreadsGetParams,
|
||||
@@ -177,9 +176,6 @@ async function fetchSSEWithAuth(
|
||||
return res;
|
||||
}
|
||||
|
||||
/** String-literal view of `ExecutionStateDTO` for ergonomic comparisons. */
|
||||
export type ExecutionState = `${ExecutionStateDTO}`;
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Re-exported DTOs — the wire shape, used directly without remapping.
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
@@ -1,34 +0,0 @@
|
||||
import axios from 'api';
|
||||
import { ErrorResponseHandler } from 'api/ErrorResponseHandler';
|
||||
import { AxiosError } from 'axios';
|
||||
import convertObjectIntoParams from 'lib/query/convertObjectIntoParams';
|
||||
import { ErrorResponse, SuccessResponse } from 'types/api';
|
||||
import { PayloadProps, Props } from 'types/api/alerts/getTriggered';
|
||||
|
||||
/**
|
||||
* @deprecated Use the generated `useGetAlerts` hook (or `getAlerts` fetcher) from
|
||||
* `api/generated/services/alerts` instead. This hand-written client targets the
|
||||
* same endpoint and will be removed once call sites migrate.
|
||||
*
|
||||
* Part of https://github.com/SigNoz/engineering-pod/issues/5289, add a comment or update when removing this method.
|
||||
*/
|
||||
const getTriggered = async (
|
||||
props: Props,
|
||||
): Promise<SuccessResponse<PayloadProps> | ErrorResponse> => {
|
||||
try {
|
||||
const queryParams = convertObjectIntoParams(props);
|
||||
|
||||
const response = await axios.get(`/alerts?${queryParams}`);
|
||||
|
||||
return {
|
||||
statusCode: 200,
|
||||
error: null,
|
||||
message: response.data.status,
|
||||
payload: response.data.data,
|
||||
};
|
||||
} catch (error) {
|
||||
return ErrorResponseHandler(error as AxiosError);
|
||||
}
|
||||
};
|
||||
|
||||
export default getTriggered;
|
||||
@@ -15,37 +15,6 @@ const generatedAPIAxiosInstance = axios.create({
|
||||
paramsSerializer: { indexes: null },
|
||||
});
|
||||
|
||||
let generatedAPIQueryKeyHeaderContext: Record<string, unknown> | undefined;
|
||||
|
||||
export const setGeneratedAPIQueryKeyHeaderContext = <THeaders extends object>(
|
||||
headers?: THeaders,
|
||||
): void => {
|
||||
generatedAPIQueryKeyHeaderContext = headers
|
||||
? { ...(headers as Record<string, unknown>) }
|
||||
: undefined;
|
||||
};
|
||||
|
||||
const hashHeaderValue = (value: string): string => {
|
||||
let hash = 0;
|
||||
|
||||
for (let index = 0; index < value.length; index += 1) {
|
||||
hash = (hash * 31 + value.charCodeAt(index)) >>> 0;
|
||||
}
|
||||
|
||||
return hash.toString(16);
|
||||
};
|
||||
|
||||
const mergeHeaderRecord = (
|
||||
target: Record<string, unknown>,
|
||||
source: unknown,
|
||||
): Record<string, unknown> => {
|
||||
if (!source || typeof source !== 'object') {
|
||||
return target;
|
||||
}
|
||||
|
||||
return Object.assign(target, source as Record<string, unknown>);
|
||||
};
|
||||
|
||||
export const GeneratedAPIInstance = <T>(
|
||||
config: AxiosRequestConfig,
|
||||
): Promise<T> => {
|
||||
@@ -60,59 +29,5 @@ generatedAPIAxiosInstance.interceptors.response.use(
|
||||
interceptorRejected,
|
||||
);
|
||||
|
||||
const getDefaultQueryKeyHeaders = (): Record<string, unknown> => {
|
||||
const defaults = generatedAPIAxiosInstance.defaults
|
||||
.headers as unknown as Record<string, unknown>;
|
||||
const headers: Record<string, unknown> = {};
|
||||
const methodKeys = new Set([
|
||||
'common',
|
||||
'delete',
|
||||
'get',
|
||||
'head',
|
||||
'options',
|
||||
'patch',
|
||||
'post',
|
||||
'put',
|
||||
]);
|
||||
|
||||
mergeHeaderRecord(headers, defaults?.common);
|
||||
mergeHeaderRecord(headers, defaults?.get);
|
||||
|
||||
for (const [key, value] of Object.entries(defaults ?? {})) {
|
||||
if (!methodKeys.has(key)) {
|
||||
headers[key] = value;
|
||||
}
|
||||
}
|
||||
|
||||
return headers;
|
||||
};
|
||||
|
||||
export const getGeneratedAPIQueryKeyHeaders = <THeaders extends object>(
|
||||
headers?: THeaders,
|
||||
): [{ headers: Record<string, unknown> }] | [] => {
|
||||
const mergedHeaders = {
|
||||
...getDefaultQueryKeyHeaders(),
|
||||
...generatedAPIQueryKeyHeaderContext,
|
||||
...(headers as Record<string, unknown> | undefined),
|
||||
};
|
||||
|
||||
const queryKeyHeaders = Object.fromEntries(
|
||||
Object.entries(mergedHeaders)
|
||||
.filter(([, value]) => value !== undefined)
|
||||
.sort(([left], [right]) => left.localeCompare(right))
|
||||
.map(([key, value]) => {
|
||||
if (key.toLowerCase() === 'authorization' && typeof value === 'string') {
|
||||
return [key, hashHeaderValue(value)];
|
||||
}
|
||||
|
||||
return [key, value];
|
||||
}),
|
||||
);
|
||||
|
||||
return Object.keys(queryKeyHeaders).length
|
||||
? [{ headers: queryKeyHeaders }]
|
||||
: [];
|
||||
};
|
||||
|
||||
export type ErrorType<Error> = AxiosError<Error>;
|
||||
export type BodyType<BodyData> = BodyData;
|
||||
|
||||
@@ -1,50 +0,0 @@
|
||||
import { ApiV3Instance } from 'api';
|
||||
import { ErrorResponseHandler } from 'api/ErrorResponseHandler';
|
||||
import { AxiosError, AxiosResponse } from 'axios';
|
||||
import { baseAutoCompleteIdKeysOrder } from 'constants/queryBuilder';
|
||||
import { createIdFromObjectFields } from 'lib/createIdFromObjectFields';
|
||||
import createQueryParams from 'lib/createQueryParams';
|
||||
// ** Helpers
|
||||
import { ErrorResponse, SuccessResponse } from 'types/api';
|
||||
// ** Types
|
||||
import { IGetAggregateAttributePayload } from 'types/api/queryBuilder/getAggregatorAttribute';
|
||||
import {
|
||||
BaseAutocompleteData,
|
||||
IQueryAutocompleteResponse,
|
||||
} from 'types/api/queryBuilder/queryAutocompleteResponse';
|
||||
|
||||
export const getAggregateAttribute = async ({
|
||||
aggregateOperator,
|
||||
searchText,
|
||||
dataSource,
|
||||
source,
|
||||
}: IGetAggregateAttributePayload): Promise<
|
||||
SuccessResponse<IQueryAutocompleteResponse> | ErrorResponse
|
||||
> => {
|
||||
try {
|
||||
const response: AxiosResponse<{
|
||||
data: IQueryAutocompleteResponse;
|
||||
}> = await ApiV3Instance.get(
|
||||
`/autocomplete/aggregate_attributes?${createQueryParams({
|
||||
aggregateOperator,
|
||||
searchText,
|
||||
dataSource: source === 'meter' ? 'meter' : dataSource,
|
||||
})}`,
|
||||
);
|
||||
|
||||
const payload: BaseAutocompleteData[] =
|
||||
response.data.data.attributeKeys?.map(({ id: _, ...item }) => ({
|
||||
...item,
|
||||
id: createIdFromObjectFields(item, baseAutoCompleteIdKeysOrder),
|
||||
})) || [];
|
||||
|
||||
return {
|
||||
statusCode: 200,
|
||||
error: null,
|
||||
message: response.statusText,
|
||||
payload: { attributeKeys: payload },
|
||||
};
|
||||
} catch (e) {
|
||||
return ErrorResponseHandler(e as AxiosError);
|
||||
}
|
||||
};
|
||||
@@ -1,50 +0,0 @@
|
||||
import { ApiV3Instance } from 'api';
|
||||
import { ErrorResponseHandler } from 'api/ErrorResponseHandler';
|
||||
import { AxiosError, AxiosResponse } from 'axios';
|
||||
import { baseAutoCompleteIdKeysOrder } from 'constants/queryBuilder';
|
||||
import { createIdFromObjectFields } from 'lib/createIdFromObjectFields';
|
||||
import createQueryParams from 'lib/createQueryParams';
|
||||
import { ErrorResponse, SuccessResponse } from 'types/api';
|
||||
import { IGetAttributeKeysPayload } from 'types/api/queryBuilder/getAttributeKeys';
|
||||
import {
|
||||
BaseAutocompleteData,
|
||||
IQueryAutocompleteResponse,
|
||||
} from 'types/api/queryBuilder/queryAutocompleteResponse';
|
||||
|
||||
export const getAggregateKeys = async ({
|
||||
aggregateOperator,
|
||||
searchText,
|
||||
dataSource,
|
||||
aggregateAttribute,
|
||||
tagType,
|
||||
}: IGetAttributeKeysPayload): Promise<
|
||||
SuccessResponse<IQueryAutocompleteResponse> | ErrorResponse
|
||||
> => {
|
||||
try {
|
||||
const response: AxiosResponse<{
|
||||
data: IQueryAutocompleteResponse;
|
||||
}> = await ApiV3Instance.get(
|
||||
`/autocomplete/attribute_keys?${createQueryParams({
|
||||
aggregateOperator,
|
||||
searchText,
|
||||
dataSource,
|
||||
aggregateAttribute,
|
||||
})}&tagType=${tagType}`,
|
||||
);
|
||||
|
||||
const payload: BaseAutocompleteData[] =
|
||||
response.data.data.attributeKeys?.map(({ id: _, ...item }) => ({
|
||||
...item,
|
||||
id: createIdFromObjectFields(item, baseAutoCompleteIdKeysOrder),
|
||||
})) || [];
|
||||
|
||||
return {
|
||||
statusCode: 200,
|
||||
error: null,
|
||||
message: response.statusText,
|
||||
payload: { attributeKeys: payload },
|
||||
};
|
||||
} catch (e) {
|
||||
return ErrorResponseHandler(e as AxiosError);
|
||||
}
|
||||
};
|
||||
@@ -1,63 +0,0 @@
|
||||
import { ApiV3Instance } from 'api';
|
||||
import { ErrorResponseHandler } from 'api/ErrorResponseHandler';
|
||||
import { AxiosError, AxiosResponse } from 'axios';
|
||||
import { baseAutoCompleteIdKeysOrder } from 'constants/queryBuilder';
|
||||
import { encode } from 'js-base64';
|
||||
import { createIdFromObjectFields } from 'lib/createIdFromObjectFields';
|
||||
import createQueryParams from 'lib/createQueryParams';
|
||||
import { ErrorResponse, SuccessResponse } from 'types/api';
|
||||
import {
|
||||
IGetAttributeSuggestionsPayload,
|
||||
IGetAttributeSuggestionsSuccessResponse,
|
||||
} from 'types/api/queryBuilder/getAttributeSuggestions';
|
||||
import { BaseAutocompleteData } from 'types/api/queryBuilder/queryAutocompleteResponse';
|
||||
|
||||
export const getAttributeSuggestions = async ({
|
||||
searchText,
|
||||
dataSource,
|
||||
filters,
|
||||
}: IGetAttributeSuggestionsPayload): Promise<
|
||||
SuccessResponse<IGetAttributeSuggestionsSuccessResponse> | ErrorResponse
|
||||
> => {
|
||||
try {
|
||||
let base64EncodedFiltersString;
|
||||
try {
|
||||
// the replace function is to remove the padding at the end of base64 encoded string which is auto added to make it a multiple of 4
|
||||
// why ? because the current working of qs doesn't work well with padding
|
||||
base64EncodedFiltersString = encode(JSON.stringify(filters)).replace(
|
||||
/=+$/,
|
||||
'',
|
||||
);
|
||||
} catch {
|
||||
// default base64 encoded string for empty filters object
|
||||
base64EncodedFiltersString = 'eyJpdGVtcyI6W10sIm9wIjoiQU5EIn0';
|
||||
}
|
||||
const response: AxiosResponse<{
|
||||
data: IGetAttributeSuggestionsSuccessResponse;
|
||||
}> = await ApiV3Instance.get(
|
||||
`/filter_suggestions?${createQueryParams({
|
||||
searchText,
|
||||
dataSource,
|
||||
existingFilter: base64EncodedFiltersString,
|
||||
})}`,
|
||||
);
|
||||
|
||||
const payload: BaseAutocompleteData[] =
|
||||
response.data.data.attributes?.map(({ id: _, ...item }) => ({
|
||||
...item,
|
||||
id: createIdFromObjectFields(item, baseAutoCompleteIdKeysOrder),
|
||||
})) || [];
|
||||
|
||||
return {
|
||||
statusCode: 200,
|
||||
error: null,
|
||||
message: response.statusText,
|
||||
payload: {
|
||||
attributes: payload,
|
||||
example_queries: response.data.data.example_queries,
|
||||
},
|
||||
};
|
||||
} catch (e) {
|
||||
return ErrorResponseHandler(e as AxiosError);
|
||||
}
|
||||
};
|
||||
@@ -1,42 +0,0 @@
|
||||
import { ApiV3Instance } from 'api';
|
||||
import { ErrorResponseHandler } from 'api/ErrorResponseHandler';
|
||||
import { AxiosError } from 'axios';
|
||||
import createQueryParams from 'lib/createQueryParams';
|
||||
import { ErrorResponse, SuccessResponse } from 'types/api';
|
||||
import {
|
||||
IAttributeValuesResponse,
|
||||
IGetAttributeValuesPayload,
|
||||
} from 'types/api/queryBuilder/getAttributesValues';
|
||||
|
||||
export const getAttributesValues = async ({
|
||||
aggregateOperator,
|
||||
dataSource,
|
||||
aggregateAttribute,
|
||||
attributeKey,
|
||||
filterAttributeKeyDataType,
|
||||
tagType,
|
||||
searchText,
|
||||
}: IGetAttributeValuesPayload): Promise<
|
||||
SuccessResponse<IAttributeValuesResponse> | ErrorResponse
|
||||
> => {
|
||||
try {
|
||||
const response = await ApiV3Instance.get(
|
||||
`/autocomplete/attribute_values?${createQueryParams({
|
||||
aggregateOperator,
|
||||
dataSource,
|
||||
aggregateAttribute,
|
||||
attributeKey,
|
||||
searchText,
|
||||
})}&filterAttributeKeyDataType=${filterAttributeKeyDataType}&tagType=${tagType}`,
|
||||
);
|
||||
|
||||
return {
|
||||
statusCode: 200,
|
||||
error: null,
|
||||
message: response.data.status,
|
||||
payload: response.data.data,
|
||||
};
|
||||
} catch (error) {
|
||||
return ErrorResponseHandler(error as AxiosError);
|
||||
}
|
||||
};
|
||||
@@ -1,27 +0,0 @@
|
||||
import { ApiV2Instance as axios } from 'api';
|
||||
import { omit } from 'lodash-es';
|
||||
import { ErrorResponse, SuccessResponse } from 'types/api';
|
||||
import {
|
||||
GetTraceFlamegraphPayloadProps,
|
||||
GetTraceFlamegraphSuccessResponse,
|
||||
} from 'types/api/trace/getTraceFlamegraph';
|
||||
|
||||
const getTraceFlamegraph = async (
|
||||
props: GetTraceFlamegraphPayloadProps,
|
||||
): Promise<
|
||||
SuccessResponse<GetTraceFlamegraphSuccessResponse> | ErrorResponse
|
||||
> => {
|
||||
const response = await axios.post<GetTraceFlamegraphSuccessResponse>(
|
||||
`/traces/flamegraph/${props.traceId}`,
|
||||
omit(props, 'traceId'),
|
||||
);
|
||||
|
||||
return {
|
||||
statusCode: 200,
|
||||
error: null,
|
||||
message: 'Success',
|
||||
payload: response.data,
|
||||
};
|
||||
};
|
||||
|
||||
export default getTraceFlamegraph;
|
||||
@@ -150,15 +150,6 @@ export const validateFunnelSteps = async (
|
||||
};
|
||||
};
|
||||
|
||||
export interface UpdateFunnelStepDetailsPayload {
|
||||
funnel_id: string;
|
||||
steps: Array<{
|
||||
step_name: string;
|
||||
description: string;
|
||||
}>;
|
||||
updated_at: number;
|
||||
}
|
||||
|
||||
interface UpdateFunnelDescriptionPayload {
|
||||
funnel_id: string;
|
||||
description: string;
|
||||
|
||||
@@ -1,23 +1,6 @@
|
||||
// V5 Query Range Constants
|
||||
|
||||
import { ENTITY_VERSION_V5 } from 'constants/app';
|
||||
import {
|
||||
FunctionName,
|
||||
RequestType,
|
||||
SignalType,
|
||||
Step,
|
||||
} from 'types/api/v5/queryRange';
|
||||
|
||||
// ===================== Schema and Version Constants =====================
|
||||
|
||||
export const SCHEMA_VERSION_V5 = ENTITY_VERSION_V5;
|
||||
export const API_VERSION_V5 = 'v5';
|
||||
|
||||
// ===================== Default Values =====================
|
||||
|
||||
export const DEFAULT_STEP_INTERVAL: Step = '60s';
|
||||
export const DEFAULT_LIMIT = 100;
|
||||
export const DEFAULT_OFFSET = 0;
|
||||
import { RequestType } from 'types/api/v5/queryRange';
|
||||
|
||||
// ===================== Request Type Constants =====================
|
||||
|
||||
@@ -27,142 +10,3 @@ export const REQUEST_TYPES: Record<string, RequestType> = {
|
||||
RAW: 'raw',
|
||||
DISTRIBUTION: 'distribution',
|
||||
} as const;
|
||||
|
||||
// ===================== Signal Type Constants =====================
|
||||
|
||||
export const SIGNAL_TYPES: Record<string, SignalType> = {
|
||||
TRACES: 'traces',
|
||||
LOGS: 'logs',
|
||||
METRICS: 'metrics',
|
||||
} as const;
|
||||
|
||||
// ===================== Common Aggregation Expressions =====================
|
||||
|
||||
export const TRACE_AGGREGATIONS = {
|
||||
COUNT: 'count()',
|
||||
COUNT_DISTINCT_TRACE_ID: 'count_distinct(traceID)',
|
||||
AVG_DURATION: 'avg(duration_nano)',
|
||||
P50_DURATION: 'p50(duration_nano)',
|
||||
P95_DURATION: 'p95(duration_nano)',
|
||||
P99_DURATION: 'p99(duration_nano)',
|
||||
MAX_DURATION: 'max(duration_nano)',
|
||||
MIN_DURATION: 'min(duration_nano)',
|
||||
SUM_DURATION: 'sum(duration_nano)',
|
||||
} as const;
|
||||
|
||||
export const LOG_AGGREGATIONS = {
|
||||
COUNT: 'count()',
|
||||
COUNT_DISTINCT_HOST: 'count_distinct(host.name)',
|
||||
COUNT_DISTINCT_SERVICE: 'count_distinct(service.name)',
|
||||
COUNT_DISTINCT_CONTAINER: 'count_distinct(container.name)',
|
||||
} as const;
|
||||
|
||||
// ===================== Common Filter Expressions =====================
|
||||
|
||||
export const COMMON_FILTERS = {
|
||||
// Trace filters
|
||||
SERVER_SPANS: "kind_string = 'Server'",
|
||||
CLIENT_SPANS: "kind_string = 'Client'",
|
||||
INTERNAL_SPANS: "kind_string = 'Internal'",
|
||||
ERROR_SPANS: 'http.status_code >= 400',
|
||||
SUCCESS_SPANS: 'http.status_code < 400',
|
||||
|
||||
// Common service filters
|
||||
EXCLUDE_HEALTH_CHECKS: "http.route != '/health' AND http.route != '/ping'",
|
||||
HTTP_REQUESTS: "http.method != ''",
|
||||
|
||||
// Log filters
|
||||
ERROR_LOGS: "severity_text = 'ERROR'",
|
||||
WARN_LOGS: "severity_text = 'WARN'",
|
||||
INFO_LOGS: "severity_text = 'INFO'",
|
||||
DEBUG_LOGS: "severity_text = 'DEBUG'",
|
||||
} as const;
|
||||
|
||||
// ===================== Common Group By Fields =====================
|
||||
|
||||
export const COMMON_GROUP_BY_FIELDS = {
|
||||
SERVICE_NAME: {
|
||||
name: 'service.name',
|
||||
fieldDataType: 'string' as const,
|
||||
fieldContext: 'resource' as const,
|
||||
},
|
||||
HTTP_METHOD: {
|
||||
name: 'http.method',
|
||||
fieldDataType: 'string' as const,
|
||||
fieldContext: 'attribute' as const,
|
||||
},
|
||||
HTTP_ROUTE: {
|
||||
name: 'http.route',
|
||||
fieldDataType: 'string' as const,
|
||||
fieldContext: 'attribute' as const,
|
||||
},
|
||||
HTTP_STATUS_CODE: {
|
||||
name: 'http.status_code',
|
||||
fieldDataType: 'int64' as const,
|
||||
fieldContext: 'attribute' as const,
|
||||
},
|
||||
HOST_NAME: {
|
||||
name: 'host.name',
|
||||
fieldDataType: 'string' as const,
|
||||
fieldContext: 'resource' as const,
|
||||
},
|
||||
CONTAINER_NAME: {
|
||||
name: 'container.name',
|
||||
fieldDataType: 'string' as const,
|
||||
fieldContext: 'resource' as const,
|
||||
},
|
||||
} as const;
|
||||
|
||||
// ===================== Function Names =====================
|
||||
|
||||
export const FUNCTION_NAMES: Record<string, FunctionName> = {
|
||||
CUT_OFF_MIN: 'cutOffMin',
|
||||
CUT_OFF_MAX: 'cutOffMax',
|
||||
CLAMP_MIN: 'clampMin',
|
||||
CLAMP_MAX: 'clampMax',
|
||||
ABSOLUTE: 'absolute',
|
||||
RUNNING_DIFF: 'runningDiff',
|
||||
LOG2: 'log2',
|
||||
LOG10: 'log10',
|
||||
CUM_SUM: 'cumulativeSum',
|
||||
EWMA3: 'ewma3',
|
||||
EWMA5: 'ewma5',
|
||||
EWMA7: 'ewma7',
|
||||
MEDIAN3: 'median3',
|
||||
MEDIAN5: 'median5',
|
||||
MEDIAN7: 'median7',
|
||||
TIME_SHIFT: 'timeShift',
|
||||
ANOMALY: 'anomaly',
|
||||
} as const;
|
||||
|
||||
// ===================== Common Step Intervals =====================
|
||||
|
||||
export const STEP_INTERVALS = {
|
||||
FIFTEEN_SECONDS: '15s',
|
||||
THIRTY_SECONDS: '30s',
|
||||
ONE_MINUTE: '60s',
|
||||
FIVE_MINUTES: '300s',
|
||||
TEN_MINUTES: '600s',
|
||||
FIFTEEN_MINUTES: '900s',
|
||||
THIRTY_MINUTES: '1800s',
|
||||
ONE_HOUR: '3600s',
|
||||
TWO_HOURS: '7200s',
|
||||
SIX_HOURS: '21600s',
|
||||
TWELVE_HOURS: '43200s',
|
||||
ONE_DAY: '86400s',
|
||||
} as const;
|
||||
|
||||
// ===================== Time Range Presets =====================
|
||||
|
||||
export const TIME_RANGE_PRESETS = {
|
||||
LAST_5_MINUTES: 5 * 60 * 1000,
|
||||
LAST_15_MINUTES: 15 * 60 * 1000,
|
||||
LAST_30_MINUTES: 30 * 60 * 1000,
|
||||
LAST_HOUR: 60 * 60 * 1000,
|
||||
LAST_3_HOURS: 3 * 60 * 60 * 1000,
|
||||
LAST_6_HOURS: 6 * 60 * 60 * 1000,
|
||||
LAST_12_HOURS: 12 * 60 * 60 * 1000,
|
||||
LAST_24_HOURS: 24 * 60 * 60 * 1000,
|
||||
LAST_3_DAYS: 3 * 24 * 60 * 60 * 1000,
|
||||
LAST_7_DAYS: 7 * 24 * 60 * 60 * 1000,
|
||||
} as const;
|
||||
|
||||
@@ -1,39 +0,0 @@
|
||||
interface SeverityCriticalIconProps {
|
||||
width?: number;
|
||||
height?: number;
|
||||
fill?: string;
|
||||
stroke?: string;
|
||||
}
|
||||
|
||||
function SeverityCriticalIcon({
|
||||
width,
|
||||
height,
|
||||
fill,
|
||||
stroke,
|
||||
}: SeverityCriticalIconProps): JSX.Element {
|
||||
return (
|
||||
<svg
|
||||
width={width}
|
||||
height={height}
|
||||
fill={fill}
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
>
|
||||
<path
|
||||
d="M.99707.666056.99707 2.99939M.99707 5.33337H.991237M3.00293.666056 3.00293 2.99939M3.00293 5.33337H2.9971M5.00879.666056V2.99939M5.00879 5.33337H5.00296"
|
||||
stroke={stroke}
|
||||
strokeWidth="1.16667"
|
||||
strokeLinecap="round"
|
||||
strokeLinejoin="round"
|
||||
/>
|
||||
</svg>
|
||||
);
|
||||
}
|
||||
|
||||
SeverityCriticalIcon.defaultProps = {
|
||||
width: 6,
|
||||
height: 6,
|
||||
fill: 'none',
|
||||
stroke: '#F56C87',
|
||||
};
|
||||
|
||||
export default SeverityCriticalIcon;
|
||||
@@ -1,42 +0,0 @@
|
||||
interface SeverityErrorIconProps {
|
||||
width?: number;
|
||||
height?: number;
|
||||
fill?: string;
|
||||
stroke?: string;
|
||||
strokeWidth?: string;
|
||||
}
|
||||
|
||||
function SeverityErrorIcon({
|
||||
width,
|
||||
height,
|
||||
fill,
|
||||
stroke,
|
||||
strokeWidth,
|
||||
}: SeverityErrorIconProps): JSX.Element {
|
||||
return (
|
||||
<svg
|
||||
width={width}
|
||||
height={height}
|
||||
fill={fill}
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
>
|
||||
<path
|
||||
d="M1.00781.957845 1.00781 2.99951M1.00781 5.04175H1.00228"
|
||||
stroke={stroke}
|
||||
strokeWidth={strokeWidth}
|
||||
strokeLinecap="round"
|
||||
strokeLinejoin="round"
|
||||
/>
|
||||
</svg>
|
||||
);
|
||||
}
|
||||
|
||||
SeverityErrorIcon.defaultProps = {
|
||||
width: 2,
|
||||
height: 6,
|
||||
fill: 'none',
|
||||
stroke: '#F56C87',
|
||||
strokeWidth: '1.02083',
|
||||
};
|
||||
|
||||
export default SeverityErrorIcon;
|
||||
@@ -1,46 +0,0 @@
|
||||
interface SeverityInfoIconProps {
|
||||
width?: number;
|
||||
height?: number;
|
||||
fill?: string;
|
||||
stroke?: string;
|
||||
}
|
||||
|
||||
function SeverityInfoIcon({
|
||||
width,
|
||||
height,
|
||||
fill,
|
||||
stroke,
|
||||
}: SeverityInfoIconProps): JSX.Element {
|
||||
return (
|
||||
<svg
|
||||
width={width}
|
||||
height={height}
|
||||
fill={fill}
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
>
|
||||
<rect
|
||||
width={width}
|
||||
height={height}
|
||||
rx="3.5"
|
||||
fill={stroke}
|
||||
fillOpacity=".2"
|
||||
/>
|
||||
<path
|
||||
d="M7 9.33346V7.00012M7 4.66675H7.00583"
|
||||
stroke={stroke}
|
||||
strokeWidth="1.16667"
|
||||
strokeLinecap="round"
|
||||
strokeLinejoin="round"
|
||||
/>
|
||||
</svg>
|
||||
);
|
||||
}
|
||||
|
||||
SeverityInfoIcon.defaultProps = {
|
||||
width: 14,
|
||||
height: 14,
|
||||
fill: 'none',
|
||||
stroke: '#7190F9',
|
||||
};
|
||||
|
||||
export default SeverityInfoIcon;
|
||||
@@ -1,42 +0,0 @@
|
||||
interface SeverityWarningIconProps {
|
||||
width?: number;
|
||||
height?: number;
|
||||
fill?: string;
|
||||
stroke?: string;
|
||||
strokeWidth?: string;
|
||||
}
|
||||
|
||||
function SeverityWarningIcon({
|
||||
width,
|
||||
height,
|
||||
fill,
|
||||
stroke,
|
||||
strokeWidth,
|
||||
}: SeverityWarningIconProps): JSX.Element {
|
||||
return (
|
||||
<svg
|
||||
width={width}
|
||||
height={height}
|
||||
fill={fill}
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
>
|
||||
<path
|
||||
d="M1.00732.957845 1.00732 2.99951M1.00732 5.04175H1.00179"
|
||||
stroke={stroke}
|
||||
strokeWidth={strokeWidth}
|
||||
strokeLinecap="round"
|
||||
strokeLinejoin="round"
|
||||
/>
|
||||
</svg>
|
||||
);
|
||||
}
|
||||
|
||||
SeverityWarningIcon.defaultProps = {
|
||||
width: 2,
|
||||
height: 6,
|
||||
fill: 'none',
|
||||
stroke: '#FFD778',
|
||||
strokeWidth: '0.978299',
|
||||
};
|
||||
|
||||
export default SeverityWarningIcon;
|
||||
@@ -1,17 +0,0 @@
|
||||
<svg width="46" height="46" viewBox="0 0 46 46" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<g filter="url(#filter0_d_2445_31698)">
|
||||
<circle cx="23" cy="23" r="3" fill="#51E7A8"/>
|
||||
</g>
|
||||
<defs>
|
||||
<filter id="filter0_d_2445_31698" x="0" y="0" width="46" height="46" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
|
||||
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
|
||||
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
|
||||
<feOffset/>
|
||||
<feGaussianBlur stdDeviation="10"/>
|
||||
<feComposite in2="hardAlpha" operator="out"/>
|
||||
<feColorMatrix type="matrix" values="0 0 0 0 0.317647 0 0 0 0 0.905882 0 0 0 0 0.658824 0 0 0 0.6 0"/>
|
||||
<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_2445_31698"/>
|
||||
<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_2445_31698" result="shape"/>
|
||||
</filter>
|
||||
</defs>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 910 B |
|
Before Width: | Height: | Size: 204 KiB |
@@ -1,458 +0,0 @@
|
||||
<svg
|
||||
width="1348"
|
||||
height="8"
|
||||
viewBox="0 0 1348 8"
|
||||
fill="none"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
>
|
||||
<rect width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="12" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="18" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="24" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="30" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="36" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="42" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="48" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="54" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="60" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="66" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="72" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="78" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="84" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="90" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="96" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="102" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="108" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="114" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="120" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="126" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="132" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="138" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="144" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="150" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="156" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="162" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="168" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="174" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="180" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="186" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="192" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="198" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="204" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="210" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="216" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="222" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="228" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="234" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="240" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="246" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="252" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="258" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="264" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="270" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="276" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="282" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="288" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="294" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="300" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="306" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="312" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="318" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="324" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="330" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="336" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="342" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="348" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="354" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="360" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="366" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="372" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="378" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="384" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="390" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="396" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="402" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="408" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="414" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="420" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="426" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="432" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="438" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="444" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="450" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="456" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="462" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="468" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="474" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="480" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="486" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="492" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="498" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="504" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="510" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="516" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="522" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="528" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="534" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="540" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="546" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="552" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="558" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="564" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="570" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="576" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="582" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="588" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="594" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="600" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="606" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="612" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="618" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="624" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="630" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="636" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="642" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="648" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="654" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="660" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="666" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="672" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="678" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="684" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="690" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="696" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="702" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="708" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="714" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="720" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="726" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="732" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="738" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="744" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="750" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="756" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="762" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="768" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="774" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="780" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="786" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="792" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="798" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="804" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="810" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="816" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="822" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="828" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="834" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="840" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="846" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="852" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="858" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="864" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="870" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="876" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="882" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="888" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="894" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="900" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="906" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="912" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="918" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="924" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="930" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="936" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="942" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="948" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="954" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="960" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="966" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="972" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="978" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="984" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="990" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="996" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="1002" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="1008" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="1014" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="1020" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="1026" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="1032" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="1038" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="1044" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="1050" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="1056" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="1062" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="1068" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="1074" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="1080" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="1086" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="1092" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="1098" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="1104" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="1110" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="1116" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="1122" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="1128" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="1134" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="1140" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="1146" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="1152" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="1158" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="1164" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="1170" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="1176" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="1182" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="1188" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="1194" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="1200" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="1206" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="1212" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="1218" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="1224" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="1230" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="1236" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="1242" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="1248" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="1254" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="1260" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="1266" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="1272" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="1278" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="1284" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="1290" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="1296" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="1302" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="1308" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="1314" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="1320" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="1326" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="1332" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="1338" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="1344" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="6" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="12" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="18" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="24" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="30" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="36" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="42" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="48" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="54" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="60" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="66" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="72" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="78" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="84" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="90" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="96" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="102" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="108" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="114" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="120" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="126" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="132" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="138" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="144" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="150" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="156" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="162" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="168" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="174" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="180" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="186" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="192" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="198" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="204" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="210" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="216" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="222" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="228" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="234" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="240" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="246" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="252" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="258" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="264" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="270" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="276" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="282" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="288" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="294" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="300" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="306" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="312" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="318" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="324" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="330" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="336" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="342" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="348" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="354" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="360" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="366" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="372" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="378" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="384" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="390" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="396" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="402" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="408" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="414" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="420" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="426" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="432" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="438" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="444" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="450" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="456" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="462" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="468" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="474" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="480" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="486" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="492" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="498" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="504" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="510" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="516" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="522" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="528" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="534" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="540" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="546" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="552" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="558" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="564" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="570" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="576" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="582" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="588" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="594" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="600" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="606" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="612" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="618" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="624" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="630" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="636" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="642" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="648" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="654" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="660" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="666" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="672" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="678" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="684" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="690" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="696" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="702" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="708" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="714" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="720" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="726" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="732" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="738" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="744" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="750" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="756" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="762" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="768" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="774" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="780" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="786" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="792" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="798" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="804" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="810" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="816" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="822" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="828" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="834" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="840" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="846" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="852" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="858" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="864" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="870" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="876" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="882" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="888" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="894" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="900" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="906" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="912" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="918" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="924" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="930" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="936" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="942" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="948" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="954" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="960" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="966" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="972" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="978" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="984" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="990" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="996" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="1002" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="1008" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="1014" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="1020" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="1026" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="1032" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="1038" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="1044" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="1050" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="1056" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="1062" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="1068" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="1074" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="1080" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="1086" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="1092" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="1098" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="1104" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="1110" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="1116" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="1122" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="1128" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="1134" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="1140" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="1146" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="1152" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="1158" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="1164" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="1170" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="1176" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="1182" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="1188" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="1194" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="1200" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="1206" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="1212" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="1218" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="1224" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="1230" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="1236" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="1242" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="1248" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="1254" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="1260" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="1266" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="1272" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="1278" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="1284" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="1290" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="1296" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="1302" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="1308" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="1314" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="1320" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="1326" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="1332" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="1338" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
<rect x="1344" y="6" width="2" height="2" rx="1" fill="#242834" />
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 31 KiB |
|
Before Width: | Height: | Size: 194 KiB |
|
Before Width: | Height: | Size: 1.7 MiB |
@@ -1 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 565.65 130.02"><defs><style>.cls-1{fill:#17181a;}.cls-2{fill:#f15931;}.cls-3{fill:#f9f2f8;}</style></defs><g id="Layer_2" data-name="Layer 2"><g id="Layer_1-2" data-name="Layer 1"><path class="cls-1" d="M157.17,97.54q-7.86-7.79-7.85-21.71h17.22q0,6.58,3.35,10.32t9.31,3.73h14.06a15.93,15.93,0,0,0,9.05-2.34,7.22,7.22,0,0,0,3.48-6.27V77q0-6.21-9.12-7.73l-23.29-3.92Q162,63.42,156.09,58A17.81,17.81,0,0,1,150.2,44.3V37.21a20.09,20.09,0,0,1,3.61-11.84,23.11,23.11,0,0,1,10.26-7.92,39.67,39.67,0,0,1,15.38-2.78h14.31a30.14,30.14,0,0,1,14.56,3.42,24.37,24.37,0,0,1,9.82,9.56,28.37,28.37,0,0,1,3.48,14.24H204.4a12.27,12.27,0,0,0-2.92-8.55,9.89,9.89,0,0,0-7.72-3.22H179.45a14.51,14.51,0,0,0-8.54,2.28,7.05,7.05,0,0,0-3.23,6.07v3.42q0,6.33,8.73,7.85l23.18,4q11.52,2,17.6,7.16a16.52,16.52,0,0,1,6.07,13.23v8.36a19.86,19.86,0,0,1-3.73,11.9,24.08,24.08,0,0,1-10.45,8,39.54,39.54,0,0,1-15.57,2.85H179Q165,105.33,157.17,97.54Z"/><path class="cls-1" d="M237.89,32.33a9.93,9.93,0,0,1-3-7.53,10,10,0,0,1,3-7.54,12.42,12.42,0,0,1,15.83,0,10,10,0,0,1,3,7.54,10,10,0,0,1-3,7.53,12.42,12.42,0,0,1-15.83,0Zm-.7,8.8h17.22v63.19H237.19Z"/><path class="cls-1" d="M279.1,124.26a21.43,21.43,0,0,1-7.47-15.13h17a6.41,6.41,0,0,0,2.28,4.49,7.58,7.58,0,0,0,5.06,1.71h11.4a7.65,7.65,0,0,0,6.39-3.23,13.46,13.46,0,0,0,2.47-8.42v-6a18.47,18.47,0,0,1-6.14,4.43,16.59,16.59,0,0,1-6.9,1.65h-8.74q-11.52,0-18.55-6.84t-7-18V66.08a27.41,27.41,0,0,1,3.3-13.62,22.83,22.83,0,0,1,9.24-9.11,28.27,28.27,0,0,1,13.68-3.23h7.34a18.87,18.87,0,0,1,8.42,2,18.64,18.64,0,0,1,6.65,5.31V41.13h15.95v62.55a28.43,28.43,0,0,1-3.23,13.81,22.81,22.81,0,0,1-9.18,9.24A27.79,27.79,0,0,1,307.34,130h-11.4Q285.82,130,279.1,124.26Zm25.2-35a10.11,10.11,0,0,0,8.1-4,18.2,18.2,0,0,0,3.8-10.45V66.08A13.26,13.26,0,0,0,312.78,58a9.76,9.76,0,0,0-7.34-3h-8.86a9.5,9.5,0,0,0-7.6,3.42,13.4,13.4,0,0,0-2.91,9V77.73a12.55,12.55,0,0,0,2.65,8.35,8.55,8.55,0,0,0,6.84,3.17Z"/><path class="cls-1" d="M348.62,15.68h15.57L406.73,76V15.68h17.1v88.64H408.26L365.71,44v60.28H348.62Z"/><path class="cls-1" d="M449.34,102.23a22.51,22.51,0,0,1-9.49-8.8,25.45,25.45,0,0,1-3.36-13.17V65.44a25.42,25.42,0,0,1,3.42-13.23,23.29,23.29,0,0,1,9.56-8.93,30.5,30.5,0,0,1,14.12-3.16H475a30.5,30.5,0,0,1,14.12,3.16,23.35,23.35,0,0,1,9.56,8.93,25.42,25.42,0,0,1,3.42,13.23V80.26a25.1,25.1,0,0,1-3.42,13.17,23,23,0,0,1-9.56,8.8,31.14,31.14,0,0,1-14.24,3.1h-11.4A30.86,30.86,0,0,1,449.34,102.23ZM474.6,90.52a9.37,9.37,0,0,0,7.47-3.23,12.43,12.43,0,0,0,2.79-8.42V66.58a12.43,12.43,0,0,0-2.79-8.42,9.21,9.21,0,0,0-7.34-3.23H463.84a9.21,9.21,0,0,0-7.34,3.23,12.43,12.43,0,0,0-2.79,8.42V78.87a12.43,12.43,0,0,0,2.79,8.42,9.08,9.08,0,0,0,7.21,3.23Z"/><path class="cls-1" d="M506.89,95.71l34.19-40H508.41V41.13h57.24v8.61l-34.19,40H565v14.56H506.89Z"/><path class="cls-2" d="M61.1,119.86C27.16,119.86,0,93.22,0,59.93,0,27,27.16,0,61.1,0H99.46a22.17,22.17,0,0,1,22.4,22v38C121.86,93.22,94.71,119.86,61.1,119.86Z"/><path class="cls-3" d="M60.62,34C35.27,34,21,55,20.39,55.87a6.53,6.53,0,0,0,0,7.26C21,64,35.27,85,60.62,85s39.64-21,40.23-21.89a6.51,6.51,0,0,0,0-7.25C100.26,55,86,34,60.62,34ZM23.9,60.79a2.33,2.33,0,0,1,0-2.58c.48-.72,10.65-15.65,28.83-19.24a22,22,0,0,0,0,41.05C34.55,76.44,24.38,61.5,23.9,60.79ZM50.49,59.5a2.11,2.11,0,0,1-4.22,0A14.36,14.36,0,0,1,60.62,45.15a2.11,2.11,0,1,1,0,4.21A10.14,10.14,0,0,0,50.49,59.5Zm10.13,5.13a5.13,5.13,0,1,1,5.13-5.13A5.13,5.13,0,0,1,60.62,64.63Zm36.72-3.84C96.86,61.5,86.7,76.44,68.52,80a22,22,0,0,0,0-41C86.7,42.56,96.86,57.49,97.34,58.21A2.29,2.29,0,0,1,97.34,60.79Z"/></g></g></svg>
|
||||
|
Before Width: | Height: | Size: 3.5 KiB |
@@ -1 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 565.65 130.02"><defs><style>.cls-1{fill:#fff;}.cls-2{fill:#f15931;}.cls-3{fill:#f9f2f8;}</style></defs><g id="Layer_2" data-name="Layer 2"><g id="Layer_1-2" data-name="Layer 1"><path class="cls-1" d="M157.17,97.54q-7.86-7.79-7.85-21.71h17.22q0,6.58,3.35,10.32t9.31,3.73h14.06a15.93,15.93,0,0,0,9.05-2.34,7.22,7.22,0,0,0,3.48-6.27V77q0-6.21-9.12-7.73l-23.29-3.92Q162,63.42,156.09,58A17.81,17.81,0,0,1,150.2,44.3V37.21a20.09,20.09,0,0,1,3.61-11.84,23.11,23.11,0,0,1,10.26-7.92,39.67,39.67,0,0,1,15.38-2.78h14.31a30.14,30.14,0,0,1,14.56,3.42,24.37,24.37,0,0,1,9.82,9.56,28.37,28.37,0,0,1,3.48,14.24H204.4a12.27,12.27,0,0,0-2.92-8.55,9.89,9.89,0,0,0-7.72-3.22H179.45a14.51,14.51,0,0,0-8.54,2.28,7.05,7.05,0,0,0-3.23,6.07v3.42q0,6.33,8.73,7.85l23.18,4q11.52,2,17.6,7.16a16.52,16.52,0,0,1,6.07,13.23v8.36a19.86,19.86,0,0,1-3.73,11.9,24.08,24.08,0,0,1-10.45,8,39.54,39.54,0,0,1-15.57,2.85H179Q165,105.33,157.17,97.54Z"/><path class="cls-1" d="M237.89,32.33a9.93,9.93,0,0,1-3-7.53,10,10,0,0,1,3-7.54,12.42,12.42,0,0,1,15.83,0,10,10,0,0,1,3,7.54,10,10,0,0,1-3,7.53,12.42,12.42,0,0,1-15.83,0Zm-.7,8.8h17.22v63.19H237.19Z"/><path class="cls-1" d="M279.1,124.26a21.43,21.43,0,0,1-7.47-15.13h17a6.41,6.41,0,0,0,2.28,4.49,7.58,7.58,0,0,0,5.06,1.71h11.4a7.65,7.65,0,0,0,6.39-3.23,13.46,13.46,0,0,0,2.47-8.42v-6a18.47,18.47,0,0,1-6.14,4.43,16.59,16.59,0,0,1-6.9,1.65h-8.74q-11.52,0-18.55-6.84t-7-18V66.08a27.41,27.41,0,0,1,3.3-13.62,22.83,22.83,0,0,1,9.24-9.11,28.27,28.27,0,0,1,13.68-3.23h7.34a18.87,18.87,0,0,1,8.42,2,18.64,18.64,0,0,1,6.65,5.31V41.13h15.95v62.55a28.43,28.43,0,0,1-3.23,13.81,22.81,22.81,0,0,1-9.18,9.24A27.79,27.79,0,0,1,307.34,130h-11.4Q285.82,130,279.1,124.26Zm25.2-35a10.11,10.11,0,0,0,8.1-4,18.2,18.2,0,0,0,3.8-10.45V66.08A13.26,13.26,0,0,0,312.78,58a9.76,9.76,0,0,0-7.34-3h-8.86a9.5,9.5,0,0,0-7.6,3.42,13.4,13.4,0,0,0-2.91,9V77.73a12.55,12.55,0,0,0,2.65,8.35,8.55,8.55,0,0,0,6.84,3.17Z"/><path class="cls-1" d="M348.62,15.68h15.57L406.73,76V15.68h17.1v88.64H408.26L365.71,44v60.28H348.62Z"/><path class="cls-1" d="M449.34,102.23a22.51,22.51,0,0,1-9.49-8.8,25.45,25.45,0,0,1-3.36-13.17V65.44a25.42,25.42,0,0,1,3.42-13.23,23.29,23.29,0,0,1,9.56-8.93,30.5,30.5,0,0,1,14.12-3.16H475a30.5,30.5,0,0,1,14.12,3.16,23.35,23.35,0,0,1,9.56,8.93,25.42,25.42,0,0,1,3.42,13.23V80.26a25.1,25.1,0,0,1-3.42,13.17,23,23,0,0,1-9.56,8.8,31.14,31.14,0,0,1-14.24,3.1h-11.4A30.86,30.86,0,0,1,449.34,102.23ZM474.6,90.52a9.37,9.37,0,0,0,7.47-3.23,12.43,12.43,0,0,0,2.79-8.42V66.58a12.43,12.43,0,0,0-2.79-8.42,9.21,9.21,0,0,0-7.34-3.23H463.84a9.21,9.21,0,0,0-7.34,3.23,12.43,12.43,0,0,0-2.79,8.42V78.87a12.43,12.43,0,0,0,2.79,8.42,9.08,9.08,0,0,0,7.21,3.23Z"/><path class="cls-1" d="M506.89,95.71l34.19-40H508.41V41.13h57.24v8.61l-34.19,40H565v14.56H506.89Z"/><path class="cls-2" d="M61.1,119.86C27.16,119.86,0,93.22,0,59.93,0,27,27.16,0,61.1,0H99.46a22.17,22.17,0,0,1,22.4,22v38C121.86,93.22,94.71,119.86,61.1,119.86Z"/><path class="cls-3" d="M60.62,34C35.27,34,21,55,20.39,55.87a6.53,6.53,0,0,0,0,7.26C21,64,35.27,85,60.62,85s39.64-21,40.23-21.89a6.51,6.51,0,0,0,0-7.25C100.26,55,86,34,60.62,34ZM23.9,60.79a2.33,2.33,0,0,1,0-2.58c.48-.72,10.65-15.65,28.83-19.24a22,22,0,0,0,0,41.05C34.55,76.44,24.38,61.5,23.9,60.79ZM50.49,59.5a2.11,2.11,0,0,1-4.22,0A14.36,14.36,0,0,1,60.62,45.15a2.11,2.11,0,1,1,0,4.21A10.14,10.14,0,0,0,50.49,59.5Zm10.13,5.13a5.13,5.13,0,1,1,5.13-5.13A5.13,5.13,0,0,1,60.62,64.63Zm36.72-3.84C96.86,61.5,86.7,76.44,68.52,80a22,22,0,0,0,0-41C86.7,42.56,96.86,57.49,97.34,58.21A2.29,2.29,0,0,1,97.34,60.79Z"/></g></g></svg>
|
||||
|
Before Width: | Height: | Size: 3.5 KiB |
@@ -33,10 +33,6 @@
|
||||
|
||||
.brand-tagline {
|
||||
margin-bottom: 24px;
|
||||
|
||||
.ant-typography {
|
||||
color: var(--l2-foreground); // Secondary text
|
||||
}
|
||||
}
|
||||
|
||||
/* HTML: <div class="loader"></div> */
|
||||
|
||||
@@ -57,9 +57,5 @@
|
||||
|
||||
.ant-drawer-footer {
|
||||
border-top: 1px solid var(--l1-border);
|
||||
|
||||
.footer-text {
|
||||
color: var(--l2-foreground);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -141,10 +141,6 @@
|
||||
border-radius: 4px;
|
||||
padding: 6px 24px 6px 12px;
|
||||
width: max-content;
|
||||
|
||||
.configure-option-Info-text {
|
||||
color: var(--l2-foreground);
|
||||
}
|
||||
}
|
||||
|
||||
.row-panel {
|
||||
@@ -157,11 +153,6 @@
|
||||
height: 48px !important;
|
||||
width: 100%;
|
||||
|
||||
.ant-typography {
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.row-panel-section {
|
||||
display: flex;
|
||||
gap: 6px;
|
||||
|
||||
@@ -67,21 +67,6 @@
|
||||
color: var(--bg-cherry-400) !important;
|
||||
}
|
||||
|
||||
.info-text {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 4px;
|
||||
cursor: default;
|
||||
color: var(--l2-foreground) !important;
|
||||
}
|
||||
|
||||
.info-text:hover {
|
||||
&.ant-btn-text {
|
||||
background-color: unset !important;
|
||||
}
|
||||
}
|
||||
|
||||
.date-time-popover__footer {
|
||||
border-top: 1px solid var(--l1-border);
|
||||
padding: 8px 14px;
|
||||
|
||||
@@ -24,10 +24,4 @@
|
||||
gap: 4px;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
&__nav {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 2px;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
// radio option labels — radix popover content inherits the root font
|
||||
// radio option labels — popover content inherits the root font
|
||||
// size; pin to the app's 13px base the antd popover used to impose
|
||||
label {
|
||||
font-size: var(--label-base-400-font-size);
|
||||
|
||||
@@ -11,12 +11,6 @@
|
||||
gap: 4px;
|
||||
}
|
||||
|
||||
.header-ai-assistant-btn__prefix {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
}
|
||||
|
||||
.header-ai-assistant-btn__badge {
|
||||
flex-shrink: 0;
|
||||
display: inline-flex;
|
||||
@@ -130,13 +124,6 @@
|
||||
resize: none;
|
||||
}
|
||||
}
|
||||
|
||||
.feedback-content-include-console-logs {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 8px;
|
||||
}
|
||||
}
|
||||
|
||||
.feedback-modal-content-footer {
|
||||
|
||||
@@ -1,60 +0,0 @@
|
||||
.host-containers {
|
||||
gap: 24px;
|
||||
height: 60vh;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 100%;
|
||||
margin: 0 auto;
|
||||
box-sizing: border-box;
|
||||
|
||||
.infra-container-card-container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 24px;
|
||||
}
|
||||
|
||||
.dev-status-container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.infra-container-card {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.infra-container-card-text {
|
||||
font-size: var(--paragraph-base-400-font-size);
|
||||
color: var(--l2-foreground);
|
||||
line-height: 20px;
|
||||
letter-spacing: -0.07px;
|
||||
width: 400px;
|
||||
font-family: 'Inter';
|
||||
margin-top: 12px;
|
||||
font-weight: 300;
|
||||
}
|
||||
|
||||
.infra-container-working-msg {
|
||||
display: flex;
|
||||
width: 400px;
|
||||
padding: 12px;
|
||||
align-items: flex-start;
|
||||
gap: 12px;
|
||||
border-radius: 4px;
|
||||
background: color-mix(in srgb, var(--bg-robin-200) 4%, transparent);
|
||||
|
||||
.ant-space {
|
||||
align-items: flex-start;
|
||||
}
|
||||
}
|
||||
|
||||
.infra-container-contact-support-btn {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin: auto;
|
||||
}
|
||||
}
|
||||
@@ -1,60 +0,0 @@
|
||||
.host-processes {
|
||||
gap: 24px;
|
||||
height: 60vh;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 100%;
|
||||
margin: 0 auto;
|
||||
box-sizing: border-box;
|
||||
|
||||
.infra-container-card-container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 24px;
|
||||
}
|
||||
|
||||
.dev-status-container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.infra-container-card {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.infra-container-card-text {
|
||||
font-size: var(--paragraph-base-400-font-size);
|
||||
color: var(--l2-foreground);
|
||||
line-height: 20px;
|
||||
letter-spacing: -0.07px;
|
||||
width: 400px;
|
||||
font-family: 'Inter';
|
||||
margin-top: 12px;
|
||||
font-weight: 300;
|
||||
}
|
||||
|
||||
.infra-container-working-msg {
|
||||
display: flex;
|
||||
width: 400px;
|
||||
padding: 12px;
|
||||
align-items: flex-start;
|
||||
gap: 12px;
|
||||
border-radius: 4px;
|
||||
background: color-mix(in srgb, var(--bg-robin-200) 4%, transparent);
|
||||
|
||||
.ant-space {
|
||||
align-items: flex-start;
|
||||
}
|
||||
}
|
||||
|
||||
.infra-container-contact-support-btn {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin: auto;
|
||||
}
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
.wait-list-container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 8px;
|
||||
|
||||
.wait-list-text {
|
||||
font-weight: 300;
|
||||
}
|
||||
|
||||
.join-waitlist-btn {
|
||||
width: 160px;
|
||||
border-radius: 2px;
|
||||
background: var(--slate-500);
|
||||
}
|
||||
}
|
||||
@@ -1,83 +0,0 @@
|
||||
import { useState } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { Color } from '@signozhq/design-tokens';
|
||||
import { Button } from 'antd';
|
||||
import { Typography } from '@signozhq/ui/typography';
|
||||
import logEvent from 'api/common/logEvent';
|
||||
import { useNotifications } from 'hooks/useNotifications';
|
||||
import { CircleCheckBig, HandPlatter } from '@signozhq/icons';
|
||||
import { useAppContext } from 'providers/App/App';
|
||||
|
||||
import './WaitListFragment.styles.scss';
|
||||
|
||||
export default function WaitlistFragment({
|
||||
entityType,
|
||||
}: {
|
||||
entityType: string;
|
||||
}): JSX.Element {
|
||||
const { user } = useAppContext();
|
||||
const { t } = useTranslation(['infraMonitoring']);
|
||||
const { notifications } = useNotifications();
|
||||
|
||||
const [isSubmitting, setIsSubmitting] = useState(false);
|
||||
const [isSuccess, setIsSuccess] = useState(false);
|
||||
|
||||
const handleJoinWaitlist = (): void => {
|
||||
if (!user || !user.email) {
|
||||
return;
|
||||
}
|
||||
|
||||
setIsSubmitting(true);
|
||||
|
||||
logEvent('Infra Monitoring: Get early access clicked', {
|
||||
entityType,
|
||||
userEmail: user.email,
|
||||
})
|
||||
.then(() => {
|
||||
notifications.success({
|
||||
message: t('waitlist_success_message'),
|
||||
});
|
||||
|
||||
setIsSubmitting(false);
|
||||
setIsSuccess(true);
|
||||
|
||||
setTimeout(() => {
|
||||
setIsSuccess(false);
|
||||
}, 4000);
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error('Error logging event:', error);
|
||||
});
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="wait-list-container">
|
||||
<Typography
|
||||
variant="paragraph"
|
||||
size="base"
|
||||
weight="regular"
|
||||
color="inherit"
|
||||
as="span"
|
||||
textOverflow="wrap"
|
||||
>
|
||||
{t('waitlist_message')}
|
||||
</Typography>
|
||||
|
||||
<Button
|
||||
className="periscope-btn join-waitlist-btn"
|
||||
type="default"
|
||||
loading={isSubmitting}
|
||||
icon={
|
||||
isSuccess ? (
|
||||
<CircleCheckBig size={16} color={Color.BG_FOREST_500} />
|
||||
) : (
|
||||
<HandPlatter size={16} />
|
||||
)
|
||||
}
|
||||
onClick={handleJoinWaitlist}
|
||||
>
|
||||
Get early access
|
||||
</Button>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -87,10 +87,6 @@
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.errorText {
|
||||
color: var(--danger-background);
|
||||
}
|
||||
|
||||
.addRow {
|
||||
display: flex;
|
||||
justify-content: flex-start;
|
||||
|
||||
@@ -64,7 +64,7 @@ describe('InviteMembers - Submission', () => {
|
||||
|
||||
render(
|
||||
<InviteMembers
|
||||
initialRowCount={3}
|
||||
initialRowCount={2}
|
||||
renderFooter={({ submit }): JSX.Element => (
|
||||
<button data-testid="submit-btn" onClick={submit}>
|
||||
Submit
|
||||
@@ -77,13 +77,11 @@ describe('InviteMembers - Submission', () => {
|
||||
await pickRole(user, 0, 'role-viewer');
|
||||
await enterInviteEmail(user, 1, 'bob@signoz.io');
|
||||
await pickRole(user, 1, 'role-editor');
|
||||
await enterInviteEmail(user, 2, 'charlie@signoz.io');
|
||||
await pickRole(user, 2, 'role-admin');
|
||||
|
||||
await user.click(screen.getByTestId('submit-btn'));
|
||||
|
||||
await waitFor(() => {
|
||||
expect(calls).toHaveLength(3);
|
||||
expect(calls).toHaveLength(2);
|
||||
});
|
||||
|
||||
expect(calls[0]).toMatchObject({
|
||||
@@ -94,10 +92,6 @@ describe('InviteMembers - Submission', () => {
|
||||
email: 'bob@signoz.io',
|
||||
userRoles: [{ id: 'role-editor' }],
|
||||
});
|
||||
expect(calls[2]).toMatchObject({
|
||||
email: 'charlie@signoz.io',
|
||||
userRoles: [{ id: 'role-admin' }],
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
export const onboardingHelpMessage = (
|
||||
dataSourceName: string,
|
||||
moduleId: string,
|
||||
): string => `Hi Team,
|
||||
|
||||
I am facing issues sending data to SigNoz. Here are my application details
|
||||
|
||||
Data Source: ${dataSourceName}
|
||||
Framework:
|
||||
Environment:
|
||||
Module: ${moduleId}
|
||||
|
||||
Thanks
|
||||
`;
|
||||
@@ -14,14 +14,14 @@ export type CreatedByProps =
|
||||
creatorOptions: CreatorOption[];
|
||||
createdBy: string[];
|
||||
onCreatedByChange: (emails: string[]) => void;
|
||||
// Clear all Created-by selections and run immediately.
|
||||
onClearCreatedBy: () => void;
|
||||
// Run a Created-by change made with the dropdown closed.
|
||||
onCreatedByCommit: (emails: string[]) => void;
|
||||
}
|
||||
| {
|
||||
creatorOptions?: undefined;
|
||||
createdBy?: undefined;
|
||||
onCreatedByChange?: undefined;
|
||||
onClearCreatedBy?: undefined;
|
||||
onCreatedByCommit?: undefined;
|
||||
};
|
||||
|
||||
type Props = CreatedByProps & {
|
||||
@@ -61,8 +61,8 @@ function FilterChips(props: Props): JSX.Element {
|
||||
placeholder="Created by"
|
||||
testId={`${testIdPrefix}-filter-created-by`}
|
||||
disabled={disabled}
|
||||
onClear={props.onClearCreatedBy}
|
||||
onChange={props.onCreatedByChange}
|
||||
onCommit={props.onCreatedByCommit}
|
||||
onDropdownVisibleChange={runOnClose}
|
||||
/>
|
||||
)}
|
||||
|
||||
@@ -81,7 +81,7 @@ function FilterZone({
|
||||
applyDraft,
|
||||
handleCreatedByChange,
|
||||
handleUpdatedChange,
|
||||
handleClearCreatedBy,
|
||||
handleCreatedByCommit,
|
||||
handleClear,
|
||||
} = useFilterZoneDraft({
|
||||
query,
|
||||
@@ -96,7 +96,7 @@ function FilterZone({
|
||||
creatorOptions,
|
||||
createdBy: reflected.createdBy,
|
||||
onCreatedByChange: handleCreatedByChange,
|
||||
onClearCreatedBy: handleClearCreatedBy,
|
||||
onCreatedByCommit: handleCreatedByCommit,
|
||||
}
|
||||
: {};
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { useCallback, useState } from 'react';
|
||||
import { ConfigProvider, Select } from 'antd';
|
||||
import { Checkbox } from '@signozhq/ui/checkbox';
|
||||
import cx from 'classnames';
|
||||
@@ -20,7 +21,9 @@ interface Props {
|
||||
placeholder: string;
|
||||
testId: string;
|
||||
onChange: (values: string[]) => void;
|
||||
onClear?: () => void;
|
||||
// A change made with the dropdown closed (a tag's ×, the clear icon) has no
|
||||
// close to run on, so it is committed here instead of staged via onChange.
|
||||
onCommit: (values: string[]) => void;
|
||||
onDropdownVisibleChange?: (open: boolean) => void;
|
||||
disabled?: boolean;
|
||||
}
|
||||
@@ -31,10 +34,31 @@ function MultiSelectFilter({
|
||||
placeholder,
|
||||
testId,
|
||||
onChange,
|
||||
onClear,
|
||||
onCommit,
|
||||
onDropdownVisibleChange,
|
||||
disabled = false,
|
||||
}: Props): JSX.Element {
|
||||
const [isOpen, setIsOpen] = useState(false);
|
||||
|
||||
const handleChange = useCallback(
|
||||
(next: string[]): void => {
|
||||
if (!isOpen) {
|
||||
onCommit(next);
|
||||
return;
|
||||
}
|
||||
onChange(next);
|
||||
},
|
||||
[isOpen, onChange, onCommit],
|
||||
);
|
||||
|
||||
const handleDropdownVisibleChange = useCallback(
|
||||
(nextOpen: boolean): void => {
|
||||
setIsOpen(nextOpen);
|
||||
onDropdownVisibleChange?.(nextOpen);
|
||||
},
|
||||
[onDropdownVisibleChange],
|
||||
);
|
||||
|
||||
return (
|
||||
<ConfigProvider theme={CHECKBOX_SELECT_THEME}>
|
||||
<Select
|
||||
@@ -51,7 +75,6 @@ function MultiSelectFilter({
|
||||
menuItemSelectedIcon={null}
|
||||
data-testid={testId}
|
||||
disabled={disabled}
|
||||
onClear={onClear}
|
||||
optionRender={(option): JSX.Element => (
|
||||
<div
|
||||
className={styles.checkOption}
|
||||
@@ -66,8 +89,8 @@ function MultiSelectFilter({
|
||||
<span className={styles.checkOptionLabel}>{option.label}</span>
|
||||
</div>
|
||||
)}
|
||||
onChange={(next): void => onChange(next as string[])}
|
||||
onDropdownVisibleChange={onDropdownVisibleChange}
|
||||
onChange={(next): void => handleChange(next as string[])}
|
||||
onDropdownVisibleChange={handleDropdownVisibleChange}
|
||||
/>
|
||||
</ConfigProvider>
|
||||
);
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { render, screen } from 'tests/test-utils';
|
||||
import userEvent from '@testing-library/user-event';
|
||||
import { render, screen, within } from 'tests/test-utils';
|
||||
|
||||
import type { DslGrammar } from '../../dsl/types';
|
||||
import FilterZone from '../FilterZone';
|
||||
@@ -47,4 +48,33 @@ describe('FilterZone', () => {
|
||||
).not.toBeInTheDocument();
|
||||
expect(screen.getByTestId('things-filter-updated')).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('runs the query when a creator is removed with the dropdown closed', async () => {
|
||||
const user = userEvent.setup();
|
||||
const onQueryChange = jest.fn();
|
||||
render(
|
||||
<FilterZone
|
||||
query="created_by = 'ada@example.com'"
|
||||
grammar={grammar}
|
||||
testIdPrefix="things"
|
||||
creatorOptions={[{ email: 'ada@example.com', label: 'Ada' }]}
|
||||
source={source}
|
||||
onQueryChange={onQueryChange}
|
||||
/>,
|
||||
);
|
||||
|
||||
// antd renders the tag's × aria-hidden.
|
||||
await user.click(
|
||||
within(screen.getByTitle('Ada')).getByRole('img', {
|
||||
name: 'close',
|
||||
hidden: true,
|
||||
}),
|
||||
);
|
||||
|
||||
expect(
|
||||
within(screen.getByTestId('things-filter-created-by')).getByRole('combobox'),
|
||||
).toHaveAttribute('aria-expanded', 'false');
|
||||
|
||||
expect(onQueryChange).toHaveBeenCalledWith('');
|
||||
});
|
||||
});
|
||||
|
||||
@@ -106,12 +106,20 @@ describe('useFilterZoneDraft', () => {
|
||||
"created_by = 'a@x.io' AND name = 'x'",
|
||||
);
|
||||
|
||||
act(() => result.current.handleClearCreatedBy());
|
||||
act(() => result.current.handleCreatedByCommit([]));
|
||||
|
||||
expect(result.current.draft).toBe("name = 'x'");
|
||||
expect(onQueryChange).toHaveBeenCalledWith("name = 'x'");
|
||||
});
|
||||
|
||||
it('runs the remaining creators when one is removed', () => {
|
||||
const { result, onQueryChange } = setup("created_by IN ['a@x.io', 'b@x.io']");
|
||||
|
||||
act(() => result.current.handleCreatedByCommit(['b@x.io']));
|
||||
|
||||
expect(onQueryChange).toHaveBeenCalledWith("created_by = 'b@x.io'");
|
||||
});
|
||||
|
||||
it('empties the draft and runs the empty query on clear', () => {
|
||||
const { result, onQueryChange, onCleared, onClearAll } = setup();
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ interface FilterZoneDraft {
|
||||
applyDraft: (next: string) => void;
|
||||
handleCreatedByChange: (emails: string[]) => void;
|
||||
handleUpdatedChange: (window: UpdatedWindow) => void;
|
||||
handleClearCreatedBy: () => void;
|
||||
handleCreatedByCommit: (emails: string[]) => void;
|
||||
handleClear: () => void;
|
||||
}
|
||||
|
||||
@@ -97,10 +97,14 @@ export function useFilterZoneDraft({
|
||||
[draft, applyDraft, onFilterApplied],
|
||||
);
|
||||
|
||||
// Clear-all on the Created-by select removes its clause and runs immediately.
|
||||
const handleClearCreatedBy = useCallback((): void => {
|
||||
applyDraft(spliceClause(draft, 'created_by', null));
|
||||
}, [draft, applyDraft]);
|
||||
// Runs a Created-by change made with its dropdown closed.
|
||||
const handleCreatedByCommit = useCallback(
|
||||
(emails: string[]): void => {
|
||||
onFilterApplied?.('createdBy', { valueCount: emails.length });
|
||||
applyDraft(spliceClause(draft, 'created_by', createdByClause(emails)));
|
||||
},
|
||||
[draft, applyDraft, onFilterApplied],
|
||||
);
|
||||
|
||||
// Clear resets the draft and runs immediately (empty query).
|
||||
const handleClear = useCallback((): void => {
|
||||
@@ -122,7 +126,7 @@ export function useFilterZoneDraft({
|
||||
applyDraft,
|
||||
handleCreatedByChange,
|
||||
handleUpdatedChange,
|
||||
handleClearCreatedBy,
|
||||
handleCreatedByCommit,
|
||||
handleClear,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -24,6 +24,7 @@ interface Props {
|
||||
confirmLabel: string;
|
||||
/** Name the input holds each time the dialog opens. */
|
||||
initialName?: string;
|
||||
placeholder: string;
|
||||
testIdPrefix: string;
|
||||
}
|
||||
|
||||
@@ -35,6 +36,7 @@ function ViewNameDialog({
|
||||
description,
|
||||
confirmLabel,
|
||||
initialName = '',
|
||||
placeholder,
|
||||
testIdPrefix,
|
||||
}: Props): JSX.Element {
|
||||
const [name, setName] = useState(initialName);
|
||||
@@ -116,7 +118,7 @@ function ViewNameDialog({
|
||||
id={inputId}
|
||||
value={name}
|
||||
maxLength={VIEW_NAME_MAX_LENGTH}
|
||||
placeholder="e.g. Prod alerts"
|
||||
placeholder={placeholder}
|
||||
autoComplete="off"
|
||||
testId={`${testIdPrefix}-name`}
|
||||
onChange={(e: ChangeEvent<HTMLInputElement>): void =>
|
||||
|
||||
@@ -39,6 +39,7 @@ interface Props {
|
||||
saveTestIdPrefix?: string;
|
||||
renameTestIdPrefix?: string;
|
||||
customSectionLabel?: string;
|
||||
viewNamePlaceholder?: string;
|
||||
deleteDescription?: string;
|
||||
/** Wraps the rail body, e.g. in an authz guard. */
|
||||
guard?: (content: ReactElement) => ReactElement;
|
||||
@@ -67,6 +68,7 @@ function ViewsRail({
|
||||
saveTestIdPrefix = 'save-view',
|
||||
renameTestIdPrefix = 'rename-view',
|
||||
customSectionLabel = 'My views',
|
||||
viewNamePlaceholder = 'e.g. Production',
|
||||
deleteDescription = 'This removes the saved view.',
|
||||
guard,
|
||||
onViewSaved,
|
||||
@@ -287,6 +289,7 @@ function ViewsRail({
|
||||
title="Save as view"
|
||||
description="Save the current filters as a view you can return to."
|
||||
confirmLabel="Save view"
|
||||
placeholder={viewNamePlaceholder}
|
||||
testIdPrefix={saveTestIdPrefix}
|
||||
/>
|
||||
<ViewNameDialog
|
||||
@@ -297,6 +300,7 @@ function ViewsRail({
|
||||
description="The view keeps its filters under the new name."
|
||||
confirmLabel="Rename"
|
||||
initialName={renameTarget?.label}
|
||||
placeholder={viewNamePlaceholder}
|
||||
testIdPrefix={renameTestIdPrefix}
|
||||
/>
|
||||
{contextHolder}
|
||||
|
||||
@@ -163,6 +163,22 @@ describe('ViewsRail', () => {
|
||||
);
|
||||
});
|
||||
|
||||
it('shows the list placeholder in the save and rename dialogs', async () => {
|
||||
const user = userEvent.setup();
|
||||
renderRail({ viewNamePlaceholder: 'e.g. Prod things' });
|
||||
|
||||
await user.click(screen.getByTestId(`${PREFIX}-view-save-trigger`));
|
||||
await expect(
|
||||
screen.findByTestId('save-view-name-field'),
|
||||
).resolves.toHaveAttribute('placeholder', 'e.g. Prod things');
|
||||
await user.click(screen.getByTestId('save-view-cancel'));
|
||||
|
||||
await user.click(screen.getByTestId(`${PREFIX}-view-rename-view-1`));
|
||||
await expect(
|
||||
screen.findByTestId('rename-view-name-field'),
|
||||
).resolves.toHaveAttribute('placeholder', 'e.g. Prod things');
|
||||
});
|
||||
|
||||
it('opens the save dialog empty again after a cancel', async () => {
|
||||
const user = userEvent.setup();
|
||||
const props = renderRail({ isModified: true });
|
||||
|
||||
@@ -48,12 +48,6 @@
|
||||
color: var(--text-sienna-400);
|
||||
}
|
||||
|
||||
.formatLabel {
|
||||
font-size: 12px;
|
||||
font-weight: 500;
|
||||
color: var(--l1-foreground);
|
||||
}
|
||||
|
||||
.toolbarDivider {
|
||||
width: 1px;
|
||||
height: 16px;
|
||||
@@ -154,13 +148,6 @@
|
||||
border-top: 1px solid var(--l1-border);
|
||||
}
|
||||
|
||||
.statusPosition {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
color: var(--text-neutral-dark-200);
|
||||
}
|
||||
|
||||
.statusSeparator {
|
||||
color: var(--l1-border);
|
||||
}
|
||||
@@ -174,11 +161,6 @@
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.statusHint {
|
||||
font-size: 11px;
|
||||
color: var(--text-neutral-dark-200);
|
||||
}
|
||||
|
||||
.helpContent {
|
||||
// The popover shell carries no padding of its own, so the content owns it.
|
||||
padding: var(--spacing-8);
|
||||
|
||||
@@ -25,10 +25,6 @@
|
||||
flex: 1;
|
||||
|
||||
position: relative;
|
||||
|
||||
.qb-trace-view-selector-container {
|
||||
padding: 12px 8px 8px 8px;
|
||||
}
|
||||
}
|
||||
|
||||
.qb-content-section {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* eslint-disable sonarjs/cognitive-complexity */
|
||||
import { useEffect, useMemo, useRef, useState } from 'react';
|
||||
import { useEffect, useMemo, useState } from 'react';
|
||||
import {
|
||||
autocompletion,
|
||||
closeCompletion,
|
||||
@@ -16,6 +16,7 @@ import CodeMirror, { EditorView, keymap } from '@uiw/react-codemirror';
|
||||
import { Button } from 'antd';
|
||||
import { Having } from 'api/v5/v5';
|
||||
import { useQueryBuilderV2Context } from 'components/QueryBuilderV2/QueryBuilderV2Context';
|
||||
import { useEditorDraft } from 'components/QueryBuilderV2/QueryV2/useEditorDraft';
|
||||
import { useIsDarkMode } from 'hooks/useDarkMode';
|
||||
import { ChevronUp } from '@signozhq/icons';
|
||||
import { IBuilderQuery } from 'types/api/queryBuilder/queryBuilderData';
|
||||
@@ -99,28 +100,20 @@ function HavingFilter({
|
||||
const { getAggregationOptions } = useQueryBuilderV2Context();
|
||||
const aggregationOptions = getAggregationOptions(queryData.queryName);
|
||||
const having = queryData?.having as Having;
|
||||
const [input, setInput] = useState(having?.expression || '');
|
||||
|
||||
useEffect(() => {
|
||||
setInput(having?.expression || '');
|
||||
}, [having?.expression]);
|
||||
const { editorRef, editorProps } = useEditorDraft(
|
||||
having?.expression || '',
|
||||
onChange,
|
||||
);
|
||||
|
||||
const [isFocused, setIsFocused] = useState(false);
|
||||
|
||||
const editorRef = useRef<EditorView | null>(null);
|
||||
|
||||
const [options, setOptions] = useState<{ label: string; value: string }[]>([]);
|
||||
|
||||
const handleChange = (value: string): void => {
|
||||
setInput(value);
|
||||
onChange(value);
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
if (isFocused && editorRef.current && options.length > 0) {
|
||||
startCompletion(editorRef.current);
|
||||
}
|
||||
}, [isFocused, options]);
|
||||
}, [editorRef, isFocused, options]);
|
||||
|
||||
// Update options when aggregation options change
|
||||
useEffect(() => {
|
||||
@@ -329,8 +322,7 @@ function HavingFilter({
|
||||
<div className="having-filter-container">
|
||||
<div className="having-filter-select-container">
|
||||
<CodeMirror
|
||||
value={input}
|
||||
onChange={handleChange}
|
||||
{...editorProps}
|
||||
theme={isDarkMode ? copilot : githubLight}
|
||||
data-testid="having-editor"
|
||||
className="having-filter-select-editor"
|
||||
@@ -354,9 +346,6 @@ function HavingFilter({
|
||||
autocompletion: true,
|
||||
completionKeymap: true,
|
||||
}}
|
||||
onCreateEditor={(view: EditorView): void => {
|
||||
editorRef.current = view;
|
||||
}}
|
||||
onFocus={(): void => {
|
||||
setIsFocused(true);
|
||||
if (editorRef.current) {
|
||||
|
||||
@@ -35,16 +35,6 @@
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 16px;
|
||||
|
||||
.compass-button {
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
|
||||
border-radius: 2px;
|
||||
border: 1px solid var(--query-builder-v2-border-color, var(--l2-border));
|
||||
background: var(--l3-background);
|
||||
box-shadow: 0px 0px 8px 0px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
}
|
||||
|
||||
.having-filter-container {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* eslint-disable import/no-extraneous-dependencies */
|
||||
/* eslint-disable sonarjs/cognitive-complexity */
|
||||
import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
||||
import { useCallback, useEffect, useMemo, useState } from 'react';
|
||||
import {
|
||||
autocompletion,
|
||||
closeCompletion,
|
||||
@@ -36,6 +36,7 @@ import {
|
||||
} from 'types/common/queryBuilder';
|
||||
|
||||
import { useQueryBuilderV2Context } from '../../QueryBuilderV2Context';
|
||||
import { useEditorDraft } from '../useEditorDraft';
|
||||
|
||||
import './QueryAggregation.styles.scss';
|
||||
|
||||
@@ -175,20 +176,17 @@ function QueryAggregationSelect({
|
||||
[],
|
||||
);
|
||||
|
||||
const [input, setInput] = useState(
|
||||
formatAggregations(queryData?.aggregations),
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
setInput(formatAggregations(queryData?.aggregations));
|
||||
}, [queryData?.aggregations, formatAggregations]);
|
||||
const {
|
||||
draft: input,
|
||||
editorRef,
|
||||
editorProps,
|
||||
} = useEditorDraft(formatAggregations(queryData?.aggregations), onChange);
|
||||
|
||||
const [cursorPos, setCursorPos] = useState(0);
|
||||
const [functionArgPairs, setFunctionArgPairs] = useState<
|
||||
{ func: string; arg: string }[]
|
||||
>([]);
|
||||
const [validationError, setValidationError] = useState<string | null>(null);
|
||||
const editorRef = useRef<EditorView | null>(null);
|
||||
const [isFocused, setIsFocused] = useState(false);
|
||||
|
||||
// Get valid function names (lowercase)
|
||||
@@ -204,7 +202,7 @@ function QueryAggregationSelect({
|
||||
startCompletion(editorRef.current);
|
||||
}
|
||||
});
|
||||
}, []);
|
||||
}, [editorRef]);
|
||||
|
||||
// Update cursor position on every editor update
|
||||
const handleUpdate = (update: { view: EditorView }): void => {
|
||||
@@ -601,11 +599,7 @@ function QueryAggregationSelect({
|
||||
return (
|
||||
<div className="query-aggregation-select-container">
|
||||
<CodeMirror
|
||||
value={input}
|
||||
onChange={(value): void => {
|
||||
setInput(value);
|
||||
onChange?.(value);
|
||||
}}
|
||||
{...editorProps}
|
||||
data-testid="query-aggregation-editor"
|
||||
className={`query-aggregation-select-editor ${
|
||||
validationError ? 'error' : ''
|
||||
@@ -637,9 +631,6 @@ function QueryAggregationSelect({
|
||||
completionKeymap: true,
|
||||
}}
|
||||
onUpdate={handleUpdate}
|
||||
onCreateEditor={(view: EditorView): void => {
|
||||
editorRef.current = view;
|
||||
}}
|
||||
onFocus={(): void => {
|
||||
setIsFocused(true);
|
||||
safeStartCompletion();
|
||||
|
||||
@@ -8,7 +8,14 @@ import { ENVIRONMENT } from 'constants/env';
|
||||
import { DEBOUNCE_DELAY } from 'constants/queryBuilderFilterConfig';
|
||||
import { initialQueriesMap } from 'constants/queryBuilder';
|
||||
import { rest, server } from 'mocks-server/server';
|
||||
import { act, render, screen, userEvent, waitFor } from 'tests/test-utils';
|
||||
import {
|
||||
act,
|
||||
render,
|
||||
screen,
|
||||
userEvent,
|
||||
waitFor,
|
||||
NO_DELAY_USER_EVENT,
|
||||
} from 'tests/test-utils';
|
||||
import type { IBuilderQuery } from 'types/api/queryBuilder/queryBuilderData';
|
||||
|
||||
import DistributionFieldSelect from '../DistributionFieldSelect';
|
||||
@@ -74,7 +81,7 @@ describe('DistributionFieldSelect', () => {
|
||||
});
|
||||
|
||||
it('picks a numeric field, keeping its context', async () => {
|
||||
const user = userEvent.setup({ delay: null, pointerEventsCheck: 0 });
|
||||
const user = userEvent.setup(NO_DELAY_USER_EVENT);
|
||||
const onChange = jest.fn() as jest.MockedFunction<(field: string) => void>;
|
||||
render(
|
||||
<DistributionFieldSelect queryData={tracesQuery('')} onChange={onChange} />,
|
||||
@@ -97,7 +104,7 @@ describe('DistributionFieldSelect', () => {
|
||||
});
|
||||
|
||||
it('replaces the saved field with the newly picked one', async () => {
|
||||
const user = userEvent.setup({ delay: null, pointerEventsCheck: 0 });
|
||||
const user = userEvent.setup(NO_DELAY_USER_EVENT);
|
||||
const onChange = jest.fn() as jest.MockedFunction<(field: string) => void>;
|
||||
render(
|
||||
<DistributionFieldSelect
|
||||
@@ -119,7 +126,7 @@ describe('DistributionFieldSelect', () => {
|
||||
});
|
||||
|
||||
it('only offers listed fields: typed text is a filter, not a value', async () => {
|
||||
const user = userEvent.setup({ delay: null, pointerEventsCheck: 0 });
|
||||
const user = userEvent.setup(NO_DELAY_USER_EVENT);
|
||||
render(
|
||||
<DistributionFieldSelect queryData={tracesQuery('')} onChange={jest.fn()} />,
|
||||
);
|
||||
|
||||
@@ -440,12 +440,6 @@ $max-recents-shown: 5;
|
||||
}
|
||||
}
|
||||
|
||||
.code-mirror-card {
|
||||
.ant-card-body {
|
||||
padding: 8px;
|
||||
}
|
||||
}
|
||||
|
||||
.query-text-preview-title {
|
||||
font-size: 13px;
|
||||
color: var(--primary-foreground);
|
||||
|
||||
@@ -105,6 +105,8 @@ const stopEventsExtension = EditorView.domEventHandlers({
|
||||
},
|
||||
});
|
||||
|
||||
const EDITOR_BASIC_SETUP = { lineNumbers: false };
|
||||
|
||||
interface QuerySearchProps {
|
||||
placeholder?: string;
|
||||
onChange: (value: string) => void;
|
||||
@@ -713,14 +715,17 @@ function QuerySearch({
|
||||
}
|
||||
}, []);
|
||||
|
||||
const handleChange = (value: string): void => {
|
||||
const onChangeRef = useRef(onChange);
|
||||
onChangeRef.current = onChange;
|
||||
|
||||
const handleChange = useCallback((value: string): void => {
|
||||
if (isProgrammaticChangeRef.current) {
|
||||
isProgrammaticChangeRef.current = false;
|
||||
return;
|
||||
}
|
||||
|
||||
onChange(value);
|
||||
};
|
||||
onChangeRef.current(value);
|
||||
}, []);
|
||||
|
||||
const handleBlur = (): void => {
|
||||
const currentExpression = getCurrentExpression();
|
||||
@@ -1474,6 +1479,65 @@ function QuerySearch({
|
||||
};
|
||||
}
|
||||
|
||||
const completionSourceRef = useRef(combinedSuggestions);
|
||||
completionSourceRef.current = combinedSuggestions;
|
||||
const handleRunRef = useRef(handleRun);
|
||||
handleRunRef.current = handleRun;
|
||||
|
||||
// Built once: new extensions reconfigure CodeMirror, which closes the open suggestions.
|
||||
const editorExtensions = useMemo(
|
||||
() => [
|
||||
autocompletion({
|
||||
override: [
|
||||
(context: CompletionContext): CompletionResult | null =>
|
||||
completionSourceRef.current(context),
|
||||
],
|
||||
defaultKeymap: true,
|
||||
closeOnBlur: true,
|
||||
activateOnTyping: true,
|
||||
maxRenderedOptions: 50,
|
||||
addToOptions: [{ render: renderRecentDeleteButton, position: 100 }],
|
||||
}),
|
||||
javascript({ jsx: false, typescript: false }),
|
||||
EditorView.lineWrapping,
|
||||
stopEventsExtension,
|
||||
Prec.highest(
|
||||
keymap.of([
|
||||
...completionKeymap,
|
||||
{
|
||||
key: 'Escape',
|
||||
run: closeCompletion,
|
||||
},
|
||||
{
|
||||
key: 'Enter',
|
||||
preventDefault: true,
|
||||
// Prevent default behavior of Enter to add new line
|
||||
// and instead run a custom action
|
||||
run: (): boolean => true,
|
||||
},
|
||||
{
|
||||
key: 'Mod-Enter',
|
||||
preventDefault: true,
|
||||
// Prevent default behavior of Mod-Enter to add new line
|
||||
// and instead run a custom action
|
||||
// Mod-Enter is usually Ctrl-Enter or Cmd-Enter based on OS
|
||||
run: (): boolean => {
|
||||
handleRunRef.current();
|
||||
return true;
|
||||
},
|
||||
},
|
||||
{
|
||||
key: 'Shift-Enter',
|
||||
preventDefault: true,
|
||||
// Prevent default behavior of Shift-Enter to add new line
|
||||
run: (): boolean => true,
|
||||
},
|
||||
]),
|
||||
),
|
||||
],
|
||||
[],
|
||||
);
|
||||
|
||||
// Effect to handle focus state and trigger suggestions
|
||||
useEffect(() => {
|
||||
const clearTimeout = toggleSuggestions(10);
|
||||
@@ -1650,56 +1714,9 @@ function QuerySearch({
|
||||
hasErrors: validation.errors.length > 0,
|
||||
hasInitialExpression: isScopedFilter && !showScopeChip,
|
||||
})}
|
||||
extensions={[
|
||||
autocompletion({
|
||||
override: [combinedSuggestions],
|
||||
defaultKeymap: true,
|
||||
closeOnBlur: true,
|
||||
activateOnTyping: true,
|
||||
maxRenderedOptions: 50,
|
||||
addToOptions: [{ render: renderRecentDeleteButton, position: 100 }],
|
||||
}),
|
||||
javascript({ jsx: false, typescript: false }),
|
||||
EditorView.lineWrapping,
|
||||
stopEventsExtension,
|
||||
Prec.highest(
|
||||
keymap.of([
|
||||
...completionKeymap,
|
||||
{
|
||||
key: 'Escape',
|
||||
run: closeCompletion,
|
||||
},
|
||||
{
|
||||
key: 'Enter',
|
||||
preventDefault: true,
|
||||
// Prevent default behavior of Enter to add new line
|
||||
// and instead run a custom action
|
||||
run: (): boolean => true,
|
||||
},
|
||||
{
|
||||
key: 'Mod-Enter',
|
||||
preventDefault: true,
|
||||
// Prevent default behavior of Mod-Enter to add new line
|
||||
// and instead run a custom action
|
||||
// Mod-Enter is usually Ctrl-Enter or Cmd-Enter based on OS
|
||||
run: (): boolean => {
|
||||
handleRun();
|
||||
return true;
|
||||
},
|
||||
},
|
||||
{
|
||||
key: 'Shift-Enter',
|
||||
preventDefault: true,
|
||||
// Prevent default behavior of Shift-Enter to add new line
|
||||
run: (): boolean => true,
|
||||
},
|
||||
]),
|
||||
),
|
||||
]}
|
||||
extensions={editorExtensions}
|
||||
placeholder={placeholder}
|
||||
basicSetup={{
|
||||
lineNumbers: false,
|
||||
}}
|
||||
basicSetup={EDITOR_BASIC_SETUP}
|
||||
onFocus={(): void => {
|
||||
setIsFocused(true);
|
||||
}}
|
||||
|
||||
@@ -59,10 +59,6 @@
|
||||
}
|
||||
}
|
||||
|
||||
&-input {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
&-container {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
@@ -104,18 +100,6 @@
|
||||
}
|
||||
}
|
||||
|
||||
&.arrow-left {
|
||||
&::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
left: -16px;
|
||||
top: 50%;
|
||||
height: 1px;
|
||||
width: 16px;
|
||||
background-color: var(--l1-border);
|
||||
}
|
||||
}
|
||||
|
||||
.label {
|
||||
align-self: stretch;
|
||||
display: flex;
|
||||
|
||||
@@ -192,6 +192,8 @@ describe('QuerySearch (Integration with Real CodeMirror)', () => {
|
||||
release();
|
||||
// Outlasts the 10 ms timer QuerySearch uses to reopen suggestions.
|
||||
await act(() => new Promise((resolve) => setTimeout(resolve, 50)));
|
||||
// Outlasts the 100 ms CodeMirror waits before it queries suggestions again.
|
||||
await new Promise((resolve) => setTimeout(resolve, 150));
|
||||
|
||||
expect(screen.getByText('payment-service')).toBeInTheDocument();
|
||||
});
|
||||
|
||||
@@ -0,0 +1,115 @@
|
||||
import { EditorView } from '@uiw/react-codemirror';
|
||||
import { act, renderHook } from 'tests/test-utils';
|
||||
|
||||
import { useEditorDraft } from '../useEditorDraft';
|
||||
|
||||
function setup(
|
||||
external = '',
|
||||
onEdit?: (value: string) => void,
|
||||
): {
|
||||
result: { current: ReturnType<typeof useEditorDraft> };
|
||||
rerender: (props: { external: string }) => void;
|
||||
} {
|
||||
return renderHook(
|
||||
({ external: value }: { external: string }) => useEditorDraft(value, onEdit),
|
||||
{ initialProps: { external } },
|
||||
);
|
||||
}
|
||||
|
||||
// Reports document changes to `onChange` the way `@uiw/react-codemirror` does.
|
||||
function attachEditor(
|
||||
result: { current: ReturnType<typeof useEditorDraft> },
|
||||
doc: string,
|
||||
): EditorView {
|
||||
const view = new EditorView({
|
||||
doc,
|
||||
extensions: EditorView.updateListener.of((update) => {
|
||||
if (update.docChanged) {
|
||||
result.current.editorProps.onChange(update.state.doc.toString());
|
||||
}
|
||||
}),
|
||||
});
|
||||
act(() => result.current.editorProps.onCreateEditor(view));
|
||||
return view;
|
||||
}
|
||||
|
||||
function type(view: EditorView, text: string): void {
|
||||
act(() => {
|
||||
view.dispatch({ changes: { from: view.state.doc.length, insert: text } });
|
||||
});
|
||||
}
|
||||
|
||||
describe('useEditorDraft', () => {
|
||||
it('keeps newer typing when an older edit comes back', () => {
|
||||
const { result, rerender } = setup();
|
||||
|
||||
act(() => result.current.editorProps.onChange('count() > 1'));
|
||||
act(() => result.current.editorProps.onChange('count() > 10'));
|
||||
rerender({ external: 'count() > 1' });
|
||||
|
||||
expect(result.current.draft).toBe('count() > 10');
|
||||
});
|
||||
|
||||
it('takes a value set outside the editor', () => {
|
||||
const { result, rerender } = setup('count() > 1');
|
||||
|
||||
act(() => result.current.editorProps.onChange('count() > 10'));
|
||||
rerender({ external: 'count() > 10' });
|
||||
rerender({ external: 'count() < 5' });
|
||||
|
||||
expect(result.current.draft).toBe('count() < 5');
|
||||
});
|
||||
|
||||
it('takes an outside value equal to an edit older than the last echo', () => {
|
||||
const { result, rerender } = setup();
|
||||
|
||||
act(() => result.current.editorProps.onChange('a'));
|
||||
act(() => result.current.editorProps.onChange('ab'));
|
||||
rerender({ external: 'ab' });
|
||||
rerender({ external: 'a' });
|
||||
|
||||
expect(result.current.draft).toBe('a');
|
||||
});
|
||||
|
||||
it('keeps the editor value at the first text while the user types', () => {
|
||||
const { result, rerender } = setup('count()');
|
||||
|
||||
act(() => result.current.editorProps.onChange('count() >'));
|
||||
rerender({ external: 'count() >' });
|
||||
act(() => result.current.editorProps.onChange('count() > 1'));
|
||||
|
||||
expect(result.current.editorProps.value).toBe('count()');
|
||||
});
|
||||
|
||||
it('passes each edit on', () => {
|
||||
const onEdit = jest.fn();
|
||||
const { result } = setup('', onEdit);
|
||||
|
||||
act(() => result.current.editorProps.onChange('count()'));
|
||||
|
||||
expect(onEdit).toHaveBeenCalledWith('count()');
|
||||
});
|
||||
|
||||
it('writes an outside change into the editor without passing it on', () => {
|
||||
const onEdit = jest.fn();
|
||||
const { result, rerender } = setup('count() > 1', onEdit);
|
||||
const view = attachEditor(result, 'count() > 1');
|
||||
|
||||
rerender({ external: 'count() < 5' });
|
||||
|
||||
expect(view.state.doc.toString()).toBe('count() < 5');
|
||||
expect(view.state.selection.main.head).toBe('count() < 5'.length);
|
||||
expect(onEdit).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('leaves the editor alone when an older edit comes back', () => {
|
||||
const { result, rerender } = setup();
|
||||
const view = attachEditor(result, '');
|
||||
|
||||
type(view, 'count_');
|
||||
type(view, 'di');
|
||||
rerender({ external: 'count_' });
|
||||
|
||||
expect(view.state.doc.toString()).toBe('count_di');
|
||||
});
|
||||
});
|
||||
109
frontend/src/components/QueryBuilderV2/QueryV2/useEditorDraft.ts
Normal file
@@ -0,0 +1,109 @@
|
||||
import { useCallback, useEffect, useRef, useState } from 'react';
|
||||
import type { MutableRefObject } from 'react';
|
||||
import type { EditorView } from '@uiw/react-codemirror';
|
||||
|
||||
// Bounds the history when no parent ever echoes the edits back.
|
||||
const MAX_PENDING_ECHOES = 200;
|
||||
|
||||
interface EditorDraft {
|
||||
/** The editor's current text. */
|
||||
draft: string;
|
||||
editorRef: MutableRefObject<EditorView | null>;
|
||||
/** Spread on `CodeMirror`. */
|
||||
editorProps: {
|
||||
value: string;
|
||||
onChange: (value: string) => void;
|
||||
onCreateEditor: (view: EditorView) => void;
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Text of a query editor whose edits round-trip through query state. Each
|
||||
* edit comes back as `external` one or more renders later; writing an older
|
||||
* copy into the editor would drop the keys typed since and move the caret to
|
||||
* the start. Values the editor sent are ignored when they come back, and any
|
||||
* other `external` value replaces the text.
|
||||
*
|
||||
* The editor owns its text, so `editorProps.value` never changes after the
|
||||
* first render: `@uiw/react-codemirror` writes a changed `value` over the
|
||||
* document in a passive effect, which on a busy page runs after newer keys and
|
||||
* drops them. Outside changes are written through the view instead.
|
||||
*/
|
||||
export function useEditorDraft(
|
||||
external: string,
|
||||
onEdit?: (value: string) => void,
|
||||
): EditorDraft {
|
||||
const [draft, setDraft] = useState(external);
|
||||
const [initialValue] = useState(external);
|
||||
const editorRef = useRef<EditorView | null>(null);
|
||||
const pendingEchoes = useRef<string[]>([]);
|
||||
const writingOutsideChange = useRef(false);
|
||||
|
||||
const writeIntoEditor = useCallback((view: EditorView, text: string): void => {
|
||||
if (view.state.doc.toString() === text) {
|
||||
return;
|
||||
}
|
||||
writingOutsideChange.current = true;
|
||||
try {
|
||||
view.dispatch({
|
||||
changes: { from: 0, to: view.state.doc.length, insert: text },
|
||||
selection: { anchor: text.length },
|
||||
});
|
||||
} finally {
|
||||
writingOutsideChange.current = false;
|
||||
}
|
||||
}, []);
|
||||
|
||||
// Echoes arrive in order, and a batched render can skip some, so a match
|
||||
// also drops every older entry: they can no longer come back.
|
||||
//
|
||||
// type "c", "co", "cou" pending [c, co, cou] draft "cou"
|
||||
// echo "c" pending [co, cou] ignored, draft stays "cou"
|
||||
// echo "cou" (skipped co) pending [] ignored
|
||||
// "count() > 5" from a saved view, never sent: applied
|
||||
//
|
||||
// Keeping the older entries would also swallow an outside change that
|
||||
// happens to equal one of them: after typing "a", "ab", a saved view with
|
||||
// "a" would be taken for an echo.
|
||||
useEffect(() => {
|
||||
const index = pendingEchoes.current.indexOf(external);
|
||||
if (index === -1) {
|
||||
pendingEchoes.current = [];
|
||||
setDraft(external);
|
||||
if (editorRef.current) {
|
||||
writeIntoEditor(editorRef.current, external);
|
||||
}
|
||||
return;
|
||||
}
|
||||
pendingEchoes.current = pendingEchoes.current.slice(index + 1);
|
||||
}, [external, writeIntoEditor]);
|
||||
|
||||
const onChange = useCallback(
|
||||
(value: string): void => {
|
||||
if (writingOutsideChange.current) {
|
||||
return;
|
||||
}
|
||||
pendingEchoes.current.push(value);
|
||||
if (pendingEchoes.current.length > MAX_PENDING_ECHOES) {
|
||||
pendingEchoes.current.shift();
|
||||
}
|
||||
setDraft(value);
|
||||
onEdit?.(value);
|
||||
},
|
||||
[onEdit],
|
||||
);
|
||||
|
||||
const onCreateEditor = useCallback(
|
||||
(view: EditorView): void => {
|
||||
editorRef.current = view;
|
||||
writeIntoEditor(view, draft);
|
||||
},
|
||||
[draft, writeIntoEditor],
|
||||
);
|
||||
|
||||
return {
|
||||
draft,
|
||||
editorRef,
|
||||
editorProps: { value: initialValue, onChange, onCreateEditor },
|
||||
};
|
||||
}
|
||||
@@ -42,7 +42,6 @@ jest.mock(
|
||||
},
|
||||
);
|
||||
jest.mock('container/QueryBuilder/filters', () => ({
|
||||
AggregatorFilter: (): JSX.Element => <div />,
|
||||
MetricNameSelector: (): JSX.Element => <div />,
|
||||
}));
|
||||
// Mock hooks
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
import { CharStreams, CommonTokenStream, ParserRuleContext } from 'antlr4';
|
||||
import { cloneDeep, isEqual, sortBy } from 'lodash-es';
|
||||
import { v4 as uuid } from 'uuid';
|
||||
import { createAggregation } from 'api/v5/queryRange/prepareQueryRangePayloadV5';
|
||||
import {
|
||||
DEPRECATED_OPERATORS_MAP,
|
||||
OPERATORS,
|
||||
@@ -28,7 +27,6 @@ import { IQueryPair } from 'types/antlrQueryTypes';
|
||||
import { BaseAutocompleteData } from 'types/api/queryBuilder/queryAutocompleteResponse';
|
||||
import {
|
||||
Having,
|
||||
IBuilderQuery,
|
||||
Query,
|
||||
TagFilter,
|
||||
TagFilterItem,
|
||||
@@ -980,59 +978,6 @@ export const convertAggregationToExpression = ({
|
||||
];
|
||||
};
|
||||
|
||||
function getColId(
|
||||
queryName: string,
|
||||
aggregation: { alias?: string; expression?: string },
|
||||
isMultipleAggregations: boolean,
|
||||
): string {
|
||||
if (isMultipleAggregations && aggregation.expression) {
|
||||
return `${queryName}.${aggregation.expression}`;
|
||||
}
|
||||
|
||||
return queryName;
|
||||
}
|
||||
|
||||
// function to give you label value for query name taking multiaggregation into account
|
||||
export function getQueryLabelWithAggregation(
|
||||
queryData: IBuilderQuery[],
|
||||
): { label: string; value: string }[] {
|
||||
const labels: { label: string; value: string }[] = [];
|
||||
|
||||
const aggregationPerQuery =
|
||||
queryData.reduce(
|
||||
(acc, query) => {
|
||||
if (query.queryName && query.aggregations?.length) {
|
||||
acc[query.queryName] = createAggregation(query).map((a: any) => ({
|
||||
alias: a.alias,
|
||||
expression: a.expression,
|
||||
}));
|
||||
}
|
||||
return acc;
|
||||
},
|
||||
{} as Record<string, any>,
|
||||
) || {};
|
||||
|
||||
Object.entries(aggregationPerQuery).forEach(([queryName, aggregations]) => {
|
||||
const isMultipleAggregations = aggregations.length > 1;
|
||||
|
||||
aggregations.forEach((agg: any, index: number) => {
|
||||
const columnId = getColId(queryName, agg, isMultipleAggregations);
|
||||
|
||||
// For display purposes, show the aggregation index for multiple aggregations
|
||||
const displayLabel = isMultipleAggregations
|
||||
? `${queryName}.${index}`
|
||||
: queryName;
|
||||
|
||||
labels.push({
|
||||
label: displayLabel,
|
||||
value: columnId, // This matches the ID format used in table columns
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
return labels;
|
||||
}
|
||||
|
||||
export const adjustQueryForV5 = (currentQuery: Query): Query => {
|
||||
if (isBuilderQueryType(currentQuery.queryType)) {
|
||||
const activeBuilder = getActiveBuilder(currentQuery);
|
||||
|
||||
@@ -15,12 +15,6 @@
|
||||
height: 48px;
|
||||
}
|
||||
|
||||
.text {
|
||||
text-align: center;
|
||||
font-size: 14px;
|
||||
color: var(--muted-foreground);
|
||||
}
|
||||
|
||||
.subText {
|
||||
color: var(--foreground);
|
||||
}
|
||||
|
||||
@@ -32,17 +32,6 @@
|
||||
gap: var(--spacing-4);
|
||||
}
|
||||
|
||||
.loadingValues {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: var(--spacing-6) 0;
|
||||
}
|
||||
|
||||
.loadingMore {
|
||||
align-self: center;
|
||||
}
|
||||
|
||||
.noData {
|
||||
align-self: center;
|
||||
}
|
||||
@@ -52,38 +41,3 @@
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.showMoreText {
|
||||
color: var(--accent-primary);
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.goToDocs {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 44px;
|
||||
}
|
||||
|
||||
.goToDocsContainer {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: var(--spacing-2);
|
||||
margin-top: var(--spacing-2);
|
||||
}
|
||||
|
||||
.goToDocsMessage {
|
||||
color: var(--l2-foreground);
|
||||
}
|
||||
|
||||
.goToDocsButton {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: var(--spacing-2);
|
||||
cursor: pointer;
|
||||
margin: 0 0 var(--spacing-2);
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.goToDocsButtonText {
|
||||
color: var(--bg-robin-400);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
import { useState } from 'react';
|
||||
import { Tooltip } from '@signozhq/ui/tooltip';
|
||||
import { Typography } from '@signozhq/ui/typography';
|
||||
import { ChevronDown, ChevronRight, Undo2 } from '@signozhq/icons';
|
||||
|
||||
@@ -22,31 +20,6 @@ export function CheckboxFilterV2Header({
|
||||
onToggleOpen,
|
||||
onClear,
|
||||
}: CheckboxFilterHeaderProps): JSX.Element {
|
||||
const [isTitleTruncated, setIsTitleTruncated] = useState(false);
|
||||
|
||||
const measureTitle = (el: HTMLElement | null): void => {
|
||||
if (el) {
|
||||
setIsTitleTruncated(el.scrollWidth > el.clientWidth);
|
||||
}
|
||||
};
|
||||
|
||||
const titleText = (
|
||||
<Typography
|
||||
ref={measureTitle}
|
||||
variant="paragraph"
|
||||
size="base"
|
||||
weight="regular"
|
||||
color="secondary"
|
||||
as="span"
|
||||
display="inline-block"
|
||||
minWidth={0}
|
||||
textOverflow="ellipsis"
|
||||
textTransform="capitalize"
|
||||
>
|
||||
{title}
|
||||
</Typography>
|
||||
);
|
||||
|
||||
return (
|
||||
<section
|
||||
role="button"
|
||||
@@ -67,7 +40,19 @@ export function CheckboxFilterV2Header({
|
||||
) : (
|
||||
<ChevronRight size={13} cursor="pointer" />
|
||||
)}
|
||||
<Tooltip title={isTitleTruncated ? title : undefined}>{titleText}</Tooltip>
|
||||
<Typography
|
||||
variant="paragraph"
|
||||
size="base"
|
||||
weight="regular"
|
||||
color="secondary"
|
||||
as="span"
|
||||
display="inline-block"
|
||||
minWidth={0}
|
||||
textOverflow="ellipsis"
|
||||
textTransform="capitalize"
|
||||
>
|
||||
{title}
|
||||
</Typography>
|
||||
</section>
|
||||
{isOpen && canReset && (
|
||||
<section className={styles.rightAction}>
|
||||
|
||||
@@ -13,15 +13,6 @@
|
||||
background: var(--l1-border);
|
||||
}
|
||||
|
||||
.label {
|
||||
font-size: var(--uppercase-small-600-font-size);
|
||||
font-weight: var(--uppercase-small-600-font-weight);
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.5px;
|
||||
color: var(--l3-foreground);
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.infoIcon {
|
||||
color: var(--l3-foreground);
|
||||
cursor: help;
|
||||
|
||||
@@ -120,43 +120,4 @@ describe('CheckboxFilterV2Header', () => {
|
||||
expect(onToggleOpen).not.toHaveBeenCalled();
|
||||
});
|
||||
});
|
||||
|
||||
describe('title tooltip', () => {
|
||||
// jsdom has no layout, so truncation is simulated at the prototype level
|
||||
// before mount (the component measures in a layout effect).
|
||||
function mockTitleWidths(scrollWidth: number, clientWidth: number): void {
|
||||
jest
|
||||
.spyOn(HTMLElement.prototype, 'scrollWidth', 'get')
|
||||
.mockReturnValue(scrollWidth);
|
||||
jest
|
||||
.spyOn(HTMLElement.prototype, 'clientWidth', 'get')
|
||||
.mockReturnValue(clientWidth);
|
||||
}
|
||||
|
||||
afterEach(() => {
|
||||
jest.restoreAllMocks();
|
||||
});
|
||||
|
||||
it('shows the full name on hover when the title is truncated', async () => {
|
||||
mockTitleWidths(200, 100);
|
||||
const user = userEvent.setup();
|
||||
render(<CheckboxFilterV2Header {...defaultProps} />);
|
||||
|
||||
await user.hover(screen.getByText(defaultProps.title));
|
||||
|
||||
await expect(screen.findByRole('tooltip')).resolves.toHaveTextContent(
|
||||
defaultProps.title,
|
||||
);
|
||||
});
|
||||
|
||||
it('shows no tooltip when the title fits', async () => {
|
||||
mockTitleWidths(100, 100);
|
||||
const user = userEvent.setup();
|
||||
render(<CheckboxFilterV2Header {...defaultProps} />);
|
||||
|
||||
await user.hover(screen.getByText(defaultProps.title));
|
||||
|
||||
expect(screen.queryByRole('tooltip')).not.toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -67,39 +67,6 @@
|
||||
border-color: var(--l1-border);
|
||||
}
|
||||
|
||||
.filter-header {
|
||||
padding: 16px 8px 16px 12px;
|
||||
.filter-title {
|
||||
display: flex;
|
||||
gap: 6px;
|
||||
|
||||
.ant-typography {
|
||||
color: var(--l2-foreground);
|
||||
}
|
||||
}
|
||||
|
||||
.sync-icon {
|
||||
background-color: var(--l1-background);
|
||||
border: 0;
|
||||
box-shadow: none;
|
||||
padding: 8px;
|
||||
}
|
||||
|
||||
.arrow-icon {
|
||||
background-color: var(--l1-background);
|
||||
border: 0;
|
||||
box-shadow: none;
|
||||
padding-top: 8px;
|
||||
|
||||
.anticon-vertical-align-top {
|
||||
svg {
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.section-body-header {
|
||||
display: flex;
|
||||
|
||||
|
||||
@@ -97,12 +97,6 @@
|
||||
flex-shrink: 0;
|
||||
justify-content: flex-end;
|
||||
|
||||
.divider-filter {
|
||||
width: 1px;
|
||||
height: 14px;
|
||||
background: var(--l1-background);
|
||||
}
|
||||
|
||||
> [aria-expanded='true'] {
|
||||
--button-variant-ghost-background-color: var(--l2-background);
|
||||
}
|
||||
|
||||
@@ -1,50 +0,0 @@
|
||||
.announcement-tooltip {
|
||||
&__dot {
|
||||
position: absolute;
|
||||
width: 8px;
|
||||
height: 8px;
|
||||
border-radius: 50%;
|
||||
background-color: var(--primary-background);
|
||||
z-index: 1000;
|
||||
}
|
||||
|
||||
&__title {
|
||||
font-weight: 500;
|
||||
font-size: 15px;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
&__container {
|
||||
position: absolute;
|
||||
width: 320px;
|
||||
background-color: var(--primary-background);
|
||||
color: var(--primary-foreground);
|
||||
border-radius: 8px;
|
||||
padding: 12px;
|
||||
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
|
||||
z-index: 1000;
|
||||
}
|
||||
|
||||
&__header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
&__close-icon {
|
||||
cursor: pointer;
|
||||
color: var(--primary-foreground);
|
||||
}
|
||||
|
||||
&__message {
|
||||
margin: 12px 0;
|
||||
line-height: 20px;
|
||||
}
|
||||
|
||||
&__footer {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
margin-top: 12px;
|
||||
}
|
||||
}
|
||||
@@ -1,84 +0,0 @@
|
||||
import { useState } from 'react';
|
||||
import { Button } from '@signozhq/ui/button';
|
||||
import classNames from 'classnames';
|
||||
import { Check, X } from '@signozhq/icons';
|
||||
|
||||
import './AnnouncementTooltip.styles.scss';
|
||||
|
||||
type AnnouncementTooltipProps = {
|
||||
position: { top: number; left: number };
|
||||
title: string;
|
||||
message: string;
|
||||
show?: boolean;
|
||||
className?: string;
|
||||
onClose?: () => void;
|
||||
};
|
||||
|
||||
// TEMPORARY HACK FOR ANNOUNCEMENTS: To be removed once proper system in place.
|
||||
function AnnouncementTooltip({
|
||||
position,
|
||||
show,
|
||||
title,
|
||||
message,
|
||||
className,
|
||||
onClose,
|
||||
}: AnnouncementTooltipProps): JSX.Element | null {
|
||||
const [visible, setVisible] = useState(show);
|
||||
|
||||
const closeTooltip = (): void => {
|
||||
setVisible(false);
|
||||
onClose?.();
|
||||
};
|
||||
|
||||
return visible ? (
|
||||
<>
|
||||
{/* Dot */}
|
||||
<div
|
||||
className={classNames('announcement-tooltip__dot', className)}
|
||||
style={{
|
||||
top: position.top,
|
||||
left: position.left,
|
||||
}}
|
||||
/>
|
||||
|
||||
{/* Tooltip box */}
|
||||
<div
|
||||
className={classNames('announcement-tooltip__container', className)}
|
||||
style={{
|
||||
top: position.top,
|
||||
left: position.left + 20,
|
||||
}}
|
||||
>
|
||||
<div className="announcement-tooltip__header">
|
||||
<p className="announcement-tooltip__title">{title}</p>
|
||||
|
||||
<X
|
||||
size={18}
|
||||
onClick={closeTooltip}
|
||||
className="announcement-tooltip__close-icon"
|
||||
/>
|
||||
</div>
|
||||
<p className="announcement-tooltip__message">{message}</p>
|
||||
<div className="announcement-tooltip__footer">
|
||||
<Button
|
||||
size="md"
|
||||
variant="solid"
|
||||
color="primary"
|
||||
onClick={closeTooltip}
|
||||
prefix={<Check size={16} />}
|
||||
>
|
||||
Okay
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
</>
|
||||
) : null;
|
||||
}
|
||||
|
||||
AnnouncementTooltip.defaultProps = {
|
||||
show: false,
|
||||
className: '',
|
||||
onClose: (): void => {},
|
||||
};
|
||||
|
||||
export default AnnouncementTooltip;
|
||||
@@ -134,12 +134,6 @@
|
||||
flex-grow: 1;
|
||||
}
|
||||
|
||||
.qf-filter-content {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
&.other-filters-item {
|
||||
padding: 8px 12px;
|
||||
height: 32px;
|
||||
|
||||
@@ -114,6 +114,19 @@ export const loadingFiltersHandlers = [
|
||||
),
|
||||
];
|
||||
|
||||
export const longTitleConfig = [
|
||||
{
|
||||
attributeKey: {
|
||||
dataType: DataTypes.Int64,
|
||||
key: 'http.request.content_length_uncompressed',
|
||||
type: 'tag',
|
||||
},
|
||||
defaultOpen: false,
|
||||
title: 'Http Request Content Length Uncompressed',
|
||||
type: FiltersType.CHECKBOX,
|
||||
},
|
||||
];
|
||||
|
||||
export const LONG_FILTER_VALUES = [
|
||||
'checkout-service.production-eu-central-1.svc.cluster.local',
|
||||
'payments-authorisation-worker.production-us-east-2.svc.cluster.local',
|
||||
|
||||
@@ -8,6 +8,7 @@ import type { GlobalMockArgs } from '@/storybook/globals';
|
||||
import QuickFilters from '../QuickFilters';
|
||||
import {
|
||||
dirtySettings,
|
||||
hoverTruncatedTitle,
|
||||
openQueryPicker,
|
||||
openSettings,
|
||||
} from './__story_mockdata__/quickFilters.play';
|
||||
@@ -18,6 +19,7 @@ import {
|
||||
handlers,
|
||||
LONG_FILTER_VALUES,
|
||||
loadingFiltersHandlers,
|
||||
longTitleConfig,
|
||||
MANY_FILTER_VALUES,
|
||||
queryBuilder,
|
||||
selectedServiceQueryBuilder,
|
||||
@@ -159,6 +161,15 @@ export const Tooltips: GlobalArgsStory = {
|
||||
},
|
||||
};
|
||||
|
||||
/** A section title too long for the rail: hovering it shows the full title once. */
|
||||
export const TruncatedTitle: GlobalArgsStory = {
|
||||
args: { config: longTitleConfig },
|
||||
parameters: {
|
||||
msw: { handlers: [noSavedFiltersHandler, ...handlers] },
|
||||
},
|
||||
play: hoverTruncatedTitle,
|
||||
};
|
||||
|
||||
const [firstQuery] = queryBuilder.currentQuery.builder.queryData;
|
||||
|
||||
/** Interaction: the query picker lists every query the filters can follow. */
|
||||
|
||||
@@ -8,9 +8,12 @@ import { QuickFilterManagePermissions } from 'lib/authz/hooks/useAuthZ/permissio
|
||||
import { expect, screen, userEvent, waitFor, within } from 'storybook/test';
|
||||
|
||||
import { grantsAll } from '@/storybook/access/access';
|
||||
import { hoverTruncatableText } from '@/storybook/play/truncatedText';
|
||||
import type { GlobalMockArgs } from '@/storybook/globals';
|
||||
|
||||
import type QuickFilters from '../../QuickFilters';
|
||||
import { longTitleConfig } from '../QuickFilters.stories.mocks';
|
||||
import { FiltersType } from '../../types';
|
||||
|
||||
interface PlayContext {
|
||||
canvasElement: HTMLElement;
|
||||
@@ -61,6 +64,26 @@ export const dirtySettings = async (context: PlayContext): Promise<void> => {
|
||||
await screen.findByRole('button', { name: 'Save changes' });
|
||||
};
|
||||
|
||||
export const hoverTruncatedTitle = async ({
|
||||
canvasElement,
|
||||
args,
|
||||
}: PlayContext): Promise<void> => {
|
||||
const [filter] = args.config ?? [];
|
||||
// Duration and slider sections render no title of their own.
|
||||
if (filter?.type !== FiltersType.CHECKBOX || !filter.title) {
|
||||
return;
|
||||
}
|
||||
|
||||
const [label] = await within(canvasElement).findAllByText(
|
||||
filter.title,
|
||||
{},
|
||||
UNTIL_LOADED,
|
||||
);
|
||||
await hoverTruncatableText(label, filter.title, {
|
||||
cut: filter.title === longTitleConfig[0].title || undefined,
|
||||
});
|
||||
};
|
||||
|
||||
export const openQueryPicker = async ({
|
||||
canvasElement,
|
||||
}: PlayContext): Promise<void> => {
|
||||
|
||||
@@ -10,6 +10,8 @@ import {
|
||||
import { getHostsQuickFiltersConfig } from 'container/InfraMonitoringHostsV2/utils';
|
||||
import { INFRA_MONITORING_ATTR_KEYS } from 'container/InfraMonitoringK8sV2/constants';
|
||||
import { useQueryBuilder } from 'hooks/queryBuilder/useQueryBuilder';
|
||||
import { useAuthZ } from 'lib/authz/hooks/useAuthZ/useAuthZ';
|
||||
import { mockUseAuthZGrantAll } from 'lib/authz/utils/authz-test-utils';
|
||||
import {
|
||||
otherFiltersResponse,
|
||||
quickFiltersFieldValuesResponse,
|
||||
@@ -17,7 +19,14 @@ import {
|
||||
} from 'mocks-server/__mockdata__/customQuickFilters';
|
||||
import { server } from 'mocks-server/server';
|
||||
import { rest } from 'msw';
|
||||
import { render, screen, userEvent, waitFor, within } from 'tests/test-utils';
|
||||
import {
|
||||
render,
|
||||
screen,
|
||||
userEvent,
|
||||
waitFor,
|
||||
within,
|
||||
NO_DELAY_USER_EVENT,
|
||||
} from 'tests/test-utils';
|
||||
import { TelemetryFieldKey } from 'types/api/v5/queryRange';
|
||||
import { QueryBuilderContextType } from 'types/common/queryBuilder';
|
||||
|
||||
@@ -32,6 +41,7 @@ jest.mock('hooks/queryBuilder/useQueryBuilder', () => ({
|
||||
useQueryBuilder: jest.fn(),
|
||||
}));
|
||||
jest.mock('container/ApiMonitoring/queryParams');
|
||||
jest.mock('lib/authz/hooks/useAuthZ/useAuthZ');
|
||||
jest.mock(
|
||||
'components/OverlayScrollbar/OverlayScrollbar',
|
||||
() =>
|
||||
@@ -55,6 +65,7 @@ const mockSetApiMonitoringParams = jest.fn() as jest.MockedFunction<
|
||||
(newParams: Partial<ApiMonitoringParams>, replace?: boolean) => void
|
||||
>;
|
||||
const mockUseApiMonitoringParams = jest.mocked(useApiMonitoringParams);
|
||||
const mockedUseAuthZ = jest.mocked(useAuthZ);
|
||||
|
||||
const BASE_URL = ENVIRONMENT.baseURL;
|
||||
const quickFiltersListURL = `${BASE_URL}/api/v2/quick_filters/logs`;
|
||||
@@ -78,11 +89,12 @@ const QUERY_NAME = 'Test Query';
|
||||
|
||||
const savedFilters = quickFiltersListResponse.data
|
||||
.filters as TelemetryFieldKey[];
|
||||
const smallSavedFilters = savedFilters.slice(0, 2);
|
||||
const smallFiltersListResponse = {
|
||||
...quickFiltersListResponse,
|
||||
data: {
|
||||
...quickFiltersListResponse.data,
|
||||
filters: savedFilters.slice(0, 2),
|
||||
filters: smallSavedFilters,
|
||||
},
|
||||
};
|
||||
|
||||
@@ -134,7 +146,7 @@ function renderSettings(): void {
|
||||
<QuickFiltersSettings
|
||||
savedFiltersSource={QuickfiltertypesSourceDTO.logs}
|
||||
setIsSettingsOpen={jest.fn()}
|
||||
customFilters={savedFilters}
|
||||
customFilters={smallSavedFilters}
|
||||
refetchCustomFilters={jest.fn()}
|
||||
/>,
|
||||
);
|
||||
@@ -180,12 +192,13 @@ beforeEach(() => {
|
||||
{ showIP: true } as ApiMonitoringParams,
|
||||
mockSetApiMonitoringParams,
|
||||
]);
|
||||
mockedUseAuthZ.mockImplementation(mockUseAuthZGrantAll);
|
||||
setupServer();
|
||||
});
|
||||
|
||||
describe('Quick Filters', () => {
|
||||
it('displays the correct query name in the header', () => {
|
||||
render(<TestQuickFilters />);
|
||||
render(<TestQuickFilters config={[]} />);
|
||||
expect(screen.getByText('Filters for')).toBeInTheDocument();
|
||||
expect(screen.getByText(QUERY_NAME)).toBeInTheDocument();
|
||||
});
|
||||
@@ -194,7 +207,7 @@ describe('Quick Filters', () => {
|
||||
const setLastUsedQuery = jest.fn() as jest.MockedFunction<
|
||||
QueryBuilderContextType['setLastUsedQuery']
|
||||
>;
|
||||
const user = userEvent.setup();
|
||||
const user = userEvent.setup(NO_DELAY_USER_EVENT);
|
||||
|
||||
(useQueryBuilder as jest.Mock).mockReturnValue({
|
||||
currentQuery: {
|
||||
@@ -221,7 +234,7 @@ describe('Quick Filters', () => {
|
||||
panelType: 'graph', // not LIST view
|
||||
});
|
||||
|
||||
render(<TestQuickFilters />);
|
||||
render(<TestQuickFilters config={[]} />);
|
||||
|
||||
// The dropdown trigger should show the first query name
|
||||
const trigger = screen.getByTestId('quick-filters-query-select');
|
||||
@@ -243,12 +256,10 @@ describe('Quick Filters', () => {
|
||||
|
||||
// jsdom cannot deliver the pointer click Base UI expects on an option,
|
||||
// so pick Query B with the arrow keys and Enter
|
||||
await waitFor(() =>
|
||||
expect(
|
||||
screen.getByTestId('quick-filters-query-select-search'),
|
||||
).toHaveFocus(),
|
||||
await user.type(
|
||||
screen.getByTestId('quick-filters-query-select-search'),
|
||||
'{ArrowDown}{Enter}',
|
||||
);
|
||||
await user.keyboard('{ArrowDown}{Enter}');
|
||||
|
||||
// Verify setLastUsedQuery was called with index 1
|
||||
expect(setLastUsedQuery).toHaveBeenCalledWith(1);
|
||||
@@ -275,7 +286,7 @@ describe('Quick Filters', () => {
|
||||
panelType: 'list', // ListView
|
||||
});
|
||||
|
||||
render(<TestQuickFilters />);
|
||||
render(<TestQuickFilters config={[]} />);
|
||||
|
||||
// Should show static query name without dropdown
|
||||
expect(screen.getByText('Query A')).toBeInTheDocument();
|
||||
@@ -286,7 +297,7 @@ describe('Quick Filters', () => {
|
||||
});
|
||||
|
||||
it('should display static query name when only one query exists', () => {
|
||||
render(<TestQuickFilters />);
|
||||
render(<TestQuickFilters config={[]} />);
|
||||
|
||||
// Should show static query name
|
||||
expect(screen.getByText(QUERY_NAME)).toBeInTheDocument();
|
||||
@@ -298,7 +309,7 @@ describe('Quick Filters', () => {
|
||||
});
|
||||
|
||||
it('should add filter data to query when checkbox is clicked', async () => {
|
||||
const user = userEvent.setup();
|
||||
const user = userEvent.setup(NO_DELAY_USER_EVENT);
|
||||
|
||||
render(<TestQuickFilters />);
|
||||
|
||||
@@ -330,7 +341,7 @@ describe('Quick Filters', () => {
|
||||
});
|
||||
});
|
||||
it('toggles Show IP addresses and updates API Monitoring params', async () => {
|
||||
const user = userEvent.setup();
|
||||
const user = userEvent.setup(NO_DELAY_USER_EVENT);
|
||||
|
||||
render(
|
||||
<TestQuickFilters quickFilterSource={QuickFiltersSource.API_MONITORING} />,
|
||||
@@ -364,7 +375,7 @@ describe('Quick Filters with custom filters', () => {
|
||||
});
|
||||
|
||||
it('opens the settings with the saved filters added and the rest under other filters', async () => {
|
||||
const user = userEvent.setup();
|
||||
const user = userEvent.setup(NO_DELAY_USER_EVENT);
|
||||
server.use(
|
||||
rest.get(quickFiltersListURL, (_, res, ctx) =>
|
||||
res(ctx.status(200), ctx.json(smallFiltersListResponse)),
|
||||
@@ -386,7 +397,7 @@ describe('Quick Filters with custom filters', () => {
|
||||
});
|
||||
|
||||
it('keeps same-name fields with different context as distinct entries', async () => {
|
||||
const user = userEvent.setup();
|
||||
const user = userEvent.setup(NO_DELAY_USER_EVENT);
|
||||
server.use(
|
||||
rest.get(quickFiltersSuggestionsURL, (_req, res, ctx) =>
|
||||
res(
|
||||
@@ -438,7 +449,7 @@ describe('Quick Filters with custom filters', () => {
|
||||
});
|
||||
|
||||
it('adds a filter from OTHER FILTERS to ADDED FILTERS when clicked', async () => {
|
||||
const user = userEvent.setup();
|
||||
const user = userEvent.setup(NO_DELAY_USER_EVENT);
|
||||
|
||||
renderSettings();
|
||||
|
||||
@@ -450,7 +461,7 @@ describe('Quick Filters with custom filters', () => {
|
||||
});
|
||||
|
||||
it('removes a filter from ADDED FILTERS and moves it to OTHER FILTERS', async () => {
|
||||
const user = userEvent.setup();
|
||||
const user = userEvent.setup(NO_DELAY_USER_EVENT);
|
||||
|
||||
renderSettings();
|
||||
const addedSection = screen.getByTestId(ADDED_FILTERS_TEST_ID);
|
||||
@@ -468,7 +479,7 @@ describe('Quick Filters with custom filters', () => {
|
||||
});
|
||||
|
||||
it('restores original filter state on Discard', async () => {
|
||||
const user = userEvent.setup();
|
||||
const user = userEvent.setup(NO_DELAY_USER_EVENT);
|
||||
|
||||
renderSettings();
|
||||
const addedSection = screen.getByTestId(ADDED_FILTERS_TEST_ID);
|
||||
@@ -491,7 +502,7 @@ describe('Quick Filters with custom filters', () => {
|
||||
});
|
||||
|
||||
it('saves the updated filters by calling PUT with correct payload', async () => {
|
||||
const user = userEvent.setup();
|
||||
const user = userEvent.setup(NO_DELAY_USER_EVENT);
|
||||
|
||||
renderSettings();
|
||||
|
||||
@@ -506,7 +517,7 @@ describe('Quick Filters with custom filters', () => {
|
||||
expect(requestBody.filters).not.toContainEqual(
|
||||
expect.objectContaining({ name: FILTER_OS_DESCRIPTION }),
|
||||
);
|
||||
expect(requestBody.filters).toHaveLength(10);
|
||||
expect(requestBody.filters).toHaveLength(smallSavedFilters.length - 1);
|
||||
});
|
||||
|
||||
it('should render duration slider for duration_nono filter', async () => {
|
||||
@@ -548,10 +559,10 @@ describe('Quick Filters with custom filters', () => {
|
||||
expect(maxDuration).toHaveProperty('placeholder', '100000000');
|
||||
|
||||
// Type values and advance debounce
|
||||
await user.clear(minDuration);
|
||||
await user.type(minDuration, '10000');
|
||||
await user.clear(maxDuration);
|
||||
await user.type(maxDuration, '20000');
|
||||
await user.click(minDuration);
|
||||
await user.paste('10000');
|
||||
await user.click(maxDuration);
|
||||
await user.paste('20000');
|
||||
jest.advanceTimersByTime(2000);
|
||||
|
||||
await waitFor(() => {
|
||||
@@ -650,7 +661,7 @@ describe('Quick Filters refetch behavior', () => {
|
||||
}),
|
||||
);
|
||||
|
||||
const user = userEvent.setup();
|
||||
const user = userEvent.setup(NO_DELAY_USER_EVENT);
|
||||
render(
|
||||
<TestQuickFilters quickFilterSource={QuickFiltersSource.LOGS_EXPLORER} />,
|
||||
);
|
||||
@@ -692,7 +703,7 @@ describe('Quick Filters refetch behavior', () => {
|
||||
),
|
||||
);
|
||||
|
||||
const user = userEvent.setup();
|
||||
const user = userEvent.setup(NO_DELAY_USER_EVENT);
|
||||
render(
|
||||
<TestQuickFilters quickFilterSource={QuickFiltersSource.LOGS_EXPLORER} />,
|
||||
);
|
||||
|
||||
@@ -9,16 +9,6 @@ export enum FiltersType {
|
||||
DURATION = 'DURATION', // ALIAS FOR DURATION_NANO
|
||||
}
|
||||
|
||||
export enum MinMax {
|
||||
MIN = 'MIN',
|
||||
MAX = 'MAX',
|
||||
}
|
||||
|
||||
export enum SpecficFilterOperations {
|
||||
ALL = 'ALL',
|
||||
ONLY = 'ONLY',
|
||||
}
|
||||
|
||||
/**
|
||||
* Missing export from signozhq/ui/checkbox, TODO(H4ad): Add and remove this type definition
|
||||
*/
|
||||
|
||||
@@ -1,31 +0,0 @@
|
||||
.DynamicColumnTable {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
width: 100%;
|
||||
|
||||
.dynamicColumnTable-button {
|
||||
align-self: flex-end;
|
||||
margin: 10px 0;
|
||||
|
||||
&.filter-btn {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.dynamicColumnsTable-items {
|
||||
display: flex;
|
||||
width: 10.625rem;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
.dynamicColumnsTable-items {
|
||||
flex-direction: column;
|
||||
width: auto;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
@@ -1,160 +0,0 @@
|
||||
import { memo, useEffect, useState } from 'react';
|
||||
import type {
|
||||
TableColumnGroupType as ColumnGroupType,
|
||||
TableColumnsType as ColumnsType,
|
||||
TableColumnType as ColumnType,
|
||||
} from 'antd';
|
||||
import { Button } from 'antd';
|
||||
import Flex from 'periscope/components/Flex/Flex';
|
||||
import { Dropdown, type DropdownItemType } from '@signozhq/ui/dropdown';
|
||||
import { Switch } from '@signozhq/ui/switch';
|
||||
import logEvent from 'api/common/logEvent';
|
||||
import LaunchChatSupport from 'components/LaunchChatSupport/LaunchChatSupport';
|
||||
import { useSafeNavigate } from 'hooks/useSafeNavigate';
|
||||
import useUrlQuery from 'hooks/useUrlQuery';
|
||||
import { SlidersHorizontal } from '@signozhq/icons';
|
||||
|
||||
import ResizeTable from './ResizeTable';
|
||||
import { DynamicColumnTableProps } from './types';
|
||||
import {
|
||||
getNewColumnData,
|
||||
getVisibleColumns,
|
||||
setVisibleColumns,
|
||||
} from './utils';
|
||||
|
||||
import './DynamicColumnTable.syles.scss';
|
||||
|
||||
function DynamicColumnTable({
|
||||
tablesource,
|
||||
columns,
|
||||
dynamicColumns,
|
||||
onDragColumn,
|
||||
facingIssueBtn,
|
||||
shouldSendAlertsLogEvent,
|
||||
pagination,
|
||||
...restProps
|
||||
}: DynamicColumnTableProps): JSX.Element {
|
||||
const { safeNavigate } = useSafeNavigate();
|
||||
const urlQuery = useUrlQuery();
|
||||
|
||||
const [columnsData, setColumnsData] = useState<ColumnsType | undefined>(
|
||||
columns,
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
setColumnsData(columns);
|
||||
const visibleColumns = getVisibleColumns({
|
||||
tablesource,
|
||||
columnsData: columns,
|
||||
dynamicColumns,
|
||||
});
|
||||
setColumnsData((prevColumns) =>
|
||||
prevColumns
|
||||
? [
|
||||
...prevColumns.slice(0, prevColumns.length - 1),
|
||||
...visibleColumns,
|
||||
prevColumns[prevColumns.length - 1],
|
||||
]
|
||||
: undefined,
|
||||
);
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [columns, dynamicColumns]);
|
||||
|
||||
const onToggleHandler =
|
||||
(index: number, column: ColumnGroupType<any> | ColumnType<any>) =>
|
||||
(checked: boolean): void => {
|
||||
if (shouldSendAlertsLogEvent) {
|
||||
logEvent('Alert: Column toggled', {
|
||||
column: column?.title,
|
||||
action: checked ? 'Enable' : 'Disable',
|
||||
});
|
||||
}
|
||||
setVisibleColumns({
|
||||
tablesource,
|
||||
dynamicColumns,
|
||||
index,
|
||||
checked,
|
||||
});
|
||||
setColumnsData((prevColumns) =>
|
||||
getNewColumnData({
|
||||
checked,
|
||||
index,
|
||||
prevColumns,
|
||||
dynamicColumns,
|
||||
}),
|
||||
);
|
||||
};
|
||||
|
||||
const items: DropdownItemType[] =
|
||||
dynamicColumns?.map((column, index) => ({
|
||||
type: 'item',
|
||||
value: String(index),
|
||||
label: (
|
||||
<div
|
||||
className="dynamicColumnsTable-items"
|
||||
onClick={(e): void => e.stopPropagation()}
|
||||
role="presentation"
|
||||
>
|
||||
<div>{column.title?.toString()}</div>
|
||||
<Switch
|
||||
color="primary"
|
||||
textPlacement="right"
|
||||
value={columnsData?.findIndex((c) => c.key === column.key) !== -1}
|
||||
onChange={onToggleHandler(index, column)}
|
||||
/>
|
||||
</div>
|
||||
),
|
||||
})) || [];
|
||||
|
||||
// Get current page from URL or default to 1
|
||||
const currentPage = Number(urlQuery.get('page')) || 1;
|
||||
|
||||
const handlePaginationChange = (page: number, pageSize?: number): void => {
|
||||
// Update URL with new page number while preserving other params
|
||||
urlQuery.set('page', page.toString());
|
||||
|
||||
safeNavigate({ search: `?${urlQuery.toString()}` });
|
||||
|
||||
// Call original pagination handler if provided
|
||||
if (pagination?.onChange && !!pageSize) {
|
||||
pagination.onChange(page, pageSize);
|
||||
}
|
||||
};
|
||||
|
||||
const enhancedPagination = {
|
||||
...pagination,
|
||||
current: currentPage, // Ensure the pagination component shows the correct page
|
||||
onChange: handlePaginationChange,
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="DynamicColumnTable">
|
||||
<Flex justify="flex-end" align="center" gap={8}>
|
||||
{facingIssueBtn && <LaunchChatSupport {...facingIssueBtn} />}
|
||||
{dynamicColumns && (
|
||||
<Dropdown items={items} nativeButton align="end" side="bottom">
|
||||
<Button
|
||||
className="dynamicColumnTable-button filter-btn"
|
||||
size="middle"
|
||||
icon={<SlidersHorizontal size={14} />}
|
||||
data-testid="additional-filters-button"
|
||||
/>
|
||||
</Dropdown>
|
||||
)}
|
||||
</Flex>
|
||||
|
||||
<ResizeTable
|
||||
columns={columnsData}
|
||||
onDragColumn={onDragColumn}
|
||||
pagination={enhancedPagination}
|
||||
{...restProps}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
DynamicColumnTable.defaultProps = {
|
||||
onDragColumn: undefined,
|
||||
};
|
||||
|
||||
export default memo(DynamicColumnTable);
|
||||
@@ -12,20 +12,6 @@
|
||||
}
|
||||
}
|
||||
|
||||
.resize-main-table {
|
||||
.ant-table-body {
|
||||
.ant-table-tbody {
|
||||
.ant-table-row {
|
||||
.ant-table-cell {
|
||||
.ant-typography {
|
||||
white-space: unset;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.logs-table,
|
||||
.traces-table {
|
||||
.resize-table {
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
import { Typography } from '@signozhq/ui/typography';
|
||||
|
||||
import Time from './Time';
|
||||
|
||||
function DateComponent(
|
||||
CreatedOrUpdateTime: string | number | Date,
|
||||
): JSX.Element {
|
||||
if (CreatedOrUpdateTime === null) {
|
||||
return (
|
||||
<Typography
|
||||
variant="paragraph"
|
||||
size="base"
|
||||
weight="regular"
|
||||
color="inherit"
|
||||
as="span"
|
||||
textOverflow="wrap"
|
||||
>
|
||||
{' '}
|
||||
-{' '}
|
||||
</Typography>
|
||||
);
|
||||
}
|
||||
|
||||
return <Time CreatedOrUpdateTime={CreatedOrUpdateTime} />;
|
||||
}
|
||||
|
||||
export default DateComponent;
|
||||
@@ -1,30 +0,0 @@
|
||||
import { Typography } from '@signozhq/ui/typography';
|
||||
import { DATE_TIME_FORMATS } from 'constants/dateTimeFormats';
|
||||
import { useTimezone } from 'providers/Timezone';
|
||||
|
||||
function Time({ CreatedOrUpdateTime }: DateProps): JSX.Element {
|
||||
const { formatTimezoneAdjustedTimestamp } = useTimezone();
|
||||
const time = new Date(CreatedOrUpdateTime);
|
||||
const timeString = formatTimezoneAdjustedTimestamp(
|
||||
time,
|
||||
DATE_TIME_FORMATS.UTC_US,
|
||||
);
|
||||
return (
|
||||
<Typography
|
||||
variant="paragraph"
|
||||
size="base"
|
||||
weight="regular"
|
||||
color="inherit"
|
||||
as="span"
|
||||
textOverflow="wrap"
|
||||
>
|
||||
{timeString}
|
||||
</Typography>
|
||||
);
|
||||
}
|
||||
|
||||
type DateProps = {
|
||||
CreatedOrUpdateTime: string | number | Date;
|
||||
};
|
||||
|
||||
export default Time;
|
||||
@@ -1,11 +0,0 @@
|
||||
export const TableDataSource = {
|
||||
Alert: 'alert',
|
||||
Dashboard: 'dashboard',
|
||||
} as const;
|
||||
|
||||
export const DynamicColumnsKey = {
|
||||
CreatedAt: 'createdAt',
|
||||
CreatedBy: 'createdBy',
|
||||
UpdatedAt: 'updatedAt',
|
||||
UpdatedBy: 'updatedBy',
|
||||
};
|
||||
@@ -1,10 +1,4 @@
|
||||
import { TableProps } from 'antd';
|
||||
import type { ColumnsType } from 'antd/es/table';
|
||||
import type { PaginationProps } from 'antd/lib';
|
||||
import type { ColumnGroupType, ColumnType } from 'antd/lib/table';
|
||||
import { LaunchChatSupportProps } from 'components/LaunchChatSupport/LaunchChatSupport';
|
||||
|
||||
import { TableDataSource } from './contants';
|
||||
|
||||
type ColumnWidths = Record<string, number>;
|
||||
|
||||
@@ -26,39 +20,3 @@ export interface ResizeTableProps extends TableProps<any> {
|
||||
*/
|
||||
onColumnWidthsChange?: (widths: ColumnWidths) => void;
|
||||
}
|
||||
export interface DynamicColumnTableProps extends TableProps<any> {
|
||||
tablesource: (typeof TableDataSource)[keyof typeof TableDataSource];
|
||||
dynamicColumns: TableProps<any>['columns'];
|
||||
onDragColumn?: (fromIndex: number, toIndex: number) => void;
|
||||
facingIssueBtn?: LaunchChatSupportProps;
|
||||
shouldSendAlertsLogEvent?: boolean;
|
||||
pagination?: PaginationProps;
|
||||
}
|
||||
|
||||
export type GetVisibleColumnsFunction = (
|
||||
props: GetVisibleColumnProps,
|
||||
) => (ColumnGroupType<any> | ColumnType<any>)[];
|
||||
|
||||
export type GetVisibleColumnProps = {
|
||||
tablesource: (typeof TableDataSource)[keyof typeof TableDataSource];
|
||||
dynamicColumns?: ColumnsType<any>;
|
||||
columnsData?: ColumnsType;
|
||||
};
|
||||
|
||||
export type SetVisibleColumnsProps = {
|
||||
checked: boolean;
|
||||
index: number;
|
||||
tablesource: (typeof TableDataSource)[keyof typeof TableDataSource];
|
||||
dynamicColumns?: ColumnsType<any>;
|
||||
};
|
||||
|
||||
type GetNewColumnDataProps = {
|
||||
prevColumns?: ColumnsType;
|
||||
checked: boolean;
|
||||
dynamicColumns?: ColumnsType<any>;
|
||||
index: number;
|
||||
};
|
||||
|
||||
export type GetNewColumnDataFunction = (
|
||||
props: GetNewColumnDataProps,
|
||||
) => ColumnsType | undefined;
|
||||
|
||||
@@ -1,80 +0,0 @@
|
||||
import getLocalStorageKey from 'api/browser/localstorage/get';
|
||||
import setLocalStorageKey from 'api/browser/localstorage/set';
|
||||
|
||||
import { DynamicColumnsKey } from './contants';
|
||||
import {
|
||||
GetNewColumnDataFunction,
|
||||
GetVisibleColumnsFunction,
|
||||
SetVisibleColumnsProps,
|
||||
} from './types';
|
||||
|
||||
export const getVisibleColumns: GetVisibleColumnsFunction = ({
|
||||
tablesource,
|
||||
dynamicColumns,
|
||||
columnsData,
|
||||
}) => {
|
||||
let columnVisibilityData: { [key: string]: boolean };
|
||||
try {
|
||||
const storedData = getLocalStorageKey(tablesource);
|
||||
if (typeof storedData === 'string' && dynamicColumns) {
|
||||
columnVisibilityData = JSON.parse(storedData);
|
||||
return dynamicColumns.filter((column) => {
|
||||
if (column.key && !columnsData?.find((c) => c.key === column.key)) {
|
||||
return columnVisibilityData[column.key];
|
||||
}
|
||||
return false;
|
||||
});
|
||||
}
|
||||
|
||||
const initialColumnVisibility: Record<string, boolean> = {};
|
||||
Object.values(DynamicColumnsKey).forEach((key) => {
|
||||
initialColumnVisibility[key] = false;
|
||||
});
|
||||
|
||||
setLocalStorageKey(tablesource, JSON.stringify(initialColumnVisibility));
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
}
|
||||
return [];
|
||||
};
|
||||
|
||||
export const setVisibleColumns = ({
|
||||
checked,
|
||||
index,
|
||||
tablesource,
|
||||
dynamicColumns,
|
||||
}: SetVisibleColumnsProps): void => {
|
||||
try {
|
||||
const storedData = getLocalStorageKey(tablesource);
|
||||
if (typeof storedData === 'string' && dynamicColumns) {
|
||||
const columnVisibilityData = JSON.parse(storedData);
|
||||
const { key } = dynamicColumns[index];
|
||||
if (key) {
|
||||
columnVisibilityData[key] = checked;
|
||||
}
|
||||
setLocalStorageKey(tablesource, JSON.stringify(columnVisibilityData));
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
}
|
||||
};
|
||||
|
||||
export const getNewColumnData: GetNewColumnDataFunction = ({
|
||||
prevColumns,
|
||||
checked,
|
||||
dynamicColumns,
|
||||
index,
|
||||
}) => {
|
||||
if (checked && dynamicColumns) {
|
||||
return prevColumns
|
||||
? [
|
||||
...prevColumns.slice(0, prevColumns.length - 1),
|
||||
dynamicColumns[index],
|
||||
prevColumns[prevColumns.length - 1],
|
||||
]
|
||||
: undefined;
|
||||
}
|
||||
return prevColumns && dynamicColumns
|
||||
? prevColumns.filter((column) => dynamicColumns[index].title !== column.title)
|
||||
: undefined;
|
||||
};
|
||||