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