2022-07-08 18:10:05 +00:00
|
|
|
import { GlToast } from '@gitlab/ui';
|
2018-10-17 10:34:19 +00:00
|
|
|
import Vue from 'vue';
|
2022-09-15 18:10:36 +00:00
|
|
|
import JobApp from './components/job/job_app.vue';
|
2020-02-04 12:09:00 +00:00
|
|
|
import createStore from './store';
|
2018-10-17 10:34:19 +00:00
|
|
|
|
2022-07-08 18:10:05 +00:00
|
|
|
Vue.use(GlToast);
|
|
|
|
|
2021-12-10 18:14:42 +00:00
|
|
|
const initializeJobPage = (element) => {
|
2020-02-04 12:09:00 +00:00
|
|
|
const store = createStore();
|
|
|
|
|
|
|
|
// Let's start initializing the store (i.e. fetching data) right away
|
|
|
|
store.dispatch('init', element.dataset);
|
|
|
|
|
2020-11-10 12:08:57 +00:00
|
|
|
const {
|
|
|
|
artifactHelpUrl,
|
|
|
|
deploymentHelpUrl,
|
|
|
|
runnerSettingsUrl,
|
|
|
|
subscriptionsMoreMinutesUrl,
|
|
|
|
endpoint,
|
|
|
|
pagePath,
|
|
|
|
logState,
|
|
|
|
buildStatus,
|
|
|
|
projectPath,
|
|
|
|
retryOutdatedJobDocsUrl,
|
|
|
|
} = element.dataset;
|
|
|
|
|
2018-10-17 10:34:19 +00:00
|
|
|
return new Vue({
|
|
|
|
el: element,
|
2020-02-04 12:09:00 +00:00
|
|
|
store,
|
2018-10-17 10:34:19 +00:00
|
|
|
components: {
|
|
|
|
JobApp,
|
|
|
|
},
|
2020-11-10 12:08:57 +00:00
|
|
|
provide: {
|
|
|
|
retryOutdatedJobDocsUrl,
|
|
|
|
},
|
2018-10-17 10:34:19 +00:00
|
|
|
render(createElement) {
|
|
|
|
return createElement('job-app', {
|
|
|
|
props: {
|
2020-09-07 06:08:35 +00:00
|
|
|
artifactHelpUrl,
|
2019-08-05 12:12:47 +00:00
|
|
|
deploymentHelpUrl,
|
|
|
|
runnerSettingsUrl,
|
2019-09-04 20:48:58 +00:00
|
|
|
subscriptionsMoreMinutesUrl,
|
2019-08-05 12:12:47 +00:00
|
|
|
endpoint,
|
|
|
|
pagePath,
|
|
|
|
logState,
|
|
|
|
buildStatus,
|
|
|
|
projectPath,
|
2018-10-17 10:34:19 +00:00
|
|
|
},
|
|
|
|
});
|
|
|
|
},
|
|
|
|
});
|
|
|
|
};
|
2021-12-10 18:14:42 +00:00
|
|
|
|
|
|
|
export default () => {
|
|
|
|
const jobElement = document.getElementById('js-job-page');
|
2022-07-06 18:08:29 +00:00
|
|
|
initializeJobPage(jobElement);
|
2021-12-10 18:14:42 +00:00
|
|
|
};
|