Commit 1fd8f45d authored by Scott Hampton's avatar Scott Hampton

Merge branch '328230-move-props-to-inject' into 'master'

Remove unused prop injections and prefer injection over props

See merge request gitlab-org/gitlab!59967
parents 08a77336 e1a75994
...@@ -45,14 +45,8 @@ export default { ...@@ -45,14 +45,8 @@ export default {
'dashboardDocumentation', 'dashboardDocumentation',
'autoFixDocumentation', 'autoFixDocumentation',
'projectFullPath', 'projectFullPath',
'pipeline',
], ],
props: {
pipeline: {
type: Object,
required: false,
default: () => ({}),
},
},
queries: { queries: {
[DASHBOARD_TYPES.GROUP]: vulnerableProjectsGroupQuery, [DASHBOARD_TYPES.GROUP]: vulnerableProjectsGroupQuery,
[DASHBOARD_TYPES.INSTANCE]: vulnerableProjectsInstanceQuery, [DASHBOARD_TYPES.INSTANCE]: vulnerableProjectsInstanceQuery,
......
...@@ -22,8 +22,6 @@ export default (el, dashboardType) => { ...@@ -22,8 +22,6 @@ export default (el, dashboardType) => {
hasVulnerabilities, hasVulnerabilities,
scanners, scanners,
securityDashboardHelpPath, securityDashboardHelpPath,
projectAddEndpoint,
projectListEndpoint,
vulnerabilitiesExportEndpoint, vulnerabilitiesExportEndpoint,
projectFullPath, projectFullPath,
autoFixDocumentation, autoFixDocumentation,
...@@ -55,6 +53,7 @@ export default (el, dashboardType) => { ...@@ -55,6 +53,7 @@ export default (el, dashboardType) => {
} }
const provide = { const provide = {
pipeline: undefined,
dashboardType, dashboardType,
dashboardDocumentation, dashboardDocumentation,
noVulnerabilitiesSvgPath, noVulnerabilitiesSvgPath,
...@@ -77,14 +76,8 @@ export default (el, dashboardType) => { ...@@ -77,14 +76,8 @@ export default (el, dashboardType) => {
), ),
}; };
const props = {
projectAddEndpoint,
projectListEndpoint,
dashboardType,
};
if (dashboardType === DASHBOARD_TYPES.PROJECT) { if (dashboardType === DASHBOARD_TYPES.PROJECT) {
props.pipeline = { provide.pipeline = {
createdAt: pipelineCreatedAt, createdAt: pipelineCreatedAt,
id: pipelineId, id: pipelineId,
path: pipelinePath, path: pipelinePath,
...@@ -103,7 +96,7 @@ export default (el, dashboardType) => { ...@@ -103,7 +96,7 @@ export default (el, dashboardType) => {
apolloProvider, apolloProvider,
provide, provide,
render(createElement) { render(createElement) {
return createElement(VulnerabilityReport, { props }); return createElement(VulnerabilityReport);
}, },
}); });
}; };
...@@ -56,6 +56,7 @@ describe('Vulnerability Report', () => { ...@@ -56,6 +56,7 @@ describe('Vulnerability Report', () => {
mocks, mocks,
propsData, propsData,
provide: { provide: {
pipeline: undefined,
groupFullPath: undefined, groupFullPath: undefined,
projectFullPath: undefined, projectFullPath: undefined,
autoFixDocumentation: undefined, autoFixDocumentation: undefined,
...@@ -230,14 +231,8 @@ describe('Vulnerability Report', () => { ...@@ -230,14 +231,8 @@ describe('Vulnerability Report', () => {
provide: { provide: {
dashboardType: DASHBOARD_TYPES.PROJECT, dashboardType: DASHBOARD_TYPES.PROJECT,
autoFixDocumentation: 'path/to/help-page', autoFixDocumentation: 'path/to/help-page',
glFeatures: { pipeline: { id: '591' },
securityAutoFix, glFeatures: { securityAutoFix },
},
},
propsData: {
pipeline: {
id: '591',
},
}, },
apolloProvider: createApolloProvider(), apolloProvider: createApolloProvider(),
}); });
......
...@@ -12,8 +12,6 @@ const TEST_DATASET = { ...@@ -12,8 +12,6 @@ const TEST_DATASET = {
noPipelineRunScannersHelpPath: '/test/no_pipeline_run_page', noPipelineRunScannersHelpPath: '/test/no_pipeline_run_page',
notEnabledScannersHelpPath: '/test/security_dashboard_not_enabled_page', notEnabledScannersHelpPath: '/test/security_dashboard_not_enabled_page',
noVulnerabilitiesSvgPath: '/test/no_vulnerability_state.svg', noVulnerabilitiesSvgPath: '/test/no_vulnerability_state.svg',
projectAddEndpoint: '/test/add-projects',
projectListEndpoint: '/test/list-projects',
securityDashboardHelpPath: '/test/security_dashboard_page', securityDashboardHelpPath: '/test/security_dashboard_page',
svgPath: '/test/no_changes_state.svg', svgPath: '/test/no_changes_state.svg',
vulnerabilitiesExportEndpoint: '/test/export-vulnerabilities', vulnerabilitiesExportEndpoint: '/test/export-vulnerabilities',
......
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