From c7fa5bd40d0e5c9ea50190a90a0ccfee8ad96c25 Mon Sep 17 00:00:00 2001
From: pacien
Date: Thu, 27 Feb 2020 21:05:51 +0100
Subject: viewer: use colon as tag separator instead of dot

For consistency with the query language
and allowing the use of the very common dot in tags.

This also introduces a migration script.

GitHub: closes #164
---
 viewer/src/components/LdProposition.vue | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

(limited to 'viewer/src/components/LdProposition.vue')

diff --git a/viewer/src/components/LdProposition.vue b/viewer/src/components/LdProposition.vue
index 375c482..3357777 100644
--- a/viewer/src/components/LdProposition.vue
+++ b/viewer/src/components/LdProposition.vue
@@ -74,7 +74,7 @@ export default class LdProposition extends Vue {
     } else {
       // Tags count from the current directory
       this.currentTags
-        .flatMap(tag => tag.split("."))
+        .flatMap(tag => tag.split(":"))
         .map(tag => this.tagsIndex[tag])
         .forEach(tagindex => (propositions[tagindex.tag] = tagindex.items.length));
     }
@@ -89,7 +89,7 @@ export default class LdProposition extends Vue {
   }
 
   rightmost(tag: Gallery.RawTag): Gallery.RawTag {
-    const dot = tag.lastIndexOf(".");
+    const dot = tag.lastIndexOf(":");
     return dot <= 0 ? tag : tag.substr(dot + 1);
   }
 
-- 
cgit v1.2.3

