Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
apollo
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
openSource
apollo
Commits
5d404bd9
Commit
5d404bd9
authored
Jul 08, 2016
by
lepdou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bugfix when add item value is null
parent
8bc7b70f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
11 deletions
+21
-11
NamespaceService.java
...rip/framework/apollo/portal/service/NamespaceService.java
+17
-8
ConfigNamespaceController.js
...ic/scripts/controller/config/ConfigNamespaceController.js
+4
-3
No files found.
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/service/NamespaceService.java
View file @
5d404bd9
...
...
@@ -8,6 +8,7 @@ import com.ctrip.framework.apollo.common.utils.ExceptionUtils;
import
com.ctrip.framework.apollo.core.dto.ItemDTO
;
import
com.ctrip.framework.apollo.core.dto.NamespaceDTO
;
import
com.ctrip.framework.apollo.core.dto.ReleaseDTO
;
import
com.ctrip.framework.apollo.core.enums.ConfigFileFormat
;
import
com.ctrip.framework.apollo.core.enums.Env
;
import
com.ctrip.framework.apollo.core.utils.StringUtils
;
import
com.ctrip.framework.apollo.portal.api.AdminServiceAPI
;
...
...
@@ -93,14 +94,7 @@ public class NamespaceService {
NamespaceVO
namespaceVO
=
new
NamespaceVO
();
namespaceVO
.
setNamespace
(
namespace
);
//先从当前appId下面找,包含私有的和公共的
AppNamespace
appNamespace
=
appNamespaceService
.
findByAppIdAndName
(
appId
,
namespace
.
getNamespaceName
());
//再从公共的app namespace里面找
if
(
appNamespace
==
null
)
{
appNamespace
=
appNamespaceService
.
findPublicAppNamespace
(
namespace
.
getNamespaceName
());
}
namespaceVO
.
setFormat
(
appNamespace
.
getFormat
());
namespaceVO
.
setFormat
(
getNamespaceFormat
(
namespace
));
List
<
NamespaceVO
.
ItemVO
>
itemVos
=
new
LinkedList
<>();
namespaceVO
.
setItems
(
itemVos
);
...
...
@@ -145,6 +139,21 @@ public class NamespaceService {
return
namespaceVO
;
}
private
String
getNamespaceFormat
(
NamespaceDTO
namespace
){
//先从当前appId下面找,包含私有的和公共的
AppNamespace
appNamespace
=
appNamespaceService
.
findByAppIdAndName
(
namespace
.
getAppId
(),
namespace
.
getNamespaceName
());
//再从公共的app namespace里面找
if
(
appNamespace
==
null
)
{
appNamespace
=
appNamespaceService
.
findPublicAppNamespace
(
namespace
.
getNamespaceName
());
}
if
(
appNamespace
==
null
){
return
ConfigFileFormat
.
Properties
.
getValue
();
}
else
{
return
appNamespace
.
getFormat
();
}
}
private
List
<
NamespaceVO
.
ItemVO
>
countDeletedItemNum
(
List
<
ItemDTO
>
newItems
,
Map
<
String
,
String
>
releaseItems
)
{
Map
<
String
,
ItemDTO
>
newItemMap
=
BeanUtils
.
mapByKey
(
"key"
,
newItems
);
...
...
apollo-portal/src/main/resources/static/scripts/controller/config/ConfigNamespaceController.js
View file @
5d404bd9
...
...
@@ -220,6 +220,9 @@ application_module.controller("ConfigNamespaceController",
if
(
selectedClusters
.
length
==
0
)
{
toastr
.
error
(
"请选择集群"
);
}
else
{
if
(
!
$scope
.
item
.
value
)
{
$scope
.
item
.
value
=
""
;
}
selectedClusters
.
forEach
(
function
(
cluster
)
{
if
(
$scope
.
tableViewOperType
==
TABLE_VIEW_OPER_TYPE
.
CREATE
)
{
...
...
@@ -238,9 +241,7 @@ application_module.controller("ConfigNamespaceController",
});
}
else
if
(
$scope
.
tableViewOperType
==
TABLE_VIEW_OPER_TYPE
.
UPDATE
)
{
if
(
!
$scope
.
item
.
value
)
{
$scope
.
item
.
value
=
""
;
}
if
(
!
$scope
.
item
.
comment
)
{
$scope
.
item
.
comment
=
""
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment