New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Chore: Remove angular dependency from data sources #27735
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
403e402
Chore: Remove angular dependency from data sources
kaydelaney 686effc
Removes default export for time and template srvs
kaydelaney e845542
Replace usage of internal templateSrv where possible
kaydelaney f71135c
Use runtime templateSrv in a couple more places
kaydelaney 7e9de0c
Merge branch 'master' into datasource-services
kaydelaney File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,13 +2,12 @@ import React, { Component } from 'react'; | |
import classNames from 'classnames'; | ||
import { isEqual } from 'lodash'; | ||
import { DataLink, LoadingState, PanelData, PanelMenuItem, QueryResultMetaNotice, ScopedVars } from '@grafana/data'; | ||
import { AngularComponent } from '@grafana/runtime'; | ||
import { AngularComponent, getTemplateSrv } from '@grafana/runtime'; | ||
import { ClickOutsideWrapper, Icon, IconName, Tooltip } from '@grafana/ui'; | ||
import { selectors } from '@grafana/e2e-selectors'; | ||
|
||
import PanelHeaderCorner from './PanelHeaderCorner'; | ||
import { PanelHeaderMenu } from './PanelHeaderMenu'; | ||
import templateSrv from 'app/features/templating/template_srv'; | ||
|
||
import { DashboardModel } from 'app/features/dashboard/state/DashboardModel'; | ||
import { PanelModel } from 'app/features/dashboard/state/PanelModel'; | ||
|
@@ -137,7 +136,7 @@ export class PanelHeader extends Component<Props, State> { | |
render() { | ||
const { panel, scopedVars, error, isViewing, isEditing, data, alertState } = this.props; | ||
const { menuItems } = this.state; | ||
const title = templateSrv.replace(panel.title, scopedVars, 'text'); | ||
const title = getTemplateSrv().replace(panel.title, scopedVars, 'text'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This component uses only the replace function, should be ok to just import |
||
|
||
const panelHeaderClass = classNames({ | ||
'panel-header': true, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
import coreModule from 'app/core/core_module'; | ||
import templateSrv from './template_srv'; | ||
import { getTemplateSrv } from './template_srv'; | ||
|
||
coreModule.factory('templateSrv', () => templateSrv); | ||
coreModule.factory('templateSrv', () => getTemplateSrv()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
import { AppEvents, DataSourcePluginMeta, DataSourceSelectItem } from '@grafana/data'; | ||
import { getTemplateSrv } from '@grafana/runtime'; | ||
import { validateVariableSelectionState } from '../state/actions'; | ||
import { QueryVariableModel, VariableRefresh } from '../types'; | ||
import { ThunkResult } from '../../../types'; | ||
import { getDatasourceSrv } from '../../plugins/datasource_srv'; | ||
import templateSrv from '../../templating/template_srv'; | ||
import { getTimeSrv } from '../../dashboard/services/TimeSrv'; | ||
import appEvents from '../../../core/app_events'; | ||
import { importDataSourcePlugin } from '../../plugins/plugin_loader'; | ||
|
@@ -138,5 +138,5 @@ const getTemplatedRegex = (variable: QueryVariableModel): string => { | |
return ''; | ||
} | ||
|
||
return templateSrv.replace(variable.regex, {}, 'regex'); | ||
return getTemplateSrv().replace(variable.regex, {}, 'regex'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe runtime import for this one? |
||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 0 additions & 3 deletions
3
public/app/plugins/datasource/cloud-monitoring/annotations_query_ctrl.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This component uses only the replace function, should be ok to just import
getTemplateSrv
from grafana/runtime?