|
|
@@ -2,6 +2,7 @@ import { h, Component } from 'preact'; |
|
|
|
import { Router, route } from 'preact-router';
|
|
|
|
import WBBrowse from 'wb-browse';
|
|
|
|
import WBSignIn from 'wb-sign-in';
|
|
|
|
import WBSignOut from 'wb-sign-out';
|
|
|
|
import WBLandingPage from 'wb-landing-page';
|
|
|
|
import WBProcessView from 'wb-process-view';
|
|
|
|
import WBCollectionView from 'wb-collection-view';
|
|
|
@@ -16,24 +17,13 @@ class WBApp extends Component { |
|
|
|
this.state.arvToken = window.localStorage['arvToken'];
|
|
|
|
if ('currentUser' in window.localStorage)
|
|
|
|
this.state.currentUser = JSON.parse(window.localStorage['currentUser']);
|
|
|
|
this.appCallbacks = {
|
|
|
|
'navbarItemClicked': item => this.navbarItemClicked(item)
|
|
|
|
};
|
|
|
|
this.appState = {
|
|
|
|
'arvHost': this.state.arvHost,
|
|
|
|
'arvToken': this.state.arvToken,
|
|
|
|
'currentUser': this.state.currentUser
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
navbarItemUrl(item) {
|
|
|
|
if (item['id'] === 'sign-out') {
|
|
|
|
delete window.localStorage['arvHost'];
|
|
|
|
delete window.localStorage['arvToken'];
|
|
|
|
delete window.localStorage['currentUser'];
|
|
|
|
return ('/sign-in');
|
|
|
|
return ('/sign-out');
|
|
|
|
} else if (item['id'] === 'home') {
|
|
|
|
return ('/browse/' + this.appState.currentUser.uuid);
|
|
|
|
return ('/browse/' + this.state.currentUser.uuid);
|
|
|
|
} else if (item['id'] === 'all-projects') {
|
|
|
|
return ('/browse');
|
|
|
|
} else if (item['id'] === 'all-users') {
|
|
|
@@ -56,11 +46,12 @@ class WBApp extends Component { |
|
|
|
<Router>
|
|
|
|
<WBLandingPage path="/" />
|
|
|
|
|
|
|
|
<WBSignIn path="/sign-in" appState={ this.appState } />
|
|
|
|
<WBSignIn path="/sign-in" appState={ this.state } />
|
|
|
|
|
|
|
|
<WBSignOut path='/sign-out' />
|
|
|
|
|
|
|
|
<WBBrowse path="/browse/:ownerUuid?/:activePage?/:objTypeTab?/:collectionPage?/:processPage?/:workflowPage?"
|
|
|
|
appCallbacks={ this.appCallbacks }
|
|
|
|
appState={ this.appState }
|
|
|
|
appState={ this.state }
|
|
|
|
app={ this } />
|
|
|
|
|
|
|
|
<WBProcessView path="/process/:uuid" app={ this } />
|
|
|
|