Skip to content
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

hotfix/IISCRUM-1324 #4

Merged
merged 2 commits into from
Feb 14, 2020
Merged
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
2 changes: 1 addition & 1 deletion src/panel-triggers/datasource-selector.directive.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const template = `

angular
.module('grafana.directives')
.directive('datasourceSelector', () => {
.directive('iirisDatasourceSelector', () => {
return {
scope: {
datasources: "=",
Expand Down
4 changes: 2 additions & 2 deletions src/panel-triggers/partials/triggers_tab.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
<label class="gf-form-label width-9">Data sources</label>
</div>
<div class="gf-form">
<datasource-selector
<iiris-datasource-selector
datasources="ctrl.panel.datasources"
options="editor.panelCtrl.available_datasources"
on-change="editor.datasourcesChanged()">
</datasource-selector>
</iiris-datasource-selector>
</div>
</div>
</div>
Expand Down
10 changes: 5 additions & 5 deletions src/panel-triggers/triggers_panel_ctrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -249,10 +249,10 @@ export class TriggerPanelCtrl extends PanelCtrl {
showAckButton = !datasource.disableReadOnlyUsersAck || userIsEditor;

// Replace template variables
const groupFilter = datasource.replaceTemplateVars(triggerFilter.group.filter);
const hostFilter = datasource.replaceTemplateVars(triggerFilter.host.filter);
const appFilter = datasource.replaceTemplateVars(triggerFilter.application.filter);
const proxyFilter = datasource.replaceTemplateVars(triggerFilter.proxy.filter);
const groupFilter = triggerFilter && triggerFilter.group ? datasource.replaceTemplateVars(triggerFilter.group.filter) : '';
const hostFilter = triggerFilter && triggerFilter.host ? datasource.replaceTemplateVars(triggerFilter.host.filter) : '';
const appFilter = triggerFilter && triggerFilter.application ? datasource.replaceTemplateVars(triggerFilter.application.filter) : '';
const proxyFilter = triggerFilter && triggerFilter.proxy ? datasource.replaceTemplateVars(triggerFilter.proxy.filter) : '';

let triggersOptions = {
showTriggers: showEvents
Expand Down Expand Up @@ -341,7 +341,7 @@ export class TriggerPanelCtrl extends PanelCtrl {

filterTriggersPre(triggerList, ds) {
// Filter triggers by description
let triggerFilter = this.panel.targets[ds].trigger.filter;
let triggerFilter = this.panel.targets && this.panel.targets[ds] ? this.panel.targets[ds].trigger.filter : '';
triggerFilter = this.datasources[ds].replaceTemplateVars(triggerFilter);
if (triggerFilter) {
triggerList = filterTriggers(triggerList, triggerFilter);
Expand Down