chore: remove showAll prop and make it a computed instead
This commit is contained in:
parent
95d8cdffe4
commit
4ce9ac9c66
2 changed files with 3 additions and 5 deletions
|
@ -53,7 +53,6 @@
|
|||
<ShowTasks
|
||||
v-if="hasLists"
|
||||
class="mt-4"
|
||||
:show-all="true"
|
||||
:key="showTasksKey"
|
||||
/>
|
||||
</div>
|
||||
|
|
|
@ -72,23 +72,22 @@ const showNothingToDo = ref<boolean>(false)
|
|||
|
||||
setTimeout(() => showNothingToDo.value = true, 100)
|
||||
|
||||
// NOTE: You MUST provide either dateFrom and dateTo OR showAll for the component to actually show tasks.
|
||||
// Linting disabled because we explicitely enabled destructuring in vite's config, this will work.
|
||||
// eslint-disable-next-line vue/no-setup-props-destructure
|
||||
const {
|
||||
dateFrom,
|
||||
dateTo,
|
||||
showAll = false,
|
||||
showNulls = false,
|
||||
showOverdue = false,
|
||||
} = defineProps<{
|
||||
dateFrom?: Date | string,
|
||||
dateTo?: Date | string,
|
||||
showAll?: Boolean,
|
||||
showNulls?: Boolean,
|
||||
showOverdue?: Boolean,
|
||||
}>()
|
||||
|
||||
const showAll = computed(() => typeof dateFrom === 'undefined' || typeof dateTo === 'undefined')
|
||||
|
||||
const pageTitle = computed(() => {
|
||||
let title = ''
|
||||
|
||||
|
@ -190,7 +189,7 @@ async function loadPendingTasks(from: string, to: string) {
|
|||
filterIncludeNulls: showNulls,
|
||||
}
|
||||
|
||||
if (!showAll) {
|
||||
if (!showAll.value) {
|
||||
params.filterBy.push('due_date')
|
||||
params.filterValue.push(to)
|
||||
params.filterComparator.push('less')
|
||||
|
|
Loading…
Reference in a new issue