Commit 1e45c8e4 authored by Dave Pisek's avatar Dave Pisek

Pipeline Security Dashboard: move props to inject

This commit removes all props and provides the values via injecting
them.
parent 438bd0a3
...@@ -20,21 +20,15 @@ export default { ...@@ -20,21 +20,15 @@ export default {
VulnerabilityReport, VulnerabilityReport,
}, },
mixins: [glFeatureFlagMixin()], mixins: [glFeatureFlagMixin()],
inject: ['projectFullPath', 'pipeline', 'dashboardDocumentation', 'emptyStateSvgPath'], inject: [
props: { 'dashboardDocumentation',
projectId: { 'emptyStateSvgPath',
type: Number, 'loadingErrorIllustrations',
required: true, 'pipeline',
}, 'projectFullPath',
vulnerabilitiesEndpoint: { 'projectId',
type: String, 'vulnerabilitiesEndpoint',
required: true, ],
},
loadingErrorIllustrations: {
type: Object,
required: true,
},
},
data() { data() {
return { return {
securityReportSummary: {}, securityReportSummary: {},
......
...@@ -42,6 +42,7 @@ export default () => { ...@@ -42,6 +42,7 @@ export default () => {
}), }),
provide: { provide: {
dashboardType: DASHBOARD_TYPES.PIPELINE, dashboardType: DASHBOARD_TYPES.PIPELINE,
projectId: parseInt(projectId, 10),
projectFullPath, projectFullPath,
dashboardDocumentation, dashboardDocumentation,
emptyStateSvgPath, emptyStateSvgPath,
...@@ -53,15 +54,11 @@ export default () => { ...@@ -53,15 +54,11 @@ export default () => {
sourceBranch, sourceBranch,
}, },
securityReportHelpPageLink, securityReportHelpPageLink,
vulnerabilitiesEndpoint,
loadingErrorIllustrations,
}, },
render(createElement) { render(createElement) {
return createElement(PipelineSecurityDashboard, { return createElement(PipelineSecurityDashboard);
props: {
projectId: parseInt(projectId, 10),
vulnerabilitiesEndpoint,
loadingErrorIllustrations,
},
});
}, },
}); });
}; };
...@@ -55,6 +55,7 @@ describe('Pipeline Security Dashboard component', () => { ...@@ -55,6 +55,7 @@ describe('Pipeline Security Dashboard component', () => {
localVue, localVue,
store, store,
provide: { provide: {
projectId,
projectFullPath: 'my-path', projectFullPath: 'my-path',
emptyStateSvgPath, emptyStateSvgPath,
dashboardDocumentation, dashboardDocumentation,
...@@ -64,12 +65,9 @@ describe('Pipeline Security Dashboard component', () => { ...@@ -64,12 +65,9 @@ describe('Pipeline Security Dashboard component', () => {
jobsPath, jobsPath,
sourceBranch, sourceBranch,
}, },
...provide,
},
propsData: {
projectId,
vulnerabilitiesEndpoint, vulnerabilitiesEndpoint,
loadingErrorIllustrations, loadingErrorIllustrations,
...provide,
}, },
stubs, stubs,
data() { data() {
......
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