From e4bf56dc52ddf808cc5da747ea2335d3fd0f3a3b Mon Sep 17 00:00:00 2001 From: Ahmed Awan Date: Thu, 30 May 2024 11:44:07 -0500 Subject: [PATCH] hide annotation and tags if no pinned histories in multiview --- .../History/CurrentHistory/HistoryDetails.vue | 2 +- .../components/History/Layout/DetailsLayout.vue | 15 ++++++++++++--- client/src/stores/historyStore.ts | 4 ++++ 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/client/src/components/History/CurrentHistory/HistoryDetails.vue b/client/src/components/History/CurrentHistory/HistoryDetails.vue index 705fe6d960e5..1f736c2b7e18 100644 --- a/client/src/components/History/CurrentHistory/HistoryDetails.vue +++ b/client/src/components/History/CurrentHistory/HistoryDetails.vue @@ -11,7 +11,7 @@ import UtcDate from "@/components/UtcDate.vue"; interface Props { history: HistorySummary; writeable: boolean; - summarized?: "both" | "annotation" | "tags" | "none"; + summarized?: "both" | "annotation" | "tags" | "none" | "hidden"; } const props = withDefaults(defineProps(), { diff --git a/client/src/components/History/Layout/DetailsLayout.vue b/client/src/components/History/Layout/DetailsLayout.vue index 8669fdebeb7c..2498fc2f2d59 100644 --- a/client/src/components/History/Layout/DetailsLayout.vue +++ b/client/src/components/History/Layout/DetailsLayout.vue @@ -20,7 +20,7 @@ interface Props { writeable?: boolean; annotation?: string; showAnnotation?: boolean; - summarized?: "both" | "annotation" | "tags" | "none"; + summarized?: "both" | "annotation" | "tags" | "none" | "hidden"; } const props = withDefaults(defineProps(), { @@ -125,7 +125,9 @@ function selectText() { v-short="annotation" class="mt-2" data-description="annotation value" /> -
+
@@ -206,5 +212,8 @@ function selectText() { .annotation { min-height: 2rem; } + .hidden { + display: none; + } } diff --git a/client/src/stores/historyStore.ts b/client/src/stores/historyStore.ts index 66c737479ef7..5d415ca43ca9 100644 --- a/client/src/stores/historyStore.ts +++ b/client/src/stores/historyStore.ts @@ -99,6 +99,10 @@ export const useHistoryStore = defineStore("historyStore", () => { let tags = false; let loaded = true; + if (pinnedHistories.value.length === 0) { + return "hidden"; + } + for (const h of pinnedHistories.value) { const history = storedHistories.value[h.id]; if (!history) {