Commit a89ad717 by nobodyiam

fix text namespace diff view when releaseId is provided in url

parent deb492eb
......@@ -71,7 +71,10 @@ function releaseHistoryController($scope, $location, AppUtil,
if ($scope.pageContext.releaseHistoryId == history.id) {
defaultToShowReleaseHistory = history;
} else if ($scope.pageContext.releaseId == history.releaseId) {
// 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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment