Component base setup

This commit is contained in:
2018-12-13 08:34:07 -05:00
parent 709c837b34
commit f287f49c1c
13 changed files with 80 additions and 12223 deletions
@@ -0,0 +1,26 @@
import Ember from 'ember'
export default Ember.Component.extend
panda_prefix: '/panda/api/v1'
loading_html: "<i class='notched circle loading icon green'></i>"
session: Ember.inject.service('session')
identifier: ''
actions:
on_show: (element, popup) ->
return unless identifier = @get('identifier')
session = @get('session')
url = "#{@get('panda_prefix')}/workflow_action_definitions/#{identifier}/action_info"
start_time = new Date()
request =
url: url
contentType: "application/json"
dataType: "json"
success: (response) ->
debugger
popup.setSemanticAttr('html', response)
if Ember.get(session, 'isAuthenticated')
session.authorize 'authorizer:devise', (key, authorization) ->
request.crossDomain = true
request.headers = {"#{key}": authorization}
Ember.$.ajax(request)
true