@@ -75,12 +75,15 @@ function StackMenuCtrl($scope) {
7575
7676function LoginCtrl ( $scope , flash , AccountService , LoginService , ServerErrorResponse , Base64 ) {
7777 $scope . currentAccount = angular . copy ( AccountService . getAccount ( ) ) ;
78+ $scope . loggedIn = false ;
7879 if ( $scope . currentAccount . user != null ) {
7980 LoginService . login ( $scope . currentAccount . user , $scope . currentAccount . pass )
8081 . then ( function ( data ) {
8182 $scope . currentAccount = angular . copy ( AccountService . getAccount ( ) ) ;
83+ $scope . close ( '#modalLogin' ) ;
8284 $scope . login . username = null ;
8385 $scope . login . password = null ;
86+ $scope . loggedIn = true ;
8487 } , function ( response ) {
8588 flash . error = ServerErrorResponse . getMessage ( response . status ) ;
8689 $scope . login . username = null ;
@@ -97,12 +100,17 @@ function LoginCtrl($scope, flash, AccountService, LoginService, ServerErrorRespo
97100 LoginService . login ( Base64 . encode ( $scope . login . username ) , Base64 . encode ( $scope . login . password ) )
98101 . then ( function ( data ) {
99102 $scope . currentAccount = angular . copy ( AccountService . getAccount ( ) ) ;
103+ $scope . close ( '#modalLogin' ) ;
100104 $scope . login . username = null ;
101105 $scope . login . password = null ;
106+ if ( $scope . currentAccount . user != null ) {
107+ $scope . loggedIn = true ;
108+ }
102109 } , function ( response ) {
103110 flash . error = ServerErrorResponse . getMessage ( response . status ) ;
104111 $scope . login . username = null ;
105112 $scope . login . password = null ;
113+ $scope . loggedIn = false ;
106114 } ) ;
107115 } ;
108116
@@ -117,6 +125,7 @@ function LoginCtrl($scope, flash, AccountService, LoginService, ServerErrorRespo
117125 LoginService . logout ( )
118126 . then ( function ( data ) {
119127 $scope . currentAccount = angular . copy ( AccountService . getAccount ( ) ) ;
128+ $scope . loggedIn = false ;
120129 } ) ;
121130 } ;
122131
@@ -316,34 +325,30 @@ app.controller('VirtuosoCtrl', function($scope, ConfigurationService, AccountSer
316325*
317326***************************************************************************************************/
318327
319- app . controller ( 'FaceteFormCtrl' , function ( $scope , ConfigurationService , GraphService ) {
328+ app . controller ( 'FaceteFormCtrl' , function ( $scope , ConfigurationService , GraphService , AccountService ) {
320329 //Settings for Facete
321330
322331 $scope . namedGraphs = [ ] ;
323332 $scope . component = ConfigurationService . getComponent ( ":Facete" ) ;
324333 var services = ConfigurationService . getComponentServices ( ":Facete" ) ;
325- $scope . facete = {
326- service : ConfigurationService . getSPARQLEndpoint ( ) ,
327- dataset : "" ,
328- } ;
329334
330335 $scope . refreshGraphList = function ( ) {
331336 GraphService . getAccessibleGraphs ( false , false , true ) . then ( function ( graphs ) {
332337 $scope . namedGraphs = graphs ;
333- $scope . facete . dataset = $scope . namedGraphs [ 0 ] ;
338+ $scope . facete = {
339+ service : ConfigurationService . getSPARQLEndpoint ( ) ,
340+ dataset : $scope . namedGraphs [ 0 ] . name ,
341+ } ;
334342 } ) ;
335343 } ;
336344
337345 $scope . refreshGraphList ( ) ;
338-
339346 $scope . url = "" ;
340347
341348 $scope . setUrl = function ( ) {
342349 $scope . url = services [ 0 ] . serviceUrl +
343350 '?service-uri=' + $scope . facete . service +
344- '&default-graph-uri=' + $scope . facete . dataset . replace ( ':' , ConfigurationService . getUriBase ( ) ) ;
345-
346-
351+ '&default-graph-uri=' + $scope . facete . dataset . name . replace ( ':' , ConfigurationService . getUriBase ( ) ) ;
347352 } ;
348353
349354 $scope . $watch ( function ( ) { return AccountService . getUsername ( ) ; } , function ( ) {
0 commit comments