Added begin_development and begin_test

Added status (changed completed field)
fixed internet status connection.
This commit is contained in:
Paolo Arena
2019-04-02 00:18:01 +02:00
parent cea5dd118a
commit 7cacf5c6ea
40 changed files with 592 additions and 278 deletions

View File

@@ -262,12 +262,12 @@ export default class Header extends Vue {
function updateOnlineStatus(event) {
if (navigator.onLine) {
// console.log('EVENT ONLINE!')
console.log('EVENT ONLINE!')
// handle online status
GlobalStore.mutations.setStateConnection('online')
mythis.changeIconConn()
} else {
// console.log('EVENT OFFLINE!')
console.log('EVENT OFFLINE!')
// handle offline status
GlobalStore.mutations.setStateConnection('offline')
mythis.changeIconConn()

View File

@@ -47,11 +47,11 @@
<!--
<div v-if="isAdmin">
<q-btn flat dense round aria-label="">
<q-icon :class="clCloudUpload" name="cloud_upload"></q-icon>
<q-icon :class="clCloudUpload" nametranslate="cloud_upload"></q-icon>
</q-btn>
<q-btn flat dense round aria-label="">
<q-icon :class="clCloudUp_Indexeddb" name="arrow_upward"></q-icon>
<q-icon :class="clCloudUp_Indexeddb" nametranslate="arrow_upward"></q-icon>
</q-btn>
</div>

View File

@@ -1,7 +1,7 @@
import Vue from 'vue'
import { Component, Prop, Watch } from 'vue-property-decorator'
import { UserStore } from '@modules'
import { Projects, UserStore } from '@modules'
import { tools } from '../../../store/Modules/tools'
import { IProject } from '../../../model/index'
@@ -39,7 +39,7 @@ export default class SingleProject extends Vue {
@Prop({ required: true }) public itemproject: IProject
// @Watch('itemproject.completed') valueChanged() {
// this.watchupdate('completed')
// this.watchupdate('status')
// }
@Watch('itemproject.enableExpiring') public valueChanged4() {
@@ -64,6 +64,12 @@ export default class SingleProject extends Vue {
@Watch('itemproject.hoursworked') public valueChangedhoursworked() {
this.watchupdate('hoursworked')
}
@Watch('itemproject.begin_development') public valueChangedbegin_development() {
this.watchupdate('begin_development')
}
@Watch('itemproject.begin_test') public valueChangedbegin_test() {
this.watchupdate('begin_test')
}
@Watch('itemproject.progressCalc') public valueChanged6() {
console.log('itemproject.progressCalc')
this.updateClasses()
@@ -72,6 +78,10 @@ export default class SingleProject extends Vue {
this.watchupdate('progressCalc')
}
get getlabeltext() {
return this.$t('proj.newproj')
}
/*
public dateToYYYYMMDD(date) {
// may have timezone caveats https://stackoverflow.com/a/29774197/1850609
@@ -93,7 +103,7 @@ export default class SingleProject extends Vue {
}
public watchupdate(field = '') {
this.$emit('eventupdate', {myitem: this.itemproject, field } )
this.$emit('eventupdateproj', {myitem: this.itemproject, field } )
this.updateicon()
}
@@ -122,11 +132,10 @@ export default class SingleProject extends Vue {
this.clButtPopover = this.sel ? 'pos-item-popover comp_selected' : 'pos-item-popover'
if (!this.itemproject.completed) {
if (this.itemproject.status !== tools.Status.COMPLETED) {
this.clButtPopover += ' pos-item-popover_cursor'
}
// this.getinputdescr = 'inputdescr' + this.itemproject._id
// console.log('classDescrEdit = ', this.classDescrEdit)
@@ -143,10 +152,6 @@ export default class SingleProject extends Vue {
}
public getstrDate(mytimestamp) {
return date.formatDate(mytimestamp, 'DD-MM-YY')
}
public created() {
this.precDescr = this.itemproject.descr
this.updateicon()
@@ -167,7 +172,7 @@ export default class SingleProject extends Vue {
if (!this.sel) {
if (!this.inEdit) {
// this.attivaEdit = true
this.$emit('deselectAllRows', this.itemproject, true)
this.$emit('deselectAllRowsproj', this.itemproject, true)
if (!this.sel) {
this.selectRiga()
@@ -230,9 +235,9 @@ export default class SingleProject extends Vue {
}
public editProject() {
console.log('INIZIO - editProject')
// console.log('INIZIO - editProject')
if (this.attivaEdit) {
this.$emit('click')
// this.$emit('click')
this.precDescr = this.itemproject.descr
this.inEdit = true
if (!this.sel) {
@@ -242,12 +247,12 @@ export default class SingleProject extends Vue {
this.updateClasses()
}
this.faiFocus('inputdescr')
this.faiFocus('inputdescr', false, true)
}
// console.log('FINE - editProject')
}
public faiFocus(elem, isparent: boolean = false) {
public faiFocus(elem, isparent: boolean = false, select: boolean = false) {
setTimeout(() => {
let theField = null
if (isparent) {
@@ -260,10 +265,15 @@ export default class SingleProject extends Vue {
if (!!theField) {
theField.focus()
}
// console.log('focus()')
}, 100)
}
public getFocus(e) {
e.target.select()
}
public exitEdit(singola: boolean = false) {
if (this.inEdit) {
if (this.precDescr !== this.itemproject.descr) {
@@ -273,7 +283,7 @@ export default class SingleProject extends Vue {
this.inEdit = false
this.attivaEdit = false
this.updateClasses()
this.$emit('deselectAllRows', this.itemproject, false, singola)
this.$emit('deselectAllRowsproj', this.itemproject, false, singola)
}
}
@@ -367,19 +377,24 @@ export default class SingleProject extends Vue {
public setCompleted() {
// console.log('setCompleted')
this.itemproject.completed = !this.itemproject.completed
if (this.itemproject.status === tools.Status.COMPLETED) {
this.itemproject.status = tools.Status.OPENED
} else {
this.itemproject.status = tools.Status.COMPLETED
}
this.updateicon()
this.updatedata('completed')
this.updatedata('status')
this.deselectAndExitEdit()
}
public updatedata(field: string) {
// const myitem = tools.jsonCopy(this.itemproject)
console.log('calling this.$emit(eventupdate)', this.itemproject)
this.$emit('eventupdate', { myitem: this.itemproject, field } )
console.log('calling this.$emit(eventupdateproj)', this.itemproject)
this.$emit('eventupdateproj', { myitem: this.itemproject, field } )
}
public updateicon() {

View File

@@ -9,7 +9,9 @@
v-model.trim="precDescr"
autogrow
borderless
:label="getlabeltext"
dense
@focus="getFocus($event)"
:class="classDescrEdit" :max-height="100"
@keydown="keyDownArea" v-on:keydown.esc="exitEdit" @blur="exitEdit(true)" @click="editProject()"/>
@@ -35,13 +37,13 @@
<div v-if="itemproject.enableExpiring" :class="classExpiring">
<span class="data_string">{{getstrDate(itemproject.expiring_at)}}</span>
<span class="data_string">{{tools.getstrDate(itemproject.expiring_at)}}</span>
<q-icon name="event" class="cursor-pointer" style="padding: 2px;">
<q-popup-proxy>
<q-date v-model="itemproject.expiring_at" today-btn/>
</q-popup-proxy>
</q-icon>
<!--<q-icon name="event" class="cursor-pointer" />-->
<!--<q-icon nametranslate="event" class="cursor-pointer" />-->
<!--<q-popup-edit v-model="itemproject.expiring_at"-->
<!--title="Edit"-->
<!--buttons class="">-->

View File

@@ -45,7 +45,7 @@ export default class SingleTodo extends Vue {
@Prop({ required: true }) public itemtodo: ITodo
// @Watch('itemtodo.completed') valueChanged() {
// this.watchupdate('completed')
// this.watchupdate('status')
// }
@Watch('itemtodo.enableExpiring') public valueChanged4() {
@@ -112,7 +112,7 @@ export default class SingleTodo extends Vue {
this.classExpiring = 'flex-item data-item shadow-1'
this.classExpiringEx = ''
if (this.itemtodo.completed) {
if (this.itemtodo.status === tools.Status.COMPLETED) {
this.percentageProgress = 100
this.classCompleted += ' icon_completed'
this.classDescr += ' status_completed'
@@ -129,7 +129,7 @@ export default class SingleTodo extends Vue {
let mycolcl = ' ' + tools.getProgressClassColor(this.itemtodo.progress)
this.colProgress = tools.getProgressColor(this.itemtodo.progress)
if (this.itemtodo.completed) {
if (this.itemtodo.status === tools.Status.COMPLETED) {
mycolcl = ' percompleted'
this.colProgress = 'gray'
}
@@ -141,7 +141,7 @@ export default class SingleTodo extends Vue {
this.clButtPopover = this.sel ? 'pos-item-popover comp_selected' : 'pos-item-popover'
if (!this.itemtodo.completed) {
if (this.itemtodo.status !== tools.Status.COMPLETED) {
this.clButtPopover += ' pos-item-popover_cursor'
}
@@ -169,10 +169,6 @@ export default class SingleTodo extends Vue {
}
public getstrDate(mytimestamp) {
return date.formatDate(mytimestamp, 'DD-MM-YY')
}
public created() {
this.precDescr = this.itemtodo.descr
this.updateicon()
@@ -192,7 +188,7 @@ export default class SingleTodo extends Vue {
if (!this.sel) {
if (!this.inEdit) {
this.$emit('deselectAllRows', this.itemtodo, true)
this.$emit('deselectAllRowstodo', this.itemtodo, true)
if (!this.sel) {
this.selectRiga()
@@ -239,7 +235,7 @@ export default class SingleTodo extends Vue {
}
public editTodo() {
if (!this.itemtodo.completed) {
if (this.itemtodo.status !== tools.Status.COMPLETED) {
// console.log('INIZIO - editTodo')
this.$emit('click')
this.precDescr = this.itemtodo.descr
@@ -281,7 +277,7 @@ export default class SingleTodo extends Vue {
// console.log('exitEdit')
this.inEdit = false
this.updateClasses()
this.$emit('deselectAllRows', this.itemtodo, false, singola)
this.$emit('deselectAllRowstodo', this.itemtodo, false, singola)
}
}
@@ -374,11 +370,15 @@ export default class SingleTodo extends Vue {
public setCompleted() {
// console.log('setCompleted')
this.itemtodo.completed = !this.itemtodo.completed
if (this.itemtodo.status === tools.Status.COMPLETED) {
this.itemtodo.status = tools.Status.OPENED
} else {
this.itemtodo.status = tools.Status.COMPLETED
}
this.updateicon()
this.updatedata('completed')
this.updatedata('status')
this.deselectAndExitEdit()
}
@@ -391,7 +391,7 @@ export default class SingleTodo extends Vue {
public updateicon() {
// console.log('updateicon')
if (this.itemtodo.completed) {
if (this.itemtodo.status === tools.Status.COMPLETED) {
this.iconCompleted = 'check_circle'
}
else {
@@ -412,7 +412,7 @@ export default class SingleTodo extends Vue {
}
public removeitem(id) {
this.$emit('deleteItem', id)
this.$emit('deleteItemtodo', id)
}
public enableExpiring() {

View File

@@ -9,7 +9,7 @@
</div>
<div class="flex-item donotdrag divdescrTot">
<q-input v-if="sel && !itemtodo.completed" hide-underline type="textarea" ref="inputdescr"
<q-input v-if="sel && itemtodo.status !== tools.Status.COMPLETED" hide-underline type="textarea" ref="inputdescr"
v-model.trim="precDescr"
autogrow
borderless
@@ -56,13 +56,13 @@
<div v-if="itemtodo.enableExpiring" :class="classExpiring">
<span class="data_string">{{getstrDate(itemtodo.expiring_at)}}</span>
<span class="data_string">{{tools.getstrDate(itemtodo.expiring_at)}}</span>
<q-icon name="event" class="cursor-pointer" style="padding: 2px;">
<q-popup-proxy>
<q-date v-model="itemtodo.expiring_at" today-btn/>
</q-popup-proxy>
</q-icon>
<!--<q-icon name="event" class="cursor-pointer" />-->
<!--<q-icon nametranslate="event" class="cursor-pointer" />-->
<!--<q-popup-edit v-model="itemtodo.expiring_at"-->
<!--title="Edit"-->
<!--buttons class="">-->

View File

@@ -15,7 +15,7 @@
<q-checkbox v-model="itemtodo.enableExpiring"/>
</q-item-section>
<q-item-section side v-if="field.value === 110">
<q-checkbox v-model="itemtodo.completed"/>
<q-checkbox v-model="itemtodo.status"/>
</q-item-section>
</q-item>
<q-item clickable v-if="(field.value === 120)" :icon="field.icon"