Skip to content

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.

feat: editor is updated in error details page

Palash gupta08e34287440c
diff --git a/frontend/src/components/Editor/index.tsx b/frontend/src/components/Editor/index.tsx
index 9e7593e1ba..0ed486e248 100644
--- a/frontend/src/components/Editor/index.tsx
+++ b/frontend/src/components/Editor/index.tsx
@@ -5,13 +5,14 @@ function Editor({
value,
language = 'yaml',
onChange,
+ readOnly = false,
}: EditorProps): JSX.Element {
return (
<MEditor
theme="vs-dark"
language={language}
value={value}
- options={{ fontSize: 16, automaticLayout: true }}
+ options={{ fontSize: 16, automaticLayout: true, readOnly }}
height="40vh"
onChange={(newValue): void => {
if (newValue) {
@@ -26,10 +27,12 @@ interface EditorProps {
value: string;
language?: string;
onChange: (value: string) => void;
+ readOnly?: boolean;
}
Editor.defaultProps = {
language: undefined,
+ readOnly: false,
};
export default Editor;
diff --git a/frontend/src/container/ErrorDetails/index.tsx b/frontend/src/container/ErrorDetails/index.tsx
index cdb9800620..702967fa08 100644
--- a/frontend/src/container/ErrorDetails/index.tsx
+++ b/frontend/src/container/ErrorDetails/index.tsx
@@ -2,7 +2,7 @@ import { Button, Divider, notification, Space, Table, Typography } from 'antd';
import Editor from 'components/Editor';
import dayjs from 'dayjs';
import history from 'lib/history';
-import React, { useMemo, useRef, useState } from 'react';
+import React, { useMemo, useState } from 'react';
import { useTranslation } from 'react-i18next';
import { useLocation } from 'react-router-dom';
import { PayloadProps as GetByErrorTypeAndServicePayload } from 'types/api/errors/getByErrorTypeAndService';
@@ -21,7 +21,7 @@ function ErrorDetails(props: ErrorDetailsProps): JSX.Element {
const errorDetail = idPayload;
- const stackTraceValue = useRef(errorDetail.excepionStacktrace);
+ const [stackTraceValue] = useState(errorDetail.excepionStacktrace);
const columns = useMemo(
() => [
@@ -126,7 +126,6 @@ function ErrorDetails(props: ErrorDetailsProps): JSX.Element {
>
{t('newer')}
</Button>
- {/* <Button icon={<RightOutlined />} /> */}
</Space>
</div>
</EventContainer>
@@ -139,7 +138,7 @@ function ErrorDetails(props: ErrorDetailsProps): JSX.Element {
</DashedContainer>
<Typography.Title level={4}>{t('stack_trace')}</Typography.Title>
- <Editor value={stackTraceValue} readOnly />
+ <Editor onChange={(): void => {}} value={stackTraceValue} readOnly />
<EditorContainer>
<Space direction="vertical">