mirror of
https://gh.wpcy.net/https://github.com/discourse/discourse.git
synced 2026-05-21 16:06:12 +08:00
When replying to a post, the user who is getting the reply should be prioritized in the autocomplete - Added in composer a getter for getting `.replyingToUser` - Added in d-editor the reference to the user that is getting the reply(`this.composer.replyingToUser`) - Passed along the reference to the user that is getting the reply to the user-search service as `replyingToUser` - Controller `users_controller.rb` was modified to accept the `user_id` parameter and pass it to the `UserSearch` model - The `UserSearch` model was modified to accept the `user_id` parameter and use it to prioritize the user that is getting the reply in the autocomplete on the first time you call the autocomplete service and while the username is included in the searched term - Had to update the serializer to pass the id of the `replyingToUser` from the post
290 lines
No EOL
5.3 KiB
JSON
Vendored
290 lines
No EOL
5.3 KiB
JSON
Vendored
{
|
|
"type": "array",
|
|
"minItems": 1,
|
|
"uniqueItems": true,
|
|
"items": {
|
|
"type": "object",
|
|
"properties": {
|
|
"id": {
|
|
"type": "integer"
|
|
},
|
|
"name": {
|
|
"type": [
|
|
"string",
|
|
"null"
|
|
]
|
|
},
|
|
"username": {
|
|
"type": "string"
|
|
},
|
|
"avatar_template": {
|
|
"type": "string"
|
|
},
|
|
"created_at": {
|
|
"type": "string"
|
|
},
|
|
"cooked": {
|
|
"type": "string"
|
|
},
|
|
"post_number": {
|
|
"type": "integer"
|
|
},
|
|
"post_type": {
|
|
"type": "integer"
|
|
},
|
|
"posts_count": {
|
|
"type": "integer"
|
|
},
|
|
"updated_at": {
|
|
"type": "string"
|
|
},
|
|
"reply_count": {
|
|
"type": "integer"
|
|
},
|
|
"reply_to_post_number": {
|
|
"type": "integer"
|
|
},
|
|
"quote_count": {
|
|
"type": "integer"
|
|
},
|
|
"incoming_link_count": {
|
|
"type": "integer"
|
|
},
|
|
"reads": {
|
|
"type": "integer"
|
|
},
|
|
"readers_count": {
|
|
"type": "integer"
|
|
},
|
|
"score": {
|
|
"type": "number"
|
|
},
|
|
"yours": {
|
|
"type": "boolean"
|
|
},
|
|
"topic_id": {
|
|
"type": "integer"
|
|
},
|
|
"topic_slug": {
|
|
"type": "string"
|
|
},
|
|
"display_username": {
|
|
"type": [
|
|
"string",
|
|
"null"
|
|
]
|
|
},
|
|
"primary_group_name": {
|
|
"type": [
|
|
"string",
|
|
"null"
|
|
]
|
|
},
|
|
"flair_name": {
|
|
"type": [
|
|
"string",
|
|
"null"
|
|
]
|
|
},
|
|
"flair_url": {
|
|
"type": [
|
|
"string",
|
|
"null"
|
|
]
|
|
},
|
|
"flair_bg_color": {
|
|
"type": [
|
|
"string",
|
|
"null"
|
|
]
|
|
},
|
|
"flair_color": {
|
|
"type": [
|
|
"string",
|
|
"null"
|
|
]
|
|
},
|
|
"flair_group_id": {
|
|
"type": [
|
|
"integer",
|
|
"null"
|
|
]
|
|
},
|
|
"version": {
|
|
"type": "integer"
|
|
},
|
|
"can_edit": {
|
|
"type": "boolean"
|
|
},
|
|
"can_delete": {
|
|
"type": "boolean"
|
|
},
|
|
"can_recover": {
|
|
"type": "boolean"
|
|
},
|
|
"can_see_hidden_post": {
|
|
"type": "boolean"
|
|
},
|
|
"can_wiki": {
|
|
"type": "boolean"
|
|
},
|
|
"user_title": {
|
|
"type": [
|
|
"string",
|
|
"null"
|
|
]
|
|
},
|
|
"reply_to_user": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"properties": {
|
|
"id": {
|
|
"type": "integer"
|
|
},
|
|
"username": {
|
|
"type": "string"
|
|
},
|
|
"name": {
|
|
"type": "string"
|
|
},
|
|
"avatar_template": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"username",
|
|
"avatar_template"
|
|
]
|
|
},
|
|
"bookmarked": {
|
|
"type": "boolean"
|
|
},
|
|
"actions_summary": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"properties": {
|
|
"id": {
|
|
"type": "integer"
|
|
},
|
|
"can_act": {
|
|
"type": "boolean"
|
|
}
|
|
},
|
|
"required": [
|
|
"id",
|
|
"can_act"
|
|
]
|
|
}
|
|
},
|
|
"moderator": {
|
|
"type": "boolean"
|
|
},
|
|
"admin": {
|
|
"type": "boolean"
|
|
},
|
|
"staff": {
|
|
"type": "boolean"
|
|
},
|
|
"user_id": {
|
|
"type": "integer"
|
|
},
|
|
"hidden": {
|
|
"type": "boolean"
|
|
},
|
|
"trust_level": {
|
|
"type": "integer"
|
|
},
|
|
"deleted_at": {
|
|
"type": [
|
|
"string",
|
|
"null"
|
|
]
|
|
},
|
|
"user_deleted": {
|
|
"type": "boolean"
|
|
},
|
|
"edit_reason": {
|
|
"type": [
|
|
"string",
|
|
"null"
|
|
]
|
|
},
|
|
"can_view_edit_history": {
|
|
"type": "boolean"
|
|
},
|
|
"wiki": {
|
|
"type": "boolean"
|
|
},
|
|
"reviewable_id": {
|
|
"type": [
|
|
"integer",
|
|
"null"
|
|
]
|
|
},
|
|
"reviewable_score_count": {
|
|
"type": "integer"
|
|
},
|
|
"reviewable_score_pending_count": {
|
|
"type": "integer"
|
|
},
|
|
"post_url": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"id",
|
|
"name",
|
|
"username",
|
|
"avatar_template",
|
|
"created_at",
|
|
"cooked",
|
|
"post_number",
|
|
"post_type",
|
|
"posts_count",
|
|
"updated_at",
|
|
"reply_count",
|
|
"reply_to_post_number",
|
|
"quote_count",
|
|
"incoming_link_count",
|
|
"reads",
|
|
"readers_count",
|
|
"score",
|
|
"yours",
|
|
"topic_id",
|
|
"topic_slug",
|
|
"display_username",
|
|
"primary_group_name",
|
|
"flair_name",
|
|
"flair_url",
|
|
"flair_bg_color",
|
|
"flair_color",
|
|
"version",
|
|
"can_edit",
|
|
"can_delete",
|
|
"can_recover",
|
|
"can_see_hidden_post",
|
|
"can_wiki",
|
|
"user_title",
|
|
"reply_to_user",
|
|
"bookmarked",
|
|
"actions_summary",
|
|
"moderator",
|
|
"admin",
|
|
"staff",
|
|
"user_id",
|
|
"hidden",
|
|
"trust_level",
|
|
"deleted_at",
|
|
"user_deleted",
|
|
"edit_reason",
|
|
"can_view_edit_history",
|
|
"wiki",
|
|
"reviewable_id",
|
|
"reviewable_score_count",
|
|
"reviewable_score_pending_count",
|
|
"post_url"
|
|
]
|
|
}
|
|
} |