From f89ed0bd94ea570d9e6533301783d13b13033db0 Mon Sep 17 00:00:00 2001
From: Zero~Informatique
Date: Fri, 11 Sep 2020 20:10:56 +0200
Subject: viewer: PR #238 code review changes
---
viewer/src/components/LdCommandSort.vue | 6 +++---
viewer/src/components/LdProposition.vue | 13 +++++++++----
2 files changed, 12 insertions(+), 7 deletions(-)
(limited to 'viewer/src/components')
diff --git a/viewer/src/components/LdCommandSort.vue b/viewer/src/components/LdCommandSort.vue
index 1d2eac3..1eef5d3 100644
--- a/viewer/src/components/LdCommandSort.vue
+++ b/viewer/src/components/LdCommandSort.vue
@@ -25,7 +25,7 @@
- {{ sort.name }}
+ {{ sort.name }}
@@ -38,7 +38,7 @@ import ItemSortFn from "@/services/itemSortFn";
@Component
export default class LdCommandSort extends Vue {
readonly SORTS = [
- { name: this.$t("command.sort.byName"), fn: ItemSortFn.sortByName },
+ { name: this.$t("command.sort.byNameAsc"), fn: ItemSortFn.sortByNameAsc },
{ name: this.$t("command.sort.byDateDesc"), fn: ItemSortFn.sortByDateDesc },
];
@@ -51,7 +51,7 @@ export default class LdCommandSort extends Vue {
diff --git a/viewer/src/components/LdProposition.vue b/viewer/src/components/LdProposition.vue
index e19e01a..34ddf51 100644
--- a/viewer/src/components/LdProposition.vue
+++ b/viewer/src/components/LdProposition.vue
@@ -47,8 +47,8 @@
{{ proposed.count }}
-
- {{ $t("tag-propositions.showmore", [showMore]) }}
+
+ {{ $t("tag-propositions.showmore", [showMoreCount]) }}
@@ -65,10 +65,15 @@ export default class LdProposition extends Vue {
@Prop({ required: true }) readonly tagsIndex!: Tag.Index;
@PropSync("searchFilters", { type: Array, required: true }) model!: Tag.Search[];
- readonly INITIAL_TAG_DISPLAY_LIMIT = this.$galleryStore.config?.initialTagDisplayLimit ?? 10;
+ readonly INITIAL_TAG_DISPLAY_LIMIT = this.getInitialTagDisplayLimit();
limit: number = this.INITIAL_TAG_DISPLAY_LIMIT;
+ getInitialTagDisplayLimit() {
+ const limit = this.$galleryStore.config?.initialTagDisplayLimit ?? 10;
+ return limit > 0 ? limit : 1000;
+ }
+
@Watch("$route")
onRouteChange() {
this.limit = this.INITIAL_TAG_DISPLAY_LIMIT;
@@ -105,7 +110,7 @@ export default class LdProposition extends Vue {
.map(entry => ({ rawTag: entry[0], count: entry[1] }));
}
- get showMore(): number {
+ get showMoreCount(): number {
return Object.keys(this.propositions).length - Object.keys(this.proposedTags).length;
}
--
cgit v1.2.3