Commit 3657cb4e authored by Phil Hughes's avatar Phil Hughes

Merge branch 'tr-allow-alert-errors-to-reappear' into 'master'

Allow alert error to reappear

See merge request gitlab-org/gitlab!37900
parents fe5abe2f 4ffac0f8
...@@ -168,7 +168,7 @@ export default { ...@@ -168,7 +168,7 @@ export default {
}; };
}, },
error() { error() {
this.errored = true; this.hasError = true;
}, },
}, },
alertsCount: { alertsCount: {
...@@ -187,10 +187,9 @@ export default { ...@@ -187,10 +187,9 @@ export default {
data() { data() {
return { return {
searchTerm: '', searchTerm: '',
errored: false, hasError: false,
errorMessage: '', errorMessage: '',
isAlertDismissed: false, isAlertDismissed: false,
isErrorAlertDismissed: false,
sort: 'STARTED_AT_DESC', sort: 'STARTED_AT_DESC',
statusFilter: [], statusFilter: [],
filteredByStatus: '', filteredByStatus: '',
...@@ -203,16 +202,13 @@ export default { ...@@ -203,16 +202,13 @@ export default {
computed: { computed: {
showNoAlertsMsg() { showNoAlertsMsg() {
return ( return (
!this.errored && !this.hasError &&
!this.loading && !this.loading &&
this.alertsCount?.all === 0 && this.alertsCount?.all === 0 &&
!this.searchTerm && !this.searchTerm &&
!this.isAlertDismissed !this.isAlertDismissed
); );
}, },
showErrorMsg() {
return this.errored && !this.isErrorAlertDismissed;
},
loading() { loading() {
return this.$apollo.queries.alerts.loading; return this.$apollo.queries.alerts.loading;
}, },
...@@ -306,11 +302,11 @@ export default { ...@@ -306,11 +302,11 @@ export default {
}; };
}, },
handleAlertError(errorMessage) { handleAlertError(errorMessage) {
this.errored = true; this.hasError = true;
this.errorMessage = errorMessage; this.errorMessage = errorMessage;
}, },
dismissError() { dismissError() {
this.isErrorAlertDismissed = true; this.hasError = false;
this.errorMessage = ''; this.errorMessage = '';
}, },
}, },
...@@ -332,12 +328,7 @@ export default { ...@@ -332,12 +328,7 @@ export default {
</template> </template>
</gl-sprintf> </gl-sprintf>
</gl-alert> </gl-alert>
<gl-alert <gl-alert v-if="hasError" variant="danger" data-testid="alert-error" @dismiss="dismissError">
v-if="showErrorMsg"
variant="danger"
data-testid="alert-error"
@dismiss="dismissError"
>
<p v-html="errorMessage || $options.i18n.errorMsg"></p> <p v-html="errorMessage || $options.i18n.errorMsg"></p>
</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