@@ -34,12 +34,7 @@ var ProjectController = Cattle.TransitioningResourceController.extend({
3434 } ,
3535
3636 setAsDefault : function ( ) {
37- var headers = { } ;
38- headers [ C . HEADER . PROJECT ] = C . HEADER . PROJECT_USER_SCOPE ;
39-
40- return this . doAction ( 'setasdefault' , undefined , headers ) . then ( ( ) => {
41- this . get ( 'session' ) . set ( C . SESSION . PROJECT_DEFAULT , this . get ( 'id' ) ) ;
42- } ) ;
37+ this . get ( 'prefs' ) . set ( C . PREFS . PROJECT_DEFAULT , this . get ( 'id' ) ) ;
4338 } ,
4439
4540 switchTo : function ( ) {
@@ -67,8 +62,8 @@ var ProjectController = Cattle.TransitioningResourceController.extend({
6762 } . property ( 'active' , 'isDefault' ) ,
6863
6964 isDefault : function ( ) {
70- return this . get ( 'session .' + C . SESSION . PROJECT_DEFAULT ) === this . get ( 'id' ) ;
71- } . property ( 'session .' + C . SESSION . PROJECT_DEFAULT , 'id' ) ,
65+ return this . get ( 'prefs .' + C . PREFS . PROJECT_DEFAULT ) === this . get ( 'id' ) ;
66+ } . property ( 'prefs .' + C . PREFS . PROJECT_DEFAULT , 'id' ) ,
7267
7368 active : function ( ) {
7469 return this . get ( 'session.' + C . SESSION . PROJECT ) === this . get ( 'id' ) ;
@@ -79,8 +74,8 @@ var ProjectController = Cattle.TransitioningResourceController.extend({
7974 } . property ( 'state' , 'actions.remove' ) ,
8075
8176 canSetDefault : function ( ) {
82- return this . get ( 'state' ) === 'active' && this . hasAction ( 'setasdefault' ) && ! this . get ( 'isDefault' ) ;
83- } . property ( 'state' , 'actions.setasdefault' , ' isDefault') ,
77+ return this . get ( 'state' ) === 'active' && ! this . get ( 'isDefault' ) ;
78+ } . property ( 'state' , 'isDefault' ) ,
8479
8580 availableActions : function ( ) {
8681 var a = this . get ( 'actions' ) ;
@@ -96,11 +91,7 @@ var ProjectController = Cattle.TransitioningResourceController.extend({
9691 ] ;
9792
9893 choices . pushObject ( { label : 'Switch to this Project' , icon : '' , action : 'switchTo' , enabled : this . get ( 'state' ) === 'active' } ) ;
99-
100- if ( this . get ( 'app.authenticationEnabled' ) )
101- {
102- choices . pushObject ( { label : 'Set as my default Project' , icon : '' , action : 'setAsDefault' , enabled : this . get ( 'canSetDefault' ) } ) ;
103- }
94+ choices . pushObject ( { label : 'Set as my default Project' , icon : '' , action : 'setAsDefault' , enabled : this . get ( 'canSetDefault' ) } ) ;
10495
10596 return choices ;
10697 } . property ( 'actions.{activate,deactivate,update,restore,purge}' , 'canRemove' , 'canSetDefault' ) ,
0 commit comments