From a8db810af5a6e7b18d9682d0b69c2f564f010292 Mon Sep 17 00:00:00 2001
From: davelopez <46503462+davelopez@users.noreply.github.com>
Date: Mon, 27 May 2024 10:32:21 +0200
Subject: [PATCH] Disable unavailable elements in History menu for immutable
histories
---
.../CurrentHistory/HistoryNavigation.vue | 17 +++++++++++------
1 file changed, 11 insertions(+), 6 deletions(-)
diff --git a/client/src/components/History/CurrentHistory/HistoryNavigation.vue b/client/src/components/History/CurrentHistory/HistoryNavigation.vue
index e433f5a5738a..7b31df06ecfe 100644
--- a/client/src/components/History/CurrentHistory/HistoryNavigation.vue
+++ b/client/src/components/History/CurrentHistory/HistoryNavigation.vue
@@ -30,9 +30,9 @@ import {
BSpinner,
} from "bootstrap-vue";
import { storeToRefs } from "pinia";
-import { ref } from "vue";
+import { computed, ref } from "vue";
-import type { HistorySummary } from "@/api";
+import { canMutateHistory, type HistorySummary } from "@/api";
import { iframeRedirect } from "@/components/plugins/legacyNavigation";
import { useHistoryStore } from "@/stores/historyStore";
import { useUserStore } from "@/stores/userStore";
@@ -80,6 +80,10 @@ const historyStore = useHistoryStore();
const { isAnonymous } = storeToRefs(userStore);
const { totalHistoryCount } = storeToRefs(historyStore);
+const canEditHistory = computed(() => {
+ return canMutateHistory(props.history);
+});
+
function onDelete() {
if (purgeHistory.value) {
historyStore.deleteHistory(props.history.id, true);
@@ -161,6 +165,7 @@ function userTitle(title: string) {
@@ -198,7 +203,7 @@ function userTitle(title: string) {
@@ -225,7 +230,7 @@ function userTitle(title: string) {
@@ -234,7 +239,7 @@ function userTitle(title: string) {
@@ -243,7 +248,7 @@ function userTitle(title: string) {
Make Private