From 7cacf5c6ea11b1afaaff2ff503a855094cf460c8 Mon Sep 17 00:00:00 2001 From: Paolo Arena Date: Tue, 2 Apr 2019 00:18:01 +0200 Subject: [PATCH] Added begin_development and begin_test Added status (changed completed field) fixed internet status connection. --- config/webpack.config.base.js | 6 +- npm-shrinkwrap.json | 191 ++++++++++++++++-- package.json | 4 +- src/components/Header/Header.ts | 4 +- src/components/Header/Header.vue | 4 +- .../projects/SingleProject/SingleProject.ts | 53 +++-- .../projects/SingleProject/SingleProject.vue | 6 +- src/components/todos/SingleTodo/SingleTodo.ts | 30 +-- .../todos/SingleTodo/SingleTodo.vue | 6 +- src/components/todos/SubMenus/SubMenus.vue | 2 +- src/error-handler/index.ts | 2 +- src/globalroutines/indexdb.ts | 28 +-- src/jquery.d.ts | 64 +++--- src/js/fetch.js | 2 +- src/layouts/menuone/menuOne.ts | 7 + src/layouts/menuone/menuOne.vue | 4 +- src/model/GlobalStore.ts | 7 +- src/model/Projects.ts | 7 +- src/model/Todos.ts | 2 +- src/router/index.ts | 4 +- src/router/route-config.ts | 8 +- src/statics/i18n.js | 11 +- src/statics/js/fetch.js | 2 +- src/store/Api/Instance.ts | 4 +- src/store/Api/index.ts | 12 +- src/store/Modules/ApiTables.ts | 38 ++-- src/store/Modules/GlobalStore.ts | 21 +- src/store/Modules/Projects.ts | 27 ++- src/store/Modules/Todos.ts | 16 +- src/store/Modules/UserStore.ts | 12 +- src/store/Modules/tools.ts | 54 ++++- src/typings/libs/vuelidate.d.ts | 8 +- src/views/categories/category/category.vue | 6 +- src/views/categories/tabledata/tabledata.vue | 6 +- src/views/projects/proj-list/proj-list.scss | 6 + src/views/projects/proj-list/proj-list.ts | 77 ++++--- src/views/projects/proj-list/proj-list.vue | 77 +++++-- src/views/todo/todo.ts | 28 ++- src/views/todo/todo.vue | 22 +- tslint.json | 2 +- 40 files changed, 592 insertions(+), 278 deletions(-) diff --git a/config/webpack.config.base.js b/config/webpack.config.base.js index 6879650..2439c3c 100644 --- a/config/webpack.config.base.js +++ b/config/webpack.config.base.js @@ -14,7 +14,7 @@ const baseConfig = { 'bundle': helpers.root('/src/main.ts'), }, output: { - filename: '[name].js', + filename: '[nametranslate].js', publicPath: '/', path: helpers.root('dist'), }, @@ -80,10 +80,10 @@ const baseConfig = { } }, { 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=&.]+)?$/, - use: 'base64-inline-loader?limit=4000&name=[name].[ext]' + use: 'base64-inline-loader?limit=4000&nametranslate=[nametranslate].[ext]' } ] }, diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 39c8d91..02c6810 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -4353,9 +4353,9 @@ } }, "@vue/cli-plugin-unit-jest": { - "version": "3.5.1", - "resolved": "https://registry.npmjs.org/@vue/cli-plugin-unit-jest/-/cli-plugin-unit-jest-3.5.1.tgz", - "integrity": "sha512-VFnkM3R/Z91IWLZyKh6CLgsWaRJfhWUThkAR13q7ama8WyIFPpKAyJKM0jdsm1Gx2PnBwCm/mrjUpzK4VB0ssA==", + "version": "3.5.3", + "resolved": "https://registry.npmjs.org/@vue/cli-plugin-unit-jest/-/cli-plugin-unit-jest-3.5.3.tgz", + "integrity": "sha512-6GRN3dhFXF8FTqvAylHA8fh+ii5+KoKPPz972j18V/MedYgm39qVSkDWD2sLKOueTX5SSVqk3QKyF6gy+Uhp7Q==", "dev": true, "requires": { "@vue/cli-shared-utils": "^3.5.1", @@ -4382,6 +4382,32 @@ "integrity": "sha1-odl8yvy8JiXMcPrc6zalDFiwGlM=", "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": { "version": "1.8.5", "resolved": "https://registry.npmjs.org/braces/-/braces-1.8.5.tgz", @@ -6262,13 +6288,109 @@ } }, "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==", + "version": "24.5.0", + "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-24.5.0.tgz", + "integrity": "sha512-0fKCXyRwxFTJL0UXDJiT2xYxO9Lu2vBd9n+cC+eDjESzcVG3s2DRGAxbzJX21fceB1WYoBjAh8pQ83dKcl003g==", "dev": true, "requires": { - "babel-plugin-istanbul": "^4.1.6", - "babel-preset-jest": "^23.2.0" + "@jest/transform": "^24.5.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": { @@ -6438,10 +6560,13 @@ } }, "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 + "version": "24.3.0", + "resolved": "https://registry.npmjs.org/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-24.3.0.tgz", + "integrity": "sha512-nWh4N1mVH55Tzhx2isvUN5ebM5CDUvIpXPZYMRazQughie/EqGnbR+czzoQlhUmJG9pPJmYDRhvocotb2THl1w==", + "dev": true, + "requires": { + "@types/babel__traverse": "^7.0.6" + } }, "babel-plugin-syntax-object-rest-spread": { "version": "6.13.0", @@ -6505,13 +6630,13 @@ } }, "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=", + "version": "24.3.0", + "resolved": "https://registry.npmjs.org/babel-preset-jest/-/babel-preset-jest-24.3.0.tgz", + "integrity": "sha512-VGTV2QYBa/Kn3WCOKdfS31j9qomaXSgJqi65B6o05/1GsJyj9LVhSljM9ro4S+IBGj/ENhNBuH9bpqzztKAQSw==", "dev": true, "requires": { - "babel-plugin-jest-hoist": "^23.2.0", - "babel-plugin-syntax-object-rest-spread": "^6.13.0" + "@babel/plugin-syntax-object-rest-spread": "^7.0.0", + "babel-plugin-jest-hoist": "^24.3.0" } }, "babel-register": { @@ -13341,6 +13466,32 @@ "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": { "version": "1.8.5", "resolved": "https://registry.npmjs.org/braces/-/braces-1.8.5.tgz", @@ -14337,9 +14488,9 @@ "dev": true }, "js-beautify": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/js-beautify/-/js-beautify-1.9.0.tgz", - "integrity": "sha512-P0skmY4IDjfLiVrx+GLDeme8w5G0R1IGXgccVU5HP2VM3lRblH7qN2LTea5vZAxrDjpZBD0Jv+ahpjwVcbz/rw==", + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/js-beautify/-/js-beautify-1.9.1.tgz", + "integrity": "sha512-oxxvVZdOdUfzk8IOLBF2XUZvl2GoBEfA+b0of4u2EBY/46NlXasi8JdFvazA5lCrf9/lQhTjyVy2QCUW7iq0MQ==", "dev": true, "requires": { "config-chain": "^1.1.12", diff --git a/package.json b/package.json index fdf02b0..6e5ab0f 100755 --- a/package.json +++ b/package.json @@ -98,11 +98,11 @@ "@vue/cli-plugin-e2e-cypress": "^3.0.1", "@vue/cli-plugin-pwa": "^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/test-utils": "^1.0.0-beta.20", "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-plugin-transform-imports": "1.5.1", "eslint": "^5.5.0", diff --git a/src/components/Header/Header.ts b/src/components/Header/Header.ts index 4a9ba8b..4d71747 100644 --- a/src/components/Header/Header.ts +++ b/src/components/Header/Header.ts @@ -262,12 +262,12 @@ export default class Header extends Vue { function updateOnlineStatus(event) { if (navigator.onLine) { - // console.log('EVENT ONLINE!') + console.log('EVENT ONLINE!') // handle online status GlobalStore.mutations.setStateConnection('online') mythis.changeIconConn() } else { - // console.log('EVENT OFFLINE!') + console.log('EVENT OFFLINE!') // handle offline status GlobalStore.mutations.setStateConnection('offline') mythis.changeIconConn() diff --git a/src/components/Header/Header.vue b/src/components/Header/Header.vue index 77e9d1c..4aaa312 100644 --- a/src/components/Header/Header.vue +++ b/src/components/Header/Header.vue @@ -47,11 +47,11 @@ + diff --git a/src/components/todos/SingleTodo/SingleTodo.ts b/src/components/todos/SingleTodo/SingleTodo.ts index efe8c2e..3f30ebc 100644 --- a/src/components/todos/SingleTodo/SingleTodo.ts +++ b/src/components/todos/SingleTodo/SingleTodo.ts @@ -45,7 +45,7 @@ export default class SingleTodo extends Vue { @Prop({ required: true }) public itemtodo: ITodo // @Watch('itemtodo.completed') valueChanged() { - // this.watchupdate('completed') + // this.watchupdate('status') // } @Watch('itemtodo.enableExpiring') public valueChanged4() { @@ -112,7 +112,7 @@ export default class SingleTodo extends Vue { this.classExpiring = 'flex-item data-item shadow-1' this.classExpiringEx = '' - if (this.itemtodo.completed) { + if (this.itemtodo.status === tools.Status.COMPLETED) { this.percentageProgress = 100 this.classCompleted += ' icon_completed' this.classDescr += ' status_completed' @@ -129,7 +129,7 @@ export default class SingleTodo extends Vue { let mycolcl = ' ' + tools.getProgressClassColor(this.itemtodo.progress) this.colProgress = tools.getProgressColor(this.itemtodo.progress) - if (this.itemtodo.completed) { + if (this.itemtodo.status === tools.Status.COMPLETED) { mycolcl = ' percompleted' this.colProgress = 'gray' } @@ -141,7 +141,7 @@ export default class SingleTodo extends Vue { this.clButtPopover = this.sel ? 'pos-item-popover comp_selected' : 'pos-item-popover' - if (!this.itemtodo.completed) { + if (this.itemtodo.status !== tools.Status.COMPLETED) { this.clButtPopover += ' pos-item-popover_cursor' } @@ -169,10 +169,6 @@ export default class SingleTodo extends Vue { } - public getstrDate(mytimestamp) { - return date.formatDate(mytimestamp, 'DD-MM-YY') - } - public created() { this.precDescr = this.itemtodo.descr this.updateicon() @@ -192,7 +188,7 @@ export default class SingleTodo extends Vue { if (!this.sel) { if (!this.inEdit) { - this.$emit('deselectAllRows', this.itemtodo, true) + this.$emit('deselectAllRowstodo', this.itemtodo, true) if (!this.sel) { this.selectRiga() @@ -239,7 +235,7 @@ export default class SingleTodo extends Vue { } public editTodo() { - if (!this.itemtodo.completed) { + if (this.itemtodo.status !== tools.Status.COMPLETED) { // console.log('INIZIO - editTodo') this.$emit('click') this.precDescr = this.itemtodo.descr @@ -281,7 +277,7 @@ export default class SingleTodo extends Vue { // console.log('exitEdit') this.inEdit = false this.updateClasses() - this.$emit('deselectAllRows', this.itemtodo, false, singola) + this.$emit('deselectAllRowstodo', this.itemtodo, false, singola) } } @@ -374,11 +370,15 @@ export default class SingleTodo extends Vue { public setCompleted() { // console.log('setCompleted') - this.itemtodo.completed = !this.itemtodo.completed + if (this.itemtodo.status === tools.Status.COMPLETED) { + this.itemtodo.status = tools.Status.OPENED + } else { + this.itemtodo.status = tools.Status.COMPLETED + } this.updateicon() - this.updatedata('completed') + this.updatedata('status') this.deselectAndExitEdit() } @@ -391,7 +391,7 @@ export default class SingleTodo extends Vue { public updateicon() { // console.log('updateicon') - if (this.itemtodo.completed) { + if (this.itemtodo.status === tools.Status.COMPLETED) { this.iconCompleted = 'check_circle' } else { @@ -412,7 +412,7 @@ export default class SingleTodo extends Vue { } public removeitem(id) { - this.$emit('deleteItem', id) + this.$emit('deleteItemtodo', id) } public enableExpiring() { diff --git a/src/components/todos/SingleTodo/SingleTodo.vue b/src/components/todos/SingleTodo/SingleTodo.vue index 80f8643..ba4db35 100644 --- a/src/components/todos/SingleTodo/SingleTodo.vue +++ b/src/components/todos/SingleTodo/SingleTodo.vue @@ -9,7 +9,7 @@
- - {{getstrDate(itemtodo.expiring_at)}} + {{tools.getstrDate(itemtodo.expiring_at)}} - + diff --git a/src/components/todos/SubMenus/SubMenus.vue b/src/components/todos/SubMenus/SubMenus.vue index ce712a7..b5e66d2 100644 --- a/src/components/todos/SubMenus/SubMenus.vue +++ b/src/components/todos/SubMenus/SubMenus.vue @@ -15,7 +15,7 @@ - + { /* - if (error.constructor.name === 'FirebaseError') { + if (error.constructor.nametranslate === 'FirebaseError') { Firebase(error) return } diff --git a/src/globalroutines/indexdb.ts b/src/globalroutines/indexdb.ts index aa66e5c..8ad6fbb 100644 --- a/src/globalroutines/indexdb.ts +++ b/src/globalroutines/indexdb.ts @@ -5,6 +5,7 @@ import { GlobalStore } from '../store/Modules' import { idbKeyval as storage } from '../js/storage.js' import { costanti } from '../store/Modules/costanti' import { ICfgData, IGlobalState } from '@src/model' +import { tools } from '@src/store/Modules/tools' function saveConfigIndexDb(context) { @@ -25,7 +26,7 @@ function writeConfigIndexDb(context, data) { } async function readfromIndexDbToState(context, table) { - console.log('*** readfromIndexDbToState ***') + console.log('*** readfromIndexDbToState ***', table) return await storage.getalldata(table) .then((reccat) => { @@ -45,30 +46,31 @@ async function readfromIndexDbToState(context, table) { console.log(table + ' records', records) // console.log('&&&&&&& readfromIndexDbToState OK: Num RECORD: ', records.length) + const arrinit = [] + for (const mytodo of records) { const cat = mytodo.category const indcat = Todos.state.categories.indexOf(cat) - if (Todos.state.todos[indcat] === undefined) { - Todos.state.todos[indcat] = {} + if (arrinit.indexOf(indcat) < 0) { + Todos.state.todos[indcat] = [] + arrinit.push(indcat) } - // add to the right array 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') { - Projects.state.projects = [] - for (const elem of reccat) { - Projects.state.projects.push(elem.valore) - } + } else { + const arrris = tools.setArrayMainByTable(table, reccat) + // console.log('************ ARRAYS SALVATI IN MEMORIA ', table, arrris) + } - }).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 } return await storage.setdata(table, datakey) - } else if (cmd === 'updatefromIndexedDbToStateTodo') { + } else if (cmd === 'updatefromIndexedDbToState') { return await readfromIndexDbToState(context, table) } else if (cmd === 'readall') { if (GlobalStore) { diff --git a/src/jquery.d.ts b/src/jquery.d.ts index 7678978..b638148 100644 --- a/src/jquery.d.ts +++ b/src/jquery.d.ts @@ -225,7 +225,7 @@ interface JQueryStatic { contains(container: Element, contained: Element): boolean 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. * * @param element The DOM element to query for the data. @@ -246,7 +246,7 @@ interface JQueryStatic { */ data(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. * * @param element The DOM element to query for the data. @@ -260,7 +260,7 @@ interface JQueryStatic { * 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 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/} * @since 1.3 */ @@ -695,7 +695,7 @@ interface JQueryStatic { /** * 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 - * elements with name/value properties. + * elements with nametranslate/value properties. * * @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. @@ -2772,14 +2772,14 @@ interface JQueryStatic { // endregion - // region (context, name) + // region (context, nametranslate) /** * 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 name The name 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 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 nametranslate argument. * @see {@link https://api.jquery.com/jQuery.proxy/} * @since 1.4 * @since 1.6 @@ -2796,7 +2796,7 @@ interface JQueryStatic { * 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 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. * An array of functions to replace the current queue contents. * @see {@link https://api.jquery.com/jQuery.queue/} @@ -3004,7 +3004,7 @@ interface JQuery extends Iterable * * @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 - * 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. * @see {@link https://api.jquery.com/addClass/} * @since 1.0 @@ -3159,7 +3159,7 @@ interface JQuery extends Iterable /** * 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()). * 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. @@ -3180,7 +3180,7 @@ interface JQuery extends Iterable /** * 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/} * @since 1.0 */ @@ -3291,7 +3291,7 @@ interface JQuery extends Iterable /** * 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/} * @since 1.4 */ @@ -3377,7 +3377,7 @@ interface JQuery extends Iterable /** * 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. * 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. @@ -3414,7 +3414,7 @@ interface JQuery extends Iterable css(propertyNames: string[]): JQuery.PlainObject /** * 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 undefined @@ -3441,7 +3441,7 @@ interface JQuery extends Iterable data(obj: JQuery.PlainObject): this /** * 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. * @see {@link https://api.jquery.com/data/} @@ -3450,7 +3450,7 @@ interface JQuery extends Iterable data(key: string): any /** * 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/} * @since 1.4 @@ -3478,7 +3478,7 @@ interface JQuery extends Iterable * 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 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/} * @since 1.4 */ @@ -3530,7 +3530,7 @@ interface JQuery extends Iterable /** * 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/} * @since 1.2 */ @@ -3731,7 +3731,7 @@ interface JQuery extends Iterable * Stop the currently-running animation, remove all queued animations, and complete all animations for * 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/} * @since 1.9 */ @@ -3824,7 +3824,7 @@ interface JQuery extends Iterable /** * 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/} * @since 1.2 */ @@ -4678,7 +4678,7 @@ interface JQuery extends Iterable /** * 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 * old property value as arguments. Within the function, the keyword this refers to the current element. * @see {@link https://api.jquery.com/prop/} @@ -4688,7 +4688,7 @@ interface JQuery extends Iterable /** * 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. * @see {@link https://api.jquery.com/prop/} * @since 1.6 @@ -4705,7 +4705,7 @@ interface JQuery extends Iterable /** * 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/} * @since 1.6 */ @@ -4714,7 +4714,7 @@ interface JQuery extends Iterable * 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 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). * @see {@link https://api.jquery.com/pushStack/} * @since 1.3 @@ -4731,7 +4731,7 @@ interface JQuery extends Iterable /** * 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. * An array of functions to replace the current queue contents. * @see {@link https://api.jquery.com/queue/} @@ -4750,7 +4750,7 @@ interface JQuery extends Iterable /** * 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/} * @since 1.2 */ @@ -4804,7 +4804,7 @@ interface JQuery extends Iterable /** * 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/} * @since 1.6 */ @@ -5079,7 +5079,7 @@ interface JQuery extends Iterable /** * 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 jumpToEnd A Boolean indicating whether to complete the current animation immediately. Defaults to false. * @see {@link https://api.jquery.com/stop/} @@ -5584,7 +5584,7 @@ declare namespace JQuery { */ 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 * 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 @@ -5594,8 +5594,8 @@ declare namespace JQuery { */ jsonp?: string | false /** - * Specify the callback function name 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 + * Specify the callback function nametranslate for a JSONP request. This value will be used instead of the + * 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 * 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 @@ -7436,7 +7436,7 @@ declare namespace JQuery { /** * 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 - * 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. */ queue?: boolean | string diff --git a/src/js/fetch.js b/src/js/fetch.js index 30ea634..7e286b4 100644 --- a/src/js/fetch.js +++ b/src/js/fetch.js @@ -47,7 +47,7 @@ name = String(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() } diff --git a/src/layouts/menuone/menuOne.ts b/src/layouts/menuone/menuOne.ts index cc198fa..c3dc7d4 100644 --- a/src/layouts/menuone/menuOne.ts +++ b/src/layouts/menuone/menuOne.ts @@ -19,6 +19,13 @@ export default class MenuOne extends Vue { return GlobalStore.getters.getmenu } + public getLabelByItem(item) { + if (!!item.name) + return this.$t(item.name) + else + return item.text + } + public setParentVisibilityBasedOnRoute(parent) { parent.routes.forEach((item) => { if (this.$route.path === item.route) { diff --git a/src/layouts/menuone/menuOne.vue b/src/layouts/menuone/menuOne.vue index e503591..466f694 100644 --- a/src/layouts/menuone/menuOne.vue +++ b/src/layouts/menuone/menuOne.vue @@ -8,7 +8,7 @@ + :label="getLabelByItem(child2)"> diff --git a/src/model/GlobalStore.ts b/src/model/GlobalStore.ts index 4e2b250..c600167 100644 --- a/src/model/GlobalStore.ts +++ b/src/model/GlobalStore.ts @@ -60,7 +60,7 @@ export interface IGlobalState { } export interface IMenuList { - name: string + nametranslate: string description: string idelem?: string icon?: string @@ -71,7 +71,8 @@ export interface IListRoutes { faIcon: string materialIcon: string name: string + text?: string routes2: [] - level_parent: string - level_child: string + level_parent: number + level_child: number } diff --git a/src/model/Projects.ts b/src/model/Projects.ts index d750395..711ceb0 100644 --- a/src/model/Projects.ts +++ b/src/model/Projects.ts @@ -12,7 +12,7 @@ export interface IProject { hoursplanned?: number hoursworked?: number priority?: number - completed?: boolean + status?: number created_at?: Date modify_at?: Date completed_at?: Date @@ -23,9 +23,12 @@ export interface IProject { pos?: number order?: number progressCalc?: number + live_url?: string + test_url?: string + begin_development?: Date + begin_test?: Date } - export interface IParamIProject { categorySel?: string checkPending?: boolean diff --git a/src/model/Todos.ts b/src/model/Todos.ts index 1481b88..36d5e07 100644 --- a/src/model/Todos.ts +++ b/src/model/Todos.ts @@ -4,7 +4,7 @@ export interface ITodo { category?: string descr?: string, priority?: number, - completed?: boolean, + status?: number, created_at?: Date, modify_at?: Date, completed_at?: Date, diff --git a/src/router/index.ts b/src/router/index.ts index 86d03d0..c0a3f1e 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -78,7 +78,7 @@ Router.beforeEach(async (to: IMyRoute, from: IMyRoute, next) => { /* if (to.matched[0] && to.meta.isModal) { console.log('Route interceptor log: <7>') - if (!from.name) { + if (!from.nametranslate) { getRouteData(to.matched[0]) GlobalStore.mutations.setPreviousModalRoute(to.matched[0].path) } else { @@ -108,7 +108,7 @@ Router.beforeEach(async (to: IMyRoute, from: IMyRoute, next) => { message: `Vous n'avez pas accès à cette page` }) ProgressBar.mutations.fail() - if (from.name) { + if (from.nametranslate) { return } else { next('/') diff --git a/src/router/route-config.ts b/src/router/route-config.ts index 546e3a1..0c12185 100644 --- a/src/router/route-config.ts +++ b/src/router/route-config.ts @@ -109,23 +109,23 @@ export const routesList: IMyRouteConfig[] = [ { path: '/requestresetpwd', component: () => import('@/views/login/requestresetpwd.vue'), - meta: { name: 'Reset your Password' } + meta: { nametranslate: 'Reset your Password' } }, { path: '/updatepwd', component: () => import('@/views/login/updatepassword.vue'), - meta: { name: 'Update your Password' } + meta: { nametranslate: 'Update your Password' } } { path: '/simpleform', component: () => import('@/views/form/simpleForm/simpleForm.vue'), - meta: { name: 'SimpleForm' } + meta: { nametranslate: 'SimpleForm' } }, { path: '/embeeded', component: () => import('@/views/form/embeeded/embeeded.vue'), - meta: { name: 'Embeeded' } + meta: { nametranslate: 'Embeeded' } }*/ ] diff --git a/src/statics/i18n.js b/src/statics/i18n.js index 4721d73..25d0c1e 100644 --- a/src/statics/i18n.js +++ b/src/statics/i18n.js @@ -236,10 +236,13 @@ const messages = { }, connection: 'Connessione', proj: { + newproj: 'Titolo Progetto', longdescr: 'Descrizione', hoursplanned: 'Ore Preventivate', hoursadded: 'Ore Aggiuntive', hoursworked: 'Ore Lavorate', + begin_development: 'Inizio Sviluppo', + begin_test: 'Inizio Test', progresstask: 'Progressione Compiti' } }, @@ -474,10 +477,13 @@ const messages = { }, connection: 'Connection', proj: { + newproj: 'Título Projecto', longdescr: 'Descripción', hoursplanned: 'Horas Estimadas', hoursadded: 'Horas Adicional', hoursworked: 'Horas Trabajadas', + begin_development: 'Comienzo desarrollo', + begin_test: 'Comienzo Prueba', progresstask: 'Progresion Tareas' } }, @@ -584,7 +590,7 @@ const messages = { multiplatform: { 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. ' + - 'just share the name of this site www.freeplanet.app.
' + + 'just share the nametranslate of this site www.freeplanet.app.
' + 'After registration it will ask to be added to the application list and in the screen', }, free: { @@ -712,10 +718,13 @@ const messages = { }, connection: 'Conexión', proj: { + newproj: 'Project Title', longdescr: 'Description', hoursplanned: 'Estimated Hours', hoursadded: 'Additional Hours', hoursworked: 'Worked Hours', + begin_development: 'Start Dev', + begin_test: 'Start Test', progresstask: 'Todos progression' } }, diff --git a/src/statics/js/fetch.js b/src/statics/js/fetch.js index 6bac6b3..9cc3293 100644 --- a/src/statics/js/fetch.js +++ b/src/statics/js/fetch.js @@ -47,7 +47,7 @@ name = String(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() } diff --git a/src/store/Api/Instance.ts b/src/store/Api/Instance.ts index 7e9fdb4..184ff45 100644 --- a/src/store/Api/Instance.ts +++ b/src/store/Api/Instance.ts @@ -27,8 +27,10 @@ axiosInstance.interceptors.response.use( if (process.env.DEBUG === '1') console.log('Status = ', error.response.status) console.log('Request Error: ', error.response) - if (error.response.status) { + if (error.response.status !== 0) { GlobalStore.mutations.setStateConnection('online') + } else { + GlobalStore.mutations.setStateConnection('offline') } } else { GlobalStore.mutations.setStateConnection('offline') diff --git a/src/store/Api/index.ts b/src/store/Api/index.ts index 6a1808e..7df7e4a 100644 --- a/src/store/Api/index.ts +++ b/src/store/Api/index.ts @@ -163,10 +163,12 @@ export namespace ApiTool { return globalroutines(null, 'delete', 'swmsg', null, mystrparam) }) .catch((err) => { - if (err.message === 'Failed to fetch') { - errorfromserver = true + if (!!err.msgerr) { + 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) }) .then((error) => { - // console.log('¨¨¨¨¨¨¨¨¨¨¨¨¨¨ errorfromserver:', errorfromserver) - const mystate = error ? 'offline' : 'online' + console.log('¨¨¨¨¨¨¨¨¨¨¨¨¨¨ errorfromserver:', errorfromserver, error) + const mystate = (error || errorfromserver) ? 'offline' : 'online' GlobalStore.mutations.setStateConnection(mystate) GlobalStore.mutations.saveConfig( { _id: costanti.CONFIG_ID_STATE_CONN, value: mystate }) diff --git a/src/store/Modules/ApiTables.ts b/src/store/Modules/ApiTables.ts index cffc030..46c6e0d 100644 --- a/src/store/Modules/ApiTables.ts +++ b/src/store/Modules/ApiTables.ts @@ -88,7 +88,7 @@ async function dbDeleteItem(call, item) { }) .catch((error) => { UserStore.mutations.setErrorCatch(error) - return UserStore.getters.getServerCode() + return UserStore.getters.getServerCode }) 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) { tools.consolelogpao('UNAUTHORIZING... TOKEN EXPIRED... !! ') } 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) { // Read all data from IndexedDB Store into Memory - await updatefromIndexedDbToStateTodo(nametabindex) + await updatefromIndexedDbToState(nametabindex) } } else { if (ris.status === tools.OK && checkPending) { @@ -210,7 +210,7 @@ async function checkPendingMsg() { try { if (config) { 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) { GlobalStore.mutations.setStateConnection(config[1].stateconn) @@ -288,7 +288,7 @@ async function sendSwMsgIfAvailable() { } async function waitAndRefreshData() { - // #Todo++ Check if is OK + // #Todo++ waitAndRefreshData: Check if is OK await Projects.actions.dbLoad({ checkPending: false, onlyiffirsttime: false }) return await Todos.actions.dbLoad({ checkPending: false }) } @@ -300,6 +300,10 @@ export async function waitAndcheckPendingMsg() { return await checkPendingMsg() .then((ris) => { if (ris) { + if (!GlobalStore.getters.isOnline) { // If is Offline, then check + + } + // console.log('risPending = ', ris) return sendSwMsgIfAvailable() .then((something) => { @@ -315,10 +319,10 @@ export async function waitAndcheckPendingMsg() { }) } -async function updatefromIndexedDbToStateTodo(nametab) { - await globalroutines(null, 'updatefromIndexedDbToStateTodo', nametab, null) +async function updatefromIndexedDbToState(nametab) { + await globalroutines(null, 'updatefromIndexedDbToState', nametab, null) .then(() => { - console.log('updatefromIndexedDbToStateTodo! ') + console.log('updatefromIndexedDbToState! ') return true }) } @@ -377,14 +381,14 @@ export async function table_ModifyRecord(nametable, myitem, fieldtochange) { const myobjsaved = tools.jsonCopy(myitem) -/* - const mymodule = tools.getModulesByTable(nametable) - let param2 = '' - if (nametable === 'todos') { - param2 = myitem.category - } - const miorec = mymodule.getters.getRecordById(myobjsaved._id, param2) -*/ + /* + const mymodule = tools.getModulesByTable(nametable) + let param2 = '' + if (nametable === 'todos') { + param2 = myitem.category + } + const miorec = mymodule.getters.getRecordById(myobjsaved._id, param2) + */ // get record from IndexedDb 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) if (nametable === 'todos') { - if (setmodifiedIfchanged(miorec, myobjsaved, 'completed')) { + if (setmodifiedIfchanged(miorec, myobjsaved, 'status')) { miorec.completed_at = new Date().getDate() } } diff --git a/src/store/Modules/GlobalStore.ts b/src/store/Modules/GlobalStore.ts index 8cdae95..c7586b0 100644 --- a/src/store/Modules/GlobalStore.ts +++ b/src/store/Modules/GlobalStore.ts @@ -40,9 +40,9 @@ const state: IGlobalState = { posts: [], menulinks: {}, listatodo: [ - { name: 'personal', description: 'personal' }, - { name: 'work', description: 'work' }, - { name: 'shopping', description: 'shopping' } + { nametranslate: 'personal', description: 'personal' }, + { nametranslate: 'work', description: 'work' }, + { nametranslate: 'shopping', description: 'shopping' } ], connData: { uploading_server: 0, @@ -120,7 +120,7 @@ namespace Getters { faIcon: 'fa fa-list-alt', materialIcon: 'todo', name: 'pages.' + elem.description, - route: '/todo/' + elem.name + route: '/todo/' + elem.nametranslate } listatodo.push(item) @@ -132,7 +132,8 @@ namespace Getters { for (const elem of arrlistaproj) { const item = { materialIcon: 'next_week', - name: elem.description, + name: elem.nametranslate, + text: elem.description, route: '/projects/' + elem.idelem } listaprojects.push(item) @@ -145,14 +146,14 @@ namespace Getters { if (!process.env.PROD) { addRoute(arrroutes, { route: '/todo', faIcon: 'fa fa-list-alt', materialIcon: 'format_list_numbered', name: 'pages.Todo', routes2: listatodo, - level_parent: '0.5', - level_child: '0.5' + level_parent: 0.5, + level_child: 0.5 }) addRoute(arrroutes,{ route: '/projects/' + tools.FIRST_PROJ, faIcon: 'fa fa-list-alt', materialIcon: 'next_week', name: 'pages.Projects', routes2: listaprojects, - level_parent: '0', - level_child: '0.5' + level_parent: 0, + level_child: 0.5 }) } @@ -210,7 +211,7 @@ namespace Getters { }, get isOnline() { - console.log('*********************** isOnline') + // console.log('*********************** isOnline') return state.stateConnection === 'online' }, diff --git a/src/store/Modules/Projects.ts b/src/store/Modules/Projects.ts index b7477c7..fe517ba 100644 --- a/src/store/Modules/Projects.ts +++ b/src/store/Modules/Projects.ts @@ -20,7 +20,7 @@ const state: IProjectsState = { 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('Projects', state) const stateGetter = b.state() @@ -55,19 +55,27 @@ namespace Getters { const obj: IProject = { _id: objectId(), descr: '', + longdescr: '', id_parent: '', priority: tools.Priority.PRIORITY_NORMAL, - completed: false, + status: tools.Status.OPENED, created_at: new Date(), modify_at: new Date(), completed_at: new Date(), + begin_development: new Date(0), + begin_test: new Date(0), category: '', // expiring_at: tomorrow, enableExpiring: false, id_prev: '', pos: 0, modified: false, + hoursworked: 0, + hoursplanned: 0, + live_url: '', + test_url: '', progressCalc: 0 + } return obj @@ -75,6 +83,7 @@ namespace Getters { const items_dacompletare = b.read((state: IProjectsState) => (id_parent: string): IProject[] => { if (state.projects) { + // console.log('state.projects', state.projects) return tools.mapSort(state.projects.filter((proj) => proj.id_parent === id_parent)) } else { return [] @@ -83,10 +92,11 @@ namespace Getters { const listaprojects = b.read((state: IProjectsState) => (): IMenuList[] => { if (state.projects) { + // console.log('state.projects', state.projects) const listaproj = tools.mapSort(state.projects.filter((proj) => proj.id_parent === tools.FIRST_PROJ)) const myarr: IMenuList[] = [] 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 @@ -150,7 +160,7 @@ namespace Getters { namespace Mutations { 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) { state.projects = [] state.projects.push(objproj) @@ -164,7 +174,7 @@ namespace Mutations { 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 }), 10) - // console.log('ARRAY TODOS = ', state.projects) if (process.env.DEBUG === '1') { console.log('dbLoad', 'state.projects', state.projects) } @@ -225,7 +234,7 @@ namespace Actions { return error }) - ApiTables.aftercalling(ris, checkPending, 'categories') + ApiTables.aftercalling(ris, checkPending, nametable) } async function deleteItem(context, { idobj }) { @@ -292,7 +301,9 @@ namespace Actions { } // 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 }) { diff --git a/src/store/Modules/Todos.ts b/src/store/Modules/Todos.ts index 4ba9e6d..2ec9cec 100644 --- a/src/store/Modules/Todos.ts +++ b/src/store/Modules/Todos.ts @@ -27,7 +27,7 @@ const state: ITodosState = { 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('Todos', state) const stateGetter = b.state() @@ -55,7 +55,7 @@ function initcat() { userId: UserStore.state.userId, descr: '', priority: tools.Priority.PRIORITY_NORMAL, - completed: false, + status: tools.Status.OPENED, created_at: new Date(), modify_at: new Date(), completed_at: new Date(), @@ -76,7 +76,7 @@ namespace Getters { const items_dacompletare = b.read((state: ITodosState) => (cat: string): ITodo[] => { const indcat = getindexbycategory(cat) if (state.todos[indcat]) { - return state.todos[indcat].filter((todo) => !todo.completed) + return state.todos[indcat].filter((todo) => todo.status !== tools.Status.COMPLETED) } else { return [] } @@ -86,10 +86,10 @@ namespace Getters { const indcat = getindexbycategory(cat) if (state.todos[indcat]) { 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 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 { return [] @@ -226,8 +226,8 @@ namespace Actions { ApiTables.aftercalling(ris, checkPending, 'categories') } - async function deleteItem(context, { cat, idobj }) { - console.log('deleteItem: KEY = ', idobj) + async function deleteItemtodo(context, { cat, idobj }) { + console.log('deleteItemtodo: KEY = ', idobj) const myarr = gettodosByCategory(cat) @@ -354,7 +354,7 @@ namespace Actions { export const actions = { dbLoad: b.dispatch(dbLoad), swapElems: b.dispatch(swapElems), - deleteItem: b.dispatch(deleteItem), + deleteItemtodo: b.dispatch(deleteItemtodo), dbInsert: b.dispatch(dbInsert), modify: b.dispatch(modify) } diff --git a/src/store/Modules/UserStore.ts b/src/store/Modules/UserStore.ts index 803feb9..e8f27df 100644 --- a/src/store/Modules/UserStore.ts +++ b/src/store/Modules/UserStore.ts @@ -235,7 +235,7 @@ namespace Actions { }) .catch((error: Types.AxiosError) => { 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 } }).catch((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 } }).catch((error) => { UserStore.mutations.setErrorCatch(error) - return UserStore.getters.getServerCode() + return UserStore.getters.getServerCode }) } @@ -348,7 +348,7 @@ namespace Actions { }) .catch((error) => { UserStore.mutations.setErrorCatch(error) - return UserStore.getters.getServerCode() + return UserStore.getters.getServerCode }) }) } @@ -456,7 +456,7 @@ namespace Actions { }) .catch((error) => { UserStore.mutations.setErrorCatch(error) - return UserStore.getters.getServerCode() + return UserStore.getters.getServerCode }) } @@ -484,7 +484,7 @@ namespace Actions { Mutations.mutations.clearAuthData() }).catch((error) => { UserStore.mutations.setErrorCatch(error) - return UserStore.getters.getServerCode() + return UserStore.getters.getServerCode }) return riscall diff --git a/src/store/Modules/tools.ts b/src/store/Modules/tools.ts index 833697d..ea6da32 100644 --- a/src/store/Modules/tools.ts +++ b/src/store/Modules/tools.ts @@ -1,7 +1,7 @@ import { Todos, Projects, UserStore } from '@store' import globalroutines from './../../globalroutines/index' import { costanti } from './costanti' -import Quasar from 'quasar' +import Quasar, { date } from 'quasar' import { IProject, ITodo } from '@src/model' import * as ApiTables from '@src/store/Modules/ApiTables' @@ -21,6 +21,8 @@ export const tools = { DUPLICATE_EMAIL_ID: 11000, DUPLICATE_USERNAME_ID: 11100, + NUMSEC_CHECKUPDATE: 20000, + FIRST_PROJ: '__PROJECTS', arrLangUsed: ['enUs', 'it', 'es'], @@ -46,6 +48,12 @@ export const tools = { PRIORITY_LOW: 0 }, + Status: { + NONE: 0, + OPENED: 1, + COMPLETED: 10, + }, + MenuAction: { DELETE: 100, TOGGLE_EXPIRING: 101, @@ -53,7 +61,8 @@ export const tools = { PROGRESS_BAR: 120, PRIORITY: 130, SHOW_TASK: 150, - EDIT: 160 + EDIT: 160, + ADD_PROJECT: 200 }, selectPriority: { @@ -350,6 +359,12 @@ export const tools = { menuPopupConfigProject: { it: [ + { + id: 5, + label: 'Nuovo Progetto', + value: 200, // ADD_PROJECT + icon: 'next_week' + }, { id: 10, label: 'Mostra Task', @@ -358,6 +373,12 @@ export const tools = { } ], es: [ + { + id: 5, + label: 'Nuevo Projecto', + value: 200, // ADD_PROJECT + icon: 'next_week' + }, { id: 10, label: 'Mostrar Tareas', @@ -366,6 +387,12 @@ export const tools = { } ], enUs: [ + { + id: 5, + label: 'New Project', + value: 200, // ADD_PROJECT + icon: 'next_week' + }, { id: 10, label: 'Show Task', @@ -555,7 +582,7 @@ export const tools = { // tools.notifyarraychanged(myarr) // myarr[indelemchange].modified = true // 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 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) { const module = tools.getModulesByTable(nametable) const arr = module.getters.items_dacompletare(cat) @@ -937,6 +978,11 @@ export const tools = { } else { return 'red' } - } + }, + + getstrDate(mytimestamp) { + return date.formatDate(mytimestamp, 'DD-MM-YY') + }, + } diff --git a/src/typings/libs/vuelidate.d.ts b/src/typings/libs/vuelidate.d.ts index 35899a3..1ce6134 100644 --- a/src/typings/libs/vuelidate.d.ts +++ b/src/typings/libs/vuelidate.d.ts @@ -85,7 +85,7 @@ declare module 'vuelidate' { */ 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 /** @@ -155,7 +155,7 @@ declare module 'vuelidate' { /** * 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 - * + * * @example * export class Foo implements IVuelidate { * data() { @@ -231,7 +231,7 @@ declare module 'vuelidate/lib/validators' { */ 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 /** @@ -247,4 +247,4 @@ declare module 'vuelidate/lib/validators' { function minValue(value: number) function maxValue(value: number) -} \ No newline at end of file +} diff --git a/src/views/categories/category/category.vue b/src/views/categories/category/category.vue index f83eff8..af3599a 100644 --- a/src/views/categories/category/category.vue +++ b/src/views/categories/category/category.vue @@ -21,10 +21,10 @@ - {{ props.row.name }} - + {{ props.row.nametranslate }} + - + diff --git a/src/views/categories/tabledata/tabledata.vue b/src/views/categories/tabledata/tabledata.vue index 3c79231..aea7ad9 100644 --- a/src/views/categories/tabledata/tabledata.vue +++ b/src/views/categories/tabledata/tabledata.vue @@ -21,10 +21,10 @@ - {{ props.row.name }} - + {{ props.row.nametranslate }} + - + diff --git a/src/views/projects/proj-list/proj-list.scss b/src/views/projects/proj-list/proj-list.scss index 4074702..b93a31f 100644 --- a/src/views/projects/proj-list/proj-list.scss +++ b/src/views/projects/proj-list/proj-list.scss @@ -90,6 +90,12 @@ flex: 1; } +.itemdata{ + font-size: 1rem; + flex: 1; + padding: 4px; +} + .progress-item { margin: 1px; padding: 2px; diff --git a/src/views/projects/proj-list/proj-list.ts b/src/views/projects/proj-list/proj-list.ts index d9e384d..21a199b 100644 --- a/src/views/projects/proj-list/proj-list.ts +++ b/src/views/projects/proj-list/proj-list.ts @@ -48,7 +48,7 @@ export default class ProjList extends Vue { public percProgress: string = 'percProgress' public $refs: { - single: SingleProject[] + singleproject: SingleProject[] } get getrouteup() { @@ -102,15 +102,11 @@ export default class ProjList extends Vue { this.updateclasses() } - public getmyid(id) { - return 'row' + id - } - public showTask(field_value) { return field_value === tools.MenuAction.SHOW_TASK } - public async onEnd2(itemdragend) { + public async onEndproj(itemdragend) { await Projects.actions.swapElems(itemdragend) } @@ -130,7 +126,7 @@ export default class ProjList extends Vue { } // console.log('args', args, itemdragend) - this.onEnd2(itemdragend) + this.onEndproj(itemdragend) }) $service.eventBus.$on('drag', (el, source) => { @@ -178,37 +174,60 @@ export default class ProjList extends Vue { public checkUpdate_everytime() { this.polling = setInterval(() => { this.checkUpdate() - }, 60000) + }, tools.NUMSEC_CHECKUPDATE) } public beforeDestroy() { clearInterval(this.polling) } - public mydeleteItem(idobj: string) { - // console.log('mydeleteItem', idobj) + public mydeleteitemproj(idobj: string) { + // console.log('mydeleteitemtodo', idobj) return Projects.actions.deleteItem({ idobj }) } - public dbInsert(atfirst: boolean = false) { - let descr = this.projbottom.trim() + public dbInsert() { + const descr = this.projbottom.trim() - if (descr === '') { - return + this.projbottom = '' + + 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)) { return } - const myobj: IProject = { - descr, - id_parent: this.idProjAtt - } - - this.projbottom = '' - - return Projects.actions.dbInsert({ myobj, atfirst }) + return await Projects.actions.dbInsert({ myobj, atfirst: false }) } public setidsel(id: string) { @@ -216,8 +235,8 @@ export default class ProjList extends Vue { this.itemsel = Projects.getters.getRecordById(this.idsel) } - public async updateitem({ myitem, field }) { - console.log('calling MODIFY updateitem', myitem, field) + public async updateitemproj({ myitem, field }) { + console.log('calling MODIFY updateitemproj', myitem, field) const itemdragend: IDrag = { id_proj: this.idProjAtt, @@ -232,12 +251,12 @@ export default class ProjList extends Vue { } - public deselectAllRows(item: IProject, check, onlythis: boolean = false) { - // console.log('deselectAllRows : ', item) + public deselectAllRowsproj(item: IProject, check, onlythis: boolean = false) { + // 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 const id = contr.itemproject._id // Don't deselect the actual clicked! @@ -271,6 +290,8 @@ export default class ProjList extends Vue { } get getCalcHoursWorked() { + if (this.itemsel.hoursplanned <= 0) + return 0 let myperc = Math.round(this.itemsel.hoursworked / this.itemsel.hoursplanned * 100) return myperc diff --git a/src/views/projects/proj-list/proj-list.vue b/src/views/projects/proj-list/proj-list.vue index f7f608a..e525d4b 100644 --- a/src/views/projects/proj-list/proj-list.vue +++ b/src/views/projects/proj-list/proj-list.vue @@ -21,22 +21,20 @@ icon="settings"> - - - - +
+ + + + - {{field.label}} - - + {{field.label}} - + @@ -45,8 +43,7 @@ :key="opt.value" @click="showtype = opt.value"> - @@ -58,8 +55,17 @@ - - + + + + + + + + {{field.label}} + +
@@ -71,15 +77,17 @@
-
- + @deselectAllRowsproj="deselectAllRowsproj" @onEnd="onEndproj" + :itemproject='myproj'> + +
@@ -91,7 +99,9 @@ color="blue-12" :label="$t('todo.insertbottom')" :after="[{icon: 'arrow_forward', content: true, handler () {}}]" - v-on:keyup.enter="dbInsert(false)"/> + v-on:keyup.enter="dbInsert()"> + +
@@ -135,7 +145,7 @@
-
+
- + +
+
+
+
+
+ + + + + + + + +
+
+
+ + + + + + + +
diff --git a/src/views/todo/todo.ts b/src/views/todo/todo.ts index 750190a..342f8fa 100644 --- a/src/views/todo/todo.ts +++ b/src/views/todo/todo.ts @@ -81,15 +81,11 @@ export default class Todo extends Vue { this.categoryAtt = this.$route.params.category } - public getmyid(id) { - return 'row' + id - } - public showTask(field_value) { return field_value === tools.MenuAction.SHOW_TASK } - public async onEnd(itemdragend) { + public async onEndtodo(itemdragend) { await Todos.actions.swapElems(itemdragend) } @@ -105,7 +101,7 @@ export default class Todo extends Vue { oldIndex: this.getElementOldIndex(args.el) } - this.onEnd(itemdragend) + this.onEndtodo(itemdragend) }) $service.eventBus.$on('drag', (el, source) => { @@ -138,19 +134,19 @@ export default class Todo extends Vue { public checkUpdate_everytime() { this.polling = setInterval(() => { this.checkUpdate() - }, 60000) + }, tools.NUMSEC_CHECKUPDATE) } public beforeDestroy() { clearInterval(this.polling) } - public mydeleteItem(idobj: string) { - // console.log('mydeleteItem', idobj) - return Todos.actions.deleteItem({ cat: this.categoryAtt, idobj }) + public mydeleteitemtodo(idobj: string) { + // console.log('mydeleteitemtodo', 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() if (atfirst) { descr = this.todotop.trim() @@ -177,11 +173,11 @@ export default class Todo extends Vue { this.todobottom = '' } - return Todos.actions.dbInsert({ myobj, atfirst }) + return await Todos.actions.dbInsert({ myobj, atfirst }) } - public async updateitem({ myitem, field }) { - console.log('calling MODIFY updateitem', myitem, field) + public async updateitemtodo({ myitem, field }) { + console.log('calling MODIFY updateitemtodo', myitem, field) const itemdragend: IDrag = { category: this.categoryAtt, @@ -197,8 +193,8 @@ export default class Todo extends Vue { } - public deselectAllRows(item: ITodo, check, onlythis: boolean = false) { - // console.log('deselectAllRows : ', item) + public deselectAllRowstodo(item: ITodo, check, onlythis: boolean = false) { + // console.log('deselectAllRowstodo : ', item) for (let i = 0; i < this.$refs.single.length; i++) { diff --git a/src/views/todo/todo.vue b/src/views/todo/todo.vue index d60f2a4..0450d69 100644 --- a/src/views/todo/todo.vue +++ b/src/views/todo/todo.vue @@ -65,21 +65,21 @@
-
-
- - + -
{{ prior = mytodo.priority, priorcomplet = mytodo.completed }} +
{{ prior = mytodo.priority, priorcomplet = (mytodo.status === tools.Status.COMPLETED) }}
@@ -91,17 +91,17 @@
-
- - + -
{{ prior = mytodo.priority, priorcomplet = mytodo.completed }} +
{{ prior = mytodo.priority, priorcomplet = (mytodo.status === tools.Status.COMPLETED) }}
diff --git a/tslint.json b/tslint.json index 9e21ce7..7f00ba3 100644 --- a/tslint.json +++ b/tslint.json @@ -10,7 +10,7 @@ // "no-restricted-syntax": [ // "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" // } // ],