From 45e1148be4cae55d84edaa8a8906515eabc4e34f Mon Sep 17 00:00:00 2001 From: Mike Decker Date: Wed, 4 Sep 2024 16:20:25 -0700 Subject: [PATCH] Configured form settings and display settings and added some acceptance tests --- ...play.node.stanford_opportunity.default.yml | 27 +- ..._term.opportunity_tag_filters.default.yml} | 6 +- ...play.node.stanford_opportunity.default.yml | 414 +++++++++--------- ...e.stanford_opportunity.search_indexing.yml | 93 ++++ ...ode.stanford_opportunity.stanford_card.yml | 159 +++++++ ....stanford_opportunity.stanford_h3_card.yml | 158 +++++++ ...splay.node.stanford_opportunity.teaser.yml | 4 +- ...ord_opportunity.layout_builder__layout.yml | 21 + ....node.stanford_opportunity.su_opp_tags.yml | 6 +- ...my_vocabulary_opportunity_tag_filters.yml} | 6 +- .../sync/search_api.index.algolia_search.yml | 9 +- .../search_api.index.full_site_content.yml | 1 + ...my.vocabulary.opportunity_tag_filters.yml} | 2 +- config/sync/user.role.opportunity_editor.yml | 8 +- .../acceptance/Content/OpportunityCest.php | 57 +++ .../functional/Content/OpportunityCest.php | 92 ++++ 16 files changed, 841 insertions(+), 222 deletions(-) rename config/sync/{core.entity_form_display.taxonomy_term.opportunity_tag_1.default.yml => core.entity_form_display.taxonomy_term.opportunity_tag_filters.default.yml} (85%) create mode 100644 config/sync/core.entity_view_display.node.stanford_opportunity.search_indexing.yml create mode 100644 config/sync/core.entity_view_display.node.stanford_opportunity.stanford_card.yml create mode 100644 config/sync/core.entity_view_display.node.stanford_opportunity.stanford_h3_card.yml create mode 100644 config/sync/field.field.node.stanford_opportunity.layout_builder__layout.yml rename config/sync/{rabbit_hole.behavior_settings.taxonomy_vocabulary_opportunity_tag_1.yml => rabbit_hole.behavior_settings.taxonomy_vocabulary_opportunity_tag_filters.yml} (64%) rename config/sync/{taxonomy.vocabulary.opportunity_tag_1.yml => taxonomy.vocabulary.opportunity_tag_filters.yml} (95%) create mode 100644 tests/codeception/acceptance/Content/OpportunityCest.php create mode 100644 tests/codeception/functional/Content/OpportunityCest.php diff --git a/config/sync/core.entity_form_display.node.stanford_opportunity.default.yml b/config/sync/core.entity_form_display.node.stanford_opportunity.default.yml index 2c279fabb..19e5bcac3 100644 --- a/config/sync/core.entity_form_display.node.stanford_opportunity.default.yml +++ b/config/sync/core.entity_form_display.node.stanford_opportunity.default.yml @@ -4,6 +4,7 @@ status: true dependencies: config: - field.field.node.stanford_opportunity.body + - field.field.node.stanford_opportunity.layout_builder__layout - field.field.node.stanford_opportunity.su_opp_application_deadline - field.field.node.stanford_opportunity.su_opp_components - field.field.node.stanford_opportunity.su_opp_contact_email @@ -28,6 +29,7 @@ dependencies: module: - change_labels - datetime + - field_formatter_class - field_group - layout_paragraphs - link @@ -139,6 +141,12 @@ content: region: content settings: { } third_party_settings: { } + layout_builder__layout: + type: null + weight: 53 + region: content + settings: { } + third_party_settings: { } path: type: path weight: 12 @@ -192,9 +200,16 @@ content: preview_view_mode: default form_display_mode: default nesting_depth: 0 - require_layouts: 0 + require_layouts: 1 empty_message: '' - third_party_settings: { } + third_party_settings: + field_formatter_class: + class: '' + change_labels: + add_another: '' + field_label_overwrite: '' + hide_add_another: 0 + force_single_cardinality: 0 su_opp_contact_email: type: email_default weight: 16 @@ -288,14 +303,10 @@ content: placeholder_title: '' third_party_settings: { } su_opp_sponsor: - type: entity_reference_autocomplete + type: options_select weight: 3 region: content - settings: - match_operator: CONTAINS - match_limit: 10 - size: 60 - placeholder: '' + settings: { } third_party_settings: { } su_opp_start_date: type: datetime_default diff --git a/config/sync/core.entity_form_display.taxonomy_term.opportunity_tag_1.default.yml b/config/sync/core.entity_form_display.taxonomy_term.opportunity_tag_filters.default.yml similarity index 85% rename from config/sync/core.entity_form_display.taxonomy_term.opportunity_tag_1.default.yml rename to config/sync/core.entity_form_display.taxonomy_term.opportunity_tag_filters.default.yml index 66180637d..5111860ac 100644 --- a/config/sync/core.entity_form_display.taxonomy_term.opportunity_tag_1.default.yml +++ b/config/sync/core.entity_form_display.taxonomy_term.opportunity_tag_filters.default.yml @@ -3,13 +3,13 @@ langcode: en status: true dependencies: config: - - taxonomy.vocabulary.opportunity_tag_1 + - taxonomy.vocabulary.opportunity_tag_filters module: - path - text -id: taxonomy_term.opportunity_tag_1.default +id: taxonomy_term.opportunity_tag_filters.default targetEntityType: taxonomy_term -bundle: opportunity_tag_1 +bundle: opportunity_tag_filters mode: default content: description: diff --git a/config/sync/core.entity_view_display.node.stanford_opportunity.default.yml b/config/sync/core.entity_view_display.node.stanford_opportunity.default.yml index cd70eea73..9460689e8 100644 --- a/config/sync/core.entity_view_display.node.stanford_opportunity.default.yml +++ b/config/sync/core.entity_view_display.node.stanford_opportunity.default.yml @@ -4,6 +4,7 @@ status: true dependencies: config: - field.field.node.stanford_opportunity.body + - field.field.node.stanford_opportunity.layout_builder__layout - field.field.node.stanford_opportunity.su_opp_application_deadline - field.field.node.stanford_opportunity.su_opp_components - field.field.node.stanford_opportunity.su_opp_contact_email @@ -26,205 +27,228 @@ dependencies: - field.field.node.stanford_opportunity.su_opp_type - node.type.stanford_opportunity module: - - datetime - - entity_reference_revisions - - link - - text + - jumpstart_ui + - layout_builder + - layout_builder_restrictions + - layout_library - user +third_party_settings: + layout_builder: + enabled: true + allow_custom: true + sections: + - + layout_id: jumpstart_ui_one_column + layout_settings: + label: '' + context_mapping: { } + extra_classes: '' + centered: centered-container + columns: default + components: + d8d66e18-44f6-4e82-90c7-131eaf8e19de: + uuid: d8d66e18-44f6-4e82-90c7-131eaf8e19de + region: main + configuration: + id: 'field_block:node:stanford_opportunity:title' + label: Title + label_display: '0' + provider: layout_builder + context_mapping: + entity: layout_builder.entity + view_mode: view_mode + formatter: + type: entity_title_heading + label: hidden + settings: + tag: h1 + third_party_settings: + empty_fields: + handler: '' + field_formatter_class: + class: '' + field_label: + label_value: '' + label_tag: '' + weight: 0 + additional: { } + e712f81b-4aa1-4bc7-bb7f-5068acb3bbd1: + uuid: e712f81b-4aa1-4bc7-bb7f-5068acb3bbd1 + region: main + configuration: + id: 'field_block:node:stanford_opportunity:body' + label: Body + label_display: '0' + provider: layout_builder + context_mapping: + entity: layout_builder.entity + view_mode: view_mode + formatter: + type: text_default + label: hidden + settings: { } + third_party_settings: + empty_fields: + handler: '' + field_formatter_class: + class: '' + field_label: + label_value: '' + label_tag: '' + weight: 1 + additional: { } + 75a9a36d-20ef-46a1-aaf6-3fbe4814ec5b: + uuid: 75a9a36d-20ef-46a1-aaf6-3fbe4814ec5b + region: main + configuration: + id: 'field_block:node:stanford_opportunity:su_opp_components' + label: Paragraphs + label_display: '0' + provider: layout_builder + context_mapping: + entity: layout_builder.entity + view_mode: view_mode + formatter: + type: layout_paragraphs + label: above + settings: + view_mode: default + third_party_settings: + empty_fields: + handler: '' + field_formatter_class: + class: '' + field_label: + label_value: '' + label_tag: '' + weight: 2 + additional: { } + third_party_settings: { } + layout_library: + enable: false + layout_builder_restrictions: + allowed_block_categories: + - 'Basic Page Type Lists (Views)' + - Book + - 'Changelog (Views)' + - 'Chaos Tools' + - 'Config Pages' + - 'Content fields' + - 'Custom block types' + - 'Custom blocks' + - Devel + - 'Devel PHP' + - Editoria11y + - 'Events Lists (Views)' + - Forms + - Help + - 'Inline blocks' + - 'Jumpstart UI' + - 'Lists (Views)' + - Menus + - 'News Lists (Views)' + - 'PDB React' + - 'People Lists (Views)' + - 'Policy (Views)' + - Printable + - 'Publication (Views)' + - React + - 'Stanford News' + - 'Stanford Profile Helper' + - 'Stanford SAML Authentication' + - System + - 'Taxonomy Terms (Views)' + - User + - Views + - core + entity_view_mode_restriction: + allowed_layouts: + - jumpstart_ui_one_column + - jumpstart_ui_two_column + - jumpstart_ui_three_column + denylisted_blocks: { } + allowlisted_blocks: + 'Changelog (Views)': + - 'views_block:change_logs-policy_changes' + 'Content fields': + - 'field_block:node:stanford_opportunity:su_opp_application_deadline' + - 'field_block:node:stanford_opportunity:su_opp_open_date' + - 'field_block:node:stanford_opportunity:body' + - 'field_block:node:stanford_opportunity:su_opp_cta_url' + - 'field_block:node:stanford_opportunity:changed' + - 'field_block:node:stanford_opportunity:su_opp_status' + - 'field_block:node:stanford_opportunity:su_opp_contact_email' + - 'field_block:node:stanford_opportunity:su_opp_contact_url' + - 'field_block:node:stanford_opportunity:su_opp_contact_name' + - 'field_block:node:stanford_opportunity:su_opp_contact_phone' + - 'field_block:node:stanford_opportunity:su_opp_course_code' + - 'field_block:node:stanford_opportunity:su_opp_eligibility' + - 'field_block:node:stanford_opportunity:su_opp_source' + - 'field_block:node:stanford_opportunity:su_opp_image' + - 'field_block:node:stanford_opportunity:su_opp_learn_more' + - 'field_block:node:stanford_opportunity:su_opp_tags' + - 'field_block:node:stanford_opportunity:su_opp_type' + - 'field_block:node:stanford_opportunity:su_opp_components' + - 'field_block:node:stanford_opportunity:su_opp_prerequisites' + - 'field_block:node:stanford_opportunity:su_opp_sponsor' + - 'field_block:node:stanford_opportunity:su_opp_start_date' + - 'field_block:node:stanford_opportunity:su_opp_summary' + - 'field_block:node:stanford_opportunity:title' + Menus: + - 'system_menu_block:stanford-event-types' + - 'menu_block:main' + - 'system_menu_block:stanford-person-type' + - 'system_menu_block:stanford-publication-topics' + - 'system_menu_block:news-topics' + System: + - system_breadcrumb_block + core: + - page_title_block + restricted_categories: + - Book + - 'Chaos Tools' + - 'Config Pages' + - Devel + - 'Devel PHP' + - Editoria11y + - Forms + - Help + - 'Lists (Views)' + - 'Policy (Views)' + - Printable + - React + - 'Stanford Profile Helper' + - 'Stanford SAML Authentication' + - 'Taxonomy Terms (Views)' + - User + - Views id: node.stanford_opportunity.default targetEntityType: node bundle: stanford_opportunity mode: default -content: - body: - type: text_default - label: hidden - settings: { } - third_party_settings: { } - weight: 101 - region: content - links: - settings: { } - third_party_settings: { } - weight: 100 - region: content - su_opp_application_deadline: - type: datetime_default - label: above - settings: - timezone_override: '' - format_type: medium - third_party_settings: { } - weight: 102 - region: content - su_opp_components: - type: entity_reference_revisions_entity_view - label: above - settings: - view_mode: default - link: '' - third_party_settings: { } - weight: 116 - region: content - su_opp_contact_email: - type: basic_string - label: above - settings: { } - third_party_settings: { } - weight: 104 - region: content - su_opp_contact_name: - type: string - label: above - settings: - link_to_entity: false - third_party_settings: { } - weight: 105 - region: content - su_opp_contact_phone: - type: basic_string - label: above - settings: { } - third_party_settings: { } - weight: 106 - region: content - su_opp_contact_url: - type: link - label: above - settings: - trim_length: 80 - url_only: false - url_plain: false - rel: '' - target: '' - third_party_settings: { } - weight: 117 - region: content - su_opp_course_code: - type: string - label: above - settings: - link_to_entity: false - third_party_settings: { } - weight: 107 - region: content - su_opp_cta_url: - type: link - label: above - settings: - trim_length: 80 - url_only: false - url_plain: false - rel: '' - target: '' - third_party_settings: { } - weight: 103 - region: content - su_opp_eligibility: - type: text_default - label: above - settings: { } - third_party_settings: { } - weight: 109 - region: content - su_opp_image: - type: entity_reference_entity_view - label: above - settings: - view_mode: default - link: false - third_party_settings: { } - weight: 110 - region: content - su_opp_learn_more: - type: link - label: above - settings: - trim_length: 80 - url_only: false - url_plain: false - rel: '' - target: '' - third_party_settings: { } - weight: 111 - region: content - su_opp_open_date: - type: datetime_default - label: above - settings: - timezone_override: '' - format_type: medium - third_party_settings: { } - weight: 114 - region: content - su_opp_prerequisites: - type: text_default - label: above - settings: { } - third_party_settings: { } - weight: 118 - region: content - su_opp_source: - type: link - label: above - settings: - trim_length: 80 - url_only: false - url_plain: false - rel: '' - target: '' - third_party_settings: { } - weight: 112 - region: content - su_opp_sponsor: - type: entity_reference_label - label: above - settings: - link: true - third_party_settings: { } - weight: 119 - region: content - su_opp_start_date: - type: datetime_default - label: above - settings: - timezone_override: '' - format_type: medium - third_party_settings: { } - weight: 108 - region: content - su_opp_status: - type: boolean - label: above - settings: - format: default - format_custom_false: '' - format_custom_true: '' - third_party_settings: { } - weight: 113 - region: content - su_opp_summary: - type: text_default - label: above - settings: { } - third_party_settings: { } - weight: 115 - region: content - su_opp_tags: - type: entity_reference_label - label: above - settings: - link: true - third_party_settings: { } - weight: 121 - region: content - su_opp_type: - type: entity_reference_label - label: above - settings: - link: true - third_party_settings: { } - weight: 120 - region: content +content: { } hidden: + body: true + layout_builder__layout: true + links: true search_api_excerpt: true + su_opp_application_deadline: true + su_opp_components: true + su_opp_contact_email: true + su_opp_contact_name: true + su_opp_contact_phone: true + su_opp_contact_url: true + su_opp_course_code: true + su_opp_cta_url: true + su_opp_eligibility: true + su_opp_image: true + su_opp_learn_more: true + su_opp_open_date: true + su_opp_prerequisites: true + su_opp_source: true + su_opp_sponsor: true + su_opp_start_date: true + su_opp_status: true + su_opp_summary: true + su_opp_tags: true + su_opp_type: true diff --git a/config/sync/core.entity_view_display.node.stanford_opportunity.search_indexing.yml b/config/sync/core.entity_view_display.node.stanford_opportunity.search_indexing.yml new file mode 100644 index 000000000..4fe704b69 --- /dev/null +++ b/config/sync/core.entity_view_display.node.stanford_opportunity.search_indexing.yml @@ -0,0 +1,93 @@ +uuid: 1916634a-c65b-4f14-a373-226322fb5d44 +langcode: en +status: true +dependencies: + config: + - core.entity_view_mode.node.search_indexing + - field.field.node.stanford_opportunity.body + - field.field.node.stanford_opportunity.layout_builder__layout + - field.field.node.stanford_opportunity.su_opp_application_deadline + - field.field.node.stanford_opportunity.su_opp_components + - field.field.node.stanford_opportunity.su_opp_contact_email + - field.field.node.stanford_opportunity.su_opp_contact_name + - field.field.node.stanford_opportunity.su_opp_contact_phone + - field.field.node.stanford_opportunity.su_opp_contact_url + - field.field.node.stanford_opportunity.su_opp_course_code + - field.field.node.stanford_opportunity.su_opp_cta_url + - field.field.node.stanford_opportunity.su_opp_eligibility + - field.field.node.stanford_opportunity.su_opp_image + - field.field.node.stanford_opportunity.su_opp_learn_more + - field.field.node.stanford_opportunity.su_opp_open_date + - field.field.node.stanford_opportunity.su_opp_prerequisites + - field.field.node.stanford_opportunity.su_opp_source + - field.field.node.stanford_opportunity.su_opp_sponsor + - field.field.node.stanford_opportunity.su_opp_start_date + - field.field.node.stanford_opportunity.su_opp_status + - field.field.node.stanford_opportunity.su_opp_summary + - field.field.node.stanford_opportunity.su_opp_tags + - field.field.node.stanford_opportunity.su_opp_type + - node.type.stanford_opportunity + module: + - layout_builder + - layout_builder_restrictions + - layout_library + - layout_paragraphs + - text + - user +third_party_settings: + layout_builder: + enabled: false + allow_custom: false + layout_library: + enable: false + layout_builder_restrictions: + allowed_block_categories: { } + entity_view_mode_restriction: + allowed_layouts: { } + denylisted_blocks: { } + allowlisted_blocks: { } + restricted_categories: { } +id: node.stanford_opportunity.search_indexing +targetEntityType: node +bundle: stanford_opportunity +mode: search_indexing +content: + body: + type: text_default + label: hidden + settings: { } + third_party_settings: { } + weight: 0 + region: content + su_opp_components: + type: layout_paragraphs + label: hidden + settings: + view_mode: default + link: '' + third_party_settings: { } + weight: 1 + region: content +hidden: + layout_builder__layout: true + links: true + search_api_excerpt: true + su_opp_application_deadline: true + su_opp_contact_email: true + su_opp_contact_name: true + su_opp_contact_phone: true + su_opp_contact_url: true + su_opp_course_code: true + su_opp_cta_url: true + su_opp_eligibility: true + su_opp_image: true + su_opp_learn_more: true + su_opp_open_date: true + su_opp_prerequisites: true + su_opp_source: true + su_opp_sponsor: true + su_opp_start_date: true + su_opp_status: true + su_opp_summary: true + su_opp_tags: true + su_opp_type: true diff --git a/config/sync/core.entity_view_display.node.stanford_opportunity.stanford_card.yml b/config/sync/core.entity_view_display.node.stanford_opportunity.stanford_card.yml new file mode 100644 index 000000000..a5eac0b0a --- /dev/null +++ b/config/sync/core.entity_view_display.node.stanford_opportunity.stanford_card.yml @@ -0,0 +1,159 @@ +uuid: 7fcf8863-6439-478b-9c8e-412b0de21623 +langcode: en +status: true +dependencies: + config: + - core.entity_view_mode.node.stanford_card + - field.field.node.stanford_opportunity.body + - field.field.node.stanford_opportunity.layout_builder__layout + - field.field.node.stanford_opportunity.su_opp_application_deadline + - field.field.node.stanford_opportunity.su_opp_components + - field.field.node.stanford_opportunity.su_opp_contact_email + - field.field.node.stanford_opportunity.su_opp_contact_name + - field.field.node.stanford_opportunity.su_opp_contact_phone + - field.field.node.stanford_opportunity.su_opp_contact_url + - field.field.node.stanford_opportunity.su_opp_course_code + - field.field.node.stanford_opportunity.su_opp_cta_url + - field.field.node.stanford_opportunity.su_opp_eligibility + - field.field.node.stanford_opportunity.su_opp_image + - field.field.node.stanford_opportunity.su_opp_learn_more + - field.field.node.stanford_opportunity.su_opp_open_date + - field.field.node.stanford_opportunity.su_opp_prerequisites + - field.field.node.stanford_opportunity.su_opp_source + - field.field.node.stanford_opportunity.su_opp_sponsor + - field.field.node.stanford_opportunity.su_opp_start_date + - field.field.node.stanford_opportunity.su_opp_status + - field.field.node.stanford_opportunity.su_opp_summary + - field.field.node.stanford_opportunity.su_opp_tags + - field.field.node.stanford_opportunity.su_opp_type + - node.type.stanford_opportunity + module: + - ds + - empty_fields + - field_formatter_class + - field_label + - layout_builder + - layout_builder_restrictions + - layout_library + - smart_trim + - stanford_media + - user +third_party_settings: + layout_builder: + enabled: false + allow_custom: false + layout_library: + enable: false + layout_builder_restrictions: + allowed_block_categories: { } + entity_view_mode_restriction: + allowed_layouts: { } + denylisted_blocks: { } + allowlisted_blocks: { } + restricted_categories: { } + ds: + layout: + id: pattern_card + library: null + disable_css: false + entity_classes: all_classes + settings: + pattern: + field_templates: default + variant: default + regions: + card_image: + - su_opp_image + card_headline: + - node_title + card_body: + - su_opp_summary + fields: + node_title: + plugin_id: node_title + weight: 1 + label: hidden + formatter: default + settings: + link: true + 'link class': '' + link_target: '' + wrapper: '' + class: su-card__link +id: node.stanford_opportunity.stanford_card +targetEntityType: node +bundle: stanford_opportunity +mode: stanford_card +content: + su_opp_image: + type: media_image_formatter + label: hidden + settings: + view_mode: default + link: true + image_style: card_1192x596 + remove_alt: false + third_party_settings: + empty_fields: + handler: '' + field_formatter_class: + class: '' + field_label: + label_value: '' + label_tag: '' + weight: 0 + region: card_image + su_opp_summary: + type: smart_trim + label: hidden + settings: + trim_length: 50 + trim_type: words + trim_suffix: '' + wrap_output: false + wrap_class: trimmed + more: + display_link: false + target_blank: false + link_trim_only: false + class: more-link + text: More + aria_label: 'Read more about [node:title]' + summary_handler: full + trim_options: + text: false + trim_zero: false + replace_tokens: false + third_party_settings: + empty_fields: + handler: '' + field_formatter_class: + class: '' + field_label: + label_value: '' + label_tag: '' + weight: 2 + region: card_body +hidden: + body: true + layout_builder__layout: true + links: true + search_api_excerpt: true + su_opp_application_deadline: true + su_opp_components: true + su_opp_contact_email: true + su_opp_contact_name: true + su_opp_contact_phone: true + su_opp_contact_url: true + su_opp_course_code: true + su_opp_cta_url: true + su_opp_eligibility: true + su_opp_learn_more: true + su_opp_open_date: true + su_opp_prerequisites: true + su_opp_source: true + su_opp_sponsor: true + su_opp_start_date: true + su_opp_status: true + su_opp_tags: true + su_opp_type: true diff --git a/config/sync/core.entity_view_display.node.stanford_opportunity.stanford_h3_card.yml b/config/sync/core.entity_view_display.node.stanford_opportunity.stanford_h3_card.yml new file mode 100644 index 000000000..32b56e207 --- /dev/null +++ b/config/sync/core.entity_view_display.node.stanford_opportunity.stanford_h3_card.yml @@ -0,0 +1,158 @@ +uuid: c4b68950-875c-401e-8b29-7750098537cb +langcode: en +status: true +dependencies: + config: + - core.entity_view_mode.node.stanford_h3_card + - field.field.node.stanford_opportunity.body + - field.field.node.stanford_opportunity.layout_builder__layout + - field.field.node.stanford_opportunity.su_opp_application_deadline + - field.field.node.stanford_opportunity.su_opp_components + - field.field.node.stanford_opportunity.su_opp_contact_email + - field.field.node.stanford_opportunity.su_opp_contact_name + - field.field.node.stanford_opportunity.su_opp_contact_phone + - field.field.node.stanford_opportunity.su_opp_contact_url + - field.field.node.stanford_opportunity.su_opp_course_code + - field.field.node.stanford_opportunity.su_opp_cta_url + - field.field.node.stanford_opportunity.su_opp_eligibility + - field.field.node.stanford_opportunity.su_opp_image + - field.field.node.stanford_opportunity.su_opp_learn_more + - field.field.node.stanford_opportunity.su_opp_open_date + - field.field.node.stanford_opportunity.su_opp_prerequisites + - field.field.node.stanford_opportunity.su_opp_source + - field.field.node.stanford_opportunity.su_opp_sponsor + - field.field.node.stanford_opportunity.su_opp_start_date + - field.field.node.stanford_opportunity.su_opp_status + - field.field.node.stanford_opportunity.su_opp_summary + - field.field.node.stanford_opportunity.su_opp_tags + - field.field.node.stanford_opportunity.su_opp_type + - node.type.stanford_opportunity + module: + - ds + - empty_fields + - field_formatter_class + - field_label + - layout_builder + - layout_builder_restrictions + - layout_library + - smart_trim + - stanford_media + - user +third_party_settings: + layout_builder: + enabled: false + allow_custom: false + layout_library: + enable: false + layout_builder_restrictions: + allowed_block_categories: { } + entity_view_mode_restriction: + allowed_layouts: { } + denylisted_blocks: { } + allowlisted_blocks: { } + restricted_categories: { } + ds: + layout: + id: pattern_card + library: null + disable_css: false + entity_classes: all_classes + settings: + pattern: + field_templates: default + variant: default + regions: + card_image: + - su_opp_image + card_body: + - node_title + - su_opp_summary + fields: + node_title: + plugin_id: node_title + weight: 1 + label: hidden + formatter: default + settings: + link: true + 'link class': '' + link_target: '' + wrapper: h3 + class: su-card__link +id: node.stanford_opportunity.stanford_h3_card +targetEntityType: node +bundle: stanford_opportunity +mode: stanford_h3_card +content: + su_opp_image: + type: media_image_formatter + label: hidden + settings: + view_mode: default + link: true + image_style: card_1192x596 + remove_alt: false + third_party_settings: + empty_fields: + handler: '' + field_formatter_class: + class: '' + field_label: + label_value: '' + label_tag: '' + weight: 0 + region: card_image + su_opp_summary: + type: smart_trim + label: hidden + settings: + trim_length: 50 + trim_type: words + trim_suffix: '' + wrap_output: false + wrap_class: trimmed + more: + display_link: false + target_blank: false + link_trim_only: false + class: more-link + text: More + aria_label: 'Read more about [node:title]' + summary_handler: full + trim_options: + text: false + trim_zero: false + replace_tokens: false + third_party_settings: + empty_fields: + handler: '' + field_formatter_class: + class: '' + field_label: + label_value: '' + label_tag: '' + weight: 2 + region: card_body +hidden: + body: true + layout_builder__layout: true + links: true + search_api_excerpt: true + su_opp_application_deadline: true + su_opp_components: true + su_opp_contact_email: true + su_opp_contact_name: true + su_opp_contact_phone: true + su_opp_contact_url: true + su_opp_course_code: true + su_opp_cta_url: true + su_opp_eligibility: true + su_opp_learn_more: true + su_opp_open_date: true + su_opp_prerequisites: true + su_opp_source: true + su_opp_sponsor: true + su_opp_start_date: true + su_opp_status: true + su_opp_tags: true + su_opp_type: true diff --git a/config/sync/core.entity_view_display.node.stanford_opportunity.teaser.yml b/config/sync/core.entity_view_display.node.stanford_opportunity.teaser.yml index 84012aee7..6ade819d9 100644 --- a/config/sync/core.entity_view_display.node.stanford_opportunity.teaser.yml +++ b/config/sync/core.entity_view_display.node.stanford_opportunity.teaser.yml @@ -1,10 +1,11 @@ uuid: eacf0e3e-0783-44c6-9012-4c4c9e2b7c47 langcode: en -status: true +status: false dependencies: config: - core.entity_view_mode.node.teaser - field.field.node.stanford_opportunity.body + - field.field.node.stanford_opportunity.layout_builder__layout - field.field.node.stanford_opportunity.su_opp_application_deadline - field.field.node.stanford_opportunity.su_opp_components - field.field.node.stanford_opportunity.su_opp_contact_email @@ -48,6 +49,7 @@ content: weight: 100 region: content hidden: + layout_builder__layout: true search_api_excerpt: true su_opp_application_deadline: true su_opp_components: true diff --git a/config/sync/field.field.node.stanford_opportunity.layout_builder__layout.yml b/config/sync/field.field.node.stanford_opportunity.layout_builder__layout.yml new file mode 100644 index 000000000..c5df33805 --- /dev/null +++ b/config/sync/field.field.node.stanford_opportunity.layout_builder__layout.yml @@ -0,0 +1,21 @@ +uuid: 3b4a0626-c0fd-4710-834d-848d18de6105 +langcode: en +status: true +dependencies: + config: + - field.storage.node.layout_builder__layout + - node.type.stanford_opportunity + module: + - layout_builder +id: node.stanford_opportunity.layout_builder__layout +field_name: layout_builder__layout +entity_type: node +bundle: stanford_opportunity +label: Layout +description: '' +required: false +translatable: false +default_value: { } +default_value_callback: '' +settings: { } +field_type: layout_section diff --git a/config/sync/field.field.node.stanford_opportunity.su_opp_tags.yml b/config/sync/field.field.node.stanford_opportunity.su_opp_tags.yml index 8f3e3cce6..84c4debb6 100644 --- a/config/sync/field.field.node.stanford_opportunity.su_opp_tags.yml +++ b/config/sync/field.field.node.stanford_opportunity.su_opp_tags.yml @@ -5,7 +5,7 @@ dependencies: config: - field.storage.node.su_opp_tags - node.type.stanford_opportunity - - taxonomy.vocabulary.opportunity_tag_1 + - taxonomy.vocabulary.opportunity_tag_filters id: node.stanford_opportunity.su_opp_tags field_name: su_opp_tags entity_type: node @@ -20,10 +20,10 @@ settings: handler: 'default:taxonomy_term' handler_settings: target_bundles: - opportunity_tag_1: opportunity_tag_1 + opportunity_tag_filters: opportunity_tag_filters sort: field: name direction: asc auto_create: false - auto_create_bundle: opportunity_tag_1 + auto_create_bundle: opportunity_tag_filters field_type: entity_reference diff --git a/config/sync/rabbit_hole.behavior_settings.taxonomy_vocabulary_opportunity_tag_1.yml b/config/sync/rabbit_hole.behavior_settings.taxonomy_vocabulary_opportunity_tag_filters.yml similarity index 64% rename from config/sync/rabbit_hole.behavior_settings.taxonomy_vocabulary_opportunity_tag_1.yml rename to config/sync/rabbit_hole.behavior_settings.taxonomy_vocabulary_opportunity_tag_filters.yml index c4688747c..c7a5e47e3 100644 --- a/config/sync/rabbit_hole.behavior_settings.taxonomy_vocabulary_opportunity_tag_1.yml +++ b/config/sync/rabbit_hole.behavior_settings.taxonomy_vocabulary_opportunity_tag_filters.yml @@ -3,10 +3,10 @@ langcode: en status: true dependencies: config: - - taxonomy.vocabulary.opportunity_tag_1 -id: taxonomy_vocabulary_opportunity_tag_1 + - taxonomy.vocabulary.opportunity_tag_filters +id: taxonomy_vocabulary_opportunity_tag_filters entity_type_id: taxonomy_vocabulary -entity_id: opportunity_tag_1 +entity_id: opportunity_tag_filters action: display_page allow_override: 1 redirect: '' diff --git a/config/sync/search_api.index.algolia_search.yml b/config/sync/search_api.index.algolia_search.yml index bf355f36c..eec17f6a1 100644 --- a/config/sync/search_api.index.algolia_search.yml +++ b/config/sync/search_api.index.algolia_search.yml @@ -3,18 +3,18 @@ langcode: en status: false dependencies: config: + - field.storage.node.su_event_audience - field.storage.node.su_basic_page_type - field.storage.node.su_course_subject - - field.storage.node.su_event_audience - field.storage.node.su_event_date_time - - field.storage.node.su_event_subject - field.storage.node.su_event_type - - field.storage.node.su_news_topics - field.storage.node.su_person_full_title - - field.storage.node.su_person_short_title + - field.storage.node.su_news_topics - field.storage.node.su_person_type_group - field.storage.node.su_publication_topics - field.storage.node.su_shared_tags + - field.storage.node.su_person_short_title + - field.storage.node.su_event_subject - search_api.server.algolia_search - core.entity_view_mode.node.search_indexing module: @@ -132,6 +132,7 @@ field_settings: stanford_event: search_indexing stanford_event_series: search_indexing stanford_news: search_indexing + stanford_opportunity: search_indexing stanford_page: search_indexing stanford_person: search_indexing stanford_policy: search_indexing diff --git a/config/sync/search_api.index.full_site_content.yml b/config/sync/search_api.index.full_site_content.yml index 3cd50d872..51d69561f 100644 --- a/config/sync/search_api.index.full_site_content.yml +++ b/config/sync/search_api.index.full_site_content.yml @@ -41,6 +41,7 @@ field_settings: stanford_event: search_indexing stanford_event_series: search_indexing stanford_news: search_indexing + stanford_opportunity: search_indexing stanford_page: search_indexing stanford_person: search_indexing stanford_policy: search_indexing diff --git a/config/sync/taxonomy.vocabulary.opportunity_tag_1.yml b/config/sync/taxonomy.vocabulary.opportunity_tag_filters.yml similarity index 95% rename from config/sync/taxonomy.vocabulary.opportunity_tag_1.yml rename to config/sync/taxonomy.vocabulary.opportunity_tag_filters.yml index a60395a63..f15f95dc2 100644 --- a/config/sync/taxonomy.vocabulary.opportunity_tag_1.yml +++ b/config/sync/taxonomy.vocabulary.opportunity_tag_filters.yml @@ -19,7 +19,7 @@ third_party_settings: unpublish_required: false unpublish_revision: false name: 'Opportunity Filters' -vid: opportunity_tag_1 +vid: opportunity_tag_filters description: null weight: 0 new_revision: false diff --git a/config/sync/user.role.opportunity_editor.yml b/config/sync/user.role.opportunity_editor.yml index 5d77e2c93..7f584b9d7 100644 --- a/config/sync/user.role.opportunity_editor.yml +++ b/config/sync/user.role.opportunity_editor.yml @@ -5,7 +5,7 @@ dependencies: config: - node.type.stanford_opportunity - taxonomy.vocabulary.opportunity_sponsor - - taxonomy.vocabulary.opportunity_tag_1 + - taxonomy.vocabulary.opportunity_tag_filters - taxonomy.vocabulary.opportunity_type module: - node @@ -20,17 +20,17 @@ permissions: - 'assign opportunity_editor role' - 'create stanford_opportunity content' - 'create terms in opportunity_sponsor' - - 'create terms in opportunity_tag_1' + - 'create terms in opportunity_tag_filters' - 'create terms in opportunity_type' - 'delete any stanford_opportunity content' - 'delete own stanford_opportunity content' - 'delete stanford_opportunity revisions' - 'delete terms in opportunity_sponsor' - - 'delete terms in opportunity_tag_1' + - 'delete terms in opportunity_tag_filters' - 'delete terms in opportunity_type' - 'edit any stanford_opportunity content' - 'edit own stanford_opportunity content' - - 'edit terms in opportunity_tag_1' + - 'edit terms in opportunity_tag_filters' - 'revert stanford_opportunity revisions' - 'view any unpublished stanford_opportunity content' - 'view stanford_opportunity revisions' diff --git a/tests/codeception/acceptance/Content/OpportunityCest.php b/tests/codeception/acceptance/Content/OpportunityCest.php new file mode 100644 index 000000000..b7a057734 --- /dev/null +++ b/tests/codeception/acceptance/Content/OpportunityCest.php @@ -0,0 +1,57 @@ +faker = Factory::create(); + } + + public function testContentAccess(AcceptanceTester $I) { + $I->logInWithRole('site_manager'); + $I->amOnPage('/node/add'); + $I->cantSee('Opportunity'); + $I->amOnPage('/admin/structure/taxonomy'); + $I->cantSee('Opportunity'); + $I->amOnPage('/user/logout'); + $I->click('Log out', 'form'); + + $I->logInWithRole('contibutor'); + $I->amOnPage('/node/add'); + $I->cantSee('Opportunity'); + $I->amOnPage('/admin/structure/taxonomy'); + $I->cantSee('Opportunity'); + $I->amOnPage('/user/logout'); + $I->click('Log out', 'form'); + + $user = $I->createUserWithRoles(['site_manager', 'opportunity_editor']); + $I->logInAs($user->getAccountName()); + $I->amOnPage('/node/add'); + $I->canSee('Opportunity'); + $I->amOnPage('/admin/structure/taxonomy'); + $I->canSee('Opportunity'); + $I->amOnPage('/admin/structure/taxonomy/manage/opportunity_tag_filters/add'); + $I->canSeeInField('Name', ''); + $I->amOnPage('/admin/structure/taxonomy/manage/opportunity_sponsor/add'); + $I->canSeeInField('Name', ''); + $I->amOnPage('/admin/structure/taxonomy/manage/opportunity_type/add'); + $I->canSeeInField('Name', ''); + } + +} diff --git a/tests/codeception/functional/Content/OpportunityCest.php b/tests/codeception/functional/Content/OpportunityCest.php new file mode 100644 index 000000000..c13551f52 --- /dev/null +++ b/tests/codeception/functional/Content/OpportunityCest.php @@ -0,0 +1,92 @@ +faker = Factory::create(); + } + + public function testContentType(FunctionalTester $I) { + $parent_1 = $I->createEntity([ + 'vid' => 'opportunity_tag_filters', + 'name' => $this->faker->words(2, TRUE), + 'weight' => 0, + ], 'taxonomy_term'); + $parent_2 = $I->createEntity([ + 'vid' => 'opportunity_tag_filters', + 'name' => $this->faker->words(2, TRUE), + 'weight' => 10, + ], 'taxonomy_term'); + + $child_1_1 = $I->createEntity([ + 'vid' => 'opportunity_tag_filters', + 'name' => $this->faker->words(2, TRUE), + 'parent' => $parent_1->id(), + ], 'taxonomy_term'); + + $child_1_2 = $I->createEntity([ + 'vid' => 'opportunity_tag_filters', + 'name' => $this->faker->words(2, TRUE), + 'parent' => $parent_1->id(), + ], 'taxonomy_term'); + + $child_2_1 = $I->createEntity([ + 'vid' => 'opportunity_tag_filters', + 'name' => $this->faker->words(2, TRUE), + 'parent' => $parent_2->id(), + ], 'taxonomy_term'); + + $child_2_2 = $I->createEntity([ + 'vid' => 'opportunity_tag_filters', + 'name' => $this->faker->words(2, TRUE), + 'parent' => $child_2_1->id(), + ], 'taxonomy_term'); + + $node = $I->createEntity([ + 'type' => 'stanford_opportunity', + 'title' => $this->faker->words(3, TRUE), + ]); + + $user = $I->createUserWithRoles(['site_manager', 'opportunity_editor']); + $I->logInAs($user->getAccountName()); + + $I->amOnPage($node->toUrl('edit-form')->toString()); + $I->click('#edit-group-basics summary'); + $I->canSee($parent_1->label(), 'legend'); + $I->canSee($parent_2->label(), 'legend'); + + $parent_1_id = preg_replace('@[^a-z0-9_.]+@', '_', mb_strtolower($parent_1->label())); + $parent_2_id = preg_replace('@[^a-z0-9_.]+@', '_', mb_strtolower($parent_2->label())); + + $I->selectOption("#$parent_1_id select.simpler-select", $child_1_1->label()); + $I->click('Add More', "#$parent_1_id"); + $I->waitForElementVisible("#$parent_1_id [class*='1-target-id'] select.simpler-select"); + $I->selectOption("#$parent_1_id [class*='1-target-id'] select.simpler-select", $child_1_2->label()); + + $I->selectOption("#$parent_2_id select.simpler-select", $child_2_1->label()); + + $I->waitForElementVisible("#$parent_2_id [class*='--level-1'] select.simpler-select"); + $I->selectOption("#$parent_2_id [class*='--level-1'] select.simpler-select", $child_2_2->label()); + + $I->click('Save'); + $I->canSee($node->label(), 'h1'); + } + +}