Skip to content

Conversation

allison-truhlar
Copy link
Collaborator

@allison-truhlar allison-truhlar commented Oct 3, 2025

Clickup ids: 86aagg1rp and 86aafecg5
This PR is dependent on PR #31 in fileglancer-central.

This PR adds the user groups membership to the data returned by the /profile endpoint, and adds a "isFilteredByGroups" preference that defaults to True. In the client, the Zones are filtered by group membership when this preference is true. The user can toggle the preference on the Preferences page. There is a note at the bottom of the Zone browser indicating whether this preference is on or off with a link to the Preferences page for the user to modify the preference, if desired.

@krokicki

- adds helper function for filtering
- checks preference manager for "filter_zones_by_group" setting. If not present, defaults to True
- this is the case where no fsps are available from the central server (local setup)
- adds helper function for filtering
- checks preference manager for "filter_zones_by_group" setting. If not present, defaults to True
- this is the case where no fsps are available from the central server (local setup)
- as opposed to fetching each preference separately, with one request per preference
Copy link
Member

@krokicki krokicki left a comment

Choose a reason for hiding this comment

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

The code looks correct but I ran into a fatal error that causes the application to stop:
Screenshot 2025-10-04 at 5 29 06 PM

This happens because the fsp is not defined for some favorites:
Screenshot 2025-10-04 at 5 30 45 PM

I'm guessing that this happens because I have favorites to folders outside of my groups.

Also, is there are any reason that the filtering must be server-side? What if we returned the groups as part of the user's profile (/api/fileglancer/profile) which is always requested? Then the filtering could be done quickly on the client side whenever the preference is changed, without additional requests.

@allison-truhlar
Copy link
Collaborator Author

@krokicki I was just starting to think I should do the filtering client-side, motivated by the fact that the request to /file-share-paths is getting cached by the browser and I'm having a hard time forcing it to ignore the cache when the filtering preference changes.

@allison-truhlar allison-truhlar marked this pull request as ready for review October 6, 2025 16:55
@krokicki
Copy link
Member

krokicki commented Oct 7, 2025

I'm getting a different error now:

Screenshot 2025-10-07 at 11 08 15 AM

@allison-truhlar
Copy link
Collaborator Author

@krokicki It should be fixed now - I'm not sure how but this commit I made to revert the file share paths handler back to no group filtering got reversed, so only FSPs in the user's group membership were being passed to the client by default again.

Copy link
Member

@krokicki krokicki left a comment

Choose a reason for hiding this comment

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

Works great! I made a commit to tweak the wording a bit.

@allison-truhlar allison-truhlar merged commit 7968274 into main Oct 8, 2025
5 checks passed
@allison-truhlar allison-truhlar deleted the add-user-groups-to-api branch October 8, 2025 16:36
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.

2 participants