Skip to content

Commit

Permalink
Replace go_color color picker with an options_select dropdown in …
Browse files Browse the repository at this point in the history
…`go_category`

This change streamlines the use of colors in the Go project. Unfortunately, we cannot reuse fields between paragraph types and normal content types.
  • Loading branch information
kasperbirch1 committed Jan 31, 2025
1 parent f597b64 commit 1a27de8
Show file tree
Hide file tree
Showing 12 changed files with 85 additions and 74 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,14 @@ langcode: en
status: true
dependencies:
config:
- field.field.node.go_category.field_category_menu_color
- field.field.node.go_category.field_category_menu_image
- field.field.node.go_category.field_category_menu_sound
- field.field.node.go_category.field_category_menu_title
- field.field.node.go_category.field_go_color
- field.field.node.go_category.field_paragraphs
- field.field.node.go_category.field_publication_date
- node.type.go_category
module:
- color_field
- datetime
- field_group
- media_library
Expand Down Expand Up @@ -64,13 +63,6 @@ targetEntityType: node
bundle: go_category
mode: default
content:
field_category_menu_color:
type: color_field_widget_box
weight: 28
region: content
settings:
default_colors: '#ffd2f0,#dcc3ff,#ffdcb9,#bee6fa'
third_party_settings: { }
field_category_menu_image:
type: media_library_widget
weight: 29
Expand All @@ -93,6 +85,12 @@ content:
size: 60
placeholder: ''
third_party_settings: { }
field_go_color:
type: options_select
weight: 31
region: content
settings: { }
third_party_settings: { }
field_paragraphs:
type: paragraphs
weight: 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ status: true
dependencies:
config:
- core.entity_view_mode.node.card
- field.field.node.go_category.field_category_menu_color
- field.field.node.go_category.field_category_menu_image
- field.field.node.go_category.field_category_menu_sound
- field.field.node.go_category.field_category_menu_title
- field.field.node.go_category.field_go_color
- field.field.node.go_category.field_paragraphs
- field.field.node.go_category.field_publication_date
- node.type.go_category
Expand All @@ -24,10 +24,10 @@ content:
weight: 100
region: content
hidden:
field_category_menu_color: true
field_category_menu_image: true
field_category_menu_sound: true
field_category_menu_title: true
field_go_color: true
field_paragraphs: true
field_publication_date: true
langcode: true
Expand Down
20 changes: 9 additions & 11 deletions config/sync/core.entity_view_display.node.go_category.default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,31 +3,22 @@ langcode: en
status: true
dependencies:
config:
- field.field.node.go_category.field_category_menu_color
- field.field.node.go_category.field_category_menu_image
- field.field.node.go_category.field_category_menu_sound
- field.field.node.go_category.field_category_menu_title
- field.field.node.go_category.field_go_color
- field.field.node.go_category.field_paragraphs
- field.field.node.go_category.field_publication_date
- node.type.go_category
module:
- color_field
- datetime
- options
- user
id: node.go_category.default
targetEntityType: node
bundle: go_category
mode: default
content:
field_category_menu_color:
type: color_field_formatter_text
label: above
settings:
format: hex
opacity: true
third_party_settings: { }
weight: 118
region: content
field_category_menu_image:
type: entity_reference_entity_view
label: above
Expand All @@ -54,6 +45,13 @@ content:
third_party_settings: { }
weight: 115
region: content
field_go_color:
type: list_default
label: above
settings: { }
third_party_settings: { }
weight: 118
region: content
field_publication_date:
type: datetime_default
label: above
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ status: true
dependencies:
config:
- core.entity_view_mode.node.full
- field.field.node.go_category.field_category_menu_color
- field.field.node.go_category.field_category_menu_image
- field.field.node.go_category.field_category_menu_sound
- field.field.node.go_category.field_category_menu_title
- field.field.node.go_category.field_go_color
- field.field.node.go_category.field_paragraphs
- field.field.node.go_category.field_publication_date
- node.type.go_category
Expand All @@ -34,10 +34,10 @@ content:
weight: 100
region: content
hidden:
field_category_menu_color: true
field_category_menu_image: true
field_category_menu_sound: true
field_category_menu_title: true
field_go_color: true
field_publication_date: true
langcode: true
search_api_excerpt: true
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ status: true
dependencies:
config:
- core.entity_view_mode.node.list_teaser
- field.field.node.go_category.field_category_menu_color
- field.field.node.go_category.field_category_menu_image
- field.field.node.go_category.field_category_menu_sound
- field.field.node.go_category.field_category_menu_title
- field.field.node.go_category.field_go_color
- field.field.node.go_category.field_paragraphs
- field.field.node.go_category.field_publication_date
- node.type.go_category
Expand All @@ -24,10 +24,10 @@ content:
weight: 100
region: content
hidden:
field_category_menu_color: true
field_category_menu_image: true
field_category_menu_sound: true
field_category_menu_title: true
field_go_color: true
field_paragraphs: true
field_publication_date: true
langcode: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ status: true
dependencies:
config:
- core.entity_view_mode.node.nav_spot
- field.field.node.go_category.field_category_menu_color
- field.field.node.go_category.field_category_menu_image
- field.field.node.go_category.field_category_menu_sound
- field.field.node.go_category.field_category_menu_title
- field.field.node.go_category.field_go_color
- field.field.node.go_category.field_paragraphs
- field.field.node.go_category.field_publication_date
- node.type.go_category
Expand All @@ -24,10 +24,10 @@ content:
weight: 100
region: content
hidden:
field_category_menu_color: true
field_category_menu_image: true
field_category_menu_sound: true
field_category_menu_title: true
field_go_color: true
field_paragraphs: true
field_publication_date: true
langcode: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ status: true
dependencies:
config:
- core.entity_view_mode.node.teaser
- field.field.node.go_category.field_category_menu_color
- field.field.node.go_category.field_category_menu_image
- field.field.node.go_category.field_category_menu_sound
- field.field.node.go_category.field_category_menu_title
- field.field.node.go_category.field_go_color
- field.field.node.go_category.field_paragraphs
- field.field.node.go_category.field_publication_date
- node.type.go_category
Expand All @@ -24,10 +24,10 @@ content:
weight: 100
region: content
hidden:
field_category_menu_color: true
field_category_menu_image: true
field_category_menu_sound: true
field_category_menu_title: true
field_go_color: true
field_paragraphs: true
field_publication_date: true
langcode: true
Expand Down

