Merge pull request #6285 from nextcloud/fix/some-bugs
This commit is contained in:
@@ -35,7 +35,7 @@ describe('Board', function() {
|
|||||||
.type(board, { force: true })
|
.type(board, { force: true })
|
||||||
|
|
||||||
// Submit
|
// Submit
|
||||||
cy.get('.board-create form input[type=submit]')
|
cy.get('.board-create form button[type=submit]')
|
||||||
.first().click({ force: true })
|
.first().click({ force: true })
|
||||||
|
|
||||||
cy.wait('@createBoardRequest').its('response.statusCode').should('equal', 200)
|
cy.wait('@createBoardRequest').its('response.statusCode').should('equal', 200)
|
||||||
|
|||||||
@@ -6,12 +6,13 @@
|
|||||||
<template>
|
<template>
|
||||||
<NcContent app-name="deck" :class="{ 'nav-hidden': !navShown, 'sidebar-hidden': !sidebarRouterView }">
|
<NcContent app-name="deck" :class="{ 'nav-hidden': !navShown, 'sidebar-hidden': !sidebarRouterView }">
|
||||||
<AppNavigation />
|
<AppNavigation />
|
||||||
<NcAppContent>
|
<NcAppContent :allow-swipe-navigation="false">
|
||||||
<router-view />
|
<router-view />
|
||||||
</NcAppContent>
|
</NcAppContent>
|
||||||
|
|
||||||
<div v-if="$route.params.id || $route.params.cardId">
|
<div v-if="$route.params.id || $route.params.cardId">
|
||||||
<NcModal v-if="cardDetailsInModal && $route.params.cardId"
|
<NcModal v-if="cardDetailsInModal && $route.params.cardId"
|
||||||
|
:name="t('deck', 'Card details')"
|
||||||
:clear-view-delay="0"
|
:clear-view-delay="0"
|
||||||
:close-button-contained="true"
|
:close-button-contained="true"
|
||||||
size="large"
|
size="large"
|
||||||
@@ -32,7 +33,7 @@
|
|||||||
import { mapState } from 'vuex'
|
import { mapState } from 'vuex'
|
||||||
import AppNavigation from './components/navigation/AppNavigation.vue'
|
import AppNavigation from './components/navigation/AppNavigation.vue'
|
||||||
import KeyboardShortcuts from './components/KeyboardShortcuts.vue'
|
import KeyboardShortcuts from './components/KeyboardShortcuts.vue'
|
||||||
import { NcModal, NcContent, NcAppContent } from '@nextcloud/vue'
|
import { NcModal, NcContent, NcAppContent, isMobile } from '@nextcloud/vue'
|
||||||
import { BoardApi } from './services/BoardApi.js'
|
import { BoardApi } from './services/BoardApi.js'
|
||||||
import { emit, subscribe } from '@nextcloud/event-bus'
|
import { emit, subscribe } from '@nextcloud/event-bus'
|
||||||
import { loadState } from '@nextcloud/initial-state'
|
import { loadState } from '@nextcloud/initial-state'
|
||||||
@@ -50,6 +51,7 @@ export default {
|
|||||||
NcAppContent,
|
NcAppContent,
|
||||||
KeyboardShortcuts,
|
KeyboardShortcuts,
|
||||||
},
|
},
|
||||||
|
mixins: [isMobile],
|
||||||
provide() {
|
provide() {
|
||||||
return {
|
return {
|
||||||
boardApi,
|
boardApi,
|
||||||
@@ -106,7 +108,7 @@ export default {
|
|||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
// Set navigation to initial state and update in case it gets toggled
|
// Set navigation to initial state and update in case it gets toggled
|
||||||
emit('toggle-navigation', { open: this.navShown, _initial: true })
|
emit('toggle-navigation', { open: !this.isMobile && this.navShown, _initial: true })
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
subscribe('navigation-toggled', (navState) => {
|
subscribe('navigation-toggled', (navState) => {
|
||||||
this.$store.dispatch('toggleNav', navState.open)
|
this.$store.dispatch('toggleNav', navState.open)
|
||||||
|
|||||||
@@ -13,16 +13,16 @@
|
|||||||
:disabled="loading"
|
:disabled="loading"
|
||||||
label="title"
|
label="title"
|
||||||
@option:selected="fetchCardsFromBoard">
|
@option:selected="fetchCardsFromBoard">
|
||||||
<template slot="singleLabel" slot-scope="props">
|
<template #selected-option="props">
|
||||||
<span>
|
<span>
|
||||||
<span :style="{ 'backgroundColor': '#' + props.option.color }" class="board-bullet" />
|
<span :style="{ 'backgroundColor': '#' + props.color }" class="board-bullet" />
|
||||||
<span>{{ props.option.title }}</span>
|
<span>{{ props.title }}</span>
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
<template slot="option" slot-scope="props">
|
<template #option="props">
|
||||||
<span>
|
<span>
|
||||||
<span :style="{ 'backgroundColor': '#' + props.option.color }" class="board-bullet" />
|
<span :style="{ 'backgroundColor': '#' + props.color }" class="board-bullet" />
|
||||||
<span>{{ props.option.title }}</span>
|
<span>{{ props.title }}</span>
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
</NcSelect>
|
</NcSelect>
|
||||||
|
|||||||
@@ -544,7 +544,7 @@ export default {
|
|||||||
.filter--item {
|
.filter--item {
|
||||||
input + label {
|
input + label {
|
||||||
display: block;
|
display: block;
|
||||||
padding: 6px 0;
|
padding: var(--default-grid-baseline) 0;
|
||||||
.avatardiv {
|
.avatardiv {
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
margin-bottom: 2px;
|
margin-bottom: 2px;
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
-->
|
-->
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="board-wrapper" :tabindex="-1">
|
<div class="board-wrapper" :tabindex="-1" @touchend="fixActionRestriction">
|
||||||
<Controls :board="board" />
|
<Controls :board="board" />
|
||||||
|
|
||||||
<transition name="fade" mode="out-in">
|
<transition name="fade" mode="out-in">
|
||||||
@@ -22,23 +22,27 @@
|
|||||||
<template #icon>
|
<template #icon>
|
||||||
<DeckIcon />
|
<DeckIcon />
|
||||||
</template>
|
</template>
|
||||||
<template #title>
|
<template #name>
|
||||||
{{ t('deck', 'No lists available') }}
|
{{ t('deck', 'No lists available') }}
|
||||||
</template>
|
</template>
|
||||||
<template v-if="canManage" #action>
|
<template v-if="canManage" #action>
|
||||||
{{ t('deck', 'Create a new list to add cards to this board') }}
|
{{ t('deck', 'Create a new list to add cards to this board') }}
|
||||||
<form @submit.prevent="addNewStack()">
|
<form @submit.prevent="addNewStack()">
|
||||||
<input id="new-stack-input-main"
|
<NcTextField ref="newStackInput"
|
||||||
v-model="newStackTitle"
|
:disable="loading"
|
||||||
v-focus
|
:value.sync="newStackTitle"
|
||||||
type="text"
|
|
||||||
class="no-close"
|
|
||||||
:placeholder="t('deck', 'List name')"
|
:placeholder="t('deck', 'List name')"
|
||||||
required>
|
type="text" />
|
||||||
<input title="t('deck', 'Add list')"
|
<NcButton type="secondary"
|
||||||
class="icon-confirm"
|
native-type="submit"
|
||||||
type="submit"
|
:disabled="loading"
|
||||||
value="">
|
:title="t('deck', 'Add list')">
|
||||||
|
<template #icon>
|
||||||
|
<CheckIcon v-if="!loading" :size="20" />
|
||||||
|
<NcLoadingIcon v-else :size="20" />
|
||||||
|
</template>
|
||||||
|
{{ t('deck', 'Add list') }}
|
||||||
|
</NcButton>
|
||||||
</form>
|
</form>
|
||||||
</template>
|
</template>
|
||||||
</NcEmptyContent>
|
</NcEmptyContent>
|
||||||
@@ -82,8 +86,9 @@ import { Container, Draggable } from 'vue-smooth-dnd'
|
|||||||
import { mapState, mapGetters } from 'vuex'
|
import { mapState, mapGetters } from 'vuex'
|
||||||
import Controls from '../Controls.vue'
|
import Controls from '../Controls.vue'
|
||||||
import DeckIcon from '../icons/DeckIcon.vue'
|
import DeckIcon from '../icons/DeckIcon.vue'
|
||||||
|
import CheckIcon from 'vue-material-design-icons/Check.vue'
|
||||||
import Stack from './Stack.vue'
|
import Stack from './Stack.vue'
|
||||||
import { NcEmptyContent, NcModal } from '@nextcloud/vue'
|
import { NcEmptyContent, NcModal, NcButton, NcTextField, NcLoadingIcon } from '@nextcloud/vue'
|
||||||
import GlobalSearchResults from '../search/GlobalSearchResults.vue'
|
import GlobalSearchResults from '../search/GlobalSearchResults.vue'
|
||||||
import { showError } from '../../helpers/errors.js'
|
import { showError } from '../../helpers/errors.js'
|
||||||
import { createSession } from '../../sessions.js'
|
import { createSession } from '../../sessions.js'
|
||||||
@@ -99,6 +104,10 @@ export default {
|
|||||||
Stack,
|
Stack,
|
||||||
NcEmptyContent,
|
NcEmptyContent,
|
||||||
NcModal,
|
NcModal,
|
||||||
|
NcTextField,
|
||||||
|
NcButton,
|
||||||
|
NcLoadingIcon,
|
||||||
|
CheckIcon,
|
||||||
CardSidebar,
|
CardSidebar,
|
||||||
},
|
},
|
||||||
inject: [
|
inject: [
|
||||||
@@ -131,7 +140,7 @@ export default {
|
|||||||
'canManage',
|
'canManage',
|
||||||
]),
|
]),
|
||||||
stacksByBoard() {
|
stacksByBoard() {
|
||||||
return this.$store.getters.stacksByBoard(this.board.id)
|
return this.board?.id ? this.$store.getters.stacksByBoard(this.board.id) : []
|
||||||
},
|
},
|
||||||
dragHandleSelector() {
|
dragHandleSelector() {
|
||||||
return this.canEdit ? '.stack__title' : '.no-drag'
|
return this.canEdit ? '.stack__title' : '.no-drag'
|
||||||
@@ -147,6 +156,11 @@ export default {
|
|||||||
showArchived() {
|
showArchived() {
|
||||||
this.fetchData()
|
this.fetchData()
|
||||||
},
|
},
|
||||||
|
isEmpty(newValue) {
|
||||||
|
newValue && this.$nextTick(() => {
|
||||||
|
this.$refs?.newStackInput?.focus()
|
||||||
|
})
|
||||||
|
},
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.session = createSession(this.id)
|
this.session = createSession(this.id)
|
||||||
@@ -217,6 +231,13 @@ export default {
|
|||||||
window.removeEventListener('mouseup', this.stopMouseDrag)
|
window.removeEventListener('mouseup', this.stopMouseDrag)
|
||||||
window.removeEventListener('mouseleave', this.stopMouseDrag)
|
window.removeEventListener('mouseleave', this.stopMouseDrag)
|
||||||
},
|
},
|
||||||
|
|
||||||
|
fixActionRestriction() {
|
||||||
|
document.body.classList.remove(
|
||||||
|
'smooth-dnd-no-user-select',
|
||||||
|
'smooth-dnd-disable-touch-action',
|
||||||
|
)
|
||||||
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
@@ -229,13 +250,16 @@ export default {
|
|||||||
text-align: center;
|
text-align: center;
|
||||||
display: flex;
|
display: flex;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
max-width: 200px;
|
|
||||||
margin: auto;
|
margin: auto;
|
||||||
margin-top: 20px;
|
margin-top: calc(var(--default-grid-baseline) * 4);
|
||||||
|
gap: var(--default-grid-baseline);
|
||||||
|
|
||||||
input[type=text] {
|
input[type="text"] {
|
||||||
flex-grow: 1;
|
flex-grow: 1;
|
||||||
}
|
}
|
||||||
|
button[type="submit"] {
|
||||||
|
flex-shrink: 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.board-wrapper {
|
.board-wrapper {
|
||||||
@@ -278,7 +302,9 @@ export default {
|
|||||||
flex-grow: 1;
|
flex-grow: 1;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
padding: $stack-spacing;
|
// Margin left instead of padidng to avoid jumps on dropping a card
|
||||||
|
margin-left: $stack-spacing;
|
||||||
|
padding-right: $stack-spacing;
|
||||||
overflow-x: hidden;
|
overflow-x: hidden;
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
padding-top: 15px;
|
padding-top: 15px;
|
||||||
|
|||||||
@@ -88,15 +88,33 @@
|
|||||||
</div>
|
</div>
|
||||||
</NcModal>
|
</NcModal>
|
||||||
|
|
||||||
<transition name="slide-top" appear>
|
<Container :get-child-payload="payloadForCard(stack.id)"
|
||||||
<div v-if="showAddCard" class="stack__card-add">
|
group-name="stack"
|
||||||
|
data-click-closes-sidebar="true"
|
||||||
|
non-drag-area-selector=".dragDisabled"
|
||||||
|
:drag-handle-selector="dragHandleSelector"
|
||||||
|
data-dragscroll-enabled
|
||||||
|
@should-accept-drop="canEdit"
|
||||||
|
@drag-start="draggingCard = true"
|
||||||
|
@drag-end="draggingCard = false"
|
||||||
|
@drop="($event) => onDropCard(stack.id, $event)">
|
||||||
|
<Draggable v-for="card in cardsByStack" :key="card.id">
|
||||||
|
<transition :appear="animate && !card.animated && (card.animated=true)"
|
||||||
|
:appear-class="'zoom-appear-class'"
|
||||||
|
:appear-active-class="'zoom-appear-active-class'">
|
||||||
|
<CardItem :id="card.id" ref="card" :dragging="draggingCard" />
|
||||||
|
</transition>
|
||||||
|
</Draggable>
|
||||||
|
</Container>
|
||||||
|
|
||||||
|
<transition name="slide-bottom" appear>
|
||||||
|
<div v-show="showAddCard" class="stack__card-add">
|
||||||
<form :class="{ 'icon-loading-small': stateCardCreating }"
|
<form :class="{ 'icon-loading-small': stateCardCreating }"
|
||||||
@submit.prevent.stop="clickAddCard()">
|
@submit.prevent.stop="clickAddCard()">
|
||||||
<label for="new-stack-input-main" class="hidden-visually">{{ t('deck', 'Add a new card') }}</label>
|
<label for="new-stack-input-main" class="hidden-visually">{{ t('deck', 'Add a new card') }}</label>
|
||||||
<input id="new-stack-input-main"
|
<input id="new-stack-input-main"
|
||||||
ref="newCardInput"
|
ref="newCardInput"
|
||||||
v-model="newCardTitle"
|
v-model="newCardTitle"
|
||||||
v-focus
|
|
||||||
type="text"
|
type="text"
|
||||||
class="no-close"
|
class="no-close"
|
||||||
:disabled="stateCardCreating"
|
:disabled="stateCardCreating"
|
||||||
@@ -112,25 +130,6 @@
|
|||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</transition>
|
</transition>
|
||||||
|
|
||||||
<Container :get-child-payload="payloadForCard(stack.id)"
|
|
||||||
group-name="stack"
|
|
||||||
data-click-closes-sidebar="true"
|
|
||||||
non-drag-area-selector=".dragDisabled"
|
|
||||||
:drag-handle-selector="dragHandleSelector"
|
|
||||||
data-dragscroll-enabled
|
|
||||||
@should-accept-drop="canEdit"
|
|
||||||
@drag-start="draggingCard = true"
|
|
||||||
@drag-end="draggingCard = false"
|
|
||||||
@drop="($event) => onDropCard(stack.id, $event)">
|
|
||||||
<Draggable v-for="card in cardsByStack" :key="card.id">
|
|
||||||
<transition :appear="animate && !card.animated && (card.animated=true)"
|
|
||||||
:appear-class="'zoom-appear-class'"
|
|
||||||
:appear-active-class="'zoom-appear-active-class'">
|
|
||||||
<CardItem :id="card.id" :dragging="draggingCard" />
|
|
||||||
</transition>
|
|
||||||
</Draggable>
|
|
||||||
</Container>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -221,10 +220,18 @@ export default {
|
|||||||
showAddCard(newValue) {
|
showAddCard(newValue) {
|
||||||
if (!newValue) {
|
if (!newValue) {
|
||||||
this.$store.dispatch('toggleShortcutLock', false)
|
this.$store.dispatch('toggleShortcutLock', false)
|
||||||
|
} else {
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs.newCardInput.focus()
|
||||||
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
|
mounted() {
|
||||||
|
this.setupAutoscrollOnDrag()
|
||||||
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
stopCardCreation(e) {
|
stopCardCreation(e) {
|
||||||
// For some reason the submit event triggers a MouseEvent that is bubbling to the outside
|
// For some reason the submit event triggers a MouseEvent that is bubbling to the outside
|
||||||
@@ -303,6 +310,7 @@ export default {
|
|||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.$refs.newCardInput.focus()
|
this.$refs.newCardInput.focus()
|
||||||
this.animate = false
|
this.animate = false
|
||||||
|
this.$refs.card[(this.$refs.card.length - 1)].scrollIntoView()
|
||||||
})
|
})
|
||||||
if (!this.cardDetailsInModal) {
|
if (!this.cardDetailsInModal) {
|
||||||
this.$router.push({ name: 'card', params: { cardId: newCard.id } })
|
this.$router.push({ name: 'card', params: { cardId: newCard.id } })
|
||||||
@@ -316,6 +324,36 @@ export default {
|
|||||||
onCreateCardFocus() {
|
onCreateCardFocus() {
|
||||||
this.$store.dispatch('toggleShortcutLock', true)
|
this.$store.dispatch('toggleShortcutLock', true)
|
||||||
},
|
},
|
||||||
|
setupAutoscrollOnDrag() {
|
||||||
|
let timer
|
||||||
|
const autoscroll = (event) => {
|
||||||
|
const viewportX = event.clientX
|
||||||
|
const boardElement = document.querySelector('.board')
|
||||||
|
const viewportWidth = boardElement.clientWidth
|
||||||
|
const offset = viewportWidth - viewportX
|
||||||
|
const scrollMultiplier = 10
|
||||||
|
const scrollBoundary = window.innerWidth * 0.15
|
||||||
|
|
||||||
|
if (offset < 100) {
|
||||||
|
const scrollToX = boardElement.scrollLeft + scrollMultiplier * (1 - offset / scrollBoundary)
|
||||||
|
boardElement.scrollTo(scrollToX, boardElement.scrollTop)
|
||||||
|
}
|
||||||
|
|
||||||
|
if (boardElement.scrollLeft > 0 && viewportX < scrollBoundary) {
|
||||||
|
const scrollToX = boardElement.scrollLeft - scrollMultiplier * (1 - viewportX / scrollBoundary)
|
||||||
|
boardElement.scrollTo(scrollToX, boardElement.scrollTop)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
window.addEventListener('mousemove', (e) => {
|
||||||
|
if (!this.draggingCard) {
|
||||||
|
timer && clearInterval(timer)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
clearInterval(timer)
|
||||||
|
timer = window.setInterval(() => autoscroll(e), 25)
|
||||||
|
})
|
||||||
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
@@ -338,6 +376,7 @@ export default {
|
|||||||
padding-left: $card-spacing;
|
padding-left: $card-spacing;
|
||||||
padding-right: $card-spacing;
|
padding-right: $card-spacing;
|
||||||
margin: 6px;
|
margin: 6px;
|
||||||
|
margin-top: 0;
|
||||||
cursor: grab;
|
cursor: grab;
|
||||||
background-color: var(--color-main-background);
|
background-color: var(--color-main-background);
|
||||||
|
|
||||||
@@ -359,14 +398,6 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&--add:before {
|
|
||||||
height: 78px;
|
|
||||||
background-image: linear-gradient(180deg, var(--color-main-background) 68px, rgba(255, 255, 255, 0) 100%);
|
|
||||||
body.theme--dark & {
|
|
||||||
background-image: linear-gradient(180deg, var(--color-main-background) 68px, rgba(0, 0, 0, 0) 100%);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
& > * {
|
& > * {
|
||||||
position: relative;
|
position: relative;
|
||||||
z-index: 100;
|
z-index: 100;
|
||||||
@@ -422,13 +453,14 @@ export default {
|
|||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
z-index: 100;
|
z-index: 100;
|
||||||
display: flex;
|
display: flex;
|
||||||
margin-top: 5px;
|
margin-bottom: 5px;
|
||||||
|
padding-top: var(--default-grid-baseline);
|
||||||
background-color: var(--color-main-background);
|
background-color: var(--color-main-background);
|
||||||
|
|
||||||
form {
|
form {
|
||||||
display: flex;
|
display: flex;
|
||||||
margin-left: $stack-spacing;
|
margin-left: $stack-spacing;
|
||||||
margin-right: $card-spacing + $stack-spacing + 4px;
|
margin-right: $stack-spacing;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
border: 2px solid var(--color-border-maxcontrast);
|
border: 2px solid var(--color-border-maxcontrast);
|
||||||
border-radius: var(--border-radius-large);
|
border-radius: var(--border-radius-large);
|
||||||
@@ -464,7 +496,16 @@ export default {
|
|||||||
.slide-top-enter, .slide-top-leave-to {
|
.slide-top-enter, .slide-top-leave-to {
|
||||||
transform: translateY(-10px);
|
transform: translateY(-10px);
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
height: 0px;
|
}
|
||||||
|
|
||||||
|
.slide-bottom-enter-active,
|
||||||
|
.slide-bottom-leave-active {
|
||||||
|
transition: all 100ms ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
.slide-bottom-enter, .slide-bottom-leave-to {
|
||||||
|
transform: translateY(20px);
|
||||||
|
opacity: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.modal__content {
|
.modal__content {
|
||||||
|
|||||||
@@ -248,6 +248,10 @@ export default {
|
|||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|
||||||
|
.drop-upload--sidebar {
|
||||||
|
min-height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
.button-group {
|
.button-group {
|
||||||
display: flex;
|
display: flex;
|
||||||
gap: calc(var(--default-grid-baseline) * 3);
|
gap: calc(var(--default-grid-baseline) * 3);
|
||||||
|
|||||||
@@ -162,7 +162,9 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
focusHeader() {
|
focusHeader() {
|
||||||
this.$refs.cardSidebar.$el.querySelector('.app-sidebar-header__mainname').focus()
|
this.$nextTick(() => {
|
||||||
|
this.$refs?.cardSidebar.$el.querySelector('.app-sidebar-header__mainname')?.focus()
|
||||||
|
})
|
||||||
},
|
},
|
||||||
handleUpdateTitleEditable(value) {
|
handleUpdateTitleEditable(value) {
|
||||||
this.titleEditable = value
|
this.titleEditable = value
|
||||||
@@ -224,6 +226,7 @@ section.app-sidebar__tab--active {
|
|||||||
left: 0;
|
left: 0;
|
||||||
right: 0;
|
right: 0;
|
||||||
max-width: calc(100% - #{$modal-padding * 2});
|
max-width: calc(100% - #{$modal-padding * 2});
|
||||||
|
min-height: calc(100vh - var(--header-height) * 4);
|
||||||
padding: 0 14px;
|
padding: 0 14px;
|
||||||
height: 97%;
|
height: 97%;
|
||||||
overflow: hidden !important;
|
overflow: hidden !important;
|
||||||
|
|||||||
@@ -66,11 +66,11 @@ export default {
|
|||||||
@import '../../css/variables';
|
@import '../../css/variables';
|
||||||
|
|
||||||
.card-cover {
|
.card-cover {
|
||||||
height: 100px;
|
height: 90px;
|
||||||
display: flex;
|
display: flex;
|
||||||
margin-top: -8px;
|
margin-top: -4px;
|
||||||
margin-left: -8px;
|
margin-left: -4px;
|
||||||
margin-right: -8px;
|
margin-right: -4px;
|
||||||
|
|
||||||
.image-wrapper {
|
.image-wrapper {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
@@ -79,10 +79,10 @@ export default {
|
|||||||
background-repeat: no-repeat;
|
background-repeat: no-repeat;
|
||||||
background-position: center center;
|
background-position: center center;
|
||||||
&.rounded-left {
|
&.rounded-left {
|
||||||
border-top-left-radius: 10px;
|
border-top-left-radius: calc(var(--border-radius-large) - 1px);
|
||||||
}
|
}
|
||||||
&.rounded-right {
|
&.rounded-right {
|
||||||
border-top-right-radius: 10px;
|
border-top-right-radius: calc(var(--border-radius-large) - 1px);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<AttachmentDragAndDrop v-if="card" :card-id="card.id" class="drop-upload--card">
|
<AttachmentDragAndDrop v-if="card" :card-id="card.id" class="drop-upload--card">
|
||||||
<div :ref="`card${card.id}`"
|
<div :ref="`card${card.id}`"
|
||||||
:class="{'compact': compactMode, 'current-card': currentCard, 'has-labels': card.labels && card.labels.length > 0, 'card__editable': canEdit, 'card__archived': card.archived }"
|
:class="{'compact': compactMode, 'current-card': currentCard, 'has-labels': card.labels && card.labels.length > 0, 'card__editable': canEdit, 'card__archived': card.archived, 'card__highlight': highlight}"
|
||||||
tag="div"
|
tag="div"
|
||||||
:tabindex="0"
|
:tabindex="0"
|
||||||
class="card"
|
class="card"
|
||||||
@@ -103,6 +103,11 @@ export default {
|
|||||||
default: false,
|
default: false,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
highlight: false,
|
||||||
|
}
|
||||||
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapState({
|
...mapState({
|
||||||
compactMode: state => state.compactMode,
|
compactMode: state => state.compactMode,
|
||||||
@@ -270,6 +275,14 @@ export default {
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
scrollIntoView() {
|
||||||
|
this.$el.scrollIntoView({ behavior: 'smooth', block: 'center', inline: 'center' })
|
||||||
|
this.focus()
|
||||||
|
this.highlight = true
|
||||||
|
setTimeout(() => {
|
||||||
|
this.highlight = false
|
||||||
|
}, 2000)
|
||||||
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
@@ -290,11 +303,10 @@ export default {
|
|||||||
background-color: var(--color-main-background);
|
background-color: var(--color-main-background);
|
||||||
margin-bottom: $card-spacing;
|
margin-bottom: $card-spacing;
|
||||||
padding: var(--default-grid-baseline) $card-padding;
|
padding: var(--default-grid-baseline) $card-padding;
|
||||||
border: 2px solid var(--color-border);
|
border: 2px solid var(--color-border-dark);
|
||||||
width: 100%;
|
width: 100%;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
gap: var(--default-grid-baseline);
|
|
||||||
|
|
||||||
&:deep(*) {
|
&:deep(*) {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
@@ -317,7 +329,7 @@ export default {
|
|||||||
h4 {
|
h4 {
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
padding: 6px;
|
padding: var(--default-grid-baseline);
|
||||||
flex-grow: 1;
|
flex-grow: 1;
|
||||||
font-size: 100%;
|
font-size: 100%;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
@@ -360,10 +372,28 @@ export default {
|
|||||||
&.card__archived {
|
&.card__archived {
|
||||||
background-color: var(--color-background-dark);
|
background-color: var(--color-background-dark);
|
||||||
}
|
}
|
||||||
|
@keyframes highlight {
|
||||||
|
0% {
|
||||||
|
border-color: var(--color-border-dark);
|
||||||
|
}
|
||||||
|
20% {
|
||||||
|
border-color: var(--color-primary-element);
|
||||||
|
}
|
||||||
|
70% {
|
||||||
|
border-color: var(--color-primary-element);
|
||||||
|
}
|
||||||
|
100% {
|
||||||
|
border-color: var(--color-border-dark);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
&.card__highlight {
|
||||||
|
animation: highlight 2s;
|
||||||
|
}
|
||||||
.card-labels {
|
.card-labels {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: end;
|
align-items: end;
|
||||||
margin-bottom: var(--default-grid-baseline);
|
padding-left: var(--default-grid-baseline);
|
||||||
|
padding-top: var(--default-grid-baseline);
|
||||||
|
|
||||||
.labels {
|
.labels {
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
@@ -403,7 +433,6 @@ export default {
|
|||||||
display: flex;
|
display: flex;
|
||||||
height: 32px;
|
height: 32px;
|
||||||
width: 32px;
|
width: 32px;
|
||||||
margin-top: 6px;
|
|
||||||
}
|
}
|
||||||
&.has-labels {
|
&.has-labels {
|
||||||
padding-bottom: $card-padding;
|
padding-bottom: $card-padding;
|
||||||
|
|||||||
@@ -8,19 +8,41 @@
|
|||||||
icon="icon-add"
|
icon="icon-add"
|
||||||
@click.prevent.stop="startCreateBoard" />
|
@click.prevent.stop="startCreateBoard" />
|
||||||
<div v-else class="board-create">
|
<div v-else class="board-create">
|
||||||
<NcColorPicker v-model="color" class="app-navigation-entry-bullet-wrapper">
|
<NcColorPicker v-model="color" class="app-navigation-entry-bullet-wrapper" :disabled="loading">
|
||||||
<div :style="{ backgroundColor: color }" class="color0 icon-colorpicker app-navigation-entry-bullet" />
|
<div :style="{ backgroundColor: color }" class="color0 icon-colorpicker app-navigation-entry-bullet" />
|
||||||
</NcColorPicker>
|
</NcColorPicker>
|
||||||
<form @submit.prevent.stop="createBoard">
|
<form @submit.prevent.stop="createBoard">
|
||||||
<input :placeholder="t('deck', 'Board name')" type="text" required>
|
<NcTextField ref="inputField"
|
||||||
<input type="submit" value="" class="icon-confirm">
|
:disable="loading"
|
||||||
<NcActions><NcActionButton icon="icon-close" @click.stop.prevent="cancelEdit" /></NcActions>
|
:value.sync="value"
|
||||||
|
:placeholder="t('deck', 'Board name')"
|
||||||
|
type="text"
|
||||||
|
required />
|
||||||
|
<NcButton type="tertiary"
|
||||||
|
:disabled="loading"
|
||||||
|
:title="t('deck', 'Cancel edit')"
|
||||||
|
@click.stop.prevent="cancelEdit">
|
||||||
|
<template #icon>
|
||||||
|
<CloseIcon :size="20" />
|
||||||
|
</template>
|
||||||
|
</NcButton>
|
||||||
|
<NcButton type="tertiary"
|
||||||
|
native-type="submit"
|
||||||
|
:disabled="loading"
|
||||||
|
:title="t('deck', 'Save board')">
|
||||||
|
<template #icon>
|
||||||
|
<CheckIcon v-if="!loading" :size="20" />
|
||||||
|
<NcLoadingIcon v-else :size="20" />
|
||||||
|
</template>
|
||||||
|
</NcButton>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { NcColorPicker, NcActionButton, NcActions, NcAppNavigationItem } from '@nextcloud/vue'
|
import { NcButton, NcColorPicker, NcAppNavigationItem, NcLoadingIcon, NcTextField } from '@nextcloud/vue'
|
||||||
|
import CheckIcon from 'vue-material-design-icons/Check.vue'
|
||||||
|
import CloseIcon from 'vue-material-design-icons/Close.vue'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@@ -35,30 +57,33 @@ function randomColor() {
|
|||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'AppNavigationAddBoard',
|
name: 'AppNavigationAddBoard',
|
||||||
components: { NcColorPicker, NcAppNavigationItem, NcActionButton, NcActions },
|
components: { NcButton, NcColorPicker, NcAppNavigationItem, NcLoadingIcon, NcTextField, CheckIcon, CloseIcon },
|
||||||
directives: {},
|
directives: {},
|
||||||
props: {},
|
props: {},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
value: '',
|
||||||
classes: [],
|
classes: [],
|
||||||
editing: false,
|
editing: false,
|
||||||
loading: false,
|
loading: false,
|
||||||
color: randomColor(),
|
color: randomColor(),
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {},
|
|
||||||
watch: {},
|
|
||||||
mounted() {},
|
|
||||||
methods: {
|
methods: {
|
||||||
startCreateBoard(e) {
|
startCreateBoard(e) {
|
||||||
this.editing = true
|
this.editing = true
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs?.inputField.focus()
|
||||||
|
})
|
||||||
},
|
},
|
||||||
async createBoard(e) {
|
async createBoard(e) {
|
||||||
const title = e.currentTarget.childNodes[0].value
|
this.loading = true
|
||||||
|
const title = this.value.trim()
|
||||||
await this.$store.dispatch('createBoard', {
|
await this.$store.dispatch('createBoard', {
|
||||||
title,
|
title,
|
||||||
color: this.color.substring(1),
|
color: this.color.substring(1),
|
||||||
})
|
})
|
||||||
|
this.loading = false
|
||||||
this.editing = false
|
this.editing = false
|
||||||
this.color = randomColor()
|
this.color = randomColor()
|
||||||
},
|
},
|
||||||
@@ -89,10 +114,9 @@ export default {
|
|||||||
width: var(--default-clickable-area);
|
width: var(--default-clickable-area);
|
||||||
height: var(--default-clickable-area);
|
height: var(--default-clickable-area);
|
||||||
.color0 {
|
.color0 {
|
||||||
width: 30px !important;
|
width: 24px !important;
|
||||||
margin: 5px;
|
margin: var(--default-grid-baseline);
|
||||||
margin-left: 7px;
|
height: 24px;
|
||||||
height: 30px;
|
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
background-size: 14px;
|
background-size: 14px;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,6 +9,8 @@
|
|||||||
:to="routeTo"
|
:to="routeTo"
|
||||||
:undo="deleted"
|
:undo="deleted"
|
||||||
:menu-placement="'auto'"
|
:menu-placement="'auto'"
|
||||||
|
:force-display-actions="isTouchDevice"
|
||||||
|
@click="onNavigate"
|
||||||
@undo="unDelete">
|
@undo="unDelete">
|
||||||
<NcAppNavigationIconBullet slot="icon" :color="board.color" />
|
<NcAppNavigationIconBullet slot="icon" :color="board.color" />
|
||||||
|
|
||||||
@@ -114,24 +116,47 @@
|
|||||||
<div :style="{ backgroundColor: getColor }" class="color0 icon-colorpicker app-navigation-entry-bullet" />
|
<div :style="{ backgroundColor: getColor }" class="color0 icon-colorpicker app-navigation-entry-bullet" />
|
||||||
</NcColorPicker>
|
</NcColorPicker>
|
||||||
<form @submit.prevent.stop="applyEdit">
|
<form @submit.prevent.stop="applyEdit">
|
||||||
<input v-model="editTitle"
|
<NcTextField ref="inputField"
|
||||||
v-focus
|
:disable="loading"
|
||||||
dir="auto"
|
:value.sync="editTitle"
|
||||||
|
:placeholder="t('deck', 'Board name')"
|
||||||
type="text"
|
type="text"
|
||||||
required>
|
required />
|
||||||
<input type="submit" value="" class="icon-confirm">
|
<NcButton type="tertiary"
|
||||||
<NcActions><NcActionButton icon="icon-close" @click.stop.prevent="cancelEdit" /></NcActions>
|
:disabled="loading"
|
||||||
|
native-type="submit"
|
||||||
|
:title="t('deck', 'Cancel edit')"
|
||||||
|
@click.stop.prevent="cancelEdit">
|
||||||
|
<template #icon>
|
||||||
|
<CloseIcon :size="20" />
|
||||||
|
</template>
|
||||||
|
</NcButton>
|
||||||
|
<NcButton type="tertiary"
|
||||||
|
native-type="submit"
|
||||||
|
:disabled="loading"
|
||||||
|
:title="t('deck', 'Save board')">
|
||||||
|
<template #icon>
|
||||||
|
<CheckIcon v-if="!loading" :size="20" />
|
||||||
|
<NcLoadingIcon v-else :size="20" />
|
||||||
|
</template>
|
||||||
|
</NcButton>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { NcAppNavigationIconBullet, NcAppNavigationItem, NcColorPicker, NcActions, NcActionButton } from '@nextcloud/vue'
|
import { NcAppNavigationIconBullet, NcAppNavigationItem, NcColorPicker, NcButton, NcTextField, NcActionButton } from '@nextcloud/vue'
|
||||||
import ClickOutside from 'vue-click-outside'
|
import ClickOutside from 'vue-click-outside'
|
||||||
import ArchiveIcon from 'vue-material-design-icons/Archive.vue'
|
import ArchiveIcon from 'vue-material-design-icons/Archive.vue'
|
||||||
import CloneIcon from 'vue-material-design-icons/ContentDuplicate.vue'
|
import CloneIcon from 'vue-material-design-icons/ContentDuplicate.vue'
|
||||||
import AccountIcon from 'vue-material-design-icons/Account.vue'
|
import AccountIcon from 'vue-material-design-icons/Account.vue'
|
||||||
|
import CloseIcon from 'vue-material-design-icons/Close.vue'
|
||||||
|
import CheckIcon from 'vue-material-design-icons/Check.vue'
|
||||||
|
|
||||||
import { loadState } from '@nextcloud/initial-state'
|
import { loadState } from '@nextcloud/initial-state'
|
||||||
|
import { emit } from '@nextcloud/event-bus'
|
||||||
|
|
||||||
|
import isTouchDevice from '../../mixins/isTouchDevice.js'
|
||||||
|
|
||||||
const canCreateState = loadState('deck', 'canCreate')
|
const canCreateState = loadState('deck', 'canCreate')
|
||||||
|
|
||||||
@@ -141,15 +166,19 @@ export default {
|
|||||||
NcAppNavigationIconBullet,
|
NcAppNavigationIconBullet,
|
||||||
NcAppNavigationItem,
|
NcAppNavigationItem,
|
||||||
NcColorPicker,
|
NcColorPicker,
|
||||||
NcActions,
|
NcButton,
|
||||||
|
NcTextField,
|
||||||
NcActionButton,
|
NcActionButton,
|
||||||
AccountIcon,
|
AccountIcon,
|
||||||
ArchiveIcon,
|
ArchiveIcon,
|
||||||
CloneIcon,
|
CloneIcon,
|
||||||
|
CloseIcon,
|
||||||
|
CheckIcon,
|
||||||
},
|
},
|
||||||
directives: {
|
directives: {
|
||||||
ClickOutside,
|
ClickOutside,
|
||||||
},
|
},
|
||||||
|
mixins: [isTouchDevice],
|
||||||
inject: [
|
inject: [
|
||||||
'boardApi',
|
'boardApi',
|
||||||
],
|
],
|
||||||
@@ -313,13 +342,20 @@ export default {
|
|||||||
actionExport() {
|
actionExport() {
|
||||||
this.boardApi.exportBoard(this.board)
|
this.boardApi.exportBoard(this.board)
|
||||||
},
|
},
|
||||||
|
onNavigate() {
|
||||||
|
if (this.isTouchDevice) {
|
||||||
|
emit('toggle-navigation', {
|
||||||
|
open: false,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.board-edit {
|
.board-edit {
|
||||||
margin-left: var(--default-clickable-area);
|
margin-left: calc(var(--default-clickable-area) / 2);
|
||||||
order: 1;
|
order: 1;
|
||||||
display: flex;
|
display: flex;
|
||||||
height: var(--default-clickable-area);
|
height: var(--default-clickable-area);
|
||||||
@@ -338,10 +374,9 @@ export default {
|
|||||||
width: var(--default-clickable-area);
|
width: var(--default-clickable-area);
|
||||||
height: var(--default-clickable-area);
|
height: var(--default-clickable-area);
|
||||||
.color0 {
|
.color0 {
|
||||||
width: 30px !important;
|
width: 24px !important;
|
||||||
margin: 5px;
|
margin: var(--default-grid-baseline);
|
||||||
margin-left: 7px;
|
height: 24px;
|
||||||
height: 30px;
|
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
background-size: 14px;
|
background-size: 14px;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -168,11 +168,13 @@ export default {
|
|||||||
.dashboard-column {
|
.dashboard-column {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
min-width: $stack-width;
|
||||||
width: $stack-width;
|
width: $stack-width;
|
||||||
margin-left: $stack-spacing;
|
margin-left: $stack-spacing;
|
||||||
margin-right: $stack-spacing;
|
margin-right: $stack-spacing;
|
||||||
|
|
||||||
h3 {
|
h3 {
|
||||||
|
font-size: var(--default-font-size);
|
||||||
margin: -6px;
|
margin: -6px;
|
||||||
margin-bottom: 12px;
|
margin-bottom: 12px;
|
||||||
padding: 6px 13px;
|
padding: 6px 13px;
|
||||||
|
|||||||
12
src/mixins/isTouchDevice.js
Normal file
12
src/mixins/isTouchDevice.js
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
/**
|
||||||
|
* SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
|
||||||
|
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||||
|
*/
|
||||||
|
|
||||||
|
export default {
|
||||||
|
computed: {
|
||||||
|
isTouchDevice() {
|
||||||
|
return ('ontouchstart' in window) || (navigator.maxTouchPoints > 0)
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
@@ -93,7 +93,7 @@
|
|||||||
<template #icon>
|
<template #icon>
|
||||||
<NcLoadingIcon />
|
<NcLoadingIcon />
|
||||||
</template>
|
</template>
|
||||||
<template #title>
|
<template #name>
|
||||||
{{ t('deck', 'Creating the new card …') }}
|
{{ t('deck', 'Creating the new card …') }}
|
||||||
</template>
|
</template>
|
||||||
</NcEmptyContent>
|
</NcEmptyContent>
|
||||||
@@ -101,7 +101,7 @@
|
|||||||
<template #icon>
|
<template #icon>
|
||||||
<CardPlusOutline />
|
<CardPlusOutline />
|
||||||
</template>
|
</template>
|
||||||
<template #title>
|
<template #name>
|
||||||
{{ t('deck', 'Card "{card}" was added to "{board}"', { card: card.title, board: selectedBoard.title }) }}
|
{{ t('deck', 'Card "{card}" was added to "{board}"', { card: card.title, board: selectedBoard.title }) }}
|
||||||
</template>
|
</template>
|
||||||
<template #action>
|
<template #action>
|
||||||
|
|||||||
Reference in New Issue
Block a user