mirror of
https://github.com/SigNoz/signoz.git
synced 2026-12-03 13:40:42 +00:00
Compare commits
11 Commits
perf/web-i
...
feat/affec
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d3b573be22 | ||
|
|
86d9862462 | ||
|
|
c2c0f0a766 | ||
|
|
455e667378 | ||
|
|
e1346d7e9c | ||
|
|
fe0f68589a | ||
|
|
f927b80f64 | ||
|
|
7a480086c7 | ||
|
|
a343edecdf | ||
|
|
8d728170ce | ||
|
|
bec18c6abf |
@@ -113,10 +113,11 @@ CI runs each play once, with its story's own args. Anyone can flip a control in
|
||||
Before writing the clicks, list what has to be on screen for the play's target to exist. Then walk every control the story exposes, the page's own as well as the shared ones, and return early for each value that takes something on that list away. These are the cases plays have missed:
|
||||
|
||||
- An arg the story sets. The story sets it because the play needs what that value renders, and the panel can flip it. On the `mine` view the dashboards Created-by filter opens with a tag to remove; on the other views it opens empty and there is no × to click. Check the tag is there by parsing the route the view resolves to.
|
||||
- The controls every story has. `State` on loading or error renders no rows and no filter suggestions. `Access`, `Permissions` and `Revoked` remove rows, row actions and gated buttons, and the `editor` and `viewer` presets grant telemetry reads only, so a page gated on its own resource shows them nothing. `Check state` on loading disables every gated control, and on error an `AuthZButton` stays enabled while an `AuthZGuardContent` set to fail closed hides what it wraps. `License` and `Banner` decide the plan, so a cloud-only form is gone on the others. `Hold tooltips open` shows a label a second time, inside its tooltip.
|
||||
- The controls every story has. `State` on loading or error renders no rows and no filter suggestions. `Access`, `Permissions` and `Revoked` remove rows, row actions and gated buttons, and the `editor` and `viewer` presets grant telemetry reads only, so a page gated on its own resource shows them nothing. `Check state` on loading disables every gated control, and on error an `AuthZButton` stays enabled while an `AuthZGuardContent` set to fail closed hides what it wraps. `License` and `Banner` decide the plan, so a cloud-only form is gone on the others. `Hold tooltips open` shows a label a second time, inside its tooltip, and fails any check that no tooltip is open.
|
||||
- A count at 0. The page can swap its whole list for an empty state, and the header, filters and column picker go with it.
|
||||
- A view, filter or invalid query that leaves no rows, even when the count is above 0.
|
||||
- A tab without the widget. A filter box that one tab has is not on the next.
|
||||
- A control that moves the widget out of the canvas. Trace details with `Panel position` on dialog renders span details in a floating panel under `document.body`, so a lookup `within(canvasElement)` never finds its tabs. Return early for that value, or search with `screen`.
|
||||
- A second list beside the main one, such as saved views. At 0, loading or failed, its actions are gone.
|
||||
- Text that depends on an arg. A disabled rule offers Enable, not Disable. A write that fails raises a different toast from one that lands, and one left loading raises none. Pick the expected text from the args.
|
||||
- Rows that move. A view, a sort or pinning changes which row is locked, pinned or legacy, so find the row by what it is, not by its index.
|
||||
|
||||
@@ -13065,6 +13065,12 @@ components:
|
||||
additionalProperties: {}
|
||||
description: All of them for a span read by ID; the selected ones in a list.
|
||||
type: object
|
||||
db_name:
|
||||
description: Omitted when empty, and in a list unless selected.
|
||||
type: string
|
||||
db_operation:
|
||||
description: Omitted when empty, and in a list unless selected.
|
||||
type: string
|
||||
duration_nano:
|
||||
minimum: 0
|
||||
type: integer
|
||||
@@ -13073,8 +13079,26 @@ components:
|
||||
items:
|
||||
$ref: '#/components/schemas/SpantypesEvent'
|
||||
type: array
|
||||
external_http_method:
|
||||
description: Method of an outgoing HTTP call. Omitted when empty, and in
|
||||
a list unless selected.
|
||||
type: string
|
||||
external_http_url:
|
||||
description: Host of an outgoing HTTP call. Omitted when empty, and in a
|
||||
list unless selected.
|
||||
type: string
|
||||
has_error:
|
||||
type: boolean
|
||||
http_host:
|
||||
description: Host or server address. Omitted when empty, and in a list unless
|
||||
selected.
|
||||
type: string
|
||||
http_method:
|
||||
description: Omitted when empty, and in a list unless selected.
|
||||
type: string
|
||||
http_url:
|
||||
description: Omitted when empty, and in a list unless selected.
|
||||
type: string
|
||||
kind_string:
|
||||
description: For example Server, Client or Internal.
|
||||
type: string
|
||||
@@ -13097,6 +13121,11 @@ components:
|
||||
response_status_code:
|
||||
description: HTTP or gRPC status code, for example 404.
|
||||
type: string
|
||||
scope:
|
||||
allOf:
|
||||
- $ref: '#/components/schemas/SpantypesScope'
|
||||
description: Instrumentation scope. Omitted when empty, and in a list unless
|
||||
selected.
|
||||
span_id:
|
||||
type: string
|
||||
status_code_string:
|
||||
@@ -13110,6 +13139,9 @@ components:
|
||||
type: integer
|
||||
trace_id:
|
||||
type: string
|
||||
trace_state:
|
||||
description: W3C trace state. Omitted when empty, and in a list unless selected.
|
||||
type: string
|
||||
required:
|
||||
- span_id
|
||||
- trace_id
|
||||
@@ -14496,8 +14528,9 @@ paths:
|
||||
x-signoz-stability: alpha
|
||||
/api/v1/channels:
|
||||
get:
|
||||
deprecated: false
|
||||
description: This endpoint lists all notification channels for the organization
|
||||
deprecated: true
|
||||
description: 'Deprecated: use GET /api/v2/notification_channels instead. This
|
||||
endpoint lists all notification channels for the organization'
|
||||
operationId: ListChannels
|
||||
responses:
|
||||
"200":
|
||||
@@ -14544,8 +14577,9 @@ paths:
|
||||
- channels
|
||||
x-signoz-stability: alpha
|
||||
post:
|
||||
deprecated: false
|
||||
description: This endpoint creates a notification channel
|
||||
deprecated: true
|
||||
description: 'Deprecated: use POST /api/v2/notification_channels instead. This
|
||||
endpoint creates a notification channel'
|
||||
operationId: CreateChannel
|
||||
requestBody:
|
||||
content:
|
||||
@@ -14602,8 +14636,9 @@ paths:
|
||||
x-signoz-stability: alpha
|
||||
/api/v1/channels/{id}:
|
||||
delete:
|
||||
deprecated: false
|
||||
description: This endpoint deletes a notification channel by ID
|
||||
deprecated: true
|
||||
description: 'Deprecated: use DELETE /api/v2/notification_channels/{id} instead.
|
||||
This endpoint deletes a notification channel by ID'
|
||||
operationId: DeleteChannelByID
|
||||
parameters:
|
||||
- in: path
|
||||
@@ -14648,8 +14683,9 @@ paths:
|
||||
- channels
|
||||
x-signoz-stability: alpha
|
||||
get:
|
||||
deprecated: false
|
||||
description: This endpoint returns a notification channel by ID
|
||||
deprecated: true
|
||||
description: 'Deprecated: use GET /api/v2/notification_channels/{id} instead.
|
||||
This endpoint returns a notification channel by ID'
|
||||
operationId: GetChannelByID
|
||||
parameters:
|
||||
- in: path
|
||||
@@ -14706,8 +14742,9 @@ paths:
|
||||
- channels
|
||||
x-signoz-stability: alpha
|
||||
put:
|
||||
deprecated: false
|
||||
description: This endpoint updates a notification channel by ID
|
||||
deprecated: true
|
||||
description: 'Deprecated: use PUT /api/v2/notification_channels/{id} instead.
|
||||
This endpoint updates a notification channel by ID'
|
||||
operationId: UpdateChannelByID
|
||||
parameters:
|
||||
- in: path
|
||||
@@ -14764,8 +14801,9 @@ paths:
|
||||
x-signoz-stability: alpha
|
||||
/api/v1/channels/test:
|
||||
post:
|
||||
deprecated: false
|
||||
description: This endpoint tests a notification channel by sending a test notification
|
||||
deprecated: true
|
||||
description: 'Deprecated: use POST /api/v2/notification_channels/test instead.
|
||||
This endpoint tests a notification channel by sending a test notification'
|
||||
operationId: TestChannel
|
||||
requestBody:
|
||||
content:
|
||||
|
||||
@@ -53,6 +53,7 @@ const EXCLUDED_PLUGINS = [
|
||||
'vite-plugin-checker',
|
||||
'dev-base-path',
|
||||
'dev-boot-data',
|
||||
'signoz:inline-boot-guard',
|
||||
'vite-plugin-compression',
|
||||
];
|
||||
|
||||
|
||||
@@ -42,7 +42,10 @@ const config: Config.InitialOptions = {
|
||||
'<rootDir>/node_modules/@signozhq/$1/dist/$1.js',
|
||||
},
|
||||
extensionsToTreatAsEsm: ['.ts'],
|
||||
testMatch: ['<rootDir>/src/**/*?(*.)(test).(ts|js)?(x)'],
|
||||
testMatch: [
|
||||
'<rootDir>/src/**/*?(*.)(test).(ts|js)?(x)',
|
||||
'<rootDir>/vite-plugins/**/*.test.ts',
|
||||
],
|
||||
preset: 'ts-jest/presets/js-with-ts-esm',
|
||||
transform: {
|
||||
'^.+\\.(ts|tsx)?$': [
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
"commitlint": "commitlint --edit $1",
|
||||
"test": "jest",
|
||||
"test:changedsince": "jest --changedSince=main --coverage --silent",
|
||||
"test:affected": "node scripts/affected-tests.mjs",
|
||||
"generate:api": "orval --config ./orval.config.ts && sh scripts/post-types-generation.sh",
|
||||
"generate:config:web-settings": "json2ts ./src/schemas/generated/webSettings.schema.json -o src/types/generated/webSettings.ts --style.useTabs --style.tabWidth=1 --style.singleQuote --bannerComment '/* AUTO GENERATED FILE - DO NOT EDIT - GENERATED FROM frontend/src/schemas/generated/webSettings.schema.json */'",
|
||||
"build:geo-outlines": "node scripts/geo-outlines/build.mjs"
|
||||
|
||||
210
frontend/scripts/affected-tests.mjs
Normal file
210
frontend/scripts/affected-tests.mjs
Normal file
@@ -0,0 +1,210 @@
|
||||
#!/usr/bin/env node
|
||||
// Usage: node scripts/affected-tests.mjs [--suite unit|storybook|e2e|all] [--base <ref>] [--list] [-- <runner args>]
|
||||
import path from 'node:path';
|
||||
|
||||
import {
|
||||
E2E,
|
||||
e2eIndex,
|
||||
specsImporting,
|
||||
specsVisiting,
|
||||
} from './affected/e2e.mjs';
|
||||
import {
|
||||
REPO,
|
||||
changedFiles,
|
||||
changedPackages,
|
||||
git,
|
||||
importersOf,
|
||||
} from './affected/git.mjs';
|
||||
import { FRONTEND, pnpm, relatedFiles } from './affected/jestGraph.mjs';
|
||||
import { log } from './affected/log.mjs';
|
||||
import { SHELL_ENTRY, pageEntries } from './affected/routes.mjs';
|
||||
|
||||
const SHARED = String.raw`^frontend/(pnpm-lock\.yaml|pnpm-workspace\.yaml|tsconfig.*\.json)$`;
|
||||
|
||||
// Any change here can affect every test of the suite, so the import graph cannot narrow it.
|
||||
const RUN_ALL = {
|
||||
unit: [
|
||||
SHARED,
|
||||
String.raw`^frontend/(jest\.\w+\.\w+|babel\.config\.cjs)$`,
|
||||
'^frontend/(__mocks__|src/__tests__)/',
|
||||
],
|
||||
storybook: [
|
||||
SHARED,
|
||||
String.raw`^frontend/vite\.config\.ts$`,
|
||||
'^frontend/(\\.storybook|src/storybook/mocks|vite-plugins)/',
|
||||
],
|
||||
e2e: [
|
||||
SHARED,
|
||||
String.raw`^frontend/(vite\.config\.ts|index\.html)$`,
|
||||
'^frontend/vite-plugins/',
|
||||
String.raw`^tests/e2e/(package\.json|pnpm-lock\.yaml|playwright\.config\.ts|tsconfig\.json)$`,
|
||||
'^tests/e2e/bootstrap/',
|
||||
],
|
||||
};
|
||||
|
||||
const STORY_MATCH = [
|
||||
'<rootDir>/src/**/*.stories.ts',
|
||||
'<rootDir>/src/**/*.stories.tsx',
|
||||
];
|
||||
const SHELL_SPEC_DIRS = ['app-shell', 'routing'];
|
||||
|
||||
function parseArgs(argv) {
|
||||
const sep = argv.indexOf('--');
|
||||
const own = sep === -1 ? argv : argv.slice(0, sep);
|
||||
const opts = {
|
||||
base: 'origin/main',
|
||||
list: false,
|
||||
suite: 'unit',
|
||||
extra: sep === -1 ? [] : argv.slice(sep + 1),
|
||||
};
|
||||
for (let i = 0; i < own.length; i++) {
|
||||
if (own[i] === '--base') {
|
||||
opts.base = own[++i];
|
||||
} else if (own[i] === '--suite') {
|
||||
opts.suite = own[++i];
|
||||
} else if (own[i] === '--list') {
|
||||
opts.list = true;
|
||||
}
|
||||
}
|
||||
return opts;
|
||||
}
|
||||
|
||||
// src/pages/DashboardPage/x/y.test.tsx -> pages/DashboardPage
|
||||
function srcFeature(file) {
|
||||
const parts = path.relative(path.join(FRONTEND, 'src'), file).split(path.sep);
|
||||
return parts.length > 2 ? `${parts[0]}/${parts[1]}` : parts[0];
|
||||
}
|
||||
|
||||
function printGroups(title, files, feature) {
|
||||
const groups = Object.entries(Object.groupBy(files, feature)).sort(
|
||||
(a, b) => b[1].length - a[1].length,
|
||||
);
|
||||
log(`\n[${title}] ${groups.length} features, ${files.length} files:`);
|
||||
groups.forEach(([name, list]) =>
|
||||
log(` ${String(list.length).padStart(4)} ${name}`),
|
||||
);
|
||||
}
|
||||
|
||||
// Swaps a dependency-only package.json bump for the source files that import the bumped packages.
|
||||
function expandBumps(files, mergeBase) {
|
||||
if (!files.includes('frontend/package.json')) {
|
||||
return { files };
|
||||
}
|
||||
const pkgs = changedPackages(mergeBase, 'frontend/package.json');
|
||||
if (!pkgs) {
|
||||
return {
|
||||
files,
|
||||
reason: 'frontend/package.json changed beyond dependency versions',
|
||||
};
|
||||
}
|
||||
log(`\nBumped packages: ${pkgs.join(', ')}`);
|
||||
const rest = files.filter(
|
||||
(f) => f !== 'frontend/package.json' && f !== 'frontend/pnpm-lock.yaml',
|
||||
);
|
||||
return {
|
||||
files: [
|
||||
...new Set([
|
||||
...rest,
|
||||
...pkgs.flatMap((p) => importersOf(p, 'frontend/src')),
|
||||
]),
|
||||
],
|
||||
};
|
||||
}
|
||||
|
||||
const planners = {
|
||||
unit: (src) => ({ files: relatedFiles(src), feature: srcFeature }),
|
||||
storybook: (src) => ({
|
||||
files: relatedFiles(src, STORY_MATCH),
|
||||
feature: srcFeature,
|
||||
}),
|
||||
e2e: (src, changed) => {
|
||||
const pages = pageEntries();
|
||||
const hit = new Set(
|
||||
relatedFiles(src, [...pages.map((p) => p.file), SHELL_ENTRY]),
|
||||
);
|
||||
const routes = pages.filter((p) => hit.has(p.file)).flatMap((p) => p.paths);
|
||||
log(
|
||||
`\n[e2e] routes reached: ${routes.join(' ') || 'none'}${hit.has(SHELL_ENTRY) ? ' + app shell' : ''}`,
|
||||
);
|
||||
const index = e2eIndex(pages.flatMap((p) => p.paths));
|
||||
const shell = hit.has(SHELL_ENTRY)
|
||||
? index.specs.filter((s) => SHELL_SPEC_DIRS.includes(index.feature(s)))
|
||||
: [];
|
||||
const own = specsImporting(
|
||||
index,
|
||||
changed.filter((f) => f.startsWith('tests/e2e/')),
|
||||
);
|
||||
return {
|
||||
files: [...new Set([...specsVisiting(index, routes), ...own, ...shell])],
|
||||
feature: index.feature,
|
||||
};
|
||||
},
|
||||
};
|
||||
|
||||
const runners = {
|
||||
unit: (files, extra) =>
|
||||
pnpm(
|
||||
['exec', 'jest', ...(files ? ['--runTestsByPath', ...files] : []), ...extra],
|
||||
FRONTEND,
|
||||
),
|
||||
storybook: (files, extra) =>
|
||||
pnpm(
|
||||
[
|
||||
'test:storybook',
|
||||
...(files ?? []).map((f) => path.relative(FRONTEND, f)),
|
||||
...extra,
|
||||
],
|
||||
FRONTEND,
|
||||
),
|
||||
e2e: (files, extra) =>
|
||||
pnpm(
|
||||
[
|
||||
'exec',
|
||||
'playwright',
|
||||
'test',
|
||||
...(files ?? []).map((f) => path.relative(E2E, f)),
|
||||
...extra,
|
||||
],
|
||||
E2E,
|
||||
),
|
||||
};
|
||||
|
||||
function runSuite(suite, changed, bumpReason, src, opts) {
|
||||
const trigger = changed.find((f) =>
|
||||
RUN_ALL[suite].some((re) => new RegExp(re).test(f)),
|
||||
);
|
||||
const reason = bumpReason ?? (trigger && `${trigger} affects every test`);
|
||||
if (reason) {
|
||||
log(`\n[${suite}] ${reason}; running the full suite.`);
|
||||
return opts.list ? 0 : runners[suite](null, opts.extra).status;
|
||||
}
|
||||
const { files, feature } = planners[suite](src, changed);
|
||||
printGroups(suite, files, feature);
|
||||
if (opts.list || !files.length) {
|
||||
return 0;
|
||||
}
|
||||
return runners[suite](files, opts.extra).status;
|
||||
}
|
||||
|
||||
const opts = parseArgs(process.argv.slice(2));
|
||||
const mergeBase = git('merge-base', opts.base, 'HEAD');
|
||||
const original = changedFiles(mergeBase);
|
||||
if (!original.length) {
|
||||
log(`No frontend or e2e changes since ${opts.base}.`);
|
||||
process.exit(0);
|
||||
}
|
||||
log(`Changed files since ${opts.base} (${original.length}):`);
|
||||
original.forEach((f) => log(` ${f}`));
|
||||
|
||||
const { files: changed, reason: bumpReason } = expandBumps(original, mergeBase);
|
||||
const src = changed
|
||||
.filter((f) => f.startsWith('frontend/'))
|
||||
.map((f) => path.join(REPO, f));
|
||||
const suites = opts.suite === 'all' ? Object.keys(planners) : [opts.suite];
|
||||
const failed = suites.filter(
|
||||
(s) => runSuite(s, changed, bumpReason, src, opts) !== 0,
|
||||
);
|
||||
if (failed.length) {
|
||||
log(`\nFailed: ${failed.join(', ')}`);
|
||||
}
|
||||
process.exit(failed.length ? 1 : 0);
|
||||
107
frontend/scripts/affected/e2e.mjs
Normal file
107
frontend/scripts/affected/e2e.mjs
Normal file
@@ -0,0 +1,107 @@
|
||||
import { existsSync, readdirSync, readFileSync } from 'node:fs';
|
||||
import path from 'node:path';
|
||||
|
||||
import { REPO } from './git.mjs';
|
||||
|
||||
export const E2E = path.join(REPO, 'tests/e2e');
|
||||
|
||||
// A driver used by this many features is infrastructure; its URLs say nothing about a spec's pages.
|
||||
const SHARED_FEATURE_COUNT = 5;
|
||||
|
||||
const feature = (spec) =>
|
||||
path.relative(path.join(E2E, 'tests'), spec).split(path.sep)[0];
|
||||
|
||||
function listSpecs(dir = path.join(E2E, 'tests')) {
|
||||
return readdirSync(dir, { withFileTypes: true }).flatMap((d) => {
|
||||
const full = path.join(dir, d.name);
|
||||
if (d.isDirectory()) {
|
||||
return listSpecs(full);
|
||||
}
|
||||
return d.name.endsWith('.spec.ts') ? [full] : [];
|
||||
});
|
||||
}
|
||||
|
||||
function localImports(file) {
|
||||
const body = readFileSync(file, 'utf8');
|
||||
return [...body.matchAll(/(?:from|import)\s+'(\.[^']+)'/g)]
|
||||
.map(([, spec]) => path.resolve(path.dirname(file), spec))
|
||||
.map((base) =>
|
||||
[base, `${base}.ts`, `${base}/index.ts`].find(
|
||||
(f) => f.endsWith('.ts') && existsSync(f),
|
||||
),
|
||||
)
|
||||
.filter((f) => f?.startsWith(E2E));
|
||||
}
|
||||
|
||||
function closure(spec) {
|
||||
const seen = new Set();
|
||||
const visit = (f) => {
|
||||
if (seen.has(f)) {
|
||||
return;
|
||||
}
|
||||
seen.add(f);
|
||||
localImports(f).forEach(visit);
|
||||
};
|
||||
visit(spec);
|
||||
return seen;
|
||||
}
|
||||
|
||||
function routeRegex(route, nested) {
|
||||
const body = route.replace(/\/$/, '').replace(/:[^/]+/g, '[^/]+');
|
||||
return new RegExp(`^${body}${nested ? '(/.*)?' : '/?'}$`);
|
||||
}
|
||||
|
||||
// The routes a URL literal from a spec lands on; `/dashboard/` comes from `/dashboard/${id}`.
|
||||
function routesFor(literal, routes) {
|
||||
const probe = literal.endsWith('/') ? `${literal}x` : literal;
|
||||
const exact = routes.filter((r) => routeRegex(r, false).test(probe));
|
||||
if (exact.length) {
|
||||
return exact;
|
||||
}
|
||||
const nested = routes.filter((r) => routeRegex(r, true).test(probe));
|
||||
return nested.sort((a, b) => b.length - a.length).slice(0, 1);
|
||||
}
|
||||
|
||||
export function e2eIndex(routes) {
|
||||
const specs = listSpecs();
|
||||
const deps = new Map(specs.map((s) => [s, closure(s)]));
|
||||
const users = new Map();
|
||||
for (const [spec, files] of deps) {
|
||||
files.forEach((f) =>
|
||||
users.set(f, new Set([...(users.get(f) ?? []), feature(spec)])),
|
||||
);
|
||||
}
|
||||
const shared = new Set(
|
||||
[...users]
|
||||
.filter(([, feats]) => feats.size >= SHARED_FEATURE_COUNT)
|
||||
.map(([f]) => f),
|
||||
);
|
||||
const specRoutes = new Map(
|
||||
specs.map((spec) => {
|
||||
const own = [...deps.get(spec)].filter((f) => f === spec || !shared.has(f));
|
||||
const literals = own.flatMap((f) =>
|
||||
[...readFileSync(f, 'utf8').matchAll(/['"`](\/[a-z][a-z0-9/_-]*)/gi)].map(
|
||||
([, l]) => l,
|
||||
),
|
||||
);
|
||||
const hit = literals
|
||||
.filter((l) => !l.startsWith('/api/'))
|
||||
.flatMap((l) => routesFor(l, routes));
|
||||
return [spec, new Set(hit)];
|
||||
}),
|
||||
);
|
||||
return { specs, deps, specRoutes, feature };
|
||||
}
|
||||
|
||||
export function specsImporting(index, files) {
|
||||
const abs = new Set(files.map((f) => path.join(REPO, f)));
|
||||
return index.specs.filter((s) =>
|
||||
[...index.deps.get(s)].some((f) => abs.has(f)),
|
||||
);
|
||||
}
|
||||
|
||||
export function specsVisiting(index, routes) {
|
||||
return index.specs.filter((s) =>
|
||||
routes.some((r) => index.specRoutes.get(s).has(r)),
|
||||
);
|
||||
}
|
||||
60
frontend/scripts/affected/git.mjs
Normal file
60
frontend/scripts/affected/git.mjs
Normal file
@@ -0,0 +1,60 @@
|
||||
import { execFileSync, spawnSync } from 'node:child_process';
|
||||
import { existsSync, readFileSync } from 'node:fs';
|
||||
import path from 'node:path';
|
||||
|
||||
export const REPO = execFileSync('git', ['rev-parse', '--show-toplevel'], {
|
||||
cwd: import.meta.dirname,
|
||||
encoding: 'utf8',
|
||||
}).trim();
|
||||
|
||||
const DEP_FIELDS = ['dependencies', 'devDependencies'];
|
||||
|
||||
export function git(...args) {
|
||||
return execFileSync('git', args, { cwd: REPO, encoding: 'utf8' }).trim();
|
||||
}
|
||||
|
||||
const lines = (out) => out.split('\n').filter(Boolean);
|
||||
|
||||
// Repo-relative paths under frontend/ and tests/e2e/ that differ from mergeBase, uncommitted included.
|
||||
export function changedFiles(mergeBase) {
|
||||
const scope = ['frontend', 'tests/e2e'];
|
||||
const tracked = lines(git('diff', '--name-only', mergeBase, '--', ...scope));
|
||||
const untracked = lines(
|
||||
git('ls-files', '--others', '--exclude-standard', '--', ...scope),
|
||||
);
|
||||
return [...new Set([...tracked, ...untracked])].filter((f) =>
|
||||
existsSync(path.join(REPO, f)),
|
||||
);
|
||||
}
|
||||
|
||||
// Changed package names, or null when anything besides dependency versions changed.
|
||||
export function changedPackages(mergeBase, pkgJson) {
|
||||
const before = JSON.parse(git('show', `${mergeBase}:${pkgJson}`));
|
||||
const after = JSON.parse(readFileSync(path.join(REPO, pkgJson), 'utf8'));
|
||||
const strip = (pkg) =>
|
||||
JSON.stringify({
|
||||
...pkg,
|
||||
...Object.fromEntries(DEP_FIELDS.map((k) => [k, null])),
|
||||
});
|
||||
if (strip(before) !== strip(after)) {
|
||||
return null;
|
||||
}
|
||||
const names = new Set(
|
||||
DEP_FIELDS.flatMap((k) => Object.keys({ ...before[k], ...after[k] })),
|
||||
);
|
||||
return [...names].filter((n) =>
|
||||
DEP_FIELDS.some((k) => before[k]?.[n] !== after[k]?.[n]),
|
||||
);
|
||||
}
|
||||
|
||||
export function importersOf(pkg, dir) {
|
||||
const out = spawnSync(
|
||||
'git',
|
||||
['grep', '-lE', `['"]${pkg}(/[^'"]*)?['"]`, '--', dir],
|
||||
{
|
||||
cwd: REPO,
|
||||
encoding: 'utf8',
|
||||
},
|
||||
).stdout;
|
||||
return lines(out);
|
||||
}
|
||||
30
frontend/scripts/affected/jestGraph.mjs
Normal file
30
frontend/scripts/affected/jestGraph.mjs
Normal file
@@ -0,0 +1,30 @@
|
||||
import { spawnSync } from 'node:child_process';
|
||||
import path from 'node:path';
|
||||
|
||||
export const FRONTEND = path.resolve(import.meta.dirname, '../..');
|
||||
|
||||
export function pnpm(args, cwd, stdio = 'inherit') {
|
||||
return spawnSync('pnpm', args, {
|
||||
cwd,
|
||||
encoding: 'utf8',
|
||||
stdio,
|
||||
maxBuffer: 64 * 1024 * 1024,
|
||||
});
|
||||
}
|
||||
|
||||
// Absolute paths of files matching testMatch whose import graph reaches any of files.
|
||||
export function relatedFiles(files, testMatch) {
|
||||
if (!files.length) {
|
||||
return [];
|
||||
}
|
||||
const match = testMatch ? ['--testMatch', ...testMatch] : [];
|
||||
const res = pnpm(
|
||||
['exec', 'jest', '--listTests', '--findRelatedTests', ...files, ...match],
|
||||
FRONTEND,
|
||||
'pipe',
|
||||
);
|
||||
if (res.status !== 0) {
|
||||
throw new Error(`jest --listTests failed:\n${res.stderr}`);
|
||||
}
|
||||
return res.stdout.split('\n').filter((l) => l.startsWith('/'));
|
||||
}
|
||||
1
frontend/scripts/affected/log.mjs
Normal file
1
frontend/scripts/affected/log.mjs
Normal file
@@ -0,0 +1 @@
|
||||
export const log = (message) => process.stdout.write(`${message}\n`);
|
||||
57
frontend/scripts/affected/routes.mjs
Normal file
57
frontend/scripts/affected/routes.mjs
Normal file
@@ -0,0 +1,57 @@
|
||||
import { existsSync, readFileSync } from 'node:fs';
|
||||
import path from 'node:path';
|
||||
|
||||
import { FRONTEND } from './jestGraph.mjs';
|
||||
|
||||
const SRC = path.join(FRONTEND, 'src');
|
||||
const read = (rel) => readFileSync(path.join(SRC, rel), 'utf8');
|
||||
|
||||
// Mounted around every page, so a change it reaches shows up as the shell, not as a page.
|
||||
export const SHELL_ENTRY = path.join(SRC, 'container/AppLayout/index.tsx');
|
||||
|
||||
function resolveModule(spec) {
|
||||
const base = path.join(SRC, spec);
|
||||
const candidates = ['.tsx', '.ts', '/index.tsx', '/index.ts'].map(
|
||||
(ext) => base + ext,
|
||||
);
|
||||
return candidates.find(existsSync);
|
||||
}
|
||||
|
||||
function routePaths() {
|
||||
const body = read('constants/routes.ts');
|
||||
return Object.fromEntries(
|
||||
[...body.matchAll(/^\s*(\w+):\s*'([^']+)'/gm)].map(([, k, v]) => [
|
||||
k,
|
||||
v.split('?')[0],
|
||||
]),
|
||||
);
|
||||
}
|
||||
|
||||
function componentModules() {
|
||||
const body = read('AppRoutes/pageComponents.ts');
|
||||
const re =
|
||||
/export const (\w+) = Loadable\(\s*\(\)\s*=>\s*import\(\s*(?:\/\*[\s\S]*?\*\/\s*)?'([^']+)'/g;
|
||||
return Object.fromEntries(
|
||||
[...body.matchAll(re)].map(([, name, spec]) => [name, resolveModule(spec)]),
|
||||
);
|
||||
}
|
||||
|
||||
// [{ file, paths }] for every page module the router mounts.
|
||||
export function pageEntries() {
|
||||
const paths = routePaths();
|
||||
const modules = componentModules();
|
||||
const byFile = new Map();
|
||||
for (const [block] of read('AppRoutes/routes.ts').matchAll(/\{[^{}]*\}/g)) {
|
||||
const component = block.match(/component:\s*(\w+)/)?.[1];
|
||||
const pathLine = block.match(/path:\s*([^\n]+)/)?.[1] ?? '';
|
||||
const file = modules[component];
|
||||
if (!file) {
|
||||
continue;
|
||||
}
|
||||
const routeKeys = [...pathLine.matchAll(/ROUTES\.(\w+)/g)]
|
||||
.map(([, k]) => paths[k])
|
||||
.filter(Boolean);
|
||||
byFile.set(file, [...(byFile.get(file) ?? []), ...routeKeys]);
|
||||
}
|
||||
return [...byFile].map(([file, p]) => ({ file, paths: [...new Set(p)] }));
|
||||
}
|
||||
@@ -68,7 +68,8 @@ const withQueryKey = <T extends object, K>(
|
||||
};
|
||||
|
||||
/**
|
||||
* This endpoint lists all notification channels for the organization
|
||||
* Deprecated: use GET /api/v2/notification_channels instead. This endpoint lists all notification channels for the organization
|
||||
* @deprecated
|
||||
* @summary List notification channels
|
||||
*/
|
||||
export const listChannels = (signal?: AbortSignal) => {
|
||||
@@ -114,6 +115,7 @@ export type ListChannelsQueryResult = NonNullable<
|
||||
export type ListChannelsQueryError = ErrorType<RenderErrorResponseDTO>;
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
* @summary List notification channels
|
||||
*/
|
||||
|
||||
@@ -137,6 +139,7 @@ export function useListChannels<
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
* @summary List notification channels
|
||||
*/
|
||||
export const invalidateListChannels = async (
|
||||
@@ -152,7 +155,8 @@ export const invalidateListChannels = async (
|
||||
};
|
||||
|
||||
/**
|
||||
* This endpoint creates a notification channel
|
||||
* Deprecated: use POST /api/v2/notification_channels instead. This endpoint creates a notification channel
|
||||
* @deprecated
|
||||
* @summary Create notification channel
|
||||
*/
|
||||
export const createChannel = (
|
||||
@@ -214,6 +218,7 @@ export type CreateChannelMutationBody =
|
||||
export type CreateChannelMutationError = ErrorType<RenderErrorResponseDTO>;
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
* @summary Create notification channel
|
||||
*/
|
||||
export const useCreateChannel = <
|
||||
@@ -235,7 +240,8 @@ export const useCreateChannel = <
|
||||
return useMutation(getCreateChannelMutationOptions(options));
|
||||
};
|
||||
/**
|
||||
* This endpoint deletes a notification channel by ID
|
||||
* Deprecated: use DELETE /api/v2/notification_channels/{id} instead. This endpoint deletes a notification channel by ID
|
||||
* @deprecated
|
||||
* @summary Delete notification channel
|
||||
*/
|
||||
export const deleteChannelByID = (
|
||||
@@ -293,6 +299,7 @@ export type DeleteChannelByIDMutationResult = NonNullable<
|
||||
export type DeleteChannelByIDMutationError = ErrorType<RenderErrorResponseDTO>;
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
* @summary Delete notification channel
|
||||
*/
|
||||
export const useDeleteChannelByID = <
|
||||
@@ -314,7 +321,8 @@ export const useDeleteChannelByID = <
|
||||
return useMutation(getDeleteChannelByIDMutationOptions(options));
|
||||
};
|
||||
/**
|
||||
* This endpoint returns a notification channel by ID
|
||||
* Deprecated: use GET /api/v2/notification_channels/{id} instead. This endpoint returns a notification channel by ID
|
||||
* @deprecated
|
||||
* @summary Get notification channel by ID
|
||||
*/
|
||||
export const getChannelByID = (
|
||||
@@ -373,6 +381,7 @@ export type GetChannelByIDQueryResult = NonNullable<
|
||||
export type GetChannelByIDQueryError = ErrorType<RenderErrorResponseDTO>;
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
* @summary Get notification channel by ID
|
||||
*/
|
||||
|
||||
@@ -399,6 +408,7 @@ export function useGetChannelByID<
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
* @summary Get notification channel by ID
|
||||
*/
|
||||
export const invalidateGetChannelByID = async (
|
||||
@@ -415,7 +425,8 @@ export const invalidateGetChannelByID = async (
|
||||
};
|
||||
|
||||
/**
|
||||
* This endpoint updates a notification channel by ID
|
||||
* Deprecated: use PUT /api/v2/notification_channels/{id} instead. This endpoint updates a notification channel by ID
|
||||
* @deprecated
|
||||
* @summary Update notification channel
|
||||
*/
|
||||
export const updateChannelByID = (
|
||||
@@ -487,6 +498,7 @@ export type UpdateChannelByIDMutationBody =
|
||||
export type UpdateChannelByIDMutationError = ErrorType<RenderErrorResponseDTO>;
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
* @summary Update notification channel
|
||||
*/
|
||||
export const useUpdateChannelByID = <
|
||||
@@ -514,7 +526,8 @@ export const useUpdateChannelByID = <
|
||||
return useMutation(getUpdateChannelByIDMutationOptions(options));
|
||||
};
|
||||
/**
|
||||
* This endpoint tests a notification channel by sending a test notification
|
||||
* Deprecated: use POST /api/v2/notification_channels/test instead. This endpoint tests a notification channel by sending a test notification
|
||||
* @deprecated
|
||||
* @summary Test notification channel
|
||||
*/
|
||||
export const testChannel = (
|
||||
@@ -576,6 +589,7 @@ export type TestChannelMutationBody =
|
||||
export type TestChannelMutationError = ErrorType<RenderErrorResponseDTO>;
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
* @summary Test notification channel
|
||||
*/
|
||||
export const useTestChannel = <
|
||||
|
||||
@@ -14681,6 +14681,16 @@ export interface SpantypesSpanDTO {
|
||||
* @description All of them for a span read by ID; the selected ones in a list.
|
||||
*/
|
||||
attributes: SpantypesSpanDTOAttributes;
|
||||
/**
|
||||
* @type string
|
||||
* @description Omitted when empty, and in a list unless selected.
|
||||
*/
|
||||
db_name?: string;
|
||||
/**
|
||||
* @type string
|
||||
* @description Omitted when empty, and in a list unless selected.
|
||||
*/
|
||||
db_operation?: string;
|
||||
/**
|
||||
* @type integer
|
||||
* @minimum 0
|
||||
@@ -14691,10 +14701,35 @@ export interface SpantypesSpanDTO {
|
||||
* @description All of them for a span read by ID; none in a list.
|
||||
*/
|
||||
events: SpantypesEventDTO[];
|
||||
/**
|
||||
* @type string
|
||||
* @description Method of an outgoing HTTP call. Omitted when empty, and in a list unless selected.
|
||||
*/
|
||||
external_http_method?: string;
|
||||
/**
|
||||
* @type string
|
||||
* @description Host of an outgoing HTTP call. Omitted when empty, and in a list unless selected.
|
||||
*/
|
||||
external_http_url?: string;
|
||||
/**
|
||||
* @type boolean
|
||||
*/
|
||||
has_error: boolean;
|
||||
/**
|
||||
* @type string
|
||||
* @description Host or server address. Omitted when empty, and in a list unless selected.
|
||||
*/
|
||||
http_host?: string;
|
||||
/**
|
||||
* @type string
|
||||
* @description Omitted when empty, and in a list unless selected.
|
||||
*/
|
||||
http_method?: string;
|
||||
/**
|
||||
* @type string
|
||||
* @description Omitted when empty, and in a list unless selected.
|
||||
*/
|
||||
http_url?: string;
|
||||
/**
|
||||
* @type string
|
||||
* @description For example Server, Client or Internal.
|
||||
@@ -14724,6 +14759,10 @@ export interface SpantypesSpanDTO {
|
||||
* @description HTTP or gRPC status code, for example 404.
|
||||
*/
|
||||
response_status_code: string;
|
||||
/**
|
||||
* @description Instrumentation scope. Omitted when empty, and in a list unless selected.
|
||||
*/
|
||||
scope?: SpantypesScopeDTO;
|
||||
/**
|
||||
* @type string
|
||||
*/
|
||||
@@ -14747,6 +14786,11 @@ export interface SpantypesSpanDTO {
|
||||
* @type string
|
||||
*/
|
||||
trace_id: string;
|
||||
/**
|
||||
* @type string
|
||||
* @description W3C trace state. Omitted when empty, and in a list unless selected.
|
||||
*/
|
||||
trace_state?: string;
|
||||
}
|
||||
|
||||
export interface SpantypesSpanTextMatchDTO {
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { ApiV5Instance } from 'api';
|
||||
import { ErrorResponseHandlerV2 } from 'api/ErrorResponseHandlerV2';
|
||||
import { AxiosError } from 'axios';
|
||||
import { ENTITY_VERSION_V5 } from 'constants/app';
|
||||
import { ErrorV2Resp, SuccessResponseV2 } from 'types/api';
|
||||
import {
|
||||
MetricRangePayloadV5,
|
||||
@@ -17,24 +16,10 @@ import {
|
||||
*/
|
||||
export const getQueryRangeV5 = async (
|
||||
props: QueryRangePayloadV5,
|
||||
version: string,
|
||||
signal?: AbortSignal,
|
||||
headers?: Record<string, string>,
|
||||
): Promise<SuccessResponseV2<MetricRangePayloadV5>> => {
|
||||
try {
|
||||
if (version && version === ENTITY_VERSION_V5) {
|
||||
const response = await ApiV5Instance.post('/query_range', props, {
|
||||
signal,
|
||||
headers,
|
||||
});
|
||||
|
||||
return {
|
||||
httpStatusCode: response.status,
|
||||
data: response.data,
|
||||
};
|
||||
}
|
||||
|
||||
// Default V5 behavior
|
||||
const response = await ApiV5Instance.post('/query_range', props, {
|
||||
signal,
|
||||
headers,
|
||||
@@ -42,7 +27,7 @@ export const getQueryRangeV5 = async (
|
||||
|
||||
return {
|
||||
httpStatusCode: response.status,
|
||||
data: response.data.data,
|
||||
data: response.data,
|
||||
};
|
||||
} catch (error) {
|
||||
ErrorResponseHandlerV2(error as AxiosError<ErrorV2Resp>);
|
||||
|
||||
@@ -7,7 +7,6 @@ import { useAppLocation } from 'lib/router/useAppLocation';
|
||||
import { QueryParams } from 'constants/query';
|
||||
import { PANEL_TYPES } from 'constants/queryBuilder';
|
||||
import { ViewMenuAction } from 'container/WidgetCard/config';
|
||||
import { ENTITY_VERSION_V5 } from 'constants/app';
|
||||
import GridCard from 'container/WidgetCard/Card';
|
||||
import { Card } from 'container/WidgetCard/styles';
|
||||
import { useIsDarkMode } from 'hooks/useDarkMode';
|
||||
@@ -179,7 +178,6 @@ function CeleryTaskBar({
|
||||
{barState === CeleryTaskState.All && (
|
||||
<GridCard
|
||||
widget={celeryAllStateFilteredData}
|
||||
version={ENTITY_VERSION_V5}
|
||||
headerMenuList={[...ViewMenuAction]}
|
||||
onDragSelect={onDragSelect}
|
||||
isQueryEnabled={queryEnabled}
|
||||
@@ -201,7 +199,6 @@ function CeleryTaskBar({
|
||||
{barState === CeleryTaskState.Failed && (
|
||||
<GridCard
|
||||
widget={celeryFailedStateFilteredData}
|
||||
version={ENTITY_VERSION_V5}
|
||||
headerMenuList={[...ViewMenuAction]}
|
||||
onDragSelect={onDragSelect}
|
||||
isQueryEnabled={queryEnabled}
|
||||
@@ -222,7 +219,6 @@ function CeleryTaskBar({
|
||||
{barState === CeleryTaskState.Retry && (
|
||||
<GridCard
|
||||
widget={celeryRetryStateFilteredData}
|
||||
version={ENTITY_VERSION_V5}
|
||||
headerMenuList={[...ViewMenuAction]}
|
||||
onDragSelect={onDragSelect}
|
||||
isQueryEnabled={queryEnabled}
|
||||
@@ -243,7 +239,6 @@ function CeleryTaskBar({
|
||||
{barState === CeleryTaskState.Successful && (
|
||||
<GridCard
|
||||
widget={celerySuccessStateFilteredData}
|
||||
version={ENTITY_VERSION_V5}
|
||||
headerMenuList={[...ViewMenuAction]}
|
||||
onDragSelect={onDragSelect}
|
||||
isQueryEnabled={queryEnabled}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { useCallback, useMemo } from 'react';
|
||||
// eslint-disable-next-line no-restricted-imports
|
||||
import { useDispatch } from 'react-redux';
|
||||
import { ENTITY_VERSION_V5 } from 'constants/app';
|
||||
import { navigate } from 'lib/router/navigation';
|
||||
import { useAppLocation } from 'lib/router/useAppLocation';
|
||||
import { QueryParams } from 'constants/query';
|
||||
@@ -137,7 +136,6 @@ function CeleryTaskGraph({
|
||||
isQueryEnabled={queryEnabled}
|
||||
openTracesButton={openTracesButton}
|
||||
onOpenTraceBtnClick={onOpenTraceBtnClick}
|
||||
version={ENTITY_VERSION_V5}
|
||||
customErrorMessage={customErrorMessage}
|
||||
start={start}
|
||||
end={end}
|
||||
|
||||
@@ -9,7 +9,6 @@ import logEvent from 'api/common/logEvent';
|
||||
import { QueryParams } from 'constants/query';
|
||||
import { PANEL_TYPES } from 'constants/queryBuilder';
|
||||
import { ViewMenuAction } from 'container/WidgetCard/config';
|
||||
import { ENTITY_VERSION_V5 } from 'constants/app';
|
||||
import GridCard from 'container/WidgetCard/Card';
|
||||
import { Card } from 'container/WidgetCard/styles';
|
||||
import { Button } from 'container/MetricsApplication/Tabs/styles';
|
||||
@@ -202,7 +201,6 @@ function CeleryTaskLatencyGraph({
|
||||
</Button>
|
||||
<GridCard
|
||||
widget={updatedWidgetData}
|
||||
version={ENTITY_VERSION_V5}
|
||||
headerMenuList={[...ViewMenuAction]}
|
||||
onDragSelect={onDragSelect}
|
||||
onClickHandler={onGraphClick('Celery_p99_latency')}
|
||||
@@ -224,7 +222,6 @@ function CeleryTaskLatencyGraph({
|
||||
</Button>
|
||||
<GridCard
|
||||
widget={updatedWidgetData}
|
||||
version={ENTITY_VERSION_V5}
|
||||
headerMenuList={[...ViewMenuAction]}
|
||||
onDragSelect={onDragSelect}
|
||||
onClickHandler={onGraphClick('Celery_p95_latency')}
|
||||
@@ -245,7 +242,6 @@ function CeleryTaskLatencyGraph({
|
||||
</Button>
|
||||
<GridCard
|
||||
widget={updatedWidgetData}
|
||||
version={ENTITY_VERSION_V5}
|
||||
headerMenuList={[...ViewMenuAction]}
|
||||
onDragSelect={onDragSelect}
|
||||
onClickHandler={onGraphClick('Celery_p90_latency')}
|
||||
|
||||
@@ -2,7 +2,6 @@ import { useCallback } from 'react';
|
||||
import { useQueries } from 'react-query';
|
||||
// eslint-disable-next-line no-restricted-imports
|
||||
import { useSelector } from 'react-redux';
|
||||
import { ENTITY_VERSION_V5 } from 'constants/app';
|
||||
import { PANEL_TYPES } from 'constants/queryBuilder';
|
||||
import { GetMetricQueryRange } from 'lib/dashboard/getQueryResults';
|
||||
import {
|
||||
@@ -42,9 +41,9 @@ export const useGetValueFromWidget = (
|
||||
|
||||
const queries = useQueries(
|
||||
queryPayloads().map((payload) => ({
|
||||
queryKey: [...queryKey, payload, ENTITY_VERSION_V5],
|
||||
queryKey: [...queryKey, payload],
|
||||
queryFn: (): Promise<SuccessResponse<MetricRangePayloadProps>> =>
|
||||
GetMetricQueryRange(payload, ENTITY_VERSION_V5),
|
||||
GetMetricQueryRange(payload),
|
||||
enabled: !!payload,
|
||||
})),
|
||||
);
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
.actions {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: var(--spacing-4);
|
||||
flex-shrink: 0;
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
import { Fragment } from 'react';
|
||||
|
||||
import type { HeaderAction } from './DetailsHeader';
|
||||
|
||||
import styles from './HeaderActions.module.scss';
|
||||
|
||||
interface HeaderActionsProps {
|
||||
actions: HeaderAction[];
|
||||
}
|
||||
|
||||
function HeaderActions({ actions }: HeaderActionsProps): JSX.Element {
|
||||
return (
|
||||
<div className={styles.actions}>
|
||||
{actions.map((action) => (
|
||||
<Fragment key={action.key}>{action.component}</Fragment>
|
||||
))}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export default HeaderActions;
|
||||
@@ -1,4 +1,6 @@
|
||||
import { Drawer } from '@signozhq/ui/drawer';
|
||||
import type { HeaderAction } from 'components/DetailsPanel/DetailsHeader/DetailsHeader';
|
||||
import HeaderActions from 'components/DetailsPanel/DetailsHeader/HeaderActions';
|
||||
|
||||
import { LogDetailProps } from './LogDetail.interfaces';
|
||||
import LogDetailBody from './LogDetailBody';
|
||||
@@ -34,6 +36,34 @@ function LogDetail({
|
||||
|
||||
const title = useLogTimestamp(shownLog);
|
||||
|
||||
const headerActions: HeaderAction[] = [
|
||||
...(shownLog
|
||||
? [
|
||||
{
|
||||
key: 'log-actions',
|
||||
component: (
|
||||
<LogActions
|
||||
log={shownLog}
|
||||
showOpenInExplorer={!!handleOpenInExplorer}
|
||||
onOpenInExplorer={handleOpenInExplorer}
|
||||
/>
|
||||
),
|
||||
},
|
||||
]
|
||||
: []),
|
||||
{
|
||||
key: 'navigation',
|
||||
component: (
|
||||
<LogNavigation
|
||||
onNavigatePrev={goToPrev}
|
||||
onNavigateNext={goToNext}
|
||||
isPrevDisabled={isPrevDisabled}
|
||||
isNextDisabled={isNextDisabled}
|
||||
/>
|
||||
),
|
||||
},
|
||||
];
|
||||
|
||||
return (
|
||||
<Drawer
|
||||
type="inspector"
|
||||
@@ -43,23 +73,7 @@ function LogDetail({
|
||||
title={title}
|
||||
width="extra-wide"
|
||||
closePosition="start"
|
||||
headerSuffix={
|
||||
<>
|
||||
{shownLog && (
|
||||
<LogActions
|
||||
log={shownLog}
|
||||
showOpenInExplorer={!!handleOpenInExplorer}
|
||||
onOpenInExplorer={handleOpenInExplorer}
|
||||
/>
|
||||
)}
|
||||
<LogNavigation
|
||||
onNavigatePrev={goToPrev}
|
||||
onNavigateNext={goToNext}
|
||||
isPrevDisabled={isPrevDisabled}
|
||||
isNextDisabled={isNextDisabled}
|
||||
/>
|
||||
</>
|
||||
}
|
||||
headerSuffix={<HeaderActions actions={headerActions} />}
|
||||
testId="log-detail-drawer"
|
||||
>
|
||||
{shownLog && (
|
||||
|
||||
@@ -433,7 +433,6 @@ function QueryAddOns({
|
||||
query={query}
|
||||
onChange={handleChangeOrderByKeys}
|
||||
isRawQuery={isRawQuery}
|
||||
isNewQueryV2
|
||||
panelType={panelType ?? undefined}
|
||||
placeholder={placeholderOf(QueryBuilderField.OrderBy)}
|
||||
/>
|
||||
|
||||
@@ -16,6 +16,7 @@ import {
|
||||
startCompletion,
|
||||
} from '@codemirror/autocomplete';
|
||||
import { javascript } from '@codemirror/lang-javascript';
|
||||
import * as Sentry from '@sentry/react';
|
||||
import { Color } from '@signozhq/design-tokens';
|
||||
import { copilot } from '@uiw/codemirror-theme-copilot';
|
||||
import { githubLight } from '@uiw/codemirror-theme-github';
|
||||
@@ -361,9 +362,12 @@ function QuerySearch({
|
||||
metricNamespace,
|
||||
},
|
||||
builderQueryType,
|
||||
);
|
||||
).catch((error: unknown) => {
|
||||
Sentry.captureException(error);
|
||||
return null;
|
||||
});
|
||||
|
||||
if (response.data.keys) {
|
||||
if (response?.data.keys) {
|
||||
const { keys } = response.data;
|
||||
const options = generateOptions(keys);
|
||||
// Deduplicate by full variant identity (name + context + data type), NOT by
|
||||
|
||||
@@ -192,8 +192,7 @@ export const QueryV2 = forwardRef(function QueryV2(
|
||||
!functions.hidden &&
|
||||
(query.dataSource === DataSource.LOGS ||
|
||||
query.dataSource === DataSource.METRICS ||
|
||||
hasQueryFunctions ||
|
||||
false)
|
||||
hasQueryFunctions)
|
||||
}
|
||||
areFunctionsDisabled={functions.disabled}
|
||||
functionsDisabledReason={functions.reason}
|
||||
|
||||
@@ -15,6 +15,7 @@ import {
|
||||
} from '@dnd-kit/sortable';
|
||||
import { CSS } from '@dnd-kit/utilities';
|
||||
import { Button } from 'antd';
|
||||
import { Typography } from '@signozhq/ui/typography';
|
||||
import OverlayScrollbar from 'components/OverlayScrollbar/OverlayScrollbar';
|
||||
import { GripVertical } from '@signozhq/icons';
|
||||
import { TelemetryFieldKey } from 'types/api/v5/queryRange';
|
||||
@@ -46,7 +47,17 @@ function SortableFilter({
|
||||
>
|
||||
<div {...attributes} {...listeners} className="drag-handle">
|
||||
{allowDrag && <GripVertical size={16} />}
|
||||
{filter.name}
|
||||
<Typography
|
||||
variant="paragraph"
|
||||
size="base"
|
||||
weight="regular"
|
||||
color="inherit"
|
||||
as="span"
|
||||
display="block"
|
||||
textOverflow="ellipsis"
|
||||
>
|
||||
{filter.name}
|
||||
</Typography>
|
||||
</div>
|
||||
{allowRemove && (
|
||||
<Button
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { useMemo } from 'react';
|
||||
import { Button, Skeleton } from 'antd';
|
||||
import { Typography } from '@signozhq/ui/typography';
|
||||
import {
|
||||
QuickfiltertypesSourceDTO,
|
||||
TelemetrytypesSourceDTO,
|
||||
@@ -98,7 +99,17 @@ function OtherFilters({
|
||||
|
||||
return otherFilters.map((filter) => (
|
||||
<div key={filter.key} className="qf-filter-item other-filters-item">
|
||||
<div className="qf-filter-key">{filter.name}</div>
|
||||
<Typography
|
||||
variant="paragraph"
|
||||
size="base"
|
||||
weight="regular"
|
||||
color="inherit"
|
||||
as="span"
|
||||
display="block"
|
||||
textOverflow="ellipsis"
|
||||
>
|
||||
{filter.name}
|
||||
</Typography>
|
||||
<Button
|
||||
className="add-filter-btn periscope-btn"
|
||||
size="small"
|
||||
|
||||
@@ -132,6 +132,11 @@
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
flex-grow: 1;
|
||||
min-width: 0;
|
||||
|
||||
> svg {
|
||||
flex-shrink: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.qf-filter-content {
|
||||
@@ -158,6 +163,7 @@
|
||||
|
||||
.remove-filter-btn,
|
||||
.add-filter-btn {
|
||||
flex-shrink: 0;
|
||||
padding: 6px 12px;
|
||||
opacity: 0;
|
||||
transition: opacity 0.2s ease-in-out;
|
||||
|
||||
@@ -90,6 +90,35 @@ export const handlers = [
|
||||
fieldValuesHandler(['checkout', 'frontend', 'payments']),
|
||||
];
|
||||
|
||||
const LONG_FILTER_NAME =
|
||||
'gen_ai.response.tool_calls.0.tool_call.function.arguments';
|
||||
|
||||
/** One added and one other filter whose names are wider than the settings panel. */
|
||||
export const longFilterNameHandlers = [
|
||||
rest.get('http://localhost/api/v2/quick_filters/logs', (_req, res, ctx) =>
|
||||
res(
|
||||
ctx.status(200),
|
||||
ctx.json(
|
||||
quickFiltersResponse(QuickfiltertypesSourceDTO.logs, [
|
||||
...customFilters,
|
||||
{
|
||||
name: LONG_FILTER_NAME,
|
||||
fieldDataType: TelemetrytypesFieldDataTypeDTO.string,
|
||||
fieldContext: TelemetrytypesFieldContextDTO.attribute,
|
||||
},
|
||||
]),
|
||||
),
|
||||
),
|
||||
),
|
||||
rest.get('http://localhost/api/v1/fields/keys', (_req, res, ctx) =>
|
||||
res(
|
||||
ctx.status(200),
|
||||
ctx.json(fieldKeysResponse([`${LONG_FILTER_NAME}.raw`])),
|
||||
),
|
||||
),
|
||||
...handlers,
|
||||
];
|
||||
|
||||
export const noSavedFiltersHandler = rest.get(
|
||||
'http://localhost/api/v2/quick_filters/logs',
|
||||
(_req, res, ctx) =>
|
||||
|
||||
@@ -11,6 +11,7 @@ import {
|
||||
hoverTruncatedTitle,
|
||||
openQueryPicker,
|
||||
openSettings,
|
||||
showsLongFilterNames,
|
||||
} from './__story_mockdata__/quickFilters.play';
|
||||
import {
|
||||
checkboxConfig,
|
||||
@@ -19,6 +20,7 @@ import {
|
||||
handlers,
|
||||
LONG_FILTER_VALUES,
|
||||
loadingFiltersHandlers,
|
||||
longFilterNameHandlers,
|
||||
longTitleConfig,
|
||||
MANY_FILTER_VALUES,
|
||||
queryBuilder,
|
||||
@@ -65,6 +67,12 @@ export const SettingsOpen: GlobalArgsStory = {
|
||||
play: openSettings,
|
||||
};
|
||||
|
||||
/** Settings with filter names wider than the panel: each name is cut with an ellipsis and its action stays in view. */
|
||||
export const SettingsLongFilterNames: GlobalArgsStory = {
|
||||
parameters: { msw: { handlers: longFilterNameHandlers } },
|
||||
play: showsLongFilterNames,
|
||||
};
|
||||
|
||||
/** Mutation: changing the settings list reveals the fixed save and discard footer. */
|
||||
export const SettingsDirtyFooter: GlobalArgsStory = {
|
||||
play: dirtySettings,
|
||||
|
||||
@@ -64,6 +64,32 @@ export const dirtySettings = async (context: PlayContext): Promise<void> => {
|
||||
await screen.findByRole('button', { name: 'Save changes' });
|
||||
};
|
||||
|
||||
/** Every Add and Remove sits inside its list: a long name is cut, not scrolled. */
|
||||
export const showsLongFilterNames = async (
|
||||
context: PlayContext,
|
||||
): Promise<void> => {
|
||||
if (!canManageQuickFilters(context.args)) {
|
||||
return;
|
||||
}
|
||||
|
||||
await openSettings(context);
|
||||
await Promise.all(
|
||||
['quick-filters-added', 'quick-filters-other'].map(async (testId) => {
|
||||
const list = await screen.findByTestId(testId);
|
||||
const actions = await within(list).findAllByRole(
|
||||
'button',
|
||||
{ name: /^(Add|Remove)$/ },
|
||||
UNTIL_LOADED,
|
||||
);
|
||||
const listRight = list.getBoundingClientRect().right;
|
||||
|
||||
actions.forEach((action) => {
|
||||
expect(action.getBoundingClientRect().right).toBeLessThanOrEqual(listRight);
|
||||
});
|
||||
}),
|
||||
);
|
||||
};
|
||||
|
||||
export const hoverTruncatedTitle = async ({
|
||||
canvasElement,
|
||||
args,
|
||||
|
||||
@@ -18,18 +18,6 @@
|
||||
letter-spacing: -0.07px;
|
||||
}
|
||||
|
||||
&__input {
|
||||
height: 32px;
|
||||
background: var(--l2-background);
|
||||
border-color: var(--l1-border);
|
||||
color: var(--l1-foreground);
|
||||
box-shadow: none;
|
||||
|
||||
&::placeholder {
|
||||
color: var(--l3-foreground);
|
||||
}
|
||||
}
|
||||
|
||||
&__datepicker {
|
||||
width: 100%;
|
||||
height: 32px;
|
||||
@@ -100,11 +88,4 @@
|
||||
text-transform: uppercase;
|
||||
margin-bottom: var(--spacing-4);
|
||||
}
|
||||
|
||||
&__learn-more {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: var(--spacing-1);
|
||||
color: var(--primary);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { useCallback, useEffect, useMemo } from 'react';
|
||||
import QuerySearch from 'components/QueryBuilderV2/QueryV2/QuerySearch/QuerySearch';
|
||||
import { combineInitialAndUserExpression } from 'components/QueryBuilderV2/QueryV2/QuerySearch/utils';
|
||||
import { ENTITY_VERSION_V5 } from 'constants/app';
|
||||
import {
|
||||
getAllEndpointsWidgetData,
|
||||
getGroupByExpressionFromRowData,
|
||||
@@ -156,7 +155,6 @@ function AllEndPoints({
|
||||
customOnDragSelect={(): void => {}}
|
||||
customTimeRange={timeRange}
|
||||
customOnRowClick={onRowClick}
|
||||
version={ENTITY_VERSION_V5}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -2,7 +2,6 @@ import { useCallback, useMemo } from 'react';
|
||||
import { useQueries } from 'react-query';
|
||||
import QuerySearch from 'components/QueryBuilderV2/QueryV2/QuerySearch/QuerySearch';
|
||||
import { combineInitialAndUserExpression } from 'components/QueryBuilderV2/QueryV2/QuerySearch/utils';
|
||||
import { ENTITY_VERSION_V5 } from 'constants/app';
|
||||
import { REACT_QUERY_KEY } from 'constants/reactQueryKeys';
|
||||
import {
|
||||
END_POINT_DETAILS_QUERY_KEYS_ARRAY,
|
||||
@@ -93,13 +92,9 @@ function EndPointDetails({
|
||||
|
||||
const endPointDetailsDataQueries = useQueries(
|
||||
endPointDetailsQueryPayload.map((payload, index) => ({
|
||||
queryKey: [
|
||||
END_POINT_DETAILS_QUERY_KEYS_ARRAY[index],
|
||||
payload,
|
||||
ENTITY_VERSION_V5,
|
||||
],
|
||||
queryKey: [END_POINT_DETAILS_QUERY_KEYS_ARRAY[index], payload],
|
||||
queryFn: (): Promise<SuccessResponse<MetricRangePayloadProps>> =>
|
||||
GetMetricQueryRange(payload, ENTITY_VERSION_V5),
|
||||
GetMetricQueryRange(payload),
|
||||
enabled: !!payload,
|
||||
// Keeps the table's rows, and so its height, while a new filter loads
|
||||
keepPreviousData:
|
||||
|
||||
@@ -9,7 +9,6 @@ import { MetricRangePayloadV5, ScalarData } from 'api/v5/v5';
|
||||
import { useNavigateToExplorer } from 'components/CeleryTask/useNavigateToExplorer';
|
||||
import { combineInitialAndUserExpression } from 'components/QueryBuilderV2/QueryV2/QuerySearch/utils';
|
||||
import { withErrorBoundary } from 'components/ErrorBoundaryHOC';
|
||||
import { ENTITY_VERSION_V5 } from 'constants/app';
|
||||
import { REACT_QUERY_KEY } from 'constants/reactQueryKeys';
|
||||
import {
|
||||
formatTopErrorsDataForTable,
|
||||
@@ -76,13 +75,12 @@ function TopErrors({
|
||||
queryKey: [
|
||||
REACT_QUERY_KEY.GET_TOP_ERRORS_BY_DOMAIN,
|
||||
queryPayload,
|
||||
ENTITY_VERSION_V5,
|
||||
showStatusCodeErrors,
|
||||
],
|
||||
queryFn: ({
|
||||
signal,
|
||||
}: QueryFunctionContext): Promise<SuccessResponseV2<MetricRangePayloadV5>> =>
|
||||
getQueryRangeV5(queryPayload, ENTITY_VERSION_V5, signal),
|
||||
getQueryRangeV5(queryPayload, signal),
|
||||
enabled: !!queryPayload,
|
||||
staleTime: 0,
|
||||
cacheTime: 0,
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
import { QueryClient, QueryClientProvider } from 'react-query';
|
||||
import { render, screen, waitFor } from 'tests/test-utils';
|
||||
import { TraceAggregation } from 'api/v5/v5';
|
||||
import { ENTITY_VERSION_V5 } from 'constants/app';
|
||||
import { GetMetricQueryRange } from 'lib/dashboard/getQueryResults';
|
||||
import { MetricQueryRangeSuccessResponse } from 'types/api/metrics/getQueryRange';
|
||||
import { IBuilderQuery } from 'types/api/queryBuilder/queryBuilderData';
|
||||
|
||||
import { SPAN_ATTRIBUTES } from '../constants';
|
||||
import DomainMetrics from './DomainMetrics';
|
||||
@@ -12,6 +13,33 @@ jest.mock('lib/dashboard/getQueryResults', () => ({
|
||||
GetMetricQueryRange: jest.fn(),
|
||||
}));
|
||||
|
||||
const mockGetMetricQueryRange = jest.mocked(GetMetricQueryRange);
|
||||
|
||||
const buildResponse = (
|
||||
rows: { data: Record<string, string> }[],
|
||||
): MetricQueryRangeSuccessResponse => ({
|
||||
statusCode: 200,
|
||||
message: 'success',
|
||||
error: null,
|
||||
payload: {
|
||||
data: {
|
||||
resultType: '',
|
||||
newResult: { data: { result: [], resultType: '' } },
|
||||
result: [
|
||||
{ queryName: 'A', metric: {}, values: [], table: { rows, columns: [] } },
|
||||
],
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
const findQuery = (queryData: IBuilderQuery[], name: string): IBuilderQuery => {
|
||||
const query = queryData.find((q) => q.queryName === name);
|
||||
if (!query) {
|
||||
throw new Error(`Query ${name} missing from the payload`);
|
||||
}
|
||||
return query;
|
||||
};
|
||||
|
||||
// Mock ErrorState component
|
||||
jest.mock('./ErrorState', () => ({
|
||||
__esModule: true,
|
||||
@@ -36,30 +64,16 @@ describe('DomainMetrics - V5 Query Payload Tests', () => {
|
||||
domainListFilterExpression: '',
|
||||
};
|
||||
|
||||
const mockSuccessResponse = {
|
||||
statusCode: 200,
|
||||
error: null,
|
||||
payload: {
|
||||
const mockSuccessResponse = buildResponse([
|
||||
{
|
||||
data: {
|
||||
result: [
|
||||
{
|
||||
table: {
|
||||
rows: [
|
||||
{
|
||||
data: {
|
||||
A: '150',
|
||||
B: '125000000',
|
||||
D: '2021-01-01T23:00:00Z',
|
||||
F1: '5.5',
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
],
|
||||
A: '150',
|
||||
B: '125000000',
|
||||
D: '2021-01-01T23:00:00Z',
|
||||
F1: '5.5',
|
||||
},
|
||||
},
|
||||
};
|
||||
]);
|
||||
|
||||
beforeEach(() => {
|
||||
queryClient = new QueryClient({
|
||||
@@ -86,7 +100,7 @@ describe('DomainMetrics - V5 Query Payload Tests', () => {
|
||||
|
||||
describe('1. V5 Query Payload with Filters', () => {
|
||||
it('sends correct V5 payload structure with domain name filters', async () => {
|
||||
(GetMetricQueryRange as jest.Mock).mockResolvedValue(mockSuccessResponse);
|
||||
mockGetMetricQueryRange.mockResolvedValue(mockSuccessResponse);
|
||||
|
||||
renderComponent();
|
||||
|
||||
@@ -94,10 +108,7 @@ describe('DomainMetrics - V5 Query Payload Tests', () => {
|
||||
expect(GetMetricQueryRange).toHaveBeenCalledTimes(1);
|
||||
});
|
||||
|
||||
const [payload, version] = (GetMetricQueryRange as jest.Mock).mock.calls[0];
|
||||
|
||||
// Verify it's using V5
|
||||
expect(version).toBe(ENTITY_VERSION_V5);
|
||||
const [payload] = mockGetMetricQueryRange.mock.calls[0];
|
||||
|
||||
// Verify time range
|
||||
expect(payload.start).toBe(1758259531000);
|
||||
@@ -111,64 +122,60 @@ describe('DomainMetrics - V5 Query Payload Tests', () => {
|
||||
const queryData = payload.query.builder.queryData;
|
||||
|
||||
// Verify Query A - count with URL filter
|
||||
const queryA = queryData.find((q: any) => q.queryName === 'A');
|
||||
expect(queryA).toBeDefined();
|
||||
const queryA = findQuery(queryData, 'A');
|
||||
expect(queryA.dataSource).toBe('traces');
|
||||
expect(queryA.aggregations?.[0]).toBeDefined();
|
||||
expect((queryA.aggregations?.[0] as TraceAggregation)?.expression).toBe(
|
||||
'count()',
|
||||
);
|
||||
// Verify exact domain filter expression structure
|
||||
expect(queryA.filter.expression).toContain("http_host = '0.0.0.0'");
|
||||
expect(queryA.filter.expression).toContain(
|
||||
expect(queryA.filter?.expression).toContain("http_host = '0.0.0.0'");
|
||||
expect(queryA.filter?.expression).toContain(
|
||||
`${SPAN_ATTRIBUTES.HTTP_URL} EXISTS`,
|
||||
);
|
||||
|
||||
// Verify Query B - p99 latency
|
||||
const queryB = queryData.find((q: any) => q.queryName === 'B');
|
||||
expect(queryB).toBeDefined();
|
||||
const queryB = findQuery(queryData, 'B');
|
||||
expect(queryB.aggregateOperator).toBe('p99');
|
||||
expect(queryB.aggregations?.[0]).toBeDefined();
|
||||
expect((queryB.aggregations?.[0] as TraceAggregation)?.expression).toBe(
|
||||
'p99(duration_nano)',
|
||||
);
|
||||
// Verify exact domain filter expression structure
|
||||
expect(queryB.filter.expression).toContain("http_host = '0.0.0.0'");
|
||||
expect(queryB.filter?.expression).toContain("http_host = '0.0.0.0'");
|
||||
|
||||
// Verify Query C - error count (disabled)
|
||||
const queryC = queryData.find((q: any) => q.queryName === 'C');
|
||||
expect(queryC).toBeDefined();
|
||||
const queryC = findQuery(queryData, 'C');
|
||||
expect(queryC.disabled).toBe(true);
|
||||
expect(queryC.filter.expression).toContain("http_host = '0.0.0.0'");
|
||||
expect(queryC.filter?.expression).toContain("http_host = '0.0.0.0'");
|
||||
expect(queryC.aggregations?.[0]).toBeDefined();
|
||||
expect((queryC.aggregations?.[0] as TraceAggregation)?.expression).toBe(
|
||||
'count()',
|
||||
);
|
||||
|
||||
expect(queryC.filter.expression).toContain('has_error = true');
|
||||
expect(queryC.filter?.expression).toContain('has_error = true');
|
||||
|
||||
// Verify Query D - max timestamp
|
||||
const queryD = queryData.find((q: any) => q.queryName === 'D');
|
||||
expect(queryD).toBeDefined();
|
||||
const queryD = findQuery(queryData, 'D');
|
||||
expect(queryD.aggregateOperator).toBe('max');
|
||||
expect(queryD.aggregations?.[0]).toBeDefined();
|
||||
expect((queryD.aggregations?.[0] as TraceAggregation)?.expression).toBe(
|
||||
'max(timestamp)',
|
||||
);
|
||||
// Verify exact domain filter expression structure
|
||||
expect(queryD.filter.expression).toContain("http_host = '0.0.0.0'");
|
||||
expect(queryD.filter?.expression).toContain("http_host = '0.0.0.0'");
|
||||
|
||||
// Verify Formula F1 - error rate calculation
|
||||
const formulas = payload.query.builder.queryFormulas;
|
||||
expect(formulas).toBeDefined();
|
||||
expect(formulas.length).toBeGreaterThan(0);
|
||||
const formulaF1 = formulas.find((f: any) => f.queryName === 'F1');
|
||||
const formulaF1 = formulas.find((f) => f.queryName === 'F1');
|
||||
expect(formulaF1).toBeDefined();
|
||||
expect(formulaF1.expression).toBe('(C/A)*100');
|
||||
expect(formulaF1?.expression).toBe('(C/A)*100');
|
||||
});
|
||||
|
||||
it('includes custom filters in filter expressions', async () => {
|
||||
(GetMetricQueryRange as jest.Mock).mockResolvedValue(mockSuccessResponse);
|
||||
mockGetMetricQueryRange.mockResolvedValue(mockSuccessResponse);
|
||||
|
||||
const customFilterExpression =
|
||||
"service.name = 'my-service' AND deployment.environment = 'production'";
|
||||
@@ -182,24 +189,21 @@ describe('DomainMetrics - V5 Query Payload Tests', () => {
|
||||
expect(GetMetricQueryRange).toHaveBeenCalled();
|
||||
});
|
||||
|
||||
const [payload] = (GetMetricQueryRange as jest.Mock).mock.calls[0];
|
||||
const [payload] = mockGetMetricQueryRange.mock.calls[0];
|
||||
const queryData = payload.query.builder.queryData;
|
||||
|
||||
// Verify all queries include the custom filters
|
||||
queryData.forEach((query: any) => {
|
||||
if (query.filter && query.filter.expression) {
|
||||
expect(query.filter.expression).toContain('service.name');
|
||||
expect(query.filter.expression).toContain('my-service');
|
||||
expect(query.filter.expression).toContain('deployment.environment');
|
||||
expect(query.filter.expression).toContain('production');
|
||||
}
|
||||
const expressions = queryData.map((query) => query.filter?.expression);
|
||||
expect(expressions).toHaveLength(4);
|
||||
expressions.forEach((expression) => {
|
||||
expect(expression).toContain(customFilterExpression);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('2. Data Display State', () => {
|
||||
it('displays metrics when data is successfully loaded', async () => {
|
||||
(GetMetricQueryRange as jest.Mock).mockResolvedValue(mockSuccessResponse);
|
||||
mockGetMetricQueryRange.mockResolvedValue(mockSuccessResponse);
|
||||
|
||||
renderComponent();
|
||||
|
||||
@@ -220,23 +224,9 @@ describe('DomainMetrics - V5 Query Payload Tests', () => {
|
||||
|
||||
describe('3. Empty/Missing Data State', () => {
|
||||
it('displays "-" for missing data values', async () => {
|
||||
const emptyResponse = {
|
||||
statusCode: 200,
|
||||
error: null,
|
||||
payload: {
|
||||
data: {
|
||||
result: [
|
||||
{
|
||||
table: {
|
||||
rows: [],
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
};
|
||||
const emptyResponse = buildResponse([]);
|
||||
|
||||
(GetMetricQueryRange as jest.Mock).mockResolvedValue(emptyResponse);
|
||||
mockGetMetricQueryRange.mockResolvedValue(emptyResponse);
|
||||
|
||||
renderComponent();
|
||||
|
||||
@@ -248,7 +238,7 @@ describe('DomainMetrics - V5 Query Payload Tests', () => {
|
||||
|
||||
describe('4. Error State', () => {
|
||||
it('displays error state when API call fails', async () => {
|
||||
(GetMetricQueryRange as jest.Mock).mockRejectedValue(new Error('API Error'));
|
||||
mockGetMetricQueryRange.mockRejectedValue(new Error('API Error'));
|
||||
|
||||
renderComponent();
|
||||
|
||||
@@ -261,7 +251,7 @@ describe('DomainMetrics - V5 Query Payload Tests', () => {
|
||||
|
||||
it('retries API call when retry button is clicked', async () => {
|
||||
let callCount = 0;
|
||||
(GetMetricQueryRange as jest.Mock).mockImplementation(() => {
|
||||
mockGetMetricQueryRange.mockImplementation(() => {
|
||||
callCount += 1;
|
||||
if (callCount === 1) {
|
||||
return Promise.reject(new Error('API Error'));
|
||||
|
||||
@@ -3,7 +3,6 @@ import { useQueries } from 'react-query';
|
||||
import { Skeleton, Tooltip } from 'antd';
|
||||
import { Progress } from '@signozhq/ui/progress';
|
||||
import { Typography } from '@signozhq/ui/typography';
|
||||
import { ENTITY_VERSION_V5 } from 'constants/app';
|
||||
import { REACT_QUERY_KEY } from 'constants/reactQueryKeys';
|
||||
import {
|
||||
DomainMetricsResponseRow,
|
||||
@@ -41,13 +40,9 @@ function DomainMetrics({
|
||||
// Since only one query here
|
||||
const domainMetricsDataQueries = useQueries(
|
||||
queryPayloads.map((payload) => ({
|
||||
queryKey: [
|
||||
REACT_QUERY_KEY.GET_DOMAIN_METRICS_DATA,
|
||||
payload,
|
||||
ENTITY_VERSION_V5,
|
||||
],
|
||||
queryKey: [REACT_QUERY_KEY.GET_DOMAIN_METRICS_DATA, payload],
|
||||
queryFn: (): Promise<SuccessResponse<MetricRangePayloadProps>> =>
|
||||
GetMetricQueryRange(payload, ENTITY_VERSION_V5),
|
||||
GetMetricQueryRange(payload),
|
||||
enabled: !!payload,
|
||||
staleTime: 60 * 1000, // 1 minute stale time : optimize this part
|
||||
})),
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { useMemo } from 'react';
|
||||
import { useQuery } from 'react-query';
|
||||
import { Combobox, type ComboboxItemType } from '@signozhq/ui/combobox';
|
||||
import { ENTITY_VERSION_V5 } from 'constants/app';
|
||||
import { REACT_QUERY_KEY } from 'constants/reactQueryKeys';
|
||||
import {
|
||||
getEndPointDropDownQueryPayload,
|
||||
@@ -44,12 +43,8 @@ function EndPointPicker({
|
||||
);
|
||||
|
||||
const { data, isLoading, isFetching } = useQuery({
|
||||
queryKey: [
|
||||
REACT_QUERY_KEY.GET_ENDPOINT_DROPDOWN_DATA,
|
||||
payload,
|
||||
ENTITY_VERSION_V5,
|
||||
],
|
||||
queryFn: () => GetMetricQueryRange(payload, ENTITY_VERSION_V5),
|
||||
queryKey: [REACT_QUERY_KEY.GET_ENDPOINT_DROPDOWN_DATA, payload],
|
||||
queryFn: () => GetMetricQueryRange(payload),
|
||||
staleTime: 60 * 1000,
|
||||
});
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { Card } from 'antd';
|
||||
import { ENTITY_VERSION_V5 } from 'constants/app';
|
||||
import GridCard from 'container/WidgetCard/Card';
|
||||
import { Widgets } from 'types/api/widgets/widget';
|
||||
|
||||
@@ -23,7 +22,6 @@ function MetricOverTimeGraph({
|
||||
customOnDragSelect={(): void => {}}
|
||||
customTimeRange={timeRange}
|
||||
customTimeRangeWindowForCoRelation="5m"
|
||||
version={ENTITY_VERSION_V5}
|
||||
/>
|
||||
</div>
|
||||
</Card>
|
||||
|
||||
@@ -8,7 +8,6 @@ import ErrorInPlace from 'components/ErrorInPlace/ErrorInPlace';
|
||||
import QueryCancelledPlaceholder from 'components/QueryCancelledPlaceholder';
|
||||
import Spinner from 'components/Spinner';
|
||||
import WarningPopover from 'components/WarningPopover/WarningPopover';
|
||||
import { ENTITY_VERSION_V5 } from 'constants/app';
|
||||
import { QueryParams } from 'constants/query';
|
||||
import { initialQueriesMap, PANEL_TYPES } from 'constants/queryBuilder';
|
||||
import { REACT_QUERY_KEY } from 'constants/reactQueryKeys';
|
||||
@@ -177,7 +176,6 @@ function ChartPreview({
|
||||
},
|
||||
originalGraphType: graphType,
|
||||
},
|
||||
ENTITY_VERSION_V5,
|
||||
{
|
||||
queryKey: [
|
||||
REACT_QUERY_KEY.ALERT_RULES_CHART_PREVIEW,
|
||||
|
||||
@@ -20,7 +20,6 @@ import Header from 'components/Header/Header';
|
||||
import HeaderRightSection from 'components/HeaderRightSection/HeaderRightSection';
|
||||
import NoAuthBanner from 'components/NoAuthBanner/NoAuthBanner';
|
||||
import { getIsNoAuthMode } from 'utils/noAuthMode';
|
||||
import { ENTITY_VERSION_V5 } from 'constants/app';
|
||||
import { ORG_PREFERENCES } from 'constants/orgPreferences';
|
||||
import { initialQueriesMap, PANEL_TYPES } from 'constants/queryBuilder';
|
||||
import { REACT_QUERY_KEY } from 'constants/reactQueryKeys';
|
||||
@@ -102,7 +101,6 @@ export default function Home(): JSX.Element {
|
||||
},
|
||||
formatForWeb: false,
|
||||
},
|
||||
ENTITY_VERSION_V5,
|
||||
{
|
||||
queryKey: [
|
||||
REACT_QUERY_KEY.GET_QUERY_RANGE,
|
||||
@@ -127,7 +125,6 @@ export default function Home(): JSX.Element {
|
||||
},
|
||||
formatForWeb: false,
|
||||
},
|
||||
ENTITY_VERSION_V5,
|
||||
{
|
||||
queryKey: [
|
||||
REACT_QUERY_KEY.GET_QUERY_RANGE,
|
||||
|
||||
@@ -4,7 +4,6 @@ import { QueryKey } from 'react-query';
|
||||
import { useSelector } from 'react-redux';
|
||||
import { Button, Select, Skeleton, Table } from 'antd';
|
||||
import logEvent from 'api/common/logEvent';
|
||||
import { ENTITY_VERSION_V5 } from 'constants/app';
|
||||
import ROUTES from 'constants/routes';
|
||||
import {
|
||||
getQueryRangeRequestData,
|
||||
@@ -226,27 +225,23 @@ function ServiceMetrics({
|
||||
[globalSelectedInterval, topLevelOperations],
|
||||
);
|
||||
|
||||
const dataQueries = useGetQueriesRange(
|
||||
queryRangeRequestData,
|
||||
ENTITY_VERSION_V5,
|
||||
{
|
||||
queryKey: useMemo(
|
||||
() => [
|
||||
`GetMetricsQueryRange-home-${globalSelectedInterval}`,
|
||||
timeRange.endTime,
|
||||
timeRange.startTime,
|
||||
globalSelectedInterval,
|
||||
],
|
||||
[globalSelectedInterval, timeRange.endTime, timeRange.startTime],
|
||||
),
|
||||
keepPreviousData: true,
|
||||
enabled: true,
|
||||
refetchOnMount: false,
|
||||
onError: () => {
|
||||
setIsError(true);
|
||||
},
|
||||
const dataQueries = useGetQueriesRange(queryRangeRequestData, {
|
||||
queryKey: useMemo(
|
||||
() => [
|
||||
`GetMetricsQueryRange-home-${globalSelectedInterval}`,
|
||||
timeRange.endTime,
|
||||
timeRange.startTime,
|
||||
globalSelectedInterval,
|
||||
],
|
||||
[globalSelectedInterval, timeRange.endTime, timeRange.startTime],
|
||||
),
|
||||
keepPreviousData: true,
|
||||
enabled: true,
|
||||
refetchOnMount: false,
|
||||
onError: () => {
|
||||
setIsError(true);
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
const isLoading = useMemo(
|
||||
() => dataQueries.some((query) => query.isLoading),
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { useCallback, useMemo } from 'react';
|
||||
import { useQuery, useQueryClient } from 'react-query';
|
||||
import { ENTITY_VERSION_V5 } from 'constants/app';
|
||||
import { REACT_QUERY_KEY } from 'constants/reactQueryKeys';
|
||||
import { GetMetricQueryRange } from 'lib/dashboard/getQueryResults';
|
||||
import { ILog } from 'types/api/logs/log';
|
||||
@@ -77,7 +76,7 @@ export function useEntityEvents({
|
||||
offset,
|
||||
pageSize,
|
||||
});
|
||||
return GetMetricQueryRange(query, ENTITY_VERSION_V5, undefined, signal);
|
||||
return GetMetricQueryRange(query, undefined, signal);
|
||||
},
|
||||
enabled: !!expression?.trim(),
|
||||
});
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { useCallback, useMemo } from 'react';
|
||||
import { useInfiniteQuery, useQueryClient } from 'react-query';
|
||||
import { ENTITY_VERSION_V5 } from 'constants/app';
|
||||
import { REACT_QUERY_KEY } from 'constants/reactQueryKeys';
|
||||
import { DEFAULT_PER_PAGE_VALUE } from 'container/Controls/config';
|
||||
import { GetMetricQueryRange } from 'lib/dashboard/getQueryResults';
|
||||
@@ -63,7 +62,7 @@ export function useInfiniteEntityLogs({
|
||||
offset: pageParam as number,
|
||||
pageSize: DEFAULT_PER_PAGE_VALUE,
|
||||
});
|
||||
return GetMetricQueryRange(query, ENTITY_VERSION_V5, undefined, signal);
|
||||
return GetMetricQueryRange(query, undefined, signal);
|
||||
},
|
||||
getNextPageParam: (lastPage, allPages) => {
|
||||
const list = lastPage?.payload?.data?.newResult?.data?.result?.[0]?.list;
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { useMemo } from 'react';
|
||||
import { QueryFunctionContext, useQueries, UseQueryResult } from 'react-query';
|
||||
import { ENTITY_VERSION_V5 } from 'constants/app';
|
||||
import { PANEL_TYPES } from 'constants/queryBuilder';
|
||||
import { REACT_QUERY_KEY } from 'constants/reactQueryKeys';
|
||||
import { InfraMonitoringEntity } from 'container/InfraMonitoringK8sV2/constants';
|
||||
@@ -51,18 +50,12 @@ export function useEntityMetrics<T>({
|
||||
const queries = useQueries(
|
||||
queryPayloads.map((payload, index) => ({
|
||||
// TODO: remove AUTO_REFRESH_QUERY when migrating to date time selection v3
|
||||
queryKey: [
|
||||
REACT_QUERY_KEY.AUTO_REFRESH_QUERY,
|
||||
queryKey,
|
||||
payload,
|
||||
ENTITY_VERSION_V5,
|
||||
category,
|
||||
],
|
||||
queryKey: [REACT_QUERY_KEY.AUTO_REFRESH_QUERY, queryKey, payload, category],
|
||||
queryFn: ({
|
||||
signal,
|
||||
}: QueryFunctionContext): Promise<
|
||||
SuccessResponse<MetricRangePayloadProps>
|
||||
> => GetMetricQueryRange(payload, ENTITY_VERSION_V5, undefined, signal),
|
||||
> => GetMetricQueryRange(payload, undefined, signal),
|
||||
enabled: !!payload && visibilities[index],
|
||||
keepPreviousData: true,
|
||||
})),
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { useCallback, useMemo } from 'react';
|
||||
import { useQuery, useQueryClient } from 'react-query';
|
||||
import { ENTITY_VERSION_V5 } from 'constants/app';
|
||||
import { REACT_QUERY_KEY } from 'constants/reactQueryKeys';
|
||||
import { GetMetricQueryRange } from 'lib/dashboard/getQueryResults';
|
||||
|
||||
@@ -68,7 +67,7 @@ export function useEntityTraces({
|
||||
offset,
|
||||
pageSize,
|
||||
});
|
||||
return GetMetricQueryRange(query, ENTITY_VERSION_V5, undefined, signal);
|
||||
return GetMetricQueryRange(query, undefined, signal);
|
||||
},
|
||||
enabled: !!expression?.trim(),
|
||||
});
|
||||
|
||||
@@ -14,7 +14,6 @@ import logEvent from 'api/common/logEvent';
|
||||
import ListViewOrderBy from 'components/OrderBy/ListViewOrderBy';
|
||||
import { SavedviewtypesSourceDTO } from 'api/generated/services/sigNoz.schemas';
|
||||
import type { TableColumnDef } from 'components/TanStackTableView/types';
|
||||
import { ENTITY_VERSION_V5 } from 'constants/app';
|
||||
import { LOCALSTORAGE } from 'constants/localStorage';
|
||||
import { QueryParams } from 'constants/query';
|
||||
import { initialQueryAIWithType, PANEL_TYPES } from 'constants/queryBuilder';
|
||||
@@ -145,7 +144,6 @@ function ListView({
|
||||
selectColumns,
|
||||
},
|
||||
},
|
||||
ENTITY_VERSION_V5,
|
||||
{
|
||||
queryKey,
|
||||
enabled:
|
||||
|
||||
@@ -12,7 +12,6 @@ import { useSelector } from 'react-redux';
|
||||
import Space from 'periscope/components/Space/Space';
|
||||
import ErrorInPlace from 'components/ErrorInPlace/ErrorInPlace';
|
||||
import ExportMenu from 'components/ExportMenu/ExportMenu';
|
||||
import { ENTITY_VERSION_V5 } from 'constants/app';
|
||||
import { initialQueriesMap, PANEL_TYPES } from 'constants/queryBuilder';
|
||||
import { REACT_QUERY_KEY } from 'constants/reactQueryKeys';
|
||||
import { QueryTable } from 'container/QueryTable';
|
||||
@@ -71,7 +70,6 @@ function TableView({
|
||||
dataSource: 'traces',
|
||||
},
|
||||
},
|
||||
ENTITY_VERSION_V5,
|
||||
{
|
||||
queryKey,
|
||||
enabled: !!stagedQuery && panelType === PANEL_TYPES.TABLE,
|
||||
|
||||
@@ -8,7 +8,6 @@ import {
|
||||
import { QueryKey } from 'react-query';
|
||||
// eslint-disable-next-line no-restricted-imports
|
||||
import { useSelector } from 'react-redux';
|
||||
import { ENTITY_VERSION_V5 } from 'constants/app';
|
||||
import { initialQueriesMap, PANEL_TYPES } from 'constants/queryBuilder';
|
||||
import { REACT_QUERY_KEY } from 'constants/reactQueryKeys';
|
||||
import TimeSeriesView from 'container/TimeSeriesView/TimeSeriesView';
|
||||
@@ -89,7 +88,6 @@ function TimeSeriesViewContainer({
|
||||
dataSource,
|
||||
},
|
||||
},
|
||||
ENTITY_VERSION_V5,
|
||||
{
|
||||
queryKey,
|
||||
enabled: !!stagedQuery && panelType === PANEL_TYPES.TIME_SERIES,
|
||||
|
||||
@@ -14,7 +14,6 @@ import logEvent from 'api/common/logEvent';
|
||||
import ListViewOrderBy from 'components/OrderBy/ListViewOrderBy';
|
||||
import { SavedviewtypesSourceDTO } from 'api/generated/services/sigNoz.schemas';
|
||||
import type { TableColumnDef } from 'components/TanStackTableView/types';
|
||||
import { ENTITY_VERSION_V5 } from 'constants/app';
|
||||
import { LOCALSTORAGE } from 'constants/localStorage';
|
||||
import { QueryParams } from 'constants/query';
|
||||
import { initialQueryAIWithType, PANEL_TYPES } from 'constants/queryBuilder';
|
||||
@@ -140,7 +139,6 @@ function TracesView({
|
||||
pagination: paginationQueryData,
|
||||
},
|
||||
},
|
||||
ENTITY_VERSION_V5,
|
||||
{
|
||||
queryKey,
|
||||
enabled: !!stagedQuery && panelType === PANEL_TYPES.TRACE,
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { useMemo } from 'react';
|
||||
import { ENTITY_VERSION_V5 } from 'constants/app';
|
||||
import { LIVE_TAIL_GRAPH_INTERVAL } from 'constants/liveTail';
|
||||
import { PANEL_TYPES } from 'constants/queryBuilder';
|
||||
import LogsExplorerChart from 'container/LogsExplorerChart';
|
||||
@@ -57,7 +56,6 @@ function LiveLogsListChart({
|
||||
const { data, isFetching } = useGetExplorerQueryRange(
|
||||
listChartQuery,
|
||||
PANEL_TYPES.TIME_SERIES,
|
||||
ENTITY_VERSION_V5,
|
||||
{
|
||||
enabled: isConnectionOpen,
|
||||
refetchInterval: LIVE_TAIL_GRAPH_INTERVAL,
|
||||
|
||||
@@ -7,7 +7,6 @@ import {
|
||||
useMemo,
|
||||
useState,
|
||||
} from 'react';
|
||||
import { ENTITY_VERSION_V5 } from 'constants/app';
|
||||
import { PANEL_TYPES } from 'constants/queryBuilder';
|
||||
import {
|
||||
getOrderByTimestamp,
|
||||
@@ -131,7 +130,6 @@ export const useContextLogData = ({
|
||||
const { isError, isFetching } = useGetExplorerQueryRange(
|
||||
requestData,
|
||||
PANEL_TYPES.LIST,
|
||||
ENTITY_VERSION_V5,
|
||||
{
|
||||
keepPreviousData: true,
|
||||
enabled: !!requestData,
|
||||
|
||||
@@ -4,7 +4,6 @@ import { Card, Skeleton } from 'antd';
|
||||
import { Typography } from '@signozhq/ui/typography';
|
||||
import cx from 'classnames';
|
||||
import Uplot from 'components/Uplot';
|
||||
import { ENTITY_VERSION_V5 } from 'constants/app';
|
||||
import dayjs from 'dayjs';
|
||||
import { useIsDarkMode } from 'hooks/useDarkMode';
|
||||
import { useResizeObserver } from 'hooks/useDimensions';
|
||||
@@ -60,9 +59,9 @@ function NodeMetrics({
|
||||
const widgetInfo = nodeName ? nodeWidgetInfo : hostWidgetInfo;
|
||||
const queries = useQueries(
|
||||
queryPayloads.map((payload) => ({
|
||||
queryKey: ['metrics', payload, ENTITY_VERSION_V5, 'NODE'],
|
||||
queryKey: ['metrics', payload, 'NODE'],
|
||||
queryFn: (): Promise<SuccessResponse<MetricRangePayloadProps>> =>
|
||||
GetMetricQueryRange(payload, ENTITY_VERSION_V5),
|
||||
GetMetricQueryRange(payload),
|
||||
enabled: !!payload,
|
||||
})),
|
||||
);
|
||||
|
||||
@@ -4,7 +4,6 @@ import { Card, Skeleton } from 'antd';
|
||||
import { Typography } from '@signozhq/ui/typography';
|
||||
import cx from 'classnames';
|
||||
import Uplot from 'components/Uplot';
|
||||
import { ENTITY_VERSION_V5 } from 'constants/app';
|
||||
import dayjs from 'dayjs';
|
||||
import { useIsDarkMode } from 'hooks/useDarkMode';
|
||||
import { useResizeObserver } from 'hooks/useDimensions';
|
||||
@@ -57,9 +56,9 @@ function PodMetrics({
|
||||
);
|
||||
const queries = useQueries(
|
||||
queryPayloads.map((payload) => ({
|
||||
queryKey: ['metrics', payload, ENTITY_VERSION_V5, 'POD'],
|
||||
queryKey: ['metrics', payload, 'POD'],
|
||||
queryFn: (): Promise<SuccessResponse<MetricRangePayloadProps>> =>
|
||||
GetMetricQueryRange(payload, ENTITY_VERSION_V5),
|
||||
GetMetricQueryRange(payload),
|
||||
enabled: !!payload,
|
||||
})),
|
||||
);
|
||||
|
||||
@@ -14,7 +14,6 @@ import { useSelector } from 'react-redux';
|
||||
import getFromLocalstorage from 'api/browser/localstorage/get';
|
||||
import setToLocalstorage from 'api/browser/localstorage/set';
|
||||
import logEvent from 'api/common/logEvent';
|
||||
import { ENTITY_VERSION_V5 } from 'constants/app';
|
||||
import { LOCALSTORAGE } from 'constants/localStorage';
|
||||
import { QueryParams } from 'constants/query';
|
||||
import {
|
||||
@@ -152,7 +151,6 @@ function LogsExplorerViewsContainer({
|
||||
} = useGetExplorerQueryRange(
|
||||
listChartQuery,
|
||||
PANEL_TYPES.TIME_SERIES,
|
||||
ENTITY_VERSION_V5,
|
||||
{
|
||||
enabled:
|
||||
showFrequencyChart &&
|
||||
@@ -170,7 +168,6 @@ function LogsExplorerViewsContainer({
|
||||
useGetExplorerQueryRange(
|
||||
requestData,
|
||||
selectedPanelType,
|
||||
ENTITY_VERSION_V5,
|
||||
{
|
||||
keepPreviousData: true,
|
||||
enabled: !isLimit && !!requestData,
|
||||
|
||||
@@ -118,7 +118,7 @@ function Section(section: MetricSection): JSX.Element {
|
||||
$panelType={PANEL_TYPES.BAR}
|
||||
className="meter-graph"
|
||||
>
|
||||
<GridCard widget={widget} onDragSelect={onDragSelect} version="v5" />
|
||||
<GridCard widget={widget} onDragSelect={onDragSelect} />
|
||||
</Card>
|
||||
))}
|
||||
</div>
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { useEffect, useMemo } from 'react';
|
||||
import { useQueries } from 'react-query';
|
||||
import { isAxiosError } from 'axios';
|
||||
import { ENTITY_VERSION_V5 } from 'constants/app';
|
||||
import { initialQueryMeterWithType, PANEL_TYPES } from 'constants/queryBuilder';
|
||||
import { MAX_QUERY_RETRIES } from 'constants/reactQuery';
|
||||
import { REACT_QUERY_KEY } from 'constants/reactQueryKeys';
|
||||
@@ -72,7 +71,6 @@ export function useTimeSeriesQueries({
|
||||
queryKey: [
|
||||
REACT_QUERY_KEY.GET_QUERY_RANGE,
|
||||
payload,
|
||||
ENTITY_VERSION_V5,
|
||||
globalSelectedTime,
|
||||
maxTime,
|
||||
minTime,
|
||||
@@ -93,7 +91,6 @@ export function useTimeSeriesQueries({
|
||||
dataSource: DataSource.METRICS,
|
||||
},
|
||||
},
|
||||
ENTITY_VERSION_V5,
|
||||
undefined,
|
||||
signal,
|
||||
),
|
||||
|
||||
@@ -5,7 +5,6 @@ import { useAppLocation } from 'lib/router/useAppLocation';
|
||||
import { useAppParams } from 'lib/router/useAppParams';
|
||||
import Col from 'periscope/components/Col/Col';
|
||||
import logEvent from 'api/common/logEvent';
|
||||
import { ENTITY_VERSION_V5 } from 'constants/app';
|
||||
import { QueryParams } from 'constants/query';
|
||||
import { PANEL_TYPES } from 'constants/queryBuilder';
|
||||
import Graph from 'container/WidgetCard/Card';
|
||||
@@ -201,7 +200,6 @@ function DBCall(): JSX.Element {
|
||||
);
|
||||
}}
|
||||
onDragSelect={onDragSelect}
|
||||
version={ENTITY_VERSION_V5}
|
||||
enableDrillDown={SERVICE_DETAIL_DRILLDOWN_ENABLED}
|
||||
/>
|
||||
</GraphContainer>
|
||||
@@ -240,7 +238,6 @@ function DBCall(): JSX.Element {
|
||||
);
|
||||
}}
|
||||
onDragSelect={onDragSelect}
|
||||
version={ENTITY_VERSION_V5}
|
||||
enableDrillDown={SERVICE_DETAIL_DRILLDOWN_ENABLED}
|
||||
/>
|
||||
</GraphContainer>
|
||||
|
||||
@@ -5,7 +5,6 @@ import { useAppLocation } from 'lib/router/useAppLocation';
|
||||
import { useAppParams } from 'lib/router/useAppParams';
|
||||
import Col from 'periscope/components/Col/Col';
|
||||
import logEvent from 'api/common/logEvent';
|
||||
import { ENTITY_VERSION_V5 } from 'constants/app';
|
||||
import { QueryParams } from 'constants/query';
|
||||
import { PANEL_TYPES } from 'constants/queryBuilder';
|
||||
import Graph from 'container/WidgetCard/Card';
|
||||
@@ -273,7 +272,6 @@ function External(): JSX.Element {
|
||||
);
|
||||
}}
|
||||
onDragSelect={onDragSelect}
|
||||
version={ENTITY_VERSION_V5}
|
||||
enableDrillDown={SERVICE_DETAIL_DRILLDOWN_ENABLED}
|
||||
/>
|
||||
</GraphContainer>
|
||||
@@ -317,7 +315,6 @@ function External(): JSX.Element {
|
||||
);
|
||||
}}
|
||||
onDragSelect={onDragSelect}
|
||||
version={ENTITY_VERSION_V5}
|
||||
enableDrillDown={SERVICE_DETAIL_DRILLDOWN_ENABLED}
|
||||
/>
|
||||
</GraphContainer>
|
||||
@@ -362,7 +359,6 @@ function External(): JSX.Element {
|
||||
)
|
||||
}
|
||||
onDragSelect={onDragSelect}
|
||||
version={ENTITY_VERSION_V5}
|
||||
enableDrillDown={SERVICE_DETAIL_DRILLDOWN_ENABLED}
|
||||
/>
|
||||
</GraphContainer>
|
||||
@@ -406,7 +402,6 @@ function External(): JSX.Element {
|
||||
);
|
||||
}}
|
||||
onDragSelect={onDragSelect}
|
||||
version={ENTITY_VERSION_V5}
|
||||
enableDrillDown={SERVICE_DETAIL_DRILLDOWN_ENABLED}
|
||||
/>
|
||||
</GraphContainer>
|
||||
|
||||
@@ -8,7 +8,6 @@ import {
|
||||
apDexToolTipUrl,
|
||||
apDexToolTipUrlText,
|
||||
} from 'constants/apDex';
|
||||
import { ENTITY_VERSION_V5 } from 'constants/app';
|
||||
import { PANEL_TYPES } from 'constants/queryBuilder';
|
||||
import Graph from 'container/WidgetCard/Card';
|
||||
import DisplayThreshold from 'container/WidgetCard/Header/DisplayThreshold';
|
||||
@@ -98,7 +97,6 @@ function ApDexMetrics({
|
||||
onClickHandler={handleGraphClick('ApDex')}
|
||||
threshold={threshold}
|
||||
isQueryEnabled={isQueryEnabled}
|
||||
version={ENTITY_VERSION_V5}
|
||||
enableDrillDown={SERVICE_DETAIL_DRILLDOWN_ENABLED}
|
||||
/>
|
||||
);
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { useMemo } from 'react';
|
||||
import { useAppParams } from 'lib/router/useAppParams';
|
||||
import { ENTITY_VERSION_V5 } from 'constants/app';
|
||||
import { FeatureKeys } from 'constants/features';
|
||||
import { PANEL_TYPES } from 'constants/queryBuilder';
|
||||
import Graph from 'container/WidgetCard/Card';
|
||||
@@ -119,7 +118,6 @@ function ServiceOverview({
|
||||
widget={latencyWidget}
|
||||
onClickHandler={handleGraphClick('Service')}
|
||||
isQueryEnabled={isQueryEnabled}
|
||||
version={ENTITY_VERSION_V5}
|
||||
enableDrillDown={SERVICE_DETAIL_DRILLDOWN_ENABLED}
|
||||
/>
|
||||
</GraphContainer>
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { Typography } from '@signozhq/ui/typography';
|
||||
import axios from 'axios';
|
||||
import { SOMETHING_WENT_WRONG } from 'constants/api';
|
||||
import { ENTITY_VERSION_V5 } from 'constants/app';
|
||||
import Graph from 'container/WidgetCard/Card';
|
||||
import { SERVICE_DETAIL_DRILLDOWN_ENABLED } from 'container/MetricsApplication/constant';
|
||||
import { Card, GraphContainer } from 'container/MetricsApplication/styles';
|
||||
@@ -40,7 +39,6 @@ function TopLevelOperation({
|
||||
onClickHandler={handleGraphClick(opName)}
|
||||
onDragSelect={onDragSelect}
|
||||
isQueryEnabled={!topLevelOperationsIsLoading}
|
||||
version={ENTITY_VERSION_V5}
|
||||
enableDrillDown={SERVICE_DETAIL_DRILLDOWN_ENABLED}
|
||||
/>
|
||||
</GraphContainer>
|
||||
|
||||
@@ -2,7 +2,6 @@ import { ReactNode, useMemo } from 'react';
|
||||
// eslint-disable-next-line no-restricted-imports
|
||||
import { useSelector } from 'react-redux';
|
||||
import { useAppParams } from 'lib/router/useAppParams';
|
||||
import { ENTITY_VERSION_V5 } from 'constants/app';
|
||||
import { PANEL_TYPES } from 'constants/queryBuilder';
|
||||
import { topOperationMetricsDownloadOptions } from 'container/MetricsApplication/constant';
|
||||
import { getWidgetQueryBuilder } from 'container/MetricsApplication/MetricsApplication.factory';
|
||||
@@ -71,7 +70,6 @@ function TopOperationMetrics(): JSX.Element {
|
||||
globalSelectedInterval,
|
||||
variables: {},
|
||||
},
|
||||
ENTITY_VERSION_V5,
|
||||
{
|
||||
queryKey: [
|
||||
`GetMetricsQueryRange-${keyOperationWidget?.timePreferance}-${globalSelectedInterval}-${keyOperationWidget?.id}`,
|
||||
|
||||
@@ -16,7 +16,6 @@ import classNames from 'classnames';
|
||||
import QueryCancelledPlaceholder from 'components/QueryCancelledPlaceholder';
|
||||
import YAxisUnitSelector from 'components/YAxisUnitSelector';
|
||||
import { YAxisSource } from 'components/YAxisUnitSelector/types';
|
||||
import { ENTITY_VERSION_V5 } from 'constants/app';
|
||||
import { initialQueriesMap, PANEL_TYPES } from 'constants/queryBuilder';
|
||||
import { MAX_QUERY_RETRIES } from 'constants/reactQuery';
|
||||
import { REACT_QUERY_KEY } from 'constants/reactQueryKeys';
|
||||
@@ -102,7 +101,6 @@ function TimeSeries({
|
||||
queryKey: [
|
||||
REACT_QUERY_KEY.GET_QUERY_RANGE,
|
||||
payload,
|
||||
ENTITY_VERSION_V5,
|
||||
globalSelectedTime,
|
||||
maxTime,
|
||||
minTime,
|
||||
@@ -123,7 +121,6 @@ function TimeSeries({
|
||||
dataSource: DataSource.METRICS,
|
||||
},
|
||||
},
|
||||
ENTITY_VERSION_V5,
|
||||
undefined,
|
||||
signal,
|
||||
),
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { useMemo } from 'react';
|
||||
import { ENTITY_VERSION_V5 } from 'constants/app';
|
||||
import {
|
||||
initialFilters,
|
||||
initialQueriesMap,
|
||||
@@ -27,15 +26,12 @@ function LogsCountInInterval({
|
||||
return q;
|
||||
}, [filter]);
|
||||
|
||||
const result = useGetQueryRange(
|
||||
{
|
||||
graphType: PANEL_TYPES.TABLE,
|
||||
query,
|
||||
selectedTime: 'GLOBAL_TIME',
|
||||
globalSelectedInterval: timeInterval,
|
||||
},
|
||||
ENTITY_VERSION_V5,
|
||||
);
|
||||
const result = useGetQueryRange({
|
||||
graphType: PANEL_TYPES.TABLE,
|
||||
query,
|
||||
selectedTime: 'GLOBAL_TIME',
|
||||
globalSelectedInterval: timeInterval,
|
||||
});
|
||||
|
||||
const count = useMemo(() => {
|
||||
const table = result.data?.payload?.data?.result?.[0]?.table;
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { useMemo } from 'react';
|
||||
import { ENTITY_VERSION_V5 } from 'constants/app';
|
||||
import {
|
||||
initialFilters,
|
||||
initialQueriesMap,
|
||||
@@ -43,15 +42,12 @@ const useSampleLogs = ({
|
||||
return q;
|
||||
}, [count, filter]);
|
||||
|
||||
const response = useGetQueryRange(
|
||||
{
|
||||
graphType: PANEL_TYPES.LIST,
|
||||
query,
|
||||
selectedTime: 'GLOBAL_TIME',
|
||||
globalSelectedInterval: timeInterval,
|
||||
},
|
||||
ENTITY_VERSION_V5,
|
||||
);
|
||||
const response = useGetQueryRange({
|
||||
graphType: PANEL_TYPES.LIST,
|
||||
query,
|
||||
selectedTime: 'GLOBAL_TIME',
|
||||
globalSelectedInterval: timeInterval,
|
||||
});
|
||||
|
||||
const { isFetching: isLoading, data } = response;
|
||||
|
||||
|
||||
@@ -8,7 +8,6 @@ export type OrderByFilterProps = {
|
||||
query: IBuilderQuery;
|
||||
onChange: (values: OrderByPayload[]) => void;
|
||||
isRawQuery?: boolean;
|
||||
isNewQueryV2?: boolean;
|
||||
placeholder?: string;
|
||||
/** A logs or traces heatmap aggregates a field, which Order by then offers. */
|
||||
panelType?: PANEL_TYPES;
|
||||
|
||||
@@ -20,7 +20,6 @@ export function OrderByFilter({
|
||||
query,
|
||||
onChange,
|
||||
isRawQuery = false,
|
||||
isNewQueryV2 = false,
|
||||
placeholder,
|
||||
panelType,
|
||||
}: OrderByFilterProps): JSX.Element {
|
||||
@@ -28,7 +27,6 @@ export function OrderByFilter({
|
||||
const {
|
||||
debouncedSearchText,
|
||||
selectedValue,
|
||||
aggregationOptions,
|
||||
generateOptions,
|
||||
createOptions,
|
||||
handleChange,
|
||||
@@ -50,11 +48,10 @@ export function OrderByFilter({
|
||||
},
|
||||
);
|
||||
|
||||
// Get parsed aggregation options using createAggregation only for QueryV2
|
||||
// Get parsed aggregation options using createAggregation
|
||||
const parsedAggregationOptions = useMemo(
|
||||
() =>
|
||||
isNewQueryV2 ? getParsedAggregationOptionsForOrderBy(query, panelType) : [],
|
||||
[query, isNewQueryV2, panelType],
|
||||
() => getParsedAggregationOptionsForOrderBy(query, panelType),
|
||||
[query, panelType],
|
||||
);
|
||||
|
||||
const optionsData = useMemo(() => {
|
||||
@@ -67,10 +64,7 @@ export function OrderByFilter({
|
||||
const options =
|
||||
query.aggregateOperator === MetricAggregateOperator.NOOP
|
||||
? keyOptions
|
||||
: [
|
||||
...groupByOptions,
|
||||
...(isNewQueryV2 ? aggregationOptionsFromParsed : aggregationOptions),
|
||||
];
|
||||
: [...groupByOptions, ...aggregationOptionsFromParsed];
|
||||
|
||||
return generateOptions(options);
|
||||
}, [
|
||||
@@ -79,9 +73,7 @@ export function OrderByFilter({
|
||||
query.groupBy,
|
||||
query.aggregateOperator,
|
||||
parsedAggregationOptions,
|
||||
aggregationOptions,
|
||||
generateOptions,
|
||||
isNewQueryV2,
|
||||
]);
|
||||
|
||||
const isDisabledSelect =
|
||||
|
||||
@@ -39,7 +39,6 @@ function setup(query: Partial<IBuilderQuery>): { onChange: jest.Mock } {
|
||||
}
|
||||
onChange={onChange}
|
||||
isRawQuery
|
||||
isNewQueryV2
|
||||
/>,
|
||||
);
|
||||
return { onChange };
|
||||
|
||||
@@ -22,7 +22,6 @@ export type UseOrderByFilterResult = {
|
||||
searchText: string;
|
||||
debouncedSearchText: string;
|
||||
selectedValue: IOption[];
|
||||
aggregationOptions: IOption[];
|
||||
generateOptions: (options: IOption[]) => IOption[];
|
||||
createOptions: (keys: string[]) => IOption[];
|
||||
handleChange: (values: IOption[]) => void;
|
||||
@@ -123,29 +122,10 @@ export const useOrderByFilter = ({
|
||||
[],
|
||||
);
|
||||
|
||||
const aggregationOptions = useMemo(
|
||||
() => [
|
||||
{
|
||||
label: `${query.aggregateOperator}(${query.aggregateAttribute?.key}) ${
|
||||
ORDERBY_FILTERS.ASC
|
||||
}`,
|
||||
value: `${SIGNOZ_VALUE}${orderByValueDelimiter}${ORDERBY_FILTERS.ASC}`,
|
||||
},
|
||||
{
|
||||
label: `${query.aggregateOperator}(${query.aggregateAttribute?.key}) ${
|
||||
ORDERBY_FILTERS.DESC
|
||||
}`,
|
||||
value: `${SIGNOZ_VALUE}${orderByValueDelimiter}${ORDERBY_FILTERS.DESC}`,
|
||||
},
|
||||
],
|
||||
[query],
|
||||
);
|
||||
|
||||
return {
|
||||
searchText,
|
||||
debouncedSearchText,
|
||||
selectedValue,
|
||||
aggregationOptions,
|
||||
createOptions,
|
||||
handleChange,
|
||||
handleSearchKeys,
|
||||
|
||||
@@ -36,7 +36,3 @@
|
||||
border: 1px solid var(--danger-background);
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.jsonEditorErrorMessage {
|
||||
word-break: break-word;
|
||||
}
|
||||
|
||||
@@ -39,45 +39,6 @@
|
||||
padding-bottom: var(--spacing-8);
|
||||
}
|
||||
|
||||
.permissionEditorCollapsedSection {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.permissionEditorCollapsedHeader {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: var(--spacing-4);
|
||||
width: 100%;
|
||||
padding: var(--spacing-4) var(--spacing-6);
|
||||
background: var(--l3-background);
|
||||
border: 1px dashed var(--l2-border);
|
||||
border-radius: 4px;
|
||||
cursor: pointer;
|
||||
transition: background 0.15s ease;
|
||||
|
||||
&:hover {
|
||||
background: var(--l2-background);
|
||||
}
|
||||
|
||||
&:focus {
|
||||
outline: 2px solid var(--primary);
|
||||
outline-offset: -2px;
|
||||
}
|
||||
}
|
||||
|
||||
.permissionEditorCollapsedLabel {
|
||||
color: var(--l2-foreground);
|
||||
flex: 1;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.permissionEditorCollapsedCount {
|
||||
color: var(--primary);
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.permissionEditorCollapseAction {
|
||||
display: flex;
|
||||
justify-content: flex-start;
|
||||
|
||||
@@ -139,19 +139,6 @@
|
||||
|
||||
:global(.ant-pagination-total-text) {
|
||||
margin-right: auto;
|
||||
|
||||
.numbers {
|
||||
font-family: Inter;
|
||||
font-size: 12px;
|
||||
color: var(--foreground);
|
||||
}
|
||||
|
||||
.total {
|
||||
font-family: Inter;
|
||||
font-size: 12px;
|
||||
color: var(--foreground);
|
||||
opacity: 0.5;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -47,141 +47,3 @@
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.rolesDescriptionTooltip {
|
||||
max-height: none;
|
||||
overflow-y: visible;
|
||||
}
|
||||
|
||||
.rolesListingTable {
|
||||
margin-top: 12px;
|
||||
border-radius: 4px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.rolesTableScrollContainer {
|
||||
overflow-x: auto;
|
||||
}
|
||||
|
||||
.rolesTableInner {
|
||||
min-width: 850px;
|
||||
}
|
||||
|
||||
.rolesTableHeader {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 8px 16px;
|
||||
gap: 24px;
|
||||
}
|
||||
|
||||
.rolesTableHeaderCell {
|
||||
color: var(--foreground);
|
||||
}
|
||||
|
||||
.rolesTableHeaderCellName {
|
||||
flex: 0 0 180px;
|
||||
}
|
||||
|
||||
.rolesTableHeaderCellDescription {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.rolesTableHeaderCellCreatedAt {
|
||||
flex: 0 0 180px;
|
||||
}
|
||||
|
||||
.rolesTableHeaderCellUpdatedAt {
|
||||
flex: 0 0 180px;
|
||||
}
|
||||
|
||||
.rolesTableSectionHeader {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
height: 32px;
|
||||
padding: 0 16px;
|
||||
background: color-mix(in srgb, var(--bg-robin-200) 4%, transparent);
|
||||
border-top: 1px solid var(--secondary);
|
||||
border-bottom: 1px solid var(--secondary);
|
||||
color: var(--foreground);
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.rolesTableSectionHeaderCount {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
min-width: 20px;
|
||||
height: 18px;
|
||||
padding: 0 6px;
|
||||
border-radius: 9px;
|
||||
background: var(--l3-background);
|
||||
color: var(--foreground);
|
||||
}
|
||||
|
||||
.rolesTableRow {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 8px 16px;
|
||||
background: color-mix(in srgb, var(--bg-robin-200) 2%, transparent);
|
||||
border-bottom: 1px solid var(--secondary);
|
||||
gap: 24px;
|
||||
}
|
||||
|
||||
.rolesTableRowClickable {
|
||||
cursor: pointer;
|
||||
|
||||
&:hover {
|
||||
background: color-mix(in srgb, var(--bg-robin-200) 5%, transparent);
|
||||
}
|
||||
}
|
||||
|
||||
.rolesTableCell {
|
||||
color: var(--foreground);
|
||||
}
|
||||
|
||||
.rolesTableCellName {
|
||||
flex: 0 0 180px;
|
||||
}
|
||||
|
||||
.rolesTableCellDescription {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.rolesTableCellCreatedAt {
|
||||
flex: 0 0 180px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.rolesTableCellUpdatedAt {
|
||||
flex: 0 0 180px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.rolesTableEmpty {
|
||||
padding: 24px 16px;
|
||||
color: var(--foreground);
|
||||
}
|
||||
|
||||
.rolesTablePagination {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: flex-end;
|
||||
padding: 8px 16px;
|
||||
|
||||
:global(.ant-pagination-total-text) {
|
||||
margin-right: auto;
|
||||
}
|
||||
|
||||
:global(.ant-pagination-total-text .numbers) {
|
||||
color: var(--foreground);
|
||||
}
|
||||
|
||||
:global(.ant-pagination-total-text .total) {
|
||||
color: var(--foreground);
|
||||
opacity: 0.5;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,10 +29,6 @@
|
||||
gap: var(--spacing-6);
|
||||
}
|
||||
|
||||
.unsavedText {
|
||||
color: var(--primary);
|
||||
}
|
||||
|
||||
.viewRolePageContent {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
@@ -68,12 +64,6 @@
|
||||
color: var(--l2-foreground);
|
||||
}
|
||||
|
||||
.viewRolePageDivider {
|
||||
width: 100%;
|
||||
height: 1px;
|
||||
background: var(--l1-border);
|
||||
}
|
||||
|
||||
// The one grid row stretches the Tabs root to the height left on the page.
|
||||
.roleTabs {
|
||||
display: grid;
|
||||
|
||||
@@ -15,7 +15,3 @@
|
||||
flex-direction: column;
|
||||
gap: var(--spacing-10);
|
||||
}
|
||||
|
||||
.errorText {
|
||||
padding: var(--spacing-4);
|
||||
}
|
||||
|
||||
@@ -29,13 +29,3 @@ export interface RolePermissionsData {
|
||||
roleDescription: string;
|
||||
resources: ResourcePermissions[];
|
||||
}
|
||||
|
||||
export interface SelectableItem {
|
||||
id: string;
|
||||
label: string;
|
||||
}
|
||||
|
||||
export interface ResourceItemsResult {
|
||||
items: SelectableItem[];
|
||||
isLoading: boolean;
|
||||
}
|
||||
|
||||
@@ -7,7 +7,6 @@ import { SolidAlertTriangle } from '@signozhq/icons';
|
||||
import Flex from 'periscope/components/Flex/Flex';
|
||||
import { Typography } from '@signozhq/ui/typography';
|
||||
import { ResizeTable } from 'components/ResizeTable';
|
||||
import { ENTITY_VERSION_V5 } from 'constants/app';
|
||||
import { MAX_RPS_LIMIT } from 'constants/global';
|
||||
import ResourceAttributesFilter from 'container/ResourceAttributesFilter';
|
||||
import { useGetQueriesRange } from 'hooks/queryBuilder/useGetQueriesRange';
|
||||
@@ -40,7 +39,7 @@ function ServiceMetricTable({
|
||||
const { isFetchingActiveLicense, trialInfo } = useAppContext();
|
||||
const { isCloudUser: isCloudUserVal } = useGetTenantLicense();
|
||||
|
||||
const queries = useGetQueriesRange(queryRangeRequestData, ENTITY_VERSION_V5, {
|
||||
const queries = useGetQueriesRange(queryRangeRequestData, {
|
||||
queryKey: [
|
||||
`GetMetricsQueryRange-${queryRangeRequestData[0]?.selectedTime}-${globalSelectedInterval}`,
|
||||
maxTime,
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { useCallback, useMemo } from 'react';
|
||||
import { QueryKey, useInfiniteQuery } from 'react-query';
|
||||
import { ENTITY_VERSION_V5 } from 'constants/app';
|
||||
import { PANEL_TYPES } from 'constants/queryBuilder';
|
||||
import { DEFAULT_PER_PAGE_VALUE } from 'container/Controls/config';
|
||||
import { TracesTableRow } from 'container/TracesExplorer/TracesTable/getFieldColumn';
|
||||
@@ -64,7 +63,6 @@ export function useListViewInfiniteQuery({
|
||||
},
|
||||
},
|
||||
},
|
||||
ENTITY_VERSION_V5,
|
||||
undefined,
|
||||
signal,
|
||||
),
|
||||
|
||||
@@ -12,7 +12,6 @@ import { useSelector } from 'react-redux';
|
||||
import Space from 'periscope/components/Space/Space';
|
||||
import ErrorInPlace from 'components/ErrorInPlace/ErrorInPlace';
|
||||
import ExportMenu from 'components/ExportMenu/ExportMenu';
|
||||
import { ENTITY_VERSION_V5 } from 'constants/app';
|
||||
import { initialQueriesMap, PANEL_TYPES } from 'constants/queryBuilder';
|
||||
import { REACT_QUERY_KEY } from 'constants/reactQueryKeys';
|
||||
import { QueryTable } from 'container/QueryTable';
|
||||
@@ -71,7 +70,6 @@ function TableView({
|
||||
dataSource: 'traces',
|
||||
},
|
||||
},
|
||||
ENTITY_VERSION_V5,
|
||||
{
|
||||
queryKey,
|
||||
enabled: !!stagedQuery && panelType === PANEL_TYPES.TABLE,
|
||||
|
||||
@@ -12,7 +12,6 @@ import { useSelector } from 'react-redux';
|
||||
import { Typography } from '@signozhq/ui/typography';
|
||||
import logEvent from 'api/common/logEvent';
|
||||
import DownloadOptionsMenu from 'components/DownloadOptionsMenu/DownloadOptionsMenu';
|
||||
import { ENTITY_VERSION_V5 } from 'constants/app';
|
||||
import { LOCALSTORAGE } from 'constants/localStorage';
|
||||
import { initialQueriesMap, PANEL_TYPES } from 'constants/queryBuilder';
|
||||
import { REACT_QUERY_KEY } from 'constants/reactQueryKeys';
|
||||
@@ -102,7 +101,6 @@ function TracesView({
|
||||
pagination: pagination.request,
|
||||
},
|
||||
},
|
||||
ENTITY_VERSION_V5,
|
||||
{
|
||||
queryKey,
|
||||
keepPreviousData: true,
|
||||
|
||||
@@ -19,7 +19,6 @@ import QueryCancelledPlaceholder from 'components/QueryCancelledPlaceholder';
|
||||
import Spinner from 'components/Spinner';
|
||||
import TimePreference from 'components/TimePreferenceDropDown';
|
||||
import WarningPopover from 'components/WarningPopover/WarningPopover';
|
||||
import { ENTITY_VERSION_V5 } from 'constants/app';
|
||||
import { QueryParams } from 'constants/query';
|
||||
import { PANEL_TYPES } from 'constants/queryBuilder';
|
||||
import { PanelMode } from 'lib/visualization/panels/types';
|
||||
@@ -55,7 +54,6 @@ import 'container/WidgetCard/Card/FullView/WidgetFullView.styles.scss';
|
||||
function FullView({
|
||||
widget,
|
||||
fullViewOptions = true,
|
||||
version,
|
||||
originalName,
|
||||
tableProcessedDataRef,
|
||||
isDependedDataLoaded = false,
|
||||
@@ -170,18 +168,11 @@ function FullView({
|
||||
}, [selectedPanelType]);
|
||||
|
||||
const queryRangeKey = useMemo(
|
||||
() => [
|
||||
widget?.query,
|
||||
selectedPanelType,
|
||||
requestData,
|
||||
version,
|
||||
minTime,
|
||||
maxTime,
|
||||
],
|
||||
[widget?.query, selectedPanelType, requestData, version, minTime, maxTime],
|
||||
() => [widget?.query, selectedPanelType, requestData, minTime, maxTime],
|
||||
[widget?.query, selectedPanelType, requestData, minTime, maxTime],
|
||||
);
|
||||
|
||||
const response = useGetQueryRange(requestData, ENTITY_VERSION_V5, {
|
||||
const response = useGetQueryRange(requestData, {
|
||||
queryKey: queryRangeKey,
|
||||
enabled: !isDependedDataLoaded,
|
||||
keepPreviousData: true,
|
||||
|
||||
@@ -24,7 +24,6 @@ export interface FullViewProps {
|
||||
customOnDragSelect?: (start: number, end: number) => void;
|
||||
name: string;
|
||||
tableProcessedDataRef: MutableRefObject<RowData[]>;
|
||||
version?: string;
|
||||
originalName: string;
|
||||
yAxisUnit?: string;
|
||||
isDependedDataLoaded?: boolean;
|
||||
|
||||
@@ -141,7 +141,6 @@ const mockProps: WidgetGraphComponentProps = {
|
||||
remove: jest.fn(),
|
||||
},
|
||||
errorMessage: '',
|
||||
version: 'v4',
|
||||
headerMenuList: [
|
||||
MenuItemKeys.View,
|
||||
MenuItemKeys.Clone,
|
||||
@@ -170,7 +169,6 @@ describe('WidgetGraphComponent', () => {
|
||||
widget={mockProps.widget}
|
||||
queryResponse={mockProps.queryResponse}
|
||||
errorMessage={mockProps.errorMessage}
|
||||
version={mockProps.version}
|
||||
headerMenuList={mockProps.headerMenuList}
|
||||
isWarning={mockProps.isWarning}
|
||||
isFetchingResponse={mockProps.isFetchingResponse}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { RefObject, useEffect, useRef, useState } from 'react';
|
||||
import { useAppLocation } from 'lib/router/useAppLocation';
|
||||
import { Skeleton, Tooltip } from 'antd';
|
||||
import { Typography } from '@signozhq/ui/typography';
|
||||
import cx from 'classnames';
|
||||
import { useNavigateToExplorer } from 'components/CeleryTask/useNavigateToExplorer';
|
||||
import { ToggleGraphProps } from 'components/Graph/types';
|
||||
@@ -38,7 +37,6 @@ import 'container/WidgetCard/WidgetCard.styles.scss';
|
||||
function WidgetGraphComponent({
|
||||
widget,
|
||||
queryResponse,
|
||||
version,
|
||||
threshold,
|
||||
headerMenuList,
|
||||
isWarning,
|
||||
@@ -51,7 +49,6 @@ function WidgetGraphComponent({
|
||||
openTracesButton,
|
||||
onOpenTraceBtnClick,
|
||||
customSeries,
|
||||
customErrorMessage,
|
||||
customOnRowClick,
|
||||
customTimeRangeWindowForCoRelation,
|
||||
enableDrillDown,
|
||||
@@ -209,7 +206,6 @@ function WidgetGraphComponent({
|
||||
>
|
||||
<FullView
|
||||
name={`${widget.id}expanded`}
|
||||
version={version}
|
||||
originalName={widget.id}
|
||||
widget={widget}
|
||||
yAxisUnit={widget.yAxisUnit}
|
||||
@@ -239,21 +235,6 @@ function WidgetGraphComponent({
|
||||
/>
|
||||
</div>
|
||||
|
||||
{queryResponse.error && customErrorMessage && (
|
||||
<div className="error-message-container">
|
||||
<Typography
|
||||
variant="paragraph"
|
||||
size="base"
|
||||
weight="regular"
|
||||
color="warning"
|
||||
as="span"
|
||||
textOverflow="wrap"
|
||||
>
|
||||
{customErrorMessage}
|
||||
</Typography>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{queryResponse.isLoading && widget.panelTypes !== PANEL_TYPES.LIST && (
|
||||
<div data-testid="widget-graph-loading">
|
||||
<Skeleton />
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { prepareQueryRangePayloadV5 } from 'api/v5/queryRange/prepareQueryRangePayloadV5';
|
||||
import { ENTITY_VERSION_V5 } from 'constants/app';
|
||||
import { initialQueriesMap, PANEL_TYPES } from 'constants/queryBuilder';
|
||||
import { getWidgetQueryBuilder } from 'container/MetricsApplication/MetricsApplication.factory';
|
||||
import { GetMetricQueryRange } from 'lib/dashboard/getQueryResults';
|
||||
@@ -87,7 +86,6 @@ describe('GridCardGraph', () => {
|
||||
<GridCardGraph
|
||||
widget={widgetFiltering('name in []')}
|
||||
isQueryEnabled={enabledBefore}
|
||||
version={ENTITY_VERSION_V5}
|
||||
/>,
|
||||
);
|
||||
|
||||
@@ -95,7 +93,6 @@ describe('GridCardGraph', () => {
|
||||
<GridCardGraph
|
||||
widget={widgetFiltering("name in ['GET /']")}
|
||||
isQueryEnabled
|
||||
version={ENTITY_VERSION_V5}
|
||||
/>,
|
||||
);
|
||||
|
||||
@@ -113,10 +110,7 @@ describe('GridCardGraph', () => {
|
||||
widgetFiltering(expression, DataSource.LOGS, PANEL_TYPES.LIST);
|
||||
|
||||
const { rerender } = render(
|
||||
<GridCardGraph
|
||||
widget={logsList("severity_text = 'ERROR'")}
|
||||
version={ENTITY_VERSION_V5}
|
||||
/>,
|
||||
<GridCardGraph widget={logsList("severity_text = 'ERROR'")} />,
|
||||
);
|
||||
|
||||
await user.click(
|
||||
@@ -127,12 +121,7 @@ describe('GridCardGraph', () => {
|
||||
await user.click(await screen.findByText('50 / page'));
|
||||
await waitFor(() => expect(lastRequestedLimit()).toBe(50));
|
||||
|
||||
rerender(
|
||||
<GridCardGraph
|
||||
widget={logsList("severity_text = 'WARN'")}
|
||||
version={ENTITY_VERSION_V5}
|
||||
/>,
|
||||
);
|
||||
rerender(<GridCardGraph widget={logsList("severity_text = 'WARN'")} />);
|
||||
|
||||
await waitFor(() =>
|
||||
expect(requestedFilters()).toContain("severity_text = 'WARN'"),
|
||||
|
||||
@@ -2,7 +2,6 @@ import { memo, useEffect, useMemo, useRef, useState } from 'react';
|
||||
// eslint-disable-next-line no-restricted-imports
|
||||
import { useDispatch, useSelector } from 'react-redux';
|
||||
import logEvent from 'api/common/logEvent';
|
||||
import { ENTITY_VERSION_V5 } from 'constants/app';
|
||||
import { QueryParams } from 'constants/query';
|
||||
import { PANEL_TYPES } from 'constants/queryBuilder';
|
||||
import { useScrollWidgetIntoView } from 'lib/visualization/hooks/useScrollWidgetIntoView';
|
||||
@@ -15,7 +14,6 @@ import getTimeString from 'lib/getTimeString';
|
||||
import isEmpty from 'lodash-es/isEmpty';
|
||||
import { UpdateTimeInterval } from 'store/actions';
|
||||
import { AppState } from 'store/reducers';
|
||||
import APIError from 'types/api/error';
|
||||
import { DataSource } from 'types/common/queryBuilder';
|
||||
import { GlobalReducer } from 'types/reducer/globalTime';
|
||||
import { getGraphType } from 'utils/getGraphType';
|
||||
@@ -41,7 +39,6 @@ function GridCardGraph({
|
||||
headerMenuList = [MenuItemKeys.View],
|
||||
isQueryEnabled,
|
||||
threshold,
|
||||
version,
|
||||
onClickHandler,
|
||||
onDragSelect,
|
||||
customOnDragSelect,
|
||||
@@ -62,8 +59,6 @@ function GridCardGraph({
|
||||
}: GridCardGraphProps): JSX.Element {
|
||||
const dispatch = useDispatch();
|
||||
const [errorMessage, setErrorMessage] = useState<string>();
|
||||
const [isInternalServerError, setIsInternalServerError] =
|
||||
useState<boolean>(false);
|
||||
const {
|
||||
minTime,
|
||||
maxTime,
|
||||
@@ -171,7 +166,6 @@ function GridCardGraph({
|
||||
end: customTimeRange?.endTime || end,
|
||||
originalGraphType: widget?.panelTypes,
|
||||
},
|
||||
version || ENTITY_VERSION_V5,
|
||||
{
|
||||
queryKey: [
|
||||
REACT_QUERY_KEY.DASHBOARD_GRID_CARD_QUERY_RANGE,
|
||||
@@ -188,16 +182,7 @@ function GridCardGraph({
|
||||
? [customTimeRange.startTime, customTimeRange.endTime]
|
||||
: []),
|
||||
],
|
||||
retry(failureCount, error): boolean {
|
||||
if (
|
||||
String(error).includes('status: error') &&
|
||||
String(error).includes('i/o timeout')
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return failureCount < 2;
|
||||
},
|
||||
retry: 2,
|
||||
keepPreviousData: true,
|
||||
cacheTime: isAutoRefreshDisabled
|
||||
? DASHBOARD_CACHE_TIME
|
||||
@@ -205,21 +190,11 @@ function GridCardGraph({
|
||||
enabled: queryEnabledCondition,
|
||||
refetchOnMount: false,
|
||||
onError: (error) => {
|
||||
const errorMessage =
|
||||
version === ENTITY_VERSION_V5
|
||||
? errorDetails(error as APIError)
|
||||
: error.message;
|
||||
|
||||
setErrorMessage(errorMessage);
|
||||
if (customErrorMessage) {
|
||||
setIsInternalServerError(
|
||||
String(error.message).includes('API responded with 500'),
|
||||
);
|
||||
if (analyticsEvent) {
|
||||
void logEvent(analyticsEvent, {
|
||||
error: error.message,
|
||||
});
|
||||
}
|
||||
setErrorMessage(errorDetails(error));
|
||||
if (customErrorMessage && analyticsEvent) {
|
||||
void logEvent(analyticsEvent, {
|
||||
error: error.message,
|
||||
});
|
||||
}
|
||||
},
|
||||
onSettled: (data) => {
|
||||
@@ -262,7 +237,6 @@ function GridCardGraph({
|
||||
queryResponse={queryResponse}
|
||||
errorMessage={errorMessage}
|
||||
isWarning={!isEmpty(queryResponse.data?.warning)}
|
||||
version={version}
|
||||
threshold={threshold}
|
||||
headerMenuList={menuList}
|
||||
isFetchingResponse={queryResponse.isFetching}
|
||||
@@ -274,7 +248,6 @@ function GridCardGraph({
|
||||
openTracesButton={openTracesButton}
|
||||
onOpenTraceBtnClick={onOpenTraceBtnClick}
|
||||
customSeries={customSeries}
|
||||
customErrorMessage={isInternalServerError ? customErrorMessage : undefined}
|
||||
customOnRowClick={customOnRowClick}
|
||||
customTimeRangeWindowForCoRelation={customTimeRangeWindowForCoRelation}
|
||||
enableDrillDown={enableDrillDown}
|
||||
@@ -290,7 +263,6 @@ GridCardGraph.defaultProps = {
|
||||
isQueryEnabled: true,
|
||||
threshold: undefined,
|
||||
headerMenuList: [MenuItemKeys.View],
|
||||
version: ENTITY_VERSION_V5,
|
||||
analyticsEvent: undefined,
|
||||
customTimeRangeWindowForCoRelation: undefined,
|
||||
enableDrillDown: false,
|
||||
|
||||
@@ -23,7 +23,6 @@ export interface WidgetGraphComponentProps {
|
||||
widget: Widgets;
|
||||
queryResponse: UseQueryResult<MetricQueryRangeSuccessResponse, Error>;
|
||||
errorMessage: string | undefined;
|
||||
version?: string;
|
||||
threshold?: ReactNode;
|
||||
headerMenuList: MenuItemKeys[];
|
||||
isWarning: boolean;
|
||||
@@ -36,7 +35,6 @@ export interface WidgetGraphComponentProps {
|
||||
openTracesButton?: boolean;
|
||||
onOpenTraceBtnClick?: (record: RowData) => void;
|
||||
customSeries?: (data: QueryData[]) => uPlot.Series[];
|
||||
customErrorMessage?: string;
|
||||
customOnRowClick?: (record: RowData) => void;
|
||||
customTimeRangeWindowForCoRelation?: string | undefined;
|
||||
enableDrillDown?: boolean;
|
||||
@@ -50,7 +48,6 @@ export interface GridCardGraphProps {
|
||||
headerMenuList?: WidgetGraphComponentProps['headerMenuList'];
|
||||
onClickHandler?: OnClickPluginOpts['onClick'];
|
||||
isQueryEnabled: boolean;
|
||||
version?: string;
|
||||
onDragSelect: (start: number, end: number) => void;
|
||||
customOnDragSelect?: (start: number, end: number) => void;
|
||||
customTooltipElement?: HTMLDivElement;
|
||||
|
||||
@@ -15,7 +15,7 @@ function ValuePanelWrapper({
|
||||
?.rows?.[0]?.data || {},
|
||||
);
|
||||
|
||||
// this is for handling both query_range v3 and v5 responses
|
||||
// a value panel gets a scalar response, which has no series, only a table row
|
||||
const gridValueData = data?.[0].length > 0 ? data : [[0], dataNew];
|
||||
|
||||
return (
|
||||
|
||||
@@ -24,16 +24,6 @@
|
||||
}
|
||||
}
|
||||
|
||||
.error-message-container {
|
||||
display: flex;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
padding-top: 0;
|
||||
padding-bottom: 32px;
|
||||
}
|
||||
|
||||
.row-settings {
|
||||
.ant-popover-inner {
|
||||
width: 191px;
|
||||
|
||||
@@ -2,7 +2,6 @@ import { MutableRefObject, useMemo } from 'react';
|
||||
import { UseQueryOptions, UseQueryResult } from 'react-query';
|
||||
// eslint-disable-next-line no-restricted-imports
|
||||
import { useSelector } from 'react-redux';
|
||||
import { ENTITY_VERSION_V5 } from 'constants/app';
|
||||
import { initialQueriesMap, PANEL_TYPES } from 'constants/queryBuilder';
|
||||
import { REACT_QUERY_KEY } from 'constants/reactQueryKeys';
|
||||
import { GetQueryResultsProps } from 'lib/dashboard/getQueryResults';
|
||||
@@ -17,7 +16,6 @@ import { useQueryBuilder } from './useQueryBuilder';
|
||||
export const useGetExplorerQueryRange = (
|
||||
requestData: Query | null,
|
||||
panelType: PANEL_TYPES | null,
|
||||
version: string,
|
||||
options?: UseQueryOptions<MetricQueryRangeSuccessResponse, Error>,
|
||||
params?: Record<string, unknown>,
|
||||
isDependentOnQB = true,
|
||||
@@ -61,8 +59,6 @@ export const useGetExplorerQueryRange = (
|
||||
query: requestData || initialQueriesMap.metrics,
|
||||
params,
|
||||
},
|
||||
// version,
|
||||
ENTITY_VERSION_V5,
|
||||
{
|
||||
...options,
|
||||
queryKey: [key, globalSelectedInterval, requestData, minTime, maxTime],
|
||||
|
||||
@@ -15,7 +15,6 @@ import { MetricRangePayloadProps } from 'types/api/metrics/getQueryRange';
|
||||
|
||||
export const useGetQueriesRange = (
|
||||
requestData: GetQueryResultsProps[],
|
||||
version: string,
|
||||
options: UseQueryOptions<SuccessResponse<MetricRangePayloadProps>, Error>,
|
||||
): UseQueryResult<SuccessResponse<MetricRangePayloadProps>, Error>[] => {
|
||||
const queryKey = useMemo(() => {
|
||||
@@ -27,7 +26,7 @@ export const useGetQueriesRange = (
|
||||
|
||||
const queryData = requestData.map((request, index) => ({
|
||||
queryFn: async (): Promise<SuccessResponse<MetricRangePayloadProps>> =>
|
||||
GetMetricQueryRange(request, version),
|
||||
GetMetricQueryRange(request),
|
||||
...options,
|
||||
queryKey: [...queryKey, index] as QueryKey,
|
||||
}));
|
||||
|
||||
@@ -22,14 +22,12 @@ type UseGetQueryRangeOptions = UseQueryOptions<
|
||||
|
||||
type UseGetQueryRange = (
|
||||
requestData: GetQueryResultsProps,
|
||||
version: string,
|
||||
options?: UseGetQueryRangeOptions,
|
||||
headers?: Record<string, string>,
|
||||
) => UseQueryResult<MetricQueryRangeSuccessResponse, Error>;
|
||||
|
||||
export const useGetQueryRange: UseGetQueryRange = (
|
||||
requestData,
|
||||
version,
|
||||
options,
|
||||
headers,
|
||||
) => {
|
||||
@@ -150,7 +148,6 @@ export const useGetQueryRange: UseGetQueryRange = (
|
||||
queryFn: async ({ signal }) =>
|
||||
GetMetricQueryRange(
|
||||
modifiedRequestData,
|
||||
version,
|
||||
dashboardDynamicVariables,
|
||||
signal,
|
||||
headers,
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { useEffect, useMemo, useState } from 'react';
|
||||
// eslint-disable-next-line no-restricted-imports
|
||||
import { useSelector } from 'react-redux';
|
||||
import { ENTITY_VERSION_V5 } from 'constants/app';
|
||||
import { QueryParams } from 'constants/query';
|
||||
import {
|
||||
initialQueryBuilderFormValues,
|
||||
@@ -141,7 +140,6 @@ export const useLogsData = ({
|
||||
const { data, isFetching } = useGetExplorerQueryRange(
|
||||
requestData,
|
||||
panelType,
|
||||
ENTITY_VERSION_V5,
|
||||
{
|
||||
keepPreviousData: true,
|
||||
enabled: !isLimit && !!requestData,
|
||||
|
||||
@@ -2,7 +2,3 @@
|
||||
box-sizing: border-box;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.permission {
|
||||
color: var(--l2-foreground);
|
||||
}
|
||||
|
||||
@@ -88,8 +88,3 @@
|
||||
align-items: center;
|
||||
gap: var(--spacing-2);
|
||||
}
|
||||
|
||||
.count {
|
||||
flex: 0 0 auto;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
@@ -47,15 +47,6 @@
|
||||
--typography-color: var(--accent-primary);
|
||||
}
|
||||
|
||||
.separator {
|
||||
flex: 0 0 auto;
|
||||
}
|
||||
|
||||
.object {
|
||||
flex: 0 1 auto;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.permissionMeta {
|
||||
display: flex;
|
||||
flex: 0 0 auto;
|
||||
|
||||
@@ -14,11 +14,6 @@ export type ObservedPermission = {
|
||||
lastSeen: number;
|
||||
};
|
||||
|
||||
export type PermissionOverride = {
|
||||
permission: BrandedPermission;
|
||||
state: OverrideState;
|
||||
};
|
||||
|
||||
export type AuthZDevStore = {
|
||||
isModalOpen: boolean;
|
||||
observed: Record<string, ObservedPermission>;
|
||||
|
||||
@@ -12,8 +12,6 @@ export const buildUserDeletePermission = (id: string): BrandedPermission =>
|
||||
buildPermission('delete', `user:${id}`);
|
||||
const buildUserAttachPermission = (id: string): BrandedPermission =>
|
||||
buildPermission('attach', `user:${id}`);
|
||||
export const buildUserDetachPermission = (id: string): BrandedPermission =>
|
||||
buildPermission('detach', `user:${id}`);
|
||||
|
||||
const PasswordCreatePermission = buildPermission('create', 'factor-password:*');
|
||||
export const PasswordListPermission = buildPermission(
|
||||
|
||||
@@ -6,7 +6,6 @@ import {
|
||||
getQueryRangeV5,
|
||||
prepareQueryRangePayloadV5,
|
||||
} from 'api/v5/v5';
|
||||
import { ENTITY_VERSION_V5 } from 'constants/app';
|
||||
import { PANEL_TYPES } from 'constants/queryBuilder';
|
||||
import { timePreferenceType } from 'constants/timePreference';
|
||||
import {
|
||||
@@ -170,7 +169,6 @@ export const getLegend = (
|
||||
// eslint-disable-next-line sonarjs/cognitive-complexity
|
||||
export async function GetMetricQueryRange(
|
||||
props: GetQueryResultsProps,
|
||||
version: string,
|
||||
dynamicVariables: DynamicVariableSuggestion[] = [],
|
||||
signal?: AbortSignal,
|
||||
headers?: Record<string, string>,
|
||||
@@ -234,7 +232,6 @@ export async function GetMetricQueryRange(
|
||||
|
||||
const v5Response = await getQueryRangeV5(
|
||||
v5Result.queryPayload,
|
||||
ENTITY_VERSION_V5,
|
||||
signal,
|
||||
headers,
|
||||
);
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user