Resolve technical debt in environments_block.vue
Resolve technical debt in app/assets/javascripts/jobs/components/environments_block.vue
- We have some inconsistency with the
environment
computed prop. We use aswitch
statement to determine the message we should return. We have onecase
inoptions
and the rest as string literals. I'd like to propose we clean up this switch statement by using an object literal lookup. I'd like to move away from theswitch
statement for easier debugging and introduce a more standard way of handling the state. - Our environment messages are not contained and the readability is not the best. I think we can simplify these methods and remove one that doesn't need to be a method since no logic is involved (failedEnvironmentMessage)
- We should move
js-environment-container
to adata-testid
- We should use gitlab utility classes where possible
- We have some inconsistency with using ternary operator vs.
if/else
we should pick one and stay with it