Commit b3e5798b authored by Jason Song's avatar Jason Song Committed by GitHub

Merge pull request #1723 from lepdou/namespace_view

hidden namespace's body when namespace's size bigger than 2
parents f1ead47e 725dd069
...@@ -214,6 +214,7 @@ ...@@ -214,6 +214,7 @@
pre-delete-item="preDeleteItem" pre-delete-item="preDeleteItem"
show-text="showText" show-text="showText"
show-no-modify-permission-dialog="showNoModifyPermissionDialog" show-no-modify-permission-dialog="showNoModifyPermissionDialog"
show-body="namespaces.length == 1"
pre-create-branch="preCreateBranch" pre-create-branch="preCreateBranch"
pre-delete-branch="preDeleteBranch"> pre-delete-branch="preDeleteBranch">
</apollonspanel> </apollonspanel>
......
...@@ -7,7 +7,6 @@ ...@@ -7,7 +7,6 @@
<link rel="stylesheet" type="text/css" href="vendor/bootstrap/css/bootstrap.min.css"> <link rel="stylesheet" type="text/css" href="vendor/bootstrap/css/bootstrap.min.css">
<link rel="stylesheet" href="vendor/font-awesome.min.css"> <link rel="stylesheet" href="vendor/font-awesome.min.css">
<style type="text/css"> <style type="text/css">
@import url(https://fonts.googleapis.com/css?family=Roboto:400,300,100,700,500);
body { body {
padding-top: 90px; padding-top: 90px;
......
...@@ -129,6 +129,7 @@ function controller($rootScope, $scope, toastr, AppUtil, EventManager, ConfigSer ...@@ -129,6 +129,7 @@ function controller($rootScope, $scope, toastr, AppUtil, EventManager, ConfigSer
$scope.namespaces.forEach(function (namespace, index) { $scope.namespaces.forEach(function (namespace, index) {
if (namespace.baseInfo.namespaceName == result.baseInfo.namespaceName) { if (namespace.baseInfo.namespaceName == result.baseInfo.namespaceName) {
$scope.namespaces[index] = result; $scope.namespaces[index] = result;
$scope.namespaces[index].showNamespaceBody = true;
} }
}); });
......
...@@ -21,7 +21,8 @@ function directive($window, toastr, AppUtil, EventManager, PermissionService, Na ...@@ -21,7 +21,8 @@ function directive($window, toastr, AppUtil, EventManager, PermissionService, Na
showNoModifyPermissionDialog: '=', showNoModifyPermissionDialog: '=',
preCreateBranch: '=', preCreateBranch: '=',
preDeleteBranch: '=', preDeleteBranch: '=',
showMergeAndPublishGrayTips: '=' showMergeAndPublishGrayTips: '=',
showBody: "=?"
}, },
link: function (scope) { link: function (scope) {
...@@ -89,8 +90,9 @@ function directive($window, toastr, AppUtil, EventManager, PermissionService, Na ...@@ -89,8 +90,9 @@ function directive($window, toastr, AppUtil, EventManager, PermissionService, Na
namespace.displayControl = { namespace.displayControl = {
currentOperateBranch: 'master', currentOperateBranch: 'master',
showSearchInput: false, showSearchInput: false,
show: true show: scope.showBody
}; };
scope.showNamespaceBody = namespace.showNamespaceBody ? true : scope.showBody;
namespace.viewItems = namespace.items; namespace.viewItems = namespace.items;
namespace.isPropertiesFormat = namespace.format == 'properties'; namespace.isPropertiesFormat = namespace.format == 'properties';
namespace.isTextEditing = false; namespace.isTextEditing = false;
...@@ -380,10 +382,8 @@ function directive($window, toastr, AppUtil, EventManager, PermissionService, Na ...@@ -380,10 +382,8 @@ function directive($window, toastr, AppUtil, EventManager, PermissionService, Na
function switchBranch(branchName) { function switchBranch(branchName) {
if (branchName != 'master') { if (branchName != 'master') {
scope.namespace.branch.displayControl.show = true;
initRules(scope.namespace.branch); initRules(scope.namespace.branch);
} else { scope.showNamespaceBody = true;
scope.namespace.displayControl.show = true;
} }
scope.namespace.displayControl.currentOperateBranch = branchName; scope.namespace.displayControl.currentOperateBranch = branchName;
......
...@@ -407,9 +407,7 @@ table th { ...@@ -407,9 +407,7 @@ table th {
} }
.namespace-panel .namespace-attribute-public { .namespace-panel .namespace-attribute-public {
background: #31708f; margin-right:5px;
width: 40px;
cursor: pointer;
} }
.namespace-panel .second-panel-heading .nav-tabs { .namespace-panel .second-panel-heading .nav-tabs {
......
...@@ -8,14 +8,8 @@ ...@@ -8,14 +8,8 @@
<span class="cursor-pointer" <span class="cursor-pointer"
data-toggle="collapse" data-target="#BODY{{namespace.branch.id}}" aria-expanded="false" data-toggle="collapse" data-target="#BODY{{namespace.branch.id}}" aria-expanded="false"
ng-click="namespace.branch.displayControl.show = !namespace.branch.displayControl.show"> ng-click="namespace.branch.displayControl.show = !namespace.branch.displayControl.show">
<span class="glyphicon glyphicon-triangle-bottom small"
ng-show="namespace.branch.displayControl.show"></span>
<span class="glyphicon glyphicon-triangle-top small"
ng-show="!namespace.branch.displayControl.show"></span>
<b class="namespace-name" ng-bind="namespace.viewName"
data-tooltip="tooltip" data-placement="bottom" title="点击展开/收缩Namespace"></b>
</span> </span>
<span class="label label-info no-radius namespace-label" ng-bind="namespace.format"></span> <b class="namespace-name" ng-bind="namespace.viewName"></b>
<span class="label label-warning no-radius namespace-label" <span class="label label-warning no-radius namespace-label"
ng-show="namespace.branch.itemModifiedCnt > 0">有修改 ng-show="namespace.branch.itemModifiedCnt > 0">有修改
<span class="badge label badge-white namespace-label" <span class="badge label badge-white namespace-label"
...@@ -52,7 +46,7 @@ ...@@ -52,7 +46,7 @@
</header> </header>
<div id="BODY{{namespace.branch.id}}" class="collapse in"> <div id="BODY{{namespace.branch.id}}" ng-class="{'collapse in': showNamespaceBody, 'collapse' : !showNamespaceBody}">
<div class="J_namespace-release-tip well well-sm no-radius text-center" <div class="J_namespace-release-tip well well-sm no-radius text-center"
ng-show="namespace.isConfigHidden"> ng-show="namespace.isConfigHidden">
<span style="color: red">您不是该项目的管理员,也没有该Namespace的编辑或发布权限,无法查看配置信息。</span> <span style="color: red">您不是该项目的管理员,也没有该Namespace的编辑或发布权限,无法查看配置信息。</span>
......
<header class="row namespace-attribute-panel"> <header class="row namespace-attribute-panel">
<div class="text-center namespace-attribute-public"> <div class="row">
<div class="col-md-6" style="padding-bottom:5px;">
<span class="text-center namespace-attribute-public label label-primary no-radius">
<span data-tooltip="tooltip" data-placement="bottom" <span data-tooltip="tooltip" data-placement="bottom"
title="私有namespace({{namespace.baseInfo.namespaceName}})的配置只能被AppId为{{appId}}的客户端读取到" title="私有namespace({{namespace.baseInfo.namespaceName}})的配置只能被AppId为{{appId}}的客户端读取到"
ng-show="!namespace.isPublic">私有</span> ng-show="!namespace.isPublic">私有</span>
...@@ -12,6 +14,21 @@ ...@@ -12,6 +14,21 @@
title="namespace({{namespace.baseInfo.namespaceName}})的配置将会覆盖公共namespace的配置, 且合并之后的配置只能被AppId为{{appId}}的客户端读取到" title="namespace({{namespace.baseInfo.namespaceName}})的配置将会覆盖公共namespace的配置, 且合并之后的配置只能被AppId为{{appId}}的客户端读取到"
ng-show="namespace.isPublic && namespace.isLinkedNamespace" ng-show="namespace.isPublic && namespace.isLinkedNamespace"
ng-click="goToParentAppConfigPage(namespace)">关联</span> ng-click="goToParentAppConfigPage(namespace)">关联</span>
</span>
<span class="text-center namespace-attribute-public label label-info no-radius">
<span ng-bind="namespace.format" style="width:30px;"></span>
</span>
</div>
<div class="col-md-6 text-right" style="padding-right:23px;">
<span data-toggle="collapse" data-target="#BODY{{namespace.branch.id}}" aria-expanded="false">
<span
class="label no-radius cursor-pointer"
data-toggle="collapse" data-target="#BODY{{namespace.id}}" aria-expanded="false"
ng-click="showNamespaceBody = !showNamespaceBody">
<a ><small>[展开/收缩]</small></a>
</span>
</span>
</div>
</div> </div>
</header> </header>
......
...@@ -7,18 +7,7 @@ ...@@ -7,18 +7,7 @@
<header class="panel-heading"> <header class="panel-heading">
<div class="row"> <div class="row">
<div class="col-md-6 col-sm-6 header-namespace"> <div class="col-md-6 col-sm-6 header-namespace">
<span class="cursor-pointer" <b class="namespace-name" ng-bind="namespace.viewName"></b>
data-toggle="collapse" data-target="#BODY{{namespace.id}}" aria-expanded="false"
ng-click="namespace.displayControl.show = !namespace.displayControl.show">
<span class="glyphicon glyphicon-triangle-bottom small"
ng-show="namespace.displayControl.show"></span>
<span class="glyphicon glyphicon-triangle-top small"
ng-show="!namespace.displayControl.show"></span>
<b class="namespace-name" ng-bind="namespace.viewName"
data-tooltip="tooltip" data-placement="bottom" title="点击展开/收缩Namespace"></b>
</span>
<span class="label label-info no-radius namespace-label" ng-bind="namespace.format"></span>
<span class="label label-warning no-radius namespace-label modify-tip" <span class="label label-warning no-radius namespace-label modify-tip"
ng-show="namespace.itemModifiedCnt > 0"> ng-show="namespace.itemModifiedCnt > 0">
有修改 有修改
...@@ -94,7 +83,7 @@ ...@@ -94,7 +83,7 @@
<div id="BODY{{namespace.id}}" class="collapse in"> <div id="BODY{{namespace.id}}" ng-class="{'collapse in': showNamespaceBody, 'collapse' : !showNamespaceBody}">
<div class="J_namespace-release-tip well well-sm no-radius text-center" <div class="J_namespace-release-tip well well-sm no-radius text-center"
ng-show="namespace.isConfigHidden"> ng-show="namespace.isConfigHidden">
<span style="color: red">您不是该项目的管理员,也没有该Namespace的编辑或发布权限,无法查看配置信息。</span> <span style="color: red">您不是该项目的管理员,也没有该Namespace的编辑或发布权限,无法查看配置信息。</span>
......
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