Skip to content

Commit

Permalink
[24.0] Purge history from history panel
Browse files Browse the repository at this point in the history
Clicking on the `Delete History` option from the `HistoryNavigation` dropdown in the `HistoryPanel` now provides you the option to also purge the history from the modal. Fixes galaxyproject#17606
  • Loading branch information
ahmedhamidawan committed Mar 12, 2024
1 parent 858289e commit 1588028
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions client/src/components/History/CurrentHistory/HistoryNavigation.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import {
BDropdownDivider,
BDropdownItem,
BDropdownText,
BFormCheckbox,
BModal,
BSpinner,
} from "bootstrap-vue";
Expand Down Expand Up @@ -63,19 +64,28 @@ interface Props {
historiesLoading?: boolean;
}
withDefaults(defineProps<Props>(), {
const props = withDefaults(defineProps<Props>(), {
title: "Histories",
historiesLoading: false,
});
const showSwitchModal = ref(false);
const purgeHistory = ref(false);
const userStore = useUserStore();
const historyStore = useHistoryStore();
const { isAnonymous } = storeToRefs(userStore);
const { totalHistoryCount } = storeToRefs(historyStore);
function onDelete() {
if (purgeHistory.value) {
historyStore.deleteHistory(props.history.id, true);
} else {
historyStore.deleteHistory(props.history.id, false);
}
}
function userTitle(title: string) {
if (isAnonymous.value) {
return localize("Log in to") + " " + localize(title);
Expand Down Expand Up @@ -264,8 +274,14 @@ function userTitle(title: string) {
id="delete-history-modal"
title="Delete History?"
title-tag="h2"
@ok="historyStore.deleteHistory(history.id, false)">
<p v-localize>Really delete the current history?</p>
@ok="onDelete"
@show="purgeHistory = false">
<p v-localize>
Do you also want to purge the history <i class="ml-1">{{ history.name }}</i>
</p>
<BFormCheckbox id="purge-history" v-model="purgeHistory">
<span v-localize>Purge history</span>
</BFormCheckbox>
</BModal>

<BModal
Expand Down

0 comments on commit 1588028

Please sign in to comment.