Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

chore(docs): get rid of stable/unstable distinction in version selector #10053

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 1 addition & 12 deletions docs/app/src/versions.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,9 @@ angular.module('versions', [])

.controller('DocsVersionsCtrl', ['$scope', '$location', '$window', 'NG_VERSIONS', function($scope, $location, $window, NG_VERSIONS) {
$scope.docs_version = NG_VERSIONS[0];

for(var i=0, minor = NaN; i < NG_VERSIONS.length; i++) {
var version = NG_VERSIONS[i];
// NaN will give false here
if (minor <= version.minor) {
continue;
}
version.isLatest = true;
minor = version.minor;
}

$scope.docs_versions = NG_VERSIONS;
$scope.getGroupName = function(v) {
return v.isLatest ? 'Latest' : (v.isStable ? 'Stable' : 'Unstable');
return 'v' + v.major + '.' + v.minor + '.x';
};

$scope.jumpToDocsVersion = function(version) {
Expand Down
11 changes: 0 additions & 11 deletions lib/versions/version-info.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,15 +91,6 @@ var getTaggedVersion = function() {
return null;
};

/**
* Stable versions have an even minor version and have no prerelease
* @param {SemVer} version The version to test
* @return {Boolean} True if the version is stable
*/
var isStable = function(version) {
return semver.satisfies(version, '1.0 || 1.2') && version.prerelease.length === 0;
};

/**
* Get a collection of all the previous versions sorted by semantic version
* @return {Array.<SemVer>} The collection of previous versions
Expand All @@ -119,8 +110,6 @@ var getPreviousVersions = function() {
})
.filter()
.map(function(version) {
version.isStable = isStable(version);

version.docsUrl = 'http://code.angularjs.org/' + version.version + '/docs';
// Versions before 1.0.2 had a different docs folder name
if ( version.major < 1 || (version.major === 1 && version.minor === 0 && version.dot < 2 ) ) {
Expand Down