Skip to content

Commit

Permalink
fix: import TaskBody globally
Browse files Browse the repository at this point in the history
Signed-off-by: Raimund Schlüßler <[email protected]>
  • Loading branch information
raimund-schluessler committed Jan 7, 2024
1 parent aebb353 commit 0ff37fb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 14 deletions.
14 changes: 0 additions & 14 deletions src/components/TaskDragContainer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -41,23 +41,9 @@ import { sort } from '../store/storeHelper.js'
import draggable from 'vuedraggable'
import { mapGetters, mapActions, mapMutations } from 'vuex'

import { defineAsyncComponent } from 'vue'

/**
* We asynchronously import here, because we have a circular dependency
* between TaskDragContainer and TaskBody which otherwise cannot be resolved.
* See https://vuejs.org/guide/components/async.html#basic-usage
*
* @return {object} The TaskBody component
*/
const TaskBody = defineAsyncComponent(() =>
import('./TaskBody.vue'),
)

export default {
name: 'TaskDragContainer',
components: {
TaskBody,
draggable,
},
props: {
Expand Down
8 changes: 8 additions & 0 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import App from './App.vue'
import router from './router.js'
import store from './store/store.js'
import TaskBody from './components/TaskBody.vue'

import AlertBoxOutline from 'vue-material-design-icons/AlertBoxOutline.vue'
import CalendarRemove from 'vue-material-design-icons/CalendarRemove.vue'
Expand Down Expand Up @@ -68,6 +69,13 @@ Vue.component('IconPulse', Pulse)
// eslint-disable-next-line vue/match-component-file-name
Vue.component('IconTrendingUp', TrendingUp)

/**
* We import TaskBody here globally, because we have a circular dependency
* between TaskDragContainer and TaskBody which otherwise cannot be resolved.
*/
// eslint-disable-next-line vue/match-component-file-name
Vue.component('TaskBody', TaskBody)

if (!OCA.Tasks) {
/**
* @namespace OCA.Tasks
Expand Down

0 comments on commit 0ff37fb

Please sign in to comment.