Skip to content

Commit

Permalink
Merge branch 'master' into add-app-edit-request-tests
Browse files Browse the repository at this point in the history
  • Loading branch information
bdzr authored Dec 2, 2019
2 parents 64f2458 + c4ae5ea commit 4b4d55c
Show file tree
Hide file tree
Showing 9 changed files with 24 additions and 14 deletions.
5 changes: 0 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,3 @@ script:
after_script:
- ./cc-test-reporter sum-coverage coverage/codeclimate.*.json | ./cc-test-reporter upload-coverage
- ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT
deploy:
provider: heroku
app: esaas-demo
api_key:
secure: L2XrbAVImlXXU+F7GdGSdp/3EY3q0aowEFJ1umsvA/Z/tOYFl0iMje8pXunmQMH2B5mbYJMDQt5kT36WJk8WxRUzRxJQbytURWN+jdmg56GrFg4B1ub/qFKl5wbI1GkjDzZ0er1I5jLFInMmfGMo5+hDONcqbzln3D5zByOrxed/nHNEbj64/R3N+1dH3qe2OqeCityeFmiPE2FUJ1seQdEZA/TRzirT8LHSI1VntoRa5yYw3TL73aZHDc4LGATRX6/BXvQZfglq4qkduqV9TSlg7YjQfz5sFVaA8YGMP69yW/hU8vxwK1yEQ2CIVa3WOEDru/d5a8ghW7K7OMoaC3txEQQ0j7o6/7SrBHT11OnkQpQ0AAw+xO6vGDe2y2qLcudx5BNvKr2ZTDGTT/iUonQOOi0y75W3tGxlZlfpr7ZVbA/vMZMjUQvZOyg4GvD+5WL2PnVoX7Z4xAop9OXyxDtpiPpA2w8eyXXkkYoieh9kMb50NRaP4EMPPKrsuQj84mxCLHBmwkMtngbUIJxOB2rf9CFVlbL7+7fJHIp1gMASkXcBENQS9B8GotHbv/a13bEJo7hghyfATp3cR0pI+enNaZaUcnaSaRNCS4SO+Kl9znh8Ac+8rw3RnX8S1Bcn52qezqKxykDJLZ+cd9VnyEU4fTffRLxLQd18fj5YCjM=
2 changes: 1 addition & 1 deletion app/controllers/iterations_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def create
def update
feedback = feedback_params
@iteration.customer_feedback = feedback.to_json
new_params = params.require(:iteration).permit(:end_date, :general_feedback)
new_params = params.require(:iteration).permit(:number, :end_date, :general_feedback)
if @iteration.save and @iteration.update(new_params)
redirect_to engagement_iterations_path(@engagement), notice: 'Iteration was successfully updated.'
else
Expand Down
3 changes: 2 additions & 1 deletion app/views/engagements/_index.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,5 @@
%td
= link_to('Edit', edit_app_engagement_path(app,engagement), :class => 'btn btn-primary')
= link_to 'Destroy', app_engagement_path(app,engagement), method: :delete, data: { confirm: 'Are you sure?' }, :class => 'btn btn-danger'
= link_to('CSV', export_path(app,engagement), :class => 'btn btn-info')
= link_to('CSV', export_path(app,engagement), :class => 'btn btn-info')
= link_to('Request Feedback', new_engagement_iteration_path(engagement), :class => 'btn btn-success pull-right')
5 changes: 3 additions & 2 deletions app/views/iterations/_form.html.haml
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
= form_errors_for @iteration

= bootstrap_form_for([@engagement, @iteration], layout: :horizontal, label_col: 'col-sm-2', control_col: 'col-sm-10') do |f|
= f.text_field :number, label: "Iteration Number"
= f.select :number, [1, 2, 3, 4], label: "Iteration Number"
= f.date_field :end_date, value: Time.now.strftime('%Y-%m-%d'), label: 'End Date'
= f.text_area :general_feedback, :rows => '6', label: 'Customer Feedback'
= f.form_group do
= f.submit :class => 'btn btn-success'
= link_to 'Back', engagement_iterations_path(@engagement), :class => 'btn btn-primary'
= link_to 'Back to App', app_path(@engagement.app), :class => 'btn btn-primary'
= link_to 'Back to Iteration', engagement_iterations_path(@engagement), :class => 'btn btn-primary'
= button_tag 'Reset', type: :reset, :class => 'btn btn-primary'

8 changes: 6 additions & 2 deletions app/views/iterations/edit.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,12 @@
= f.fields_for :customer_feedback, nil do |feedback_form|
%fieldset.row
.col-sm-6
= f.text_field :number, label: 'Iteration Number'
= f.date_field :end_date, label: 'End Date'
- if current_user&.coach?
= f.select :number, [1, 2, 3, 4], {}, label: "Iteration Number"
= f.date_field :end_date, label: 'End Date'
- if not current_user&.coach?
= f.text_field :number, label: "Iteration Number", readonly: "readonly"
= f.date_field :end_date, label: 'End Date', readonly: "readonly"
= feedback_form.collection_select :duration, Iteration.duration_options, :itself, :itself, selected: @feedback['duration'], label: 'Duration'
.col-sm-6
= f.text_area :general_feedback, label: 'General Feedback', rows: 8
Expand Down
2 changes: 1 addition & 1 deletion app/views/iterations/index.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
%tr
%td=iter.number
%td=iter.end_date.strftime('%F')
%td=iter.general_feedback
%td=sanitize iter.general_feedback
- Iteration.customer_rating_keys.each do |rating|
%td=Iteration.rating_to_score(h[rating]) || "No Data"
%td{:style => 'white-space: nowrap'}
Expand Down
2 changes: 2 additions & 0 deletions app/views/layouts/_nav_header.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
%li= link_to 'Users', users_path, :class => ('active' if klass =~ /users/i), :role => 'presentation'
%li= link_to 'Create', creation_path, :class => ('active' if klass =~ /creation/i), :role => 'presentation'
%li= link_to 'Help', 'https://github.com/saasbook/esaas-engagements', :target => '_blank'
- if not current_user
%li= link_to 'Login', my_projects_path
- if current_user
%li= link_to "Current iteration", current_iteration_path
%li= link_to "Logout @#{current_user.github_uid}", logout_path
Expand Down
2 changes: 1 addition & 1 deletion features/auth_user.feature
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ Scenario: Happy Path - Can create new iteration, edit and destroy existing itera
And I follow "2017-03-25"
And I follow "Add Iteration"
Then I should see "New Iteration for Engagement from"
And I follow "Back"
And I follow "Back to Iteration"
And I press "Edit" for "2017-04-14"
Then I should see "Edit Customer Feedback"
And I follow "Back to Iteration"
Expand Down
9 changes: 8 additions & 1 deletion features/login_controller.feature
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,11 @@ Scenario: not logged in so should not see "My Projects" tab
Scenario: logged in so should see "My Projects" tab
Given I am logged in
Then I should see "My Projects"


Scenario: not logged in so should see "Login" tab
Given I am not logged in
Then I should see "Login"

Scenario: logged in so should not see "Login" tab
Given I am logged in
Then I should not see "Login"

0 comments on commit 4b4d55c

Please sign in to comment.