Commit c8ed6bd6 by lepdou

UI handle public namespace not exist situation

parent 7e4f6bcc
...@@ -222,7 +222,7 @@ function directive($window, toastr, AppUtil, EventManager, PermissionService, Na ...@@ -222,7 +222,7 @@ function directive($window, toastr, AppUtil, EventManager, PermissionService, Na
} }
function initLinkedNamespace(namespace) { function initLinkedNamespace(namespace) {
if (!namespace.isPublic || !namespace.isLinkedNamespace) { if (!namespace.isPublic || !namespace.isLinkedNamespace || namespace.format != 'properties') {
return; return;
} }
//load public namespace //load public namespace
...@@ -237,12 +237,11 @@ function directive($window, toastr, AppUtil, EventManager, PermissionService, Na ...@@ -237,12 +237,11 @@ function directive($window, toastr, AppUtil, EventManager, PermissionService, Na
linkNamespaceItemKeys.push(key); linkNamespaceItemKeys.push(key);
}); });
publicNamespace.viewItems = []; publicNamespace.viewItems = [];
publicNamespace.items.forEach(function (item) { publicNamespace.items.forEach(function (item) {
var key = item.item.key; var key = item.item.key;
if (key){ if (key) {
publicNamespace.viewItems.push(item); publicNamespace.viewItems.push(item);
} }
...@@ -250,7 +249,7 @@ function directive($window, toastr, AppUtil, EventManager, PermissionService, Na ...@@ -250,7 +249,7 @@ function directive($window, toastr, AppUtil, EventManager, PermissionService, Na
if (item.isModified || item.isDeleted) { if (item.isModified || item.isDeleted) {
publicNamespace.isModified = true; publicNamespace.isModified = true;
} else if (key){ } else if (key) {
publicNamespace.hasPublishedItem = true; publicNamespace.hasPublishedItem = true;
} }
}); });
......
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