Commit 875e9ff9 authored by Mark Florian's avatar Mark Florian

Extract slot name constants from ReportSection

parent f5bd4c28
......@@ -3,7 +3,7 @@ import { __ } from '~/locale';
import StatusIcon from '~/vue_merge_request_widget/components/mr_widget_status_icon.vue';
import Popover from '~/vue_shared/components/help_popover.vue';
import IssuesList from './issues_list.vue';
import { status } from '../constants';
import { status, SLOT_SUCCESS, SLOT_LOADING, SLOT_ERROR } from '../constants';
export default {
name: 'ReportSection',
......@@ -152,12 +152,12 @@ export default {
},
slotName() {
if (this.isSuccess) {
return 'success';
return SLOT_SUCCESS;
} else if (this.isLoading) {
return 'loading';
return SLOT_LOADING;
}
return 'error';
return SLOT_ERROR;
},
},
methods: {
......
......@@ -25,3 +25,11 @@ export const status = {
export const ACCESSIBILITY_ISSUE_ERROR = 'error';
export const ACCESSIBILITY_ISSUE_WARNING = 'warning';
/**
* Slot names for the ReportSection component, corresponding to the success,
* loading and error statuses.
*/
export const SLOT_SUCCESS = 'success';
export const SLOT_LOADING = 'loading';
export const SLOT_ERROR = 'error';
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