Commit 44456e4f authored by Andrew Fontaine's avatar Andrew Fontaine

Merge branch '285084-move-app-init-location' into 'master'

Move the init code to the relevant folder

See merge request gitlab-org/gitlab!48663
parents 80635b3f ae8f36f6
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 => {
if (!el) {
return null;
}
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