Loki: Remove range options from query builder (#102566)
* Loki: Remove range options from query builder * Loki: Improve description * Loki: Fix test * Loki: Add default `$__auto` * Loki: Fix test
This commit is contained in:
@@ -151,7 +151,7 @@ describe('LokiQueryEditorSelector', () => {
|
||||
it('parses query when changing to builder mode', async () => {
|
||||
const { rerender } = renderWithProps({
|
||||
refId: 'A',
|
||||
expr: 'rate({instance="host.docker.internal:3000"}[$__interval])',
|
||||
expr: 'rate({instance="host.docker.internal:3000"}[$__auto])',
|
||||
editorMode: QueryEditorMode.Code,
|
||||
});
|
||||
await expectCodeEditor();
|
||||
@@ -161,7 +161,7 @@ describe('LokiQueryEditorSelector', () => {
|
||||
{...defaultProps}
|
||||
query={{
|
||||
refId: 'A',
|
||||
expr: 'rate({instance="host.docker.internal:3000"}[$__interval])',
|
||||
expr: 'rate({instance="host.docker.internal:3000"}[$__auto])',
|
||||
editorMode: QueryEditorMode.Builder,
|
||||
}}
|
||||
/>
|
||||
@@ -169,7 +169,7 @@ describe('LokiQueryEditorSelector', () => {
|
||||
|
||||
await screen.findByText('host.docker.internal:3000');
|
||||
expect(screen.getByText('Rate')).toBeInTheDocument();
|
||||
expect(screen.getByText('$__interval')).toBeInTheDocument();
|
||||
expect(screen.getByText('$__auto')).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('renders the label browser button', async () => {
|
||||
|
||||
@@ -336,11 +336,14 @@ export function getLineFilterRenderer(operation: string, caseInsensitive?: boole
|
||||
return `${innerExpr} ${operation} ${delimiter}${params.join(`${delimiter} or ${delimiter}`)}${delimiter}`;
|
||||
};
|
||||
}
|
||||
|
||||
function getRangeVectorParamDef(): QueryBuilderOperationParamDef {
|
||||
return {
|
||||
name: 'Range',
|
||||
type: 'string',
|
||||
options: ['$__auto', '1m', '5m', '10m', '1h', '24h'],
|
||||
options: ['$__auto'],
|
||||
description:
|
||||
'Use the default value "$__auto". Change the "step" value in the query options to change the bucket size.',
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user