This repository has been archived on 2024-02-08. You can view files and clone it, but cannot push or open issues or pull requests.
frontend/src/components/lists/ShowList.vue
konrad c7845bb9c1
All checks were successful
continuous-integration/drone/push Build is passing
Kanban (#118)
Add error message when trying to create an invalid new task in a bucket

Prevent creation of new buckets if the bucket title is empty

Disable deleting a bucket if it's the last one

Disable dragging tasks when they are being updated

Fix transition when opening tasks

Send the user to list view by default

Show loading spinner when updating multiple tasks

Add loading spinner when moving tasks

Add loading animation when bucket is loading / updating etc

Add bucket title edit

Fix creating new buckets

Add loading animation

Add removing buckets

Fix creating a new bucket after tasks were moved

Fix warning about labels on tasks

Fix labels on tasks not updating after retrieval from api

Fix property width

Add closing and mobile design

Make the task detail popup look good

Move list views

Move task detail view in a popup

Add link to tasks

Add saving the new task position after it was moved

Fix creating new bucket

Fix creating a new task

Cleanup

Disable user selection for task cards

Fix drag placeholder

Add dragging style to task

Add placeholder + change animation duration

More cleanup

Cleanup / docs

Working of dragging and dropping tasks

Adjust markup and styling for new library

Change kanban library to something that works

Add basic calculation of new positions

Don't try to create empty tasks

Add indicator if a task is done

Add moving tasks between buckets

Make empty buckets a little smaller

Add gimmick for button description

Fix color

Fix scrolling bucket layout

Add creating a new bucket

Add hiding the task input field

Co-authored-by: kolaente <k@knt.li>
Reviewed-on: #118
2020-04-25 23:11:34 +00:00

91 lines
3.0 KiB
Vue

<template>
<div class="loader-container" :class="{ 'is-loading': listService.loading}">
<div class="content">
<router-link :to="{ name: 'editList', params: { id: list.id } }" class="icon settings is-medium">
<icon icon="cog" size="2x"/>
</router-link>
<h1 :style="{ 'opacity': list.title === '' ? '0': '1' }">{{ list.title === '' ? 'Loading...': list.title}}</h1>
<div class="notification is-warning" v-if="list.isArchived">
This list is archived.
It is not possible to create new or edit tasks or it.
</div>
<div class="switch-view">
<router-link :to="{ name: 'list.list', params: { id: $route.params.listId } }" :class="{'is-active': $route.name === 'list.list'}">List</router-link>
<router-link :to="{ name: 'list.gantt', params: { id: $route.params.listId } }" :class="{'is-active': $route.name === 'list.gantt'}">Gantt</router-link>
<router-link :to="{ name: 'list.table', params: { id: $route.params.listId } }" :class="{'is-active': $route.name === 'list.table'}">Table</router-link>
<router-link :to="{ name: 'list.kanban', params: { id: $route.params.listId } }" :class="{'is-active': $route.name === 'list.kanban'}">Kanban</router-link>
</div>
</div>
<router-view/>
</div>
</template>
<script>
import auth from '../../auth'
import router from '../../router'
import ListModel from '../../models/list'
import ListService from '../../services/list'
import authType from '../../models/authTypes'
export default {
data() {
return {
listService: ListService,
list: ListModel,
listLoaded: 0,
}
},
beforeMount() {
// Check if the user is already logged in, if so, redirect him to the homepage
if (!auth.user.authenticated && auth.user.infos.type !== authType.LINK_SHARE) {
router.push({name: 'home'})
}
},
created() {
this.listService = new ListService()
this.list = new ListModel()
},
mounted() {
this.loadList()
},
watch: {
// call again the method if the route changes
'$route.path': 'loadList',
},
methods: {
loadList() {
// Don't load the list if we either already loaded it or aren't dealing with a list at all currently
if(this.$route.params.listId === this.listLoaded || typeof this.$route.params.listId === 'undefined') {
return
}
// Redirect the user to list view by default
if (
this.$route.name !== 'list.list' &&
this.$route.name !== 'list.gantt' &&
this.$route.name !== 'list.table' &&
this.$route.name !== 'list.kanban'
) {
router.push({name: 'list.list', params: {id: this.$route.params.listId}})
return
}
// We create an extra list object instead of creating it in this.list because that would trigger a ui update which would result in bad ux.
let list = new ListModel({id: this.$route.params.listId})
this.listService.get(list)
.then(r => {
this.$set(this, 'list', r)
})
.catch(e => {
this.error(e, this)
})
.finally(() => {
this.listLoaded = this.$route.params.listId
})
},
}
}
</script>