Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
greg
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
it-bott-integrasjoner
greg
Commits
92b21d34
Commit
92b21d34
authored
3 years ago
by
Tore.Brede
Browse files
Options
Downloads
Patches
Plain Diff
Fixing linting error
parent
a5b8b690
No related branches found
Branches containing commit
No related tags found
1 merge request
!88
GREG-60: Validate e-mail
Pipeline
#95868
passed
3 years ago
Stage: venv update
Stage: tests and linting
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
frontend/src/utils/index.ts
+2
-2
2 additions, 2 deletions
frontend/src/utils/index.ts
with
2 additions
and
2 deletions
frontend/src/utils/index.ts
+
2
−
2
View file @
92b21d34
...
@@ -3,7 +3,7 @@ import i18n from 'i18next'
...
@@ -3,7 +3,7 @@ import i18n from 'i18next'
import
{
isValidPhoneNumber
}
from
'
libphonenumber-js
'
import
{
isValidPhoneNumber
}
from
'
libphonenumber-js
'
const
valid
_e
mail
_r
egex
=
/^
(?=
.
{1,254}
$
)(?=
.
{1,64}
@
)[
-!#$%&'*+
/
0-9=?A-Z^_`a-z{|}~
]
+
(\.[
-!#$%&'*+
/
0-9=?A-Z^_`a-z{|}~
]
+
)
*@
[
A-Za-z0-9
]([
A-Za-z0-9-
]{0,61}[
A-Za-z0-9
])?(\.[
A-Za-z0-9
]([
A-Za-z0-9-
]{0,61}[
A-Za-z0-9
])?)
*$/
const
valid
E
mail
R
egex
=
/^
(?=
.
{1,254}
$
)(?=
.
{1,64}
@
)[
-!#$%&'*+
/
0-9=?A-Z^_`a-z{|}~
]
+
(\.[
-!#$%&'*+
/
0-9=?A-Z^_`a-z{|}~
]
+
)
*@
[
A-Za-z0-9
]([
A-Za-z0-9-
]{0,61}[
A-Za-z0-9
])?(\.[
A-Za-z0-9
]([
A-Za-z0-9-
]{0,61}[
A-Za-z0-9
])?)
*$/
export
function
getCookie
(
name
:
string
)
{
export
function
getCookie
(
name
:
string
)
{
if
(
!
document
.
cookie
)
{
if
(
!
document
.
cookie
)
{
...
@@ -70,7 +70,7 @@ export function isValidEmail(data: string | undefined): boolean | string {
...
@@ -70,7 +70,7 @@ export function isValidEmail(data: string | undefined): boolean | string {
if
(
!
data
)
{
if
(
!
data
)
{
return
i18n
.
t
<
string
>
(
'
common:validation.emailRequired
'
)
return
i18n
.
t
<
string
>
(
'
common:validation.emailRequired
'
)
}
}
if
(
valid
_e
mail
_r
egex
.
test
(
data
))
{
if
(
valid
E
mail
R
egex
.
test
(
data
))
{
return
true
return
true
}
}
return
i18n
.
t
<
string
>
(
'
common:validation.invalidEmail
'
)
return
i18n
.
t
<
string
>
(
'
common:validation.invalidEmail
'
)
...
...
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