Skip to content

Commit

Permalink
Merge branch 'features/issue_65_end_users' of https://github.com/Moon…
Browse files Browse the repository at this point in the history
…shine-IDE/Super.Human.Portal into features/issue_65_end_users
  • Loading branch information
JoelProminic committed Nov 15, 2024
2 parents 36123c9 + e96902d commit 234c37c
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 35 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -296,36 +296,43 @@ package classes.managers
{
var tmpArr:Array = [];

var viewEntryCount:int = jsonData.length;

for (var i:int = 0; i < viewEntryCount; i++)
if (jsonData)
{
var bookmark:Object = jsonData[i];
var tmpVO:BookmarkVO = new BookmarkVO(bookmark.group, bookmark.DominoUniversalID, bookmark.name,
bookmark.server, bookmark.database, bookmark.view,
bookmark.type, bookmark.url, bookmark.nomadURL, bookmark.defaultAction, bookmark.description);
var viewEntryCount:int = jsonData.length;

tmpArr.push(tmpVO);
for (var i:int = 0; i < viewEntryCount; i++)
{
var bookmark:Object = jsonData[i];
var tmpVO:BookmarkVO = new BookmarkVO(bookmark.group, bookmark.DominoUniversalID, bookmark.name,
bookmark.server, bookmark.database, bookmark.view,
bookmark.type, bookmark.url, bookmark.nomadURL, bookmark.defaultAction, bookmark.description);

tmpArr.push(tmpVO);
}
}

return tmpArr;
}

public static function parseDatabases(databases:Array):Array
{
var folders:Array = [];
var nonFolders:Array = [];

var viewEntryCount:int = databases.length;

for (var i:int = 0; i < viewEntryCount; i++)
if (databases)
{
var db:Object = databases[i];
var bookmarks:Array = parseCustomBookmarksList(db.bookmarks);
var nonFolders:Array = [];

var viewEntryCount:int = databases.length;

var tmpVO:ServerVO = new ServerVO(db.name, db.type, db.url, db.nomadURL, db.server, db.database,
db.view, db.replicaID, db.hasBookmarks, db.bookmarkCount, bookmarks);
folders.push(tmpVO);
for (var i:int = 0; i < viewEntryCount; i++)
{
var db:Object = databases[i];
var bookmarks:Array = parseCustomBookmarksList(db.bookmarks);

var tmpVO:ServerVO = new ServerVO(db.name, db.type, db.url, db.nomadURL, db.server, db.database,
db.view, db.replicaID, db.hasBookmarks, db.bookmarkCount, bookmarks);
folders.push(tmpVO);
}
}

return folders;
Expand All @@ -340,19 +347,21 @@ package classes.managers
{
var tmpArr:Array = [];

var viewEntryCount:int = jsonData.length;

for (var i:int = 0; i < viewEntryCount; i++)
if (jsonData)
{
var cat:Object = jsonData[i];
var tmpVO:CategoryVO = new CategoryVO(cat.DominoUniversalID, cat.CategoryID, cat.Description,
Number(cat.Order), cat.Label, cat.Icon, cat.Link);
var viewEntryCount:int = jsonData.length;

tmpArr.push(tmpVO);
for (var i:int = 0; i < viewEntryCount; i++)
{
var cat:Object = jsonData[i];
var tmpVO:CategoryVO = new CategoryVO(cat.DominoUniversalID, cat.CategoryID, cat.Description,
Number(cat.Order), cat.Label, cat.Icon, cat.Link);

tmpArr.push(tmpVO);
}

UtilsCore.sortItems(tmpArr, "order", false, true);
}

UtilsCore.sortItems(tmpArr, "order", false, true);

return tmpArr;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,11 @@
this.rootMenu.selectedItem as TopMenuVO;
var itemsOrder:Array = this.model.itemsOrder;
if (!mainSelectedItem && itemsOrder.length == 0)
{
return false;
}
return mainSelectedItem.id != itemsOrder[itemsOrder.length - 1];
}
Expand All @@ -347,6 +352,11 @@
this.rootMenu.selectedItem as TopMenuVO;
var itemsOrder:Array = this.model.itemsOrder;
if (!mainSelectedItem && itemsOrder.length == 0)
{
return false;
}
return mainSelectedItem.id != itemsOrder[1];
}
Expand Down Expand Up @@ -374,7 +384,7 @@
{
currentSelectedItem = this.rootMenu.selectedItem as TopMenuVO;
if (!currentSelectedItem.hasChildren())
if (currentSelectedItem && !currentSelectedItem.hasChildren())
{
var siblings:Array = TopMenuUtils.getSiblings(currentSelectedItem.id, this.model);
this.setRootMenuItems(siblings);
Expand Down Expand Up @@ -427,7 +437,8 @@
}
else
{
var subMenuChildren:Array = TopMenuUtils.getChildren(currentSelectedItem.id, this.model);
var targetId:String = currentSelectedItem ? currentSelectedItem.id : null;
var subMenuChildren:Array = TopMenuUtils.getChildren(targetId, this.model);
this.setSubMenuItems(subMenuChildren);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ package controller.roles.executeRoles
var bookmark:Bookmark = bookmarksMediator.view.bookmarksList.getElementAt(i) as Bookmark;
if (bookmark)
{
bookmark.editable = hasAdminRole;
bookmark.editable = hasAdminRole && loginProxy.user.display.manageBookmarks;
}
}

bookmarksMediator.view.addBookmark["visible"] = hasAdminRole;
bookmarksMediator.view.addBookmark["visible"] = hasAdminRole && loginProxy.user.display.manageBookmarks;
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,21 @@ package mediator.bookmarks
private function onTopMenuItemChange(event:TopMenuEvent):void
{
this.view.breadcrump.model = this.view.topMenu.model;

this.view.breadcrump.buildBreadcrump(event.subItem ? event.subItem : event.item);
view.selectedItem = event.subItem ? event.subItem.data : event.item.data;

if (event.subItem)
{
view.selectedItem = event.subItem.data;
}
else if (event.item)
{
view.selectedItem = event.item.data;
}
else
{
view.selectedItem = null;
}

this.refreshButtonLinks();
this.refreshCurrentState(event.item, event.subItem);
Expand Down Expand Up @@ -179,7 +191,6 @@ package mediator.bookmarks

private function refreshButtonLinks():void
{

if (view.selectedItem)
{
view.openClient.html = "<a target='_blank' href='" + view.selectedItem.url + "'>Open in Client</a>";
Expand Down

0 comments on commit 234c37c

Please sign in to comment.