feat: use new async component definition
- fix see: https://v3.vuejs.org/guide/migration/async-components.html - put async editor in separate component
This commit is contained in:
parent
51a740f53c
commit
421ff9a188
10 changed files with 38 additions and 74 deletions
12
src/components/input/AsyncEditor.js
Normal file
12
src/components/input/AsyncEditor.js
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
import { defineAsyncComponent } from 'vue'
|
||||||
|
import ErrorComponent from '@/components/misc/error.vue'
|
||||||
|
import LoadingComponent from '@/components/misc/loading.vue'
|
||||||
|
|
||||||
|
const Editor = () => import('@/components/input/editor.vue')
|
||||||
|
|
||||||
|
export default defineAsyncComponent({
|
||||||
|
loader: Editor,
|
||||||
|
loadingComponent: LoadingComponent,
|
||||||
|
errorComponent: ErrorComponent,
|
||||||
|
timeout: 60000,
|
||||||
|
})
|
|
@ -69,6 +69,8 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import AsyncEditor from '@/components/input/AsyncEditor'
|
||||||
|
|
||||||
import ListService from '../../services/list'
|
import ListService from '../../services/list'
|
||||||
import TaskService from '../../services/task'
|
import TaskService from '../../services/task'
|
||||||
import TaskModel from '../../models/task'
|
import TaskModel from '../../models/task'
|
||||||
|
@ -76,8 +78,6 @@ import priorities from '../../models/constants/priorities'
|
||||||
import EditLabels from './partials/editLabels'
|
import EditLabels from './partials/editLabels'
|
||||||
import Reminders from './partials/reminders'
|
import Reminders from './partials/reminders'
|
||||||
import ColorPicker from '../input/colorPicker'
|
import ColorPicker from '../input/colorPicker'
|
||||||
import LoadingComponent from '../misc/loading'
|
|
||||||
import ErrorComponent from '../misc/error'
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'edit-task',
|
name: 'edit-task',
|
||||||
|
@ -99,12 +99,7 @@ export default {
|
||||||
ColorPicker,
|
ColorPicker,
|
||||||
Reminders,
|
Reminders,
|
||||||
EditLabels,
|
EditLabels,
|
||||||
editor: () => ({
|
editor: AsyncEditor,
|
||||||
component: import('../../components/input/editor'),
|
|
||||||
loading: LoadingComponent,
|
|
||||||
error: ErrorComponent,
|
|
||||||
timeout: 60000,
|
|
||||||
}),
|
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
task: {
|
task: {
|
||||||
|
|
|
@ -152,22 +152,17 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import AsyncEditor from '@/components/input/AsyncEditor'
|
||||||
|
|
||||||
import TaskCommentService from '../../../services/taskComment'
|
import TaskCommentService from '../../../services/taskComment'
|
||||||
import TaskCommentModel from '../../../models/taskComment'
|
import TaskCommentModel from '../../../models/taskComment'
|
||||||
import LoadingComponent from '../../misc/loading'
|
|
||||||
import ErrorComponent from '../../misc/error'
|
|
||||||
import {uploadFile} from '@/helpers/attachments'
|
import {uploadFile} from '@/helpers/attachments'
|
||||||
import {mapState} from 'vuex'
|
import {mapState} from 'vuex'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'comments',
|
name: 'comments',
|
||||||
components: {
|
components: {
|
||||||
editor: () => ({
|
editor: AsyncEditor,
|
||||||
component: import('../../input/editor'),
|
|
||||||
loading: LoadingComponent,
|
|
||||||
error: ErrorComponent,
|
|
||||||
timeout: 60000,
|
|
||||||
}),
|
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
taskId: {
|
taskId: {
|
||||||
|
|
|
@ -30,8 +30,7 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import LoadingComponent from '@/components/misc/loading.vue'
|
import AsyncEditor from '@/components/input/AsyncEditor'
|
||||||
import ErrorComponent from '@/components/misc/error.vue'
|
|
||||||
|
|
||||||
import {LOADING} from '@/store/mutation-types'
|
import {LOADING} from '@/store/mutation-types'
|
||||||
import {mapState} from 'vuex'
|
import {mapState} from 'vuex'
|
||||||
|
@ -39,12 +38,7 @@ import {mapState} from 'vuex'
|
||||||
export default {
|
export default {
|
||||||
name: 'description',
|
name: 'description',
|
||||||
components: {
|
components: {
|
||||||
editor: () => ({
|
editor: AsyncEditor,
|
||||||
component: import('@/components/input/editor.vue'),
|
|
||||||
loading: LoadingComponent,
|
|
||||||
error: ErrorComponent,
|
|
||||||
timeout: 60000,
|
|
||||||
}),
|
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
|
|
@ -60,8 +60,8 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import LoadingComponent from '@/components/misc/loading.vue'
|
import AsyncEditor from '@/components/input/AsyncEditor'
|
||||||
import ErrorComponent from '@/components/misc/error.vue'
|
|
||||||
import Filters from '@/components/list/partials/filters.vue'
|
import Filters from '@/components/list/partials/filters.vue'
|
||||||
import SavedFilterService from '@/services/savedFilter'
|
import SavedFilterService from '@/services/savedFilter'
|
||||||
import SavedFilterModel from '@/models/savedFilter'
|
import SavedFilterModel from '@/models/savedFilter'
|
||||||
|
@ -86,12 +86,7 @@ export default {
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
Filters,
|
Filters,
|
||||||
editor: () => ({
|
editor: AsyncEditor,
|
||||||
component: import('../../components/input/editor'),
|
|
||||||
loading: LoadingComponent,
|
|
||||||
error: ErrorComponent,
|
|
||||||
timeout: 60000,
|
|
||||||
}),
|
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.editorActive = false
|
this.editorActive = false
|
||||||
|
|
|
@ -52,8 +52,8 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import ErrorComponent from '@/components/misc/error.vue'
|
import AsyncEditor from '@/components/input/AsyncEditor'
|
||||||
import LoadingComponent from '@/components/misc/loading.vue'
|
|
||||||
import CreateEdit from '@/components/misc/create-edit.vue'
|
import CreateEdit from '@/components/misc/create-edit.vue'
|
||||||
|
|
||||||
import SavedFilterModel from '@/models/savedFilter'
|
import SavedFilterModel from '@/models/savedFilter'
|
||||||
|
@ -84,12 +84,7 @@ export default {
|
||||||
components: {
|
components: {
|
||||||
CreateEdit,
|
CreateEdit,
|
||||||
Filters,
|
Filters,
|
||||||
editor: () => ({
|
editor: AsyncEditor,
|
||||||
component: import('@/components/input/editor.vue'),
|
|
||||||
loading: LoadingComponent,
|
|
||||||
error: ErrorComponent,
|
|
||||||
timeout: 60000,
|
|
||||||
}),
|
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
// call again the method if the route changes
|
// call again the method if the route changes
|
||||||
|
|
|
@ -100,21 +100,16 @@
|
||||||
import {mapState} from 'vuex'
|
import {mapState} from 'vuex'
|
||||||
|
|
||||||
import LabelModel from '../../models/label'
|
import LabelModel from '../../models/label'
|
||||||
import ColorPicker from '../../components/input/colorPicker'
|
|
||||||
import LoadingComponent from '../../components/misc/loading'
|
|
||||||
import ErrorComponent from '../../components/misc/error'
|
|
||||||
import {LOADING, LOADING_MODULE} from '@/store/mutation-types'
|
import {LOADING, LOADING_MODULE} from '@/store/mutation-types'
|
||||||
|
|
||||||
|
import AsyncEditor from '@/components/input/AsyncEditor'
|
||||||
|
import ColorPicker from '@/components/input/colorPicker'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'ListLabels',
|
name: 'ListLabels',
|
||||||
components: {
|
components: {
|
||||||
ColorPicker,
|
ColorPicker,
|
||||||
editor: () => ({
|
editor: AsyncEditor,
|
||||||
component: import('../../components/input/editor'),
|
|
||||||
loading: LoadingComponent,
|
|
||||||
error: ErrorComponent,
|
|
||||||
timeout: 60000,
|
|
||||||
}),
|
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
|
|
@ -66,11 +66,11 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import AsyncEditor from '@/components/input/AsyncEditor'
|
||||||
|
|
||||||
import ListModel from '@/models/list'
|
import ListModel from '@/models/list'
|
||||||
import ListService from '@/services/list'
|
import ListService from '@/services/list'
|
||||||
import ColorPicker from '@/components/input/colorPicker.vue'
|
import ColorPicker from '@/components/input/colorPicker.vue'
|
||||||
import LoadingComponent from '@/components/misc/loading.vue'
|
|
||||||
import ErrorComponent from '@/components/misc/error.vue'
|
|
||||||
import ListDuplicateService from '@/services/listDuplicateService'
|
import ListDuplicateService from '@/services/listDuplicateService'
|
||||||
import {CURRENT_LIST} from '@/store/mutation-types'
|
import {CURRENT_LIST} from '@/store/mutation-types'
|
||||||
import CreateEdit from '@/components/misc/create-edit.vue'
|
import CreateEdit from '@/components/misc/create-edit.vue'
|
||||||
|
@ -87,12 +87,7 @@ export default {
|
||||||
components: {
|
components: {
|
||||||
CreateEdit,
|
CreateEdit,
|
||||||
ColorPicker,
|
ColorPicker,
|
||||||
editor: () => ({
|
editor: AsyncEditor,
|
||||||
component: import('@/components/input/editor.vue'),
|
|
||||||
loading: LoadingComponent,
|
|
||||||
error: ErrorComponent,
|
|
||||||
timeout: 60000,
|
|
||||||
}),
|
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
'$route.params.listId': {
|
'$route.params.listId': {
|
||||||
|
|
|
@ -57,12 +57,12 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import AsyncEditor from '@/components/input/AsyncEditor'
|
||||||
|
|
||||||
import NamespaceService from '@/services/namespace'
|
import NamespaceService from '@/services/namespace'
|
||||||
import NamespaceModel from '@/models/namespace'
|
import NamespaceModel from '@/models/namespace'
|
||||||
import Fancycheckbox from '@/components/input/fancycheckbox.vue'
|
import Fancycheckbox from '@/components/input/fancycheckbox.vue'
|
||||||
import ColorPicker from '@/components/input/colorPicker.vue'
|
import ColorPicker from '@/components/input/colorPicker.vue'
|
||||||
import LoadingComponent from '@/components/misc/loading.vue'
|
|
||||||
import ErrorComponent from '@/components/misc/error.vue'
|
|
||||||
import CreateEdit from '@/components/misc/create-edit.vue'
|
import CreateEdit from '@/components/misc/create-edit.vue'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
@ -79,12 +79,7 @@ export default {
|
||||||
CreateEdit,
|
CreateEdit,
|
||||||
ColorPicker,
|
ColorPicker,
|
||||||
Fancycheckbox,
|
Fancycheckbox,
|
||||||
editor: () => ({
|
editor: AsyncEditor,
|
||||||
component: import('@/components/input/editor.vue'),
|
|
||||||
loading: LoadingComponent,
|
|
||||||
error: ErrorComponent,
|
|
||||||
timeout: 60000,
|
|
||||||
}),
|
|
||||||
},
|
},
|
||||||
beforeMount() {
|
beforeMount() {
|
||||||
this.namespace.id = this.$route.params.id
|
this.namespace.id = this.$route.params.id
|
||||||
|
|
|
@ -161,6 +161,7 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import AsyncEditor from '@/components/input/AsyncEditor'
|
||||||
import {mapState} from 'vuex'
|
import {mapState} from 'vuex'
|
||||||
|
|
||||||
import TeamService from '../../services/team'
|
import TeamService from '../../services/team'
|
||||||
|
@ -171,9 +172,6 @@ import UserModel from '../../models/user'
|
||||||
import UserService from '../../services/user'
|
import UserService from '../../services/user'
|
||||||
import Rights from '../../models/constants/rights.json'
|
import Rights from '../../models/constants/rights.json'
|
||||||
|
|
||||||
import LoadingComponent from '../../components/misc/loading'
|
|
||||||
import ErrorComponent from '../../components/misc/error'
|
|
||||||
|
|
||||||
import Multiselect from '@/components/input/multiselect.vue'
|
import Multiselect from '@/components/input/multiselect.vue'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
@ -199,12 +197,7 @@ export default {
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
Multiselect,
|
Multiselect,
|
||||||
editor: () => ({
|
editor: AsyncEditor,
|
||||||
component: import('../../components/input/editor'),
|
|
||||||
loading: LoadingComponent,
|
|
||||||
error: ErrorComponent,
|
|
||||||
timeout: 60000,
|
|
||||||
}),
|
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
// call again the method if the route changes
|
// call again the method if the route changes
|
||||||
|
|
Loading…
Reference in a new issue