Compare commits

...

29 Commits

Author SHA1 Message Date
Manika Malhotra
66464f84f2 Merge branch 'main' into chore/cleanup-unused-code 2026-11-24 22:42:25 +05:30
Manika Malhotra
94709aa1d7 chore(frontend): remove dead global styles 2026-11-24 22:38:59 +05:30
Manika Malhotra
7f63f9ac37 chore(frontend): remove unused CSS module classes 2026-11-24 22:38:51 +05:30
Manika Malhotra
7b149ee98d refactor(frontend): remove unused exports 2026-11-24 22:38:35 +05:30
Manika Malhotra
a8a105ad41 test(frontend): remove mocks of modules the tests no longer load 2026-11-24 22:38:16 +05:30
Manika Malhotra
2056a7ec93 chore(frontend): give knip the entry points it cannot infer 2026-11-24 22:38:14 +05:30
Manika Malhotra
5a64826123 build(frontend): remove dead jest, vite and TypeScript config 2026-11-24 22:37:57 +05:30
Manika Malhotra
f5121fd0b6 chore(frontend): remove Radix leftovers and stale @signozhq/ui hints 2026-11-24 22:37:43 +05:30
Manika Malhotra
0338e22054 chore(frontend): remove unused images 2026-11-24 22:37:41 +05:30
Manika Malhotra
5bd30836b2 chore(query-builder): remove the unreachable v3 autocomplete client 2026-11-24 22:37:31 +05:30
Manika Malhotra
8fff975812 chore(dashboard): remove the unused first-section migration flow 2026-11-24 22:19:51 +05:30
Manika Malhotra
4cd0d972bb chore(frontend): remove components only their own tests and stories use 2026-11-24 22:19:44 +05:30
Manika Malhotra
7b6bf286b0 chore(frontend): remove unused files 2026-11-24 22:19:42 +05:30
Ashwin Bhatkal
09d905edc4 test(frontend): rewrite slow and flaky jest tests to the test rules (#13646)
Some checks are pending
build-staging / prepare (push) Waiting to run
build-staging / js-build (push) Blocked by required conditions
build-staging / go-build (push) Blocked by required conditions
build-staging / staging (push) Blocked by required conditions
cacheci / tests (push) Waiting to run
Release Drafter / update_release_draft (push) Waiting to run
#### Description

Stacked on [#13645](https://github.com/SigNoz/signoz/pull/13645).

- 57 slow or flaky test files are rewritten to the test rules.
- These files find elements through Testing Library only (`screen`,
`within`), never `querySelector`, `closest` or `container`. Source files
gain the test IDs this needs, and the onboarding sliders and two selects
gain the accessible names they were missing.
- Locally the full suite went from 271 s to about 160 s, and tests over
1 s went from 75 to 5.

#### Issues closed by this PR

Closes https://github.com/SigNoz/pulse-pod/issues/768
2026-11-24 15:27:58 +00:00
Ashwin Bhatkal
d473d022b0 test(frontend): speed up the jest setup and add test rules that keep tests fast (#13645)
#### Description

- The test setup turns off three DOM walks that jsdom does slowly:
user-event's pointer-events check, Floating UI positioning, and antd's
scroll-container lookup.
- The test rule adds a 500 ms budget per test and bans `*ByRole` inside
`waitFor` and raised timeouts. The agent guide runs checks only at the
gate, and `no checks` skips them while iterating.
- Local jest runs use at most 4 workers and restart any worker that
grows past 1 GB. CI keeps its default worker count.

#### Issues closed by this PR

Closes https://github.com/SigNoz/pulse-pod/issues/767

#### Additional Information

These rules depart from Testing Library's defaults on purpose. Each one
gives up a check for speed:

- Tests find elements by test ID instead of by role. Testing Library
ranks `getByTestId` last, but `getByRole` walks the accessibility tree
on every call. That makes it the slowest query on large pages. A test no
longer fails when a control has no accessible name.
- Tests render the component that owns the behaviour instead of the
whole page, and click-through flows move to e2e. A bug in the wiring
between components needs a page-level test or e2e to catch it.
- user-event's pointer-events check is off in every test.
`jest.setup.ts` swaps the package for a wrapper, so a direct import of
`@testing-library/user-event` gets it too. A click on a button hidden
under an overlay now passes.
- `@floating-ui/dom` returns position 0,0 without measuring. jsdom has
no layout, so the real numbers were meaningless anyway.
- antd's scroll-container lookup is mocked through an internal path,
`@rc-component/trigger/lib/util`. If antd renames the function, the
speedup stops without an error. The mock goes when antd does.
2026-11-24 13:58:48 +00:00
Tushar Vats
1664c29cf4 fix(fields): resolve field value names like the query builder (#13423)
#### Description

Fixes how `/api/v1/fields/values` finds the key for `name`.

##### How `name` is read now

| Request | Keys looked up, in order |
|---|---|
| `name=log.level` | `log.level` in any context, then the log field
`level` |
| `name=resource.service.name` | `resource.service.name` in any context,
then the resource `service.name` |
| `name=attribute.resource.service.name` |
`attribute.resource.service.name` in any context, then the attribute
`resource.service.name` (only the first prefix is a context) |
| `name=attribute.key&fieldContext=attribute` | attribute
`attribute.key` only (context given, name used as is) |
| `name=service.name:string` | `service.name` with type `string` |
| `name=user.id:string&fieldDataType=string` | `user.id:string` (type
given, suffix stays in the name) |

When a name has two readings, values of the prefixed name come first and
win the limit.

##### Other fixes

- `searchText` is no longer read as a key. A search like `log.x` used to
change the context.
- Metric attributes are now found with `fieldContext=attribute`. They
are stored as `point`, not `tag`.
- A data type no longer hides metric attribute values. The filter
compared `string` with the stored `String`; metric attributes are all
strings, so it is dropped, as the keys lookup already does.
- Related values (`existingQuery`) skip rows that don't have the key.
Those rows used to come back as empty strings and fill the limit.
- Number search now works for `int64` and `float64` keys too.

#### Tests

- Unit tests in `field_test.go` and `metadata_query_test.go`.
- New integration tests in `quickfilter/` (`02`, `03`, `04`). They also
check that unknown keys return nothing, and that values cover every key
a name can mean.
- Field keys and values tests moved into `quickfilter/` from
`queriercommon` and `queriermetrics`.
#### Additional Information

Values cover every key a name can mean, so some can match nothing in a
filter on the same name. The filter reads one key; this is accepted:

- A name stored as both resource and attribute (`service.name`): the
filter reads the resource key and warns.
- `resource.x` and `attribute.x`: the filter never reads a key stored
under the prefixed name, and does not warn when the stripped key also
exists.

🤖 Generated with [Claude Code](https://claude.com/claude-code)
2026-11-24 12:04:27 +00:00
ashu8912
f4bc90da34 feat(alerts): add Enabled and Recently viewed rule views (#13626)
This PR also adds sort by status and run queries on blur

#### Description

- Renames the State dropdown to **Status** and moves it first in the
filters row, ahead of Created by and Updated. Filtering by status from
the DSL is on hold (SigNoz/pulse-pod#750).
- Adds two rail views: **Enabled** (every state except disabled) and
**Recently viewed** (rules opened from the list, in visit order, kept in
the browser like dashboards' Recently viewed).
- Sorts the alert rules table by status by default, firing first
(`sort=state&order=desc`). Saved views keep their own sort.
- Leaving the query box with an unrun draft (e.g. terms picked from
suggestions) now runs it. The fix is in the shared `SearchBar`, so it
applies to dashboards too. A blur from switching tabs or windows doesn't
run it.

#### Issues closed by this PR

Closes SigNoz/pulse-pod#749

#### Screenshots / Screen Recordings

[Visual diff](https://claude.ai/artifact/RhoUKk7x88kGQFBfsRkaxs):
`Pages/Alerts/Rules` and `Pages/Dashboards/List/Default`, merge-base vs
branch, dark and light. Taken before the Status filter was restored;
`StateFilterOpen` was since restored. Every rules story moves with the
rail and the firing-first sort. The dashboards list differs only by a
timestamp second (noise).

#### Additional Information

- Recently viewed fetches one 200-row page (the API max) and filters it
in the browser, since the API has no id filter.
- The default sort shows no arrow in the table header, as before.
- Stories: `EnabledView` and `RecentlyViewed` added. The story mock now
sorts by status like the backend.
2026-11-24 09:39:36 +00:00
Abhi kumar
02de020642 fix(dashboard): stop clipping query builder autocomplete in panel view modal (#13733)
Some checks failed
build-staging / prepare (push) Has been cancelled
build-staging / js-build (push) Has been cancelled
build-staging / go-build (push) Has been cancelled
build-staging / staging (push) Has been cancelled
cacheci / tests (push) Has been cancelled
Release Drafter / update_release_draft (push) Has been cancelled
#### Description

- In the panel View modal, the where-clause and aggregation autocomplete
was clipped at the query builder's edge and looked hidden behind the
chart.
- Two `overflow: auto` wrappers clipped it: the modal's `.queryBuilder`
and the shared editor pane's container. The modal already scrolls, so
both now let the dropdown overflow.
- The full-page editor keeps its own scroll area; the override applies
only when `stickyHeader` is off (View modal only).

Before:

<img width="2056" height="1329" alt="image"
src="https://github.com/user-attachments/assets/88477a6a-edcf-4c1b-b624-d0759bfe50e1"
/>

After: 

<img width="2056" height="1329" alt="image"
src="https://github.com/user-attachments/assets/7e8f028d-2e88-4881-8c2e-f670947087e8"
/>

#### Issues closed by this PR

Closes SigNoz/pulse-pod#773
2026-11-24 08:28:24 +00:00
ashu8912
570e622a46 fix(alerts): keep the list query bar visible when there is nothing to list (#13622)
#### Description

- The alert rules and dashboards lists hid their header (title, count,
DSL query bar, filters) when the workspace was empty, so the query
runner only appeared once there was data or a query.
- Both lists now render the header through a shared `ListHeaderZone`
(`components/ListViews`), always, with the empty state below it. The two
pages' duplicate header styles are gone.
- The alert empty state drops its own "Alert Rules" heading, which would
repeat the header's.

#### Issues closed by this PR

Closes SigNoz/pulse-pod#746

#### Screenshots / Screen Recordings

[Visual diff](https://claude.ai/artifact/EkmPBu3SGz61yB5hwww82W):
`Pages/Alerts/Rules/No Rules` and `Pages/Dashboards/List/Empty
Workspace`, merge-base vs branch, dark and light: 4 changed.

#### Additional Information

- Both stories already cover the empty state; no story edit needed.
- Touches `AlertsEmptyState.module.scss` next to #13619's change;
whichever merges second may need a small conflict fix.
2026-11-24 07:43:31 +00:00
Abhi kumar
381cda6821 feat(dashboard): heatmap panels for logs and traces (#13638)
#### Description

- Heatmap panels now take logs and traces queries. The aggregation is
the bare numeric field the querier buckets (e.g. `duration_nano`),
picked from a numeric-field select that searches the server.
- No default field: a logs or traces heatmap waits until a field is
picked.
- Switching panel kinds keeps the field: `avg(x)` / `pNN(x)` enters a
heatmap as `x` and leaves as `p90(x)`; an order-by on the aggregation
(or its alias) follows it.
- The tooltip names what the grid buckets, e.g. `Traces ·
duration_nano`.

Closes https://github.com/SigNoz/pulse-pod/issues/741


https://github.com/user-attachments/assets/a3edba7a-cd6b-499a-8894-89ddc5bfab51


https://github.com/user-attachments/assets/885e6950-be51-42cf-af57-f3ff3347e4b3
2026-11-24 06:47:53 +00:00
Tushar Vats
9dbe4db00e chore(claude): forbid copying structs through a pointer dereference (#13713)
#### Description

- Adds a Go rule: never copy a struct through a pointer dereference
(`copied := *original`).
- Such a copy is shallow. Pointer, slice and map fields stay shared, so
changing the copy can change the original.
- Use the type's `Copy()` when it has one; otherwise create a new struct
literal from the needed fields.
- `Copy()` methods themselves may dereference, as long as they then
replace every pointer, slice and map field.

🤖 Generated with [Claude Code](https://claude.com/claude-code)
2026-11-24 06:38:42 +00:00
Tushar Vats
da35d99714 test(frontend): raise jest test timeout to 10s (#13721)
#### Description

- Multi-step `userEvent` tests (open a drawer, click, save, wait for the
refetch) pass Jest's default 5s on busy CI runners and fail with
`Exceeded timeout of 5000 ms`, though nothing is wrong.
- `jsci` failed three times on SigNoz/signoz#13713, a rules-only change,
each time on different tests (`QuickFilters`, `InviteMembers`,
`PricedModelsTab`, `AttributeMappingsTab`).
- Raises the default `testTimeout` to 10s. Tests with their own timeout
keep it; a truly hung test now takes 10s to fail.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 05:58:08 +00:00
Vinicius Lourenço
f955bb952a perf(settings): load each settings and alert details tab when it opens (#13694)
#### Description

Settings and alert details import every tab up front, so opening
Settings downloads billing (chart.js, uPlot, `moment-timezone`), service
accounts (CodeMirror) and every other tab before the one you asked for
renders. Each tab now loads when it opens, using the per-tab loading
state from #13691. Tab URLs, order, permissions and license checks stay
as they are.

Opening Settings goes from 11.76 MB to 10.95 MB on main today (3.19 MB
to 2.95 MB gzipped), and to 2.55 MB (0.77 MB gzipped) once the entry PRs
are in. The first time a tab opens in a session it shows a short spinner
beside the settings menu.

The ingestion page relied on the `.learn-more` style that the MCP server
tab happened to load; it now imports it itself.

Part of #10192

#### Screenshots / Screen Recordings

Opening Settings pages in Storybook, main on the left. The network is
slowed to 1.6 Mbps so the loading state is visible; at 4 Mbps a page
shows in about 0.3 s:


https://github.com/user-attachments/assets/02da6227-5dac-43a2-b6fe-dfd4968a009b

Across the 188 Settings and alert stories, the tabs render the same in
both themes once loaded, apart from a focus ring left on the members
search and a 1px edge in the role JSON panel. The other differences are
toasts and play steps caught at different moments.
2026-11-24 03:57:36 +00:00
Gaurav Tewari
cb0adcc618 refactor(ai-assistant): import assistant types from @signozhq/noz-client (#13526)
Some checks failed
cacheci / tests (push) Has been cancelled
build-staging / prepare (push) Has been cancelled
build-staging / js-build (push) Has been cancelled
build-staging / go-build (push) Has been cancelled
build-staging / staging (push) Has been cancelled
Release Drafter / update_release_draft (push) Has been cancelled
#### Description

- AI Assistant DTOs and enums now come from the `@signozhq/noz-client`
package (pinned `1.12.2`) instead of a generated copy in
`src/api/ai-assistant/`. The API spec lives in the assistant repo, so
bumping a package version replaces hand-syncing the files on every
release.
- Deleted `sigNozAIAssistantAPI.schemas.ts` and the unused orval hooks
in `index.ts`. `chat.ts` (REST + SSE client) stays and keeps using
`AIAssistantInstance`.
- Only types and enums are imported, so the package's hooks and
`setGeneratedAPIInstance` are not wired.

#### Issues closed by this PR


https://github.com/orgs/SigNoz/projects/59/views/18?pane=issue&itemId=315100999&issue=SigNoz%7Cnerve-pod%7C677

#### Screenshots / Screen Recordings

#### Additional Information

- The package exports the same schemas as the deleted file, plus
`ReadinessChecksDTODrain`.

---------

Co-authored-by: Gaurav Tewari <tewarig@users.noreply.github.com>
2026-11-23 18:36:19 +00:00
Vinicius Lourenço
b14b634bce perf(web): keep the tab bar while a lazy tab loads (#13691)
#### Description

Pages with tabs (Settings, Logs, Traces, Metrics and others) render them
through `RouteTab`, which mounts only the active tab but receives every
tab's component already imported. To let a page load each tab when it
opens, a tab has to be able to suspend. Each tab pane now has its own
loading boundary, so a tab that is still loading shows a spinner under
the tab bar instead of the whole page turning into one.

Nothing changes on its own: no tab is lazy yet. The pages follow in
separate PRs per owner, and with them and the entry PRs in, opening
Settings goes from 11.76 MB to 2.55 MB (3.19 MB to 0.77 MB gzipped).

The jest setup's `getComputedStyle` fallback now returns a width and
height, since tables mounted inside a lazy pane crashed without them.

Part of #10192

#### Screenshots / Screen Recordings

Settings with its pages loading on demand through this change (the
follow-up PR), in Storybook with the network slowed to 1.6 Mbps, main on
the left:


https://github.com/user-attachments/assets/d22bf877-1ff8-4d25-a4eb-85a0a046998c
2026-11-23 17:48:51 +00:00
Vinicius Lourenço
7ea0d57417 fix(roles): keep the editor loading until the role's grants are in local state (#13671)
Some checks failed
build-staging / staging (push) Has been cancelled
build-staging / prepare (push) Has been cancelled
build-staging / js-build (push) Has been cancelled
build-staging / go-build (push) Has been cancelled
cacheci / tests (push) Has been cancelled
Release Drafter / update_release_draft (push) Has been cancelled
#### Description

Opening a role's JSON view from a link or after a reload
(`/settings/roles/:id/edit?viewMode=json`) could show `[]` instead of
the role's grants, and saving then replaced them with whatever was
typed. It happened whenever the permission check answered before the
role fetch.

The editor reads its value only once, when it mounts, so the page now
stays in its loading state until the fetched role is in local state.
2026-11-23 14:26:30 +00:00
Nikhil Soni
1e08a94ab8 fix: application support for clickhouse 26.8 (#13371)
#### Description

Part of SigNoz/platform-pod#3428.

- Run every integration suite against ClickHouse `26.8.34` (SQLite only,
non-blocking) to catch upgrade issues early.
- Bump the collector to `v0.144.17` for
SigNoz/signoz-otel-collector#990: 26.8 rejects the migrator's `CREATE`
of AggregatingMergeTree tables with plain columns outside the sorting
key.
- Pin `use_variant_as_common_type=0`: 26.8 turns mismatched types into
`Variant` instead of the no-common-type error. Handling `Variant`
results instead is tracked in SigNoz/events-pod#271.
- Drop `avg(timestamp)` from the pinned unsupported aggregations: 26.8
averages `DateTime64` into an instant.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_01X3AdVnw3X4N8Knhw8Yghtv
2026-11-23 13:24:36 +00:00
Vinicius Lourenço
cbfbb103af fix(web): correct the CSS modules guide, forbid component overrides, replace undefined tokens (#13697)
## Description

The CSS modules guide told us to write `:local(@keyframes name)`, and
Greptile now flags plain `@keyframes` in review because of it. That form
doesn't compile (Sass fails with `expected selector`), and it isn't
needed: CSS Modules already scope `@keyframes` in a `.module.scss` file.

While checking the rest of the guide against `@signozhq/ui` and the
design tokens, I fixed two more things that don't exist or don't behave
as written. The `--periscope-font-size-*` and `--font-size-*` tokens
aren't defined anywhere, so the checklist now points at the text style
tokens. And a nested `.icon` inside `.button` compiles to `.button
.icon`, so it is scoped under `.button`, contrary to what the comment
said.

The app had the same problem: the AI assistant, the Top List panel and
the Geo Map tooltip used `--periscope-font-size-*`, `--font-size-*` and
`--font-weight-*` tokens that were never defined, so their text fell
back to whatever size and weight it inherited. They now use the
typography tokens, so small labels render at 11px and medium or semibold
text gets its weight back. Expect those surfaces to look slightly
different.

The guide also taught how to override `@signozhq/ui` components through
their CSS variables and `data-*` attributes, and several of the
variables it listed didn't exist. That section now says not to override
them at all: use the component's props, put layout on a wrapper you own,
and when the component can't do what the design needs, file a UI
suggestion in `SigNoz/uforge-pod` instead of restyling it locally.
`frontend/CLAUDE.md` says the same, so agents stop writing overrides.

## Screenshots

AI assistant thread list: group headers and timestamps drop to 11px,
headers get bolder.
![AI assistant thread list, before and
after](https://github.com/user-attachments/assets/97d85d76-95d1-4793-b968-049ba21b11d1)

AI assistant suggested actions: the label drops to 11px, the action
buttons grow to 13px.
![AI assistant suggested actions, before and
after](https://github.com/user-attachments/assets/bc115d6d-2a95-47c5-8aeb-8d8da62cbd7a)

Geo Map tooltip: the place name goes to 13px medium, the code, label and
value to 11px.
![Geo Map tooltip, before and
after](https://github.com/user-attachments/assets/12b54137-2310-4e0b-976b-ac94e7ad364c)

Top List: the value column goes from regular to medium weight.
![Top List values, before and
after](https://github.com/user-attachments/assets/f90222b0-d256-499d-90b7-03065676886d)
2026-11-23 13:17:32 +00:00
Swapnil Nakade
fbca5e7d80 feat(auditor): add tls to the kafka auditor (#13710)
<!--A few plain bullets saying what changed and why, for a reviewer
skimming it - not a wall of text, not a restatement of the diff, not
generated boilerplate.-->
#### Description
- Adds `auditor::kafka::tls` (`enabled`, `ca_file`, `cert_file`,
`key_file`) so the Kafka auditor can connect to brokers that require TLS
or mTLS, such as Redpanda's internal listener in TLS deployments.

<!--Reference issues using `Closes #issue-number` to enable automatic
closure on merge. -->
#### Issues closed by this PR
closes https://github.com/SigNoz/keystone-pod/issues/225
2026-11-23 10:57:46 +00:00
1104 changed files with 8096 additions and 25721 deletions

View File

@@ -9,12 +9,14 @@ paths:
Examples and the harness API live in [`frontend/src/tests/README.md`](../../frontend/src/tests/README.md).
- **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` computes the accessibility tree on every call and is the slowest query.
- **Interact like a user.** `const user = userEvent.setup({ pointerEventsCheck: 0 })`, then an awaited `user.click`, `hover`, `keyboard` or `type`. `fireEvent` only for events `userEvent` has no equivalent for: scroll, resize, setting `scrollTop`.
- **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` computes the accessibility tree on every call and is the slowest query. 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, which walks `getComputedStyle` up the tree on every action; never turn it back on. `fireEvent` only for events `userEvent` has no equivalent for: scroll, resize, setting `scrollTop`.
- **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`.
- **Mock only business boundaries.** Local `jest.mock` for API modules, custom hooks and domain components. Never re-mock what the harness provides or what `jest.config.ts` maps (`uplot`, `@signozhq/icons`, `useSafeNavigate`, `logEvent`).
- **Mock only business boundaries.** Local `jest.mock` for API modules, custom hooks and domain components. Never re-mock what the harness provides (`@floating-ui/dom`, `@testing-library/user-event` and antd's `collectScroller` in `jest.setup.ts`) or what `jest.config.ts` maps (`uplot`, `@signozhq/icons`, `useSafeNavigate`, `logEvent`).
- **Type mocks and fixtures.** `jest.mocked(fn)` for module mocks, `jest.fn() as jest.MockedFunction<T>` for a standalone mock you configure or assert on. Fixtures carry their real type, from `src/api/generated` where it exists. No `any`, no `as unknown as`. An inline `onX={jest.fn()}` on a typed prop that is never asserted needs no annotation.
- **A test fails without its change.** Revert the change, or break the line under test, and run the test before you finish: it must fail. Assert the specific outcome (exact text, request payload, call arguments), never only that an element exists.
- **One behaviour per test, at the smallest render.** Render the component that owns the behaviour, not the page around it, unless the page wiring is the behaviour. A flow of steps (a wizard, a multi-step form) becomes one test per step that starts at that step through props, store or route. A full click-through belongs in the e2e suite (`tests/e2e`).
- **Each test under 500 ms.** `pnpm jest <file> --verbose` prints each test's time. CI runs about four times slower than a laptop, and the timeout is 5 s. Never raise a timeout (`jest.setTimeout`, a third argument to `it`) to make a slow test pass; slim the test instead.
- **A test fails without its change.** At the gate in [`frontend/AGENTS.md`](../../frontend/AGENTS.md), revert the change, or break the line under test, and run the test: it must fail, and each test must stay under 500 ms. Assert the specific outcome (exact text, request payload, call arguments), never only that an element exists.
- **No limit on tests per file.** Split a file when it mixes unrelated behaviour, not to hit a count.

View File

@@ -15,3 +15,4 @@ paths:
- When defining types, keep the structure of file to have any constants and variables first, then exported types and exported methods and then finally the unexported types and methods.
- Never import types or other modules in migration files, duplicate the required type or method to keep migration free from changes.
- Always run the gofmt tool for formating beforing commiting any changes.
- **Never copy through a pointer dereference** (`copied := *original`). It copies only the top level: pointer, slice and map fields stay shared, so changing the copy can change the original. Use the type's `Copy()` when it has one (`QueryBuilderFormula.Copy`); otherwise create a new struct literal from the fields you need. A `Copy()` itself may dereference, as long as it then replaces every pointer, slice and map field.

View File

@@ -94,7 +94,7 @@ jobs:
postgres:15 \
clickhouse/clickhouse-server:25.12.5 \
clickhouse/clickhouse-keeper:25.12.5 \
signoz/signoz-otel-collector:v0.144.16-rc.1 \
signoz/signoz-otel-collector:v0.144.17 \
wiremock/wiremock:2.35.1-1 \
| xargs -P 0 -n 1 docker pull -q
- name: python

View File

@@ -85,13 +85,18 @@ jobs:
- wal
clickhouse-version:
- 25.12.5
- 26.8.34
signoz-otel-collector-version:
- v0.144.16-rc.1
- v0.144.17
postgres-version:
- 15
exclude:
- sqlstore-provider: postgres
clickhouse-version: 26.8.34
if: |
((github.event_name == 'pull_request' && ! github.event.pull_request.head.repo.fork && github.event.pull_request.user.login != 'dependabot[bot]' && ! contains(github.event.pull_request.labels.*.name, 'safe-to-test')) ||
(github.event_name == 'pull_request_target' && contains(github.event.pull_request.labels.*.name, 'safe-to-test'))) && contains(github.event.pull_request.labels.*.name, 'safe-to-integrate')
continue-on-error: ${{ matrix.clickhouse-version == '26.8.34' }}
runs-on: ubuntu-latest
steps:
- name: checkout

View File

@@ -474,6 +474,14 @@ auditor:
compression: lz4
# The maximum time to drain buffered events on shutdown. Undelivered events are dropped after it.
shutdown_timeout: 30s
tls:
# Whether to connect to the brokers over TLS.
enabled: false
# The PEM CA bundle that verifies broker certificates. Empty uses the system roots.
ca_file: ""
# The client certificate and key, for brokers that require client auth. Set both or neither.
cert_file: ""
key_file: ""
##################### Cloud Integration #####################
cloudintegration:

View File

@@ -16274,13 +16274,22 @@ paths:
where it is case-sensitive and % and _ act as wildcards. For keys, a context
prefix such as resource.service.name sets fieldContext when it is empty.'
type: string
- description: The key whose values to return, such as service.name. A context
prefix such as resource.service.name sets fieldContext when it is empty.
- description: 'The key whose values to return, such as service.name. With fieldContext
set, it is the stored name as is. Otherwise a context prefix such as resource.service.name
sets the context and a type suffix such as service.name:string sets fieldDataType
when that is empty; as in filter expressions, a prefixed name also matches
a key stored under the full name, whose values come first: log.level returns
values of a key named log.level, then of the log field level.'
in: query
name: name
schema:
description: The key whose values to return, such as service.name. A context
prefix such as resource.service.name sets fieldContext when it is empty.
description: 'The key whose values to return, such as service.name. With
fieldContext set, it is the stored name as is. Otherwise a context prefix
such as resource.service.name sets the context and a type suffix such
as service.name:string sets fieldDataType when that is empty; as in filter
expressions, a prefixed name also matches a key stored under the full
name, whose values come first: log.level returns values of a key named
log.level, then of the log field level.'
type: string
- description: Filter expression already applied in the explorer. When set,
relatedValues lists the values seen on data matching it.
@@ -28927,13 +28936,22 @@ paths:
where it is case-sensitive and % and _ act as wildcards. For keys, a context
prefix such as resource.service.name sets fieldContext when it is empty.'
type: string
- description: The key whose values to return, such as service.name. A context
prefix such as resource.service.name sets fieldContext when it is empty.
- description: 'The key whose values to return, such as service.name. With fieldContext
set, it is the stored name as is. Otherwise a context prefix such as resource.service.name
sets the context and a type suffix such as service.name:string sets fieldDataType
when that is empty; as in filter expressions, a prefixed name also matches
a key stored under the full name, whose values come first: log.level returns
values of a key named log.level, then of the log field level.'
in: query
name: name
schema:
description: The key whose values to return, such as service.name. A context
prefix such as resource.service.name sets fieldContext when it is empty.
description: 'The key whose values to return, such as service.name. With
fieldContext set, it is the stored name as is. Otherwise a context prefix
such as resource.service.name sets the context and a type suffix such
as service.name:string sets fieldDataType when that is empty; as in filter
expressions, a prefixed name also matches a key stored under the full
name, whose values come first: log.level returns values of a key named
log.level, then of the log field level.'
type: string
- description: Filter expression already applied in the explorer. When set,
relatedValues lists the values seen on data matching it.

View File

@@ -2,7 +2,10 @@ package kafkaauditor
import (
"context"
"crypto/tls"
"crypto/x509"
"log/slog"
"os"
"github.com/twmb/franz-go/pkg/kgo"
"github.com/twmb/franz-go/plugin/kslog"
@@ -10,6 +13,7 @@ import (
"github.com/SigNoz/signoz/pkg/auditor"
"github.com/SigNoz/signoz/pkg/auditor/auditorserver"
"github.com/SigNoz/signoz/pkg/errors"
"github.com/SigNoz/signoz/pkg/factory"
"github.com/SigNoz/signoz/pkg/licensing"
"github.com/SigNoz/signoz/pkg/types/audittypes"
@@ -39,13 +43,25 @@ func newProvider(_ context.Context, providerSettings factory.ProviderSettings, c
// Acks from all in-sync replicas, idempotent writes and unbounded record retries are franz-go defaults and are kept as is.
// A delivery timeout or retry limit lets franz-go < v1.22.2 ack a record that was never written (twmb/franz-go#1484).
client, err := kgo.NewClient(
opts := []kgo.Opt{
kgo.SeedBrokers(config.Kafka.Brokers...),
kgo.ClientID(config.Kafka.ClientID),
kgo.ProducerBatchCompression(compressionCodec(config.Kafka.Compression)),
kgo.ProducerLinger(0),
kgo.WithLogger(kslog.New(settings.Logger())),
)
}
if config.Kafka.TLS.Enabled {
tlsConfig, err := newTLSConfig(config.Kafka.TLS)
if err != nil {
return nil, err
}
// franz-go sets ServerName per broker from the dialed address.
opts = append(opts, kgo.DialTLSConfig(tlsConfig))
}
client, err := kgo.NewClient(opts...)
if err != nil {
return nil, err
}
@@ -130,3 +146,30 @@ func compressionCodec(name string) kgo.CompressionCodec {
return kgo.NoCompression()
}
}
func newTLSConfig(config auditor.TLSConfig) (*tls.Config, error) {
tlsConfig := &tls.Config{}
if config.CAFile != "" {
caPEM, err := os.ReadFile(config.CAFile)
if err != nil {
return nil, errors.WrapInvalidInputf(err, errors.CodeInvalidInput, "cannot read auditor::kafka::tls::ca_file")
}
tlsConfig.RootCAs = x509.NewCertPool()
if !tlsConfig.RootCAs.AppendCertsFromPEM(caPEM) {
return nil, errors.NewInvalidInputf(errors.CodeInvalidInput, "auditor::kafka::tls::ca_file %q holds no PEM certificate", config.CAFile)
}
}
if config.CertFile != "" {
cert, err := tls.LoadX509KeyPair(config.CertFile, config.KeyFile)
if err != nil {
return nil, errors.WrapInvalidInputf(err, errors.CodeInvalidInput, "cannot load auditor::kafka::tls::cert_file and auditor::kafka::tls::key_file")
}
tlsConfig.Certificates = []tls.Certificate{cert}
}
return tlsConfig, nil
}

View File

@@ -0,0 +1,269 @@
package kafkaauditor
import (
"context"
"crypto/ecdsa"
"crypto/elliptic"
"crypto/rand"
"crypto/tls"
"crypto/x509"
"crypto/x509/pkix"
"encoding/pem"
"math/big"
"net"
"os"
"path/filepath"
"testing"
"time"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/twmb/franz-go/pkg/kfake"
"github.com/twmb/franz-go/pkg/kgo"
"github.com/SigNoz/signoz/pkg/auditor"
"github.com/SigNoz/signoz/pkg/errors"
"github.com/SigNoz/signoz/pkg/instrumentation/instrumentationtest"
"github.com/SigNoz/signoz/pkg/types/audittypes"
"github.com/SigNoz/signoz/pkg/types/coretypes"
"github.com/SigNoz/signoz/pkg/version"
)
func TestExport_MutualTLS(t *testing.T) {
certificates := newTestCertificates(t)
cluster, err := kfake.NewCluster(
kfake.NumBrokers(1),
kfake.SeedTopics(1, "tls_audit"),
kfake.TLS(&tls.Config{
Certificates: []tls.Certificate{certificates.server},
ClientCAs: certificates.caPool,
ClientAuth: tls.RequireAndVerifyClientCert,
}),
)
require.NoError(t, err)
t.Cleanup(cluster.Close)
testCases := []struct {
name string
tls auditor.TLSConfig
err bool
}{
{
name: "CAAndClientCertificate_Delivers",
tls: certificates.client,
},
{
name: "TLSDisabled_Fails",
tls: auditor.TLSConfig{},
err: true,
},
{
name: "WithoutClientCertificate_Fails",
tls: auditor.TLSConfig{Enabled: true, CAFile: certificates.client.CAFile},
err: true,
},
{
name: "WithoutCA_Fails",
tls: auditor.TLSConfig{Enabled: true, CertFile: certificates.client.CertFile, KeyFile: certificates.client.KeyFile},
err: true,
},
}
for _, testCase := range testCases {
t.Run(testCase.name, func(t *testing.T) {
config := auditor.Config{
Provider: "kafka",
BufferSize: 10,
BatchSize: 5,
FlushInterval: 50 * time.Millisecond,
Kafka: auditor.KafkaConfig{
Brokers: cluster.ListenAddrs(),
Topic: "tls_audit",
ClientID: "signoz-tls-test",
Compression: "lz4",
ShutdownTimeout: 30 * time.Second,
TLS: testCase.tls,
},
}
auditor, err := newProvider(context.Background(), instrumentationtest.New().ToProviderSettings(), config, nil, version.Info)
require.NoError(t, err)
provider := auditor.(*provider)
defer provider.client.Close()
ctx, cancel := context.WithTimeout(context.Background(), 2*time.Second)
defer cancel()
err = provider.export(ctx, []audittypes.AuditEvent{newTestEvent(coretypes.ResourceUser, coretypes.VerbCreate, testCase.name)})
if testCase.err {
assert.True(t, errors.Is(err, context.DeadlineExceeded))
return
}
require.NoError(t, err)
})
}
consumerTLS, err := newTLSConfig(certificates.client)
require.NoError(t, err)
consumer, err := kgo.NewClient(
kgo.SeedBrokers(cluster.ListenAddrs()...),
kgo.DialTLSConfig(consumerTLS),
kgo.ConsumeTopics("tls_audit"),
kgo.ConsumeResetOffset(kgo.NewOffset().AtStart()),
)
require.NoError(t, err)
defer consumer.Close()
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
defer cancel()
fetches := consumer.PollFetches(ctx)
require.Empty(t, fetches.Errors())
assert.Len(t, fetches.Records(), 1)
}
func TestNewTLSConfig(t *testing.T) {
certificates := newTestCertificates(t)
notPEMFile := filepath.Join(t.TempDir(), "not-pem.crt")
require.NoError(t, os.WriteFile(notPEMFile, []byte("not a pem"), 0o600))
testCases := []struct {
name string
config auditor.TLSConfig
err bool
wantRootCAs bool
wantCertificates int
}{
{
name: "NoFiles_UsesSystemRoots",
config: auditor.TLSConfig{Enabled: true},
},
{
name: "CAOnly",
config: auditor.TLSConfig{Enabled: true, CAFile: certificates.client.CAFile},
wantRootCAs: true,
},
{
name: "CAAndClientCertificate",
config: certificates.client,
wantRootCAs: true,
wantCertificates: 1,
},
{
name: "CAFileMissing",
config: auditor.TLSConfig{Enabled: true, CAFile: filepath.Join(t.TempDir(), "missing-ca.crt")},
err: true,
},
{
name: "CAFileNotPEM",
config: auditor.TLSConfig{Enabled: true, CAFile: notPEMFile},
err: true,
},
{
name: "KeyFileMissing",
config: auditor.TLSConfig{Enabled: true, CertFile: certificates.client.CertFile, KeyFile: filepath.Join(t.TempDir(), "missing.key")},
err: true,
},
{
name: "CertFileNotPEM",
config: auditor.TLSConfig{Enabled: true, CertFile: notPEMFile, KeyFile: certificates.client.KeyFile},
err: true,
},
}
for _, testCase := range testCases {
t.Run(testCase.name, func(t *testing.T) {
tlsConfig, err := newTLSConfig(testCase.config)
if testCase.err {
assert.True(t, errors.Ast(err, errors.TypeInvalidInput))
return
}
require.NoError(t, err)
assert.Equal(t, testCase.wantRootCAs, tlsConfig.RootCAs != nil)
assert.Len(t, tlsConfig.Certificates, testCase.wantCertificates)
})
}
}
type testCertificates struct {
caPool *x509.CertPool
server tls.Certificate
client auditor.TLSConfig
}
// Issues a CA, a broker certificate for 127.0.0.1 and a client certificate, writing the client side as ca.crt, tls.crt and tls.key.
func newTestCertificates(t *testing.T) testCertificates {
t.Helper()
caKey, err := ecdsa.GenerateKey(elliptic.P256(), rand.Reader)
require.NoError(t, err)
caTemplate := &x509.Certificate{
SerialNumber: big.NewInt(1),
Subject: pkix.Name{CommonName: "test-ca"},
NotBefore: time.Now().Add(-time.Hour),
NotAfter: time.Now().Add(time.Hour),
IsCA: true,
BasicConstraintsValid: true,
KeyUsage: x509.KeyUsageCertSign,
}
caDER, err := x509.CreateCertificate(rand.Reader, caTemplate, caTemplate, &caKey.PublicKey, caKey)
require.NoError(t, err)
ca, err := x509.ParseCertificate(caDER)
require.NoError(t, err)
serverCertPEM, serverKeyPEM := issueTestCertificate(t, ca, caKey, &x509.Certificate{
SerialNumber: big.NewInt(2),
Subject: pkix.Name{CommonName: "broker"},
IPAddresses: []net.IP{net.ParseIP("127.0.0.1")},
ExtKeyUsage: []x509.ExtKeyUsage{x509.ExtKeyUsageServerAuth},
})
server, err := tls.X509KeyPair(serverCertPEM, serverKeyPEM)
require.NoError(t, err)
clientCertPEM, clientKeyPEM := issueTestCertificate(t, ca, caKey, &x509.Certificate{
SerialNumber: big.NewInt(3),
Subject: pkix.Name{CommonName: "signoz"},
ExtKeyUsage: []x509.ExtKeyUsage{x509.ExtKeyUsageClientAuth},
})
dir := t.TempDir()
client := auditor.TLSConfig{
Enabled: true,
CAFile: filepath.Join(dir, "ca.crt"),
CertFile: filepath.Join(dir, "tls.crt"),
KeyFile: filepath.Join(dir, "tls.key"),
}
require.NoError(t, os.WriteFile(client.CAFile, pem.EncodeToMemory(&pem.Block{Type: "CERTIFICATE", Bytes: caDER}), 0o600))
require.NoError(t, os.WriteFile(client.CertFile, clientCertPEM, 0o600))
require.NoError(t, os.WriteFile(client.KeyFile, clientKeyPEM, 0o600))
caPool := x509.NewCertPool()
caPool.AddCert(ca)
return testCertificates{caPool: caPool, server: server, client: client}
}
func issueTestCertificate(t *testing.T, ca *x509.Certificate, caKey *ecdsa.PrivateKey, template *x509.Certificate) ([]byte, []byte) {
t.Helper()
key, err := ecdsa.GenerateKey(elliptic.P256(), rand.Reader)
require.NoError(t, err)
template.NotBefore = time.Now().Add(-time.Hour)
template.NotAfter = time.Now().Add(time.Hour)
template.KeyUsage = x509.KeyUsageDigitalSignature
der, err := x509.CreateCertificate(rand.Reader, template, ca, &key.PublicKey, caKey)
require.NoError(t, err)
keyDER, err := x509.MarshalECPrivateKey(key)
require.NoError(t, err)
return pem.EncodeToMemory(&pem.Block{Type: "CERTIFICATE", Bytes: der}), pem.EncodeToMemory(&pem.Block{Type: "EC PRIVATE KEY", Bytes: keyDER})
}

View File

@@ -99,7 +99,7 @@ is still by hand. The generator never adds a SideNav item; do that in
CSS Modules (`docs/css-modules-guide.md`), React Query for server state (prefer
`api/generated` hooks), nuqs for URL state, Zustand for client state, `data-testid` on
every interactive element.
5. **Verify** before reporting done:
5. **Verify** at the gate in `AGENTS.md` (commit, push or PR), not after each edit; skip it while the user says `no checks`:
```bash
pnpm tsgo --noEmit
pnpm oxlint src/pages/<Feature>

View File

@@ -506,7 +506,6 @@
"ignorePatterns": [
"src/parser/*.ts",
"scripts/update-registry.cjs",
"scripts/generate-permissions-type.cjs",
"**/node_modules",
"**/build",
"**/*.typegen.ts",

View File

@@ -28,20 +28,24 @@ You are operating within a constrained context window and strict system prompts.
- UI primitives come from `@signozhq/ui` (subpath imports) and icons from `@signozhq/icons`. No new `antd` component or direct icon library (`lucide-react`) where `@signozhq/ui` has an equivalent; `signoz/no-antd-components` enforces part of this list.
- Exception: a control added beside `antd` siblings of the same kind (a tab in an `antd` tab strip) matches them until that surface migrates. Say so in the PR.
- When `@signozhq/ui` or `@signozhq/icons` lacks what you need, say so in the PR before reaching for another library.
- Before styling a `@signozhq/ui` component, check its props in `node_modules/@signozhq/ui/dist/<component>/*.d.ts` for `className`/`style` support; some omit them. Avoid overriding the component's CSS vars unless explicitly needed.
- Never override a `@signozhq/ui` component's styles: no `--<component>-*` CSS variables, no `:global` class or `data-*` selectors, no restyling through `className`/`style`. Use its props, and put layout on a wrapper you own. When it can't do what the design needs, file a UI suggestion in `SigNoz/uforge-pod` (`ui-suggestion.yml` template) and link it in the PR.
- When writing code that could need authorization checks, read ./src/lib/authz/README.md
- A flow that gains a request also gates on that request's permission: a rename that now reads the view first needs `read` as well as `update`.
- Identity keys (legend groups, color groups, CSV headers, React keys) come from structured values, never from joined display text: `['us, east', 'prod']` and `['us', 'east, prod']` both join to `us, east, prod`.
- A payload saved under another kind or schema copies only the fields that schema accepts, and drops bindings to columns the user removed. The server rejects unknown or stale fields, so the preview works and the save fails.
3. FORCED VERIFICATION: Your internal tools mark file writes as successful even if the code does not compile. Run these checks once all changes of a task are done, never after each edit. You are FORBIDDEN from reporting a task as complete until you have:
3. CHECKS AT THE GATE: Your internal tools mark file writes as successful even if the code does not compile, so the checks below are required, but only at the gate. The gate is when the user says commit, push, raise or update the PR, mark it ready, or "run checks". Never run them after each edit or between the user's iterations.
- Between gates, after an edit, run at most the one test file that covers it.
- `no checks`: when the user says it (or "don't run tests", "just making changes"), run nothing: no tests, type check, lint, format or build. Make the change and stop. This holds until the user names a gate.
At the gate, you are FORBIDDEN from reporting a task as complete until you have:
- Run `pnpm tsgo --noEmit`
- Run `pnpm lint:js --quiet` to find critical errors
- Run `pnpm oxlint <file1> <file2>` and fix all warnings
- Run `pnpm build`
- Find if the file has tests for it, or if there's `__test__` folder or the parent folder has tests, and run. Run them before coding the change or after all changes, never in between.
- For e2e, run only the specs you added or changed: the stack is heavy. Leave the full jest and e2e suites to CI unless the user asks.
- For every test you added or changed, revert the change it covers and confirm the test fails
- For every test you added or changed, revert the change it covers and confirm the test fails, and that each test runs under 500 ms (`pnpm jest <file> --verbose`)
- On a stacked branch (`gh stack`), run `pnpm tsgo --noEmit` on every branch above it before pushing: a renamed prop or moved export breaks them
- Fixed ALL resulting errors

View File

@@ -9,12 +9,12 @@
- [ ] No deep class nesting (max 3 class levels; pseudo-classes/elements and parent-reference selectors like `&.active`, `&#bar` are not counted)
- [ ] No hardcoded colors - use `--l1/l2/l3-*` semantic tokens (not `--bg-*` primitives)
- [ ] No magic numbers - use `--spacing-*` tokens
- [ ] Typography uses `--periscope-font-size-*` or `--font-size-*` tokens
- [ ] @signozhq/ui overrides use CSS variables, not direct class overrides
- [ ] Global escapes only for third-party overrides
- [ ] Typography uses `--{variant}-{size}-{weight}-*` text style tokens (see Typography)
- [ ] No overrides of `@signozhq/ui` components (see below)
- [ ] Global escapes only for third-party overrides (`@signozhq/ui` is not third-party)
- [ ] No ID selectors
- [ ] No bare element selectors
- [ ] Keyframes use `:local(@keyframes name)` to avoid global collisions
- [ ] Keyframes are declared in the module with plain `@keyframes name` (already local)
## Config (vite.config.ts)
@@ -77,7 +77,7 @@ css: {
// BAD: Nesting creates separate classes you might not expect
.button {
.icon { } // -> styles.icon (separate class, not scoped under .button)
.icon { } // -> styles.icon, but the rule is `.button .icon`: it only matches inside .button
}
// GOOD: Flat structure
@@ -289,88 +289,32 @@ Use L1/L2/L3 semantic tokens - they handle light/dark theme automatically.
- L2 = elevated surfaces (cards, panels)
- L3 = nested/inset elements
## Overriding @signozhq/ui Components
## @signozhq/ui Components
Components expose CSS variables for customization.
Don't override them. That covers setting a component's `--<component>-*` CSS variables, targeting its classes or `data-*` attributes through `:global(...)`, and restyling it with `className` or `style`. An override keeps working until the component changes, then breaks with no type error or lint warning, and the screen drifts from every other one using that component.
You can ensure they exist by looking at ./node_modules/@signozhq/ui/dist.
Never write a override without confirm it exists.
Override via:
### Method 1: CSS Variables (Preferred)
Each component exposes `--<component>-<property>` variables:
- Use the component's props (`variant`, `color`, `size`, ...) for how it looks.
- Put layout (position, margin, width inside a flex or grid parent) on a wrapper element you own.
- If the component can't do what the design needs, file a [UI suggestion](https://github.com/SigNoz/uforge-pod/issues/new?template=ui-suggestion.yml) in `SigNoz/uforge-pod` and ship with the component as it renders until the suggestion is decided. Link the issue in the PR.
```scss
// Override Button
.customButton {
--button-background: var(--success-background);
--button-border-radius: var(--radius-2);
--button-padding: var(--spacing-4) var(--spacing-8);
--button-font-size: var(--label-base-400-font-size);
// BAD: Restyling the component
.saveButton {
--button-primary-background-color: var(--success-background);
}
// Override Input
.customInput {
--input-height: 2.5rem;
--input-border-color: var(--l2-border);
--input-padding: var(--spacing-2) var(--spacing-6);
--input-placeholder-color: var(--l3-foreground);
.toolbar :global([data-variant="outlined"]) {
--button-variant-outlined-border: 1px solid var(--accent-primary);
}
// Override nested parts
.customInput {
--input-prefix-padding: 0 var(--spacing-4) 0 var(--spacing-6);
--input-suffix-color: var(--accent-primary);
// GOOD: Layout on your own wrapper, looks from props
.toolbarActions {
display: flex;
gap: var(--spacing-4);
margin-left: auto;
}
```
### Method 2: Data Attributes
Components use data attributes for variants/states. Target them for state-specific overrides:
```scss
// Target variant
.wrapper :global([data-variant="outlined"]) {
--button-border-color: var(--accent-primary);
}
// Target size
.wrapper :global([data-size="sm"]) {
--button-font-size: var(--label-small-400-font-size);
}
// Target color
.wrapper :global([data-color="destructive"]) {
--button-background: var(--danger-background);
}
// Target state (Radix patterns)
.popover :global([data-state="open"]) {
opacity: 1;
}
.tooltip :global([data-side="top"]) {
margin-bottom: var(--spacing-2);
}
```
### Common Component CSS Variables
**Button:**
- `--button-background`, `--button-border-radius`, `--button-padding`
- `--button-font-size`, `--button-height`, `--button-gap`
- `--button-hover-background`, `--button-disabled-opacity`
**Input:**
- `--input-height`, `--input-border-color`, `--input-background`
- `--input-padding`, `--input-font-size`, `--input-placeholder-color`
- `--input-focus-outline-color`, `--input-hover-border-color`
- `--input-prefix-*`, `--input-suffix-*` for adornments
**General pattern:** `--<component>-<property>` or `--<component>-<state>-<property>`
## Good Patterns
### Structure
@@ -434,24 +378,21 @@ Components use data attributes for variants/states. Target them for state-specif
### Keyframes (Local Scoping)
Without `:local()`, keyframe names are global and can clash across modules:
CSS Modules scope `@keyframes` like classes: the build renames `fadeIn` to `_fadeIn_<hash>` and rewrites every `animation` in the same module that names it. Don't wrap it in `:local(...)`; Sass rejects `:local(@keyframes fadeIn)` with `expected selector`.
```scss
// BAD: Global keyframe - can conflict with other modules
// GOOD: Local to this module
@keyframes fadeIn {
from { opacity: 0; }
to { opacity: 1; }
}
// GOOD: Locally scoped keyframe
:local(@keyframes fadeIn) {
from { opacity: 0; }
to { opacity: 1; }
}
.modal {
animation: fadeIn 200ms ease;
}
// BAD: Doesn't compile
:local(@keyframes fadeIn) { }
```
## JS Import Patterns

View File

@@ -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

View File

@@ -6,6 +6,8 @@ const LOG_EVENT_MOCK_PATH = '<rootDir>/src/__tests__/logEventMock.ts';
const config: Config.InitialOptions = {
silent: true,
// CI runners are slow enough that multi-step userEvent tests pass 5s.
testTimeout: 10000,
clearMocks: true,
coverageDirectory: 'coverage',
coverageReporters: ['text', 'cobertura', 'html', 'json-summary'],
@@ -19,9 +21,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,17 +57,18 @@ 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/'],
moduleDirectories: ['node_modules', 'src'],
testEnvironment: '<rootDir>/jest.environment.cjs',
// Local only: the default (cores - 1) workers exhaust RAM when several runs overlap.
...(process.env.CI ? {} : { maxWorkers: 4, workerIdleMemoryLimit: '1GB' }),
coverageThreshold: {
global: {
statements: 80,

View File

@@ -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,
@@ -39,8 +37,8 @@ if (!HTMLElement.prototype.scrollIntoView) {
HTMLElement.prototype.scrollIntoView = function (): void {};
}
// 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 ScrollArea) call. Stub them so those components
// can be exercised in tests.
if (!HTMLElement.prototype.hasPointerCapture) {
HTMLElement.prototype.hasPointerCapture = function (): boolean {
@@ -122,8 +120,8 @@ if (typeof globalThis.DOMRect === 'undefined') {
// Patch getComputedStyle to handle CSS parsing errors from @signozhq/* packages.
// These packages inject CSS at import time via style-inject / vite-plugin-css-injected-by-js.
// jsdom's nwsapi cannot parse some of the injected selectors (e.g. Tailwind's :animate-in),
// causing SyntaxErrors during getComputedStyle / getByRole calls.
// jsdom's nwsapi cannot parse some of the injected selectors, causing SyntaxErrors
// during getComputedStyle / getByRole calls.
const _origGetComputedStyle = window.getComputedStyle;
window.getComputedStyle = function (
elt: Element,
@@ -132,11 +130,13 @@ window.getComputedStyle = function (
try {
return _origGetComputedStyle.call(window, elt, pseudoElt);
} catch {
// Return a minimal CSSStyleDeclaration so callers (testing-library, Radix UI)
// Return a minimal CSSStyleDeclaration so callers (testing-library, Base UI)
// see the element as visible and without animations.
return {
display: '',
visibility: '',
width: '',
height: '',
opacity: '1',
animationName: 'none',
getPropertyValue: () => '',
@@ -144,6 +144,39 @@ window.getComputedStyle = function (
}
};
// jsdom has no layout, and Floating UI's getComputedStyle walk over every
// popover ancestor costs up to ~1 s per open.
jest.mock('@floating-ui/dom', () => ({
...jest.requireActual('@floating-ui/dom'),
autoUpdate: (): (() => void) => (): void => {},
computePosition: (
_reference: unknown,
_floating: unknown,
{ placement = 'bottom', strategy = 'absolute' } = {},
): Promise<unknown> =>
Promise.resolve({ x: 0, y: 0, placement, strategy, middlewareData: {} }),
}));
jest.mock('@testing-library/user-event', () =>
jest.requireActual('tests/userEventWithDefaults'),
);
// antd popups walk getComputedStyle up every ancestor to find scroll
// containers on each open. pnpm keeps the package under antd, not at the root.
jest.mock(
require.resolve('@rc-component/trigger/lib/util', {
paths: [require.resolve('antd')],
}),
() => ({
...jest.requireActual(
require.resolve('@rc-component/trigger/lib/util', {
paths: [require.resolve('antd')],
}),
),
collectScroller: (): HTMLElement[] => [],
}),
);
beforeAll(() => server.listen());
afterEach(() => server.resetHandlers());

View File

@@ -1,8 +1,18 @@
{
"$schema": "https://unpkg.com/knip@5/schema.json",
"entry": [
"scripts/**/*.{mjs,cjs}",
"src/storybook/mocks/*.mock.{ts,tsx}",
"src/**/__tests__/floatingUiDomMock.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"
]
}
}

View File

@@ -56,6 +56,7 @@
"@sentry/vite-plugin": "5.3.0",
"@signozhq/design-tokens": "2.8.0",
"@signozhq/icons": "0.4.0",
"@signozhq/noz-client": "1.13.0",
"@signozhq/ui": "0.4.0-rc.5",
"@tanstack/react-table": "8.21.3",
"@tanstack/react-virtual": "3.13.22",

View File

@@ -18,7 +18,7 @@ const BANNED_COMPONENTS = {
'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.',
'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.',

View File

@@ -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);

View File

@@ -82,6 +82,9 @@ importers:
'@signozhq/icons':
specifier: 0.4.0
version: 0.4.0
'@signozhq/noz-client':
specifier: 1.13.0
version: 1.13.0(axios@1.21.1)(react-query@3.39.3(react-dom@18.2.0(react@18.2.0))(react@18.2.0))(react@18.2.0)
'@signozhq/ui':
specifier: 0.4.0-rc.5
version: 0.4.0-rc.5(@date-fns/tz@1.4.1)(@signozhq/design-tokens@2.8.0)(@signozhq/icons@0.4.0)(@types/react@18.0.26)(date-fns@4.1.0)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)
@@ -3248,6 +3251,13 @@ packages:
'@signozhq/icons@0.4.0':
resolution: {integrity: sha512-QctNvNPlQlsefFdIVmSy/P/7a1IcQ3IryKP0KPMqtoqew3q89FGUmFa5IfEJ7Z3CHhtG1zaXwBKqP72QkLyA3g==}
'@signozhq/noz-client@1.13.0':
resolution: {integrity: sha512-130L2xomHnQZK8ZtAst34qFz9d2rSF/JYpg9gKvJkZVS9+46CPZeTW8Va9PNS9Oa5owezVHIXZStTEbsHIxnwg==}
peerDependencies:
axios: ^1.20.0
react: ^18.2.0
react-query: ^3.39.3
'@signozhq/ui@0.4.0-rc.5':
resolution: {integrity: sha512-WlJMfeDfvL2hjMpTpHhhND/tuK7X0sfXQlx6E1ZG+6E/DYHpuhYljfvW3E6/BohIlHFlTyCs/ZMl9wnV2k9Zcw==}
peerDependencies:
@@ -12373,6 +12383,12 @@ snapshots:
'@signozhq/icons@0.4.0': {}
'@signozhq/noz-client@1.13.0(axios@1.21.1)(react-query@3.39.3(react-dom@18.2.0(react@18.2.0))(react@18.2.0))(react@18.2.0)':
dependencies:
axios: 1.21.1
react: 18.2.0
react-query: 3.39.3(react-dom@18.2.0(react@18.2.0))(react@18.2.0)
'@signozhq/ui@0.4.0-rc.5(@date-fns/tz@1.4.1)(@signozhq/design-tokens@2.8.0)(@signozhq/icons@0.4.0)(@types/react@18.0.26)(date-fns@4.1.0)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)':
dependencies:
'@base-ui/react': 1.8.0(@date-fns/tz@1.4.1)(@types/react@18.0.26)(date-fns@4.1.0)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)

View File

@@ -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'),

View File

@@ -321,8 +321,8 @@ const createTracesResponse = ({
httpMethod: trace.httpMethod ?? httpMethods[index % httpMethods.length],
responseStatusCode:
trace.responseStatusCode ?? statusCodes[index % statusCodes.length],
traceID: `trace-id-${index}`,
spanID: `span-id-${index}`,
trace_id: `trace-id-${index}`,
span_id: `span-id-${index}`,
},
};
})
@@ -340,8 +340,8 @@ const createTracesResponse = ({
durationNano: 1000000 + cumulativeIndex * 100000,
httpMethod: httpMethods[cumulativeIndex % httpMethods.length],
responseStatusCode: statusCodes[cumulativeIndex % statusCodes.length],
traceID: `trace-id-${cumulativeIndex}`,
spanID: `span-id-${cumulativeIndex}`,
trace_id: `trace-id-${cumulativeIndex}`,
span_id: `span-id-${cumulativeIndex}`,
},
};
},

View File

@@ -19,7 +19,7 @@ export const SIGNOZ_URL_HEADER = 'X-SigNoz-URL';
* needs the originating SigNoz instance URL for multi-tenant deployments;
* when omitted it falls back to its `SIGNOZ_API_URL` env var.
*/
export const interceptorsRequestSigNozUrl = (
const interceptorsRequestSigNozUrl = (
value: InternalAxiosRequestConfig,
): InternalAxiosRequestConfig => {
if (value.headers) {

View File

@@ -11,7 +11,7 @@
* to resume, which each return a new executionId to open a fresh SSE stream.
*
* Types in this file re-use the OpenAPI-generated DTOs in
* `src/api/ai-assistant/sigNozAIAssistantAPI.schemas.ts`.
* `@signozhq/noz-client`.
* Local types are defined only when the UI needs a different shape — for
* example, the SSE event union adds a literal `type` discriminator that the
* generated event DTOs leave loose.
@@ -40,7 +40,6 @@ import type {
CreateThreadResponseDTO,
DoneEventDTO,
ErrorEventDTO,
ExecutionStateDTO,
FeedbackRatingDTO,
ListThreadsApiV1AssistantThreadsGetArchived,
ListThreadsApiV1AssistantThreadsGetParams,
@@ -60,7 +59,7 @@ import type {
PageTypeDTO,
ToolCallEventDTO,
ToolResultEventDTO,
} from './sigNozAIAssistantAPI.schemas';
} from '@signozhq/noz-client';
import { LOCALSTORAGE } from 'constants/localStorage';
import {
@@ -203,9 +202,6 @@ export type SSEEvent =
| (ConversationEventDTO & { type: 'conversation' })
| (DoneEventDTO & { type: 'done' });
/** String-literal view of `ExecutionStateDTO` for ergonomic comparisons. */
export type ExecutionState = `${ExecutionStateDTO}`;
// ---------------------------------------------------------------------------
// Re-exported DTOs — the wire shape, used directly without remapping.
// ---------------------------------------------------------------------------
@@ -401,7 +397,7 @@ async function* readSSEReader(
* Carries the HTTP status so callers can branch on rate-limit vs. other
* failures (e.g. show a "please wait a moment" message on 429).
*/
export class SSEStreamError extends Error {
class SSEStreamError extends Error {
status: number;
constructor(status: number, statusText: string) {

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -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;

View File

@@ -40,5 +40,3 @@ export const getFieldKeys = async (
ErrorResponseHandlerV2(error as AxiosError<ErrorV2Resp>);
}
};
export default getFieldKeys;

View File

@@ -93,5 +93,3 @@ export const getFieldValues = async (
ErrorResponseHandlerV2(error as AxiosError<ErrorV2Resp>);
}
};
export default getFieldValues;

View File

@@ -15619,7 +15619,7 @@ export type GetFieldsValuesParams = {
searchText?: string;
/**
* @type string
* @description The key whose values to return, such as service.name. A context prefix such as resource.service.name sets fieldContext when it is empty.
* @description The key whose values to return, such as service.name. With fieldContext set, it is the stored name as is. Otherwise a context prefix such as resource.service.name sets the context and a type suffix such as service.name:string sets fieldDataType when that is empty; as in filter expressions, a prefixed name also matches a key stored under the full name, whose values come first: log.level returns values of a key named log.level, then of the log field level.
*/
name?: string;
/**
@@ -17236,7 +17236,7 @@ export type GetRuleHistoryFilterValuesParams = {
searchText?: string;
/**
* @type string
* @description The key whose values to return, such as service.name. A context prefix such as resource.service.name sets fieldContext when it is empty.
* @description The key whose values to return, such as service.name. With fieldContext set, it is the stored name as is. Otherwise a context prefix such as resource.service.name sets the context and a type suffix such as service.name:string sets fieldDataType when that is empty; as in filter expressions, a prefixed name also matches a key stored under the full name, whose values come first: log.level returns values of a key named log.level, then of the log field level.
*/
name?: string;
/**

View File

@@ -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;

View File

@@ -179,7 +179,7 @@ instance.interceptors.request.use(interceptorsRequestResponse);
instance.interceptors.request.use(interceptorsRequestBasePath);
instance.interceptors.response.use(interceptorsResponse, interceptorRejected);
export const AxiosAlertManagerInstance = axios.create({
const AxiosAlertManagerInstance = axios.create({
baseURL: `${ENVIRONMENT.baseURL}${apiAlertManager}`,
});
@@ -252,5 +252,4 @@ AxiosAlertManagerInstance.interceptors.response.use(
AxiosAlertManagerInstance.interceptors.request.use(interceptorsRequestResponse);
AxiosAlertManagerInstance.interceptors.request.use(interceptorsRequestBasePath);
export { apiV1 };
export default instance;

View File

@@ -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);
}
};

View File

@@ -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);
}
};

View File

@@ -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);
}
};

View File

@@ -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);
}
};

View File

@@ -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;

View File

@@ -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;

View File

@@ -73,5 +73,3 @@ export const downloadExportData = async (
ErrorResponseHandlerV2(error as AxiosError<ErrorV2Resp>);
}
};
export default downloadExportData;

View File

@@ -1,24 +1,11 @@
// V5 Query Range Constants
import { ENTITY_VERSION_V5 } from 'constants/app';
import {
FunctionName,
RequestType,
SignalType,
Step,
} from 'types/api/v5/queryRange';
import { RequestType } 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;
// ===================== Request Type Constants =====================
export const REQUEST_TYPES: Record<string, RequestType> = {
@@ -30,139 +17,14 @@ export const REQUEST_TYPES: Record<string, RequestType> = {
// ===================== 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;

View File

@@ -48,5 +48,3 @@ export const getQueryRangeV5 = async (
ErrorResponseHandlerV2(error as AxiosError<ErrorV2Resp>);
}
};
export default getQueryRangeV5;

View File

@@ -21,6 +21,7 @@ import { DataSource, ReduceOperators } from 'types/common/queryBuilder';
import {
convertBuilderQueriesToV5,
createAggregation,
mapPanelTypeToRequestType,
prepareQueryRangePayloadV5,
} from './prepareQueryRangePayloadV5';
@@ -1015,3 +1016,47 @@ describe('convertBuilderQueriesToV5 builder query type', () => {
expect(buildEnvelope(builderQueryType, 'trace').type).toBe('builder_query');
});
});
describe('createAggregation fallback', () => {
const logsQuery = (expression: string): Partial<IBuilderQuery> => ({
dataSource: DataSource.LOGS,
aggregations: [{ expression }],
});
it('sends no aggregation for a heatmap with no field', () => {
expect(createAggregation(logsQuery(''), PANEL_TYPES.HEATMAP)).toStrictEqual(
[],
);
});
it('reads a field on a heatmap and turns it into count() elsewhere', () => {
expect(
createAggregation(logsQuery('duration_nano'), PANEL_TYPES.HEATMAP),
).toStrictEqual([{ expression: 'duration_nano' }]);
expect(
createAggregation(logsQuery('duration_nano'), PANEL_TYPES.TIME_SERIES),
).toStrictEqual([{ expression: 'count()' }]);
});
it('still defaults other panels to count()', () => {
expect(
createAggregation(logsQuery(''), PANEL_TYPES.TIME_SERIES),
).toStrictEqual([{ expression: 'count()' }]);
});
it('sends the field of a logs heatmap query', () => {
const [envelope] = convertBuilderQueriesToV5(
{
A: {
...logsQuery('duration_nano'),
queryName: 'A',
} as IBuilderQuery,
},
mapPanelTypeToRequestType(PANEL_TYPES.HEATMAP),
PANEL_TYPES.HEATMAP,
);
expect((envelope.spec as LogBuilderQuery).aggregations).toStrictEqual([
{ expression: 'duration_nano' },
]);
});
});

View File

@@ -5,6 +5,8 @@ import { PANEL_TYPES } from 'constants/queryBuilder';
import { GetQueryResultsProps } from 'lib/dashboard/getQueryResults';
import { foldAISlot } from 'lib/query/builderSlot';
import getStartEndRangeTime from 'lib/getStartEndRangeTime';
import { parseAggregations } from 'lib/query/aggregationExpression';
import { aggregatesDistributionField } from 'lib/query/distributionField';
import { mapQueryDataToApi } from 'lib/newQueryBuilder/queryBuilderMappers/mapQueryDataToApi';
import { isEmpty } from 'lodash-es';
import { DynamicVariableSuggestion } from 'providers/Dashboard/store/dynamicVariableSuggestions';
@@ -240,32 +242,6 @@ function createBaseSpec(
};
}
// Utility to parse aggregation expressions with optional alias
export function parseAggregations(
expression: string,
availableAlias?: string,
): { expression: string; alias?: string }[] {
const result: { expression: string; alias?: string }[] = [];
// Matches function calls like "count()" or "sum(field)" with optional alias like "as 'alias'"
// Handles quoted ('alias'), dash-separated (field-name), and unquoted values after "as" keyword
const regex =
/([a-zA-Z0-9_]+\([^)]*\))(?:\s*as\s+((?:'[^']*'|"[^"]*"|[a-zA-Z0-9_-]+)))?/g;
let match = regex.exec(expression);
while (match !== null) {
const expr = match[1];
let alias = match[2] || availableAlias; // Use provided alias or availableAlias if not matched
if (alias) {
// Remove quotes if present
alias = alias.replace(/^['"]|['"]$/g, '');
result.push({ expression: expr, alias });
} else {
result.push({ expression: expr });
}
match = regex.exec(expression);
}
return result;
}
export function createAggregation(
queryData: any,
panelType?: PANEL_TYPES,
@@ -310,18 +286,28 @@ export function createAggregation(
];
}
// A heatmap buckets the field the user names; count() would be rejected as one.
// Elsewhere a field is not an aggregation, so it falls back to count().
const isDistributionField = aggregatesDistributionField(
panelType,
queryData.dataSource,
);
const fallback = isDistributionField ? [] : [{ expression: 'count()' }];
if (queryData.aggregations?.length > 0) {
return queryData.aggregations.flatMap(
(agg: { expression: string; alias?: string }) => {
const parsedAggregations = parseAggregations(agg.expression, agg?.alias);
return isEmpty(parsedAggregations)
? [{ expression: 'count()' }]
: parsedAggregations;
const parsedAggregations = parseAggregations(
agg.expression,
agg?.alias,
isDistributionField,
);
return isEmpty(parsedAggregations) ? fallback : parsedAggregations;
},
);
}
return [{ expression: 'count()' }];
return fallback;
}
/**

View File

@@ -10,7 +10,7 @@ import { QueryBuilderContextType } from 'types/common/queryBuilder';
import { AppLayer } from './types';
export interface AppPageProvidersProps {
interface AppPageProvidersProps {
children: ReactNode;
layout: AppLayer;
/** When set, replaces `QueryBuilderProvider` with a fixed context value. */

View File

@@ -11,7 +11,7 @@ import TimezoneProvider from 'providers/Timezone';
import { AppLayer } from './types';
export interface AppProvidersProps {
interface AppProvidersProps {
children: ReactNode;
store: Store;
queryClient: QueryClient;

View File

@@ -5,7 +5,7 @@ import { NotificationProvider } from 'hooks/useNotifications';
import { CmdKProvider } from 'providers/cmdKProvider';
import { ErrorModalProvider } from 'providers/ErrorModalProvider';
export interface AppShellProps {
interface AppShellProps {
children: ReactNode;
/** Mounted beside the routed content: the command palette and its siblings. */
overlays?: ReactNode;

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;

View File

@@ -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

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 204 KiB

View File

@@ -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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 194 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 1.7 MiB

View File

@@ -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

View File

@@ -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

View File

@@ -12,4 +12,5 @@
import '@signozhq/design-tokens';
import '@signozhq/icons';
import '@signozhq/noz-client';
import '@signozhq/ui';

View File

@@ -4,7 +4,7 @@ import { Divider } from '@signozhq/ui/divider';
import styles from './AlertBreadcrumb.module.scss';
import BreadcrumbItem, { BreadcrumbItemConfig } from './BreadcrumbItem';
export interface AlertBreadcrumbProps {
interface AlertBreadcrumbProps {
items: BreadcrumbItemConfig[];
className?: string;
showDivider?: boolean;

View File

@@ -1,6 +1 @@
export { default } from './AlertBreadcrumb';
export {
default as BreadcrumbItem,
type BreadcrumbItemConfig,
} from './BreadcrumbItem';
export type { AlertBreadcrumbProps } from './AlertBreadcrumb';

View File

@@ -29,33 +29,6 @@
min-width: 0;
}
.overflowTrigger {
all: unset;
cursor: pointer;
}
.labelPopover {
display: flex;
flex-direction: column;
gap: 6px;
padding: 8px;
max-height: 300px;
overflow-y: auto;
}
.labelTooltip {
display: flex;
flex-direction: column;
gap: 6px;
max-height: 300px;
overflow-y: auto;
}
.labelValue {
text-overflow: ellipsis;
overflow: hidden;
}
.tooltipContent {
display: flex;
align-items: center;

View File

@@ -11,7 +11,7 @@ import LabelTag from './LabelTag';
import styles from './LabelColumn.module.scss';
import { getVisibleCount } from './utils';
export interface LabelColumnProps {
interface LabelColumnProps {
labels: string[];
color?: BadgeColorType;
value?: { [key: string]: string };

View File

@@ -6,7 +6,7 @@ import { useCopyToClipboard } from 'react-use';
import styles from './LabelTag.module.scss';
export interface LabelTagProps {
interface LabelTagProps {
label: string;
color?: BadgeColorType;
value?: string;

View File

@@ -1,2 +1 @@
export { default } from './LabelColumn';
export type { LabelColumnProps } from './LabelColumn';

View File

@@ -1,4 +1,4 @@
export const OVERFLOW_BADGE_WIDTH = 40;
const OVERFLOW_BADGE_WIDTH = 40;
/**
* How many leading labels fit in `available` px, reserving room for the `+N` badge

View File

@@ -1,29 +1,5 @@
import type { BadgeColorType } from '@signozhq/ui/badge';
export const STATE_ORDER = ['firing', 'pending', 'inactive', 'disabled'];
export const SEVERITY_ORDER = ['critical', 'error', 'warning', 'info'];
export const STATE_LABELS: Record<string, string> = {
firing: 'Firing',
pending: 'Pending',
inactive: 'OK',
disabled: 'Disabled',
};
export const STATE_COLORS: Record<string, string> = {
firing: 'var(--bg-cherry-500)',
pending: 'var(--bg-amber-500)',
inactive: 'var(--bg-forest-500)',
disabled: 'var(--l2-foreground)',
};
export const SEVERITY_COLORS: Record<string, string> = {
critical: 'var(--bg-cherry-500)',
error: 'var(--bg-cherry-400)',
warning: 'var(--bg-amber-500)',
info: 'var(--bg-robin-500)',
};
export const SEVERITY_BADGE_COLORS: Record<string, BadgeColorType> = {
critical: 'danger',
error: 'danger',

View File

@@ -33,10 +33,6 @@
.brand-tagline {
margin-bottom: 24px;
.ant-typography {
color: var(--l2-foreground); // Secondary text
}
}
/* HTML: <div class="loader"></div> */

View File

@@ -7,7 +7,7 @@ import { isModifierKeyPressed } from 'utils/app';
import styles from './BackHeader.module.scss';
export interface BackHeaderProps {
interface BackHeaderProps {
/** Where the page came from, named as the place rather than the action. */
backLabel: string;
backRoute: string;

View File

@@ -57,9 +57,5 @@
.ant-drawer-footer {
border-top: 1px solid var(--l1-border);
.footer-text {
color: var(--l2-foreground);
}
}
}

View File

@@ -18,7 +18,7 @@ import { useNavigateToExplorer } from '../useNavigateToExplorer';
import './CeleryTaskDetail.style.scss';
export type CeleryTaskData = {
type CeleryTaskData = {
entity: string;
value: string | number;
timeRange: [number, number];

View File

@@ -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;

View File

@@ -41,7 +41,7 @@ interface TabData {
key: string;
}
export enum CeleryTaskGraphState {
enum CeleryTaskGraphState {
P99 = 'p99',
P95 = 'p95',
P90 = 'p90',

View File

@@ -9,7 +9,7 @@ import SyntaxHighlighter, {
import styles from './CodeBlock.module.scss';
export interface CodeBlockProps {
interface CodeBlockProps {
code: string;
language?: string;
className?: string;

View File

@@ -21,9 +21,4 @@
line-height: var(--paragraph-small-400-line-height);
margin: 0;
}
&__helper {
color: var(--l3-foreground);
margin: calc(var(--spacing-2) * -1) 0 var(--spacing-4) 0;
}
}

View File

@@ -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;

View File

@@ -24,10 +24,4 @@
gap: 4px;
flex-shrink: 0;
}
&__nav {
display: flex;
align-items: center;
gap: 2px;
}
}

View File

@@ -9,7 +9,7 @@ export interface HeaderAction {
component: ReactNode; // check later if we can use direct btn itself or not.
}
export interface DetailsHeaderProps {
interface DetailsHeaderProps {
title: string;
onClose: () => void;
actions?: HeaderAction[];

View File

@@ -1,8 +1,4 @@
export type {
DetailsHeaderProps,
HeaderAction,
} from './DetailsHeader/DetailsHeader';
export type { HeaderAction } from './DetailsHeader/DetailsHeader';
export { default as DetailsHeader } from './DetailsHeader/DetailsHeader';
export { default as DetailsPanelDrawer } from './DetailsPanelDrawer';
export type { DetailsPanelState, UseDetailsPanelOptions } from './types';
export { default as useDetailsPanel } from './useDetailsPanel';

View File

@@ -771,7 +771,11 @@ describe('EditMemberDrawer', () => {
it('keeps roles editable', async () => {
renderDrawer({ member: selfMember });
await expect(screen.findByText('Select roles')).resolves.toBeInTheDocument();
await expect(
screen.findByTestId(
`member-roles-select-chip-${managedRoles[0].id}-remove`,
),
).resolves.toBeInTheDocument();
expect(screen.queryByTestId('member-roles-locked')).not.toBeInTheDocument();
});
});

View File

@@ -1,2 +1 @@
export type { WithErrorBoundaryOptions } from './withErrorBoundary';
export { default as withErrorBoundary } from './withErrorBoundary';

View File

@@ -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);

View File

@@ -12,7 +12,7 @@ export type IntersectionCursorPluginOptions = {
gapSize?: number;
};
export const defaultIntersectionCursorPluginOptions: Required<IntersectionCursorPluginOptions> =
const defaultIntersectionCursorPluginOptions: Required<IntersectionCursorPluginOptions> =
{
color: 'white',
dashSize: 3,

View File

@@ -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 {

View File

@@ -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;
}
}

View File

@@ -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;
}
}

View File

@@ -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);
}
}

View File

@@ -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>
);
}

View File

@@ -87,10 +87,6 @@
justify-content: center;
}
.errorText {
color: var(--danger-background);
}
.addRow {
display: flex;
justify-content: flex-start;

View File

@@ -2,6 +2,7 @@ import { rest, server } from 'mocks-server/server';
import { render, screen, userEvent, waitFor } from 'tests/test-utils';
import InviteMembers from '../InviteMembers';
import { InviteMembersProps } from '../types';
import { pickRole } from './roleSelectUtils';
import {
@@ -9,9 +10,12 @@ import {
createErrorHandler,
createRolesHandler,
createSuccessHandler,
enterInviteEmail,
VALID_EMAIL,
} from './testUtils';
type InviteCallback = Required<InviteMembersProps>['onSuccess'];
describe('InviteMembers - Edge Cases', () => {
beforeEach(() => {
server.use(createRolesHandler(), createSuccessHandler());
@@ -23,7 +27,7 @@ describe('InviteMembers - Edge Cases', () => {
describe('reset behavior', () => {
it('clears all rows when reset is called', async () => {
const user = userEvent.setup({ pointerEventsCheck: 0 });
const user = userEvent.setup();
render(
<InviteMembers
@@ -36,13 +40,12 @@ describe('InviteMembers - Edge Cases', () => {
/>,
);
const emailInputs = screen.getAllByPlaceholderText('e.g. john@signoz.io');
await user.type(emailInputs[0], VALID_EMAIL);
await user.type(emailInputs[1], 'bob@signoz.io');
await enterInviteEmail(user, 0, VALID_EMAIL);
await enterInviteEmail(user, 1, 'bob@signoz.io');
await user.click(screen.getByTestId('reset-btn'));
const resetInputs = screen.getAllByPlaceholderText('e.g. john@signoz.io');
const resetInputs = screen.getAllByTestId(/^invite-email-.*-field$/);
expect(resetInputs).toHaveLength(2);
resetInputs.forEach((input) => {
expect(input).toHaveValue('');
@@ -50,7 +53,7 @@ describe('InviteMembers - Edge Cases', () => {
});
it('clears results on reset', async () => {
const user = userEvent.setup({ pointerEventsCheck: 0 });
const user = userEvent.setup();
render(
<InviteMembers
@@ -67,8 +70,7 @@ describe('InviteMembers - Edge Cases', () => {
/>,
);
const emailInputs = screen.getAllByPlaceholderText('e.g. john@signoz.io');
await user.type(emailInputs[0], VALID_EMAIL);
await enterInviteEmail(user, 0, VALID_EMAIL);
await pickRole(user, 0, 'role-viewer');
await user.click(screen.getByTestId('submit-btn'));
@@ -84,7 +86,7 @@ describe('InviteMembers - Edge Cases', () => {
describe('results cleared on edit', () => {
it('clears API error when email is edited', async () => {
const user = userEvent.setup({ pointerEventsCheck: 0 });
const user = userEvent.setup();
server.use(createErrorHandler('already_exists', 'User already exists'));
@@ -98,8 +100,7 @@ describe('InviteMembers - Edge Cases', () => {
/>,
);
const emailInputs = screen.getAllByPlaceholderText('e.g. john@signoz.io');
await user.type(emailInputs[0], VALID_EMAIL);
await enterInviteEmail(user, 0, VALID_EMAIL);
await pickRole(user, 0, 'role-viewer');
await user.click(screen.getByTestId('submit-btn'));
@@ -107,7 +108,7 @@ describe('InviteMembers - Edge Cases', () => {
screen.findByTestId('invite-api-error'),
).resolves.toBeInTheDocument();
await user.type(emailInputs[0], 'x');
await user.type(screen.getAllByTestId(/^invite-email-.*-field$/)[0], 'x');
await waitFor(() => {
expect(screen.queryByTestId('invite-api-error')).not.toBeInTheDocument();
@@ -115,7 +116,7 @@ describe('InviteMembers - Edge Cases', () => {
});
it('clears API error when role is changed', async () => {
const user = userEvent.setup({ pointerEventsCheck: 0 });
const user = userEvent.setup();
server.use(createErrorHandler('already_exists', 'User already exists'));
@@ -129,8 +130,7 @@ describe('InviteMembers - Edge Cases', () => {
/>,
);
const emailInputs = screen.getAllByPlaceholderText('e.g. john@signoz.io');
await user.type(emailInputs[0], VALID_EMAIL);
await enterInviteEmail(user, 0, VALID_EMAIL);
await pickRole(user, 0, 'role-viewer');
await user.click(screen.getByTestId('submit-btn'));
@@ -148,8 +148,8 @@ describe('InviteMembers - Edge Cases', () => {
describe('empty submission', () => {
it('does not submit when no rows are touched', async () => {
const user = userEvent.setup({ pointerEventsCheck: 0 });
const onSuccess = jest.fn();
const user = userEvent.setup();
const onSuccess = jest.fn() as jest.MockedFunction<InviteCallback>;
render(
<InviteMembers
@@ -170,7 +170,7 @@ describe('InviteMembers - Edge Cases', () => {
describe('submitting state', () => {
it('disables submit while submitting', async () => {
const user = userEvent.setup({ pointerEventsCheck: 0 });
const user = userEvent.setup();
render(
<InviteMembers
@@ -182,8 +182,7 @@ describe('InviteMembers - Edge Cases', () => {
/>,
);
const emailInputs = screen.getAllByPlaceholderText('e.g. john@signoz.io');
await user.type(emailInputs[0], VALID_EMAIL);
await enterInviteEmail(user, 0, VALID_EMAIL);
await pickRole(user, 0, 'role-viewer');
const submitBtn = screen.getByTestId('submit-btn');
@@ -197,7 +196,7 @@ describe('InviteMembers - Edge Cases', () => {
describe('whitespace handling', () => {
it('trims email whitespace before submission', async () => {
const user = userEvent.setup({ pointerEventsCheck: 0 });
const user = userEvent.setup();
const calls: { email: string }[] = [];
server.use(
@@ -218,8 +217,7 @@ describe('InviteMembers - Edge Cases', () => {
/>,
);
const emailInputs = screen.getAllByPlaceholderText('e.g. john@signoz.io');
await user.type(emailInputs[0], ' alice@signoz.io ');
await enterInviteEmail(user, 0, ' alice@signoz.io ');
await pickRole(user, 0, 'role-viewer');
await user.click(screen.getByTestId('submit-btn'));

View File

@@ -2,6 +2,7 @@ import { rest, server } from 'mocks-server/server';
import { render, screen, userEvent, waitFor } from 'tests/test-utils';
import InviteMembers from '../InviteMembers';
import { InviteMembersProps } from '../types';
import { pickRole } from './roleSelectUtils';
import {
@@ -10,9 +11,12 @@ import {
createRolesHandler,
createSuccessHandler,
createTrackingHandler,
enterInviteEmail,
VALID_EMAIL,
} from './testUtils';
type InviteCallback = Required<InviteMembersProps>['onSuccess'];
describe('InviteMembers - Submission', () => {
beforeEach(() => {
server.use(createRolesHandler(), createSuccessHandler());
@@ -24,7 +28,7 @@ describe('InviteMembers - Submission', () => {
describe('API calls', () => {
it('calls createUser API for each touched row', async () => {
const user = userEvent.setup({ pointerEventsCheck: 0 });
const user = userEvent.setup();
const { handler, calls } = createTrackingHandler();
server.use(handler);
@@ -39,8 +43,7 @@ describe('InviteMembers - Submission', () => {
/>,
);
const emailInputs = screen.getAllByPlaceholderText('e.g. john@signoz.io');
await user.type(emailInputs[0], 'alice@signoz.io');
await enterInviteEmail(user, 0, 'alice@signoz.io');
await pickRole(user, 0, 'role-viewer');
await user.click(screen.getByTestId('submit-btn'));
@@ -55,7 +58,7 @@ describe('InviteMembers - Submission', () => {
});
it('calls createUser API for multiple touched rows', async () => {
const user = userEvent.setup({ pointerEventsCheck: 0 });
const user = userEvent.setup();
const { handler, calls } = createTrackingHandler();
server.use(handler);
@@ -70,15 +73,11 @@ describe('InviteMembers - Submission', () => {
/>,
);
const emailInputs = screen.getAllByPlaceholderText('e.g. john@signoz.io');
await user.type(emailInputs[0], 'alice@signoz.io');
await enterInviteEmail(user, 0, 'alice@signoz.io');
await pickRole(user, 0, 'role-viewer');
await user.type(emailInputs[1], 'bob@signoz.io');
await enterInviteEmail(user, 1, 'bob@signoz.io');
await pickRole(user, 1, 'role-editor');
await user.type(emailInputs[2], 'charlie@signoz.io');
await enterInviteEmail(user, 2, 'charlie@signoz.io');
await pickRole(user, 2, 'role-admin');
await user.click(screen.getByTestId('submit-btn'));
@@ -104,8 +103,8 @@ describe('InviteMembers - Submission', () => {
describe('callbacks', () => {
it('calls onSuccess when all invites succeed', async () => {
const user = userEvent.setup({ pointerEventsCheck: 0 });
const onSuccess = jest.fn();
const user = userEvent.setup();
const onSuccess = jest.fn() as jest.MockedFunction<InviteCallback>;
render(
<InviteMembers
@@ -118,8 +117,7 @@ describe('InviteMembers - Submission', () => {
/>,
);
const emailInputs = screen.getAllByPlaceholderText('e.g. john@signoz.io');
await user.type(emailInputs[0], VALID_EMAIL);
await enterInviteEmail(user, 0, VALID_EMAIL);
await pickRole(user, 0, 'role-viewer');
await user.click(screen.getByTestId('submit-btn'));
@@ -130,8 +128,8 @@ describe('InviteMembers - Submission', () => {
});
it('calls onAllFailed when all invites fail', async () => {
const user = userEvent.setup({ pointerEventsCheck: 0 });
const onAllFailed = jest.fn();
const user = userEvent.setup();
const onAllFailed = jest.fn() as jest.MockedFunction<InviteCallback>;
server.use(createErrorHandler('already_exists', 'User already exists'));
@@ -146,8 +144,7 @@ describe('InviteMembers - Submission', () => {
/>,
);
const emailInputs = screen.getAllByPlaceholderText('e.g. john@signoz.io');
await user.type(emailInputs[0], VALID_EMAIL);
await enterInviteEmail(user, 0, VALID_EMAIL);
await pickRole(user, 0, 'role-viewer');
await user.click(screen.getByTestId('submit-btn'));
@@ -166,10 +163,10 @@ describe('InviteMembers - Submission', () => {
});
it('calls onPartialSuccess when some invites succeed and some fail', async () => {
const user = userEvent.setup({ pointerEventsCheck: 0 });
const onPartialSuccess = jest.fn();
const onSuccess = jest.fn();
const onAllFailed = jest.fn();
const user = userEvent.setup();
const onPartialSuccess = jest.fn() as jest.MockedFunction<InviteCallback>;
const onSuccess = jest.fn() as jest.MockedFunction<InviteCallback>;
const onAllFailed = jest.fn() as jest.MockedFunction<InviteCallback>;
const apiCalls: string[] = [];
let callCount = 0;
@@ -208,12 +205,9 @@ describe('InviteMembers - Submission', () => {
/>,
);
const emailInputs = screen.getAllByPlaceholderText('e.g. john@signoz.io');
await user.type(emailInputs[0], 'alice@signoz.io');
await enterInviteEmail(user, 0, 'alice@signoz.io');
await pickRole(user, 0, 'role-viewer');
await user.type(emailInputs[1], 'bob@signoz.io');
await enterInviteEmail(user, 1, 'bob@signoz.io');
await pickRole(user, 1, 'role-editor');
await user.click(screen.getByTestId('submit-btn'));
@@ -252,7 +246,7 @@ describe('InviteMembers - Submission', () => {
describe('result display', () => {
it('shows success callout when all invites succeed', async () => {
const user = userEvent.setup({ pointerEventsCheck: 0 });
const user = userEvent.setup();
render(
<InviteMembers
@@ -264,8 +258,7 @@ describe('InviteMembers - Submission', () => {
/>,
);
const emailInputs = screen.getAllByPlaceholderText('e.g. john@signoz.io');
await user.type(emailInputs[0], VALID_EMAIL);
await enterInviteEmail(user, 0, VALID_EMAIL);
await pickRole(user, 0, 'role-viewer');
await user.click(screen.getByTestId('submit-btn'));
@@ -276,7 +269,7 @@ describe('InviteMembers - Submission', () => {
});
it('shows error callout with failed emails when API fails', async () => {
const user = userEvent.setup({ pointerEventsCheck: 0 });
const user = userEvent.setup();
server.use(createErrorHandler('already_exists', 'User already exists'));
@@ -290,8 +283,7 @@ describe('InviteMembers - Submission', () => {
/>,
);
const emailInputs = screen.getAllByPlaceholderText('e.g. john@signoz.io');
await user.type(emailInputs[0], VALID_EMAIL);
await enterInviteEmail(user, 0, VALID_EMAIL);
await pickRole(user, 0, 'role-viewer');
await user.click(screen.getByTestId('submit-btn'));
@@ -305,7 +297,7 @@ describe('InviteMembers - Submission', () => {
describe('footer props', () => {
it('provides correct canSubmit state', async () => {
const user = userEvent.setup({ pointerEventsCheck: 0 });
const user = userEvent.setup();
render(
<InviteMembers
@@ -319,14 +311,13 @@ describe('InviteMembers - Submission', () => {
expect(screen.getByTestId('submit-btn')).toBeDisabled();
const emailInputs = screen.getAllByPlaceholderText('e.g. john@signoz.io');
await user.type(emailInputs[0], VALID_EMAIL);
await enterInviteEmail(user, 0, VALID_EMAIL);
expect(screen.getByTestId('submit-btn')).not.toBeDisabled();
});
it('provides touchedCount', async () => {
const user = userEvent.setup({ pointerEventsCheck: 0 });
const user = userEvent.setup();
render(
<InviteMembers
@@ -339,12 +330,11 @@ describe('InviteMembers - Submission', () => {
expect(screen.getByTestId('touched-count')).toHaveTextContent('0');
const emailInputs = screen.getAllByPlaceholderText('e.g. john@signoz.io');
await user.type(emailInputs[0], 'a@b.com');
await enterInviteEmail(user, 0, 'a@b.com');
expect(screen.getByTestId('touched-count')).toHaveTextContent('1');
await user.type(emailInputs[1], 'c@d.com');
await enterInviteEmail(user, 1, 'c@d.com');
expect(screen.getByTestId('touched-count')).toHaveTextContent('2');
});

View File

@@ -4,7 +4,7 @@ const ROLE_TRIGGER_TEST_ID = /^invite-role-[0-9a-f-]{36}$/;
type User = ReturnType<typeof userEvent.setup>;
export function getRoleTrigger(rowIndex: number): HTMLElement {
function getRoleTrigger(rowIndex: number): HTMLElement {
return screen.getAllByTestId(ROLE_TRIGGER_TEST_ID)[rowIndex];
}

View File

@@ -1,10 +1,13 @@
import { RestHandler } from 'msw';
import { rest } from 'mocks-server/server';
import { screen, userEvent } from 'tests/test-utils';
type User = ReturnType<typeof userEvent.setup>;
export const CREATE_USER_ENDPOINT = '*/api/v2/users';
export const LIST_ROLES_ENDPOINT = '*/api/v1/roles';
const LIST_ROLES_ENDPOINT = '*/api/v1/roles';
export const MOCK_ROLES = [
const MOCK_ROLES = [
{ id: 'role-admin', name: 'Admin', description: 'Admin role' },
{ id: 'role-editor', name: 'Editor', description: 'Editor role' },
{ id: 'role-viewer', name: 'Viewer', description: 'Viewer role' },
@@ -52,3 +55,12 @@ export function createTrackingHandler(): {
});
return { handler, calls };
}
export async function enterInviteEmail(
user: User,
rowIndex: number,
email: string,
): Promise<void> {
await user.click(screen.getAllByTestId(/^invite-email-.*-field$/)[rowIndex]);
await user.paste(email);
}

View File

@@ -12,7 +12,7 @@ export interface InviteResult {
error?: string;
}
export interface FooterRenderProps {
interface FooterRenderProps {
submit: () => Promise<InviteResult[]>;
reset: () => void;
canSubmit: boolean;

View File

@@ -12,7 +12,7 @@ import { useAppContext } from 'providers/App/App';
import './LaunchChatSupport.styles.scss';
export interface LaunchChatSupportProps {
interface LaunchChatSupportProps {
eventName: string;
attributes: Record<string, unknown>;
message?: string;

View File

@@ -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
`;

View File

@@ -24,11 +24,6 @@
flex-wrap: wrap;
}
.filtersLabel {
color: var(--l2-foreground);
margin-right: 2px;
}
.filterControls {
display: flex;
align-items: center;

View File

@@ -31,7 +31,7 @@ interface Props {
placeholder?: string;
// Rendered at the end of the search row (e.g. the New Dashboard action).
rightSlot?: ReactNode;
// Rendered in the filters row after the chips. A function receives the draft.
// Rendered in the filters row before the chips. A function receives the draft.
extraFilters?: ReactNode | ((api: ExtraFiltersApi) => ReactNode);
// Shows Clear even when the query is empty.
hasExtraFilters?: boolean;
@@ -142,6 +142,9 @@ function FilterZone({
className={styles.filterControls}
data-testid={`${testIdPrefix}-filter-zone`}
>
{typeof extraFilters === 'function'
? extraFilters({ draft, applyDraft, setDraft })
: extraFilters}
<FilterChips
{...createdByProps}
updated={reflected.updated}
@@ -150,9 +153,6 @@ function FilterZone({
onApply={run}
disabled={disabled}
/>
{typeof extraFilters === 'function'
? extraFilters({ draft, applyDraft, setDraft })
: extraFilters}
{(!isEmpty || hasExtraFilters) && (
<Button
disabledTooltip={undefined}

View File

@@ -43,6 +43,7 @@ function MultiSelectFilter({
allowClear
className={cx(styles.select, styles.selectWide)}
placeholder={placeholder}
aria-label={placeholder}
value={value}
options={options}
optionFilterProp="label"
@@ -52,7 +53,10 @@ function MultiSelectFilter({
disabled={disabled}
onClear={onClear}
optionRender={(option): JSX.Element => (
<div className={styles.checkOption}>
<div
className={styles.checkOption}
data-testid={`${testId}-option-${String(option.value)}`}
>
<div className={styles.checkOptionBox}>
<Checkbox
color="primary"

View File

@@ -1,4 +1,10 @@
import { type MouseEvent, useCallback, useMemo, useRef } from 'react';
import {
type FocusEvent,
type MouseEvent,
useCallback,
useMemo,
useRef,
} from 'react';
import {
autocompletion,
closeCompletion,
@@ -27,7 +33,7 @@ import styles from './SearchBar.module.scss';
interface Props {
value: string;
grammar: DslGrammar;
// Ids: `${testIdPrefix}`, `-submit`, `-dirty`.
// Ids: `${testIdPrefix}`, `-field` (the editable area), `-submit`, `-dirty`.
testIdPrefix: string;
onChange: (value: string) => void;
onSubmit: () => void;
@@ -67,10 +73,25 @@ function SearchBar({
const onSubmitRef = useRef(handleSubmit);
onSubmitRef.current = handleSubmit;
// Leaving the box runs an unrun draft, e.g. terms picked from the suggestions.
// A blur from switching windows or tabs does not.
const handleBlur = useCallback(
(event: FocusEvent<HTMLDivElement>): void => {
const stillInside = event.currentTarget.contains(
event.relatedTarget as Node | null,
);
if (!stillInside && dirty && !disabled && document.hasFocus()) {
handleSubmit();
}
},
[dirty, disabled, handleSubmit],
);
const extensions = useMemo(
() => [
dslHighlight,
editorTheme,
EditorView.contentAttributes.of({ 'data-testid': `${testIdPrefix}-field` }),
// Wrap a long query onto the next line instead of scrolling horizontally.
EditorView.lineWrapping,
// Read-only is not enough: these open the list on click and accepting an
@@ -122,12 +143,15 @@ function SearchBar({
]),
),
],
[disabled],
[disabled, testIdPrefix],
);
return (
<div className={styles.wrapper}>
<div className={cx(styles.field, { [styles.disabled]: disabled })}>
<div
className={cx(styles.field, { [styles.disabled]: disabled })}
onBlur={handleBlur}
>
<Search
size={12}
color={Color.BG_VANILLA_400}

View File

@@ -0,0 +1,101 @@
import type { ComponentProps } from 'react';
import { render, screen, userEvent } from 'tests/test-utils';
import type { DslGrammar } from '../../dsl/types';
import SearchBar from '../SearchBar';
type SearchBarProps = ComponentProps<typeof SearchBar>;
const GRAMMAR: DslGrammar = {
fields: [{ key: 'name', type: 'string' }],
dynamicKey: { detail: 'tag', prefix: '' },
};
function renderSearchBar(props: { dirty: boolean; disabled?: boolean }): {
onSubmit: jest.MockedFunction<SearchBarProps['onSubmit']>;
onSubmitted: jest.MockedFunction<NonNullable<SearchBarProps['onSubmitted']>>;
} {
const onSubmit = jest.fn() as jest.MockedFunction<SearchBarProps['onSubmit']>;
const onSubmitted = jest.fn() as jest.MockedFunction<
NonNullable<SearchBarProps['onSubmitted']>
>;
render(
<>
<SearchBar
value="name = 'x'"
grammar={GRAMMAR}
testIdPrefix="list-search"
onChange={jest.fn()}
onSubmit={onSubmit}
onSubmitted={onSubmitted}
dirty={props.dirty}
disabled={props.disabled}
/>
<button type="button" data-testid="outside">
outside
</button>
</>,
);
return { onSubmit, onSubmitted };
}
function searchContent(): HTMLElement {
return screen
.getByTestId('list-search')
.querySelector('.cm-content') as HTMLElement;
}
describe('SearchBar — run on blur', () => {
let hasFocus: jest.SpyInstance<boolean, []>;
beforeEach(() => {
// jsdom reports no focus once it leaves the editor; a focused browser window does.
hasFocus = jest.spyOn(document, 'hasFocus').mockReturnValue(true);
});
afterEach(() => {
jest.restoreAllMocks();
});
it('runs an unrun draft when focus leaves the box', async () => {
const user = userEvent.setup({ pointerEventsCheck: 0 });
const { onSubmit, onSubmitted } = renderSearchBar({ dirty: true });
await user.click(searchContent());
await user.click(screen.getByTestId('outside'));
expect(onSubmit).toHaveBeenCalledTimes(1);
expect(onSubmitted).toHaveBeenCalledWith(true);
});
it('does nothing when the draft was already run', async () => {
const user = userEvent.setup({ pointerEventsCheck: 0 });
const { onSubmit } = renderSearchBar({ dirty: false });
await user.click(searchContent());
await user.click(screen.getByTestId('outside'));
expect(onSubmit).not.toHaveBeenCalled();
});
it('does nothing when focus leaves the window', async () => {
const user = userEvent.setup({ pointerEventsCheck: 0 });
const { onSubmit } = renderSearchBar({ dirty: true });
await user.click(searchContent());
hasFocus.mockReturnValue(false);
await user.click(screen.getByTestId('outside'));
expect(onSubmit).not.toHaveBeenCalled();
});
it('runs once when Run query is clicked with an unrun draft', async () => {
const user = userEvent.setup({ pointerEventsCheck: 0 });
const { onSubmit } = renderSearchBar({ dirty: true });
await user.click(searchContent());
await user.click(screen.getByTestId('list-search-submit'));
expect(onSubmit).toHaveBeenCalledTimes(1);
});
});

Some files were not shown because too many files have changed in this diff Show More