From 7c2a2ff46469d5e8f44fb3ec7feae5f798e0baf8 Mon Sep 17 00:00:00 2001 From: Zero~Informatique Date: Thu, 27 Feb 2020 17:23:32 +0100 Subject: viewer: architectural fixes and improvements Make use of VueX's strict mode (which is different from vuex-class-component strict mode) Fixed issues and bad-practices with search filter tags mutations Correctly implement the new index.json format --- viewer/src/@types/gallery.d.ts | 3 ++- viewer/src/components/LdBreadcrumb.vue | 2 +- viewer/src/components/LdCommand.vue | 2 +- viewer/src/components/LdProposition.vue | 4 ++-- viewer/src/components/LdTagInput.vue | 4 ++-- viewer/src/store/galleryStore.ts | 23 +++++++++++++++-------- viewer/src/store/index.ts | 3 ++- viewer/src/store/uiStore.ts | 1 - viewer/src/views/GalleryNavigation.vue | 2 +- viewer/src/views/GallerySearch.vue | 16 ++-------------- viewer/src/views/PanelLeft.vue | 29 +++++++++++++++++++++++------ 11 files changed, 51 insertions(+), 38 deletions(-) (limited to 'viewer') diff --git a/viewer/src/@types/gallery.d.ts b/viewer/src/@types/gallery.d.ts index d7645b6..399fb66 100644 --- a/viewer/src/@types/gallery.d.ts +++ b/viewer/src/@types/gallery.d.ts @@ -27,8 +27,9 @@ declare namespace Gallery { } interface Index { properties: GalleryProperties, - tree: Item + tree: Directory } + interface Other extends Item { properties: OtherProperties, } diff --git a/viewer/src/components/LdBreadcrumb.vue b/viewer/src/components/LdBreadcrumb.vue index 2ac1216..2b45b71 100644 --- a/viewer/src/components/LdBreadcrumb.vue +++ b/viewer/src/components/LdBreadcrumb.vue @@ -53,7 +53,7 @@ import Navigation from "@/services/navigation"; @Component export default class LdBreadcrumb extends Vue { - @Prop({ required: true }) readonly currentItemPath!: Gallery.Item[]; + @Prop({ type: Array, required: true }) readonly currentItemPath!: Gallery.Item[]; @Prop(Boolean) readonly searchMode!: boolean; @Ref() readonly breadcrumb!: HTMLUListElement; diff --git a/viewer/src/components/LdCommand.vue b/viewer/src/components/LdCommand.vue index 367e08f..398107e 100644 --- a/viewer/src/components/LdCommand.vue +++ b/viewer/src/components/LdCommand.vue @@ -44,7 +44,7 @@ import { RawLocation } from "vue-router"; @Component export default class LdCommand extends Vue { - @Prop({ required: true }) readonly currentItemPath!: Gallery.Item[]; + @Prop({ type: Array, required: true }) readonly currentItemPath!: Gallery.Item[]; commandToggleSearchPanelIcon(): string { return this.$uiStore.fullWidth ? "search" : "angle-double-left"; diff --git a/viewer/src/components/LdProposition.vue b/viewer/src/components/LdProposition.vue index 7f6521f..375c482 100644 --- a/viewer/src/components/LdProposition.vue +++ b/viewer/src/components/LdProposition.vue @@ -49,14 +49,14 @@ diff --git a/viewer/src/views/PanelLeft.vue b/viewer/src/views/PanelLeft.vue index 6292e78..54b9c63 100644 --- a/viewer/src/views/PanelLeft.vue +++ b/viewer/src/views/PanelLeft.vue @@ -19,11 +19,11 @@ - + {{$t('panelLeft.propositions')}} -- cgit v1.2.3