Commit 84b69f34 authored by Filipa Lacerda's avatar Filipa Lacerda

Moves mr widget options ee file into vue file

parent 75ee3d1e
...@@ -44,4 +44,4 @@ export { default as SquashBeforeMerge } from 'ee/vue_merge_request_widget/compon ...@@ -44,4 +44,4 @@ export { default as SquashBeforeMerge } from 'ee/vue_merge_request_widget/compon
export { default as notify } from '../lib/utils/notify'; export { default as notify } from '../lib/utils/notify';
export { default as SourceBranchRemovalStatus } from './components/source_branch_removal_status.vue'; export { default as SourceBranchRemovalStatus } from './components/source_branch_removal_status.vue';
export { default as mrWidgetOptions } from 'ee/vue_merge_request_widget/mr_widget_options'; export { default as mrWidgetOptions } from 'ee/vue_merge_request_widget/mr_widget_options.vue';
<script>
import { n__, s__, __, sprintf } from '~/locale'; import { n__, s__, __, sprintf } from '~/locale';
import CEWidgetOptions from '~/vue_merge_request_widget/mr_widget_options'; import CEWidgetOptions from '~/vue_merge_request_widget/mr_widget_options.vue';
import WidgetApprovals from './components/approvals/mr_widget_approvals'; import WidgetApprovals from './components/approvals/mr_widget_approvals';
import GeoSecondaryNode from './components/states/mr_widget_secondary_geo_node'; import GeoSecondaryNode from './components/states/mr_widget_secondary_geo_node';
import ReportSection from '../vue_shared/security_reports/components/report_section.vue'; import ReportSection from '../vue_shared/security_reports/components/report_section.vue';
...@@ -118,6 +119,15 @@ export default { ...@@ -118,6 +119,15 @@ export default {
return this.checkReportStatus(this.isLoadingPerformance, this.loadingPerformanceFailed); return this.checkReportStatus(this.isLoadingPerformance, this.loadingPerformanceFailed);
}, },
}, },
created() {
if (this.shouldRenderCodeQuality) {
this.fetchCodeQuality();
}
if (this.shouldRenderPerformance) {
this.fetchPerformance();
}
},
methods: { methods: {
fetchCodeQuality() { fetchCodeQuality() {
const { head_path, base_path } = this.mr.codeclimate; const { head_path, base_path } = this.mr.codeclimate;
...@@ -167,16 +177,9 @@ export default { ...@@ -167,16 +177,9 @@ export default {
}; };
}, },
}, },
created() { };
if (this.shouldRenderCodeQuality) { </script>
this.fetchCodeQuality(); <template>
}
if (this.shouldRenderPerformance) {
this.fetchPerformance();
}
},
template: `
<div class="mr-state-widget prepend-top-default"> <div class="mr-state-widget prepend-top-default">
<mr-widget-header :mr="mr" /> <mr-widget-header :mr="mr" />
<mr-widget-pipeline <mr-widget-pipeline
...@@ -244,20 +247,30 @@ export default { ...@@ -244,20 +247,30 @@ export default {
<component <component
:is="componentName" :is="componentName"
:mr="mr" :mr="mr"
:service="service" /> :service="service"
<mr-widget-maintainer-edit />
:maintainerEditAllowed="mr.maintainerEditAllowed" />
<section
v-if="mr.maintainerEditAllowed"
class="mr-info-list mr-links"
>
{{ s__("mrWidget|Allows edits from maintainers") }}
</section>
<mr-widget-related-links <mr-widget-related-links
v-if="shouldRenderRelatedLinks" v-if="shouldRenderRelatedLinks"
:state="mr.state" :state="mr.state"
:related-links="mr.relatedLinks" /> :related-links="mr.relatedLinks"
/>
<source-branch-removal-status <source-branch-removal-status
v-if="shouldRenderSourceBranchRemovalStatus" v-if="shouldRenderSourceBranchRemovalStatus"
/> />
</div> </div>
<div class="mr-widget-footer" v-if="shouldRenderMergeHelp"> <div
class="mr-widget-footer"
v-if="shouldRenderMergeHelp"
>
<mr-widget-merge-help /> <mr-widget-merge-help />
</div> </div>
</div> </div>
`, </template
};
import Vue from 'vue'; import Vue from 'vue';
import MockAdapter from 'axios-mock-adapter'; import MockAdapter from 'axios-mock-adapter';
import axios from '~/lib/utils/axios_utils'; import axios from '~/lib/utils/axios_utils';
import mrWidgetOptions from 'ee/vue_merge_request_widget/mr_widget_options'; import mrWidgetOptions from 'ee/vue_merge_request_widget/mr_widget_options.vue';
import MRWidgetService from 'ee/vue_merge_request_widget/services/mr_widget_service'; import MRWidgetService from 'ee/vue_merge_request_widget/services/mr_widget_service';
import MRWidgetStore from 'ee/vue_merge_request_widget/stores/mr_widget_store'; import MRWidgetStore from 'ee/vue_merge_request_widget/stores/mr_widget_store';
import mountComponent from 'spec/helpers/vue_mount_component_helper'; import mountComponent from 'spec/helpers/vue_mount_component_helper';
......
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