Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Activity bar preference handling fixes. #17701

Merged
merged 2 commits into from
Mar 14, 2024
Merged
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
4 changes: 2 additions & 2 deletions client/src/components/Common/PublishedItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,12 @@ const pluralPath = computed(() => plural.value.toLowerCase());
const publishedByUser = computed(() => `/${pluralPath.value}/list_published?f-username=${owner.value}`);
const urlAll = computed(() => `/${pluralPath.value}/list_published`);

const { showActivityBar, showToolbox } = usePanels();
const { showToolbox } = usePanels();
</script>

<template>
<div id="columns" class="d-flex">
<ActivityBar v-if="showActivityBar" />
<ActivityBar />

<FlexPanel v-if="showToolbox" side="left">
<ToolPanel />
Expand Down
4 changes: 2 additions & 2 deletions client/src/components/Masthead/Masthead.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { getActiveTab } from "./utilities";

import NotificationsBell from "@/components/Notifications/NotificationsBell.vue";

const { isAnonymous, showActivityBar } = storeToRefs(useUserStore());
const { isAnonymous } = storeToRefs(useUserStore());

const route = useRoute();
const { config, isConfigLoaded } = useConfig();
Expand Down Expand Up @@ -139,7 +139,7 @@ onMounted(() => {
@open-url="emit('open-url', $event)" />
<MastheadItem v-if="windowTab" :tab="windowTab" :toggle="windowToggle" @click="onWindowToggle" />
<BNavItem
v-if="!isAnonymous && isConfigLoaded && config.enable_notification_system && !showActivityBar"
v-if="!isAnonymous && isConfigLoaded && config.enable_notification_system"
id="notifications-bell">
<NotificationsBell tooltip-placement="bottom" />
</BNavItem>
Expand Down
31 changes: 0 additions & 31 deletions client/src/components/User/UserActivityBarSettings.vue

This file was deleted.

13 changes: 0 additions & 13 deletions client/src/components/User/UserPreferences.vue
Original file line number Diff line number Diff line change
Expand Up @@ -67,16 +67,6 @@
title="Manage Custom Builds"
description="Add or remove custom builds using history datasets."
to="/custom_builds" />
<UserPreferencesElement
icon="fa-th-list"
title="Manage Activity Bar"
description="Click here to show or hide the activity bar."
badge="New!"
@click="toggleActivityBar = !toggleActivityBar">
<b-collapse v-model="toggleActivityBar">
<UserActivityBarSettings />
</b-collapse>
</UserPreferencesElement>
<UserPreferencesElement
v-if="hasThemes"
icon="fa-palette"
Expand Down Expand Up @@ -148,7 +138,6 @@ import Vue from "vue";
import { useConfig } from "@/composables/config";
import { useUserStore } from "@/stores/userStore";

import UserActivityBarSettings from "./UserActivityBarSettings";
import UserBeaconSettings from "./UserBeaconSettings";
import UserDeletion from "./UserDeletion";
import UserPreferencesElement from "./UserPreferencesElement";
Expand All @@ -160,7 +149,6 @@ Vue.use(BootstrapVue);

export default {
components: {
UserActivityBarSettings,
UserDeletion,
UserPreferencesElement,
ThemeSelector,
Expand Down Expand Up @@ -190,7 +178,6 @@ export default {
message: null,
showLogoutModal: false,
showDataPrivateModal: false,
toggleActivityBar: false,
toggleTheme: false,
};
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ watch(
}
);

const { showActivityBar, showToolbox } = usePanels();
const { showToolbox } = usePanels();

const downloadUrl = computed(() => withPrefix(`/api/workflows/${props.id}/download?format=json-download`));
const importUrl = computed(() => withPrefix(`/workflow/imp?id=${props.id}`));
Expand All @@ -156,7 +156,7 @@ const viewUrl = computed(() => withPrefix(`/published/workflow?id=${props.id}`))

<template>
<div id="columns" class="d-flex">
<ActivityBar v-if="!props.embed && showActivityBar" />
<ActivityBar v-if="!props.embed" />
<FlexPanel v-if="!props.embed && showToolbox" side="left">
<ToolPanel />
</FlexPanel>
Expand Down
7 changes: 1 addition & 6 deletions client/src/composables/usePanels.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
import { computed } from "vue";
import { useRoute } from "vue-router/composables";

import { useUserStore } from "@/stores/userStore";

export function usePanels() {
const userStore = useUserStore();
const route = useRoute();

const showPanels = computed(() => {
Expand All @@ -15,12 +12,10 @@ export function usePanels() {
return true;
});

const showActivityBar = computed(() => showPanels.value && userStore.showActivityBar);
const showToolbox = computed(() => showPanels.value && !showActivityBar.value);
const showToolbox = computed(() => showPanels.value);

return {
showPanels,
showActivityBar,
showToolbox,
};
}
8 changes: 2 additions & 6 deletions client/src/entry/analysis/modules/Analysis.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,11 @@ import CenterFrame from "./CenterFrame.vue";
import ActivityBar from "@/components/ActivityBar/ActivityBar.vue";
import HistoryIndex from "@/components/History/Index.vue";
import FlexPanel from "@/components/Panels/FlexPanel.vue";
import ToolPanel from "@/components/Panels/ToolPanel.vue";
import DragAndDropModal from "@/components/Upload/DragAndDropModal.vue";

const router = useRouter();
const showCenter = ref(false);
const { showActivityBar, showToolbox, showPanels } = usePanels();
const { showPanels } = usePanels();

// methods
function hideCenter() {
Expand All @@ -38,10 +37,7 @@ onUnmounted(() => {

<template>
<div id="columns" class="d-flex">
<ActivityBar v-if="showActivityBar" />
<FlexPanel v-if="showToolbox" side="left">
<ToolPanel />
</FlexPanel>
<ActivityBar />
<div id="center" class="overflow-auto p-3 w-100">
<CenterFrame v-show="showCenter" id="galaxy_main" @load="onLoad" />
<router-view v-show="!showCenter" :key="$route.fullPath" class="h-100" />
Expand Down
7 changes: 0 additions & 7 deletions client/src/stores/userStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ export const useUserStore = defineStore("userStore", () => {

// explicitly pass current User, because userStore might not exist yet
const toggledSideBar = useUserLocalStorage("user-store-toggled-side-bar", "tools", currentUser);
const showActivityBar = useUserLocalStorage("user-store-show-activity-bar", true, currentUser);
const preferredListViewMode = useUserLocalStorage("user-store-preferred-list-view-mode", "grid", currentUser);

let loadPromise: Promise<void> | null = null;
Expand Down Expand Up @@ -135,10 +134,6 @@ export const useUserStore = defineStore("userStore", () => {
preferredListViewMode.value = view;
}

function toggleActivityBar() {
showActivityBar.value = !showActivityBar.value;
}

function toggleSideBar(currentOpen = "") {
toggledSideBar.value = toggledSideBar.value === currentOpen ? "" : currentOpen;
}
Expand All @@ -153,7 +148,6 @@ export const useUserStore = defineStore("userStore", () => {
isAnonymous,
currentTheme,
currentFavorites,
showActivityBar,
toggledSideBar,
preferredListViewMode,
loadUser,
Expand All @@ -162,7 +156,6 @@ export const useUserStore = defineStore("userStore", () => {
setPreferredListViewMode,
addFavoriteTool,
removeFavoriteTool,
toggleActivityBar,
toggleSideBar,
isRegisteredUser,
$reset,
Expand Down
Loading