Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
Frontend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Package Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Contributor analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
HUB Terra
SMS
Frontend
Commits
3241f9b3
Verified
Commit
3241f9b3
authored
3 years ago
by
Marc Hanisch
Browse files
Options
Downloads
Plain Diff
Merge branch 'master' into feature-restructure-frontend
parents
c0572597
b63223bc
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!82
Restructure frontend
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
layouts/default.vue
+36
-3
36 additions, 3 deletions
layouts/default.vue
nuxt.config.js
+2
-2
2 additions, 2 deletions
nuxt.config.js
pages/profile.vue
+6
-6
6 additions, 6 deletions
pages/profile.vue
plugins/fullContext.ts
+51
-0
51 additions, 0 deletions
plugins/fullContext.ts
with
95 additions
and
11 deletions
layouts/default.vue
+
36
−
3
View file @
3241f9b3
...
...
@@ -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
>
This diff is collapsed.
Click to expand it.
nuxt.config.js
+
2
−
2
View file @
3241f9b3
...
...
@@ -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
'
],
...
...
This diff is collapsed.
Click to expand it.
pages/profile.vue
+
6
−
6
View file @
3241f9b3
...
...
@@ -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>
...
...
This diff is collapsed.
Click to expand it.
plugins/fullContext.ts
0 → 100644
+
51
−
0
View file @
3241f9b3
/**
* @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
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment