Commit 7d3220ac authored by Olena Horal-Koretska's avatar Olena Horal-Koretska Committed by Nicolò Maria Mezzopera

Communicate empty stack trace on error details page

parent df980634
...@@ -106,6 +106,7 @@ export default { ...@@ -106,6 +106,7 @@ export default {
errorPollTimeout: 0, errorPollTimeout: 0,
issueCreationInProgress: false, issueCreationInProgress: false,
isAlertVisible: false, isAlertVisible: false,
isStacktraceEmptyAlertVisible: true,
closedIssueId: null, closedIssueId: null,
}; };
}, },
...@@ -167,6 +168,9 @@ export default { ...@@ -167,6 +168,9 @@ export default {
resolveBtnLabel() { resolveBtnLabel() {
return this.errorStatus !== errorStatus.RESOLVED ? __('Resolve') : __('Unresolve'); return this.errorStatus !== errorStatus.RESOLVED ? __('Resolve') : __('Unresolve');
}, },
showEmptyStacktraceAlert() {
return !this.loadingStacktrace && !this.showStacktrace && this.isStacktraceEmptyAlertVisible;
},
}, },
watch: { watch: {
error(val) { error(val) {
...@@ -254,6 +258,10 @@ export default { ...@@ -254,6 +258,10 @@ export default {
</gl-sprintf> </gl-sprintf>
</gl-alert> </gl-alert>
<gl-alert v-if="showEmptyStacktraceAlert" @dismiss="isStacktraceEmptyAlertVisible = false">
{{ __('No stack trace for this error') }}
</gl-alert>
<div class="error-details-header d-flex py-2 justify-content-between"> <div class="error-details-header d-flex py-2 justify-content-between">
<div <div
v-if="!loadingStacktrace && stacktrace" v-if="!loadingStacktrace && stacktrace"
......
---
title: Show notification about empty stacktrace
merge_request: 34517
author:
type: added
...@@ -14972,6 +14972,9 @@ msgstr "" ...@@ -14972,6 +14972,9 @@ msgstr ""
msgid "No schedules" msgid "No schedules"
msgstr "" msgstr ""
msgid "No stack trace for this error"
msgstr ""
msgid "No starrers matched your search" msgid "No starrers matched your search"
msgstr "" msgstr ""
......
...@@ -48,6 +48,7 @@ describe('ErrorDetails', () => { ...@@ -48,6 +48,7 @@ describe('ErrorDetails', () => {
const findUpdateResolveStatusButton = () => const findUpdateResolveStatusButton = () =>
wrapper.find('[data-testid="update-resolve-status-btn"]'); wrapper.find('[data-testid="update-resolve-status-btn"]');
const findExternalUrl = () => wrapper.find('[data-testid="external-url-link"]'); const findExternalUrl = () => wrapper.find('[data-testid="external-url-link"]');
const findAlert = () => wrapper.find(GlAlert);
function mountComponent() { function mountComponent() {
wrapper = shallowMount(ErrorDetails, { wrapper = shallowMount(ErrorDetails, {
...@@ -278,15 +279,17 @@ describe('ErrorDetails', () => { ...@@ -278,15 +279,17 @@ describe('ErrorDetails', () => {
return wrapper.vm.$nextTick().then(() => { return wrapper.vm.$nextTick().then(() => {
expect(wrapper.find(GlLoadingIcon).exists()).toBe(false); expect(wrapper.find(GlLoadingIcon).exists()).toBe(false);
expect(wrapper.find(Stacktrace).exists()).toBe(true); expect(wrapper.find(Stacktrace).exists()).toBe(true);
expect(findAlert().exists()).toBe(false);
}); });
}); });
it('should NOT show stacktrace if no entries', () => { it('should NOT show stacktrace if no entries and show Alert message', () => {
store.state.details.loadingStacktrace = false; store.state.details.loadingStacktrace = false;
store.getters = { 'details/sentryUrl': () => 'sentry.io', 'details/stacktrace': () => [] }; store.getters = { 'details/sentryUrl': () => 'sentry.io', 'details/stacktrace': () => [] };
return wrapper.vm.$nextTick().then(() => { return wrapper.vm.$nextTick().then(() => {
expect(wrapper.find(GlLoadingIcon).exists()).toBe(false); expect(wrapper.find(GlLoadingIcon).exists()).toBe(false);
expect(wrapper.find(Stacktrace).exists()).toBe(false); expect(wrapper.find(Stacktrace).exists()).toBe(false);
expect(findAlert().text()).toBe('No stack trace for this error');
}); });
}); });
}); });
...@@ -404,7 +407,6 @@ describe('ErrorDetails', () => { ...@@ -404,7 +407,6 @@ describe('ErrorDetails', () => {
}); });
it('should show alert with closed issueId', () => { it('should show alert with closed issueId', () => {
const findAlert = () => wrapper.find(GlAlert);
const closedIssueId = 123; const closedIssueId = 123;
wrapper.setData({ wrapper.setData({
isAlertVisible: true, isAlertVisible: true,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment