Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/assets/javascripts/issues/new/index.js')
-rw-r--r--app/assets/javascripts/issues/new/index.js27
1 files changed, 27 insertions, 0 deletions
diff --git a/app/assets/javascripts/issues/new/index.js b/app/assets/javascripts/issues/new/index.js
index 91599502996..84a170e6564 100644
--- a/app/assets/javascripts/issues/new/index.js
+++ b/app/assets/javascripts/issues/new/index.js
@@ -1,8 +1,10 @@
import Vue from 'vue';
import VueApollo from 'vue-apollo';
import createDefaultClient from '~/lib/graphql';
+import { parseBoolean } from '~/lib/utils/common_utils';
import TitleSuggestions from './components/title_suggestions.vue';
import TypePopover from './components/type_popover.vue';
+import TypeSelect from './components/type_select.vue';
export function initTitleSuggestions() {
const el = document.getElementById('js-suggestions');
@@ -56,3 +58,28 @@ export function initTypePopover() {
render: (createElement) => createElement(TypePopover),
});
}
+
+export function initTypeSelect() {
+ const el = document.getElementById('js-type-select');
+
+ if (!el) {
+ return undefined;
+ }
+
+ const { selectedType, isIssueAllowed, isIncidentAllowed, issuePath, incidentPath } = el.dataset;
+
+ return new Vue({
+ el,
+ name: 'TypeSelectRoot',
+ render: (createElement) =>
+ createElement(TypeSelect, {
+ props: {
+ selectedType,
+ isIssueAllowed: parseBoolean(isIssueAllowed),
+ isIncidentAllowed: parseBoolean(isIncidentAllowed),
+ issuePath,
+ incidentPath,
+ },
+ }),
+ });
+}