Skip to content

Commit

Permalink
Tab Navigation for Child configuration model
Browse files Browse the repository at this point in the history
  • Loading branch information
jatindersingh93 committed Jun 13, 2024
1 parent 006527d commit 2b6290f
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 7 deletions.
33 changes: 27 additions & 6 deletions frontend/src/components/bucket/BucketChildConfig.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ import { object, string } from 'yup';
import TextInput from '@/components/form/TextInput.vue';
import { Button, Dialog, Message, useToast } from '@/lib/primevue';
import { useAuthStore, useBucketStore } from '@/store';
import { useAuthStore, useBucketStore, useNavStore } from '@/store';
import { onDialogHide } from '@/utils/utils';
import type { Ref } from 'vue';
import type { Bucket } from '@/types';
Expand All @@ -19,6 +20,7 @@ const props = defineProps<{
// Store
const bucketStore = useBucketStore();
const { getUserId } = storeToRefs(useAuthStore());
const { focusedElement } = storeToRefs(useNavStore());
// Form validation
const validationMessages: Ref<Array<string>> = ref([]);
Expand All @@ -33,7 +35,12 @@ const schema = object({
const toast = useToast();
const dialogIsVisible: Ref<boolean> = ref(false);
const showDialog = (x: boolean) => {
//debugger;
dialogIsVisible.value = x;
if (dialogIsVisible.value) {
focusedElement.value = document.activeElement;
//document?.getElementById('subfolder_label')?.focus(); TODO this can be delete
}
};
const onSubmit = async (values: any) => {
Expand Down Expand Up @@ -64,7 +71,6 @@ const onCancel = () => {
class="p-button-lg p-button-text"
aria-label="Add subfolder"
@click="showDialog(true)"
@keyup.enter="showDialog(true)"
>
<font-awesome-icon icon="fa-solid fa-folder-plus" />
</Button>
Expand All @@ -75,21 +81,36 @@ const onCancel = () => {
:modal="true"
:visible="dialogIsVisible"
@update:visible="showDialog(false)"
aria-labelledby="subfolder_label"

Check warning on line 84 in frontend/src/components/bucket/BucketChildConfig.vue

View workflow job for this annotation

GitHub Actions / Unit Tests (Frontend) (16.x)

Attribute "aria-labelledby" should go before "@update:visible"

Check warning on line 84 in frontend/src/components/bucket/BucketChildConfig.vue

View workflow job for this annotation

GitHub Actions / Unit Tests (Frontend) (18.x)

Attribute "aria-labelledby" should go before "@update:visible"

Check warning on line 84 in frontend/src/components/bucket/BucketChildConfig.vue

View workflow job for this annotation

GitHub Actions / Unit Tests (Frontend) (20.x)

Attribute "aria-labelledby" should go before "@update:visible"

Check warning on line 84 in frontend/src/components/bucket/BucketChildConfig.vue

View workflow job for this annotation

GitHub Actions / Unit Tests (Frontend) (16.x)

Attribute "aria-labelledby" should go before "@update:visible"

Check warning on line 84 in frontend/src/components/bucket/BucketChildConfig.vue

View workflow job for this annotation

GitHub Actions / Unit Tests (Frontend) (18.x)

Attribute "aria-labelledby" should go before "@update:visible"

Check warning on line 84 in frontend/src/components/bucket/BucketChildConfig.vue

View workflow job for this annotation

GitHub Actions / Unit Tests (Frontend) (20.x)

Attribute "aria-labelledby" should go before "@update:visible"
aria-describedby="subfolder_desc"

Check warning on line 85 in frontend/src/components/bucket/BucketChildConfig.vue

View workflow job for this annotation

GitHub Actions / Unit Tests (Frontend) (16.x)

Attribute "aria-describedby" should go before "@update:visible"

Check warning on line 85 in frontend/src/components/bucket/BucketChildConfig.vue

View workflow job for this annotation

GitHub Actions / Unit Tests (Frontend) (18.x)

Attribute "aria-describedby" should go before "@update:visible"

Check warning on line 85 in frontend/src/components/bucket/BucketChildConfig.vue

View workflow job for this annotation

GitHub Actions / Unit Tests (Frontend) (20.x)

Attribute "aria-describedby" should go before "@update:visible"

Check warning on line 85 in frontend/src/components/bucket/BucketChildConfig.vue

View workflow job for this annotation

GitHub Actions / Unit Tests (Frontend) (16.x)

Attribute "aria-describedby" should go before "@update:visible"

Check warning on line 85 in frontend/src/components/bucket/BucketChildConfig.vue

View workflow job for this annotation

GitHub Actions / Unit Tests (Frontend) (18.x)

Attribute "aria-describedby" should go before "@update:visible"

Check warning on line 85 in frontend/src/components/bucket/BucketChildConfig.vue

View workflow job for this annotation

GitHub Actions / Unit Tests (Frontend) (20.x)

Attribute "aria-describedby" should go before "@update:visible"
@after-hide="onDialogHide"
>
<template #header>
<font-awesome-icon
icon="fas fa-cog"
fixed-width
/>
<span class="p-dialog-title">Add subfolder</span>
<span
id="subfolder_label"
class="p-dialog-title"
>
Add subfolder
</span>
</template>

<h3 class="bcbox-info-dialog-subhead mb-0">{{ props.parentBucket.bucketName }}</h3>
<h3
id="subfolder_desc"
class="bcbox-info-dialog-subhead mb-0"
>
{{ props.parentBucket.bucketName }}
</h3>
<ul class="mt-0 pl-3">
<li>Sets a subfolder to appear within a folder</li>
</ul>
<Form
:validation-schema="schema"
role="form"
id="add-subfolder"

Check warning on line 112 in frontend/src/components/bucket/BucketChildConfig.vue

View workflow job for this annotation

GitHub Actions / Unit Tests (Frontend) (16.x)

Attribute "id" should go before "role"

Check warning on line 112 in frontend/src/components/bucket/BucketChildConfig.vue

View workflow job for this annotation

GitHub Actions / Unit Tests (Frontend) (18.x)

Attribute "id" should go before "role"

Check warning on line 112 in frontend/src/components/bucket/BucketChildConfig.vue

View workflow job for this annotation

GitHub Actions / Unit Tests (Frontend) (20.x)

Attribute "id" should go before "role"

Check warning on line 112 in frontend/src/components/bucket/BucketChildConfig.vue

View workflow job for this annotation

GitHub Actions / Unit Tests (Frontend) (16.x)

Attribute "id" should go before "role"

Check warning on line 112 in frontend/src/components/bucket/BucketChildConfig.vue

View workflow job for this annotation

GitHub Actions / Unit Tests (Frontend) (18.x)

Attribute "id" should go before "role"

Check warning on line 112 in frontend/src/components/bucket/BucketChildConfig.vue

View workflow job for this annotation

GitHub Actions / Unit Tests (Frontend) (20.x)

Attribute "id" should go before "role"
aria-label="Add subfolder"
@submit="onSubmit"
>
<Message
Expand All @@ -108,14 +129,14 @@ const onCancel = () => {
but it can't be changed after it is set.<br />
Folder levels are supported using '/' between levels (for example: 2024/January/my-documents).`"
class="child-input"
focus-trap
/>
<TextInput
name="bucketName"
label="Folder display name *"
placeholder="My Documents"
help-text="Your custom display name for the subfolder - any name as you would like to see it listed in BCBox."
class="child-input"
autofocus
/>
<Button
class="p-button mt-2 mr-2"
Expand Down
1 change: 0 additions & 1 deletion frontend/src/components/bucket/BucketTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,6 @@ watch(getBuckets, () => {
class="p-button-lg p-button-text"
aria-label="Folder permissions"
@click="showPermissions(node.data.bucketId, node.data.bucketName)"
@keyup.enter="showPermissions(node.data.bucketId, node.data.bucketName)"
>
<font-awesome-icon icon="fa-solid fa-users" />
</Button>
Expand Down

0 comments on commit 2b6290f

Please sign in to comment.