Fix: first elem added not working...
This commit is contained in:
@@ -128,6 +128,7 @@ const messages = {
|
|||||||
confirmed: 'Notifiche Attivate!',
|
confirmed: 'Notifiche Attivate!',
|
||||||
denied: 'Notifiche Disabilitate! Attenzione così non vedrai arrivarti i messaggi. Riabilitali per vederli.',
|
denied: 'Notifiche Disabilitate! Attenzione così non vedrai arrivarti i messaggi. Riabilitali per vederli.',
|
||||||
titlegranted: 'Permesso Notifiche Abilitato!',
|
titlegranted: 'Permesso Notifiche Abilitato!',
|
||||||
|
statusnot: 'Stato Notifiche',
|
||||||
titledenied: 'Permesso Notifiche Disabilitato!',
|
titledenied: 'Permesso Notifiche Disabilitato!',
|
||||||
title_subscribed: 'Sottoscrizione a FreePlanet.app!',
|
title_subscribed: 'Sottoscrizione a FreePlanet.app!',
|
||||||
subscribed: 'Ora potrai ricevere i messaggi e le notifiche.',
|
subscribed: 'Ora potrai ricevere i messaggi e le notifiche.',
|
||||||
@@ -264,6 +265,7 @@ const messages = {
|
|||||||
confirmed: 'Notificaciones activadas!',
|
confirmed: 'Notificaciones activadas!',
|
||||||
denied: 'Notificaciones deshabilitadas! Ten cuidado, así no verás llegar los mensajes. Rehabilítalos para verlos.',
|
denied: 'Notificaciones deshabilitadas! Ten cuidado, así no verás llegar los mensajes. Rehabilítalos para verlos.',
|
||||||
titlegranted: 'Notificaciones permitidas habilitadas!',
|
titlegranted: 'Notificaciones permitidas habilitadas!',
|
||||||
|
statusnot: 'Estado Notificaciones',
|
||||||
titledenied: 'Notificaciones permitidas deshabilitadas!',
|
titledenied: 'Notificaciones permitidas deshabilitadas!',
|
||||||
title_subscribed: 'Suscripción a FreePlanet.app!',
|
title_subscribed: 'Suscripción a FreePlanet.app!',
|
||||||
subscribed: 'Ahora puedes recibir mensajes y notificaciones.',
|
subscribed: 'Ahora puedes recibir mensajes y notificaciones.',
|
||||||
@@ -400,6 +402,7 @@ const messages = {
|
|||||||
confirmed: 'Notifications Enabled!',
|
confirmed: 'Notifications Enabled!',
|
||||||
denied: 'Notifications Disabled! Attention, you will not see your messages incoming. Reenable it for see it',
|
denied: 'Notifications Disabled! Attention, you will not see your messages incoming. Reenable it for see it',
|
||||||
titlegranted: 'Notification Permission Granted!',
|
titlegranted: 'Notification Permission Granted!',
|
||||||
|
statusnot: 'status Notification',
|
||||||
titledenied: 'Notification Permission Denied!',
|
titledenied: 'Notification Permission Denied!',
|
||||||
title_subscribed: 'Subscribed to FreePlanet.app!',
|
title_subscribed: 'Subscribed to FreePlanet.app!',
|
||||||
subscribed: 'You can now receive Notification and Messages.',
|
subscribed: 'You can now receive Notification and Messages.',
|
||||||
|
|||||||
@@ -125,7 +125,7 @@ $heightdescr: 20px;
|
|||||||
// animation: none;
|
// animation: none;
|
||||||
//}
|
//}
|
||||||
|
|
||||||
.pos-item:hover, .pos-item-popover:hover {
|
.pos-item:hover, .pos-item-popover_cursor:hover {
|
||||||
cursor: grab;
|
cursor: grab;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -142,6 +142,11 @@ export default class SingleTodo extends Vue {
|
|||||||
|
|
||||||
this.clButtPopover = this.sel ? 'pos-item-popover comp_selected' : 'pos-item-popover'
|
this.clButtPopover = this.sel ? 'pos-item-popover comp_selected' : 'pos-item-popover'
|
||||||
|
|
||||||
|
if (!this.itemtodo.completed) {
|
||||||
|
this.clButtPopover += ' pos-item-popover_cursor'
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// if (this.inEdit) {
|
// if (this.inEdit) {
|
||||||
// this.classDescr += ' hide'
|
// this.classDescr += ' hide'
|
||||||
@@ -245,8 +250,6 @@ export default class SingleTodo extends Vue {
|
|||||||
|
|
||||||
this.faiFocus('inputdescr')
|
this.faiFocus('inputdescr')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// console.log('FINE - editTodo')
|
// console.log('FINE - editTodo')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
.flex-container{
|
.flex-container{
|
||||||
background-color: rgb(250, 250, 250);
|
background-color: rgb(250, 250, 250);
|
||||||
padding: 5px;
|
padding: 2px;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
|
|||||||
@@ -15,6 +15,8 @@ import { Getter, State, Mutation } from 'vuex-class'
|
|||||||
import { costanti } from '@src/store/Modules/costanti'
|
import { costanti } from '@src/store/Modules/costanti'
|
||||||
const namespace: string = 'Todos'
|
const namespace: string = 'Todos'
|
||||||
|
|
||||||
|
import globalroutines from './../../../globalroutines/index'
|
||||||
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
|
|
||||||
@@ -44,6 +46,7 @@ export default class Todo extends Vue {
|
|||||||
public service: any
|
public service: any
|
||||||
public actualMaxPosition: number = 15
|
public actualMaxPosition: number = 15
|
||||||
public scrollable = true
|
public scrollable = true
|
||||||
|
public tmpstrTodos: string = ''
|
||||||
public categoryAtt: string = ''
|
public categoryAtt: string = ''
|
||||||
// public showtype: number = Todos.state.showtype
|
// public showtype: number = Todos.state.showtype
|
||||||
|
|
||||||
@@ -502,5 +505,36 @@ export default class Todo extends Vue {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getArrTodos() {
|
||||||
|
|
||||||
|
let mystr = ''
|
||||||
|
let mythis = this
|
||||||
|
|
||||||
|
mythis.tmpstrTodos = ''
|
||||||
|
return globalroutines(null, 'readall', 'todos', null)
|
||||||
|
.then(function (alldata) {
|
||||||
|
const myrecs = [...alldata]
|
||||||
|
|
||||||
|
myrecs.forEach(rec => {
|
||||||
|
mystr = mystr + rec.descr + rec.completed + '] ['
|
||||||
|
})
|
||||||
|
|
||||||
|
mythis.tmpstrTodos = 'TODOS: ' + mystr
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// setArrTodos() {
|
||||||
|
//
|
||||||
|
// let mystr = ''
|
||||||
|
// let mythis = this
|
||||||
|
//
|
||||||
|
// mythis.tmpstrTodos = ''
|
||||||
|
// return globalroutines(null, 'write', 'todos', this.todos_arr[0])
|
||||||
|
// .then(function (alldata) {
|
||||||
|
// mythis.getArrTodos()
|
||||||
|
// })
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<q-page>
|
<q-page>
|
||||||
<div class="panel">
|
<div class="panel">
|
||||||
<p class="caption"></p>
|
|
||||||
|
|
||||||
showtype = {{showtype}}
|
|
||||||
<div class="divtitlecat">
|
<div class="divtitlecat">
|
||||||
<div class="flex-container">
|
<div class="flex-container">
|
||||||
<div class="flex-item categorytitle">{{categoryAtt | capitalize}}</div>
|
<div class="flex-item categorytitle">{{categoryAtt | capitalize}}</div>
|
||||||
@@ -29,17 +26,6 @@
|
|||||||
<q-item-main v-else>
|
<q-item-main v-else>
|
||||||
<q-item-tile label class="item-menu">{{field.label}}</q-item-tile>
|
<q-item-tile label class="item-menu">{{field.label}}</q-item-tile>
|
||||||
</q-item-main>
|
</q-item-main>
|
||||||
<!--<q-item-side>-->
|
|
||||||
<!--<div>-->
|
|
||||||
<!--<q-input v-model="itemtodo.progress"-->
|
|
||||||
<!--class="menuInputCompleted"-->
|
|
||||||
<!--type="number"-->
|
|
||||||
<!--suffix=""-->
|
|
||||||
<!--@change="val => { model = val }"-->
|
|
||||||
<!-->-->
|
|
||||||
<!--</div>-->
|
|
||||||
<!--</q-item-side>-->
|
|
||||||
|
|
||||||
</q-item>
|
</q-item>
|
||||||
</div>
|
</div>
|
||||||
</q-list>
|
</q-list>
|
||||||
@@ -55,13 +41,6 @@
|
|||||||
|
|
||||||
<div style="display: none">{{ prior = 0, priorcomplet = false }}</div>
|
<div style="display: none">{{ prior = 0, priorcomplet = false }}</div>
|
||||||
<div>
|
<div>
|
||||||
<!--<draggable v-model="todos_arr" :options="{draggable:'.myitemdrag'}"-->
|
|
||||||
<!--@start="onStart" @end="onEnd" class="dragArea">-->
|
|
||||||
<!--<transition-group :name="mytypetransgroup">-->
|
|
||||||
<!--<div :id="getmyid(mytodo._id)" v-for="(mytodo, index) in todos_arr" :key="mytodo._id" class="myitemdrag"-->
|
|
||||||
<!--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">-->
|
<!--<q-infinite-scroll :handler="loadMoreTodo" :offset="7">-->
|
||||||
<div class="container" v-dragula="todos_dacompletare(categoryAtt)" drake="first">
|
<div class="container" v-dragula="todos_dacompletare(categoryAtt)" drake="first">
|
||||||
<div :id="getmyid(mytodo._id)" :index="index"
|
<div :id="getmyid(mytodo._id)" :index="index"
|
||||||
@@ -89,7 +68,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!--<q-infinite-scroll :handler="loadMoreTodo" :offset="7">-->
|
<!--<q-infinite-scroll :handler="loadMoreTodo" :offset="7">-->
|
||||||
<div class="container" v-dragula="todos_completati(categoryAtt)" drake="second">
|
<div class="container">
|
||||||
<div :id="getmyid(mytodo._id)" :index="index"
|
<div :id="getmyid(mytodo._id)" :index="index"
|
||||||
v-for="(mytodo, index) in todos_completati(categoryAtt)"
|
v-for="(mytodo, index) in todos_completati(categoryAtt)"
|
||||||
:key="mytodo._id" class="myitemdrag">
|
:key="mytodo._id" class="myitemdrag">
|
||||||
@@ -105,8 +84,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!--</q-infinite-scroll>-->
|
<!--</q-infinite-scroll>-->
|
||||||
<!--</transition-group>-->
|
|
||||||
<!--</draggable>-->
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
@@ -117,14 +94,16 @@
|
|||||||
|
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
<!--
|
<!--{{ tmpstrTodos }}-->
|
||||||
<div class="flex-item btn-item">
|
|
||||||
<q-btn class="mybtn" round color="" icon="lock" @click="getArrTodos">Get Todo</q-btn>
|
<!--<div class="flex-item btn-item">-->
|
||||||
<q-btn class="mybtn" round color="" icon="person" @click="setArrTodos">Set Todo</q-btn>
|
<!--<q-btn class="mybtn" round color="" icon="lock" @click="getArrTodos">Get Todo</q-btn>-->
|
||||||
<q-btn class="mybtn" round color="" icon="list" @click="reload_fromServer++">Reload</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="testPao" float-label="testPao"/>–>-->
|
||||||
<!--<q-input v-model="todos_changed" float-label="todos_changed"/>-->
|
<!--<q-input v-model="todos_changed" float-label="todos_changed"/>-->
|
||||||
|
|
||||||
<!--<q-input v-model="reload_fromServer" float-label="reload_fromServer"/>-->
|
<!--<q-input v-model="reload_fromServer" float-label="reload_fromServer"/>-->
|
||||||
@@ -139,7 +118,7 @@
|
|||||||
<!--<q-btn class="mybtn" round color="" icon="lock" @click="clickaggshowtype()"></q-btn>-->
|
<!--<q-btn class="mybtn" round color="" icon="lock" @click="clickaggshowtype()"></q-btn>-->
|
||||||
|
|
||||||
|
|
||||||
<!--<span style="white-space: pre;">{{ todos_vista }}</span>-->
|
<span style="white-space: pre;">{{ todos_vista }}</span>
|
||||||
</div>
|
</div>
|
||||||
</q-page>
|
</q-page>
|
||||||
|
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ export interface IDrag {
|
|||||||
|
|
||||||
export interface ITodosState {
|
export interface ITodosState {
|
||||||
showtype: number
|
showtype: number
|
||||||
todos: [ITodo[]]
|
todos: {}
|
||||||
categories: string[]
|
categories: string[]
|
||||||
// todos_changed: number
|
// todos_changed: number
|
||||||
reload_fromServer: number
|
reload_fromServer: number
|
||||||
|
|||||||
@@ -54,7 +54,7 @@
|
|||||||
icon="notifications"
|
icon="notifications"
|
||||||
class="shadow"
|
class="shadow"
|
||||||
:label="$t('notification.titlegranted')"
|
:label="$t('notification.titlegranted')"
|
||||||
helper="Stato Notifiche">
|
:helper="$t('notification.statusnot')">
|
||||||
</q-field>
|
</q-field>
|
||||||
<q-field
|
<q-field
|
||||||
v-if="NotServiceWorker()"
|
v-if="NotServiceWorker()"
|
||||||
|
|||||||
@@ -246,7 +246,7 @@ namespace Actions {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log('createPushSubscription')
|
// console.log('createPushSubscription')
|
||||||
|
|
||||||
let reg
|
let reg
|
||||||
const mykey = process.env.PUBLICKEY_PUSH
|
const mykey = process.env.PUBLICKEY_PUSH
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ import { costanti } from '@src/store/Modules/costanti'
|
|||||||
|
|
||||||
const state: ITodosState = {
|
const state: ITodosState = {
|
||||||
showtype: costanti.ShowTypeTask.SHOW_LAST_N_COMPLETED,
|
showtype: costanti.ShowTypeTask.SHOW_LAST_N_COMPLETED,
|
||||||
todos: [[]],
|
todos: {},
|
||||||
categories: [],
|
categories: [],
|
||||||
// todos_changed: 1,
|
// todos_changed: 1,
|
||||||
reload_fromServer: 0,
|
reload_fromServer: 0,
|
||||||
@@ -288,15 +288,19 @@ namespace Mutations {
|
|||||||
return -1
|
return -1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function createNewItem(state: ITodosState, { objtodo, atfirst, categorySel }) {
|
function createNewItem(state: ITodosState, { objtodo, atfirst, categorySel }) {
|
||||||
const indcat = state.categories.indexOf(categorySel)
|
let indcat = state.categories.indexOf(categorySel)
|
||||||
|
if (indcat == -1) {
|
||||||
|
state.categories.push(categorySel)
|
||||||
|
indcat = state.categories.indexOf(categorySel)
|
||||||
|
}
|
||||||
console.log('createNewItem', objtodo, 'cat=', categorySel, 'state.todos[indcat]', state.todos[indcat])
|
console.log('createNewItem', objtodo, 'cat=', categorySel, 'state.todos[indcat]', state.todos[indcat])
|
||||||
if (state.todos[indcat] === undefined) {
|
if (state.todos[indcat] === undefined) {
|
||||||
state.todos[indcat] = []
|
state.todos[indcat] = []
|
||||||
}
|
|
||||||
if (!state.todos[indcat]) {
|
|
||||||
state.todos[indcat].push(objtodo)
|
state.todos[indcat].push(objtodo)
|
||||||
console.log('state.todos[indcat]', state.todos[indcat])
|
console.log('push state.todos[indcat]', state.todos)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (atfirst)
|
if (atfirst)
|
||||||
@@ -796,19 +800,25 @@ namespace Actions {
|
|||||||
|
|
||||||
|
|
||||||
async function swapElems(context, itemdragend: IDrag) {
|
async function swapElems(context, itemdragend: IDrag) {
|
||||||
// console.log('swapElems', itemdragend)
|
console.log('swapElems', itemdragend)
|
||||||
|
console.log('state.todos', state.todos)
|
||||||
|
console.log('state.categories', state.categories)
|
||||||
const cat = itemdragend.category
|
const cat = itemdragend.category
|
||||||
const indcat = state.categories.indexOf(cat)
|
const indcat = state.categories.indexOf(cat)
|
||||||
|
|
||||||
if (itemdragend.field === 'priority') {
|
if (itemdragend.field === 'priority') {
|
||||||
// get last elem priority
|
// get last elem priority
|
||||||
|
console.log('get last elem priority')
|
||||||
itemdragend.newIndex = getLastFirstElemPriority(itemdragend.category, itemdragend.prioritychosen, itemdragend.atfirst, itemdragend.idelemtochange)
|
itemdragend.newIndex = getLastFirstElemPriority(itemdragend.category, itemdragend.prioritychosen, itemdragend.atfirst, itemdragend.idelemtochange)
|
||||||
itemdragend.oldIndex = getIndexById(itemdragend.category, itemdragend.idelemtochange)
|
itemdragend.oldIndex = getIndexById(itemdragend.category, itemdragend.idelemtochange)
|
||||||
|
|
||||||
console.log('swapElems PRIORITY', itemdragend)
|
console.log('swapElems PRIORITY', itemdragend)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
console.log('indcat', indcat)
|
||||||
|
|
||||||
if (isValidIndex(cat, indcat) && isValidIndex(cat, itemdragend.newIndex) && isValidIndex(cat, itemdragend.oldIndex)) {
|
if (isValidIndex(cat, indcat) && isValidIndex(cat, itemdragend.newIndex) && isValidIndex(cat, itemdragend.oldIndex)) {
|
||||||
|
console.log('isValidIndex')
|
||||||
state.todos[indcat].splice(itemdragend.newIndex, 0, state.todos[indcat].splice(itemdragend.oldIndex, 1)[0])
|
state.todos[indcat].splice(itemdragend.newIndex, 0, state.todos[indcat].splice(itemdragend.oldIndex, 1)[0])
|
||||||
tools.notifyarraychanged(state.todos[indcat][itemdragend.newIndex])
|
tools.notifyarraychanged(state.todos[indcat][itemdragend.newIndex])
|
||||||
tools.notifyarraychanged(state.todos[indcat][itemdragend.oldIndex])
|
tools.notifyarraychanged(state.todos[indcat][itemdragend.oldIndex])
|
||||||
@@ -819,18 +829,21 @@ namespace Actions {
|
|||||||
|
|
||||||
if (isValidIndex(cat, precind) && isValidIndex(cat, nextind)) {
|
if (isValidIndex(cat, precind) && isValidIndex(cat, nextind)) {
|
||||||
if ((state.todos[indcat][precind].priority === state.todos[indcat][nextind].priority) && (state.todos[indcat][precind].priority !== state.todos[indcat][itemdragend.newIndex].priority)) {
|
if ((state.todos[indcat][precind].priority === state.todos[indcat][nextind].priority) && (state.todos[indcat][precind].priority !== state.todos[indcat][itemdragend.newIndex].priority)) {
|
||||||
|
console.log(' 1)')
|
||||||
state.todos[indcat][itemdragend.newIndex].priority = state.todos[indcat][precind].priority
|
state.todos[indcat][itemdragend.newIndex].priority = state.todos[indcat][precind].priority
|
||||||
tools.notifyarraychanged(state.todos[indcat][itemdragend.newIndex])
|
tools.notifyarraychanged(state.todos[indcat][itemdragend.newIndex])
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (!isValidIndex(cat, precind)) {
|
if (!isValidIndex(cat, precind)) {
|
||||||
if ((state.todos[indcat][nextind].priority !== state.todos[indcat][itemdragend.newIndex].priority)) {
|
if ((state.todos[indcat][nextind].priority !== state.todos[indcat][itemdragend.newIndex].priority)) {
|
||||||
|
console.log(' 2)')
|
||||||
state.todos[indcat][itemdragend.newIndex].priority = state.todos[indcat][nextind].priority
|
state.todos[indcat][itemdragend.newIndex].priority = state.todos[indcat][nextind].priority
|
||||||
tools.notifyarraychanged(state.todos[indcat][itemdragend.newIndex])
|
tools.notifyarraychanged(state.todos[indcat][itemdragend.newIndex])
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
if ((state.todos[indcat][precind].priority !== state.todos[indcat][itemdragend.newIndex].priority)) {
|
if ((state.todos[indcat][precind].priority !== state.todos[indcat][itemdragend.newIndex].priority)) {
|
||||||
|
console.log(' 3)')
|
||||||
state.todos[indcat][itemdragend.newIndex].priority = state.todos[indcat][precind].priority
|
state.todos[indcat][itemdragend.newIndex].priority = state.todos[indcat][precind].priority
|
||||||
tools.notifyarraychanged(state.todos[indcat][itemdragend.newIndex])
|
tools.notifyarraychanged(state.todos[indcat][itemdragend.newIndex])
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user