Component base setup
This commit is contained in:
@@ -33,6 +33,10 @@ Tasks this addon does:
|
|||||||
* Make sure that the globals are loaded (dunlop pattern)
|
* Make sure that the globals are loaded (dunlop pattern)
|
||||||
* `mkdir tests/dummy/app/initializers/`
|
* `mkdir tests/dummy/app/initializers/`
|
||||||
* `cp ../ember-cli-dunlop/tests/dummy/app/initializers/globals.coffee tests/dummy/app/initializers/`
|
* `cp ../ember-cli-dunlop/tests/dummy/app/initializers/globals.coffee tests/dummy/app/initializers/`
|
||||||
|
* Since the "".htmlSafe() pattern is used and a long search why this is
|
||||||
|
no longer working lead to the knowledge of the existence of the
|
||||||
|
`ember-disable-prototype-extensions` package that was added to the
|
||||||
|
`package.json`
|
||||||
|
|
||||||
## Running
|
## Running
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +0,0 @@
|
|||||||
import Ember from 'ember'
|
|
||||||
import layout from '../templates/components/action-identifier-info-popup'
|
|
||||||
|
|
||||||
export default Ember.Component.extend
|
|
||||||
layout: layout
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
// Generated by CoffeeScript 1.12.5
|
|
||||||
import Ember from 'ember';
|
|
||||||
|
|
||||||
import layout from '../templates/components/action-identifier-info-popup';
|
|
||||||
|
|
||||||
export default Ember.Component.extend({
|
|
||||||
layout: layout
|
|
||||||
});
|
|
||||||
@@ -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
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
// Generated by CoffeeScript 1.12.5
|
||||||
|
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: function(element, popup) {
|
||||||
|
var identifier, request, session, start_time, url;
|
||||||
|
if (!(identifier = this.get('identifier'))) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
session = this.get('session');
|
||||||
|
url = (this.get('panda_prefix')) + "/workflow_action_definitions/" + identifier + "/action_info";
|
||||||
|
start_time = new Date();
|
||||||
|
request = {
|
||||||
|
url: url,
|
||||||
|
contentType: "application/json",
|
||||||
|
dataType: "json",
|
||||||
|
success: function(response) {
|
||||||
|
debugger;
|
||||||
|
return popup.setSemanticAttr('html', response);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
if (Ember.get(session, 'isAuthenticated')) {
|
||||||
|
session.authorize('authorizer:devise', function(key, authorization) {
|
||||||
|
var obj;
|
||||||
|
request.crossDomain = true;
|
||||||
|
return request.headers = (
|
||||||
|
obj = {},
|
||||||
|
obj["" + key] = authorization,
|
||||||
|
obj
|
||||||
|
);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
Ember.$.ajax(request);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
h1 Hi
|
|
||||||
= yield
|
|
||||||
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
export { default } from 'ember-panda-adapter/components/action-identifier-info-popup';
|
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
export { default } from 'ember-panda-adapter/components/panda-action-identifier-info-popup';
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
= ui-popup tagName='i' class='info circle icon' on='click' html=loading_html onShow=(action 'on_show')
|
||||||
|
= yield
|
||||||
|
|
||||||
Generated
-12199
File diff suppressed because it is too large
Load Diff
@@ -41,7 +41,6 @@
|
|||||||
"ember-cli-sri": "^2.1.0",
|
"ember-cli-sri": "^2.1.0",
|
||||||
"ember-cli-uglify": "^2.0.0",
|
"ember-cli-uglify": "^2.0.0",
|
||||||
"ember-data": "^2.16.3",
|
"ember-data": "^2.16.3",
|
||||||
"ember-disable-prototype-extensions": "^1.1.2",
|
|
||||||
"ember-export-application-global": "^2.0.0",
|
"ember-export-application-global": "^2.0.0",
|
||||||
"ember-get-config": "^0.2.4",
|
"ember-get-config": "^0.2.4",
|
||||||
"ember-load-initializers": "^1.0.0",
|
"ember-load-initializers": "^1.0.0",
|
||||||
|
|||||||
@@ -1,2 +1,2 @@
|
|||||||
/= page-title 'This shows demos of components'
|
= page-title 'This shows demos of components'
|
||||||
h1 h
|
= outlet
|
||||||
|
|||||||
@@ -1,4 +1,2 @@
|
|||||||
h1 Yeah
|
.ui.info.message panda-action-identifier-info-popup
|
||||||
h1 Yeah
|
= panda-action-identifier-info-popup identifier='abcd'
|
||||||
h1 Yeah
|
|
||||||
h1 Yeah
|
|
||||||
|
|||||||
Reference in New Issue
Block a user