Allow user to add cluster when there are ancestor clusters
What does this MR do?
This MR was created as a consequence of https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/22996#note_122272045
If a user visits the project's kubernetes cluster index in CE, the "Add Kubernetes Cluster" button is disabled if any of that project's ancestor groups have a cluster. This button should only be disabled if there's a cluster defined specifically for that project.
This MR extends the definition of ClusterablePresenter#can_create_cluster?
to also check if the project or group has a cluster.
Related to https://gitlab.com/gitlab-org/gitlab-ce/issues/34758
EE counterpart https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/8706
What are the relevant issue numbers?
https://gitlab.com/gitlab-org/gitlab-ce/issues/34758
Does this MR meet the acceptance criteria?
-
Changelog entry added, if necessary - [-] Documentation created/updated
-
Tests added for this feature/bug -
Conforms to the code review guidelines -
Conforms to the merge request performance guidelines -
Conforms to the style guides - [-] Conforms to the database guides
- [-] Link to e2e tests MR added if this MR has Requires e2e tests label. See the Test Planning Process.
- [-] Security reports checked/validated by reviewer
Edited by 🤖 GitLab Bot 🤖