mirror of
https://gitea.com/gitea/tea.git
synced 2026-10-26 11:01:25 +01:00
fix(org): check membership before member changes and polish org output
org member remove and public/private exited 0 without a word for users who are not members, and member list --public showed concealed members, because Gitea lists them as public to administrators. Membership changes now check the membership first: removing a non-member warns, publicizing one fails, and a change to the current visibility warns. Member list checks each membership and gains a VISIBILITY column. org list and member list get a header and context line through writeTable, org view shows the description, website, location and member, team and repository counts, mutations print ✓ lines, and org delete asks to type the organization's name after refusing organizations that still own repositories. public and private become publicize and conceal, the old names stay as aliases, and org edit --visibility no longer shows the create default. Every command has examples, and organizations and members complete. Signed-off-by: bircni <bircni@icloud.com>
This commit is contained in:
7 files changed
+747
-178
No files matched your search
@@ -445,8 +445,8 @@ func (a *application) completeReleases() cobra.CompletionFunc {
|
||||
// completeOrgs completes the organizations of the account.
|
||||
func (a *application) completeOrgs() cobra.CompletionFunc {
|
||||
return a.apiCompletion(false, func(ctx context.Context, t target, _ string) ([]cobra.Completion, error) {
|
||||
items, _, err := services.Organizations{Client: t.client}.List(ctx, true, "", completionLimit, 1)
|
||||
return describe(items, func(item services.Organization) (string, string) { return item.Name, item.FullName }), err
|
||||
items, err := services.Organizations{Client: t.client}.List(ctx, true, "", completionLimit, 1)
|
||||
return describe(items.Items, func(item services.Organization) (string, string) { return item.Name, item.FullName }), err
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user