This file was deleted.

21 changes: 21 additions & 0 deletions config/sync/field.field.node.go_category.field_go_color.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
uuid: ce1a2dde-cd99-42ac-8a67-fd1ce54dbe36
langcode: en
status: true
dependencies:
config:
- field.storage.node.field_go_color
- node.type.go_category
module:
- options
id: node.go_category.field_go_color
field_name: field_go_color
entity_type: node
bundle: go_category
label: 'Category menu color'
description: ''
required: false
translatable: false
default_value: { }
default_value_callback: ''
settings: { }
field_type: list_string
20 changes: 0 additions & 20 deletions config/sync/field.storage.node.field_category_menu_color.yml

This file was deleted.

36 changes: 36 additions & 0 deletions config/sync/field.storage.node.field_go_color.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
uuid: c8209755-e72b-4ff6-9160-4ee174a2bc66
langcode: en
status: true
dependencies:
module:
- node
- options
id: node.field_go_color
field_name: field_go_color
entity_type: node
type: list_string
settings:
allowed_values:
-
value: content_color_1
label: 'Content Color 1'
-
value: content_color_2
label: 'Content Color 2'
-
value: content_color_3
label: 'Content Color 3'
-
value: content_color_4
label: 'Content Color 4'
-
value: content_color_5
label: 'Content Color 5'
allowed_values_function: ''
module: options
locked: false
cardinality: 1
translatable: true
indexes: { }
persist_with_no_fields: false
custom_storage: false
4 changes: 2 additions & 2 deletions config/sync/graphql_compose.settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -174,14 +174,14 @@ field_config:
field_teaser_text:
enabled: true
go_category:
field_category_menu_color:
enabled: true
field_category_menu_image:
enabled: true
field_category_menu_sound:
enabled: true
field_category_menu_title:
enabled: true
field_go_color:
enabled: true
field_paragraphs:
enabled: true
field_publication_date:
Expand Down

0 comments on commit 1a27de8

Please sign in to comment.