diff --git a/app/assets/stylesheets/components/_cluster_types_view.scss b/app/assets/stylesheets/components/_cluster_types_view.scss index a45e3e126..fad76f31d 100644 --- a/app/assets/stylesheets/components/_cluster_types_view.scss +++ b/app/assets/stylesheets/components/_cluster_types_view.scss @@ -25,6 +25,10 @@ margin: 0 !important; width: 100%; min-height: 14.2rem; + + &.disabled-cluster-type-card { + cursor: not-allowed; + } } .cluster-type-card-title { @@ -84,28 +88,29 @@ margin-bottom: 0.625rem; .cluster-type-card-title { - justify-self: left; - align-self: end; - max-width: 28em; + justify-self: left; + align-self: end; + max-width: 28em; } .cluster-type-card-description { - justify-self: left; - align-self: start; - max-width: 28em; + justify-self: left; + align-self: start; + max-width: 28em; } } .choose-team { - margin-bottom: 2rem; - margin-left: 0.7rem; - margin-top: 1rem; + display: flex; + justify-content: space-around; + margin-bottom: 1rem; + margin-top: 3rem; - .formItem { - max-width: 22rem; - } + .formItem { + width: 22rem; + } - select { - margin-bottom: 0; - } + select { + margin-bottom: 0; + } } diff --git a/app/javascript/cluster_types/index.js b/app/javascript/cluster_types/index.js index 271b3b1d8..a423319f0 100644 --- a/app/javascript/cluster_types/index.js +++ b/app/javascript/cluster_types/index.js @@ -1,16 +1,16 @@ document.addEventListener("DOMContentLoaded", function() { const teamSelect = document.querySelector("#choose_cluster_team"); - const typeLinks = document.querySelectorAll(".cluster-type-link"); + const cards = document.querySelectorAll(".cluster-type-card"); - if(teamSelect && !teamSelect.disabled && typeLinks.length > 0) { + if(teamSelect && !teamSelect.disabled && cards.length > 0) { teamSelect.addEventListener("change", function(event) { let selectedTeamId = event.target.value; - typeLinks.forEach(function(link) { + cards.forEach(function(link) { link.href = `${link.dataset.baseTargetUrl}?team_id=${selectedTeamId}`; - link.classList.remove("disabled-cluster-link"); + link.classList.remove("disabled-cluster-type-card"); link.title = ""; }); }); } -}); +}); \ No newline at end of file diff --git a/app/views/cluster_types/_actions.html.erb b/app/views/cluster_types/_actions.html.erb deleted file mode 100644 index c38ad30e5..000000000 --- a/app/views/cluster_types/_actions.html.erb +++ /dev/null @@ -1,7 +0,0 @@ -

Actions

- -<%= - render_lhm_actions("Cluster type actions") do |actions| - actions.add text: "Check for latest cluster types", path: cluster_types_path(use_cache: false, team_id: @team) - end -%> diff --git a/app/views/cluster_types/index.html.erb b/app/views/cluster_types/index.html.erb index 65a71fb85..5ad5964d9 100644 --- a/app/views/cluster_types/index.html.erb +++ b/app/views/cluster_types/index.html.erb @@ -3,10 +3,6 @@ <%= javascript_import_module_tag "cluster_types/index" %> <% end %> -<% content_for(:side_content) do %> - <%= render 'actions' %> -<% end %> -

Choose from our selection of cluster types to start building a cluster using diff --git a/app/views/clusters/_actions.html.erb b/app/views/clusters/_actions.html.erb index d93cd1b82..b7a6730fb 100644 --- a/app/views/clusters/_actions.html.erb +++ b/app/views/clusters/_actions.html.erb @@ -2,7 +2,7 @@ <%= render_lhm_actions("Cluster actions") do |actions| - actions.add title: "Manage key-pairs", path: key_pairs_path - actions.add title: "Re-select cluster type or team", path: cluster_types_path(team_id: @team) + actions.add text: "Manage key-pairs", path: key_pairs_path + actions.add text: "Re-select cluster type or team", path: cluster_types_path(team_id: @team) end %> diff --git a/app/views/clusters/new.html.erb b/app/views/clusters/new.html.erb index 091225ccb..23dc681ba 100644 --- a/app/views/clusters/new.html.erb +++ b/app/views/clusters/new.html.erb @@ -2,7 +2,7 @@ <%= javascript_import_module_tag "clusters/new" %> <% end %> -<% set_title 'Create cluster - configure cluster' -%> +<% set_title "Create cluster for team #{@team.name} - configure cluster" -%> <% content_for(:side_content) do %> <%= render 'actions' %> <% end %> diff --git a/db/migrate/20240319145626_destroy_racks.rb b/db/migrate/20240319145627_destroy_racks.rb similarity index 100% rename from db/migrate/20240319145626_destroy_racks.rb rename to db/migrate/20240319145627_destroy_racks.rb diff --git a/db/migrate/20240319145627_change_rack_associations.rb b/db/migrate/20240319145628_change_rack_associations.rb similarity index 100% rename from db/migrate/20240319145627_change_rack_associations.rb rename to db/migrate/20240319145628_change_rack_associations.rb diff --git a/db/migrate/20240319145628_remove_outdated_user_fields.rb b/db/migrate/20240319145629_remove_outdated_user_fields.rb similarity index 100% rename from db/migrate/20240319145628_remove_outdated_user_fields.rb rename to db/migrate/20240319145629_remove_outdated_user_fields.rb diff --git a/db/migrate/20240319145629_add_single_user_to_team.rb b/db/migrate/20240319145630_add_single_user_to_team.rb similarity index 100% rename from db/migrate/20240319145629_add_single_user_to_team.rb rename to db/migrate/20240319145630_add_single_user_to_team.rb diff --git a/db/schema.rb b/db/schema.rb index 24b05cf65..e92ea1f4c 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema[7.1].define(version: 2024_03_19_145629) do +ActiveRecord::Schema[7.1].define(version: 2024_03_19_145630) do # These are extensions that must be enabled in order to support this database enable_extension "pgcrypto" enable_extension "plpgsql"