Commit 4ffac0f8 authored by Tristan Read's avatar Tristan Read Committed by Phil Hughes

Allow alert error to reappear

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