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
80372d12
Commit
80372d12
authored
Nov 22, 2019
by
Laura Montemayor
Committed by
Phil Hughes
Nov 22, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Pass sentry error title, description and link (unstyled) to newly created issue
parent
f9c84077
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
68 additions
and
4 deletions
+68
-4
app/assets/javascripts/error_tracking/components/error_details.vue
...s/javascripts/error_tracking/components/error_details.vue
+29
-1
locale/gitlab.pot
locale/gitlab.pot
+15
-0
spec/frontend/error_tracking/components/error_details_spec.js
.../frontend/error_tracking/components/error_details_spec.js
+24
-3
No files found.
app/assets/javascripts/error_tracking/components/error_details.vue
View file @
80372d12
...
...
@@ -62,6 +62,34 @@ export default {
showStacktrace
()
{
return
Boolean
(
!
this
.
loadingStacktrace
&&
this
.
stacktrace
&&
this
.
stacktrace
.
length
);
},
errorTitle
()
{
return
`
${
this
.
error
.
title
}
`
;
},
errorUrl
()
{
return
sprintf
(
__
(
'
Sentry event: %{external_url}
'
),
{
external_url
:
this
.
error
.
external_url
,
});
},
errorFirstSeen
()
{
return
sprintf
(
__
(
'
First seen: %{first_seen}
'
),
{
first_seen
:
this
.
error
.
first_seen
});
},
errorLastSeen
()
{
return
sprintf
(
__
(
'
Last seen: %{last_seen}
'
),
{
last_seen
:
this
.
error
.
last_seen
});
},
errorCount
()
{
return
sprintf
(
__
(
'
Events: %{count}
'
),
{
count
:
this
.
error
.
count
});
},
errorUserCount
()
{
return
sprintf
(
__
(
'
Users: %{user_count}
'
),
{
user_count
:
this
.
error
.
user_count
});
},
issueLink
()
{
return
`
${
this
.
issueProjectPath
}
?issue[title]=
${
encodeURIComponent
(
this
.
errorTitle
,
)}
&issue[description]=
${
encodeURIComponent
(
this
.
issueDescription
)}
`
;
},
issueDescription
()
{
return
`
${
this
.
errorUrl
}${
this
.
errorFirstSeen
}${
this
.
errorLastSeen
}${
this
.
errorCount
}${
this
.
errorUserCount
}
`
;
},
},
mounted
()
{
this
.
startPollingDetails
(
this
.
issueDetailsPath
);
...
...
@@ -86,7 +114,7 @@ export default {
<div
v-else-if=
"showDetails"
class=
"error-details"
>
<div
class=
"top-area align-items-center justify-content-between py-3"
>
<span
v-if=
"!loadingStacktrace && stacktrace"
v-html=
"reported"
></span>
<gl-button
variant=
"success"
:href=
"issue
ProjectPath
"
>
<gl-button
variant=
"success"
:href=
"issue
Link
"
>
{{
__
(
'
Create issue
'
)
}}
</gl-button>
</div>
...
...
locale/gitlab.pot
View file @
80372d12
...
...
@@ -6940,6 +6940,9 @@ msgstr ""
msgid "Events"
msgstr ""
msgid "Events: %{count}"
msgstr ""
msgid "Every %{action} attempt has failed: %{job_error_message}. Please try again."
msgstr ""
...
...
@@ -7599,6 +7602,9 @@ msgstr ""
msgid "First seen"
msgstr ""
msgid "First seen: %{first_seen}"
msgstr ""
msgid "Fixed date"
msgstr ""
...
...
@@ -10038,6 +10044,9 @@ msgstr ""
msgid "Last seen"
msgstr ""
msgid "Last seen: %{last_seen}"
msgstr ""
msgid "Last successful update"
msgstr ""
...
...
@@ -15510,6 +15519,9 @@ msgstr ""
msgid "Sentry event"
msgstr ""
msgid "Sentry event: %{external_url}"
msgstr ""
msgid "Sep"
msgstr ""
...
...
@@ -19196,6 +19208,9 @@ msgstr ""
msgid "Users with a Guest role or those who don't belong to any projects or groups don't count towards seats in use."
msgstr ""
msgid "Users: %{user_count}"
msgstr ""
msgid "UsersSelect|%{name} + %{length} more"
msgstr ""
...
...
spec/frontend/error_tracking/components/error_details_spec.js
View file @
80372d12
...
...
@@ -83,13 +83,34 @@ describe('ErrorDetails', () => {
expect
(
wrapper
.
find
(
Stacktrace
).
exists
()).
toBe
(
false
);
});
it
(
'
should allow a
blank issue to be created
'
,
()
=>
{
it
(
'
should allow a
n issue to be created with title and description
'
,
()
=>
{
store
.
state
.
details
.
loading
=
false
;
store
.
state
.
details
.
error
.
id
=
1
;
store
.
state
.
details
.
error
=
{
id
:
1
,
title
:
'
Issue title
'
,
external_url
:
'
http://sentry.gitlab.net/gitlab
'
,
first_seen
:
'
2017-05-26T13:32:48Z
'
,
last_seen
:
'
2018-05-26T13:32:48Z
'
,
count
:
12
,
user_count
:
2
,
};
mountComponent
();
const
button
=
wrapper
.
find
(
GlButton
);
const
title
=
'
Issue title
'
;
const
url
=
'
Sentry event: http://sentry.gitlab.net/gitlab
'
;
const
firstSeen
=
'
First seen: 2017-05-26T13:32:48Z
'
;
const
lastSeen
=
'
Last seen: 2018-05-26T13:32:48Z
'
;
const
count
=
'
Events: 12
'
;
const
userCount
=
'
Users: 2
'
;
const
issueDescription
=
`
${
url
}${
firstSeen
}${
lastSeen
}${
count
}${
userCount
}
`
;
const
issueLink
=
`/test-project/issues/new?issue[title]=
${
encodeURIComponent
(
title
,
)}
&issue[description]=
${
encodeURIComponent
(
issueDescription
)}
`
;
expect
(
button
.
exists
()).
toBe
(
true
);
expect
(
button
.
attributes
().
href
).
toBe
(
wrapper
.
props
().
issueProjectPath
);
expect
(
button
.
attributes
().
href
).
toBe
(
issueLink
);
});
describe
(
'
Stacktrace
'
,
()
=>
{
...
...
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