Don't pass a single space as a severity in Security Dashboard table row
The following discussions from !25489 (merged) should be addressed:
-
@farias-gl started a discussion: (+3 comments) We usually try to avoid having v-if logic inline. What do you think of creating a new computed prop
Computed Prop:
hasSeverityBadge(){ return this.severity && this.severity != ' '; }
In template:
<div v-if="hasSeverityBadge" class="severity-badge gl-text-gray-900">
Note to maintainer: Not sure why, I didn't have a chance to debug, but when this component is initialized the
severity
prop is a string with a space. I believe this is the reason forthis.severity != ' ';
Specifically, this is about cleaning up the tech debt of passing a single space to the severity badge component, done here: https://gitlab.com/gitlab-org/gitlab/-/blob/7c029f070ed4db89a4b36f91fd3a8eac9e1b5864/ee/app/assets/javascripts/security_dashboard/components/security_dashboard_table_row.vue#L45
Edited by Mark Florian