Move merge button rendering into MR widget states
Right now we have a dedicated component to show a merge button: ready_to_merge.vue
. And we also have dedicated components for each of the state that MR widget can take (they live in the same folder).
This means that the merge button component is now aware of every state that the MR can take as well. This spreads the state logic between an MR state component and the merge button. And it also causes for indeterminate states to occur: MR state button might be still syncing state but the merge button is unaware of this and there's no indication to the user on what's going on. So even when the button can or should be visible it might be hidden because of these reasons.
In order to answer this question: Given an MR state, do we see the MR button?
we should refactor our MR state components to include the merge button when needed, so it's clear when it's shown and when it's not visible. We also should make separate components for different kinds of merge buttons: regular, auto-merge, etc. Or use slots to extend the basic merge button to keep the component's logic simple.