diff --git a/client/src/components/History/CurrentHistory/HistoryNavigation.vue b/client/src/components/History/CurrentHistory/HistoryNavigation.vue index 7420c8f2e53..7084e2713bf 100644 --- a/client/src/components/History/CurrentHistory/HistoryNavigation.vue +++ b/client/src/components/History/CurrentHistory/HistoryNavigation.vue @@ -71,7 +71,12 @@ const props = withDefaults(defineProps(), { minimal: false, }); +// modal refs const showSwitchModal = ref(false); +const showDeleteModal = ref(false); +const showPrivacyModal = ref(false); +const showCopyModal = ref(false); + const purgeHistory = ref(false); const userStore = useUserStore(); @@ -202,17 +207,17 @@ function userTitle(title: string) { + :title="userTitle('Copy History to a New History')" + @click="showCopyModal = !showCopyModal"> Copy this History + :title="localize('Permanently Delete History')" + @click="showDeleteModal = !showDeleteModal"> Delete this History @@ -278,9 +283,9 @@ function userTitle(title: string) { + :title="userTitle('Make this History Private')" + @click="showPrivacyModal = !showPrivacyModal"> Make Private @@ -297,13 +302,19 @@ function userTitle(title: string) { :show-modal.sync="showSwitchModal" @selectHistory="historyStore.setCurrentHistory($event.id)" /> - + +

+ History: + {{ history.name }} +

This will make all the data in this history private (excluding library datasets), and will set permissions such that all new data is created as private. Any datasets within that are currently shared @@ -312,7 +323,7 @@ function userTitle(title: string) { (); +const props = withDefaults(defineProps(), { + showModal: false, +}); + +const emit = defineEmits<{ + (e: "update:show-modal", value: boolean): void; +}>(); const userStore = useUserStore(); const historyStore = useHistoryStore(); @@ -32,6 +39,7 @@ const { currentUser, isAnonymous } = storeToRefs(userStore); const name = ref(""); const copyAll = ref(false); const loading = ref(false); +const localShowModal = ref(props.showModal); const title = computed(() => { return `Copying History: ${props.history.name}`; @@ -55,6 +63,18 @@ const formValid = computed(() => { return newNameValid.value; }); +watch( + () => props.showModal, + (newVal) => { + localShowModal.value = newVal; + } +); +watch( + () => localShowModal.value, + (newVal) => { + emit("update:show-modal", newVal); + } +); watch( () => props.history, (newHistory) => { @@ -74,7 +94,7 @@ async function copy(close: () => void) {