Resolve techical debt in sidebar.vue
Resolve technical debt in app/assets/javascripts/jobs/components/sidebar.vue
- Avoid addition assignment operator on
retryButtonClasscomputed prop. We could use template literal for prop value and just return if we want it to be a primary or inverted secondary button. -
hasArtifactis checking if an artifact is present based on the object being empty. This is wrong sincelockedproperty will be present always it seems. So thev-ifstatement will never work for theartifactsblock. We need a different method of checking. - Looks as the
triggerproperty on the job is not present if no trigger is defined on the job.hasTriggerscould possibly be refactored to be more accurate representation of the datathis.job?.trigger - Could
stagesstate be used forhasStagescomputed prop? It looks like nostagesproperty is present on the job's pipeline. I wonder if this is an improper implementation, will need further investigation. - If the
commitcomputed property is everyundefinedwe return an empty object. Downstream this will break thecommitblock component since it's trying to accesscommit.idetc. in the component. - Let's use gitlab utility classes in this component
- Let's use a
data-testidinstead ofjs-sidebar-build-toggle - Instead of using button classes on the
GlLinkcomponents let's useGlButtoncomponent withhrefprop.