Skip to content
Snippets Groups Projects
Verified Commit 3241f9b3 authored by Marc Hanisch's avatar Marc Hanisch
Browse files

Merge branch 'master' into feature-restructure-frontend

parents c0572597 b63223bc
No related branches found
No related tags found
1 merge request!82Restructure frontend
......@@ -251,6 +251,15 @@ export default {
}
},
computed: {
browserTitle () {
if (this.title === this.appBarTitle) {
return this.title
}
if (!this.appBarTitle) {
return this.title
}
return this.title + ' - ' + this.appBarTitle
},
error () {
return this.$store.state.snackbar.error
},
......@@ -325,17 +334,41 @@ export default {
this.$store.commit('appbar/setActiveTab', tab)
},
login () {
this.loginPopup().then((redirectPath) => {
this.$router.push(redirectPath)
this.loginPopup().then((_redirectPath) => {
/*
The redirect path is normally just a path to '/'.
However - as we are now logged in we are fine that
the user still can access the current page.
So we will not do the redirect.
In case you want to re-introduce this redirect, you
can use the following snippet:
```javascript
this.$router.push(redirectPath)
```
*/
}).catch((_err) => {
this.$store.commit('snackbar/setError', 'Login failed')
})
},
logout () {
this.removeOidcUser().then(() => {
this.$router.push('/')
// same logic as in the vuex-oidc-router.js middleware
// but don't display an error message
const accessPromise = this.$store.dispatch('oidc/oidcCheckAccess', this.$fullContext.route)
accessPromise.then((hasAccess) => {
if (!hasAccess) {
this.$router.push('/')
}
})
})
}
},
head () {
return {
title: this.browserTitle
}
}
}
</script>
......@@ -66,8 +66,7 @@ export default {
** Headers of the page
*/
head: {
titleTemplate: '%s - ' + process.env.npm_package_name,
title: process.env.npm_package_name || '',
title: 'Sensor Management System',
meta: [
{ charset: 'utf-8' },
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
......@@ -90,6 +89,7 @@ export default {
** Plugins to load before mounting the App
*/
plugins: [
'~/plugins/fullContext.ts',
'~/plugins/api.ts',
'~/plugins/filters.ts'
],
......
......@@ -41,11 +41,11 @@ permissions and limitations under the Licence.
Personal info
</v-col>
<v-col align-self="end" class="text-right">
<b-btn icon @click.stop.prevent="togglePersonalSection">
<v-btn icon @click.stop.prevent="togglePersonalSection">
<v-icon>
{{ isPersonalSectionVisible ? 'mdi-chevron-up' : 'mdi-chevron-down' }}
</v-icon>
</b-btn>
</v-btn>
</v-col>
</v-row>
</v-card-text>
......@@ -104,11 +104,11 @@ permissions and limitations under the Licence.
OpenID Connect
</v-col>
<v-col align-self="end" class="text-right">
<b-btn icon @click.stop.prevent="toggleOpenIdConnectSection">
<v-btn icon @click.stop.prevent="toggleOpenIdConnectSection">
<v-icon>
{{ isOpenIdConnectSectionVisible ? 'mdi-chevron-up' : 'mdi-chevron-down' }}
</v-icon>
</b-btn>
</v-btn>
</v-col>
</v-row>
</v-card-text>
......@@ -134,11 +134,11 @@ permissions and limitations under the Licence.
Token
</v-col>
<v-col align-self="end" class="text-right">
<b-btn icon @click.stop.prevent="toggleTokenSection">
<v-btn icon @click.stop.prevent="toggleTokenSection">
<v-icon>
{{ isTokenSectionVisible ? 'mdi-chevron-up' : 'mdi-chevron-down' }}
</v-icon>
</b-btn>
</v-btn>
</v-col>
</v-row>
</v-card-text>
......
/**
* @license
* Web client of the Sensor Management System software developed within
* the Helmholtz DataHub Initiative by GFZ and UFZ.
*
* Copyright (C) 2020, 2021
* - Nils Brinckmann (GFZ, nils.brinckmann@gfz-potsdam.de)
* - Marc Hanisch (GFZ, marc.hanisch@gfz-potsdam.de)
* - Helmholtz Centre Potsdam - GFZ German Research Centre for
* Geosciences (GFZ, https://www.gfz-potsdam.de)
*
* Parts of this program were developed within the context of the
* following publicly funded projects or measures:
* - Helmholtz Earth and Environment DataHub
* (https://www.helmholtz.de/en/research/earth_and_environment/initiatives/#h51095)
*
* Licensed under the HEESIL, Version 1.0 or - as soon they will be
* approved by the "Community" - subsequent versions of the HEESIL
* (the "Licence").
*
* You may not use this work except in compliance with the Licence.
*
* You may obtain a copy of the Licence at:
* https://gitext.gfz-potsdam.de/software/heesil
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the Licence is distributed on an "AS IS" basis,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
* implied. See the Licence for the specific language governing
* permissions and limitations under the Licence.
*/
import { Plugin, Context } from '@nuxt/types'
declare module 'vue/types/vue' {
interface Vue {
$fullContext: Context
}
}
declare module '@nuxt/types' {
interface NuxtAppOptions {
$fullContext: Context
}
}
const fullContextPlugin: Plugin = (context: Context, inject) => {
inject('fullContext', context)
}
export default fullContextPlugin
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment