forked from ember-learn/ember-api-docs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "Handle /release requests (ember-learn#209)"
This reverts commit ffd2eb5.
- Loading branch information
1 parent
ffd2eb5
commit f4d64da
Showing
15 changed files
with
46 additions
and
162 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,9 @@ | ||
import DS from 'ember-data'; | ||
import Ember from 'ember'; | ||
import semverCompare from 'npm:semver-compare'; | ||
import getMinorVersion from "../utils/get-minor-version"; | ||
import _ from 'lodash'; | ||
import config from 'ember-api-docs/config/environment'; | ||
|
||
|
||
const {Model, attr, hasMany} = DS; | ||
const {computed,A} = Ember; | ||
|
||
export default Model.extend({ | ||
name: attr(), | ||
githubUrl: attr(), | ||
projectVersions: hasMany('project-version', {async: true}), | ||
|
||
latestProjectVersion: computed.alias('sortedProjectVersions.firstObject'), | ||
sortedProjectVersions: computed(function() { | ||
let projectVersions = this.hasMany('projectVersions').ids().map(id => { | ||
return id.replace(this.id, '').split('-')[1]; | ||
}); | ||
let sortedVersions = projectVersions.sort((a, b) => semverCompare(b, a)); | ||
sortedVersions = sortedVersions.map((version) => { | ||
const minorVersion = getMinorVersion(version); | ||
return { id: version, minorVersion }; | ||
}); | ||
|
||
let groupedVersions = _.groupBy(sortedVersions, version => version.minorVersion); | ||
|
||
return A(_.values(groupedVersions).map(groupedVersion => groupedVersion[0])); | ||
}), | ||
|
||
getProjectVersion(version) { | ||
if (version === 'release') { | ||
return this.get('latestProjectVersion.id'); | ||
} | ||
if (version === 'lts') { | ||
return config.ltsVersion; | ||
} | ||
return version; | ||
} | ||
|
||
projectVersions: hasMany('project-version', {async: true}) | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.