1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
|
import Vue from 'vue';
import VueApollo from 'vue-apollo';
import createDefaultClient from '~/lib/graphql';
import { VARIANT_EMBEDDED } from '~/sidebar/components/labels/labels_select_widget/constants';
import { WORKSPACE_PROJECT } from '~/issues/constants';
import IssuableLabelSelector from '~/vue_shared/issuable/create/components/issuable_label_selector.vue';
Vue.use(VueApollo);
const apolloProvider = new VueApollo({
defaultClient: createDefaultClient(),
});
export default () => {
const el = document.querySelector('.js-issuable-form-label-selector');
if (!el) {
return false;
}
const {
fieldName,
fullPath,
initialLabels,
issuableType,
labelsFilterBasePath,
labelsManagePath,
} = el.dataset;
return new Vue({
el,
apolloProvider,
provide: {
allowLabelCreate: true,
allowLabelEdit: true,
allowLabelRemove: true,
allowScopedLabels: true,
attrWorkspacePath: fullPath,
fieldName,
fullPath,
initialLabels: JSON.parse(initialLabels),
issuableType,
labelType: WORKSPACE_PROJECT,
labelsFilterBasePath,
labelsManagePath,
variant: VARIANT_EMBEDDED,
workspaceType: WORKSPACE_PROJECT,
toggleAttrs: { 'data-testid': 'issuable-label-dropdown' },
},
render(createElement) {
return createElement(IssuableLabelSelector);
},
});
};
|