feat: add a theme picker (#11140)

This commit is contained in:
Kayla Washburn
2023-12-14 10:38:44 -07:00
committed by GitHub
parent 0cd4842d18
commit 133dc66143
63 changed files with 1283 additions and 317 deletions
+71
View File
@@ -45,6 +45,7 @@ curl -X GET http://coder-server:8080/api/v2/users \
}
],
"status": "active",
"theme_preference": "string",
"username": "string"
}
]
@@ -112,6 +113,7 @@ curl -X POST http://coder-server:8080/api/v2/users \
}
],
"status": "active",
"theme_preference": "string",
"username": "string"
}
```
@@ -370,6 +372,7 @@ curl -X GET http://coder-server:8080/api/v2/users/{user} \
}
],
"status": "active",
"theme_preference": "string",
"username": "string"
}
```
@@ -421,6 +424,69 @@ curl -X DELETE http://coder-server:8080/api/v2/users/{user} \
}
],
"status": "active",
"theme_preference": "string",
"username": "string"
}
```
### Responses
| Status | Meaning | Description | Schema |
| ------ | ------------------------------------------------------- | ----------- | ---------------------------------------- |
| 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [codersdk.User](schemas.md#codersdkuser) |
To perform this operation, you must be authenticated. [Learn more](authentication.md).
## Update user appearance settings
### Code samples
```shell
# Example request using curl
curl -X PUT http://coder-server:8080/api/v2/users/{user}/appearance \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Coder-Session-Token: API_KEY'
```
`PUT /users/{user}/appearance`
> Body parameter
```json
{
"theme_preference": "string"
}
```
### Parameters
| Name | In | Type | Required | Description |
| ------ | ---- | ------------------------------------------------------------------------------------------------------ | -------- | ----------------------- |
| `user` | path | string | true | User ID, name, or me |
| `body` | body | [codersdk.UpdateUserAppearanceSettingsRequest](schemas.md#codersdkupdateuserappearancesettingsrequest) | true | New appearance settings |
### Example responses
> 200 Response
```json
{
"avatar_url": "http://example.com",
"created_at": "2019-08-24T14:15:22Z",
"email": "user@example.com",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"last_seen_at": "2019-08-24T14:15:22Z",
"login_type": "",
"organization_ids": ["497f6eca-6276-4993-bfeb-53cbbbba6f08"],
"roles": [
{
"display_name": "string",
"name": "string"
}
],
"status": "active",
"theme_preference": "string",
"username": "string"
}
```
@@ -1015,6 +1081,7 @@ curl -X PUT http://coder-server:8080/api/v2/users/{user}/profile \
}
],
"status": "active",
"theme_preference": "string",
"username": "string"
}
```
@@ -1066,6 +1133,7 @@ curl -X GET http://coder-server:8080/api/v2/users/{user}/roles \
}
],
"status": "active",
"theme_preference": "string",
"username": "string"
}
```
@@ -1127,6 +1195,7 @@ curl -X PUT http://coder-server:8080/api/v2/users/{user}/roles \
}
],
"status": "active",
"theme_preference": "string",
"username": "string"
}
```
@@ -1178,6 +1247,7 @@ curl -X PUT http://coder-server:8080/api/v2/users/{user}/status/activate \
}
],
"status": "active",
"theme_preference": "string",
"username": "string"
}
```
@@ -1229,6 +1299,7 @@ curl -X PUT http://coder-server:8080/api/v2/users/{user}/status/suspend \
}
],
"status": "active",
"theme_preference": "string",
"username": "string"
}
```