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

Review feedback: Renaming, init function

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