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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
|
import Vue from 'vue';
import VueApollo from 'vue-apollo';
import VueRouter from 'vue-router';
import IssuesListApp from 'ee_else_ce/issues/list/components/issues_list_app.vue';
import { parseBoolean } from '~/lib/utils/common_utils';
import JiraIssuesImportStatusApp from './components/jira_issues_import_status_app.vue';
import { gqlClient } from './graphql';
export async function mountJiraIssuesListApp() {
const el = document.querySelector('.js-jira-issues-import-status-root');
if (!el) {
return null;
}
const { issuesPath, projectPath } = el.dataset;
const canEdit = parseBoolean(el.dataset.canEdit);
const isJiraConfigured = parseBoolean(el.dataset.isJiraConfigured);
if (!isJiraConfigured || !canEdit) {
return null;
}
Vue.use(VueApollo);
return new Vue({
el,
name: 'JiraIssuesImportStatusRoot',
apolloProvider: new VueApollo({
defaultClient: await gqlClient(),
}),
render(createComponent) {
return createComponent(JiraIssuesImportStatusApp, {
props: {
canEdit,
isJiraConfigured,
issuesPath,
projectPath,
},
});
},
});
}
export async function mountIssuesListApp() {
const el = document.querySelector('.js-issues-list-root');
if (!el) {
return null;
}
Vue.use(VueApollo);
Vue.use(VueRouter);
const {
autocompleteAwardEmojisPath,
calendarPath,
canBulkUpdate,
canCreateProjects,
canEdit,
canImportIssues,
canReadCrmContact,
canReadCrmOrganization,
email,
emailsHelpPagePath,
emptyStateSvgPath,
exportCsvPath,
fullPath,
groupPath,
hasAnyIssues,
hasAnyProjects,
hasBlockedIssuesFeature,
hasIssuableHealthStatusFeature,
hasIssueWeightsFeature,
hasIterationsFeature,
hasScopedLabelsFeature,
hasOkrsFeature,
importCsvIssuesPath,
initialEmail,
initialSort,
isIssueRepositioningDisabled,
isProject,
isPublicVisibilityRestricted,
isSignedIn,
jiraIntegrationPath,
markdownHelpPath,
maxAttachmentSize,
newIssuePath,
newProjectPath,
projectImportJiraPath,
quickActionsHelpPath,
releasesPath,
resetPath,
rssPath,
showNewIssueLink,
signInPath,
groupId = '',
} = el.dataset;
return new Vue({
el,
name: 'IssuesListRoot',
apolloProvider: new VueApollo({
defaultClient: await gqlClient(),
}),
router: new VueRouter({
base: window.location.pathname,
mode: 'history',
routes: [{ path: '/' }],
}),
provide: {
autocompleteAwardEmojisPath,
calendarPath,
canBulkUpdate: parseBoolean(canBulkUpdate),
canCreateProjects: parseBoolean(canCreateProjects),
canReadCrmContact: parseBoolean(canReadCrmContact),
canReadCrmOrganization: parseBoolean(canReadCrmOrganization),
emptyStateSvgPath,
fullPath,
groupPath,
hasAnyIssues: parseBoolean(hasAnyIssues),
hasAnyProjects: parseBoolean(hasAnyProjects),
hasBlockedIssuesFeature: parseBoolean(hasBlockedIssuesFeature),
hasIssuableHealthStatusFeature: parseBoolean(hasIssuableHealthStatusFeature),
hasIssueWeightsFeature: parseBoolean(hasIssueWeightsFeature),
hasIterationsFeature: parseBoolean(hasIterationsFeature),
hasScopedLabelsFeature: parseBoolean(hasScopedLabelsFeature),
hasOkrsFeature: parseBoolean(hasOkrsFeature),
initialSort,
isIssueRepositioningDisabled: parseBoolean(isIssueRepositioningDisabled),
isProject: parseBoolean(isProject),
isPublicVisibilityRestricted: parseBoolean(isPublicVisibilityRestricted),
isSignedIn: parseBoolean(isSignedIn),
jiraIntegrationPath,
newIssuePath,
newProjectPath,
releasesPath,
rssPath,
showNewIssueLink: parseBoolean(showNewIssueLink),
signInPath,
// For CsvImportExportButtons component
canEdit: parseBoolean(canEdit),
email,
exportCsvPath,
importCsvIssuesPath,
maxAttachmentSize,
projectImportJiraPath,
showExportButton: parseBoolean(hasAnyIssues),
showImportButton: parseBoolean(canImportIssues),
showLabel: !parseBoolean(hasAnyIssues),
// For IssuableByEmail component
emailsHelpPagePath,
initialEmail,
markdownHelpPath,
quickActionsHelpPath,
resetPath,
groupId,
},
render: (createComponent) => createComponent(IssuesListApp),
});
}
|