Skip to content

Commit

Permalink
Tab Navigation for configure folder
Browse files Browse the repository at this point in the history
  • Loading branch information
jatindersingh93 committed Jun 19, 2024
1 parent 4eb0788 commit 77496c7
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 7 deletions.
2 changes: 1 addition & 1 deletion frontend/src/components/bucket/BucketConfigForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ const onCancel = () => {
placeholder="My Documents"
help-text="Your custom display name for the storage location,
shown in BCBox as a folder. Any name as you would like to see it listed in BCBox."
autofocus
focus-trap
/>
<TextInput
name="bucket"
Expand Down
17 changes: 15 additions & 2 deletions frontend/src/components/bucket/BucketList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { BucketConfigForm, BucketSidebar, BucketTable } from '@/components/bucke
import { Button, Dialog, Message } from '@/lib/primevue';
import { useAuthStore, useBucketStore, useConfigStore, usePermissionStore } from '@/store';
import { BucketConfig } from '@/utils/constants';
import { onDialogHide } from '@/utils/utils';
import type { Ref } from 'vue';
import type { Bucket } from '@/types';
Expand Down Expand Up @@ -38,6 +39,7 @@ const showBucketConfig = (bucket?: Bucket) => {
const closeBucketConfig = () => {
displayBucketConfig.value = false;
onDialogHide();
};
onMounted(async () => {
Expand Down Expand Up @@ -78,21 +80,32 @@ onMounted(async () => {
<!-- Bucket config dialog -->
<Dialog
id="config_dialog"
class="bcbox-info-dialog"
:visible="displayBucketConfig"
:style="{ width: '50vw' }"
:modal="true"
aria-labelledby="config_dialog_label"
aria-describedby="config_dialog_desc"
@update:visible="closeBucketConfig"
>
<template #header>
<font-awesome-icon
icon="fas fa-cog"
fixed-width
/>
<span class="p-dialog-title">{{ BucketConfig.HEADER_NEW_BUCKET }}</span>
<span
id="config_dialog_label"
class="p-dialog-title"
>
{{ BucketConfig.HEADER_NEW_BUCKET }}
</span>
</template>
<h3 class="bcbox-info-dialog-subhead">
<h3
id="config_dialog_label"
class="bcbox-info-dialog-subhead"
>
{{ bucketConfigTitle }}
</h3>
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 @@ -52,6 +52,7 @@ const showSidebarInfo = async (id: number) => {
};
const showBucketConfig = async (bucket: Bucket) => {
focusedElement.value = document.activeElement;
emit('show-bucket-config', bucket);
};
Expand Down Expand Up @@ -309,7 +310,6 @@ watch(getBuckets, () => {
class="p-button-lg p-button-text"
aria-label="Configure folder"
@click="showBucketConfig(node.data)"
@keyup.enter="showBucketConfig(node.data)"
>
<font-awesome-icon icon="fas fa-cog" />
</Button>
Expand Down
15 changes: 12 additions & 3 deletions frontend/src/components/common/ShareButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ import { Invite, Share } from '@/components/common';
import { Button, Dialog, TabView, TabPanel } from '@/lib/primevue';
import { Permissions } from '@/utils/constants';
import { useAuthStore, useObjectStore, usePermissionStore, useBucketStore } from '@/store';
import { useAuthStore, useObjectStore, usePermissionStore, useBucketStore, useNavStore } from '@/store';
import { onDialogHide } from '@/utils/utils';
import type { Ref } from 'vue';
Expand All @@ -32,6 +33,7 @@ const objectStore = useObjectStore();
const bucketStore = useBucketStore();
const { getUserId } = storeToRefs(useAuthStore());
const permissionStore = usePermissionStore();
const { focusedElement } = storeToRefs(useNavStore());
// State
const resourceType = props.objectId ? ref('object') : ref('bucket');
Expand All @@ -54,6 +56,13 @@ const hasManagePermission: Ref<boolean> = computed(() => {
// Dialog
const displayShareDialog = ref(false);
const showDialog = (x: boolean) => {
displayShareDialog.value = x;
if (displayShareDialog.value) {
focusedElement.value = document.activeElement;
}
};
</script>

<template>
Expand All @@ -67,6 +76,7 @@ const displayShareDialog = ref(false);
aria-labelledby="share_dialog_label"
aria-describedby="share_dialog_desc"
focus-trap
@after-hide="onDialogHide"
>
<template #header>
<font-awesome-icon
Expand Down Expand Up @@ -139,8 +149,7 @@ const displayShareDialog = ref(false);
v-tooltip.bottom="`Share ${props.labelText.toLocaleLowerCase()}`"
class="p-button-lg p-button-text primary"
:aria-label="`Share ${props.labelText.toLocaleLowerCase()}`"
@click="displayShareDialog = true"
@keyup.enter="displayShareDialog = true"
@click="showDialog(true)"
>
<font-awesome-icon icon="fa-solid fa-share-alt" />
</Button>
Expand Down

0 comments on commit 77496c7

Please sign in to comment.