Skip to content

Commit 56e39dc

Browse files
authored
fix: remove several source change forms throughout the log drawer (#730)
1 parent db761ba commit 56e39dc

File tree

5 files changed

+9
-68
lines changed

5 files changed

+9
-68
lines changed

.changeset/big-rules-think.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@hyperdx/app": patch
3+
---
4+
5+
36c3edc fix: remove several source change forms throughout the log drawer

packages/app/src/components/DBRowOverviewPanel.tsx

-1
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,6 @@ export function RowOverviewPanel({
123123
{!hideHeader && (
124124
<Box px="32px" pt="md">
125125
<DBRowSidePanelHeader
126-
sourceId={source.id}
127126
date={new Date(firstRow?.__hdx_timestamp ?? 0)}
128127
tags={{}}
129128
mainContent={mainContent}

packages/app/src/components/DBRowSidePanel.tsx

-1
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,6 @@ export default function DBRowSidePanel({
247247
<>
248248
<Box p="sm">
249249
<DBRowSidePanelHeader
250-
sourceId={source.id}
251250
date={timestampDate}
252251
tags={tags}
253252
mainContent={mainContent}

packages/app/src/components/DBRowSidePanelHeader.tsx

+4-33
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,9 @@ import React, {
55
useRef,
66
useState,
77
} from 'react';
8-
import { Box, Button, Flex, Modal, Paper, Popover, Text } from '@mantine/core';
8+
import { Button, Flex, Paper, Text } from '@mantine/core';
99

1010
import EventTag from '@/components/EventTag';
11-
import { TableSourceForm } from '@/components/SourceForm';
1211
import { FormatTime } from '@/useFormatTime';
1312
import { useUserPreferences } from '@/useUserPreferences';
1413
import { formatDistanceToNowStrictShort } from '@/utils';
@@ -20,37 +19,13 @@ const isValidDate = (date: Date) => 'getTime' in date && !isNaN(date.getTime());
2019

2120
const MAX_MAIN_CONTENT_LENGTH = 2000;
2221

23-
const EditButton = ({
24-
sourceId,
25-
label,
26-
}: {
27-
sourceId: string;
28-
label?: string;
29-
}) => {
30-
return (
31-
<Popover width={600} position="bottom" withArrow withinPortal={false}>
32-
<Popover.Target>
33-
<Button size="compact-xs" variant="subtle" color="gray">
34-
<i className="bi bi-gear-fill fs-8.5" />
35-
{label && <span className="ms-2">{label}</span>}
36-
</Button>
37-
</Popover.Target>
38-
<Popover.Dropdown>
39-
<TableSourceForm sourceId={sourceId} />
40-
</Popover.Dropdown>
41-
</Popover>
42-
);
43-
};
44-
4522
export default function DBRowSidePanelHeader({
46-
sourceId,
4723
tags,
4824
mainContent = '',
4925
mainContentHeader,
5026
date,
5127
severityText,
5228
}: {
53-
sourceId: string;
5429
date: Date;
5530
mainContent?: string;
5631
mainContentHeader?: string;
@@ -137,12 +112,9 @@ export default function DBRowSidePanelHeader({
137112
ref={headerRef}
138113
>
139114
<Flex justify="space-between" mb="xs">
140-
<Flex align="baseline" gap={2}>
141-
<Text size="xs" c="gray.4">
142-
{mainContentHeader}
143-
</Text>
144-
<EditButton sourceId={sourceId} />
145-
</Flex>
115+
<Text size="xs" c="gray.4">
116+
{mainContentHeader}
117+
</Text>
146118
{/* Toggles expanded sidebar header*/}
147119
{headerHeight >= maxBoxHeight && (
148120
<Button
@@ -184,7 +156,6 @@ export default function DBRowSidePanelHeader({
184156
<Text size="xs" c="gray.4" mb="xs">
185157
[Empty]
186158
</Text>
187-
<EditButton sourceId={sourceId} label="Set body expression" />
188159
</Paper>
189160
)}
190161
<Flex mt="sm">

packages/app/src/components/DBTracePanel.tsx

-33
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import { useForm } from 'react-hook-form';
44
import { tcFromSource } from '@hyperdx/common-utils/dist/metadata';
55
import { SourceKind } from '@hyperdx/common-utils/dist/types';
66
import {
7-
ActionIcon,
87
Button,
98
Center,
109
Divider,
@@ -14,15 +13,13 @@ import {
1413
Stack,
1514
Text,
1615
} from '@mantine/core';
17-
import { useDisclosure } from '@mantine/hooks';
1816

1917
import { DBTraceWaterfallChartContainer } from '@/components/DBTraceWaterfallChart';
2018
import { useSource, useUpdateSource } from '@/source';
2119
import TabBar from '@/TabBar';
2220

2321
import { RowDataPanel } from './DBRowDataPanel';
2422
import { RowOverviewPanel } from './DBRowOverviewPanel';
25-
import { TableSourceForm } from './SourceForm';
2623
import { SourceSelectControlled } from './SourceSelect';
2724
import { SQLInlineEditorControlled } from './SQLInlineEditor';
2825

@@ -103,22 +100,6 @@ export default function DBTracePanel({
103100
}, [parentSourceData?.traceIdExpression, traceIdSetValue]);
104101

105102
const [showTraceIdInput, setShowTraceIdInput] = useState(false);
106-
const [showSourceForm, setShowSourceForm] = useState(false);
107-
useEffect(() => {
108-
if (
109-
isTraceSourceLoading == false &&
110-
(traceSourceData == null ||
111-
traceSourceData?.kind == 'log' ||
112-
traceSourceData?.durationExpression == null)
113-
) {
114-
setShowSourceForm(true);
115-
}
116-
}, [showSourceForm, traceSourceData, isTraceSourceLoading]);
117-
118-
const [
119-
sourceFormModalOpened,
120-
{ open: openSourceFormModal, close: closeSourceFormModal },
121-
] = useDisclosure(false);
122103

123104
// Reset highlighted row when trace ID changes
124105
// otherwise we'll show stale span details
@@ -155,19 +136,6 @@ export default function DBTracePanel({
155136
: 'Correlated Log Source'}
156137
</Text>
157138
<SourceSelectControlled control={control} name="source" size="xs" />
158-
<ActionIcon
159-
variant="subtle"
160-
color="dark.2"
161-
size="sm"
162-
onClick={
163-
sourceFormModalOpened ? closeSourceFormModal : openSourceFormModal
164-
}
165-
title="Edit Source"
166-
>
167-
<Text size="xs">
168-
<i className="bi bi-gear" />
169-
</Text>
170-
</ActionIcon>
171139
</Group>
172140
</Flex>
173141
{(showTraceIdInput || !traceId) && parentSourceId != null && (
@@ -214,7 +182,6 @@ export default function DBTracePanel({
214182
</Stack>
215183
)}
216184
<Divider my="sm" />
217-
{sourceFormModalOpened && <TableSourceForm sourceId={watch('source')} />}
218185
{traceSourceData?.kind === SourceKind.Trace && (
219186
<DBTraceWaterfallChartContainer
220187
traceTableSource={traceSourceData}

0 commit comments

Comments
 (0)