Skip to content

Commit

Permalink
Make tag_colour optional
Browse files Browse the repository at this point in the history
  • Loading branch information
rolodato committed Nov 8, 2024
1 parent 693676d commit 5258be0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docs/resources/tag.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ Flagsmith Tag
### Required

- `project_uuid` (String) UUID of project the tag belongs to
- `tag_colour` (String) Hexadecimal value of the tag color
- `tag_name` (String) Name of the tag

### Optional

- `description` (String) Description of the feature
- `tag_colour` (String) Colour for this tag, as accepted by [color-string](https://github.com/Qix-/color-string).

### Read-Only

Expand Down
7 changes: 5 additions & 2 deletions flagsmith/resource_tag.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"github.com/hashicorp/terraform-plugin-framework/path"
"github.com/hashicorp/terraform-plugin-framework/resource"
"github.com/hashicorp/terraform-plugin-framework/resource/schema"
"github.com/hashicorp/terraform-plugin-framework/resource/schema/stringdefault"
"strings"

"github.com/hashicorp/terraform-plugin-framework/resource/schema/int64planmodifier"
Expand Down Expand Up @@ -75,8 +76,10 @@ func (t *tagResource) Schema(ctx context.Context, req resource.SchemaRequest, re
MarkdownDescription: "Name of the tag",
},
"tag_colour": schema.StringAttribute{
Required: true,
MarkdownDescription: "Hexadecimal value of the tag color",
Computed: true,
Optional: true,
Default: stringdefault.StaticString("#6837FC"),
MarkdownDescription: "Colour for this tag, as accepted by [color-string](https://github.com/Qix-/color-string).",
},
"description": schema.StringAttribute{
Optional: true,
Expand Down

0 comments on commit 5258be0

Please sign in to comment.