Commit e8a2e02a authored by Dave Pisek's avatar Dave Pisek

Add vulnerable projects to instance dashboard

This commit injects an endpoint into the instance security
dashboard component, so it renders the vulnerable projects widget.
parent 064696e1
...@@ -18,6 +18,7 @@ if (gon.features && gon.features.securityDashboard) { ...@@ -18,6 +18,7 @@ if (gon.features && gon.features.securityDashboard) {
vulnerabilitiesEndpoint, vulnerabilitiesEndpoint,
vulnerabilitiesHistoryEndpoint, vulnerabilitiesHistoryEndpoint,
vulnerabilityFeedbackHelpPath, vulnerabilityFeedbackHelpPath,
vulnerableProjectsEndpoint,
} = el.dataset; } = el.dataset;
const router = createRouter(); const router = createRouter();
const store = createStore({ plugins: [projectSelector, syncWithRouter(router)] }); const store = createStore({ plugins: [projectSelector, syncWithRouter(router)] });
...@@ -41,6 +42,7 @@ if (gon.features && gon.features.securityDashboard) { ...@@ -41,6 +42,7 @@ if (gon.features && gon.features.securityDashboard) {
vulnerabilitiesEndpoint, vulnerabilitiesEndpoint,
vulnerabilitiesHistoryEndpoint, vulnerabilitiesHistoryEndpoint,
vulnerabilityFeedbackHelpPath, vulnerabilityFeedbackHelpPath,
vulnerableProjectsEndpoint,
}, },
}); });
}, },
......
...@@ -52,6 +52,11 @@ export default { ...@@ -52,6 +52,11 @@ export default {
type: String, type: String,
required: true, required: true,
}, },
vulnerableProjectsEndpoint: {
type: String,
required: false,
default: '',
},
}, },
data() { data() {
return { return {
...@@ -143,6 +148,7 @@ export default { ...@@ -143,6 +148,7 @@ export default {
:vulnerabilities-count-endpoint="vulnerabilitiesCountEndpoint" :vulnerabilities-count-endpoint="vulnerabilitiesCountEndpoint"
:vulnerabilities-history-endpoint="vulnerabilitiesHistoryEndpoint" :vulnerabilities-history-endpoint="vulnerabilitiesHistoryEndpoint"
:vulnerability-feedback-help-path="vulnerabilityFeedbackHelpPath" :vulnerability-feedback-help-path="vulnerabilityFeedbackHelpPath"
:vulnerable-projects-endpoint="vulnerableProjectsEndpoint"
/> />
</template> </template>
</template> </template>
......
...@@ -17,6 +17,7 @@ const vulnerabilitiesEndpoint = '/vulnerabilities'; ...@@ -17,6 +17,7 @@ const vulnerabilitiesEndpoint = '/vulnerabilities';
const vulnerabilitiesCountEndpoint = '/vulnerabilities_summary'; const vulnerabilitiesCountEndpoint = '/vulnerabilities_summary';
const vulnerabilitiesHistoryEndpoint = '/vulnerabilities_history'; const vulnerabilitiesHistoryEndpoint = '/vulnerabilities_history';
const vulnerabilityFeedbackHelpPath = '/vulnerabilities_feedback_help'; const vulnerabilityFeedbackHelpPath = '/vulnerabilities_feedback_help';
const vulnerableProjectsEndpoint = '/vulnerable_projects_endpoint';
describe('Instance Security Dashboard component', () => { describe('Instance Security Dashboard component', () => {
let store; let store;
...@@ -60,6 +61,7 @@ describe('Instance Security Dashboard component', () => { ...@@ -60,6 +61,7 @@ describe('Instance Security Dashboard component', () => {
vulnerabilitiesCountEndpoint, vulnerabilitiesCountEndpoint,
vulnerabilitiesHistoryEndpoint, vulnerabilitiesHistoryEndpoint,
vulnerabilityFeedbackHelpPath, vulnerabilityFeedbackHelpPath,
vulnerableProjectsEndpoint,
}, },
}); });
}; };
...@@ -164,6 +166,7 @@ describe('Instance Security Dashboard component', () => { ...@@ -164,6 +166,7 @@ describe('Instance Security Dashboard component', () => {
vulnerabilitiesCountEndpoint, vulnerabilitiesCountEndpoint,
vulnerabilitiesHistoryEndpoint, vulnerabilitiesHistoryEndpoint,
vulnerabilityFeedbackHelpPath, vulnerabilityFeedbackHelpPath,
vulnerableProjectsEndpoint,
}); });
}); });
......
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