Resolve techical debt in sidebar.vue

Resolve technical debt in app/assets/javascripts/jobs/components/sidebar.vue

  • Avoid addition assignment operator on retryButtonClass computed prop. We could use template literal for prop value and just return if we want it to be a primary or inverted secondary button.
  • hasArtifact is checking if an artifact is present based on the object being empty. This is wrong since locked property will be present always it seems. So the v-if statement will never work for the artifacts block. We need a different method of checking.
  • Looks as the trigger property on the job is not present if no trigger is defined on the job. hasTriggers could possibly be refactored to be more accurate representation of the data this.job?.trigger
  • Could stages state be used for hasStages computed prop? It looks like no stages property is present on the job's pipeline. I wonder if this is an improper implementation, will need further investigation.
  • If the commit computed property is every undefined we return an empty object. Downstream this will break the commit block component since it's trying to access commit.id etc. in the component.
  • Let's use gitlab utility classes in this component
  • Let's use a data-testid instead of js-sidebar-build-toggle
  • Instead of using button classes on the GlLink components let's use GlButton component with href prop.