Skip to content

Conversation

@TimCsaky
Copy link
Contributor

@TimCsaky TimCsaky commented May 2, 2025

Description

MVP implementation of public folders that can be accessed without login:

  • "My Objects" page (i.e. the one displaying folder contents):
    • Now accessible without login, as long as the folder is public
    • Label indicating that a folder is public, appended next to the folder name
    • Individual object public toggles are disabled if the folder is public
  • "My files" page (i.e. the one that displays all the folders)
    • Labels indicating whether a folder is public
  • Bucket permissions modal
    • New toggle for changing whether a folder is public (or not)
      • This toggle is disabled if the parent folder is public

The following items have been skipped over for now:

  • "File details" sidebar/view; for now:
    • The associated action button has been hidden
    • The link on the filename duplicates the functionality of the "download" button
  • CSS for the bucket public toggle
    • The toggle "switch" is off-centre, but otherwise still perfectly functional

SHOWCASE-3959
SHOWCASE-3960

Types of changes

New feature (non-breaking change which adds functionality)

Checklist

  • I have read the CONTRIBUTING doc
  • I have checked that unit tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)

Further comments

@github-actions
Copy link

github-actions bot commented May 2, 2025

Coverage Report (Application)

Totals Coverage
Statements: 70.67% ( 53 / 75 )
Methods: 62.5% ( 5 / 8 )
Lines: 81.63% ( 40 / 49 )
Branches: 44.44% ( 8 / 18 )

@github-actions
Copy link

github-actions bot commented Sep 17, 2025

Coverage Report (Frontend)

Totals Coverage
Statements: 15.76% ( 837 / 5310 )
Methods: 16.24% ( 158 / 973 )
Lines: 19.36% ( 563 / 2908 )
Branches: 8.12% ( 116 / 1429 )

@github-actions
Copy link

github-actions bot commented Sep 17, 2025

// @ts-ignore: bucketId will always be provided
const currBucketPath = getBucketPath(bucketStore.getBucket(props.bucketId));
const parentPath = currBucketPath.substring(0, currBucketPath.lastIndexOf('/'));
const parentBucket = bucketStore.getBucketByFullPath(parentPath);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think using the store is ok for now..
but i think it requires that the user has visited the 'my files' page already to load any parent folders into the store.

<InputSwitch
v-model="isPublic"
aria-label="Toggle to make public"
:disabled="!isToggleEnabled"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe not a requirement now.. but at some point would be good to add a tooltip indicating why it's disabled.

export { default as ObjectUploadBasic } from './ObjectUploadBasic.vue';
export { default as ObjectUploadFile } from './ObjectUploadFile.vue';
export { default as ObjectVersion } from './ObjectVersion.vue';
export { default as PublicObjectList } from './PublicObjectList.vue';
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dont forget to remove files PublicObjectList.vue PublicObjectTable.vue
if youre not using them

aria-label="Toggle to make public"
:disabled="
!(
!bucketPublic &&
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

my 2cts: i dont see why we wouldnt just hide the toggle if not authenticated, people wont be expecting it.
rather than passing bucketPublic down through a lot of props.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think my train of thought is that bucket.public is already being passed down through multiple components/layers deep (all the way from <ListObjectsView> at the top), since each of the intermediate components need that boolean for themselves as well. Like, save on API calls by making just one to figure out of a bucket is public.

That being said, it does seem a bit odd to have both COMS API calls and depending on props side by side 🤔

order: lazyParams.value.sortOrder === 1 ? 'asc' : 'desc',
tagset: lazyParams.value?.filters?.tags.value
public: !getIsAuthenticated.value ? true : undefined,
tagset: getIsAuthenticated.value ? lazyParams.value?.filters?.tags.value : undefined
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the kind of fine-grained code changes i wanted to avoid by having an alternate view

component: () => import('@/views/list/ListDeletedObjectsView.vue'),
meta: { requiresAuth: true, breadcrumb: '__listDeletedObjectsDynamic', title: 'My Deleted Objects' },
props: createProps
},
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

guess we dont need this anymore

// }
// }

async function fetchBucket(bucketId: string) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need this? i think youre using bucket search endpoint

}
}

// /**
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need this?

@@ -0,0 +1,67 @@
<script setup lang="ts">
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dont thin we need this file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants