Skip to content

Commit bbd9bb5

Browse files
committed
Remove buttons that changes sorting
1 parent 0a57acf commit bbd9bb5

File tree

3 files changed

+2
-56
lines changed

3 files changed

+2
-56
lines changed

src/components/App/ObservabilityQueryLanguageComponent.tsx

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -252,20 +252,6 @@ export default function ObservabilityQueryLanguageComponent() {
252252
setActiveQuery(q);
253253
}, [query, tableDefinitions, currentTable]);
254254

255-
const onOrderChange = useCallback((columnName: string, order: string) => {
256-
257-
const newOrderBy = `|> ORDER BY ${columnName} ${order}`;
258-
const lines = query.split('\n');
259-
const index = lines.map((line: string) => line.toLowerCase().startsWith('|> order by')).lastIndexOf(true);
260-
if (index !== -1) {
261-
lines[index] = newOrderBy;
262-
} else {
263-
lines.push(newOrderBy);
264-
}
265-
const q = lines.join('\n');
266-
setQuery(q);
267-
setActiveQuery(q);
268-
}, [query]);
269255

270256
const handleAiModalAccept = useCallback((query: string) => {
271257
console.log("handleAiModalAccept", query);
@@ -396,7 +382,6 @@ export default function ObservabilityQueryLanguageComponent() {
396382
tabularResult={tabularResult}
397383
transpiledSQL={transpiledSQL}
398384
onFilterChange={onFilterChange}
399-
onOrderChange={onOrderChange}
400385
/>
401386
</div>
402387

src/components/result/ResultTable.tsx

Lines changed: 1 addition & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -225,10 +225,9 @@ function CompactCell({ columns, cells, startIndex, onFilterChange }: { columns:
225225
interface ResultTableProps {
226226
tabularResult: TabularResult | null;
227227
onFilterChange: (columnName: string, value: string, operator: string) => void;
228-
onOrderChange: (columnName: string, order: string) => void;
229228
}
230229

231-
export function ResultTable({ tabularResult, onFilterChange, onOrderChange }: ResultTableProps) {
230+
export function ResultTable({ tabularResult, onFilterChange }: ResultTableProps) {
232231
const [selectedRow, setSelectedRow] = useState<number | null>(null);
233232
const [isDetailOpen, setIsDetailOpen] = useState(false);
234233
const [hoveredRow, setHoveredRow] = useState<number | null>(null);
@@ -280,42 +279,6 @@ export function ResultTable({ tabularResult, onFilterChange, onOrderChange }: Re
280279
gap: '8px'
281280
}}>
282281
<div style={{ flex: 1, textAlign: 'center' }}>{column}</div>
283-
{column !== 'More Details' && (
284-
<div style={{ display: 'flex', gap: '4px', alignItems: 'center', flexShrink: 0 }}>
285-
<div style={{ display: 'flex', alignItems: 'center' }}>
286-
<button
287-
onClick={(e) => {
288-
e.stopPropagation();
289-
onOrderChange(column, 'ASC');
290-
}}
291-
style={{
292-
border: 'none',
293-
background: 'none',
294-
cursor: 'pointer',
295-
padding: '2px 0',
296-
color: '#ccccdc'
297-
}}
298-
>
299-
300-
</button>
301-
<button
302-
onClick={(e) => {
303-
e.stopPropagation();
304-
onOrderChange(column, 'DESC');
305-
}}
306-
style={{
307-
border: 'none',
308-
background: 'none',
309-
cursor: 'pointer',
310-
padding: '2px 0',
311-
color: '#ccccdc'
312-
}}
313-
>
314-
315-
</button>
316-
</div>
317-
</div>
318-
)}
319282
</div>
320283
</TableCell>
321284
))}

src/components/result/Results.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,9 @@ interface ResultsProps {
88
tabularResult: TabularResult | null;
99
transpiledSQL: string | null;
1010
onFilterChange: (columnName: string, value: string, operator: string) => void;
11-
onOrderChange: (columnName: string, order: string) => void;
1211
}
1312

14-
export function Results({ tabularResult, transpiledSQL, onFilterChange, onOrderChange }: ResultsProps) {
13+
export function Results({ tabularResult, transpiledSQL, onFilterChange}: ResultsProps) {
1514
const [showChart, setShowChart] = useState(false);
1615
const [canShowChart, setCanShowChart] = useState(false);
1716
const [showSQL, setShowSQL] = useState(false);
@@ -131,7 +130,6 @@ export function Results({ tabularResult, transpiledSQL, onFilterChange, onOrderC
131130
<ResultTable
132131
tabularResult={tabularResult}
133132
onFilterChange={onFilterChange}
134-
onOrderChange={onOrderChange}
135133
/>
136134
)}
137135
</div>

0 commit comments

Comments
 (0)