-
-
Notifications
You must be signed in to change notification settings - Fork 5.9k
Manage User Badges in the UI #31262
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
base: main
Are you sure you want to change the base?
Manage User Badges in the UI #31262
Conversation
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.
Thanks for the PR! The CI has a few linting reports that came up that I've reported in line :)
Thank you so much! |
Co-authored-by: Diogo Vicente <diogo.m.s.vicente@tecnico.ulisboa.pt>
Co-authored-by: Diogo Vicente <diogo.m.s.vicente@tecnico.ulisboa.pt>
@HenriquerPimentel looks like some different CI steps are failing, also related to linting (some public go functions require comments to document their purpose, eg As a sidenote: force pushing erases some review history as GitHub sees some files as new (even if they remain the same). If you could reduce your force pushes, it'd be helpful to me as a reviewer so I can keep track of what I've seen already |
@lunny any additional feedback? |
@lunny @wxiaoguang thanks for your feedback. I've updated this PR per your reviews. I also cherry-picked changes from #33950 by @komarov (I set you as the commit author, but the GUI only shows that in one specific place, as it has me as the "committer". GH has you as a co-author in the commit trailing bits for when this PR is squashed/merged) |
@@ -25,6 +30,59 @@ type UserBadge struct { //nolint:revive // export stutter | |||
UserID int64 `xorm:"INDEX"` | |||
} | |||
|
|||
// TableIndices implements xorm's TableIndices interface |
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.
So that please remove the index tags in the struct
|
||
// AddUniqueIndexForUserBadge adds a compound unique indexes for user badge table | ||
// and it replaces an old index on user_id | ||
func AddUniqueIndexForUserBadge(x *xorm.Engine) error { |
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.
It's better to add a test for the function.
Implemented #29798
This feature implements:
Implemented Badge Management in administration panel
9 Added new translation phrases (en-US): search.badge_kind, form.ImageURL, form.invalid_image_url_error, form.slug_been_taken, admin.badges, admin.badges.badges_manage_panel, admin.badges.details, admin.badges.new_badge, admin.badges.slug, admin.badges.description, admin.badges.image_url, admin.badges.slug.must_fill, admin.badges.new_success, admin.badges.update_success, admin.badges.deletion_success, admin.badges.edit_badge, admin.badges.update_badge, admin.badges.delete_badge, admin.badges.delete_badge_desc
Implemented User Badge Management Interface