@@ -43,13 +43,14 @@ import {
43
43
EuiCode ,
44
44
EuiText ,
45
45
} from '@elastic/eui' ;
46
+ import { i18n } from '@kbn/i18n' ;
46
47
import { FormattedMessage } from '@kbn/i18n/react' ;
47
48
48
49
function newAnnotation ( ) {
49
50
return {
50
51
id : uuid . v1 ( ) ,
51
52
color : '#F00' ,
52
- index_pattern : '* ' ,
53
+ index_pattern : '' ,
53
54
time_field : '@timestamp' ,
54
55
icon : 'fa-tag' ,
55
56
ignore_global_filters : 1 ,
@@ -84,7 +85,7 @@ export class AnnotationsEditor extends Component {
84
85
const defaults = {
85
86
fields : '' ,
86
87
template : '' ,
87
- index_pattern : '* ' ,
88
+ index_pattern : '' ,
88
89
query_string : { query : '' , language : getDefaultQueryLanguage ( ) } ,
89
90
} ;
90
91
const model = { ...defaults , ...row } ;
@@ -100,6 +101,8 @@ export class AnnotationsEditor extends Component {
100
101
const htmlId = htmlIdGenerator ( model . id ) ;
101
102
const handleAdd = collectionActions . handleAdd . bind ( null , this . props , newAnnotation ) ;
102
103
const handleDelete = collectionActions . handleDelete . bind ( null , this . props , model ) ;
104
+ const defaultIndexPattern = this . props . model . default_index_pattern ;
105
+
103
106
return (
104
107
< div className = "tvbAnnotationsEditor" key = { model . id } >
105
108
< EuiFlexGroup responsive = { false } >
@@ -120,14 +123,22 @@ export class AnnotationsEditor extends Component {
120
123
label = {
121
124
< FormattedMessage
122
125
id = "visTypeTimeseries.annotationsEditor.indexPatternLabel"
123
- defaultMessage = "Index pattern (required) "
126
+ defaultMessage = "Index pattern"
124
127
/>
125
128
}
129
+ helpText = {
130
+ defaultIndexPattern &&
131
+ ! model . index_pattern &&
132
+ i18n . translate ( 'visTypeTimeseries.indexPattern.searchByDefaultIndex' , {
133
+ defaultMessage : 'Default index pattern is used. To query all indexes use *' ,
134
+ } )
135
+ }
126
136
fullWidth
127
137
>
128
138
< EuiFieldText
129
139
onChange = { this . handleChange ( model , 'index_pattern' ) }
130
140
value = { model . index_pattern }
141
+ placeholder = { defaultIndexPattern }
131
142
fullWidth
132
143
/>
133
144
</ EuiFormRow >
0 commit comments