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

SAW - Auto-refresh bug for Modified Rate, Add/Delete Services #2176

Merged
merged 9 commits into from
Feb 5, 2020
31 changes: 13 additions & 18 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,24 @@ end

group :development, :test do
gem 'byebug'
gem 'database_cleaner' # Consider removing https://stackoverflow.com/q/49246124
gem 'email_spec' # Check usage
gem 'factory_bot_rails'
gem 'parallel_tests' # Check usage
gem 'pdf-inspector', require: false
gem 'pry'
gem 'rails-controller-testing', require: false # Consider removing and cleaning up controller specs
gem 'rails-erd' # Check usage
gem 'rspec-activemodel-mocks' # Check usage
gem 'rspec-collection_matchers'
gem 'rspec-html-matchers' # Consider removing and using `have_selector` matchers
gem 'rspec-rails', '~> 3.9'
gem 'shoulda-callback-matchers'
gem 'shoulda-matchers', require: false
gem 'simplecov', require: false # Check usage
gem 'site_prism'
gem 'webdrivers', '~> 4.2'
gem 'webmock'
end
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The gemfile changes were because webdrivers wasn't under the development group and bundle install was not updating or installing webdrivers to run specs locally.


group :development do
Expand All @@ -118,24 +131,6 @@ group :development do
gem 'traceroute' # Check usage
end

group :test do
gem 'database_cleaner' # Consider removing https://stackoverflow.com/q/49246124
gem 'email_spec' # Check usage
# gem 'geckodriver-helper' # Replace with https://github.com/titusfortner/webdrivers
gem 'webdrivers', '~> 4.2'
gem 'rails-controller-testing', require: false # Consider removing and cleaning up controller specs
gem 'rspec-activemodel-mocks' # Check usage
gem 'rspec-collection_matchers'
gem 'rspec-html-matchers' # Consider removing and using `have_selector` matchers
# gem 'selenium-webdriver'
gem 'shoulda-callback-matchers'
gem 'shoulda-matchers', require: false
gem 'simplecov', require: false # Check usage
gem 'site_prism'
gem 'webmock'
gem 'pdf-inspector', require: false
end

group :assets do
# We don't require this because we only have it so
# that we can run asset precompile during build without
Expand Down
5 changes: 5 additions & 0 deletions app/views/dashboard/clinical_line_items/create.js.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,9 @@ loadServiceCalendar()

$("#modalContainer").modal('hide')
$("#flashContainer").replaceWith("<%= j render 'layouts/flash' %>")

# Re-render Admin Edit SSR header to update costs
if $("#subServiceRequestSummary").length
$("#subServiceRequestSummary").replaceWith("<%= j render 'dashboard/sub_service_requests/header', sub_service_request: @sub_service_request %>")

<% end %>
5 changes: 5 additions & 0 deletions app/views/dashboard/clinical_line_items/destroy.js.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,9 @@ loadServiceCalendar()

$("#modalContainer").modal('hide')
$("#flashContainer").replaceWith("<%= j render 'layouts/flash' %>")

# Re-render Admin Edit SSR header to update costs
if $("#subServiceRequestSummary").length
$("#subServiceRequestSummary").replaceWith("<%= j render 'dashboard/sub_service_requests/header', sub_service_request: @sub_service_request %>")

<% end %>
6 changes: 6 additions & 0 deletions app/views/dashboard/study_level_activities/create.js.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ $('#studyLevelActivitiesTab').html('<%= j render "dashboard/sub_service_requests
<% else %>
$('#studyLevelActivitiesTable').bootstrapTable('refresh')
<% end %>

$("#modalContainer").modal('hide')
$("#flashContainer").replaceWith("<%= j render 'layouts/flash' %>")

# Re-render Admin Edit SSR header to update costs
if $("#subServiceRequestSummary").length
$("#subServiceRequestSummary").replaceWith("<%= j render 'dashboard/sub_service_requests/header', sub_service_request: @sub_service_request %>")

<% end %>
6 changes: 6 additions & 0 deletions app/views/dashboard/study_level_activities/destroy.js.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,10 @@ $('#studyLevelActivitiesTab').html('<%= j render "dashboard/sub_service_requests
$('#studyLevelActivitiesTable').bootstrapTable('refresh')
<% end %>

# Re-render Admin Edit SSR header to update costs
if $("#subServiceRequestSummary").length
$("#subServiceRequestSummary").replaceWith("<%= j render 'dashboard/sub_service_requests/header', sub_service_request: @sub_service_request %>")

$("#flashContainer").replaceWith("<%= j render 'layouts/flash' %>")

$(document).trigger('ajax:complete') # rails-ujs element replacement bug fix
6 changes: 6 additions & 0 deletions app/views/line_items/update.js.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,10 @@ $(".line-item-<%= @line_item.id %>:visible .total-per-study").replaceWith("<%= j
$('.one-time-fees-container:visible .max-total-direct').replaceWith("<%= j render 'service_calendars/master_calendar/otf/totals/max_total_direct_one_time_fee', service_request: @service_request %>")
$('.one-time-fees-container:visible .max-total-per-study').replaceWith("<%= j render 'service_calendars/master_calendar/otf/totals/total_cost_per_study', service_request: @service_request %>")
<% end %>

# Re-render Admin Edit SSR header to update costs
<% if @in_dashboard %>
$("#subServiceRequestSummary").replaceWith("<%= j render 'dashboard/sub_service_requests/header', sub_service_request: @sub_service_request %>")
<% end %>

<% end %>