Commit 4ea68d4a authored by Dave Pisek's avatar Dave Pisek

Review feedback: Renaming, init function

parent a7098dbb
...@@ -23,7 +23,7 @@ export default () => { ...@@ -23,7 +23,7 @@ export default () => {
vulnerabilitiesEndpoint, vulnerabilitiesEndpoint,
emptyStateUnauthorizedSvgPath, emptyStateUnauthorizedSvgPath,
emptyStateForbiddenSvgPath, emptyStateForbiddenSvgPath,
projectCommitPath, commitBasePath,
projectFullPath, projectFullPath,
pipelineJobsPath, pipelineJobsPath,
canAdminVulnerability, canAdminVulnerability,
...@@ -44,7 +44,7 @@ export default () => { ...@@ -44,7 +44,7 @@ export default () => {
provide: { provide: {
dashboardType: DASHBOARD_TYPES.PIPELINE, dashboardType: DASHBOARD_TYPES.PIPELINE,
projectId: parseInt(projectId, 10), projectId: parseInt(projectId, 10),
projectCommitPath, commitBasePath,
projectFullPath, projectFullPath,
dashboardDocumentation, dashboardDocumentation,
emptyStateSvgPath, emptyStateSvgPath,
......
...@@ -5,7 +5,7 @@ export default { ...@@ -5,7 +5,7 @@ export default {
components: { components: {
GlLink, GlLink,
}, },
inject: ['projectCommitPath'], inject: ['commitBasePath'],
props: { props: {
value: { value: {
type: String, type: String,
...@@ -13,13 +13,13 @@ export default { ...@@ -13,13 +13,13 @@ export default {
}, },
}, },
computed: { computed: {
linkToCommit() { commitPath() {
return `${this.projectCommitPath}/${this.value}`; return `${this.commitBasePath}/${this.value}`;
}, },
}, },
}; };
</script> </script>
<template> <template>
<gl-link :href="linkToCommit">{{ value }}</gl-link> <gl-link :href="commitPath">{{ value }}</gl-link>
</template> </template>
...@@ -8,9 +8,7 @@ export default (el) => { ...@@ -8,9 +8,7 @@ export default (el) => {
return null; return null;
} }
const { vulnerability: rawVulnerability, projectCommitPath } = el.dataset; const vulnerability = convertObjectPropsToCamelCase(JSON.parse(el.dataset.vulnerability), {
const vulnerability = convertObjectPropsToCamelCase(JSON.parse(rawVulnerability), {
deep: true, deep: true,
}); });
...@@ -20,7 +18,7 @@ export default (el) => { ...@@ -20,7 +18,7 @@ export default (el) => {
provide: { provide: {
reportType: vulnerability.reportType, reportType: vulnerability.reportType,
newIssueUrl: vulnerability.newIssueUrl, newIssueUrl: vulnerability.newIssueUrl,
projectCommitPath, commitBasePath: el.dataset.commitBasePath,
projectFingerprint: vulnerability.projectFingerprint, projectFingerprint: vulnerability.projectFingerprint,
projectFullPath: vulnerability.project?.fullPath, projectFullPath: vulnerability.project?.fullPath,
vulnerabilityId: vulnerability.id, vulnerabilityId: vulnerability.id,
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
empty_state_unauthorized_svg_path: image_path('illustrations/user-not-logged-in.svg'), empty_state_unauthorized_svg_path: image_path('illustrations/user-not-logged-in.svg'),
empty_state_forbidden_svg_path: image_path('illustrations/lock_promotion.svg'), empty_state_forbidden_svg_path: image_path('illustrations/lock_promotion.svg'),
project_full_path: project.path_with_namespace, project_full_path: project.path_with_namespace,
project_commit_path: "#{project_path(project)}/-/commit", commit_base_path: "#{project_path(project)}/-/commit",
can_admin_vulnerability: can?(current_user, :admin_vulnerability, project).to_s, can_admin_vulnerability: can?(current_user, :admin_vulnerability, project).to_s,
security_report_help_page_link: help_page_path('user/application_security/index', anchor: 'security-report-validation') } } security_report_help_page_link: help_page_path('user/application_security/index', anchor: 'security-report-validation') } }
......
...@@ -6,4 +6,4 @@ ...@@ -6,4 +6,4 @@
- add_page_specific_style 'page_bundles/security_dashboard' - add_page_specific_style 'page_bundles/security_dashboard'
#js-vulnerability-main{ data: { vulnerability: vulnerability_details_json(@vulnerability, @pipeline), #js-vulnerability-main{ data: { vulnerability: vulnerability_details_json(@vulnerability, @pipeline),
project_commit_path: "#{project_path(@vulnerability.project)}/-/commit" } } commit_base_path: "#{project_path(@vulnerability.project)}/-/commit" } }
...@@ -14,7 +14,7 @@ describe('ee/vulnerabilities/components/generic_report/types/commit.vue', () => ...@@ -14,7 +14,7 @@ describe('ee/vulnerabilities/components/generic_report/types/commit.vue', () =>
return shallowMount(Commit, { return shallowMount(Commit, {
propsData: TEST_DATA, propsData: TEST_DATA,
provide: { provide: {
projectCommitPath: TEST_PROJECT_COMMIT_PATH, commitBasePath: TEST_PROJECT_COMMIT_PATH,
}, },
}); });
}; };
......
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