Skip to content

Commit

Permalink
Fix drugis#53: redirect after chooseProblem
Browse files Browse the repository at this point in the history
 - the code that passed workspaceId and scenarioId to the redirect had
   been removed (???)
  • Loading branch information
gertvv committed Apr 29, 2014
1 parent 8e9e663 commit 9136da7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion app-remote/src/main/webapp/WEB-INF/views/index.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
examplesRepository : "examples/",
workspacesRepository : {
service : "RemoteWorkspaces",
url : "workspaces/",
url : "/workspaces/",
_csrf_token : "${_csrf.token}",
_csrf_header : "${_csrf.headerName}"
}
Expand Down
12 changes: 8 additions & 4 deletions app/js/services/remoteWorkspaces.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ define(['mcda/config', 'angular', 'angular-resource', 'underscore'],
}
});

var redirectToDefaultView = function() {
$state.go(Config.defaultView);
var redirectToDefaultView = function(workspaceId, scenarioId) {
$state.go(Config.defaultView, {workspaceId: workspaceId, scenarioId: scenarioId});
};

var decorate = function(workspace) {
Expand All @@ -55,7 +55,11 @@ define(['mcda/config', 'angular', 'angular-resource', 'underscore'],
);

workspace.redirectToDefaultView = function(scenarioId) {
$state.go(Config.defaultView);
if (scenarioId) {
redirectToDefaultView(workspace.id, scenarioId);
} else {
redirectToDefaultView(workspace.id, workspace.defaultScenarioId);
}
};

ScenarioResource.prototype.save = function() {
Expand Down Expand Up @@ -166,4 +170,4 @@ define(['mcda/config', 'angular', 'angular-resource', 'underscore'],
};

return angular.module('elicit.remoteWorkspaces', dependencies).factory('RemoteWorkspaces', Workspaces);
});
});

0 comments on commit 9136da7

Please sign in to comment.