Skip to content

Commit

Permalink
change messages to say launcher instead of script
Browse files Browse the repository at this point in the history
  • Loading branch information
ashton22305 committed Nov 22, 2024
1 parent 1a93298 commit b2ebc9d
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 19 deletions.
10 changes: 5 additions & 5 deletions apps/dashboard/app/controllers/launchers_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ def create
default_script_created = @launcher.create_default_script

if @launcher.save
notice_messages = [I18n.t('dashboard.jobs_scripts_created')]
notice_messages << I18n.t('dashboard.jobs_scripts_default_created') if default_script_created
notice_messages = [I18n.t('dashboard.jobs_launchers_created')]
notice_messages << I18n.t('dashboard.jobs_launchers_default_created') if default_script_created
redirect_to project_path(params[:project_id]), notice: notice_messages.join(' ')
else
redirect_to project_path(params[:project_id]), alert: @launcher.errors[:save].last
Expand All @@ -45,7 +45,7 @@ def edit
# DELETE /projects/:project_id/launchers/:id
def destroy
if @launcher.destroy
redirect_to project_path(params[:project_id]), notice: I18n.t('dashboard.jobs_scripts_deleted')
redirect_to project_path(params[:project_id]), notice: I18n.t('dashboard.jobs_launchers_deleted')
else
redirect_to project_path(params[:project_id]), alert: @launcher.errors[:destroy].last
end
Expand All @@ -57,7 +57,7 @@ def save
@launcher.update(save_launcher_params[:launcher])

if @launcher.save
redirect_to project_path(params[:project_id]), notice: I18n.t('dashboard.jobs_scripts_updated')
redirect_to project_path(params[:project_id]), notice: I18n.t('dashboard.jobs_launchers_updated')
else
redirect_to project_path(params[:project_id]), alert: @launcher.errors[:save].last
end
Expand All @@ -69,7 +69,7 @@ def submit
opts = submit_launcher_params[:launcher].to_h.symbolize_keys

if (job_id = @launcher.submit(opts))
redirect_to(project_path(params[:project_id]), notice: I18n.t('dashboard.jobs_scripts_submitted', job_id: job_id))
redirect_to(project_path(params[:project_id]), notice: I18n.t('dashboard.jobs_launchers_submitted', job_id: job_id))
else
redirect_to(project_path(params[:project_id]), alert: @launcher.errors[:submit].last)
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
<div class="list-group col-md-4">
<div class="list-group-item mb-3">
<input type="checkbox" id="<%= fixed_id %>" name="<%= fixed_name %>" value="true" <%= fixed ? 'checked' : '' %> data-fixed-toggler="<%= field_id %>">
<label class="form-check-label" for="<%= fixed_id %>"><%= t('dashboard.jobs_scripts_fixed_field') %></label>
<label class="form-check-label" for="<%= fixed_id %>"><%= t('dashboard.jobs_launchers_fixed_field') %></label>
</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
id: "delete_#{launcher.id}",
class: "btn btn-danger launcher-button",
title: delete_title,
data: { confirm: I18n.t('dashboard.jobs_scripts_delete_script_confirmation') },
data: { confirm: I18n.t('dashboard.jobs_launchers_delete_script_confirmation') },
method: :delete) do
%>
<%= I18n.t('dashboard.delete') %>
Expand Down
16 changes: 8 additions & 8 deletions apps/dashboard/config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -253,14 +253,14 @@ en:
jobs_project_job_deleted: "Successfully deleted job %{job_id}"
jobs_project_job_not_deleted: "Cannot delete job %{job_id}"

jobs_scripts_created: "Script successfully created!"
jobs_scripts_default_created: "A 'hello_world.sh' was also added to this project."
jobs_scripts_updated: "Script manifest updated!"
jobs_scripts_not_found: "Cannot find script %{script_id}"
jobs_scripts_deleted: "Script successfully deleted!"
jobs_scripts_submitted: "Successfully submitted job %{job_id}."
jobs_scripts_delete_script_confirmation: "Delete all contents of script?"
jobs_scripts_fixed_field: "Fixed Value"
jobs_launchers_created: "Launcher successfully created!"
jobs_launchers_default_created: "A 'hello_world.sh' was also added to this project."
jobs_launchers_updated: "Launcher manifest updated!"
jobs_launchers_not_found: "Cannot find Launcher %{launcher_id}"
jobs_launchers_deleted: "Launcher successfully deleted!"
jobs_launchers_submitted: "Successfully submitted job %{job_id}."
jobs_launchers_delete_script_confirmation: "Delete all contents of launcher?"
jobs_launchers_fixed_field: "Fixed Value"

settings_updated: "Settings updated"
settings_invalid_request: "Invalid settings submitted"
Expand Down
8 changes: 4 additions & 4 deletions apps/dashboard/test/system/project_manager_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ def add_auto_environment_variable(project_id, launcher_id, save: true)
required: false
HEREDOC

success_message = I18n.t('dashboard.jobs_scripts_created')
success_message = I18n.t('dashboard.jobs_launchers_created')
assert_selector('.alert-success', text: "Close\n#{success_message}")
assert_equal(expected_yml, File.read("#{dir}/projects/#{project_id}/.ondemand/launchers/#{launcher_id}/form.yml"))

Expand Down Expand Up @@ -312,7 +312,7 @@ def add_auto_environment_variable(project_id, launcher_id, save: true)
required: true
HEREDOC

success_message = I18n.t('dashboard.jobs_scripts_created')
success_message = I18n.t('dashboard.jobs_launchers_created')
assert_selector('.alert-success', text: "Close\n#{success_message}")
assert_equal(expected_yml, File.read("#{dir}/projects/#{project_id}/.ondemand/launchers/#{launcher_id}/form.yml"))
end
Expand Down Expand Up @@ -563,7 +563,7 @@ def add_auto_environment_variable(project_id, launcher_id, save: true)

# correctly saves
click_on(I18n.t('dashboard.save'))
success_message = I18n.t('dashboard.jobs_scripts_updated')
success_message = I18n.t('dashboard.jobs_launchers_updated')
assert_selector('.alert-success', text: "Close\n#{success_message}")
assert_current_path project_path(project_id)

Expand Down Expand Up @@ -654,7 +654,7 @@ def add_auto_environment_variable(project_id, launcher_id, save: true)

# correctly saves
click_on(I18n.t('dashboard.save'))
success_message = I18n.t('dashboard.jobs_scripts_updated')
success_message = I18n.t('dashboard.jobs_launchers_updated')
assert_selector('.alert-success', text: "Close\n#{success_message}")
assert_current_path project_path(project_id)

Expand Down

0 comments on commit b2ebc9d

Please sign in to comment.