3 Commits b988b43a66 ... 6fb04ede84

Author SHA1 Message Date
  bach 6fb04ede84 linkeditable save bug fix 1 month ago
  bach 0fae2dee66 bug fix: revisions mismatch 1 month ago
  bach f44d52bc2c bug fix: open boussole from search failed when mapitem_id different from cid 1 month ago

+ 7 - 0
src/components/ConcernementMapItem.vue

@@ -409,7 +409,14 @@ export default {
 
 
       // console.log(`ConcernementsMapItem ${this.id} created`);
       // console.log(`ConcernementsMapItem ${this.id} created`);
       // this.entites = this.concernement.entites
       // this.entites = this.concernement.entites
+      // TODO sometimes active revision is not on revisions_by_id ... why ?
+      let revisions_ids = Object.keys(this.concernement.revisions_byid);
+      if (revisions_ids.indexOf(this.concernement.revision_id) !== -1) {
       this.entites = this.concernement.revisions_byid[this.concernement.revision_id].entites;
       this.entites = this.concernement.revisions_byid[this.concernement.revision_id].entites;
+      } else {
+        this.entites = this.concernement.revisions_byid[revisions_ids.pop()].entites;
+      }
+      
     },
     },
     parseEntityPointsValues (){
     parseEntityPointsValues (){
       // console.log(`parseEntityPointsValues`);
       // console.log(`parseEntityPointsValues`);

+ 6 - 2
src/components/editable/LinkEditable.vue

@@ -71,12 +71,16 @@ export default {
         const $li = this.$refs.links_list.children[i];
         const $li = this.$refs.links_list.children[i];
         if ($li.querySelector('input.url').value) {
         if ($li.querySelector('input.url').value) {
           let title = $li.querySelector('input.title').value;
           let title = $li.querySelector('input.title').value;
-          let url = $li.querySelector('input.url').value; 
+          let url = $li.querySelector('input.url').value;
+          console.log(`title ${title}, url ${url}`);
           list.push({
           list.push({
             title: title,
             title: title,
             uri: url
             uri: url
           });
           });
-          tobesaved = (typeof this.links[i] === 'undefined' || title !== this.links[i].title || url !== this.links[i].url);
+          console.log(`title ${title} | this.links[i].title ${this.links[i].title}`);
+          if (!tobesaved) {
+            tobesaved = (typeof this.links[i] === 'undefined' || title !== this.links[i].title || url !== this.links[i].url);
+          }
         }
         }
       }
       }
       if (!tobesaved) {
       if (!tobesaved) {

+ 1 - 1
src/stores/concernements.js

@@ -644,7 +644,7 @@ export const ConcernementsStore = defineStore({
     openCloseConcernements (cid, mi_id) {
     openCloseConcernements (cid, mi_id) {
       console.log(`openCloseConcernements cid: ${cid}, mi_id: ${mi_id}`);
       console.log(`openCloseConcernements cid: ${cid}, mi_id: ${mi_id}`);
       var state;
       var state;
-      let mapitem_id = mi_id ? mi_id : this.concernementsByID[cid].mapitems_ids[0];
+      let mapitem_id = mi_id ? mi_id : cid ? this.concernementsByID[cid].mapitems_ids[this.concernementsByID[cid].mapitems_ids.length -1] : null;
       this.opened_concernement = null;
       this.opened_concernement = null;
       this.opened_recit = null;
       this.opened_recit = null;
       this.concernements.forEach((c, i) => {
       this.concernements.forEach((c, i) => {