forked from openshift/origin-web-console
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcreateProject.js
31 lines (28 loc) · 941 Bytes
/
createProject.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
'use strict';
/**
* @ngdoc function
* @name openshiftConsole.controller:CreateProjectController
* @description
* # CreateProjectController
* Controller of the openshiftConsole
*/
angular.module('openshiftConsole')
.controller('CreateProjectController',
function($scope,
$location,
$window,
AuthService,
Constants) {
var landingPageEnabled = !Constants.DISABLE_SERVICE_CATALOG_LANDING_PAGE;
$scope.onProjectCreated = function(encodedProjectName) {
if (landingPageEnabled) {
// If the new experience is enabled, return to project list.
$window.history.back();
} else {
// If the next experience is not enabled, go to the catalog.
$location.path("project/" + encodedProjectName + "/create");
}
};
// Make sure we're logged in.
AuthService.withUser();
});