Commit ea92ddcc by Torkel Ödegaard

create annotations progress

parent ff426ae9
...@@ -69,7 +69,7 @@ function popoverSrv($compile, $rootScope, $timeout) { ...@@ -69,7 +69,7 @@ function popoverSrv($compile, $rootScope, $timeout) {
openDrop = drop; openDrop = drop;
openDrop.open(); openDrop.open();
}, 10); }, 100);
}; };
} }
......
...@@ -38,7 +38,12 @@ export class AnnotationsSrv { ...@@ -38,7 +38,12 @@ export class AnnotationsSrv {
// filter out annotations that do not belong to requesting panel // filter out annotations that do not belong to requesting panel
annotations = _.filter(annotations, item => { annotations = _.filter(annotations, item => {
if (item.panelId && options.panel.id !== item.panelId) { console.log(item);
// shownIn === 1 requires annotation matching panel id
if (item.source.showIn === 1) {
if (item.panelId && options.panel.id === item.panelId) {
return true;
}
return false; return false;
} }
return true; return true;
......
...@@ -18,13 +18,13 @@ export class AnnotationsEditorCtrl { ...@@ -18,13 +18,13 @@ export class AnnotationsEditorCtrl {
datasource: null, datasource: null,
iconColor: 'rgba(255, 96, 96, 1)', iconColor: 'rgba(255, 96, 96, 1)',
enable: true, enable: true,
show: 0, showIn: 0,
hide: false, hide: false,
}; };
showOptions: any = [ showOptions: any = [
{text: 'All Panels', value: 0}, {text: 'All Panels', value: 0},
{text: 'Specifc Panels', value: 1}, {text: 'Specific Panels', value: 1},
]; ];
/** @ngInject */ /** @ngInject */
...@@ -51,7 +51,7 @@ export class AnnotationsEditorCtrl { ...@@ -51,7 +51,7 @@ export class AnnotationsEditorCtrl {
edit(annotation) { edit(annotation) {
this.currentAnnotation = annotation; this.currentAnnotation = annotation;
this.currentAnnotation.show = this.currentAnnotation.show || 0; this.currentAnnotation.showIn = this.currentAnnotation.showIn || 0;
this.currentIsNew = false; this.currentIsNew = false;
this.datasourceChanged(); this.datasourceChanged();
this.mode = 'edit'; this.mode = 'edit';
......
...@@ -80,7 +80,7 @@ ...@@ -80,7 +80,7 @@
<div class="gf-form"> <div class="gf-form">
<span class="gf-form-label width-7">Show in</span> <span class="gf-form-label width-7">Show in</span>
<div class="gf-form-select-wrapper width-12"> <div class="gf-form-select-wrapper width-12">
<select class="gf-form-input" ng-model="ctrl.currentAnnotation.show" ng-options="f.value as f.text for f in ctrl.showOptions"></select> <select class="gf-form-input" ng-model="ctrl.currentAnnotation.showIn" ng-options="f.value as f.text for f in ctrl.showOptions"></select>
</div> </div>
</div> </div>
<gf-form-switch class="gf-form" <gf-form-switch class="gf-form"
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<h5 class="section-heading text-center">Add annotation</h5> <h5 class="section-heading text-center">Add annotation</h5>
<form name="ctrl.form" class="text-center"> <form name="ctrl.form" class="text-center">
<div class="gf-form-group" style="display: inline-block"> <div style="display: inline-block">
<div class="gf-form"> <div class="gf-form">
<span class="gf-form-label width-7">Title</span> <span class="gf-form-label width-7">Title</span>
<input type="text" ng-model="ctrl.annotation.title" class="gf-form-input max-width-20" required> <input type="text" ng-model="ctrl.annotation.title" class="gf-form-input max-width-20" required>
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
<dash-row class="dash-row" ng-repeat="row in dashboard.rows" row="row" dashboard="dashboard"> <dash-row class="dash-row" ng-repeat="row in dashboard.rows" row="row" dashboard="dashboard">
</dash-row> </dash-row>
<div ng-show='dashboardMeta.canEdit' class="add-row-panel-hint"> <div ng-show='dashboard.meta.canEdit && !dashboard.meta.fullscreen' class="add-row-panel-hint">
<div class="span12" style="text-align:left;"> <div class="span12" style="text-align:left;">
<span style="margin-left: 12px;" ng-click="addRowDefault()" class="pointer btn btn-inverse btn-small"> <span style="margin-left: 12px;" ng-click="addRowDefault()" class="pointer btn btn-inverse btn-small">
<span><i class="fa fa-plus"></i> ADD ROW</span> <span><i class="fa fa-plus"></i> ADD ROW</span>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment