diff --git a/apollo-portal/src/main/resources/static/scripts/controller/config/ReleaseHistoryController.js b/apollo-portal/src/main/resources/static/scripts/controller/config/ReleaseHistoryController.js index 981d87477fe76c124295399fe1c95c16231c51ad..921bba3b9729abe0ff8362c669e9452014fc1f7f 100644 --- a/apollo-portal/src/main/resources/static/scripts/controller/config/ReleaseHistoryController.js +++ b/apollo-portal/src/main/resources/static/scripts/controller/config/ReleaseHistoryController.js @@ -71,7 +71,10 @@ function releaseHistoryController($scope, $location, AppUtil, if ($scope.pageContext.releaseHistoryId == history.id) { defaultToShowReleaseHistory = history; } else if ($scope.pageContext.releaseId == history.releaseId) { - history.viewType = CONFIG_VIEW_TYPE.ALL; + // text namespace doesn't support ALL view + if (!$scope.isTextNamespace) { + history.viewType = CONFIG_VIEW_TYPE.ALL; + } defaultToShowReleaseHistory = history; } }); @@ -93,6 +96,9 @@ function releaseHistoryController($scope, $location, AppUtil, $scope.pageContext.namespaceName) .then(function (result) { $scope.isTextNamespace = result.format != "properties"; + if ($scope.isTextNamespace) { + fixTextNamespaceViewType(); + } }) } @@ -107,6 +113,15 @@ function releaseHistoryController($scope, $location, AppUtil, } + function fixTextNamespaceViewType() { + $scope.releaseHistories.forEach(function (history) { + // text namespace doesn't support ALL view + if (history.viewType == CONFIG_VIEW_TYPE.ALL) { + switchConfigViewType(history, CONFIG_VIEW_TYPE.DIFF); + } + }); + } + function switchConfigViewType(history, viewType) { history.viewType = viewType;