Commit 5714cc34 authored by Sean Arnold's avatar Sean Arnold

Change color palette/weight to be enums

- Update graphql types and docs
parent 43184bc8
# frozen_string_literal: true
module Types
module DataVisualizationPalette
class ColorEnum < BaseEnum
graphql_name 'DataVisualizationColorEnum'
description 'Color of the data visualization palette'
Enums::DataVisualizationPalette.colors.keys.each do |unit|
value unit.upcase, value: unit, description: "#{unit.to_s.titleize} color"
end
end
end
end
# frozen_string_literal: true
module Types
module DataVisualizationPalette
class WeightEnum < BaseEnum
graphql_name 'DataVisualizationWeightEnum'
description 'Weight of the data visualization palette'
::Enums::DataVisualizationPalette.weights.keys.each do |unit|
value "weight_#{unit}".upcase, value: unit, description: "#{unit.to_s.titleize} weight"
end
end
end
end
......@@ -5700,6 +5700,96 @@ enum DastSiteValidationStrategyEnum {
TEXT_FILE
}
"""
Color of the data visualization palette
"""
enum DataVisualizationColorEnum {
"""
Aqua color
"""
AQUA
"""
Blue color
"""
BLUE
"""
Green color
"""
GREEN
"""
Magenta color
"""
MAGENTA
"""
Orange color
"""
ORANGE
}
"""
Weight of the data visualization palette
"""
enum DataVisualizationWeightEnum {
"""
100 weight
"""
WEIGHT_100
"""
200 weight
"""
WEIGHT_200
"""
300 weight
"""
WEIGHT_300
"""
400 weight
"""
WEIGHT_400
"""
50 weight
"""
WEIGHT_50
"""
500 weight
"""
WEIGHT_500
"""
600 weight
"""
WEIGHT_600
"""
700 weight
"""
WEIGHT_700
"""
800 weight
"""
WEIGHT_800
"""
900 weight
"""
WEIGHT_900
"""
950 weight
"""
WEIGHT_950
}
"""
Date represented in ISO 8601
"""
......@@ -15727,12 +15817,12 @@ input OncallUserInputType {
"""
The color palette to assign to the on-call user, for example: "blue".
"""
colorPalette: String
colorPalette: DataVisualizationColorEnum
"""
The color weight to assign to for the on-call user, for example "500". Max 4 chars. For easy identification of the user.
"""
colorWeight: String
colorWeight: DataVisualizationWeightEnum
"""
The username of the user to participate in the on-call rotation. i.e user_one
......
......@@ -15691,6 +15691,124 @@
],
"possibleTypes": null
},
{
"kind": "ENUM",
"name": "DataVisualizationColorEnum",
"description": "Color of the data visualization palette",
"fields": null,
"inputFields": null,
"interfaces": null,
"enumValues": [
{
"name": "BLUE",
"description": "Blue color",
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "ORANGE",
"description": "Orange color",
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "AQUA",
"description": "Aqua color",
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "GREEN",
"description": "Green color",
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "MAGENTA",
"description": "Magenta color",
"isDeprecated": false,
"deprecationReason": null
}
],
"possibleTypes": null
},
{
"kind": "ENUM",
"name": "DataVisualizationWeightEnum",
"description": "Weight of the data visualization palette",
"fields": null,
"inputFields": null,
"interfaces": null,
"enumValues": [
{
"name": "WEIGHT_50",
"description": "50 weight",
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "WEIGHT_100",
"description": "100 weight",
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "WEIGHT_200",
"description": "200 weight",
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "WEIGHT_300",
"description": "300 weight",
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "WEIGHT_400",
"description": "400 weight",
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "WEIGHT_500",
"description": "500 weight",
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "WEIGHT_600",
"description": "600 weight",
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "WEIGHT_700",
"description": "700 weight",
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "WEIGHT_800",
"description": "800 weight",
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "WEIGHT_900",
"description": "900 weight",
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "WEIGHT_950",
"description": "950 weight",
"isDeprecated": false,
"deprecationReason": null
}
],
"possibleTypes": null
},
{
"kind": "SCALAR",
"name": "Date",
......@@ -46827,8 +46945,8 @@
"name": "colorPalette",
"description": "The color palette to assign to the on-call user, for example: \"blue\".",
"type": {
"kind": "SCALAR",
"name": "String",
"kind": "ENUM",
"name": "DataVisualizationColorEnum",
"ofType": null
},
"defaultValue": null
......@@ -46837,8 +46955,8 @@
"name": "colorWeight",
"description": "The color weight to assign to for the on-call user, for example \"500\". Max 4 chars. For easy identification of the user.",
"type": {
"kind": "SCALAR",
"name": "String",
"kind": "ENUM",
"name": "DataVisualizationWeightEnum",
"ofType": null
},
"defaultValue": null
......@@ -4272,6 +4272,36 @@ Status of a container repository.
| `HEADER` | Header validation |
| `TEXT_FILE` | Text file validation |
### DataVisualizationColorEnum
Color of the data visualization palette.
| Value | Description |
| ----- | ----------- |
| `AQUA` | Aqua color |
| `BLUE` | Blue color |
| `GREEN` | Green color |
| `MAGENTA` | Magenta color |
| `ORANGE` | Orange color |
### DataVisualizationWeightEnum
Weight of the data visualization palette.
| Value | Description |
| ----- | ----------- |
| `WEIGHT_100` | 100 weight |
| `WEIGHT_200` | 200 weight |
| `WEIGHT_300` | 300 weight |
| `WEIGHT_400` | 400 weight |
| `WEIGHT_50` | 50 weight |
| `WEIGHT_500` | 500 weight |
| `WEIGHT_600` | 600 weight |
| `WEIGHT_700` | 700 weight |
| `WEIGHT_800` | 800 weight |
| `WEIGHT_900` | 900 weight |
| `WEIGHT_950` | 950 weight |
### DesignCollectionCopyState
Copy state of a DesignCollection.
......
......@@ -11,11 +11,11 @@ module Types
required: true,
description: 'The username of the user to participate in the on-call rotation. i.e user_one'
argument :color_palette, GraphQL::STRING_TYPE,
argument :color_palette, ::Types::DataVisualizationPalette::ColorEnum,
required: false,
description: 'The color palette to assign to the on-call user, for example: "blue".'
argument :color_weight, GraphQL::STRING_TYPE,
argument :color_weight, ::Types::DataVisualizationPalette::WeightEnum,
required: false,
description: 'The color weight to assign to for the on-call user, for example "500". Max 4 chars. For easy identification of the user.'
end
......
......@@ -19,8 +19,8 @@ RSpec.describe Mutations::IncidentManagement::OncallRotation::Create do
participants: [
{
username: current_user.username,
color_weight: "500",
color_palette: "black"
color_weight: ::IncidentManagement::OncallParticipant.color_weights['50'],
color_palette: ::IncidentManagement::OncallParticipant.color_palettes[:blue]
}
]
}
......@@ -79,8 +79,8 @@ RSpec.describe Mutations::IncidentManagement::OncallRotation::Create do
participants: [
{
username: other_user.username,
color_weight: "500",
color_palette: "black"
color_weight: ::IncidentManagement::OncallParticipant.color_weights['50'],
color_palette: ::IncidentManagement::OncallParticipant.color_palettes[:blue]
}
]
)
......
......@@ -24,8 +24,8 @@ RSpec.describe 'Creating a new on-call schedule' do
participants: [
{
username: current_user.username,
colorWeight: "500",
colorPalette: "black"
colorWeight: "WEIGHT_500",
colorPalette: "BLUE"
}
]
}
......
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