-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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 broken following organization #29005
Conversation
Sorry for breaking |
Never mind. |
@yardenshoham I see, we need to refresh the following count in user profile avatar card, but we don't need to refresh it in organization's home page. So only refresh the |
So you can remove |
0741903
to
56a477f
Compare
I think this should be in 1.22's milestone, as #28908 will be released in 1.22. |
ctx.HTML(http.StatusOK, tplFollowUnfollow) | ||
return | ||
} | ||
log.Error("Failed to apply action %q: unsupport context user type: %s", ctx.FormString("action"), ctx.ContextUser.Type) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ctx.ContextUser.Type
is not a %s
.
} else if ctx.ContextUser.IsOrganization() { | ||
ctx.Data["IsFollowing"] = ctx.Doer != nil && user_model.IsFollowing(ctx, ctx.Doer.ID, ctx.ContextUser.ID) | ||
ctx.HTML(http.StatusOK, tplFollowUnfollow) | ||
return | ||
} | ||
log.Error("Failed to apply action %q: unsupport context user type: %s", ctx.FormString("action"), ctx.ContextUser.Type) | ||
ctx.Error(http.StatusBadRequest, fmt.Sprintf("Action %q failed", ctx.FormString("action"))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why doesn't the same action apply as for users?
Does the org not use HTMX on that page?
If no, then I'd suggest adding it there as well.
And in the other case, I don't see reasons to deviate from the user behavior…
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
user profile has the count of followers, that should also be refreshed. But org home page doesn’t.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense, unfortunately.
Ultimately, I think the behavior should be unified, but okay, I can accept that for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This also confused me.
You can check the comment: #29005 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can take a stab at this after this PR is merged
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, forgot the approval yesterday
Leftover from #29005 # Before ![before](https://github.com/go-gitea/gitea/assets/20454870/24c74278-ccac-4dc6-bf26-713e90c07239) # After ![after](https://github.com/go-gitea/gitea/assets/20454870/f91d503b-87d4-4c17-a56c-9c0a81fd9082) --------- Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Leftover from go-gitea/gitea#29005 # Before ![before](https://github.com/go-gitea/gitea/assets/20454870/24c74278-ccac-4dc6-bf26-713e90c07239) # After ![after](https://github.com/go-gitea/gitea/assets/20454870/f91d503b-87d4-4c17-a56c-9c0a81fd9082) --------- Signed-off-by: Yarden Shoham <git@yardenshoham.com> (cherry picked from commit aa6f88638fb827d5c5ed7506e5fc06dad92beea7)
- following organization is broken from go-gitea#28908 - add login check for the follow button in organization profile page
Leftover from go-gitea#29005 # Before ![before](https://github.com/go-gitea/gitea/assets/20454870/24c74278-ccac-4dc6-bf26-713e90c07239) # After ![after](https://github.com/go-gitea/gitea/assets/20454870/f91d503b-87d4-4c17-a56c-9c0a81fd9082) --------- Signed-off-by: Yarden Shoham <git@yardenshoham.com>
- following organization is broken from go-gitea#28908 - add login check for the follow button in organization profile page (cherry picked from commit 6822799)
Automatically locked because of our CONTRIBUTING guidelines |
Subscribe
andFollow
#28908