| 7 | import getCompactVersion from '../utils/get-compact-version'; |
| 8 | |
| 9 | export default class ProjectVersionController extends Controller { |
| 10 | @service |
| 11 | filterData; |
| 12 | |
| 13 | @service |
| 14 | metaStore; |
| 15 | |
| 16 | @service |
| 17 | project; |
| 18 | |
| 19 | @service |
| 20 | prerender; |
| 21 | |
| 22 | @service router; |
| 23 | @service('project') projectService; |
| 24 | |
| 25 | get showPrivateClasses() { |
| 26 | return this.filterData.showPrivateClasses; |
| 27 | } |
| 28 | |
| 29 | get classesIDs() { |
| 30 | return this.getRelationshipIDs('classes'); |
| 31 | } |
| 32 | |
| 33 | get publicClassesIDs() { |
| 34 | return this.getRelationshipIDs('public-classes'); |
| 35 | } |
| 36 | |
| 37 | get namespaceIDs() { |
| 38 | return this.getRelationshipIDs('namespaces'); |
| 39 | } |
| 40 | |
| 41 | get publicNamespaceIDs() { |
| 42 | return this.getRelationshipIDs('public-namespaces'); |
| 43 | } |
| 44 | |
| 45 | get moduleIDs() { |
| 46 | return this.getModuleRelationships(this.model.id, 'modules'); |
| 47 | } |
| 48 | |
| 49 | get publicModuleIDs() { |
| 50 | return this.getModuleRelationships(this.model.id, 'public-modules'); |
| 51 | } |
| 52 | |
| 53 | getModuleRelationships(versionId, moduleType) { |
| 54 | let relations = this.getRelations(moduleType); |
| 55 | // filter overviews out. If other projects add their overview we should filter those too. |
| 56 | return relations |
| 57 | .map((id) => id.substring(versionId.length + 1)) |
| 58 | .filter((id) => id !== 'ember-data-overview'); |
| 59 | } |
| 60 | |
| 61 | getRelations(relationship) { |
| 62 | return this.model.hasMany(relationship).ids().sort(); |
| 63 | } |
| 64 | |
| 65 | getRelationshipIDs(relationship) { |
| 66 | const projectId = this.model.project.id; |
nothing calls this directly
no outgoing calls
no test coverage detected