- add fields: typeproj and id_main_project
This commit is contained in:
@@ -77,6 +77,12 @@ export default class SingleProject extends Vue {
|
|||||||
@Watch('itemproject.actualphase') public valueChangedactualphase() {
|
@Watch('itemproject.actualphase') public valueChangedactualphase() {
|
||||||
this.watchupdate('actualphase')
|
this.watchupdate('actualphase')
|
||||||
}
|
}
|
||||||
|
@Watch('itemproject.privacyread') public valueChanged_privacyread() {
|
||||||
|
this.watchupdate('privacyread')
|
||||||
|
}
|
||||||
|
@Watch('itemproject.privacywrite') public valueChanged_privacywrite() {
|
||||||
|
this.watchupdate('privacywrite')
|
||||||
|
}
|
||||||
@Watch('itemproject.totalphases') public valueChangedtotalphases() {
|
@Watch('itemproject.totalphases') public valueChangedtotalphases() {
|
||||||
this.watchupdate('totalphases')
|
this.watchupdate('totalphases')
|
||||||
}
|
}
|
||||||
@@ -88,8 +94,15 @@ export default class SingleProject extends Vue {
|
|||||||
this.watchupdate('progressCalc')
|
this.watchupdate('progressCalc')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get isMainProject() {
|
||||||
|
return tools.isMainProject(this.itemproject.id_parent)
|
||||||
|
}
|
||||||
|
|
||||||
get getlabeltext() {
|
get getlabeltext() {
|
||||||
|
if (this.isMainProject)
|
||||||
return this.$t('proj.newproj')
|
return this.$t('proj.newproj')
|
||||||
|
else
|
||||||
|
return this.$t('proj.newsubproj')
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -6,6 +6,8 @@ export interface IProject {
|
|||||||
_id?: any,
|
_id?: any,
|
||||||
userId?: string
|
userId?: string
|
||||||
category?: string
|
category?: string
|
||||||
|
typeproj?: number
|
||||||
|
id_main_project?: string
|
||||||
id_parent?: string
|
id_parent?: string
|
||||||
descr?: string
|
descr?: string
|
||||||
longdescr?: string
|
longdescr?: string
|
||||||
@@ -31,6 +33,8 @@ export interface IProject {
|
|||||||
begin_test?: Date
|
begin_test?: Date
|
||||||
totalphases?: number
|
totalphases?: number
|
||||||
actualphase?: number
|
actualphase?: number
|
||||||
|
privacyread?: string
|
||||||
|
privacywrite?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface IProjectsState {
|
export interface IProjectsState {
|
||||||
@@ -39,3 +43,15 @@ export interface IProjectsState {
|
|||||||
insidePending: boolean
|
insidePending: boolean
|
||||||
visuLastCompleted: number
|
visuLastCompleted: number
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const Privacy = {
|
||||||
|
all: 'all',
|
||||||
|
friends: 'friends',
|
||||||
|
mygroup: 'mygroup',
|
||||||
|
onlyme: 'onlyme'
|
||||||
|
}
|
||||||
|
|
||||||
|
export const TypeProj = {
|
||||||
|
TYPE_PROJECT: 1,
|
||||||
|
TYPE_SUBDIR: 2
|
||||||
|
}
|
||||||
|
|||||||
@@ -242,6 +242,7 @@ const messages = {
|
|||||||
connection: 'Connessione',
|
connection: 'Connessione',
|
||||||
proj: {
|
proj: {
|
||||||
newproj: 'Titolo Progetto',
|
newproj: 'Titolo Progetto',
|
||||||
|
newsubproj: 'Titolo Sotto-Progetto',
|
||||||
longdescr: 'Descrizione',
|
longdescr: 'Descrizione',
|
||||||
hoursplanned: 'Ore Preventivate',
|
hoursplanned: 'Ore Preventivate',
|
||||||
hoursadded: 'Ore Aggiuntive',
|
hoursadded: 'Ore Aggiuntive',
|
||||||
@@ -252,6 +253,8 @@ const messages = {
|
|||||||
actualphase: 'Fase Attuale',
|
actualphase: 'Fase Attuale',
|
||||||
hoursweeky_plannedtowork: 'Ore settimanali previste',
|
hoursweeky_plannedtowork: 'Ore settimanali previste',
|
||||||
endwork_estimate: 'Data fine lavori stimata',
|
endwork_estimate: 'Data fine lavori stimata',
|
||||||
|
privacyread:'Chi lo puo vedere:',
|
||||||
|
privacywrite:'Chi lo puo modificare:',
|
||||||
totalphases: 'Totale Fasi'
|
totalphases: 'Totale Fasi'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -492,6 +495,7 @@ const messages = {
|
|||||||
connection: 'Connection',
|
connection: 'Connection',
|
||||||
proj: {
|
proj: {
|
||||||
newproj: 'Título Projecto',
|
newproj: 'Título Projecto',
|
||||||
|
newsubproj: 'Título Sub-Projecto',
|
||||||
longdescr: 'Descripción',
|
longdescr: 'Descripción',
|
||||||
hoursplanned: 'Horas Estimadas',
|
hoursplanned: 'Horas Estimadas',
|
||||||
hoursadded: 'Horas Adicional',
|
hoursadded: 'Horas Adicional',
|
||||||
@@ -502,6 +506,8 @@ const messages = {
|
|||||||
actualphase: 'Fase Actual',
|
actualphase: 'Fase Actual',
|
||||||
hoursweeky_plannedtowork: 'Horarios semanales programados',
|
hoursweeky_plannedtowork: 'Horarios semanales programados',
|
||||||
endwork_estimate: 'Fecha estimada de finalización',
|
endwork_estimate: 'Fecha estimada de finalización',
|
||||||
|
privacyread:'Quien puede verlo:',
|
||||||
|
privacywrite:'Quien puede modificarlo:',
|
||||||
totalphases: 'Fases totales'
|
totalphases: 'Fases totales'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -742,6 +748,7 @@ const messages = {
|
|||||||
connection: 'Conexión',
|
connection: 'Conexión',
|
||||||
proj: {
|
proj: {
|
||||||
newproj: 'Project Title',
|
newproj: 'Project Title',
|
||||||
|
newsubproj: 'SubProject Title',
|
||||||
longdescr: 'Description',
|
longdescr: 'Description',
|
||||||
hoursplanned: 'Estimated Hours',
|
hoursplanned: 'Estimated Hours',
|
||||||
hoursadded: 'Additional Hours',
|
hoursadded: 'Additional Hours',
|
||||||
@@ -752,6 +759,8 @@ const messages = {
|
|||||||
actualphase: 'Actual Phase',
|
actualphase: 'Actual Phase',
|
||||||
hoursweeky_plannedtowork: 'Scheduled weekly hours',
|
hoursweeky_plannedtowork: 'Scheduled weekly hours',
|
||||||
endwork_estimate: 'Estimated completion date',
|
endwork_estimate: 'Estimated completion date',
|
||||||
|
privacyread:'Who can see it:',
|
||||||
|
privacywrite:'Who can modify if:',
|
||||||
totalphases: 'Total Phase'
|
totalphases: 'Total Phase'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -156,12 +156,19 @@ export namespace ApiTool {
|
|||||||
// console.log('A1) INIZIO.............................................................')
|
// console.log('A1) INIZIO.............................................................')
|
||||||
return globalroutines(null, 'readall', tablesync, null)
|
return globalroutines(null, 'readall', tablesync, null)
|
||||||
.then((alldata) => {
|
.then((alldata) => {
|
||||||
const myrecs = [...alldata]
|
|
||||||
|
let myrecs
|
||||||
|
|
||||||
|
if (alldata === undefined) {
|
||||||
|
console.log('alldata NON DEFINITA')
|
||||||
|
return true
|
||||||
|
} else {
|
||||||
|
myrecs = [...alldata]
|
||||||
|
}
|
||||||
|
|
||||||
const promises = myrecs.map((rec) => {
|
const promises = myrecs.map((rec) => {
|
||||||
let link = '/' + ApiTables.getLinkByTableName(nametab)
|
let link = '/' + ApiTables.getLinkByTableName(nametab)
|
||||||
|
|
||||||
|
|
||||||
if (method !== 'POST') {
|
if (method !== 'POST') {
|
||||||
link += '/' + rec._id
|
link += '/' + rec._id
|
||||||
}
|
}
|
||||||
@@ -195,11 +202,11 @@ export namespace ApiTool {
|
|||||||
return (errorfromserver && !lettoqualcosa)
|
return (errorfromserver && !lettoqualcosa)
|
||||||
})
|
})
|
||||||
|
|
||||||
}).catch((e) => {
|
}).catch((error) => {
|
||||||
|
console.log('¨¨¨¨¨¨¨¨¨¨¨¨¨¨ errorfromserver:', errorfromserver, error)
|
||||||
return (errorfromserver && !lettoqualcosa)
|
return (errorfromserver && !lettoqualcosa)
|
||||||
})
|
})
|
||||||
.then((error) => {
|
.then((error) => {
|
||||||
console.log('¨¨¨¨¨¨¨¨¨¨¨¨¨¨ errorfromserver:', errorfromserver, error)
|
|
||||||
const mystate = (error || errorfromserver) ? 'offline' : 'online'
|
const mystate = (error || errorfromserver) ? 'offline' : 'online'
|
||||||
GlobalStore.mutations.setStateConnection(mystate)
|
GlobalStore.mutations.setStateConnection(mystate)
|
||||||
GlobalStore.mutations.saveConfig( { _id: costanti.CONFIG_ID_STATE_CONN, value: mystate })
|
GlobalStore.mutations.saveConfig( { _id: costanti.CONFIG_ID_STATE_CONN, value: mystate })
|
||||||
|
|||||||
@@ -20,7 +20,10 @@ const stateglob: IProjectsState = {
|
|||||||
visuLastCompleted: 10
|
visuLastCompleted: 10
|
||||||
}
|
}
|
||||||
|
|
||||||
const listFieldsToChange: string [] = ['descr', 'longdescr', 'hoursplanned', 'hoursworked', 'id_parent', 'statusproj', 'category', 'expiring_at', 'priority', 'id_prev', 'pos', 'enableExpiring', 'progressCalc', 'live_url', 'test_url', 'begin_development', 'begin_test', 'actualphase', 'totalphases', 'hoursweeky_plannedtowork', 'endwork_estimate']
|
const listFieldsToChange: string [] = ['descr', 'longdescr', 'hoursplanned', 'hoursworked', 'id_parent', 'statusproj',
|
||||||
|
'category', 'expiring_at', 'priority', 'id_prev', 'pos', 'enableExpiring', 'progressCalc', 'live_url', 'test_url',
|
||||||
|
'begin_development', 'begin_test', 'actualphase', 'totalphases', 'hoursweeky_plannedtowork', 'endwork_estimate',
|
||||||
|
'privacyread', 'privacywrite', 'id_main_project', 'typeproj']
|
||||||
|
|
||||||
const listFieldsUpdateCalculation: string [] = ['hoursplanned', 'hoursworked', 'progressCalc', 'endwork_estimate']
|
const listFieldsUpdateCalculation: string [] = ['hoursplanned', 'hoursworked', 'progressCalc', 'endwork_estimate']
|
||||||
|
|
||||||
@@ -43,8 +46,8 @@ function initcat() {
|
|||||||
|
|
||||||
function updateDataCalculated(projout, projin) {
|
function updateDataCalculated(projout, projin) {
|
||||||
listFieldsUpdateCalculation.forEach((field) => {
|
listFieldsUpdateCalculation.forEach((field) => {
|
||||||
projout[field] = projin[field];
|
projout[field] = projin[field]
|
||||||
});
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace Getters {
|
namespace Getters {
|
||||||
@@ -56,7 +59,9 @@ namespace Getters {
|
|||||||
_id: objectId(),
|
_id: objectId(),
|
||||||
descr: '',
|
descr: '',
|
||||||
longdescr: '',
|
longdescr: '',
|
||||||
|
typeproj: 0,
|
||||||
id_parent: '',
|
id_parent: '',
|
||||||
|
id_main_project: '',
|
||||||
priority: tools.Priority.PRIORITY_NORMAL,
|
priority: tools.Priority.PRIORITY_NORMAL,
|
||||||
statusproj: tools.Status.OPENED,
|
statusproj: tools.Status.OPENED,
|
||||||
created_at: tools.getDateNow(),
|
created_at: tools.getDateNow(),
|
||||||
@@ -75,6 +80,8 @@ namespace Getters {
|
|||||||
hoursworked: 0,
|
hoursworked: 0,
|
||||||
hoursplanned: 0,
|
hoursplanned: 0,
|
||||||
progressCalc: 0,
|
progressCalc: 0,
|
||||||
|
privacyread: '',
|
||||||
|
privacywrite: '',
|
||||||
begin_development: tools.getDateNull(),
|
begin_development: tools.getDateNull(),
|
||||||
begin_test: tools.getDateNull(),
|
begin_test: tools.getDateNull(),
|
||||||
hoursweeky_plannedtowork: 0,
|
hoursweeky_plannedtowork: 0,
|
||||||
@@ -95,12 +102,13 @@ namespace Getters {
|
|||||||
|
|
||||||
const listaprojects = b.read((state: IProjectsState) => (): IMenuList[] => {
|
const listaprojects = b.read((state: IProjectsState) => (): IMenuList[] => {
|
||||||
if (state.projects) {
|
if (state.projects) {
|
||||||
// console.log('state.projects', state.projects)
|
console.log('state.projects', state.projects)
|
||||||
const listaproj = tools.mapSort(state.projects.filter((proj) => proj.id_parent === process.env.PROJECT_ID_MAIN))
|
const listaproj = tools.mapSort(state.projects.filter((proj) => proj.id_parent === process.env.PROJECT_ID_MAIN))
|
||||||
const myarr: IMenuList[] = []
|
const myarr: IMenuList[] = []
|
||||||
for (const proj of listaproj) {
|
for (const proj of listaproj) {
|
||||||
myarr.push({ nametranslate: '', description: proj.descr, idelem: proj._id })
|
myarr.push({ nametranslate: '', description: proj.descr, idelem: proj._id })
|
||||||
}
|
}
|
||||||
|
console.log(' myarr', myarr, listaproj)
|
||||||
return myarr
|
return myarr
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
@@ -120,17 +128,6 @@ namespace Getters {
|
|||||||
return ''
|
return ''
|
||||||
}, 'getDescrById')
|
}, 'getDescrById')
|
||||||
|
|
||||||
const getParentById = b.read((state: IProjectsState) => (id: string): string => {
|
|
||||||
if (state.projects) {
|
|
||||||
const itemfound = state.projects.find((item) => item._id === id)
|
|
||||||
if (!!itemfound) {
|
|
||||||
return itemfound.id_parent
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return ''
|
|
||||||
}, 'getParentById')
|
|
||||||
|
|
||||||
const getRecordById = b.read((state: IProjectsState) => (id: string): IProject => {
|
const getRecordById = b.read((state: IProjectsState) => (id: string): IProject => {
|
||||||
if (state.projects) {
|
if (state.projects) {
|
||||||
return state.projects.find((item) => item._id === id)
|
return state.projects.find((item) => item._id === id)
|
||||||
@@ -151,13 +148,9 @@ namespace Getters {
|
|||||||
get getDescrById() {
|
get getDescrById() {
|
||||||
return getDescrById()
|
return getDescrById()
|
||||||
},
|
},
|
||||||
get getParentById() {
|
|
||||||
return getParentById()
|
|
||||||
},
|
|
||||||
get getRecordById() {
|
get getRecordById() {
|
||||||
return getRecordById()
|
return getRecordById()
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -282,6 +275,8 @@ namespace Actions {
|
|||||||
objproj.descr = myobj.descr
|
objproj.descr = myobj.descr
|
||||||
objproj.category = myobj.category
|
objproj.category = myobj.category
|
||||||
objproj.id_parent = myobj.id_parent
|
objproj.id_parent = myobj.id_parent
|
||||||
|
objproj.id_main_project = myobj.id_main_project
|
||||||
|
objproj.typeproj = myobj.typeproj
|
||||||
|
|
||||||
let elemtochange: IProject = null
|
let elemtochange: IProject = null
|
||||||
|
|
||||||
|
|||||||
@@ -67,6 +67,18 @@ namespace Getters {
|
|||||||
return state.servercode
|
return state.servercode
|
||||||
}, 'getServerCode')
|
}, 'getServerCode')
|
||||||
|
|
||||||
|
const IsMyFriend = b.read((state) => (userIdOwner) => {
|
||||||
|
// ++TODO Check if userIdOwner is my friend
|
||||||
|
// userIdOwner is my friend ?
|
||||||
|
return true
|
||||||
|
}, 'IsMyFriend')
|
||||||
|
|
||||||
|
const IsMyGroup = b.read((state) => (userIdOwner) => {
|
||||||
|
// ++TODO Check if userIdOwner is on my groups
|
||||||
|
// userIdOwner is on my groups ?
|
||||||
|
return true
|
||||||
|
}, 'IsMyGroup')
|
||||||
|
|
||||||
export const getters = {
|
export const getters = {
|
||||||
get lang() {
|
get lang() {
|
||||||
return lang()
|
return lang()
|
||||||
@@ -80,6 +92,12 @@ namespace Getters {
|
|||||||
get getServerCode() {
|
get getServerCode() {
|
||||||
return getServerCode()
|
return getServerCode()
|
||||||
},
|
},
|
||||||
|
get IsMyFriend() {
|
||||||
|
return IsMyFriend()
|
||||||
|
},
|
||||||
|
get IsMyGroup() {
|
||||||
|
return IsMyGroup()
|
||||||
|
}
|
||||||
// get fullName() { return fullName();},
|
// get fullName() { return fullName();},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import globalroutines from './../../globalroutines/index'
|
|||||||
import { costanti } from './costanti'
|
import { costanti } from './costanti'
|
||||||
import { translation } from './translation'
|
import { translation } from './translation'
|
||||||
import Quasar, { date } from 'quasar'
|
import Quasar, { date } from 'quasar'
|
||||||
import { IProject, ITodo } from '@src/model'
|
import { IProject, ITodo, Privacy } from '@src/model'
|
||||||
import * as ApiTables from '@src/store/Modules/ApiTables'
|
import * as ApiTables from '@src/store/Modules/ApiTables'
|
||||||
import translate from '@src/globalroutines/util'
|
import translate from '@src/globalroutines/util'
|
||||||
|
|
||||||
@@ -136,8 +136,77 @@ export const tools = {
|
|||||||
value: 3
|
value: 3
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
|
selectPrivacy: {
|
||||||
|
it: [
|
||||||
|
{
|
||||||
|
id: 1,
|
||||||
|
label: translation.it.privacy.all,
|
||||||
|
value: Privacy.all
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 2,
|
||||||
|
label: translation.it.privacy.friends,
|
||||||
|
value: Privacy.friends
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 3,
|
||||||
|
label: translation.it.privacy.mygroup,
|
||||||
|
value: Privacy.mygroup
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 4,
|
||||||
|
label: translation.it.privacy.onlyme,
|
||||||
|
value: Privacy.onlyme
|
||||||
|
}
|
||||||
|
],
|
||||||
|
es: [
|
||||||
|
{
|
||||||
|
id: 1,
|
||||||
|
label: translation.es.privacy.all,
|
||||||
|
value: Privacy.all
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 2,
|
||||||
|
label: translation.es.privacy.friends,
|
||||||
|
value: Privacy.friends
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 3,
|
||||||
|
label: translation.es.privacy.mygroup,
|
||||||
|
value: Privacy.mygroup
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 4,
|
||||||
|
label: translation.es.privacy.onlyme,
|
||||||
|
value: Privacy.onlyme
|
||||||
|
}
|
||||||
|
],
|
||||||
|
enUs: [
|
||||||
|
{
|
||||||
|
id: 1,
|
||||||
|
label: translation.enUs.privacy.all,
|
||||||
|
value: Privacy.all
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 2,
|
||||||
|
label: translation.enUs.privacy.friends,
|
||||||
|
value: Privacy.friends
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 3,
|
||||||
|
label: translation.enUs.privacy.mygroup,
|
||||||
|
value: Privacy.mygroup
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 4,
|
||||||
|
label: translation.enUs.privacy.onlyme,
|
||||||
|
value: Privacy.onlyme
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
|
||||||
selectStatus: {
|
selectStatus: {
|
||||||
it: [
|
it: [
|
||||||
{
|
{
|
||||||
@@ -514,13 +583,13 @@ export const tools = {
|
|||||||
it: [
|
it: [
|
||||||
{
|
{
|
||||||
id: 5,
|
id: 5,
|
||||||
label: 'Nuovo Progetto',
|
label: translation.it.proj.newsubproj,
|
||||||
value: 200, // ADD_PROJECT
|
value: 200, // ADD_PROJECT
|
||||||
icon: 'next_week'
|
icon: 'next_week'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 10,
|
id: 10,
|
||||||
label: 'Mostra Task',
|
label: translation.it.task.showtask,
|
||||||
value: 150, // SHOW_TASK
|
value: 150, // SHOW_TASK
|
||||||
icon: 'rowing'
|
icon: 'rowing'
|
||||||
}
|
}
|
||||||
@@ -529,13 +598,13 @@ export const tools = {
|
|||||||
[
|
[
|
||||||
{
|
{
|
||||||
id: 5,
|
id: 5,
|
||||||
label: 'Nuevo Projecto',
|
label: translation.es.proj.newsubproj,
|
||||||
value: 200, // ADD_PROJECT
|
value: 200, // ADD_PROJECT
|
||||||
icon: 'next_week'
|
icon: 'next_week'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 10,
|
id: 10,
|
||||||
label: 'Mostrar Tareas',
|
label: translation.es.task.showtask,
|
||||||
value: 150,
|
value: 150,
|
||||||
icon: 'rowing'
|
icon: 'rowing'
|
||||||
}
|
}
|
||||||
@@ -544,19 +613,47 @@ export const tools = {
|
|||||||
[
|
[
|
||||||
{
|
{
|
||||||
id: 5,
|
id: 5,
|
||||||
label: 'New Project',
|
label: translation.it.proj.newsubproj,
|
||||||
value: 200, // ADD_PROJECT
|
value: 200, // ADD_PROJECT
|
||||||
icon: 'next_week'
|
icon: 'next_week'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 10,
|
id: 10,
|
||||||
label: 'Show Task',
|
label: translation.enUs.task.showtask,
|
||||||
value: 150,
|
value: 150,
|
||||||
icon: 'rowing'
|
icon: 'rowing'
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
|
||||||
|
menuPopupConfigMAINProject: {
|
||||||
|
it: [
|
||||||
|
{
|
||||||
|
id: 5,
|
||||||
|
label: translation.it.proj.newproj,
|
||||||
|
value: 200, // ADD_PROJECT
|
||||||
|
icon: 'next_week'
|
||||||
}
|
}
|
||||||
,
|
],
|
||||||
|
es:
|
||||||
|
[
|
||||||
|
{
|
||||||
|
id: 5,
|
||||||
|
label: translation.es.proj.newproj,
|
||||||
|
value: 200, // ADD_PROJECT
|
||||||
|
icon: 'next_week'
|
||||||
|
}
|
||||||
|
],
|
||||||
|
enUs:
|
||||||
|
[
|
||||||
|
{
|
||||||
|
id: 5,
|
||||||
|
label: translation.it.proj.newproj,
|
||||||
|
value: 200, // ADD_PROJECT
|
||||||
|
icon: 'next_week'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
|
||||||
listOptionShowTask: {
|
listOptionShowTask: {
|
||||||
it: [
|
it: [
|
||||||
@@ -1270,5 +1367,9 @@ export const tools = {
|
|||||||
return new Date().valueOf()
|
return new Date().valueOf()
|
||||||
},
|
},
|
||||||
|
|
||||||
|
isMainProject(idproj) {
|
||||||
|
return idproj === process.env.PROJECT_ID_MAIN
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,14 +1,53 @@
|
|||||||
export const translation = {
|
export const translation = {
|
||||||
it: {
|
it: {
|
||||||
fase: 'Fase',
|
fase: 'Fase',
|
||||||
|
privacy: {
|
||||||
|
all: 'Tutti',
|
||||||
|
friends: 'Amici',
|
||||||
|
mygroup: 'Gruppo',
|
||||||
|
onlyme: 'Solo io'
|
||||||
|
},
|
||||||
|
proj: {
|
||||||
|
newproj: 'Nuovo Progetto',
|
||||||
|
newsubproj: 'Nuovo Sotto-Progetto',
|
||||||
|
},
|
||||||
|
task: {
|
||||||
|
showtask: 'Mostra Task',
|
||||||
|
},
|
||||||
end: ''
|
end: ''
|
||||||
},
|
},
|
||||||
es: {
|
es: {
|
||||||
fase: 'Fase',
|
fase: 'Fase',
|
||||||
|
privacy: {
|
||||||
|
all: 'Todos',
|
||||||
|
friends: 'Amigos',
|
||||||
|
mygroup: 'Grupos',
|
||||||
|
onlyme: 'Solo yo'
|
||||||
|
},
|
||||||
|
proj: {
|
||||||
|
newproj: 'Nuevo Projecto',
|
||||||
|
newsubproj: 'Nuevo Sub-Projecto',
|
||||||
|
},
|
||||||
|
task: {
|
||||||
|
showtask: 'Mostrar Tarea',
|
||||||
|
},
|
||||||
end: ''
|
end: ''
|
||||||
},
|
},
|
||||||
enUs: {
|
enUs: {
|
||||||
fase: 'Phase',
|
fase: 'Phase',
|
||||||
|
privacy: {
|
||||||
|
all: 'All',
|
||||||
|
friends: 'Friends',
|
||||||
|
mygroup: 'Group',
|
||||||
|
onlyme: 'Only me'
|
||||||
|
},
|
||||||
|
proj: {
|
||||||
|
newproj: 'New Project',
|
||||||
|
newsubproj: 'New Sub-Project',
|
||||||
|
},
|
||||||
|
task: {
|
||||||
|
showtask: 'Show Task',
|
||||||
|
},
|
||||||
end: ''
|
end: ''
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import Vue from 'vue'
|
import Vue from 'vue'
|
||||||
import { Component, Watch } from 'vue-property-decorator'
|
import { Component, Watch } from 'vue-property-decorator'
|
||||||
|
|
||||||
import { IDrag, IProject, IProjectsState, ITodo } from '../../../model/index'
|
import { IDrag, IProject, IProjectsState, ITodo, Privacy, TypeProj } from '../../../model/index'
|
||||||
import { SingleProject } from '../../../components/projects/SingleProject/index'
|
import { SingleProject } from '../../../components/projects/SingleProject/index'
|
||||||
import { CTodo } from '../../../components/todos/CTodo'
|
import { CTodo } from '../../../components/todos/CTodo'
|
||||||
|
|
||||||
@@ -41,7 +41,6 @@ export default class ProjList extends Vue {
|
|||||||
public scrollable = true
|
public scrollable = true
|
||||||
public dragname: string = 'second'
|
public dragname: string = 'second'
|
||||||
public idProjAtt: string = process.env.PROJECT_ID_MAIN
|
public idProjAtt: string = process.env.PROJECT_ID_MAIN
|
||||||
public idProjParentAtt: string = ''
|
|
||||||
public splitterModel = 50 // start at 50%
|
public splitterModel = 50 // start at 50%
|
||||||
public itemproj: IProject = null
|
public itemproj: IProject = null
|
||||||
public idsel: string = ''
|
public idsel: string = ''
|
||||||
@@ -53,6 +52,7 @@ export default class ProjList extends Vue {
|
|||||||
|
|
||||||
public selectStatus: [] = tools.selectStatus[UserStore.state.lang]
|
public selectStatus: [] = tools.selectStatus[UserStore.state.lang]
|
||||||
public selectPhase: [] = tools.selectPhase[UserStore.state.lang]
|
public selectPhase: [] = tools.selectPhase[UserStore.state.lang]
|
||||||
|
public selectPrivacy: [] = tools.selectPrivacy[UserStore.state.lang]
|
||||||
|
|
||||||
public $refs: {
|
public $refs: {
|
||||||
singleproject: SingleProject[],
|
singleproject: SingleProject[],
|
||||||
@@ -64,13 +64,13 @@ export default class ProjList extends Vue {
|
|||||||
|
|
||||||
@Watch('items_dacompletare')
|
@Watch('items_dacompletare')
|
||||||
public changeitems() {
|
public changeitems() {
|
||||||
this.idProjParentAtt = Projects.getters.getParentById(this.idProjAtt)
|
this.updateindexProj()
|
||||||
}
|
}
|
||||||
|
|
||||||
@Watch('$route.params.idProj')
|
@Watch('$route.params.idProj')
|
||||||
public changeparent() {
|
public changeparent() {
|
||||||
this.idProjAtt = this.$route.params.idProj
|
this.idProjAtt = this.$route.params.idProj
|
||||||
this.idProjParentAtt = Projects.getters.getParentById(this.idProjAtt)
|
this.updateindexProj()
|
||||||
this.selproj()
|
this.selproj()
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -79,8 +79,31 @@ export default class ProjList extends Vue {
|
|||||||
this.updateclasses()
|
this.updateclasses()
|
||||||
}
|
}
|
||||||
|
|
||||||
get getidProjParentAtt() {
|
private updateindexProj() {
|
||||||
return this.idProjParentAtt
|
console.log('idProjAtt', this.idProjAtt)
|
||||||
|
this.itemproj = Projects.getters.getRecordById(this.idProjAtt)
|
||||||
|
console.log('this.itemproj', this.itemproj)
|
||||||
|
// console.log('idproj', this.idProjAtt, 'params' , this.$route.params)
|
||||||
|
}
|
||||||
|
|
||||||
|
get readonly_PanelPrivacy() {
|
||||||
|
return !this.CanIModifyPanelPrivacy
|
||||||
|
}
|
||||||
|
|
||||||
|
get CanISeeProject() {
|
||||||
|
|
||||||
|
if (UserStore.state.userId === this.itemselproj.userId) // If it's the owner
|
||||||
|
return true
|
||||||
|
|
||||||
|
return (this.itemselproj.privacyread === Privacy.all) ||
|
||||||
|
(this.itemselproj.privacyread === Privacy.friends) && (UserStore.getters.IsMyFriend(this.itemselproj.userId))
|
||||||
|
|| ((this.itemselproj.privacyread === Privacy.mygroup) && (UserStore.getters.IsMyGroup(this.itemselproj.userId)))
|
||||||
|
}
|
||||||
|
|
||||||
|
get CanIModifyPanelPrivacy() {
|
||||||
|
|
||||||
|
if (UserStore.state.userId === this.itemselproj.userId) // If it's the owner
|
||||||
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
// I use this because the statustodo will disappear from the UI, so it won't call the status changed...
|
// I use this because the statustodo will disappear from the UI, so it won't call the status changed...
|
||||||
@@ -91,7 +114,7 @@ export default class ProjList extends Vue {
|
|||||||
}
|
}
|
||||||
|
|
||||||
get getrouteup() {
|
get getrouteup() {
|
||||||
return '/projects/' + this.idProjParentAtt
|
return '/projects/' + this.itemproj.id_parent
|
||||||
}
|
}
|
||||||
|
|
||||||
public selproj() {
|
public selproj() {
|
||||||
@@ -113,7 +136,25 @@ export default class ProjList extends Vue {
|
|||||||
GlobalStore.mutations.setShowType(value)
|
GlobalStore.mutations.setShowType(value)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get isRootProject() {
|
||||||
|
return this.idProjAtt === process.env.PROJECT_ID_MAIN
|
||||||
|
}
|
||||||
|
|
||||||
|
get getIdParent() {
|
||||||
|
if (!!this.itemproj)
|
||||||
|
return this.itemproj.id_parent
|
||||||
|
else
|
||||||
|
return ''
|
||||||
|
}
|
||||||
|
|
||||||
|
get isMainProject() {
|
||||||
|
return tools.isMainProject(this.idProjAtt)
|
||||||
|
}
|
||||||
|
|
||||||
get menuPopupConfigProject() {
|
get menuPopupConfigProject() {
|
||||||
|
if (this.isMainProject)
|
||||||
|
return tools.menuPopupConfigMAINProject[UserStore.state.lang]
|
||||||
|
else
|
||||||
return tools.menuPopupConfigProject[UserStore.state.lang]
|
return tools.menuPopupConfigProject[UserStore.state.lang]
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -125,6 +166,70 @@ export default class ProjList extends Vue {
|
|||||||
return Projects.getters.getDescrById(this.idProjAtt)
|
return Projects.getters.getDescrById(this.idProjAtt)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get getCalcHoursWorked() {
|
||||||
|
|
||||||
|
if (this.itemselproj.hoursplanned <= 0) {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
return Math.round(this.itemselproj.hoursworked / this.itemselproj.hoursplanned * 100)
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
get calcprogressWeekly() {
|
||||||
|
|
||||||
|
if (this.itemselproj.hoursplanned <= 0) {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
return Math.round(this.itemselproj.hoursworked / this.itemselproj.hoursplanned * 100)
|
||||||
|
}
|
||||||
|
|
||||||
|
get calcEndWork_Estimate() {
|
||||||
|
if (date.isValid(this.itemselproj.begin_development) && (this.itemselproj.hoursweeky_plannedtowork > 0)) {
|
||||||
|
const hoursw = this.itemselproj.hoursweeky_plannedtowork
|
||||||
|
|
||||||
|
try {
|
||||||
|
|
||||||
|
let orerimaste = this.itemselproj.hoursplanned - this.itemselproj.hoursworked
|
||||||
|
if (orerimaste < 0) {
|
||||||
|
orerimaste = 0
|
||||||
|
}
|
||||||
|
|
||||||
|
const weeks = orerimaste / hoursw
|
||||||
|
const days = Math.round(weeks * 7)
|
||||||
|
|
||||||
|
let mydate = this.itemselproj.begin_development
|
||||||
|
const datenow = tools.getDateNow()
|
||||||
|
// if begin is in the past, take the day now
|
||||||
|
if (date.getDateDiff(mydate, datenow) < 0) {
|
||||||
|
mydate = datenow
|
||||||
|
}
|
||||||
|
console.log('mydate', mydate)
|
||||||
|
this.itemselproj.endwork_estimate = date.addToDate(mydate, { days })
|
||||||
|
|
||||||
|
console.log(' days', days, 'weeks', weeks, 'orerimaste', orerimaste, 'dateestimated', this.itemselproj.endwork_estimate)
|
||||||
|
|
||||||
|
return this.itemselproj.endwork_estimate
|
||||||
|
}catch (e) {
|
||||||
|
this.itemselproj.endwork_estimate = tools.getDateNull()
|
||||||
|
}
|
||||||
|
|
||||||
|
return tools.getDateNull()
|
||||||
|
|
||||||
|
} else {
|
||||||
|
return tools.getDateNull()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
get getCalcTodoHoursWorked() {
|
||||||
|
if (this.itemtodosel.hoursplanned <= 0) {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
const myperc = Math.round(this.itemtodosel.hoursworked / this.itemtodosel.hoursplanned * 100)
|
||||||
|
|
||||||
|
return myperc
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
public showTask(field_value) {
|
public showTask(field_value) {
|
||||||
return field_value === tools.MenuAction.SHOW_TASK
|
return field_value === tools.MenuAction.SHOW_TASK
|
||||||
}
|
}
|
||||||
@@ -172,9 +277,7 @@ export default class ProjList extends Vue {
|
|||||||
this.splitterModel = 50
|
this.splitterModel = 50
|
||||||
}
|
}
|
||||||
this.idProjAtt = this.$route.params.idProj
|
this.idProjAtt = this.$route.params.idProj
|
||||||
this.idProjParentAtt = Projects.getters.getParentById(this.idProjAtt)
|
this.updateindexProj()
|
||||||
|
|
||||||
console.log('this.idProjParentAtt', this.idProjParentAtt, 'idproj', this.idProjAtt, 'params' , this.$route.params)
|
|
||||||
|
|
||||||
tools.touchmove(this.scrollable)
|
tools.touchmove(this.scrollable)
|
||||||
}
|
}
|
||||||
@@ -183,12 +286,9 @@ export default class ProjList extends Vue {
|
|||||||
console.log('LOAD PROJECTS....')
|
console.log('LOAD PROJECTS....')
|
||||||
if (!!this.$route.params.idProj) {
|
if (!!this.$route.params.idProj) {
|
||||||
this.idProjAtt = this.$route.params.idProj
|
this.idProjAtt = this.$route.params.idProj
|
||||||
this.idProjParentAtt = Projects.getters.getParentById(this.idProjAtt)
|
this.updateindexProj()
|
||||||
this.itemproj = Projects.getters.getRecordById(this.idProjAtt)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// console.log('this.idProjAtt', this.idProjAtt, this.idProjParentAtt)
|
|
||||||
|
|
||||||
// Set last category selected
|
// Set last category selected
|
||||||
// localStorage.setItem(tools.localStorage.categorySel, this.categoryAtt)
|
// localStorage.setItem(tools.localStorage.categorySel, this.categoryAtt)
|
||||||
|
|
||||||
@@ -206,8 +306,8 @@ export default class ProjList extends Vue {
|
|||||||
clearInterval(this.polling)
|
clearInterval(this.polling)
|
||||||
}
|
}
|
||||||
|
|
||||||
public mydeleteitemproj(idobj: string) {
|
public static mydeleteitemproj(idobj: string) {
|
||||||
// console.log('mydeleteitemtodo', idobj)
|
console.log('mydeleteitemtodo', idobj)
|
||||||
return Projects.actions.deleteItem({ idobj })
|
return Projects.actions.deleteItem({ idobj })
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -249,6 +349,14 @@ export default class ProjList extends Vue {
|
|||||||
id_parent: this.idProjAtt
|
id_parent: this.idProjAtt
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (this.isRootProject) {
|
||||||
|
myobj.typeproj = TypeProj.TYPE_PROJECT
|
||||||
|
myobj.id_main_project = this.idProjAtt
|
||||||
|
} else {
|
||||||
|
myobj.typeproj = TypeProj.TYPE_SUBDIR
|
||||||
|
myobj.id_main_project = this.itemproj.id_main_project
|
||||||
|
}
|
||||||
|
|
||||||
if (!tools.checkIfUserExist(this)) {
|
if (!tools.checkIfUserExist(this)) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -340,54 +448,6 @@ export default class ProjList extends Vue {
|
|||||||
ApiTables.waitAndcheckPendingMsg()
|
ApiTables.waitAndcheckPendingMsg()
|
||||||
}
|
}
|
||||||
|
|
||||||
get getCalcHoursWorked() {
|
|
||||||
|
|
||||||
if (this.itemselproj.hoursplanned <= 0) {
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
return Math.round(this.itemselproj.hoursworked / this.itemselproj.hoursplanned * 100)
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
get calcprogressWeekly() {
|
|
||||||
|
|
||||||
if (this.itemselproj.hoursplanned <= 0) {
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
return Math.round(this.itemselproj.hoursworked / this.itemselproj.hoursplanned * 100)
|
|
||||||
}
|
|
||||||
|
|
||||||
get calcEndWork_Estimate() {
|
|
||||||
if (date.isValid(this.itemselproj.begin_development) && (this.itemselproj.hoursweeky_plannedtowork > 0)) {
|
|
||||||
const hoursw = this.itemselproj.hoursweeky_plannedtowork
|
|
||||||
|
|
||||||
try {
|
|
||||||
|
|
||||||
let orerimaste = this.itemselproj.hoursplanned - this.itemselproj.hoursworked
|
|
||||||
if (orerimaste < 0) {
|
|
||||||
orerimaste = 0
|
|
||||||
}
|
|
||||||
|
|
||||||
const weeks = orerimaste / hoursw
|
|
||||||
const days = Math.round(weeks * 7)
|
|
||||||
|
|
||||||
const mydate = this.itemselproj.begin_development
|
|
||||||
this.itemselproj.endwork_estimate = date.addToDate(mydate, { days })
|
|
||||||
|
|
||||||
console.log(' days', days, 'weeks', weeks, 'orerimaste', orerimaste, 'dateestimated', this.itemselproj.endwork_estimate)
|
|
||||||
|
|
||||||
return this.itemselproj.endwork_estimate
|
|
||||||
}catch (e) {
|
|
||||||
this.itemselproj.endwork_estimate = tools.getDateNull()
|
|
||||||
}
|
|
||||||
|
|
||||||
return tools.getDateNull()
|
|
||||||
|
|
||||||
} else {
|
|
||||||
return tools.getDateNull()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private getElementIndex(el: any) {
|
private getElementIndex(el: any) {
|
||||||
return [].slice.call(el.parentElement.children).indexOf(el)
|
return [].slice.call(el.parentElement.children).indexOf(el)
|
||||||
}
|
}
|
||||||
@@ -396,14 +456,5 @@ export default class ProjList extends Vue {
|
|||||||
return parseInt(el.attributes.index.value, 10)
|
return parseInt(el.attributes.index.value, 10)
|
||||||
}
|
}
|
||||||
|
|
||||||
get getCalcTodoHoursWorked() {
|
|
||||||
if (this.itemtodosel.hoursplanned <= 0) {
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
const myperc = Math.round(this.itemtodosel.hoursworked / this.itemtodosel.hoursplanned * 100)
|
|
||||||
|
|
||||||
return myperc
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
<div>
|
<div>
|
||||||
<div class="divtitlecat clMain">
|
<div class="divtitlecat clMain">
|
||||||
<div class="flex-container clMain">
|
<div class="flex-container clMain">
|
||||||
<q-btn v-if="!!getidProjParentAtt" size="sm" push color="secondary" round
|
<q-btn v-if="!!getIdParent && CanISeeProject" size="sm" push color="secondary" round
|
||||||
icon="arrow_back"
|
icon="arrow_back"
|
||||||
:to="getrouteup">
|
:to="getrouteup">
|
||||||
|
|
||||||
@@ -122,11 +122,28 @@
|
|||||||
:label="$t('proj.longdescr')"
|
:label="$t('proj.longdescr')"
|
||||||
outlined
|
outlined
|
||||||
debounce="1000"
|
debounce="1000"
|
||||||
autogrow
|
autogrow>
|
||||||
/>
|
</q-input>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div v-if="isMainProject" class="flex-container clMain">
|
||||||
|
<q-icon class="flex-item flex-icon" name="lock"/>
|
||||||
|
<div class="flex-item itemstatus">
|
||||||
|
<q-select :readonly="readonly_PanelPrivacy"
|
||||||
|
rounded outlined v-model="itemselproj.privacyread" :options="selectPrivacy"
|
||||||
|
:label="$t('proj.privacyread')" emit-value map-options>
|
||||||
|
</q-select>
|
||||||
|
</div>
|
||||||
|
<q-icon class="flex-item flex-icon" name="edit"/>
|
||||||
|
<div class="flex-item itemstatus">
|
||||||
|
<q-select :readonly="readonly_PanelPrivacy" rounded outlined
|
||||||
|
v-model="itemselproj.privacywrite" :options="selectPrivacy"
|
||||||
|
:label="$t('proj.privacywrite')" emit-value map-options>
|
||||||
|
</q-select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div v-if="CanISeeProject">
|
||||||
<div class="flex-container clMain">
|
<div class="flex-container clMain">
|
||||||
<q-icon class="flex-item flex-icon" name="work_outline"/>
|
<q-icon class="flex-item flex-icon" name="work_outline"/>
|
||||||
<div class="flex-item itemdescr">
|
<div class="flex-item itemdescr">
|
||||||
@@ -166,7 +183,8 @@
|
|||||||
</div>
|
</div>
|
||||||
<div style="margin: 10px;"></div>
|
<div style="margin: 10px;"></div>
|
||||||
<div class="flex-item itemdata">
|
<div class="flex-item itemdata">
|
||||||
<CDate :mydate="itemselproj.begin_test" @input="itemselproj.begin_test = new Date(arguments[0])"
|
<CDate :mydate="itemselproj.begin_test"
|
||||||
|
@input="itemselproj.begin_test = new Date(arguments[0])"
|
||||||
:label="$t('proj.begin_test')">
|
:label="$t('proj.begin_test')">
|
||||||
</CDate>
|
</CDate>
|
||||||
</div>
|
</div>
|
||||||
@@ -208,9 +226,8 @@
|
|||||||
</CDate>
|
</CDate>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<template v-else-if="(whatisSel === tools.WHAT_TODO) && (!!itemtodosel.descr)" v-slot:after>
|
<template v-else-if="(whatisSel === tools.WHAT_TODO) && (!!itemtodosel.descr)" v-slot:after>
|
||||||
<div class="q-pa-xs clMain">
|
<div class="q-pa-xs clMain">
|
||||||
|
|||||||
Reference in New Issue
Block a user