Merge remote-tracking branch 'origin/list-multiple-clusters' into cluster-page-with-list-clusters
This commit is contained in:
commit
2fc29237aa
8 changed files with 12 additions and 9 deletions
|
@ -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
|
||||
|
|
|
@ -23,4 +23,8 @@
|
|||
.empty-state .svg-content img {
|
||||
width: 145px;
|
||||
}
|
||||
|
||||
.top-area .nav-controls > .btn.btn-add-cluster {
|
||||
margin-right: 0;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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")
|
||||
|
|
|
@ -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')
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue