add stack button on empty board
Signed-off-by: Jakob Röhrl <jakob.roehrl@web.de>
This commit is contained in:
committed by
Julius Härtl
parent
4d7940e14d
commit
ce41400a22
@@ -23,6 +23,26 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="board-wrapper">
|
<div class="board-wrapper">
|
||||||
<Controls :board="board" />
|
<Controls :board="board" />
|
||||||
|
|
||||||
|
<EmptyContent v-if="stacksByBoard.length === 0" icon="icon-pause">
|
||||||
|
No lists, add one
|
||||||
|
<template #desc>
|
||||||
|
<form @submit.prevent="addNewStack()">
|
||||||
|
<input id="new-stack-input-main"
|
||||||
|
v-model="newStackTitle"
|
||||||
|
v-focus
|
||||||
|
type="text"
|
||||||
|
class="no-close"
|
||||||
|
:placeholder="t('deck', 'List name')"
|
||||||
|
required>
|
||||||
|
<input v-tooltip="t('deck', 'Add new list')"
|
||||||
|
class="icon-confirm"
|
||||||
|
type="submit"
|
||||||
|
value="">
|
||||||
|
</form>
|
||||||
|
</template>
|
||||||
|
</EmptyContent>
|
||||||
|
|
||||||
<transition name="fade" mode="out-in">
|
<transition name="fade" mode="out-in">
|
||||||
<div v-if="loading" key="loading" class="emptycontent">
|
<div v-if="loading" key="loading" class="emptycontent">
|
||||||
<div class="icon icon-loading" />
|
<div class="icon icon-loading" />
|
||||||
@@ -54,6 +74,7 @@ import { Container, Draggable } from 'vue-smooth-dnd'
|
|||||||
import { mapState, mapGetters } from 'vuex'
|
import { mapState, mapGetters } from 'vuex'
|
||||||
import Controls from '../Controls'
|
import Controls from '../Controls'
|
||||||
import Stack from './Stack'
|
import Stack from './Stack'
|
||||||
|
import { EmptyContent } from '@nextcloud/vue'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'Board',
|
name: 'Board',
|
||||||
@@ -62,6 +83,7 @@ export default {
|
|||||||
Container,
|
Container,
|
||||||
Draggable,
|
Draggable,
|
||||||
Stack,
|
Stack,
|
||||||
|
EmptyContent,
|
||||||
},
|
},
|
||||||
inject: [
|
inject: [
|
||||||
'boardApi',
|
'boardApi',
|
||||||
@@ -75,6 +97,7 @@ export default {
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
loading: true,
|
loading: true,
|
||||||
|
newStackTitle: '',
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@@ -117,11 +140,10 @@ export default {
|
|||||||
this.$store.dispatch('orderStack', { stack: this.stacksByBoard[removedIndex], removedIndex, addedIndex })
|
this.$store.dispatch('orderStack', { stack: this.stacksByBoard[removedIndex], removedIndex, addedIndex })
|
||||||
},
|
},
|
||||||
|
|
||||||
createStack() {
|
addNewStack() {
|
||||||
const newStack = {
|
const newStack = {
|
||||||
title: 'FooBar',
|
title: this.newStackTitle,
|
||||||
boardId: this.id,
|
boardId: this.id,
|
||||||
order: this.stacksByBoard().length,
|
|
||||||
}
|
}
|
||||||
this.$store.dispatch('createStack', newStack)
|
this.$store.dispatch('createStack', newStack)
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user