forked from vikunja/frontend
Set list in search box in settings
This commit is contained in:
parent
a9728f774d
commit
816c5bb4ec
|
@ -78,8 +78,8 @@ export default {
|
|||
if (this.listId !== undefined) {
|
||||
this.listIdForNewTask = this.listId
|
||||
this.validListIdAvailable = true
|
||||
} else if(this.$store.state.auth.settings.defaultListID !== undefined) {
|
||||
this.listIdForNewTask = this.$store.state.auth.settings.defaultListID
|
||||
} else if(this.$store.state.auth.settings.defaultListId !== undefined) {
|
||||
this.listIdForNewTask = this.$store.state.auth.settings.defaultListId
|
||||
this.validListIdAvailable = true
|
||||
}
|
||||
},
|
||||
|
|
|
@ -42,8 +42,10 @@ export default {
|
|||
},
|
||||
},
|
||||
beforeMount() {
|
||||
this.listSerivce = new ListService()
|
||||
this.listService = new ListService()
|
||||
this.list = new ListModel()
|
||||
},
|
||||
mounted() {
|
||||
if (this.listId !== undefined) {
|
||||
this.getListById()
|
||||
}
|
||||
|
@ -55,9 +57,10 @@ export default {
|
|||
return
|
||||
}
|
||||
|
||||
this.listSerivce.getAll({}, {s: query})
|
||||
this.listService.getAll({}, {s: query})
|
||||
.then(response => {
|
||||
this.$set(this, 'foundLists', response)
|
||||
this.$set(this, 'list', response)
|
||||
})
|
||||
.catch(e => {
|
||||
this.error(e, this)
|
||||
|
@ -66,7 +69,7 @@ export default {
|
|||
getListById() {
|
||||
this.listService.get({id: this.listId})
|
||||
.then(response => {
|
||||
this.$set(this, 'foundLists', response)
|
||||
this.list = response
|
||||
})
|
||||
.catch(e => {
|
||||
this.error(e, this)
|
||||
|
|
|
@ -9,7 +9,7 @@ export default class UserSettingsModel extends AbstractModel {
|
|||
discoverableByName: false,
|
||||
discoverableByEmail: false,
|
||||
overdueTasksRemindersEnabled: true,
|
||||
defaultListID: 1,
|
||||
defaultListId: 1,
|
||||
weekStart: 0,
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,9 +3,9 @@ import { ERROR_MESSAGE, LOADING } from '../mutation-types'
|
|||
import UserModel from '../../models/user'
|
||||
|
||||
const defaultSettings = settings => {
|
||||
if (typeof settings.defaultListID === 'undefined' || settings.defaultListID === '') {
|
||||
settings.defaultListID = 1
|
||||
}
|
||||
// if (typeof settings.defaultListId === 'undefined' || settings.defaultListId === '') {
|
||||
// settings.defaultListId = 1
|
||||
// }
|
||||
if (typeof settings.weekStart === 'undefined' || settings.weekStart === '') {
|
||||
settings.weekStart = 0
|
||||
}
|
||||
|
|
|
@ -138,7 +138,7 @@
|
|||
Default list for new tasks is
|
||||
</span>
|
||||
<div class="ml-2">
|
||||
<list-search @selected="changeList" :listId="settings.defaultListID" ref="defaultList"/>
|
||||
<list-search @selected="changeList" :listId="settings.defaultListId" ref="defaultList"/>
|
||||
</div>
|
||||
</label>
|
||||
</div>
|
||||
|
@ -433,7 +433,7 @@ export default {
|
|||
copy(text)
|
||||
},
|
||||
changeList(list) {
|
||||
this.settings.defaultListID = list.id
|
||||
this.settings.defaultListId = list.id
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue