initial github commit
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
import Ember from 'ember'
|
||||
|
||||
export default Ember.Component.extend
|
||||
tagName: 'span'
|
||||
organizations: []
|
||||
actions:
|
||||
apply_filters: ->
|
||||
@get('apply_filters')?()
|
||||
set_scope_organization: (organization) ->
|
||||
if organization?
|
||||
#organization.reload().then =>
|
||||
organization_id = organization?.get('id') || ''
|
||||
@set 'scope_organization', organization
|
||||
@set 'filters.workflow_action_definition_organization_id', organization_id
|
||||
@$('.select-organization .dropdown.button').addClass('orange')
|
||||
@send 'apply_filters'
|
||||
else
|
||||
@setProperties
|
||||
scope_organization: null
|
||||
scope_scenario: null
|
||||
'filters.workflow_action_definition_organization_id': ''
|
||||
@$('.select-organization .dropdown.button').removeClass('orange')
|
||||
@send 'apply_filters'
|
||||
@@ -0,0 +1,30 @@
|
||||
// Generated by CoffeeScript 1.12.5
|
||||
import Ember from 'ember';
|
||||
|
||||
export default Ember.Component.extend({
|
||||
tagName: 'span',
|
||||
organizations: [],
|
||||
actions: {
|
||||
apply_filters: function() {
|
||||
var base;
|
||||
return typeof (base = this.get('apply_filters')) === "function" ? base() : void 0;
|
||||
},
|
||||
set_scope_organization: function(organization) {
|
||||
var organization_id;
|
||||
if (organization != null) {
|
||||
organization_id = (organization != null ? organization.get('id') : void 0) || '';
|
||||
this.set('scope_organization', organization);
|
||||
this.set('filters.workflow_action_definition_organization_id', organization_id);
|
||||
this.$('.select-organization .dropdown.button').addClass('orange');
|
||||
return this.send('apply_filters');
|
||||
} else {
|
||||
this.setProperties({
|
||||
scope_organization: null,
|
||||
scope_scenario: null,
|
||||
'filters.workflow_action_definition_organization_id': ''
|
||||
}, this.$('.select-organization .dropdown.button').removeClass('orange'));
|
||||
return this.send('apply_filters');
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -0,0 +1,42 @@
|
||||
import Ember from 'ember'
|
||||
{get} = Ember
|
||||
|
||||
export default Ember.Component.extend
|
||||
tagName: 'span'
|
||||
scope_project: null
|
||||
scope_scenario: null
|
||||
projects: []
|
||||
actions:
|
||||
apply_filters: ->
|
||||
@get('apply_filters')?()
|
||||
|
||||
edit_project_instance_action: (project_instance_action) ->
|
||||
@modal 'project/edit-instance-action', model: project_instance_action
|
||||
set_scope_project: (project) ->
|
||||
if project?
|
||||
project.reload().then =>
|
||||
project_id = project?.get('id') || ''
|
||||
@set 'scope_project', project
|
||||
@set 'filters.workflow_action_definition_title_cont', ''
|
||||
@set 'filters.project_id', project_id
|
||||
@$('.select-project .dropdown.button').addClass('orange')
|
||||
@send 'apply_filters'
|
||||
else
|
||||
@setProperties
|
||||
scope_project: null
|
||||
scope_scenario: null
|
||||
'filters.project_id': ''
|
||||
'filters.project_instance_project_scenario_id': ''
|
||||
@$('.select-project .dropdown.button').removeClass('orange')
|
||||
@send 'apply_filters'
|
||||
|
||||
set_scope_scenario: (project_scenario) ->
|
||||
if project_scenario
|
||||
scenario_id = get(project_scenario, 'id')
|
||||
@$('.select-project-scenario .dropdown.button').addClass('orange')
|
||||
else
|
||||
@$('.select-project-scenario .dropdown.button').removeClass('orange')
|
||||
scenario_id = ''
|
||||
@set 'filters.project_instance_project_scenario_id', scenario_id
|
||||
@set 'scope_scenario', project_scenario
|
||||
@send 'apply_filters'
|
||||
@@ -0,0 +1,60 @@
|
||||
// Generated by CoffeeScript 1.12.5
|
||||
var get;
|
||||
|
||||
import Ember from 'ember';
|
||||
|
||||
get = Ember.get;
|
||||
|
||||
export default Ember.Component.extend({
|
||||
tagName: 'span',
|
||||
scope_project: null,
|
||||
scope_scenario: null,
|
||||
projects: [],
|
||||
actions: {
|
||||
apply_filters: function() {
|
||||
var base;
|
||||
return typeof (base = this.get('apply_filters')) === "function" ? base() : void 0;
|
||||
},
|
||||
edit_project_instance_action: function(project_instance_action) {
|
||||
return this.modal('project/edit-instance-action', {
|
||||
model: project_instance_action
|
||||
});
|
||||
},
|
||||
set_scope_project: function(project) {
|
||||
if (project != null) {
|
||||
return project.reload().then((function(_this) {
|
||||
return function() {
|
||||
var project_id;
|
||||
project_id = (project != null ? project.get('id') : void 0) || '';
|
||||
_this.set('scope_project', project);
|
||||
_this.set('filters.workflow_action_definition_title_cont', '');
|
||||
_this.set('filters.project_id', project_id);
|
||||
_this.$('.select-project .dropdown.button').addClass('orange');
|
||||
return _this.send('apply_filters');
|
||||
};
|
||||
})(this));
|
||||
} else {
|
||||
this.setProperties({
|
||||
scope_project: null,
|
||||
scope_scenario: null,
|
||||
'filters.project_id': '',
|
||||
'filters.project_instance_project_scenario_id': ''
|
||||
}, this.$('.select-project .dropdown.button').removeClass('orange'));
|
||||
return this.send('apply_filters');
|
||||
}
|
||||
},
|
||||
set_scope_scenario: function(project_scenario) {
|
||||
var scenario_id;
|
||||
if (project_scenario) {
|
||||
scenario_id = get(project_scenario, 'id');
|
||||
this.$('.select-project-scenario .dropdown.button').addClass('orange');
|
||||
} else {
|
||||
this.$('.select-project-scenario .dropdown.button').removeClass('orange');
|
||||
scenario_id = '';
|
||||
}
|
||||
this.set('filters.project_instance_project_scenario_id', scenario_id);
|
||||
this.set('scope_scenario', project_scenario);
|
||||
return this.send('apply_filters');
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -0,0 +1,13 @@
|
||||
import Ember from 'ember'
|
||||
import config from 'ember-get-config'
|
||||
|
||||
export default Ember.Component.extend
|
||||
tagName: 'img'
|
||||
init: ->
|
||||
src = if config.environment is 'development' or config.environment is 'test'
|
||||
"#{config.rootURL}ember-panda/assets/#{@get('path')}"
|
||||
else
|
||||
"#{config.rootURL}assets/#{@get('path')}"
|
||||
@set 'full_src', src
|
||||
@_super arguments...
|
||||
attributeBindings: ['full_src:src']
|
||||
@@ -0,0 +1,15 @@
|
||||
// Generated by CoffeeScript 1.12.5
|
||||
import Ember from 'ember';
|
||||
|
||||
import config from 'ember-get-config';
|
||||
|
||||
export default Ember.Component.extend({
|
||||
tagName: 'img',
|
||||
init: function() {
|
||||
var src;
|
||||
src = config.environment === 'development' || config.environment === 'test' ? config.rootURL + "ember-panda/assets/" + (this.get('path')) : config.rootURL + "assets/" + (this.get('path'));
|
||||
this.set('full_src', src);
|
||||
return this._super.apply(this, arguments);
|
||||
},
|
||||
attributeBindings: ['full_src:src']
|
||||
});
|
||||
@@ -0,0 +1,18 @@
|
||||
import Ember from 'ember'
|
||||
|
||||
export default Ember.Component.extend
|
||||
classNames: ['ui', 'small', 'buttons', 'active-project-scenario-selector-component']
|
||||
project: null
|
||||
active_project_scenario: null
|
||||
|
||||
actions:
|
||||
show_project_scenarios_grid: (project) ->
|
||||
@modal 'project/project-scenarios-show-grid',
|
||||
model: project
|
||||
edit_selected_project_scenario: ->
|
||||
return unless project_scenario = @get('active_project_scenario')
|
||||
@modal 'project/edit-project-scenario',
|
||||
model: project_scenario
|
||||
closeOnOverlay: false
|
||||
destroy_callback: =>
|
||||
@set 'active_project_scenario', null
|
||||
@@ -0,0 +1,30 @@
|
||||
// Generated by CoffeeScript 1.12.5
|
||||
import Ember from 'ember';
|
||||
|
||||
export default Ember.Component.extend({
|
||||
classNames: ['ui', 'small', 'buttons', 'active-project-scenario-selector-component'],
|
||||
project: null,
|
||||
active_project_scenario: null,
|
||||
actions: {
|
||||
show_project_scenarios_grid: function(project) {
|
||||
return this.modal('project/project-scenarios-show-grid', {
|
||||
model: project
|
||||
});
|
||||
},
|
||||
edit_selected_project_scenario: function() {
|
||||
var project_scenario;
|
||||
if (!(project_scenario = this.get('active_project_scenario'))) {
|
||||
return;
|
||||
}
|
||||
return this.modal('project/edit-project-scenario', {
|
||||
model: project_scenario,
|
||||
closeOnOverlay: false,
|
||||
destroy_callback: (function(_this) {
|
||||
return function() {
|
||||
return _this.set('active_project_scenario', null);
|
||||
};
|
||||
})(this)
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -0,0 +1,53 @@
|
||||
import Ember from 'ember'
|
||||
|
||||
export default Ember.Component.extend
|
||||
classNames: ['project-instance-action-value-display']
|
||||
eventIO: null
|
||||
project_instance_action: null
|
||||
value_type: Ember.computed.alias 'project_instance_action.workflow_action_definition.value_type'
|
||||
save: ->
|
||||
|
||||
# https://stackoverflow.com/questions/26967855/handling-click-and-doubleclick-on-same-view-in-emberjs
|
||||
doubleClick: ->
|
||||
eventIO = @get 'eventIO'
|
||||
if eventIO?
|
||||
Ember.run.cancel eventIO
|
||||
@set 'eventIO', null
|
||||
|
||||
if @get('value_type') is 'boolean'
|
||||
#@toggleProperty 'project_instance_action.boolean_value'
|
||||
#@get('project_instance_action').save()
|
||||
|
||||
# always modal, otherwise implement authorizations overhere
|
||||
@modal 'project/edit-instance-action',
|
||||
model: @get('project_instance_action')
|
||||
save: @save
|
||||
close: @save
|
||||
else
|
||||
# fallback to single click behaviour
|
||||
@modal 'project/edit-instance-action',
|
||||
model: @get('project_instance_action')
|
||||
save: @save
|
||||
close: @save
|
||||
|
||||
|
||||
click: ->
|
||||
if @get('eventIO') is null
|
||||
eventIO = Ember.run.later @, ->
|
||||
@modal 'project/edit-instance-action',
|
||||
model: @get('project_instance_action')
|
||||
save: @save
|
||||
close: @save
|
||||
if @get('eventIO') isnt null
|
||||
Ember.run.cancel @get('eventIO')
|
||||
@set 'eventIO', null
|
||||
, 500
|
||||
@set 'eventIO', eventIO
|
||||
|
||||
actions:
|
||||
right_click: ->
|
||||
debugger
|
||||
false
|
||||
#edit_record: ->
|
||||
# @modal 'project/edit-instance-action', model: @get('project_instance_action')
|
||||
# false
|
||||
@@ -0,0 +1,54 @@
|
||||
// Generated by CoffeeScript 1.12.5
|
||||
import Ember from 'ember';
|
||||
|
||||
export default Ember.Component.extend({
|
||||
classNames: ['project-instance-action-value-display'],
|
||||
eventIO: null,
|
||||
project_instance_action: null,
|
||||
value_type: Ember.computed.alias('project_instance_action.workflow_action_definition.value_type'),
|
||||
save: function() {},
|
||||
doubleClick: function() {
|
||||
var eventIO;
|
||||
eventIO = this.get('eventIO');
|
||||
if (eventIO != null) {
|
||||
Ember.run.cancel(eventIO);
|
||||
this.set('eventIO', null);
|
||||
}
|
||||
if (this.get('value_type') === 'boolean') {
|
||||
return this.modal('project/edit-instance-action', {
|
||||
model: this.get('project_instance_action'),
|
||||
save: this.save,
|
||||
close: this.save
|
||||
});
|
||||
} else {
|
||||
return this.modal('project/edit-instance-action', {
|
||||
model: this.get('project_instance_action'),
|
||||
save: this.save,
|
||||
close: this.save
|
||||
});
|
||||
}
|
||||
},
|
||||
click: function() {
|
||||
var eventIO;
|
||||
if (this.get('eventIO') === null) {
|
||||
eventIO = Ember.run.later(this, function() {
|
||||
this.modal('project/edit-instance-action', {
|
||||
model: this.get('project_instance_action'),
|
||||
save: this.save,
|
||||
close: this.save
|
||||
});
|
||||
if (this.get('eventIO') !== null) {
|
||||
Ember.run.cancel(this.get('eventIO'));
|
||||
return this.set('eventIO', null);
|
||||
}
|
||||
}, 500);
|
||||
return this.set('eventIO', eventIO);
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
right_click: function() {
|
||||
debugger;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -0,0 +1,27 @@
|
||||
import Ember from 'ember'
|
||||
|
||||
Component = Ember.Component.extend
|
||||
tagName: 'span'
|
||||
classNames: ['ui', 'label', 'state-badge']
|
||||
classNameBindings: ['ui_class', 'having_action:with-action', 'basic:basic']
|
||||
action: null
|
||||
state: '…'
|
||||
human_state: Ember.computed 'state', ->
|
||||
return '-' unless state = @get('state')
|
||||
t("attributes.state.#{state}", default: state)
|
||||
having_action: Ember.computed.bool 'action'
|
||||
click: ->
|
||||
@action?()
|
||||
ui_class: Ember.computed 'state', ->
|
||||
switch @get('state')
|
||||
when 'overdue' then 'yellow'
|
||||
when 'completed', 'all_completed' then 'green'
|
||||
when 'rejected', 'any_rejected' then 'red'
|
||||
when 'active', 'processing' then 'blue'
|
||||
when 'inquiry' then 'pink'
|
||||
else 'grey'
|
||||
|
||||
Component.reopenClass
|
||||
positionalParams: ['state']
|
||||
|
||||
export default Component
|
||||
@@ -0,0 +1,50 @@
|
||||
// Generated by CoffeeScript 1.12.5
|
||||
var Component;
|
||||
|
||||
import Ember from 'ember';
|
||||
|
||||
Component = Ember.Component.extend({
|
||||
tagName: 'span',
|
||||
classNames: ['ui', 'label', 'state-badge'],
|
||||
classNameBindings: ['ui_class', 'having_action:with-action', 'basic:basic'],
|
||||
action: null,
|
||||
state: '…',
|
||||
human_state: Ember.computed('state', function() {
|
||||
var state;
|
||||
if (!(state = this.get('state'))) {
|
||||
return '-';
|
||||
}
|
||||
return t("attributes.state." + state, {
|
||||
"default": state
|
||||
});
|
||||
}),
|
||||
having_action: Ember.computed.bool('action'),
|
||||
click: function() {
|
||||
return typeof this.action === "function" ? this.action() : void 0;
|
||||
},
|
||||
ui_class: Ember.computed('state', function() {
|
||||
switch (this.get('state')) {
|
||||
case 'overdue':
|
||||
return 'yellow';
|
||||
case 'completed':
|
||||
case 'all_completed':
|
||||
return 'green';
|
||||
case 'rejected':
|
||||
case 'any_rejected':
|
||||
return 'red';
|
||||
case 'active':
|
||||
case 'processing':
|
||||
return 'blue';
|
||||
case 'inquiry':
|
||||
return 'pink';
|
||||
default:
|
||||
return 'grey';
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
Component.reopenClass({
|
||||
positionalParams: ['state']
|
||||
});
|
||||
|
||||
export default Component;
|
||||
@@ -0,0 +1,13 @@
|
||||
import Ember from 'ember'
|
||||
|
||||
export default Ember.Component.extend
|
||||
classNames: ['ui-multi-select-container']
|
||||
labelProperty: 'name'
|
||||
placeholder: 'Select' # can be a text or translation string: organization.select_users.placeholder => # 'Select ${models.plural.user} (%{count})'
|
||||
options: []
|
||||
selected: []
|
||||
placeholder_text: Ember.computed 'placeholder', ->
|
||||
placeholder = @get('placeholder')
|
||||
placeholder = t(placeholder, count: @get('options.length')) if is_translation_path(placeholder)
|
||||
placeholder.htmlSafe()
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
// Generated by CoffeeScript 1.12.5
|
||||
import Ember from 'ember';
|
||||
|
||||
export default Ember.Component.extend({
|
||||
classNames: ['ui-multi-select-container'],
|
||||
labelProperty: 'name',
|
||||
placeholder: 'Select',
|
||||
options: [],
|
||||
selected: [],
|
||||
placeholder_text: Ember.computed('placeholder', function() {
|
||||
var placeholder;
|
||||
placeholder = this.get('placeholder');
|
||||
if (is_translation_path(placeholder)) {
|
||||
placeholder = t(placeholder, {
|
||||
count: this.get('options.length')
|
||||
});
|
||||
}
|
||||
return placeholder.htmlSafe();
|
||||
})
|
||||
});
|
||||
@@ -0,0 +1,34 @@
|
||||
import Ember from 'ember'
|
||||
|
||||
export default Ember.Component.extend
|
||||
tagName: 'span'
|
||||
type: null
|
||||
classNames: ['value-type-display']
|
||||
classNameBindings: ['typeClass']
|
||||
typeClass: Ember.computed 'type', -> @get('type') || 'no-typ'
|
||||
iconClass: Ember.computed 'type', ->
|
||||
switch @get('type')
|
||||
when 'boolean' then 'checkmark box'
|
||||
when 'date' then 'calendar'
|
||||
when 'select' then 'list'
|
||||
when 'string' then 'terminal'
|
||||
when 'text' then 'sticky note outline'
|
||||
when 'number' then 'hashtag'
|
||||
when 'timestamp' then 'wait'
|
||||
else 'red warning circle'
|
||||
# &.date
|
||||
# @extend .fa-calendar
|
||||
# &.number
|
||||
# @extend .fa-hashtag
|
||||
# &.select
|
||||
# @extend .fa-list-ul
|
||||
# &.string
|
||||
# @extend .fa-terminal
|
||||
# &.text
|
||||
# @extend .fa-sticky-note-o
|
||||
# &.window_from
|
||||
# @extend .fa-clock-o
|
||||
# &.window_to
|
||||
# @extend .fa-clock-o
|
||||
# &.timestamp
|
||||
# @extend .fa-clock-o
|
||||
@@ -0,0 +1,32 @@
|
||||
// Generated by CoffeeScript 1.12.5
|
||||
import Ember from 'ember';
|
||||
|
||||
export default Ember.Component.extend({
|
||||
tagName: 'span',
|
||||
type: null,
|
||||
classNames: ['value-type-display'],
|
||||
classNameBindings: ['typeClass'],
|
||||
typeClass: Ember.computed('type', function() {
|
||||
return this.get('type') || 'no-typ';
|
||||
}),
|
||||
iconClass: Ember.computed('type', function() {
|
||||
switch (this.get('type')) {
|
||||
case 'boolean':
|
||||
return 'checkmark box';
|
||||
case 'date':
|
||||
return 'calendar';
|
||||
case 'select':
|
||||
return 'list';
|
||||
case 'string':
|
||||
return 'terminal';
|
||||
case 'text':
|
||||
return 'sticky note outline';
|
||||
case 'number':
|
||||
return 'hashtag';
|
||||
case 'timestamp':
|
||||
return 'wait';
|
||||
default:
|
||||
return 'red warning circle';
|
||||
}
|
||||
})
|
||||
});
|
||||
Reference in New Issue
Block a user