-
- {{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">
-
-
-
-
+