From 3ba25aaaff2011cabbb40fffe266c90b3ea232e4 Mon Sep 17 00:00:00 2001 From: Yeni Atencio Date: Thu, 15 Feb 2024 13:30:21 +1100 Subject: [PATCH] ref-testing --- .DS_Store | Bin 0 -> 10244 bytes config/.DS_Store | Bin 0 -> 8196 bytes config/install/.DS_Store | Bin 0 -> 14340 bytes ...raph.call_to_action_image_logo.default.yml | 35 ++++ ...rm_display.taxonomy_term.sites.default.yml | 157 +++++++++++++++++- ...raph.call_to_action_image_logo.default.yml | 44 +++++ ...ew_display.taxonomy_term.sites.default.yml | 96 ++++++++++- ..._action_image_logo.field_feature_image.yml | 37 +++++ ..._action_image_logo.field_paragraph_cta.yml | 36 ++++ ...omy_term.sites.field_site_footer_logos.yml | 147 +++++++++++++++- ....storage.paragraph.field_feature_image.yml | 33 ++++ ....taxonomy_term.field_site_footer_logos.yml | 4 + ...agraphs_type.call_to_action_image_logo.yml | 9 + tide_site.install | 53 ++++++ 14 files changed, 639 insertions(+), 12 deletions(-) create mode 100644 .DS_Store create mode 100644 config/.DS_Store create mode 100644 config/install/.DS_Store create mode 100644 config/install/core.entity_form_display.paragraph.call_to_action_image_logo.default.yml create mode 100644 config/install/core.entity_view_display.paragraph.call_to_action_image_logo.default.yml create mode 100644 config/install/field.field.paragraph.call_to_action_image_logo.field_feature_image.yml create mode 100644 config/install/field.field.paragraph.call_to_action_image_logo.field_paragraph_cta.yml create mode 100644 config/install/field.storage.paragraph.field_feature_image.yml create mode 100644 config/install/paragraphs.paragraphs_type.call_to_action_image_logo.yml diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..42b47af1454bba5d9a2607d6d714a92da1e9e158 GIT binary patch literal 10244 zcmeHNOK%fN5U$S4u?)z(mc1a21P2a@2`myIF2;mIB;bG%9C!qeZIancW~{Lt2Sr)= z4F7=(KVYx>OZI1Q=LBC>cS85fLNb_go8Q#yq(UsemUMQG?#nHpOdkLEAs@40r}S1D*lTfM?)1Fo5rDE{ioSed`(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nufZOcxw5eBk(lDRHWz^@US?8=gv5 zZdcWrdgrdL?w;O0P0Rb%PRlU@d(dh!0?Y5yX8Ux=ty#})&sl?XxUQ_{Qa4~q8W0BPe&75#MPCG<|`eC=^+c#I(3b#nM$W)WGqK4ty3Fh ztySq76ekml8`O<*DaMuVtk>U9_w9@2gr1bOPvm{<+S?32XdAHH!d)fw`((M-KV;;r zwjn}U!J_w;eIsm z0D3rpIrQ-uK7x5lR_bLYiacr|QHj)73Xwt&>}5x_w|Ayhc%IVvWjRiD40Vqv9P-APel z9i1Gfh4|G<82;r8OncFtYPB|l;zqDbmJ)j##f)HA#H*_{i9%JdwRP31Rz!iQaND(U zVliYI*Q=^lOd%;`n>G^*>}??UR1@vQ0_;D7`loOnF2QB^iJ*QJiwNNJFosJoPQc!T z2~1%VHWRqpaVMrZ!21Z^8O)-CEBMA;m83I1^%8qCTanmIXZ3&cjlcij%u7alMIMMeFwH!G#ZBp^B;8aYHBY`jR%^$o z@2Ach(;F3(o6x|^aiY8&Cpz|rAfjj7=9h7gaks|sveN`1U+qmwlpoY-9oCunS0&MCY!EE*wuazxKz3I(Ere% zQ2q%&g?mr!^Soon^R7KvZ_6Qf54QKm+ZY$15V5BnFNdpnd3IXWJ{syqCIl0dt5S|8RHZ)XGMmR>Fnt5=3E5Dwb*N?Mh=sE93Ooh%%V7C3GB1>5 zvO!Dg>X{98k$PlMoNSfb+QqUmT1iJE2dXV^J#G0aG6$umj6&bNp1r1> z8sa%x-9UU!nQ(UZ9}sPw0Y(p8jmFrEF@iz6738+ZUsFqqO-(wPszFl~4uMw|vzzj2qvx`ldSWSRX9fJW%4(i!m5=1CY~or~J=HEBm3@~KPp;Rj?$MiNKCZY?RkSLf z>YEe1Yuci*{+_UG{T|7(qzZcYp&1}+u@+2yTgTaSP_3*hFrb{*`$VJ|n_ ztGDBzpW>m_Px0`BpW@remaining' maxlength_js_enforce: false maxlength_js_truncate_html: false + field_site_favicon: + type: image_image + weight: 20 + region: content + settings: + progress_indicator: throbber + preview_image_style: thumbnail + third_party_settings: { } + field_site_feature_flags: + type: key_value_textfield + weight: 19 + region: content + settings: + size: 60 + placeholder: '' + key_label: Key + value_label: Value + description_label: Description + description_rows: 5 + key_size: 60 + key_placeholder: '' + description_enabled: false + description_placeholder: '' + third_party_settings: { } field_site_footer_logos: type: entity_reference_paragraphs - weight: 8 + weight: 7 region: content settings: title: Paragraph @@ -195,6 +313,22 @@ content: maxlength: maxlength_js: 35 maxlength_js_label: 'Link text limited to @limit characters, remaining: @remaining' + field_site_theme_values: + type: key_value_textfield + weight: 18 + region: content + settings: + size: 60 + placeholder: '' + key_label: Key + value_label: Value + description_label: Description + description_rows: 5 + key_size: 60 + key_placeholder: '' + description_enabled: false + description_placeholder: '' + third_party_settings: { } field_site_twitter_image: type: entity_browser_entity_reference weight: 14 @@ -218,6 +352,14 @@ content: size: 60 placeholder: '' third_party_settings: { } + field_top_corner_graphic: + type: image_image + weight: 22 + region: content + settings: + progress_indicator: throbber + preview_image_style: thumbnail + third_party_settings: { } name: type: string_textfield weight: 0 @@ -226,6 +368,11 @@ content: size: 60 placeholder: '' third_party_settings: { } + simple_sitemap: + weight: 10 + region: content + settings: { } + third_party_settings: { } status: type: boolean_checkbox weight: 16 diff --git a/config/install/core.entity_view_display.paragraph.call_to_action_image_logo.default.yml b/config/install/core.entity_view_display.paragraph.call_to_action_image_logo.default.yml new file mode 100644 index 00000000..a6ce136c --- /dev/null +++ b/config/install/core.entity_view_display.paragraph.call_to_action_image_logo.default.yml @@ -0,0 +1,44 @@ +langcode: en +status: true +dependencies: + config: + - field.field.paragraph.call_to_action_image_logo.field_feature_image + - field.field.paragraph.call_to_action_image_logo.field_paragraph_cta + - paragraphs.paragraphs_type.call_to_action_image_logo + module: + - link + - svg_image +id: paragraph.call_to_action_image_logo.default +targetEntityType: paragraph +bundle: call_to_action_image_logo +mode: default +content: + field_feature_image: + type: image + label: above + settings: + image_link: '' + image_style: '' + svg_attributes: + width: null + height: null + svg_render_as_image: true + image_loading: + attribute: lazy + third_party_settings: { } + weight: 1 + region: content + field_paragraph_cta: + type: link + label: above + settings: + trim_length: 80 + url_only: false + url_plain: false + rel: '' + target: '' + third_party_settings: { } + weight: 0 + region: content +hidden: + search_api_excerpt: true diff --git a/config/install/core.entity_view_display.taxonomy_term.sites.default.yml b/config/install/core.entity_view_display.taxonomy_term.sites.default.yml index 3b7c9747..417b7930 100644 --- a/config/install/core.entity_view_display.taxonomy_term.sites.default.yml +++ b/config/install/core.entity_view_display.taxonomy_term.sites.default.yml @@ -24,6 +24,8 @@ dependencies: - entity_reference_revisions - file - link + - media + - svg_image - text id: taxonomy_term.sites.default targetEntityType: taxonomy_term @@ -35,7 +37,45 @@ content: label: above settings: { } third_party_settings: { } - weight: 9 + weight: 8 + region: content + field_bottom_corner_graphic: + type: image + label: above + settings: + image_link: '' + image_style: '' + svg_attributes: + width: null + height: null + svg_render_as_image: true + image_loading: + attribute: lazy + third_party_settings: { } + weight: 20 + region: content + field_paragraph_cta: + type: link + label: above + settings: + trim_length: 80 + url_only: false + url_plain: false + rel: '' + target: '' + third_party_settings: { } + weight: 0 + region: content + field_paragraph_media: + type: media_thumbnail + label: above + settings: + image_link: '' + image_style: '' + image_loading: + attribute: lazy + third_party_settings: { } + weight: 1 region: content field_print_friendly_logo: type: file_default @@ -67,7 +107,30 @@ content: label: above settings: { } third_party_settings: { } - weight: 3 + weight: 2 + region: content + field_site_favicon: + type: image + label: above + settings: + image_link: '' + image_style: '' + svg_attributes: + width: null + height: null + svg_render_as_image: true + image_loading: + attribute: lazy + third_party_settings: { } + weight: 18 + region: content + field_site_feature_flags: + type: key_value + label: above + settings: + value_only: false + third_party_settings: { } + weight: 17 region: content field_site_footer_logos: type: entity_reference_revisions_entity_view @@ -111,6 +174,8 @@ content: width: null height: null svg_render_as_image: true + image_loading: + attribute: lazy third_party_settings: { } weight: 1 region: content @@ -158,7 +223,15 @@ content: rel: '' target: '' third_party_settings: { } - weight: 14 + weight: 13 + region: content + field_site_theme_values: + type: key_value + label: above + settings: + value_only: false + third_party_settings: { } + weight: 16 region: content field_site_twitter_image: type: entity_reference_label @@ -174,7 +247,22 @@ content: settings: link_to_entity: false third_party_settings: { } - weight: 16 + weight: 15 + region: content + field_top_corner_graphic: + type: image + label: above + settings: + image_link: '' + image_style: '' + svg_attributes: + width: null + height: null + svg_render_as_image: true + image_loading: + attribute: lazy + third_party_settings: { } + weight: 19 region: content hidden: description: true diff --git a/config/install/field.field.paragraph.call_to_action_image_logo.field_feature_image.yml b/config/install/field.field.paragraph.call_to_action_image_logo.field_feature_image.yml new file mode 100644 index 00000000..3bc5270d --- /dev/null +++ b/config/install/field.field.paragraph.call_to_action_image_logo.field_feature_image.yml @@ -0,0 +1,37 @@ +langcode: en +status: true +dependencies: + config: + - field.storage.paragraph.field_feature_image + - paragraphs.paragraphs_type.call_to_action_image_logo + module: + - image +id: paragraph.call_to_action_image_logo.field_feature_image +field_name: field_feature_image +entity_type: paragraph +bundle: call_to_action_image_logo +label: 'Feature image' +description: '' +required: true +translatable: false +default_value: { } +default_value_callback: '' +settings: + handler: 'default:file' + handler_settings: { } + file_directory: '[date:custom:Y]-[date:custom:m]' + file_extensions: 'png gif jpg jpeg svg' + max_filesize: '' + max_resolution: '' + min_resolution: '' + alt_field: true + alt_field_required: true + title_field: false + title_field_required: false + default_image: + uuid: '' + alt: '' + title: '' + width: null + height: null +field_type: image diff --git a/config/install/field.field.paragraph.call_to_action_image_logo.field_paragraph_cta.yml b/config/install/field.field.paragraph.call_to_action_image_logo.field_paragraph_cta.yml new file mode 100644 index 00000000..6edb5d20 --- /dev/null +++ b/config/install/field.field.paragraph.call_to_action_image_logo.field_paragraph_cta.yml @@ -0,0 +1,36 @@ +langcode: en +status: true +dependencies: + config: + - field.storage.paragraph.field_paragraph_cta + - paragraphs.paragraphs_type.call_to_action_image_logo + module: + - link + - link_field_autocomplete_filter +third_party_settings: + link_field_autocomplete_filter: + negate: null + allowed_content_types: + alert: '0' + event: '0' + grant: '0' + landing_page: '0' + news: '0' + publication: '0' + publication_page: '0' + test: '0' + tide_search_listing: '0' +id: paragraph.call_to_action_image_logo.field_paragraph_cta +field_name: field_paragraph_cta +entity_type: paragraph +bundle: call_to_action_image_logo +label: CTA +description: '' +required: true +translatable: true +default_value: { } +default_value_callback: '' +settings: + title: 2 + link_type: 17 +field_type: link diff --git a/config/install/field.field.taxonomy_term.sites.field_site_footer_logos.yml b/config/install/field.field.taxonomy_term.sites.field_site_footer_logos.yml index 5ab50581..51d7e646 100644 --- a/config/install/field.field.taxonomy_term.sites.field_site_footer_logos.yml +++ b/config/install/field.field.taxonomy_term.sites.field_site_footer_logos.yml @@ -3,7 +3,7 @@ status: true dependencies: config: - field.storage.taxonomy_term.field_site_footer_logos - - paragraphs.paragraphs_type.call_to_action_image + - paragraphs.paragraphs_type.call_to_action_image_logo - taxonomy.vocabulary.sites module: - entity_reference_revisions @@ -23,9 +23,150 @@ settings: handler_settings: negate: 0 target_bundles: - call_to_action_image: call_to_action_image + call_to_action_image_logo: call_to_action_image_logo target_bundles_drag_drop: + accordion: + weight: 49 + enabled: false + accordion_content: + weight: 50 + enabled: false + banner: + weight: 51 + enabled: false + basic_text: + weight: 52 + enabled: false + call_to_action: + weight: 53 + enabled: false call_to_action_image: - enabled: true weight: 25 + enabled: false + call_to_action_image_logo: + weight: 55 + enabled: true + card_carousel: + weight: 56 + enabled: false + card_event: + weight: 57 + enabled: false + card_event_auto: + weight: 58 + enabled: false + card_keydates: + weight: 59 + enabled: false + card_promotion: + weight: 60 + enabled: false + card_promotion_auto: + weight: 61 + enabled: false + compact_card: + weight: 62 + enabled: false + compact_card_collection: + weight: 63 + enabled: false + complex_image: + weight: 64 + enabled: false + contact_us: + weight: 65 + enabled: false + content_collection: + weight: 66 + enabled: false + content_collection_enhanced: + weight: 67 + enabled: false + data_driven_component: + weight: 68 + enabled: false + data_table: + weight: 69 + enabled: false + embedded_search_form: + weight: 70 + enabled: false + embedded_webform: + weight: 71 + enabled: false + event_details: + weight: 72 + enabled: false + form_embed_openforms: + weight: 73 + enabled: false + hero_banner_with_cta: + weight: 74 + enabled: false + introduction_banner: + weight: 75 + enabled: false + key_journeys: + weight: 77 + enabled: false + keydates: + weight: 76 + enabled: false + latest_events: + weight: 78 + enabled: false + links: + weight: 79 + enabled: false + listing_content_type: + weight: 80 + enabled: false + listing_custom_filter: + weight: 81 + enabled: false + listing_site: + weight: 82 + enabled: false + listing_user_custom_filter: + weight: 83 + enabled: false + media_gallery: + weight: 84 + enabled: false + navigation_card: + weight: 85 + enabled: false + news_listing: + weight: 86 + enabled: false + phone: + weight: 87 + enabled: false + promotion_card: + weight: 88 + enabled: false + related_links: + weight: 89 + enabled: false + search_listing_header_component: + weight: 91 + enabled: false + searchable_fields: + weight: 90 + enabled: false + social_link: + weight: 92 + enabled: false + statistic_block: + weight: 94 + enabled: false + statistics_grid: + weight: 93 + enabled: false + timeline: + weight: 95 + enabled: false + timelines: + weight: 96 + enabled: false field_type: entity_reference_revisions diff --git a/config/install/field.storage.paragraph.field_feature_image.yml b/config/install/field.storage.paragraph.field_feature_image.yml new file mode 100644 index 00000000..5099f8f5 --- /dev/null +++ b/config/install/field.storage.paragraph.field_feature_image.yml @@ -0,0 +1,33 @@ +langcode: en +status: true +dependencies: + module: + - field_permissions + - file + - image + - paragraphs +third_party_settings: + field_permissions: + permission_type: public +id: paragraph.field_feature_image +field_name: field_feature_image +entity_type: paragraph +type: image +settings: + target_type: file + display_field: false + display_default: false + uri_scheme: public + default_image: + uuid: '' + alt: '' + title: '' + width: null + height: null +module: image +locked: false +cardinality: 1 +translatable: true +indexes: { } +persist_with_no_fields: false +custom_storage: false diff --git a/config/install/field.storage.taxonomy_term.field_site_footer_logos.yml b/config/install/field.storage.taxonomy_term.field_site_footer_logos.yml index e6a7a40a..653c7745 100644 --- a/config/install/field.storage.taxonomy_term.field_site_footer_logos.yml +++ b/config/install/field.storage.taxonomy_term.field_site_footer_logos.yml @@ -3,8 +3,12 @@ status: true dependencies: module: - entity_reference_revisions + - field_permissions - paragraphs - taxonomy +third_party_settings: + field_permissions: + permission_type: public id: taxonomy_term.field_site_footer_logos field_name: field_site_footer_logos entity_type: taxonomy_term diff --git a/config/install/paragraphs.paragraphs_type.call_to_action_image_logo.yml b/config/install/paragraphs.paragraphs_type.call_to_action_image_logo.yml new file mode 100644 index 00000000..4adc8682 --- /dev/null +++ b/config/install/paragraphs.paragraphs_type.call_to_action_image_logo.yml @@ -0,0 +1,9 @@ +langcode: en +status: true +dependencies: { } +id: call_to_action_image_logo +label: 'Call to action image logo' +icon_uuid: null +icon_default: null +description: '' +behavior_plugins: { } diff --git a/tide_site.install b/tide_site.install index 83348050..3cd4936b 100644 --- a/tide_site.install +++ b/tide_site.install @@ -5,6 +5,8 @@ * Install file for tide_site. */ + use Drupal\Component\Utility\NestedArray; + /** * Implements hook_install(). */ @@ -17,3 +19,54 @@ function tide_site_install() { } } } + +/** + * New field taxonomy image logo. + */ +function tide_site_update_10000() { + $configs = [ + 'paragraphs.paragraphs_type.call_to_action_image_logo' => 'paragraphs_type', + 'field.storage.paragraph.field_feature_image' => 'field_storage_config', + 'field.field.paragraph.call_to_action_image_logo.field_feature_image' => 'field_config', + 'field.field.paragraph.call_to_action_image_logo.field_paragraph_cta' => 'field_config', + 'core.entity_form_display.paragraph.call_to_action_image_logo.default' => 'entity_form_display', + 'core.entity_view_display.paragraph.call_to_action_image_logo.default' => 'entity_view_display', + + ]; + module_load_include('inc', 'tide_core', 'includes/helpers'); + $config_location = [\Drupal::service('extension.list.module')->getPath('tide_site') . '/config/install']; + // Check if field already exported to config/sync. + foreach ($configs as $config => $type) { + $config_read = _tide_read_config($config, $config_location, TRUE); + $storage = \Drupal::entityTypeManager()->getStorage($type); + $id = substr($config, strrpos($config, '.') + 1); + if ($storage->load($id) == NULL) { + $config_entity = $storage->createFromStorageRecord($config_read); + $config_entity->save(); + } + } + + $update_configs = [ + 'core.entity_view_display.taxonomy_term.sites.default' => 'entity_view_display', + 'core.entity_form_display.taxonomy_term.sites.default' => 'entity_form_display', + 'field.field.taxonomy_term.sites.field_site_footer_logos' => 'field_config', + 'field.storage.taxonomy_term.field_site_footer_logos' => 'field_storage_config', + ]; + foreach ($update_configs as $update_config => $type) { + $config_read = _tide_read_config($update_config, $config_location, FALSE); + $config = \Drupal::configFactory()->getEditable($update_config); + if (!$config) { + continue; + } + $data = $config->getRawData(); + foreach ($config_read as $key => $item) { + NestedArray::setValue($data, [ + $key, + ], NestedArray::getValue($config_read, [ + $key, + ])); + } + $config->setData($data)->save(); + } + +}