Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 0 additions & 15 deletions src/components/App/ObservabilityQueryLanguageComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -252,20 +252,6 @@ export default function ObservabilityQueryLanguageComponent() {
setActiveQuery(q);
}, [query, tableDefinitions, currentTable]);

const onOrderChange = useCallback((columnName: string, order: string) => {

const newOrderBy = `|> ORDER BY ${columnName} ${order}`;
const lines = query.split('\n');
const index = lines.map((line: string) => line.toLowerCase().startsWith('|> order by')).lastIndexOf(true);
if (index !== -1) {
lines[index] = newOrderBy;
} else {
lines.push(newOrderBy);
}
const q = lines.join('\n');
setQuery(q);
setActiveQuery(q);
}, [query]);

const handleAiModalAccept = useCallback((query: string) => {
console.log("handleAiModalAccept", query);
Expand Down Expand Up @@ -396,7 +382,6 @@ export default function ObservabilityQueryLanguageComponent() {
tabularResult={tabularResult}
transpiledSQL={transpiledSQL}
onFilterChange={onFilterChange}
onOrderChange={onOrderChange}
/>
</div>

Expand Down
39 changes: 1 addition & 38 deletions src/components/result/ResultTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -225,10 +225,9 @@ function CompactCell({ columns, cells, startIndex, onFilterChange }: { columns:
interface ResultTableProps {
tabularResult: TabularResult | null;
onFilterChange: (columnName: string, value: string, operator: string) => void;
onOrderChange: (columnName: string, order: string) => void;
}

export function ResultTable({ tabularResult, onFilterChange, onOrderChange }: ResultTableProps) {
export function ResultTable({ tabularResult, onFilterChange }: ResultTableProps) {
const [selectedRow, setSelectedRow] = useState<number | null>(null);
const [isDetailOpen, setIsDetailOpen] = useState(false);
const [hoveredRow, setHoveredRow] = useState<number | null>(null);
Expand Down Expand Up @@ -280,42 +279,6 @@ export function ResultTable({ tabularResult, onFilterChange, onOrderChange }: Re
gap: '8px'
}}>
<div style={{ flex: 1, textAlign: 'center' }}>{column}</div>
{column !== 'More Details' && (
<div style={{ display: 'flex', gap: '4px', alignItems: 'center', flexShrink: 0 }}>
<div style={{ display: 'flex', alignItems: 'center' }}>
<button
onClick={(e) => {
e.stopPropagation();
onOrderChange(column, 'ASC');
}}
style={{
border: 'none',
background: 'none',
cursor: 'pointer',
padding: '2px 0',
color: '#ccccdc'
}}
>
</button>
<button
onClick={(e) => {
e.stopPropagation();
onOrderChange(column, 'DESC');
}}
style={{
border: 'none',
background: 'none',
cursor: 'pointer',
padding: '2px 0',
color: '#ccccdc'
}}
>
</button>
</div>
</div>
)}
</div>
</TableCell>
))}
Expand Down
4 changes: 1 addition & 3 deletions src/components/result/Results.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,9 @@ interface ResultsProps {
tabularResult: TabularResult | null;
transpiledSQL: string | null;
onFilterChange: (columnName: string, value: string, operator: string) => void;
onOrderChange: (columnName: string, order: string) => void;
}

export function Results({ tabularResult, transpiledSQL, onFilterChange, onOrderChange }: ResultsProps) {
export function Results({ tabularResult, transpiledSQL, onFilterChange}: ResultsProps) {
const [showChart, setShowChart] = useState(false);
const [canShowChart, setCanShowChart] = useState(false);
const [showSQL, setShowSQL] = useState(false);
Expand Down Expand Up @@ -131,7 +130,6 @@ export function Results({ tabularResult, transpiledSQL, onFilterChange, onOrderC
<ResultTable
tabularResult={tabularResult}
onFilterChange={onFilterChange}
onOrderChange={onOrderChange}
/>
)}
</div>
Expand Down
Loading