mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Chore: Remove unused Loki and Cloudwatch syntax providers (#29686)
* Remove syntax provider in Cloudwatch * Remove syntax provider and refactor useLokiLabels
This commit is contained in:
@@ -7,8 +7,6 @@ import { InlineFormLabel } from '@grafana/ui';
|
||||
import { CloudWatchDatasource } from '../datasource';
|
||||
import { CloudWatchLogsQuery, CloudWatchQuery } from '../types';
|
||||
import { CloudWatchLogsQueryField } from './LogsQueryField';
|
||||
import { useCloudWatchSyntax } from '../useCloudwatchSyntax';
|
||||
import { CloudWatchLanguageProvider } from '../language_provider';
|
||||
import CloudWatchLink from './CloudWatchLink';
|
||||
import { css } from 'emotion';
|
||||
|
||||
@@ -36,11 +34,6 @@ export const CloudWatchLogsQueryEditor = memo(function CloudWatchLogsQueryEditor
|
||||
};
|
||||
}
|
||||
|
||||
const { isSyntaxReady, syntax } = useCloudWatchSyntax(
|
||||
datasource.languageProvider as CloudWatchLanguageProvider,
|
||||
absolute
|
||||
);
|
||||
|
||||
return (
|
||||
<CloudWatchLogsQueryField
|
||||
exploreId={exploreId}
|
||||
@@ -52,8 +45,6 @@ export const CloudWatchLogsQueryEditor = memo(function CloudWatchLogsQueryEditor
|
||||
history={[]}
|
||||
data={data}
|
||||
absoluteRange={absolute}
|
||||
syntaxLoaded={isSyntaxReady}
|
||||
syntax={syntax}
|
||||
allowCustomValue={allowCustomValue}
|
||||
ExtraFieldElement={
|
||||
<InlineFormLabel className={`gf-form-label--btn ${labelClass}`} width="auto" tooltip="Link to Graph in AWS">
|
||||
|
||||
@@ -17,8 +17,6 @@ describe('CloudWatchLogsQueryField', () => {
|
||||
<CloudWatchLogsQueryField
|
||||
history={[]}
|
||||
absoluteRange={{ from: 1, to: 10 }}
|
||||
syntaxLoaded={false}
|
||||
syntax={{} as any}
|
||||
exploreId={ExploreId.left}
|
||||
datasource={
|
||||
{
|
||||
@@ -153,8 +151,6 @@ describe('CloudWatchLogsQueryField', () => {
|
||||
<CloudWatchLogsQueryField
|
||||
history={[]}
|
||||
absoluteRange={{ from: 1, to: 10 }}
|
||||
syntaxLoaded={false}
|
||||
syntax={{} as any}
|
||||
exploreId={ExploreId.left}
|
||||
datasource={
|
||||
{
|
||||
|
||||
@@ -24,7 +24,7 @@ import syntax from '../syntax';
|
||||
import { ExploreQueryFieldProps, AbsoluteTimeRange, SelectableValue, AppEvents } from '@grafana/data';
|
||||
import { CloudWatchQuery, CloudWatchLogsQuery } from '../types';
|
||||
import { CloudWatchDatasource } from '../datasource';
|
||||
import { Grammar, LanguageMap, languages as prismLanguages } from 'prismjs';
|
||||
import { LanguageMap, languages as prismLanguages } from 'prismjs';
|
||||
import { CloudWatchLanguageProvider } from '../language_provider';
|
||||
import { css } from 'emotion';
|
||||
import { ExploreId } from 'app/types';
|
||||
@@ -36,8 +36,6 @@ export interface CloudWatchLogsQueryFieldProps extends ExploreQueryFieldProps<Cl
|
||||
absoluteRange: AbsoluteTimeRange;
|
||||
onLabelsRefresh?: () => void;
|
||||
ExtraFieldElement?: ReactNode;
|
||||
syntaxLoaded: boolean;
|
||||
syntax: Grammar | null;
|
||||
exploreId: ExploreId;
|
||||
allowCustomValue?: boolean;
|
||||
}
|
||||
@@ -294,7 +292,7 @@ export class CloudWatchLogsQueryField extends React.PureComponent<CloudWatchLogs
|
||||
};
|
||||
|
||||
render() {
|
||||
const { ExtraFieldElement, data, query, syntaxLoaded, datasource, allowCustomValue } = this.props;
|
||||
const { ExtraFieldElement, data, query, datasource, allowCustomValue } = this.props;
|
||||
const {
|
||||
selectedLogGroups,
|
||||
availableLogGroups,
|
||||
@@ -375,7 +373,6 @@ export class CloudWatchLogsQueryField extends React.PureComponent<CloudWatchLogs
|
||||
cleanText={cleanText}
|
||||
placeholder="Enter a CloudWatch Logs Insights query (run with Shift+Enter)"
|
||||
portalOrigin="cloudwatch"
|
||||
syntaxLoaded={syntaxLoaded}
|
||||
disabled={loadingLogGroups || selectedLogGroups.length === 0}
|
||||
/>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user