diff --git a/frontend/src/components/bucket/BucketPermission.vue b/frontend/src/components/bucket/BucketPermission.vue index 1cb4b2e9..38b3297d 100644 --- a/frontend/src/components/bucket/BucketPermission.vue +++ b/frontend/src/components/bucket/BucketPermission.vue @@ -123,7 +123,7 @@ onBeforeMount(async () => { v-model="data.create" input-id="create" :binary="true" - @update:model-value="(value:boolean) => updateBucketPermission(value, data.userId, Permissions.CREATE)" + @update:model-value="(value: boolean) => updateBucketPermission(value, data.userId, Permissions.CREATE)" /> @@ -137,7 +137,7 @@ onBeforeMount(async () => { v-model="data.read" input-id="read" :binary="true" - @update:model-value="(value:boolean) => updateBucketPermission(value, data.userId, Permissions.READ)" + @update:model-value="(value: boolean) => updateBucketPermission(value, data.userId, Permissions.READ)" /> @@ -151,7 +151,7 @@ onBeforeMount(async () => { v-model="data.update" input-id="update" :binary="true" - @update:model-value="(value:boolean) => updateBucketPermission(value, data.userId, Permissions.UPDATE)" + @update:model-value="(value: boolean) => updateBucketPermission(value, data.userId, Permissions.UPDATE)" /> @@ -165,7 +165,7 @@ onBeforeMount(async () => { v-model="data.delete" input-id="delete" :binary="true" - @update:model-value="(value:boolean) => updateBucketPermission(value, data.userId, Permissions.DELETE)" + @update:model-value="(value: boolean) => updateBucketPermission(value, data.userId, Permissions.DELETE)" /> @@ -180,7 +180,7 @@ onBeforeMount(async () => { input-id="manage" :binary="true" :disabled="!data.elevatedRights" - @update:model-value="(value:boolean) => updateBucketPermission(value, data.userId, Permissions.MANAGE)" + @update:model-value="(value: boolean) => updateBucketPermission(value, data.userId, Permissions.MANAGE)" /> diff --git a/frontend/src/components/bucket/BucketTable.vue b/frontend/src/components/bucket/BucketTable.vue index f189e9f5..87a10e9d 100644 --- a/frontend/src/components/bucket/BucketTable.vue +++ b/frontend/src/components/bucket/BucketTable.vue @@ -322,6 +322,7 @@ watch(getBuckets, () => { diff --git a/frontend/src/components/common/Invite.vue b/frontend/src/components/common/Invite.vue index 2fea8b88..8a687f14 100644 --- a/frontend/src/components/common/Invite.vue +++ b/frontend/src/components/common/Invite.vue @@ -31,6 +31,11 @@ const toast = useToast(); // State const inviteLoading: Ref = ref(false); +const permHelpLink: Ref = computed(() => { + return props.resourceType === 'bucket' + ? 'https://github.com/bcgov/bcbox/wiki/My-Files#folder-permissions' + : 'https://github.com/bcgov/bcbox/wiki/Files#file-permissions'; +}); const timeFrames: Record = { '1 Hour': 3600, @@ -58,6 +63,7 @@ const selectedOptions = computed(() => { // Form validation schema const schema = yup.object().shape({ + permCodes: yup.array().min(1, 'Select one or more access options'), email: yup .string() .matches(new RegExp(Regex.EMAIL), 'Provide a valid email address') @@ -87,7 +93,7 @@ const { values, defineField, handleSubmit } = useForm({ validationSchema: schema, initialValues: { expiresAt: 86400, - permCodes: ['READ'], + permCodes: props.resourceType === 'object' ? ['READ'] : [], email: '', emailType: 'single', multiEmail: '' @@ -100,6 +106,10 @@ const [emailType] = defineField('emailType', {}); const [email] = defineField('email', {}); const [multiEmail] = defineField('multiEmail', {}); +// require READ perm for file invites +const isDisabled = (optionValue: string) => { + return props.resourceType === 'object' && optionValue === 'READ'; +}; // Invite form is submitted const onSubmit = handleSubmit(async (values: any) => { inviteLoading.value = true; @@ -135,7 +145,7 @@ const onSubmit = handleSubmit(async (values: any) => { {{ props.label }} Make invite available for - + { - Access options - - - - Access options + + + - {{ name }} - + + + {{ name }} + + + + + Get help understanding permissions + + + Send to @@ -267,4 +291,7 @@ const onSubmit = handleSubmit(async (values: any) => { .multi-email { width: 100%; } +.help { + line-height: 1.6rem; +}
Make invite available for
Access options
Send to