From 665139f7d25a64f66e1149a6403fc26efcbabb2a Mon Sep 17 00:00:00 2001
From: pacien
Date: Sun, 3 May 2020 23:07:51 +0200
Subject: viewer/GalleryNavigation: better error messages

Introducing a generic error page with some icon and a different error for unknown resources

GitHub: closes #190
---
 viewer/src/components/LdGallery.vue | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

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

diff --git a/viewer/src/components/LdGallery.vue b/viewer/src/components/LdGallery.vue
index 29c18b9..e512758 100644
--- a/viewer/src/components/LdGallery.vue
+++ b/viewer/src/components/LdGallery.vue
@@ -18,11 +18,11 @@
 -->
 
 <template>
-  <div class="thumbnail-tiles">
+  <ld-error v-if="hasNoResults()" icon="search" :message="noresult" />
+  <div v-else class="thumbnail-tiles">
     <router-link v-for="item in items" :key="item.path" :to="item.path">
       <ld-thumbnail :item="item" />
     </router-link>
-    <div v-if="hasNoResults()" class="noresult">{{noresult}}</div>
   </div>
 </template>
 
@@ -47,11 +47,9 @@ export default class LdPicture extends Vue {
   flex-wrap: wrap;
   align-items: center;
   justify-content: space-evenly;
+
   & > a {
     margin: 2px;
   }
-  & .noresult {
-    margin-top: 40px;
-  }
 }
 </style>
-- 
cgit v1.2.3


From 69dc0d20706ed41e5ecdbb77515066d8a7d7703b Mon Sep 17 00:00:00 2001
From: Zero~Informatique
Date: Fri, 19 Jun 2020 22:12:03 +0200
Subject: viewer: code update (no functional change)

Types { [x: T]: R } updated to Record<T, R>
Methods in template updated to getters (computed in VueJS), which are reactive and cached
Code formatting
---
 viewer/src/components/LdGallery.vue | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

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

diff --git a/viewer/src/components/LdGallery.vue b/viewer/src/components/LdGallery.vue
index e512758..5a72d99 100644
--- a/viewer/src/components/LdGallery.vue
+++ b/viewer/src/components/LdGallery.vue
@@ -18,7 +18,7 @@
 -->
 
 <template>
-  <ld-error v-if="hasNoResults()" icon="search" :message="noresult" />
+  <ld-error v-if="hasNoResults" icon="search" :message="noresult" />
   <div v-else class="thumbnail-tiles">
     <router-link v-for="item in items" :key="item.path" :to="item.path">
       <ld-thumbnail :item="item" />
@@ -35,7 +35,7 @@ export default class LdPicture extends Vue {
   @Prop({ type: Array, required: true }) readonly items!: Gallery.Item[];
   @Prop(String) readonly noresult?: string;
 
-  hasNoResults(): boolean {
+  get hasNoResults(): boolean {
     return Boolean(this.noresult) && this.items.length === 0;
   }
 }
-- 
cgit v1.2.3


From e6c2a8d9653ffde924632ca2f260c3a8cddc14ed Mon Sep 17 00:00:00 2001
From: Zero~Informatique
Date: Fri, 11 Sep 2020 00:15:04 +0200
Subject: viewer: item display order

github: resolves #28
---
 viewer/src/components/LdGallery.vue | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

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

diff --git a/viewer/src/components/LdGallery.vue b/viewer/src/components/LdGallery.vue
index 5a72d99..0c0a43c 100644
--- a/viewer/src/components/LdGallery.vue
+++ b/viewer/src/components/LdGallery.vue
@@ -20,7 +20,7 @@
 <template>
   <ld-error v-if="hasNoResults" icon="search" :message="noresult" />
   <div v-else class="thumbnail-tiles">
-    <router-link v-for="item in items" :key="item.path" :to="item.path">
+    <router-link v-for="item in sortedItems" :key="item.path" :to="item.path">
       <ld-thumbnail :item="item" />
     </router-link>
   </div>
@@ -35,6 +35,10 @@ export default class LdPicture extends Vue {
   @Prop({ type: Array, required: true }) readonly items!: Gallery.Item[];
   @Prop(String) readonly noresult?: string;
 
+  get sortedItems() {
+    return this.items.sort(this.$uiStore.sortFn);
+  }
+
   get hasNoResults(): boolean {
     return Boolean(this.noresult) && this.items.length === 0;
   }
-- 
cgit v1.2.3


From 26210d495aed813baac1095b5c7a7c7879d2d206 Mon Sep 17 00:00:00 2001
From: Zero~Informatique
Date: Fri, 25 Sep 2020 10:42:33 +0200
Subject: viewer: refactor how the available sorts are stored

github: resolves #259
---
 viewer/src/components/LdGallery.vue | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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

diff --git a/viewer/src/components/LdGallery.vue b/viewer/src/components/LdGallery.vue
index 0c0a43c..edd479c 100644
--- a/viewer/src/components/LdGallery.vue
+++ b/viewer/src/components/LdGallery.vue
@@ -36,7 +36,7 @@ export default class LdPicture extends Vue {
   @Prop(String) readonly noresult?: string;
 
   get sortedItems() {
-    return this.items.sort(this.$uiStore.sortFn);
+    return this.items.sort(this.$uiStore.sort.fn);
   }
 
   get hasNoResults(): boolean {
-- 
cgit v1.2.3

