From 96d3824cbb67615c18faa5eaddbc92ff9d308bd3 Mon Sep 17 00:00:00 2001 From: Benjamin ter Kuile Date: Mon, 17 Dec 2018 07:46:43 -0500 Subject: [PATCH] Fix the datatype issue and make use of apiHost if available --- addon/components/panda-action-identifier-info-popup.coffee | 5 +++-- addon/components/panda-action-identifier-info-popup.js | 6 ++++-- .../components/panda-action-identifier-info-popup.emblem | 2 +- tests/dummy/config/environment.js | 2 +- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/addon/components/panda-action-identifier-info-popup.coffee b/addon/components/panda-action-identifier-info-popup.coffee index 3a3992a..be72479 100644 --- a/addon/components/panda-action-identifier-info-popup.coffee +++ b/addon/components/panda-action-identifier-info-popup.coffee @@ -1,4 +1,5 @@ import Ember from 'ember' +import config from 'ember-get-config' export default Ember.Component.extend tagName: 'span' @@ -10,12 +11,12 @@ export default Ember.Component.extend on_show: (element, popup) -> return unless identifier = @get('identifier') session = @get('session') - url = "#{@get('panda_prefix')}/workflow_action_definitions/#{identifier}/action_info" + url = "#{config.apiHost}#{@get('panda_prefix')}/workflow_action_definitions/#{identifier}/action_info" start_time = new Date() request = url: url contentType: "application/json" - dataType: "json" + dataType: "html" success: (response) -> #debugger #console.log response diff --git a/addon/components/panda-action-identifier-info-popup.js b/addon/components/panda-action-identifier-info-popup.js index 4765173..84bc726 100644 --- a/addon/components/panda-action-identifier-info-popup.js +++ b/addon/components/panda-action-identifier-info-popup.js @@ -1,6 +1,8 @@ // Generated by CoffeeScript 1.12.5 import Ember from 'ember'; +import config from 'ember-get-config'; + export default Ember.Component.extend({ tagName: 'span', panda_prefix: '/panda/api/v1', @@ -14,12 +16,12 @@ export default Ember.Component.extend({ return; } session = this.get('session'); - url = (this.get('panda_prefix')) + "/workflow_action_definitions/" + identifier + "/action_info"; + url = "" + config.apiHost + (this.get('panda_prefix')) + "/workflow_action_definitions/" + identifier + "/action_info"; start_time = new Date(); request = { url: url, contentType: "application/json", - dataType: "json", + dataType: "html", success: function(response) { var action_info_load_time, finish_time; finish_time = new Date(); diff --git a/app/templates/components/panda-action-identifier-info-popup.emblem b/app/templates/components/panda-action-identifier-info-popup.emblem index 870dd1e..47d8da3 100644 --- a/app/templates/components/panda-action-identifier-info-popup.emblem +++ b/app/templates/components/panda-action-identifier-info-popup.emblem @@ -1,3 +1,3 @@ -= ui-popup tagName='i' class='info circle icon' on='click' html=loading_html onShow=(action 'on_show') += ui-popup tagName='i' class='info circle icon' on='click' html=loading_html onShow=(action 'on_show') variation='very wide' = yield diff --git a/tests/dummy/config/environment.js b/tests/dummy/config/environment.js index 0deca10..b4c7ebe 100644 --- a/tests/dummy/config/environment.js +++ b/tests/dummy/config/environment.js @@ -8,7 +8,7 @@ module.exports = function(environment) { rootURL: '/dunlop-app-namespace/app/', locationType: 'auto', //applicationName: "Panda", - //apiHost: '', + apiHost: '', //apiNamespace: 'dunlop-app-namespace/api/v1', //exportApplicationGlobal: true, EmberENV: {