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

@@ -14,7 +14,7 @@ const baseConfig = {
'bundle': helpers.root('/src/main.ts'), 'bundle': helpers.root('/src/main.ts'),
}, },
output: { output: {
filename: '[name].js', filename: '[nametranslate].js',
publicPath: '/', publicPath: '/',
path: helpers.root('dist'), path: helpers.root('dist'),
}, },
@@ -80,10 +80,10 @@ const baseConfig = {
} }
}, { }, {
test: /\.(jpe?g|png|ttf|eot|woff(2)?)(\?[a-z0-9=&.]+)?$/, test: /\.(jpe?g|png|ttf|eot|woff(2)?)(\?[a-z0-9=&.]+)?$/,
use: 'base64-inline-loader?limit=1000&name=[name].[ext]' use: 'base64-inline-loader?limit=1000&nametranslate=[nametranslate].[ext]'
},{ },{
test: /\.(svg)(\?[a-z0-9=&.]+)?$/, test: /\.(svg)(\?[a-z0-9=&.]+)?$/,
use: 'base64-inline-loader?limit=4000&name=[name].[ext]' use: 'base64-inline-loader?limit=4000&nametranslate=[nametranslate].[ext]'
} }
] ]
}, },

191
npm-shrinkwrap.json generated
View File

@@ -4353,9 +4353,9 @@
} }
}, },
"@vue/cli-plugin-unit-jest": { "@vue/cli-plugin-unit-jest": {
"version": "3.5.1", "version": "3.5.3",
"resolved": "https://registry.npmjs.org/@vue/cli-plugin-unit-jest/-/cli-plugin-unit-jest-3.5.1.tgz", "resolved": "https://registry.npmjs.org/@vue/cli-plugin-unit-jest/-/cli-plugin-unit-jest-3.5.3.tgz",
"integrity": "sha512-VFnkM3R/Z91IWLZyKh6CLgsWaRJfhWUThkAR13q7ama8WyIFPpKAyJKM0jdsm1Gx2PnBwCm/mrjUpzK4VB0ssA==", "integrity": "sha512-6GRN3dhFXF8FTqvAylHA8fh+ii5+KoKPPz972j18V/MedYgm39qVSkDWD2sLKOueTX5SSVqk3QKyF6gy+Uhp7Q==",
"dev": true, "dev": true,
"requires": { "requires": {
"@vue/cli-shared-utils": "^3.5.1", "@vue/cli-shared-utils": "^3.5.1",
@@ -4382,6 +4382,32 @@
"integrity": "sha1-odl8yvy8JiXMcPrc6zalDFiwGlM=", "integrity": "sha1-odl8yvy8JiXMcPrc6zalDFiwGlM=",
"dev": true "dev": true
}, },
"babel-jest": {
"version": "23.6.0",
"resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-23.6.0.tgz",
"integrity": "sha512-lqKGG6LYXYu+DQh/slrQ8nxXQkEkhugdXsU6St7GmhVS7Ilc/22ArwqXNJrf0QaOBjZB0360qZMwXqDYQHXaew==",
"dev": true,
"requires": {
"babel-plugin-istanbul": "^4.1.6",
"babel-preset-jest": "^23.2.0"
}
},
"babel-plugin-jest-hoist": {
"version": "23.2.0",
"resolved": "https://registry.npmjs.org/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-23.2.0.tgz",
"integrity": "sha1-5h+uBaHKiAGq3uV6bWa4zvr0QWc=",
"dev": true
},
"babel-preset-jest": {
"version": "23.2.0",
"resolved": "https://registry.npmjs.org/babel-preset-jest/-/babel-preset-jest-23.2.0.tgz",
"integrity": "sha1-jsegOhOPABoaj7HoETZSvxpV2kY=",
"dev": true,
"requires": {
"babel-plugin-jest-hoist": "^23.2.0",
"babel-plugin-syntax-object-rest-spread": "^6.13.0"
}
},
"braces": { "braces": {
"version": "1.8.5", "version": "1.8.5",
"resolved": "https://registry.npmjs.org/braces/-/braces-1.8.5.tgz", "resolved": "https://registry.npmjs.org/braces/-/braces-1.8.5.tgz",
@@ -6262,13 +6288,109 @@
} }
}, },
"babel-jest": { "babel-jest": {
"version": "23.6.0", "version": "24.5.0",
"resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-23.6.0.tgz", "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-24.5.0.tgz",
"integrity": "sha512-lqKGG6LYXYu+DQh/slrQ8nxXQkEkhugdXsU6St7GmhVS7Ilc/22ArwqXNJrf0QaOBjZB0360qZMwXqDYQHXaew==", "integrity": "sha512-0fKCXyRwxFTJL0UXDJiT2xYxO9Lu2vBd9n+cC+eDjESzcVG3s2DRGAxbzJX21fceB1WYoBjAh8pQ83dKcl003g==",
"dev": true, "dev": true,
"requires": { "requires": {
"babel-plugin-istanbul": "^4.1.6", "@jest/transform": "^24.5.0",
"babel-preset-jest": "^23.2.0" "@jest/types": "^24.5.0",
"@types/babel__core": "^7.1.0",
"babel-plugin-istanbul": "^5.1.0",
"babel-preset-jest": "^24.3.0",
"chalk": "^2.4.2",
"slash": "^2.0.0"
},
"dependencies": {
"babel-plugin-istanbul": {
"version": "5.1.1",
"resolved": "https://registry.npmjs.org/babel-plugin-istanbul/-/babel-plugin-istanbul-5.1.1.tgz",
"integrity": "sha512-RNNVv2lsHAXJQsEJ5jonQwrJVWK8AcZpG1oxhnjCUaAjL7xahYLANhPUZbzEQHjKy1NMYUwn+0NPKQc8iSY4xQ==",
"dev": true,
"requires": {
"find-up": "^3.0.0",
"istanbul-lib-instrument": "^3.0.0",
"test-exclude": "^5.0.0"
}
},
"istanbul-lib-coverage": {
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.3.tgz",
"integrity": "sha512-dKWuzRGCs4G+67VfW9pBFFz2Jpi4vSp/k7zBcJ888ofV5Mi1g5CUML5GvMvV6u9Cjybftu+E8Cgp+k0dI1E5lw==",
"dev": true
},
"istanbul-lib-instrument": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-3.1.0.tgz",
"integrity": "sha512-ooVllVGT38HIk8MxDj/OIHXSYvH+1tq/Vb38s8ixt9GoJadXska4WkGY+0wkmtYCZNYtaARniH/DixUGGLZ0uA==",
"dev": true,
"requires": {
"@babel/generator": "^7.0.0",
"@babel/parser": "^7.0.0",
"@babel/template": "^7.0.0",
"@babel/traverse": "^7.0.0",
"@babel/types": "^7.0.0",
"istanbul-lib-coverage": "^2.0.3",
"semver": "^5.5.0"
}
},
"load-json-file": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz",
"integrity": "sha1-L19Fq5HjMhYjT9U62rZo607AmTs=",
"dev": true,
"requires": {
"graceful-fs": "^4.1.2",
"parse-json": "^4.0.0",
"pify": "^3.0.0",
"strip-bom": "^3.0.0"
}
},
"pify": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz",
"integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=",
"dev": true
},
"read-pkg": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-3.0.0.tgz",
"integrity": "sha1-nLxoaXj+5l0WwA4rGcI3/Pbjg4k=",
"dev": true,
"requires": {
"load-json-file": "^4.0.0",
"normalize-package-data": "^2.3.2",
"path-type": "^3.0.0"
}
},
"read-pkg-up": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-4.0.0.tgz",
"integrity": "sha512-6etQSH7nJGsK0RbG/2TeDzZFa8shjQ1um+SwQQ5cwKy0dhSXdOncEhb1CPpvQG4h7FyOV6EB6YlV0yJvZQNAkA==",
"dev": true,
"requires": {
"find-up": "^3.0.0",
"read-pkg": "^3.0.0"
}
},
"strip-bom": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz",
"integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=",
"dev": true
},
"test-exclude": {
"version": "5.1.0",
"resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-5.1.0.tgz",
"integrity": "sha512-gwf0S2fFsANC55fSeSqpb8BYk6w3FDvwZxfNjeF6FRgvFa43r+7wRiA/Q0IxoRU37wB/LE8IQ4221BsNucTaCA==",
"dev": true,
"requires": {
"arrify": "^1.0.1",
"minimatch": "^3.0.4",
"read-pkg-up": "^4.0.0",
"require-main-filename": "^1.0.1"
}
}
} }
}, },
"babel-loader": { "babel-loader": {
@@ -6438,10 +6560,13 @@
} }
}, },
"babel-plugin-jest-hoist": { "babel-plugin-jest-hoist": {
"version": "23.2.0", "version": "24.3.0",
"resolved": "https://registry.npmjs.org/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-23.2.0.tgz", "resolved": "https://registry.npmjs.org/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-24.3.0.tgz",
"integrity": "sha1-5h+uBaHKiAGq3uV6bWa4zvr0QWc=", "integrity": "sha512-nWh4N1mVH55Tzhx2isvUN5ebM5CDUvIpXPZYMRazQughie/EqGnbR+czzoQlhUmJG9pPJmYDRhvocotb2THl1w==",
"dev": true "dev": true,
"requires": {
"@types/babel__traverse": "^7.0.6"
}
}, },
"babel-plugin-syntax-object-rest-spread": { "babel-plugin-syntax-object-rest-spread": {
"version": "6.13.0", "version": "6.13.0",
@@ -6505,13 +6630,13 @@
} }
}, },
"babel-preset-jest": { "babel-preset-jest": {
"version": "23.2.0", "version": "24.3.0",
"resolved": "https://registry.npmjs.org/babel-preset-jest/-/babel-preset-jest-23.2.0.tgz", "resolved": "https://registry.npmjs.org/babel-preset-jest/-/babel-preset-jest-24.3.0.tgz",
"integrity": "sha1-jsegOhOPABoaj7HoETZSvxpV2kY=", "integrity": "sha512-VGTV2QYBa/Kn3WCOKdfS31j9qomaXSgJqi65B6o05/1GsJyj9LVhSljM9ro4S+IBGj/ENhNBuH9bpqzztKAQSw==",
"dev": true, "dev": true,
"requires": { "requires": {
"babel-plugin-jest-hoist": "^23.2.0", "@babel/plugin-syntax-object-rest-spread": "^7.0.0",
"babel-plugin-syntax-object-rest-spread": "^6.13.0" "babel-plugin-jest-hoist": "^24.3.0"
} }
}, },
"babel-register": { "babel-register": {
@@ -13341,6 +13466,32 @@
"source-map": "^0.5.7" "source-map": "^0.5.7"
} }
}, },
"babel-jest": {
"version": "23.6.0",
"resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-23.6.0.tgz",
"integrity": "sha512-lqKGG6LYXYu+DQh/slrQ8nxXQkEkhugdXsU6St7GmhVS7Ilc/22ArwqXNJrf0QaOBjZB0360qZMwXqDYQHXaew==",
"dev": true,
"requires": {
"babel-plugin-istanbul": "^4.1.6",
"babel-preset-jest": "^23.2.0"
}
},
"babel-plugin-jest-hoist": {
"version": "23.2.0",
"resolved": "https://registry.npmjs.org/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-23.2.0.tgz",
"integrity": "sha1-5h+uBaHKiAGq3uV6bWa4zvr0QWc=",
"dev": true
},
"babel-preset-jest": {
"version": "23.2.0",
"resolved": "https://registry.npmjs.org/babel-preset-jest/-/babel-preset-jest-23.2.0.tgz",
"integrity": "sha1-jsegOhOPABoaj7HoETZSvxpV2kY=",
"dev": true,
"requires": {
"babel-plugin-jest-hoist": "^23.2.0",
"babel-plugin-syntax-object-rest-spread": "^6.13.0"
}
},
"braces": { "braces": {
"version": "1.8.5", "version": "1.8.5",
"resolved": "https://registry.npmjs.org/braces/-/braces-1.8.5.tgz", "resolved": "https://registry.npmjs.org/braces/-/braces-1.8.5.tgz",
@@ -14337,9 +14488,9 @@
"dev": true "dev": true
}, },
"js-beautify": { "js-beautify": {
"version": "1.9.0", "version": "1.9.1",
"resolved": "https://registry.npmjs.org/js-beautify/-/js-beautify-1.9.0.tgz", "resolved": "https://registry.npmjs.org/js-beautify/-/js-beautify-1.9.1.tgz",
"integrity": "sha512-P0skmY4IDjfLiVrx+GLDeme8w5G0R1IGXgccVU5HP2VM3lRblH7qN2LTea5vZAxrDjpZBD0Jv+ahpjwVcbz/rw==", "integrity": "sha512-oxxvVZdOdUfzk8IOLBF2XUZvl2GoBEfA+b0of4u2EBY/46NlXasi8JdFvazA5lCrf9/lQhTjyVy2QCUW7iq0MQ==",
"dev": true, "dev": true,
"requires": { "requires": {
"config-chain": "^1.1.12", "config-chain": "^1.1.12",

View File

@@ -98,11 +98,11 @@
"@vue/cli-plugin-e2e-cypress": "^3.0.1", "@vue/cli-plugin-e2e-cypress": "^3.0.1",
"@vue/cli-plugin-pwa": "^3.0.1", "@vue/cli-plugin-pwa": "^3.0.1",
"@vue/cli-plugin-typescript": "^3.0.1", "@vue/cli-plugin-typescript": "^3.0.1",
"@vue/cli-plugin-unit-jest": "^3.0.1", "@vue/cli-plugin-unit-jest": "^3.5.3",
"@vue/cli-service": "^3.0.1", "@vue/cli-service": "^3.0.1",
"@vue/test-utils": "^1.0.0-beta.20", "@vue/test-utils": "^1.0.0-beta.20",
"babel-core": "^7.0.0-bridge.0", "babel-core": "^7.0.0-bridge.0",
"babel-jest": "^23.4.2", "babel-jest": "^24.5.0",
"babel-loader": "8.0.0-beta.2", "babel-loader": "8.0.0-beta.2",
"babel-plugin-transform-imports": "1.5.1", "babel-plugin-transform-imports": "1.5.1",
"eslint": "^5.5.0", "eslint": "^5.5.0",

View File

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

View File

@@ -47,11 +47,11 @@
<!-- <!--
<div v-if="isAdmin"> <div v-if="isAdmin">
<q-btn flat dense round aria-label=""> <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>
<q-btn flat dense round aria-label=""> <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> </q-btn>
</div> </div>

View File

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

View File

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

View File

@@ -45,7 +45,7 @@ export default class SingleTodo extends Vue {
@Prop({ required: true }) public itemtodo: ITodo @Prop({ required: true }) public itemtodo: ITodo
// @Watch('itemtodo.completed') valueChanged() { // @Watch('itemtodo.completed') valueChanged() {
// this.watchupdate('completed') // this.watchupdate('status')
// } // }
@Watch('itemtodo.enableExpiring') public valueChanged4() { @Watch('itemtodo.enableExpiring') public valueChanged4() {
@@ -112,7 +112,7 @@ export default class SingleTodo extends Vue {
this.classExpiring = 'flex-item data-item shadow-1' this.classExpiring = 'flex-item data-item shadow-1'
this.classExpiringEx = '' this.classExpiringEx = ''
if (this.itemtodo.completed) { if (this.itemtodo.status === tools.Status.COMPLETED) {
this.percentageProgress = 100 this.percentageProgress = 100
this.classCompleted += ' icon_completed' this.classCompleted += ' icon_completed'
this.classDescr += ' status_completed' this.classDescr += ' status_completed'
@@ -129,7 +129,7 @@ export default class SingleTodo extends Vue {
let mycolcl = ' ' + tools.getProgressClassColor(this.itemtodo.progress) let mycolcl = ' ' + tools.getProgressClassColor(this.itemtodo.progress)
this.colProgress = tools.getProgressColor(this.itemtodo.progress) this.colProgress = tools.getProgressColor(this.itemtodo.progress)
if (this.itemtodo.completed) { if (this.itemtodo.status === tools.Status.COMPLETED) {
mycolcl = ' percompleted' mycolcl = ' percompleted'
this.colProgress = 'gray' 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' 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' 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() { public created() {
this.precDescr = this.itemtodo.descr this.precDescr = this.itemtodo.descr
this.updateicon() this.updateicon()
@@ -192,7 +188,7 @@ export default class SingleTodo extends Vue {
if (!this.sel) { if (!this.sel) {
if (!this.inEdit) { if (!this.inEdit) {
this.$emit('deselectAllRows', this.itemtodo, true) this.$emit('deselectAllRowstodo', this.itemtodo, true)
if (!this.sel) { if (!this.sel) {
this.selectRiga() this.selectRiga()
@@ -239,7 +235,7 @@ export default class SingleTodo extends Vue {
} }
public editTodo() { public editTodo() {
if (!this.itemtodo.completed) { if (this.itemtodo.status !== tools.Status.COMPLETED) {
// console.log('INIZIO - editTodo') // console.log('INIZIO - editTodo')
this.$emit('click') this.$emit('click')
this.precDescr = this.itemtodo.descr this.precDescr = this.itemtodo.descr
@@ -281,7 +277,7 @@ export default class SingleTodo extends Vue {
// console.log('exitEdit') // console.log('exitEdit')
this.inEdit = false this.inEdit = false
this.updateClasses() 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() { public setCompleted() {
// console.log('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.updateicon()
this.updatedata('completed') this.updatedata('status')
this.deselectAndExitEdit() this.deselectAndExitEdit()
} }
@@ -391,7 +391,7 @@ export default class SingleTodo extends Vue {
public updateicon() { public updateicon() {
// console.log('updateicon') // console.log('updateicon')
if (this.itemtodo.completed) { if (this.itemtodo.status === tools.Status.COMPLETED) {
this.iconCompleted = 'check_circle' this.iconCompleted = 'check_circle'
} }
else { else {
@@ -412,7 +412,7 @@ export default class SingleTodo extends Vue {
} }
public removeitem(id) { public removeitem(id) {
this.$emit('deleteItem', id) this.$emit('deleteItemtodo', id)
} }
public enableExpiring() { public enableExpiring() {

View File

@@ -9,7 +9,7 @@
</div> </div>
<div class="flex-item donotdrag divdescrTot"> <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" v-model.trim="precDescr"
autogrow autogrow
borderless borderless
@@ -56,13 +56,13 @@
<div v-if="itemtodo.enableExpiring" :class="classExpiring"> <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-icon name="event" class="cursor-pointer" style="padding: 2px;">
<q-popup-proxy> <q-popup-proxy>
<q-date v-model="itemtodo.expiring_at" today-btn/> <q-date v-model="itemtodo.expiring_at" today-btn/>
</q-popup-proxy> </q-popup-proxy>
</q-icon> </q-icon>
<!--<q-icon name="event" class="cursor-pointer" />--> <!--<q-icon nametranslate="event" class="cursor-pointer" />-->
<!--<q-popup-edit v-model="itemtodo.expiring_at"--> <!--<q-popup-edit v-model="itemtodo.expiring_at"-->
<!--title="Edit"--> <!--title="Edit"-->
<!--buttons class="">--> <!--buttons class="">-->

View File

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

View File

@@ -4,7 +4,7 @@ import Graphql from './graphql'
export default (context, error) => { export default (context, error) => {
/* /*
if (error.constructor.name === 'FirebaseError') { if (error.constructor.nametranslate === 'FirebaseError') {
Firebase(error) Firebase(error)
return return
} }

View File

@@ -5,6 +5,7 @@ import { GlobalStore } from '../store/Modules'
import { idbKeyval as storage } from '../js/storage.js' import { idbKeyval as storage } from '../js/storage.js'
import { costanti } from '../store/Modules/costanti' import { costanti } from '../store/Modules/costanti'
import { ICfgData, IGlobalState } from '@src/model' import { ICfgData, IGlobalState } from '@src/model'
import { tools } from '@src/store/Modules/tools'
function saveConfigIndexDb(context) { function saveConfigIndexDb(context) {
@@ -25,7 +26,7 @@ function writeConfigIndexDb(context, data) {
} }
async function readfromIndexDbToState(context, table) { async function readfromIndexDbToState(context, table) {
console.log('*** readfromIndexDbToState ***') console.log('*** readfromIndexDbToState ***', table)
return await storage.getalldata(table) return await storage.getalldata(table)
.then((reccat) => { .then((reccat) => {
@@ -45,30 +46,31 @@ async function readfromIndexDbToState(context, table) {
console.log(table + ' records', records) console.log(table + ' records', records)
// console.log('&&&&&&& readfromIndexDbToState OK: Num RECORD: ', records.length) // console.log('&&&&&&& readfromIndexDbToState OK: Num RECORD: ', records.length)
const arrinit = []
for (const mytodo of records) { for (const mytodo of records) {
const cat = mytodo.category const cat = mytodo.category
const indcat = Todos.state.categories.indexOf(cat) const indcat = Todos.state.categories.indexOf(cat)
if (Todos.state.todos[indcat] === undefined) { if (arrinit.indexOf(indcat) < 0) {
Todos.state.todos[indcat] = {} Todos.state.todos[indcat] = []
arrinit.push(indcat)
} }
// add to the right array
Todos.state.todos[indcat].push(mytodo) Todos.state.todos[indcat].push(mytodo)
} }
console.log('************ ARRAYS SALVATI IN MEMORIA ', records) console.log('************ ARRAYS SALVATI IN MEMORIA ', table, records)
}) })
} else if (table === 'projects') { } else {
Projects.state.projects = [] const arrris = tools.setArrayMainByTable(table, reccat)
for (const elem of reccat) { // console.log('************ ARRAYS SALVATI IN MEMORIA ', table, arrris)
Projects.state.projects.push(elem.valore)
}
} }
}).catch((error) => { }).catch((error) => {
console.log('err: ', error) console.log('err readfromIndexDbToState: ', error)
}) })
} }
@@ -95,7 +97,7 @@ export default async (context, cmd, table, datakey = null, id = '') => {
GlobalStore.state.connData.uploading_indexeddb = 1 GlobalStore.state.connData.uploading_indexeddb = 1
} }
return await storage.setdata(table, datakey) return await storage.setdata(table, datakey)
} else if (cmd === 'updatefromIndexedDbToStateTodo') { } else if (cmd === 'updatefromIndexedDbToState') {
return await readfromIndexDbToState(context, table) return await readfromIndexDbToState(context, table)
} else if (cmd === 'readall') { } else if (cmd === 'readall') {
if (GlobalStore) { if (GlobalStore) {

64
src/jquery.d.ts vendored
View File

@@ -225,7 +225,7 @@ interface JQueryStatic<TElement extends Node = HTMLElement> {
contains(container: Element, contained: Element): boolean contains(container: Element, contained: Element): boolean
css(elem: Element, unknown: any): any css(elem: Element, unknown: any): any
/** /**
* Returns value at named data store for the element, as set by jQuery.data(element, name, value), or * Returns value at named data store for the element, as set by jQuery.data(element, nametranslate, value), or
* the full data store for the element. * the full data store for the element.
* *
* @param element The DOM element to query for the data. * @param element The DOM element to query for the data.
@@ -246,7 +246,7 @@ interface JQueryStatic<TElement extends Node = HTMLElement> {
*/ */
data<T>(element: Element, key: string, value: T): T data<T>(element: Element, key: string, value: T): T
/** /**
* Returns value at named data store for the element, as set by jQuery.data(element, name, value), or * Returns value at named data store for the element, as set by jQuery.data(element, nametranslate, value), or
* the full data store for the element. * the full data store for the element.
* *
* @param element The DOM element to query for the data. * @param element The DOM element to query for the data.
@@ -260,7 +260,7 @@ interface JQueryStatic<TElement extends Node = HTMLElement> {
* Execute the next function on the queue for the matched element. * Execute the next function on the queue for the matched element.
* *
* @param element A DOM element from which to remove and execute a queued function. * @param element A DOM element from which to remove and execute a queued function.
* @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. * @param queueName A string containing the nametranslate of the queue. Defaults to fx, the standard effects queue.
* @see {@link https://api.jquery.com/jQuery.dequeue/} * @see {@link https://api.jquery.com/jQuery.dequeue/}
* @since 1.3 * @since 1.3
*/ */
@@ -695,7 +695,7 @@ interface JQueryStatic<TElement extends Node = HTMLElement> {
/** /**
* Create a serialized representation of an array, a plain object, or a jQuery object suitable for use * Create a serialized representation of an array, a plain object, or a jQuery object suitable for use
* in a URL query string or Ajax request. In case a jQuery object is passed, it should contain input * in a URL query string or Ajax request. In case a jQuery object is passed, it should contain input
* elements with name/value properties. * elements with nametranslate/value properties.
* *
* @param obj An array, a plain object, or a jQuery object to serialize. * @param obj An array, a plain object, or a jQuery object to serialize.
* @param traditional A Boolean indicating whether to perform a traditional "shallow" serialization. * @param traditional A Boolean indicating whether to perform a traditional "shallow" serialization.
@@ -2772,14 +2772,14 @@ interface JQueryStatic<TElement extends Node = HTMLElement> {
// endregion // endregion
// region (context, name) // region (context, nametranslate)
/** /**
* Takes a function and returns a new one that will always have a particular context. * Takes a function and returns a new one that will always have a particular context.
* *
* @param context The object to which the context of the function should be set. * @param context The object to which the context of the function should be set.
* @param name The name of the function whose context will be changed (should be a property of the context object). * @param name The nametranslate of the function whose context will be changed (should be a property of the context object).
* @param additionalArguments Any number of arguments to be passed to the function named in the name argument. * @param additionalArguments Any number of arguments to be passed to the function named in the nametranslate argument.
* @see {@link https://api.jquery.com/jQuery.proxy/} * @see {@link https://api.jquery.com/jQuery.proxy/}
* @since 1.4 * @since 1.4
* @since 1.6 * @since 1.6
@@ -2796,7 +2796,7 @@ interface JQueryStatic<TElement extends Node = HTMLElement> {
* Manipulate the queue of functions to be executed on the matched element. * Manipulate the queue of functions to be executed on the matched element.
* *
* @param element A DOM element where the array of queued functions is attached. * @param element A DOM element where the array of queued functions is attached.
* @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. * @param queueName A string containing the nametranslate of the queue. Defaults to fx, the standard effects queue.
* @param newQueue The new function to add to the queue. * @param newQueue The new function to add to the queue.
* An array of functions to replace the current queue contents. * An array of functions to replace the current queue contents.
* @see {@link https://api.jquery.com/jQuery.queue/} * @see {@link https://api.jquery.com/jQuery.queue/}
@@ -3004,7 +3004,7 @@ interface JQuery<TElement extends Node = HTMLElement> extends Iterable<TElement>
* *
* @param className One or more space-separated classes to be added to the class attribute of each matched element. * @param className One or more space-separated classes to be added to the class attribute of each matched element.
* A function returning one or more space-separated class names to be added to the existing class * A function returning one or more space-separated class names to be added to the existing class
* name(s). Receives the index position of the element in the set and the existing class name(s) as * nametranslate(s). Receives the index position of the element in the set and the existing class nametranslate(s) as
* arguments. Within the function, this refers to the current element in the set. * arguments. Within the function, this refers to the current element in the set.
* @see {@link https://api.jquery.com/addClass/} * @see {@link https://api.jquery.com/addClass/}
* @since 1.0 * @since 1.0
@@ -3159,7 +3159,7 @@ interface JQuery<TElement extends Node = HTMLElement> extends Iterable<TElement>
/** /**
* Set one or more attributes for the set of matched elements. * Set one or more attributes for the set of matched elements.
* *
* @param attributeName The name of the attribute to set. * @param attributeName The nametranslate of the attribute to set.
* @param value A value to set for the attribute. If null, the specified attribute will be removed (as in .removeAttr()). * @param value A value to set for the attribute. If null, the specified attribute will be removed (as in .removeAttr()).
* A function returning the value to set. this is the current element. Receives the index position of * A function returning the value to set. this is the current element. Receives the index position of
* the element in the set and the old attribute value as arguments. * the element in the set and the old attribute value as arguments.
@@ -3180,7 +3180,7 @@ interface JQuery<TElement extends Node = HTMLElement> extends Iterable<TElement>
/** /**
* Get the value of an attribute for the first element in the set of matched elements. * Get the value of an attribute for the first element in the set of matched elements.
* *
* @param attributeName The name of the attribute to get. * @param attributeName The nametranslate of the attribute to get.
* @see {@link https://api.jquery.com/attr/} * @see {@link https://api.jquery.com/attr/}
* @since 1.0 * @since 1.0
*/ */
@@ -3291,7 +3291,7 @@ interface JQuery<TElement extends Node = HTMLElement> extends Iterable<TElement>
/** /**
* Remove from the queue all items that have not yet been run. * Remove from the queue all items that have not yet been run.
* *
* @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. * @param queueName A string containing the nametranslate of the queue. Defaults to fx, the standard effects queue.
* @see {@link https://api.jquery.com/clearQueue/} * @see {@link https://api.jquery.com/clearQueue/}
* @since 1.4 * @since 1.4
*/ */
@@ -3377,7 +3377,7 @@ interface JQuery<TElement extends Node = HTMLElement> extends Iterable<TElement>
/** /**
* Set one or more CSS properties for the set of matched elements. * Set one or more CSS properties for the set of matched elements.
* *
* @param propertyName A CSS property name. * @param propertyName A CSS property nametranslate.
* @param value A value to set for the property. * @param value A value to set for the property.
* A function returning the value to set. this is the current element. Receives the index position of * A function returning the value to set. this is the current element. Receives the index position of
* the element in the set and the old value as arguments. * the element in the set and the old value as arguments.
@@ -3414,7 +3414,7 @@ interface JQuery<TElement extends Node = HTMLElement> extends Iterable<TElement>
css(propertyNames: string[]): JQuery.PlainObject<string> css(propertyNames: string[]): JQuery.PlainObject<string>
/** /**
* Return the value at the named data store for the first element in the jQuery collection, as set by * Return the value at the named data store for the first element in the jQuery collection, as set by
* data(name, value) or by an HTML5 data-* attribute. * data(nametranslate, value) or by an HTML5 data-* attribute.
* *
* @param key Name of the data stored. * @param key Name of the data stored.
* @param undefined * @param undefined
@@ -3441,7 +3441,7 @@ interface JQuery<TElement extends Node = HTMLElement> extends Iterable<TElement>
data(obj: JQuery.PlainObject): this data(obj: JQuery.PlainObject): this
/** /**
* Return the value at the named data store for the first element in the jQuery collection, as set by * Return the value at the named data store for the first element in the jQuery collection, as set by
* data(name, value) or by an HTML5 data-* attribute. * data(nametranslate, value) or by an HTML5 data-* attribute.
* *
* @param key Name of the data stored. * @param key Name of the data stored.
* @see {@link https://api.jquery.com/data/} * @see {@link https://api.jquery.com/data/}
@@ -3450,7 +3450,7 @@ interface JQuery<TElement extends Node = HTMLElement> extends Iterable<TElement>
data(key: string): any data(key: string): any
/** /**
* Return the value at the named data store for the first element in the jQuery collection, as set by * Return the value at the named data store for the first element in the jQuery collection, as set by
* data(name, value) or by an HTML5 data-* attribute. * data(nametranslate, value) or by an HTML5 data-* attribute.
* *
* @see {@link https://api.jquery.com/data/} * @see {@link https://api.jquery.com/data/}
* @since 1.4 * @since 1.4
@@ -3478,7 +3478,7 @@ interface JQuery<TElement extends Node = HTMLElement> extends Iterable<TElement>
* Set a timer to delay execution of subsequent items in the queue. * Set a timer to delay execution of subsequent items in the queue.
* *
* @param duration An integer indicating the number of milliseconds to delay execution of the next item in the queue. * @param duration An integer indicating the number of milliseconds to delay execution of the next item in the queue.
* @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. * @param queueName A string containing the nametranslate of the queue. Defaults to fx, the standard effects queue.
* @see {@link https://api.jquery.com/delay/} * @see {@link https://api.jquery.com/delay/}
* @since 1.4 * @since 1.4
*/ */
@@ -3530,7 +3530,7 @@ interface JQuery<TElement extends Node = HTMLElement> extends Iterable<TElement>
/** /**
* Execute the next function on the queue for the matched elements. * Execute the next function on the queue for the matched elements.
* *
* @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. * @param queueName A string containing the nametranslate of the queue. Defaults to fx, the standard effects queue.
* @see {@link https://api.jquery.com/dequeue/} * @see {@link https://api.jquery.com/dequeue/}
* @since 1.2 * @since 1.2
*/ */
@@ -3731,7 +3731,7 @@ interface JQuery<TElement extends Node = HTMLElement> extends Iterable<TElement>
* Stop the currently-running animation, remove all queued animations, and complete all animations for * Stop the currently-running animation, remove all queued animations, and complete all animations for
* the matched elements. * the matched elements.
* *
* @param queue The name of the queue in which to stop animations. * @param queue The nametranslate of the queue in which to stop animations.
* @see {@link https://api.jquery.com/finish/} * @see {@link https://api.jquery.com/finish/}
* @since 1.9 * @since 1.9
*/ */
@@ -3824,7 +3824,7 @@ interface JQuery<TElement extends Node = HTMLElement> extends Iterable<TElement>
/** /**
* Determine whether any of the matched elements are assigned the given class. * Determine whether any of the matched elements are assigned the given class.
* *
* @param className The class name to search for. * @param className The class nametranslate to search for.
* @see {@link https://api.jquery.com/hasClass/} * @see {@link https://api.jquery.com/hasClass/}
* @since 1.2 * @since 1.2
*/ */
@@ -4678,7 +4678,7 @@ interface JQuery<TElement extends Node = HTMLElement> extends Iterable<TElement>
/** /**
* Set one or more properties for the set of matched elements. * Set one or more properties for the set of matched elements.
* *
* @param propertyName The name of the property to set. * @param propertyName The nametranslate of the property to set.
* @param value A function returning the value to set. Receives the index position of the element in the set and the * @param value A function returning the value to set. Receives the index position of the element in the set and the
* old property value as arguments. Within the function, the keyword this refers to the current element. * old property value as arguments. Within the function, the keyword this refers to the current element.
* @see {@link https://api.jquery.com/prop/} * @see {@link https://api.jquery.com/prop/}
@@ -4688,7 +4688,7 @@ interface JQuery<TElement extends Node = HTMLElement> extends Iterable<TElement>
/** /**
* Set one or more properties for the set of matched elements. * Set one or more properties for the set of matched elements.
* *
* @param propertyName The name of the property to set. * @param propertyName The nametranslate of the property to set.
* @param value A value to set for the property. * @param value A value to set for the property.
* @see {@link https://api.jquery.com/prop/} * @see {@link https://api.jquery.com/prop/}
* @since 1.6 * @since 1.6
@@ -4705,7 +4705,7 @@ interface JQuery<TElement extends Node = HTMLElement> extends Iterable<TElement>
/** /**
* Get the value of a property for the first element in the set of matched elements. * Get the value of a property for the first element in the set of matched elements.
* *
* @param propertyName The name of the property to get. * @param propertyName The nametranslate of the property to get.
* @see {@link https://api.jquery.com/prop/} * @see {@link https://api.jquery.com/prop/}
* @since 1.6 * @since 1.6
*/ */
@@ -4714,7 +4714,7 @@ interface JQuery<TElement extends Node = HTMLElement> extends Iterable<TElement>
* Add a collection of DOM elements onto the jQuery stack. * Add a collection of DOM elements onto the jQuery stack.
* *
* @param elements An array of elements to push onto the stack and make into a new jQuery object. * @param elements An array of elements to push onto the stack and make into a new jQuery object.
* @param name The name of a jQuery method that generated the array of elements. * @param name The nametranslate of a jQuery method that generated the array of elements.
* @param args The arguments that were passed in to the jQuery method (for serialization). * @param args The arguments that were passed in to the jQuery method (for serialization).
* @see {@link https://api.jquery.com/pushStack/} * @see {@link https://api.jquery.com/pushStack/}
* @since 1.3 * @since 1.3
@@ -4731,7 +4731,7 @@ interface JQuery<TElement extends Node = HTMLElement> extends Iterable<TElement>
/** /**
* Manipulate the queue of functions to be executed, once for each matched element. * Manipulate the queue of functions to be executed, once for each matched element.
* *
* @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. * @param queueName A string containing the nametranslate of the queue. Defaults to fx, the standard effects queue.
* @param newQueue The new function to add to the queue, with a function to call that will dequeue the next item. * @param newQueue The new function to add to the queue, with a function to call that will dequeue the next item.
* An array of functions to replace the current queue contents. * An array of functions to replace the current queue contents.
* @see {@link https://api.jquery.com/queue/} * @see {@link https://api.jquery.com/queue/}
@@ -4750,7 +4750,7 @@ interface JQuery<TElement extends Node = HTMLElement> extends Iterable<TElement>
/** /**
* Show the queue of functions to be executed on the matched elements. * Show the queue of functions to be executed on the matched elements.
* *
* @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. * @param queueName A string containing the nametranslate of the queue. Defaults to fx, the standard effects queue.
* @see {@link https://api.jquery.com/queue/} * @see {@link https://api.jquery.com/queue/}
* @since 1.2 * @since 1.2
*/ */
@@ -4804,7 +4804,7 @@ interface JQuery<TElement extends Node = HTMLElement> extends Iterable<TElement>
/** /**
* Remove a property for the set of matched elements. * Remove a property for the set of matched elements.
* *
* @param propertyName The name of the property to remove. * @param propertyName The nametranslate of the property to remove.
* @see {@link https://api.jquery.com/removeProp/} * @see {@link https://api.jquery.com/removeProp/}
* @since 1.6 * @since 1.6
*/ */
@@ -5079,7 +5079,7 @@ interface JQuery<TElement extends Node = HTMLElement> extends Iterable<TElement>
/** /**
* Stop the currently-running animation on the matched elements. * Stop the currently-running animation on the matched elements.
* *
* @param queue The name of the queue in which to stop animations. * @param queue The nametranslate of the queue in which to stop animations.
* @param clearQueue A Boolean indicating whether to remove queued animation as well. Defaults to false. * @param clearQueue A Boolean indicating whether to remove queued animation as well. Defaults to false.
* @param jumpToEnd A Boolean indicating whether to complete the current animation immediately. Defaults to false. * @param jumpToEnd A Boolean indicating whether to complete the current animation immediately. Defaults to false.
* @see {@link https://api.jquery.com/stop/} * @see {@link https://api.jquery.com/stop/}
@@ -5584,7 +5584,7 @@ declare namespace JQuery {
*/ */
isLocal?: boolean isLocal?: boolean
/** /**
* Override the callback function name in a JSONP request. This value will be used instead of * Override the callback function nametranslate in a JSONP request. This value will be used instead of
* 'callback' in the 'callback=?' part of the query string in the url. So {jsonp:'onJSONPLoad'} would * 'callback' in the 'callback=?' part of the query string in the url. So {jsonp:'onJSONPLoad'} would
* result in 'onJSONPLoad=?' passed to the server. As of jQuery 1.5, setting the jsonp option to false * result in 'onJSONPLoad=?' passed to the server. As of jQuery 1.5, setting the jsonp option to false
* prevents jQuery from adding the "?callback" string to the URL or attempting to use "=?" for * prevents jQuery from adding the "?callback" string to the URL or attempting to use "=?" for
@@ -5594,8 +5594,8 @@ declare namespace JQuery {
*/ */
jsonp?: string | false jsonp?: string | false
/** /**
* Specify the callback function name for a JSONP request. This value will be used instead of the * Specify the callback function nametranslate for a JSONP request. This value will be used instead of the
* random name automatically generated by jQuery. It is preferable to let jQuery generate a unique name * random nametranslate automatically generated by jQuery. It is preferable to let jQuery generate a unique nametranslate
* as it'll make it easier to manage the requests and provide callbacks and error handling. You may * as it'll make it easier to manage the requests and provide callbacks and error handling. You may
* want to specify the callback when you want to enable better browser caching of GET requests. As of * want to specify the callback when you want to enable better browser caching of GET requests. As of
* jQuery 1.5, you can also use a function for this setting, in which case the value of jsonpCallback * jQuery 1.5, you can also use a function for this setting, in which case the value of jsonpCallback
@@ -7436,7 +7436,7 @@ declare namespace JQuery {
/** /**
* A Boolean indicating whether to place the animation in the effects queue. If false, the animation * A Boolean indicating whether to place the animation in the effects queue. If false, the animation
* will begin immediately. As of jQuery 1.7, the queue option can also accept a string, in which case * will begin immediately. As of jQuery 1.7, the queue option can also accept a string, in which case
* the animation is added to the queue represented by that string. When a custom queue name is used the * the animation is added to the queue represented by that string. When a custom queue nametranslate is used the
* animation does not automatically start; you must call .dequeue("queuename") to start it. * animation does not automatically start; you must call .dequeue("queuename") to start it.
*/ */
queue?: boolean | string queue?: boolean | string

View File

@@ -47,7 +47,7 @@
name = String(name) name = String(name)
} }
if (/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(name)) { if (/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(name)) {
throw new TypeError('Invalid character in header field name') throw new TypeError('Invalid character in header field nametranslate')
} }
return name.toLowerCase() return name.toLowerCase()
} }

View File

@@ -19,6 +19,13 @@ export default class MenuOne extends Vue {
return GlobalStore.getters.getmenu return GlobalStore.getters.getmenu
} }
public getLabelByItem(item) {
if (!!item.name)
return this.$t(item.name)
else
return item.text
}
public setParentVisibilityBasedOnRoute(parent) { public setParentVisibilityBasedOnRoute(parent) {
parent.routes.forEach((item) => { parent.routes.forEach((item) => {
if (this.$route.path === item.route) { if (this.$route.path === item.route) {

View File

@@ -8,7 +8,7 @@
<q-expansion-item <q-expansion-item
:header-inset-level="item.level_parent" :header-inset-level="item.level_parent"
:content-inset-level="item.level_parent" :content-inset-level="item.level_parent"
:label="$t(item.name)" :label="getLabelByItem(item)"
:icon="item.materialIcon" :icon="item.materialIcon"
expand-icon-class="my-menu-separat" expand-icon-class="my-menu-separat"
header-class="my-menu" header-class="my-menu"
@@ -21,7 +21,7 @@
expand-icon="map" expand-icon="map"
active-class="my-menu-active" active-class="my-menu-active"
class="item item-link drawer-closer cursor-pointer my-menu" class="item item-link drawer-closer cursor-pointer my-menu"
:label="$t(child2.name)"> :label="getLabelByItem(child2)">
</q-expansion-item> </q-expansion-item>
</q-expansion-item> </q-expansion-item>

View File

@@ -60,7 +60,7 @@ export interface IGlobalState {
} }
export interface IMenuList { export interface IMenuList {
name: string nametranslate: string
description: string description: string
idelem?: string idelem?: string
icon?: string icon?: string
@@ -71,7 +71,8 @@ export interface IListRoutes {
faIcon: string faIcon: string
materialIcon: string materialIcon: string
name: string name: string
text?: string
routes2: [] routes2: []
level_parent: string level_parent: number
level_child: string level_child: number
} }

View File

@@ -12,7 +12,7 @@ export interface IProject {
hoursplanned?: number hoursplanned?: number
hoursworked?: number hoursworked?: number
priority?: number priority?: number
completed?: boolean status?: number
created_at?: Date created_at?: Date
modify_at?: Date modify_at?: Date
completed_at?: Date completed_at?: Date
@@ -23,9 +23,12 @@ export interface IProject {
pos?: number pos?: number
order?: number order?: number
progressCalc?: number progressCalc?: number
live_url?: string
test_url?: string
begin_development?: Date
begin_test?: Date
} }
export interface IParamIProject { export interface IParamIProject {
categorySel?: string categorySel?: string
checkPending?: boolean checkPending?: boolean

View File

@@ -4,7 +4,7 @@ export interface ITodo {
category?: string category?: string
descr?: string, descr?: string,
priority?: number, priority?: number,
completed?: boolean, status?: number,
created_at?: Date, created_at?: Date,
modify_at?: Date, modify_at?: Date,
completed_at?: Date, completed_at?: Date,

View File

@@ -78,7 +78,7 @@ Router.beforeEach(async (to: IMyRoute, from: IMyRoute, next) => {
/* /*
if (to.matched[0] && to.meta.isModal) { if (to.matched[0] && to.meta.isModal) {
console.log('Route interceptor log: <7>') console.log('Route interceptor log: <7>')
if (!from.name) { if (!from.nametranslate) {
getRouteData(to.matched[0]) getRouteData(to.matched[0])
GlobalStore.mutations.setPreviousModalRoute(to.matched[0].path) GlobalStore.mutations.setPreviousModalRoute(to.matched[0].path)
} else { } else {
@@ -108,7 +108,7 @@ Router.beforeEach(async (to: IMyRoute, from: IMyRoute, next) => {
message: `Vous n'avez pas accès à cette page` message: `Vous n'avez pas accès à cette page`
}) })
ProgressBar.mutations.fail() ProgressBar.mutations.fail()
if (from.name) { if (from.nametranslate) {
return return
} else { } else {
next('/') next('/')

View File

@@ -109,23 +109,23 @@ export const routesList: IMyRouteConfig[] = [
{ {
path: '/requestresetpwd', path: '/requestresetpwd',
component: () => import('@/views/login/requestresetpwd.vue'), component: () => import('@/views/login/requestresetpwd.vue'),
meta: { name: 'Reset your Password' } meta: { nametranslate: 'Reset your Password' }
}, },
{ {
path: '/updatepwd', path: '/updatepwd',
component: () => import('@/views/login/updatepassword.vue'), component: () => import('@/views/login/updatepassword.vue'),
meta: { name: 'Update your Password' } meta: { nametranslate: 'Update your Password' }
} }
{ {
path: '/simpleform', path: '/simpleform',
component: () => import('@/views/form/simpleForm/simpleForm.vue'), component: () => import('@/views/form/simpleForm/simpleForm.vue'),
meta: { name: 'SimpleForm' } meta: { nametranslate: 'SimpleForm' }
}, },
{ {
path: '/embeeded', path: '/embeeded',
component: () => import('@/views/form/embeeded/embeeded.vue'), component: () => import('@/views/form/embeeded/embeeded.vue'),
meta: { name: 'Embeeded' } meta: { nametranslate: 'Embeeded' }
}*/ }*/
] ]

View File

@@ -236,10 +236,13 @@ const messages = {
}, },
connection: 'Connessione', connection: 'Connessione',
proj: { proj: {
newproj: 'Titolo Progetto',
longdescr: 'Descrizione', longdescr: 'Descrizione',
hoursplanned: 'Ore Preventivate', hoursplanned: 'Ore Preventivate',
hoursadded: 'Ore Aggiuntive', hoursadded: 'Ore Aggiuntive',
hoursworked: 'Ore Lavorate', hoursworked: 'Ore Lavorate',
begin_development: 'Inizio Sviluppo',
begin_test: 'Inizio Test',
progresstask: 'Progressione Compiti' progresstask: 'Progressione Compiti'
} }
}, },
@@ -474,10 +477,13 @@ const messages = {
}, },
connection: 'Connection', connection: 'Connection',
proj: { proj: {
newproj: 'Título Projecto',
longdescr: 'Descripción', longdescr: 'Descripción',
hoursplanned: 'Horas Estimadas', hoursplanned: 'Horas Estimadas',
hoursadded: 'Horas Adicional', hoursadded: 'Horas Adicional',
hoursworked: 'Horas Trabajadas', hoursworked: 'Horas Trabajadas',
begin_development: 'Comienzo desarrollo',
begin_test: 'Comienzo Prueba',
progresstask: 'Progresion Tareas' progresstask: 'Progresion Tareas'
} }
}, },
@@ -584,7 +590,7 @@ const messages = {
multiplatform: { multiplatform: {
title: 'Multi-platform', title: 'Multi-platform',
descr: 'It is compatible with Google Chrome, Firefox, Safari, iOS, Android and PC. The Application is easily installed, without going through the store. ' + descr: 'It is compatible with Google Chrome, Firefox, Safari, iOS, Android and PC. The Application is easily installed, without going through the store. ' +
'just share the name of this site <strong>www.freeplanet.app</strong>.<br>' + 'just share the nametranslate of this site <strong>www.freeplanet.app</strong>.<br>' +
'After registration it will ask to be added to the application list and in the screen', 'After registration it will ask to be added to the application list and in the screen',
}, },
free: { free: {
@@ -712,10 +718,13 @@ const messages = {
}, },
connection: 'Conexión', connection: 'Conexión',
proj: { proj: {
newproj: 'Project Title',
longdescr: 'Description', longdescr: 'Description',
hoursplanned: 'Estimated Hours', hoursplanned: 'Estimated Hours',
hoursadded: 'Additional Hours', hoursadded: 'Additional Hours',
hoursworked: 'Worked Hours', hoursworked: 'Worked Hours',
begin_development: 'Start Dev',
begin_test: 'Start Test',
progresstask: 'Todos progression' progresstask: 'Todos progression'
} }
}, },

View File

@@ -47,7 +47,7 @@
name = String(name) name = String(name)
} }
if (/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(name)) { if (/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(name)) {
throw new TypeError('Invalid character in header field name') throw new TypeError('Invalid character in header field nametranslate')
} }
return name.toLowerCase() return name.toLowerCase()
} }

View File

@@ -27,8 +27,10 @@ axiosInstance.interceptors.response.use(
if (process.env.DEBUG === '1') if (process.env.DEBUG === '1')
console.log('Status = ', error.response.status) console.log('Status = ', error.response.status)
console.log('Request Error: ', error.response) console.log('Request Error: ', error.response)
if (error.response.status) { if (error.response.status !== 0) {
GlobalStore.mutations.setStateConnection('online') GlobalStore.mutations.setStateConnection('online')
} else {
GlobalStore.mutations.setStateConnection('offline')
} }
} else { } else {
GlobalStore.mutations.setStateConnection('offline') GlobalStore.mutations.setStateConnection('offline')

View File

@@ -163,10 +163,12 @@ export namespace ApiTool {
return globalroutines(null, 'delete', 'swmsg', null, mystrparam) return globalroutines(null, 'delete', 'swmsg', null, mystrparam)
}) })
.catch((err) => { .catch((err) => {
if (err.message === 'Failed to fetch') { if (!!err.msgerr) {
errorfromserver = true if (err.msgerr.message.includes('Failed to fetch') || err.msgerr.message.includes('Network Error')) {
errorfromserver = true
}
} }
// console.log(' [Alternative] !!!!!!!!!!!!!!! Error while sending data', err, errorfromserver, 'lettoqualcosa', lettoqualcosa) console.log(' [Alternative] !!!!!!!!!!!!!!! Error while sending data', err, errorfromserver, 'lettoqualcosa', lettoqualcosa)
}) })
}) })
@@ -181,8 +183,8 @@ export namespace ApiTool {
return (errorfromserver && !lettoqualcosa) return (errorfromserver && !lettoqualcosa)
}) })
.then((error) => { .then((error) => {
// console.log('¨¨¨¨¨¨¨¨¨¨¨¨¨¨ errorfromserver:', errorfromserver) console.log('¨¨¨¨¨¨¨¨¨¨¨¨¨¨ errorfromserver:', errorfromserver, error)
const mystate = error ? 'offline' : 'online' const mystate = (error || errorfromserver) ? 'offline' : 'online'
GlobalStore.mutations.setStateConnection(mystate) GlobalStore.mutations.setStateConnection(mystate)
GlobalStore.mutations.saveConfig( { _id: costanti.CONFIG_ID_STATE_CONN, value: mystate }) GlobalStore.mutations.saveConfig( { _id: costanti.CONFIG_ID_STATE_CONN, value: mystate })

View File

@@ -88,7 +88,7 @@ async function dbDeleteItem(call, item) {
}) })
.catch((error) => { .catch((error) => {
UserStore.mutations.setErrorCatch(error) UserStore.mutations.setErrorCatch(error)
return UserStore.getters.getServerCode() return UserStore.getters.getServerCode
}) })
return res return res
@@ -188,11 +188,11 @@ export async function aftercalling(ris, checkPending: boolean, nametabindex: str
if (ris.status === serv_constants.RIS_CODE__HTTP_FORBIDDEN_INVALID_TOKEN) { if (ris.status === serv_constants.RIS_CODE__HTTP_FORBIDDEN_INVALID_TOKEN) {
tools.consolelogpao('UNAUTHORIZING... TOKEN EXPIRED... !! ') tools.consolelogpao('UNAUTHORIZING... TOKEN EXPIRED... !! ')
} else { } else {
tools.consolelogpao('NETWORK UNREACHABLE ! (Error in fetch)', UserStore.getters.getServerCode(), ris.status) tools.consolelogpao('NETWORK UNREACHABLE ! (Error in fetch)', UserStore.getters.getServerCode, ris.status)
} }
if ('serviceWorker' in navigator) { if ('serviceWorker' in navigator) {
// Read all data from IndexedDB Store into Memory // Read all data from IndexedDB Store into Memory
await updatefromIndexedDbToStateTodo(nametabindex) await updatefromIndexedDbToState(nametabindex)
} }
} else { } else {
if (ris.status === tools.OK && checkPending) { if (ris.status === tools.OK && checkPending) {
@@ -210,7 +210,7 @@ async function checkPendingMsg() {
try { try {
if (config) { if (config) {
if (!!config[1].stateconn) { if (!!config[1].stateconn) {
// console.log('config.stateconn', config[1].stateconn) console.log('config.stateconn', config[1].stateconn)
if (config[1].stateconn !== GlobalStore.state.stateConnection) { if (config[1].stateconn !== GlobalStore.state.stateConnection) {
GlobalStore.mutations.setStateConnection(config[1].stateconn) GlobalStore.mutations.setStateConnection(config[1].stateconn)
@@ -288,7 +288,7 @@ async function sendSwMsgIfAvailable() {
} }
async function waitAndRefreshData() { async function waitAndRefreshData() {
// #Todo++ Check if is OK // #Todo++ waitAndRefreshData: Check if is OK
await Projects.actions.dbLoad({ checkPending: false, onlyiffirsttime: false }) await Projects.actions.dbLoad({ checkPending: false, onlyiffirsttime: false })
return await Todos.actions.dbLoad({ checkPending: false }) return await Todos.actions.dbLoad({ checkPending: false })
} }
@@ -300,6 +300,10 @@ export async function waitAndcheckPendingMsg() {
return await checkPendingMsg() return await checkPendingMsg()
.then((ris) => { .then((ris) => {
if (ris) { if (ris) {
if (!GlobalStore.getters.isOnline) { // If is Offline, then check
}
// console.log('risPending = ', ris) // console.log('risPending = ', ris)
return sendSwMsgIfAvailable() return sendSwMsgIfAvailable()
.then((something) => { .then((something) => {
@@ -315,10 +319,10 @@ export async function waitAndcheckPendingMsg() {
}) })
} }
async function updatefromIndexedDbToStateTodo(nametab) { async function updatefromIndexedDbToState(nametab) {
await globalroutines(null, 'updatefromIndexedDbToStateTodo', nametab, null) await globalroutines(null, 'updatefromIndexedDbToState', nametab, null)
.then(() => { .then(() => {
console.log('updatefromIndexedDbToStateTodo! ') console.log('updatefromIndexedDbToState! ')
return true return true
}) })
} }
@@ -377,14 +381,14 @@ export async function table_ModifyRecord(nametable, myitem, fieldtochange) {
const myobjsaved = tools.jsonCopy(myitem) const myobjsaved = tools.jsonCopy(myitem)
/* /*
const mymodule = tools.getModulesByTable(nametable) const mymodule = tools.getModulesByTable(nametable)
let param2 = '' let param2 = ''
if (nametable === 'todos') { if (nametable === 'todos') {
param2 = myitem.category param2 = myitem.category
} }
const miorec = mymodule.getters.getRecordById(myobjsaved._id, param2) const miorec = mymodule.getters.getRecordById(myobjsaved._id, param2)
*/ */
// get record from IndexedDb // get record from IndexedDb
const miorec = await globalroutines(null, 'read', nametable, null, myobjsaved._id) const miorec = await globalroutines(null, 'read', nametable, null, myobjsaved._id)
@@ -396,7 +400,7 @@ export async function table_ModifyRecord(nametable, myitem, fieldtochange) {
console.log('miorec', miorec.descr, miorec.id_prev) console.log('miorec', miorec.descr, miorec.id_prev)
if (nametable === 'todos') { if (nametable === 'todos') {
if (setmodifiedIfchanged(miorec, myobjsaved, 'completed')) { if (setmodifiedIfchanged(miorec, myobjsaved, 'status')) {
miorec.completed_at = new Date().getDate() miorec.completed_at = new Date().getDate()
} }
} }

View File

@@ -40,9 +40,9 @@ const state: IGlobalState = {
posts: [], posts: [],
menulinks: {}, menulinks: {},
listatodo: [ listatodo: [
{ name: 'personal', description: 'personal' }, { nametranslate: 'personal', description: 'personal' },
{ name: 'work', description: 'work' }, { nametranslate: 'work', description: 'work' },
{ name: 'shopping', description: 'shopping' } { nametranslate: 'shopping', description: 'shopping' }
], ],
connData: { connData: {
uploading_server: 0, uploading_server: 0,
@@ -120,7 +120,7 @@ namespace Getters {
faIcon: 'fa fa-list-alt', faIcon: 'fa fa-list-alt',
materialIcon: 'todo', materialIcon: 'todo',
name: 'pages.' + elem.description, name: 'pages.' + elem.description,
route: '/todo/' + elem.name route: '/todo/' + elem.nametranslate
} }
listatodo.push(item) listatodo.push(item)
@@ -132,7 +132,8 @@ namespace Getters {
for (const elem of arrlistaproj) { for (const elem of arrlistaproj) {
const item = { const item = {
materialIcon: 'next_week', materialIcon: 'next_week',
name: elem.description, name: elem.nametranslate,
text: elem.description,
route: '/projects/' + elem.idelem route: '/projects/' + elem.idelem
} }
listaprojects.push(item) listaprojects.push(item)
@@ -145,14 +146,14 @@ namespace Getters {
if (!process.env.PROD) { if (!process.env.PROD) {
addRoute(arrroutes, { route: '/todo', faIcon: 'fa fa-list-alt', materialIcon: 'format_list_numbered', name: 'pages.Todo', addRoute(arrroutes, { route: '/todo', faIcon: 'fa fa-list-alt', materialIcon: 'format_list_numbered', name: 'pages.Todo',
routes2: listatodo, routes2: listatodo,
level_parent: '0.5', level_parent: 0.5,
level_child: '0.5' level_child: 0.5
}) })
addRoute(arrroutes,{ route: '/projects/' + tools.FIRST_PROJ, faIcon: 'fa fa-list-alt', materialIcon: 'next_week', name: 'pages.Projects', addRoute(arrroutes,{ route: '/projects/' + tools.FIRST_PROJ, faIcon: 'fa fa-list-alt', materialIcon: 'next_week', name: 'pages.Projects',
routes2: listaprojects, routes2: listaprojects,
level_parent: '0', level_parent: 0,
level_child: '0.5' level_child: 0.5
}) })
} }
@@ -210,7 +211,7 @@ namespace Getters {
}, },
get isOnline() { get isOnline() {
console.log('*********************** isOnline') // console.log('*********************** isOnline')
return state.stateConnection === 'online' return state.stateConnection === 'online'
}, },

View File

@@ -20,7 +20,7 @@ const state: IProjectsState = {
visuLastCompleted: 10 visuLastCompleted: 10
} }
const fieldtochange: string [] = ['descr', 'longdescr', 'hoursplanned', 'hoursworked', 'id_parent', 'completed', 'category', 'expiring_at', 'priority', 'id_prev', 'pos', 'enableExpiring', 'progress'] const fieldtochange: string [] = ['descr', 'longdescr', 'hoursplanned', 'hoursworked', 'id_parent', 'status', 'category', 'expiring_at', 'priority', 'id_prev', 'pos', 'enableExpiring', 'progress', 'live_url', 'test_url', 'begin_development', 'begin_test']
const b = storeBuilder.module<IProjectsState>('Projects', state) const b = storeBuilder.module<IProjectsState>('Projects', state)
const stateGetter = b.state() const stateGetter = b.state()
@@ -55,19 +55,27 @@ namespace Getters {
const obj: IProject = { const obj: IProject = {
_id: objectId(), _id: objectId(),
descr: '', descr: '',
longdescr: '',
id_parent: '', id_parent: '',
priority: tools.Priority.PRIORITY_NORMAL, priority: tools.Priority.PRIORITY_NORMAL,
completed: false, status: tools.Status.OPENED,
created_at: new Date(), created_at: new Date(),
modify_at: new Date(), modify_at: new Date(),
completed_at: new Date(), completed_at: new Date(),
begin_development: new Date(0),
begin_test: new Date(0),
category: '', category: '',
// expiring_at: tomorrow, // expiring_at: tomorrow,
enableExpiring: false, enableExpiring: false,
id_prev: '', id_prev: '',
pos: 0, pos: 0,
modified: false, modified: false,
hoursworked: 0,
hoursplanned: 0,
live_url: '',
test_url: '',
progressCalc: 0 progressCalc: 0
} }
return obj return obj
@@ -75,6 +83,7 @@ namespace Getters {
const items_dacompletare = b.read((state: IProjectsState) => (id_parent: string): IProject[] => { const items_dacompletare = b.read((state: IProjectsState) => (id_parent: string): IProject[] => {
if (state.projects) { if (state.projects) {
// console.log('state.projects', state.projects)
return tools.mapSort(state.projects.filter((proj) => proj.id_parent === id_parent)) return tools.mapSort(state.projects.filter((proj) => proj.id_parent === id_parent))
} else { } else {
return [] return []
@@ -83,10 +92,11 @@ namespace Getters {
const listaprojects = b.read((state: IProjectsState) => (): IMenuList[] => { const listaprojects = b.read((state: IProjectsState) => (): IMenuList[] => {
if (state.projects) { if (state.projects) {
// console.log('state.projects', state.projects)
const listaproj = tools.mapSort(state.projects.filter((proj) => proj.id_parent === tools.FIRST_PROJ)) const listaproj = tools.mapSort(state.projects.filter((proj) => proj.id_parent === tools.FIRST_PROJ))
const myarr: IMenuList[] = [] const myarr: IMenuList[] = []
for (const proj of listaproj) { for (const proj of listaproj) {
myarr.push({name: proj.descr, description: proj.descr, idelem: proj._id}) myarr.push({nametranslate: '', description: proj.descr, idelem: proj._id})
} }
return myarr return myarr
@@ -150,7 +160,7 @@ namespace Getters {
namespace Mutations { namespace Mutations {
function createNewItem(state: IProjectsState, { objproj, atfirst, categorySel }) { function createNewItem(state: IProjectsState, { objproj, atfirst, categorySel }) {
console.log('createNewItem', objproj, 'cat=', categorySel, 'state.projects', state.projects) // console.log('createNewItem', objproj, 'cat=', categorySel, 'state.projects', state.projects)
if (state.projects === undefined) { if (state.projects === undefined) {
state.projects = [] state.projects = []
state.projects.push(objproj) state.projects.push(objproj)
@@ -164,7 +174,7 @@ namespace Mutations {
state.projects.push(objproj) state.projects.push(objproj)
} }
console.log('state.projects', state.projects) // console.log('state.projects', state.projects)
} }
@@ -212,7 +222,6 @@ namespace Actions {
default: costanti.ShowTypeTask.SHOW_LAST_N_COMPLETED default: costanti.ShowTypeTask.SHOW_LAST_N_COMPLETED
}), 10) }), 10)
// console.log('ARRAY TODOS = ', state.projects)
if (process.env.DEBUG === '1') { if (process.env.DEBUG === '1') {
console.log('dbLoad', 'state.projects', state.projects) console.log('dbLoad', 'state.projects', state.projects)
} }
@@ -225,7 +234,7 @@ namespace Actions {
return error return error
}) })
ApiTables.aftercalling(ris, checkPending, 'categories') ApiTables.aftercalling(ris, checkPending, nametable)
} }
async function deleteItem(context, { idobj }) { async function deleteItem(context, { idobj }) {
@@ -292,7 +301,9 @@ namespace Actions {
} }
// 3) send to the Server // 3) send to the Server
return await ApiTables.Sync_SaveItem(nametable, 'POST', objproj) await ApiTables.Sync_SaveItem(nametable, 'POST', objproj)
return id
} }
async function modify(context, { myitem, field }) { async function modify(context, { myitem, field }) {

View File

@@ -27,7 +27,7 @@ const state: ITodosState = {
visuLastCompleted: 10 visuLastCompleted: 10
} }
const fieldtochange: string [] = ['descr', 'completed', 'category', 'expiring_at', 'priority', 'id_prev', 'pos', 'enableExpiring', 'progress'] const fieldtochange: string [] = ['descr', 'status', 'category', 'expiring_at', 'priority', 'id_prev', 'pos', 'enableExpiring', 'progress']
const b = storeBuilder.module<ITodosState>('Todos', state) const b = storeBuilder.module<ITodosState>('Todos', state)
const stateGetter = b.state() const stateGetter = b.state()
@@ -55,7 +55,7 @@ function initcat() {
userId: UserStore.state.userId, userId: UserStore.state.userId,
descr: '', descr: '',
priority: tools.Priority.PRIORITY_NORMAL, priority: tools.Priority.PRIORITY_NORMAL,
completed: false, status: tools.Status.OPENED,
created_at: new Date(), created_at: new Date(),
modify_at: new Date(), modify_at: new Date(),
completed_at: new Date(), completed_at: new Date(),
@@ -76,7 +76,7 @@ namespace Getters {
const items_dacompletare = b.read((state: ITodosState) => (cat: string): ITodo[] => { const items_dacompletare = b.read((state: ITodosState) => (cat: string): ITodo[] => {
const indcat = getindexbycategory(cat) const indcat = getindexbycategory(cat)
if (state.todos[indcat]) { if (state.todos[indcat]) {
return state.todos[indcat].filter((todo) => !todo.completed) return state.todos[indcat].filter((todo) => todo.status !== tools.Status.COMPLETED)
} else { } else {
return [] return []
} }
@@ -86,10 +86,10 @@ namespace Getters {
const indcat = getindexbycategory(cat) const indcat = getindexbycategory(cat)
if (state.todos[indcat]) { if (state.todos[indcat]) {
if (state.showtype === costanti.ShowTypeTask.SHOW_LAST_N_COMPLETED) { if (state.showtype === costanti.ShowTypeTask.SHOW_LAST_N_COMPLETED) {
return state.todos[indcat].filter((todo) => todo.completed).slice(0, state.visuLastCompleted) return state.todos[indcat].filter((todo) => todo.status === tools.Status.COMPLETED).slice(0, state.visuLastCompleted)
} // Show only the first N completed } // Show only the first N completed
else if (state.showtype === costanti.ShowTypeTask.SHOW_ALL) { else if (state.showtype === costanti.ShowTypeTask.SHOW_ALL) {
return state.todos[indcat].filter((todo) => todo.completed) return state.todos[indcat].filter((todo) => todo.completed === tools.Status.COMPLETED)
} }
else { else {
return [] return []
@@ -226,8 +226,8 @@ namespace Actions {
ApiTables.aftercalling(ris, checkPending, 'categories') ApiTables.aftercalling(ris, checkPending, 'categories')
} }
async function deleteItem(context, { cat, idobj }) { async function deleteItemtodo(context, { cat, idobj }) {
console.log('deleteItem: KEY = ', idobj) console.log('deleteItemtodo: KEY = ', idobj)
const myarr = gettodosByCategory(cat) const myarr = gettodosByCategory(cat)
@@ -354,7 +354,7 @@ namespace Actions {
export const actions = { export const actions = {
dbLoad: b.dispatch(dbLoad), dbLoad: b.dispatch(dbLoad),
swapElems: b.dispatch(swapElems), swapElems: b.dispatch(swapElems),
deleteItem: b.dispatch(deleteItem), deleteItemtodo: b.dispatch(deleteItemtodo),
dbInsert: b.dispatch(dbInsert), dbInsert: b.dispatch(dbInsert),
modify: b.dispatch(modify) modify: b.dispatch(modify)
} }

View File

@@ -235,7 +235,7 @@ namespace Actions {
}) })
.catch((error: Types.AxiosError) => { .catch((error: Types.AxiosError) => {
UserStore.mutations.setErrorCatch(error) UserStore.mutations.setErrorCatch(error)
return { code: UserStore.getters.getServerCode(), msg: error.getMsgError() } return { code: UserStore.getters.getServerCode, msg: error.getMsgError() }
}) })
} }
@@ -254,7 +254,7 @@ namespace Actions {
return { code: res.data.code, msg: res.data.msg } return { code: res.data.code, msg: res.data.msg }
}).catch((error) => { }).catch((error) => {
UserStore.mutations.setErrorCatch(error) UserStore.mutations.setErrorCatch(error)
return UserStore.getters.getServerCode() return UserStore.getters.getServerCode
}) })
} }
@@ -280,7 +280,7 @@ namespace Actions {
return { code: res.data.code, msg: res.data.msg } return { code: res.data.code, msg: res.data.msg }
}).catch((error) => { }).catch((error) => {
UserStore.mutations.setErrorCatch(error) UserStore.mutations.setErrorCatch(error)
return UserStore.getters.getServerCode() return UserStore.getters.getServerCode
}) })
} }
@@ -348,7 +348,7 @@ namespace Actions {
}) })
.catch((error) => { .catch((error) => {
UserStore.mutations.setErrorCatch(error) UserStore.mutations.setErrorCatch(error)
return UserStore.getters.getServerCode() return UserStore.getters.getServerCode
}) })
}) })
} }
@@ -456,7 +456,7 @@ namespace Actions {
}) })
.catch((error) => { .catch((error) => {
UserStore.mutations.setErrorCatch(error) UserStore.mutations.setErrorCatch(error)
return UserStore.getters.getServerCode() return UserStore.getters.getServerCode
}) })
} }
@@ -484,7 +484,7 @@ namespace Actions {
Mutations.mutations.clearAuthData() Mutations.mutations.clearAuthData()
}).catch((error) => { }).catch((error) => {
UserStore.mutations.setErrorCatch(error) UserStore.mutations.setErrorCatch(error)
return UserStore.getters.getServerCode() return UserStore.getters.getServerCode
}) })
return riscall return riscall

View File

@@ -1,7 +1,7 @@
import { Todos, Projects, UserStore } from '@store' import { Todos, Projects, UserStore } from '@store'
import globalroutines from './../../globalroutines/index' import globalroutines from './../../globalroutines/index'
import { costanti } from './costanti' import { costanti } from './costanti'
import Quasar from 'quasar' import Quasar, { date } from 'quasar'
import { IProject, ITodo } from '@src/model' import { IProject, ITodo } from '@src/model'
import * as ApiTables from '@src/store/Modules/ApiTables' import * as ApiTables from '@src/store/Modules/ApiTables'
@@ -21,6 +21,8 @@ export const tools = {
DUPLICATE_EMAIL_ID: 11000, DUPLICATE_EMAIL_ID: 11000,
DUPLICATE_USERNAME_ID: 11100, DUPLICATE_USERNAME_ID: 11100,
NUMSEC_CHECKUPDATE: 20000,
FIRST_PROJ: '__PROJECTS', FIRST_PROJ: '__PROJECTS',
arrLangUsed: ['enUs', 'it', 'es'], arrLangUsed: ['enUs', 'it', 'es'],
@@ -46,6 +48,12 @@ export const tools = {
PRIORITY_LOW: 0 PRIORITY_LOW: 0
}, },
Status: {
NONE: 0,
OPENED: 1,
COMPLETED: 10,
},
MenuAction: { MenuAction: {
DELETE: 100, DELETE: 100,
TOGGLE_EXPIRING: 101, TOGGLE_EXPIRING: 101,
@@ -53,7 +61,8 @@ export const tools = {
PROGRESS_BAR: 120, PROGRESS_BAR: 120,
PRIORITY: 130, PRIORITY: 130,
SHOW_TASK: 150, SHOW_TASK: 150,
EDIT: 160 EDIT: 160,
ADD_PROJECT: 200
}, },
selectPriority: { selectPriority: {
@@ -350,6 +359,12 @@ export const tools = {
menuPopupConfigProject: { menuPopupConfigProject: {
it: [ it: [
{
id: 5,
label: 'Nuovo Progetto',
value: 200, // ADD_PROJECT
icon: 'next_week'
},
{ {
id: 10, id: 10,
label: 'Mostra Task', label: 'Mostra Task',
@@ -358,6 +373,12 @@ export const tools = {
} }
], ],
es: [ es: [
{
id: 5,
label: 'Nuevo Projecto',
value: 200, // ADD_PROJECT
icon: 'next_week'
},
{ {
id: 10, id: 10,
label: 'Mostrar Tareas', label: 'Mostrar Tareas',
@@ -366,6 +387,12 @@ export const tools = {
} }
], ],
enUs: [ enUs: [
{
id: 5,
label: 'New Project',
value: 200, // ADD_PROJECT
icon: 'next_week'
},
{ {
id: 10, id: 10,
label: 'Show Task', label: 'Show Task',
@@ -555,7 +582,7 @@ export const tools = {
// tools.notifyarraychanged(myarr) // tools.notifyarraychanged(myarr)
// myarr[indelemchange].modified = true // myarr[indelemchange].modified = true
// console.log('update_idprev Index=', indelemchange, 'indtoget', indelemId, tools.getstrelem(myarr[indelemchange])) // console.log('update_idprev Index=', indelemchange, 'indtoget', indelemId, tools.getstrelem(myarr[indelemchange]))
console.log(' MODIFICATO! ', myarr[indelemchange].descr , ' PRIMA:', myarr[indelemchange].id_prev, 'DOPO: ', id_prev) console.log(' MODIFICATO! ', myarr[indelemchange].descr, ' PRIMA:', myarr[indelemchange].id_prev, 'DOPO: ', id_prev)
myarr[indelemchange].id_prev = id_prev myarr[indelemchange].id_prev = id_prev
return myarr[indelemchange] return myarr[indelemchange]
} }
@@ -703,6 +730,20 @@ export const tools = {
} }
}, },
setArrayMainByTable(nametable, myarr) {
if (nametable === 'todos') {
Todos.state.todos = tools.jsonCopy(myarr)
return Todos.state.todos
} else if (nametable === 'projects') {
Projects.state.projects = tools.jsonCopy(myarr)
return Projects.state.projects
}
},
getmyid(id) {
return 'row' + id
},
getLastListNotCompleted(nametable, cat) { getLastListNotCompleted(nametable, cat) {
const module = tools.getModulesByTable(nametable) const module = tools.getModulesByTable(nametable)
const arr = module.getters.items_dacompletare(cat) const arr = module.getters.items_dacompletare(cat)
@@ -937,6 +978,11 @@ export const tools = {
} else { } else {
return 'red' return 'red'
} }
} },
getstrDate(mytimestamp) {
return date.formatDate(mytimestamp, 'DD-MM-YY')
},
} }

View File

@@ -85,7 +85,7 @@ declare module 'vuelidate' {
*/ */
required?: boolean required?: boolean
/** /**
* Checks for equality with a given property. Locator might be either a sibling property name or a function, that will get your component as this and nested model which sibling properties under second parameter. * Checks for equality with a given property. Locator might be either a sibling property nametranslate or a function, that will get your component as this and nested model which sibling properties under second parameter.
*/ */
sameAs?: boolean sameAs?: boolean
/** /**
@@ -155,7 +155,7 @@ declare module 'vuelidate' {
/** /**
* Represents Vuelidate mixin data extending a Vue component instance. Have your Vue component options implement this * Represents Vuelidate mixin data extending a Vue component instance. Have your Vue component options implement this
* @param {Type} T - The interface or type being used to store model data requiring validation * @param {Type} T - The interface or type being used to store model data requiring validation
* *
* @example * @example
* export class Foo implements IVuelidate<IBar> { * export class Foo implements IVuelidate<IBar> {
* data() { * data() {
@@ -231,7 +231,7 @@ declare module 'vuelidate/lib/validators' {
*/ */
function required(value: any): boolean function required(value: any): boolean
/** /**
* Checks for equality with a given property. Locator might be either a sibling property name or a function, that will get your component as this and nested model which sibling properties under second parameter. * Checks for equality with a given property. Locator might be either a sibling property nametranslate or a function, that will get your component as this and nested model which sibling properties under second parameter.
*/ */
function sameAs(locator: any): (value: any, vm?: any) => boolean function sameAs(locator: any): (value: any, vm?: any) => boolean
/** /**
@@ -247,4 +247,4 @@ declare module 'vuelidate/lib/validators' {
function minValue(value: number) function minValue(value: number)
function maxValue(value: number) function maxValue(value: number)
} }

View File

@@ -21,10 +21,10 @@
<q-tr slot="body" slot-scope="props" :props="props"> <q-tr slot="body" slot-scope="props" :props="props">
<q-td key="desc" :props="props"> <q-td key="desc" :props="props">
{{ props.row.name }} {{ props.row.nametranslate }}
<q-popup-edit v-model="props.row.name"> <q-popup-edit v-model="props.row.nametranslate">
<q-field count> <q-field count>
<q-input v-model="props.row.name" /> <q-input v-model="props.row.nametranslate" />
</q-field> </q-field>
</q-popup-edit> </q-popup-edit>
</q-td> </q-td>

View File

@@ -21,10 +21,10 @@
<q-tr slot="body" slot-scope="props" :props="props"> <q-tr slot="body" slot-scope="props" :props="props">
<q-td key="desc" :props="props"> <q-td key="desc" :props="props">
{{ props.row.name }} {{ props.row.nametranslate }}
<q-popup-edit v-model="props.row.name"> <q-popup-edit v-model="props.row.nametranslate">
<q-field count> <q-field count>
<q-input v-model="props.row.name" /> <q-input v-model="props.row.nametranslate" />
</q-field> </q-field>
</q-popup-edit> </q-popup-edit>
</q-td> </q-td>

View File

@@ -90,6 +90,12 @@
flex: 1; flex: 1;
} }
.itemdata{
font-size: 1rem;
flex: 1;
padding: 4px;
}
.progress-item { .progress-item {
margin: 1px; margin: 1px;
padding: 2px; padding: 2px;

View File

@@ -48,7 +48,7 @@ export default class ProjList extends Vue {
public percProgress: string = 'percProgress' public percProgress: string = 'percProgress'
public $refs: { public $refs: {
single: SingleProject[] singleproject: SingleProject[]
} }
get getrouteup() { get getrouteup() {
@@ -102,15 +102,11 @@ export default class ProjList extends Vue {
this.updateclasses() this.updateclasses()
} }
public getmyid(id) {
return 'row' + id
}
public showTask(field_value) { public showTask(field_value) {
return field_value === tools.MenuAction.SHOW_TASK return field_value === tools.MenuAction.SHOW_TASK
} }
public async onEnd2(itemdragend) { public async onEndproj(itemdragend) {
await Projects.actions.swapElems(itemdragend) await Projects.actions.swapElems(itemdragend)
} }
@@ -130,7 +126,7 @@ export default class ProjList extends Vue {
} }
// console.log('args', args, itemdragend) // console.log('args', args, itemdragend)
this.onEnd2(itemdragend) this.onEndproj(itemdragend)
}) })
$service.eventBus.$on('drag', (el, source) => { $service.eventBus.$on('drag', (el, source) => {
@@ -178,37 +174,60 @@ export default class ProjList extends Vue {
public checkUpdate_everytime() { public checkUpdate_everytime() {
this.polling = setInterval(() => { this.polling = setInterval(() => {
this.checkUpdate() this.checkUpdate()
}, 60000) }, tools.NUMSEC_CHECKUPDATE)
} }
public beforeDestroy() { public beforeDestroy() {
clearInterval(this.polling) clearInterval(this.polling)
} }
public mydeleteItem(idobj: string) { public mydeleteitemproj(idobj: string) {
// console.log('mydeleteItem', idobj) // console.log('mydeleteitemtodo', idobj)
return Projects.actions.deleteItem({ idobj }) return Projects.actions.deleteItem({ idobj })
} }
public dbInsert(atfirst: boolean = false) { public dbInsert() {
let descr = this.projbottom.trim() const descr = this.projbottom.trim()
if (descr === '') { this.projbottom = ''
return
return this.addProject(descr)
}
public async clickMenuProjList(action) {
console.log('clickMenuProjList: ', action)
if (action === tools.MenuAction.ADD_PROJECT) {
const idnewelem = await this.addProject('')
// get element by id
const elem = this.getCompProjectById(idnewelem)
// @ts-ignore
elem.activeEdit()
// console.log('idnewelem', idnewelem, 'Elem Trovato', elem)
}
}
public getCompProjectById(id): SingleProject {
console.log('this.$refs.singleproject', this.$refs.singleproject)
for (const elem of this.$refs.singleproject) {
// @ts-ignore
if (elem.itemproject._id === id)
return elem
}
}
// const descr = this.$t('project.newproj').toString()
public async addProject(descr) {
const myobj: IProject = {
descr,
id_parent: this.idProjAtt
} }
if (!tools.checkIfUserExist(this)) { if (!tools.checkIfUserExist(this)) {
return return
} }
const myobj: IProject = { return await Projects.actions.dbInsert({ myobj, atfirst: false })
descr,
id_parent: this.idProjAtt
}
this.projbottom = ''
return Projects.actions.dbInsert({ myobj, atfirst })
} }
public setidsel(id: string) { public setidsel(id: string) {
@@ -216,8 +235,8 @@ export default class ProjList extends Vue {
this.itemsel = Projects.getters.getRecordById(this.idsel) this.itemsel = Projects.getters.getRecordById(this.idsel)
} }
public async updateitem({ myitem, field }) { public async updateitemproj({ myitem, field }) {
console.log('calling MODIFY updateitem', myitem, field) console.log('calling MODIFY updateitemproj', myitem, field)
const itemdragend: IDrag = { const itemdragend: IDrag = {
id_proj: this.idProjAtt, id_proj: this.idProjAtt,
@@ -232,12 +251,12 @@ export default class ProjList extends Vue {
} }
public deselectAllRows(item: IProject, check, onlythis: boolean = false) { public deselectAllRowsproj(item: IProject, check, onlythis: boolean = false) {
// console.log('deselectAllRows : ', item) // console.log('deselectAllRowsproj : ', item)
for (let i = 0; i < this.$refs.single.length; i++) { for (let i = 0; i < this.$refs.singleproject.length; i++) {
const contr = this.$refs.single[i] as SingleProject const contr = this.$refs.singleproject[i] as SingleProject
// @ts-ignore // @ts-ignore
const id = contr.itemproject._id const id = contr.itemproject._id
// Don't deselect the actual clicked! // Don't deselect the actual clicked!
@@ -271,6 +290,8 @@ export default class ProjList extends Vue {
} }
get getCalcHoursWorked() { get getCalcHoursWorked() {
if (this.itemsel.hoursplanned <= 0)
return 0
let myperc = Math.round(this.itemsel.hoursworked / this.itemsel.hoursplanned * 100) let myperc = Math.round(this.itemsel.hoursworked / this.itemsel.hoursplanned * 100)
return myperc return myperc

View File

@@ -21,22 +21,20 @@
icon="settings"> icon="settings">
<q-menu id="popconfig" self="top right"> <q-menu id="popconfig" self="top right">
<q-list link separator no-border class="todo-menu"> <q-list link separator no-border class="todo-menu">
<q-item clickable v-for="field in menuPopupConfigProject" <div v-for="field in menuPopupConfigProject" :key="field.value">
:key="field.value"> <q-item clickable v-if="(field.value === 150)">
<q-item-section avatar> <q-item-section avatar>
<q-icon :name="field.icon"/> <q-icon :name="field.icon"/>
</q-item-section> </q-item-section>
<q-item-section>{{field.label}}</q-item-section> <q-item-section>{{field.label}}</q-item-section>
<q-item-section side v-if="showTask(field.value)">
<q-item-section side> <q-item-section side>
<q-icon name="keyboard_arrow_right"/> <q-icon name="keyboard_arrow_right"/>
</q-item-section> </q-item-section>
<q-menu auto-close anchor="bottom middle" self="top middle"> <q-menu auto-close anchor="bottom middle" self="top middle">
<q-list dense> <q-list dense>
<q-item side :icon="field.icon"> <q-item side clickable :icon="field.icon">
<q-item-section> <q-item-section>
<q-list dense> <q-list dense>
@@ -45,8 +43,7 @@
:key="opt.value" :key="opt.value"
@click="showtype = opt.value"> @click="showtype = opt.value">
<q-item-section avatar> <q-item-section avatar>
<q-icon :name="opt.icon" <q-icon :name="opt.icon" inverted
inverted
color="primary"/> color="primary"/>
</q-item-section> </q-item-section>
<q-item-section> <q-item-section>
@@ -58,8 +55,17 @@
</q-item> </q-item>
</q-list> </q-list>
</q-menu> </q-menu>
</q-item-section> </q-item>
</q-item> <q-item v-else v-close-popup clickable :icon="field.icon"
@click="clickMenuProjList(field.value)">
<q-item-section avatar>
<q-icon :name="field.icon"/>
</q-item-section>
<q-item-section>{{field.label}}</q-item-section>
</q-item>
</div>
</q-list> </q-list>
</q-menu> </q-menu>
</q-btn> </q-btn>
@@ -71,15 +77,17 @@
<div> <div>
<!--<q-infinite-scroll :handler="loadMoreTodo" :offset="7">--> <!--<q-infinite-scroll :handler="loadMoreTodo" :offset="7">-->
<div class="container" v-dragula="items_dacompletare(idProjAtt)" drake="second"> <div class="container" v-dragula="items_dacompletare(idProjAtt)" drake="second">
<div :id="getmyid(myproj._id)" :index="index" <div :id="tools.getmyid(myproj._id)" :index="index"
v-for="(myproj, index) in items_dacompletare(idProjAtt)" v-for="(myproj, index) in items_dacompletare(idProjAtt)"
:key="myproj._id" class="myitemdrag"> :key="myproj._id" class="myitemdrag">
<SingleProject ref="single" @deleteItem="mydeleteItem(myproj._id)" <SingleProject ref="singleproject" @deleteItemproj="mydeleteitemproj(myproj._id)"
@eventupdate="updateitem" @eventupdateproj="updateitemproj"
@idsel="setidsel" @idsel="setidsel"
@deselectAllRows="deselectAllRows" @onEnd="onEnd2" @deselectAllRowsproj="deselectAllRowsproj" @onEnd="onEndproj"
:itemproject='myproj'/> :itemproject='myproj'>
</SingleProject>
</div> </div>
</div> </div>
@@ -91,7 +99,9 @@
color="blue-12" color="blue-12"
:label="$t('todo.insertbottom')" :label="$t('todo.insertbottom')"
:after="[{icon: 'arrow_forward', content: true, handler () {}}]" :after="[{icon: 'arrow_forward', content: true, handler () {}}]"
v-on:keyup.enter="dbInsert(false)"/> v-on:keyup.enter="dbInsert()">
</q-input>
<br> <br>
</div> </div>
@@ -135,7 +145,7 @@
</div> </div>
<q-icon class="flex-item flex-icon" name="watch_later"/> <q-icon class="flex-item flex-icon" name="watch_later"/>
<div class="flex-item itemdescr content-center"> <div class="flex-item itemdata content-center">
<q-input <q-input
ref="input" ref="input"
type="number" type="number"
@@ -144,7 +154,32 @@
:label="$t('proj.hoursplanned')" :label="$t('proj.hoursplanned')"
debounce="500" debounce="500"
/> />
<CProgress :descr="$t('proj.progresstask')" :progressval="itemsel.progressCalc"></CProgress> <CProgress :descr="$t('proj.progresstask')"
:progressval="itemsel.progressCalc"></CProgress>
</div>
</div>
<div class="flex-container clMain">
<div style="margin: 10px;"></div>
<div class="flex-item itemdata">
<q-input v-model="itemsel.begin_development" mask="date" :hint="$t('proj.begin_development')">
<!--<span class="data_string">{{tools.getstrDate(itemsel.begin_development)}}</span>-->
<q-icon name="event" class="cursor-pointer">
<q-popup-proxy>
<q-date v-model="itemsel.begin_development" today-btn/>
</q-popup-proxy>
</q-icon>
</q-input>
</div>
<div style="margin: 10px;"></div>
<div class="flex-item itemdata">
<q-input v-model="itemsel.begin_test" mask="date" :hint="$t('proj.begin_test')">
<!--<span class="data_string">{{tools.getstrDate(itemsel.begin_development)}}</span>-->
<q-icon name="event" class="cursor-pointer">
<q-popup-proxy>
<q-date v-model="itemsel.begin_test" today-btn/>
</q-popup-proxy>
</q-icon>
</q-input>
</div> </div>
</div> </div>
</div> </div>

View File

@@ -81,15 +81,11 @@ export default class Todo extends Vue {
this.categoryAtt = this.$route.params.category this.categoryAtt = this.$route.params.category
} }
public getmyid(id) {
return 'row' + id
}
public showTask(field_value) { public showTask(field_value) {
return field_value === tools.MenuAction.SHOW_TASK return field_value === tools.MenuAction.SHOW_TASK
} }
public async onEnd(itemdragend) { public async onEndtodo(itemdragend) {
await Todos.actions.swapElems(itemdragend) await Todos.actions.swapElems(itemdragend)
} }
@@ -105,7 +101,7 @@ export default class Todo extends Vue {
oldIndex: this.getElementOldIndex(args.el) oldIndex: this.getElementOldIndex(args.el)
} }
this.onEnd(itemdragend) this.onEndtodo(itemdragend)
}) })
$service.eventBus.$on('drag', (el, source) => { $service.eventBus.$on('drag', (el, source) => {
@@ -138,19 +134,19 @@ export default class Todo extends Vue {
public checkUpdate_everytime() { public checkUpdate_everytime() {
this.polling = setInterval(() => { this.polling = setInterval(() => {
this.checkUpdate() this.checkUpdate()
}, 60000) }, tools.NUMSEC_CHECKUPDATE)
} }
public beforeDestroy() { public beforeDestroy() {
clearInterval(this.polling) clearInterval(this.polling)
} }
public mydeleteItem(idobj: string) { public mydeleteitemtodo(idobj: string) {
// console.log('mydeleteItem', idobj) // console.log('mydeleteitemtodo', idobj)
return Todos.actions.deleteItem({ cat: this.categoryAtt, idobj }) return Todos.actions.deleteItemtodo({ cat: this.categoryAtt, idobj })
} }
public dbInsert(atfirst: boolean = false) { public async dbInsert(atfirst: boolean = false) {
let descr = this.todobottom.trim() let descr = this.todobottom.trim()
if (atfirst) { if (atfirst) {
descr = this.todotop.trim() descr = this.todotop.trim()
@@ -177,11 +173,11 @@ export default class Todo extends Vue {
this.todobottom = '' this.todobottom = ''
} }
return Todos.actions.dbInsert({ myobj, atfirst }) return await Todos.actions.dbInsert({ myobj, atfirst })
} }
public async updateitem({ myitem, field }) { public async updateitemtodo({ myitem, field }) {
console.log('calling MODIFY updateitem', myitem, field) console.log('calling MODIFY updateitemtodo', myitem, field)
const itemdragend: IDrag = { const itemdragend: IDrag = {
category: this.categoryAtt, category: this.categoryAtt,
@@ -197,8 +193,8 @@ export default class Todo extends Vue {
} }
public deselectAllRows(item: ITodo, check, onlythis: boolean = false) { public deselectAllRowstodo(item: ITodo, check, onlythis: boolean = false) {
// console.log('deselectAllRows : ', item) // console.log('deselectAllRowstodo : ', item)
for (let i = 0; i < this.$refs.single.length; i++) { for (let i = 0; i < this.$refs.single.length; i++) {

View File

@@ -65,21 +65,21 @@
<div> <div>
<!--<q-infinite-scroll :handler="loadMoreTodo" :offset="7">--> <!--<q-infinite-scroll :handler="loadMoreTodo" :offset="7">-->
<div class="container" v-dragula="items_dacompletare(categoryAtt)" :drake="dragname"> <div class="container" v-dragula="items_dacompletare(categoryAtt)" :drake="dragname">
<div :id="getmyid(mytodo._id)" :index="index" <div :id="tools.getmyid(mytodo._id)" :index="index"
v-for="(mytodo, index) in items_dacompletare(categoryAtt)" v-for="(mytodo, index) in items_dacompletare(categoryAtt)"
:key="mytodo._id" class="myitemdrag"> :key="mytodo._id" class="myitemdrag">
<div v-if="(prior !== mytodo.priority) && !mytodo.completed" <div v-if="(prior !== mytodo.priority) && mytodo.status !== tools.Status.COMPLETED"
:class="tools.getTitlePriority(mytodo.priority)"> :class="tools.getTitlePriority(mytodo.priority)">
<label>{{tools.getPriorityByInd(mytodo.priority)}}</label> <label>{{tools.getPriorityByInd(mytodo.priority)}}</label>
</div> </div>
<SingleTodo ref="single" @deleteItem="mydeleteItem(mytodo._id)" @eventupdate="updateitem" <SingleTodo ref="single" @deleteItemtodo="mydeleteitemtodo(mytodo._id)" @eventupdate="updateitemtodo"
@deselectAllRows="deselectAllRows" @onEnd="onEnd" @deselectAllRowstodo="deselectAllRowstodo" @onEnd="onEndtodo"
:itemtodo='mytodo'/> :itemtodo='mytodo'/>
<!--<div :name="`REF${index}`" class="divdrag non-draggato"></div>--> <!--<div :nametranslate="`REF${index}`" class="divdrag non-draggato"></div>-->
<div style="display: none">{{ prior = mytodo.priority, priorcomplet = mytodo.completed }} <div style="display: none">{{ prior = mytodo.priority, priorcomplet = (mytodo.status === tools.Status.COMPLETED) }}
</div> </div>
</div> </div>
</div> </div>
@@ -91,17 +91,17 @@
<!--<q-infinite-scroll :handler="loadMoreTodo" :offset="7">--> <!--<q-infinite-scroll :handler="loadMoreTodo" :offset="7">-->
<div class="container"> <div class="container">
<div :id="getmyid(mytodo._id)" :index="index" <div :id="tools.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">
<SingleTodo ref="single" @deleteItem="mydeleteItem(mytodo._id)" @eventupdate="updateitem" <SingleTodo ref="single" @deleteItemtodo="mydeleteItemtodo(mytodo._id)" @eventupdate="updateitemtodo"
@deselectAllRows="deselectAllRows" @onEnd="onEnd" @deselectAllRows="deselectAllRowstodo" @onEndtodo="onEndtodo"
:itemtodo='mytodo'/> :itemtodo='mytodo'/>
<!--<div :name="`REF${index}`" class="divdrag non-draggato"></div>--> <!--<div :nametranslate="`REF${index}`" class="divdrag non-draggato"></div>-->
<div style="display: none">{{ prior = mytodo.priority, priorcomplet = mytodo.completed }} <div style="display: none">{{ prior = mytodo.priority, priorcomplet = (mytodo.status === tools.Status.COMPLETED) }}
</div> </div>
</div> </div>
</div> </div>

View File

@@ -10,7 +10,7 @@
// "no-restricted-syntax": [ // "no-restricted-syntax": [
// "error", // "error",
// { // {
// "selector": "CallExpression[callee.object.name='console'][callee.property.name!=/^(log|warn|error|info|trace)$/]", // "selector": "CallExpression[callee.object.nametranslate='console'][callee.property.nametranslate!=/^(log|warn|error|info|trace)$/]",
// "message": "Unexpected property on console object was called" // "message": "Unexpected property on console object was called"
// } // }
// ], // ],