Skip to content

Permission management for User group in front-end #3432

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: user-groups/listing
Choose a base branch
from

Conversation

ildyria
Copy link
Member

@ildyria ildyria commented Jun 10, 2025

This pull request introduces support for sharing albums with both individual users and user groups. It refactors the sharing-related components to accommodate this new functionality by introducing a unified UserOrGroup type and updating the UI and logic accordingly.

Support for User and Group Sharing:

  • New UserOrGroup Type and Utility Functions: Added a new UserOrGroup type and useSearchUserGroupComputed composable to manage shared users and groups, including loading, filtering, and selecting them. (resources/js/composables/search/searchUserGroupComputed.ts)
  • Updated Sharing Data Structure: Modified components like AlbumCreateShareDialog, AlbumTransfer, BulkSharingModal, and CreateSharing to handle both user and group IDs when creating sharing permissions. (resources/js/components/forms/album/AlbumCreateShareDialog.vue, resources/js/components/forms/sharing/BulkSharingModal.vue, and others) [1] [2] [3]

UI Enhancements:

  • Dynamic Styling for Groups: Updated UI elements to dynamically style group names differently, using the text-primary-emphasis class for groups. (resources/js/components/forms/album/AlbumCreateShareDialog.vue, resources/js/components/forms/sharing/ShareLine.vue) [1] [2]
  • Improved Select Components: Updated SearchTargetUser and other components to display both users and groups in dropdowns and lists, with clear visual differentiation. (resources/js/components/forms/album/SearchTargetUser.vue, resources/js/components/forms/sharing/BulkSharingModal.vue) [1] [2]

Refactoring for Consistency:

  • Unified Props and Data Types: Replaced LightUserResource with the new UserOrGroup type across multiple components for consistency and to support groups. (resources/js/components/forms/album/AlbumCreateShareDialog.vue, resources/js/components/forms/sharing/CreateSharing.vue) [1] [2]
  • Removed Legacy Code: Refactored and removed redundant logic for filtering and loading users, replacing it with the new composable. (resources/js/components/forms/album/SearchTargetUser.vue, resources/js/components/forms/sharing/BulkSharingModal.vue) [1] [2]

These changes enhance the flexibility of the sharing functionality while maintaining a clean and consistent codebase.

Copy link

codecov bot commented Jun 10, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 86.67%. Comparing base (2982aa2) to head (4c9331d).

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@ildyria ildyria force-pushed the user-groups/listing-frontend branch 2 times, most recently from ea02a12 to 50fae1a Compare June 10, 2025 19:38
@ildyria ildyria added the Review: easy Easy review expected: probably just need a quick to go through. label Jun 10, 2025
@ildyria ildyria marked this pull request as ready for review June 10, 2025 19:40
@ildyria ildyria requested a review from a team as a code owner June 10, 2025 19:40
@ildyria ildyria force-pushed the user-groups/listing-frontend branch from 50fae1a to 4ec61fe Compare June 11, 2025 13:56
@ildyria ildyria force-pushed the user-groups/listing branch 2 times, most recently from 465b434 to 2982aa2 Compare June 11, 2025 14:02
@ildyria ildyria force-pushed the user-groups/listing-frontend branch from 4ec61fe to 0b6db78 Compare June 11, 2025 14:02
@ildyria ildyria force-pushed the user-groups/listing-frontend branch from 0b6db78 to 4c9331d Compare June 11, 2025 14:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Review: easy Easy review expected: probably just need a quick to go through.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant