debian-mirror-gitlab/app/assets/javascripts/issues/dashboard/index.js

58 lines
1.6 KiB
JavaScript
Raw Normal View History

2023-01-13 00:05:48 +05:30
import Vue from 'vue';
2023-03-04 22:38:38 +05:30
import VueApollo from 'vue-apollo';
import createDefaultClient from '~/lib/graphql';
2023-01-13 00:05:48 +05:30
import { parseBoolean } from '~/lib/utils/common_utils';
import IssuesDashboardApp from './components/issues_dashboard_app.vue';
export function mountIssuesDashboardApp() {
const el = document.querySelector('.js-issues-dashboard');
if (!el) {
return null;
}
2023-03-04 22:38:38 +05:30
Vue.use(VueApollo);
const {
2023-03-17 16:20:25 +05:30
autocompleteAwardEmojisPath,
2023-03-04 22:38:38 +05:30
calendarPath,
2023-03-17 16:20:25 +05:30
dashboardLabelsPath,
dashboardMilestonesPath,
emptyStateWithFilterSvgPath,
emptyStateWithoutFilterSvgPath,
2023-03-04 22:38:38 +05:30
hasBlockedIssuesFeature,
hasIssuableHealthStatusFeature,
hasIssueWeightsFeature,
hasScopedLabelsFeature,
initialSort,
isPublicVisibilityRestricted,
isSignedIn,
rssPath,
} = el.dataset;
2023-01-13 00:05:48 +05:30
return new Vue({
el,
name: 'IssuesDashboardRoot',
2023-03-04 22:38:38 +05:30
apolloProvider: new VueApollo({
defaultClient: createDefaultClient(),
}),
2023-01-13 00:05:48 +05:30
provide: {
2023-03-17 16:20:25 +05:30
autocompleteAwardEmojisPath,
2023-01-13 00:05:48 +05:30
calendarPath,
2023-03-17 16:20:25 +05:30
dashboardLabelsPath,
dashboardMilestonesPath,
emptyStateWithFilterSvgPath,
emptyStateWithoutFilterSvgPath,
2023-03-04 22:38:38 +05:30
hasBlockedIssuesFeature: parseBoolean(hasBlockedIssuesFeature),
hasIssuableHealthStatusFeature: parseBoolean(hasIssuableHealthStatusFeature),
hasIssueWeightsFeature: parseBoolean(hasIssueWeightsFeature),
hasScopedLabelsFeature: parseBoolean(hasScopedLabelsFeature),
initialSort,
isPublicVisibilityRestricted: parseBoolean(isPublicVisibilityRestricted),
2023-01-13 00:05:48 +05:30
isSignedIn: parseBoolean(isSignedIn),
rssPath,
},
render: (createComponent) => createComponent(IssuesDashboardApp),
});
}