提交 a89ad717 编写于 作者: N nobodyiam

fix text namespace diff view when releaseId is provided in url

上级 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) {
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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册