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

50 lines
1.4 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 {
calendarPath,
emptyStateSvgPath,
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: {
calendarPath,
emptyStateSvgPath,
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),
});
}