@@ -99,31 +99,47 @@ <h1>[[_titleDisplayString]]</h1>
99
99
</ template >
100
100
</ div >
101
101
102
- < template is ="dom-if " if ="[[_tagsWithNoData]] ">
103
- < div id ="error-content ">
104
- < iron-icon class ="error-icon " icon ="icons:error "> </ iron-icon >
105
- No data found for these tags:
106
- < ul >
107
- < template is ="dom-repeat " items ="[[_tagsWithNoData]] ">
108
- < li > [[item]]</ li >
109
- </ template >
110
- </ ul >
111
- < br >
112
- Tags for the value, lower, and upper bounds of margin charts in the Layout
113
- proto must match tags in the SCALARS dashboard.
102
+ <!-- here -->
103
+ < template is ="dom-if " if ="[[_missingTags.length]] ">
104
+ < div class ="collapsible-list-title ">
105
+ < paper-icon-button
106
+ icon ="[[_getToggleCollapsibleIcon(_missingTagsCollapsibleOpened)]] "
107
+ on-click ="_toggleMissingTagsCollapsibleOpen "
108
+ class ="toggle-collapsible-button ">
109
+ </ paper-icon-button >
110
+ < span class ="collapsible-title-text ">
111
+ < iron-icon icon ="icons:error "> </ iron-icon > Missing Tags
112
+ </ span >
114
113
</ div >
114
+ < iron-collapse opened ="[[_missingTagsCollapsibleOpened]] ">
115
+ < div class ="error-content ">
116
+ < iron-icon class ="error-icon " icon ="icons:error "> </ iron-icon >
117
+ < template is ="dom-repeat "
118
+ items ="[[_missingTags]] "
119
+ as ="missingEntry ">
120
+ < div class ="missing-tags-for-run-container ">
121
+ Run "[[missingEntry.run]]" lacks data for tags
122
+ < ul >
123
+ < template is ="dom-repeat " items ="[[missingEntry.tags]] " as ="tag ">
124
+ < li > [[tag]]</ li >
125
+ </ template >
126
+ </ ul >
127
+ </ div >
128
+ </ template >
129
+ </ div >
130
+ </ iron-collapse >
115
131
</ template >
116
132
117
133
< template is ="dom-if " if ="[[_tagFilterInvalid]] ">
118
- < div id ="error-content ">
134
+ < div class ="error-content ">
119
135
< iron-icon class ="error-icon " icon ="icons:error "> </ iron-icon >
120
136
This regular expresion is invalid:< br >
121
137
< span class ="invalid-regex "> [[_tagFilter]]</ span >
122
138
</ div >
123
139
</ template >
124
140
125
141
< template is ="dom-if " if ="[[_stepsMismatch]] ">
126
- < div id ="error-content ">
142
+ < div class ="error-content ">
127
143
< iron-icon class ="error-icon " icon ="icons:error "> </ iron-icon >
128
144
The steps for value, lower, and upper tags do not match:
129
145
< ul >
@@ -144,16 +160,16 @@ <h1>[[_titleDisplayString]]</h1>
144
160
</ template >
145
161
146
162
< div id ="matches-container ">
147
- < div id =" matches -list-title ">
163
+ < div class =" collapsible -list-title ">
148
164
< template is ="dom-if " if ="[[_dataSeriesStrings.length]] ">
149
165
< paper-icon-button
150
- icon ="[[_getToggleMatchesIcon (_matchesListOpened)]] "
166
+ icon ="[[_getToggleCollapsibleIcon (_matchesListOpened)]] "
151
167
on-click ="_toggleMatchesOpen "
152
168
class ="toggle-matches-button ">
153
169
</ paper-icon-button >
154
170
</ template >
155
171
156
- < span class ="matches -text ">
172
+ < span class ="collapsible-title -text ">
157
173
Matches ([[_dataSeriesStrings.length]])
158
174
</ span >
159
175
</ div >
@@ -179,7 +195,7 @@ <h1>[[_titleDisplayString]]</h1>
179
195
</ div >
180
196
< style include ="tf-custom-scalar-card-style "> </ style >
181
197
< style >
182
- # error-content {
198
+ . error-content {
183
199
background : # f00 ;
184
200
border-radius : 5px ;
185
201
color : # fff ;
@@ -197,7 +213,7 @@ <h1>[[_titleDisplayString]]</h1>
197
213
font-weight : bold;
198
214
}
199
215
200
- # error-content ul {
216
+ . error-content ul {
201
217
margin : 1px 0 0 0 ;
202
218
padding : 0 0 0 19px ;
203
219
}
@@ -206,10 +222,14 @@ <h1>[[_titleDisplayString]]</h1>
206
222
font-weight : bold;
207
223
}
208
224
209
- # matches -list-title {
225
+ . collapsible -list-title {
210
226
margin : 10px 0 5px 0 ;
211
227
}
212
228
229
+ .collapsible-title-text {
230
+ vertical-align : middle;
231
+ }
232
+
213
233
# matches-list {
214
234
font-size : 0.8em ;
215
235
max-height : 200px ;
@@ -226,8 +246,8 @@ <h1>[[_titleDisplayString]]</h1>
226
246
width : 10px ;
227
247
}
228
248
229
- .matches-text {
230
- vertical-align : middle ;
249
+ .missing-tags-for-run-container {
250
+ margin : 8 px 0 0 0 ;
231
251
}
232
252
</ style >
233
253
</ template >
@@ -381,7 +401,22 @@ <h1>[[_titleDisplayString]]</h1>
381
401
] ;
382
402
}
383
403
} ,
384
- _tagsWithNoData : String ,
404
+ /**
405
+ * A list of objects encapsulating missing tags. Each object within this
406
+ * list has the following properties:
407
+ * run: A string denoting the relevant run.
408
+ * tags: A non-empty list of tags (strings) missing for that run.
409
+ * A run only has an entry in this list if some (but not all) of its 3
410
+ * tags (value, lower, upper) are missing.
411
+ */
412
+ _missingTags : {
413
+ type : Array ,
414
+ value : [ ] ,
415
+ } ,
416
+ _missingTagsCollapsibleOpened : {
417
+ type : Boolean ,
418
+ value : false ,
419
+ } ,
385
420
/**
386
421
* This field is only set if data retrieved from the server exhibits a
387
422
* step mismatch: if the lists of values, lower bounds, and upper bounds
@@ -517,13 +552,28 @@ <h1>[[_titleDisplayString]]</h1>
517
552
run , tagsObject . value , seriesName , dataPoints ) ;
518
553
}
519
554
} ) ;
555
+ this . set ( '_nameToDataSeries' , newMapping ) ;
520
556
521
- if ( tagsNotFound . length ) {
522
- // At least 1 tag could not be found. Show an error message.
523
- this . set ( '_tagsWithNoData' , tagsNotFound ) ;
557
+ const entryIndex = _ . findIndex ( this . _missingTags , ( entry ) => {
558
+ return entry . run === run ;
559
+ } ) ;
560
+ if ( tagsNotFound . length && tagsNotFound . length != 3 ) {
561
+ // Some but not all tags were found. Show a warning message.
562
+ const entry = {
563
+ run : run ,
564
+ tags : tagsNotFound ,
565
+ } ;
566
+ if ( entryIndex >= 0 ) {
567
+ // Remove the previous entry. Insert the new one.
568
+ this . splice ( '_missingTags' , entryIndex , 1 , entry ) ;
569
+ } else {
570
+ // Insert a new entry.
571
+ this . push ( '_missingTags' , entry ) ;
572
+ }
573
+ } else if ( entryIndex >= 0 ) {
574
+ // Remove the previous entry if it exists.
575
+ this . splice ( '_missingTags' , entryIndex , 1 ) ;
524
576
}
525
-
526
- this . set ( '_nameToDataSeries' , newMapping ) ;
527
577
} ) ;
528
578
} ,
529
579
_findStepMismatch ( tagsObject , valueSteps , lowerSteps , upperSteps ) {
@@ -606,8 +656,8 @@ <h1>[[_titleDisplayString]]</h1>
606
656
_escapeRegexCharacters ( stringValue ) {
607
657
return stringValue . replace ( / [ . * + ? ^ $ { } ( ) | [ \] \\ ] / g, '\\$&' ) ;
608
658
} ,
609
- _getToggleMatchesIcon ( matchesListOpened ) {
610
- return matchesListOpened ? 'expand-less' : 'expand-more' ;
659
+ _getToggleCollapsibleIcon ( listOpened ) {
660
+ return listOpened ? 'expand-less' : 'expand-more' ;
611
661
} ,
612
662
_toggleMatchesOpen ( ) {
613
663
this . set ( '_matchesListOpened' , ! this . _matchesListOpened ) ;
@@ -620,6 +670,11 @@ <h1>[[_titleDisplayString]]</h1>
620
670
_separateWithCommas ( numbers ) {
621
671
return numbers . join ( ', ' ) ;
622
672
} ,
673
+ _toggleMissingTagsCollapsibleOpen ( ) {
674
+ this . set (
675
+ '_missingTagsCollapsibleOpened' ,
676
+ ! this . _missingTagsCollapsibleOpened ) ;
677
+ } ,
623
678
} ) ;
624
679
</ script >
625
680
</ dom-module >
0 commit comments