diff --git a/app/services/users/build_service.rb b/app/services/users/build_service.rb index 064bf132d3daf1dcc0fa40adebb56b3d147feaf7..289a8097525a1c43dfcbf29e1c6dc66d8e3b0789 100644 --- a/app/services/users/build_service.rb +++ b/app/services/users/build_service.rb @@ -163,6 +163,7 @@ def admin_create_params :skype, :theme_id, :twitter, + :discord, :username, :website_url, :private_profile, diff --git a/doc/api/users.md b/doc/api/users.md index d6a4604cf511f769d2fbc6b5bee69319c4eb65ad..4ecb3d48c0fbf15ac5989372f01625e6ed58fbcf 100644 --- a/doc/api/users.md +++ b/doc/api/users.md @@ -142,6 +142,7 @@ GET /users "skype": "", "linkedin": "", "twitter": "", + "discord": "", "website_url": "", "organization": "", "job_title": "", @@ -183,6 +184,7 @@ GET /users "skype": "", "linkedin": "", "twitter": "", + "discord": "", "website_url": "", "organization": "", "job_title": "", @@ -319,6 +321,7 @@ Parameters: "skype": "", "linkedin": "", "twitter": "", + "discord": "", "website_url": "", "organization": "", "job_title": "Operations Specialist", @@ -365,6 +368,7 @@ Example Responses: "skype": "", "linkedin": "", "twitter": "", + "discord": "", "website_url": "", "organization": "", "job_title": "Operations Specialist", @@ -508,6 +512,7 @@ Parameters: | `skype` | No | Skype ID | | `theme_id` | No | GitLab theme for the user (for more information, see the [user preference documentation](../user/profile/preferences.md#navigation-theme) for more information) | | `twitter` | No | Twitter account | +| `discord` | No | Discord account | | `username` | Yes | Username | | `view_diffs_file_by_file` | No | Flag indicating the user sees only one file diff per page | | `website_url` | No | Website URL | @@ -558,6 +563,7 @@ Parameters: | `skype` | No | Skype ID | | `theme_id` | No | GitLab theme for the user (for more information, see the [user preference documentation](../user/profile/preferences.md#navigation-theme) for more information) | | `twitter` | No | Twitter account | +| `discord` | No | Discord account | | `username` | No | Username | | `view_diffs_file_by_file` | No | Flag indicating the user sees only one file diff per page | | `website_url` | No | Website URL | @@ -626,6 +632,7 @@ GET /user "skype": "", "linkedin": "", "twitter": "", + "discord": "", "website_url": "", "organization": "", "job_title": "", @@ -690,6 +697,7 @@ Parameters: "skype": "", "linkedin": "", "twitter": "", + "discord": "", "website_url": "", "organization": "", "job_title": "", diff --git a/lib/api/entities/user.rb b/lib/api/entities/user.rb index a86039b856a1b0c00249c4eb1cdf51a84b454ca3..884f0f75d7ae5d0b76eb9fda772f08afed02b9b8 100644 --- a/lib/api/entities/user.rb +++ b/lib/api/entities/user.rb @@ -7,7 +7,7 @@ class User < UserBasic include TimeZoneHelper expose :created_at, if: ->(user, opts) { Ability.allowed?(opts[:current_user], :read_user_profile, user) } - expose :bio, :location, :public_email, :skype, :linkedin, :twitter, :website_url, :organization, :job_title, :pronouns + expose :bio, :location, :public_email, :skype, :linkedin, :twitter, :discord, :website_url, :organization, :job_title, :pronouns expose :bot?, as: :bot expose :work_information do |user| work_information(user) diff --git a/lib/api/users.rb b/lib/api/users.rb index 6e9dc22cf86c57a93d1aed86c02365beb5d5ffa6..cc7eb63798a70ab640f17e15957f83abd1bf720b 100644 --- a/lib/api/users.rb +++ b/lib/api/users.rb @@ -46,6 +46,7 @@ def reorder_users(users) optional :skype, type: String, desc: 'The Skype username' optional :linkedin, type: String, desc: 'The LinkedIn username' optional :twitter, type: String, desc: 'The Twitter username' + optional :discord, type: String, desc: 'The Discord user ID' optional :website_url, type: String, desc: 'The website of the user' optional :organization, type: String, desc: 'The organization of the user' optional :projects_limit, type: Integer, desc: 'The number of projects a user can create' diff --git a/spec/lib/api/entities/user_spec.rb b/spec/lib/api/entities/user_spec.rb index 407f2894f016be5b3bab1fb92498825a90111280..3094fc748c9671a75718ed9f21dea51d17cdd1d1 100644 --- a/spec/lib/api/entities/user_spec.rb +++ b/spec/lib/api/entities/user_spec.rb @@ -18,7 +18,7 @@ # UserBasic :state, :avatar_url, :web_url, # User - :created_at, :bio, :location, :public_email, :skype, :linkedin, :twitter, + :created_at, :bio, :location, :public_email, :skype, :linkedin, :twitter, :discord, :website_url, :organization, :job_title, :pronouns, :bot, :work_information, :followers, :following, :is_followed, :local_time )