concernement with less than 3 entites are visible only if can_update

This commit is contained in:
Bachir Soussi Chiadmi 2024-05-21 17:01:23 +02:00
parent 433383437d
commit fc947913f7
2 changed files with 43 additions and 41 deletions

View File

@ -75,6 +75,8 @@ export default {
// console.log('App couple_ids', couple_ids);
// loop through all concernement
for(let [concernement_id, concernement] of Object.entries(this.concernementsByID)){
// TODO check if more than 3 entities or if connected user if author
if (concernement.entites.length > 3 || concernement.can_update) {
// create the main mapitem object
let mapitem = {
id: concernement.id,
@ -116,6 +118,8 @@ export default {
}
this.mapitems.push(mapitem)
this.allMapItems_byid[mapitem.id] = mapitem;
}
}
console.log('App mapitems', this.mapitems);
}

View File

@ -95,8 +95,7 @@ export const ConcernementsStore = defineStore({
concernement.has_proximites = false;
concernement.has_superpositions = false;
concernement.has_agissantes = false;
// var entites_temp = concernement.entites; // record a temp entites liste
// concernement.entites = []; // erase the concernement.entite array as we want to keep only visible entites
concernement.entites.forEach(entite => {
// console.log(`parsing entite ${entite.id}`);
if (entite.entite) { // entite.entite may be null because of workflow confidentiality
@ -115,7 +114,6 @@ export const ConcernementsStore = defineStore({
this.allEntitesById[entite.entite.id] = entite;
this.allEntitesById[entite.entite.id].cid = concernement.id;
}
// concernement.entites.push(entite); // fill the entites array with visible entite only
// PROXIMITES
if (entite.entite.proximite.length) {