fixes for comments

This commit is contained in:
Sytone 2021-06-17 12:55:20 -07:00
parent f39a4d76da
commit 3a6d81d221
3 changed files with 50 additions and 54 deletions

View File

@ -1,34 +1,33 @@
<template>
<div class="field is-grouped" >
<div v-if="validListIdAvailable">
<p
:class="{ 'is-loading': taskService.loading }"
class="control has-icons-left is-expanded"
<p
:class="{ 'is-loading': taskService.loading }"
class="control has-icons-left is-expanded"
v-if="validListIdAvailable"
>
<input
:class="{ disabled: taskService.loading }"
@keyup.enter="addTask()"
class="input"
placeholder="Add a new task..."
type="text"
v-focus
v-model="newTaskText"
ref="newTaskInput"
/>
<span class="icon is-small is-left">
<icon icon="tasks" />
</span>
</p>
<p class="control" v-if="validListIdAvailable">
<x-button
:disabled="newTaskText.length === 0"
@click="addTask()"
icon="plus"
>
<input
:class="{ disabled: taskService.loading }"
@keyup.enter="addTask()"
class="input"
placeholder="Add a new task..."
type="text"
v-focus
v-model="newTaskText"
ref="newTaskInput"
/>
<span class="icon is-small is-left">
<icon icon="tasks" />
</span>
</p>
<p class="control">
<x-button
:disabled="newTaskText.length === 0"
@click="addTask()"
icon="plus"
>
Add
</x-button>
</p>
</div>
Add
</x-button>
</p>
<p class="help is-warning" v-if="!validListIdAvailable">
No default list set. Please go to settings and specify default list.
</p>

View File

@ -20,7 +20,6 @@
<script>
import ListService from '../../../services/list'
import ListModel from '../../../models/list'
import Multiselect from '@/components/input/multiselect'
export default {
@ -28,27 +27,19 @@ export default {
data() {
return {
listSerivce: ListService,
list: ListModel,
foundLists: [],
}
},
components: {
Multiselect,
},
props: {
listId: {
type: Number,
required: false,
},
},
prop: ['list'],
model: {
prop: 'list',
event: 'selected',
},
beforeMount() {
this.listService = new ListService()
this.list = new ListModel()
},
mounted() {
if (this.listId !== undefined) {
this.getListById()
}
},
methods: {
findLists(query) {
@ -66,15 +57,6 @@ export default {
this.error(e, this)
})
},
getListById() {
this.listService.get({id: this.listId})
.then(response => {
this.list = response
})
.catch(e => {
this.error(e, this)
})
},
clearAll() {
this.$set(this, 'foundLists', [])
},
@ -88,8 +70,8 @@ export default {
}
return 'Shared Lists'
},
handleInput (e) {
this.$emit('input', this.content)
handleInput (value) {
this.$emit('selected', value)
},
},
}

View File

@ -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" v-model="defaultList" ref="defaultList"/>
</div>
</label>
</div>
@ -273,6 +273,8 @@ import TotpService from '../../services/totp'
import UserSettingsService from '../../services/userSettings'
import UserSettingsModel from '../../models/userSettings'
import ListSearch from '../../components/tasks/partials/listSearch'
import ListService from '../../services/list'
import ListModel from '../../models/list'
import {playSoundWhenDoneKey} from '@/helpers/playPop'
import {mapState} from 'vuex'
@ -302,6 +304,9 @@ export default {
settings: UserSettingsModel,
userSettingsService: UserSettingsService,
listService: ListService,
defaultList: ListModel,
}
},
components: {
@ -323,7 +328,11 @@ export default {
this.playSoundWhenDone = localStorage.getItem(playSoundWhenDoneKey) === 'true' || localStorage.getItem(playSoundWhenDoneKey) === null
this.listService = new ListService()
this.defaultList = new ListModel()
this.totpStatus()
this.getListById()
},
mounted() {
this.setTitle('Settings')
@ -435,6 +444,12 @@ export default {
changeList(list) {
this.settings.defaultListId = list.id
},
getListById() {
this.listService.get({id: this.settings.defaultListId})
.then(response => {
this.defaultList = response
})
},
},
}
</script>