7373 <v-tooltip
7474 :top =" scrollY <= 20"
7575 :bottom =" scrollY > 20"
76- :disabled =" condition.status"
76+ :disabled =" condition.status === 'True' "
7777 >
7878 <template v-slot :activator =" { on , attrs } " >
7979 <v-chip
8989 v-bind =" attrs"
9090 v-on =" on"
9191 >
92- <!-- :color="($vuetify.theme.dark) ? getType(condition) : 'white'"
93- :text-color="($vuetify.theme.dark) ? 'black' : getType(condition)" -->
9492 <StatusIcon
95- :type =" ( condition.status) ? 'success' : condition.severity. toLowerCase()"
93+ :type =" condition.status === 'True' ? 'success' : ( condition.Status === 'Unknown' ? 'unknown' : (condition. severity ? condition.severity. toLowerCase() : 'unknown' ) )"
9694 :spinnerWidth =" 2"
9795 left
9896 >
97+ <!-- TODO: verify that StatusIcon works when passing in undefined as type, i.e. if condition.severity is undefined -->
9998 </StatusIcon >
10099 {{ condition.type }}
101100 </v-chip >
102101 </template >
103- <span >{{ condition.severity }}: {{ condition.reason }}</span >
102+ <span v-if =" condition.severity && condition.reason" >{{ condition.severity }}: {{ condition.reason }}</span >
103+ <span v-else-if =" condition.severity" >{{ condition.severity }}</span >
104+ <span v-else-if =" condition.reason" >{{ condition.reason }}</span >
105+ <span v-else >Unknown</span >
104106 </v-tooltip >
105107 </div >
106108 </div >
@@ -201,11 +203,9 @@ export default {
201203 },
202204 methods: {
203205 getType (condition ) {
204- return condition .status
205- ? " success"
206- : condition .isError
207- ? " error"
208- : " warning" ;
206+ if (condition .status === " True" ) return " success" ;
207+ else if (condition .isError || ! condition .severity || condition .status === " Unknown" ) return " error" ; // if severity is undefined, we assume it's an error
208+ else return " warning" ;
209209 },
210210 onScroll (e ) {
211211 this .scrollY = window .scrollY ;
@@ -230,7 +230,7 @@ export default {
230230 conditions .forEach ((e , i ) => {
231231 this .conditions .push ({
232232 type: e .type ,
233- status: e .status === " True " ,
233+ status: e .status ,
234234 isError: e .severity === " Error" ,
235235 severity: e .severity ,
236236 reason: e .reason ,
@@ -258,6 +258,7 @@ export default {
258258 watch: {
259259 jsonItems: {
260260 handler (val , old ) {
261+ console .log (" Val is" , val);
261262 this .setConditions (val? .status ? .conditions );
262263 },
263264 },
0 commit comments