Skip to content

Commit

Permalink
More cleanup after the activity bar default swap. With it enabled by
Browse files Browse the repository at this point in the history
default and the only option, there is no need for a separate store or
user preference setting -- various items are now accessible *only*
through the activity bar and it is part of the standard interface.
  • Loading branch information
dannon committed Mar 13, 2024
1 parent e2b67da commit 0afd536
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 62 deletions.
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
4 changes: 1 addition & 3 deletions client/src/composables/usePanels.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,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,
};
}
4 changes: 2 additions & 2 deletions client/src/entry/analysis/modules/Analysis.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import DragAndDropModal from "@/components/Upload/DragAndDropModal.vue";
const router = useRouter();
const showCenter = ref(false);
const { showActivityBar, showToolbox, showPanels } = usePanels();
const { showToolbox, showPanels } = usePanels();
// methods
function hideCenter() {
Expand All @@ -38,7 +38,7 @@ onUnmounted(() => {

<template>
<div id="columns" class="d-flex">
<ActivityBar v-if="showActivityBar" />
<ActivityBar />
<FlexPanel v-if="showToolbox" side="left">
<ToolPanel />
</FlexPanel>
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

0 comments on commit 0afd536

Please sign in to comment.