Skip to content
Snippets Groups Projects
Commit 5a58c873 authored by juanf's avatar juanf
Browse files

SSDM-616: Add ability to create Projects in the ELN (Refresh menu)

SVN: 32114
parent d9950e66
No related branches found
No related tags found
No related merge requests found
...@@ -33,6 +33,18 @@ function SideMenuWidget(mainController, containerId, serverFacade) { ...@@ -33,6 +33,18 @@ function SideMenuWidget(mainController, containerId, serverFacade) {
this._pointerToMenuNode = this._menuStructure; this._pointerToMenuNode = this._menuStructure;
this.isHidden = false; this.isHidden = false;
this.refreshProject = function(spaceCode, projectCode) {
var menuItemSpace = this._getSpaceNodeForCode(spaceCode);
var newMenuIfSelectedProject = {
children : []
}
var projectIdentifier = "/" + spaceCode + "/" + projectCode;
var menuItemProject = new SideMenuWidgetComponent(true, false, projectCode, menuItemSpace, newMenuIfSelectedProject, "showProjectPageFromIdentifier", projectIdentifier, "(Project)");
menuItemSpace.newMenuIfSelected.children.push(menuItemProject);
this.repaint();
}
this.refreshExperiment = function(projectIdentifierToAskForExperiments) { this.refreshExperiment = function(projectIdentifierToAskForExperiments) {
var _this = this; var _this = this;
...@@ -108,6 +120,19 @@ function SideMenuWidget(mainController, containerId, serverFacade) { ...@@ -108,6 +120,19 @@ function SideMenuWidget(mainController, containerId, serverFacade) {
}); });
} }
this._getSpaceNodeForCode = function(spaceCode) {
for(var sIdx = 0; sIdx < this._menuStructure.newMenuIfSelected.children.length; sIdx++) {
var spaceNode = this._menuStructure.newMenuIfSelected.children[sIdx];
if(spaceNode.isTitle && !spaceNode.isSelectable) {
continue;
}
if(spaceNode.displayName === spaceCode) {
return spaceNode;
}
}
return null;
}
this._getProjectNodeForCode = function(projectCode) { this._getProjectNodeForCode = function(projectCode) {
for(var sIdx = 0; sIdx < this._menuStructure.newMenuIfSelected.children.length; sIdx++) { for(var sIdx = 0; sIdx < this._menuStructure.newMenuIfSelected.children.length; sIdx++) {
var spaceNode = this._menuStructure.newMenuIfSelected.children[sIdx]; var spaceNode = this._menuStructure.newMenuIfSelected.children[sIdx];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment