diff options
Diffstat (limited to 'app/assets/javascripts/work_items/index.js')
-rw-r--r-- | app/assets/javascripts/work_items/index.js | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/app/assets/javascripts/work_items/index.js b/app/assets/javascripts/work_items/index.js index 70bda7d3783..0b7f9290d6e 100644 --- a/app/assets/javascripts/work_items/index.js +++ b/app/assets/javascripts/work_items/index.js @@ -1,17 +1,25 @@ import Vue from 'vue'; import VueApollo from 'vue-apollo'; +import { WORKSPACE_GROUP } from '~/issues/constants'; import { parseBoolean } from '~/lib/utils/common_utils'; import { apolloProvider } from '~/graphql_shared/issuable_client'; import App from './components/app.vue'; +import WorkItemRoot from './pages/work_item_root.vue'; import { createRouter } from './router'; Vue.use(VueApollo); -export const initWorkItemsRoot = () => { +export const initWorkItemsRoot = (workspace) => { const el = document.querySelector('#js-work-items'); + + if (!el) { + return undefined; + } + const { fullPath, hasIssueWeightsFeature, + iid, issuesListPath, registerPath, signInPath, @@ -22,6 +30,8 @@ export const initWorkItemsRoot = () => { reportAbusePath, } = el.dataset; + const Component = workspace === WORKSPACE_GROUP ? WorkItemRoot : App; + return new Vue({ el, name: 'WorkItemsRoot', @@ -29,6 +39,7 @@ export const initWorkItemsRoot = () => { apolloProvider, provide: { fullPath, + isGroup: workspace === WORKSPACE_GROUP, hasIssueWeightsFeature: parseBoolean(hasIssueWeightsFeature), hasOkrsFeature: parseBoolean(hasOkrsFeature), issuesListPath, @@ -40,7 +51,11 @@ export const initWorkItemsRoot = () => { reportAbusePath, }, render(createElement) { - return createElement(App); + return createElement(Component, { + props: { + iid: workspace === WORKSPACE_GROUP ? iid : undefined, + }, + }); }, }); }; |