Compare commits
10 Commits
fd3f166841
...
d603418735
| Author | SHA1 | Date | |
|---|---|---|---|
| d603418735 | |||
| a4321d0a23 | |||
| 0b236e142f | |||
| 36a9f70d3d | |||
| 60f1388f45 | |||
| e8cce92f0e | |||
| a317dee95e | |||
| b7487ca827 | |||
| 9444f9d9ad | |||
| 0469ef470f |
@@ -21,3 +21,4 @@ testem.log
|
||||
.node_modules.ember-try/
|
||||
bower.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,
|
||||
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';
|
||||
|
||||
get = Ember.get;
|
||||
({get} = Ember);
|
||||
|
||||
export default Ember.Component.extend({
|
||||
tagName: 'span',
|
||||
@@ -32,6 +32,7 @@ export default Ember.Component.extend({
|
||||
set_scope_organization: function(organization) {
|
||||
var organization_id;
|
||||
if (organization != null) {
|
||||
//organization.reload().then =>
|
||||
organization_id = (organization != null ? organization.get('id') : void 0) || '';
|
||||
this.set('scope_organization', organization);
|
||||
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;
|
||||
|
||||
import Ember from 'ember';
|
||||
|
||||
get = Ember.get;
|
||||
({get} = Ember);
|
||||
|
||||
export default Ember.Component.extend({
|
||||
tagName: 'span',
|
||||
@@ -22,17 +22,15 @@ export default Ember.Component.extend({
|
||||
},
|
||||
set_scope_project: function(project) {
|
||||
if (project != null) {
|
||||
return project.reload().then((function(_this) {
|
||||
return function() {
|
||||
var project_id;
|
||||
project_id = (project != null ? project.get('id') : void 0) || '';
|
||||
_this.set('scope_project', project);
|
||||
_this.set('filters.workflow_action_definition_title_cont', '');
|
||||
_this.set('filters.project_id', project_id);
|
||||
_this.$('.select-project .dropdown.button').addClass('orange');
|
||||
return _this.send('apply_filters');
|
||||
};
|
||||
})(this));
|
||||
return project.reload().then(() => {
|
||||
var project_id;
|
||||
project_id = (project != null ? project.get('id') : void 0) || '';
|
||||
this.set('scope_project', project);
|
||||
this.set('filters.workflow_action_definition_title_cont', '');
|
||||
this.set('filters.project_id', project_id);
|
||||
this.$('.select-project .dropdown.button').addClass('orange');
|
||||
return this.send('apply_filters');
|
||||
});
|
||||
} else {
|
||||
this.setProperties({
|
||||
scope_project: null,
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
// Generated by CoffeeScript 1.12.5
|
||||
// Generated by CoffeeScript 2.7.0
|
||||
import Ember from 'ember';
|
||||
|
||||
import DS from 'ember-data';
|
||||
|
||||
export default Ember.Component.extend({
|
||||
record: null,
|
||||
project_specific: false,
|
||||
record: null, // parameter
|
||||
project_specific: false, // parameter
|
||||
session: Ember.inject.service('session'),
|
||||
classNames: ['project-aggregate-statistics', 'project-aggregate-organization-statistics'],
|
||||
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;
|
||||
}),
|
||||
statistics_data: Ember.computed(function() {
|
||||
@@ -53,7 +58,7 @@ export default Ember.Component.extend({
|
||||
}
|
||||
model_name = 'panda/organization';
|
||||
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');
|
||||
store = this.store;
|
||||
request = {
|
||||
@@ -61,15 +66,14 @@ export default Ember.Component.extend({
|
||||
contentType: "application/json",
|
||||
dataType: "json"
|
||||
};
|
||||
//success: (response) ->
|
||||
// resolve(response)
|
||||
if (Ember.get(session, 'isAuthenticated')) {
|
||||
session.authorize('authorizer:devise', function(key, authorization) {
|
||||
var obj;
|
||||
request.crossDomain = true;
|
||||
return request.headers = (
|
||||
obj = {},
|
||||
obj["" + key] = authorization,
|
||||
obj
|
||||
);
|
||||
return request.headers = {
|
||||
[`${key}`]: authorization
|
||||
};
|
||||
});
|
||||
}
|
||||
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 config from 'ember-get-config';
|
||||
@@ -7,9 +7,9 @@ export default Ember.Component.extend({
|
||||
tagName: 'img',
|
||||
init: function() {
|
||||
var src;
|
||||
src = config.environment === 'development' || config.environment === 'test' ? config.rootURL + "ember-panda/assets/" + (this.get('path')) : config.rootURL + "assets/" + (this.get('path'));
|
||||
src = config.environment === 'development' || config.environment === 'test' ? `${config.rootURL}ember-panda/assets/${this.get('path')}` : `${config.rootURL}assets/${this.get('path')}`;
|
||||
this.set('full_src', src);
|
||||
return this._super.apply(this, arguments);
|
||||
return this._super(...arguments);
|
||||
},
|
||||
attributeBindings: ['full_src:src']
|
||||
});
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Generated by CoffeeScript 1.12.5
|
||||
// Generated by CoffeeScript 2.7.0
|
||||
import Ember from 'ember';
|
||||
|
||||
export default Ember.Component.extend({
|
||||
@@ -19,11 +19,9 @@ export default Ember.Component.extend({
|
||||
return this.modal('project/edit-project-scenario', {
|
||||
model: project_scenario,
|
||||
closeOnOverlay: false,
|
||||
destroy_callback: (function(_this) {
|
||||
return function() {
|
||||
return _this.set('active_project_scenario', null);
|
||||
};
|
||||
})(this)
|
||||
destroy_callback: () => {
|
||||
return this.set('active_project_scenario', null);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Generated by CoffeeScript 1.12.5
|
||||
// Generated by CoffeeScript 2.7.0
|
||||
import Ember from 'ember';
|
||||
|
||||
export default Ember.Component.extend({
|
||||
@@ -8,6 +8,7 @@ export default Ember.Component.extend({
|
||||
project_instance_action: null,
|
||||
value_type: Ember.computed.alias('project_instance_action.workflow_action_definition.value_type'),
|
||||
save: function() {},
|
||||
// https://stackoverflow.com/questions/26967855/handling-click-and-doubleclick-on-same-view-in-emberjs
|
||||
doubleClick: function() {
|
||||
var eventIO;
|
||||
eventIO = this.get('eventIO');
|
||||
@@ -16,12 +17,17 @@ export default Ember.Component.extend({
|
||||
this.set('eventIO', null);
|
||||
}
|
||||
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', {
|
||||
model: this.get('project_instance_action'),
|
||||
save: this.save,
|
||||
close: this.save
|
||||
});
|
||||
} else {
|
||||
// fallback to single click behaviour
|
||||
return this.modal('project/edit-instance-action', {
|
||||
model: this.get('project_instance_action'),
|
||||
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;
|
||||
|
||||
import Ember from 'ember';
|
||||
@@ -14,8 +14,8 @@ Component = Ember.Component.extend({
|
||||
if (!(state = this.get('state'))) {
|
||||
return '-';
|
||||
}
|
||||
return t("attributes.state." + state, {
|
||||
"default": state
|
||||
return t(`attributes.state.${state}`, {
|
||||
default: state
|
||||
});
|
||||
}),
|
||||
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';
|
||||
|
||||
export default Ember.Component.extend({
|
||||
classNames: ['ui-multi-select-container'],
|
||||
labelProperty: 'name',
|
||||
placeholder: 'Select',
|
||||
placeholder: 'Select', // can be a text or translation string: organization.select_users.placeholder => # 'Select ${models.plural.user} (%{count})'
|
||||
options: [],
|
||||
selected: [],
|
||||
placeholder_text: Ember.computed('placeholder', function() {
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
// Generated by CoffeeScript 1.12.5
|
||||
// Generated by CoffeeScript 2.7.0
|
||||
import Ember from 'ember';
|
||||
|
||||
import DS from 'ember-data';
|
||||
|
||||
export default Ember.Component.extend({
|
||||
user: null,
|
||||
project_specific: false,
|
||||
user: null, // parameter
|
||||
project_specific: false, // parameter
|
||||
session: Ember.inject.service('session'),
|
||||
classNames: ['project-aggregate-statistics', 'project-aggregate-user-statistics'],
|
||||
statistics: Ember.computed('statistics_data.isFulfilled', 'project_specific', function() {
|
||||
@@ -15,6 +15,7 @@ export default Ember.Component.extend({
|
||||
return {};
|
||||
}
|
||||
target = {};
|
||||
//states = ['pending', 'planned', 'active', 'overdue', 'inquiry', 'rejected', 'completed']
|
||||
states = this.get('globals.project_instance_action.states');
|
||||
project_specific = this.get('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;
|
||||
}),
|
||||
statistics_data: Ember.computed(function() {
|
||||
@@ -53,7 +59,7 @@ export default Ember.Component.extend({
|
||||
}
|
||||
model_name = 'user';
|
||||
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');
|
||||
store = this.store;
|
||||
request = {
|
||||
@@ -61,15 +67,14 @@ export default Ember.Component.extend({
|
||||
contentType: "application/json",
|
||||
dataType: "json"
|
||||
};
|
||||
//success: (response) ->
|
||||
// resolve(response)
|
||||
if (Ember.get(session, 'isAuthenticated')) {
|
||||
session.authorize('authorizer:devise', function(key, authorization) {
|
||||
var obj;
|
||||
request.crossDomain = true;
|
||||
return request.headers = (
|
||||
obj = {},
|
||||
obj["" + key] = authorization,
|
||||
obj
|
||||
);
|
||||
return request.headers = {
|
||||
[`${key}`]: authorization
|
||||
};
|
||||
});
|
||||
}
|
||||
return DS.PromiseObject.create({
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Generated by CoffeeScript 1.12.5
|
||||
// Generated by CoffeeScript 2.7.0
|
||||
import Ember from 'ember';
|
||||
|
||||
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';
|
||||
|
||||
export default Ember.Controller.extend({
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
// Generated by CoffeeScript 1.12.5
|
||||
var slice = [].slice;
|
||||
|
||||
// Generated by CoffeeScript 2.7.0
|
||||
import Ember from 'ember';
|
||||
|
||||
//import config from 'ember-get-config'
|
||||
export default Ember.Controller.extend({
|
||||
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_scenario: null,
|
||||
scope_organization: null,
|
||||
@@ -44,7 +45,7 @@ export default Ember.Controller.extend({
|
||||
q: this.get('filter_query'),
|
||||
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() {
|
||||
var base_url, filter_addition, model_name;
|
||||
@@ -54,7 +55,7 @@ export default Ember.Controller.extend({
|
||||
q: this.get('filter_query'),
|
||||
include_pointing: true
|
||||
});
|
||||
return base_url + "/export_technical.csv?" + filter_addition;
|
||||
return `${base_url}/export_technical.csv?${filter_addition}`;
|
||||
}),
|
||||
actions: {
|
||||
apply_filters: function() {
|
||||
@@ -65,14 +66,12 @@ export default Ember.Controller.extend({
|
||||
if (project_ids.length === 1) {
|
||||
if (current_scope_project_id !== 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', '');
|
||||
}
|
||||
project.reload().then((function(_this) {
|
||||
return function() {
|
||||
return _this.set('scope_project', project);
|
||||
};
|
||||
})(this));
|
||||
project.reload().then(() => {
|
||||
return this.set('scope_project', project);
|
||||
});
|
||||
}
|
||||
} else if (this.get('scope_project')) {
|
||||
this.set('scope_project', null);
|
||||
@@ -100,29 +99,25 @@ export default Ember.Controller.extend({
|
||||
var new_value;
|
||||
new_value = [];
|
||||
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 {
|
||||
this.get("filters." + key).forEach(function(present_in_filter) {
|
||||
this.get(`filters.${key}`).forEach(function(present_in_filter) {
|
||||
if (present_in_filter !== value) {
|
||||
return new_value.push(present_in_filter);
|
||||
}
|
||||
});
|
||||
}
|
||||
this.set("filters." + key, new_value);
|
||||
this.set(`filters.${key}`, new_value);
|
||||
return this.apply_filters();
|
||||
},
|
||||
clear_filter: function() {
|
||||
var keys;
|
||||
keys = 1 <= arguments.length ? slice.call(arguments, 0) : [];
|
||||
keys.forEach((function(_this) {
|
||||
return function(key) {
|
||||
if (Ember.isArray(_this.get("filters." + key))) {
|
||||
return _this.set("filters." + key, []);
|
||||
} else {
|
||||
return _this.set("filters." + key, null);
|
||||
}
|
||||
};
|
||||
})(this));
|
||||
clear_filter: function(...keys) {
|
||||
keys.forEach((key) => {
|
||||
if (Ember.isArray(this.get(`filters.${key}`))) {
|
||||
return this.set(`filters.${key}`, []);
|
||||
} else {
|
||||
return this.set(`filters.${key}`, null);
|
||||
}
|
||||
});
|
||||
return this.apply_filters();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Generated by CoffeeScript 1.12.5
|
||||
// Generated by CoffeeScript 2.7.0
|
||||
import Ember from 'ember';
|
||||
|
||||
export default Ember.Controller.extend({
|
||||
@@ -11,12 +11,12 @@ export default Ember.Controller.extend({
|
||||
}
|
||||
duration = moment.duration(moment().diff(start_time));
|
||||
if (duration.days()) {
|
||||
return (duration.days()) + " days and " + (duration.hours()) + " hours";
|
||||
return `${duration.days()} days and ${duration.hours()} hours`;
|
||||
} else {
|
||||
hours = ('0' + duration.hours()).slice(-2);
|
||||
minutes = ('0' + duration.minutes()).slice(-2);
|
||||
seconds = ('0' + duration.seconds()).slice(-2);
|
||||
return hours + ":" + minutes + ":" + seconds;
|
||||
return `${hours}:${minutes}:${seconds}`;
|
||||
}
|
||||
}),
|
||||
actions: {
|
||||
|
||||
@@ -1,14 +1,15 @@
|
||||
// Generated by CoffeeScript 1.12.5
|
||||
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; };
|
||||
// Generated by CoffeeScript 2.7.0
|
||||
var indexOf = [].indexOf;
|
||||
|
||||
import Ember from 'ember';
|
||||
|
||||
export default Ember.Mixin.create({
|
||||
selected_project_scenarios: [],
|
||||
selected_project_scenarios_set_operation: 'union',
|
||||
selected_project_scenarios: [], // null
|
||||
selected_project_scenarios_set_operation: 'union', // union or intersection
|
||||
active_workflow_action_definitions: [],
|
||||
active_workflow_action_definition_ids: [],
|
||||
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_set_operation') === 'intersection') {
|
||||
return this.set_active_workflow_action_definitions_using_intersection();
|
||||
|
||||
@@ -1,15 +1,13 @@
|
||||
// Generated by CoffeeScript 1.12.5
|
||||
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; };
|
||||
// Generated by CoffeeScript 2.7.0
|
||||
var indexOf = [].indexOf;
|
||||
|
||||
import Ember from 'ember';
|
||||
|
||||
export default Ember.Mixin.create({
|
||||
get_active_workflow_groups: function(workflow_groups, project_scenarios, set_operation) {
|
||||
if (set_operation == null) {
|
||||
set_operation = 'union';
|
||||
}
|
||||
get_active_workflow_groups: function(workflow_groups, project_scenarios, set_operation = 'union') {
|
||||
project_scenarios = Ember.makeArray(project_scenarios);
|
||||
workflow_groups = workflow_groups.toArray();
|
||||
// initialize unused working workflow-groups
|
||||
if (project_scenarios.length) {
|
||||
if (set_operation === 'intersection') {
|
||||
return this.get_active_workflow_groups_using_intersection(workflow_groups, project_scenarios);
|
||||
@@ -20,6 +18,8 @@ export default Ember.Mixin.create({
|
||||
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) {
|
||||
var selected_project_scenario_workflow_group_ids, working_workflow_groups;
|
||||
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;
|
||||
},
|
||||
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;
|
||||
});
|
||||
});
|
||||
//@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) {
|
||||
var ref;
|
||||
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';
|
||||
|
||||
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';
|
||||
|
||||
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';
|
||||
|
||||
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';
|
||||
|
||||
export default DS.Model.extend({
|
||||
conditional_base_value: DS.attr('string', {
|
||||
defaultValue: ''
|
||||
}),
|
||||
connection_type: DS.attr('string'),
|
||||
connection_type: DS.attr('string'), // attached, constraint, info
|
||||
workflow_action_definition: DS.belongsTo('panda/workflow-action-definition', {
|
||||
inverse: 'workflow_action_connections'
|
||||
}),
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Generated by CoffeeScript 1.12.5
|
||||
// Generated by CoffeeScript 2.7.0
|
||||
var Model;
|
||||
|
||||
import Ember from 'ember';
|
||||
@@ -19,16 +19,16 @@ Model = {
|
||||
name: Ember.computed.alias('title'),
|
||||
description: DS.attr('string'),
|
||||
isEditing: DS.attr('boolean', {
|
||||
defaultValue: false
|
||||
defaultValue: false //TODO: remove, is from PMBC
|
||||
}),
|
||||
done: DS.attr('boolean', {
|
||||
defaultValue: false
|
||||
defaultValue: false //TODO: remove, is from PMBC
|
||||
}),
|
||||
position: DS.attr('number', {
|
||||
defaultValue: 0
|
||||
}),
|
||||
value_type: DS.attr('string', {
|
||||
defaultValue: 'boolean'
|
||||
defaultValue: 'boolean' // means checkbox progress type
|
||||
}),
|
||||
value_type_select_options: DS.attr({
|
||||
defaultValue: function() {
|
||||
@@ -37,7 +37,7 @@ Model = {
|
||||
}),
|
||||
extra_info: DS.attr('string'),
|
||||
offset_type: DS.attr('string', {
|
||||
defaultValue: 'none'
|
||||
defaultValue: 'none' // none, attached, configured
|
||||
}),
|
||||
overdue_coulance: DS.attr('number', {
|
||||
defaultValue: 0
|
||||
@@ -45,6 +45,9 @@ Model = {
|
||||
completes_group: DS.attr('boolean', {
|
||||
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'),
|
||||
project: DS.belongsTo('panda/project', {
|
||||
inverse: 'workflow_action_definitions'
|
||||
@@ -61,6 +64,7 @@ Model = {
|
||||
dependent_workflow_action_offsets: DS.hasMany('panda/workflow-action-offset', {
|
||||
inverse: 'base_workflow_action_definition'
|
||||
}),
|
||||
//project_scenarios: DS.hasMany('panda/project-scenario', inverse: 'workflow_action_definitions')
|
||||
project_scenarios: DS.hasMany('panda/project-scenario'),
|
||||
project_instance_actions: DS.hasMany('panda/project-instance-action', {
|
||||
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_attributes: true
|
||||
});
|
||||
|
||||
add_business_day_computations(Model, 'batch_element_threshold', {
|
||||
add_attributes: true
|
||||
add_attributes: true //, default_unit: 'businessday'
|
||||
});
|
||||
|
||||
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 PagedRemoteArray from 'ember-cli-dunlop/utils/paged-remote-array';
|
||||
@@ -17,7 +17,7 @@ export default Ember.Route.extend({
|
||||
modelName: 'panda/action-event',
|
||||
setupController: function(controller) {
|
||||
controller.set('filters', filters);
|
||||
return this._super.apply(this, arguments);
|
||||
return this._super(...arguments);
|
||||
},
|
||||
model: function(params) {
|
||||
return PagedRemoteArray.create({
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
// Generated by CoffeeScript 1.12.5
|
||||
// Generated by CoffeeScript 2.7.0
|
||||
var get;
|
||||
|
||||
import Ember from 'ember';
|
||||
|
||||
import PagedRemoteArray from 'ember-cli-dunlop/utils/paged-remote-array';
|
||||
|
||||
get = Ember.get;
|
||||
({get} = Ember);
|
||||
|
||||
export var default_filters = Ember.Object.create({
|
||||
filter_calls: 0,
|
||||
@@ -14,9 +14,11 @@ export var default_filters = Ember.Object.create({
|
||||
project_id: '',
|
||||
project_instance_project_scenario_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: '',
|
||||
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: [],
|
||||
target_date_gteq: null,
|
||||
target_date_lteq: null,
|
||||
@@ -47,7 +49,7 @@ export default Ember.Route.extend({
|
||||
modelName: 'panda/project-instance-action',
|
||||
setupController: function(controller, model) {
|
||||
controller.set('filters', model.project_instance_actions.get('filters'));
|
||||
return this._super.apply(this, arguments);
|
||||
return this._super(...arguments);
|
||||
},
|
||||
model: function(params) {
|
||||
var filters, scope_key, user_default;
|
||||
@@ -60,6 +62,29 @@ export default Ember.Route.extend({
|
||||
filters = default_filters;
|
||||
}
|
||||
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(','));
|
||||
}
|
||||
if (params.action) {
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
// Generated by CoffeeScript 1.12.5
|
||||
// Generated by CoffeeScript 2.7.0
|
||||
import Ember from 'ember';
|
||||
|
||||
import config from 'ember-get-config';
|
||||
|
||||
//import Route from '@ember/route'
|
||||
//import { inject as service } from '@ember/service'
|
||||
export default Ember.Route.extend({
|
||||
poll: 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;
|
||||
model_name = 'panda/setting';
|
||||
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 = {
|
||||
url: endpoint,
|
||||
success: (function(_this) {
|
||||
return function(operation_running) {
|
||||
if (operation_running) {
|
||||
return _this.set('router.globals.operation_running', moment(operation_running));
|
||||
} else {
|
||||
return _this.set('router.globals.operation_running', '');
|
||||
}
|
||||
};
|
||||
})(this)
|
||||
success: (operation_running) => {
|
||||
if (operation_running) {
|
||||
return this.set('router.globals.operation_running', moment(operation_running));
|
||||
} else {
|
||||
return this.set('router.globals.operation_running', '');
|
||||
}
|
||||
}
|
||||
};
|
||||
session = this.get('session');
|
||||
if (Ember.get(session, 'isAuthenticated')) {
|
||||
session.authorize('authorizer:devise', function(key, authorization) {
|
||||
var obj;
|
||||
request.crossDomain = true;
|
||||
return request.headers = (
|
||||
obj = {},
|
||||
obj["" + key] = authorization,
|
||||
obj
|
||||
);
|
||||
return request.headers = {
|
||||
[`${key}`]: authorization
|
||||
};
|
||||
});
|
||||
}
|
||||
pollFunction = (function(_this) {
|
||||
return function() {
|
||||
return Ember.$.ajax(request);
|
||||
};
|
||||
})(this);
|
||||
pollFunction = () => {
|
||||
return Ember.$.ajax(request);
|
||||
};
|
||||
pollFunction();
|
||||
return pollId = this.get('poll').addPoll({
|
||||
interval: 30 * 1000,
|
||||
@@ -57,6 +52,8 @@ export default Ember.Route.extend({
|
||||
label: 'project-running'
|
||||
});
|
||||
},
|
||||
//@get('poll').startPoll(pollId)
|
||||
//@get('poll').startPollByLabel('project-running')
|
||||
willTransition: function() {
|
||||
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;
|
||||
|
||||
import Ember from 'ember';
|
||||
|
||||
import DS from 'ember-data';
|
||||
|
||||
businessDayComputations = function(target, prefix, options) {
|
||||
if (options == null) {
|
||||
options = {};
|
||||
}
|
||||
businessDayComputations = function(target, prefix, options = {}) {
|
||||
if (options.add_attributes) {
|
||||
Ember.defineProperty(target, prefix + "_value", DS.attr('number', {
|
||||
Ember.defineProperty(target, `${prefix}_value`, DS.attr('number', {
|
||||
defaultValue: 0
|
||||
}));
|
||||
Ember.defineProperty(target, prefix + "_unit", DS.attr('string', {
|
||||
Ember.defineProperty(target, `${prefix}_unit`, DS.attr('string', {
|
||||
defaultValue: options.default_unit || 'day'
|
||||
}));
|
||||
Ember.defineProperty(target, prefix + "_business_days", DS.attr({
|
||||
Ember.defineProperty(target, `${prefix}_business_days`, DS.attr({
|
||||
defaultValue: function() {
|
||||
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;
|
||||
};
|
||||
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
// Generated by CoffeeScript 1.12.5
|
||||
// Generated by CoffeeScript 2.7.0
|
||||
'use strict';
|
||||
// taken from https://github.com/kalmecak/moment-business-days
|
||||
//if (typeof require === 'function') {
|
||||
// var moment = require('moment');
|
||||
//}
|
||||
moment.fn.isHoliday = function() {
|
||||
var locale;
|
||||
locale = this.localeData();
|
||||
@@ -64,11 +68,8 @@ moment.fn.businessDiff = function(param) {
|
||||
return daysBetween;
|
||||
};
|
||||
|
||||
moment.fn.businessAdd = function(number, options) {
|
||||
moment.fn.businessAdd = function(number, options = {}) {
|
||||
var day, remaining, signal;
|
||||
if (options == null) {
|
||||
options = {};
|
||||
}
|
||||
options.period || (options.period = 'days');
|
||||
day = this.clone();
|
||||
signal = number < 0 ? -1 : 1;
|
||||
@@ -82,10 +83,7 @@ moment.fn.businessAdd = function(number, options) {
|
||||
return day;
|
||||
};
|
||||
|
||||
moment.fn.businessSubtract = function(number, options) {
|
||||
if (options == null) {
|
||||
options = {};
|
||||
}
|
||||
moment.fn.businessSubtract = function(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;
|
||||
|
||||
pandaRouteSetup = function(context) {
|
||||
@@ -12,6 +12,8 @@ pandaRouteSetup = function(context) {
|
||||
path: 'tracker-subject/:tracker_subject_id'
|
||||
});
|
||||
this.route('add-progress');
|
||||
//@route 'tracker-subject', ->
|
||||
// @route 'show'
|
||||
this.route('dunlop-generator');
|
||||
this.route('analysis');
|
||||
this.route('operate');
|
||||
@@ -37,7 +39,9 @@ pandaRouteSetup = function(context) {
|
||||
});
|
||||
});
|
||||
});
|
||||
//@route 'project/views', path: 'views'
|
||||
context.route('login');
|
||||
//@route 'organization', path: 'organizations/:organization_id'
|
||||
context.route('action-list');
|
||||
context.route('organization', function() {
|
||||
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('action-event');
|
||||
context.route('meeting-reports');
|
||||
@@ -73,7 +78,7 @@ pandaRouteSetup = function(context) {
|
||||
return this.route('dunlop');
|
||||
});
|
||||
return this.route('tracker', function() {
|
||||
return this.route('tricks');
|
||||
return this.route('tricks'); // dummy/empty now, to genate the index
|
||||
});
|
||||
});
|
||||
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,
|
||||
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';
|
||||
|
||||
// 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) {
|
||||
var selected_project_scenario_workflow_action_definition_ids, working_workflow_action_definitions;
|
||||
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) {
|
||||
if (set_operation == null) {
|
||||
set_operation = 'union';
|
||||
}
|
||||
get_active_workflow_action_definitions = function(workflow_action_definitions, project_scenarios, set_operation = 'union') {
|
||||
project_scenarios = Ember.makeArray(project_scenarios);
|
||||
workflow_action_definitions = workflow_action_definitions.toArray();
|
||||
// initialize unused working workflow-action-definitions
|
||||
if (project_scenarios.length) {
|
||||
if (set_operation === 'intersection') {
|
||||
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);
|
||||
}
|
||||
} else {
|
||||
// no filtering can be allplied, return all
|
||||
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,
|
||||
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';
|
||||
|
||||
// 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) {
|
||||
var selected_project_scenario_workflow_group_ids, working_workflow_groups;
|
||||
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) {
|
||||
if (set_operation == null) {
|
||||
set_operation = 'union';
|
||||
}
|
||||
get_active_workflow_groups = function(workflow_groups, project_scenarios, set_operation = 'union') {
|
||||
project_scenarios = Ember.makeArray(project_scenarios);
|
||||
workflow_groups = workflow_groups.toArray();
|
||||
// initialize unused working workflow-groups
|
||||
if (project_scenarios.length) {
|
||||
if (set_operation === 'intersection') {
|
||||
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);
|
||||
}
|
||||
} else {
|
||||
// no filtering can be allplied, return all
|
||||
return workflow_groups;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Generated by CoffeeScript 1.12.5
|
||||
// Generated by CoffeeScript 2.7.0
|
||||
var projectContract;
|
||||
|
||||
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,
|
||||
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';
|
||||
|
||||
@@ -10,7 +13,7 @@ RecordNode = Ember.Object.extend({
|
||||
var title, value_shift;
|
||||
title = this.get('record.title');
|
||||
if (value_shift = this.get('value_shift')) {
|
||||
title = " " + title + " (" + value_shift + "d)";
|
||||
title = ` ${title} (${value_shift}d)`;
|
||||
}
|
||||
return title;
|
||||
})
|
||||
@@ -30,12 +33,10 @@ WorkflowActionDefinitionOffsetNodes = Ember.Object.extend({
|
||||
batch_size: 0,
|
||||
active_project_scenario: null,
|
||||
forEach: function() {
|
||||
var ref;
|
||||
return (ref = this.get('processed_workflow_action_definitions')).forEach.apply(ref, arguments);
|
||||
return this.get('processed_workflow_action_definitions').forEach(...arguments);
|
||||
},
|
||||
filterBy: function() {
|
||||
var ref;
|
||||
return (ref = this.get('processed_workflow_action_definitions')).filterBy.apply(ref, arguments);
|
||||
return this.get('processed_workflow_action_definitions').filterBy(...arguments);
|
||||
},
|
||||
get_resolved: function() {
|
||||
return this.get('processed_workflow_action_definitions').filterBy('resolved');
|
||||
@@ -58,16 +59,16 @@ WorkflowActionDefinitionOffsetNodes = Ember.Object.extend({
|
||||
action_added = false;
|
||||
if (workflow_action_definition.get('offset_type') === 'configured') {
|
||||
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) {
|
||||
return;
|
||||
}
|
||||
if (active_scenario_identifier && workflow_action_offset.get('project_scenario.identifier') && workflow_action_offset.get('project_scenario.identifier') !== active_scenario_identifier) {
|
||||
return;
|
||||
}
|
||||
if (!workflow_action_offset.get('base_workflow_action_definition.content')) {
|
||||
ref = base.get_offset_for_target(workflow_action_offset, 0), offset_date = ref[0], offset_value = ref[1];
|
||||
ref1 = base.get_dynamic_offset_for_target(workflow_action_offset, offset_value), date = ref1[0], value_shift = ref1[1];
|
||||
if (!workflow_action_offset.get('base_workflow_action_definition.content')) { // x_based
|
||||
[offset_date, offset_value] = base.get_offset_for_target(workflow_action_offset, 0);
|
||||
[date, value_shift] = base.get_dynamic_offset_for_target(workflow_action_offset, offset_value);
|
||||
absolute_value = offset_value + value_shift;
|
||||
record_wrapper = RecordNode.create({
|
||||
record: workflow_action_definition,
|
||||
@@ -97,32 +98,31 @@ WorkflowActionDefinitionOffsetNodes = Ember.Object.extend({
|
||||
this.set('processed_workflow_action_definitions', first_loop_actions);
|
||||
this.set('working_workflow_action_definitions', working_workflow_action_definitions);
|
||||
this.incrementProperty('iteration_context_counter');
|
||||
//@set 'working_workflow_action_definitions', @get('workflow_action_definitions').filterBy('offset_type', 'configured')
|
||||
this.run_critical_path_resolve_loop();
|
||||
resolve_level = this.get('iteration_context_counter');
|
||||
return this.get('working_workflow_action_definitions').forEach((function(_this) {
|
||||
return function(unresolved_workflow_action_definition) {
|
||||
var offset_wrappers;
|
||||
offset_wrappers = [];
|
||||
unresolved_workflow_action_definition.get('workflow_action_offsets').forEach(function(action_offset) {
|
||||
var ref;
|
||||
if (ref = action_offset.get('base_workflow_action_definition.id'), indexOf.call(scope_workflow_action_definition_ids, ref) < 0) {
|
||||
return;
|
||||
}
|
||||
return offset_wrappers.push(OffsetNode.create({
|
||||
total_offset: action_offset.get('offset_value'),
|
||||
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'
|
||||
return this.get('working_workflow_action_definitions').forEach((unresolved_workflow_action_definition) => { // add unresolved records
|
||||
var offset_wrappers;
|
||||
offset_wrappers = [];
|
||||
unresolved_workflow_action_definition.get('workflow_action_offsets').forEach(function(action_offset) {
|
||||
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
|
||||
return;
|
||||
}
|
||||
return offset_wrappers.push(OffsetNode.create({
|
||||
total_offset: action_offset.get('offset_value'),
|
||||
record: action_offset
|
||||
}));
|
||||
};
|
||||
})(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) {
|
||||
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'))) {
|
||||
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;
|
||||
}
|
||||
period_unit = target.get('batch_element_threshold_unit');
|
||||
offset_value = target.get('offset_value');
|
||||
operation = offset_value < 0 ? 'subtract' : 'add';
|
||||
if (period_unit === 'businessday') {
|
||||
operation = "business" + (operation.capitalize());
|
||||
operation = `business${operation.capitalize()}`;
|
||||
shifted_date = base_date.clone()[operation](threshold_exceedance, {
|
||||
business_days: target.get('batch_element_threshold_business_days')
|
||||
});
|
||||
@@ -161,7 +161,7 @@ WorkflowActionDefinitionOffsetNodes = Ember.Object.extend({
|
||||
period_unit = target.get('offset_unit');
|
||||
operation = offset_value < 0 ? 'subtract' : 'add';
|
||||
if (period_unit === 'businessday') {
|
||||
operation = "business" + (operation.capitalize());
|
||||
operation = `business${operation.capitalize()}`;
|
||||
shifted_date = base_date.clone()[operation](Math.abs(offset_value), {
|
||||
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);
|
||||
}
|
||||
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];
|
||||
},
|
||||
run_critical_path_resolve_loop: function() {
|
||||
@@ -188,24 +189,26 @@ WorkflowActionDefinitionOffsetNodes = Ember.Object.extend({
|
||||
farthest_absolute_value = 0;
|
||||
farthest_absolute_value_value_shift = 0;
|
||||
farthest_result_total_offset = 0;
|
||||
date = null;
|
||||
date = null; // scoping
|
||||
resolved_offset_wrappers = [];
|
||||
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) {
|
||||
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 (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 false;
|
||||
}
|
||||
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];
|
||||
ref2 = get_dynamic_offset_for_target(workflow_action_offset, processed_absolute_value + working_offset_value), date = ref2[0], current_connection_value_shift = ref2[1];
|
||||
[offset_date, working_offset_value] = get_offset_for_target(workflow_action_offset, processed_absolute_value);
|
||||
[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_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)) {
|
||||
farthest_absolute_value = current_connection_absolute_value;
|
||||
farthest_absolute_value_value_shift = current_connection_value_shift;
|
||||
@@ -217,7 +220,7 @@ WorkflowActionDefinitionOffsetNodes = Ember.Object.extend({
|
||||
total_offset: current_connection_total_offset_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) {
|
||||
record_wrapper = RecordNode.create({
|
||||
@@ -262,10 +265,10 @@ WorkflowActionDefinitionOffsetNodes = Ember.Object.extend({
|
||||
farthest_absolute_value = 0;
|
||||
farthest_absolute_value_value_shift = 0;
|
||||
farthest_result_total_offset = 0;
|
||||
date = null;
|
||||
date = null; // scoping
|
||||
resolved_offset_wrappers = [];
|
||||
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) {
|
||||
return;
|
||||
}
|
||||
@@ -276,10 +279,12 @@ WorkflowActionDefinitionOffsetNodes = Ember.Object.extend({
|
||||
return;
|
||||
}
|
||||
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];
|
||||
ref2 = get_dynamic_offset_for_target(workflow_action_offset, processed_absolute_value + working_offset_value), date = ref2[0], current_connection_value_shift = ref2[1];
|
||||
[offset_date, working_offset_value] = get_offset_for_target(workflow_action_offset, processed_absolute_value);
|
||||
[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_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)) {
|
||||
farthest_absolute_value = current_connection_absolute_value;
|
||||
farthest_absolute_value_value_shift = current_connection_value_shift;
|
||||
@@ -296,7 +301,7 @@ WorkflowActionDefinitionOffsetNodes = Ember.Object.extend({
|
||||
record_wrapper = RecordNode.create({
|
||||
record: working_workflow_action_definition,
|
||||
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,
|
||||
absolute_value: farthest_absolute_value,
|
||||
date: date,
|
||||
@@ -331,10 +336,10 @@ WorkflowActionDefinitionOffsetNodes = Ember.Object.extend({
|
||||
farthest_absolute_value = 0;
|
||||
farthest_absolute_value_value_shift = 0;
|
||||
farthest_result_total_offset = 0;
|
||||
date = null;
|
||||
date = null; // scoping
|
||||
resolved_offset_wrappers = [];
|
||||
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) {
|
||||
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')))) {
|
||||
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');
|
||||
ref1 = get_offset_for_target(workflow_action_offset, processed_absolute_value), offset_date = ref1[0], working_offset_value = ref1[1];
|
||||
ref2 = get_dynamic_offset_for_target(workflow_action_offset, processed_absolute_value + working_offset_value), date = ref2[0], current_connection_value_shift = ref2[1];
|
||||
[offset_date, working_offset_value] = get_offset_for_target(workflow_action_offset, processed_absolute_value);
|
||||
[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;
|
||||
//NOTE MINUS!!!!!!!!!!!!!!!!!!!!!
|
||||
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)) {
|
||||
farthest_absolute_value = current_connection_absolute_value;
|
||||
farthest_absolute_value_value_shift = current_connection_value_shift;
|
||||
@@ -365,7 +374,7 @@ WorkflowActionDefinitionOffsetNodes = Ember.Object.extend({
|
||||
record_wrapper = RecordNode.create({
|
||||
record: working_workflow_action_definition,
|
||||
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,
|
||||
absolute_value: farthest_absolute_value,
|
||||
date: date,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Generated by CoffeeScript 1.12.5
|
||||
// Generated by CoffeeScript 2.7.0
|
||||
var validations;
|
||||
|
||||
import {
|
||||
@@ -11,7 +11,7 @@ validations = {
|
||||
name: validatePresence({
|
||||
presence: true,
|
||||
message: function(key, type) {
|
||||
return buildMessage(t("attributes.workflow_action_definition." + key), {
|
||||
return buildMessage(t(`attributes.workflow_action_definition.${key}`), {
|
||||
type: type
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Generated by CoffeeScript 1.12.5
|
||||
// Generated by CoffeeScript 2.7.0
|
||||
var validations;
|
||||
|
||||
import {
|
||||
@@ -11,7 +11,7 @@ validations = {
|
||||
client_identifier: validatePresence({
|
||||
presence: true,
|
||||
message: function(key, type) {
|
||||
return buildMessage(t("attributes.project_instance." + key), {
|
||||
return buildMessage(t(`attributes.project_instance.${key}`), {
|
||||
type: type
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Generated by CoffeeScript 1.12.5
|
||||
// Generated by CoffeeScript 2.7.0
|
||||
var validations;
|
||||
|
||||
import {
|
||||
@@ -11,7 +11,7 @@ validations = {
|
||||
name: validatePresence({
|
||||
presence: true,
|
||||
message: function(key, type) {
|
||||
return buildMessage(t("attributes.workflow_action_definition." + key), {
|
||||
return buildMessage(t(`attributes.workflow_action_definition.${key}`), {
|
||||
type: type
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Generated by CoffeeScript 1.12.5
|
||||
// Generated by CoffeeScript 2.7.0
|
||||
var validations;
|
||||
|
||||
import {
|
||||
@@ -12,7 +12,7 @@ validations = {
|
||||
nickname: validatePresence({
|
||||
presence: true,
|
||||
message: function(key, type) {
|
||||
return buildMessage(t("attributes.user." + key), {
|
||||
return buildMessage(t(`attributes.user.${key}`), {
|
||||
type: type
|
||||
});
|
||||
}
|
||||
@@ -20,7 +20,7 @@ validations = {
|
||||
email: validateFormat({
|
||||
type: 'email',
|
||||
message: function(key, type) {
|
||||
return buildMessage(t("attributes.user." + key), {
|
||||
return buildMessage(t(`attributes.user.${key}`), {
|
||||
type: type
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Generated by CoffeeScript 1.12.5
|
||||
// Generated by CoffeeScript 2.7.0
|
||||
var validations;
|
||||
|
||||
import {
|
||||
@@ -11,7 +11,7 @@ validations = {
|
||||
title: validatePresence({
|
||||
presence: true,
|
||||
message: function(key, type) {
|
||||
return buildMessage(t("attributes.workflow_action_definition." + key), {
|
||||
return buildMessage(t(`attributes.workflow_action_definition.${key}`), {
|
||||
type: type
|
||||
});
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ export default Ember.Component.extend
|
||||
nesting_level: Infinity
|
||||
top_title: 'JSON'
|
||||
didInsertElement: ->
|
||||
formatter = new JSONFormatter.default(@get('value'), @get('nesting_level'))
|
||||
formatter = new JSONFormatter(@get('value'), @get('nesting_level'))
|
||||
v = formatter.render()
|
||||
tree = $(v)
|
||||
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: []
|
||||
willOpenModal: ->
|
||||
@set 'possible_users', @store.peekAll('user')
|
||||
@get('model.users').then (users)=>
|
||||
@get('model').get('users').then (users) =>
|
||||
@set 'selected_users', users.toArray()
|
||||
|
||||
actions:
|
||||
|
||||
@@ -27,9 +27,9 @@ export default ModalBase.extend
|
||||
@set 'contract', DS.PromiseObject.create
|
||||
promise: new Ember.RSVP.Promise (resolve) ->
|
||||
contract =
|
||||
generating_project: project.get('id')
|
||||
identifier: project.get('identifier')
|
||||
contract_version: 'v1'
|
||||
generating_project_identifier: project.get('identifier')
|
||||
generating_project_name: project.get('name')
|
||||
instance_scope: project.get('instance_scope')
|
||||
workflow_groups: []
|
||||
workflow_actions: []
|
||||
@@ -48,7 +48,7 @@ export default ModalBase.extend
|
||||
offset_type: workflow_group.get('offset_type')
|
||||
offset_base: workflow_group.get('offset_base.identifier') || null # no undefined
|
||||
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
|
||||
add_offset_to workflow_group_object, 'batch_element_threshold', workflow_group
|
||||
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_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')
|
||||
offset_object.base_workflow_action = base_identifier
|
||||
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')
|
||||
workflow_action_definition_object.action_connections.push connection_object
|
||||
|
||||
workflow_action_definition.get('workflow_action_constraints').forEach (workflow_action_constraint) ->
|
||||
workflow_action_definition_object.action_constraints ||= []
|
||||
workflow_action_definition_object.action_constraints.push
|
||||
type: workflow_action_constraint.get('type')
|
||||
base_workflow_action: workflow_action_constraint.get('constraint_workflow_action_definition.identifier')
|
||||
#workflow_action_definition.get('workflow_action_constraints').forEach (workflow_action_constraint) ->
|
||||
# workflow_action_definition_object.action_constraints ||= []
|
||||
# workflow_action_definition_object.action_constraints.push
|
||||
# type: workflow_action_constraint.get('type')
|
||||
# base_workflow_action: workflow_action_constraint.get('constraint_workflow_action_definition.identifier')
|
||||
project.get('project_scenarios').forEach (project_scenario) ->
|
||||
project_scenario_object =
|
||||
identifier: project_scenario.get('identifier')
|
||||
|
||||
@@ -68,7 +68,7 @@ export default ModalBase.extend
|
||||
|
||||
select_class_names: Ember.computed 'model.string_value', ->
|
||||
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', ->
|
||||
|
||||
@@ -54,6 +54,7 @@ export default ModalBase.extend
|
||||
@_super()
|
||||
rollback_and_close: ->
|
||||
constraints = @get('model.constraints')
|
||||
constraints = constraints.content if !constraints.filterBy and constraints.content?
|
||||
constraints.filterBy('isNew').invoke 'unloadRecord'
|
||||
constraints.rejectBy('isNew').invoke 'rollbackAttributes' # not rolling back belongsTo, known issue
|
||||
@_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
|
||||
session: Ember.inject.service('session')
|
||||
actions:
|
||||
editOrganization: (organization)->
|
||||
editOrganization: (organization) ->
|
||||
@modal 'organization/edit-organization',
|
||||
model: organization.get('changeset')
|
||||
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
import Ember from 'ember'
|
||||
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.attached.segment
|
||||
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'
|
||||
.default.text Export
|
||||
i.dropdown.icon
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
.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
|
||||
.ui.right.floated.icon.buttons= push-action type="new" action="newWorkflowInstanceType"
|
||||
= t 'models.plural.workflow_instance_type'
|
||||
@@ -8,5 +8,9 @@
|
||||
each workflow_instance_types as |workflow_instance_type|
|
||||
.ui.segment
|
||||
editable-attribute model=workflow_instance_type
|
||||
span
|
||||
span.between-brackets
|
||||
span id:
|
||||
= workflow_instance_type.id
|
||||
.modal-actions.sticky
|
||||
button.ui.basic.button.modal-close.pull-right{ action "close"}= t 'general.close'
|
||||
|
||||
@@ -22,6 +22,7 @@ else
|
||||
.ui.segment
|
||||
.ui.horizontal.divider= t 'project.operate.set_value_on_non_final_till_date.title'
|
||||
.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|
|
||||
.default.text= t 'action.select_model' modelPath='models.workflow_action_definition'
|
||||
i.dropdown.icon
|
||||
@@ -30,11 +31,14 @@ else
|
||||
each model.sorted_workflow_action_definitions as |workflow_action_definition|
|
||||
.item data-value='{{map-value mapper workflow_action_definition}}'
|
||||
= 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
|
||||
'
|
||||
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')
|
||||
button.ui.secondary.button click="set_value_on_non_final_till_date" Boom!
|
||||
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
|
||||
td= t 'models.plural.organization'
|
||||
td= ui-multi-select options=possible_organizations labelProperty='name' selected=selected_organizations
|
||||
= partial 'user/edit-user-addition-overload'
|
||||
.modal-actions.sticky
|
||||
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'
|
||||
|
||||
@@ -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='new' action='newUser' description='Add user'
|
||||
= t 'models.plural.user'
|
||||
span
|
||||
span.between-brackets= users.length
|
||||
table.ui.unstackable.table
|
||||
thead
|
||||
tr
|
||||
th= t 'attributes.user.nickname'
|
||||
th= t 'attributes.user.email'
|
||||
th= t 'models.plural.organization'
|
||||
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
|
||||
/each model as |user|
|
||||
each (sort-by 'nickname' model) as |user|
|
||||
each (sort-by 'nickname' users) as |user|
|
||||
tr
|
||||
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
|
||||
br
|
||||
br
|
||||
|
||||
@@ -20,11 +20,10 @@ d-breadcrumbs as |breadcrumb|
|
||||
td= t 'attributes.user.email'
|
||||
td= model.email
|
||||
br
|
||||
= user-main-statistics1 user=model
|
||||
br
|
||||
br
|
||||
= partial 'user/show-user-addition-overload'
|
||||
|
||||
if (can 'manage' 'model' 'user')
|
||||
/ disable authorizations
|
||||
/if (can 'manage' 'model' 'user')
|
||||
.ui.two.column.grid
|
||||
.column
|
||||
.ui.top.attached.header.block
|
||||
|
||||
+2
-1
@@ -22,7 +22,7 @@
|
||||
"ember-cli-babel": "^6.3.0",
|
||||
"ember-cli-dunlop": "^0.0.0",
|
||||
"ember-cli-htmlbars": "^2.0.3",
|
||||
"ember-cli-sass": "^7.0.0"
|
||||
"ember-cli-sass": "^8.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"active-model-adapter": "^2.1.1",
|
||||
@@ -70,6 +70,7 @@
|
||||
"emberx-select": "^3.1.0",
|
||||
"json-formatter-js": "^2.2.0",
|
||||
"loader.js": "^4.2.3",
|
||||
"sass": "^1.24.0",
|
||||
"semantic-ui-ember": "^3.0.3",
|
||||
"tooltipster": "^4.2.5",
|
||||
"viz.js": "^1.8.0"
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import Ember from 'ember'
|
||||
import config from '../config/environment'
|
||||
import DunlopApplicationRoute from 'ember-cli-dunlop/mixins/application-route'
|
||||
|
||||
export default Ember.Route.extend DunlopApplicationRoute,
|
||||
@@ -55,7 +56,7 @@ export default Ember.Route.extend DunlopApplicationRoute,
|
||||
contentType: "application/json"
|
||||
success: success
|
||||
dataType: "json"
|
||||
if get(session, 'isAuthenticated')
|
||||
if Ember.get(session, 'isAuthenticated')
|
||||
session.authorize 'authorizer:devise', (key, authorization) ->
|
||||
request.crossDomain = true
|
||||
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