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

@@ -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() {