Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
Onegeo LogIn
Manage
Activity
Members
Plan
Wiki
Redmine
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
OneGeo Suite
Sites
Onegeo LogIn
Commits
8ec33bad
Commit
8ec33bad
authored
2 years ago
by
Florent Lavelle
Committed by
m431m
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Add `forms.signup.disabled` to `config.js`
parent
b0165d20
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
public/config.js
+6
-5
6 additions, 5 deletions
public/config.js
src/router/index.js
+13
-4
13 additions, 4 deletions
src/router/index.js
src/views/SignIn.vue
+1
-0
1 addition, 0 deletions
src/views/SignIn.vue
with
20 additions
and
9 deletions
public/config.js
+
6
−
5
View file @
8ec33bad
export
default
{
forms
:
{
signup
:
{
disabled
:
false
,
hiddenFields
:
[],
requiredFields
:
[
'
first_name
'
,
'
last_name
'
,
'
email
'
]
'
email
'
,
]
,
},
organisation
:
{
hiddenFields
:
[],
requiredFields
:
[
'
name
'
,
'
type
'
]
}
'
type
'
,
]
,
}
,
}
};
This diff is collapsed.
Click to expand it.
src/router/index.js
+
13
−
4
View file @
8ec33bad
...
...
@@ -2,6 +2,8 @@ import Vue from 'vue';
import
VueRouter
from
'
vue-router
'
;
import
i18n
from
'
@/i18n
'
;
import
config
from
'
../../public/config.js
'
;
Vue
.
use
(
VueRouter
);
function
normalizePathname
(
pathname
)
{
...
...
@@ -18,24 +20,24 @@ const routes = [
{
path
:
'
/:locale
'
,
component
:
()
=>
import
(
'
@/views/Base.vue
'
),
beforeEnter
:
(
to
,
from
,
next
)
=>
{
beforeEnter
:
(
to
,
from
,
next
)
=>
{
const
locale
=
to
.
params
.
locale
;
const
supported_locales
=
process
.
env
.
VUE_APP_I18N_SUPPORTED_LOCALE
.
split
(
'
,
'
);
if
(
!
locale
)
{
return
next
({
path
:
`
${
process
.
env
.
VUE_APP_I18N_DEFAULT_LOCALE
}${
to
.
path
.
endsWith
(
'
/
'
)
?
to
.
path
:
normalizePathname
(
to
.
path
)}
`
,
query
:
to
.
query
});
}
if
(
locale
&&
locale
.
length
!==
2
)
{
return
next
({
path
:
`
${
process
.
env
.
VUE_APP_I18N_DEFAULT_LOCALE
}${
to
.
path
.
endsWith
(
'
/
'
)
?
to
.
path
:
normalizePathname
(
to
.
path
)}
`
,
query
:
to
.
query
});
}
if
(
locale
&&
!
supported_locales
.
includes
(
locale
))
{
return
next
({
path
:
...
...
@@ -75,6 +77,13 @@ const routes = [
path
:
'
signup
'
,
name
:
'
SignUp
'
,
component
:
()
=>
import
(
'
@/views/SignUp.vue
'
),
beforeEnter
:
(
to
,
from
,
next
)
=>
{
if
(
config
.
forms
.
signup
.
disabled
)
{
return
next
({
path
:
'
not-found/
'
});
}
else
{
return
next
();
}
}
},
{
path
:
'
terms-of-use
'
,
...
...
This diff is collapsed.
Click to expand it.
src/views/SignIn.vue
+
1
−
0
View file @
8ec33bad
...
...
@@ -74,6 +74,7 @@
<
div
class
=
"
form-row
"
>
<
div
class
=
"
btn-group-vertical
"
>
<
router
-
link
v
-
if
=
"
!$config.forms.signup.disabled
"
:
to
=
"
{ name: 'SignUp'
}
"
custom
>
...
...
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