Commit f04fcc23 authored by Savas Vedova's avatar Savas Vedova

Move the init code to the relevant folder

Follow the same pattern we're using in the security dashboards
and move the init code to the appropriate folder
parent 87a0c544
import Vue from 'vue';
import MainApp from 'ee/vulnerabilities/components/vulnerability.vue';
import { convertObjectPropsToCamelCase } from '~/lib/utils/common_utils';
import initVulnerabilities from 'ee/vulnerabilities/vulnerabilities_init';
(function createMainApp() {
const el = document.getElementById('js-vulnerability-main');
const vulnerability = convertObjectPropsToCamelCase(JSON.parse(el.dataset.vulnerability), {
deep: true,
});
return new Vue({
el,
provide: {
reportType: vulnerability.reportType,
createIssueUrl: vulnerability.createIssueUrl,
projectFingerprint: vulnerability.projectFingerprint,
vulnerabilityId: vulnerability.id,
issueTrackingHelpPath: vulnerability.issueTrackingHelpPath,
permissionsHelpPath: vulnerability.permissionsHelpPath,
},
render: h =>
h(MainApp, {
props: { vulnerability },
}),
});
})();
initVulnerabilities(document.getElementById('js-vulnerability-main'));
import Vue from 'vue';
import App from 'ee/vulnerabilities/components/vulnerability.vue';
import { convertObjectPropsToCamelCase } from '~/lib/utils/common_utils';
export default el => {
const vulnerability = convertObjectPropsToCamelCase(JSON.parse(el.dataset.vulnerability), {
deep: true,
});
return new Vue({
el,
provide: {
reportType: vulnerability.reportType,
createIssueUrl: vulnerability.createIssueUrl,
projectFingerprint: vulnerability.projectFingerprint,
vulnerabilityId: vulnerability.id,
issueTrackingHelpPath: vulnerability.issueTrackingHelpPath,
permissionsHelpPath: vulnerability.permissionsHelpPath,
},
render: h =>
h(App, {
props: { vulnerability },
}),
});
};
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