Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
648a9061
Commit
648a9061
authored
Oct 25, 2019
by
Laura Montemayor
Committed by
Natalia Tepluhina
Oct 25, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adds getters to filter results
* Moves search bar next to the button * Adds minimal styling
parent
6506ff4d
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
81 additions
and
5 deletions
+81
-5
app/assets/javascripts/error_tracking/components/error_tracking_list.vue
...scripts/error_tracking/components/error_tracking_list.vue
+36
-5
app/assets/javascripts/error_tracking/store/getters.js
app/assets/javascripts/error_tracking/store/getters.js
+4
-0
app/assets/javascripts/error_tracking/store/index.js
app/assets/javascripts/error_tracking/store/index.js
+2
-0
changelogs/unreleased/lm-search-list-of-sentry-errors.yml
changelogs/unreleased/lm-search-list-of-sentry-errors.yml
+5
-0
doc/user/project/operations/error_tracking.md
doc/user/project/operations/error_tracking.md
+1
-0
doc/user/project/operations/img/error_tracking_list.png
doc/user/project/operations/img/error_tracking_list.png
+0
-0
spec/frontend/error_tracking/store/getters_spec.js
spec/frontend/error_tracking/store/getters_spec.js
+33
-0
No files found.
app/assets/javascripts/error_tracking/components/error_tracking_list.vue
View file @
648a9061
<
script
>
import
{
mapActions
,
mapState
}
from
'
vuex
'
;
import
{
GlEmptyState
,
GlButton
,
GlLink
,
GlLoadingIcon
,
GlTable
}
from
'
@gitlab/ui
'
;
import
{
mapActions
,
mapState
,
mapGetters
}
from
'
vuex
'
;
import
{
GlEmptyState
,
GlButton
,
GlLink
,
GlLoadingIcon
,
GlTable
,
GlSearchBoxByType
,
}
from
'
@gitlab/ui
'
;
import
Icon
from
'
~/vue_shared/components/icon.vue
'
;
import
TimeAgo
from
'
~/vue_shared/components/time_ago_tooltip.vue
'
;
import
{
__
}
from
'
~/locale
'
;
...
...
@@ -20,6 +27,7 @@ export default {
GlLink
,
GlLoadingIcon
,
GlTable
,
GlSearchBoxByType
,
Icon
,
TimeAgo
,
},
...
...
@@ -48,8 +56,17 @@ export default {
required
:
true
,
},
},
data
()
{
return
{
errorSearchQuery
:
''
,
};
},
computed
:
{
...
mapState
([
'
errors
'
,
'
externalUrl
'
,
'
loading
'
]),
...
mapGetters
([
'
filterErrorsByTitle
'
]),
filteredErrors
()
{
return
this
.
errorSearchQuery
?
this
.
filterErrorsByTitle
(
this
.
errorSearchQuery
)
:
this
.
errors
;
},
},
created
()
{
if
(
this
.
errorTrackingEnabled
)
{
...
...
@@ -71,10 +88,17 @@ export default {
<gl-loading-icon
:size=
"3"
/>
</div>
<div
v-else
>
<div
class=
"d-flex justify-content-end"
>
<div
class=
"d-flex flex-row justify-content-around bg-secondary border"
>
<gl-search-box-by-type
v-model=
"errorSearchQuery"
class=
"col-lg-10 m-3 p-0"
:placeholder=
"__('Search or filter results...')"
type=
"search"
autofocus
/>
<gl-button
v-track-event=
"trackViewInSentryOptions(externalUrl)"
class=
"m
y-3 ml-auto
"
class=
"m
-3
"
variant=
"primary"
:href=
"externalUrl"
target=
"_blank"
...
...
@@ -84,7 +108,14 @@ export default {
</gl-button>
</div>
<gl-table
:items=
"errors"
:fields=
"$options.fields"
:show-empty=
"true"
fixed
stacked=
"sm"
>
<gl-table
class=
"mt-3"
:items=
"filteredErrors"
:fields=
"$options.fields"
:show-empty=
"true"
fixed
stacked=
"sm"
>
<template
slot=
"HEAD_events"
slot-scope=
"data"
>
<div
class=
"text-md-right"
>
{{
data
.
label
}}
</div>
</
template
>
...
...
app/assets/javascripts/error_tracking/store/getters.js
0 → 100644
View file @
648a9061
export
const
filterErrorsByTitle
=
state
=>
errorQuery
=>
state
.
errors
.
filter
(
error
=>
error
.
title
.
match
(
new
RegExp
(
`
${
errorQuery
}
`
,
'
i
'
)));
export
default
()
=>
{};
app/assets/javascripts/error_tracking/store/index.js
View file @
648a9061
import
Vue
from
'
vue
'
;
import
Vuex
from
'
vuex
'
;
import
*
as
actions
from
'
./actions
'
;
import
*
as
getters
from
'
./getters
'
;
import
mutations
from
'
./mutations
'
;
Vue
.
use
(
Vuex
);
...
...
@@ -14,6 +15,7 @@ export const createStore = () =>
},
actions
,
mutations
,
getters
,
});
export
default
createStore
();
changelogs/unreleased/lm-search-list-of-sentry-errors.yml
0 → 100644
View file @
648a9061
---
title
:
Search list of Sentry errors by title in Gitlab
merge_request
:
18772
author
:
type
:
added
doc/user/project/operations/error_tracking.md
View file @
648a9061
...
...
@@ -41,5 +41,6 @@ NOTE: **Note:**
You will need at least Reporter
[
permissions
](
../../permissions.md
)
to view the Error Tracking list.
The Error Tracking list may be found at
**Operations > Error Tracking**
in your project's sidebar.
Errors can be filtered by title.
![
Error Tracking list
](
img/error_tracking_list.png
)
doc/user/project/operations/img/error_tracking_list.png
View replaced file @
6506ff4d
View file @
648a9061
59.3 KB
|
W:
|
H:
743 KB
|
W:
|
H:
2-up
Swipe
Onion skin
spec/frontend/error_tracking/store/getters_spec.js
0 → 100644
View file @
648a9061
import
*
as
getters
from
'
~/error_tracking/store/getters
'
;
describe
(
'
Error Tracking getters
'
,
()
=>
{
let
state
;
const
mockErrors
=
[
{
title
:
'
ActiveModel::MissingAttributeError: missing attribute: encrypted_password
'
},
{
title
:
'
Grape::Exceptions::MethodNotAllowed: Grape::Exceptions::MethodNotAllowed
'
},
{
title
:
'
NoMethodError: undefined method `sanitize_http_headers=
'
},
{
title
:
'
NoMethodError: undefined method `pry
'
},
];
beforeEach
(()
=>
{
state
=
{
errors
:
mockErrors
,
};
});
describe
(
'
search results
'
,
()
=>
{
it
(
'
should return errors filtered by words in title matching the query
'
,
()
=>
{
const
filteredErrors
=
getters
.
filterErrorsByTitle
(
state
)(
'
NoMethod
'
);
expect
(
filteredErrors
).
not
.
toContainEqual
(
mockErrors
[
0
]);
expect
(
filteredErrors
.
length
).
toBe
(
2
);
});
it
(
'
should not return results if there is no matching query
'
,
()
=>
{
const
filteredErrors
=
getters
.
filterErrorsByTitle
(
state
)(
'
GitLab
'
);
expect
(
filteredErrors
.
length
).
toBe
(
0
);
});
});
});
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment