Show Button, when Upgrade Version is available ! (check from the server, the version number
- for debug: added led button to see when is calling the server and the IndexedDb.
This commit is contained in:
@@ -22,6 +22,8 @@ import globalroutines from '../../../globalroutines/index'
|
||||
|
||||
import $ from 'jquery'
|
||||
import Api from '@api'
|
||||
import { Getter, State } from 'vuex-class'
|
||||
import { GetterTree } from 'vuex'
|
||||
|
||||
@Component({
|
||||
|
||||
@@ -53,6 +55,12 @@ export default class Todo extends Vue {
|
||||
public service: any
|
||||
public actualMaxPosition: number = 15
|
||||
public scrollable = true
|
||||
public compKey1: number = 0
|
||||
public compKey2: number = 0
|
||||
public compKey3: number = 0
|
||||
// public priorcomplet: number[] = []
|
||||
public arrFiltered: any [] = []
|
||||
|
||||
|
||||
fieldtochange: String [] = ['descr', 'completed', 'category', 'expiring_at', 'priority', 'id_prev', 'id_next', 'pos', 'enableExpiring', 'progress']
|
||||
|
||||
@@ -67,6 +75,8 @@ export default class Todo extends Vue {
|
||||
console.log('drag = ' + this.drag)
|
||||
}
|
||||
|
||||
// @Getter
|
||||
|
||||
|
||||
@Watch('$route', { immediate: true, deep: true })
|
||||
onUrlChange(newVal: any) {
|
||||
@@ -103,7 +113,8 @@ export default class Todo extends Vue {
|
||||
|
||||
// Computed:
|
||||
get showingDataTodo() {
|
||||
return this.todos_arr.slice(0, this.actualMaxPosition)
|
||||
// return this.todos_arr.slice(0, this.actualMaxPosition)
|
||||
return this.arrFiltered
|
||||
}
|
||||
|
||||
|
||||
@@ -157,7 +168,7 @@ export default class Todo extends Vue {
|
||||
const myrecs = [...alldata]
|
||||
|
||||
myrecs.forEach(rec => {
|
||||
mystr = mystr + rec.descr + '] ['
|
||||
mystr = mystr + rec.descr + rec.completed + '] ['
|
||||
})
|
||||
|
||||
mythis.tmpstrTodos = 'TODOS: ' + mystr
|
||||
@@ -465,7 +476,7 @@ export default class Todo extends Vue {
|
||||
let mythis = this
|
||||
if (window) {
|
||||
window.addEventListener('touchmove', function (e) {
|
||||
console.log('touchmove')
|
||||
// console.log('touchmove')
|
||||
if (!mythis.scrollable) {
|
||||
e.preventDefault()
|
||||
}
|
||||
@@ -515,7 +526,7 @@ export default class Todo extends Vue {
|
||||
checkUpdate_everytime() {
|
||||
this.polling = setInterval(() => {
|
||||
this.checkUpdate()
|
||||
}, 10000)
|
||||
}, 60000)
|
||||
}
|
||||
|
||||
initcat() {
|
||||
@@ -840,6 +851,8 @@ export default class Todo extends Vue {
|
||||
|
||||
this.todos_arr = [...arrtemp] // make copy
|
||||
|
||||
this.arrFiltered = this.todos_arr.filter((item, index) => index < this.actualMaxPosition)
|
||||
|
||||
console.log('AGGIORNA todos_arr [', this.todos_arr.length, ']')
|
||||
|
||||
})
|
||||
@@ -925,10 +938,17 @@ export default class Todo extends Vue {
|
||||
}
|
||||
|
||||
updateitem(myobj) {
|
||||
console.log('calling MODIFY 4 updateitem')
|
||||
this.modify(myobj, true)
|
||||
console.log('calling MODIFY 4 updateitem', myobj)
|
||||
// Update the others components...
|
||||
this.compKey1++
|
||||
this.compKey2++
|
||||
this.compKey3++
|
||||
|
||||
console.log('this.compKey3', this.compKey3)
|
||||
return this.modify(myobj, true)
|
||||
}
|
||||
|
||||
|
||||
// inactiveAllButtons() {
|
||||
// let divs = this.$children.filter(function (child) {
|
||||
// return child.$attrs['component-type'] === 'my-custom-button'
|
||||
@@ -988,18 +1008,19 @@ export default class Todo extends Vue {
|
||||
return new Promise(function (resolve, reject) {
|
||||
resolve()
|
||||
})
|
||||
return await globalroutines(this, 'read', 'todos', null, myobj._id)
|
||||
const myobjsaved = rescodes.jsonCopy(myobj)
|
||||
return await globalroutines(this, 'read', 'todos', null, myobjsaved._id)
|
||||
.then(miorec => {
|
||||
if (miorec === undefined) {
|
||||
console.log('~~~~~~~~~~~~~~~~~~~~ !!!!!!!!!!!!!!!!!! Record not Found !!!!!! id=', myobj._id)
|
||||
console.log('~~~~~~~~~~~~~~~~~~~~ !!!!!!!!!!!!!!!!!! Record not Found !!!!!! id=', myobjsaved._id)
|
||||
return
|
||||
}
|
||||
|
||||
if (this.modifyField(miorec, myobj, 'completed'))
|
||||
if (this.modifyField(miorec, myobjsaved, 'completed'))
|
||||
miorec.completed_at = new Date().getDate()
|
||||
|
||||
this.fieldtochange.forEach(field => {
|
||||
this.modifyField(miorec, myobj, field)
|
||||
this.modifyField(miorec, myobjsaved, field)
|
||||
})
|
||||
|
||||
|
||||
@@ -1022,7 +1043,7 @@ export default class Todo extends Vue {
|
||||
.then(ris => {
|
||||
|
||||
// 3) Modify on the Server (call)
|
||||
return this.saveItemToSyncAndDb(rescodes.DB.TABLE_SYNC_TODOS_PATCH, 'PATCH', miorec, update)
|
||||
this.saveItemToSyncAndDb(rescodes.DB.TABLE_SYNC_TODOS_PATCH, 'PATCH', miorec, update)
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
@@ -20,16 +20,16 @@
|
||||
<!--draggable="true" @dragstart="dragStart(index, $event)" @dragover.prevent @dragenter="dragEnter(index)"-->
|
||||
<!--@dragleave="dragLeave(index)" @dragend="dragEnd" @drop="dragFinish(index, $event)" >-->
|
||||
<q-infinite-scroll :handler="loadMoreTodo" :offset="7">
|
||||
<div class="container" v-dragula="todos_arr" drake="first">
|
||||
<div class="container" v-dragula="todos_arr" drake="first" :key="compKey3">
|
||||
<div :id="getmyid(mytodo._id)" :index="index" v-for="(mytodo, index) in showingDataTodo"
|
||||
:key="mytodo._id" class="myitemdrag">
|
||||
|
||||
|
||||
<div v-if="(prior !== mytodo.priority) && !mytodo.completed"
|
||||
:class="getTitlePriority(mytodo.priority)">
|
||||
:class="getTitlePriority(mytodo.priority)" :key="compKey1">
|
||||
<label>{{getPriorityByInd(mytodo.priority)}}</label>
|
||||
</div>
|
||||
<div v-if="(!priorcomplet && mytodo.completed)" class="titleCompleted">
|
||||
<div v-if="(!priorcomplet && mytodo.completed)" class="titleCompleted" :key="compKey2">
|
||||
<label>{{$t('todo.completed')}}</label>
|
||||
<div style="display: none">{{ priorcomplet = true }}</div>
|
||||
</div>
|
||||
@@ -54,12 +54,13 @@
|
||||
v-on:keyup.enter="insertTodo(false)"/>
|
||||
|
||||
<!--{{ tmpstrTodos }}-->
|
||||
<!--<br>-->
|
||||
|
||||
<!--<div class="flex-item btn-item">-->
|
||||
<!--<!–<div class="flex-item btn-item">–>-->
|
||||
<!--<q-btn class="mybtn" round color="" icon="lock" @click="getArrTodos">Get Todo</q-btn>-->
|
||||
<!--<q-btn class="mybtn" round color="" icon="person" @click="setArrTodos">Set Todo</q-btn>-->
|
||||
<!--<q-btn class="mybtn" round color="" icon="list" @click="reload_fromServer++">Reload</q-btn>-->
|
||||
<!--</div>-->
|
||||
<!--<!–</div>–>-->
|
||||
|
||||
<!--<!–<q-input v-model="testPao" float-label="testPao"/>–>-->
|
||||
<!--<q-input v-model="todos_changed" float-label="todos_changed"/>-->
|
||||
@@ -67,8 +68,8 @@
|
||||
<!--<q-input v-model="reload_fromServer" float-label="reload_fromServer"/>-->
|
||||
|
||||
<!--<div class="flex-item btn-item">-->
|
||||
<!--<!–<q-btn class="mybtn" round color="" icon="lock" @click="clicktest()"></q-btn>–>-->
|
||||
<!--<!–<q-btn class="mybtn" round color="" icon="person" @click="clicktest2()"></q-btn>–>-->
|
||||
<!--<q-btn class="mybtn" round color="" icon="lock" @click="clicktest()"></q-btn>-->
|
||||
<!--<q-btn class="mybtn" round color="" icon="person" @click="clicktest2()"></q-btn>-->
|
||||
<!--<q-btn class="mybtn" round color="" icon="list" @click="checkUpdate()"></q-btn>-->
|
||||
<!--</div>-->
|
||||
|
||||
|
||||
Reference in New Issue
Block a user