Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
A
admin-fe
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Pleroma
admin-fe
Commits
6722a9e3
Commit
6722a9e3
authored
4 years ago
by
Angelina Filippova
Browse files
Options
Downloads
Patches
Plain Diff
Replace router push with the one that catches errors
parent
5ca76701
No related branches found
Branches containing commit
No related tags found
1 merge request
!198
Fix displaying multiple errors
Pipeline
#35291
passed
4 years ago
Stage: build
Stage: test
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/router/index.js
+13
-0
13 additions, 0 deletions
src/router/index.js
test/views/layout/index.test.js
+1
-0
1 addition, 0 deletions
test/views/layout/index.test.js
with
14 additions
and
0 deletions
src/router/index.js
+
13
−
0
View file @
6722a9e3
...
...
@@ -3,6 +3,19 @@ import Router from 'vue-router'
Vue
.
use
(
Router
)
const
originalPush
=
Router
.
prototype
.
push
Router
.
prototype
.
push
=
function
push
(
location
,
onResolve
,
onReject
)
{
if
(
onResolve
||
onReject
)
{
return
originalPush
.
call
(
this
,
location
,
onResolve
,
onReject
)
}
return
originalPush
.
call
(
this
,
location
).
catch
((
err
)
=>
{
if
(
Router
.
isNavigationFailure
(
err
))
{
// resolve err
return
err
}
// rethrow error
return
Promise
.
reject
(
err
)
})
}
/* Layout */
import
Layout
from
'
@/views/layout/Layout
'
...
...
This diff is collapsed.
Click to expand it.
test/views/layout/index.test.js
+
1
−
0
View file @
6722a9e3
...
...
@@ -16,6 +16,7 @@ localVue.use(VueRouter)
localVue
.
use
(
Element
)
jest
.
mock
(
'
@/api/reports
'
)
jest
.
mock
(
'
@/api/settings
'
)
describe
(
'
Log out
'
,
()
=>
{
let
store
...
...
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