debian-mirror-gitlab/app/assets/javascripts/pages/projects/new/index.js

31 lines
964 B
JavaScript
Raw Normal View History

2018-03-17 18:26:18 +05:30
import initProjectVisibilitySelector from '../../../project_visibility';
import initProjectNew from '../../../projects/project_new';
2020-06-23 00:09:42 +05:30
import { __ } from '~/locale';
2020-10-24 23:57:45 +05:30
import { deprecatedCreateFlash as createFlash } from '~/flash';
2018-03-17 18:26:18 +05:30
2018-03-27 19:54:05 +05:30
document.addEventListener('DOMContentLoaded', () => {
2018-03-17 18:26:18 +05:30
initProjectVisibilitySelector();
initProjectNew.bindEvents();
2020-06-23 00:09:42 +05:30
2021-02-22 17:27:13 +05:30
import(
/* webpackChunkName: 'experiment_new_project_creation' */ '../../../projects/experiment_new_project_creation'
)
2021-03-08 18:12:59 +05:30
.then((m) => {
2021-02-22 17:27:13 +05:30
const el = document.querySelector('.js-experiment-new-project-creation');
2020-06-23 00:09:42 +05:30
2021-02-22 17:27:13 +05:30
if (!el) {
return;
}
2020-06-23 00:09:42 +05:30
2021-02-22 17:27:13 +05:30
const config = {
hasErrors: 'hasErrors' in el.dataset,
isCiCdAvailable: 'isCiCdAvailable' in el.dataset,
newProjectGuidelines: el.dataset.newProjectGuidelines,
};
m.default(el, config);
})
.catch(() => {
createFlash(__('An error occurred while loading project creation UI'));
});
2018-03-27 19:54:05 +05:30
});