Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions client/src/components/History/CurrentHistory/HistoryNavigation.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup lang="ts">
import { faExchangeAlt, faPlus, faSpinner } from "@fortawesome/free-solid-svg-icons";
import { faChevronRight, faExchangeAlt, faPlus, faSpinner } from "@fortawesome/free-solid-svg-icons";
import { FontAwesomeIcon } from "@fortawesome/vue-fontawesome";
import { BButton, BButtonGroup } from "bootstrap-vue";
import { storeToRefs } from "pinia";
Expand All @@ -10,6 +10,7 @@ import { useHistoryStore } from "@/stores/historyStore";
import { useUserStore } from "@/stores/userStore";
import localize from "@/utils/localization";

import GButton from "@/components/BaseComponents/GButton.vue";
import HistoryOptions from "@/components/History/HistoryOptions.vue";
import SelectorModal from "@/components/History/Modals/SelectorModal.vue";

Expand All @@ -22,6 +23,10 @@ const props = withDefaults(defineProps<Props>(), {
minimal: false,
});

const emit = defineEmits<{
(e: "show", showPanel: boolean): void;
}>();

const historyStore = useHistoryStore();
const { histories, changingCurrentHistory } = storeToRefs(historyStore);

Expand All @@ -45,7 +50,10 @@ function userTitle(title: string) {
<nav
:class="{ 'd-flex justify-content-between mx-3 my-2': !props.minimal }"
aria-label="current history management">
<h2 v-if="!props.minimal" class="m-1 h-sm">History</h2>
<GButton v-if="!props.minimal" size="small" transparent @click="emit('show', false)">
<FontAwesomeIcon fixed-width :icon="faChevronRight" />
<span>History</span>
</GButton>

<BButtonGroup>
<BButton
Expand Down
6 changes: 5 additions & 1 deletion client/src/components/History/Index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ import CurrentCollection from "@/components/History/CurrentCollection/Collection
import HistoryNavigation from "@/components/History/CurrentHistory/HistoryNavigation.vue";
import HistoryPanel from "@/components/History/CurrentHistory/HistoryPanel.vue";

const emit = defineEmits<{
(e: "show", showPanel: boolean): void;
}>();

const userStore = useUserStore();
const historyStore = useHistoryStore();

Expand Down Expand Up @@ -37,7 +41,7 @@ function onViewCollection(collection: CollectionEntry, currentOffset?: number) {
:filterable="true"
@view-collection="onViewCollection">
<template v-slot:navigation>
<HistoryNavigation :history="currentHistory" />
<HistoryNavigation :history="currentHistory" @show="(val) => emit('show', val)" />
</template>
</HistoryPanel>

Expand Down
4 changes: 4 additions & 0 deletions client/src/components/Panels/FlexPanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@ const sideClasses = computed(() => ({
left: props.side === "left",
right: props.side === "right",
}));

defineExpose({
show,
});
</script>

<template>
Expand Down
12 changes: 10 additions & 2 deletions client/src/entry/analysis/modules/Analysis.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,21 @@ const router = useRouter();
const showCenter = ref(false);
const { showPanels } = usePanels();

const historyPanel = ref(null);

const { historyPanelWidth } = storeToRefs(useUserStore());

// methods
function hideCenter() {
showCenter.value = false;
}

function onShow(showPanel) {
if (historyPanel.value) {
historyPanel.value.show = showPanel;
}
}

function onLoad() {
showCenter.value = true;
}
Expand All @@ -48,8 +56,8 @@ onUnmounted(() => {
<router-view :key="$route.fullPath" class="h-100" />
</div>
</div>
<FlexPanel v-if="showPanels" side="right" :reactive-width.sync="historyPanelWidth">
<HistoryIndex />
<FlexPanel v-if="showPanels" ref="historyPanel" side="right" :reactive-width.sync="historyPanelWidth">
<HistoryIndex @show="onShow" />
</FlexPanel>
<DragAndDropModal />
</div>
Expand Down
Loading