1
0

Merge branch 'main' into feature/date-math

This commit is contained in:
kolaente
2022-03-27 22:41:53 +02:00
32 changed files with 1286 additions and 1150 deletions

View File

@ -653,10 +653,6 @@ $filter-container-height: '1rem - #{$switch-view-height}';
border-radius: $radius;
}
}
.sortable-chosen .task {
transform: rotate(3deg);
}
.bucket {
border-radius: $radius;

View File

@ -42,12 +42,12 @@
</Message>
</transition>
<slot />
<slot v-if="loadedListId"/>
</div>
</template>
<script setup lang="ts">
import {ref, shallowRef, computed, watchEffect} from 'vue'
import {ref, computed, watchEffect} from 'vue'
import {useRoute} from 'vue-router'
import Message from '@/components/misc/message.vue'
@ -55,12 +55,12 @@ import Message from '@/components/misc/message.vue'
import ListModel from '@/models/list'
import ListService from '@/services/list'
import {store} from '@/store'
import {CURRENT_LIST} from '@/store/mutation-types'
import {BACKGROUND, CURRENT_LIST} from '@/store/mutation-types'
import {getListTitle} from '@/helpers/getListTitle'
import {saveListToHistory} from '@/modules/listHistory'
import { useTitle } from '@/composables/useTitle'
import {useTitle} from '@/composables/useTitle'
import {useStore} from 'vuex'
const props = defineProps({
listId: {
@ -74,8 +74,9 @@ const props = defineProps({
})
const route = useRoute()
const store = useStore()
const listService = shallowRef(new ListService())
const listService = ref(new ListService())
const loadedListId = ref(0)
const currentList = computed(() => {
@ -87,7 +88,7 @@ const currentList = computed(() => {
} : store.state.currentList
})
// call again the method if the listId changes
// call the method again if the listId changes
watchEffect(() => loadList(props.listId))
useTitle(() => currentList.value.id ? getListTitle(currentList.value) : '')
@ -123,6 +124,14 @@ async function loadList(listIdToLoad: number) {
console.debug(`Loading list, props.viewName = ${props.viewName}, $route.params =`, route.params, `, loadedListId = ${loadedListId.value}, currentList = `, currentList.value)
// Put set the current list to the one we're about to load so that the title is already shown at the top
loadedListId.value = 0
const listFromStore = store.getters['lists/getListById'](listData.id)
if (listFromStore !== null) {
store.commit(BACKGROUND, null)
store.commit(CURRENT_LIST, listFromStore)
}
// We create an extra list object instead of creating it in list.value because that would trigger a ui update which would result in bad ux.
const list = new ListModel(listData)
try {

View File

@ -259,6 +259,7 @@
class="is-outlined has-no-border"
icon="check-double"
variant="secondary"
v-shortcut="'t'"
>
{{ task.done ? $t('task.detail.undone') : $t('task.detail.done') }}
</x-button>
@ -356,6 +357,7 @@
@click="setFieldActive('moveList')"
variant="secondary"
icon="list"
v-shortcut="'m'"
>
{{ $t('task.detail.actions.moveList') }}
</x-button>
@ -363,6 +365,7 @@
@click="setFieldActive('color')"
variant="secondary"
icon="fill-drip"
v-shortcut="'c'"
>
{{ $t('task.detail.actions.color') }}
</x-button>