Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: added additional fields to component schema resource #83

Merged
merged 3 commits into from
Feb 18, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .changes/unreleased/Added-20250218-090151.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
kind: Added
body: Added additional fields to component resource
time: 2025-02-18T09:01:51.133547493+01:00
4 changes: 2 additions & 2 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ linters:
- cyclop
- errcheck
- exhaustive
- exportloopref
- copyloopvar
- forcetypeassert
- goimports
- gosimple
- govet
- ineffassign
- predeclared
- staticcheck
- tenv
- usetesting
- typecheck
- unused
- whitespace
21 changes: 21 additions & 0 deletions docs/resources/component.md
Original file line number Diff line number Diff line change
Expand Up @@ -202,43 +202,64 @@ Required:
Optional:

- `add_https` (Boolean) Prepends https: to stop usage of relative protocol
- `allow_advanced_search` (Boolean) Allows advanced search in option fields
- `allow_custom_attributes` (Boolean) Enables custom attributes in links for richtext or multilink fields
- `allow_external_url` (Boolean) Allows external URLs in asset or multiasset fields
- `allow_multiline` (Boolean) Enables empty paragraphs in markdown fields
- `allow_target_blank` (Boolean) Allows to open links in a new tab for Richtext; Default: false
- `asset_folder_id` (Number) Default asset folder numeric id to store uploaded image of that field
- `asset_link_type` (Boolean) Allows assets in multilink fields
- `can_sync` (Boolean) Advanced usage to sync with field in preview; Default: false
- `component_group_whitelist` (List of String) Array of group UUIDs for restricting components in bloks fields
- `component_tag_whitelist` (List of Number) Array of tag IDs for restricting components in bloks fields
- `component_whitelist` (List of String) Array of component/content type names: ["post","page","product"]. Only for type: bloks, multilink, and richtext (for nestable bloks inside that)
- `conditional_settings` (Attributes List) Array containing the object with information about conditions set on the field (see [below for nested schema](#nestedatt--schema--conditional_settings))
- `customize_toolbar` (Boolean) Allow to customize the Markdown or Richtext toolbar; Default: false
- `datasource_slug` (String) Define selectable datasources string; Effects editor only if source=internal
- `decimals` (Number) Number of decimal places for number fields
- `default_value` (String) Default value for the field; Can be an escaped JSON object
- `description` (String) Description shown in the editor interface
- `disable_time` (Boolean) Disables time selection from date picker; Default: false
- `display_name` (String) Display name shown in the editor interface
- `email_link_type` (Boolean) Allows email links in multilink fields
- `entry_appearance` (String) Appearance of an option (link or card) in an option field
- `exclude_empty_option` (Boolean) Hides empty options in option fields
- `exclude_from_merge` (Boolean) Excludes a blok from merge actions (Dimensions App).
- `exclude_from_overwrite` (Boolean) Excludes a blok from overwrite actions (Dimensions App).
- `external_datasource` (String) Define external datasource JSON Url; Effects editor only if source=external
- `field_type` (String) Name of the custom field type plugin
- `filetypes` (List of String) Array of file type names: ["images", "videos", "audios", "texts"]
- `filter_content_type` (List of String) An array of content types that can be selected in a option or options field where source is internal_stories: ["post", "faq_item"]
- `folder_slug` (String) Filter on selectable stories path; Effects editor only if source=internal_stories; In case you have a multi-language folder structure you can add the '{0}' placeholder and the path will be adapted dynamically. Examples: "{0}/categories/", {0}/{1}/categories/
- `force_link_scope` (Boolean) Force link scope to be internal_stories; Default: false
- `force_merge` (Boolean) Forces overwriting a blok during a merge action (Dimensions App).
- `image_crop` (Boolean) Activate force crop for images: (true/false)
- `image_height` (String) Define height in px or height ratio if keep_image_size is enabled
- `image_width` (String) Define width in px or width ratio if keep_image_size is enabled
- `inline_label` (Boolean) Makes the label of a boolean field inline
- `is_reference_type` (Boolean) True if the options field is of type reference
- `keep_image_size` (Boolean) Keep original size: (true/false)
- `keys` (List of String) Array of field keys to include in this section
- `link_scope` (String) A path to a folder to restrict the link scope
- `max_length` (Number) Set the max length of the input string
- `max_options` (Number) Maximum amount of options for this options field
- `max_value` (Number) Maximum value for number fields
- `maximum` (Number) Maximum amount of added bloks in this blok field
- `min_options` (Number) Minimum amount of options for this options field
- `min_value` (Number) Minimum value for number fields
- `minimum` (Number) Minimum amount of added bloks in this blok field
- `no_translate` (Boolean) Should be excluded in translation export
- `options` (Attributes List) Array of datasource entries [{name:"", value:""}]; Effects editor only if source=undefined (see [below for nested schema](#nestedatt--schema--options))
- `regex` (String) Client Regex validation for the field
- `required` (Boolean) Is field required; Default: false
- `restrict_components` (Boolean) Activate restriction nestable component option; Default: false
- `restrict_content_types` (Boolean) Activate restriction content type option
- `restrict_type` (String) Restricts the type of components used in bloks fields (e.g., tags, groups).
- `rich_markdown` (Boolean) Enable rich markdown view by default (true/false)
- `rtl` (Boolean) Enable global RTL for this field
- `show_anchor` (Boolean) Enables anchor field for internal links in multilink fields
- `source` (String) Possible values: undefined: Self; internal_stories: Stories; internal: Datasource; external: API Endpoint in Datasource Entries Array Format
- `steps` (Number) Step interval for number fields
- `toolbar` (List of String) Array of toolbar keys to include in the Richtext or Markdown toolbar
- `tooltip` (Boolean) Show the description as a tooltip
- `translatable` (Boolean) Can field be translated; Default: false
Expand Down
57 changes: 29 additions & 28 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
module github.com/labd/terraform-provider-storyblok

go 1.22
toolchain go1.22.5
go 1.22.7

// replace github.com/labd/storyblok-go-sdk => ../storyblok-go-sdk
toolchain go1.22.8

//replace github.com/labd/storyblok-go-sdk => ../storyblok-go-sdk

require (
github.com/davecgh/go-spew v1.1.1
github.com/deepmap/oapi-codegen v1.16.3
github.com/hashicorp/terraform-plugin-docs v0.19.4
github.com/hashicorp/terraform-plugin-framework v1.12.0
github.com/hashicorp/terraform-plugin-docs v0.20.1
github.com/hashicorp/terraform-plugin-framework v1.13.0
github.com/hashicorp/terraform-plugin-log v0.9.0
github.com/labd/storyblok-go-sdk v0.6.0
github.com/labd/storyblok-go-sdk v0.7.0
github.com/wk8/go-ordered-map/v2 v2.1.8
)

require (
github.com/Masterminds/goutils v1.1.1 // indirect
github.com/Masterminds/semver/v3 v3.2.1 // indirect
github.com/Masterminds/sprig/v3 v3.2.3 // indirect
github.com/Masterminds/semver/v3 v3.3.0 // indirect
github.com/Masterminds/sprig/v3 v3.3.0 // indirect
github.com/apapsch/go-jsonmerge/v2 v2.0.0 // indirect
github.com/armon/go-radix v1.0.0 // indirect
github.com/bahlo/generic-list-go v0.2.0 // indirect
Expand All @@ -34,20 +35,19 @@ require (
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
github.com/hashicorp/go-hclog v1.6.3 // indirect
github.com/hashicorp/go-multierror v1.1.1 // indirect
github.com/hashicorp/go-plugin v1.6.1 // indirect
github.com/hashicorp/go-plugin v1.6.2 // indirect
github.com/hashicorp/go-uuid v1.0.3 // indirect
github.com/hashicorp/go-version v1.7.0 // indirect
github.com/hashicorp/hc-install v0.7.0 // indirect
github.com/hashicorp/hc-install v0.9.0 // indirect
github.com/hashicorp/terraform-exec v0.21.0 // indirect
github.com/hashicorp/terraform-json v0.22.1 // indirect
github.com/hashicorp/terraform-json v0.23.0 // indirect
github.com/hashicorp/terraform-plugin-framework-validators v0.13.0
github.com/hashicorp/terraform-plugin-go v0.24.0
github.com/hashicorp/terraform-plugin-go v0.25.0
github.com/hashicorp/terraform-registry-address v0.2.3 // indirect
github.com/hashicorp/terraform-svchost v0.1.1 // indirect
github.com/hashicorp/yamux v0.1.1 // indirect
github.com/huandu/xstrings v1.4.0 // indirect
github.com/imdario/mergo v0.3.16 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/huandu/xstrings v1.5.0 // indirect
github.com/mailru/easyjson v0.9.0 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mitchellh/copystructure v1.2.0 // indirect
Expand All @@ -56,16 +56,16 @@ require (
github.com/oklog/run v1.1.0 // indirect
github.com/posener/complete v1.2.3 // indirect
github.com/shopspring/decimal v1.4.0 // indirect
github.com/spf13/cast v1.6.0 // indirect
github.com/zclconf/go-cty v1.14.4 // indirect
golang.org/x/crypto v0.24.0 // indirect
github.com/spf13/cast v1.7.0 // indirect
github.com/zclconf/go-cty v1.15.0 // indirect
golang.org/x/crypto v0.26.0 // indirect
golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 // indirect
golang.org/x/mod v0.18.0 // indirect
golang.org/x/net v0.26.0 // indirect
golang.org/x/sys v0.21.0 // indirect
golang.org/x/text v0.16.0 // indirect
google.golang.org/grpc v1.66.2 // indirect
google.golang.org/protobuf v1.34.2 // indirect
golang.org/x/mod v0.21.0 // indirect
golang.org/x/net v0.28.0 // indirect
golang.org/x/sys v0.24.0 // indirect
golang.org/x/text v0.20.0 // indirect
google.golang.org/grpc v1.67.1 // indirect
google.golang.org/protobuf v1.35.1 // indirect
)

require (
Expand All @@ -76,12 +76,13 @@ require (
)

require (
dario.cat/mergo v1.0.1 // indirect
github.com/BurntSushi/toml v1.3.2 // indirect
github.com/Kunde21/markdownfmt/v3 v3.1.0 // indirect
github.com/ProtonMail/go-crypto v1.1.0-alpha.2-proton // indirect
github.com/agext/levenshtein v1.2.2 // indirect
github.com/apparentlymart/go-textseg/v15 v15.0.0 // indirect
github.com/bmatcuk/doublestar/v4 v4.6.1 // indirect
github.com/bmatcuk/doublestar/v4 v4.7.1 // indirect
github.com/cloudflare/circl v1.3.8 // indirect
github.com/go-test/deep v1.0.8 // indirect
github.com/google/go-cmp v0.6.0 // indirect
Expand All @@ -98,13 +99,13 @@ require (
github.com/vmihailenco/msgpack v4.0.4+incompatible // indirect
github.com/vmihailenco/msgpack/v5 v5.4.1 // indirect
github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect
github.com/yuin/goldmark v1.7.1 // indirect
github.com/yuin/goldmark v1.7.7 // indirect
github.com/yuin/goldmark-meta v1.1.0 // indirect
go.abhg.dev/goldmark/frontmatter v0.2.0 // indirect
golang.org/x/sync v0.7.0 // indirect
golang.org/x/sync v0.9.0 // indirect
golang.org/x/tools v0.22.0 // indirect
google.golang.org/appengine v1.6.8 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240604185151-ef581f913117 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240814211410-ddb44dafa142 // indirect
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
Expand Down
Loading
Loading