feat(organization): enhance organization selection and sharing UI

- Updated organization selection dropdowns to include new SVG icons for better visual representation.
- Improved organization option layout with additional metadata display, including member count and share count.
- Enhanced share item display with organization icons and improved action buttons for better user interaction.
- Adjusted styles for organization-related components to improve usability and aesthetics.

This update enhances the user experience by providing clearer organization visuals and more intuitive sharing options.
This commit is contained in:
wizardchen
2026-02-02 22:45:13 +08:00
committed by lyingbug
parent d854083c70
commit ffbb8e1b02
7 changed files with 383 additions and 169 deletions
+9 -9
View File
@@ -240,15 +240,15 @@ func (s *organizationService) SearchSearchableOrganizations(ctx context.Context,
items := make([]types.SearchableOrganizationItem, 0, len(orgs))
for _, org := range orgs {
items = append(items, types.SearchableOrganizationItem{
ID: org.ID,
Name: org.Name,
Description: org.Description,
Avatar: org.Avatar,
MemberCount: int(memberCounts[org.ID]),
MemberLimit: org.MemberLimit,
ShareCount: int(shareCounts[org.ID]),
IsAlreadyMember: memberOrgIDs[org.ID],
RequireApproval: org.RequireApproval,
ID: org.ID,
Name: org.Name,
Description: org.Description,
Avatar: org.Avatar,
MemberCount: int(memberCounts[org.ID]),
MemberLimit: org.MemberLimit,
ShareCount: int(shareCounts[org.ID]),
IsAlreadyMember: memberOrgIDs[org.ID],
RequireApproval: org.RequireApproval,
})
}
return &types.ListSearchableOrganizationsResponse{
+14 -14
View File
@@ -229,9 +229,9 @@ type UpdateOrganizationRequest struct {
Description *string `json:"description" binding:"omitempty,max=1000"`
Avatar *string `json:"avatar" binding:"omitempty,max=512"` // optional avatar URL
RequireApproval *bool `json:"require_approval"`
Searchable *bool `json:"searchable"` // open for search so others can discover and join
Searchable *bool `json:"searchable"` // open for search so others can discover and join
InviteCodeValidityDays *int `json:"invite_code_validity_days"` // 0=never, 1, 7, 30
MemberLimit *int `json:"member_limit"` // max members; 0=unlimited
MemberLimit *int `json:"member_limit"` // max members; 0=unlimited
}
// AddMemberRequest represents a request to add a member to an organization
@@ -350,28 +350,28 @@ type ListOrganizationsResponse struct {
// SearchableOrganizationItem is a searchable org item for discovery (no invite code)
type SearchableOrganizationItem struct {
ID string `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
Avatar string `json:"avatar,omitempty"`
MemberCount int `json:"member_count"`
MemberLimit int `json:"member_limit"` // 0 = unlimited
ShareCount int `json:"share_count"`
IsAlreadyMember bool `json:"is_already_member"`
RequireApproval bool `json:"require_approval"`
ID string `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
Avatar string `json:"avatar,omitempty"`
MemberCount int `json:"member_count"`
MemberLimit int `json:"member_limit"` // 0 = unlimited
ShareCount int `json:"share_count"`
IsAlreadyMember bool `json:"is_already_member"`
RequireApproval bool `json:"require_approval"`
}
// ListSearchableOrganizationsResponse is the response for searching discoverable organizations
type ListSearchableOrganizationsResponse struct {
Organizations []SearchableOrganizationItem `json:"organizations"`
Total int64 `json:"total"`
Total int64 `json:"total"`
}
// JoinByOrganizationIDRequest is used to join a searchable organization by ID (no invite code)
type JoinByOrganizationIDRequest struct {
OrganizationID string `json:"organization_id" binding:"required"`
Message string `json:"message" binding:"max=500"` // Optional message for join request
Role OrgMemberRole `json:"role"` // Optional: requested role (admin/editor/viewer); default viewer
Message string `json:"message" binding:"max=500"` // Optional message for join request
Role OrgMemberRole `json:"role"` // Optional: requested role (admin/editor/viewer); default viewer
}
// JoinRequestResponse represents a join request in API responses