Skip to content

Commit

Permalink
Change literals for StagingWorkflow in the UI
Browse files Browse the repository at this point in the history
Now the StagingWorkflow is referred as
Staging. The edit action is to configure the Staging.
  • Loading branch information
Moises Deniz Aleman committed Nov 19, 2018
1 parent ee9379c commit 59a739a
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def set_staging_workflow
return if @staging_workflow

redirect_back(fallback_location: root_path)
flash[:error] = "StagingWorkflow with id = #{params[:staging_workflow_id]} doesn't exist"
flash[:error] = "Staging with id = #{params[:staging_workflow_id]} doesn't exist"
return
end
end
Expand Down
10 changes: 5 additions & 5 deletions src/api/app/controllers/webui/staging/workflows_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ def create
staging_workflow.managers_group = Group.find_by(title: params[:managers_title])

if staging_workflow.save
flash[:success] = "Staging Workflow for #{@project.name} was successfully created"
flash[:success] = "Staging for #{@project} was successfully created"
redirect_to staging_workflow_path(staging_workflow)
else
flash[:error] = "Staging Workflow for #{@project.name} couldn't be created"
flash[:error] = "Staging for #{@project} couldn't be created"
render :new
end
end
Expand Down Expand Up @@ -61,10 +61,10 @@ def destroy
@staging_workflow.staging_projects.where(id: params[:staging_project_ids]).destroy_all

if @staging_workflow.destroy
flash[:success] = "Staging Workflow for #{@project.name} was successfully deleted."
flash[:success] = "Staging for #{@project} was successfully deleted."
render js: "window.location='#{project_show_path(@project)}'"
else
flash[:error] = "Staging Workflow for #{@project.name} couldn't be deleted: #{@staging_workflow.errors.full_messages.to_sentence}."
flash[:error] = "Staging for #{@project} couldn't be deleted: #{@staging_workflow.errors.full_messages.to_sentence}."
render js: "window.location='#{staging_workflow_path(@staging_workflow)}'"
end
end
Expand Down Expand Up @@ -105,7 +105,7 @@ def set_staging_workflow
return if @staging_workflow

redirect_back(fallback_location: root_path)
flash[:error] = "StagingWorkflow with id = #{params[:id]} doesn't exist"
flash[:error] = "Staging with id = #{params[:id]} doesn't exist"
return
end
end
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
= render partial: 'webui/project/breadcrumb_items'
- if controller_name == 'workflows' && action_name == 'show'
%li.breadcrumb-item.active{ 'aria-current' => 'page' }
Staging Projects
Staging
- elsif controller_name == 'workflows' && action_name == 'new'
%li.breadcrumb-item.active{ 'aria-current' => 'page' }
Create Staging Projects
- else
%li.breadcrumb-item
= link_to 'Staging Projects', staging_workflow_path(@staging_workflow)
= link_to 'Staging', staging_workflow_path(@staging_workflow)
- if controller_name == 'workflows' && action_name == 'edit'
%li.breadcrumb-item.active{ 'aria-current' => 'page' }
Edit
Configure
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
.modal-content
.modal-header
%h5.modal-title
Do you want to delete the staging workflow for #{project.name}?
Do you want to delete the staging for #{project.name}?
.modal-body
%p Please confirm deletion of the staging workflow for #{project.name}
%p Please confirm deletion of the staging for #{project.name}
= form_tag staging_workflow_path, method: :delete, remote: true, id: 'staging-workflow-delete' do
- if @staging_workflow.staging_projects.any?
%p Check the staging projects you want to be deleted:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
- @pagetitle = "Edit Staging Projects for #{@project}"
- @pagetitle = "Configure Staging for #{@project}"

.row
.col-xl-12
Expand All @@ -14,7 +14,7 @@
%li.list-inline-item
= link_to('#', class: 'nav-link', data: { toggle: 'modal', target: '#staging-managers-group-modal' }) do
%i.fas.fa-users.text-warning
Select Managers
Managers

= render(partial: 'staging_projects_table',
locals: { staging_workflow: @staging_workflow, staging_projects: @staging_projects, display_actions_column: true })
Expand Down
11 changes: 6 additions & 5 deletions src/api/app/views/webui2/webui/staging/workflows/show.html.haml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
- @pagetitle = "Staging Projects for #{@project}"
- @pagetitle = "Staging for #{@project}"

.row
.col-xl-10
Expand All @@ -7,10 +7,11 @@
.card-body
%h3= @pagetitle
%ul.list-inline.mb-0
%li.list-inline-item
= link_to(edit_staging_workflow_path(@staging_workflow), class: 'nav-link') do
%i.fas.fa-edit.text-info
Edit
- if policy(@staging_workflow).update?
%li.list-inline-item
= link_to(edit_staging_workflow_path(@staging_workflow), class: 'nav-link') do
%i.fas.fa-edit.text-info
Configure
- if policy(@staging_workflow).destroy?
%li.list-inline-item
= link_to('#', class: 'nav-link', data: { toggle: 'modal', target: '#delete-staging-workflow' }) do
Expand Down

0 comments on commit 59a739a

Please sign in to comment.