Skip to content
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

Fix display problems of members and teams unit #26363

Merged

Conversation

yp05327
Copy link
Member

@yp05327 yp05327 commented Aug 7, 2023

Fix:

  • display member count and team count in the menu bar
    image
  • Also display member unit in the menu bar if there are no hidden members in public org
    image
  • hidden member board when there's no seeable members.
    In this org, we only have hidden members:
    image
    We will hidden the member board when doer is not the member of this org
    image
    Before:
    image
    If you click the number in the members board, you will access the members page, which is not expected.
    image

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Aug 7, 2023
@pull-request-size pull-request-size bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Aug 7, 2023
modules/context/org.go Outdated Show resolved Hide resolved
routers/web/org/home.go Outdated Show resolved Hide resolved
Comment on lines 126 to 128
if ctx.Doer != nil {
isMember, err := org.IsOrgMember(ctx.Doer.ID)
if err != nil {
ctx.Error(http.StatusInternalServerError, "IsOrgMember")
return
}
opts.PublicOnly = !isMember && !ctx.Doer.IsAdmin
opts.PublicOnly = !ctx.Org.IsMember && !ctx.Doer.IsAdmin
}
Copy link
Member

Choose a reason for hiding this comment

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

Why do we need this code block again, if we already checked it in HandleOrgAssignment?

Copy link
Member Author

Choose a reason for hiding this comment

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

Done in 3ade541

templates/org/home.tmpl Outdated Show resolved Hide resolved
yp05327 and others added 4 commits August 8, 2023 09:06
Co-authored-by: delvh <dev.lh@web.de>
Co-authored-by: delvh <dev.lh@web.de>
@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Aug 11, 2023
@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Aug 11, 2023
@lunny lunny added this to the 1.21.0 milestone Aug 14, 2023
@lunny lunny added the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Aug 15, 2023
@silverwind silverwind merged commit 7f8028e into go-gitea:main Aug 15, 2023
23 checks passed
@GiteaBot GiteaBot removed the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Aug 15, 2023
@yp05327 yp05327 deleted the fix-display-problem-of-org-members-unit branch August 15, 2023 23:55
zjjhot added a commit to zjjhot/gitea that referenced this pull request Aug 17, 2023
* upstream/main:
  Sync repo's IsEmpty status correctly (go-gitea#26517)
  [skip ci] Updated translations via Crowdin
  Remove fomantic transition module (go-gitea#26469)
  Explain SearchOptions and fix ToSearchOptions (go-gitea#26542)
  Update go dependencies (go-gitea#26534)
  Differentiate better between user settings and admin settings (go-gitea#26538)
  Add missing triggers to update issue indexer (go-gitea#26539)
  Improve deadline icon location in milestone list page (go-gitea#26532)
  Use unique class for breadcrumb divider (go-gitea#26524)
  Fix typo of RunerOwnerID (go-gitea#26508)
  Improve clickable area in repo action view page (go-gitea#26115)
  Fix dark theme highlight for "NameNamespace" (go-gitea#26519)
  Remove duplicate CSS import for chroma/base.css (go-gitea#26523)
  Fix project filter bugs (go-gitea#26490)
  Fix display problems of members and teams unit (go-gitea#26363)
  Use `hidden` over `clip` for text truncation (go-gitea#26520)
  Add API route to list org secrets (go-gitea#26485)
  Set "type=button" for editor's toolbar buttons (go-gitea#26510)
  Apply to become a maintainer (go-gitea#26514)
  Detect ogg mime-type as audio or video (go-gitea#26494)
lunny pushed a commit that referenced this pull request Oct 30, 2023
…s in public org (#27795)

Follow #26363.
I missed that org templates also using
`templates/user/overview/header.tmpl`.
You can confirm this problem in https://gitea.com/gitea/-/projects with
anonymous access.

Before: (no login)

![image](https://github.com/go-gitea/gitea/assets/18380374/e285565c-ca65-4b18-9ff7-434c6367c13a)

After:

![image](https://github.com/go-gitea/gitea/assets/18380374/81e7532a-c458-4552-8d75-6896538e42cb)
@go-gitea go-gitea locked as resolved and limited conversation to collaborators Nov 13, 2023
@denyskon denyskon added the type/enhancement An improvement of existing functionality label Nov 13, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. type/enhancement An improvement of existing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants