Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
c98816d92b | ||
|
dadf7c0cdf | ||
|
f62b4fca5c | ||
0cc55420ea |
|
@ -32,6 +32,11 @@ const props = defineProps({
|
||||||
},
|
},
|
||||||
required: false,
|
required: false,
|
||||||
},
|
},
|
||||||
|
includeFilters:{
|
||||||
|
type: Boolean as PropType<Boolean>,
|
||||||
|
required: false,
|
||||||
|
default: false
|
||||||
|
}
|
||||||
})
|
})
|
||||||
const emit = defineEmits(['update:modelValue'])
|
const emit = defineEmits(['update:modelValue'])
|
||||||
|
|
||||||
|
@ -54,7 +59,7 @@ function findLists(query: string) {
|
||||||
if (query === '') {
|
if (query === '') {
|
||||||
select(null)
|
select(null)
|
||||||
}
|
}
|
||||||
foundLists.value = store.getters['lists/searchList'](query)
|
foundLists.value = store.getters['lists/searchList'](query,false,props.includeFilters)
|
||||||
}
|
}
|
||||||
|
|
||||||
function select(l: ListModel | null) {
|
function select(l: ListModel | null) {
|
||||||
|
|
|
@ -10,6 +10,7 @@ export default class UserSettingsModel extends AbstractModel {
|
||||||
discoverableByEmail: false,
|
discoverableByEmail: false,
|
||||||
overdueTasksRemindersEnabled: true,
|
overdueTasksRemindersEnabled: true,
|
||||||
defaultListId: undefined,
|
defaultListId: undefined,
|
||||||
|
homeListId: undefined,
|
||||||
weekStart: 0,
|
weekStart: 0,
|
||||||
timezone: '',
|
timezone: '',
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,9 +40,9 @@ export default {
|
||||||
})
|
})
|
||||||
return typeof list === 'undefined' ? null : list
|
return typeof list === 'undefined' ? null : list
|
||||||
},
|
},
|
||||||
searchList: state => (query, includeArchived = false) => {
|
searchList: state => (query, includeArchived = false, includeFilters = false) => {
|
||||||
return search(query)
|
return search(query)
|
||||||
?.filter(value => value > 0)
|
?.filter(value => value > 0 || includeFilters)
|
||||||
.map(id => state[id])
|
.map(id => state[id])
|
||||||
.filter(list => list.isArchived === includeArchived)
|
.filter(list => list.isArchived === includeArchived)
|
||||||
|| []
|
|| []
|
||||||
|
|
|
@ -59,6 +59,8 @@ import DatepickerWithRange from '@/components/date/datepickerWithRange.vue'
|
||||||
import {DATE_RANGES} from '@/components/date/dateRanges'
|
import {DATE_RANGES} from '@/components/date/dateRanges'
|
||||||
import {LOADING, LOADING_MODULE} from '@/store/mutation-types'
|
import {LOADING, LOADING_MODULE} from '@/store/mutation-types'
|
||||||
import LlamaCool from '@/assets/llama-cool.svg?component'
|
import LlamaCool from '@/assets/llama-cool.svg?component'
|
||||||
|
import TaskCollectionService from '../../services/taskCollection'
|
||||||
|
|
||||||
|
|
||||||
const store = useStore()
|
const store = useStore()
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
|
@ -85,6 +87,7 @@ const {
|
||||||
}>()
|
}>()
|
||||||
|
|
||||||
const showAll = computed(() => typeof dateFrom === 'undefined' || typeof dateTo === 'undefined')
|
const showAll = computed(() => typeof dateFrom === 'undefined' || typeof dateTo === 'undefined')
|
||||||
|
const homeListId = computed(() => store.state.auth.settings.homeListId)
|
||||||
|
|
||||||
const pageTitle = computed(() => {
|
const pageTitle = computed(() => {
|
||||||
// We need to define "key" because it is the first parameter in the array and we need the second
|
// We need to define "key" because it is the first parameter in the array and we need the second
|
||||||
|
@ -152,7 +155,10 @@ async function loadPendingTasks(from: string, to: string) {
|
||||||
if (!userAuthenticated.value) {
|
if (!userAuthenticated.value) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
if(homeListId.value !== 0){
|
||||||
|
tasks.value = await (new TaskCollectionService().getAll({listId: homeListId.value}))
|
||||||
|
return;
|
||||||
|
}
|
||||||
const params = {
|
const params = {
|
||||||
sortBy: ['due_date', 'id'],
|
sortBy: ['due_date', 'id'],
|
||||||
orderBy: ['asc', 'desc'],
|
orderBy: ['asc', 'desc'],
|
||||||
|
|
|
@ -18,6 +18,12 @@
|
||||||
</label>
|
</label>
|
||||||
<list-search v-model="defaultList"/>
|
<list-search v-model="defaultList"/>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="field">
|
||||||
|
<label class="label">
|
||||||
|
{{ $t('user.settings.general.homeList') }}
|
||||||
|
</label>
|
||||||
|
<list-search v-model="homeList" :includeFilters="true"/>
|
||||||
|
</div>
|
||||||
<div class="field">
|
<div class="field">
|
||||||
<label class="checkbox">
|
<label class="checkbox">
|
||||||
<input type="checkbox" v-model="settings.emailRemindersEnabled"/>
|
<input type="checkbox" v-model="settings.emailRemindersEnabled"/>
|
||||||
|
@ -226,6 +232,12 @@ const defaultList = computed({
|
||||||
settings.defaultListId = l ? l.id : DEFAULT_LIST_ID
|
settings.defaultListId = l ? l.id : DEFAULT_LIST_ID
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
const homeList = computed({
|
||||||
|
get: () => store.getters['lists/getListById'](settings.homeListId),
|
||||||
|
set(l) {
|
||||||
|
settings.homeListId = l ? l.id : DEFAULT_LIST_ID
|
||||||
|
},
|
||||||
|
})
|
||||||
const loading = computed(() => store.state.loading && store.state.loadingModule === 'general-settings')
|
const loading = computed(() => store.state.loading && store.state.loadingModule === 'general-settings')
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
|
|
Reference in New Issue
Block a user