diff --git a/Gemfile.lock b/Gemfile.lock index 943011e54..6f27d0148 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -60,7 +60,7 @@ GEM childprocess (0.5.9) ffi (~> 1.0, >= 1.0.11) clavius (1.0.2) - clearbit (0.2.5) + clearbit (0.2.7) nestful (~> 1.1.0) coderay (1.1.1) coffee-rails (4.2.1) @@ -155,7 +155,7 @@ GEM guard guard-compat (~> 1.1) hashdiff (0.3.2) - hashie (3.5.5) + hashie (3.5.6) htmlentities (4.3.4) http (1.0.4) addressable (~> 2.3) @@ -341,7 +341,6 @@ GEM sawyer (0.7.0) addressable (>= 2.3.5, < 2.5) faraday (~> 0.8, < 0.10) - scrub_rb (1.0.1) selenium-webdriver (2.53.4) childprocess (~> 0.5) rubyzip (~> 1.0) @@ -413,13 +412,12 @@ GEM hashdiff websocket (1.2.3) writeexcel (1.0.5) - zendesk_api (1.14.0) + zendesk_api (1.14.4) faraday (~> 0.9) - hashie (>= 1.2, < 4.0, != 3.3.0) + hashie (>= 3.5.2, < 4.0.0) inflection mime-types multipart-post (~> 2.0) - scrub_rb (~> 1.0.1) PLATFORMS ruby diff --git a/app/assets/javascripts/app/controllers/import_zendesk.coffee b/app/assets/javascripts/app/controllers/import_zendesk.coffee index 04ffeee3b..b076c7210 100644 --- a/app/assets/javascripts/app/controllers/import_zendesk.coffee +++ b/app/assets/javascripts/app/controllers/import_zendesk.coffee @@ -116,7 +116,8 @@ class Index extends App.ControllerContent showCredentials: (e) => e.preventDefault() @urlStatus.attr('data-state', '') - @zendeskUrlApiToken.attr('href', @zendeskUrl.val() + 'agent/admin/api') + url = @zendeskUrl.val() + '/agent/admin/api' + @zendeskUrlApiToken.attr('href', url.replace('//', '/')) @zendeskUrlApiToken.val('HERE') @$('[data-slide=zendesk-url]').toggleClass('hide') @$('[data-slide=zendesk-credentials]').toggleClass('hide') diff --git a/app/controllers/import_zendesk_controller.rb b/app/controllers/import_zendesk_controller.rb index e0ab2c006..b77056e3a 100644 --- a/app/controllers/import_zendesk_controller.rb +++ b/app/controllers/import_zendesk_controller.rb @@ -49,7 +49,9 @@ class ImportZendeskController < ApplicationController return end - Setting.set('import_zendesk_endpoint', "#{params[:url]}api/v2") + endpoint = "#{params[:url]}/api/v2" + endpoint.gsub('//', '/') + Setting.set('import_zendesk_endpoint', endpoint) render json: { result: 'ok',