Skip to content

Commit

Permalink
Merge pull request #166 from rolodato/fix/default-tag-colour
Browse files Browse the repository at this point in the history
Make tag_colour optional
  • Loading branch information
rolodato authored Nov 8, 2024
2 parents 693676d + 5258be0 commit 28a1b23
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 28a1b23

Please sign in to comment.