Skip to content

Commit

Permalink
Merge pull request #2104 from sparc-request/saw-add-service-bug
Browse files Browse the repository at this point in the history
SAW - New Request Popup Window Bug
  • Loading branch information
Stuart-Johnson committed Dec 12, 2019
2 parents 270c191 + 5bf27cb commit 9b5b8d5
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
19 changes: 19 additions & 0 deletions app/assets/javascripts/service_requests.js.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,25 @@ $(document).ready ->
url: '/service_request/save_and_exit'
data: $('.milestone-field input').serialize() + "&srid=#{getSRId()}"

###################
### Add Service ###
###################

$(document).on 'click', '.add-service', ->
$(this).prop('disabled', true)
$this = $(this)
service_id = $(this).data('service-id')

$.ajax
method: 'POST'
dataType: 'script'
url: '/service_request/add_service'
data:
srid: getSRId()
service_id: service_id
complete: ->
$this.prop('disabled', false)

###############
### Catalog ###
###############
Expand Down
3 changes: 2 additions & 1 deletion app/views/catalogs/accordion/_services.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@
- else
= service.display_service_name
.col-2.text-right
= link_to icon('fas', 'plus'), add_service_service_request_path(srid: service_request.id, service_id: service.id), method: :post, remote: true, class: 'btn btn-sm btn-sq btn-success add-service', title: t('proper.cart.add_service'), data: { toggle: 'tooltip', disable: true }
%button.btn.btn-sm.btn-sq.btn-success.add-service{ type: 'button', title: t('proper.cart.add_service'), data: { toggle: 'tooltip', service_id: service.id } }
= icon('fas', 'plus')
= cpt_code_text(service)
= eap_id_text(service)
= raw service_pricing_text(service)

0 comments on commit 9b5b8d5

Please sign in to comment.