Skip to content

Commit

Permalink
Add Tab Navigation to sidebar
Browse files Browse the repository at this point in the history
  • Loading branch information
jatindersingh93 committed Jun 21, 2024
1 parent f27cb89 commit 53b9700
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
20 changes: 18 additions & 2 deletions frontend/src/components/bucket/BucketSidebar.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<!-- eslint-disable vue/valid-v-slot -->
<script setup lang="ts">
import { storeToRefs } from 'pinia';
import { onBeforeMount, ref, watch } from 'vue';
import { onBeforeMount, onMounted, ref, watch } from 'vue';

import { Button } from '@/lib/primevue';
import { usePermissionStore, useUserStore } from '@/store';
Expand All @@ -9,6 +10,7 @@ import { formatDateLong } from '@/utils/formatters';

import type { Ref } from 'vue';
import type { Bucket, BucketPermission } from '@/types';
import { onDialogHide } from '@/utils/utils';

// Props
type Props = {
Expand All @@ -31,6 +33,7 @@ const managedBy: Ref<string | undefined> = ref();

// Actions
const closeSidebarInfo = async () => {
onDialogHide();
emit('close-sidebar-info');
};

Expand Down Expand Up @@ -60,17 +63,30 @@ onBeforeMount(() => {
load();
});

onMounted(() => {
document.getElementById('side-panel').focus();
});

watch(props, () => {
load();
});
</script>

<template>
<div class="side-panel pl-4">
<div
id="side-panel"
tabindex="0"
class="side-panel pl-4"
role="dialog"
aria-modal="true"
aria-labelledby="side-panel_label"
aria-describedby="side-panel_desc"
>
<div class="flex panel-header align-items-start">
<font-awesome-icon icon="fa-solid fa-circle-info" />
<h1 class="mt-0 ml-3 flex-grow-1">Folder details</h1>
<Button
aria-label="Close"
class="p-button-text pt-0"
@click="closeSidebarInfo"
>
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/bucket/BucketTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ const endpointMap = new Map<string, Array<Bucket>>();
const showSidebarInfo = async (id: number) => {
emit('show-sidebar-info', id);
focusedElement.value = document.activeElement;
};
const showBucketConfig = async (bucket: Bucket) => {
Expand Down Expand Up @@ -334,7 +335,6 @@ watch(getBuckets, () => {
class="p-button-lg p-button-rounded p-button-text"
aria-label="Folder details"
@click="showSidebarInfo(node.data.bucketId)"
@keyup.enter="showSidebarInfo(node.data.bucketId)"
>
<font-awesome-icon icon="fa-solid fa-circle-info" />
</Button>
Expand Down

0 comments on commit 53b9700

Please sign in to comment.