feat: Enable custom support links (#6313)

* backend: support links

* frontend: Support links

* fmt

* test: CODER_SUPPORT_LINKS_0_NAME

* Go tests

* Use UpdateAppearanceConfig

* ui: UpdateAppearanceConfig

* fix: fmt

* Fix: site

* Fix: site tests

* fix: fmt

* fix

* test: check default support links
This commit is contained in:
Marcin Tojek
2023-02-27 09:25:04 +01:00
committed by GitHub
parent 16364db483
commit 2e53fb55da
20 changed files with 641 additions and 90 deletions
+14 -7
View File
@@ -24,7 +24,14 @@ curl -X GET http://coder-server:8080/api/v2/appearance \
"background_color": "string",
"enabled": true,
"message": "string"
}
},
"support_links": [
{
"icon": "string",
"name": "string",
"target": "string"
}
]
}
```
@@ -65,9 +72,9 @@ curl -X PUT http://coder-server:8080/api/v2/appearance \
### Parameters
| Name | In | Type | Required | Description |
| ------ | ---- | ---------------------------------------------------------------- | -------- | ------------------------- |
| `body` | body | [codersdk.AppearanceConfig](schemas.md#codersdkappearanceconfig) | true | Update appearance request |
| Name | In | Type | Required | Description |
| ------ | ---- | ---------------------------------------------------------------------------- | -------- | ------------------------- |
| `body` | body | [codersdk.UpdateAppearanceConfig](schemas.md#codersdkupdateappearanceconfig) | true | Update appearance request |
### Example responses
@@ -86,9 +93,9 @@ curl -X PUT http://coder-server:8080/api/v2/appearance \
### Responses
| Status | Meaning | Description | Schema |
| ------ | ------------------------------------------------------- | ----------- | ---------------------------------------------------------------- |
| 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [codersdk.AppearanceConfig](schemas.md#codersdkappearanceconfig) |
| Status | Meaning | Description | Schema |
| ------ | ------------------------------------------------------- | ----------- | ---------------------------------------------------------------------------- |
| 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [codersdk.UpdateAppearanceConfig](schemas.md#codersdkupdateappearanceconfig) |
To perform this operation, you must be authenticated. [Learn more](authentication.md).
+25
View File
@@ -879,6 +879,31 @@ curl -X GET http://coder-server:8080/api/v2/config/deployment \
"usage": "string",
"value": ["string"]
},
"support": {
"links": {
"default": [
{
"icon": "string",
"name": "string",
"target": "string"
}
],
"enterprise": true,
"flag": "string",
"hidden": true,
"name": "string",
"secret": true,
"shorthand": "string",
"usage": "string",
"value": [
{
"icon": "string",
"name": "string",
"target": "string"
}
]
}
},
"swagger": {
"enable": {
"default": true,
+151 -1
View File
@@ -440,7 +440,14 @@
"background_color": "string",
"enabled": true,
"message": "string"
}
},
"support_links": [
{
"icon": "string",
"name": "string",
"target": "string"
}
]
}
```
@@ -450,6 +457,7 @@
| ---------------- | ------------------------------------------------------------ | -------- | ------------ | ----------- |
| `logo_url` | string | false | | |
| `service_banner` | [codersdk.ServiceBannerConfig](#codersdkservicebannerconfig) | false | | |
| `support_links` | array of [codersdk.LinkConfig](#codersdklinkconfig) | false | | |
## codersdk.AssignableRoles
@@ -2285,6 +2293,31 @@ CreateParameterRequest is a structure used to create a new parameter value for a
"usage": "string",
"value": ["string"]
},
"support": {
"links": {
"default": [
{
"icon": "string",
"name": "string",
"target": "string"
}
],
"enterprise": true,
"flag": "string",
"hidden": true,
"name": "string",
"secret": true,
"shorthand": "string",
"usage": "string",
"value": [
{
"icon": "string",
"name": "string",
"target": "string"
}
]
}
},
"swagger": {
"enable": {
"default": true,
@@ -2546,6 +2579,7 @@ CreateParameterRequest is a structure used to create a new parameter value for a
| `ssh_keygen_algorithm` | [codersdk.DeploymentConfigField-string](#codersdkdeploymentconfigfield-string) | false | | |
| `strict_transport_security` | [codersdk.DeploymentConfigField-int](#codersdkdeploymentconfigfield-int) | false | | |
| `strict_transport_security_options` | [codersdk.DeploymentConfigField-array_string](#codersdkdeploymentconfigfield-array_string) | false | | |
| `support` | [codersdk.SupportConfig](#codersdksupportconfig) | false | | |
| `swagger` | [codersdk.SwaggerConfig](#codersdkswaggerconfig) | false | | |
| `telemetry` | [codersdk.TelemetryConfig](#codersdktelemetryconfig) | false | | |
| `tls` | [codersdk.TLSConfig](#codersdktlsconfig) | false | | |
@@ -2607,6 +2641,48 @@ CreateParameterRequest is a structure used to create a new parameter value for a
| `usage` | string | false | | |
| `value` | array of [codersdk.GitAuthConfig](#codersdkgitauthconfig) | false | | |
## codersdk.DeploymentConfigField-array_codersdk_LinkConfig
```json
{
"default": [
{
"icon": "string",
"name": "string",
"target": "string"
}
],
"enterprise": true,
"flag": "string",
"hidden": true,
"name": "string",
"secret": true,
"shorthand": "string",
"usage": "string",
"value": [
{
"icon": "string",
"name": "string",
"target": "string"
}
]
}
```
### Properties
| Name | Type | Required | Restrictions | Description |
| ------------ | --------------------------------------------------- | -------- | ------------ | ----------- |
| `default` | array of [codersdk.LinkConfig](#codersdklinkconfig) | false | | |
| `enterprise` | boolean | false | | |
| `flag` | string | false | | |
| `hidden` | boolean | false | | |
| `name` | string | false | | |
| `secret` | boolean | false | | |
| `shorthand` | string | false | | |
| `usage` | string | false | | |
| `value` | array of [codersdk.LinkConfig](#codersdklinkconfig) | false | | |
## codersdk.DeploymentConfigField-array_string
```json
@@ -3043,6 +3119,24 @@ CreateParameterRequest is a structure used to create a new parameter value for a
| `uploaded_at` | string | false | | |
| `uuid` | string | false | | |
## codersdk.LinkConfig
```json
{
"icon": "string",
"name": "string",
"target": "string"
}
```
### Properties
| Name | Type | Required | Restrictions | Description |
| -------- | ------ | -------- | ------------ | ----------- |
| `icon` | string | false | | |
| `name` | string | false | | |
| `target` | string | false | | |
## codersdk.LogLevel
```json
@@ -4120,6 +4214,42 @@ Parameter represents a set value for the scope.
| `enabled` | boolean | false | | |
| `message` | string | false | | |
## codersdk.SupportConfig
```json
{
"links": {
"default": [
{
"icon": "string",
"name": "string",
"target": "string"
}
],
"enterprise": true,
"flag": "string",
"hidden": true,
"name": "string",
"secret": true,
"shorthand": "string",
"usage": "string",
"value": [
{
"icon": "string",
"name": "string",
"target": "string"
}
]
}
}
```
### Properties
| Name | Type | Required | Restrictions | Description |
| ------- | -------------------------------------------------------------------------------------------------------------------- | -------- | ------------ | ----------- |
| `links` | [codersdk.DeploymentConfigField-array_codersdk_LinkConfig](#codersdkdeploymentconfigfield-array_codersdk_linkconfig) | false | | |
## codersdk.SwaggerConfig
```json
@@ -4757,6 +4887,26 @@ Parameter represents a set value for the scope.
| ---- | ------ | -------- | ------------ | ----------- |
| `id` | string | true | | |
## codersdk.UpdateAppearanceConfig
```json
{
"logo_url": "string",
"service_banner": {
"background_color": "string",
"enabled": true,
"message": "string"
}
}
```
### Properties
| Name | Type | Required | Restrictions | Description |
| ---------------- | ------------------------------------------------------------ | -------- | ------------ | ----------- |
| `logo_url` | string | false | | |
| `service_banner` | [codersdk.ServiceBannerConfig](#codersdkservicebannerconfig) | false | | |
## codersdk.UpdateCheckResponse
```json