Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#3902 fix-up launcher buttons list #3938

Merged
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions apps/dashboard/app/assets/stylesheets/projects.scss
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,9 @@
font-size: 1.4em;
float: right;
}

.launcher-button {
color: white;
width: 100%;
margin: 0.25rem;
}
21 changes: 11 additions & 10 deletions apps/dashboard/app/views/projects/_launcher_buttons.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -6,53 +6,54 @@
-%>

<div class="row">

<div class="col">
<%= button_to(
submit_project_launcher_path(@project.id, launcher.id),
class: 'btn btn-success',
class: 'btn btn-success launcher-button',
title: 'Launch script with cached or default values',
disabled: disabled,
params: launcher.quick_launch_params,
id: "launch_#{launcher.id}"
) do
%>
<i class="fa fa-play"></i>
Launch
<%- end %>
</div>

<div class="col">
<%= link_to(
project_launcher_path(@project.id, launcher.id),
class: "btn btn-success #{disabled_class}",
class: "btn btn-info launcher-button #{disabled_class}",
id: "show_#{launcher.id}"
) do
%>
<i class="fa fa-bars"></i>
Options
euler-room marked this conversation as resolved.
Show resolved Hide resolved
<%- end -%>
</div>

</div>
</div>
<div class="row">
<div class="col">
<%= link_to(
edit_project_launcher_path(@project.id, launcher.id),
class: "btn btn-primary #{disabled_class}",
class: "btn btn-primary launcher-button #{disabled_class}",
id: "edit_#{launcher.id}",
title: edit_title) do
%>
<i class="fa fa-pencil"></i>
Edit
euler-room marked this conversation as resolved.
Show resolved Hide resolved
<%- end %>
</div>

<div class="col">
<%= button_to(
project_launcher_path(@project.id, launcher.id),
id: "delete_#{launcher.id}",
class: "btn btn-danger",
class: "btn btn-danger launcher-button",
title: delete_title,
data: { confirm: I18n.t('dashboard.jobs_scripts_delete_script_confirmation') },
method: :delete) do
%>
<i class="fa fa-trash"></i>
Delete
<%- end -%>
</div>
</div>
15 changes: 10 additions & 5 deletions apps/dashboard/app/views/projects/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
</div>

<div class="row mb-3">
<div class="col-md-2">
<div class="col-md-3">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we keep this at 2? I feel like we need the real estate for other things to come like file navigation and job inspection.

<div class="list-group">
<a class="list-group-item list-group-item-action bg-light font-weight-bold list-toggler"
data-bs-toggle="collapse" data-bs-target="#launcher_list"
Expand All @@ -42,9 +42,12 @@
<div id="launcher_list" class="collapse show">
<%- @scripts.each do |launcher| -%>
<div class="list-group-item list-group-item-action" id="launcher_<%= launcher.id %>">
<div class="row py-2 justify-content-center">
<%= launcher.title %>
<div class="row launcher-item">
<div class="col">
<%= launcher.title %>
</div>
</div>

<%= render(partial: 'launcher_buttons', locals: { launcher: launcher }) %>
</div>
<%- end -%>
Expand All @@ -56,9 +59,10 @@
</a>
</div>
</div>
<div class="col-md-8">

<div class="col-md-7">
<div class="row">
<h2 class="h3 d-flex justify-content-center">Active Jobs</h2>
<h2 class="d-flex justify-content-center">Active Jobs</h2>
<%= render(partial: 'job_details', collection: @project.active_jobs, as: :job) %>
</div>

Expand All @@ -74,6 +78,7 @@
</div>
</div>
</div>

<% unless @project.readme_path.nil? %>
<div class="card">
<div class="card-header">
Expand Down
12 changes: 6 additions & 6 deletions apps/dashboard/test/system/project_manager_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ def add_auto_environment_variable(project_id, launcher_id, save: true)
assert_equal(expected_yml, File.read("#{dir}/projects/#{project_id}/.ondemand/launchers/#{launcher_id}/form.yml"))

launcher_path = project_launcher_path(project_id, launcher_id)
find("[href='#{launcher_path}'].btn-success").click
find("[href='#{launcher_path}'].btn-info").click
assert_selector('h1', text: 'the script title', count: 1)
end
end
Expand Down Expand Up @@ -326,7 +326,7 @@ def add_auto_environment_variable(project_id, launcher_id, save: true)
add_account(project_id, launcher_id)

launcher_path = project_launcher_path(project_id, launcher_id)
find("[href='#{launcher_path}'].btn-success").click
find("[href='#{launcher_path}'].btn-info").click
assert_selector('h1', text: 'the script title', count: 1)

expected_accounts = ['pas1604', 'pas1754', 'pas1871', 'pas2051', 'pde0006', 'pzs0714', 'pzs0715', 'pzs1010',
Expand Down Expand Up @@ -377,7 +377,7 @@ def add_auto_environment_variable(project_id, launcher_id, save: true)
add_account(project_id, launcher_id)

launcher_path = project_launcher_path(project_id, launcher_id)
find("[href='#{launcher_path}'].btn-success").click
find("[href='#{launcher_path}'].btn-info").click
assert_selector('h1', text: 'the script title', count: 1)

# assert defaults
Expand Down Expand Up @@ -424,7 +424,7 @@ def add_auto_environment_variable(project_id, launcher_id, save: true)
click_on(I18n.t('dashboard.save'))

launcher_path = project_launcher_path(project_id, launcher_id)
find("[href='#{launcher_path}'].btn-success").click
find("[href='#{launcher_path}'].btn-info").click
assert_selector('h1', text: 'the script title', count: 1)

# assert defaults
Expand Down Expand Up @@ -466,7 +466,7 @@ def add_auto_environment_variable(project_id, launcher_id, save: true)
add_account(project_id, launcher_id)

launcher_path = project_launcher_path(project_id, launcher_id)
find("[href='#{launcher_path}'].btn-success").click
find("[href='#{launcher_path}'].btn-info").click
assert_selector('h1', text: 'the script title', count: 1)

# assert defaults
Expand Down Expand Up @@ -793,7 +793,7 @@ def add_auto_environment_variable(project_id, launcher_id, save: true)
find('#save_script_edit').click
assert_current_path(project_path(project_id))
launcher_path = project_launcher_path(project_id, launcher_id)
find("[href='#{launcher_path}'].btn-success").click
find("[href='#{launcher_path}'].btn-info").click

# now let's check scripts#show to see if they've actually been excluded.
show_account_options = page.all('#launcher_auto_accounts option').map(&:value)
Expand Down
Loading