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 ++-- viewer/src/services/indexfactory.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'viewer') 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); } diff --git a/viewer/src/services/indexfactory.ts b/viewer/src/services/indexfactory.ts index a6bc865..6fed6cc 100644 --- a/viewer/src/services/indexfactory.ts +++ b/viewer/src/services/indexfactory.ts @@ -36,7 +36,7 @@ export default class IndexFactory { return; // Directories are not indexed } for (const tag of item.tags) { - const parts = tag.split('.'); + const parts = tag.split(':'); let lastPart: string | null = null; for (const part of parts) { if (!tagsIndex[part]) tagsIndex[part] = { tag: part, tagfiltered: Navigation.normalize(part), items: [], children: {} }; -- cgit v1.2.3