Commit c1279510 authored by Adam Hegyi's avatar Adam Hegyi

Enable clear_status_with_quick_options FF

This change enables the `clear_status_with_quick_options` feature flag
and updates the documentation.
parent bf59a42f
---
title: Schedule user status cleanup after a given time interval via the REST API
merge_request: 54207
author:
type: added
...@@ -5,4 +5,4 @@ rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/320777 ...@@ -5,4 +5,4 @@ rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/320777
milestone: '13.9' milestone: '13.9'
type: development type: development
group: group::optimize group: group::optimize
default_enabled: false default_enabled: true
...@@ -626,7 +626,8 @@ Example response: ...@@ -626,7 +626,8 @@ Example response:
{ {
"emoji":"coffee", "emoji":"coffee",
"message":"I crave coffee :coffee:", "message":"I crave coffee :coffee:",
"message_html": "I crave coffee <gl-emoji title=\"hot beverage\" data-name=\"coffee\" data-unicode-version=\"4.0\">☕</gl-emoji>" "message_html": "I crave coffee <gl-emoji title=\"hot beverage\" data-name=\"coffee\" data-unicode-version=\"4.0\">☕</gl-emoji>",
"clear_status_at": null
} }
``` ```
...@@ -652,7 +653,8 @@ Example response: ...@@ -652,7 +653,8 @@ Example response:
{ {
"emoji":"coffee", "emoji":"coffee",
"message":"I crave coffee :coffee:", "message":"I crave coffee :coffee:",
"message_html": "I crave coffee <gl-emoji title=\"hot beverage\" data-name=\"coffee\" data-unicode-version=\"4.0\">☕</gl-emoji>" "message_html": "I crave coffee <gl-emoji title=\"hot beverage\" data-name=\"coffee\" data-unicode-version=\"4.0\">☕</gl-emoji>",
"clear_status_at": null
} }
``` ```
...@@ -664,15 +666,16 @@ Set the status of the current user. ...@@ -664,15 +666,16 @@ Set the status of the current user.
PUT /user/status PUT /user/status
``` ```
| Attribute | Type | Required | Description | | Attribute | Type | Required | Description |
| --------- | ------ | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | -------------------- | ------ | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `emoji` | string | no | The name of the emoji to use as status. If omitted `speech_balloon` is used. Emoji name can be one of the specified names in the [Gemojione index](https://github.com/bonusly/gemojione/blob/master/config/index.json). | | `emoji` | string | no | The name of the emoji to use as status. If omitted `speech_balloon` is used. Emoji name can be one of the specified names in the [Gemojione index](https://github.com/bonusly/gemojione/blob/master/config/index.json). |
| `message` | string | no | The message to set as a status. It can also contain emoji codes. | | `message` | string | no | The message to set as a status. It can also contain emoji codes. |
| `clear_status_after` | string | no | Automatically clean up the status after a given time interval, allowed values: `30_minutes`, `3_hours`, `8_hours`, `1_day`, `3_days`, `7_days`, `30_days`
When both parameters `emoji` and `message` are empty, the status is cleared. When both parameters `emoji` and `message` are empty, the status is cleared. When the `clear_status_after` parameter is missing from the request, the previously set value for `"clear_status_after` is cleared.
```shell ```shell
curl --request PUT --header "PRIVATE-TOKEN: <your_access_token>" --data "emoji=coffee" --data "message=I crave coffee" "https://gitlab.example.com/api/v4/user/status" curl --request PUT --header "PRIVATE-TOKEN: <your_access_token>" --data "clear_status_after=1_day" --data "emoji=coffee" --data "message=I crave coffee" "https://gitlab.example.com/api/v4/user/status"
``` ```
Example responses Example responses
...@@ -681,7 +684,8 @@ Example responses ...@@ -681,7 +684,8 @@ Example responses
{ {
"emoji":"coffee", "emoji":"coffee",
"message":"I crave coffee", "message":"I crave coffee",
"message_html": "I crave coffee" "message_html": "I crave coffee",
"clear_status_at":"2021-02-15T10:49:01.311Z"
} }
``` ```
......
...@@ -1010,7 +1010,7 @@ module API ...@@ -1010,7 +1010,7 @@ module API
forbidden! unless can?(current_user, :update_user_status, current_user) forbidden! unless can?(current_user, :update_user_status, current_user)
update_params = declared_params update_params = declared_params
update_params.delete(:clear_status_after) if Feature.disabled?(:clear_status_with_quick_options, current_user) update_params.delete(:clear_status_after) if Feature.disabled?(:clear_status_with_quick_options, current_user, default_enabled: :yaml)
if ::Users::SetStatusService.new(current_user, update_params).execute if ::Users::SetStatusService.new(current_user, update_params).execute
present current_user.status, with: Entities::UserStatus present current_user.status, with: Entities::UserStatus
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment