diff --git a/notes.md b/notes.md index ff3d4d1..f70e0c2 100644 --- a/notes.md +++ b/notes.md @@ -11,9 +11,11 @@ - Update files to import when deploying for included json files instead of secret.json files +- Also remove /test/ routes - Fix text field overflow (text too big for box) - Other optimization for seat plan editor +- Fix diagonal stand component - FUTURE: Implement Permission system diff --git a/src/server/app.js b/src/server/app.js index 05c9aa5..c02bc6d 100644 --- a/src/server/app.js +++ b/src/server/app.js @@ -52,17 +52,19 @@ const settings = JSON.parse( fs.readFileSync( path.join( __dirname + '/config/se // Vue SSR and gets its support files (e.g. CSS and JS files) from // the /home/supportFiles/:file route plus its assets from the /otherAssets/:file // route). -if ( settings.init ) { +if ( settings.setupDone ) { app.get( '/', ( req, res ) => { res.sendFile( path.join( __dirname + '/ui/home/active/en/index.html' ) ); } ); } +// TODO: If no init, initialize DB. + // Set up static routes for static file serving (performance wise not // that good, but way easier to set up) console.log( '[ Server ] Setting up static routes' ); -if ( settings.init ) { +if ( settings.setupDone ) { app.use( express.static( 'webapp/main/dist' ) ); } else { app.use( express.static( 'webapp/setup/dist' ) ); @@ -86,7 +88,7 @@ app.use( cookieParser() ); let file = path.join( __dirname + '/webapp/main/dist/index.html' ); console.log( '[ Server ] loading backend components' ); -if ( settings.init ) { +if ( settings.setupDone ) { require( './backend/helperRoutes.js' )( app, settings ); // Helper routes require( './admin/adminRoutes.js' )( app, settings ); // admin routes require( './admin/adminAPIRoutes.js' )( app, settings ); // admin api routes diff --git a/src/server/backend/userRoutes.js b/src/server/backend/userRoutes.js index 550b4ae..a1c1e40 100644 --- a/src/server/backend/userRoutes.js +++ b/src/server/backend/userRoutes.js @@ -28,7 +28,7 @@ module.exports = ( app, settings ) => { if ( data[ 0 ] ) { let dat = {}; for ( let element in data[ 0 ] ) { - if ( element === 'pass' ) { + if ( element !== 'pass' ) { dat[ element ] = data[ 0 ][ element ]; } } diff --git a/src/server/config/settings.config.json b/src/server/config/settings.config.json index d5cfc2c..248086c 100644 --- a/src/server/config/settings.config.json +++ b/src/server/config/settings.config.json @@ -1 +1,17 @@ -{"init":false,"twoFA":"enforce","setupKey":"hello world","twoFAMode":"enhanced","db":"json","payments":"stripe","name":"libreevent","yourDomain":"http://localhost:8080","mailSender":"libreevent ","maxTickets":10,"currency":"CHF","gcInterval":300,"ticketTimeout":900,"startPage":"default","version":"1.0.0"} \ No newline at end of file +{ + "init":false, + "setupDone": true, + "twoFA":"enforce", + "twoFAMode":"enhanced", + "db":"json", + "payments":"stripe", + "name":"libreevent", + "yourDomain":"http://localhost:8080", + "mailSender":"libreevent ", + "maxTickets":10, + "currency":"CHF", + "gcInterval":300, + "ticketTimeout":900, + "startPage":"default", + "version":"1.0.0" +} \ No newline at end of file diff --git a/src/webapp/main/src/views/user/AccountView.vue b/src/webapp/main/src/views/user/AccountView.vue index ba97bc8..379a841 100644 --- a/src/webapp/main/src/views/user/AccountView.vue +++ b/src/webapp/main/src/views/user/AccountView.vue @@ -11,7 +11,16 @@ {{ accountData.email }} + + + Name + + + {{ accountData.first_name }} {{ accountData.name }} + + + @@ -44,7 +53,7 @@ ...mapStores( useUserStore ) }, created () { - // TODO: Also get all orders of user (using join functions) + // TODO: FUTURE Also get all orders of user (using join functions) fetch( localStorage.getItem( 'url' ) + '/user/details' ).then( res => { if ( res.status === 200 ) { res.json().then( data => { diff --git a/src/webapp/setup/src/views/SetupRootView.vue b/src/webapp/setup/src/views/SetupRootView.vue index 13bc59d..78f6d3c 100644 --- a/src/webapp/setup/src/views/SetupRootView.vue +++ b/src/webapp/setup/src/views/SetupRootView.vue @@ -169,6 +169,7 @@ } }, proceed () { + // TODO: Perform checks this.backendStore.addVisitedSetupPages( 'complete', true ); this.$router.push( 'complete' ); }