diff options
-rw-r--r-- | app/assets/javascripts/clusters/clusters_index.js | 2 | ||||
-rw-r--r-- | app/assets/stylesheets/pages/clusters.scss | 4 | ||||
-rw-r--r-- | app/controllers/projects/clusters_controller.rb | 2 | ||||
-rw-r--r-- | app/models/project.rb | 1 | ||||
-rw-r--r-- | app/views/projects/clusters/_tabs.html.haml | 4 | ||||
-rw-r--r-- | spec/controllers/projects/clusters_controller_spec.rb | 2 | ||||
-rw-r--r-- | spec/migrations/migrate_gcp_clusters_to_new_clusters_architectures_spec.rb | 4 | ||||
-rw-r--r-- | spec/models/project_spec.rb | 2 |
8 files changed, 12 insertions, 9 deletions
diff --git a/app/assets/javascripts/clusters/clusters_index.js b/app/assets/javascripts/clusters/clusters_index.js index 82ac8d93035..6844d1dbd83 100644 --- a/app/assets/javascripts/clusters/clusters_index.js +++ b/app/assets/javascripts/clusters/clusters_index.js @@ -28,7 +28,7 @@ const toggleValue = (button) => { * * When the user clicks the toggle button for each cluster, it: * - toggles the button - * - shows a loading and disabled state + * - shows a loading and disables button * - Makes a put request to the given endpoint * Once we receive the response, either: * 1) Show updated status in case of successfull response diff --git a/app/assets/stylesheets/pages/clusters.scss b/app/assets/stylesheets/pages/clusters.scss index b5ac6db04ad..c303f016ff9 100644 --- a/app/assets/stylesheets/pages/clusters.scss +++ b/app/assets/stylesheets/pages/clusters.scss @@ -23,4 +23,8 @@ .empty-state .svg-content img { width: 145px; } + + .top-area .nav-controls > .btn.btn-add-cluster { + margin-right: 0; + } } diff --git a/app/controllers/projects/clusters_controller.rb b/app/controllers/projects/clusters_controller.rb index e0ded4ceb2f..f3939c74591 100644 --- a/app/controllers/projects/clusters_controller.rb +++ b/app/controllers/projects/clusters_controller.rb @@ -46,7 +46,7 @@ class Projects::ClustersController < Projects::ApplicationController end format.html do flash[:notice] = "Cluster was successfully updated." - redirect_to project_cluster_path(project, project.cluster) + redirect_to project_cluster_path(project, cluster) end end else diff --git a/app/models/project.rb b/app/models/project.rb index 0a7e7617d9b..df3034d86ef 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -189,7 +189,6 @@ class Project < ActiveRecord::Base has_one :statistics, class_name: 'ProjectStatistics' has_one :cluster_project, class_name: 'Clusters::Project' - has_one :cluster, through: :cluster_project, class_name: 'Clusters::Cluster' has_many :clusters, through: :cluster_project, class_name: 'Clusters::Cluster' # Container repositories need to remove data from the container registry, diff --git a/app/views/projects/clusters/_tabs.html.haml b/app/views/projects/clusters/_tabs.html.haml index 955a9940727..920ed40ea69 100644 --- a/app/views/projects/clusters/_tabs.html.haml +++ b/app/views/projects/clusters/_tabs.html.haml @@ -14,5 +14,5 @@ = link_to project_clusters_path(@project), class: "js-all-tab" do = s_("ClusterIntegration|All") %span.badge= @all_count - .pull-right.nav-bar-right - = link_to s_("ClusterIntegration|Add cluster"), new_project_cluster_path(@project), class: "btn btn-success disabled has-tooltip js-add-cluster", title: s_("ClusterIntegration|Multiple clusters are available in GitLab Entreprise Edition Premium and Ultimate") + .nav-controls + = link_to s_("ClusterIntegration|Add cluster"), new_project_cluster_path(@project), class: "btn btn-success btn-add-cluster disabled has-tooltip js-add-cluster", title: s_("ClusterIntegration|Multiple clusters are available in GitLab Entreprise Edition Premium and Ultimate") diff --git a/spec/controllers/projects/clusters_controller_spec.rb b/spec/controllers/projects/clusters_controller_spec.rb index 806e33e0e4e..64e62411c9e 100644 --- a/spec/controllers/projects/clusters_controller_spec.rb +++ b/spec/controllers/projects/clusters_controller_spec.rb @@ -306,7 +306,7 @@ describe Projects::ClustersController do go cluster.reload - expect(response).to redirect_to(namespace_project_cluster_path(project.namespace, project, project.cluster)) + expect(response).to redirect_to(project_cluster_path(project, cluster)) expect(flash[:notice]).to eq('Cluster was successfully updated.') expect(cluster.enabled).to be_falsey expect(cluster.name).to eq('my-new-cluster-name') diff --git a/spec/migrations/migrate_gcp_clusters_to_new_clusters_architectures_spec.rb b/spec/migrations/migrate_gcp_clusters_to_new_clusters_architectures_spec.rb index 9f41534441b..05f281fffff 100644 --- a/spec/migrations/migrate_gcp_clusters_to_new_clusters_architectures_spec.rb +++ b/spec/migrations/migrate_gcp_clusters_to_new_clusters_architectures_spec.rb @@ -57,7 +57,7 @@ describe MigrateGcpClustersToNewClustersArchitectures, :migration do expect(cluster.platform_type).to eq('kubernetes') expect(cluster.project).to eq(project) - expect(project.cluster).to eq(cluster) + expect(project.clusters).to include(cluster) expect(cluster.provider_gcp.cluster).to eq(cluster) expect(cluster.provider_gcp.status).to eq(status) @@ -134,7 +134,7 @@ describe MigrateGcpClustersToNewClustersArchitectures, :migration do expect(cluster.platform_type).to eq('kubernetes') expect(cluster.project).to eq(project) - expect(project.cluster).to eq(cluster) + expect(project.clusters).to include(cluster) expect(cluster.provider_gcp.cluster).to eq(cluster) expect(cluster.provider_gcp.status).to eq(status) diff --git a/spec/models/project_spec.rb b/spec/models/project_spec.rb index 000d5b7126d..cf866920529 100644 --- a/spec/models/project_spec.rb +++ b/spec/models/project_spec.rb @@ -78,7 +78,7 @@ describe Project do it { is_expected.to have_many(:uploads).dependent(:destroy) } it { is_expected.to have_many(:pipeline_schedules) } it { is_expected.to have_many(:members_and_requesters) } - it { is_expected.to have_one(:cluster) } + it { is_expected.to have_many(:clusters) } it { is_expected.to have_many(:custom_attributes).class_name('ProjectCustomAttribute') } context 'after initialized' do |