Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
nmaas Portal
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
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
nmaas
nmaas Portal
Commits
6b875098
Commit
6b875098
authored
3 months ago
by
Lukasz Lopatowski
Browse files
Options
Downloads
Plain Diff
Merge branch 'handle-wrong-password-error' into 'develop'
added error handle See merge request
!107
parents
0de427fa
82c3e817
Branches
Branches containing commit
Tags
Tags containing commit
4 merge requests
!184
Develop
,
!119
Develop
,
!108
Develop
,
!107
added error handle
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/app/welcome/link-account/link-account.component.html
+1
-1
1 addition, 1 deletion
src/app/welcome/link-account/link-account.component.html
src/app/welcome/link-account/link-account.component.ts
+19
-1
19 additions, 1 deletion
src/app/welcome/link-account/link-account.component.ts
with
20 additions
and
2 deletions
src/app/welcome/link-account/link-account.component.html
+
1
−
1
View file @
6b875098
...
...
@@ -43,7 +43,7 @@ margin-top: 50px;
<button
type=
"submit"
class=
"btn btn-primary"
(click)=
"submit()"
>
{{ 'ACCOUNT_LINKING.CONFIRM' | translate }}
</button>
<div
*ngIf=
"error"
class=
"alert alert-danger"
style=
"margin-top: 20px"
>
{{error}}
</div>
</form>
<br>
</div>
...
...
This diff is collapsed.
Click to expand it.
src/app/welcome/link-account/link-account.component.ts
+
19
−
1
View file @
6b875098
...
...
@@ -3,6 +3,7 @@ import {User} from '../../model';
import
{
ActivatedRoute
,
Router
}
from
'
@angular/router
'
;
import
jwtDecode
from
'
jwt-decode
'
;
import
{
AuthService
}
from
'
../../auth/auth.service
'
;
import
{
TranslateService
}
from
'
@ngx-translate/core
'
;
@
Component
({
...
...
@@ -14,11 +15,13 @@ export class LinkAccountComponent implements OnInit, OnDestroy {
public
user
:
User
;
private
token
:
string
;
public
password
:
string
;
public
error
:
string
;
constructor
(
private
readonly
route
:
ActivatedRoute
,
private
readonly
authService
:
AuthService
,
private
readonly
router
:
Router
private
readonly
router
:
Router
,
private
translate
:
TranslateService
,
)
{
}
...
...
@@ -52,9 +55,24 @@ export class LinkAccountComponent implements OnInit, OnDestroy {
).
subscribe
(
()
=>
{
this
.
router
.
navigate
([
'
/
'
]);
},
err
=>
{
this
.
error
=
this
.
translate
.
instant
(
this
.
getMessage
(
err
));
}
)
}
private
getMessage
(
err
:
any
):
string
{
switch
(
err
[
'
status
'
])
{
case
401
:
return
'
LOGIN.LOGIN_FAILURE_MESSAGE
'
;
case
406
:
return
'
LOGIN.APPLICATION_UNDER_MAINTENANCE_MESSAGE
'
;
case
409
:
return
'
GENERIC_MESSAGE.UNAVAILABLE_MESSAGE
'
;
default
:
return
'
GENERIC_MESSAGE.UNAVAILABLE_MESSAGE
'
;
}
}
}
...
...
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