SigNoz is an open-source, OpenTelemetry-native observability platform for your team and their AI agents. Get logs, metrics, and traces in one tool with features like APM, distributed tracing, log management, infra monitoring, etc. Combined with SigNoz MCP and a native AI teammate (in SigNoz Cloud) it helps you build more resilient apps.
TypeScript apmapplication-monitoringdistributed-tracinggogood-first-issuejaegerloglogsmetricsmonitoringnextjsobservabilityopen-sourceopentelemetryprometheusreactreactjsself-hostedtracingtypescript
feat: add override can edit dashboard (#12580)
Gaurav Tewari7bcfaab35e9a
diff --git a/frontend/src/container/LLMObservability/Overview/Overview.tsx b/frontend/src/container/LLMObservability/Overview/Overview.tsxindex 880af02048..9a9e8deb35 100644--- a/frontend/src/container/LLMObservability/Overview/Overview.tsx+++ b/frontend/src/container/LLMObservability/Overview/Overview.tsx@@ -9,7 +9,11 @@ function Overview(): JSX.Element {return (<div className={styles.overview} data-testid="llm-observability-overview">- <DashboardContainer dashboard={dashboard} refetch={refetch} />+ <DashboardContainer+ dashboard={dashboard}+ refetch={refetch}+ canEditDashboardOverride={false}+ /></div>);}diff --git a/frontend/src/container/LLMObservability/Overview/json/dashboard.json b/frontend/src/container/LLMObservability/Overview/json/dashboard.jsonindex 3936e5856d..5b9b55382f 100644--- a/frontend/src/container/LLMObservability/Overview/json/dashboard.json+++ b/frontend/src/container/LLMObservability/Overview/json/dashboard.json@@ -1,7 +1,7 @@{"id": "llm-observability-overview","orgId": "",- "locked": true,+ "locked": false,"name": "AI Observability Overview","schemaVersion": "v6","source": "system",@@ -1146,4 +1146,4 @@}]}-}+}\ No newline at end of filediff --git a/frontend/src/pages/DashboardPageV2/DashboardContainer/DashboardPageToolbar/DashboardActions/DashboardActions.tsx b/frontend/src/pages/DashboardPageV2/DashboardContainer/DashboardPageToolbar/DashboardActions/DashboardActions.tsxindex 5d17a98e99..ed84f2455e 100644--- a/frontend/src/pages/DashboardPageV2/DashboardContainer/DashboardPageToolbar/DashboardActions/DashboardActions.tsx+++ b/frontend/src/pages/DashboardPageV2/DashboardContainer/DashboardPageToolbar/DashboardActions/DashboardActions.tsx@@ -189,7 +189,8 @@ function DashboardActions({onClick: (): void => void handleClone(),});}- if (isAuthor || user.role === USER_ROLES.ADMIN) {++ if (canEditDashboard && (isAuthor || user.role === USER_ROLES.ADMIN)) {dashboardGroup.push({key: 'lock',label: isDashboardLocked ? 'Unlock dashboard' : 'Lock dashboard',diff --git a/frontend/src/pages/DashboardPageV2/DashboardContainer/index.tsx b/frontend/src/pages/DashboardPageV2/DashboardContainer/index.tsxindex ad933e8da6..c443ba8a2c 100644--- a/frontend/src/pages/DashboardPageV2/DashboardContainer/index.tsx+++ b/frontend/src/pages/DashboardPageV2/DashboardContainer/index.tsx@@ -19,11 +19,20 @@ import { resolveDashboardImage } from 'pages/DashboardPageV2/DashboardContainer/interface DashboardContainerProps {dashboard: DashboardtypesGettableDashboardV2DTO;refetch: () => void;+ /**+ * @deprecated+ * `canEditDashboardOverride` is a temporary solution to allow the dashboard to be view only.+ * This is only used for LLM Observability.+ * It will be removed in the future.+ * TODO: @Ashwin / @Abhi — remove when the final solution is implemented.+ */+ canEditDashboardOverride?: boolean;}function DashboardContainer({dashboard,refetch,+ canEditDashboardOverride,}: DashboardContainerProps): JSX.Element {const spec = dashboard.spec;const image = resolveDashboardImage(dashboard.image);@@ -45,10 +54,11 @@ function DashboardContainer({// Seed during render (not an effect) so the first Panel render already sees the id —// useDashboardFetchRequired throws on a missing id. setEditContext self-guards.const setEditContext = useDashboardStore((s) => s.setEditContext);+setEditContext({dashboardId: dashboard.id,isLocked,- canEditDashboard,+ canEditDashboard: canEditDashboardOverride ?? canEditDashboard,refetch,});