Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| d603418735 | |||
| a4321d0a23 | |||
| 0b236e142f | |||
| 36a9f70d3d | |||
| 60f1388f45 | |||
| e8cce92f0e | |||
| a317dee95e | |||
| b7487ca827 | |||
| 9444f9d9ad | |||
| 0469ef470f |
@@ -21,3 +21,4 @@ testem.log
|
|||||||
.node_modules.ember-try/
|
.node_modules.ember-try/
|
||||||
bower.json.ember-try
|
bower.json.ember-try
|
||||||
package.json.ember-try
|
package.json.ember-try
|
||||||
|
/package-lock.json
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
// Generated by CoffeeScript 1.12.5
|
// Generated by CoffeeScript 2.7.0
|
||||||
var get,
|
var get,
|
||||||
indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };
|
indexOf = [].indexOf;
|
||||||
|
|
||||||
import Ember from 'ember';
|
import Ember from 'ember';
|
||||||
|
|
||||||
get = Ember.get;
|
({get} = Ember);
|
||||||
|
|
||||||
export default Ember.Component.extend({
|
export default Ember.Component.extend({
|
||||||
tagName: 'span',
|
tagName: 'span',
|
||||||
@@ -32,6 +32,7 @@ export default Ember.Component.extend({
|
|||||||
set_scope_organization: function(organization) {
|
set_scope_organization: function(organization) {
|
||||||
var organization_id;
|
var organization_id;
|
||||||
if (organization != null) {
|
if (organization != null) {
|
||||||
|
//organization.reload().then =>
|
||||||
organization_id = (organization != null ? organization.get('id') : void 0) || '';
|
organization_id = (organization != null ? organization.get('id') : void 0) || '';
|
||||||
this.set('scope_organization', organization);
|
this.set('scope_organization', organization);
|
||||||
this.set('filters.workflow_action_definition_organization_id', organization_id);
|
this.set('filters.workflow_action_definition_organization_id', organization_id);
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
// Generated by CoffeeScript 1.12.5
|
// Generated by CoffeeScript 2.7.0
|
||||||
var get;
|
var get;
|
||||||
|
|
||||||
import Ember from 'ember';
|
import Ember from 'ember';
|
||||||
|
|
||||||
get = Ember.get;
|
({get} = Ember);
|
||||||
|
|
||||||
export default Ember.Component.extend({
|
export default Ember.Component.extend({
|
||||||
tagName: 'span',
|
tagName: 'span',
|
||||||
@@ -22,17 +22,15 @@ export default Ember.Component.extend({
|
|||||||
},
|
},
|
||||||
set_scope_project: function(project) {
|
set_scope_project: function(project) {
|
||||||
if (project != null) {
|
if (project != null) {
|
||||||
return project.reload().then((function(_this) {
|
return project.reload().then(() => {
|
||||||
return function() {
|
var project_id;
|
||||||
var project_id;
|
project_id = (project != null ? project.get('id') : void 0) || '';
|
||||||
project_id = (project != null ? project.get('id') : void 0) || '';
|
this.set('scope_project', project);
|
||||||
_this.set('scope_project', project);
|
this.set('filters.workflow_action_definition_title_cont', '');
|
||||||
_this.set('filters.workflow_action_definition_title_cont', '');
|
this.set('filters.project_id', project_id);
|
||||||
_this.set('filters.project_id', project_id);
|
this.$('.select-project .dropdown.button').addClass('orange');
|
||||||
_this.$('.select-project .dropdown.button').addClass('orange');
|
return this.send('apply_filters');
|
||||||
return _this.send('apply_filters');
|
});
|
||||||
};
|
|
||||||
})(this));
|
|
||||||
} else {
|
} else {
|
||||||
this.setProperties({
|
this.setProperties({
|
||||||
scope_project: null,
|
scope_project: null,
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
// Generated by CoffeeScript 1.12.5
|
// Generated by CoffeeScript 2.7.0
|
||||||
import Ember from 'ember';
|
import Ember from 'ember';
|
||||||
|
|
||||||
import DS from 'ember-data';
|
import DS from 'ember-data';
|
||||||
|
|
||||||
export default Ember.Component.extend({
|
export default Ember.Component.extend({
|
||||||
record: null,
|
record: null, // parameter
|
||||||
project_specific: false,
|
project_specific: false, // parameter
|
||||||
session: Ember.inject.service('session'),
|
session: Ember.inject.service('session'),
|
||||||
classNames: ['project-aggregate-statistics', 'project-aggregate-organization-statistics'],
|
classNames: ['project-aggregate-statistics', 'project-aggregate-organization-statistics'],
|
||||||
statistics: Ember.computed('statistics_data.isFulfilled', 'project_specific', function() {
|
statistics: Ember.computed('statistics_data.isFulfilled', 'project_specific', function() {
|
||||||
@@ -44,6 +44,11 @@ export default Ember.Component.extend({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
//if project_object.project and project_object.project.id isnt project.id
|
||||||
|
// target.push project_object
|
||||||
|
// project_object = {project: project}
|
||||||
|
// continue
|
||||||
|
//project_object.project = project
|
||||||
return target;
|
return target;
|
||||||
}),
|
}),
|
||||||
statistics_data: Ember.computed(function() {
|
statistics_data: Ember.computed(function() {
|
||||||
@@ -53,7 +58,7 @@ export default Ember.Component.extend({
|
|||||||
}
|
}
|
||||||
model_name = 'panda/organization';
|
model_name = 'panda/organization';
|
||||||
base_url = this.store.adapterFor(model_name).buildURL(model_name);
|
base_url = this.store.adapterFor(model_name).buildURL(model_name);
|
||||||
url = base_url + "/" + record_id + "/statistics1";
|
url = `${base_url}/${record_id}/statistics1`;
|
||||||
session = this.get('session');
|
session = this.get('session');
|
||||||
store = this.store;
|
store = this.store;
|
||||||
request = {
|
request = {
|
||||||
@@ -61,15 +66,14 @@ export default Ember.Component.extend({
|
|||||||
contentType: "application/json",
|
contentType: "application/json",
|
||||||
dataType: "json"
|
dataType: "json"
|
||||||
};
|
};
|
||||||
|
//success: (response) ->
|
||||||
|
// resolve(response)
|
||||||
if (Ember.get(session, 'isAuthenticated')) {
|
if (Ember.get(session, 'isAuthenticated')) {
|
||||||
session.authorize('authorizer:devise', function(key, authorization) {
|
session.authorize('authorizer:devise', function(key, authorization) {
|
||||||
var obj;
|
|
||||||
request.crossDomain = true;
|
request.crossDomain = true;
|
||||||
return request.headers = (
|
return request.headers = {
|
||||||
obj = {},
|
[`${key}`]: authorization
|
||||||
obj["" + key] = authorization,
|
};
|
||||||
obj
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
return DS.PromiseObject.create({
|
return DS.PromiseObject.create({
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Generated by CoffeeScript 1.12.5
|
// Generated by CoffeeScript 2.7.0
|
||||||
import Ember from 'ember';
|
import Ember from 'ember';
|
||||||
|
|
||||||
import config from 'ember-get-config';
|
import config from 'ember-get-config';
|
||||||
@@ -7,9 +7,9 @@ export default Ember.Component.extend({
|
|||||||
tagName: 'img',
|
tagName: 'img',
|
||||||
init: function() {
|
init: function() {
|
||||||
var src;
|
var src;
|
||||||
src = config.environment === 'development' || config.environment === 'test' ? config.rootURL + "ember-panda/assets/" + (this.get('path')) : config.rootURL + "assets/" + (this.get('path'));
|
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);
|
this.set('full_src', src);
|
||||||
return this._super.apply(this, arguments);
|
return this._super(...arguments);
|
||||||
},
|
},
|
||||||
attributeBindings: ['full_src:src']
|
attributeBindings: ['full_src:src']
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Generated by CoffeeScript 1.12.5
|
// Generated by CoffeeScript 2.7.0
|
||||||
import Ember from 'ember';
|
import Ember from 'ember';
|
||||||
|
|
||||||
export default Ember.Component.extend({
|
export default Ember.Component.extend({
|
||||||
@@ -19,11 +19,9 @@ export default Ember.Component.extend({
|
|||||||
return this.modal('project/edit-project-scenario', {
|
return this.modal('project/edit-project-scenario', {
|
||||||
model: project_scenario,
|
model: project_scenario,
|
||||||
closeOnOverlay: false,
|
closeOnOverlay: false,
|
||||||
destroy_callback: (function(_this) {
|
destroy_callback: () => {
|
||||||
return function() {
|
return this.set('active_project_scenario', null);
|
||||||
return _this.set('active_project_scenario', null);
|
}
|
||||||
};
|
|
||||||
})(this)
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Generated by CoffeeScript 1.12.5
|
// Generated by CoffeeScript 2.7.0
|
||||||
import Ember from 'ember';
|
import Ember from 'ember';
|
||||||
|
|
||||||
export default Ember.Component.extend({
|
export default Ember.Component.extend({
|
||||||
@@ -8,6 +8,7 @@ export default Ember.Component.extend({
|
|||||||
project_instance_action: null,
|
project_instance_action: null,
|
||||||
value_type: Ember.computed.alias('project_instance_action.workflow_action_definition.value_type'),
|
value_type: Ember.computed.alias('project_instance_action.workflow_action_definition.value_type'),
|
||||||
save: function() {},
|
save: function() {},
|
||||||
|
// https://stackoverflow.com/questions/26967855/handling-click-and-doubleclick-on-same-view-in-emberjs
|
||||||
doubleClick: function() {
|
doubleClick: function() {
|
||||||
var eventIO;
|
var eventIO;
|
||||||
eventIO = this.get('eventIO');
|
eventIO = this.get('eventIO');
|
||||||
@@ -16,12 +17,17 @@ export default Ember.Component.extend({
|
|||||||
this.set('eventIO', null);
|
this.set('eventIO', null);
|
||||||
}
|
}
|
||||||
if (this.get('value_type') === 'boolean') {
|
if (this.get('value_type') === 'boolean') {
|
||||||
|
//@toggleProperty 'project_instance_action.boolean_value'
|
||||||
|
//@get('project_instance_action').save()
|
||||||
|
|
||||||
|
// always modal, otherwise implement authorizations overhere
|
||||||
return this.modal('project/edit-instance-action', {
|
return this.modal('project/edit-instance-action', {
|
||||||
model: this.get('project_instance_action'),
|
model: this.get('project_instance_action'),
|
||||||
save: this.save,
|
save: this.save,
|
||||||
close: this.save
|
close: this.save
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
// fallback to single click behaviour
|
||||||
return this.modal('project/edit-instance-action', {
|
return this.modal('project/edit-instance-action', {
|
||||||
model: this.get('project_instance_action'),
|
model: this.get('project_instance_action'),
|
||||||
save: this.save,
|
save: this.save,
|
||||||
@@ -52,3 +58,7 @@ export default Ember.Component.extend({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
//edit_record: ->
|
||||||
|
// @modal 'project/edit-instance-action', model: @get('project_instance_action')
|
||||||
|
// false
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Generated by CoffeeScript 1.12.5
|
// Generated by CoffeeScript 2.7.0
|
||||||
var Component;
|
var Component;
|
||||||
|
|
||||||
import Ember from 'ember';
|
import Ember from 'ember';
|
||||||
@@ -14,8 +14,8 @@ Component = Ember.Component.extend({
|
|||||||
if (!(state = this.get('state'))) {
|
if (!(state = this.get('state'))) {
|
||||||
return '-';
|
return '-';
|
||||||
}
|
}
|
||||||
return t("attributes.state." + state, {
|
return t(`attributes.state.${state}`, {
|
||||||
"default": state
|
default: state
|
||||||
});
|
});
|
||||||
}),
|
}),
|
||||||
having_action: Ember.computed.bool('action'),
|
having_action: Ember.computed.bool('action'),
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
// Generated by CoffeeScript 1.12.5
|
// Generated by CoffeeScript 2.7.0
|
||||||
import Ember from 'ember';
|
import Ember from 'ember';
|
||||||
|
|
||||||
export default Ember.Component.extend({
|
export default Ember.Component.extend({
|
||||||
classNames: ['ui-multi-select-container'],
|
classNames: ['ui-multi-select-container'],
|
||||||
labelProperty: 'name',
|
labelProperty: 'name',
|
||||||
placeholder: 'Select',
|
placeholder: 'Select', // can be a text or translation string: organization.select_users.placeholder => # 'Select ${models.plural.user} (%{count})'
|
||||||
options: [],
|
options: [],
|
||||||
selected: [],
|
selected: [],
|
||||||
placeholder_text: Ember.computed('placeholder', function() {
|
placeholder_text: Ember.computed('placeholder', function() {
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
// Generated by CoffeeScript 1.12.5
|
// Generated by CoffeeScript 2.7.0
|
||||||
import Ember from 'ember';
|
import Ember from 'ember';
|
||||||
|
|
||||||
import DS from 'ember-data';
|
import DS from 'ember-data';
|
||||||
|
|
||||||
export default Ember.Component.extend({
|
export default Ember.Component.extend({
|
||||||
user: null,
|
user: null, // parameter
|
||||||
project_specific: false,
|
project_specific: false, // parameter
|
||||||
session: Ember.inject.service('session'),
|
session: Ember.inject.service('session'),
|
||||||
classNames: ['project-aggregate-statistics', 'project-aggregate-user-statistics'],
|
classNames: ['project-aggregate-statistics', 'project-aggregate-user-statistics'],
|
||||||
statistics: Ember.computed('statistics_data.isFulfilled', 'project_specific', function() {
|
statistics: Ember.computed('statistics_data.isFulfilled', 'project_specific', function() {
|
||||||
@@ -15,6 +15,7 @@ export default Ember.Component.extend({
|
|||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
target = {};
|
target = {};
|
||||||
|
//states = ['pending', 'planned', 'active', 'overdue', 'inquiry', 'rejected', 'completed']
|
||||||
states = this.get('globals.project_instance_action.states');
|
states = this.get('globals.project_instance_action.states');
|
||||||
project_specific = this.get('project_specific');
|
project_specific = this.get('project_specific');
|
||||||
if (!project_specific) {
|
if (!project_specific) {
|
||||||
@@ -44,6 +45,11 @@ export default Ember.Component.extend({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
//if project_object.project and project_object.project.id isnt project.id
|
||||||
|
// target.push project_object
|
||||||
|
// project_object = {project: project}
|
||||||
|
// continue
|
||||||
|
//project_object.project = project
|
||||||
return target;
|
return target;
|
||||||
}),
|
}),
|
||||||
statistics_data: Ember.computed(function() {
|
statistics_data: Ember.computed(function() {
|
||||||
@@ -53,7 +59,7 @@ export default Ember.Component.extend({
|
|||||||
}
|
}
|
||||||
model_name = 'user';
|
model_name = 'user';
|
||||||
base_url = this.store.adapterFor(model_name).buildURL(model_name);
|
base_url = this.store.adapterFor(model_name).buildURL(model_name);
|
||||||
url = base_url + "/" + user_id + "/statistics1";
|
url = `${base_url}/${user_id}/statistics1`;
|
||||||
session = this.get('session');
|
session = this.get('session');
|
||||||
store = this.store;
|
store = this.store;
|
||||||
request = {
|
request = {
|
||||||
@@ -61,15 +67,14 @@ export default Ember.Component.extend({
|
|||||||
contentType: "application/json",
|
contentType: "application/json",
|
||||||
dataType: "json"
|
dataType: "json"
|
||||||
};
|
};
|
||||||
|
//success: (response) ->
|
||||||
|
// resolve(response)
|
||||||
if (Ember.get(session, 'isAuthenticated')) {
|
if (Ember.get(session, 'isAuthenticated')) {
|
||||||
session.authorize('authorizer:devise', function(key, authorization) {
|
session.authorize('authorizer:devise', function(key, authorization) {
|
||||||
var obj;
|
|
||||||
request.crossDomain = true;
|
request.crossDomain = true;
|
||||||
return request.headers = (
|
return request.headers = {
|
||||||
obj = {},
|
[`${key}`]: authorization
|
||||||
obj["" + key] = authorization,
|
};
|
||||||
obj
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
return DS.PromiseObject.create({
|
return DS.PromiseObject.create({
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Generated by CoffeeScript 1.12.5
|
// Generated by CoffeeScript 2.7.0
|
||||||
import Ember from 'ember';
|
import Ember from 'ember';
|
||||||
|
|
||||||
export default Ember.Component.extend({
|
export default Ember.Component.extend({
|
||||||
@@ -30,3 +30,20 @@ export default Ember.Component.extend({
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// &.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
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Generated by CoffeeScript 1.12.5
|
// Generated by CoffeeScript 2.7.0
|
||||||
import Ember from 'ember';
|
import Ember from 'ember';
|
||||||
|
|
||||||
export default Ember.Controller.extend({
|
export default Ember.Controller.extend({
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
// Generated by CoffeeScript 1.12.5
|
// Generated by CoffeeScript 2.7.0
|
||||||
var slice = [].slice;
|
|
||||||
|
|
||||||
import Ember from 'ember';
|
import Ember from 'ember';
|
||||||
|
|
||||||
|
//import config from 'ember-get-config'
|
||||||
export default Ember.Controller.extend({
|
export default Ember.Controller.extend({
|
||||||
session: Ember.inject.service('session'),
|
session: Ember.inject.service('session'),
|
||||||
|
//filters: {filter_calls: 0} # will be overwritten in route
|
||||||
|
//filters: Ember.computed.alias 'model.project_instance_actions.filters'
|
||||||
scope_project: null,
|
scope_project: null,
|
||||||
scope_scenario: null,
|
scope_scenario: null,
|
||||||
scope_organization: null,
|
scope_organization: null,
|
||||||
@@ -44,7 +45,7 @@ export default Ember.Controller.extend({
|
|||||||
q: this.get('filter_query'),
|
q: this.get('filter_query'),
|
||||||
include_pointing: true
|
include_pointing: true
|
||||||
});
|
});
|
||||||
return base_url + "/export_human.csv?" + filter_addition;
|
return `${base_url}/export_human.csv?${filter_addition}`;
|
||||||
}),
|
}),
|
||||||
export_technical_url: Ember.computed('filter_query', function() {
|
export_technical_url: Ember.computed('filter_query', function() {
|
||||||
var base_url, filter_addition, model_name;
|
var base_url, filter_addition, model_name;
|
||||||
@@ -54,7 +55,7 @@ export default Ember.Controller.extend({
|
|||||||
q: this.get('filter_query'),
|
q: this.get('filter_query'),
|
||||||
include_pointing: true
|
include_pointing: true
|
||||||
});
|
});
|
||||||
return base_url + "/export_technical.csv?" + filter_addition;
|
return `${base_url}/export_technical.csv?${filter_addition}`;
|
||||||
}),
|
}),
|
||||||
actions: {
|
actions: {
|
||||||
apply_filters: function() {
|
apply_filters: function() {
|
||||||
@@ -65,14 +66,12 @@ export default Ember.Controller.extend({
|
|||||||
if (project_ids.length === 1) {
|
if (project_ids.length === 1) {
|
||||||
if (current_scope_project_id !== project_ids[0]) {
|
if (current_scope_project_id !== project_ids[0]) {
|
||||||
project = this.store.peekRecord('panda/project', project_ids[0]);
|
project = this.store.peekRecord('panda/project', project_ids[0]);
|
||||||
if (this.get('filters.workflow_action_definition_title_cont')) {
|
if (this.get('filters.workflow_action_definition_title_cont')) { // this field disappears since actual action matching is assumed
|
||||||
this.set('filters.workflow_action_definition_title_cont', '');
|
this.set('filters.workflow_action_definition_title_cont', '');
|
||||||
}
|
}
|
||||||
project.reload().then((function(_this) {
|
project.reload().then(() => {
|
||||||
return function() {
|
return this.set('scope_project', project);
|
||||||
return _this.set('scope_project', project);
|
});
|
||||||
};
|
|
||||||
})(this));
|
|
||||||
}
|
}
|
||||||
} else if (this.get('scope_project')) {
|
} else if (this.get('scope_project')) {
|
||||||
this.set('scope_project', null);
|
this.set('scope_project', null);
|
||||||
@@ -100,29 +99,25 @@ export default Ember.Controller.extend({
|
|||||||
var new_value;
|
var new_value;
|
||||||
new_value = [];
|
new_value = [];
|
||||||
if (checked) {
|
if (checked) {
|
||||||
new_value = new_value.concat(this.get("filters." + key)).concat(value);
|
new_value = new_value.concat(this.get(`filters.${key}`)).concat(value);
|
||||||
} else {
|
} else {
|
||||||
this.get("filters." + key).forEach(function(present_in_filter) {
|
this.get(`filters.${key}`).forEach(function(present_in_filter) {
|
||||||
if (present_in_filter !== value) {
|
if (present_in_filter !== value) {
|
||||||
return new_value.push(present_in_filter);
|
return new_value.push(present_in_filter);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
this.set("filters." + key, new_value);
|
this.set(`filters.${key}`, new_value);
|
||||||
return this.apply_filters();
|
return this.apply_filters();
|
||||||
},
|
},
|
||||||
clear_filter: function() {
|
clear_filter: function(...keys) {
|
||||||
var keys;
|
keys.forEach((key) => {
|
||||||
keys = 1 <= arguments.length ? slice.call(arguments, 0) : [];
|
if (Ember.isArray(this.get(`filters.${key}`))) {
|
||||||
keys.forEach((function(_this) {
|
return this.set(`filters.${key}`, []);
|
||||||
return function(key) {
|
} else {
|
||||||
if (Ember.isArray(_this.get("filters." + key))) {
|
return this.set(`filters.${key}`, null);
|
||||||
return _this.set("filters." + key, []);
|
}
|
||||||
} else {
|
});
|
||||||
return _this.set("filters." + key, null);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
})(this));
|
|
||||||
return this.apply_filters();
|
return this.apply_filters();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Generated by CoffeeScript 1.12.5
|
// Generated by CoffeeScript 2.7.0
|
||||||
import Ember from 'ember';
|
import Ember from 'ember';
|
||||||
|
|
||||||
export default Ember.Controller.extend({
|
export default Ember.Controller.extend({
|
||||||
@@ -11,12 +11,12 @@ export default Ember.Controller.extend({
|
|||||||
}
|
}
|
||||||
duration = moment.duration(moment().diff(start_time));
|
duration = moment.duration(moment().diff(start_time));
|
||||||
if (duration.days()) {
|
if (duration.days()) {
|
||||||
return (duration.days()) + " days and " + (duration.hours()) + " hours";
|
return `${duration.days()} days and ${duration.hours()} hours`;
|
||||||
} else {
|
} else {
|
||||||
hours = ('0' + duration.hours()).slice(-2);
|
hours = ('0' + duration.hours()).slice(-2);
|
||||||
minutes = ('0' + duration.minutes()).slice(-2);
|
minutes = ('0' + duration.minutes()).slice(-2);
|
||||||
seconds = ('0' + duration.seconds()).slice(-2);
|
seconds = ('0' + duration.seconds()).slice(-2);
|
||||||
return hours + ":" + minutes + ":" + seconds;
|
return `${hours}:${minutes}:${seconds}`;
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
actions: {
|
actions: {
|
||||||
|
|||||||
@@ -1,14 +1,15 @@
|
|||||||
// Generated by CoffeeScript 1.12.5
|
// Generated by CoffeeScript 2.7.0
|
||||||
var indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };
|
var indexOf = [].indexOf;
|
||||||
|
|
||||||
import Ember from 'ember';
|
import Ember from 'ember';
|
||||||
|
|
||||||
export default Ember.Mixin.create({
|
export default Ember.Mixin.create({
|
||||||
selected_project_scenarios: [],
|
selected_project_scenarios: [], // null
|
||||||
selected_project_scenarios_set_operation: 'union',
|
selected_project_scenarios_set_operation: 'union', // union or intersection
|
||||||
active_workflow_action_definitions: [],
|
active_workflow_action_definitions: [],
|
||||||
active_workflow_action_definition_ids: [],
|
active_workflow_action_definition_ids: [],
|
||||||
set_active_workflow_action_definitions: function() {
|
set_active_workflow_action_definitions: function() {
|
||||||
|
// initialize unused working workflow-action-definitions
|
||||||
if (this.get('selected_project_scenarios.length')) {
|
if (this.get('selected_project_scenarios.length')) {
|
||||||
if (this.get('selected_project_scenarios_set_operation') === 'intersection') {
|
if (this.get('selected_project_scenarios_set_operation') === 'intersection') {
|
||||||
return this.set_active_workflow_action_definitions_using_intersection();
|
return this.set_active_workflow_action_definitions_using_intersection();
|
||||||
|
|||||||
@@ -1,15 +1,13 @@
|
|||||||
// Generated by CoffeeScript 1.12.5
|
// Generated by CoffeeScript 2.7.0
|
||||||
var indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };
|
var indexOf = [].indexOf;
|
||||||
|
|
||||||
import Ember from 'ember';
|
import Ember from 'ember';
|
||||||
|
|
||||||
export default Ember.Mixin.create({
|
export default Ember.Mixin.create({
|
||||||
get_active_workflow_groups: function(workflow_groups, project_scenarios, set_operation) {
|
get_active_workflow_groups: function(workflow_groups, project_scenarios, set_operation = 'union') {
|
||||||
if (set_operation == null) {
|
|
||||||
set_operation = 'union';
|
|
||||||
}
|
|
||||||
project_scenarios = Ember.makeArray(project_scenarios);
|
project_scenarios = Ember.makeArray(project_scenarios);
|
||||||
workflow_groups = workflow_groups.toArray();
|
workflow_groups = workflow_groups.toArray();
|
||||||
|
// initialize unused working workflow-groups
|
||||||
if (project_scenarios.length) {
|
if (project_scenarios.length) {
|
||||||
if (set_operation === 'intersection') {
|
if (set_operation === 'intersection') {
|
||||||
return this.get_active_workflow_groups_using_intersection(workflow_groups, project_scenarios);
|
return this.get_active_workflow_groups_using_intersection(workflow_groups, project_scenarios);
|
||||||
@@ -20,6 +18,8 @@ export default Ember.Mixin.create({
|
|||||||
return workflow_groups;
|
return workflow_groups;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
//@set 'active_workflow_groups', workflow_groups || []
|
||||||
|
//@set 'active_workflow_group_ids', @get('active_workflow_groups').mapBy('id').toArray()
|
||||||
get_active_workflow_groups_using_union: function(project_scenarios) {
|
get_active_workflow_groups_using_union: function(project_scenarios) {
|
||||||
var selected_project_scenario_workflow_group_ids, working_workflow_groups;
|
var selected_project_scenario_workflow_group_ids, working_workflow_groups;
|
||||||
selected_project_scenario_workflow_group_ids = [];
|
selected_project_scenario_workflow_group_ids = [];
|
||||||
@@ -32,6 +32,9 @@ export default Ember.Mixin.create({
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
//working_workflow_groups = working_workflow_groups
|
||||||
|
//@set 'active_workflow_groups', working_workflow_groups
|
||||||
|
//@set 'active_workflow_group_ids', selected_project_scenario_workflow_group_ids
|
||||||
return working_workflow_groups;
|
return working_workflow_groups;
|
||||||
},
|
},
|
||||||
get_active_workflow_groups_using_intersection: function(workflow_groups, project_scenarios) {
|
get_active_workflow_groups_using_intersection: function(workflow_groups, project_scenarios) {
|
||||||
@@ -50,6 +53,8 @@ export default Ember.Mixin.create({
|
|||||||
return indexOf.call(current_workflow_group_ids, id) >= 0;
|
return indexOf.call(current_workflow_group_ids, id) >= 0;
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
//@set 'active_workflow_group_ids', selected_project_scenario_workflow_group_ids
|
||||||
|
//@set 'active_workflow_groups', workflow_groups.filter((r) -> r.get('id') in selected_project_scenario_workflow_group_ids)
|
||||||
return workflow_groups.filter(function(r) {
|
return workflow_groups.filter(function(r) {
|
||||||
var ref;
|
var ref;
|
||||||
return ref = r.get('id'), indexOf.call(selected_project_scenario_workflow_group_ids, ref) >= 0;
|
return ref = r.get('id'), indexOf.call(selected_project_scenario_workflow_group_ids, ref) >= 0;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Generated by CoffeeScript 1.12.5
|
// Generated by CoffeeScript 2.7.0
|
||||||
import DS from 'ember-data';
|
import DS from 'ember-data';
|
||||||
|
|
||||||
export default DS.Model.extend({
|
export default DS.Model.extend({
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Generated by CoffeeScript 1.12.5
|
// Generated by CoffeeScript 2.7.0
|
||||||
import DS from 'ember-data';
|
import DS from 'ember-data';
|
||||||
|
|
||||||
export default DS.Model.extend({
|
export default DS.Model.extend({
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Generated by CoffeeScript 1.12.5
|
// Generated by CoffeeScript 2.7.0
|
||||||
import DS from 'ember-data';
|
import DS from 'ember-data';
|
||||||
|
|
||||||
export default DS.Model.extend({
|
export default DS.Model.extend({
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
// Generated by CoffeeScript 1.12.5
|
// Generated by CoffeeScript 2.7.0
|
||||||
import DS from 'ember-data';
|
import DS from 'ember-data';
|
||||||
|
|
||||||
export default DS.Model.extend({
|
export default DS.Model.extend({
|
||||||
conditional_base_value: DS.attr('string', {
|
conditional_base_value: DS.attr('string', {
|
||||||
defaultValue: ''
|
defaultValue: ''
|
||||||
}),
|
}),
|
||||||
connection_type: DS.attr('string'),
|
connection_type: DS.attr('string'), // attached, constraint, info
|
||||||
workflow_action_definition: DS.belongsTo('panda/workflow-action-definition', {
|
workflow_action_definition: DS.belongsTo('panda/workflow-action-definition', {
|
||||||
inverse: 'workflow_action_connections'
|
inverse: 'workflow_action_connections'
|
||||||
}),
|
}),
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Generated by CoffeeScript 1.12.5
|
// Generated by CoffeeScript 2.7.0
|
||||||
var Model;
|
var Model;
|
||||||
|
|
||||||
import Ember from 'ember';
|
import Ember from 'ember';
|
||||||
@@ -19,16 +19,16 @@ Model = {
|
|||||||
name: Ember.computed.alias('title'),
|
name: Ember.computed.alias('title'),
|
||||||
description: DS.attr('string'),
|
description: DS.attr('string'),
|
||||||
isEditing: DS.attr('boolean', {
|
isEditing: DS.attr('boolean', {
|
||||||
defaultValue: false
|
defaultValue: false //TODO: remove, is from PMBC
|
||||||
}),
|
}),
|
||||||
done: DS.attr('boolean', {
|
done: DS.attr('boolean', {
|
||||||
defaultValue: false
|
defaultValue: false //TODO: remove, is from PMBC
|
||||||
}),
|
}),
|
||||||
position: DS.attr('number', {
|
position: DS.attr('number', {
|
||||||
defaultValue: 0
|
defaultValue: 0
|
||||||
}),
|
}),
|
||||||
value_type: DS.attr('string', {
|
value_type: DS.attr('string', {
|
||||||
defaultValue: 'boolean'
|
defaultValue: 'boolean' // means checkbox progress type
|
||||||
}),
|
}),
|
||||||
value_type_select_options: DS.attr({
|
value_type_select_options: DS.attr({
|
||||||
defaultValue: function() {
|
defaultValue: function() {
|
||||||
@@ -37,7 +37,7 @@ Model = {
|
|||||||
}),
|
}),
|
||||||
extra_info: DS.attr('string'),
|
extra_info: DS.attr('string'),
|
||||||
offset_type: DS.attr('string', {
|
offset_type: DS.attr('string', {
|
||||||
defaultValue: 'none'
|
defaultValue: 'none' // none, attached, configured
|
||||||
}),
|
}),
|
||||||
overdue_coulance: DS.attr('number', {
|
overdue_coulance: DS.attr('number', {
|
||||||
defaultValue: 0
|
defaultValue: 0
|
||||||
@@ -45,6 +45,9 @@ Model = {
|
|||||||
completes_group: DS.attr('boolean', {
|
completes_group: DS.attr('boolean', {
|
||||||
defaultValue: false
|
defaultValue: false
|
||||||
}),
|
}),
|
||||||
|
// Offset tree
|
||||||
|
//action_offset_base: DS.belongsTo('workflow-action-definition', inverse: 'action_offset_dependents')
|
||||||
|
//action_offset_dependents: DS.hasMany('workflow-action-definition', inverse: null) # do not give with api, will clear inverse if not given
|
||||||
workflow_group: DS.belongsTo('panda/workflow-group'),
|
workflow_group: DS.belongsTo('panda/workflow-group'),
|
||||||
project: DS.belongsTo('panda/project', {
|
project: DS.belongsTo('panda/project', {
|
||||||
inverse: 'workflow_action_definitions'
|
inverse: 'workflow_action_definitions'
|
||||||
@@ -61,6 +64,7 @@ Model = {
|
|||||||
dependent_workflow_action_offsets: DS.hasMany('panda/workflow-action-offset', {
|
dependent_workflow_action_offsets: DS.hasMany('panda/workflow-action-offset', {
|
||||||
inverse: 'base_workflow_action_definition'
|
inverse: 'base_workflow_action_definition'
|
||||||
}),
|
}),
|
||||||
|
//project_scenarios: DS.hasMany('panda/project-scenario', inverse: 'workflow_action_definitions')
|
||||||
project_scenarios: DS.hasMany('panda/project-scenario'),
|
project_scenarios: DS.hasMany('panda/project-scenario'),
|
||||||
project_instance_actions: DS.hasMany('panda/project-instance-action', {
|
project_instance_actions: DS.hasMany('panda/project-instance-action', {
|
||||||
inverse: 'workflow_action_definition'
|
inverse: 'workflow_action_definition'
|
||||||
@@ -85,12 +89,17 @@ Model = {
|
|||||||
})
|
})
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//drag_identifier: Ember.computed 'id', 'workflow_group.id', 'position', ->
|
||||||
|
// "#{@get('id')}-#{@get('workflow_group.id')}-#{@get('position')}"
|
||||||
|
//smart_position: Ember.computed 'done', 'position', ->
|
||||||
|
// num = @get('position')
|
||||||
|
// if @get('done') then num + 1000 else num
|
||||||
add_business_day_computations(Model, 'offset', {
|
add_business_day_computations(Model, 'offset', {
|
||||||
add_attributes: true
|
add_attributes: true
|
||||||
});
|
});
|
||||||
|
|
||||||
add_business_day_computations(Model, 'batch_element_threshold', {
|
add_business_day_computations(Model, 'batch_element_threshold', {
|
||||||
add_attributes: true
|
add_attributes: true //, default_unit: 'businessday'
|
||||||
});
|
});
|
||||||
|
|
||||||
export default DS.Model.extend(Model);
|
export default DS.Model.extend(Model);
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Generated by CoffeeScript 1.12.5
|
// Generated by CoffeeScript 2.7.0
|
||||||
import Ember from 'ember';
|
import Ember from 'ember';
|
||||||
|
|
||||||
import PagedRemoteArray from 'ember-cli-dunlop/utils/paged-remote-array';
|
import PagedRemoteArray from 'ember-cli-dunlop/utils/paged-remote-array';
|
||||||
@@ -17,7 +17,7 @@ export default Ember.Route.extend({
|
|||||||
modelName: 'panda/action-event',
|
modelName: 'panda/action-event',
|
||||||
setupController: function(controller) {
|
setupController: function(controller) {
|
||||||
controller.set('filters', filters);
|
controller.set('filters', filters);
|
||||||
return this._super.apply(this, arguments);
|
return this._super(...arguments);
|
||||||
},
|
},
|
||||||
model: function(params) {
|
model: function(params) {
|
||||||
return PagedRemoteArray.create({
|
return PagedRemoteArray.create({
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
// Generated by CoffeeScript 1.12.5
|
// Generated by CoffeeScript 2.7.0
|
||||||
var get;
|
var get;
|
||||||
|
|
||||||
import Ember from 'ember';
|
import Ember from 'ember';
|
||||||
|
|
||||||
import PagedRemoteArray from 'ember-cli-dunlop/utils/paged-remote-array';
|
import PagedRemoteArray from 'ember-cli-dunlop/utils/paged-remote-array';
|
||||||
|
|
||||||
get = Ember.get;
|
({get} = Ember);
|
||||||
|
|
||||||
export var default_filters = Ember.Object.create({
|
export var default_filters = Ember.Object.create({
|
||||||
filter_calls: 0,
|
filter_calls: 0,
|
||||||
@@ -14,9 +14,11 @@ export var default_filters = Ember.Object.create({
|
|||||||
project_id: '',
|
project_id: '',
|
||||||
project_instance_project_scenario_id: '',
|
project_instance_project_scenario_id: '',
|
||||||
workflow_action_definition_organization_id: '',
|
workflow_action_definition_organization_id: '',
|
||||||
|
// untill ransack chronological pre joins issue has been fixed force order to first lookup the pre-joined relation since that magically works
|
||||||
workflow_action_definition_title_cont: '',
|
workflow_action_definition_title_cont: '',
|
||||||
project_instance_client_identifier_cont: '',
|
project_instance_client_identifier_cont: '',
|
||||||
target_date_not_null: 1,
|
//workflow_action_definition_offset_type_not_eq: 'attached'
|
||||||
|
target_date_not_null: 1, // only target date actions
|
||||||
state_in: [],
|
state_in: [],
|
||||||
target_date_gteq: null,
|
target_date_gteq: null,
|
||||||
target_date_lteq: null,
|
target_date_lteq: null,
|
||||||
@@ -47,7 +49,7 @@ export default Ember.Route.extend({
|
|||||||
modelName: 'panda/project-instance-action',
|
modelName: 'panda/project-instance-action',
|
||||||
setupController: function(controller, model) {
|
setupController: function(controller, model) {
|
||||||
controller.set('filters', model.project_instance_actions.get('filters'));
|
controller.set('filters', model.project_instance_actions.get('filters'));
|
||||||
return this._super.apply(this, arguments);
|
return this._super(...arguments);
|
||||||
},
|
},
|
||||||
model: function(params) {
|
model: function(params) {
|
||||||
var filters, scope_key, user_default;
|
var filters, scope_key, user_default;
|
||||||
@@ -60,6 +62,29 @@ export default Ember.Route.extend({
|
|||||||
filters = default_filters;
|
filters = default_filters;
|
||||||
}
|
}
|
||||||
if (params.state) {
|
if (params.state) {
|
||||||
|
//@store.findAll('epots/migration-window-planning')
|
||||||
|
//includes = [
|
||||||
|
// 'workflow_action_definition.~workflow_action_connections'
|
||||||
|
// 'workflow_action_definition.~pointing_workflow_action_connections'
|
||||||
|
// 'workflow_action_definition.~organization'
|
||||||
|
// 'workflow_action_definition.~workflow_action_offsets'
|
||||||
|
// 'project_instance_group.~project'
|
||||||
|
// 'project_instance_group.~project_instance'
|
||||||
|
// 'project_instance_group.~project_instance_actions'
|
||||||
|
// 'project_instance_group.workflow_group'
|
||||||
|
// 'project_instance.~project'
|
||||||
|
// 'project_instance.project_scenario.~project'
|
||||||
|
// 'project_instance.project_scenario.~workflow_groups'
|
||||||
|
// 'project_instance.project_scenario.~workflow_action_definitions'
|
||||||
|
// 'pointing_project_instance_action_connections.project_instance_action.~project'
|
||||||
|
// 'pointing_project_instance_action_connections.project_instance_action.~project_instance'
|
||||||
|
// 'pointing_project_instance_action_connections.project_instance_action.~project_instance_group'
|
||||||
|
// 'pointing_project_instance_action_connections.project_instance_action.~pointing_project_instance_action_connections'
|
||||||
|
// 'pointing_project_instance_action_connections.project_instance_action.workflow_action_definition.~workflow_action_connections'
|
||||||
|
// 'pointing_project_instance_action_connections.project_instance_action.workflow_action_definition.~pointing_workflow_action_connections'
|
||||||
|
// 'pointing_project_instance_action_connections.project_instance_action.workflow_action_definition.~organization'
|
||||||
|
// 'pointing_project_instance_action_connections.project_instance_action.workflow_action_definition.~workflow_action_offsets'
|
||||||
|
//]
|
||||||
filters.set('state_in', params.state.split(','));
|
filters.set('state_in', params.state.split(','));
|
||||||
}
|
}
|
||||||
if (params.action) {
|
if (params.action) {
|
||||||
|
|||||||
@@ -1,8 +1,10 @@
|
|||||||
// Generated by CoffeeScript 1.12.5
|
// Generated by CoffeeScript 2.7.0
|
||||||
import Ember from 'ember';
|
import Ember from 'ember';
|
||||||
|
|
||||||
import config from 'ember-get-config';
|
import config from 'ember-get-config';
|
||||||
|
|
||||||
|
//import Route from '@ember/route'
|
||||||
|
//import { inject as service } from '@ember/service'
|
||||||
export default Ember.Route.extend({
|
export default Ember.Route.extend({
|
||||||
poll: Ember.inject.service(),
|
poll: Ember.inject.service(),
|
||||||
session: Ember.inject.service(),
|
session: Ember.inject.service(),
|
||||||
@@ -20,36 +22,29 @@ export default Ember.Route.extend({
|
|||||||
var base_url, endpoint, model_name, pollFunction, pollId, request, session;
|
var base_url, endpoint, model_name, pollFunction, pollId, request, session;
|
||||||
model_name = 'panda/setting';
|
model_name = 'panda/setting';
|
||||||
base_url = this.store.adapterFor(model_name).buildURL(model_name);
|
base_url = this.store.adapterFor(model_name).buildURL(model_name);
|
||||||
endpoint = base_url + "/operation_running/get_value";
|
endpoint = `${base_url}/operation_running/get_value`;
|
||||||
request = {
|
request = {
|
||||||
url: endpoint,
|
url: endpoint,
|
||||||
success: (function(_this) {
|
success: (operation_running) => {
|
||||||
return function(operation_running) {
|
if (operation_running) {
|
||||||
if (operation_running) {
|
return this.set('router.globals.operation_running', moment(operation_running));
|
||||||
return _this.set('router.globals.operation_running', moment(operation_running));
|
} else {
|
||||||
} else {
|
return this.set('router.globals.operation_running', '');
|
||||||
return _this.set('router.globals.operation_running', '');
|
}
|
||||||
}
|
}
|
||||||
};
|
|
||||||
})(this)
|
|
||||||
};
|
};
|
||||||
session = this.get('session');
|
session = this.get('session');
|
||||||
if (Ember.get(session, 'isAuthenticated')) {
|
if (Ember.get(session, 'isAuthenticated')) {
|
||||||
session.authorize('authorizer:devise', function(key, authorization) {
|
session.authorize('authorizer:devise', function(key, authorization) {
|
||||||
var obj;
|
|
||||||
request.crossDomain = true;
|
request.crossDomain = true;
|
||||||
return request.headers = (
|
return request.headers = {
|
||||||
obj = {},
|
[`${key}`]: authorization
|
||||||
obj["" + key] = authorization,
|
};
|
||||||
obj
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
pollFunction = (function(_this) {
|
pollFunction = () => {
|
||||||
return function() {
|
return Ember.$.ajax(request);
|
||||||
return Ember.$.ajax(request);
|
};
|
||||||
};
|
|
||||||
})(this);
|
|
||||||
pollFunction();
|
pollFunction();
|
||||||
return pollId = this.get('poll').addPoll({
|
return pollId = this.get('poll').addPoll({
|
||||||
interval: 30 * 1000,
|
interval: 30 * 1000,
|
||||||
@@ -57,6 +52,8 @@ export default Ember.Route.extend({
|
|||||||
label: 'project-running'
|
label: 'project-running'
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
//@get('poll').startPoll(pollId)
|
||||||
|
//@get('poll').startPollByLabel('project-running')
|
||||||
willTransition: function() {
|
willTransition: function() {
|
||||||
return this.get('poll').stopPollByLabel('project-running');
|
return this.get('poll').stopPollByLabel('project-running');
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,27 +1,28 @@
|
|||||||
// Generated by CoffeeScript 1.12.5
|
// Generated by CoffeeScript 2.7.0
|
||||||
var businessDayComputations;
|
var businessDayComputations;
|
||||||
|
|
||||||
import Ember from 'ember';
|
import Ember from 'ember';
|
||||||
|
|
||||||
import DS from 'ember-data';
|
import DS from 'ember-data';
|
||||||
|
|
||||||
businessDayComputations = function(target, prefix, options) {
|
businessDayComputations = function(target, prefix, options = {}) {
|
||||||
if (options == null) {
|
|
||||||
options = {};
|
|
||||||
}
|
|
||||||
if (options.add_attributes) {
|
if (options.add_attributes) {
|
||||||
Ember.defineProperty(target, prefix + "_value", DS.attr('number', {
|
Ember.defineProperty(target, `${prefix}_value`, DS.attr('number', {
|
||||||
defaultValue: 0
|
defaultValue: 0
|
||||||
}));
|
}));
|
||||||
Ember.defineProperty(target, prefix + "_unit", DS.attr('string', {
|
Ember.defineProperty(target, `${prefix}_unit`, DS.attr('string', {
|
||||||
defaultValue: options.default_unit || 'day'
|
defaultValue: options.default_unit || 'day'
|
||||||
}));
|
}));
|
||||||
Ember.defineProperty(target, prefix + "_business_days", DS.attr({
|
Ember.defineProperty(target, `${prefix}_business_days`, DS.attr({
|
||||||
defaultValue: function() {
|
defaultValue: function() {
|
||||||
return [1, 2, 3, 4, 5];
|
return [1, 2, 3, 4, 5];
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
//Ember.defineProperty target, "#{prefix}_business_days_index_sum", Ember.computed.sum "#{prefix}_business_days"
|
||||||
|
//Ember.defineProperty target, "has_default_#{prefix}_business_days", Ember.computed "#{prefix}_business_days.length", "#{prefix}_business_days_index_sum", ->
|
||||||
|
// @get("#{prefix}_business_days.length") is 5 and @get("#{prefix}_business_days_index_sum") is 15
|
||||||
|
//Ember.defineProperty target, "#{prefix}_unit_businessday", Ember.computed.equal "#{prefix}_unit", 'businessday'
|
||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,9 @@
|
|||||||
// Generated by CoffeeScript 1.12.5
|
// Generated by CoffeeScript 2.7.0
|
||||||
'use strict';
|
'use strict';
|
||||||
|
// taken from https://github.com/kalmecak/moment-business-days
|
||||||
|
//if (typeof require === 'function') {
|
||||||
|
// var moment = require('moment');
|
||||||
|
//}
|
||||||
moment.fn.isHoliday = function() {
|
moment.fn.isHoliday = function() {
|
||||||
var locale;
|
var locale;
|
||||||
locale = this.localeData();
|
locale = this.localeData();
|
||||||
@@ -64,11 +68,8 @@ moment.fn.businessDiff = function(param) {
|
|||||||
return daysBetween;
|
return daysBetween;
|
||||||
};
|
};
|
||||||
|
|
||||||
moment.fn.businessAdd = function(number, options) {
|
moment.fn.businessAdd = function(number, options = {}) {
|
||||||
var day, remaining, signal;
|
var day, remaining, signal;
|
||||||
if (options == null) {
|
|
||||||
options = {};
|
|
||||||
}
|
|
||||||
options.period || (options.period = 'days');
|
options.period || (options.period = 'days');
|
||||||
day = this.clone();
|
day = this.clone();
|
||||||
signal = number < 0 ? -1 : 1;
|
signal = number < 0 ? -1 : 1;
|
||||||
@@ -82,10 +83,7 @@ moment.fn.businessAdd = function(number, options) {
|
|||||||
return day;
|
return day;
|
||||||
};
|
};
|
||||||
|
|
||||||
moment.fn.businessSubtract = function(number, options) {
|
moment.fn.businessSubtract = function(number, options = {}) {
|
||||||
if (options == null) {
|
|
||||||
options = {};
|
|
||||||
}
|
|
||||||
return this.businessAdd(-number, options);
|
return this.businessAdd(-number, options);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Generated by CoffeeScript 1.12.5
|
// Generated by CoffeeScript 2.7.0
|
||||||
var pandaRouteSetup;
|
var pandaRouteSetup;
|
||||||
|
|
||||||
pandaRouteSetup = function(context) {
|
pandaRouteSetup = function(context) {
|
||||||
@@ -12,6 +12,8 @@ pandaRouteSetup = function(context) {
|
|||||||
path: 'tracker-subject/:tracker_subject_id'
|
path: 'tracker-subject/:tracker_subject_id'
|
||||||
});
|
});
|
||||||
this.route('add-progress');
|
this.route('add-progress');
|
||||||
|
//@route 'tracker-subject', ->
|
||||||
|
// @route 'show'
|
||||||
this.route('dunlop-generator');
|
this.route('dunlop-generator');
|
||||||
this.route('analysis');
|
this.route('analysis');
|
||||||
this.route('operate');
|
this.route('operate');
|
||||||
@@ -37,7 +39,9 @@ pandaRouteSetup = function(context) {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
//@route 'project/views', path: 'views'
|
||||||
context.route('login');
|
context.route('login');
|
||||||
|
//@route 'organization', path: 'organizations/:organization_id'
|
||||||
context.route('action-list');
|
context.route('action-list');
|
||||||
context.route('organization', function() {
|
context.route('organization', function() {
|
||||||
return this.route('show', {
|
return this.route('show', {
|
||||||
@@ -65,6 +69,7 @@ pandaRouteSetup = function(context) {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
//@route 'tracker-subject/tracker-group', path: 'tracker-subjects/:tracker_subject_id/tracker-groups/:tracker_group_id'
|
||||||
context.route('event');
|
context.route('event');
|
||||||
context.route('action-event');
|
context.route('action-event');
|
||||||
context.route('meeting-reports');
|
context.route('meeting-reports');
|
||||||
@@ -73,7 +78,7 @@ pandaRouteSetup = function(context) {
|
|||||||
return this.route('dunlop');
|
return this.route('dunlop');
|
||||||
});
|
});
|
||||||
return this.route('tracker', function() {
|
return this.route('tracker', function() {
|
||||||
return this.route('tricks');
|
return this.route('tricks'); // dummy/empty now, to genate the index
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -1,9 +1,12 @@
|
|||||||
// Generated by CoffeeScript 1.12.5
|
// Generated by CoffeeScript 2.7.0
|
||||||
var get_active_workflow_action_definitions, get_active_workflow_action_definitions_using_intersection, get_active_workflow_action_definitions_using_union,
|
var get_active_workflow_action_definitions, get_active_workflow_action_definitions_using_intersection, get_active_workflow_action_definitions_using_union,
|
||||||
indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };
|
indexOf = [].indexOf;
|
||||||
|
|
||||||
import Ember from 'ember';
|
import Ember from 'ember';
|
||||||
|
|
||||||
|
// get_active_workflow_action_definitions(workflow_action_definitions, project_scenarios, set_operation = 'union or intersection')
|
||||||
|
// this util takes as first arguments the workflow_action_definitions scope
|
||||||
|
// and tries to apply filtering based on the given project_scenarios and set_operation
|
||||||
get_active_workflow_action_definitions_using_union = function(project_scenarios) {
|
get_active_workflow_action_definitions_using_union = function(project_scenarios) {
|
||||||
var selected_project_scenario_workflow_action_definition_ids, working_workflow_action_definitions;
|
var selected_project_scenario_workflow_action_definition_ids, working_workflow_action_definitions;
|
||||||
selected_project_scenario_workflow_action_definition_ids = [];
|
selected_project_scenario_workflow_action_definition_ids = [];
|
||||||
@@ -41,12 +44,10 @@ get_active_workflow_action_definitions_using_intersection = function(workflow_ac
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
get_active_workflow_action_definitions = function(workflow_action_definitions, project_scenarios, set_operation) {
|
get_active_workflow_action_definitions = function(workflow_action_definitions, project_scenarios, set_operation = 'union') {
|
||||||
if (set_operation == null) {
|
|
||||||
set_operation = 'union';
|
|
||||||
}
|
|
||||||
project_scenarios = Ember.makeArray(project_scenarios);
|
project_scenarios = Ember.makeArray(project_scenarios);
|
||||||
workflow_action_definitions = workflow_action_definitions.toArray();
|
workflow_action_definitions = workflow_action_definitions.toArray();
|
||||||
|
// initialize unused working workflow-action-definitions
|
||||||
if (project_scenarios.length) {
|
if (project_scenarios.length) {
|
||||||
if (set_operation === 'intersection') {
|
if (set_operation === 'intersection') {
|
||||||
return get_active_workflow_action_definitions_using_intersection(workflow_action_definitions, project_scenarios);
|
return get_active_workflow_action_definitions_using_intersection(workflow_action_definitions, project_scenarios);
|
||||||
@@ -54,6 +55,7 @@ get_active_workflow_action_definitions = function(workflow_action_definitions, p
|
|||||||
return get_active_workflow_action_definitions_using_union(project_scenarios);
|
return get_active_workflow_action_definitions_using_union(project_scenarios);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
// no filtering can be allplied, return all
|
||||||
return workflow_action_definitions;
|
return workflow_action_definitions;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,9 +1,12 @@
|
|||||||
// Generated by CoffeeScript 1.12.5
|
// Generated by CoffeeScript 2.7.0
|
||||||
var get_active_workflow_groups, get_active_workflow_groups_using_intersection, get_active_workflow_groups_using_union,
|
var get_active_workflow_groups, get_active_workflow_groups_using_intersection, get_active_workflow_groups_using_union,
|
||||||
indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };
|
indexOf = [].indexOf;
|
||||||
|
|
||||||
import Ember from 'ember';
|
import Ember from 'ember';
|
||||||
|
|
||||||
|
// get_active_workflow_groups(workflow_groups, project_scenarios, set_operation = 'union or intersection')
|
||||||
|
// this util takes as first arguments the workflow_groups scope
|
||||||
|
// and tries to apply filtering based on the given project_scenarios and set_operation
|
||||||
get_active_workflow_groups_using_union = function(project_scenarios) {
|
get_active_workflow_groups_using_union = function(project_scenarios) {
|
||||||
var selected_project_scenario_workflow_group_ids, working_workflow_groups;
|
var selected_project_scenario_workflow_group_ids, working_workflow_groups;
|
||||||
selected_project_scenario_workflow_group_ids = [];
|
selected_project_scenario_workflow_group_ids = [];
|
||||||
@@ -41,12 +44,10 @@ get_active_workflow_groups_using_intersection = function(workflow_groups, projec
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
get_active_workflow_groups = function(workflow_groups, project_scenarios, set_operation) {
|
get_active_workflow_groups = function(workflow_groups, project_scenarios, set_operation = 'union') {
|
||||||
if (set_operation == null) {
|
|
||||||
set_operation = 'union';
|
|
||||||
}
|
|
||||||
project_scenarios = Ember.makeArray(project_scenarios);
|
project_scenarios = Ember.makeArray(project_scenarios);
|
||||||
workflow_groups = workflow_groups.toArray();
|
workflow_groups = workflow_groups.toArray();
|
||||||
|
// initialize unused working workflow-groups
|
||||||
if (project_scenarios.length) {
|
if (project_scenarios.length) {
|
||||||
if (set_operation === 'intersection') {
|
if (set_operation === 'intersection') {
|
||||||
return get_active_workflow_groups_using_intersection(workflow_groups, project_scenarios);
|
return get_active_workflow_groups_using_intersection(workflow_groups, project_scenarios);
|
||||||
@@ -54,6 +55,7 @@ get_active_workflow_groups = function(workflow_groups, project_scenarios, set_op
|
|||||||
return get_active_workflow_groups_using_union(project_scenarios);
|
return get_active_workflow_groups_using_union(project_scenarios);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
// no filtering can be allplied, return all
|
||||||
return workflow_groups;
|
return workflow_groups;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Generated by CoffeeScript 1.12.5
|
// Generated by CoffeeScript 2.7.0
|
||||||
var projectContract;
|
var projectContract;
|
||||||
|
|
||||||
projectContract = function() {
|
projectContract = function() {
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
// Generated by CoffeeScript 1.12.5
|
// Generated by CoffeeScript 2.7.0
|
||||||
|
//projectGetWorkflowActionDefinitionOffsets = () ->
|
||||||
|
// true
|
||||||
|
//export default projectGetWorkflowActionDefinitionOffsets
|
||||||
var OffsetNode, RecordNode, WorkflowActionDefinitionOffsetNodes,
|
var OffsetNode, RecordNode, WorkflowActionDefinitionOffsetNodes,
|
||||||
indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };
|
indexOf = [].indexOf;
|
||||||
|
|
||||||
import Ember from 'ember';
|
import Ember from 'ember';
|
||||||
|
|
||||||
@@ -10,7 +13,7 @@ RecordNode = Ember.Object.extend({
|
|||||||
var title, value_shift;
|
var title, value_shift;
|
||||||
title = this.get('record.title');
|
title = this.get('record.title');
|
||||||
if (value_shift = this.get('value_shift')) {
|
if (value_shift = this.get('value_shift')) {
|
||||||
title = " " + title + " (" + value_shift + "d)";
|
title = ` ${title} (${value_shift}d)`;
|
||||||
}
|
}
|
||||||
return title;
|
return title;
|
||||||
})
|
})
|
||||||
@@ -30,12 +33,10 @@ WorkflowActionDefinitionOffsetNodes = Ember.Object.extend({
|
|||||||
batch_size: 0,
|
batch_size: 0,
|
||||||
active_project_scenario: null,
|
active_project_scenario: null,
|
||||||
forEach: function() {
|
forEach: function() {
|
||||||
var ref;
|
return this.get('processed_workflow_action_definitions').forEach(...arguments);
|
||||||
return (ref = this.get('processed_workflow_action_definitions')).forEach.apply(ref, arguments);
|
|
||||||
},
|
},
|
||||||
filterBy: function() {
|
filterBy: function() {
|
||||||
var ref;
|
return this.get('processed_workflow_action_definitions').filterBy(...arguments);
|
||||||
return (ref = this.get('processed_workflow_action_definitions')).filterBy.apply(ref, arguments);
|
|
||||||
},
|
},
|
||||||
get_resolved: function() {
|
get_resolved: function() {
|
||||||
return this.get('processed_workflow_action_definitions').filterBy('resolved');
|
return this.get('processed_workflow_action_definitions').filterBy('resolved');
|
||||||
@@ -58,16 +59,16 @@ WorkflowActionDefinitionOffsetNodes = Ember.Object.extend({
|
|||||||
action_added = false;
|
action_added = false;
|
||||||
if (workflow_action_definition.get('offset_type') === 'configured') {
|
if (workflow_action_definition.get('offset_type') === 'configured') {
|
||||||
workflow_action_definition.get('workflow_action_offsets').forEach(function(workflow_action_offset) {
|
workflow_action_definition.get('workflow_action_offsets').forEach(function(workflow_action_offset) {
|
||||||
var absolute_value, date, offset_date, offset_value, record_wrapper, ref, ref1, value_shift;
|
var absolute_value, date, offset_date, offset_value, record_wrapper, value_shift;
|
||||||
if (action_added) {
|
if (action_added) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (active_scenario_identifier && workflow_action_offset.get('project_scenario.identifier') && workflow_action_offset.get('project_scenario.identifier') !== active_scenario_identifier) {
|
if (active_scenario_identifier && workflow_action_offset.get('project_scenario.identifier') && workflow_action_offset.get('project_scenario.identifier') !== active_scenario_identifier) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!workflow_action_offset.get('base_workflow_action_definition.content')) {
|
if (!workflow_action_offset.get('base_workflow_action_definition.content')) { // x_based
|
||||||
ref = base.get_offset_for_target(workflow_action_offset, 0), offset_date = ref[0], offset_value = ref[1];
|
[offset_date, offset_value] = base.get_offset_for_target(workflow_action_offset, 0);
|
||||||
ref1 = base.get_dynamic_offset_for_target(workflow_action_offset, offset_value), date = ref1[0], value_shift = ref1[1];
|
[date, value_shift] = base.get_dynamic_offset_for_target(workflow_action_offset, offset_value);
|
||||||
absolute_value = offset_value + value_shift;
|
absolute_value = offset_value + value_shift;
|
||||||
record_wrapper = RecordNode.create({
|
record_wrapper = RecordNode.create({
|
||||||
record: workflow_action_definition,
|
record: workflow_action_definition,
|
||||||
@@ -97,32 +98,31 @@ WorkflowActionDefinitionOffsetNodes = Ember.Object.extend({
|
|||||||
this.set('processed_workflow_action_definitions', first_loop_actions);
|
this.set('processed_workflow_action_definitions', first_loop_actions);
|
||||||
this.set('working_workflow_action_definitions', working_workflow_action_definitions);
|
this.set('working_workflow_action_definitions', working_workflow_action_definitions);
|
||||||
this.incrementProperty('iteration_context_counter');
|
this.incrementProperty('iteration_context_counter');
|
||||||
|
//@set 'working_workflow_action_definitions', @get('workflow_action_definitions').filterBy('offset_type', 'configured')
|
||||||
this.run_critical_path_resolve_loop();
|
this.run_critical_path_resolve_loop();
|
||||||
resolve_level = this.get('iteration_context_counter');
|
resolve_level = this.get('iteration_context_counter');
|
||||||
return this.get('working_workflow_action_definitions').forEach((function(_this) {
|
return this.get('working_workflow_action_definitions').forEach((unresolved_workflow_action_definition) => { // add unresolved records
|
||||||
return function(unresolved_workflow_action_definition) {
|
var offset_wrappers;
|
||||||
var offset_wrappers;
|
offset_wrappers = [];
|
||||||
offset_wrappers = [];
|
unresolved_workflow_action_definition.get('workflow_action_offsets').forEach(function(action_offset) {
|
||||||
unresolved_workflow_action_definition.get('workflow_action_offsets').forEach(function(action_offset) {
|
var ref;
|
||||||
var ref;
|
if (ref = action_offset.get('base_workflow_action_definition.id'), indexOf.call(scope_workflow_action_definition_ids, ref) < 0) { // do not add offsets from other scenarios
|
||||||
if (ref = action_offset.get('base_workflow_action_definition.id'), indexOf.call(scope_workflow_action_definition_ids, ref) < 0) {
|
return;
|
||||||
return;
|
}
|
||||||
}
|
return offset_wrappers.push(OffsetNode.create({
|
||||||
return offset_wrappers.push(OffsetNode.create({
|
total_offset: action_offset.get('offset_value'),
|
||||||
total_offset: action_offset.get('offset_value'),
|
record: action_offset
|
||||||
record: action_offset
|
|
||||||
}));
|
|
||||||
});
|
|
||||||
return _this.get('processed_workflow_action_definitions').push(RecordNode.create({
|
|
||||||
record: unresolved_workflow_action_definition,
|
|
||||||
record_id: unresolved_workflow_action_definition.get('id'),
|
|
||||||
offset_wrappers: offset_wrappers,
|
|
||||||
resolved: false,
|
|
||||||
resolve_level: resolve_level,
|
|
||||||
resolve_type: 'unresolved'
|
|
||||||
}));
|
}));
|
||||||
};
|
});
|
||||||
})(this));
|
return this.get('processed_workflow_action_definitions').push(RecordNode.create({
|
||||||
|
record: unresolved_workflow_action_definition,
|
||||||
|
record_id: unresolved_workflow_action_definition.get('id'),
|
||||||
|
offset_wrappers: offset_wrappers,
|
||||||
|
resolved: false,
|
||||||
|
resolve_level: resolve_level,
|
||||||
|
resolve_type: 'unresolved'
|
||||||
|
}));
|
||||||
|
});
|
||||||
},
|
},
|
||||||
get_dynamic_offset_for_target: function(target, absolute_value) {
|
get_dynamic_offset_for_target: function(target, absolute_value) {
|
||||||
var base_date, batch_size, empty, offset_value, operation, period_unit, shifted_date, threshold, threshold_exceedance, value_shift;
|
var base_date, batch_size, empty, offset_value, operation, period_unit, shifted_date, threshold, threshold_exceedance, value_shift;
|
||||||
@@ -134,14 +134,14 @@ WorkflowActionDefinitionOffsetNodes = Ember.Object.extend({
|
|||||||
if (!(threshold = target.get('batch_element_threshold_value'))) {
|
if (!(threshold = target.get('batch_element_threshold_value'))) {
|
||||||
return empty;
|
return empty;
|
||||||
}
|
}
|
||||||
if (!(threshold_exceedance = Math.floor(batch_size / (0.1 + parseInt(threshold))))) {
|
if (!(threshold_exceedance = Math.floor(batch_size / (0.1 + parseInt(threshold))))) { // + 0.1 (delta) to exclude exact match of batch_size and threshold. First day is action day
|
||||||
return empty;
|
return empty;
|
||||||
}
|
}
|
||||||
period_unit = target.get('batch_element_threshold_unit');
|
period_unit = target.get('batch_element_threshold_unit');
|
||||||
offset_value = target.get('offset_value');
|
offset_value = target.get('offset_value');
|
||||||
operation = offset_value < 0 ? 'subtract' : 'add';
|
operation = offset_value < 0 ? 'subtract' : 'add';
|
||||||
if (period_unit === 'businessday') {
|
if (period_unit === 'businessday') {
|
||||||
operation = "business" + (operation.capitalize());
|
operation = `business${operation.capitalize()}`;
|
||||||
shifted_date = base_date.clone()[operation](threshold_exceedance, {
|
shifted_date = base_date.clone()[operation](threshold_exceedance, {
|
||||||
business_days: target.get('batch_element_threshold_business_days')
|
business_days: target.get('batch_element_threshold_business_days')
|
||||||
});
|
});
|
||||||
@@ -161,7 +161,7 @@ WorkflowActionDefinitionOffsetNodes = Ember.Object.extend({
|
|||||||
period_unit = target.get('offset_unit');
|
period_unit = target.get('offset_unit');
|
||||||
operation = offset_value < 0 ? 'subtract' : 'add';
|
operation = offset_value < 0 ? 'subtract' : 'add';
|
||||||
if (period_unit === 'businessday') {
|
if (period_unit === 'businessday') {
|
||||||
operation = "business" + (operation.capitalize());
|
operation = `business${operation.capitalize()}`;
|
||||||
shifted_date = base_date.clone()[operation](Math.abs(offset_value), {
|
shifted_date = base_date.clone()[operation](Math.abs(offset_value), {
|
||||||
business_days: target.get('offset_business_days')
|
business_days: target.get('offset_business_days')
|
||||||
});
|
});
|
||||||
@@ -169,6 +169,7 @@ WorkflowActionDefinitionOffsetNodes = Ember.Object.extend({
|
|||||||
shifted_date = base_date.clone()[operation](Math.abs(offset_value), period_unit);
|
shifted_date = base_date.clone()[operation](Math.abs(offset_value), period_unit);
|
||||||
}
|
}
|
||||||
value_shift = shifted_date.diff(base_date, 'day');
|
value_shift = shifted_date.diff(base_date, 'day');
|
||||||
|
//debugger if target.get('workflow_action_definition.title') is 'Initial check done'
|
||||||
return [shifted_date, value_shift];
|
return [shifted_date, value_shift];
|
||||||
},
|
},
|
||||||
run_critical_path_resolve_loop: function() {
|
run_critical_path_resolve_loop: function() {
|
||||||
@@ -188,24 +189,26 @@ WorkflowActionDefinitionOffsetNodes = Ember.Object.extend({
|
|||||||
farthest_absolute_value = 0;
|
farthest_absolute_value = 0;
|
||||||
farthest_absolute_value_value_shift = 0;
|
farthest_absolute_value_value_shift = 0;
|
||||||
farthest_result_total_offset = 0;
|
farthest_result_total_offset = 0;
|
||||||
date = null;
|
date = null; // scoping
|
||||||
resolved_offset_wrappers = [];
|
resolved_offset_wrappers = [];
|
||||||
all_offsets_resolved = working_workflow_action_definition.get('workflow_action_offsets').every(function(workflow_action_offset) {
|
all_offsets_resolved = working_workflow_action_definition.get('workflow_action_offsets').every(function(workflow_action_offset) {
|
||||||
var current_connection_absolute_value, current_connection_total_offset_value, current_connection_value_shift, offset_date, processed_absolute_value, processed_base_workflow_action_definition_wrapper, ref, ref1, ref2, working_offset_value;
|
var current_connection_absolute_value, current_connection_total_offset_value, current_connection_value_shift, offset_date, processed_absolute_value, processed_base_workflow_action_definition_wrapper, ref, working_offset_value;
|
||||||
if (active_scenario_identifier && workflow_action_offset.get('project_scenario.identifier') && workflow_action_offset.get('project_scenario.identifier') !== active_scenario_identifier) {
|
if (active_scenario_identifier && workflow_action_offset.get('project_scenario.identifier') && workflow_action_offset.get('project_scenario.identifier') !== active_scenario_identifier) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!(processed_base_workflow_action_definition_wrapper = processed_workflow_action_definitions.findBy('record_id', workflow_action_offset.get('base_workflow_action_definition.id')))) {
|
if (!(processed_base_workflow_action_definition_wrapper = processed_workflow_action_definitions.findBy('record_id', workflow_action_offset.get('base_workflow_action_definition.id')))) {
|
||||||
if (ref = workflow_action_offset.get('base_workflow_action_definition.id'), indexOf.call(scope_workflow_action_definition_ids, ref) < 0) {
|
if (ref = workflow_action_offset.get('base_workflow_action_definition.id'), indexOf.call(scope_workflow_action_definition_ids, ref) < 0) { // base is not present in this scenario, do not pursue this connection
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
processed_absolute_value = processed_base_workflow_action_definition_wrapper.get('absolute_value');
|
processed_absolute_value = processed_base_workflow_action_definition_wrapper.get('absolute_value');
|
||||||
ref1 = get_offset_for_target(workflow_action_offset, processed_absolute_value), offset_date = ref1[0], working_offset_value = ref1[1];
|
[offset_date, working_offset_value] = get_offset_for_target(workflow_action_offset, processed_absolute_value);
|
||||||
ref2 = get_dynamic_offset_for_target(workflow_action_offset, processed_absolute_value + working_offset_value), date = ref2[0], current_connection_value_shift = ref2[1];
|
[date, current_connection_value_shift] = get_dynamic_offset_for_target(workflow_action_offset, processed_absolute_value + working_offset_value);
|
||||||
current_connection_total_offset_value = current_connection_value_shift + working_offset_value;
|
current_connection_total_offset_value = current_connection_value_shift + working_offset_value;
|
||||||
current_connection_absolute_value = processed_absolute_value + current_connection_total_offset_value;
|
current_connection_absolute_value = processed_absolute_value + current_connection_total_offset_value;
|
||||||
|
//debugger if processed_base_workflow_action_definition_wrapper.get('record.title') is 'Initial check done'
|
||||||
|
//debugger if working_workflow_action_definition.get('title') is 'Initial check done'
|
||||||
if (Math.abs(current_connection_absolute_value) > Math.abs(farthest_absolute_value)) {
|
if (Math.abs(current_connection_absolute_value) > Math.abs(farthest_absolute_value)) {
|
||||||
farthest_absolute_value = current_connection_absolute_value;
|
farthest_absolute_value = current_connection_absolute_value;
|
||||||
farthest_absolute_value_value_shift = current_connection_value_shift;
|
farthest_absolute_value_value_shift = current_connection_value_shift;
|
||||||
@@ -217,7 +220,7 @@ WorkflowActionDefinitionOffsetNodes = Ember.Object.extend({
|
|||||||
total_offset: current_connection_total_offset_value,
|
total_offset: current_connection_total_offset_value,
|
||||||
resulting_absolute_value: current_connection_absolute_value
|
resulting_absolute_value: current_connection_absolute_value
|
||||||
}));
|
}));
|
||||||
return true;
|
return true; // indicate processed_base_workflow_action_definition_wrapper found for all_offsets_resolved value
|
||||||
});
|
});
|
||||||
if (all_offsets_resolved && resolved_offset_wrappers.length) {
|
if (all_offsets_resolved && resolved_offset_wrappers.length) {
|
||||||
record_wrapper = RecordNode.create({
|
record_wrapper = RecordNode.create({
|
||||||
@@ -262,10 +265,10 @@ WorkflowActionDefinitionOffsetNodes = Ember.Object.extend({
|
|||||||
farthest_absolute_value = 0;
|
farthest_absolute_value = 0;
|
||||||
farthest_absolute_value_value_shift = 0;
|
farthest_absolute_value_value_shift = 0;
|
||||||
farthest_result_total_offset = 0;
|
farthest_result_total_offset = 0;
|
||||||
date = null;
|
date = null; // scoping
|
||||||
resolved_offset_wrappers = [];
|
resolved_offset_wrappers = [];
|
||||||
working_workflow_action_definition.get('workflow_action_offsets').forEach(function(workflow_action_offset) {
|
working_workflow_action_definition.get('workflow_action_offsets').forEach(function(workflow_action_offset) {
|
||||||
var current_connection_absolute_value, current_connection_total_offset_value, current_connection_value_shift, offset_date, processed_absolute_value, processed_base_workflow_action_definition_wrapper, ref, ref1, ref2, working_offset_value;
|
var current_connection_absolute_value, current_connection_total_offset_value, current_connection_value_shift, offset_date, processed_absolute_value, processed_base_workflow_action_definition_wrapper, ref, working_offset_value;
|
||||||
if (active_scenario_identifier && workflow_action_offset.get('project_scenario.identifier') && workflow_action_offset.get('project_scenario.identifier') !== active_scenario_identifier) {
|
if (active_scenario_identifier && workflow_action_offset.get('project_scenario.identifier') && workflow_action_offset.get('project_scenario.identifier') !== active_scenario_identifier) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -276,10 +279,12 @@ WorkflowActionDefinitionOffsetNodes = Ember.Object.extend({
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
processed_absolute_value = processed_base_workflow_action_definition_wrapper.get('absolute_value');
|
processed_absolute_value = processed_base_workflow_action_definition_wrapper.get('absolute_value');
|
||||||
ref1 = get_offset_for_target(workflow_action_offset, processed_absolute_value), offset_date = ref1[0], working_offset_value = ref1[1];
|
[offset_date, working_offset_value] = get_offset_for_target(workflow_action_offset, processed_absolute_value);
|
||||||
ref2 = get_dynamic_offset_for_target(workflow_action_offset, processed_absolute_value + working_offset_value), date = ref2[0], current_connection_value_shift = ref2[1];
|
[date, current_connection_value_shift] = get_dynamic_offset_for_target(workflow_action_offset, processed_absolute_value + working_offset_value);
|
||||||
current_connection_total_offset_value = current_connection_value_shift + working_offset_value;
|
current_connection_total_offset_value = current_connection_value_shift + working_offset_value;
|
||||||
current_connection_absolute_value = processed_absolute_value + current_connection_total_offset_value;
|
current_connection_absolute_value = processed_absolute_value + current_connection_total_offset_value;
|
||||||
|
//debugger if processed_base_workflow_action_definition_wrapper.get('record.title') is 'Initial check done'
|
||||||
|
//debugger if working_workflow_action_definition.get('title') is 'Initial check done'
|
||||||
if (Math.abs(current_connection_absolute_value) > Math.abs(farthest_absolute_value)) {
|
if (Math.abs(current_connection_absolute_value) > Math.abs(farthest_absolute_value)) {
|
||||||
farthest_absolute_value = current_connection_absolute_value;
|
farthest_absolute_value = current_connection_absolute_value;
|
||||||
farthest_absolute_value_value_shift = current_connection_value_shift;
|
farthest_absolute_value_value_shift = current_connection_value_shift;
|
||||||
@@ -296,7 +301,7 @@ WorkflowActionDefinitionOffsetNodes = Ember.Object.extend({
|
|||||||
record_wrapper = RecordNode.create({
|
record_wrapper = RecordNode.create({
|
||||||
record: working_workflow_action_definition,
|
record: working_workflow_action_definition,
|
||||||
record_id: working_workflow_action_definition.get('id'),
|
record_id: working_workflow_action_definition.get('id'),
|
||||||
offset_wrappers: resolved_offset_wrappers,
|
offset_wrappers: resolved_offset_wrappers, // .clone()?
|
||||||
value_shift: farthest_absolute_value_value_shift,
|
value_shift: farthest_absolute_value_value_shift,
|
||||||
absolute_value: farthest_absolute_value,
|
absolute_value: farthest_absolute_value,
|
||||||
date: date,
|
date: date,
|
||||||
@@ -331,10 +336,10 @@ WorkflowActionDefinitionOffsetNodes = Ember.Object.extend({
|
|||||||
farthest_absolute_value = 0;
|
farthest_absolute_value = 0;
|
||||||
farthest_absolute_value_value_shift = 0;
|
farthest_absolute_value_value_shift = 0;
|
||||||
farthest_result_total_offset = 0;
|
farthest_result_total_offset = 0;
|
||||||
date = null;
|
date = null; // scoping
|
||||||
resolved_offset_wrappers = [];
|
resolved_offset_wrappers = [];
|
||||||
working_workflow_action_definition.get('dependent_workflow_action_offsets').forEach(function(workflow_action_offset) {
|
working_workflow_action_definition.get('dependent_workflow_action_offsets').forEach(function(workflow_action_offset) {
|
||||||
var current_connection_absolute_value, current_connection_total_offset_value, current_connection_value_shift, offset_date, processed_absolute_value, processed_base_workflow_action_definition_wrapper, ref, ref1, ref2, working_offset_value;
|
var current_connection_absolute_value, current_connection_total_offset_value, current_connection_value_shift, offset_date, processed_absolute_value, processed_base_workflow_action_definition_wrapper, ref, working_offset_value;
|
||||||
if (active_scenario_identifier && workflow_action_offset.get('project_scenario.identifier') && workflow_action_offset.get('project_scenario.identifier') !== active_scenario_identifier) {
|
if (active_scenario_identifier && workflow_action_offset.get('project_scenario.identifier') && workflow_action_offset.get('project_scenario.identifier') !== active_scenario_identifier) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -344,11 +349,15 @@ WorkflowActionDefinitionOffsetNodes = Ember.Object.extend({
|
|||||||
if (!(processed_base_workflow_action_definition_wrapper = processed_workflow_action_definitions.findBy('record_id', workflow_action_offset.get('workflow_action_definition.id')))) {
|
if (!(processed_base_workflow_action_definition_wrapper = processed_workflow_action_definitions.findBy('record_id', workflow_action_offset.get('workflow_action_definition.id')))) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
//return if workflow_action_offset.get('workflow_action_definition.offset_type') is 'none' # do not resolve on none offset typed nodes
|
||||||
processed_absolute_value = processed_base_workflow_action_definition_wrapper.get('absolute_value');
|
processed_absolute_value = processed_base_workflow_action_definition_wrapper.get('absolute_value');
|
||||||
ref1 = get_offset_for_target(workflow_action_offset, processed_absolute_value), offset_date = ref1[0], working_offset_value = ref1[1];
|
[offset_date, working_offset_value] = get_offset_for_target(workflow_action_offset, processed_absolute_value);
|
||||||
ref2 = get_dynamic_offset_for_target(workflow_action_offset, processed_absolute_value + working_offset_value), date = ref2[0], current_connection_value_shift = ref2[1];
|
[date, current_connection_value_shift] = get_dynamic_offset_for_target(workflow_action_offset, processed_absolute_value + working_offset_value);
|
||||||
current_connection_total_offset_value = current_connection_value_shift + working_offset_value;
|
current_connection_total_offset_value = current_connection_value_shift + working_offset_value;
|
||||||
|
//NOTE MINUS!!!!!!!!!!!!!!!!!!!!!
|
||||||
current_connection_absolute_value = processed_absolute_value - current_connection_total_offset_value;
|
current_connection_absolute_value = processed_absolute_value - current_connection_total_offset_value;
|
||||||
|
//debugger if processed_base_workflow_action_definition_wrapper.get('record.title') is 'Initial check done'
|
||||||
|
//debugger if working_workflow_action_definition.get('title') is 'Initial check done'
|
||||||
if (Math.abs(current_connection_absolute_value) > Math.abs(farthest_absolute_value)) {
|
if (Math.abs(current_connection_absolute_value) > Math.abs(farthest_absolute_value)) {
|
||||||
farthest_absolute_value = current_connection_absolute_value;
|
farthest_absolute_value = current_connection_absolute_value;
|
||||||
farthest_absolute_value_value_shift = current_connection_value_shift;
|
farthest_absolute_value_value_shift = current_connection_value_shift;
|
||||||
@@ -365,7 +374,7 @@ WorkflowActionDefinitionOffsetNodes = Ember.Object.extend({
|
|||||||
record_wrapper = RecordNode.create({
|
record_wrapper = RecordNode.create({
|
||||||
record: working_workflow_action_definition,
|
record: working_workflow_action_definition,
|
||||||
record_id: working_workflow_action_definition.get('id'),
|
record_id: working_workflow_action_definition.get('id'),
|
||||||
offset_wrappers: resolved_offset_wrappers,
|
offset_wrappers: resolved_offset_wrappers, // .clone()?
|
||||||
value_shift: farthest_absolute_value_value_shift,
|
value_shift: farthest_absolute_value_value_shift,
|
||||||
absolute_value: farthest_absolute_value,
|
absolute_value: farthest_absolute_value,
|
||||||
date: date,
|
date: date,
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Generated by CoffeeScript 1.12.5
|
// Generated by CoffeeScript 2.7.0
|
||||||
var validations;
|
var validations;
|
||||||
|
|
||||||
import {
|
import {
|
||||||
@@ -11,7 +11,7 @@ validations = {
|
|||||||
name: validatePresence({
|
name: validatePresence({
|
||||||
presence: true,
|
presence: true,
|
||||||
message: function(key, type) {
|
message: function(key, type) {
|
||||||
return buildMessage(t("attributes.workflow_action_definition." + key), {
|
return buildMessage(t(`attributes.workflow_action_definition.${key}`), {
|
||||||
type: type
|
type: type
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Generated by CoffeeScript 1.12.5
|
// Generated by CoffeeScript 2.7.0
|
||||||
var validations;
|
var validations;
|
||||||
|
|
||||||
import {
|
import {
|
||||||
@@ -11,7 +11,7 @@ validations = {
|
|||||||
client_identifier: validatePresence({
|
client_identifier: validatePresence({
|
||||||
presence: true,
|
presence: true,
|
||||||
message: function(key, type) {
|
message: function(key, type) {
|
||||||
return buildMessage(t("attributes.project_instance." + key), {
|
return buildMessage(t(`attributes.project_instance.${key}`), {
|
||||||
type: type
|
type: type
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Generated by CoffeeScript 1.12.5
|
// Generated by CoffeeScript 2.7.0
|
||||||
var validations;
|
var validations;
|
||||||
|
|
||||||
import {
|
import {
|
||||||
@@ -11,7 +11,7 @@ validations = {
|
|||||||
name: validatePresence({
|
name: validatePresence({
|
||||||
presence: true,
|
presence: true,
|
||||||
message: function(key, type) {
|
message: function(key, type) {
|
||||||
return buildMessage(t("attributes.workflow_action_definition." + key), {
|
return buildMessage(t(`attributes.workflow_action_definition.${key}`), {
|
||||||
type: type
|
type: type
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Generated by CoffeeScript 1.12.5
|
// Generated by CoffeeScript 2.7.0
|
||||||
var validations;
|
var validations;
|
||||||
|
|
||||||
import {
|
import {
|
||||||
@@ -12,7 +12,7 @@ validations = {
|
|||||||
nickname: validatePresence({
|
nickname: validatePresence({
|
||||||
presence: true,
|
presence: true,
|
||||||
message: function(key, type) {
|
message: function(key, type) {
|
||||||
return buildMessage(t("attributes.user." + key), {
|
return buildMessage(t(`attributes.user.${key}`), {
|
||||||
type: type
|
type: type
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -20,7 +20,7 @@ validations = {
|
|||||||
email: validateFormat({
|
email: validateFormat({
|
||||||
type: 'email',
|
type: 'email',
|
||||||
message: function(key, type) {
|
message: function(key, type) {
|
||||||
return buildMessage(t("attributes.user." + key), {
|
return buildMessage(t(`attributes.user.${key}`), {
|
||||||
type: type
|
type: type
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Generated by CoffeeScript 1.12.5
|
// Generated by CoffeeScript 2.7.0
|
||||||
var validations;
|
var validations;
|
||||||
|
|
||||||
import {
|
import {
|
||||||
@@ -11,7 +11,7 @@ validations = {
|
|||||||
title: validatePresence({
|
title: validatePresence({
|
||||||
presence: true,
|
presence: true,
|
||||||
message: function(key, type) {
|
message: function(key, type) {
|
||||||
return buildMessage(t("attributes.workflow_action_definition." + key), {
|
return buildMessage(t(`attributes.workflow_action_definition.${key}`), {
|
||||||
type: type
|
type: type
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ export default Ember.Component.extend
|
|||||||
nesting_level: Infinity
|
nesting_level: Infinity
|
||||||
top_title: 'JSON'
|
top_title: 'JSON'
|
||||||
didInsertElement: ->
|
didInsertElement: ->
|
||||||
formatter = new JSONFormatter.default(@get('value'), @get('nesting_level'))
|
formatter = new JSONFormatter(@get('value'), @get('nesting_level'))
|
||||||
v = formatter.render()
|
v = formatter.render()
|
||||||
tree = $(v)
|
tree = $(v)
|
||||||
tree.find('.json-formatter-constructor-name:first').removeClass('json-formatter-constructor-name').addClass('json-formatter-top-node-name').text(@get('top_title'))
|
tree.find('.json-formatter-constructor-name:first').removeClass('json-formatter-constructor-name').addClass('json-formatter-top-node-name').text(@get('top_title'))
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ export default ModalBase.extend
|
|||||||
possible_users: []
|
possible_users: []
|
||||||
willOpenModal: ->
|
willOpenModal: ->
|
||||||
@set 'possible_users', @store.peekAll('user')
|
@set 'possible_users', @store.peekAll('user')
|
||||||
@get('model.users').then (users)=>
|
@get('model').get('users').then (users) =>
|
||||||
@set 'selected_users', users.toArray()
|
@set 'selected_users', users.toArray()
|
||||||
|
|
||||||
actions:
|
actions:
|
||||||
|
|||||||
@@ -27,9 +27,9 @@ export default ModalBase.extend
|
|||||||
@set 'contract', DS.PromiseObject.create
|
@set 'contract', DS.PromiseObject.create
|
||||||
promise: new Ember.RSVP.Promise (resolve) ->
|
promise: new Ember.RSVP.Promise (resolve) ->
|
||||||
contract =
|
contract =
|
||||||
generating_project: project.get('id')
|
|
||||||
identifier: project.get('identifier')
|
|
||||||
contract_version: 'v1'
|
contract_version: 'v1'
|
||||||
|
generating_project_identifier: project.get('identifier')
|
||||||
|
generating_project_name: project.get('name')
|
||||||
instance_scope: project.get('instance_scope')
|
instance_scope: project.get('instance_scope')
|
||||||
workflow_groups: []
|
workflow_groups: []
|
||||||
workflow_actions: []
|
workflow_actions: []
|
||||||
@@ -48,7 +48,7 @@ export default ModalBase.extend
|
|||||||
offset_type: workflow_group.get('offset_type')
|
offset_type: workflow_group.get('offset_type')
|
||||||
offset_base: workflow_group.get('offset_base.identifier') || null # no undefined
|
offset_base: workflow_group.get('offset_base.identifier') || null # no undefined
|
||||||
scenarios: workflow_group.get('project_scenarios').mapBy('identifier')
|
scenarios: workflow_group.get('project_scenarios').mapBy('identifier')
|
||||||
add_offset_to workflow_group_object, ['offset', 'duration', 'batch_element_threshold'], workflow_group
|
add_offset_to workflow_group_object, ['offset', 'duration'], workflow_group
|
||||||
if is_batch_project
|
if is_batch_project
|
||||||
add_offset_to workflow_group_object, 'batch_element_threshold', workflow_group
|
add_offset_to workflow_group_object, 'batch_element_threshold', workflow_group
|
||||||
contract.workflow_groups.push workflow_group_object
|
contract.workflow_groups.push workflow_group_object
|
||||||
@@ -71,7 +71,7 @@ export default ModalBase.extend
|
|||||||
|
|
||||||
workflow_action_definition.get('workflow_action_offsets').forEach (workflow_action_offset) ->
|
workflow_action_definition.get('workflow_action_offsets').forEach (workflow_action_offset) ->
|
||||||
workflow_action_definition_object.action_offsets ||= []
|
workflow_action_definition_object.action_offsets ||= []
|
||||||
offset_object = {}
|
offset_object = {scenario: workflow_action_offset.get('project_scenario.identifier')}
|
||||||
if base_identifier = workflow_action_offset.get('base_workflow_action_definition.identifier')
|
if base_identifier = workflow_action_offset.get('base_workflow_action_definition.identifier')
|
||||||
offset_object.base_workflow_action = base_identifier
|
offset_object.base_workflow_action = base_identifier
|
||||||
add_offset_to offset_object, 'offset', workflow_action_offset
|
add_offset_to offset_object, 'offset', workflow_action_offset
|
||||||
@@ -87,11 +87,11 @@ export default ModalBase.extend
|
|||||||
conditional_value: workflow_action_connection.get('conditional_base_value')
|
conditional_value: workflow_action_connection.get('conditional_base_value')
|
||||||
workflow_action_definition_object.action_connections.push connection_object
|
workflow_action_definition_object.action_connections.push connection_object
|
||||||
|
|
||||||
workflow_action_definition.get('workflow_action_constraints').forEach (workflow_action_constraint) ->
|
#workflow_action_definition.get('workflow_action_constraints').forEach (workflow_action_constraint) ->
|
||||||
workflow_action_definition_object.action_constraints ||= []
|
# workflow_action_definition_object.action_constraints ||= []
|
||||||
workflow_action_definition_object.action_constraints.push
|
# workflow_action_definition_object.action_constraints.push
|
||||||
type: workflow_action_constraint.get('type')
|
# type: workflow_action_constraint.get('type')
|
||||||
base_workflow_action: workflow_action_constraint.get('constraint_workflow_action_definition.identifier')
|
# base_workflow_action: workflow_action_constraint.get('constraint_workflow_action_definition.identifier')
|
||||||
project.get('project_scenarios').forEach (project_scenario) ->
|
project.get('project_scenarios').forEach (project_scenario) ->
|
||||||
project_scenario_object =
|
project_scenario_object =
|
||||||
identifier: project_scenario.get('identifier')
|
identifier: project_scenario.get('identifier')
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ export default ModalBase.extend
|
|||||||
|
|
||||||
select_class_names: Ember.computed 'model.string_value', ->
|
select_class_names: Ember.computed 'model.string_value', ->
|
||||||
return ['green']
|
return ['green']
|
||||||
if @get('model.string_value') then 'green button' else 'button'
|
#if @get('model.string_value') then 'green button' else 'button'
|
||||||
|
|
||||||
|
|
||||||
has_changed_timestamp_value: Ember.computed 'timestamp_value', 'model.timestamp_value', ->
|
has_changed_timestamp_value: Ember.computed 'timestamp_value', 'model.timestamp_value', ->
|
||||||
|
|||||||
@@ -54,6 +54,7 @@ export default ModalBase.extend
|
|||||||
@_super()
|
@_super()
|
||||||
rollback_and_close: ->
|
rollback_and_close: ->
|
||||||
constraints = @get('model.constraints')
|
constraints = @get('model.constraints')
|
||||||
|
constraints = constraints.content if !constraints.filterBy and constraints.content?
|
||||||
constraints.filterBy('isNew').invoke 'unloadRecord'
|
constraints.filterBy('isNew').invoke 'unloadRecord'
|
||||||
constraints.rejectBy('isNew').invoke 'rollbackAttributes' # not rolling back belongsTo, known issue
|
constraints.rejectBy('isNew').invoke 'rollbackAttributes' # not rolling back belongsTo, known issue
|
||||||
@_super()
|
@_super()
|
||||||
|
|||||||
@@ -0,0 +1,23 @@
|
|||||||
|
import Ember from 'ember'
|
||||||
|
export default Ember.Controller.extend
|
||||||
|
nickname_filter: ''
|
||||||
|
email_filter: ''
|
||||||
|
organization_filter: null
|
||||||
|
possible_organizations: (-> @store.peekAll('panda/organization')).property()
|
||||||
|
users: Ember.computed 'model', 'nickname_filter', 'email_filter', 'organization_filter', ->
|
||||||
|
return [] unless records = @get 'model'
|
||||||
|
if nickname_filter = @get('nickname_filter')
|
||||||
|
nickname_matcher = new RegExp nickname_filter, 'i'
|
||||||
|
records = records.filter (record) -> nickname_matcher.test record.get('nickname')
|
||||||
|
if email_filter = @get('email_filter')
|
||||||
|
email_matcher = new RegExp email_filter, 'i'
|
||||||
|
records = records.filter (record) -> email_matcher.test record.get('email')
|
||||||
|
if organization_filter = @get('organization_filter')
|
||||||
|
records = records.filter (record) -> record.get('organizations').includes organization_filter
|
||||||
|
#records.sortBy 'nickname'
|
||||||
|
records
|
||||||
|
|
||||||
|
actions:
|
||||||
|
clear_nickname_filter: -> @set 'nickname_filter', ''
|
||||||
|
clear_email_filter: -> @set 'email_filter', ''
|
||||||
|
set_organization_filter: (organization) -> @set 'organization_filter', organization
|
||||||
@@ -3,7 +3,7 @@ import Ember from 'ember'
|
|||||||
export default Ember.Route.extend
|
export default Ember.Route.extend
|
||||||
session: Ember.inject.service('session')
|
session: Ember.inject.service('session')
|
||||||
actions:
|
actions:
|
||||||
editOrganization: (organization)->
|
editOrganization: (organization) ->
|
||||||
@modal 'organization/edit-organization',
|
@modal 'organization/edit-organization',
|
||||||
model: organization.get('changeset')
|
model: organization.get('changeset')
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
import Ember from 'ember'
|
import Ember from 'ember'
|
||||||
export default Ember.Route.extend
|
export default Ember.Route.extend
|
||||||
model: -> @store.peekAll('user') # fetched in application route
|
model: -> @store.peekAll('user') # preloaded in application route
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
.ui.top-right.pagination.menu= page-numbers content=model.project_instance_actions showFL=true
|
.ui.top-right.pagination.menu= page-numbers content=model.project_instance_actions showFL=true
|
||||||
.ui.attached.segment
|
.ui.attached.segment
|
||||||
if globals.current_user.admin
|
if globals.current_user.admin
|
||||||
.pull-right= user-filters-manager scope_key='panda/action-list' content=model
|
.pull-right= user-filters-manager scope_key='panda/action-list' content=model.project_instance_actions
|
||||||
= ui-dropdown class='violet button pull-right'
|
= ui-dropdown class='violet button pull-right'
|
||||||
.default.text Export
|
.default.text Export
|
||||||
i.dropdown.icon
|
i.dropdown.icon
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
.ui.container
|
.ui.container
|
||||||
.ui.visible.message= t 'project.modals.edit_projects_context.message'
|
.ui.visible.message= t 'project.edit_projects_context.message'
|
||||||
h3.ui.top.attached.header
|
h3.ui.top.attached.header
|
||||||
.ui.right.floated.icon.buttons= push-action type="new" action="newWorkflowInstanceType"
|
.ui.right.floated.icon.buttons= push-action type="new" action="newWorkflowInstanceType"
|
||||||
= t 'models.plural.workflow_instance_type'
|
= t 'models.plural.workflow_instance_type'
|
||||||
@@ -8,5 +8,9 @@
|
|||||||
each workflow_instance_types as |workflow_instance_type|
|
each workflow_instance_types as |workflow_instance_type|
|
||||||
.ui.segment
|
.ui.segment
|
||||||
editable-attribute model=workflow_instance_type
|
editable-attribute model=workflow_instance_type
|
||||||
|
span
|
||||||
|
span.between-brackets
|
||||||
|
span id:
|
||||||
|
= workflow_instance_type.id
|
||||||
.modal-actions.sticky
|
.modal-actions.sticky
|
||||||
button.ui.basic.button.modal-close.pull-right{ action "close"}= t 'general.close'
|
button.ui.basic.button.modal-close.pull-right{ action "close"}= t 'general.close'
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ else
|
|||||||
.ui.segment
|
.ui.segment
|
||||||
.ui.horizontal.divider= t 'project.operate.set_value_on_non_final_till_date.title'
|
.ui.horizontal.divider= t 'project.operate.set_value_on_non_final_till_date.title'
|
||||||
.ui.segment
|
.ui.segment
|
||||||
|
span Complete action
|
||||||
= ui-dropdown class='search selection' selected=set_value_on_non_final_till_date_action onChange=(action (mut set_value_on_non_final_till_date_action)) fullTextSearch=true as |execute mapper|
|
= ui-dropdown class='search selection' selected=set_value_on_non_final_till_date_action onChange=(action (mut set_value_on_non_final_till_date_action)) fullTextSearch=true as |execute mapper|
|
||||||
.default.text= t 'action.select_model' modelPath='models.workflow_action_definition'
|
.default.text= t 'action.select_model' modelPath='models.workflow_action_definition'
|
||||||
i.dropdown.icon
|
i.dropdown.icon
|
||||||
@@ -30,11 +31,14 @@ else
|
|||||||
each model.sorted_workflow_action_definitions as |workflow_action_definition|
|
each model.sorted_workflow_action_definitions as |workflow_action_definition|
|
||||||
.item data-value='{{map-value mapper workflow_action_definition}}'
|
.item data-value='{{map-value mapper workflow_action_definition}}'
|
||||||
= workflow_action_definition.title
|
= workflow_action_definition.title
|
||||||
.ui.small.icon.input= ui-calendar-moment type='date' momentValue=(readonly set_value_on_non_final_till_date_date) onChange=(action (mut set_value_on_non_final_till_date_date)) placeholder='X'
|
|
||||||
if set_value_on_non_final_till_date_action
|
if set_value_on_non_final_till_date_action
|
||||||
'
|
'
|
||||||
span.between-brackets= set_value_on_non_final_till_date_action.identifier
|
span.between-brackets= set_value_on_non_final_till_date_action.identifier
|
||||||
'
|
span not having one of the states inquiry, rejected, completed until the action's target date
|
||||||
|
.ui.small.icon.input= ui-calendar-moment type='date' momentValue=(readonly set_value_on_non_final_till_date_date) onChange=(action (mut set_value_on_non_final_till_date_date)) placeholder='X'
|
||||||
|
'
|
||||||
|
span whose group is already closed (newly added action to project for example)
|
||||||
|
if set_value_on_non_final_till_date_action
|
||||||
if (eq set_value_on_non_final_till_date_action.value_type 'boolean')
|
if (eq set_value_on_non_final_till_date_action.value_type 'boolean')
|
||||||
button.ui.secondary.button click="set_value_on_non_final_till_date" Boom!
|
button.ui.secondary.button click="set_value_on_non_final_till_date" Boom!
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -0,0 +1 @@
|
|||||||
|
/ empty, to be used by panda implementing applications for custom magick that cannot be known by this generalized application
|
||||||
@@ -5,6 +5,7 @@ table.ui.compact.definition.table
|
|||||||
tr
|
tr
|
||||||
td= t 'models.plural.organization'
|
td= t 'models.plural.organization'
|
||||||
td= ui-multi-select options=possible_organizations labelProperty='name' selected=selected_organizations
|
td= ui-multi-select options=possible_organizations labelProperty='name' selected=selected_organizations
|
||||||
|
= partial 'user/edit-user-addition-overload'
|
||||||
.modal-actions.sticky
|
.modal-actions.sticky
|
||||||
button.ui.primary.button.modal-save.pull-right{action 'saveRecord'}= t 'general.save'
|
button.ui.primary.button.modal-save.pull-right{action 'saveRecord'}= t 'general.save'
|
||||||
button.ui.negative.button.modal-destroy.pull-right{action 'destroyRecord'}= t 'general.destroy.button'
|
button.ui.negative.button.modal-destroy.pull-right{action 'destroyRecord'}= t 'general.destroy.button'
|
||||||
|
|||||||
@@ -0,0 +1,3 @@
|
|||||||
|
= user-main-statistics1 user=model
|
||||||
|
br
|
||||||
|
br
|
||||||
@@ -8,14 +8,58 @@ d-breadcrumbs as |breadcrumb|
|
|||||||
/= push-action type='edit' action='editUsersContext'
|
/= push-action type='edit' action='editUsersContext'
|
||||||
= push-action type='new' action='newUser' description='Add user'
|
= push-action type='new' action='newUser' description='Add user'
|
||||||
= t 'models.plural.user'
|
= t 'models.plural.user'
|
||||||
|
span
|
||||||
|
span.between-brackets= users.length
|
||||||
table.ui.unstackable.table
|
table.ui.unstackable.table
|
||||||
thead
|
thead
|
||||||
tr
|
tr
|
||||||
th= t 'attributes.user.nickname'
|
th= t 'attributes.user.nickname'
|
||||||
|
th= t 'attributes.user.email'
|
||||||
|
th= t 'models.plural.organization'
|
||||||
th.actions
|
th.actions
|
||||||
|
tr
|
||||||
|
td.unpadded
|
||||||
|
.ui.mini.right.action.left.icon.input
|
||||||
|
i.filter.icon
|
||||||
|
= input value=nickname_filter
|
||||||
|
if nickname_filter
|
||||||
|
button.ui.icon.button click='clear_nickname_filter'
|
||||||
|
i.close.icon
|
||||||
|
td.unpadded
|
||||||
|
.ui.mini.right.action.left.icon.input
|
||||||
|
i.filter.icon
|
||||||
|
= input value=email_filter
|
||||||
|
if email_filter
|
||||||
|
button.ui.icon.button click='clear_email_filter'
|
||||||
|
i.close.icon
|
||||||
|
td
|
||||||
|
= ui-dropdown class='fluid search selection' selected=organization_filter onChange=(action 'set_organization_filter') fullTextSearch=true as |execute mapper|
|
||||||
|
.default.text= t 'action.select_model' modelPath='models.organization'
|
||||||
|
i.dropdown.icon
|
||||||
|
.menu
|
||||||
|
.item data-value='{{map-value mapper null}}' --
|
||||||
|
each possible_organizations as |organization|
|
||||||
|
.item data-value='{{map-value mapper organization}}'
|
||||||
|
if organization.logo
|
||||||
|
img src=organization.logo_url.small
|
||||||
|
= organization.name
|
||||||
|
td
|
||||||
|
if organization_filter
|
||||||
|
button.ui.mini.icon.button click="action 'set_organization_filter' null"
|
||||||
|
i.close.icon
|
||||||
|
|
||||||
tbody
|
tbody
|
||||||
/each model as |user|
|
/each model as |user|
|
||||||
each (sort-by 'nickname' model) as |user|
|
each (sort-by 'nickname' users) as |user|
|
||||||
tr
|
tr
|
||||||
td= link-to user.nickname 'user.show' user
|
td= link-to user.nickname 'user.show' user
|
||||||
|
td= user.email
|
||||||
|
td.comma-separated-items
|
||||||
|
each (sort-by 'name' user.organizations) as |organization|
|
||||||
|
if (eq organization_filter organization)
|
||||||
|
strong= link-to organization.name 'organization.show' organization
|
||||||
|
else
|
||||||
|
= link-to organization.name 'organization.show' organization
|
||||||
td.actions= push-action type='edit' action='editUser' model=user
|
td.actions= push-action type='edit' action='editUser' model=user
|
||||||
|
br
|
||||||
|
br
|
||||||
|
|||||||
@@ -20,11 +20,10 @@ d-breadcrumbs as |breadcrumb|
|
|||||||
td= t 'attributes.user.email'
|
td= t 'attributes.user.email'
|
||||||
td= model.email
|
td= model.email
|
||||||
br
|
br
|
||||||
= user-main-statistics1 user=model
|
= partial 'user/show-user-addition-overload'
|
||||||
br
|
|
||||||
br
|
|
||||||
|
|
||||||
if (can 'manage' 'model' 'user')
|
/ disable authorizations
|
||||||
|
/if (can 'manage' 'model' 'user')
|
||||||
.ui.two.column.grid
|
.ui.two.column.grid
|
||||||
.column
|
.column
|
||||||
.ui.top.attached.header.block
|
.ui.top.attached.header.block
|
||||||
|
|||||||
+2
-1
@@ -22,7 +22,7 @@
|
|||||||
"ember-cli-babel": "^6.3.0",
|
"ember-cli-babel": "^6.3.0",
|
||||||
"ember-cli-dunlop": "^0.0.0",
|
"ember-cli-dunlop": "^0.0.0",
|
||||||
"ember-cli-htmlbars": "^2.0.3",
|
"ember-cli-htmlbars": "^2.0.3",
|
||||||
"ember-cli-sass": "^7.0.0"
|
"ember-cli-sass": "^8.0.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"active-model-adapter": "^2.1.1",
|
"active-model-adapter": "^2.1.1",
|
||||||
@@ -70,6 +70,7 @@
|
|||||||
"emberx-select": "^3.1.0",
|
"emberx-select": "^3.1.0",
|
||||||
"json-formatter-js": "^2.2.0",
|
"json-formatter-js": "^2.2.0",
|
||||||
"loader.js": "^4.2.3",
|
"loader.js": "^4.2.3",
|
||||||
|
"sass": "^1.24.0",
|
||||||
"semantic-ui-ember": "^3.0.3",
|
"semantic-ui-ember": "^3.0.3",
|
||||||
"tooltipster": "^4.2.5",
|
"tooltipster": "^4.2.5",
|
||||||
"viz.js": "^1.8.0"
|
"viz.js": "^1.8.0"
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import Ember from 'ember'
|
import Ember from 'ember'
|
||||||
|
import config from '../config/environment'
|
||||||
import DunlopApplicationRoute from 'ember-cli-dunlop/mixins/application-route'
|
import DunlopApplicationRoute from 'ember-cli-dunlop/mixins/application-route'
|
||||||
|
|
||||||
export default Ember.Route.extend DunlopApplicationRoute,
|
export default Ember.Route.extend DunlopApplicationRoute,
|
||||||
@@ -55,7 +56,7 @@ export default Ember.Route.extend DunlopApplicationRoute,
|
|||||||
contentType: "application/json"
|
contentType: "application/json"
|
||||||
success: success
|
success: success
|
||||||
dataType: "json"
|
dataType: "json"
|
||||||
if get(session, 'isAuthenticated')
|
if Ember.get(session, 'isAuthenticated')
|
||||||
session.authorize 'authorizer:devise', (key, authorization) ->
|
session.authorize 'authorizer:devise', (key, authorization) ->
|
||||||
request.crossDomain = true
|
request.crossDomain = true
|
||||||
request.headers = {"#{key}": authorization}
|
request.headers = {"#{key}": authorization}
|
||||||
|
|||||||
Executable → Regular
|
Before Width: | Height: | Size: 28 KiB After Width: | Height: | Size: 28 KiB |
Reference in New Issue
Block a user