Repository: ambari Updated Branches: refs/heads/trunk 761000633 -> 7d1223232
AMBARI-16972 Strange behavior of Add Version functionality (zhewang) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/7d122323 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/7d122323 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/7d122323 Branch: refs/heads/trunk Commit: 7d1223232221294b692e2ee1ac795c2a5b4e26f6 Parents: 7610006 Author: Zhe (Joe) Wang <[email protected]> Authored: Wed Jun 1 13:01:51 2016 -0700 Committer: Zhe (Joe) Wang <[email protected]> Committed: Wed Jun 1 13:01:51 2016 -0700 ---------------------------------------------------------------------- .../ui/admin-web/app/scripts/services/AddVersionModal.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/7d122323/ambari-admin/src/main/resources/ui/admin-web/app/scripts/services/AddVersionModal.js ---------------------------------------------------------------------- diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/services/AddVersionModal.js b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/services/AddVersionModal.js index 0af7004..1bef0e6 100644 --- a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/services/AddVersionModal.js +++ b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/services/AddVersionModal.js @@ -140,10 +140,17 @@ angular.module('ambariAdminConsole') parentScope.setStackIdActive(stack); } }); + parentScope.allVersions.push(response); angular.forEach(parentScope.allVersions, function(version) { - version.visible = (version.stackNameVersion === response.stackNameVersion); + var isPublicVersionsExist = false; + // If public VDF exists for a stack then default base stack version should be hidden + if (version.stackDefault) { + isPublicVersionsExist = parentScope.allVersions.find(function(_version){ + return (version.stackNameVersion === _version.stackNameVersion && !_version.stackDefault); + }); + } + version.visible = (version.stackNameVersion === response.stackNameVersion) && !isPublicVersionsExist; }); - parentScope.allVersions.push(response); parentScope.activeStackVersion = response; parentScope.selectedPublicRepoVersion = response; parentScope.setVersionSelected(response);
