Commit e9bc002c authored by mehulsharma's avatar mehulsharma

Improve empty state when artifacts fail to load

When there are no artifacts to show and there is an error loading artifacts
we now only show the alert and not the empty artifacts message.

Changelog: changed
parent a3b04963
...@@ -95,9 +95,9 @@ export default { ...@@ -95,9 +95,9 @@ export default {
{{ $options.i18n.artifactsFetchErrorMessage }} {{ $options.i18n.artifactsFetchErrorMessage }}
</gl-alert> </gl-alert>
<gl-loading-icon v-if="isLoading" size="sm" /> <gl-loading-icon v-else-if="isLoading" size="sm" />
<gl-dropdown-item v-if="!artifacts.length && !isLoading" data-testid="artifacts-empty-message"> <gl-dropdown-item v-else-if="!artifacts.length" data-testid="artifacts-empty-message">
{{ $options.i18n.emptyArtifactsMessage }} {{ $options.i18n.emptyArtifactsMessage }}
</gl-dropdown-item> </gl-dropdown-item>
......
...@@ -50,11 +50,6 @@ export default { ...@@ -50,11 +50,6 @@ export default {
isLoading: false, isLoading: false,
}; };
}, },
computed: {
hasArtifacts() {
return Boolean(this.artifacts.length);
},
},
methods: { methods: {
fetchArtifacts() { fetchArtifacts() {
this.isLoading = true; this.isLoading = true;
...@@ -99,9 +94,9 @@ export default { ...@@ -99,9 +94,9 @@ export default {
{{ $options.i18n.artifactsFetchErrorMessage }} {{ $options.i18n.artifactsFetchErrorMessage }}
</gl-alert> </gl-alert>
<gl-loading-icon v-if="isLoading" size="sm" /> <gl-loading-icon v-else-if="isLoading" size="sm" />
<gl-alert v-else-if="!hasArtifacts" variant="info" :dismissible="false"> <gl-alert v-else-if="!artifacts.length" variant="info" :dismissible="false">
{{ $options.i18n.noArtifacts }} {{ $options.i18n.noArtifacts }}
</gl-alert> </gl-alert>
......
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