See Allinq epots changelog v1.3.0
This commit is contained in:
@@ -1,8 +1,16 @@
|
||||
import Ember from 'ember'
|
||||
{get} = Ember
|
||||
|
||||
export default Ember.Component.extend
|
||||
tagName: 'span'
|
||||
organizations: []
|
||||
relevant_organizations: Ember.computed 'organizations.[]', 'globals.current_user.admin', ->
|
||||
return [] unless user = @get('globals.current_user')
|
||||
organizations = @get('organizations')
|
||||
return organizations if get(user, 'admin')
|
||||
organizations.filter (o) ->
|
||||
user_ids = get(o, 'users').mapBy('id')
|
||||
get(user, 'id') in user_ids
|
||||
actions:
|
||||
apply_filters: ->
|
||||
@get('apply_filters')?()
|
||||
|
||||
@@ -1,9 +1,29 @@
|
||||
// Generated by CoffeeScript 1.12.5
|
||||
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; };
|
||||
|
||||
import Ember from 'ember';
|
||||
|
||||
get = Ember.get;
|
||||
|
||||
export default Ember.Component.extend({
|
||||
tagName: 'span',
|
||||
organizations: [],
|
||||
relevant_organizations: Ember.computed('organizations.[]', 'globals.current_user.admin', function() {
|
||||
var organizations, user;
|
||||
if (!(user = this.get('globals.current_user'))) {
|
||||
return [];
|
||||
}
|
||||
organizations = this.get('organizations');
|
||||
if (get(user, 'admin')) {
|
||||
return organizations;
|
||||
}
|
||||
return organizations.filter(function(o) {
|
||||
var ref, user_ids;
|
||||
user_ids = get(o, 'users').mapBy('id');
|
||||
return ref = get(user, 'id'), indexOf.call(user_ids, ref) >= 0;
|
||||
});
|
||||
}),
|
||||
actions: {
|
||||
apply_filters: function() {
|
||||
var base;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import Ember from 'ember'
|
||||
|
||||
export default Ember.Component.extend
|
||||
tagName: 'span'
|
||||
classNames: ['project-instance-action-value-display']
|
||||
eventIO: null
|
||||
project_instance_action: null
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
import Ember from 'ember';
|
||||
|
||||
export default Ember.Component.extend({
|
||||
tagName: 'span',
|
||||
classNames: ['project-instance-action-value-display'],
|
||||
eventIO: null,
|
||||
project_instance_action: null,
|
||||
|
||||
Reference in New Issue
Block a user