Commit 70db1eba authored by Ezekiel Kigbo's avatar Ezekiel Kigbo

Merge branch 'fix/code-quality-widget-links' into 'master'

Fix links in code quality widget

See merge request gitlab-org/gitlab!63346
parents cfdcc0dc 10265281
...@@ -12,11 +12,24 @@ export default { ...@@ -12,11 +12,24 @@ export default {
ReportSection, ReportSection,
}, },
props: { props: {
headPath: {
type: String,
required: true,
},
headBlobPath: {
type: String,
required: true,
},
basePath: { basePath: {
type: String, type: String,
required: false, required: false,
default: null, default: null,
}, },
baseBlobPath: {
type: String,
required: false,
default: null,
},
codequalityReportsPath: { codequalityReportsPath: {
type: String, type: String,
required: false, required: false,
...@@ -40,6 +53,9 @@ export default { ...@@ -40,6 +53,9 @@ export default {
created() { created() {
this.setPaths({ this.setPaths({
basePath: this.basePath, basePath: this.basePath,
headPath: this.headPath,
baseBlobPath: this.baseBlobPath,
headBlobPath: this.headBlobPath,
reportsPath: this.codequalityReportsPath, reportsPath: this.codequalityReportsPath,
helpPath: this.codequalityHelpPath, helpPath: this.codequalityHelpPath,
}); });
......
...@@ -3,6 +3,9 @@ import * as types from './mutation_types'; ...@@ -3,6 +3,9 @@ import * as types from './mutation_types';
export default { export default {
[types.SET_PATHS](state, paths) { [types.SET_PATHS](state, paths) {
state.basePath = paths.basePath; state.basePath = paths.basePath;
state.headPath = paths.headPath;
state.baseBlobPath = paths.baseBlobPath;
state.headBlobPath = paths.headBlobPath;
state.reportsPath = paths.reportsPath; state.reportsPath = paths.reportsPath;
state.helpPath = paths.helpPath; state.helpPath = paths.helpPath;
}, },
......
...@@ -497,6 +497,9 @@ export default { ...@@ -497,6 +497,9 @@ export default {
<grouped-codequality-reports-app <grouped-codequality-reports-app
v-if="shouldRenderCodeQuality" v-if="shouldRenderCodeQuality"
:base-path="mr.codeclimate.base_path" :base-path="mr.codeclimate.base_path"
:head-path="mr.codeclimate.head_path"
:head-blob-path="mr.headBlobPath"
:base-blob-path="mr.baseBlobPath"
:codequality-reports-path="mr.codequalityReportsPath" :codequality-reports-path="mr.codequalityReportsPath"
:codequality-help-path="mr.codequalityHelpPath" :codequality-help-path="mr.codequalityHelpPath"
/> />
......
...@@ -303,6 +303,9 @@ export default { ...@@ -303,6 +303,9 @@ export default {
<grouped-codequality-reports-app <grouped-codequality-reports-app
v-if="shouldRenderCodeQuality" v-if="shouldRenderCodeQuality"
:base-path="mr.codeclimate.base_path" :base-path="mr.codeclimate.base_path"
:head-path="mr.codeclimate.head_path"
:head-blob-path="mr.headBlobPath"
:base-blob-path="mr.baseBlobPath"
:codequality-reports-path="mr.codequalityReportsPath" :codequality-reports-path="mr.codequalityReportsPath"
:codequality-help-path="mr.codequalityHelpPath" :codequality-help-path="mr.codequalityHelpPath"
/> />
......
...@@ -20,6 +20,9 @@ describe('Codequality Reports actions', () => { ...@@ -20,6 +20,9 @@ describe('Codequality Reports actions', () => {
it('should commit SET_PATHS mutation', (done) => { it('should commit SET_PATHS mutation', (done) => {
const paths = { const paths = {
basePath: 'basePath', basePath: 'basePath',
headPath: 'headPath',
baseBlobPath: 'baseBlobPath',
headBlobPath: 'headBlobPath',
reportsPath: 'reportsPath', reportsPath: 'reportsPath',
helpPath: 'codequalityHelpPath', helpPath: 'codequalityHelpPath',
}; };
......
...@@ -13,16 +13,25 @@ describe('Codequality Reports mutations', () => { ...@@ -13,16 +13,25 @@ describe('Codequality Reports mutations', () => {
describe('SET_PATHS', () => { describe('SET_PATHS', () => {
it('sets paths to given values', () => { it('sets paths to given values', () => {
const basePath = 'base.json'; const basePath = 'base.json';
const headPath = 'head.json';
const baseBlobPath = 'base/blob/path/';
const headBlobPath = 'head/blob/path/';
const reportsPath = 'reports.json'; const reportsPath = 'reports.json';
const helpPath = 'help.html'; const helpPath = 'help.html';
mutations.SET_PATHS(localState, { mutations.SET_PATHS(localState, {
basePath, basePath,
headPath,
baseBlobPath,
headBlobPath,
reportsPath, reportsPath,
helpPath, helpPath,
}); });
expect(localState.basePath).toEqual(basePath); expect(localState.basePath).toEqual(basePath);
expect(localState.headPath).toEqual(headPath);
expect(localState.baseBlobPath).toEqual(baseBlobPath);
expect(localState.headBlobPath).toEqual(headBlobPath);
expect(localState.reportsPath).toEqual(reportsPath); expect(localState.reportsPath).toEqual(reportsPath);
expect(localState.helpPath).toEqual(helpPath); expect(localState.helpPath).toEqual(helpPath);
}); });
......
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