Skip to content

Commit

Permalink
Add field for group when creating a StagingWorkflow
Browse files Browse the repository at this point in the history
At creationg time the managers group is mandatory, now we pass it from
the UI
  • Loading branch information
Moises Deniz Aleman committed Nov 19, 2018
1 parent 82d9df5 commit 302771b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
2 changes: 2 additions & 0 deletions src/api/app/controllers/webui/staging/workflows_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ def create
staging_workflow = @project.build_staging
authorize staging_workflow

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"
redirect_to staging_workflow_path(staging_workflow)
Expand Down
14 changes: 7 additions & 7 deletions src/api/app/views/webui2/webui/staging/workflows/new.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,20 @@
.mb-3
Adding the staging capability to this project will enable you to group
requests into staging projects and being able to see how they build together.
.text-center
.mb-3.w-50.m-auto
= form_for @staging_workflow, method: :post do |f|
= hidden_field_tag :project_name, @project
.form-group#assign-managers-group-modal-input
= label_tag(:managers_id, "Managers:")
= label_tag(:managers_title, 'Managers:')
.input-group
.input-group-prepend
%span.input-group-text#assign-managers-group-search-icon
%i.fa.fa-search
%i.fas.fa-spinner.fa-spin.d-none
= text_field_tag 'managers_id', '', required: true, placeholder: 'Type to autocomplete...', class: 'form-control',
data: { autocomplete_groups_url: url_for(controller: '/webui/groups', action: 'autocomplete')}

= f.submit 'Create Staging Projects', class: 'btn btn-primary'
= text_field_tag 'managers_title', '', required: true, placeholder: 'Type to autocomplete...', class: 'form-control',
data: { autocomplete_groups_url: url_for(controller: '/webui/groups', action: 'autocomplete') }
.text-center
= f.submit 'Create Staging Projects', class: 'btn btn-primary'

- content_for :ready_function do
autocompleteStagingManagersGroup();
autocompleteStagingManagersGroup();

0 comments on commit 302771b

Please sign in to comment.