Skip to content

Commit

Permalink
update create cluster front end after rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
timalces committed Mar 19, 2024
1 parent 09102f6 commit f601d76
Show file tree
Hide file tree
Showing 11 changed files with 29 additions and 35 deletions.
35 changes: 20 additions & 15 deletions app/assets/stylesheets/components/_cluster_types_view.scss
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@
margin: 0 !important;
width: 100%;
min-height: 14.2rem;

&.disabled-cluster-type-card {
cursor: not-allowed;
}
}

.cluster-type-card-title {
Expand Down Expand Up @@ -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;
}
}
10 changes: 5 additions & 5 deletions app/javascript/cluster_types/index.js
Original file line number Diff line number Diff line change
@@ -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 = "";
});
});
}
});
});
7 changes: 0 additions & 7 deletions app/views/cluster_types/_actions.html.erb

This file was deleted.

4 changes: 0 additions & 4 deletions app/views/cluster_types/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@
<%= javascript_import_module_tag "cluster_types/index" %>
<% end %>

<% content_for(:side_content) do %>
<%= render 'actions' %>
<% end %>

<div class="text-center">
<h3>
Choose from our selection of cluster types to start building a cluster using
Expand Down
4 changes: 2 additions & 2 deletions app/views/clusters/_actions.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -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
%>
2 changes: 1 addition & 1 deletion app/views/clusters/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -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 %>
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion db/schema.rb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit f601d76

Please sign in to comment.