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