Insert menu: "My Proj Shared" and when I insert a project, put the right property privacy
This commit is contained in:
@@ -11,6 +11,7 @@ import { CDate } from '../../CDate'
|
|||||||
|
|
||||||
import { date } from 'quasar'
|
import { date } from 'quasar'
|
||||||
import { GlobalStore } from '@store'
|
import { GlobalStore } from '@store'
|
||||||
|
import { RouteNames } from '@src/router/route-names'
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
components: { SubMenusProj, CDate },
|
components: { SubMenusProj, CDate },
|
||||||
@@ -283,12 +284,16 @@ export default class SingleProject extends Vue {
|
|||||||
return this.itemproject.userId === UserStore.state.userId
|
return this.itemproject.userId === UserStore.state.userId
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get tipoProj() {
|
||||||
|
return this.$route.name
|
||||||
|
}
|
||||||
|
|
||||||
get getrouteto() {
|
get getrouteto() {
|
||||||
return tools.getUrlByTipoProj(this.isMyProject) + this.itemproject._id
|
return tools.getUrlByTipoProj(this.tipoProj) + this.itemproject._id
|
||||||
}
|
}
|
||||||
|
|
||||||
public goIntoTheProject() {
|
public goIntoTheProject() {
|
||||||
this.$router.replace(tools.getUrlByTipoProj(this.isMyProject) + this.itemproject._id)
|
this.$router.replace(tools.getUrlByTipoProj(this.tipoProj) + this.itemproject._id)
|
||||||
}
|
}
|
||||||
|
|
||||||
public editProject() {
|
public editProject() {
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ export interface IDrag {
|
|||||||
category?: string
|
category?: string
|
||||||
id_proj?: string
|
id_proj?: string
|
||||||
atfirst?: boolean
|
atfirst?: boolean
|
||||||
mieiproj?: boolean
|
tipoproj?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface ITodosState {
|
export interface ITodosState {
|
||||||
|
|||||||
@@ -97,8 +97,8 @@ export const routesList: IMyRouteConfig[] = [
|
|||||||
// component: () => import('@/root/malaga/malaga.vue')
|
// component: () => import('@/root/malaga/malaga.vue')
|
||||||
// },
|
// },
|
||||||
{
|
{
|
||||||
path: '/' + RouteNames.projects + '/:idProj',
|
path: '/' + RouteNames.projectsall + '/:idProj',
|
||||||
name: RouteNames.projects,
|
name: RouteNames.projectsall,
|
||||||
component: () => import('@/views/projects/proj-list/proj-list.vue'),
|
component: () => import('@/views/projects/proj-list/proj-list.vue'),
|
||||||
meta: {
|
meta: {
|
||||||
requiresAuth: false,
|
requiresAuth: false,
|
||||||
@@ -120,6 +120,18 @@ export const routesList: IMyRouteConfig[] = [
|
|||||||
// middleware: [auth]
|
// middleware: [auth]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: '/' + RouteNames.projectsshared + '/:idProj',
|
||||||
|
name: RouteNames.projectsshared,
|
||||||
|
component: () => import('@/views/projects/proj-list/proj-list.vue'),
|
||||||
|
meta: {
|
||||||
|
requiresAuth: true,
|
||||||
|
async asyncData() {
|
||||||
|
await Projects.actions.dbLoad({ checkPending: false, onlyiffirsttime: true })
|
||||||
|
}
|
||||||
|
// middleware: [auth]
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
path: '/' + RouteNames.listprojects,
|
path: '/' + RouteNames.listprojects,
|
||||||
name: RouteNames.listprojects,
|
name: RouteNames.listprojects,
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ export const RouteNames = {
|
|||||||
home: 'home',
|
home: 'home',
|
||||||
login: 'login',
|
login: 'login',
|
||||||
projects: 'projects',
|
projects: 'projects',
|
||||||
|
projectsall: 'projall',
|
||||||
projectsshared: 'projectsShared',
|
projectsshared: 'projectsShared',
|
||||||
myprojects: 'myprojects',
|
myprojects: 'myprojects',
|
||||||
favouriteprojects: 'favproj',
|
favouriteprojects: 'favproj',
|
||||||
|
|||||||
@@ -129,8 +129,9 @@ const messages = {
|
|||||||
Test2: 'Test2',
|
Test2: 'Test2',
|
||||||
projects: 'Progetti',
|
projects: 'Progetti',
|
||||||
favproj: 'Favoriti',
|
favproj: 'Favoriti',
|
||||||
projectsShared: 'Condivisi',
|
projall: 'Tutti',
|
||||||
myprojects: 'Personali'
|
projectsShared: 'Miei Condivisi',
|
||||||
|
myprojects: 'Miei Personali'
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
authentication: {
|
authentication: {
|
||||||
@@ -393,8 +394,9 @@ const messages = {
|
|||||||
Test2: 'Test2',
|
Test2: 'Test2',
|
||||||
projects: 'Proyectos',
|
projects: 'Proyectos',
|
||||||
favproj: 'Favoritos',
|
favproj: 'Favoritos',
|
||||||
projectsShared: 'Compartidos',
|
projall: 'Todos',
|
||||||
myprojects: 'Personales',
|
projectsShared: 'Mis Compartidos',
|
||||||
|
myprojects: 'Mis Personales',
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
authentication: {
|
authentication: {
|
||||||
@@ -651,8 +653,9 @@ const messages = {
|
|||||||
Test2: 'Test2',
|
Test2: 'Test2',
|
||||||
projects: 'Projects',
|
projects: 'Projects',
|
||||||
favproj: 'Favorite',
|
favproj: 'Favorite',
|
||||||
projectsShared: 'Shared',
|
projall: 'All',
|
||||||
myprojects: 'Personals',
|
projectsShared: 'My Shared',
|
||||||
|
myprojects: 'My Personals',
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
authentication: {
|
authentication: {
|
||||||
|
|||||||
@@ -138,9 +138,9 @@ namespace Getters {
|
|||||||
let arrlistaprojtutti = []
|
let arrlistaprojtutti = []
|
||||||
let arrlistaprojmiei = []
|
let arrlistaprojmiei = []
|
||||||
if (SHOW_PROJINTHEMENU) {
|
if (SHOW_PROJINTHEMENU) {
|
||||||
arrlistaprojtutti = Projects.getters.listaprojects(false, false)
|
arrlistaprojtutti = Projects.getters.listaprojects(RouteNames.projectsall)
|
||||||
arrlistaprojmiei = Projects.getters.listaprojects(true, false)
|
arrlistaprojmiei = Projects.getters.listaprojects(RouteNames.myprojects)
|
||||||
arrlistafavourite = Projects.getters.listaprojects(false, true)
|
arrlistafavourite = Projects.getters.listaprojects(RouteNames.favouriteprojects)
|
||||||
}
|
}
|
||||||
|
|
||||||
const arrMenu: IMenuList[] = []
|
const arrMenu: IMenuList[] = []
|
||||||
@@ -158,11 +158,22 @@ namespace Getters {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// PROGETTI -> TUTTI :
|
||||||
|
arrMenu.push({
|
||||||
|
icon: '',
|
||||||
|
nametranslate: 'pages.' + RouteNames.projectsall,
|
||||||
|
urlroute: RouteNames.projectsall,
|
||||||
|
level_parent: 0.0,
|
||||||
|
level_child: 0.5,
|
||||||
|
routes2: [],
|
||||||
|
idelem: process.env.PROJECT_ID_MAIN
|
||||||
|
})
|
||||||
|
|
||||||
// PROGETTI -> CONDIVISI :
|
// PROGETTI -> CONDIVISI :
|
||||||
arrMenu.push({
|
arrMenu.push({
|
||||||
icon: '',
|
icon: '',
|
||||||
nametranslate: 'pages.' + RouteNames.projectsshared,
|
nametranslate: 'pages.' + RouteNames.projectsshared,
|
||||||
urlroute: 'projects',
|
urlroute: RouteNames.projectsshared,
|
||||||
level_parent: 0.0,
|
level_parent: 0.0,
|
||||||
level_child: 0.5,
|
level_child: 0.5,
|
||||||
routes2: arrlistaprojtutti,
|
routes2: arrlistaprojtutti,
|
||||||
@@ -173,7 +184,7 @@ namespace Getters {
|
|||||||
arrMenu.push({
|
arrMenu.push({
|
||||||
icon: '',
|
icon: '',
|
||||||
nametranslate: 'pages.' + RouteNames.myprojects,
|
nametranslate: 'pages.' + RouteNames.myprojects,
|
||||||
urlroute: 'myprojects',
|
urlroute: RouteNames.myprojects,
|
||||||
level_parent: 0.0,
|
level_parent: 0.0,
|
||||||
level_child: 0.5,
|
level_child: 0.5,
|
||||||
routes2: arrlistaprojmiei,
|
routes2: arrlistaprojmiei,
|
||||||
@@ -431,11 +442,11 @@ namespace Actions {
|
|||||||
const mykey = process.env.PUBLICKEY_PUSH
|
const mykey = process.env.PUBLICKEY_PUSH
|
||||||
const mystate = state
|
const mystate = state
|
||||||
return navigator.serviceWorker.ready
|
return navigator.serviceWorker.ready
|
||||||
.then(function (swreg) {
|
.then((swreg) => {
|
||||||
reg = swreg
|
reg = swreg
|
||||||
return swreg.pushManager.getSubscription()
|
return swreg.pushManager.getSubscription()
|
||||||
})
|
})
|
||||||
.then(function (subscription) {
|
.then((subscription) => {
|
||||||
mystate.wasAlreadySubscribed = !(subscription === null)
|
mystate.wasAlreadySubscribed = !(subscription === null)
|
||||||
|
|
||||||
if (mystate.wasAlreadySubscribed) {
|
if (mystate.wasAlreadySubscribed) {
|
||||||
@@ -452,10 +463,10 @@ namespace Actions {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.then(function (newSub) {
|
.then((newSub) => {
|
||||||
saveNewSubscriptionToServer(context, newSub)
|
saveNewSubscriptionToServer(context, newSub)
|
||||||
})
|
})
|
||||||
.catch(function (err) {
|
.catch((err) => {
|
||||||
console.log('ERR createPushSubscription:', err)
|
console.log('ERR createPushSubscription:', err)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import { GlobalStore, UserStore } from '@store'
|
|||||||
import globalroutines from './../../globalroutines/index'
|
import globalroutines from './../../globalroutines/index'
|
||||||
import objectId from '@src/js/objectId'
|
import objectId from '@src/js/objectId'
|
||||||
import { costanti } from '@src/store/Modules/costanti'
|
import { costanti } from '@src/store/Modules/costanti'
|
||||||
|
import { RouteNames } from '@src/router/route-names'
|
||||||
|
|
||||||
const nametable = 'projects'
|
const nametable = 'projects'
|
||||||
|
|
||||||
@@ -51,12 +52,14 @@ function updateDataCalculated(projout, projin) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
function getproj(projects, idproj, miei: boolean, favourite: boolean) {
|
function getproj(projects, idproj, tipoproj: string) {
|
||||||
if (miei && !favourite) {
|
|
||||||
return tools.mapSort(projects.filter((proj) => (proj.id_parent === idproj) && (proj.userId === UserStore.state.userId)))
|
if (tipoproj === RouteNames.myprojects)
|
||||||
} else {
|
return tools.mapSort(projects.filter((proj) => (proj.id_parent === idproj) && (proj.userId === UserStore.state.userId) && (proj.privacyread === Privacy.onlyme)))
|
||||||
return tools.mapSort(projects.filter((proj) => (proj.id_parent === idproj) && (proj.userId !== UserStore.state.userId)))
|
else if (tipoproj === RouteNames.projectsshared)
|
||||||
}
|
return tools.mapSort(projects.filter((proj) => (proj.id_parent === idproj) && (proj.userId === UserStore.state.userId) && (proj.privacyread !== Privacy.onlyme)))
|
||||||
|
else if (tipoproj === RouteNames.projectsall)
|
||||||
|
return tools.mapSort(projects.filter((proj) => (proj.id_parent === idproj) && (proj.userId !== UserStore.state.userId) ))
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace Getters {
|
namespace Getters {
|
||||||
@@ -101,20 +104,20 @@ namespace Getters {
|
|||||||
return obj
|
return obj
|
||||||
}, 'getRecordEmpty')
|
}, 'getRecordEmpty')
|
||||||
|
|
||||||
const projs_dacompletare = b.read((state: IProjectsState) => (id_parent: string, miei: boolean): IProject[] => {
|
const projs_dacompletare = b.read((state: IProjectsState) => (id_parent: string, tipoproj: string): IProject[] => {
|
||||||
// console.log('projs_dacompletare', miei)
|
// console.log('projs_dacompletare', miei)
|
||||||
if (state.projects) {
|
if (state.projects) {
|
||||||
// console.log('state.projects', state.projects)
|
// console.log('state.projects', state.projects)
|
||||||
return getproj(state.projects, id_parent, miei, false)
|
return getproj(state.projects, id_parent, tipoproj)
|
||||||
} else {
|
} else {
|
||||||
return []
|
return []
|
||||||
}
|
}
|
||||||
}, 'projs_dacompletare')
|
}, 'projs_dacompletare')
|
||||||
|
|
||||||
const listaprojects = b.read((state: IProjectsState) => (miei: boolean, favourite: boolean): IMenuList[] => {
|
const listaprojects = b.read((state: IProjectsState) => (tipoproj: string): IMenuList[] => {
|
||||||
if (state.projects) {
|
if (state.projects) {
|
||||||
// console.log('state.projects', state.projects)
|
// console.log('state.projects', state.projects)
|
||||||
const listaproj = getproj(state.projects, process.env.PROJECT_ID_MAIN, miei, favourite)
|
const listaproj = getproj(state.projects, process.env.PROJECT_ID_MAIN, tipoproj)
|
||||||
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 })
|
||||||
@@ -350,7 +353,7 @@ namespace Actions {
|
|||||||
} else {
|
} else {
|
||||||
console.log('INSERT AT THE BOTTOM')
|
console.log('INSERT AT THE BOTTOM')
|
||||||
// INSERT AT THE BOTTOM , so GET LAST ITEM
|
// INSERT AT THE BOTTOM , so GET LAST ITEM
|
||||||
const lastelem = tools.getLastListNotCompleted(nametable, objproj.id_parent)
|
const lastelem = tools.getLastListNotCompleted(nametable, objproj.id_parent, this.tipoProj)
|
||||||
|
|
||||||
objproj.id_prev = (!!lastelem) ? lastelem._id : ApiTables.LIST_START
|
objproj.id_prev = (!!lastelem) ? lastelem._id : ApiTables.LIST_START
|
||||||
}
|
}
|
||||||
@@ -385,7 +388,7 @@ namespace Actions {
|
|||||||
async function swapElems(context, itemdragend: IDrag) {
|
async function swapElems(context, itemdragend: IDrag) {
|
||||||
console.log('PROJECT swapElems', itemdragend, stateglob.projects)
|
console.log('PROJECT swapElems', itemdragend, stateglob.projects)
|
||||||
|
|
||||||
const myarr = Getters.getters.projs_dacompletare(itemdragend.id_proj, itemdragend.mieiproj)
|
const myarr = Getters.getters.projs_dacompletare(itemdragend.id_proj, itemdragend.tipoproj)
|
||||||
|
|
||||||
tools.swapGeneralElem(nametable, myarr, itemdragend, listFieldsToChange)
|
tools.swapGeneralElem(nametable, myarr, itemdragend, listFieldsToChange)
|
||||||
|
|
||||||
|
|||||||
@@ -313,7 +313,7 @@ namespace Actions {
|
|||||||
} else {
|
} else {
|
||||||
console.log('INSERT AT THE BOTTOM')
|
console.log('INSERT AT THE BOTTOM')
|
||||||
// INSERT AT THE BOTTOM , so GET LAST ITEM
|
// INSERT AT THE BOTTOM , so GET LAST ITEM
|
||||||
const lastelem = tools.getLastListNotCompleted(nametable, objtodo.category)
|
const lastelem = tools.getLastListNotCompleted(nametable, objtodo.category, this.tipoProj)
|
||||||
|
|
||||||
objtodo.id_prev = (!!lastelem) ? lastelem._id : ApiTables.LIST_START
|
objtodo.id_prev = (!!lastelem) ? lastelem._id : ApiTables.LIST_START
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import Quasar, { date } from 'quasar'
|
|||||||
import { IListRoutes, IMenuList, IProject, ITodo, Privacy } from '@src/model'
|
import { IListRoutes, IMenuList, 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'
|
||||||
|
import { RouteNames } from '@src/router/route-names'
|
||||||
|
|
||||||
export interface INotify {
|
export interface INotify {
|
||||||
color?: string | 'primary'
|
color?: string | 'primary'
|
||||||
@@ -1185,17 +1186,19 @@ export const tools = {
|
|||||||
}
|
}
|
||||||
,
|
,
|
||||||
|
|
||||||
getLastListNotCompleted(nametable, cat, isproj = false, miei = false) {
|
getLastListNotCompleted(nametable, cat, tipoproj: string) {
|
||||||
// const module = tools.getModulesByTable(nametable)
|
// const module = tools.getModulesByTable(nametable)
|
||||||
let arr = []
|
let arr = []
|
||||||
if (nametable === 'projects')
|
if (nametable === 'projects')
|
||||||
arr = Projects.getters.projs_dacompletare(cat, miei)
|
arr = Projects.getters.projs_dacompletare(cat, tipoproj)
|
||||||
else if (nametable === 'todos')
|
else if (nametable === 'todos')
|
||||||
arr = Todos.getters.items_dacompletare(cat)
|
arr = Todos.getters.items_dacompletare(cat)
|
||||||
|
|
||||||
return (arr.length > 0) ? arr[arr.length - 1] : null
|
if (!!arr)
|
||||||
}
|
return (arr.length > 0) ? arr[arr.length - 1] : null
|
||||||
,
|
else
|
||||||
|
return null
|
||||||
|
},
|
||||||
|
|
||||||
getElemByIndex(myarr, index) {
|
getElemByIndex(myarr, index) {
|
||||||
if (index >= 0 && index < myarr.length) {
|
if (index >= 0 && index < myarr.length) {
|
||||||
@@ -1509,14 +1512,11 @@ export const tools = {
|
|||||||
return idproj === process.env.PROJECT_ID_MAIN
|
return idproj === process.env.PROJECT_ID_MAIN
|
||||||
},
|
},
|
||||||
|
|
||||||
getUrlByTipoProj(miei, name?: string) {
|
getUrlByTipoProj(tipoproj, name?: string) {
|
||||||
if (!!name)
|
if (!!name)
|
||||||
return '/' + name + '/'
|
return '/' + name + '/'
|
||||||
|
|
||||||
if (miei)
|
|
||||||
return '/myprojects/'
|
|
||||||
else
|
else
|
||||||
return '/projects/'
|
return '/' + tipoproj + '/'
|
||||||
},
|
},
|
||||||
|
|
||||||
convertMenuListInListRoutes(arrlista: IMenuList[]) {
|
convertMenuListInListRoutes(arrlista: IMenuList[]) {
|
||||||
@@ -1540,4 +1540,15 @@ export const tools = {
|
|||||||
return lista
|
return lista
|
||||||
},
|
},
|
||||||
|
|
||||||
|
getprivacyreadbytipoproj(tipoproj) {
|
||||||
|
if (tipoproj === RouteNames.myprojects)
|
||||||
|
return Privacy.onlyme
|
||||||
|
else
|
||||||
|
return Privacy.all
|
||||||
|
},
|
||||||
|
|
||||||
|
getprivacywritebytipoproj(tipoproj) {
|
||||||
|
return Privacy.onlyme
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ export default class ProjList extends Vue {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Getter('projs_dacompletare', { namespace })
|
@Getter('projs_dacompletare', { namespace })
|
||||||
public projs_dacompletare: (state: IProjectsState, id_parent: string, miei: boolean) => IProject[]
|
public projs_dacompletare: (state: IProjectsState, id_parent: string, tipoproj: string) => IProject[]
|
||||||
|
|
||||||
@Watch('projs_dacompletare')
|
@Watch('projs_dacompletare')
|
||||||
public changeitems() {
|
public changeitems() {
|
||||||
@@ -72,7 +72,7 @@ export default class ProjList extends Vue {
|
|||||||
|
|
||||||
@Watch('$route.name')
|
@Watch('$route.name')
|
||||||
public changename() {
|
public changename() {
|
||||||
console.log('tools.getUrlByTipoProj(this.areMyProjects)', tools.getUrlByTipoProj(this.areMyProjects))
|
console.log('tools.getUrlByTipoProj(this.tipoProj)', tools.getUrlByTipoProj(this.tipoProj))
|
||||||
this.changeparent()
|
this.changeparent()
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -98,9 +98,9 @@ export default class ProjList extends Vue {
|
|||||||
// console.log('idproj', this.idProjAtt, 'params' , this.$route.params)
|
// console.log('idproj', this.idProjAtt, 'params' , this.$route.params)
|
||||||
}
|
}
|
||||||
|
|
||||||
get areMyProjects() {
|
get tipoProj() {
|
||||||
// console.log('this.$route.name', this.$route.name)
|
// console.log('this.$route.name', this.$route.name)
|
||||||
return this.$route.name === RouteNames.myprojects
|
return this.$route.name
|
||||||
}
|
}
|
||||||
|
|
||||||
get readonly_PanelPrivacy() {
|
get readonly_PanelPrivacy() {
|
||||||
@@ -132,7 +132,7 @@ export default class ProjList extends Vue {
|
|||||||
}
|
}
|
||||||
|
|
||||||
get getrouteup() {
|
get getrouteup() {
|
||||||
return tools.getUrlByTipoProj(this.areMyProjects) + this.itemproj.id_parent
|
return tools.getUrlByTipoProj(this.tipoProj) + this.itemproj.id_parent
|
||||||
}
|
}
|
||||||
|
|
||||||
get tools() {
|
get tools() {
|
||||||
@@ -294,7 +294,7 @@ export default class ProjList extends Vue {
|
|||||||
id_proj: this.idProjAtt,
|
id_proj: this.idProjAtt,
|
||||||
newIndex: this.getElementIndex(args.el),
|
newIndex: this.getElementIndex(args.el),
|
||||||
oldIndex: this.getElementOldIndex(args.el),
|
oldIndex: this.getElementOldIndex(args.el),
|
||||||
mieiproj: this.areMyProjects
|
tipoproj: this.tipoProj
|
||||||
}
|
}
|
||||||
|
|
||||||
// console.log('args', args, itemdragend)
|
// console.log('args', args, itemdragend)
|
||||||
@@ -373,13 +373,13 @@ export default class ProjList extends Vue {
|
|||||||
|
|
||||||
this.projbottom = ''
|
this.projbottom = ''
|
||||||
|
|
||||||
return this.addProject(descr)
|
return this.addProject(descr, this.tipoProj)
|
||||||
}
|
}
|
||||||
|
|
||||||
public async clickMenuProjList(action) {
|
public async clickMenuProjList(action) {
|
||||||
console.log('clickMenuProjList: ', action)
|
console.log('clickMenuProjList: ', action)
|
||||||
if (action === tools.MenuAction.ADD_PROJECT) {
|
if (action === tools.MenuAction.ADD_PROJECT) {
|
||||||
const idnewelem = await this.addProject('')
|
const idnewelem = await this.addProject('', this.tipoProj)
|
||||||
// get element by id
|
// get element by id
|
||||||
const elem = this.getCompProjectById(idnewelem)
|
const elem = this.getCompProjectById(idnewelem)
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
@@ -412,14 +412,25 @@ export default class ProjList extends Vue {
|
|||||||
|
|
||||||
// const descr = this.$t('project.newproj').toString()
|
// const descr = this.$t('project.newproj').toString()
|
||||||
|
|
||||||
public async addProject(descr) {
|
public async addProject(descr, tipoproj: string) {
|
||||||
const projatt = Projects.getters.getRecordById(this.idProjAtt)
|
const projatt = Projects.getters.getRecordById(this.idProjAtt)
|
||||||
const myobj: IProject = {
|
let myobj: IProject = null
|
||||||
descr,
|
if (this.idProjAtt === process.env.PROJECT_ID_MAIN) {
|
||||||
id_parent: this.idProjAtt,
|
myobj = {
|
||||||
privacyread: projatt.privacyread,
|
descr,
|
||||||
privacywrite: projatt.privacywrite,
|
id_parent: this.idProjAtt,
|
||||||
actualphase: projatt.actualphase
|
privacyread: tools.getprivacyreadbytipoproj(tipoproj),
|
||||||
|
privacywrite: tools.getprivacywritebytipoproj(tipoproj),
|
||||||
|
actualphase: projatt.actualphase
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
myobj = {
|
||||||
|
descr,
|
||||||
|
id_parent: this.idProjAtt,
|
||||||
|
privacyread: projatt.privacyread,
|
||||||
|
privacywrite: projatt.privacywrite,
|
||||||
|
actualphase: projatt.actualphase
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.itemproj === undefined)
|
if (this.itemproj === undefined)
|
||||||
|
|||||||
@@ -81,9 +81,9 @@
|
|||||||
<div style="display: none">{{ prior = 0, priorcomplet = false }}</div>
|
<div style="display: none">{{ prior = 0, priorcomplet = false }}</div>
|
||||||
<div>
|
<div>
|
||||||
<!--<q-infinite-scroll :handler="loadMoreTodo" :offset="7">-->
|
<!--<q-infinite-scroll :handler="loadMoreTodo" :offset="7">-->
|
||||||
<div class="container" v-dragula="projs_dacompletare(idProjAtt, areMyProjects)" drake="second">
|
<div class="container" v-dragula="projs_dacompletare(idProjAtt, tipoProj)" drake="second">
|
||||||
<div :id="tools.getmyid(myproj._id)" :index="index"
|
<div :id="tools.getmyid(myproj._id)" :index="index"
|
||||||
v-for="(myproj, index) in projs_dacompletare(idProjAtt, areMyProjects)"
|
v-for="(myproj, index) in projs_dacompletare(idProjAtt, tipoProj)"
|
||||||
:key="myproj._id" class="myitemdrag">
|
:key="myproj._id" class="myitemdrag">
|
||||||
|
|
||||||
<SingleProject ref="singleproject" @deleteItemproj="mydeleteitemproj(myproj._id)"
|
<SingleProject ref="singleproject" @deleteItemproj="mydeleteitemproj(myproj._id)"
|
||||||
@@ -105,7 +105,7 @@
|
|||||||
color="blue-12"
|
color="blue-12"
|
||||||
:label="$t('proj.insertbottom')"
|
:label="$t('proj.insertbottom')"
|
||||||
:after="[{icon: 'arrow_forward', content: true, handler () {}}]"
|
:after="[{icon: 'arrow_forward', content: true, handler () {}}]"
|
||||||
v-on:keyup.enter="dbInsert(false)">
|
v-on:keyup.enter="dbInsert()">
|
||||||
|
|
||||||
</q-input>
|
</q-input>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user