get groupsWithProjects() { const groupedProjects = groupBy(self.filteredProjects, p => (p.group ? p.group.id : 'other')); return compact( [...self.filteredGroups].map(group => { if (!group) { return null; } return { ...group, projects: groupedProjects[group.id] || [] }; }) ); }
/** * Check if action matches any of user roles action * * @param name Name of the action * @param params Params of the action * * @return {boolean} */ async can (name, params) { const routeAction = { name, ...params } // Transform imperium stored roles object into an array with only matching action const roles = compact(map(this.imperium._roles, ({ process, actions }, role) => { const action = find(actions, { name }) if (!action) return null return { role, action, process } })) for (const role of roles) { /* istanbul ignore else */ if (await this._roleMatchRouteAction(role, routeAction)) return true } return false }
language: language, oldSource: oldSource, enhancers: compact(enhancers) };
let mutations = compact(flatten( definitions.map((definition) => Array.from(definition.getMutations( mutationContext)))));
}, this); dataset = compact(dataset);