From 730fff09676826840f546e785411660ba6eac671 Mon Sep 17 00:00:00 2001 From: Z Saenz Date: Fri, 9 Jan 2026 09:54:19 -0700 Subject: [PATCH 01/59] Create az_opportunity content type Creates a base Opportunity content type with 3 display views. Uses Smart Title. --- .../config/install/smart_title.settings.yml | 5 +- .../az_opportunity/az_opportunity.info.yml | 28 + .../az_opportunity.libraries.yml | 4 + .../az_opportunity/az_opportunity.module | 30 + .../az_opportunity/config/install/.htaccess | 24 + ...d_override.node.az_opportunity.promote.yml | 21 + ...rm_display.node.az_opportunity.default.yml | 237 ++++ ...ew_display.node.az_opportunity.az_card.yml | 328 ++++++ ...iew_display.node.az_opportunity.az_row.yml | 251 ++++ ...ew_display.node.az_opportunity.default.yml | 350 ++++++ ...y_term.az_opportunity_audience.default.yml | 20 + ...y_term.az_opportunity_semester.default.yml | 21 + ...omy_term.az_opportunity_topic.az_badge.yml | 40 + ...nomy_term.az_opportunity_topic.default.yml | 20 + ..._opportunity.field_az_application_date.yml | 20 + ..._opportunity.field_az_application_link.yml | 22 + ...node.az_opportunity.field_az_audiences.yml | 28 + ...ield.node.az_opportunity.field_az_body.yml | 23 + ...ld.node.az_opportunity.field_az_credit.yml | 28 + ...ode.az_opportunity.field_az_incentives.yml | 20 + ....node.az_opportunity.field_az_location.yml | 22 + ....node.az_opportunity.field_az_modality.yml | 28 + ...d.node.az_opportunity.field_az_offered.yml | 28 + ...d.node.az_opportunity.field_az_ongoing.yml | 20 + ...az_opportunity.field_az_parent_account.yml | 18 + ...e.az_opportunity.field_az_program_date.yml | 20 + ...az_opportunity.field_az_program_length.yml | 18 + ...z_opportunity.field_az_program_website.yml | 22 + ....az_opportunity.field_az_start_options.yml | 1 + ...eld.node.az_opportunity.field_az_topic.yml | 28 + ...ode.az_opportunity.field_az_trellis_id.yml | 18 + ...rtunity.field_az_trellis_imported_date.yml | 20 + ...ortunity.field_opportunity_attachments.yml | 28 + ...storage.node.field_az_application_date.yml | 19 + ...storage.node.field_az_application_link.yml | 18 + .../field.storage.node.field_az_audiences.yml | 19 + .../field.storage.node.field_az_credit.yml | 19 + ...field.storage.node.field_az_incentives.yml | 17 + .../field.storage.node.field_az_modality.yml | 19 + .../field.storage.node.field_az_offered.yml | 19 + .../field.storage.node.field_az_ongoing.yml | 17 + ...d.storage.node.field_az_parent_account.yml | 20 + ...eld.storage.node.field_az_program_date.yml | 19 + ...d.storage.node.field_az_program_length.yml | 20 + ....storage.node.field_az_program_website.yml | 18 + ...ld.storage.node.field_az_start_options.yml | 1 + .../field.storage.node.field_az_topic.yml | 19 + ...ge.node.field_az_trellis_imported_date.yml | 19 + ...age.node.field_opportunity_attachments.yml | 19 + .../install/node.type.az_opportunity.yml | 16 + ...omy.vocabulary.az_opportunity_audience.yml | 8 + ...onomy.vocabulary.az_opportunity_credit.yml | 8 + ...omy.vocabulary.az_opportunity_modality.yml | 8 + ...omy.vocabulary.az_opportunity_semester.yml | 8 + ...xonomy.vocabulary.az_opportunity_topic.yml | 8 + .../install/views.view.az_opportunity.yml | 1036 +++++++++++++++++ .../az_opportunity/css/az_opportunity.css | 15 + ...view_reference.field_az_view_reference.yml | 7 +- 58 files changed, 3180 insertions(+), 7 deletions(-) create mode 100644 modules/custom/az_opportunity/az_opportunity.info.yml create mode 100644 modules/custom/az_opportunity/az_opportunity.libraries.yml create mode 100644 modules/custom/az_opportunity/az_opportunity.module create mode 100644 modules/custom/az_opportunity/config/install/.htaccess create mode 100644 modules/custom/az_opportunity/config/install/core.base_field_override.node.az_opportunity.promote.yml create mode 100644 modules/custom/az_opportunity/config/install/core.entity_form_display.node.az_opportunity.default.yml create mode 100644 modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_card.yml create mode 100644 modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_row.yml create mode 100644 modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.default.yml create mode 100644 modules/custom/az_opportunity/config/install/core.entity_view_display.taxonomy_term.az_opportunity_audience.default.yml create mode 100644 modules/custom/az_opportunity/config/install/core.entity_view_display.taxonomy_term.az_opportunity_semester.default.yml create mode 100644 modules/custom/az_opportunity/config/install/core.entity_view_display.taxonomy_term.az_opportunity_topic.az_badge.yml create mode 100644 modules/custom/az_opportunity/config/install/core.entity_view_display.taxonomy_term.az_opportunity_topic.default.yml create mode 100644 modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_application_date.yml create mode 100644 modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_application_link.yml create mode 100644 modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_audiences.yml create mode 100644 modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_body.yml create mode 100644 modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_credit.yml create mode 100644 modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_incentives.yml create mode 100644 modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_location.yml create mode 100644 modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_modality.yml create mode 100644 modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_offered.yml create mode 100644 modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_ongoing.yml create mode 100644 modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_parent_account.yml create mode 100644 modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_program_date.yml create mode 100644 modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_program_length.yml create mode 100644 modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_program_website.yml create mode 100644 modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_start_options.yml create mode 100644 modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_topic.yml create mode 100644 modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_trellis_id.yml create mode 100644 modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_trellis_imported_date.yml create mode 100644 modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_opportunity_attachments.yml create mode 100644 modules/custom/az_opportunity/config/install/field.storage.node.field_az_application_date.yml create mode 100644 modules/custom/az_opportunity/config/install/field.storage.node.field_az_application_link.yml create mode 100644 modules/custom/az_opportunity/config/install/field.storage.node.field_az_audiences.yml create mode 100644 modules/custom/az_opportunity/config/install/field.storage.node.field_az_credit.yml create mode 100644 modules/custom/az_opportunity/config/install/field.storage.node.field_az_incentives.yml create mode 100644 modules/custom/az_opportunity/config/install/field.storage.node.field_az_modality.yml create mode 100644 modules/custom/az_opportunity/config/install/field.storage.node.field_az_offered.yml create mode 100644 modules/custom/az_opportunity/config/install/field.storage.node.field_az_ongoing.yml create mode 100644 modules/custom/az_opportunity/config/install/field.storage.node.field_az_parent_account.yml create mode 100644 modules/custom/az_opportunity/config/install/field.storage.node.field_az_program_date.yml create mode 100644 modules/custom/az_opportunity/config/install/field.storage.node.field_az_program_length.yml create mode 100644 modules/custom/az_opportunity/config/install/field.storage.node.field_az_program_website.yml create mode 100644 modules/custom/az_opportunity/config/install/field.storage.node.field_az_start_options.yml create mode 100644 modules/custom/az_opportunity/config/install/field.storage.node.field_az_topic.yml create mode 100644 modules/custom/az_opportunity/config/install/field.storage.node.field_az_trellis_imported_date.yml create mode 100644 modules/custom/az_opportunity/config/install/field.storage.node.field_opportunity_attachments.yml create mode 100644 modules/custom/az_opportunity/config/install/node.type.az_opportunity.yml create mode 100644 modules/custom/az_opportunity/config/install/taxonomy.vocabulary.az_opportunity_audience.yml create mode 100644 modules/custom/az_opportunity/config/install/taxonomy.vocabulary.az_opportunity_credit.yml create mode 100644 modules/custom/az_opportunity/config/install/taxonomy.vocabulary.az_opportunity_modality.yml create mode 100644 modules/custom/az_opportunity/config/install/taxonomy.vocabulary.az_opportunity_semester.yml create mode 100644 modules/custom/az_opportunity/config/install/taxonomy.vocabulary.az_opportunity_topic.yml create mode 100644 modules/custom/az_opportunity/config/install/views.view.az_opportunity.yml create mode 100644 modules/custom/az_opportunity/css/az_opportunity.css diff --git a/modules/custom/az_core/config/install/smart_title.settings.yml b/modules/custom/az_core/config/install/smart_title.settings.yml index d28299b790..7c96b08fc9 100644 --- a/modules/custom/az_core/config/install/smart_title.settings.yml +++ b/modules/custom/az_core/config/install/smart_title.settings.yml @@ -1,9 +1,8 @@ smart_title: - - 'node:az_carousel_item' - - 'node:az_course' - 'node:az_event' - - 'node:az_news' - 'node:az_flexible_page' + - 'node:az_news' + - 'node:az_opportunity' - 'node:az_person' - 'node:az_publication' - 'taxonomy_term:az_event_categories' diff --git a/modules/custom/az_opportunity/az_opportunity.info.yml b/modules/custom/az_opportunity/az_opportunity.info.yml new file mode 100644 index 0000000000..4749193637 --- /dev/null +++ b/modules/custom/az_opportunity/az_opportunity.info.yml @@ -0,0 +1,28 @@ +name: Quickstart Opportunity +description: 'Provides an Opportunity content type and related configuration. Use this content type to add non-academic opportunities such as Scholarships, Internships or Job Opportunities to your site.' +core_version_requirement: ^10 || ^11 || ^12 +type: module +package: The University of Arizona - Experimental +dependencies: + - az_core:az_core + - calendar_link:calendar_link + - date_ap_style:date_ap_style + - drupal:datetime_range + - drupal:field + - field_group:field_group + - jquery_ui_datepicker:jquery_ui_datepicker + - drupal:file + - drupal:link + - drupal:media + - drupal:media_library + - drupal:menu_ui + - drupal:node + - drupal:path + - pathauto:pathauto + - smart_date:smart_date + - smart_date:smart_date_recur + - smart_title:smart_title + - drupal:taxonomy + - drupal:text + - drupal:user + - views_bootstrap:views_bootstrap \ No newline at end of file diff --git a/modules/custom/az_opportunity/az_opportunity.libraries.yml b/modules/custom/az_opportunity/az_opportunity.libraries.yml new file mode 100644 index 0000000000..d1d610dee3 --- /dev/null +++ b/modules/custom/az_opportunity/az_opportunity.libraries.yml @@ -0,0 +1,4 @@ +az_opportunity: + css: + theme: + css/az_opportunity.css: {} \ No newline at end of file diff --git a/modules/custom/az_opportunity/az_opportunity.module b/modules/custom/az_opportunity/az_opportunity.module new file mode 100644 index 0000000000..e6bc35ddc4 --- /dev/null +++ b/modules/custom/az_opportunity/az_opportunity.module @@ -0,0 +1,30 @@ +storage->id(); + + if ($id === 'az_opportunity') { + $variables['#attached']['library'][] = 'az_opportunity/az_opportunity'; + } +} \ No newline at end of file diff --git a/modules/custom/az_opportunity/config/install/.htaccess b/modules/custom/az_opportunity/config/install/.htaccess new file mode 100644 index 0000000000..b0dc5406e6 --- /dev/null +++ b/modules/custom/az_opportunity/config/install/.htaccess @@ -0,0 +1,24 @@ +# Deny all requests from Apache 2.4+. + + Require all denied + + +# Deny all requests from Apache 2.0-2.2. + + Deny from all + + +# Turn off all options we don't need. +Options -Indexes -ExecCGI -Includes -MultiViews + +# Set the catch-all handler to prevent scripts from being executed. +SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006 + + # Override the handler again if we're run later in the evaluation list. + SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003 + + +# If we know how to do it safely, disable the PHP engine entirely. + + php_flag engine off + \ No newline at end of file diff --git a/modules/custom/az_opportunity/config/install/core.base_field_override.node.az_opportunity.promote.yml b/modules/custom/az_opportunity/config/install/core.base_field_override.node.az_opportunity.promote.yml new file mode 100644 index 0000000000..238214da05 --- /dev/null +++ b/modules/custom/az_opportunity/config/install/core.base_field_override.node.az_opportunity.promote.yml @@ -0,0 +1,21 @@ +langcode: en +status: true +dependencies: + config: + - node.type.az_opportunity +id: node.az_opportunity.promote +field_name: promote +entity_type: node +bundle: az_opportunity +label: 'Promoted to front page' +description: '' +required: false +translatable: true +default_value: + - + value: 0 +default_value_callback: '' +settings: + on_label: 'On' + off_label: 'Off' +field_type: boolean diff --git a/modules/custom/az_opportunity/config/install/core.entity_form_display.node.az_opportunity.default.yml b/modules/custom/az_opportunity/config/install/core.entity_form_display.node.az_opportunity.default.yml new file mode 100644 index 0000000000..05ac5fe07c --- /dev/null +++ b/modules/custom/az_opportunity/config/install/core.entity_form_display.node.az_opportunity.default.yml @@ -0,0 +1,237 @@ +langcode: en +status: true +dependencies: + config: + - field.field.node.az_opportunity.field_az_application_date + - field.field.node.az_opportunity.field_az_application_link + - field.field.node.az_opportunity.field_az_audiences + - field.field.node.az_opportunity.field_az_body + - field.field.node.az_opportunity.field_az_credit + - field.field.node.az_opportunity.field_az_incentives + - field.field.node.az_opportunity.field_az_location + - field.field.node.az_opportunity.field_az_modality + - field.field.node.az_opportunity.field_az_offered + - field.field.node.az_opportunity.field_az_ongoing + - field.field.node.az_opportunity.field_az_parent_account + - field.field.node.az_opportunity.field_az_program_date + - field.field.node.az_opportunity.field_az_program_length + - field.field.node.az_opportunity.field_az_program_website + - field.field.node.az_opportunity.field_az_topic + - field.field.node.az_opportunity.field_az_trellis_id + - field.field.node.az_opportunity.field_az_trellis_imported_date + - field.field.node.az_opportunity.field_opportunity_attachments + - node.type.az_opportunity + module: + - datetime + - datetime_range + - link + - media_library + - path + - text +id: node.az_opportunity.default +targetEntityType: node +bundle: az_opportunity +mode: default +content: + created: + type: datetime_timestamp + weight: 2 + region: content + settings: { } + third_party_settings: { } + field_az_application_date: + type: daterange_default + weight: 9 + region: content + settings: { } + third_party_settings: { } + field_az_application_link: + type: link_default + weight: 19 + region: content + settings: + placeholder_url: '' + placeholder_title: '' + third_party_settings: { } + field_az_audiences: + type: entity_reference_autocomplete + weight: 20 + region: content + settings: + match_operator: CONTAINS + match_limit: 10 + size: 60 + placeholder: '' + third_party_settings: { } + field_az_body: + type: text_textarea + weight: 21 + region: content + settings: + rows: 9 + placeholder: '' + third_party_settings: { } + field_az_credit: + type: entity_reference_autocomplete + weight: 15 + region: content + settings: + match_operator: CONTAINS + match_limit: 10 + size: 60 + placeholder: '' + third_party_settings: { } + field_az_incentives: + type: boolean_checkbox + weight: 12 + region: content + settings: + display_label: true + third_party_settings: { } + field_az_location: + type: link_default + weight: 13 + region: content + settings: + placeholder_url: '' + placeholder_title: '' + third_party_settings: { } + field_az_modality: + type: entity_reference_autocomplete + weight: 14 + region: content + settings: + match_operator: CONTAINS + match_limit: 10 + size: 60 + placeholder: '' + third_party_settings: { } + field_az_offered: + type: entity_reference_autocomplete + weight: 16 + region: content + settings: + match_operator: CONTAINS + match_limit: 10 + size: 60 + placeholder: '' + third_party_settings: { } + field_az_ongoing: + type: boolean_checkbox + weight: 11 + region: content + settings: + display_label: true + third_party_settings: { } + field_az_parent_account: + type: string_textfield + weight: 23 + region: content + settings: + size: 60 + placeholder: '' + third_party_settings: { } + field_az_program_date: + type: daterange_default + weight: 10 + region: content + settings: { } + third_party_settings: { } + field_az_program_length: + type: string_textfield + weight: 8 + region: content + settings: + size: 60 + placeholder: '' + third_party_settings: { } + field_az_program_website: + type: link_default + weight: 18 + region: content + settings: + placeholder_url: '' + placeholder_title: '' + third_party_settings: { } + field_az_topic: + type: entity_reference_autocomplete + weight: 17 + region: content + settings: + match_operator: CONTAINS + match_limit: 10 + size: 60 + placeholder: '' + third_party_settings: { } + field_az_trellis_id: + type: string_textfield + weight: 24 + region: content + settings: + size: 60 + placeholder: '' + third_party_settings: { } + field_az_trellis_imported_date: + type: datetime_default + weight: 25 + region: content + settings: { } + third_party_settings: { } + field_opportunity_attachments: + type: media_library_widget + weight: 22 + region: content + settings: + media_types: { } + third_party_settings: { } + path: + type: path + weight: 5 + region: content + settings: { } + third_party_settings: { } + promote: + type: boolean_checkbox + weight: 3 + region: content + settings: + display_label: true + third_party_settings: { } + status: + type: boolean_checkbox + weight: 7 + region: content + settings: + display_label: true + third_party_settings: { } + sticky: + type: boolean_checkbox + weight: 4 + region: content + settings: + display_label: true + third_party_settings: { } + title: + type: string_textfield + weight: 0 + region: content + settings: + size: 60 + placeholder: '' + third_party_settings: { } + uid: + type: entity_reference_autocomplete + weight: 1 + region: content + settings: + match_operator: CONTAINS + match_limit: 10 + size: 60 + placeholder: '' + third_party_settings: { } + url_redirects: + weight: 6 + region: content + settings: { } + third_party_settings: { } +hidden: { } diff --git a/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_card.yml b/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_card.yml new file mode 100644 index 0000000000..b7ca55f4ba --- /dev/null +++ b/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_card.yml @@ -0,0 +1,328 @@ +langcode: en +status: true +dependencies: + config: + - core.entity_view_mode.node.az_card + - field.field.node.az_opportunity.field_az_application_date + - field.field.node.az_opportunity.field_az_application_link + - field.field.node.az_opportunity.field_az_audiences + - field.field.node.az_opportunity.field_az_body + - field.field.node.az_opportunity.field_az_credit + - field.field.node.az_opportunity.field_az_incentives + - field.field.node.az_opportunity.field_az_location + - field.field.node.az_opportunity.field_az_modality + - field.field.node.az_opportunity.field_az_offered + - field.field.node.az_opportunity.field_az_ongoing + - field.field.node.az_opportunity.field_az_parent_account + - field.field.node.az_opportunity.field_az_program_date + - field.field.node.az_opportunity.field_az_program_length + - field.field.node.az_opportunity.field_az_program_website + - field.field.node.az_opportunity.field_az_topic + - field.field.node.az_opportunity.field_az_trellis_id + - field.field.node.az_opportunity.field_az_trellis_imported_date + - field.field.node.az_opportunity.field_opportunity_attachments + - node.type.az_opportunity + module: + - datetime_range + - field_group + - link + - smart_title + - user +third_party_settings: + field_group: + group_col1: + children: { } + label: col1 + parent_name: '' + region: hidden + weight: 14 + format_type: html_element + format_settings: + classes: col + show_empty_fields: false + id: '' + label_as_html: false + element: div + show_label: false + label_element: h3 + label_element_classes: '' + attributes: '' + effect: none + speed: fast + group_col2: + children: { } + label: col2 + parent_name: '' + region: hidden + weight: 15 + format_type: html_element + format_settings: + classes: col + show_empty_fields: false + id: '' + label_as_html: false + element: div + show_label: false + label_element: h3 + label_element_classes: '' + attributes: '' + effect: none + speed: fast + group_col3: + children: { } + label: col3 + parent_name: '' + region: hidden + weight: 17 + format_type: html_element + format_settings: + classes: col + show_empty_fields: false + id: '' + label_as_html: false + element: div + show_label: false + label_element: h3 + label_element_classes: '' + attributes: '' + effect: none + speed: fast + group_col4: + children: { } + label: col4 + parent_name: '' + region: hidden + weight: 18 + format_type: html_element + format_settings: + classes: col + show_empty_fields: false + id: '' + label_as_html: false + element: div + show_label: false + label_element: h3 + label_element_classes: '' + attributes: '' + effect: none + speed: fast + group_col5: + children: { } + label: col5 + parent_name: '' + region: hidden + weight: 19 + format_type: html_element + format_settings: + classes: col + show_empty_fields: false + id: '' + label_as_html: false + element: div + show_label: false + label_element: h3 + label_element_classes: '' + attributes: '' + effect: none + speed: fast + group_col6: + children: { } + label: col6 + parent_name: '' + region: hidden + weight: 16 + format_type: html_element + format_settings: + classes: col + show_empty_fields: false + id: '' + label_as_html: false + element: div + show_label: false + label_element: h3 + label_element_classes: '' + attributes: '' + effect: none + speed: fast + group_col7: + children: { } + label: col7 + parent_name: '' + region: hidden + weight: 20 + format_type: html_element + format_settings: + classes: col7 + show_empty_fields: false + id: '' + label_as_html: false + element: div + show_label: false + label_element: h3 + label_element_classes: '' + attributes: '' + effect: none + speed: fast + group_col8: + children: { } + label: col8 + parent_name: '' + region: hidden + weight: 21 + format_type: html_element + format_settings: + classes: col + show_empty_fields: false + id: '' + label_as_html: false + element: div + show_label: false + label_element: h3 + label_element_classes: '' + attributes: '' + effect: none + speed: fast + group_header_row: + children: + - group_card_clickable + label: 'header row' + parent_name: '' + region: content + weight: 0 + format_type: html_element + format_settings: + classes: row + show_empty_fields: false + id: '' + label_as_html: false + element: div + show_label: false + label_element: h3 + label_element_classes: '' + attributes: '' + effect: none + speed: fast + group_card_clickable: + children: + - group_link + label: 'Card Clickable' + parent_name: group_header_row + region: content + weight: 0 + format_type: html_element + format_settings: + classes: 'card border-0 mb-4 hover' + show_empty_fields: false + id: '' + label_as_html: false + element: div + show_label: false + label_element: h3 + label_element_classes: '' + attributes: '' + effect: none + speed: fast + group_link: + children: + - links + - smart_title + - field_az_location + - field_az_application_date + - field_az_program_length + - field_az_offered + - field_az_modality + label: Link + parent_name: group_card_clickable + region: content + weight: 1 + format_type: link + format_settings: + classes: 'card-body p-0 stretched-link link-primary text-decoration-none' + show_empty_fields: false + id: '' + label_as_html: false + target: custom_uri + custom_uri: '[node:az-canonical-url]' + target_attribute: default + smart_title: + enabled: true + settings: + smart_title__link: true + smart_title__tag: h3 + smart_title__classes: { } +id: node.az_opportunity.az_card +targetEntityType: node +bundle: az_opportunity +mode: az_card +content: + field_az_application_date: + type: daterange_default + label: inline + settings: + timezone_override: '' + format_type: html_date + from_to: both + separator: '-' + third_party_settings: { } + weight: 4 + region: content + field_az_location: + type: link + label: inline + settings: + trim_length: 80 + url_only: false + url_plain: false + rel: '' + target: '' + third_party_settings: { } + weight: 3 + region: content + field_az_modality: + type: entity_reference_label + label: inline + settings: + link: false + third_party_settings: { } + weight: 7 + region: content + field_az_offered: + type: entity_reference_label + label: inline + settings: + link: false + third_party_settings: { } + weight: 6 + region: content + field_az_program_length: + type: string + label: inline + settings: + link_to_entity: false + third_party_settings: { } + weight: 5 + region: content + links: + settings: { } + third_party_settings: { } + weight: 1 + region: content + smart_title: + settings: { } + third_party_settings: { } + weight: 2 + region: content +hidden: + field_az_application_link: true + field_az_audiences: true + field_az_body: true + field_az_credit: true + field_az_incentives: true + field_az_ongoing: true + field_az_parent_account: true + field_az_program_date: true + field_az_program_website: true + field_az_topic: true + field_az_trellis_id: true + field_az_trellis_imported_date: true + field_opportunity_attachments: true diff --git a/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_row.yml b/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_row.yml new file mode 100644 index 0000000000..778ee75541 --- /dev/null +++ b/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_row.yml @@ -0,0 +1,251 @@ +langcode: en +status: true +dependencies: + config: + - core.entity_view_mode.node.az_row + - field.field.node.az_opportunity.field_az_application_date + - field.field.node.az_opportunity.field_az_application_link + - field.field.node.az_opportunity.field_az_audiences + - field.field.node.az_opportunity.field_az_body + - field.field.node.az_opportunity.field_az_credit + - field.field.node.az_opportunity.field_az_incentives + - field.field.node.az_opportunity.field_az_location + - field.field.node.az_opportunity.field_az_modality + - field.field.node.az_opportunity.field_az_offered + - field.field.node.az_opportunity.field_az_ongoing + - field.field.node.az_opportunity.field_az_parent_account + - field.field.node.az_opportunity.field_az_program_date + - field.field.node.az_opportunity.field_az_program_length + - field.field.node.az_opportunity.field_az_program_website + - field.field.node.az_opportunity.field_az_topic + - field.field.node.az_opportunity.field_az_trellis_id + - field.field.node.az_opportunity.field_az_trellis_imported_date + - field.field.node.az_opportunity.field_opportunity_attachments + - node.type.az_opportunity + module: + - datetime_range + - field_group + - link + - smart_title + - user +third_party_settings: + field_group: + group_row_wrap: + children: + - group_opportunity_link + label: 'row wrap' + parent_name: '' + region: content + weight: 0 + format_type: html_element + format_settings: + classes: 'position-relative d-block list-group-item-action' + show_empty_fields: false + id: '' + label_as_html: false + element: div + show_label: false + label_element: h3 + label_element_classes: '' + attributes: '' + effect: none + speed: fast + group_opportunity_link: + children: + - links + - group_row + label: 'opportunity link' + parent_name: group_row_wrap + region: content + weight: 1 + format_type: link + format_settings: + classes: 'text-decoration-none stretched-link' + show_empty_fields: false + id: '' + label_as_html: false + target: custom_uri + custom_uri: '[node:az-canonical-url]' + target_attribute: default + group_row: + children: + - group_col_1 + - group_col_2 + - group_col_3 + - group_col_4 + label: row + parent_name: group_opportunity_link + region: content + weight: 8 + format_type: html_element + format_settings: + classes: row + show_empty_fields: false + id: '' + label_as_html: false + element: div + show_label: false + label_element: h3 + label_element_classes: '' + attributes: '' + effect: none + speed: fast + group_col_1: + children: + - smart_title + label: 'col 1' + parent_name: group_row + region: content + weight: 3 + format_type: html_element + format_settings: + classes: col-4 + show_empty_fields: false + id: '' + label_as_html: false + element: div + show_label: false + label_element: h3 + label_element_classes: '' + attributes: '' + effect: none + speed: fast + group_col_2: + children: + - field_az_application_date + label: 'col 2' + parent_name: group_row + region: content + weight: 4 + format_type: html_element + format_settings: + classes: col-3 + show_empty_fields: false + id: '' + label_as_html: false + element: div + show_label: false + label_element: h3 + label_element_classes: '' + attributes: '' + effect: none + speed: fast + group_col_3: + children: + - field_az_location + - field_az_incentives + label: 'Col 3' + parent_name: group_row + region: content + weight: 5 + format_type: html_element + format_settings: + classes: col-3 + show_empty_fields: false + id: '' + label_as_html: false + element: div + show_label: false + label_element: h3 + label_element_classes: '' + attributes: '' + effect: none + speed: fast + group_col_4: + children: + - field_az_topic + label: 'col 4' + parent_name: group_row + region: content + weight: 6 + format_type: html_element + format_settings: + classes: col-2 + show_empty_fields: false + id: '' + label_as_html: false + element: div + show_label: false + label_element: h3 + label_element_classes: '' + attributes: '' + effect: none + speed: fast + smart_title: + enabled: true + settings: + smart_title__link: true + smart_title__tag: h2 + smart_title__classes: + - node__title +id: node.az_opportunity.az_row +targetEntityType: node +bundle: az_opportunity +mode: az_row +content: + field_az_application_date: + type: daterange_default + label: inline + settings: + timezone_override: '' + format_type: medium + from_to: both + separator: '-' + third_party_settings: { } + weight: 10 + region: content + field_az_incentives: + type: boolean + label: inline + settings: + format: default + format_custom_false: '' + format_custom_true: '' + third_party_settings: { } + weight: 12 + region: content + field_az_location: + type: link + label: inline + settings: + trim_length: 80 + url_only: false + url_plain: false + rel: '' + target: '' + third_party_settings: { } + weight: 11 + region: content + field_az_topic: + type: entity_reference_label + label: inline + settings: + link: false + third_party_settings: { } + weight: 5 + region: content + links: + settings: { } + third_party_settings: { } + weight: 7 + region: content + smart_title: + settings: { } + third_party_settings: { } + weight: 0 + region: content +hidden: + field_az_application_link: true + field_az_audiences: true + field_az_body: true + field_az_credit: true + field_az_modality: true + field_az_offered: true + field_az_ongoing: true + field_az_parent_account: true + field_az_program_date: true + field_az_program_length: true + field_az_program_website: true + field_az_trellis_id: true + field_az_trellis_imported_date: true + field_opportunity_attachments: true diff --git a/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.default.yml b/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.default.yml new file mode 100644 index 0000000000..75bac47fad --- /dev/null +++ b/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.default.yml @@ -0,0 +1,350 @@ +langcode: en +status: true +dependencies: + config: + - field.field.node.az_opportunity.field_az_application_date + - field.field.node.az_opportunity.field_az_application_link + - field.field.node.az_opportunity.field_az_audiences + - field.field.node.az_opportunity.field_az_body + - field.field.node.az_opportunity.field_az_credit + - field.field.node.az_opportunity.field_az_incentives + - field.field.node.az_opportunity.field_az_location + - field.field.node.az_opportunity.field_az_modality + - field.field.node.az_opportunity.field_az_offered + - field.field.node.az_opportunity.field_az_ongoing + - field.field.node.az_opportunity.field_az_parent_account + - field.field.node.az_opportunity.field_az_program_date + - field.field.node.az_opportunity.field_az_program_length + - field.field.node.az_opportunity.field_az_program_website + - field.field.node.az_opportunity.field_az_topic + - field.field.node.az_opportunity.field_az_trellis_id + - field.field.node.az_opportunity.field_az_trellis_imported_date + - field.field.node.az_opportunity.field_opportunity_attachments + - node.type.az_opportunity + module: + - datetime_range + - field_group + - link + - smart_title + - text + - user +third_party_settings: + field_group: + group_col1: + children: + - field_az_location + label: col1 + parent_name: group_header_row + region: content + weight: 1 + format_type: html_element + format_settings: + classes: col + show_empty_fields: false + id: '' + label_as_html: false + element: div + show_label: false + label_element: h3 + label_element_classes: '' + attributes: '' + effect: none + speed: fast + group_col2: + children: + - field_az_application_date + label: col2 + parent_name: group_header_row + region: content + weight: 2 + format_type: html_element + format_settings: + classes: col + show_empty_fields: false + id: '' + label_as_html: false + element: div + show_label: false + label_element: h3 + label_element_classes: '' + attributes: '' + effect: none + speed: fast + group_col3: + children: + - field_az_program_length + label: col3 + parent_name: group_header_row + region: content + weight: 3 + format_type: html_element + format_settings: + classes: col + show_empty_fields: false + id: '' + label_as_html: false + element: div + show_label: false + label_element: h3 + label_element_classes: '' + attributes: '' + effect: none + speed: fast + group_col4: + children: + - field_az_offered + - field_az_modality + label: col4 + parent_name: group_header_row + region: content + weight: 4 + format_type: html_element + format_settings: + classes: col + show_empty_fields: false + id: '' + label_as_html: false + element: div + show_label: false + label_element: h3 + label_element_classes: '' + attributes: '' + effect: none + speed: fast + group_col5: + children: + - field_az_incentives + - field_az_credit + label: col5 + parent_name: group_header_row + region: content + weight: 5 + format_type: html_element + format_settings: + classes: col + show_empty_fields: false + id: '' + label_as_html: false + element: div + show_label: false + label_element: h3 + label_element_classes: '' + attributes: '' + effect: none + speed: fast + group_col6: + children: + - field_az_topic + label: col6 + parent_name: group_header_row + region: content + weight: 6 + format_type: html_element + format_settings: + classes: col + show_empty_fields: false + id: '' + label_as_html: false + element: div + show_label: false + label_element: h3 + label_element_classes: '' + attributes: '' + effect: none + speed: fast + group_col7: + children: { } + label: col7 + parent_name: '' + region: hidden + weight: 12 + format_type: html_element + format_settings: + classes: col7 + show_empty_fields: false + id: '' + label_as_html: false + element: div + show_label: false + label_element: h3 + label_element_classes: '' + attributes: '' + effect: none + speed: fast + group_col8: + children: { } + label: col8 + parent_name: '' + region: hidden + weight: 13 + format_type: html_element + format_settings: + classes: col + show_empty_fields: false + id: '' + label_as_html: false + element: div + show_label: false + label_element: h3 + label_element_classes: '' + attributes: '' + effect: none + speed: fast + group_header_row: + children: + - group_col1 + - group_col2 + - group_col3 + - group_col4 + - group_col5 + - group_col6 + label: 'header row' + parent_name: '' + region: content + weight: 0 + format_type: html_element + format_settings: + classes: row + show_empty_fields: false + id: '' + label_as_html: false + element: div + show_label: false + label_element: h3 + label_element_classes: '' + attributes: '' + effect: none + speed: fast + smart_title: + enabled: false +id: node.az_opportunity.default +targetEntityType: node +bundle: az_opportunity +mode: default +content: + field_az_application_date: + type: daterange_default + label: above + settings: + timezone_override: '' + format_type: html_date + from_to: both + separator: '-' + third_party_settings: { } + weight: 5 + region: content + field_az_application_link: + type: link + label: above + settings: + trim_length: 80 + url_only: false + url_plain: false + rel: '' + target: '' + third_party_settings: { } + weight: 5 + region: content + field_az_body: + type: text_default + label: hidden + settings: { } + third_party_settings: { } + weight: 1 + region: content + field_az_credit: + type: entity_reference_label + label: hidden + settings: + link: false + third_party_settings: { } + weight: 9 + region: content + field_az_incentives: + type: boolean + label: above + settings: + format: default + format_custom_false: '' + format_custom_true: '' + third_party_settings: { } + weight: 8 + region: content + field_az_location: + type: link_separate + label: above + settings: + trim_length: 80 + url_only: false + url_plain: false + rel: '' + target: '' + third_party_settings: { } + weight: 7 + region: content + field_az_modality: + type: entity_reference_label + label: hidden + settings: + link: false + third_party_settings: { } + weight: 8 + region: content + field_az_offered: + type: entity_reference_label + label: above + settings: + link: false + third_party_settings: { } + weight: 7 + region: content + field_az_program_length: + type: string + label: above + settings: + link_to_entity: false + third_party_settings: { } + weight: 8 + region: content + field_az_program_website: + type: link + label: above + settings: + trim_length: 80 + url_only: false + url_plain: false + rel: '' + target: '' + third_party_settings: { } + weight: 4 + region: content + field_az_topic: + type: entity_reference_label + label: above + settings: + link: false + third_party_settings: { } + weight: 7 + region: content + field_opportunity_attachments: + type: entity_reference_entity_view + label: above + settings: + view_mode: default + link: false + third_party_settings: { } + weight: 3 + region: content + links: + settings: { } + third_party_settings: { } + weight: 2 + region: content +hidden: + field_az_audiences: true + field_az_ongoing: true + field_az_parent_account: true + field_az_program_date: true + field_az_trellis_id: true + field_az_trellis_imported_date: true + smart_title: true diff --git a/modules/custom/az_opportunity/config/install/core.entity_view_display.taxonomy_term.az_opportunity_audience.default.yml b/modules/custom/az_opportunity/config/install/core.entity_view_display.taxonomy_term.az_opportunity_audience.default.yml new file mode 100644 index 0000000000..784d6a84bd --- /dev/null +++ b/modules/custom/az_opportunity/config/install/core.entity_view_display.taxonomy_term.az_opportunity_audience.default.yml @@ -0,0 +1,20 @@ +langcode: en +status: true +dependencies: + config: + - taxonomy.vocabulary.az_opportunity_audience + module: + - az_core +id: taxonomy_term.az_opportunity_audience.default +targetEntityType: taxonomy_term +bundle: az_opportunity_audience +mode: default +content: + description: + type: az_text_summary + label: hidden + settings: { } + third_party_settings: { } + weight: 0 + region: content +hidden: { } diff --git a/modules/custom/az_opportunity/config/install/core.entity_view_display.taxonomy_term.az_opportunity_semester.default.yml b/modules/custom/az_opportunity/config/install/core.entity_view_display.taxonomy_term.az_opportunity_semester.default.yml new file mode 100644 index 0000000000..53fd35f123 --- /dev/null +++ b/modules/custom/az_opportunity/config/install/core.entity_view_display.taxonomy_term.az_opportunity_semester.default.yml @@ -0,0 +1,21 @@ +langcode: en +status: true +dependencies: + config: + - taxonomy.vocabulary.az_opportunity_semester + module: + - text +id: taxonomy_term.az_opportunity_semester.default +targetEntityType: taxonomy_term +bundle: az_opportunity_semester +mode: default +content: + description: + type: text_trimmed + label: hidden + settings: + trim_length: 600 + third_party_settings: { } + weight: 0 + region: content +hidden: { } diff --git a/modules/custom/az_opportunity/config/install/core.entity_view_display.taxonomy_term.az_opportunity_topic.az_badge.yml b/modules/custom/az_opportunity/config/install/core.entity_view_display.taxonomy_term.az_opportunity_topic.az_badge.yml new file mode 100644 index 0000000000..cddf8b46a6 --- /dev/null +++ b/modules/custom/az_opportunity/config/install/core.entity_view_display.taxonomy_term.az_opportunity_topic.az_badge.yml @@ -0,0 +1,40 @@ +langcode: en +status: false +dependencies: + config: + - core.entity_view_mode.taxonomy_term.az_badge + - taxonomy.vocabulary.az_opportunity_topic + module: + - field_group + - text +third_party_settings: + field_group: + group_opportunity_tags: + children: + - description + label: 'Opportunity Tags' + parent_name: '' + region: content + weight: 0 + format_type: link + format_settings: + classes: 'badge text-bg-light badge-link' + show_empty_fields: false + id: '' + label_as_html: false + target: entity + custom_uri: '' + target_attribute: default +id: taxonomy_term.az_opportunity_topic.az_badge +targetEntityType: taxonomy_term +bundle: az_opportunity_topic +mode: az_badge +content: + description: + type: text_default + label: hidden + settings: { } + third_party_settings: { } + weight: 1 + region: content +hidden: { } diff --git a/modules/custom/az_opportunity/config/install/core.entity_view_display.taxonomy_term.az_opportunity_topic.default.yml b/modules/custom/az_opportunity/config/install/core.entity_view_display.taxonomy_term.az_opportunity_topic.default.yml new file mode 100644 index 0000000000..15eab546d4 --- /dev/null +++ b/modules/custom/az_opportunity/config/install/core.entity_view_display.taxonomy_term.az_opportunity_topic.default.yml @@ -0,0 +1,20 @@ +langcode: en +status: true +dependencies: + config: + - taxonomy.vocabulary.az_opportunity_topic + module: + - text +id: taxonomy_term.az_opportunity_topic.default +targetEntityType: taxonomy_term +bundle: az_opportunity_topic +mode: default +content: + description: + type: text_default + label: hidden + settings: { } + third_party_settings: { } + weight: 0 + region: content +hidden: { } diff --git a/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_application_date.yml b/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_application_date.yml new file mode 100644 index 0000000000..0c32f00500 --- /dev/null +++ b/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_application_date.yml @@ -0,0 +1,20 @@ +langcode: en +status: true +dependencies: + config: + - field.storage.node.field_az_application_date + - node.type.az_opportunity + module: + - datetime_range +id: node.az_opportunity.field_az_application_date +field_name: field_az_application_date +entity_type: node +bundle: az_opportunity +label: 'Application Date' +description: '' +required: false +translatable: false +default_value: { } +default_value_callback: '' +settings: { } +field_type: daterange diff --git a/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_application_link.yml b/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_application_link.yml new file mode 100644 index 0000000000..a88251ddf5 --- /dev/null +++ b/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_application_link.yml @@ -0,0 +1,22 @@ +langcode: en +status: true +dependencies: + config: + - field.storage.node.field_az_application_link + - node.type.az_opportunity + module: + - link +id: node.az_opportunity.field_az_application_link +field_name: field_az_application_link +entity_type: node +bundle: az_opportunity +label: 'Application Link' +description: '' +required: false +translatable: false +default_value: { } +default_value_callback: '' +settings: + title: 1 + link_type: 17 +field_type: link diff --git a/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_audiences.yml b/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_audiences.yml new file mode 100644 index 0000000000..7a2a5fb77f --- /dev/null +++ b/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_audiences.yml @@ -0,0 +1,28 @@ +langcode: en +status: true +dependencies: + config: + - field.storage.node.field_az_audiences + - node.type.az_opportunity + - taxonomy.vocabulary.az_opportunity_audience +id: node.az_opportunity.field_az_audiences +field_name: field_az_audiences +entity_type: node +bundle: az_opportunity +label: Audiences +description: '' +required: false +translatable: false +default_value: { } +default_value_callback: '' +settings: + handler: 'default:taxonomy_term' + handler_settings: + target_bundles: + az_opportunity_audience: az_opportunity_audience + sort: + field: name + direction: asc + auto_create: true + auto_create_bundle: '' +field_type: entity_reference diff --git a/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_body.yml b/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_body.yml new file mode 100644 index 0000000000..99d7b2958b --- /dev/null +++ b/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_body.yml @@ -0,0 +1,23 @@ +langcode: en +status: true +dependencies: + config: + - field.storage.node.field_az_body + - filter.format.az_standard + - node.type.az_opportunity + module: + - text +id: node.az_opportunity.field_az_body +field_name: field_az_body +entity_type: node +bundle: az_opportunity +label: 'Opportunity Description' +description: 'White text will be highlighted in gray (only while editing) to keep the text visible.' +required: false +translatable: false +default_value: { } +default_value_callback: '' +settings: + allowed_formats: + - az_standard +field_type: text_long diff --git a/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_credit.yml b/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_credit.yml new file mode 100644 index 0000000000..0d29761677 --- /dev/null +++ b/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_credit.yml @@ -0,0 +1,28 @@ +langcode: en +status: true +dependencies: + config: + - field.storage.node.field_az_credit + - node.type.az_opportunity + - taxonomy.vocabulary.az_opportunity_credit +id: node.az_opportunity.field_az_credit +field_name: field_az_credit +entity_type: node +bundle: az_opportunity +label: Credit +description: '' +required: false +translatable: false +default_value: { } +default_value_callback: '' +settings: + handler: 'default:taxonomy_term' + handler_settings: + target_bundles: + az_opportunity_credit: az_opportunity_credit + sort: + field: name + direction: asc + auto_create: true + auto_create_bundle: '' +field_type: entity_reference diff --git a/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_incentives.yml b/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_incentives.yml new file mode 100644 index 0000000000..c67852d2ff --- /dev/null +++ b/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_incentives.yml @@ -0,0 +1,20 @@ +langcode: en +status: true +dependencies: + config: + - field.storage.node.field_az_incentives + - node.type.az_opportunity +id: node.az_opportunity.field_az_incentives +field_name: field_az_incentives +entity_type: node +bundle: az_opportunity +label: Incentives +description: '' +required: false +translatable: false +default_value: { } +default_value_callback: '' +settings: + on_label: 'Yes' + off_label: 'No' +field_type: boolean diff --git a/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_location.yml b/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_location.yml new file mode 100644 index 0000000000..3656bea942 --- /dev/null +++ b/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_location.yml @@ -0,0 +1,22 @@ +langcode: en +status: true +dependencies: + config: + - field.storage.node.field_az_location + - node.type.az_opportunity + module: + - link +id: node.az_opportunity.field_az_location +field_name: field_az_location +entity_type: node +bundle: az_opportunity +label: Where +description: "To link to an online map for the location, enter a URL above.
\r\nOtherwise, enter <nolink> in the URL field and enter the location name or address in the Link text field.
\r\nCampus Map: https://map.arizona.edu
\r\nGoogle Maps: https://maps.google.com" +required: false +translatable: false +default_value: { } +default_value_callback: '' +settings: + title: 1 + link_type: 17 +field_type: link diff --git a/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_modality.yml b/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_modality.yml new file mode 100644 index 0000000000..6371b19b33 --- /dev/null +++ b/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_modality.yml @@ -0,0 +1,28 @@ +langcode: en +status: true +dependencies: + config: + - field.storage.node.field_az_modality + - node.type.az_opportunity + - taxonomy.vocabulary.az_opportunity_modality +id: node.az_opportunity.field_az_modality +field_name: field_az_modality +entity_type: node +bundle: az_opportunity +label: Modality +description: '' +required: false +translatable: false +default_value: { } +default_value_callback: '' +settings: + handler: 'default:taxonomy_term' + handler_settings: + target_bundles: + az_opportunity_modality: az_opportunity_modality + sort: + field: name + direction: asc + auto_create: true + auto_create_bundle: '' +field_type: entity_reference diff --git a/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_offered.yml b/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_offered.yml new file mode 100644 index 0000000000..9279d5cf8e --- /dev/null +++ b/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_offered.yml @@ -0,0 +1,28 @@ +langcode: en +status: true +dependencies: + config: + - field.storage.node.field_az_offered + - node.type.az_opportunity + - taxonomy.vocabulary.az_opportunity_semester +id: node.az_opportunity.field_az_offered +field_name: field_az_offered +entity_type: node +bundle: az_opportunity +label: Offered +description: '' +required: false +translatable: false +default_value: { } +default_value_callback: '' +settings: + handler: 'default:taxonomy_term' + handler_settings: + target_bundles: + az_opportunity_semester: az_opportunity_semester + sort: + field: name + direction: asc + auto_create: true + auto_create_bundle: '' +field_type: entity_reference diff --git a/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_ongoing.yml b/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_ongoing.yml new file mode 100644 index 0000000000..f08803f956 --- /dev/null +++ b/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_ongoing.yml @@ -0,0 +1,20 @@ +langcode: en +status: true +dependencies: + config: + - field.storage.node.field_az_ongoing + - node.type.az_opportunity +id: node.az_opportunity.field_az_ongoing +field_name: field_az_ongoing +entity_type: node +bundle: az_opportunity +label: Ongoing +description: '' +required: false +translatable: false +default_value: { } +default_value_callback: '' +settings: + on_label: 'On' + off_label: 'Off' +field_type: boolean diff --git a/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_parent_account.yml b/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_parent_account.yml new file mode 100644 index 0000000000..3c9cd75e9e --- /dev/null +++ b/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_parent_account.yml @@ -0,0 +1,18 @@ +langcode: en +status: true +dependencies: + config: + - field.storage.node.field_az_parent_account + - node.type.az_opportunity +id: node.az_opportunity.field_az_parent_account +field_name: field_az_parent_account +entity_type: node +bundle: az_opportunity +label: 'Parent Account' +description: '' +required: false +translatable: false +default_value: { } +default_value_callback: '' +settings: { } +field_type: string diff --git a/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_program_date.yml b/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_program_date.yml new file mode 100644 index 0000000000..028476bac7 --- /dev/null +++ b/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_program_date.yml @@ -0,0 +1,20 @@ +langcode: en +status: true +dependencies: + config: + - field.storage.node.field_az_program_date + - node.type.az_opportunity + module: + - datetime_range +id: node.az_opportunity.field_az_program_date +field_name: field_az_program_date +entity_type: node +bundle: az_opportunity +label: 'Program Date' +description: '' +required: false +translatable: false +default_value: { } +default_value_callback: '' +settings: { } +field_type: daterange diff --git a/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_program_length.yml b/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_program_length.yml new file mode 100644 index 0000000000..391930e099 --- /dev/null +++ b/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_program_length.yml @@ -0,0 +1,18 @@ +langcode: en +status: true +dependencies: + config: + - field.storage.node.field_az_program_length + - node.type.az_opportunity +id: node.az_opportunity.field_az_program_length +field_name: field_az_program_length +entity_type: node +bundle: az_opportunity +label: 'Program Length' +description: '' +required: false +translatable: false +default_value: { } +default_value_callback: '' +settings: { } +field_type: string diff --git a/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_program_website.yml b/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_program_website.yml new file mode 100644 index 0000000000..07aba7fc0b --- /dev/null +++ b/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_program_website.yml @@ -0,0 +1,22 @@ +langcode: en +status: true +dependencies: + config: + - field.storage.node.field_az_program_website + - node.type.az_opportunity + module: + - link +id: node.az_opportunity.field_az_program_website +field_name: field_az_program_website +entity_type: node +bundle: az_opportunity +label: 'Program Website' +description: '' +required: false +translatable: false +default_value: { } +default_value_callback: '' +settings: + title: 1 + link_type: 17 +field_type: link diff --git a/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_start_options.yml b/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_start_options.yml new file mode 100644 index 0000000000..f7bcb871e6 --- /dev/null +++ b/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_start_options.yml @@ -0,0 +1 @@ +{ } \ No newline at end of file diff --git a/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_topic.yml b/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_topic.yml new file mode 100644 index 0000000000..055def15e9 --- /dev/null +++ b/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_topic.yml @@ -0,0 +1,28 @@ +langcode: en +status: true +dependencies: + config: + - field.storage.node.field_az_topic + - node.type.az_opportunity + - taxonomy.vocabulary.az_opportunity_topic +id: node.az_opportunity.field_az_topic +field_name: field_az_topic +entity_type: node +bundle: az_opportunity +label: Topic +description: '' +required: false +translatable: false +default_value: { } +default_value_callback: '' +settings: + handler: 'default:taxonomy_term' + handler_settings: + target_bundles: + az_opportunity_topic: az_opportunity_topic + sort: + field: name + direction: asc + auto_create: true + auto_create_bundle: '' +field_type: entity_reference diff --git a/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_trellis_id.yml b/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_trellis_id.yml new file mode 100644 index 0000000000..47c8f495b1 --- /dev/null +++ b/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_trellis_id.yml @@ -0,0 +1,18 @@ +langcode: en +status: true +dependencies: + config: + - field.storage.node.field_az_trellis_id + - node.type.az_opportunity +id: node.az_opportunity.field_az_trellis_id +field_name: field_az_trellis_id +entity_type: node +bundle: az_opportunity +label: 'Trellis Opportunity ID' +description: '' +required: false +translatable: false +default_value: { } +default_value_callback: '' +settings: { } +field_type: string diff --git a/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_trellis_imported_date.yml b/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_trellis_imported_date.yml new file mode 100644 index 0000000000..d2b743f523 --- /dev/null +++ b/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_trellis_imported_date.yml @@ -0,0 +1,20 @@ +langcode: en +status: true +dependencies: + config: + - field.storage.node.field_az_trellis_imported_date + - node.type.az_opportunity + module: + - datetime +id: node.az_opportunity.field_az_trellis_imported_date +field_name: field_az_trellis_imported_date +entity_type: node +bundle: az_opportunity +label: 'Trellis Imported Date' +description: 'An internal field that informs us when this content was last updated.' +required: false +translatable: false +default_value: { } +default_value_callback: '' +settings: { } +field_type: datetime diff --git a/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_opportunity_attachments.yml b/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_opportunity_attachments.yml new file mode 100644 index 0000000000..8ca53fa8be --- /dev/null +++ b/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_opportunity_attachments.yml @@ -0,0 +1,28 @@ +langcode: en +status: true +dependencies: + config: + - field.storage.node.field_opportunity_attachments + - media.type.az_document + - node.type.az_opportunity +id: node.az_opportunity.field_opportunity_attachments +field_name: field_opportunity_attachments +entity_type: node +bundle: az_opportunity +label: 'Opportunity Attachments' +description: '' +required: false +translatable: false +default_value: { } +default_value_callback: '' +settings: + handler: 'default:media' + handler_settings: + target_bundles: + az_document: az_document + sort: + field: _none + direction: ASC + auto_create: false + auto_create_bundle: '' +field_type: entity_reference diff --git a/modules/custom/az_opportunity/config/install/field.storage.node.field_az_application_date.yml b/modules/custom/az_opportunity/config/install/field.storage.node.field_az_application_date.yml new file mode 100644 index 0000000000..84554f56da --- /dev/null +++ b/modules/custom/az_opportunity/config/install/field.storage.node.field_az_application_date.yml @@ -0,0 +1,19 @@ +langcode: en +status: true +dependencies: + module: + - datetime_range + - node +id: node.field_az_application_date +field_name: field_az_application_date +entity_type: node +type: daterange +settings: + datetime_type: datetime +module: datetime_range +locked: false +cardinality: 1 +translatable: true +indexes: { } +persist_with_no_fields: false +custom_storage: false diff --git a/modules/custom/az_opportunity/config/install/field.storage.node.field_az_application_link.yml b/modules/custom/az_opportunity/config/install/field.storage.node.field_az_application_link.yml new file mode 100644 index 0000000000..530cdc3e0a --- /dev/null +++ b/modules/custom/az_opportunity/config/install/field.storage.node.field_az_application_link.yml @@ -0,0 +1,18 @@ +langcode: en +status: true +dependencies: + module: + - link + - node +id: node.field_az_application_link +field_name: field_az_application_link +entity_type: node +type: link +settings: { } +module: link +locked: false +cardinality: 1 +translatable: true +indexes: { } +persist_with_no_fields: false +custom_storage: false diff --git a/modules/custom/az_opportunity/config/install/field.storage.node.field_az_audiences.yml b/modules/custom/az_opportunity/config/install/field.storage.node.field_az_audiences.yml new file mode 100644 index 0000000000..2e64f0704f --- /dev/null +++ b/modules/custom/az_opportunity/config/install/field.storage.node.field_az_audiences.yml @@ -0,0 +1,19 @@ +langcode: en +status: true +dependencies: + module: + - node + - taxonomy +id: node.field_az_audiences +field_name: field_az_audiences +entity_type: node +type: entity_reference +settings: + target_type: taxonomy_term +module: core +locked: false +cardinality: -1 +translatable: true +indexes: { } +persist_with_no_fields: false +custom_storage: false diff --git a/modules/custom/az_opportunity/config/install/field.storage.node.field_az_credit.yml b/modules/custom/az_opportunity/config/install/field.storage.node.field_az_credit.yml new file mode 100644 index 0000000000..6c3742abfc --- /dev/null +++ b/modules/custom/az_opportunity/config/install/field.storage.node.field_az_credit.yml @@ -0,0 +1,19 @@ +langcode: en +status: true +dependencies: + module: + - node + - taxonomy +id: node.field_az_credit +field_name: field_az_credit +entity_type: node +type: entity_reference +settings: + target_type: taxonomy_term +module: core +locked: false +cardinality: -1 +translatable: true +indexes: { } +persist_with_no_fields: false +custom_storage: false diff --git a/modules/custom/az_opportunity/config/install/field.storage.node.field_az_incentives.yml b/modules/custom/az_opportunity/config/install/field.storage.node.field_az_incentives.yml new file mode 100644 index 0000000000..1cb25341b6 --- /dev/null +++ b/modules/custom/az_opportunity/config/install/field.storage.node.field_az_incentives.yml @@ -0,0 +1,17 @@ +langcode: en +status: true +dependencies: + module: + - node +id: node.field_az_incentives +field_name: field_az_incentives +entity_type: node +type: boolean +settings: { } +module: core +locked: false +cardinality: 1 +translatable: true +indexes: { } +persist_with_no_fields: false +custom_storage: false diff --git a/modules/custom/az_opportunity/config/install/field.storage.node.field_az_modality.yml b/modules/custom/az_opportunity/config/install/field.storage.node.field_az_modality.yml new file mode 100644 index 0000000000..f44b383e75 --- /dev/null +++ b/modules/custom/az_opportunity/config/install/field.storage.node.field_az_modality.yml @@ -0,0 +1,19 @@ +langcode: en +status: true +dependencies: + module: + - node + - taxonomy +id: node.field_az_modality +field_name: field_az_modality +entity_type: node +type: entity_reference +settings: + target_type: taxonomy_term +module: core +locked: false +cardinality: 1 +translatable: true +indexes: { } +persist_with_no_fields: false +custom_storage: false diff --git a/modules/custom/az_opportunity/config/install/field.storage.node.field_az_offered.yml b/modules/custom/az_opportunity/config/install/field.storage.node.field_az_offered.yml new file mode 100644 index 0000000000..fb55b0a439 --- /dev/null +++ b/modules/custom/az_opportunity/config/install/field.storage.node.field_az_offered.yml @@ -0,0 +1,19 @@ +langcode: en +status: true +dependencies: + module: + - node + - taxonomy +id: node.field_az_offered +field_name: field_az_offered +entity_type: node +type: entity_reference +settings: + target_type: taxonomy_term +module: core +locked: false +cardinality: -1 +translatable: true +indexes: { } +persist_with_no_fields: false +custom_storage: false diff --git a/modules/custom/az_opportunity/config/install/field.storage.node.field_az_ongoing.yml b/modules/custom/az_opportunity/config/install/field.storage.node.field_az_ongoing.yml new file mode 100644 index 0000000000..2b0ec8f908 --- /dev/null +++ b/modules/custom/az_opportunity/config/install/field.storage.node.field_az_ongoing.yml @@ -0,0 +1,17 @@ +langcode: en +status: true +dependencies: + module: + - node +id: node.field_az_ongoing +field_name: field_az_ongoing +entity_type: node +type: boolean +settings: { } +module: core +locked: false +cardinality: 1 +translatable: true +indexes: { } +persist_with_no_fields: false +custom_storage: false diff --git a/modules/custom/az_opportunity/config/install/field.storage.node.field_az_parent_account.yml b/modules/custom/az_opportunity/config/install/field.storage.node.field_az_parent_account.yml new file mode 100644 index 0000000000..b178540f18 --- /dev/null +++ b/modules/custom/az_opportunity/config/install/field.storage.node.field_az_parent_account.yml @@ -0,0 +1,20 @@ +langcode: en +status: true +dependencies: + module: + - node +id: node.field_az_parent_account +field_name: field_az_parent_account +entity_type: node +type: string +settings: + max_length: 255 + case_sensitive: false + is_ascii: false +module: core +locked: false +cardinality: 1 +translatable: true +indexes: { } +persist_with_no_fields: false +custom_storage: false diff --git a/modules/custom/az_opportunity/config/install/field.storage.node.field_az_program_date.yml b/modules/custom/az_opportunity/config/install/field.storage.node.field_az_program_date.yml new file mode 100644 index 0000000000..e0926ea086 --- /dev/null +++ b/modules/custom/az_opportunity/config/install/field.storage.node.field_az_program_date.yml @@ -0,0 +1,19 @@ +langcode: en +status: true +dependencies: + module: + - datetime_range + - node +id: node.field_az_program_date +field_name: field_az_program_date +entity_type: node +type: daterange +settings: + datetime_type: datetime +module: datetime_range +locked: false +cardinality: 1 +translatable: true +indexes: { } +persist_with_no_fields: false +custom_storage: false diff --git a/modules/custom/az_opportunity/config/install/field.storage.node.field_az_program_length.yml b/modules/custom/az_opportunity/config/install/field.storage.node.field_az_program_length.yml new file mode 100644 index 0000000000..7e2d8371d2 --- /dev/null +++ b/modules/custom/az_opportunity/config/install/field.storage.node.field_az_program_length.yml @@ -0,0 +1,20 @@ +langcode: en +status: true +dependencies: + module: + - node +id: node.field_az_program_length +field_name: field_az_program_length +entity_type: node +type: string +settings: + max_length: 255 + case_sensitive: false + is_ascii: false +module: core +locked: false +cardinality: 1 +translatable: true +indexes: { } +persist_with_no_fields: false +custom_storage: false diff --git a/modules/custom/az_opportunity/config/install/field.storage.node.field_az_program_website.yml b/modules/custom/az_opportunity/config/install/field.storage.node.field_az_program_website.yml new file mode 100644 index 0000000000..9208b2bec4 --- /dev/null +++ b/modules/custom/az_opportunity/config/install/field.storage.node.field_az_program_website.yml @@ -0,0 +1,18 @@ +langcode: en +status: true +dependencies: + module: + - link + - node +id: node.field_az_program_website +field_name: field_az_program_website +entity_type: node +type: link +settings: { } +module: link +locked: false +cardinality: 1 +translatable: true +indexes: { } +persist_with_no_fields: false +custom_storage: false diff --git a/modules/custom/az_opportunity/config/install/field.storage.node.field_az_start_options.yml b/modules/custom/az_opportunity/config/install/field.storage.node.field_az_start_options.yml new file mode 100644 index 0000000000..f7bcb871e6 --- /dev/null +++ b/modules/custom/az_opportunity/config/install/field.storage.node.field_az_start_options.yml @@ -0,0 +1 @@ +{ } \ No newline at end of file diff --git a/modules/custom/az_opportunity/config/install/field.storage.node.field_az_topic.yml b/modules/custom/az_opportunity/config/install/field.storage.node.field_az_topic.yml new file mode 100644 index 0000000000..7503690d35 --- /dev/null +++ b/modules/custom/az_opportunity/config/install/field.storage.node.field_az_topic.yml @@ -0,0 +1,19 @@ +langcode: en +status: true +dependencies: + module: + - node + - taxonomy +id: node.field_az_topic +field_name: field_az_topic +entity_type: node +type: entity_reference +settings: + target_type: taxonomy_term +module: core +locked: false +cardinality: -1 +translatable: true +indexes: { } +persist_with_no_fields: false +custom_storage: false diff --git a/modules/custom/az_opportunity/config/install/field.storage.node.field_az_trellis_imported_date.yml b/modules/custom/az_opportunity/config/install/field.storage.node.field_az_trellis_imported_date.yml new file mode 100644 index 0000000000..8d54b2ca18 --- /dev/null +++ b/modules/custom/az_opportunity/config/install/field.storage.node.field_az_trellis_imported_date.yml @@ -0,0 +1,19 @@ +langcode: en +status: true +dependencies: + module: + - datetime + - node +id: node.field_az_trellis_imported_date +field_name: field_az_trellis_imported_date +entity_type: node +type: datetime +settings: + datetime_type: datetime +module: datetime +locked: false +cardinality: 1 +translatable: true +indexes: { } +persist_with_no_fields: false +custom_storage: false diff --git a/modules/custom/az_opportunity/config/install/field.storage.node.field_opportunity_attachments.yml b/modules/custom/az_opportunity/config/install/field.storage.node.field_opportunity_attachments.yml new file mode 100644 index 0000000000..7a9528c875 --- /dev/null +++ b/modules/custom/az_opportunity/config/install/field.storage.node.field_opportunity_attachments.yml @@ -0,0 +1,19 @@ +langcode: en +status: true +dependencies: + module: + - media + - node +id: node.field_opportunity_attachments +field_name: field_opportunity_attachments +entity_type: node +type: entity_reference +settings: + target_type: media +module: core +locked: false +cardinality: 1 +translatable: true +indexes: { } +persist_with_no_fields: false +custom_storage: false diff --git a/modules/custom/az_opportunity/config/install/node.type.az_opportunity.yml b/modules/custom/az_opportunity/config/install/node.type.az_opportunity.yml new file mode 100644 index 0000000000..92f5ad98e2 --- /dev/null +++ b/modules/custom/az_opportunity/config/install/node.type.az_opportunity.yml @@ -0,0 +1,16 @@ +langcode: en +status: true +dependencies: + module: + - menu_ui +third_party_settings: + menu_ui: + available_menus: { } + parent: '' +name: Opportunity +type: az_opportunity +description: null +help: null +new_revision: true +preview_mode: 1 +display_submitted: false diff --git a/modules/custom/az_opportunity/config/install/taxonomy.vocabulary.az_opportunity_audience.yml b/modules/custom/az_opportunity/config/install/taxonomy.vocabulary.az_opportunity_audience.yml new file mode 100644 index 0000000000..fb131efa99 --- /dev/null +++ b/modules/custom/az_opportunity/config/install/taxonomy.vocabulary.az_opportunity_audience.yml @@ -0,0 +1,8 @@ +langcode: en +status: true +dependencies: { } +name: 'Opportunity Audience' +vid: az_opportunity_audience +description: null +weight: 0 +new_revision: false diff --git a/modules/custom/az_opportunity/config/install/taxonomy.vocabulary.az_opportunity_credit.yml b/modules/custom/az_opportunity/config/install/taxonomy.vocabulary.az_opportunity_credit.yml new file mode 100644 index 0000000000..38150963a1 --- /dev/null +++ b/modules/custom/az_opportunity/config/install/taxonomy.vocabulary.az_opportunity_credit.yml @@ -0,0 +1,8 @@ +langcode: en +status: true +dependencies: { } +name: 'Opportunity Credit' +vid: az_opportunity_credit +description: null +weight: 0 +new_revision: false diff --git a/modules/custom/az_opportunity/config/install/taxonomy.vocabulary.az_opportunity_modality.yml b/modules/custom/az_opportunity/config/install/taxonomy.vocabulary.az_opportunity_modality.yml new file mode 100644 index 0000000000..6705704c67 --- /dev/null +++ b/modules/custom/az_opportunity/config/install/taxonomy.vocabulary.az_opportunity_modality.yml @@ -0,0 +1,8 @@ +langcode: en +status: true +dependencies: { } +name: 'Opportunity Modality' +vid: az_opportunity_modality +description: null +weight: 0 +new_revision: false diff --git a/modules/custom/az_opportunity/config/install/taxonomy.vocabulary.az_opportunity_semester.yml b/modules/custom/az_opportunity/config/install/taxonomy.vocabulary.az_opportunity_semester.yml new file mode 100644 index 0000000000..0e67c29117 --- /dev/null +++ b/modules/custom/az_opportunity/config/install/taxonomy.vocabulary.az_opportunity_semester.yml @@ -0,0 +1,8 @@ +langcode: en +status: true +dependencies: { } +name: 'Opportunity Semester' +vid: az_opportunity_semester +description: null +weight: 0 +new_revision: false diff --git a/modules/custom/az_opportunity/config/install/taxonomy.vocabulary.az_opportunity_topic.yml b/modules/custom/az_opportunity/config/install/taxonomy.vocabulary.az_opportunity_topic.yml new file mode 100644 index 0000000000..ac1e581d22 --- /dev/null +++ b/modules/custom/az_opportunity/config/install/taxonomy.vocabulary.az_opportunity_topic.yml @@ -0,0 +1,8 @@ +langcode: en +status: true +dependencies: { } +name: 'Opportunity Topic' +vid: az_opportunity_topic +description: null +weight: 0 +new_revision: false diff --git a/modules/custom/az_opportunity/config/install/views.view.az_opportunity.yml b/modules/custom/az_opportunity/config/install/views.view.az_opportunity.yml new file mode 100644 index 0000000000..79d86a5820 --- /dev/null +++ b/modules/custom/az_opportunity/config/install/views.view.az_opportunity.yml @@ -0,0 +1,1036 @@ +langcode: en +status: true +dependencies: + config: + - core.entity_view_mode.node.az_card + - core.entity_view_mode.node.az_row + - field.storage.node.field_az_application_date + - field.storage.node.field_az_incentives + - field.storage.node.field_az_location + - field.storage.node.field_az_modality + - field.storage.node.field_az_offered + - field.storage.node.field_az_topic + - node.type.az_opportunity + - taxonomy.vocabulary.az_opportunity_modality + - taxonomy.vocabulary.az_opportunity_semester + - taxonomy.vocabulary.az_opportunity_topic + module: + - datetime + - datetime_range + - link + - node + - taxonomy + - user +id: az_opportunity +label: 'AZ Opportunity' +module: views +description: '' +tag: '' +base_table: node_field_data +base_field: nid +display: + default: + id: default + display_title: Default + display_plugin: default + position: 0 + display_options: + fields: + title: + id: title + table: node_field_data + field: title + relationship: none + group_type: group + admin_label: '' + entity_type: node + entity_field: title + plugin_id: field + label: '' + exclude: false + alter: + alter_text: false + make_link: false + absolute: false + word_boundary: false + ellipsis: false + strip_tags: false + trim: false + html: false + element_type: '' + element_class: '' + element_label_type: '' + element_label_class: '' + element_label_colon: false + element_wrapper_type: '' + element_wrapper_class: '' + element_default_classes: true + empty: '' + hide_empty: false + empty_zero: false + hide_alter_empty: true + click_sort_column: value + type: string + settings: + link_to_entity: true + group_column: value + group_columns: { } + group_rows: true + delta_limit: 0 + delta_offset: 0 + delta_reversed: false + delta_first_last: false + multi_type: separator + separator: ', ' + field_api_classes: false + pager: + type: mini + options: + offset: 0 + pagination_heading_level: h4 + items_per_page: 10 + total_pages: null + id: 0 + tags: + next: ›› + previous: ‹‹ + expose: + items_per_page: false + items_per_page_label: 'Items per page' + items_per_page_options: '5, 10, 25, 50' + items_per_page_options_all: false + items_per_page_options_all_label: '- All -' + offset: false + offset_label: Offset + exposed_form: + type: basic + options: + submit_button: Apply + reset_button: false + reset_button_label: Reset + exposed_sorts_label: 'Sort by' + expose_sort_order: true + sort_asc_label: Asc + sort_desc_label: Desc + access: + type: perm + options: + perm: 'access content' + cache: + type: tag + options: { } + empty: { } + sorts: + field_az_application_date_value: + id: field_az_application_date_value + table: node__field_az_application_date + field: field_az_application_date_value + relationship: none + group_type: group + admin_label: '' + plugin_id: datetime + order: ASC + expose: + label: '' + field_identifier: '' + exposed: false + granularity: second + arguments: { } + filters: + status: + id: status + table: node_field_data + field: status + entity_type: node + entity_field: status + plugin_id: boolean + value: '1' + group: 1 + expose: + operator: '' + type: + id: type + table: node_field_data + field: type + entity_type: node + entity_field: type + plugin_id: bundle + value: + az_opportunity: az_opportunity + style: + type: default + options: + row_class: '' + default_row_class: true + uses_fields: false + row: + type: 'entity:node' + options: + relationship: none + view_mode: az_card + query: + type: views_query + options: + query_comment: '' + disable_sql_rewrite: false + distinct: false + replica: false + query_tags: { } + relationships: { } + header: { } + footer: { } + display_extenders: { } + cache_metadata: + max-age: -1 + contexts: + - 'languages:language_content' + - 'languages:language_interface' + - url.query_args + - 'user.node_grants:view' + - user.permissions + tags: { } + block_1: + id: block_1 + display_title: 'Filtered Row View' + display_plugin: block + position: 1 + display_options: + style: + type: default + options: + row_class: '' + default_row_class: true + uses_fields: false + row: + type: 'entity:node' + options: + relationship: none + view_mode: az_row + defaults: + style: false + style_options: false + row: false + display_description: '' + style_options: null + display_extenders: { } + cache_metadata: + max-age: -1 + contexts: + - 'languages:language_content' + - 'languages:language_interface' + - url.query_args + - 'user.node_grants:view' + - user.permissions + tags: { } + block_2: + id: block_2 + display_title: 'Filtered Table View' + display_plugin: block + position: 1 + display_options: + fields: + title: + id: title + table: node_field_data + field: title + relationship: none + group_type: group + admin_label: '' + entity_type: node + entity_field: title + plugin_id: field + label: Title + exclude: false + alter: + alter_text: false + text: '' + make_link: false + path: '' + absolute: false + external: false + replace_spaces: false + path_case: none + trim_whitespace: false + alt: '' + rel: '' + link_class: '' + prefix: '' + suffix: '' + target: '' + nl2br: false + max_length: 0 + word_boundary: false + ellipsis: false + more_link: false + more_link_text: '' + more_link_path: '' + strip_tags: false + trim: false + preserve_tags: '' + html: false + element_type: '' + element_class: '' + element_label_type: '' + element_label_class: '' + element_label_colon: false + element_wrapper_type: '' + element_wrapper_class: '' + element_default_classes: true + empty: '' + hide_empty: false + empty_zero: false + hide_alter_empty: true + click_sort_column: value + type: string + settings: + link_to_entity: true + group_column: value + group_columns: { } + group_rows: true + delta_limit: 0 + delta_offset: 0 + delta_reversed: false + delta_first_last: false + multi_type: separator + separator: ', ' + field_api_classes: false + field_az_application_date: + id: field_az_application_date + table: node__field_az_application_date + field: field_az_application_date + relationship: none + group_type: group + admin_label: '' + plugin_id: field + label: 'Application Date' + exclude: false + alter: + alter_text: false + text: '' + make_link: false + path: '' + absolute: false + external: false + replace_spaces: false + path_case: none + trim_whitespace: false + alt: '' + rel: '' + link_class: '' + prefix: '' + suffix: '' + target: '' + nl2br: false + max_length: 0 + word_boundary: true + ellipsis: true + more_link: false + more_link_text: '' + more_link_path: '' + strip_tags: false + trim: false + preserve_tags: '' + html: false + element_type: '' + element_class: '' + element_label_type: '' + element_label_class: '' + element_label_colon: false + element_wrapper_type: '' + element_wrapper_class: '' + element_default_classes: true + empty: '' + hide_empty: false + empty_zero: false + hide_alter_empty: true + click_sort_column: value + type: daterange_default + settings: + timezone_override: '' + format_type: html_date + from_to: both + separator: '-' + group_column: value + group_columns: { } + group_rows: true + delta_limit: 0 + delta_offset: 0 + delta_reversed: false + delta_first_last: false + multi_type: separator + separator: ', ' + field_api_classes: false + field_az_incentives: + id: field_az_incentives + table: node__field_az_incentives + field: field_az_incentives + relationship: none + group_type: group + admin_label: '' + plugin_id: field + label: Incentives + exclude: false + alter: + alter_text: false + text: '' + make_link: false + path: '' + absolute: false + external: false + replace_spaces: false + path_case: none + trim_whitespace: false + alt: '' + rel: '' + link_class: '' + prefix: '' + suffix: '' + target: '' + nl2br: false + max_length: 0 + word_boundary: true + ellipsis: true + more_link: false + more_link_text: '' + more_link_path: '' + strip_tags: false + trim: false + preserve_tags: '' + html: false + element_type: '' + element_class: '' + element_label_type: '' + element_label_class: '' + element_label_colon: false + element_wrapper_type: '' + element_wrapper_class: '' + element_default_classes: true + empty: '' + hide_empty: false + empty_zero: false + hide_alter_empty: true + click_sort_column: value + type: boolean + settings: + format: default + format_custom_false: '' + format_custom_true: '' + group_column: value + group_columns: { } + group_rows: true + delta_limit: 0 + delta_offset: 0 + delta_reversed: false + delta_first_last: false + multi_type: separator + separator: ', ' + field_api_classes: false + field_az_modality: + id: field_az_modality + table: node__field_az_modality + field: field_az_modality + relationship: none + group_type: group + admin_label: '' + plugin_id: field + label: Modality + exclude: false + alter: + alter_text: false + text: '' + make_link: false + path: '' + absolute: false + external: false + replace_spaces: false + path_case: none + trim_whitespace: false + alt: '' + rel: '' + link_class: '' + prefix: '' + suffix: '' + target: '' + nl2br: false + max_length: 0 + word_boundary: true + ellipsis: true + more_link: false + more_link_text: '' + more_link_path: '' + strip_tags: false + trim: false + preserve_tags: '' + html: false + element_type: '' + element_class: '' + element_label_type: '' + element_label_class: '' + element_label_colon: false + element_wrapper_type: '' + element_wrapper_class: '' + element_default_classes: true + empty: '' + hide_empty: false + empty_zero: false + hide_alter_empty: true + click_sort_column: target_id + type: entity_reference_label + settings: + link: true + group_column: target_id + group_columns: { } + group_rows: true + delta_limit: 0 + delta_offset: 0 + delta_reversed: false + delta_first_last: false + multi_type: separator + separator: ', ' + field_api_classes: false + field_az_offered: + id: field_az_offered + table: node__field_az_offered + field: field_az_offered + relationship: none + group_type: group + admin_label: '' + plugin_id: field + label: Offered + exclude: false + alter: + alter_text: false + text: '' + make_link: false + path: '' + absolute: false + external: false + replace_spaces: false + path_case: none + trim_whitespace: false + alt: '' + rel: '' + link_class: '' + prefix: '' + suffix: '' + target: '' + nl2br: false + max_length: 0 + word_boundary: true + ellipsis: true + more_link: false + more_link_text: '' + more_link_path: '' + strip_tags: false + trim: false + preserve_tags: '' + html: false + element_type: '' + element_class: '' + element_label_type: '' + element_label_class: '' + element_label_colon: false + element_wrapper_type: '' + element_wrapper_class: '' + element_default_classes: true + empty: '' + hide_empty: false + empty_zero: false + hide_alter_empty: true + click_sort_column: target_id + type: entity_reference_label + settings: + link: true + group_column: target_id + group_columns: { } + group_rows: true + delta_limit: 0 + delta_offset: 0 + delta_reversed: false + delta_first_last: false + multi_type: separator + separator: ', ' + field_api_classes: false + field_az_topic: + id: field_az_topic + table: node__field_az_topic + field: field_az_topic + relationship: none + group_type: group + admin_label: '' + plugin_id: field + label: Topic + exclude: false + alter: + alter_text: false + text: '' + make_link: false + path: '' + absolute: false + external: false + replace_spaces: false + path_case: none + trim_whitespace: false + alt: '' + rel: '' + link_class: '' + prefix: '' + suffix: '' + target: '' + nl2br: false + max_length: 0 + word_boundary: true + ellipsis: true + more_link: false + more_link_text: '' + more_link_path: '' + strip_tags: false + trim: false + preserve_tags: '' + html: false + element_type: '' + element_class: '' + element_label_type: '' + element_label_class: '' + element_label_colon: false + element_wrapper_type: '' + element_wrapper_class: '' + element_default_classes: true + empty: '' + hide_empty: false + empty_zero: false + hide_alter_empty: true + click_sort_column: target_id + type: entity_reference_label + settings: + link: true + group_column: target_id + group_columns: { } + group_rows: true + delta_limit: 0 + delta_offset: 0 + delta_reversed: false + delta_first_last: false + multi_type: separator + separator: ', ' + field_api_classes: false + field_az_location: + id: field_az_location + table: node__field_az_location + field: field_az_location + relationship: none + group_type: group + admin_label: '' + plugin_id: field + label: Where + exclude: false + alter: + alter_text: false + text: '' + make_link: false + path: '' + absolute: false + external: false + replace_spaces: false + path_case: none + trim_whitespace: false + alt: '' + rel: '' + link_class: '' + prefix: '' + suffix: '' + target: '' + nl2br: false + max_length: 0 + word_boundary: true + ellipsis: true + more_link: false + more_link_text: '' + more_link_path: '' + strip_tags: false + trim: false + preserve_tags: '' + html: false + element_type: '' + element_class: '' + element_label_type: '' + element_label_class: '' + element_label_colon: false + element_wrapper_type: '' + element_wrapper_class: '' + element_default_classes: true + empty: '' + hide_empty: false + empty_zero: false + hide_alter_empty: true + click_sort_column: uri + type: link + settings: + trim_length: 80 + url_only: false + url_plain: false + rel: '0' + target: '0' + group_column: '' + group_columns: { } + group_rows: true + delta_limit: 0 + delta_offset: 0 + delta_reversed: false + delta_first_last: false + multi_type: separator + separator: ', ' + field_api_classes: false + filters: + status: + id: status + table: node_field_data + field: status + entity_type: node + entity_field: status + plugin_id: boolean + value: '1' + group: 1 + expose: + operator: '' + type: + id: type + table: node_field_data + field: type + entity_type: node + entity_field: type + plugin_id: bundle + value: + az_opportunity: az_opportunity + title: + id: title + table: node_field_data + field: title + relationship: none + group_type: group + admin_label: '' + entity_type: node + entity_field: title + plugin_id: string + operator: contains + value: '' + group: 1 + exposed: true + expose: + operator_id: title_op + label: Title + description: '' + use_operator: false + operator: title_op + operator_limit_selection: false + operator_list: { } + identifier: title + required: false + remember: false + multiple: false + remember_roles: + authenticated: authenticated + placeholder: '' + is_grouped: false + group_info: + label: '' + description: '' + identifier: '' + optional: true + widget: select + multiple: false + remember: false + default_group: All + default_group_multiple: { } + group_items: { } + field_az_incentives_value: + id: field_az_incentives_value + table: node__field_az_incentives + field: field_az_incentives_value + relationship: none + group_type: group + admin_label: '' + plugin_id: boolean + operator: '=' + value: All + group: 1 + exposed: true + expose: + operator_id: '' + label: Incentives + description: '' + use_operator: false + operator: field_az_incentives_value_op + operator_limit_selection: false + operator_list: { } + identifier: field_az_incentives_value + required: false + remember: false + multiple: false + remember_roles: + authenticated: authenticated + is_grouped: false + group_info: + label: '' + description: '' + identifier: '' + optional: true + widget: select + multiple: false + remember: false + default_group: All + default_group_multiple: { } + group_items: { } + field_az_modality_target_id: + id: field_az_modality_target_id + table: node__field_az_modality + field: field_az_modality_target_id + relationship: none + group_type: group + admin_label: '' + plugin_id: taxonomy_index_tid + operator: or + value: { } + group: 1 + exposed: true + expose: + operator_id: field_az_modality_target_id_op + label: Modality + description: '' + use_operator: false + operator: field_az_modality_target_id_op + operator_limit_selection: false + operator_list: { } + identifier: field_az_modality_target_id + required: false + remember: false + multiple: false + remember_roles: + authenticated: authenticated + reduce: false + is_grouped: false + group_info: + label: '' + description: '' + identifier: '' + optional: true + widget: select + multiple: false + remember: false + default_group: All + default_group_multiple: { } + group_items: { } + reduce_duplicates: false + vid: az_opportunity_modality + type: select + hierarchy: false + limit: true + error_message: true + field_az_offered_target_id: + id: field_az_offered_target_id + table: node__field_az_offered + field: field_az_offered_target_id + relationship: none + group_type: group + admin_label: '' + plugin_id: taxonomy_index_tid + operator: or + value: { } + group: 1 + exposed: true + expose: + operator_id: field_az_offered_target_id_op + label: Offered + description: '' + use_operator: false + operator: field_az_offered_target_id_op + operator_limit_selection: false + operator_list: { } + identifier: field_az_offered_target_id + required: false + remember: false + multiple: false + remember_roles: + authenticated: authenticated + reduce: false + is_grouped: false + group_info: + label: '' + description: '' + identifier: '' + optional: true + widget: select + multiple: false + remember: false + default_group: All + default_group_multiple: { } + group_items: { } + reduce_duplicates: false + vid: az_opportunity_semester + type: select + hierarchy: false + limit: true + error_message: true + field_az_topic_target_id: + id: field_az_topic_target_id + table: node__field_az_topic + field: field_az_topic_target_id + relationship: none + group_type: group + admin_label: '' + plugin_id: taxonomy_index_tid + operator: or + value: { } + group: 1 + exposed: true + expose: + operator_id: field_az_topic_target_id_op + label: Topic + description: '' + use_operator: false + operator: field_az_topic_target_id_op + operator_limit_selection: false + operator_list: { } + identifier: field_az_topic_target_id + required: false + remember: false + multiple: false + remember_roles: + authenticated: authenticated + reduce: false + is_grouped: false + group_info: + label: '' + description: '' + identifier: '' + optional: true + widget: select + multiple: false + remember: false + default_group: All + default_group_multiple: { } + group_items: { } + reduce_duplicates: false + vid: az_opportunity_topic + type: textfield + hierarchy: false + limit: true + error_message: true + filter_groups: + operator: AND + groups: + 1: AND + style: + type: table + options: + grouping: { } + row_class: '' + default_row_class: true + columns: + title: title + field_az_application_date: field_az_application_date + field_az_incentives: field_az_incentives + field_az_modality: field_az_modality + field_az_offered: field_az_offered + field_az_topic: field_az_topic + field_az_location: field_az_location + default: '-1' + info: + title: + sortable: false + default_sort_order: asc + align: '' + separator: '' + empty_column: false + responsive: '' + field_az_application_date: + sortable: true + default_sort_order: asc + align: '' + separator: '' + empty_column: false + responsive: '' + field_az_incentives: + sortable: false + default_sort_order: asc + align: '' + separator: '' + empty_column: false + responsive: '' + field_az_modality: + sortable: false + default_sort_order: asc + align: '' + separator: '' + empty_column: false + responsive: '' + field_az_offered: + align: '' + separator: '' + empty_column: false + responsive: '' + field_az_topic: + align: '' + separator: '' + empty_column: false + responsive: '' + field_az_location: + align: '' + separator: '' + empty_column: false + responsive: '' + override: true + sticky: false + summary: '' + empty_table: false + caption: '' + description: '' + class: '' + row: + type: 'entity:node' + options: + relationship: none + view_mode: az_row + defaults: + style: false + style_options: false + row: false + fields: false + filters: false + filter_groups: false + display_description: '' + style_options: null + display_extenders: { } + cache_metadata: + max-age: -1 + contexts: + - 'languages:language_content' + - 'languages:language_interface' + - url + - url.query_args + - 'user.node_grants:view' + - user.permissions + tags: + - 'config:field.storage.node.field_az_application_date' + - 'config:field.storage.node.field_az_incentives' + - 'config:field.storage.node.field_az_location' + - 'config:field.storage.node.field_az_modality' + - 'config:field.storage.node.field_az_offered' + - 'config:field.storage.node.field_az_topic' + block_3: + id: block_3 + display_title: 'Card View' + display_plugin: block + position: 1 + display_options: + display_description: '' + display_extenders: { } + cache_metadata: + max-age: -1 + contexts: + - 'languages:language_content' + - 'languages:language_interface' + - url.query_args + - 'user.node_grants:view' + - user.permissions + tags: { } diff --git a/modules/custom/az_opportunity/css/az_opportunity.css b/modules/custom/az_opportunity/css/az_opportunity.css new file mode 100644 index 0000000000..a69d06ee9c --- /dev/null +++ b/modules/custom/az_opportunity/css/az_opportunity.css @@ -0,0 +1,15 @@ +/* Override for Entity Reference Margins issue. */ + +/* Issue: Inline labels in the views need 0 margin, + * but labels for h3 in the default display need margin. + */ + + +.field--type-entity-reference { + margin: 0 !important; +} + +.field--type-entity-reference .field__label:not(.fw-bolder) { + font-weight: 500 !important; + margin: 1.042em 0 .667em !important; +} \ No newline at end of file diff --git a/modules/custom/az_paragraphs/az_paragraphs_view/config/install/field.field.paragraph.az_view_reference.field_az_view_reference.yml b/modules/custom/az_paragraphs/az_paragraphs_view/config/install/field.field.paragraph.az_view_reference.field_az_view_reference.yml index 4b0d1e6655..6de0e9dd8d 100644 --- a/modules/custom/az_paragraphs/az_paragraphs_view/config/install/field.field.paragraph.az_view_reference.field_az_view_reference.yml +++ b/modules/custom/az_paragraphs/az_paragraphs_view/config/install/field.field.paragraph.az_view_reference.field_az_view_reference.yml @@ -23,19 +23,18 @@ settings: auto_create: false plugin_types: default: default - block: block page: page + block: block preselect_views: - az_courses: az_courses az_events: az_events az_news: az_news + az_opportunity: az_opportunity az_page_by_category: az_page_by_category az_person: az_person - az_publications: az_publications enabled_settings: - pager: pager offset: offset argument: argument title: title + pager: pager limit: limit field_type: viewsreference From 1e9b7526999789297180563d81132f00f468ad08 Mon Sep 17 00:00:00 2001 From: Z Saenz Date: Fri, 9 Jan 2026 13:00:29 -0700 Subject: [PATCH 02/59] PHPCBF, clarifying css --- .../az_opportunity/az_opportunity.info.yml | 2 +- .../az_opportunity.libraries.yml | 2 +- .../az_opportunity/az_opportunity.module | 20 +++++++++---------- ....az_opportunity.field_az_start_options.yml | 2 +- ...ld.storage.node.field_az_start_options.yml | 2 +- .../az_opportunity/css/az_opportunity.css | 4 ++-- 6 files changed, 15 insertions(+), 17 deletions(-) diff --git a/modules/custom/az_opportunity/az_opportunity.info.yml b/modules/custom/az_opportunity/az_opportunity.info.yml index 4749193637..b5c23f3314 100644 --- a/modules/custom/az_opportunity/az_opportunity.info.yml +++ b/modules/custom/az_opportunity/az_opportunity.info.yml @@ -25,4 +25,4 @@ dependencies: - drupal:taxonomy - drupal:text - drupal:user - - views_bootstrap:views_bootstrap \ No newline at end of file + - views_bootstrap:views_bootstrap diff --git a/modules/custom/az_opportunity/az_opportunity.libraries.yml b/modules/custom/az_opportunity/az_opportunity.libraries.yml index d1d610dee3..dba72415b1 100644 --- a/modules/custom/az_opportunity/az_opportunity.libraries.yml +++ b/modules/custom/az_opportunity/az_opportunity.libraries.yml @@ -1,4 +1,4 @@ az_opportunity: css: theme: - css/az_opportunity.css: {} \ No newline at end of file + css/az_opportunity.css: {} diff --git a/modules/custom/az_opportunity/az_opportunity.module b/modules/custom/az_opportunity/az_opportunity.module index e6bc35ddc4..2214b11852 100644 --- a/modules/custom/az_opportunity/az_opportunity.module +++ b/modules/custom/az_opportunity/az_opportunity.module @@ -10,21 +10,19 @@ */ function az_opportunity_preprocess_node__az_opportunity(&$variables) { - // Attach the opportunity CSS library for az_opportunity node renderings. - $variables['#attached']['library'][] = 'az_opportunity/az_opportunity'; + // Attach the opportunity CSS library for az_opportunity node renderings. + $variables['#attached']['library'][] = 'az_opportunity/az_opportunity'; } /** - * Implements template_preprocess_views_view(). - * - * Ensure that views that render az_opportunity also get the CSS library. + * Implements template_preprocess_views_view() for az_opportunity views. */ function az_opportunity_preprocess_views_view(&$variables) { - $view = $variables['view']; - $id = $view->storage->id(); + $view = $variables['view']; + $id = $view->storage->id(); - if ($id === 'az_opportunity') { - $variables['#attached']['library'][] = 'az_opportunity/az_opportunity'; - } -} \ No newline at end of file + if ($id === 'az_opportunity') { + $variables['#attached']['library'][] = 'az_opportunity/az_opportunity'; + } +} diff --git a/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_start_options.yml b/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_start_options.yml index f7bcb871e6..6578fd5a5c 100644 --- a/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_start_options.yml +++ b/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_start_options.yml @@ -1 +1 @@ -{ } \ No newline at end of file +{ } diff --git a/modules/custom/az_opportunity/config/install/field.storage.node.field_az_start_options.yml b/modules/custom/az_opportunity/config/install/field.storage.node.field_az_start_options.yml index f7bcb871e6..6578fd5a5c 100644 --- a/modules/custom/az_opportunity/config/install/field.storage.node.field_az_start_options.yml +++ b/modules/custom/az_opportunity/config/install/field.storage.node.field_az_start_options.yml @@ -1 +1 @@ -{ } \ No newline at end of file +{ } diff --git a/modules/custom/az_opportunity/css/az_opportunity.css b/modules/custom/az_opportunity/css/az_opportunity.css index a69d06ee9c..2f21a4e0c4 100644 --- a/modules/custom/az_opportunity/css/az_opportunity.css +++ b/modules/custom/az_opportunity/css/az_opportunity.css @@ -1,10 +1,10 @@ /* Override for Entity Reference Margins issue. */ -/* Issue: Inline labels in the views need 0 margin, +/* CSS reason: The issue is that inline labels in the views need 0 margin, * but labels for h3 in the default display need margin. + * @TODO: Possible fix for Barrio Bootstrap Core? */ - .field--type-entity-reference { margin: 0 !important; } From f26a7137e6fa9bd2049abbf01fcc97712a9f4eb3 Mon Sep 17 00:00:00 2001 From: Z Saenz Date: Fri, 9 Jan 2026 15:37:48 -0700 Subject: [PATCH 03/59] Updates content with more descriptive content. --- .../config/install/smart_title.settings.yml | 1 + ...iew_display.node.az_opportunity.az_row.yml | 3 +- ...ew_display.node.az_opportunity.default.yml | 3 +- ...omy_term.az_opportunity_topic.az_badge.yml | 21 +++++--- ...nomy_term.az_opportunity_topic.default.yml | 17 ++++-- ..._opportunity.field_az_application_date.yml | 2 +- ...ld.node.az_opportunity.field_az_credit.yml | 2 +- ...ode.az_opportunity.field_az_incentives.yml | 2 +- ....node.az_opportunity.field_az_modality.yml | 2 +- ...d.node.az_opportunity.field_az_offered.yml | 2 +- ...d.node.az_opportunity.field_az_ongoing.yml | 2 +- ...az_opportunity.field_az_parent_account.yml | 2 +- ...e.az_opportunity.field_az_program_date.yml | 2 +- ...az_opportunity.field_az_program_length.yml | 2 +- ...z_opportunity.field_az_program_website.yml | 2 +- ...ortunity.field_opportunity_attachments.yml | 6 ++- .../install/node.type.az_opportunity.yml | 2 +- ...omy.vocabulary.az_opportunity_audience.yml | 2 +- ...onomy.vocabulary.az_opportunity_credit.yml | 2 +- ...omy.vocabulary.az_opportunity_modality.yml | 2 +- ...omy.vocabulary.az_opportunity_semester.yml | 2 +- ...xonomy.vocabulary.az_opportunity_topic.yml | 2 +- .../install/views.view.az_opportunity.yml | 52 +++++++++++++++++-- 23 files changed, 97 insertions(+), 38 deletions(-) diff --git a/modules/custom/az_core/config/install/smart_title.settings.yml b/modules/custom/az_core/config/install/smart_title.settings.yml index 7c96b08fc9..ccacfb8934 100644 --- a/modules/custom/az_core/config/install/smart_title.settings.yml +++ b/modules/custom/az_core/config/install/smart_title.settings.yml @@ -7,6 +7,7 @@ smart_title: - 'node:az_publication' - 'taxonomy_term:az_event_categories' - 'taxonomy_term:az_news_tags' + - 'taxonomy_term:az_opportunity_topic' - 'taxonomy_term:az_page_categories' - 'taxonomy_term:az_person_categories' - 'taxonomy_term:az_person_categories_secondary' diff --git a/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_row.yml b/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_row.yml index 778ee75541..de21e68c0e 100644 --- a/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_row.yml +++ b/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_row.yml @@ -217,9 +217,10 @@ content: weight: 11 region: content field_az_topic: - type: entity_reference_label + type: entity_reference_entity_view label: inline settings: + view_mode: az_badge link: false third_party_settings: { } weight: 5 diff --git a/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.default.yml b/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.default.yml index 75bac47fad..fb94810318 100644 --- a/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.default.yml +++ b/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.default.yml @@ -319,9 +319,10 @@ content: weight: 4 region: content field_az_topic: - type: entity_reference_label + type: entity_reference_entity_view label: above settings: + view_mode: az_badge link: false third_party_settings: { } weight: 7 diff --git a/modules/custom/az_opportunity/config/install/core.entity_view_display.taxonomy_term.az_opportunity_topic.az_badge.yml b/modules/custom/az_opportunity/config/install/core.entity_view_display.taxonomy_term.az_opportunity_topic.az_badge.yml index cddf8b46a6..7a2be9975b 100644 --- a/modules/custom/az_opportunity/config/install/core.entity_view_display.taxonomy_term.az_opportunity_topic.az_badge.yml +++ b/modules/custom/az_opportunity/config/install/core.entity_view_display.taxonomy_term.az_opportunity_topic.az_badge.yml @@ -1,17 +1,17 @@ langcode: en -status: false +status: true dependencies: config: - core.entity_view_mode.taxonomy_term.az_badge - taxonomy.vocabulary.az_opportunity_topic module: - field_group - - text + - smart_title third_party_settings: field_group: group_opportunity_tags: children: - - description + - smart_title label: 'Opportunity Tags' parent_name: '' region: content @@ -25,16 +25,21 @@ third_party_settings: target: entity custom_uri: '' target_attribute: default + smart_title: + enabled: true + settings: + smart_title__link: false + smart_title__tag: div + smart_title__classes: { } id: taxonomy_term.az_opportunity_topic.az_badge targetEntityType: taxonomy_term bundle: az_opportunity_topic mode: az_badge content: - description: - type: text_default - label: hidden + smart_title: settings: { } third_party_settings: { } - weight: 1 + weight: 0 region: content -hidden: { } +hidden: + description: true diff --git a/modules/custom/az_opportunity/config/install/core.entity_view_display.taxonomy_term.az_opportunity_topic.default.yml b/modules/custom/az_opportunity/config/install/core.entity_view_display.taxonomy_term.az_opportunity_topic.default.yml index 15eab546d4..6b585cfa50 100644 --- a/modules/custom/az_opportunity/config/install/core.entity_view_display.taxonomy_term.az_opportunity_topic.default.yml +++ b/modules/custom/az_opportunity/config/install/core.entity_view_display.taxonomy_term.az_opportunity_topic.default.yml @@ -4,17 +4,24 @@ dependencies: config: - taxonomy.vocabulary.az_opportunity_topic module: - - text + - smart_title +third_party_settings: + smart_title: + enabled: true + settings: + smart_title__link: true + smart_title__tag: h2 + smart_title__classes: + - taxonomy-term__title id: taxonomy_term.az_opportunity_topic.default targetEntityType: taxonomy_term bundle: az_opportunity_topic mode: default content: - description: - type: text_default - label: hidden + smart_title: settings: { } third_party_settings: { } weight: 0 region: content -hidden: { } +hidden: + description: true diff --git a/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_application_date.yml b/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_application_date.yml index 0c32f00500..a912e9c518 100644 --- a/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_application_date.yml +++ b/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_application_date.yml @@ -11,7 +11,7 @@ field_name: field_az_application_date entity_type: node bundle: az_opportunity label: 'Application Date' -description: '' +description: 'An Application Date is when this opportunity is active for applications.' required: false translatable: false default_value: { } diff --git a/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_credit.yml b/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_credit.yml index 0d29761677..db53ee7b85 100644 --- a/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_credit.yml +++ b/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_credit.yml @@ -10,7 +10,7 @@ field_name: field_az_credit entity_type: node bundle: az_opportunity label: Credit -description: '' +description: 'Does this opportunity earn Credits?' required: false translatable: false default_value: { } diff --git a/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_incentives.yml b/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_incentives.yml index c67852d2ff..de62e34e73 100644 --- a/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_incentives.yml +++ b/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_incentives.yml @@ -9,7 +9,7 @@ field_name: field_az_incentives entity_type: node bundle: az_opportunity label: Incentives -description: '' +description: 'Indicates if this opportunity is paid or has other incentives.' required: false translatable: false default_value: { } diff --git a/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_modality.yml b/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_modality.yml index 6371b19b33..d17389b583 100644 --- a/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_modality.yml +++ b/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_modality.yml @@ -10,7 +10,7 @@ field_name: field_az_modality entity_type: node bundle: az_opportunity label: Modality -description: '' +description: 'How this opportunity is attended.' required: false translatable: false default_value: { } diff --git a/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_offered.yml b/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_offered.yml index 9279d5cf8e..2edc818cf8 100644 --- a/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_offered.yml +++ b/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_offered.yml @@ -10,7 +10,7 @@ field_name: field_az_offered entity_type: node bundle: az_opportunity label: Offered -description: '' +description: 'Which semester or season this opportunity is offered.' required: false translatable: false default_value: { } diff --git a/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_ongoing.yml b/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_ongoing.yml index f08803f956..ed7facdf04 100644 --- a/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_ongoing.yml +++ b/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_ongoing.yml @@ -9,7 +9,7 @@ field_name: field_az_ongoing entity_type: node bundle: az_opportunity label: Ongoing -description: '' +description: 'Is this content ongoing even though its Application time has passed?' required: false translatable: false default_value: { } diff --git a/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_parent_account.yml b/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_parent_account.yml index 3c9cd75e9e..df222c0db8 100644 --- a/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_parent_account.yml +++ b/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_parent_account.yml @@ -9,7 +9,7 @@ field_name: field_az_parent_account entity_type: node bundle: az_opportunity label: 'Parent Account' -description: '' +description: 'Trellis specific field that checks for Parent Accounts, or the parent program content.' required: false translatable: false default_value: { } diff --git a/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_program_date.yml b/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_program_date.yml index 028476bac7..1f1e6a6960 100644 --- a/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_program_date.yml +++ b/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_program_date.yml @@ -11,7 +11,7 @@ field_name: field_az_program_date entity_type: node bundle: az_opportunity label: 'Program Date' -description: '' +description: 'The Program Date, or the Account Date, that the program is active.' required: false translatable: false default_value: { } diff --git a/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_program_length.yml b/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_program_length.yml index 391930e099..6b3bbd873c 100644 --- a/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_program_length.yml +++ b/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_program_length.yml @@ -9,7 +9,7 @@ field_name: field_az_program_length entity_type: node bundle: az_opportunity label: 'Program Length' -description: '' +description: 'How long a program is running.' required: false translatable: false default_value: { } diff --git a/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_program_website.yml b/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_program_website.yml index 07aba7fc0b..fd516e45ec 100644 --- a/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_program_website.yml +++ b/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_program_website.yml @@ -11,7 +11,7 @@ field_name: field_az_program_website entity_type: node bundle: az_opportunity label: 'Program Website' -description: '' +description: 'A link to the Program website.' required: false translatable: false default_value: { } diff --git a/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_opportunity_attachments.yml b/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_opportunity_attachments.yml index 8ca53fa8be..f99768de19 100644 --- a/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_opportunity_attachments.yml +++ b/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_opportunity_attachments.yml @@ -4,13 +4,14 @@ dependencies: config: - field.storage.node.field_opportunity_attachments - media.type.az_document + - media.type.az_image - node.type.az_opportunity id: node.az_opportunity.field_opportunity_attachments field_name: field_opportunity_attachments entity_type: node bundle: az_opportunity label: 'Opportunity Attachments' -description: '' +description: 'Add an document or flyer.' required: false translatable: false default_value: { } @@ -20,9 +21,10 @@ settings: handler_settings: target_bundles: az_document: az_document + az_image: az_image sort: field: _none direction: ASC auto_create: false - auto_create_bundle: '' + auto_create_bundle: az_document field_type: entity_reference diff --git a/modules/custom/az_opportunity/config/install/node.type.az_opportunity.yml b/modules/custom/az_opportunity/config/install/node.type.az_opportunity.yml index 92f5ad98e2..5fe143b326 100644 --- a/modules/custom/az_opportunity/config/install/node.type.az_opportunity.yml +++ b/modules/custom/az_opportunity/config/install/node.type.az_opportunity.yml @@ -9,7 +9,7 @@ third_party_settings: parent: '' name: Opportunity type: az_opportunity -description: null +description: 'Use this content type to add a new Opportunity to your site.' help: null new_revision: true preview_mode: 1 diff --git a/modules/custom/az_opportunity/config/install/taxonomy.vocabulary.az_opportunity_audience.yml b/modules/custom/az_opportunity/config/install/taxonomy.vocabulary.az_opportunity_audience.yml index fb131efa99..d93aff8a1f 100644 --- a/modules/custom/az_opportunity/config/install/taxonomy.vocabulary.az_opportunity_audience.yml +++ b/modules/custom/az_opportunity/config/install/taxonomy.vocabulary.az_opportunity_audience.yml @@ -3,6 +3,6 @@ status: true dependencies: { } name: 'Opportunity Audience' vid: az_opportunity_audience -description: null +description: 'Taxonomy for the Opportunity content type' weight: 0 new_revision: false diff --git a/modules/custom/az_opportunity/config/install/taxonomy.vocabulary.az_opportunity_credit.yml b/modules/custom/az_opportunity/config/install/taxonomy.vocabulary.az_opportunity_credit.yml index 38150963a1..227cfb6393 100644 --- a/modules/custom/az_opportunity/config/install/taxonomy.vocabulary.az_opportunity_credit.yml +++ b/modules/custom/az_opportunity/config/install/taxonomy.vocabulary.az_opportunity_credit.yml @@ -3,6 +3,6 @@ status: true dependencies: { } name: 'Opportunity Credit' vid: az_opportunity_credit -description: null +description: 'Taxonomy for the Opportunity content type' weight: 0 new_revision: false diff --git a/modules/custom/az_opportunity/config/install/taxonomy.vocabulary.az_opportunity_modality.yml b/modules/custom/az_opportunity/config/install/taxonomy.vocabulary.az_opportunity_modality.yml index 6705704c67..f21972ca48 100644 --- a/modules/custom/az_opportunity/config/install/taxonomy.vocabulary.az_opportunity_modality.yml +++ b/modules/custom/az_opportunity/config/install/taxonomy.vocabulary.az_opportunity_modality.yml @@ -3,6 +3,6 @@ status: true dependencies: { } name: 'Opportunity Modality' vid: az_opportunity_modality -description: null +description: 'Taxonomy for the Opportunity content type' weight: 0 new_revision: false diff --git a/modules/custom/az_opportunity/config/install/taxonomy.vocabulary.az_opportunity_semester.yml b/modules/custom/az_opportunity/config/install/taxonomy.vocabulary.az_opportunity_semester.yml index 0e67c29117..3aa129511a 100644 --- a/modules/custom/az_opportunity/config/install/taxonomy.vocabulary.az_opportunity_semester.yml +++ b/modules/custom/az_opportunity/config/install/taxonomy.vocabulary.az_opportunity_semester.yml @@ -3,6 +3,6 @@ status: true dependencies: { } name: 'Opportunity Semester' vid: az_opportunity_semester -description: null +description: 'Taxonomy for the Opportunity content type' weight: 0 new_revision: false diff --git a/modules/custom/az_opportunity/config/install/taxonomy.vocabulary.az_opportunity_topic.yml b/modules/custom/az_opportunity/config/install/taxonomy.vocabulary.az_opportunity_topic.yml index ac1e581d22..894d532413 100644 --- a/modules/custom/az_opportunity/config/install/taxonomy.vocabulary.az_opportunity_topic.yml +++ b/modules/custom/az_opportunity/config/install/taxonomy.vocabulary.az_opportunity_topic.yml @@ -3,6 +3,6 @@ status: true dependencies: { } name: 'Opportunity Topic' vid: az_opportunity_topic -description: null +description: 'Taxonomy for the Opportunity content type' weight: 0 new_revision: false diff --git a/modules/custom/az_opportunity/config/install/views.view.az_opportunity.yml b/modules/custom/az_opportunity/config/install/views.view.az_opportunity.yml index 79d86a5820..d53d63e485 100644 --- a/modules/custom/az_opportunity/config/install/views.view.az_opportunity.yml +++ b/modules/custom/az_opportunity/config/install/views.view.az_opportunity.yml @@ -24,7 +24,7 @@ dependencies: id: az_opportunity label: 'AZ Opportunity' module: views -description: '' +description: 'Use this view to display Opportunities content type' tag: '' base_table: node_field_data base_field: nid @@ -135,7 +135,46 @@ display: field_identifier: '' exposed: false granularity: second - arguments: { } + arguments: + field_az_topic_target_id: + id: field_az_topic_target_id + table: node__field_az_topic + field: field_az_topic_target_id + relationship: none + group_type: group + admin_label: '' + plugin_id: entity_target_id + default_action: ignore + exception: + value: all + title_enable: false + title: All + title_enable: false + title: '' + default_argument_type: fixed + default_argument_options: + argument: '' + summary_options: + base_path: '' + count: true + override: false + items_per_page: 25 + summary: + sort_order: asc + number_of_records: 0 + format: default_summary + specify_validation: true + validate: + type: 'entity:taxonomy_term' + fail: ignore + validate_options: + bundles: + az_opportunity_topic: az_opportunity_topic + access: false + operation: view + multiple: 1 + break_phrase: false + not: false filters: status: id: status @@ -185,13 +224,14 @@ display: contexts: - 'languages:language_content' - 'languages:language_interface' + - url - url.query_args - 'user.node_grants:view' - user.permissions tags: { } block_1: id: block_1 - display_title: 'Filtered Row View' + display_title: 'Row View' display_plugin: block position: 1 display_options: @@ -218,6 +258,7 @@ display: contexts: - 'languages:language_content' - 'languages:language_interface' + - url - url.query_args - 'user.node_grants:view' - user.permissions @@ -601,9 +642,9 @@ display: empty_zero: false hide_alter_empty: true click_sort_column: target_id - type: entity_reference_label + type: entity_reference_entity_view settings: - link: true + view_mode: az_badge group_column: target_id group_columns: { } group_rows: true @@ -1030,6 +1071,7 @@ display: contexts: - 'languages:language_content' - 'languages:language_interface' + - url - url.query_args - 'user.node_grants:view' - user.permissions From 8403d81f5e920915f2aef7059f5ea993bd45236f Mon Sep 17 00:00:00 2001 From: Z Saenz Date: Thu, 15 Jan 2026 10:49:33 -0700 Subject: [PATCH 04/59] Update fields, displays, views --- ...rm_display.node.az_opportunity.default.yml | 98 +- ...ew_display.node.az_opportunity.az_card.yml | 152 ++- ...iew_display.node.az_opportunity.az_row.yml | 32 +- ....az_opportunity.az_row_with_background.yml | 66 ++ ...splay.node.az_opportunity.az_small_row.yml | 258 +++++ ...ew_display.node.az_opportunity.default.yml | 212 +++- ..._opportunity.field_az_application_date.yml | 7 +- ...de.az_opportunity.field_az_attachments.yml | 26 + ...ield.node.az_opportunity.field_az_body.yml | 2 +- ...ld.node.az_opportunity.field_az_credit.yml | 16 +- ...ode.az_opportunity.field_az_incentives.yml | 4 +- ....node.az_opportunity.field_az_location.yml | 7 +- ...de.az_opportunity.field_az_media_image.yml | 28 + ...e.az_opportunity.field_az_program_date.yml | 7 +- ...ortunity.field_opportunity_attachments.yml | 31 +- .../field.storage.node.field_az_credit.yml | 9 +- ...age.node.field_opportunity_attachments.yml | 20 +- ...onomy.vocabulary.az_opportunity_credit.yml | 9 +- .../install/views.view.az_opportunity.yml | 955 ++++++++---------- 19 files changed, 1182 insertions(+), 757 deletions(-) create mode 100644 modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_row_with_background.yml create mode 100644 modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_small_row.yml create mode 100644 modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_attachments.yml create mode 100644 modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_media_image.yml diff --git a/modules/custom/az_opportunity/config/install/core.entity_form_display.node.az_opportunity.default.yml b/modules/custom/az_opportunity/config/install/core.entity_form_display.node.az_opportunity.default.yml index 05ac5fe07c..89357349cb 100644 --- a/modules/custom/az_opportunity/config/install/core.entity_form_display.node.az_opportunity.default.yml +++ b/modules/custom/az_opportunity/config/install/core.entity_form_display.node.az_opportunity.default.yml @@ -4,11 +4,13 @@ dependencies: config: - field.field.node.az_opportunity.field_az_application_date - field.field.node.az_opportunity.field_az_application_link + - field.field.node.az_opportunity.field_az_attachments - field.field.node.az_opportunity.field_az_audiences - field.field.node.az_opportunity.field_az_body - field.field.node.az_opportunity.field_az_credit - field.field.node.az_opportunity.field_az_incentives - field.field.node.az_opportunity.field_az_location + - field.field.node.az_opportunity.field_az_media_image - field.field.node.az_opportunity.field_az_modality - field.field.node.az_opportunity.field_az_offered - field.field.node.az_opportunity.field_az_ongoing @@ -19,14 +21,15 @@ dependencies: - field.field.node.az_opportunity.field_az_topic - field.field.node.az_opportunity.field_az_trellis_id - field.field.node.az_opportunity.field_az_trellis_imported_date - - field.field.node.az_opportunity.field_opportunity_attachments - node.type.az_opportunity module: - datetime - - datetime_range + - file - link - media_library + - media_library_edit - path + - smart_date - text id: node.az_opportunity.default targetEntityType: node @@ -40,22 +43,43 @@ content: settings: { } third_party_settings: { } field_az_application_date: - type: daterange_default + type: smartdate_only weight: 9 region: content - settings: { } + settings: + separator: to + modal: false + default_duration: 60 + default_duration_increments: |- + 30 + 60|1 hour + 90 + 120|2 hours + custom + show_extra: false + hide_date: true + allday: true + remove_seconds: false + duration_overlay: true third_party_settings: { } field_az_application_link: type: link_default - weight: 19 + weight: 21 region: content settings: placeholder_url: '' placeholder_title: '' third_party_settings: { } + field_az_attachments: + type: file_generic + weight: 17 + region: content + settings: + progress_indicator: throbber + third_party_settings: { } field_az_audiences: type: entity_reference_autocomplete - weight: 20 + weight: 22 region: content settings: match_operator: CONTAINS @@ -65,40 +89,47 @@ content: third_party_settings: { } field_az_body: type: text_textarea - weight: 21 + weight: 23 region: content settings: rows: 9 placeholder: '' third_party_settings: { } field_az_credit: - type: entity_reference_autocomplete - weight: 15 + type: string_textfield + weight: 14 region: content settings: - match_operator: CONTAINS - match_limit: 10 size: 60 placeholder: '' third_party_settings: { } field_az_incentives: type: boolean_checkbox - weight: 12 + weight: 13 region: content settings: display_label: true third_party_settings: { } field_az_location: type: link_default - weight: 13 + weight: 15 region: content settings: placeholder_url: '' placeholder_title: '' third_party_settings: { } + field_az_media_image: + type: media_library_widget + weight: 11 + region: content + settings: + media_types: { } + third_party_settings: + media_library_edit: + show_edit: '1' field_az_modality: type: entity_reference_autocomplete - weight: 14 + weight: 16 region: content settings: match_operator: CONTAINS @@ -108,7 +139,7 @@ content: third_party_settings: { } field_az_offered: type: entity_reference_autocomplete - weight: 16 + weight: 18 region: content settings: match_operator: CONTAINS @@ -118,24 +149,38 @@ content: third_party_settings: { } field_az_ongoing: type: boolean_checkbox - weight: 11 + weight: 12 region: content settings: display_label: true third_party_settings: { } field_az_parent_account: type: string_textfield - weight: 23 + weight: 24 region: content settings: size: 60 placeholder: '' third_party_settings: { } field_az_program_date: - type: daterange_default + type: smartdate_only weight: 10 region: content - settings: { } + settings: + separator: to + modal: false + default_duration: 60 + default_duration_increments: |- + 30 + 60|1 hour + 90 + 120|2 hours + custom + show_extra: false + hide_date: true + allday: true + remove_seconds: false + duration_overlay: true third_party_settings: { } field_az_program_length: type: string_textfield @@ -147,7 +192,7 @@ content: third_party_settings: { } field_az_program_website: type: link_default - weight: 18 + weight: 20 region: content settings: placeholder_url: '' @@ -155,7 +200,7 @@ content: third_party_settings: { } field_az_topic: type: entity_reference_autocomplete - weight: 17 + weight: 19 region: content settings: match_operator: CONTAINS @@ -165,7 +210,7 @@ content: third_party_settings: { } field_az_trellis_id: type: string_textfield - weight: 24 + weight: 25 region: content settings: size: 60 @@ -173,17 +218,10 @@ content: third_party_settings: { } field_az_trellis_imported_date: type: datetime_default - weight: 25 + weight: 26 region: content settings: { } third_party_settings: { } - field_opportunity_attachments: - type: media_library_widget - weight: 22 - region: content - settings: - media_types: { } - third_party_settings: { } path: type: path weight: 5 diff --git a/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_card.yml b/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_card.yml index b7ca55f4ba..3a9e84f5c8 100644 --- a/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_card.yml +++ b/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_card.yml @@ -5,11 +5,13 @@ dependencies: - core.entity_view_mode.node.az_card - field.field.node.az_opportunity.field_az_application_date - field.field.node.az_opportunity.field_az_application_link + - field.field.node.az_opportunity.field_az_attachments - field.field.node.az_opportunity.field_az_audiences - field.field.node.az_opportunity.field_az_body - field.field.node.az_opportunity.field_az_credit - field.field.node.az_opportunity.field_az_incentives - field.field.node.az_opportunity.field_az_location + - field.field.node.az_opportunity.field_az_media_image - field.field.node.az_opportunity.field_az_modality - field.field.node.az_opportunity.field_az_offered - field.field.node.az_opportunity.field_az_ongoing @@ -20,7 +22,6 @@ dependencies: - field.field.node.az_opportunity.field_az_topic - field.field.node.az_opportunity.field_az_trellis_id - field.field.node.az_opportunity.field_az_trellis_imported_date - - field.field.node.az_opportunity.field_opportunity_attachments - node.type.az_opportunity module: - datetime_range @@ -35,7 +36,7 @@ third_party_settings: label: col1 parent_name: '' region: hidden - weight: 14 + weight: 19 format_type: html_element format_settings: classes: col @@ -54,7 +55,7 @@ third_party_settings: label: col2 parent_name: '' region: hidden - weight: 15 + weight: 20 format_type: html_element format_settings: classes: col @@ -73,7 +74,7 @@ third_party_settings: label: col3 parent_name: '' region: hidden - weight: 17 + weight: 22 format_type: html_element format_settings: classes: col @@ -92,7 +93,7 @@ third_party_settings: label: col4 parent_name: '' region: hidden - weight: 18 + weight: 23 format_type: html_element format_settings: classes: col @@ -111,7 +112,7 @@ third_party_settings: label: col5 parent_name: '' region: hidden - weight: 19 + weight: 24 format_type: html_element format_settings: classes: col @@ -130,7 +131,7 @@ third_party_settings: label: col6 parent_name: '' region: hidden - weight: 16 + weight: 21 format_type: html_element format_settings: classes: col @@ -149,7 +150,7 @@ third_party_settings: label: col7 parent_name: '' region: hidden - weight: 20 + weight: 25 format_type: html_element format_settings: classes: col7 @@ -168,7 +169,7 @@ third_party_settings: label: col8 parent_name: '' region: hidden - weight: 21 + weight: 26 format_type: html_element format_settings: classes: col @@ -185,10 +186,12 @@ third_party_settings: group_header_row: children: - group_card_clickable + - field_az_program_length + - group_read_more label: 'header row' parent_name: '' - region: content - weight: 0 + region: hidden + weight: 18 format_type: html_element format_settings: classes: row @@ -225,16 +228,13 @@ third_party_settings: group_link: children: - links - - smart_title - - field_az_location - - field_az_application_date - - field_az_program_length - - field_az_offered - - field_az_modality + - field_az_media_image + - group_heading + - group_text_body_secondary label: Link parent_name: group_card_clickable region: content - weight: 1 + weight: 16 format_type: link format_settings: classes: 'card-body p-0 stretched-link link-primary text-decoration-none' @@ -244,11 +244,93 @@ third_party_settings: target: custom_uri custom_uri: '[node:az-canonical-url]' target_attribute: default + group_heading: + children: + - smart_title + label: Heading + parent_name: group_link + region: content + weight: 18 + format_type: html_element + format_settings: + classes: 'card-title text-midnight h5 mb-0' + show_empty_fields: false + id: '' + label_as_html: false + element: h4 + show_label: false + label_element: h3 + label_element_classes: '' + attributes: '' + effect: none + speed: fast + group_text_body_secondary: + children: + - field_az_application_date + - field_az_location + - field_az_offered + - field_az_modality + label: 'Text Body Secondary' + parent_name: group_link + region: content + weight: 19 + format_type: html_element + format_settings: + classes: 'text-body-secondary fw-normal small mt-2' + show_empty_fields: false + id: '' + label_as_html: false + element: div + show_label: false + label_element: h3 + label_element_classes: '' + attributes: '' + effect: none + speed: fast + group_read_more: + children: + - group_read_more_text + label: 'Read more' + parent_name: group_header_row + region: hidden + weight: 6 + format_type: html_element + format_settings: + classes: mt-2 + show_empty_fields: false + id: '' + label_as_html: false + element: div + show_label: false + label_element: h3 + label_element_classes: '' + attributes: '' + effect: none + speed: fast + group_read_more_text: + children: { } + label: 'Read more text' + parent_name: group_read_more + region: hidden + weight: 4 + format_type: html_element + format_settings: + classes: 'text-start hover-text-underline' + show_empty_fields: false + id: '' + label_as_html: false + element: div + show_label: false + label_element: h3 + label_element_classes: '' + attributes: '' + effect: none + speed: fast smart_title: enabled: true settings: - smart_title__link: true - smart_title__tag: h3 + smart_title__link: false + smart_title__tag: '' smart_title__classes: { } id: node.az_opportunity.az_card targetEntityType: node @@ -264,7 +346,7 @@ content: from_to: both separator: '-' third_party_settings: { } - weight: 4 + weight: 2 region: content field_az_location: type: link @@ -278,42 +360,44 @@ content: third_party_settings: { } weight: 3 region: content - field_az_modality: - type: entity_reference_label - label: inline + field_az_media_image: + type: entity_reference_entity_view + label: hidden settings: + view_mode: az_card_image link: false third_party_settings: { } - weight: 7 + weight: 17 region: content - field_az_offered: + field_az_modality: type: entity_reference_label label: inline settings: link: false third_party_settings: { } - weight: 6 + weight: 5 region: content - field_az_program_length: - type: string + field_az_offered: + type: entity_reference_label label: inline settings: - link_to_entity: false + link: false third_party_settings: { } - weight: 5 + weight: 4 region: content links: settings: { } third_party_settings: { } - weight: 1 + weight: 16 region: content smart_title: settings: { } third_party_settings: { } - weight: 2 + weight: 3 region: content hidden: field_az_application_link: true + field_az_attachments: true field_az_audiences: true field_az_body: true field_az_credit: true @@ -321,8 +405,8 @@ hidden: field_az_ongoing: true field_az_parent_account: true field_az_program_date: true + field_az_program_length: true field_az_program_website: true field_az_topic: true field_az_trellis_id: true field_az_trellis_imported_date: true - field_opportunity_attachments: true diff --git a/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_row.yml b/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_row.yml index de21e68c0e..56296ffbe8 100644 --- a/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_row.yml +++ b/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_row.yml @@ -5,11 +5,13 @@ dependencies: - core.entity_view_mode.node.az_row - field.field.node.az_opportunity.field_az_application_date - field.field.node.az_opportunity.field_az_application_link + - field.field.node.az_opportunity.field_az_attachments - field.field.node.az_opportunity.field_az_audiences - field.field.node.az_opportunity.field_az_body - field.field.node.az_opportunity.field_az_credit - field.field.node.az_opportunity.field_az_incentives - field.field.node.az_opportunity.field_az_location + - field.field.node.az_opportunity.field_az_media_image - field.field.node.az_opportunity.field_az_modality - field.field.node.az_opportunity.field_az_offered - field.field.node.az_opportunity.field_az_ongoing @@ -20,7 +22,6 @@ dependencies: - field.field.node.az_opportunity.field_az_topic - field.field.node.az_opportunity.field_az_trellis_id - field.field.node.az_opportunity.field_az_trellis_imported_date - - field.field.node.az_opportunity.field_opportunity_attachments - node.type.az_opportunity module: - datetime_range @@ -99,7 +100,7 @@ third_party_settings: weight: 3 format_type: html_element format_settings: - classes: col-4 + classes: col-3 show_empty_fields: false id: '' label_as_html: false @@ -112,14 +113,14 @@ third_party_settings: speed: fast group_col_2: children: - - field_az_application_date + - field_az_location label: 'col 2' parent_name: group_row region: content weight: 4 format_type: html_element format_settings: - classes: col-3 + classes: col-4 show_empty_fields: false id: '' label_as_html: false @@ -132,8 +133,7 @@ third_party_settings: speed: fast group_col_3: children: - - field_az_location - - field_az_incentives + - field_az_application_date label: 'Col 3' parent_name: group_row region: content @@ -178,6 +178,8 @@ third_party_settings: smart_title__tag: h2 smart_title__classes: - node__title + - h5 + - m-0 id: node.az_opportunity.az_row targetEntityType: node bundle: az_opportunity @@ -188,21 +190,11 @@ content: label: inline settings: timezone_override: '' - format_type: medium + format_type: short from_to: both separator: '-' third_party_settings: { } - weight: 10 - region: content - field_az_incentives: - type: boolean - label: inline - settings: - format: default - format_custom_false: '' - format_custom_true: '' - third_party_settings: { } - weight: 12 + weight: 13 region: content field_az_location: type: link @@ -237,9 +229,12 @@ content: region: content hidden: field_az_application_link: true + field_az_attachments: true field_az_audiences: true field_az_body: true field_az_credit: true + field_az_incentives: true + field_az_media_image: true field_az_modality: true field_az_offered: true field_az_ongoing: true @@ -249,4 +244,3 @@ hidden: field_az_program_website: true field_az_trellis_id: true field_az_trellis_imported_date: true - field_opportunity_attachments: true diff --git a/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_row_with_background.yml b/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_row_with_background.yml new file mode 100644 index 0000000000..fccc03aff7 --- /dev/null +++ b/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_row_with_background.yml @@ -0,0 +1,66 @@ +langcode: en +status: false +dependencies: + config: + - core.entity_view_mode.node.az_row_with_background + - field.field.node.az_opportunity.field_az_application_date + - field.field.node.az_opportunity.field_az_application_link + - field.field.node.az_opportunity.field_az_attachments + - field.field.node.az_opportunity.field_az_audiences + - field.field.node.az_opportunity.field_az_body + - field.field.node.az_opportunity.field_az_credit + - field.field.node.az_opportunity.field_az_incentives + - field.field.node.az_opportunity.field_az_location + - field.field.node.az_opportunity.field_az_media_image + - field.field.node.az_opportunity.field_az_modality + - field.field.node.az_opportunity.field_az_offered + - field.field.node.az_opportunity.field_az_ongoing + - field.field.node.az_opportunity.field_az_parent_account + - field.field.node.az_opportunity.field_az_program_date + - field.field.node.az_opportunity.field_az_program_length + - field.field.node.az_opportunity.field_az_program_website + - field.field.node.az_opportunity.field_az_topic + - field.field.node.az_opportunity.field_az_trellis_id + - field.field.node.az_opportunity.field_az_trellis_imported_date + - node.type.az_opportunity + module: + - user +id: node.az_opportunity.az_row_with_background +targetEntityType: node +bundle: az_opportunity +mode: az_row_with_background +content: + field_az_media_image: + type: entity_reference_entity_view + label: hidden + settings: + view_mode: az_card_image + link: false + third_party_settings: { } + weight: 2 + region: content + links: + settings: { } + third_party_settings: { } + weight: 100 + region: content +hidden: + field_az_application_date: true + field_az_application_link: true + field_az_attachments: true + field_az_audiences: true + field_az_body: true + field_az_credit: true + field_az_incentives: true + field_az_location: true + field_az_modality: true + field_az_offered: true + field_az_ongoing: true + field_az_parent_account: true + field_az_program_date: true + field_az_program_length: true + field_az_program_website: true + field_az_topic: true + field_az_trellis_id: true + field_az_trellis_imported_date: true + smart_title: true diff --git a/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_small_row.yml b/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_small_row.yml new file mode 100644 index 0000000000..7e845add81 --- /dev/null +++ b/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_small_row.yml @@ -0,0 +1,258 @@ +langcode: en +status: true +dependencies: + config: + - core.entity_view_mode.node.az_small_row + - field.field.node.az_opportunity.field_az_application_date + - field.field.node.az_opportunity.field_az_application_link + - field.field.node.az_opportunity.field_az_attachments + - field.field.node.az_opportunity.field_az_audiences + - field.field.node.az_opportunity.field_az_body + - field.field.node.az_opportunity.field_az_credit + - field.field.node.az_opportunity.field_az_incentives + - field.field.node.az_opportunity.field_az_location + - field.field.node.az_opportunity.field_az_media_image + - field.field.node.az_opportunity.field_az_modality + - field.field.node.az_opportunity.field_az_offered + - field.field.node.az_opportunity.field_az_ongoing + - field.field.node.az_opportunity.field_az_parent_account + - field.field.node.az_opportunity.field_az_program_date + - field.field.node.az_opportunity.field_az_program_length + - field.field.node.az_opportunity.field_az_program_website + - field.field.node.az_opportunity.field_az_topic + - field.field.node.az_opportunity.field_az_trellis_id + - field.field.node.az_opportunity.field_az_trellis_imported_date + - node.type.az_opportunity + module: + - datetime_range + - field_group + - smart_title + - user +third_party_settings: + field_group: + group_col1: + children: + - smart_title + label: col1 + parent_name: group_header_row + region: content + weight: 7 + format_type: html_element + format_settings: + classes: col + show_empty_fields: false + id: '' + label_as_html: true + element: div + show_label: false + label_element: h3 + label_element_classes: '' + attributes: '' + effect: none + speed: fast + group_col2: + children: + - field_az_application_date + label: col2 + parent_name: group_header_row + region: content + weight: 8 + format_type: html_element + format_settings: + classes: col + show_empty_fields: false + id: '' + label_as_html: false + element: div + show_label: false + label_element: h3 + label_element_classes: '' + attributes: '' + effect: none + speed: fast + group_col3: + children: { } + label: col3 + parent_name: '' + region: hidden + weight: 20 + format_type: html_element + format_settings: + classes: col + show_empty_fields: false + id: '' + label_as_html: false + element: div + show_label: false + label_element: h3 + label_element_classes: '' + attributes: '' + effect: none + speed: fast + group_col4: + children: { } + label: col4 + parent_name: '' + region: hidden + weight: 21 + format_type: html_element + format_settings: + classes: col + show_empty_fields: false + id: '' + label_as_html: false + element: div + show_label: false + label_element: h3 + label_element_classes: '' + attributes: '' + effect: none + speed: fast + group_col5: + children: { } + label: col5 + parent_name: '' + region: hidden + weight: 22 + format_type: html_element + format_settings: + classes: col + show_empty_fields: false + id: '' + label_as_html: false + element: div + show_label: false + label_element: h3 + label_element_classes: '' + attributes: '' + effect: none + speed: fast + group_col6: + children: { } + label: col6 + parent_name: '' + region: hidden + weight: 23 + format_type: html_element + format_settings: + classes: col + show_empty_fields: false + id: '' + label_as_html: false + element: div + show_label: false + label_element: h3 + label_element_classes: '' + attributes: '' + effect: none + speed: fast + group_col7: + children: { } + label: col7 + parent_name: '' + region: hidden + weight: 24 + format_type: html_element + format_settings: + classes: col7 + show_empty_fields: false + id: '' + label_as_html: false + element: div + show_label: false + label_element: h3 + label_element_classes: '' + attributes: '' + effect: none + speed: fast + group_col8: + children: { } + label: col8 + parent_name: '' + region: hidden + weight: 25 + format_type: html_element + format_settings: + classes: col + show_empty_fields: false + id: '' + label_as_html: false + element: div + show_label: false + label_element: h3 + label_element_classes: '' + attributes: '' + effect: none + speed: fast + group_header_row: + children: + - group_col1 + - group_col2 + label: 'header row' + parent_name: '' + region: content + weight: 0 + format_type: html_element + format_settings: + classes: row + show_empty_fields: false + id: '' + label_as_html: false + element: div + show_label: false + label_element: h3 + label_element_classes: '' + attributes: '' + effect: none + speed: fast + smart_title: + enabled: true + settings: + smart_title__link: true + smart_title__tag: h5 + smart_title__classes: + - node__title + - fw-bold + - mt-0 + - mb-0 +id: node.az_opportunity.az_small_row +targetEntityType: node +bundle: az_opportunity +mode: az_small_row +content: + field_az_application_date: + type: daterange_default + label: hidden + settings: + timezone_override: '' + format_type: short + from_to: both + separator: '-' + third_party_settings: { } + weight: 5 + region: content + smart_title: + settings: { } + third_party_settings: { } + weight: 6 + region: content +hidden: + field_az_application_link: true + field_az_attachments: true + field_az_audiences: true + field_az_body: true + field_az_credit: true + field_az_incentives: true + field_az_location: true + field_az_media_image: true + field_az_modality: true + field_az_offered: true + field_az_ongoing: true + field_az_parent_account: true + field_az_program_date: true + field_az_program_length: true + field_az_program_website: true + field_az_topic: true + field_az_trellis_id: true + field_az_trellis_imported_date: true + links: true diff --git a/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.default.yml b/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.default.yml index fb94810318..e7ec8e2aa6 100644 --- a/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.default.yml +++ b/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.default.yml @@ -4,11 +4,13 @@ dependencies: config: - field.field.node.az_opportunity.field_az_application_date - field.field.node.az_opportunity.field_az_application_link + - field.field.node.az_opportunity.field_az_attachments - field.field.node.az_opportunity.field_az_audiences - field.field.node.az_opportunity.field_az_body - field.field.node.az_opportunity.field_az_credit - field.field.node.az_opportunity.field_az_incentives - field.field.node.az_opportunity.field_az_location + - field.field.node.az_opportunity.field_az_media_image - field.field.node.az_opportunity.field_az_modality - field.field.node.az_opportunity.field_az_offered - field.field.node.az_opportunity.field_az_ongoing @@ -19,11 +21,11 @@ dependencies: - field.field.node.az_opportunity.field_az_topic - field.field.node.az_opportunity.field_az_trellis_id - field.field.node.az_opportunity.field_az_trellis_imported_date - - field.field.node.az_opportunity.field_opportunity_attachments - node.type.az_opportunity module: - datetime_range - field_group + - file - link - smart_title - text @@ -32,6 +34,7 @@ third_party_settings: field_group: group_col1: children: + - group_where - field_az_location label: col1 parent_name: group_header_row @@ -46,12 +49,13 @@ third_party_settings: element: div show_label: false label_element: h3 - label_element_classes: '' + label_element_classes: Where attributes: '' effect: none speed: fast group_col2: children: + - group_date - field_az_application_date label: col2 parent_name: group_header_row @@ -72,6 +76,7 @@ third_party_settings: speed: fast group_col3: children: + - group_program_length - field_az_program_length label: col3 parent_name: group_header_row @@ -92,8 +97,9 @@ third_party_settings: speed: fast group_col4: children: - - field_az_offered + - group_modality - field_az_modality + - field_az_offered label: col4 parent_name: group_header_row region: content @@ -113,6 +119,7 @@ third_party_settings: speed: fast group_col5: children: + - group_incentives - field_az_incentives - field_az_credit label: col5 @@ -134,7 +141,8 @@ third_party_settings: speed: fast group_col6: children: - - field_az_topic + - group_audiences + - field_az_audiences label: col6 parent_name: group_header_row region: content @@ -157,7 +165,7 @@ third_party_settings: label: col7 parent_name: '' region: hidden - weight: 12 + weight: 14 format_type: html_element format_settings: classes: col7 @@ -176,7 +184,7 @@ third_party_settings: label: col8 parent_name: '' region: hidden - weight: 13 + weight: 15 format_type: html_element format_settings: classes: col @@ -204,7 +212,7 @@ third_party_settings: weight: 0 format_type: html_element format_settings: - classes: row + classes: 'row text-bg-cool-gray rounded pb-4 mb-4' show_empty_fields: false id: '' label_as_html: false @@ -215,6 +223,120 @@ third_party_settings: attributes: '' effect: none speed: fast + group_where: + children: { } + label: Where + parent_name: group_col1 + region: content + weight: 5 + format_type: html_element + format_settings: + classes: '' + show_empty_fields: true + id: '' + label_as_html: false + element: h4 + show_label: true + label_element: Where + label_element_classes: '' + attributes: '' + effect: none + speed: fast + group_date: + children: { } + label: Date + parent_name: group_col2 + region: content + weight: 14 + format_type: html_element + format_settings: + classes: '' + show_empty_fields: true + id: '' + label_as_html: false + element: h4 + show_label: true + label_element: Date + label_element_classes: '' + attributes: '' + effect: none + speed: fast + group_modality: + children: { } + label: Modality + parent_name: group_col4 + region: content + weight: 9 + format_type: html_element + format_settings: + classes: '' + show_empty_fields: true + id: '' + label_as_html: false + element: h4 + show_label: true + label_element: Modality + label_element_classes: '' + attributes: '' + effect: none + speed: fast + group_incentives: + children: { } + label: Incentives + parent_name: group_col5 + region: content + weight: 2 + format_type: html_element + format_settings: + classes: '' + show_empty_fields: true + id: '' + label_as_html: false + element: h4 + show_label: true + label_element: Incentives + label_element_classes: '' + attributes: '' + effect: none + speed: fast + group_audiences: + children: { } + label: Audiences + parent_name: group_col6 + region: content + weight: 3 + format_type: html_element + format_settings: + classes: '' + show_empty_fields: true + id: '' + label_as_html: false + element: h4 + show_label: true + label_element: Audiences + label_element_classes: '' + attributes: '' + effect: none + speed: fast + group_program_length: + children: { } + label: Length + parent_name: group_col3 + region: content + weight: 9 + format_type: html_element + format_settings: + classes: '' + show_empty_fields: true + id: '' + label_as_html: false + element: h4 + show_label: true + label_element: Length + label_element_classes: '' + attributes: '' + effect: none + speed: fast smart_title: enabled: false id: node.az_opportunity.default @@ -224,14 +346,14 @@ mode: default content: field_az_application_date: type: daterange_default - label: above + label: hidden settings: timezone_override: '' format_type: html_date from_to: both separator: '-' third_party_settings: { } - weight: 5 + weight: 15 region: content field_az_application_link: type: link @@ -243,36 +365,52 @@ content: rel: '' target: '' third_party_settings: { } - weight: 5 + weight: 7 + region: content + field_az_attachments: + type: file_default + label: hidden + settings: + use_description_as_link_text: true + third_party_settings: { } + weight: 4 + region: content + field_az_audiences: + type: entity_reference_label + label: hidden + settings: + link: true + third_party_settings: { } + weight: 4 region: content field_az_body: type: text_default - label: hidden + label: above settings: { } third_party_settings: { } - weight: 1 + weight: 3 region: content field_az_credit: - type: entity_reference_label + type: string label: hidden settings: - link: false + link_to_entity: false third_party_settings: { } - weight: 9 + weight: 5 region: content field_az_incentives: type: boolean - label: above + label: hidden settings: format: default format_custom_false: '' format_custom_true: '' third_party_settings: { } - weight: 8 + weight: 4 region: content field_az_location: type: link_separate - label: above + label: hidden settings: trim_length: 80 url_only: false @@ -280,7 +418,15 @@ content: rel: '' target: '' third_party_settings: { } - weight: 7 + weight: 6 + region: content + field_az_media_image: + type: entity_reference_label + label: hidden + settings: + link: true + third_party_settings: { } + weight: 8 region: content field_az_modality: type: entity_reference_label @@ -288,23 +434,23 @@ content: settings: link: false third_party_settings: { } - weight: 8 + weight: 10 region: content field_az_offered: type: entity_reference_label - label: above + label: hidden settings: link: false third_party_settings: { } - weight: 7 + weight: 11 region: content field_az_program_length: type: string - label: above + label: hidden settings: link_to_entity: false third_party_settings: { } - weight: 8 + weight: 10 region: content field_az_program_website: type: link @@ -316,33 +462,23 @@ content: rel: '' target: '' third_party_settings: { } - weight: 4 + weight: 6 region: content field_az_topic: type: entity_reference_entity_view - label: above + label: hidden settings: view_mode: az_badge link: false third_party_settings: { } - weight: 7 - region: content - field_opportunity_attachments: - type: entity_reference_entity_view - label: above - settings: - view_mode: default - link: false - third_party_settings: { } - weight: 3 + weight: 1 region: content links: settings: { } third_party_settings: { } - weight: 2 + weight: 5 region: content hidden: - field_az_audiences: true field_az_ongoing: true field_az_parent_account: true field_az_program_date: true diff --git a/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_application_date.yml b/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_application_date.yml index a912e9c518..d721c9f948 100644 --- a/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_application_date.yml +++ b/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_application_date.yml @@ -14,7 +14,12 @@ label: 'Application Date' description: 'An Application Date is when this opportunity is active for applications.' required: false translatable: false -default_value: { } +default_value: + - + default_date_type: now + default_date: now + default_end_date_type: now + default_end_date: now default_value_callback: '' settings: { } field_type: daterange diff --git a/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_attachments.yml b/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_attachments.yml new file mode 100644 index 0000000000..f5bcb12f1f --- /dev/null +++ b/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_attachments.yml @@ -0,0 +1,26 @@ +langcode: en +status: true +dependencies: + config: + - field.storage.node.field_az_attachments + - node.type.az_opportunity + module: + - file +id: node.az_opportunity.field_az_attachments +field_name: field_az_attachments +entity_type: node +bundle: az_opportunity +label: Attachments +description: '' +required: false +translatable: false +default_value: { } +default_value_callback: '' +settings: + handler: 'default:file' + handler_settings: { } + file_directory: documents + file_extensions: pdf + max_filesize: '10 MB' + description_field: true +field_type: file diff --git a/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_body.yml b/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_body.yml index 99d7b2958b..9a947eb828 100644 --- a/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_body.yml +++ b/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_body.yml @@ -11,7 +11,7 @@ id: node.az_opportunity.field_az_body field_name: field_az_body entity_type: node bundle: az_opportunity -label: 'Opportunity Description' +label: Overview description: 'White text will be highlighted in gray (only while editing) to keep the text visible.' required: false translatable: false diff --git a/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_credit.yml b/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_credit.yml index db53ee7b85..de6c3577ed 100644 --- a/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_credit.yml +++ b/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_credit.yml @@ -4,25 +4,15 @@ dependencies: config: - field.storage.node.field_az_credit - node.type.az_opportunity - - taxonomy.vocabulary.az_opportunity_credit id: node.az_opportunity.field_az_credit field_name: field_az_credit entity_type: node bundle: az_opportunity label: Credit -description: 'Does this opportunity earn Credits?' +description: 'Whether this opportunity earns university credit.' required: false translatable: false default_value: { } default_value_callback: '' -settings: - handler: 'default:taxonomy_term' - handler_settings: - target_bundles: - az_opportunity_credit: az_opportunity_credit - sort: - field: name - direction: asc - auto_create: true - auto_create_bundle: '' -field_type: entity_reference +settings: { } +field_type: string diff --git a/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_incentives.yml b/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_incentives.yml index de62e34e73..0c17dc6b62 100644 --- a/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_incentives.yml +++ b/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_incentives.yml @@ -15,6 +15,6 @@ translatable: false default_value: { } default_value_callback: '' settings: - on_label: 'Yes' - off_label: 'No' + on_label: 'Has incentives' + off_label: 'No incentives' field_type: boolean diff --git a/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_location.yml b/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_location.yml index 3656bea942..99b5d34ab4 100644 --- a/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_location.yml +++ b/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_location.yml @@ -14,7 +14,12 @@ label: Where description: "To link to an online map for the location, enter a URL above.
\r\nOtherwise, enter <nolink> in the URL field and enter the location name or address in the Link text field.
\r\nCampus Map: https://map.arizona.edu
\r\nGoogle Maps: https://maps.google.com" required: false translatable: false -default_value: { } +default_value: + - + attributes: { } + uri: 'route:' + title: '' + options: { } default_value_callback: '' settings: title: 1 diff --git a/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_media_image.yml b/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_media_image.yml new file mode 100644 index 0000000000..d58ab01079 --- /dev/null +++ b/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_media_image.yml @@ -0,0 +1,28 @@ +langcode: en +status: true +dependencies: + config: + - field.storage.node.field_az_media_image + - media.type.az_image + - node.type.az_opportunity +id: node.az_opportunity.field_az_media_image +field_name: field_az_media_image +entity_type: node +bundle: az_opportunity +label: Photo +description: '' +required: false +translatable: false +default_value: { } +default_value_callback: '' +settings: + handler: 'default:media' + handler_settings: + target_bundles: + az_image: az_image + sort: + field: _none + direction: ASC + auto_create: false + auto_create_bundle: '' +field_type: entity_reference diff --git a/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_program_date.yml b/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_program_date.yml index 1f1e6a6960..e9058e5a4d 100644 --- a/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_program_date.yml +++ b/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_program_date.yml @@ -14,7 +14,12 @@ label: 'Program Date' description: 'The Program Date, or the Account Date, that the program is active.' required: false translatable: false -default_value: { } +default_value: + - + default_date_type: now + default_date: now + default_end_date_type: now + default_end_date: now default_value_callback: '' settings: { } field_type: daterange diff --git a/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_opportunity_attachments.yml b/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_opportunity_attachments.yml index f99768de19..6578fd5a5c 100644 --- a/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_opportunity_attachments.yml +++ b/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_opportunity_attachments.yml @@ -1,30 +1 @@ -langcode: en -status: true -dependencies: - config: - - field.storage.node.field_opportunity_attachments - - media.type.az_document - - media.type.az_image - - node.type.az_opportunity -id: node.az_opportunity.field_opportunity_attachments -field_name: field_opportunity_attachments -entity_type: node -bundle: az_opportunity -label: 'Opportunity Attachments' -description: 'Add an document or flyer.' -required: false -translatable: false -default_value: { } -default_value_callback: '' -settings: - handler: 'default:media' - handler_settings: - target_bundles: - az_document: az_document - az_image: az_image - sort: - field: _none - direction: ASC - auto_create: false - auto_create_bundle: az_document -field_type: entity_reference +{ } diff --git a/modules/custom/az_opportunity/config/install/field.storage.node.field_az_credit.yml b/modules/custom/az_opportunity/config/install/field.storage.node.field_az_credit.yml index 6c3742abfc..2c11b0e58d 100644 --- a/modules/custom/az_opportunity/config/install/field.storage.node.field_az_credit.yml +++ b/modules/custom/az_opportunity/config/install/field.storage.node.field_az_credit.yml @@ -3,16 +3,17 @@ status: true dependencies: module: - node - - taxonomy id: node.field_az_credit field_name: field_az_credit entity_type: node -type: entity_reference +type: string settings: - target_type: taxonomy_term + max_length: 255 + case_sensitive: false + is_ascii: false module: core locked: false -cardinality: -1 +cardinality: 1 translatable: true indexes: { } persist_with_no_fields: false diff --git a/modules/custom/az_opportunity/config/install/field.storage.node.field_opportunity_attachments.yml b/modules/custom/az_opportunity/config/install/field.storage.node.field_opportunity_attachments.yml index 7a9528c875..6578fd5a5c 100644 --- a/modules/custom/az_opportunity/config/install/field.storage.node.field_opportunity_attachments.yml +++ b/modules/custom/az_opportunity/config/install/field.storage.node.field_opportunity_attachments.yml @@ -1,19 +1 @@ -langcode: en -status: true -dependencies: - module: - - media - - node -id: node.field_opportunity_attachments -field_name: field_opportunity_attachments -entity_type: node -type: entity_reference -settings: - target_type: media -module: core -locked: false -cardinality: 1 -translatable: true -indexes: { } -persist_with_no_fields: false -custom_storage: false +{ } diff --git a/modules/custom/az_opportunity/config/install/taxonomy.vocabulary.az_opportunity_credit.yml b/modules/custom/az_opportunity/config/install/taxonomy.vocabulary.az_opportunity_credit.yml index 227cfb6393..6578fd5a5c 100644 --- a/modules/custom/az_opportunity/config/install/taxonomy.vocabulary.az_opportunity_credit.yml +++ b/modules/custom/az_opportunity/config/install/taxonomy.vocabulary.az_opportunity_credit.yml @@ -1,8 +1 @@ -langcode: en -status: true -dependencies: { } -name: 'Opportunity Credit' -vid: az_opportunity_credit -description: 'Taxonomy for the Opportunity content type' -weight: 0 -new_revision: false +{ } diff --git a/modules/custom/az_opportunity/config/install/views.view.az_opportunity.yml b/modules/custom/az_opportunity/config/install/views.view.az_opportunity.yml index d53d63e485..1755cef6b8 100644 --- a/modules/custom/az_opportunity/config/install/views.view.az_opportunity.yml +++ b/modules/custom/az_opportunity/config/install/views.view.az_opportunity.yml @@ -4,23 +4,17 @@ dependencies: config: - core.entity_view_mode.node.az_card - core.entity_view_mode.node.az_row - - field.storage.node.field_az_application_date - - field.storage.node.field_az_incentives - - field.storage.node.field_az_location - - field.storage.node.field_az_modality - - field.storage.node.field_az_offered - - field.storage.node.field_az_topic + - core.entity_view_mode.node.az_small_row - node.type.az_opportunity - taxonomy.vocabulary.az_opportunity_modality - taxonomy.vocabulary.az_opportunity_semester - taxonomy.vocabulary.az_opportunity_topic module: - datetime - - datetime_range - - link - node - taxonomy - user + - views_bootstrap id: az_opportunity label: 'AZ Opportunity' module: views @@ -197,11 +191,18 @@ display: value: az_opportunity: az_opportunity style: - type: default + type: views_bootstrap_grid options: row_class: '' default_row_class: true uses_fields: false + grid_class: '' + col_xs: col-1 + col_sm: col-sm-1 + col_md: col-md-4 + col_lg: col-lg-4 + col_xl: col-xl-4 + col_xxl: col-xxl-4 row: type: 'entity:node' options: @@ -231,7 +232,7 @@ display: tags: { } block_1: id: block_1 - display_title: 'Row View' + display_title: 'Small Row View' display_plugin: block position: 1 display_options: @@ -245,7 +246,7 @@ display: type: 'entity:node' options: relationship: none - view_mode: az_row + view_mode: az_small_row defaults: style: false style_options: false @@ -265,11 +266,32 @@ display: tags: { } block_2: id: block_2 - display_title: 'Filtered Table View' + display_title: 'Row View with Filter' display_plugin: block position: 1 display_options: - fields: + filters: + status: + id: status + table: node_field_data + field: status + entity_type: node + entity_field: status + plugin_id: boolean + value: '1' + group: 1 + expose: + operator: '' + type: + id: type + table: node_field_data + field: type + entity_type: node + entity_field: type + plugin_id: bundle + value: + az_opportunity: az_opportunity + group: 1 title: id: title table: node_field_data @@ -279,449 +301,308 @@ display: admin_label: '' entity_type: node entity_field: title - plugin_id: field - label: Title - exclude: false - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: false - ellipsis: false - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: false - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - click_sort_column: value - type: string - settings: - link_to_entity: true - group_column: value - group_columns: { } - group_rows: true - delta_limit: 0 - delta_offset: 0 - delta_reversed: false - delta_first_last: false - multi_type: separator - separator: ', ' - field_api_classes: false - field_az_application_date: - id: field_az_application_date - table: node__field_az_application_date - field: field_az_application_date + plugin_id: string + operator: '=' + value: '' + group: 1 + exposed: true + expose: + operator_id: title_op + label: Title + description: '' + use_operator: false + operator: title_op + operator_limit_selection: false + operator_list: { } + identifier: title + required: false + remember: false + multiple: false + remember_roles: + authenticated: authenticated + placeholder: '' + is_grouped: false + group_info: + label: '' + description: '' + identifier: '' + optional: true + widget: select + multiple: false + remember: false + default_group: All + default_group_multiple: { } + group_items: { } + field_az_location_options: + id: field_az_location_options + table: node__field_az_location + field: field_az_location_options relationship: none group_type: group admin_label: '' - plugin_id: field - label: 'Application Date' - exclude: false - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: false - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - click_sort_column: value - type: daterange_default - settings: - timezone_override: '' - format_type: html_date - from_to: both - separator: '-' - group_column: value - group_columns: { } - group_rows: true - delta_limit: 0 - delta_offset: 0 - delta_reversed: false - delta_first_last: false - multi_type: separator - separator: ', ' - field_api_classes: false - field_az_incentives: - id: field_az_incentives - table: node__field_az_incentives - field: field_az_incentives + plugin_id: string + operator: '=' + value: '' + group: 1 + exposed: true + expose: + operator_id: field_az_location_options_op + label: Where + description: '' + use_operator: false + operator: field_az_location_options_op + operator_limit_selection: false + operator_list: { } + identifier: field_az_location_options + required: false + remember: false + multiple: false + remember_roles: + authenticated: authenticated + placeholder: '' + is_grouped: false + group_info: + label: '' + description: '' + identifier: '' + optional: true + widget: select + multiple: false + remember: false + default_group: All + default_group_multiple: { } + group_items: { } + field_az_topic_target_id: + id: field_az_topic_target_id + table: node__field_az_topic + field: field_az_topic_target_id relationship: none group_type: group admin_label: '' - plugin_id: field - label: Incentives - exclude: false - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: false - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - click_sort_column: value - type: boolean - settings: - format: default - format_custom_false: '' - format_custom_true: '' - group_column: value - group_columns: { } - group_rows: true - delta_limit: 0 - delta_offset: 0 - delta_reversed: false - delta_first_last: false - multi_type: separator - separator: ', ' - field_api_classes: false - field_az_modality: - id: field_az_modality + plugin_id: taxonomy_index_tid + operator: or + value: { } + group: 1 + exposed: true + expose: + operator_id: field_az_topic_target_id_op + label: Topic + description: '' + use_operator: false + operator: field_az_topic_target_id_op + operator_limit_selection: false + operator_list: { } + identifier: field_az_topic_target_id + required: false + remember: false + multiple: false + remember_roles: + authenticated: authenticated + reduce: false + is_grouped: false + group_info: + label: '' + description: '' + identifier: '' + optional: true + widget: select + multiple: false + remember: false + default_group: All + default_group_multiple: { } + group_items: { } + reduce_duplicates: false + vid: az_opportunity_topic + type: select + hierarchy: false + limit: true + error_message: true + field_az_modality_target_id: + id: field_az_modality_target_id table: node__field_az_modality - field: field_az_modality + field: field_az_modality_target_id relationship: none group_type: group admin_label: '' - plugin_id: field - label: Modality - exclude: false - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: false - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - click_sort_column: target_id - type: entity_reference_label - settings: - link: true - group_column: target_id - group_columns: { } - group_rows: true - delta_limit: 0 - delta_offset: 0 - delta_reversed: false - delta_first_last: false - multi_type: separator - separator: ', ' - field_api_classes: false - field_az_offered: - id: field_az_offered + plugin_id: taxonomy_index_tid + operator: or + value: { } + group: 1 + exposed: true + expose: + operator_id: field_az_modality_target_id_op + label: Modality + description: '' + use_operator: false + operator: field_az_modality_target_id_op + operator_limit_selection: false + operator_list: { } + identifier: field_az_modality_target_id + required: false + remember: false + multiple: false + remember_roles: + authenticated: authenticated + reduce: false + is_grouped: false + group_info: + label: '' + description: '' + identifier: '' + optional: true + widget: select + multiple: false + remember: false + default_group: All + default_group_multiple: { } + group_items: { } + reduce_duplicates: false + vid: az_opportunity_modality + type: select + hierarchy: false + limit: true + error_message: true + field_az_offered_target_id: + id: field_az_offered_target_id table: node__field_az_offered - field: field_az_offered - relationship: none - group_type: group - admin_label: '' - plugin_id: field - label: Offered - exclude: false - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: false - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - click_sort_column: target_id - type: entity_reference_label - settings: - link: true - group_column: target_id - group_columns: { } - group_rows: true - delta_limit: 0 - delta_offset: 0 - delta_reversed: false - delta_first_last: false - multi_type: separator - separator: ', ' - field_api_classes: false - field_az_topic: - id: field_az_topic - table: node__field_az_topic - field: field_az_topic + field: field_az_offered_target_id relationship: none group_type: group admin_label: '' - plugin_id: field - label: Topic - exclude: false - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: false - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - click_sort_column: target_id - type: entity_reference_entity_view - settings: - view_mode: az_badge - group_column: target_id - group_columns: { } - group_rows: true - delta_limit: 0 - delta_offset: 0 - delta_reversed: false - delta_first_last: false - multi_type: separator - separator: ', ' - field_api_classes: false - field_az_location: - id: field_az_location - table: node__field_az_location - field: field_az_location + plugin_id: taxonomy_index_tid + operator: or + value: { } + group: 1 + exposed: true + expose: + operator_id: field_az_offered_target_id_op + label: Offered + description: '' + use_operator: false + operator: field_az_offered_target_id_op + operator_limit_selection: false + operator_list: { } + identifier: field_az_offered_target_id + required: false + remember: false + multiple: false + remember_roles: + authenticated: authenticated + reduce: false + is_grouped: false + group_info: + label: '' + description: '' + identifier: '' + optional: true + widget: select + multiple: false + remember: false + default_group: All + default_group_multiple: { } + group_items: { } + reduce_duplicates: false + vid: az_opportunity_semester + type: select + hierarchy: false + limit: true + error_message: true + field_az_incentives_value: + id: field_az_incentives_value + table: node__field_az_incentives + field: field_az_incentives_value relationship: none group_type: group admin_label: '' - plugin_id: field - label: Where - exclude: false - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: false - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - click_sort_column: uri - type: link - settings: - trim_length: 80 - url_only: false - url_plain: false - rel: '0' - target: '0' - group_column: '' - group_columns: { } - group_rows: true - delta_limit: 0 - delta_offset: 0 - delta_reversed: false - delta_first_last: false - multi_type: separator - separator: ', ' - field_api_classes: false + plugin_id: boolean + operator: '=' + value: All + group: 1 + exposed: true + expose: + operator_id: '' + label: Incentives + description: '' + use_operator: false + operator: field_az_incentives_value_op + operator_limit_selection: false + operator_list: { } + identifier: field_az_incentives_value + required: false + remember: false + multiple: false + remember_roles: + authenticated: authenticated + is_grouped: false + group_info: + label: '' + description: '' + identifier: '' + optional: true + widget: select + multiple: false + remember: false + default_group: All + default_group_multiple: { } + group_items: { } + filter_groups: + operator: AND + groups: + 1: AND + style: + type: default + options: + row_class: '' + default_row_class: true + uses_fields: false + row: + type: 'entity:node' + options: + relationship: none + view_mode: az_row + defaults: + style: false + style_options: false + row: false + filters: false + filter_groups: false + display_description: '' + style_options: null + display_extenders: { } + cache_metadata: + max-age: -1 + contexts: + - 'languages:language_content' + - 'languages:language_interface' + - url + - url.query_args + - 'user.node_grants:view' + - user.permissions + tags: { } + block_3: + id: block_3 + display_title: 'Card View' + display_plugin: block + position: 1 + display_options: + display_description: '' + display_extenders: { } + cache_metadata: + max-age: -1 + contexts: + - 'languages:language_content' + - 'languages:language_interface' + - url + - url.query_args + - 'user.node_grants:view' + - user.permissions + tags: { } + block_6: + id: block_6 + display_title: 'Card View with Filter' + display_plugin: block + position: 1 + display_options: filters: status: id: status @@ -743,6 +624,7 @@ display: plugin_id: bundle value: az_opportunity: az_opportunity + group: 1 title: id: title table: node_field_data @@ -753,7 +635,7 @@ display: entity_type: node entity_field: title plugin_id: string - operator: contains + operator: '=' value: '' group: 1 exposed: true @@ -784,32 +666,72 @@ display: default_group: All default_group_multiple: { } group_items: { } - field_az_incentives_value: - id: field_az_incentives_value - table: node__field_az_incentives - field: field_az_incentives_value + field_az_location_options: + id: field_az_location_options + table: node__field_az_location + field: field_az_location_options relationship: none group_type: group admin_label: '' - plugin_id: boolean + plugin_id: string operator: '=' - value: All + value: '' group: 1 exposed: true expose: - operator_id: '' - label: Incentives + operator_id: field_az_location_options_op + label: Where description: '' use_operator: false - operator: field_az_incentives_value_op + operator: field_az_location_options_op operator_limit_selection: false operator_list: { } - identifier: field_az_incentives_value + identifier: field_az_location_options + required: false + remember: false + multiple: false + remember_roles: + authenticated: authenticated + placeholder: '' + is_grouped: false + group_info: + label: '' + description: '' + identifier: '' + optional: true + widget: select + multiple: false + remember: false + default_group: All + default_group_multiple: { } + group_items: { } + field_az_topic_target_id: + id: field_az_topic_target_id + table: node__field_az_topic + field: field_az_topic_target_id + relationship: none + group_type: group + admin_label: '' + plugin_id: taxonomy_index_tid + operator: or + value: { } + group: 1 + exposed: true + expose: + operator_id: field_az_topic_target_id_op + label: Topic + description: '' + use_operator: false + operator: field_az_topic_target_id_op + operator_limit_selection: false + operator_list: { } + identifier: field_az_topic_target_id required: false remember: false multiple: false remember_roles: authenticated: authenticated + reduce: false is_grouped: false group_info: label: '' @@ -822,6 +744,12 @@ display: default_group: All default_group_multiple: { } group_items: { } + reduce_duplicates: false + vid: az_opportunity_topic + type: select + hierarchy: false + limit: true + error_message: true field_az_modality_target_id: id: field_az_modality_target_id table: node__field_az_modality @@ -912,33 +840,32 @@ display: hierarchy: false limit: true error_message: true - field_az_topic_target_id: - id: field_az_topic_target_id - table: node__field_az_topic - field: field_az_topic_target_id + field_az_incentives_value: + id: field_az_incentives_value + table: node__field_az_incentives + field: field_az_incentives_value relationship: none group_type: group admin_label: '' - plugin_id: taxonomy_index_tid - operator: or - value: { } + plugin_id: boolean + operator: '=' + value: All group: 1 exposed: true expose: - operator_id: field_az_topic_target_id_op - label: Topic + operator_id: '' + label: Incentives description: '' use_operator: false - operator: field_az_topic_target_id_op + operator: field_az_incentives_value_op operator_limit_selection: false operator_list: { } - identifier: field_az_topic_target_id + identifier: field_az_incentives_value required: false remember: false multiple: false remember_roles: authenticated: authenticated - reduce: false is_grouped: false group_info: label: '' @@ -951,121 +878,37 @@ display: default_group: All default_group_multiple: { } group_items: { } - reduce_duplicates: false - vid: az_opportunity_topic - type: textfield - hierarchy: false - limit: true - error_message: true filter_groups: operator: AND groups: 1: AND style: - type: table + type: views_bootstrap_grid options: - grouping: { } row_class: '' default_row_class: true - columns: - title: title - field_az_application_date: field_az_application_date - field_az_incentives: field_az_incentives - field_az_modality: field_az_modality - field_az_offered: field_az_offered - field_az_topic: field_az_topic - field_az_location: field_az_location - default: '-1' - info: - title: - sortable: false - default_sort_order: asc - align: '' - separator: '' - empty_column: false - responsive: '' - field_az_application_date: - sortable: true - default_sort_order: asc - align: '' - separator: '' - empty_column: false - responsive: '' - field_az_incentives: - sortable: false - default_sort_order: asc - align: '' - separator: '' - empty_column: false - responsive: '' - field_az_modality: - sortable: false - default_sort_order: asc - align: '' - separator: '' - empty_column: false - responsive: '' - field_az_offered: - align: '' - separator: '' - empty_column: false - responsive: '' - field_az_topic: - align: '' - separator: '' - empty_column: false - responsive: '' - field_az_location: - align: '' - separator: '' - empty_column: false - responsive: '' - override: true - sticky: false - summary: '' - empty_table: false - caption: '' - description: '' - class: '' + uses_fields: false + grid_class: '' + col_xs: col-1 + col_sm: col-sm-1 + col_md: col-md-4 + col_lg: col-lg-4 + col_xl: col-xl-4 + col_xxl: col-xxl-4 row: type: 'entity:node' options: relationship: none - view_mode: az_row + view_mode: az_card defaults: style: false style_options: false row: false - fields: false filters: false filter_groups: false display_description: '' style_options: null display_extenders: { } - cache_metadata: - max-age: -1 - contexts: - - 'languages:language_content' - - 'languages:language_interface' - - url - - url.query_args - - 'user.node_grants:view' - - user.permissions - tags: - - 'config:field.storage.node.field_az_application_date' - - 'config:field.storage.node.field_az_incentives' - - 'config:field.storage.node.field_az_location' - - 'config:field.storage.node.field_az_modality' - - 'config:field.storage.node.field_az_offered' - - 'config:field.storage.node.field_az_topic' - block_3: - id: block_3 - display_title: 'Card View' - display_plugin: block - position: 1 - display_options: - display_description: '' - display_extenders: { } cache_metadata: max-age: -1 contexts: From 9cd4b5eb66e8e75b6a826b2c9223f348a4b7f807 Mon Sep 17 00:00:00 2001 From: Z Saenz Date: Thu, 15 Jan 2026 11:00:29 -0700 Subject: [PATCH 05/59] puts back optional views --- ...ield.paragraph.az_view_reference.field_az_view_reference.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/custom/az_paragraphs/az_paragraphs_view/config/install/field.field.paragraph.az_view_reference.field_az_view_reference.yml b/modules/custom/az_paragraphs/az_paragraphs_view/config/install/field.field.paragraph.az_view_reference.field_az_view_reference.yml index 6de0e9dd8d..b90e2b8b67 100644 --- a/modules/custom/az_paragraphs/az_paragraphs_view/config/install/field.field.paragraph.az_view_reference.field_az_view_reference.yml +++ b/modules/custom/az_paragraphs/az_paragraphs_view/config/install/field.field.paragraph.az_view_reference.field_az_view_reference.yml @@ -26,11 +26,13 @@ settings: page: page block: block preselect_views: + az_courses: az_courses az_events: az_events az_news: az_news az_opportunity: az_opportunity az_page_by_category: az_page_by_category az_person: az_person + az_publications: az_publications enabled_settings: offset: offset argument: argument From b5e09440a0262568aae3df454b42f65367fd6f6f Mon Sep 17 00:00:00 2001 From: Z Saenz Date: Thu, 15 Jan 2026 14:40:00 -0700 Subject: [PATCH 06/59] Add Type field, minor display fixes --- ...rm_display.node.az_opportunity.default.yml | 59 +++++++++++-------- ...ew_display.node.az_opportunity.az_card.yml | 2 + ...iew_display.node.az_opportunity.az_row.yml | 2 + ....az_opportunity.az_row_with_background.yml | 2 + ...splay.node.az_opportunity.az_small_row.yml | 2 + ...ew_display.node.az_opportunity.default.yml | 18 ++++-- ..._opportunity.field_az_opportunity_type.yml | 28 +++++++++ ...storage.node.field_az_opportunity_type.yml | 19 ++++++ ...axonomy.vocabulary.az_opportunity_type.yml | 8 +++ .../az_opportunity/css/az_opportunity.css | 6 +- 10 files changed, 114 insertions(+), 32 deletions(-) create mode 100644 modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_opportunity_type.yml create mode 100644 modules/custom/az_opportunity/config/install/field.storage.node.field_az_opportunity_type.yml create mode 100644 modules/custom/az_opportunity/config/install/taxonomy.vocabulary.az_opportunity_type.yml diff --git a/modules/custom/az_opportunity/config/install/core.entity_form_display.node.az_opportunity.default.yml b/modules/custom/az_opportunity/config/install/core.entity_form_display.node.az_opportunity.default.yml index 89357349cb..24896792a2 100644 --- a/modules/custom/az_opportunity/config/install/core.entity_form_display.node.az_opportunity.default.yml +++ b/modules/custom/az_opportunity/config/install/core.entity_form_display.node.az_opportunity.default.yml @@ -14,6 +14,7 @@ dependencies: - field.field.node.az_opportunity.field_az_modality - field.field.node.az_opportunity.field_az_offered - field.field.node.az_opportunity.field_az_ongoing + - field.field.node.az_opportunity.field_az_opportunity_type - field.field.node.az_opportunity.field_az_parent_account - field.field.node.az_opportunity.field_az_program_date - field.field.node.az_opportunity.field_az_program_length @@ -38,13 +39,13 @@ mode: default content: created: type: datetime_timestamp - weight: 2 + weight: 3 region: content settings: { } third_party_settings: { } field_az_application_date: type: smartdate_only - weight: 9 + weight: 10 region: content settings: separator: to @@ -64,7 +65,7 @@ content: third_party_settings: { } field_az_application_link: type: link_default - weight: 21 + weight: 22 region: content settings: placeholder_url: '' @@ -72,14 +73,14 @@ content: third_party_settings: { } field_az_attachments: type: file_generic - weight: 17 + weight: 18 region: content settings: progress_indicator: throbber third_party_settings: { } field_az_audiences: type: entity_reference_autocomplete - weight: 22 + weight: 23 region: content settings: match_operator: CONTAINS @@ -89,7 +90,7 @@ content: third_party_settings: { } field_az_body: type: text_textarea - weight: 23 + weight: 24 region: content settings: rows: 9 @@ -97,7 +98,7 @@ content: third_party_settings: { } field_az_credit: type: string_textfield - weight: 14 + weight: 15 region: content settings: size: 60 @@ -105,14 +106,14 @@ content: third_party_settings: { } field_az_incentives: type: boolean_checkbox - weight: 13 + weight: 14 region: content settings: display_label: true third_party_settings: { } field_az_location: type: link_default - weight: 15 + weight: 16 region: content settings: placeholder_url: '' @@ -120,7 +121,7 @@ content: third_party_settings: { } field_az_media_image: type: media_library_widget - weight: 11 + weight: 12 region: content settings: media_types: { } @@ -129,7 +130,7 @@ content: show_edit: '1' field_az_modality: type: entity_reference_autocomplete - weight: 16 + weight: 17 region: content settings: match_operator: CONTAINS @@ -139,7 +140,7 @@ content: third_party_settings: { } field_az_offered: type: entity_reference_autocomplete - weight: 18 + weight: 19 region: content settings: match_operator: CONTAINS @@ -149,14 +150,20 @@ content: third_party_settings: { } field_az_ongoing: type: boolean_checkbox - weight: 12 + weight: 13 region: content settings: display_label: true third_party_settings: { } + field_az_opportunity_type: + type: options_buttons + weight: 1 + region: content + settings: { } + third_party_settings: { } field_az_parent_account: type: string_textfield - weight: 24 + weight: 25 region: content settings: size: 60 @@ -164,7 +171,7 @@ content: third_party_settings: { } field_az_program_date: type: smartdate_only - weight: 10 + weight: 11 region: content settings: separator: to @@ -184,7 +191,7 @@ content: third_party_settings: { } field_az_program_length: type: string_textfield - weight: 8 + weight: 9 region: content settings: size: 60 @@ -192,7 +199,7 @@ content: third_party_settings: { } field_az_program_website: type: link_default - weight: 20 + weight: 21 region: content settings: placeholder_url: '' @@ -200,7 +207,7 @@ content: third_party_settings: { } field_az_topic: type: entity_reference_autocomplete - weight: 19 + weight: 20 region: content settings: match_operator: CONTAINS @@ -210,7 +217,7 @@ content: third_party_settings: { } field_az_trellis_id: type: string_textfield - weight: 25 + weight: 26 region: content settings: size: 60 @@ -218,33 +225,33 @@ content: third_party_settings: { } field_az_trellis_imported_date: type: datetime_default - weight: 26 + weight: 27 region: content settings: { } third_party_settings: { } path: type: path - weight: 5 + weight: 6 region: content settings: { } third_party_settings: { } promote: type: boolean_checkbox - weight: 3 + weight: 4 region: content settings: display_label: true third_party_settings: { } status: type: boolean_checkbox - weight: 7 + weight: 8 region: content settings: display_label: true third_party_settings: { } sticky: type: boolean_checkbox - weight: 4 + weight: 5 region: content settings: display_label: true @@ -259,7 +266,7 @@ content: third_party_settings: { } uid: type: entity_reference_autocomplete - weight: 1 + weight: 2 region: content settings: match_operator: CONTAINS @@ -268,7 +275,7 @@ content: placeholder: '' third_party_settings: { } url_redirects: - weight: 6 + weight: 7 region: content settings: { } third_party_settings: { } diff --git a/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_card.yml b/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_card.yml index 3a9e84f5c8..dc07c4908d 100644 --- a/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_card.yml +++ b/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_card.yml @@ -15,6 +15,7 @@ dependencies: - field.field.node.az_opportunity.field_az_modality - field.field.node.az_opportunity.field_az_offered - field.field.node.az_opportunity.field_az_ongoing + - field.field.node.az_opportunity.field_az_opportunity_type - field.field.node.az_opportunity.field_az_parent_account - field.field.node.az_opportunity.field_az_program_date - field.field.node.az_opportunity.field_az_program_length @@ -403,6 +404,7 @@ hidden: field_az_credit: true field_az_incentives: true field_az_ongoing: true + field_az_opportunity_type: true field_az_parent_account: true field_az_program_date: true field_az_program_length: true diff --git a/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_row.yml b/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_row.yml index 56296ffbe8..17a92a7f1f 100644 --- a/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_row.yml +++ b/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_row.yml @@ -15,6 +15,7 @@ dependencies: - field.field.node.az_opportunity.field_az_modality - field.field.node.az_opportunity.field_az_offered - field.field.node.az_opportunity.field_az_ongoing + - field.field.node.az_opportunity.field_az_opportunity_type - field.field.node.az_opportunity.field_az_parent_account - field.field.node.az_opportunity.field_az_program_date - field.field.node.az_opportunity.field_az_program_length @@ -238,6 +239,7 @@ hidden: field_az_modality: true field_az_offered: true field_az_ongoing: true + field_az_opportunity_type: true field_az_parent_account: true field_az_program_date: true field_az_program_length: true diff --git a/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_row_with_background.yml b/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_row_with_background.yml index fccc03aff7..22a5fe2348 100644 --- a/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_row_with_background.yml +++ b/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_row_with_background.yml @@ -15,6 +15,7 @@ dependencies: - field.field.node.az_opportunity.field_az_modality - field.field.node.az_opportunity.field_az_offered - field.field.node.az_opportunity.field_az_ongoing + - field.field.node.az_opportunity.field_az_opportunity_type - field.field.node.az_opportunity.field_az_parent_account - field.field.node.az_opportunity.field_az_program_date - field.field.node.az_opportunity.field_az_program_length @@ -56,6 +57,7 @@ hidden: field_az_modality: true field_az_offered: true field_az_ongoing: true + field_az_opportunity_type: true field_az_parent_account: true field_az_program_date: true field_az_program_length: true diff --git a/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_small_row.yml b/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_small_row.yml index 7e845add81..416922125f 100644 --- a/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_small_row.yml +++ b/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_small_row.yml @@ -15,6 +15,7 @@ dependencies: - field.field.node.az_opportunity.field_az_modality - field.field.node.az_opportunity.field_az_offered - field.field.node.az_opportunity.field_az_ongoing + - field.field.node.az_opportunity.field_az_opportunity_type - field.field.node.az_opportunity.field_az_parent_account - field.field.node.az_opportunity.field_az_program_date - field.field.node.az_opportunity.field_az_program_length @@ -248,6 +249,7 @@ hidden: field_az_modality: true field_az_offered: true field_az_ongoing: true + field_az_opportunity_type: true field_az_parent_account: true field_az_program_date: true field_az_program_length: true diff --git a/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.default.yml b/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.default.yml index e7ec8e2aa6..54e1a9abbb 100644 --- a/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.default.yml +++ b/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.default.yml @@ -14,6 +14,7 @@ dependencies: - field.field.node.az_opportunity.field_az_modality - field.field.node.az_opportunity.field_az_offered - field.field.node.az_opportunity.field_az_ongoing + - field.field.node.az_opportunity.field_az_opportunity_type - field.field.node.az_opportunity.field_az_parent_account - field.field.node.az_opportunity.field_az_program_date - field.field.node.az_opportunity.field_az_program_length @@ -143,6 +144,7 @@ third_party_settings: children: - group_audiences - field_az_audiences + - field_az_opportunity_type label: col6 parent_name: group_header_row region: content @@ -373,7 +375,7 @@ content: settings: use_description_as_link_text: true third_party_settings: { } - weight: 4 + weight: 3 region: content field_az_audiences: type: entity_reference_label @@ -388,7 +390,7 @@ content: label: above settings: { } third_party_settings: { } - weight: 3 + weight: 2 region: content field_az_credit: type: string @@ -444,6 +446,14 @@ content: third_party_settings: { } weight: 11 region: content + field_az_opportunity_type: + type: entity_reference_label + label: hidden + settings: + link: true + third_party_settings: { } + weight: 5 + region: content field_az_program_length: type: string label: hidden @@ -462,7 +472,7 @@ content: rel: '' target: '' third_party_settings: { } - weight: 6 + weight: 5 region: content field_az_topic: type: entity_reference_entity_view @@ -476,7 +486,7 @@ content: links: settings: { } third_party_settings: { } - weight: 5 + weight: 4 region: content hidden: field_az_ongoing: true diff --git a/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_opportunity_type.yml b/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_opportunity_type.yml new file mode 100644 index 0000000000..9b4fb62f65 --- /dev/null +++ b/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_opportunity_type.yml @@ -0,0 +1,28 @@ +langcode: en +status: true +dependencies: + config: + - field.storage.node.field_az_opportunity_type + - node.type.az_opportunity + - taxonomy.vocabulary.az_opportunity_type +id: node.az_opportunity.field_az_opportunity_type +field_name: field_az_opportunity_type +entity_type: node +bundle: az_opportunity +label: 'Opportunity Type' +description: '' +required: false +translatable: false +default_value: { } +default_value_callback: '' +settings: + handler: 'default:taxonomy_term' + handler_settings: + target_bundles: + az_opportunity_type: az_opportunity_type + sort: + field: name + direction: asc + auto_create: true + auto_create_bundle: '' +field_type: entity_reference diff --git a/modules/custom/az_opportunity/config/install/field.storage.node.field_az_opportunity_type.yml b/modules/custom/az_opportunity/config/install/field.storage.node.field_az_opportunity_type.yml new file mode 100644 index 0000000000..0718b23d17 --- /dev/null +++ b/modules/custom/az_opportunity/config/install/field.storage.node.field_az_opportunity_type.yml @@ -0,0 +1,19 @@ +langcode: en +status: true +dependencies: + module: + - node + - taxonomy +id: node.field_az_opportunity_type +field_name: field_az_opportunity_type +entity_type: node +type: entity_reference +settings: + target_type: taxonomy_term +module: core +locked: false +cardinality: -1 +translatable: true +indexes: { } +persist_with_no_fields: false +custom_storage: false diff --git a/modules/custom/az_opportunity/config/install/taxonomy.vocabulary.az_opportunity_type.yml b/modules/custom/az_opportunity/config/install/taxonomy.vocabulary.az_opportunity_type.yml new file mode 100644 index 0000000000..73ef2feed4 --- /dev/null +++ b/modules/custom/az_opportunity/config/install/taxonomy.vocabulary.az_opportunity_type.yml @@ -0,0 +1,8 @@ +langcode: en +status: true +dependencies: { } +name: 'Opportunity Type' +vid: az_opportunity_type +description: 'Taxonomy for the Opportunity content type' +weight: 0 +new_revision: false diff --git a/modules/custom/az_opportunity/css/az_opportunity.css b/modules/custom/az_opportunity/css/az_opportunity.css index 2f21a4e0c4..3303e8a737 100644 --- a/modules/custom/az_opportunity/css/az_opportunity.css +++ b/modules/custom/az_opportunity/css/az_opportunity.css @@ -3,7 +3,7 @@ /* CSS reason: The issue is that inline labels in the views need 0 margin, * but labels for h3 in the default display need margin. * @TODO: Possible fix for Barrio Bootstrap Core? - */ + .field--type-entity-reference { margin: 0 !important; @@ -12,4 +12,6 @@ .field--type-entity-reference .field__label:not(.fw-bolder) { font-weight: 500 !important; margin: 1.042em 0 .667em !important; -} \ No newline at end of file +} + +*/ \ No newline at end of file From 2dfd76b117bed7d19a33799d27a464d111fa9265 Mon Sep 17 00:00:00 2001 From: Z Saenz Date: Wed, 21 Jan 2026 09:02:51 -0700 Subject: [PATCH 07/59] Final touches to display all requested fields --- .../az_opportunity/az_opportunity.module | 13 + ...iew_display.node.az_opportunity.az_row.yml | 25 +- ...ew_display.node.az_opportunity.default.yml | 42 +-- ..._opportunity.field_az_application_date.yml | 9 +- ...e.az_opportunity.field_az_program_date.yml | 9 +- ...storage.node.field_az_application_date.yml | 1 + ...eld.storage.node.field_az_program_date.yml | 1 + .../install/views.view.az_opportunity.yml | 266 ++++++++---------- 8 files changed, 182 insertions(+), 184 deletions(-) diff --git a/modules/custom/az_opportunity/az_opportunity.module b/modules/custom/az_opportunity/az_opportunity.module index 2214b11852..5727a3bbe5 100644 --- a/modules/custom/az_opportunity/az_opportunity.module +++ b/modules/custom/az_opportunity/az_opportunity.module @@ -12,6 +12,10 @@ function az_opportunity_preprocess_node__az_opportunity(&$variables) { // Attach the opportunity CSS library for az_opportunity node renderings. $variables['#attached']['library'][] = 'az_opportunity/az_opportunity'; + //dpr($variables); + //if(isEmpty($variables['elements']['field_az_application_date'][0])) { + + //} } /** @@ -26,3 +30,12 @@ function az_opportunity_preprocess_views_view(&$variables) { $variables['#attached']['library'][] = 'az_opportunity/az_opportunity'; } } + +/** + * Implements hook_preprocess_field() for field_az_application_date. + * + * Displays "TBD" when the field is empty. + */ +//function az_opportunity_preprocess_field__field_az_application_date(&$variables) { +// dpr($variables); +//} \ No newline at end of file diff --git a/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_row.yml b/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_row.yml index 17a92a7f1f..90667e609f 100644 --- a/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_row.yml +++ b/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_row.yml @@ -74,7 +74,6 @@ third_party_settings: - group_col_1 - group_col_2 - group_col_3 - - group_col_4 label: row parent_name: group_opportunity_link region: content @@ -95,13 +94,14 @@ third_party_settings: group_col_1: children: - smart_title + - field_az_topic label: 'col 1' parent_name: group_row region: content weight: 3 format_type: html_element format_settings: - classes: col-3 + classes: col-6 show_empty_fields: false id: '' label_as_html: false @@ -114,14 +114,14 @@ third_party_settings: speed: fast group_col_2: children: - - field_az_location + - field_az_application_date label: 'col 2' parent_name: group_row region: content weight: 4 format_type: html_element format_settings: - classes: col-4 + classes: col-3 show_empty_fields: false id: '' label_as_html: false @@ -134,7 +134,7 @@ third_party_settings: speed: fast group_col_3: children: - - field_az_application_date + - field_az_location label: 'Col 3' parent_name: group_row region: content @@ -153,12 +153,11 @@ third_party_settings: effect: none speed: fast group_col_4: - children: - - field_az_topic + children: { } label: 'col 4' - parent_name: group_row - region: content - weight: 6 + parent_name: '' + region: hidden + weight: 1 format_type: html_element format_settings: classes: col-2 @@ -207,16 +206,16 @@ content: rel: '' target: '' third_party_settings: { } - weight: 11 + weight: 14 region: content field_az_topic: type: entity_reference_entity_view - label: inline + label: hidden settings: view_mode: az_badge link: false third_party_settings: { } - weight: 5 + weight: 1 region: content links: settings: { } diff --git a/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.default.yml b/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.default.yml index 54e1a9abbb..6a0339c207 100644 --- a/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.default.yml +++ b/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.default.yml @@ -57,7 +57,7 @@ third_party_settings: group_col2: children: - group_date - - field_az_application_date + - field_az_offered label: col2 parent_name: group_header_row region: content @@ -100,7 +100,6 @@ third_party_settings: children: - group_modality - field_az_modality - - field_az_offered label: col4 parent_name: group_header_row region: content @@ -148,7 +147,7 @@ third_party_settings: label: col6 parent_name: group_header_row region: content - weight: 6 + weight: 7 format_type: html_element format_settings: classes: col @@ -348,14 +347,14 @@ mode: default content: field_az_application_date: type: daterange_default - label: hidden + label: inline settings: timezone_override: '' - format_type: html_date + format_type: short from_to: both separator: '-' third_party_settings: { } - weight: 15 + weight: 4 region: content field_az_application_link: type: link @@ -367,7 +366,7 @@ content: rel: '' target: '' third_party_settings: { } - weight: 7 + weight: 9 region: content field_az_attachments: type: file_default @@ -375,7 +374,7 @@ content: settings: use_description_as_link_text: true third_party_settings: { } - weight: 3 + weight: 6 region: content field_az_audiences: type: entity_reference_label @@ -390,7 +389,7 @@ content: label: above settings: { } third_party_settings: { } - weight: 2 + weight: 3 region: content field_az_credit: type: string @@ -423,12 +422,13 @@ content: weight: 6 region: content field_az_media_image: - type: entity_reference_label + type: entity_reference_entity_view label: hidden settings: - link: true + view_mode: az_large + link: false third_party_settings: { } - weight: 8 + weight: 2 region: content field_az_modality: type: entity_reference_label @@ -444,7 +444,7 @@ content: settings: link: false third_party_settings: { } - weight: 11 + weight: 15 region: content field_az_opportunity_type: type: entity_reference_label @@ -452,6 +452,17 @@ content: settings: link: true third_party_settings: { } + weight: 6 + region: content + field_az_program_date: + type: daterange_default + label: inline + settings: + timezone_override: '' + format_type: short + from_to: both + separator: '-' + third_party_settings: { } weight: 5 region: content field_az_program_length: @@ -472,7 +483,7 @@ content: rel: '' target: '' third_party_settings: { } - weight: 5 + weight: 8 region: content field_az_topic: type: entity_reference_entity_view @@ -486,12 +497,11 @@ content: links: settings: { } third_party_settings: { } - weight: 4 + weight: 7 region: content hidden: field_az_ongoing: true field_az_parent_account: true - field_az_program_date: true field_az_trellis_id: true field_az_trellis_imported_date: true smart_title: true diff --git a/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_application_date.yml b/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_application_date.yml index d721c9f948..a7e239d149 100644 --- a/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_application_date.yml +++ b/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_application_date.yml @@ -11,15 +11,10 @@ field_name: field_az_application_date entity_type: node bundle: az_opportunity label: 'Application Date' -description: 'An Application Date is when this opportunity is active for applications.' +description: "An Application Date is when this opportunity is active for applications.\r\nLeave this field empty for \"TBD\"" required: false translatable: false -default_value: - - - default_date_type: now - default_date: now - default_end_date_type: now - default_end_date: now +default_value: { } default_value_callback: '' settings: { } field_type: daterange diff --git a/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_program_date.yml b/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_program_date.yml index e9058e5a4d..83da3dc08a 100644 --- a/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_program_date.yml +++ b/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_program_date.yml @@ -11,15 +11,10 @@ field_name: field_az_program_date entity_type: node bundle: az_opportunity label: 'Program Date' -description: 'The Program Date, or the Account Date, that the program is active.' +description: "The Program Date, or the Account Date, that the program is active.\r\nLeave this field empty for \"TBD\"" required: false translatable: false -default_value: - - - default_date_type: now - default_date: now - default_end_date_type: now - default_end_date: now +default_value: { } default_value_callback: '' settings: { } field_type: daterange diff --git a/modules/custom/az_opportunity/config/install/field.storage.node.field_az_application_date.yml b/modules/custom/az_opportunity/config/install/field.storage.node.field_az_application_date.yml index 84554f56da..92e1ddc588 100644 --- a/modules/custom/az_opportunity/config/install/field.storage.node.field_az_application_date.yml +++ b/modules/custom/az_opportunity/config/install/field.storage.node.field_az_application_date.yml @@ -10,6 +10,7 @@ entity_type: node type: daterange settings: datetime_type: datetime + optional_end_date: false module: datetime_range locked: false cardinality: 1 diff --git a/modules/custom/az_opportunity/config/install/field.storage.node.field_az_program_date.yml b/modules/custom/az_opportunity/config/install/field.storage.node.field_az_program_date.yml index e0926ea086..9877ec60c6 100644 --- a/modules/custom/az_opportunity/config/install/field.storage.node.field_az_program_date.yml +++ b/modules/custom/az_opportunity/config/install/field.storage.node.field_az_program_date.yml @@ -10,6 +10,7 @@ entity_type: node type: daterange settings: datetime_type: datetime + optional_end_date: false module: datetime_range locked: false cardinality: 1 diff --git a/modules/custom/az_opportunity/config/install/views.view.az_opportunity.yml b/modules/custom/az_opportunity/config/install/views.view.az_opportunity.yml index 1755cef6b8..a0bce0a21b 100644 --- a/modules/custom/az_opportunity/config/install/views.view.az_opportunity.yml +++ b/modules/custom/az_opportunity/config/install/views.view.az_opportunity.yml @@ -129,6 +129,21 @@ display: field_identifier: '' exposed: false granularity: second + title: + id: title + table: node_field_data + field: title + relationship: none + group_type: group + admin_label: '' + entity_type: node + entity_field: title + plugin_id: standard + order: ASC + expose: + label: '' + field_identifier: '' + exposed: false arguments: field_az_topic_target_id: id: field_az_topic_target_id @@ -236,6 +251,22 @@ display: display_plugin: block position: 1 display_options: + sorts: + title: + id: title + table: node_field_data + field: title + relationship: none + group_type: group + admin_label: '' + entity_type: node + entity_field: title + plugin_id: standard + order: ASC + expose: + label: '' + field_identifier: '' + exposed: false style: type: default options: @@ -251,6 +282,7 @@ display: style: false style_options: false row: false + sorts: false display_description: '' style_options: null display_extenders: { } @@ -264,9 +296,27 @@ display: - 'user.node_grants:view' - user.permissions tags: { } - block_2: - id: block_2 - display_title: 'Row View with Filter' + block_3: + id: block_3 + display_title: 'Card View' + display_plugin: block + position: 1 + display_options: + display_description: '' + display_extenders: { } + cache_metadata: + max-age: -1 + contexts: + - 'languages:language_content' + - 'languages:language_interface' + - url + - url.query_args + - 'user.node_grants:view' + - user.permissions + tags: { } + block_4: + id: block_4 + display_title: 'Row View Filter' display_plugin: block position: 1 display_options: @@ -292,35 +342,32 @@ display: value: az_opportunity: az_opportunity group: 1 - title: - id: title - table: node_field_data - field: title + field_az_ongoing_value_1: + id: field_az_ongoing_value_1 + table: node__field_az_ongoing + field: field_az_ongoing_value relationship: none group_type: group admin_label: '' - entity_type: node - entity_field: title - plugin_id: string + plugin_id: boolean operator: '=' - value: '' + value: '0' group: 1 - exposed: true + exposed: false expose: - operator_id: title_op - label: Title + operator_id: '' + label: '' description: '' use_operator: false - operator: title_op + operator: '' operator_limit_selection: false operator_list: { } - identifier: title + identifier: '' required: false remember: false multiple: false remember_roles: authenticated: authenticated - placeholder: '' is_grouped: false group_info: label: '' @@ -333,32 +380,38 @@ display: default_group: All default_group_multiple: { } group_items: { } - field_az_location_options: - id: field_az_location_options - table: node__field_az_location - field: field_az_location_options + field_az_application_date_end_value: + id: field_az_application_date_end_value + table: node__field_az_application_date + field: field_az_application_date_end_value relationship: none group_type: group admin_label: '' - plugin_id: string - operator: '=' - value: '' + plugin_id: datetime + operator: '>=' + value: + min: '' + max: '' + value: now + type: offset group: 1 - exposed: true + exposed: false expose: - operator_id: field_az_location_options_op - label: Where + operator_id: '' + label: '' description: '' use_operator: false - operator: field_az_location_options_op + operator: '' operator_limit_selection: false operator_list: { } - identifier: field_az_location_options + identifier: '' required: false remember: false multiple: false remember_roles: authenticated: authenticated + min_placeholder: '' + max_placeholder: '' placeholder: '' is_grouped: false group_info: @@ -372,78 +425,35 @@ display: default_group: All default_group_multiple: { } group_items: { } - field_az_topic_target_id: - id: field_az_topic_target_id - table: node__field_az_topic - field: field_az_topic_target_id + granularity: day + status_1: + id: status_1 + table: node_field_data + field: status relationship: none group_type: group admin_label: '' - plugin_id: taxonomy_index_tid - operator: or - value: { } - group: 1 - exposed: true + entity_type: node + entity_field: status + plugin_id: boolean + operator: '=' + value: '1' + group: 2 + exposed: false expose: - operator_id: field_az_topic_target_id_op - label: Topic - description: '' - use_operator: false - operator: field_az_topic_target_id_op - operator_limit_selection: false - operator_list: { } - identifier: field_az_topic_target_id - required: false - remember: false - multiple: false - remember_roles: - authenticated: authenticated - reduce: false - is_grouped: false - group_info: + operator_id: '' label: '' description: '' - identifier: '' - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: { } - reduce_duplicates: false - vid: az_opportunity_topic - type: select - hierarchy: false - limit: true - error_message: true - field_az_modality_target_id: - id: field_az_modality_target_id - table: node__field_az_modality - field: field_az_modality_target_id - relationship: none - group_type: group - admin_label: '' - plugin_id: taxonomy_index_tid - operator: or - value: { } - group: 1 - exposed: true - expose: - operator_id: field_az_modality_target_id_op - label: Modality - description: '' use_operator: false - operator: field_az_modality_target_id_op + operator: '' operator_limit_selection: false operator_list: { } - identifier: field_az_modality_target_id + identifier: '' required: false remember: false multiple: false remember_roles: authenticated: authenticated - reduce: false is_grouped: false group_info: label: '' @@ -456,33 +466,30 @@ display: default_group: All default_group_multiple: { } group_items: { } - reduce_duplicates: false - vid: az_opportunity_modality - type: select - hierarchy: false - limit: true - error_message: true - field_az_offered_target_id: - id: field_az_offered_target_id - table: node__field_az_offered - field: field_az_offered_target_id + type_1: + id: type_1 + table: node_field_data + field: type relationship: none group_type: group admin_label: '' - plugin_id: taxonomy_index_tid - operator: or - value: { } - group: 1 - exposed: true + entity_type: node + entity_field: type + plugin_id: bundle + operator: in + value: + az_opportunity: az_opportunity + group: 2 + exposed: false expose: - operator_id: field_az_offered_target_id_op - label: Offered + operator_id: '' + label: '' description: '' use_operator: false - operator: field_az_offered_target_id_op + operator: '' operator_limit_selection: false operator_list: { } - identifier: field_az_offered_target_id + identifier: '' required: false remember: false multiple: false @@ -501,33 +508,27 @@ display: default_group: All default_group_multiple: { } group_items: { } - reduce_duplicates: false - vid: az_opportunity_semester - type: select - hierarchy: false - limit: true - error_message: true - field_az_incentives_value: - id: field_az_incentives_value - table: node__field_az_incentives - field: field_az_incentives_value + field_az_ongoing_value: + id: field_az_ongoing_value + table: node__field_az_ongoing + field: field_az_ongoing_value relationship: none group_type: group admin_label: '' plugin_id: boolean operator: '=' - value: All - group: 1 - exposed: true + value: '1' + group: 2 + exposed: false expose: operator_id: '' - label: Incentives + label: '' description: '' use_operator: false - operator: field_az_incentives_value_op + operator: '' operator_limit_selection: false operator_list: { } - identifier: field_az_incentives_value + identifier: '' required: false remember: false multiple: false @@ -546,9 +547,10 @@ display: default_group_multiple: { } group_items: { } filter_groups: - operator: AND + operator: OR groups: 1: AND + 2: AND style: type: default options: @@ -579,24 +581,6 @@ display: - 'user.node_grants:view' - user.permissions tags: { } - block_3: - id: block_3 - display_title: 'Card View' - display_plugin: block - position: 1 - display_options: - display_description: '' - display_extenders: { } - cache_metadata: - max-age: -1 - contexts: - - 'languages:language_content' - - 'languages:language_interface' - - url - - url.query_args - - 'user.node_grants:view' - - user.permissions - tags: { } block_6: id: block_6 display_title: 'Card View with Filter' From b6db6004a0f0cd7b8c4118cabadf5e65375ce5aa Mon Sep 17 00:00:00 2001 From: Z Saenz Date: Thu, 22 Jan 2026 14:07:26 -0700 Subject: [PATCH 08/59] Updates views and displays, getting started with Trellis Opportunities from Events --- .../az_opportunity/az_opportunity.info.yml | 3 + .../az_opportunity.libraries.yml | 4 - .../az_opportunity/az_opportunity.module | 41 - .../az_opportunitty_trellis.install | 35 + .../az_opportunity_trellis.info.yml | 21 + .../az_opportunity_trellis.libraries.yml | 18 + .../az_opportunity_trellis.links.action.yml | 5 + .../az_opportunity_trellis.links.task.yml | 18 + .../az_opportunity_trellis.module | 171 +++ .../az_opportunity_trellis.routing.yml | 47 + .../az_opportunity_trellis.services.yml | 17 + .../az_opportunity_trellis.views.inc | 69 ++ .../az_opportunity_trellis.settings.yml | 1 + ..._plus.migration.az_trellis_opportunity.yml | 135 +++ ...migration_group.az_trellis_opportunity.yml | 11 + ....cron_migration.az_opportunity_trellis.yml | 13 + ...ews.view.az_opportunity_trellis_import.yml | 1053 +++++++++++++++++ .../schema/az_opportunity_trellis.schema.yml | 39 + .../az_opportunity_trellis_datewrapper.css | 3 + .../js/az_opportunity_trellis_date.js | 27 + .../az_trellis_opportunity_files.yml | 42 + .../az_trellis_opportunity_media.yml | 56 + .../src/AZRecurringImportRuleInterface.php | 30 + .../src/AZRecurringImportRuleListBuilder.php | 56 + .../AZRecurringImportModalController.php | 101 ++ .../src/Entity/AZRecurringImportRule.php | 129 ++ .../AZOpportunityTrellisDataSubscriber.php | 157 +++ .../src/Form/AZRecurringImportRuleForm.php | 185 +++ .../Form/TrellisOpportunitySettingsForm.php | 53 + .../source/AZTrellisOpportunitySource.php | 144 +++ .../field/AZOpportunityTrellisViewsField.php | 160 +++ ...ZOpportunityTrellisViewsApprovalFilter.php | 96 ++ ...OpportunityTrellisViewsAttributeFilter.php | 170 +++ .../AZOpportunityTrellisViewsDateFilter.php | 289 +++++ .../src/TrellisHelper.php | 314 +++++ ...iew_display.node.az_opportunity.az_row.yml | 30 +- ...ew_display.node.az_opportunity.default.yml | 34 +- ...omy_term.az_opportunity_topic.az_badge.yml | 2 +- .../install/views.view.az_opportunity.yml | 318 ++++- .../az_opportunity/css/az_opportunity.css | 17 - ...--field_az_topic--az_opportunity.html.twig | 70 ++ 41 files changed, 4104 insertions(+), 80 deletions(-) delete mode 100644 modules/custom/az_opportunity/az_opportunity.libraries.yml delete mode 100644 modules/custom/az_opportunity/az_opportunity.module create mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/az_opportunitty_trellis.install create mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.info.yml create mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.libraries.yml create mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.links.action.yml create mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.links.task.yml create mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.module create mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.routing.yml create mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.services.yml create mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.views.inc create mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/config/install/az_opportunity_trellis.settings.yml create mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/config/install/migrate_plus.migration.az_trellis_opportunity.yml create mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/config/install/migrate_plus.migration_group.az_trellis_opportunity.yml create mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/config/install/migrate_queue_importer.cron_migration.az_opportunity_trellis.yml create mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/config/install/views.view.az_opportunity_trellis_import.yml create mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/config/schema/az_opportunity_trellis.schema.yml create mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/css/az_opportunity_trellis_datewrapper.css create mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/js/az_opportunity_trellis_date.js create mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/migrations/az_trellis_opportunity_files.yml create mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/migrations/az_trellis_opportunity_media.yml create mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/src/AZRecurringImportRuleInterface.php create mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/src/AZRecurringImportRuleListBuilder.php create mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/src/Controller/AZRecurringImportModalController.php create mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/src/Entity/AZRecurringImportRule.php create mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/src/EventSubscriber/AZOpportunityTrellisDataSubscriber.php create mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/src/Form/AZRecurringImportRuleForm.php create mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/src/Form/TrellisOpportunitySettingsForm.php create mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/src/Plugin/migrate/source/AZTrellisOpportunitySource.php create mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/src/Plugin/views/field/AZOpportunityTrellisViewsField.php create mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/src/Plugin/views/filter/AZOpportunityTrellisViewsApprovalFilter.php create mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/src/Plugin/views/filter/AZOpportunityTrellisViewsAttributeFilter.php create mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/src/Plugin/views/filter/AZOpportunityTrellisViewsDateFilter.php create mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/src/TrellisHelper.php delete mode 100644 modules/custom/az_opportunity/css/az_opportunity.css create mode 100644 themes/custom/az_barrio/templates/field/field--node--field_az_topic--az_opportunity.html.twig diff --git a/modules/custom/az_opportunity/az_opportunity.info.yml b/modules/custom/az_opportunity/az_opportunity.info.yml index b5c23f3314..55ab3190e0 100644 --- a/modules/custom/az_opportunity/az_opportunity.info.yml +++ b/modules/custom/az_opportunity/az_opportunity.info.yml @@ -3,6 +3,9 @@ description: 'Provides an Opportunity content type and related configuration. Us core_version_requirement: ^10 || ^11 || ^12 type: module package: The University of Arizona - Experimental +lifecycle: experimental +lifecycle_link: 'https://github.com/az-digital/az_quickstart/blob/main/RELEASES.md#experimental-features' + dependencies: - az_core:az_core - calendar_link:calendar_link diff --git a/modules/custom/az_opportunity/az_opportunity.libraries.yml b/modules/custom/az_opportunity/az_opportunity.libraries.yml deleted file mode 100644 index dba72415b1..0000000000 --- a/modules/custom/az_opportunity/az_opportunity.libraries.yml +++ /dev/null @@ -1,4 +0,0 @@ -az_opportunity: - css: - theme: - css/az_opportunity.css: {} diff --git a/modules/custom/az_opportunity/az_opportunity.module b/modules/custom/az_opportunity/az_opportunity.module deleted file mode 100644 index 5727a3bbe5..0000000000 --- a/modules/custom/az_opportunity/az_opportunity.module +++ /dev/null @@ -1,41 +0,0 @@ -storage->id(); - - if ($id === 'az_opportunity') { - $variables['#attached']['library'][] = 'az_opportunity/az_opportunity'; - } -} - -/** - * Implements hook_preprocess_field() for field_az_application_date. - * - * Displays "TBD" when the field is empty. - */ -//function az_opportunity_preprocess_field__field_az_application_date(&$variables) { -// dpr($variables); -//} \ No newline at end of file diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunitty_trellis.install b/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunitty_trellis.install new file mode 100644 index 0000000000..9e2cd74a19 --- /dev/null +++ b/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunitty_trellis.install @@ -0,0 +1,35 @@ +install(['views_remote_data']); +} + +/** + * Ensure az_recurring_import_rule entity type is installed. + */ +function az_opportunity_trellis_update_1021001() { + $changes = \Drupal::entityDefinitionUpdateManager()->getChangeList(); + $status = $changes['az_recurring_import_rule']['entity_type'] ?? ''; + // Determine if recurring import rule entity needs to be created. + if ($status === EntityDefinitionUpdateManagerInterface::DEFINITION_CREATED) { + $entity_type_definition = \Drupal::service('entity_type.manager')->getDefinition('az_recurring_import_rule'); + \Drupal::entityDefinitionUpdateManager()->installEntityType($entity_type_definition); + } +} + +/** + * Ensure az_migration_remote is installed. + */ +function az_opportunity_trellis_update_1021301() { + \Drupal::service('module_installer')->install(['az_migration_remote']); +} diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.info.yml b/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.info.yml new file mode 100644 index 0000000000..3748a260a9 --- /dev/null +++ b/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.info.yml @@ -0,0 +1,21 @@ +name: Quickstart Opportunity - Trellis Importer +type: module +description: 'Import opportunities from Trellis Progrmas, the official University of Arizona programs management tool.' +core_version_requirement: ^10 || ^11 || ^12 +package: 'The University of Arizona - Experimental' +lifecycle: experimental +lifecycle_link: 'https://github.com/az-digital/az_quickstart/blob/main/RELEASES.md#experimental-features' +php: 8.0 + +dependencies: + - az_core:az_core + - az_opportunity:az_opportunity + - az_migration:az_migration_remote + - drupal:views + - drupal:migrate + - migrate_plus:migrate_plus + - migrate_tools:migrate_tools + - migrate_queue_importer:migrate_queue_importer + - views_remote_data:views_remote_data + +configure: az_opportunity_trellis.settings \ No newline at end of file diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.libraries.yml b/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.libraries.yml new file mode 100644 index 0000000000..02849af8d1 --- /dev/null +++ b/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.libraries.yml @@ -0,0 +1,18 @@ +az_opportunity_trellis_date: + js: + js/az_opportunity_trellis_date.js: {} + css: + theme: + css/az_opportunity_trellis_datewrapper.css: {} + dependencies: + - core/drupal + - core/drupalSettings + - core/once + - az_opportunity_trellis/easepick_bundle +easepick_bundle: + js: + /libraries/easepick--bundle/dist/index.umd.js: { minified: true } +easepick_styles: + css: + theme: + /libraries/easepick--bundle/dist/index.css: { minified: true } diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.links.action.yml b/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.links.action.yml new file mode 100644 index 0000000000..2fbeb0bbfe --- /dev/null +++ b/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.links.action.yml @@ -0,0 +1,5 @@ +entity.az_recurring_import_rule.add_form: + route_name: 'entity.az_recurring_import_rule.add_form' + title: 'Add Recurring Import Rule' + appears_on: + - entity.az_recurring_import_rule.collection diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.links.task.yml b/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.links.task.yml new file mode 100644 index 0000000000..d2b3ae045e --- /dev/null +++ b/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.links.task.yml @@ -0,0 +1,18 @@ +az_opportunity_trellis.az_opportunity_trellis_settings_task: + route_name: az_opportunity_trellis.settings + title: 'AZ Trellis Opportunity Importer' + base_route: az_core.az_settings + weight: 0 + +az_opportunity.import_form_task: + title: 'Trellis opportunity importer' + route_name: view.az_opportunity_trellis_import.page_1 + parent_id: system.admin_content + description: 'Import opportunities from the Trellis Opportunity API.' + weight: 101 + +az_opportunity_trellis.az_recurring_import_rules_tab: + route_name: entity.az_recurring_import_rule.collection + title: 'Recurring Imports' + base_route: az_core.az_settings + weight: 5 diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.module b/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.module new file mode 100644 index 0000000000..ae4d6bd17d --- /dev/null +++ b/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.module @@ -0,0 +1,171 @@ +getFormObject(); + if ($form_object instanceof EntityFormInterface) { + /** @var \Drupal\node\NodeInterface $node */ + $node = $form_object->getEntity(); + $trellis_id = $node->get('field_az_trellis_id')->getString(); + if (!empty($trellis_id)) { + $trellis_link_url = TrellisHelper::$eventViewBasePath . $trellis_id . '/view'; + $trellis_warning = t('This opportunity has been imported from Trellis Programs. Opportunity details can only be edited by a Trellis user in Trellis Programs.', [ + '@trellis-url' => $trellis_link_url, + ]); + \Drupal::messenger()->addWarning($trellis_warning); + + $disabled_fields = [ + 'title', + // 'title', // Original fields for reference + // 'field_az_location', + // 'field_az_event_date', + // 'field_az_link', + // 'field_az_summary', + // 'field_az_photos', + // 'field_az_enterprise_attributes', + 'field_az_application_date', + 'field_az_application_link', + 'field_az_audiences', + 'field_az_credit', + 'field_az_incentives', + 'field_az_modality', + 'field_az_offered', + 'field_az_ongoing', + 'field_az_opportunity_type', + 'field_az_media_image', + 'field_az_program_date', + 'field_az_program_length', + 'field_az_program_website', + 'field_az_topic', + 'field_az_location' + ]; + foreach ($disabled_fields as $field) { + $form[$field]['#disabled'] = TRUE; + } + + $no_access_fields = [ + // 'field_az_subheading', + 'field_az_body', + //'field_az_contacts', + 'field_az_attachments', + ]; + foreach ($no_access_fields as $field) { + $form[$field]['#access'] = FALSE; + } + } + } +} + +/** + * Gather exposed API parameters from view. + * + * @param mixed $form + * An associative array containing the structure of the form. + * @param \Drupal\Core\Form\FormStateInterface $form_state + * The current state of the form. + * + * @return array + * The remote API search values. + */ +function az_opportunity_trellis_gather_filter_options(&$form, FormStateInterface $form_state) { + $search = []; + /** @var \Drupal\views\ViewExecutable $view */ + $view = $form_state->get('view'); + // Consult the filter handlers of the view. + if (!empty($view->filter)) { + /** @var \Drupal\views\Plugin\views\ViewsHandlerInterface[] $handlers */ + $handlers = $view->filter; + // Get exposed search information. + $input = $view->getExposedInput(); + if (empty($input)) { + return []; + } + // Loops through handlers to find inputs we want. + /** @var \Drupal\views\Plugin\views\filter\FilterPluginBase $handler */ + foreach ($handlers as $handler) { + if ($handler->isExposed()) { + $info = $handler->exposedInfo(); + $identifier = $info['value'] ?? ''; + // Make sure our input for this exposed filter isn't NULL. + // This won't normally happen in an actual GET form. + if (!isset($input[$identifier])) { + $input[$identifier] = ''; + } + // Check if the handler validates versus the input. + if ($handler->acceptExposedInput($input)) { + // If the handler accepts the input, bundle it up. + $value = $input[$identifier] ?? ''; + if (!empty($identifier) && !empty($value)) { + if ($handler instanceof AZOpportunityTrellisViewsAttributeFilter) { + // Attributes handled separately since they are from a remote API. + $search['attributes'][$identifier] = $value; + } + else { + $search[$identifier] = $value; + } + } + } + } + } + } + // Don't return id or date fields, unnecessary for recurring imports. + unset($search['id']); + unset($search['start']); + unset($search['modified']); + return $search; +} + +/** + * Implements hook_form_FORM_ID_alter(). + * + * Add clickable link that opens import configuration modal. + */ +function az_opportunity_trellis_form_views_exposed_form_alter(&$form, FormStateInterface $form_state, $form_id) { + + $view = $form_state->get('view'); + if (($view->id() === 'az_opportunity_trellis_import') && ($view->current_display === 'page_1')) { + + // Don't create configuration link if user does not have permission. + if (!\Drupal::currentUser()->hasPermission('administer quickstart configuration')) { + return; + } + $search = az_opportunity_trellis_gather_filter_options($form, $form_state); + if (!empty($search)) { + // We cannot use an ajax response here to open a dialog. + // Exposed forms do not support ajax callbacks. Cache search parameters. + // Compute cache key of parameters. + $key = 'az_recurring_import_modal:' . Crypt::hashBase64(serialize($search)); + $expire = time() + 1200; + // Cache the search. + \Drupal::service('cache.default')->set($key, $search, $expire); + $form['#attached']['library'][] = 'core/drupal.dialog.ajax'; + // Add a link to open the modal. + $form['actions']['recurring'] = [ + '#type' => 'link', + '#title' => t('Create Recurring Import'), + '#url' => Url::fromRoute('entity.az_recurring_import_rule.modal'), + // Pass the search parameters cache key as an argument. + '#options' => ['query' => ['search' => $key]], + '#attributes' => ['class' => ['use-ajax', 'button']], + ]; + } + } +} diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.routing.yml b/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.routing.yml new file mode 100644 index 0000000000..607ac65714 --- /dev/null +++ b/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.routing.yml @@ -0,0 +1,47 @@ +az_opportunity_trellis.settings: + path: '/admin/config/az-quickstart/settings/az-opportunity-trellis' + defaults: + _form: '\Drupal\az_opportunity_trellis\Form\TrellisOpportunitySettingsForm' + _title: 'Trellis Opportunity Importer Settings' + requirements: + _permission: 'administer quickstart configuration' + +entity.az_recurring_import_rule.collection: + path: '/admin/config/az-quickstart/settings/az-recurring-import-rule' + defaults: + _entity_list: 'az_recurring_import_rule' + _title: 'Recurring Import Rule configuration' + requirements: + _permission: 'administer quickstart configuration' + +entity.az_recurring_import_rule.add_form: + path: '/admin/config/az-quickstart/settings/az-recurring-import-rule/add' + defaults: + _entity_form: 'az_recurring_import_rule.add' + _title: 'Add a recurring import rule' + requirements: + _permission: 'administer quickstart configuration' + +entity.az_recurring_import_rule.edit_form: + path: '/admin/config/az-quickstart/settings/az-recurring-import-rule/{az_recurring_import_rule}' + defaults: + _entity_form: 'az_recurring_import_rule.edit' + _title: 'Edit a recurring import rule' + requirements: + _permission: 'administer quickstart configuration' + +entity.az_recurring_import_rule.delete_form: + path: '/admin/config/az-quickstart/settings/az-recurring-import-rule/{az_recurring_import_rule}/delete' + defaults: + _entity_form: 'az_recurring_import_rule.delete' + _title: 'Delete a recurring import rule' + requirements: + _permission: 'administer quickstart configuration' + +entity.az_recurring_import_rule.modal: + path: '/admin/az-opportunity-trellis-modal' + defaults: + _title: 'Entity Az Recurring Import Rule Modal' + _controller: '\Drupal\az_opportunity_trellis\Controller\AZRecurringImportModalController' + requirements: + _permission: 'administer quickstart configuration' diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.services.yml b/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.services.yml new file mode 100644 index 0000000000..cab26fdcf7 --- /dev/null +++ b/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.services.yml @@ -0,0 +1,17 @@ +services: + _defaults: + autoconfigure: true + az_opportunity_trellis.trellis_helper: + class: Drupal\az_opportunity_trellis\TrellisHelper + arguments: + - '@config.factory' + - '@http_client' + - '@cache.default' + - '@entity_type.manager' + az_opportunity_trellis.trellis_opportunity_data: + class: Drupal\az_opportunity_trellis\EventSubscriber\AZOpportunityTrellisDataSubscriber + arguments: + - '@az_opportunity_trellis.trellis_helper' + - '@messenger' + - '@entity_type.manager' + - '@current_user' diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.views.inc b/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.views.inc new file mode 100644 index 0000000000..57616a1d11 --- /dev/null +++ b/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.views.inc @@ -0,0 +1,69 @@ + t('Trellis Opportunities'), + 'query_id' => 'views_remote_data_query', + ]; + $data['az_opportunity_trellis_data']['Id'] = [ + 'title' => t('Trellis Opportunity ID'), + 'help' => t('Unique key of Trellis opportunity.'), + 'field' => [ + 'id' => 'az_opportunity_trellis_views_field', + ], + ]; + $data['az_opportunity_trellis_data']['Last_Modified_Date'] = [ + 'title' => t('Trellis opportunity modification time'), + 'help' => t('Time of the Trellis opportunity was last modified'), + 'field' => [ + 'id' => 'date', + ], + ]; + $data['az_opportunity_trellis_data']['Start_DateTime'] = [ + 'title' => t('Trellis opportunity start time'), + 'help' => t('Start time of the Trellis opportunity.'), + 'field' => [ + 'id' => 'date', + ], + ]; + $data['az_opportunity_trellis_data']['End_DateTime'] = [ + 'title' => t('Trellis opportunity end time'), + 'help' => t('End time of the Trellis opportunity.'), + 'field' => [ + 'id' => 'date', + ], + ]; + $data['az_opportunity_trellis_data']['Attributes'] = [ + 'title' => t('Enterprise Attribute'), + 'help' => t('Trellis opportunity search API enterprise attributes'), + 'filter' => [ + 'id' => 'az_opportunity_trellis_views_attribute_filter', + ], + ]; + $data['az_opportunity_trellis_data']['Approval'] = [ + 'title' => t('Approval status'), + 'help' => t('Trellis opportunity search API approval status'), + 'filter' => [ + 'id' => 'az_opportunity_trellis_views_approval_filter', + ], + ]; + $data['az_opportunity_trellis_data']['Date'] = [ + 'title' => t('Trellis Date'), + 'help' => t('Trellis opportunity search API dates'), + 'filter' => [ + 'id' => 'az_opportunity_trellis_views_date_filter', + ], + ]; + return $data; +} diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/config/install/az_opportunity_trellis.settings.yml b/modules/custom/az_opportunity/az_opportunity_trellis/config/install/az_opportunity_trellis.settings.yml new file mode 100644 index 0000000000..99487dab9f --- /dev/null +++ b/modules/custom/az_opportunity/az_opportunity_trellis/config/install/az_opportunity_trellis.settings.yml @@ -0,0 +1 @@ +api_hostname: 'api.trellis.arizona.edu' diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/config/install/migrate_plus.migration.az_trellis_opportunity.yml b/modules/custom/az_opportunity/az_opportunity_trellis/config/install/migrate_plus.migration.az_trellis_opportunity.yml new file mode 100644 index 0000000000..b21a6f1861 --- /dev/null +++ b/modules/custom/az_opportunity/az_opportunity_trellis/config/install/migrate_plus.migration.az_trellis_opportunity.yml @@ -0,0 +1,135 @@ +langcode: en +status: true +dependencies: { } +id: az_trellis_opportunity +class: null +field_plugin_method: null +cck_plugin_method: null +migration_tags: + - Opportunity +migration_group: az_trellis_opportunity +label: 'Trellis Opportunity' +source: + plugin: az_trellis_opportunity_api + trellis_ids: { } + track_changes: true + fields: + - + name: id + label: ID + selector: Id + - + name: name + label: Name + selector: Name + - + name: url + label: URL + selector: Branded_Opportunity_URL + - + name: summary + label: Summary + selector: Summary + - + name: owner + label: 'Owner NetID' + selector: Owner_NetID + - + name: timezone + label: 'Time Zone' + selector: tz_name + - + name: start_date_time + label: 'Start Date and Time' + selector: Start_DateTime + - + name: end_date_time + label: 'End Date and Time' + selector: End_DateTime + - + name: image_url + label: 'Image URL' + selector: Image_URL + - + name: publish + label: Publish + selector: Publish_Formula + - + name: az_enterprise_attributes + label: 'Enterprise Attributes' + selector: Attributes + - + name: format + label: 'Format' + selector: Format + ids: + id: + type: string +process: + field_az_enterprise_attributes: + - plugin: flatten + source: + - az_enterprise_attributes + - format + - + plugin: multiple_values + - + plugin: callback + callable: trim + - + plugin: single_value + - + plugin: entity_lookup + entity_type: taxonomy_term + bundle_key: vid + bundle: az_enterprise_attributes + value_key: name + ignore_case: true + title: name + field_az_trellis_id: id + field_az_link/uri: url + field_az_link/title: + - + plugin: default_value + default_value: 'Event details' + field_az_summary: + - + plugin: skip_on_empty + method: process + source: summary + status: + - + plugin: get + source: publish + - + plugin: default_value + strict: true + default_value: 0 + field_az_photos/target_id: + - + plugin: migration_lookup + migration: az_trellis_opportunity_media + source: id + no_stub: true + - + plugin: skip_on_empty + method: process + field_az_event_date/value: + - + plugin: format_date + source: start_date_time + from_format: 'Y-m-d\TH:i:s.vp' + to_format: U + field_az_event_date/end_value: + - + plugin: format_date + source: end_date_time + from_format: 'Y-m-d\TH:i:s.vp' + to_format: U +destination: + plugin: 'entity:node' + default_bundle: az_opportunity + validate: false +migration_dependencies: + optional: + - az_trellis_opportunity_media diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/config/install/migrate_plus.migration_group.az_trellis_opportunity.yml b/modules/custom/az_opportunity/az_opportunity_trellis/config/install/migrate_plus.migration_group.az_trellis_opportunity.yml new file mode 100644 index 0000000000..4d73287f2a --- /dev/null +++ b/modules/custom/az_opportunity/az_opportunity_trellis/config/install/migrate_plus.migration_group.az_trellis_opportunity.yml @@ -0,0 +1,11 @@ +langcode: en +status: true +dependencies: + module: + - az_opportunity_trellis +id: az_trellis_opportunity +label: 'AZ Trellis Opportunity' +description: 'Import AZ Opportunities from Trellis Programs.' +source_type: 'Trellis Opportunity' +module: az_opportunity_trellis +shared_configuration: null diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/config/install/migrate_queue_importer.cron_migration.az_opportunity_trellis.yml b/modules/custom/az_opportunity/az_opportunity_trellis/config/install/migrate_queue_importer.cron_migration.az_opportunity_trellis.yml new file mode 100644 index 0000000000..44f43b148a --- /dev/null +++ b/modules/custom/az_opportunity/az_opportunity_trellis/config/install/migrate_queue_importer.cron_migration.az_opportunity_trellis.yml @@ -0,0 +1,13 @@ +langcode: en +status: true +dependencies: + enforced: + module: + - az_opportunity_trellis +id: az_opportunity_trellis +label: 'Quickstart Trellis Opportunity' +migration: az_trellis_opportunity +time: 43200 +update: false +sync: false +ignore_dependencies: 0 diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/config/install/views.view.az_opportunity_trellis_import.yml b/modules/custom/az_opportunity/az_opportunity_trellis/config/install/views.view.az_opportunity_trellis_import.yml new file mode 100644 index 0000000000..b297b7daca --- /dev/null +++ b/modules/custom/az_opportunity/az_opportunity_trellis/config/install/views.view.az_opportunity_trellis_import.yml @@ -0,0 +1,1053 @@ +langcode: en +status: true +dependencies: + module: + - az_opportunity_trellis + - user + - views_remote_data +id: az_opportunity_trellis_import +label: 'Trellis Opportunity Importer' +module: views +description: '' +tag: '' +base_table: az_opportunity_trellis_data +base_field: '' +display: + default: + id: default + display_title: Default + display_plugin: default + position: 0 + display_options: + title: 'Trellis Opportunity Importer' + fields: + Id: + id: Id + table: az_opportunity_trellis_data + field: Id + relationship: none + group_type: group + admin_label: '' + entity_type: null + entity_field: null + plugin_id: az_opportunity_trellis_views_field + label: 'Trellis Opportunity ID' + exclude: false + alter: + alter_text: false + text: '' + make_link: false + path: '' + absolute: false + external: false + replace_spaces: false + path_case: none + trim_whitespace: false + alt: '' + rel: '' + link_class: '' + prefix: '' + suffix: '' + target: '' + nl2br: false + max_length: 0 + word_boundary: true + ellipsis: true + more_link: false + more_link_text: '' + more_link_path: '' + strip_tags: false + trim: false + preserve_tags: '' + html: false + element_type: '' + element_class: '' + element_label_type: '' + element_label_class: '' + element_label_colon: true + element_wrapper_type: '' + element_wrapper_class: '' + element_default_classes: true + empty: '' + hide_empty: false + empty_zero: false + hide_alter_empty: true + action_title: Action + include_exclude: exclude + selected_actions: { } + property_5: + id: property_5 + table: az_opportunity_trellis_data + field: property + relationship: none + group_type: group + admin_label: '' + plugin_id: views_remote_data_property + label: 'Branded Opportunity URL' + exclude: true + alter: + alter_text: false + text: '' + make_link: false + path: '' + absolute: false + external: false + replace_spaces: false + path_case: none + trim_whitespace: false + alt: '' + rel: '' + link_class: '' + prefix: '' + suffix: '' + target: '' + nl2br: false + max_length: 0 + word_boundary: true + ellipsis: true + more_link: false + more_link_text: '' + more_link_path: '' + strip_tags: false + trim: false + preserve_tags: '' + html: false + element_type: '' + element_class: '' + element_label_type: '' + element_label_class: '' + element_label_colon: false + element_wrapper_type: '' + element_wrapper_class: '' + element_default_classes: true + empty: '' + hide_empty: false + empty_zero: false + hide_alter_empty: true + property_path: Branded_Opportunity_URL + property: + id: property + table: az_opportunity_trellis_data + field: property + relationship: none + group_type: group + admin_label: '' + plugin_id: views_remote_data_property + label: Name + exclude: false + alter: + alter_text: false + text: '' + make_link: true + path: '{{ property_5 }}' + absolute: false + external: true + replace_spaces: false + path_case: none + trim_whitespace: false + alt: '' + rel: '' + link_class: '' + prefix: '' + suffix: '' + target: _blank + nl2br: false + max_length: 0 + word_boundary: true + ellipsis: true + more_link: false + more_link_text: '' + more_link_path: '' + strip_tags: false + trim: false + preserve_tags: '' + html: false + element_type: '' + element_class: '' + element_label_type: '' + element_label_class: '' + element_label_colon: false + element_wrapper_type: '' + element_wrapper_class: '' + element_default_classes: true + empty: '' + hide_empty: false + empty_zero: false + hide_alter_empty: true + property_path: Name + property_1: + id: property_1 + table: az_opportunity_trellis_data + field: property + relationship: none + group_type: group + admin_label: '' + plugin_id: views_remote_data_property + label: Host + exclude: false + alter: + alter_text: false + text: '' + make_link: false + path: '' + absolute: false + external: false + replace_spaces: false + path_case: none + trim_whitespace: false + alt: '' + rel: '' + link_class: '' + prefix: '' + suffix: '' + target: '' + nl2br: false + max_length: 0 + word_boundary: true + ellipsis: true + more_link: false + more_link_text: '' + more_link_path: '' + strip_tags: false + trim: false + preserve_tags: '' + html: false + element_type: '' + element_class: '' + element_label_type: '' + element_label_class: '' + element_label_colon: false + element_wrapper_type: '' + element_wrapper_class: '' + element_default_classes: true + empty: '' + hide_empty: false + empty_zero: false + hide_alter_empty: true + property_path: Host + property_2: + id: property_2 + table: az_opportunity_trellis_data + field: property + relationship: none + group_type: group + admin_label: '' + plugin_id: views_remote_data_property + label: Audience + exclude: false + alter: + alter_text: false + text: '' + make_link: false + path: '' + absolute: false + external: false + replace_spaces: false + path_case: none + trim_whitespace: false + alt: '' + rel: '' + link_class: '' + prefix: '' + suffix: '' + target: '' + nl2br: false + max_length: 0 + word_boundary: true + ellipsis: true + more_link: false + more_link_text: '' + more_link_path: '' + strip_tags: false + trim: false + preserve_tags: '' + html: false + element_type: '' + element_class: '' + element_label_type: '' + element_label_class: '' + element_label_colon: true + element_wrapper_type: '' + element_wrapper_class: '' + element_default_classes: true + empty: '' + hide_empty: false + empty_zero: false + hide_alter_empty: true + property_path: Attributes.0.Audiences.0 + property_3: + id: property_3 + table: az_opportunity_trellis_data + field: property + relationship: none + group_type: group + admin_label: '' + plugin_id: views_remote_data_property + label: Topic + exclude: false + alter: + alter_text: false + text: '' + make_link: false + path: '' + absolute: false + external: false + replace_spaces: false + path_case: none + trim_whitespace: false + alt: '' + rel: '' + link_class: '' + prefix: '' + suffix: '' + target: '' + nl2br: false + max_length: 0 + word_boundary: true + ellipsis: true + more_link: false + more_link_text: '' + more_link_path: '' + strip_tags: false + trim: false + preserve_tags: '' + html: false + element_type: '' + element_class: '' + element_label_type: '' + element_label_class: '' + element_label_colon: true + element_wrapper_type: '' + element_wrapper_class: '' + element_default_classes: true + empty: '' + hide_empty: false + empty_zero: false + hide_alter_empty: true + property_path: Attributes.0.Topic.0 + property_4: + id: property_4 + table: az_opportunity_trellis_data + field: property + relationship: none + group_type: group + admin_label: '' + plugin_id: views_remote_data_property + label: Category + exclude: false + alter: + alter_text: false + text: '' + make_link: false + path: '' + absolute: false + external: false + replace_spaces: false + path_case: none + trim_whitespace: false + alt: '' + rel: '' + link_class: '' + prefix: '' + suffix: '' + target: '' + nl2br: false + max_length: 0 + word_boundary: true + ellipsis: true + more_link: false + more_link_text: '' + more_link_path: '' + strip_tags: false + trim: false + preserve_tags: '' + html: false + element_type: '' + element_class: '' + element_label_type: '' + element_label_class: '' + element_label_colon: true + element_wrapper_type: '' + element_wrapper_class: '' + element_default_classes: true + empty: '' + hide_empty: false + empty_zero: false + hide_alter_empty: true + property_path: Attributes.0.Category.0 + Start_DateTime: + id: Start_DateTime + table: az_opportunity_trellis_data + field: Start_DateTime + relationship: none + group_type: group + admin_label: '' + plugin_id: date + label: 'Start Date' + exclude: false + alter: + alter_text: false + text: '' + make_link: false + path: '' + absolute: false + external: false + replace_spaces: false + path_case: none + trim_whitespace: false + alt: '' + rel: '' + link_class: '' + prefix: '' + suffix: '' + target: '' + nl2br: false + max_length: 0 + word_boundary: true + ellipsis: true + more_link: false + more_link_text: '' + more_link_path: '' + strip_tags: false + trim: false + preserve_tags: '' + html: false + element_type: '' + element_class: '' + element_label_type: '' + element_label_class: '' + element_label_colon: true + element_wrapper_type: '' + element_wrapper_class: '' + element_default_classes: true + empty: '' + hide_empty: false + empty_zero: false + hide_alter_empty: true + date_format: custom + custom_date_format: 'm/d/Y - h:ia' + timezone: '' + Last_Modified_Date: + id: Last_Modified_Date + table: az_opportunity_trellis_data + field: Last_Modified_Date + relationship: none + group_type: group + admin_label: '' + plugin_id: date + label: Updated + exclude: false + alter: + alter_text: false + text: '' + make_link: false + path: '' + absolute: false + external: false + replace_spaces: false + path_case: none + trim_whitespace: false + alt: '' + rel: '' + link_class: '' + prefix: '' + suffix: '' + target: '' + nl2br: false + max_length: 0 + word_boundary: true + ellipsis: true + more_link: false + more_link_text: '' + more_link_path: '' + strip_tags: false + trim: false + preserve_tags: '' + html: false + element_type: '' + element_class: '' + element_label_type: '' + element_label_class: '' + element_label_colon: true + element_wrapper_type: '' + element_wrapper_class: '' + element_default_classes: true + empty: '' + hide_empty: false + empty_zero: false + hide_alter_empty: true + date_format: custom + custom_date_format: 'm/d/Y - h:ia' + timezone: '' + pager: + type: mini + options: + offset: 0 + items_per_page: 10 + total_pages: null + id: 0 + tags: + next: ›› + previous: ‹‹ + expose: + items_per_page: false + items_per_page_label: 'Items per page' + items_per_page_options: '5, 10, 25, 50' + items_per_page_options_all: false + items_per_page_options_all_label: '- All -' + offset: false + offset_label: Offset + pagination_heading_level: h4 + exposed_form: + type: basic + options: + submit_button: Search + reset_button: true + reset_button_label: Reset + exposed_sorts_label: 'Sort by' + expose_sort_order: false + sort_asc_label: Asc + sort_desc_label: Desc + access: + type: perm + options: + perm: 'create az_event content' + cache: + type: none + options: { } + empty: { } + sorts: { } + arguments: { } + filters: + property_1: + id: property_1 + table: az_opportunity_trellis_data + field: property + relationship: none + group_type: group + admin_label: '' + plugin_id: views_remote_data_property + operator: '=' + value: '' + group: 1 + exposed: true + expose: + operator_id: property_1_op + label: Owner + description: '' + use_operator: false + operator: property_1_op + operator_limit_selection: false + operator_list: { } + identifier: owner + required: false + remember: false + multiple: false + remember_roles: + authenticated: authenticated + is_grouped: false + group_info: + label: '' + description: '' + identifier: '' + optional: true + widget: select + multiple: false + remember: false + default_group: All + default_group_multiple: { } + group_items: { } + property_path: owner + property_2: + id: property_2 + table: az_opportunity_trellis_data + field: property + relationship: none + group_type: group + admin_label: '' + plugin_id: views_remote_data_property + operator: '=' + value: '' + group: 1 + exposed: true + expose: + operator_id: property_2_op + label: Host + description: '' + use_operator: false + operator: property_2_op + operator_limit_selection: false + operator_list: { } + identifier: host + required: false + remember: false + multiple: false + remember_roles: + authenticated: authenticated + is_grouped: false + group_info: + label: '' + description: '' + identifier: '' + optional: true + widget: select + multiple: false + remember: false + default_group: All + default_group_multiple: { } + group_items: { } + property_path: host + property_3: + id: property_3 + table: az_opportunity_trellis_data + field: property + relationship: none + group_type: group + admin_label: '' + plugin_id: views_remote_data_property + operator: '=' + value: '' + group: 1 + exposed: true + expose: + operator_id: property_3_op + label: 'Event ID' + description: '' + use_operator: false + operator: property_3_op + operator_limit_selection: false + operator_list: { } + identifier: id + required: false + remember: false + multiple: false + remember_roles: + authenticated: authenticated + is_grouped: false + group_info: + label: '' + description: '' + identifier: '' + optional: true + widget: select + multiple: false + remember: false + default_group: All + default_group_multiple: { } + group_items: { } + property_path: id + Attributes: + id: Attributes + table: az_opportunity_trellis_data + field: Attributes + relationship: none + group_type: group + admin_label: '' + plugin_id: az_opportunity_trellis_views_attribute_filter + operator: '=' + value: '' + group: 1 + exposed: true + expose: + operator_id: Attributes_op + label: Audience + description: '' + use_operator: false + operator: Attributes_op + operator_limit_selection: false + operator_list: { } + identifier: audience + required: false + remember: false + multiple: false + remember_roles: + authenticated: authenticated + is_grouped: false + group_info: + label: '' + description: '' + identifier: '' + optional: true + widget: select + multiple: false + remember: false + default_group: All + default_group_multiple: { } + group_items: { } + property_path: audience + az_attribute_key: Audiences__c + Attributes_1: + id: Attributes_1 + table: az_opportunity_trellis_data + field: Attributes + relationship: none + group_type: group + admin_label: '' + plugin_id: az_opportunity_trellis_views_attribute_filter + operator: '=' + value: '' + group: 1 + exposed: true + expose: + operator_id: Attributes_1_op + label: Topic + description: '' + use_operator: false + operator: Attributes_1_op + operator_limit_selection: false + operator_list: { } + identifier: topic + required: false + remember: false + multiple: false + remember_roles: + authenticated: authenticated + is_grouped: false + group_info: + label: '' + description: '' + identifier: '' + optional: true + widget: select + multiple: false + remember: false + default_group: All + default_group_multiple: { } + group_items: { } + property_path: topic + az_attribute_key: Topic__c + Attributes_2: + id: Attributes_2 + table: az_opportunity_trellis_data + field: Attributes + relationship: none + group_type: group + admin_label: '' + plugin_id: az_opportunity_trellis_views_attribute_filter + operator: '=' + value: '' + group: 1 + exposed: true + expose: + operator_id: Attributes_2_op + label: Category + description: '' + use_operator: false + operator: Attributes_2_op + operator_limit_selection: false + operator_list: { } + identifier: category + required: false + remember: false + multiple: false + remember_roles: + authenticated: authenticated + is_grouped: false + group_info: + label: '' + description: '' + identifier: '' + optional: true + widget: select + multiple: false + remember: false + default_group: All + default_group_multiple: { } + group_items: { } + property_path: category + az_attribute_key: Category1__c + Attributes_3: + id: Attributes_3 + table: az_opportunity_trellis_data + field: Attributes + relationship: none + group_type: group + admin_label: '' + plugin_id: az_opportunity_trellis_views_attribute_filter + operator: '=' + value: '' + group: 1 + exposed: true + expose: + operator_id: Attributes_3_op + label: Format + description: '' + use_operator: false + operator: Attributes_3_op + operator_limit_selection: false + operator_list: { } + identifier: format + required: false + remember: false + multiple: false + remember_roles: + authenticated: authenticated + is_grouped: false + group_info: + label: '' + description: '' + identifier: '' + optional: true + widget: select + multiple: false + remember: false + default_group: All + default_group_multiple: { } + group_items: { } + property_path: format + az_attribute_key: Event_Format__c + property: + id: property + table: az_opportunity_trellis_data + field: property + relationship: none + group_type: group + admin_label: '' + plugin_id: views_remote_data_property + operator: '=' + value: '' + group: 1 + exposed: true + expose: + operator_id: property_op + label: Keyword + description: '' + use_operator: false + operator: property_op + operator_limit_selection: false + operator_list: { } + identifier: keyword + required: false + remember: false + multiple: false + remember_roles: + authenticated: authenticated + is_grouped: false + group_info: + label: '' + description: '' + identifier: '' + optional: true + widget: select + multiple: false + remember: false + default_group: All + default_group_multiple: { } + group_items: { } + property_path: keyword + Date_1: + id: Date_1 + table: az_opportunity_trellis_data + field: Date + relationship: none + group_type: group + admin_label: '' + plugin_id: az_opportunity_trellis_views_date_filter + operator: '=' + value: + value: '' + begin: '' + end: '' + group: 1 + exposed: true + expose: + operator_id: Date_1_op + label: 'Start Date' + description: '' + use_operator: false + operator: Date_1_op + operator_limit_selection: false + operator_list: { } + identifier: start + required: false + remember: false + multiple: false + remember_roles: + authenticated: authenticated + is_grouped: false + group_info: + label: '' + description: '' + identifier: '' + optional: true + widget: select + multiple: false + remember: false + default_group: All + default_group_multiple: { } + group_items: { } + api_param: start + api_options: + 'Next 7 Days': 'Next 7 Days' + 'Next 30 Days': 'Next 30 Days' + Custom: Custom + api_param_custom_begin: start_begin + api_param_custom_end: start_end + Date: + id: Date + table: az_opportunity_trellis_data + field: Date + relationship: none + group_type: group + admin_label: '' + plugin_id: az_opportunity_trellis_views_date_filter + operator: '=' + value: + value: '' + begin: '' + end: '' + group: 1 + exposed: true + expose: + operator_id: Date_op + label: 'Updated Date' + description: '' + use_operator: false + operator: Date_op + operator_limit_selection: false + operator_list: { } + identifier: modified + required: false + remember: false + multiple: false + remember_roles: + authenticated: authenticated + is_grouped: false + group_info: + label: '' + description: '' + identifier: '' + optional: true + widget: select + multiple: false + remember: false + default_group: All + default_group_multiple: { } + group_items: { } + api_param: modified + api_options: + 'Last 7 Days': 'Last 7 Days' + 'Last 30 Days': 'Last 30 Days' + Custom: Custom + api_param_custom_begin: modified_begin + api_param_custom_end: modified_end + property_4: + id: property_4 + table: az_opportunity_trellis_data + field: property + relationship: none + group_type: group + admin_label: '' + plugin_id: views_remote_data_property + operator: '=' + value: 'true' + group: 1 + exposed: false + expose: + operator_id: '' + label: '' + description: '' + use_operator: false + operator: '' + operator_limit_selection: false + operator_list: { } + identifier: '' + required: false + remember: false + multiple: false + remember_roles: + authenticated: authenticated + is_grouped: false + group_info: + label: '' + description: '' + identifier: '' + optional: true + widget: select + multiple: false + remember: false + default_group: All + default_group_multiple: { } + group_items: { } + property_path: publish + Approval: + id: Approval + table: az_opportunity_trellis_data + field: Approval + relationship: none + group_type: group + admin_label: '' + plugin_id: az_opportunity_trellis_views_approval_filter + operator: '=' + value: approved + group: 1 + exposed: true + expose: + operator_id: Approval_op + label: 'Approved for University Calendar' + description: 'Limits results to events curated by University Communications for the University Calendar.' + use_operator: false + operator: Approval_op + operator_limit_selection: false + operator_list: { } + identifier: approval + required: false + remember: false + multiple: false + remember_roles: + authenticated: authenticated + is_grouped: false + group_info: + label: '' + description: '' + identifier: '' + optional: true + widget: select + multiple: false + remember: false + default_group: All + default_group_multiple: { } + group_items: { } + property_path: approval + filter_groups: + operator: AND + groups: + 1: AND + style: + type: table + row: + type: fields + query: + type: views_query + options: { } + relationships: { } + use_ajax: true + header: { } + footer: { } + display_extenders: { } + cache_metadata: + max-age: 0 + contexts: + - 'languages:language_interface' + - url + - url.query_args + - user.permissions + tags: + - views_remote_data + page_1: + id: page_1 + display_title: Page + display_plugin: page + position: 1 + display_options: + display_extenders: { } + path: admin/trellis-opportunity-importer + cache_metadata: + max-age: 0 + contexts: + - 'languages:language_interface' + - url + - url.query_args + - user.permissions + tags: + - views_remote_data diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/config/schema/az_opportunity_trellis.schema.yml b/modules/custom/az_opportunity/az_opportunity_trellis/config/schema/az_opportunity_trellis.schema.yml new file mode 100644 index 0000000000..576f05a01c --- /dev/null +++ b/modules/custom/az_opportunity/az_opportunity_trellis/config/schema/az_opportunity_trellis.schema.yml @@ -0,0 +1,39 @@ +views.filter_value.az_opportunity_trellis_views_date_filter: + type: views_filter + label: 'Trellis filter' + mapping: + value: + type: string + label: 'Value' + begin: + type: string + label: 'Custom Date Range Begin' + end: + type: string + label: 'Custom Date Range End' +az_opportunity_trellis.az_recurring_import_rule.*: + type: config_entity + label: Trellis Opportunity Import + mapping: + id: + type: machine_name + label: ID + label: + type: label + label: Label + uuid: + type: uuid + host: + type: string + owner: + type: string + keyword: + type: string + attributes: + type: sequence + label: ‘Enterprise Attributes’ + sequence: + type: string + label: ‘Attribute’ + approval: + type: string diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/css/az_opportunity_trellis_datewrapper.css b/modules/custom/az_opportunity/az_opportunity_trellis/css/az_opportunity_trellis_datewrapper.css new file mode 100644 index 0000000000..6fef13e186 --- /dev/null +++ b/modules/custom/az_opportunity/az_opportunity_trellis/css/az_opportunity_trellis_datewrapper.css @@ -0,0 +1,3 @@ +.az-opportunity-trellis-datewrapper.views-exposed-form__item .form-item:first-child { + margin-top: 0; +} \ No newline at end of file diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/js/az_opportunity_trellis_date.js b/modules/custom/az_opportunity/az_opportunity_trellis/js/az_opportunity_trellis_date.js new file mode 100644 index 0000000000..911cef299d --- /dev/null +++ b/modules/custom/az_opportunity/az_opportunity_trellis/js/az_opportunity_trellis_date.js @@ -0,0 +1,27 @@ +/** + * @file + * Trellis date range picker. + */ + +((Drupal, drupalSettings, once) => { + Drupal.behaviors.trellisDatePicker = { + attach(context) { + const elements = once('aztrellisdate', '.az-trellis-daterange', context); + elements.forEach((element) => { + const begin = element; + const id = element.dataset.azTrellisDaterangeEnd; + const end = document.getElementById(id); + // eslint-disable-next-line no-unused-vars, no-undef, new-cap + const picker = new easepick.create({ + element: begin, + css: drupalSettings.trellisDatePicker.css, + zIndex: 10, + RangePlugin: { + elementEnd: end, + }, + plugins: ['RangePlugin'], + }); + }); + }, + }; +})(Drupal, drupalSettings, once); diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/migrations/az_trellis_opportunity_files.yml b/modules/custom/az_opportunity/az_opportunity_trellis/migrations/az_trellis_opportunity_files.yml new file mode 100644 index 0000000000..969e87e18b --- /dev/null +++ b/modules/custom/az_opportunity/az_opportunity_trellis/migrations/az_trellis_opportunity_files.yml @@ -0,0 +1,42 @@ +id: az_trellis_opportunity_files +label: Trellis Opportunity Files +source: + plugin: az_trellis_opportunity_api + trellis_ids: { } + track_changes: true + fields: + - + name: id + label: ID + selector: Id + - + name: image_url + label: 'Image URL' + selector: Image_URL + ids: + id: + type: string + +process: + status: + plugin: default_value + default_value: 1 + + uri: + - + plugin: az_migration_remote_file + migration: az_trellis_opportunity_files + default_filename: id + directory: 'public://trellis-opportunity' + source_ids: + - id + source: image_url + - + plugin: skip_on_empty + method: row + uid: + plugin: default_value + default_value: 0 + +destination: + plugin: entity:file diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/migrations/az_trellis_opportunity_media.yml b/modules/custom/az_opportunity/az_opportunity_trellis/migrations/az_trellis_opportunity_media.yml new file mode 100644 index 0000000000..f23e074c80 --- /dev/null +++ b/modules/custom/az_opportunity/az_opportunity_trellis/migrations/az_trellis_opportunity_media.yml @@ -0,0 +1,56 @@ +id: az_trellis_opportunity_media +label: Trellis Opportunity Media +source: + plugin: az_trellis_opportunity_api + trellis_ids: { } + track_changes: true + fields: + - + name: id + label: ID + selector: Id + - + name: image_url + label: 'Image URL' + selector: Image_URL + - + name: name + label: Name + selector: Name + ids: + id: + type: string + +process: + uid: + plugin: default_value + default_value: 0 + bundle: + plugin: default_value + default_value: az_image + field_media_az_image/target_id: + - + plugin: migration_lookup + migration: az_trellis_opportunity_files + source: id + no_stub: true + - + plugin: skip_on_empty + method: row + field_media_az_image/alt: name + field_media_az_image/title: name + status: + plugin: default_value + default_value: 1 + +destination: + plugin: entity:media + +dependencies: + enforced: + module: + - az_opportunity_trellis + - az_media +migration_dependencies: + optional: + - az_trellis_opportunity_files diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/src/AZRecurringImportRuleInterface.php b/modules/custom/az_opportunity/az_opportunity_trellis/src/AZRecurringImportRuleInterface.php new file mode 100644 index 0000000000..8ba5f5d470 --- /dev/null +++ b/modules/custom/az_opportunity/az_opportunity_trellis/src/AZRecurringImportRuleInterface.php @@ -0,0 +1,30 @@ +t('Label'); + $header['id'] = $this->t('Machine name'); + $header['results'] = $this->t('Results'); + $header['status'] = $this->t('Status'); + return $header + parent::buildHeader(); + } + + /** + * {@inheritdoc} + */ + public function buildRow(EntityInterface $entity): array { + /** @var \Drupal\az_event_trellis\AZRecurringImportRuleInterface $entity */ + $row['label'] = $entity->label(); + $row['id'] = $entity->id(); + + // Get entity's query parameters. + $params = $entity->getQueryParameters(); + unset($params['publish']); + + if (!empty($params)) { + // Generate link to results page. + $row['result']['data'] = [ + '#type' => 'link', + '#title' => $this->t('View Results'), + '#url' => Url::fromRoute('view.az_event_trellis_import.page_1'), + '#options' => ['query' => $params], + '#attributes' => ['class' => 'button'], + ]; + } + else { + $row['result'] = ''; + } + $row['status'] = $entity->status() ? $this->t('Enabled') : $this->t('Disabled'); + return $row + parent::buildRow($entity); + } + +} diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/src/Controller/AZRecurringImportModalController.php b/modules/custom/az_opportunity/az_opportunity_trellis/src/Controller/AZRecurringImportModalController.php new file mode 100644 index 0000000000..1c2af8acc2 --- /dev/null +++ b/modules/custom/az_opportunity/az_opportunity_trellis/src/Controller/AZRecurringImportModalController.php @@ -0,0 +1,101 @@ +entityTypeManager = $entityTypeManager; + $this->entityFormBuilder = $entityFormBuilder; + $this->cache = $cache; + } + + /** + * {@inheritdoc} + */ + public static function create(ContainerInterface $container): self { + return new self( + $container->get('entity_type.manager'), + $container->get('entity.form_builder'), + $container->get('cache.default'), + ); + } + + /** + * Open az_recurring_import_rule configuration form as a modal. + * + * @param \Symfony\Component\HttpFoundation\Request $request + * The current request. + * + * @return \Drupal\Core\Ajax\AjaxResponse + * AjaxResponse containing command to open a modal. + */ + public function __invoke(Request $request): AjaxResponse { + $search = []; + $key = $request->query->get('search'); + // Attempt to get cached search if we have a valid cache key. + if (!empty($key) && str_starts_with($key, 'az_recurring_import_modal:')) { + // Get a cached search if there is one for our key. + $search = $this->cache->get($key)->data ?? []; + } + + // Create an AjaxResponse that opens a modal copy of the config form. + $response = new AjaxResponse(); + // Entity forms require an entity. + $config = $this->entityTypeManager->getStorage('az_recurring_import_rule')->create($search); + // Generate a copy of the configuration entity form using the stub as basis. + $config_form = $this->entityFormBuilder->getForm($config, 'add'); + // Forms generated during ajax calls do not have the right action path. + $config_form['#action'] = Url::fromRoute('entity.az_recurring_import_rule.add_form')->toString(); + // Add an ajax command to open the modal. + $response->addCommand(new OpenModalDialogCommand($this->t('Create Recurring Import'), $config_form, ['width' => '1000'])); + return $response; + } + +} diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/src/Entity/AZRecurringImportRule.php b/modules/custom/az_opportunity/az_opportunity_trellis/src/Entity/AZRecurringImportRule.php new file mode 100644 index 0000000000..9d5867b938 --- /dev/null +++ b/modules/custom/az_opportunity/az_opportunity_trellis/src/Entity/AZRecurringImportRule.php @@ -0,0 +1,129 @@ + AZRecurringImportRuleListBuilder::class, + 'form' => [ + 'add' => AZRecurringImportRuleForm::class, + 'edit' => AZRecurringImportRuleForm::class, + 'delete' => EntityDeleteForm::class, + ], + ], + config_prefix: 'az_recurring_import_rule', + admin_permission: 'administer quickstart configuration', + label_count: [ + 'singular' => '@count recurring import rule', + 'plural' => '@count recurring import rules', + ], + links: [ + 'collection' => '/admin/config/az-quickstart/settings/az-recurring-import-rule', + 'add-form' => '/admin/config/az-quickstart/settings/az-recurring-import-rule/add', + 'edit-form' => '/admin/config/az-quickstart/settings/az-recurring-import-rule/{az_recurring_import_rule}', + 'delete-form' => '/admin/config/az-quickstart/settings/az-recurring-import-rule/{az_recurring_import_rule}/delete', + ], + entity_keys: [ + 'id' => 'id', + 'label' => 'label', + 'uuid' => 'uuid', + ], + config_export: [ + 'id', + 'label', + 'owner', + 'host', + 'keyword', + 'attributes', + 'approval', + ], +)] +final class AZRecurringImportRule extends ConfigEntityBase implements AZRecurringImportRuleInterface { + + /** + * The az_recurring_import_rule ID. + */ + protected string $id; + + /** + * The az_recurring_import_rule label. + */ + protected string $label; + + /** + * The az_recurring_import_rule keyword. + */ + protected string $keyword; + + /** + * The az_recurring_import_rule owner. + */ + protected string $owner; + + /** + * The az_recurring_import_rule owner. + */ + protected string $host; + + /** + * The az_recurring_import_rule enterprise attributes. + */ + protected ?array $attributes; + + /** + * The az_recurring_import_rule approval status. + */ + protected string $approval; + + /** + * {@inheritdoc} + */ + public function getQueryParameters() { + // Build a list of query parameters. + $params = [ + 'publish' => 'true', + ]; + $attributes = array_filter($this->attributes ?? []); + $params += $attributes; + $params['keyword'] = $this->get('keyword') ?? ''; + $params['owner'] = $this->get('owner') ?? ''; + $params['host'] = $this->get('host') ?? ''; + $params['approval'] = $this->get('approval') ?? ''; + $params = array_filter($params); + return $params; + } + + /** + * {@inheritdoc} + */ + public function getEventIds() { + // Build a list of query parameters. + $params = $this->getQueryParameters(); + + // Let's refuse to search if there are no constraints except published. + if (count($params) === 1) { + return []; + } + + return \Drupal::service('az_opportunity_trellis.trellis_helper')->searchEvents($params); + } + +} diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/src/EventSubscriber/AZOpportunityTrellisDataSubscriber.php b/modules/custom/az_opportunity/az_opportunity_trellis/src/EventSubscriber/AZOpportunityTrellisDataSubscriber.php new file mode 100644 index 0000000000..3ad87067ac --- /dev/null +++ b/modules/custom/az_opportunity/az_opportunity_trellis/src/EventSubscriber/AZOpportunityTrellisDataSubscriber.php @@ -0,0 +1,157 @@ + 'onQuery', + MigrateOpportunity::POST_ROW_SAVE => 'onPostRowSave', + ]; + } + + /** + * Constructs an AZEventTrellisDataSubscriber. + * + * @param \Drupal\az_opportunity_trellis\TrellisHelper $trellisHelper + * The Trellis helper server. + * @param \Drupal\Core\Messenger\Messenger $messenger + * Database connection object. + * @param \Drupal\Core\Entity\EntityTypeManagerInterface $entityTypeManager + * The entity type manager service. + * @param \Drupal\Core\Session\AccountProxy $currentUser + * The currently logged in user. + */ + public function __construct(TrellisHelper $trellisHelper, Messenger $messenger, EntityTypeManagerInterface $entityTypeManager, AccountProxy $currentUser) { + $this->trellisHelper = $trellisHelper; + $this->messenger = $messenger; + $this->entityTypeManager = $entityTypeManager; + $this->nodeStorage = $this->entityTypeManager->getStorage('node'); + $this->currentUser = $currentUser; + } + + /** + * Respond to opportunity on migration import for relevant migrations. + * + * @param \Drupal\migrate\Event\MigratePostRowSaveEvent $event + * The post save event object. + */ + public function onPostRowSave(MigratePostRowSaveEvent $opportunity) { + $migration = $opportunity->getMigration()->getBaseId(); + $ids = $opportunity->getDestinationIdValues(); + $id = reset($ids); + if ($migration === 'az_trellis_opportunity') { + $opportunity = $this->nodeStorage->load($id); + if (!empty($opportunity)) { + $url = $opportunity->toUrl()->toString(); + // Only show message if current user has permission. + if ($this->currentUser->hasPermission('create az_opportunity content')) { + // Show status message that opportunity was imported. + $this->messenger->addMessage($this->t('Imported @opportunitytitle.', [ + '@opportunitylink' => $url, + '@opportunitytitle' => $opportunity->getTitle(), + ])); + } + } + } + } + + /** + * Subscribes to populate Trellis view results. + * + * @param \Drupal\views_remote_data\Opportunity\RemoteDataQueryEvent $opportunity + * The event. + */ + public function onQuery(RemoteDataQueryEvent $event): void { + $supported_bases = ['az_opportunity_trellis_data']; + $base_tables = array_keys($event->getView()->getBaseTables()); + if (count(array_intersect($supported_bases, $base_tables)) > 0) { + $parameters = []; + $condition_groups = $event->getConditions(); + // Check for conditional parameters. + foreach ($condition_groups as $condition_group) { + if (!empty($condition_group['conditions'])) { + foreach ($condition_group['conditions'] as $condition) { + if (!empty($condition['field'][0]) & !empty($condition['value'])) { + $parameters[$condition['field'][0]] = $condition['value']; + } + } + } + } + // Don't perform search if empty or publish is the only field. + if (empty($parameters) || (count($parameters) <= 1)) { + return; + } + $ids = $this->trellisHelper->searchopportunity($parameters); + if (!empty($ids)) { + $offset = $event->getOffset(); + $limit = $event->getLimit(); + if (!empty($limit)) { + $ids = array_slice($ids, $offset, $limit); + } + // Run data fetch request. + $results = $this->trellisHelper->getOpportunity($ids); + $datefields = [ + 'Last_Modified_Date', + 'Start_DateTime', + 'End_DateTime', + ]; + foreach ($results as $result) { + // Change date format fields to what views expects to see. + foreach ($datefields as $datefield) { + if (!empty($result[$datefield])) { + $result[$datefield] = strtotime($result[$datefield]); + } + } + $event->addResult(new ResultRow($result)); + } + } + } + } + +} diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/src/Form/AZRecurringImportRuleForm.php b/modules/custom/az_opportunity/az_opportunity_trellis/src/Form/AZRecurringImportRuleForm.php new file mode 100644 index 0000000000..2fd1df1bb5 --- /dev/null +++ b/modules/custom/az_opportunity/az_opportunity_trellis/src/Form/AZRecurringImportRuleForm.php @@ -0,0 +1,185 @@ +entityRepository = $container->get('entity.repository'); + $instance->trellisHelper = $container->get('az_opportunity_trellis.trellis_helper'); + return $instance; + } + + /** + * {@inheritdoc} + */ + public function form(array $form, FormStateInterface $form_state): array { + + $form = parent::form($form, $form_state); + /** @var \Drupal\az_opportunity_trellis\Entity\AZRecurringImportRule $entity */ + $entity = $this->entity; + // Fetch the list of attributes mapped by the API. + $mappings = $this->trellisHelper->getAttributeMappings(); + + $form['label'] = [ + '#type' => 'textfield', + '#title' => $this->t('Import Rule Name'), + '#maxlength' => 255, + '#default_value' => $entity->label(), + '#description' => $this->t('Describe this rule, e.g., Graduate Lecture Series'), + '#required' => TRUE, + ]; + + $form['id'] = [ + '#type' => 'machine_name', + '#default_value' => $this->entity->id(), + '#machine_name' => [ + 'exists' => [AZRecurringImportRule::class, 'load'], + ], + '#disabled' => !$entity->isNew(), + ]; + + $form['status'] = [ + '#type' => 'checkbox', + '#title' => $this->t('Enabled'), + '#default_value' => $entity->status(), + '#description' => $this->t('Enabled import rules will regularly import matching content into the site automatically.'), + ]; + + $form['query_parameters'] = [ + '#type' => 'details', + '#title' => $this->t('Recurring Search Parameters'), + '#description' => $this->t('When this import rule runs, the following search terms will be used.'), + '#open' => TRUE, + ]; + + $form['query_parameters']['owner'] = [ + '#type' => 'textfield', + '#title' => $this->t('Owner'), + '#maxlength' => 255, + '#default_value' => $entity->get('owner'), + ]; + + $form['query_parameters']['host'] = [ + '#type' => 'textfield', + '#title' => $this->t('Host'), + '#maxlength' => 255, + '#default_value' => $entity->get('host'), + ]; + + $form['query_parameters']['keyword'] = [ + '#type' => 'textfield', + '#title' => $this->t('Keyword'), + '#maxlength' => 255, + '#default_value' => $entity->get('keyword'), + ]; + + $form['query_parameters']['attributes']['#tree'] = TRUE; + + // Get the different attributes available. + $term_storage = $this->entityTypeManager->getStorage('taxonomy_term'); + $query = $term_storage->getQuery() + ->accessCheck(TRUE) + ->addTag('taxonomy_term_access') + ->condition('vid', 'az_enterprise_attributes') + ->condition('parent', 0) + ->sort('name') + // Only fetch attributes that have an API mapping. + ->condition('field_az_attribute_key', array_keys($mappings), 'IN'); + $attributes = $query->execute(); + $attributes = $term_storage->loadMultiple($attributes); + + // Build attribute select lists. + foreach ($attributes as $attribute) { + $options = []; + $key = $mappings[$attribute->field_az_attribute_key->value]; + $id = $attribute->id(); + + // Find the options the attribute has, in order. + $query = $term_storage->getQuery() + ->accessCheck(TRUE) + ->addTag('taxonomy_term_access') + ->condition('vid', 'az_enterprise_attributes') + ->condition('parent', $id) + ->sort('name') + ->condition('field_az_attribute_key', '', '<>'); + $terms = $query->execute(); + $terms = $term_storage->loadMultiple($terms); + foreach ($terms as $term) { + $options[$term->field_az_attribute_key->value] = $this->entityRepository->getTranslationFromContext($term)->label(); + } + + // Build the select element for the attribute. + $form['query_parameters']['attributes'][$key] = [ + '#type' => 'select', + '#options' => $options, + '#empty_option' => $this->t('- Any -'), + '#empty_value' => '', + '#title' => $this->entityRepository->getTranslationFromContext($attribute)->label(), + '#required' => FALSE, + '#default_value' => $entity->get('attributes')[$key] ?? NULL, + ]; + } + + $form['query_parameters']['approval'] = [ + '#type' => 'select', + '#title' => $this->t('Approved for University Calendar'), + '#options' => [ + 'approved' => $this->t('Approved'), + 'denied' => $this->t('Denied'), + ], + '#empty_option' => $this->t('- Any -'), + '#empty_value' => '', + '#required' => FALSE, + '#default_value' => $entity->get('approval'), + ]; + + return $form; + } + + /** + * {@inheritdoc} + */ + public function save(array $form, FormStateInterface $form_state): int { + $result = parent::save($form, $form_state); + $message_args = ['%label' => $this->entity->label()]; + $this->messenger()->addStatus( + match($result) { + \SAVED_NEW => $this->t('Created new recurring import rule %label.', $message_args), + \SAVED_UPDATED => $this->t('Updated recurring import rule %label.', $message_args), + } + ); + + $form_state->setRedirectUrl($this->entity->toUrl('collection')); + return $result; + } + +} diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/src/Form/TrellisOpportunitySettingsForm.php b/modules/custom/az_opportunity/az_opportunity_trellis/src/Form/TrellisOpportunitySettingsForm.php new file mode 100644 index 0000000000..d018341dda --- /dev/null +++ b/modules/custom/az_opportunity/az_opportunity_trellis/src/Form/TrellisOpportunitySettingsForm.php @@ -0,0 +1,53 @@ +config('az_opportunity_trellis.settings'); + + $form['api_hostname'] = [ + '#title' => $this->t("API Hostname"), + '#type' => 'textfield', + '#default_value' => $az_opportunity_trellis_config->get('api_hostname'), + ]; + + return parent::buildForm($form, $form_state); + } + + /** + * {@inheritdoc} + */ + public function submitForm(array &$form, FormStateInterface $form_state) { + $this->config('az_opportunity_trellis.settings') + ->set('api_hostname', $form_state->getValue('api_hostname')) + ->save(); + + parent::submitForm($form, $form_state); + } + +} diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/src/Plugin/migrate/source/AZTrellisOpportunitySource.php b/modules/custom/az_opportunity/az_opportunity_trellis/src/Plugin/migrate/source/AZTrellisOpportunitySource.php new file mode 100644 index 0000000000..8a2a61b0f3 --- /dev/null +++ b/modules/custom/az_opportunity/az_opportunity_trellis/src/Plugin/migrate/source/AZTrellisOpportunitySource.php @@ -0,0 +1,144 @@ +fields = $configuration['fields']; + $this->ids = $configuration['ids']; + // @todo use injection for this. + $this->trellisHelper = \Drupal::service('az_opportunity_trellis.trellis_helper'); + $this->trellisIds = $configuration['trellis_ids'] ?? []; + // If no arguments are supplied, fetch the list currently on the site. + if (empty($this->trellisIds)) { + $ids = $this->trellisHelper->getImportedOpportunityIds(); + $ids += $this->trellisHelper->getRecurringOpportunityIds(); + $this->trellisIds = array_unique($ids); + } + } + + /** + * Initializes the iterator with the source data. + * + * @return \Iterator + * Returns an iterable object of data for this source. + */ + protected function initializeIterator() { + // Fetch the opportunities via trellis API. + $items = $this->trellisHelper->getOpportunities($this->trellisIds); + $results = []; + $fields = []; + // Find field selectors. + foreach ($this->fields as $field) { + $fields[$field['name']] = $field['selector'] ?? $field['name']; + } + foreach ($items as $item) { + $result = []; + // Transform selectors into defined fields. + foreach ($fields as $field => $selector) { + if (isset($item[$selector])) { + $result[$field] = $item[$selector]; + } + } + $results[] = $result; + } + // Return an iterable. + $obj = new \ArrayObject($results); + return $obj->getIterator(); + } + + /** + * {@inheritdoc} + */ + public function prepareRow(Row $row) { + // Trellis IDs from source configuration can affect the hash of the row. + $row->setSourceProperty('trellis_ids', []); + // Perform normal source plugin hashing. + return parent::prepareRow($row); + } + + /** + * Return a string representing the source ids. + * + * @return string + * Comma-separated list of ids being imported. + */ + public function __toString(): string { + $ids = implode(', ', $this->trellisIds); + return $ids; + } + + /** + * {@inheritdoc} + */ + public function fields(): array { + $fields = []; + foreach ($this->fields as $field_info) { + $fields[$field_info['name']] = $field_info['label'] ?? $field_info['name']; + } + return $fields; + } + + /** + * {@inheritdoc} + */ + public function getIds(): array { + return $this->ids; + } + +} diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/src/Plugin/views/field/AZOpportunityTrellisViewsField.php b/modules/custom/az_opportunity/az_opportunity_trellis/src/Plugin/views/field/AZOpportunityTrellisViewsField.php new file mode 100644 index 0000000000..b523041695 --- /dev/null +++ b/modules/custom/az_opportunity/az_opportunity_trellis/src/Plugin/views/field/AZOpportunityTrellisViewsField.php @@ -0,0 +1,160 @@ +migrationRemoteTools = $container->get('az_migration_remote.tools'); + $instance->trellisHelper = $container->get('az_opportunity_trellis.trellis_helper'); + return $instance; + } + + /** + * {@inheritdoc} + */ + public function init(ViewExecutable $view, DisplayPluginBase $display, ?array &$options = NULL) { + FieldPluginBase::init($view, $display, $options); + $this->actions = []; + } + + /** + * {@inheritdoc} + */ + public function viewsForm(&$form, FormStateInterface $form_state) { + $form['#cache']['max-age'] = 0; + + $form[$this->options['id']] = [ + '#tree' => TRUE, + ]; + + foreach ($this->view->result as $row_index => $row) { + $form[$this->options['id']][$row_index] = [ + '#type' => 'checkbox', + // We are not able to determine a main "title" for each row, so we can + // only output a generic label. + '#title' => $this->t('Update this item'), + '#title_display' => 'invisible', + '#return_value' => $row->Id ?? '', + '#default_value' => !empty($form_state->getValue($this->options['id'])[$row_index]) ? 1 : NULL, + ]; + } + + // Change default BulkForm label. + if (!empty($form['actions']['submit'])) { + $form['actions']['submit']['#value'] = $this->t('Import'); + } + } + + /** + * {@inheritdoc} + */ + public function viewsFormValidate(&$form, FormStateInterface $form_state) { + $ids = $form_state->getValue($this->options['id']); + if (empty($ids) || empty(array_filter($ids))) { + $form_state->setErrorByName('', $this->emptySelectedMessage()); + } + // Unlike parent class, do not throw form error when action is empty. + } + + /** + * Submit handler for the Trellis import form. + * + * @param mixed $form + * An associative array containing the structure of the form. + * @param \Drupal\Core\Form\FormStateInterface $form_state + * The current state of the form. + * + * @throws \Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException + * Thrown when the user tried to access an action without access to it. + */ + public function viewsFormSubmit(&$form, FormStateInterface $form_state) { + $values = $form_state->getValues(); + if (!empty($values[$this->options['id']])) { + $ids = $values[$this->options['id']]; + $ids = array_filter($ids); + foreach ($ids as $value) { + if (!empty($value)) { + \Drupal::service('messenger')->addMessage($this->t('Importing Trellis Opportunity @id.', [ + '@id' => $value, + ])); + } + } + + $migrations = [ + 'az_trellis_opportunity_files' => [ + 'limit' => 0, + 'update' => 0, + 'force' => 0, + 'configuration' => [ + 'source' => [ + 'trellis_ids' => $ids, + ], + ], + ], + 'az_trellis_opportunity_media' => [ + 'limit' => 0, + 'update' => 0, + 'force' => 0, + 'configuration' => [ + 'source' => [ + 'trellis_ids' => $ids, + ], + ], + ], + 'az_trellis_opportunity' => [ + 'limit' => 0, + 'update' => 0, + 'force' => 0, + 'configuration' => [ + 'source' => [ + 'trellis_ids' => $ids, + ], + ], + ], + ]; + + $this->migrationRemoteTools->batch($migrations); + } + + } + + /** + * {@inheritdoc} + */ + public function isWorkspaceSafeForm(array $form, FormStateInterface $form_state): bool { + // This field is not backed by an entity like BulkForm expects. + return FALSE; + } + +} diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/src/Plugin/views/filter/AZOpportunityTrellisViewsApprovalFilter.php b/modules/custom/az_opportunity/az_opportunity_trellis/src/Plugin/views/filter/AZOpportunityTrellisViewsApprovalFilter.php new file mode 100644 index 0000000000..555df5c6f4 --- /dev/null +++ b/modules/custom/az_opportunity/az_opportunity_trellis/src/Plugin/views/filter/AZOpportunityTrellisViewsApprovalFilter.php @@ -0,0 +1,96 @@ + 'select', + '#title' => $this->t('Value'), + '#options' => [ + 'approved' => $this->t('Approved'), + 'denied' => $this->t('Denied'), + ], + '#required' => FALSE, + '#default_value' => $this->value, + ]; + } + + /** + * {@inheritdoc} + */ + public function operatorOptions(): array { + return [ + '=' => $this->t('Is equal to'), + '!=' => $this->t('Is not equal to'), + ]; + } + + /** + * {@inheritdoc} + */ + protected function defineOptions(): array { + $options = parent::defineOptions(); + $this->definePropertyPathOption($options); + return $options; + } + + /** + * {@inheritdoc} + */ + public function buildOptionsForm(&$form, FormStateInterface $form_state): void { + $this->propertyPathElement($form, $this->options); + parent::buildOptionsForm($form, $form_state); + } + + /** + * {@inheritdoc} + */ + public function adminSummary() { + $prop = $this->options['property_path'] ?? ''; + return '(API value ' . $prop . ') ' . $this->operator . ' ' . $this->value; + } + + /** + * {@inheritdoc} + */ + public function query($group_by = FALSE): void { + if (!($this->query instanceof RemoteDataQuery)) { + return; + } + $this->query->addWhere( + $this->options['group'], + $this->options['property_path'], + $this->value, + $this->operator + ); + } + +} diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/src/Plugin/views/filter/AZOpportunityTrellisViewsAttributeFilter.php b/modules/custom/az_opportunity/az_opportunity_trellis/src/Plugin/views/filter/AZOpportunityTrellisViewsAttributeFilter.php new file mode 100644 index 0000000000..a4e549cd24 --- /dev/null +++ b/modules/custom/az_opportunity/az_opportunity_trellis/src/Plugin/views/filter/AZOpportunityTrellisViewsAttributeFilter.php @@ -0,0 +1,170 @@ +entityRepository = $container->get('entity.repository'); + $instance->termStorage = $container->get('entity_type.manager')->getStorage('taxonomy_term'); + return $instance; + } + + /** + * {@inheritdoc} + */ + protected function valueForm(&$form, FormStateInterface $form_state): void { + $options = []; + $key = $this->options['az_attribute_key'] ?? ''; + + // Get the applicable attribute terms. + $query = $this->termStorage->getQuery() + ->accessCheck(TRUE) + ->addTag('taxonomy_term_access') + ->condition('vid', 'az_enterprise_attributes') + ->condition('field_az_attribute_key', $key); + $parents = $query->execute(); + $children = []; + if (!empty($parents)) { + $query = $this->termStorage->getQuery() + ->accessCheck(TRUE) + ->sort('name') + ->addTag('taxonomy_term_access') + ->condition('parent', $parents, 'IN'); + $children = $query->execute(); + } + $terms = Term::loadMultiple($children); + // Build option list. + foreach ($terms as $term) { + if ($term->hasField('field_az_attribute_key') && !empty($term->field_az_attribute_key->value)) { + $options[$term->field_az_attribute_key->value] = $this->entityRepository->getTranslationFromContext($term)->label(); + } + } + $form['value'] = [ + '#type' => 'select', + '#title' => $this->t('Value'), + '#options' => $options, + '#required' => FALSE, + '#access' => !empty($options), + '#default_value' => $this->value, + ]; + } + + /** + * {@inheritdoc} + */ + public function operatorOptions(): array { + return [ + '=' => $this->t('Is equal to'), + '!=' => $this->t('Is not equal to'), + ]; + } + + /** + * {@inheritdoc} + */ + protected function defineOptions(): array { + $options = parent::defineOptions(); + $this->definePropertyPathOption($options); + $options['az_attribute_key'] = ['default' => '']; + return $options; + } + + /** + * {@inheritdoc} + */ + public function buildOptionsForm(&$form, FormStateInterface $form_state): void { + $this->propertyPathElement($form, $this->options); + parent::buildOptionsForm($form, $form_state); + $form['az_attribute_key'] = [ + '#title' => $this->t('Unique key of enterprise attribute'), + '#type' => 'textfield', + '#default_value' => $this->options['az_attribute_key'] ?? '', + '#required' => TRUE, + ]; + } + + /** + * Return the attribute id and api parameter name. + * + * @return array + * An array with the key as the attribute id and the value as the api path. + */ + public function getApiMapping(): array { + $key = $this->options['az_attribute_key'] ?? ''; + $path = $this->options['property_path'] ?? ''; + return [$key => $path]; + } + + /** + * {@inheritdoc} + */ + public function adminSummary() { + $prop = $this->options['property_path'] ?? ''; + $key = $this->options['az_attribute_key'] ?? ''; + return $key . ' (API value ' . $prop . ') ' . $this->operator . ' ' . $this->value; + } + + /** + * {@inheritdoc} + */ + public function query($group_by = FALSE): void { + if (!($this->query instanceof RemoteDataQuery)) { + return; + } + $this->query->addWhere( + $this->options['group'], + $this->options['property_path'], + $this->value, + $this->operator + ); + } + +} diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/src/Plugin/views/filter/AZOpportunityTrellisViewsDateFilter.php b/modules/custom/az_opportunity/az_opportunity_trellis/src/Plugin/views/filter/AZOpportunityTrellisViewsDateFilter.php new file mode 100644 index 0000000000..22bf20d20d --- /dev/null +++ b/modules/custom/az_opportunity/az_opportunity_trellis/src/Plugin/views/filter/AZOpportunityTrellisViewsDateFilter.php @@ -0,0 +1,289 @@ + $this->t('Next 7 Days'), + 'Next 30 Days' => $this->t('Next 30 Days'), + 'Last 7 Days' => $this->t('Last 7 Days'), + 'Last 30 Days' => $this->t('Last 30 Days'), + 'Custom' => $this->t('Custom'), + ]; + return $options; + } + + /** + * The asset resolver service. + * + * @var \Drupal\Core\Asset\AssetResolver + */ + protected $assetResolver; + + /** + * The file url generator service. + * + * @var \Drupal\Core\File\FileUrlGeneratorInterface + */ + protected $fileUrlGenerator; + + /** + * {@inheritdoc} + */ + public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) { + $instance = new static( + $configuration, + $plugin_id, + $plugin_definition + ); + + $instance->assetResolver = $container->get('asset.resolver'); + $instance->fileUrlGenerator = $container->get('file_url_generator'); + return $instance; + } + + /** + * {@inheritdoc} + */ + protected function valueForm(&$form, FormStateInterface $form_state): void { + $form['value']['#tree'] = TRUE; + $form['#attached']['library'][] = 'az_opportunity_trellis/az_opportunity_trellis_date'; + // Trim valid options to selected options. + $options = $this->trellisDateOptions(); + $keys = $this->options['api_options'] ?? []; + $options = array_intersect($options, array_flip($keys)); + $form['value']['value'] = [ + '#type' => 'select', + '#options' => $options, + '#empty_option' => $this->t('- Any -'), + '#empty_value' => '', + '#required' => FALSE, + '#default_value' => $this->value['value'], + ]; + // Add label if this is the exposed form. + $exposed_info = $this->exposedInfo(); + if (!empty($exposed_info['label'])) { + $form['value']['value']['#title'] = $exposed_info['label']; + } + // Fetch library information for shadow DOM inclusion. + $css = []; + try { + $attached = AttachedAssets::createFromRenderArray([ + '#attached' => [ + 'library' => [ + 'az_opportunity_trellis/easepick_styles', + ], + ], + ]); + $assets = $this->assetResolver->getCssAssets($attached, TRUE); + foreach ($assets as $asset) { + if (!empty($asset['data'])) { + $css[] = $this->fileUrlGenerator->generateString($asset['data']); + } + } + } + catch (\Exception $e) { + // Failed to fetch assets. + } + $form['#attached']['drupalSettings']['trellisDatePicker']['css'] = $css; + // Prepare unique id for data attribute. + $end_id = Html::getUniqueId('az-trellis-daterange-end'); + $form['value']['begin'] = [ + '#type' => 'textfield', + '#title' => $this->t('Begin'), + '#attributes' => [ + 'data-az-trellis-daterange-end' => $end_id, + 'class' => ['az-trellis-daterange'], + ], + '#size' => 30, + '#default_value' => $this->value['begin'], + ]; + $form['value']['end'] = [ + '#type' => 'textfield', + '#title' => $this->t('End'), + '#attributes' => [ + 'id' => $end_id, + 'class' => ['az-trellis-daterange-end'], + ], + '#size' => 30, + '#default_value' => $this->value['end'], + ]; + // Compute conditional fields using states array. + if ($form_state->get('exposed')) { + $identifier = $this->options['expose']['identifier']; + $source = ':input[name="' . $identifier . '[value]"]'; + $state = [$source => ['value' => 'Custom']]; + $form['value']['begin']['#states']['visible'][] = $state; + $form['value']['end']['#states']['visible'][] = $state; + } + } + + /** + * {@inheritdoc} + */ + protected function buildValueWrapper(&$form, $wrapper_identifier) { + // Modify parent class behavior to be a container rather than a fieldset. + if (!isset($form[$wrapper_identifier])) { + $form[$wrapper_identifier] = [ + '#type' => 'container', + '#attributes' => [ + 'class' => [ + 'views-exposed-form__item', + 'az-opportunity-trellis-datewrapper', + ], + ], + ]; + } + } + + /** + * {@inheritdoc} + */ + public function operatorOptions(): array { + return [ + '=' => $this->t('Is equal to'), + '!=' => $this->t('Is not equal to'), + ]; + } + + /** + * {@inheritdoc} + */ + protected function defineOptions(): array { + $options = parent::defineOptions(); + $options['value'] = [ + 'contains' => [ + 'value' => ['default' => ''], + 'begin' => ['default' => ''], + 'end' => ['default' => ''], + ], + ]; + $options['api_param'] = ['default' => '']; + $options['api_options'] = ['default' => []]; + $options['api_param_custom_begin'] = ['default' => '']; + $options['api_param_custom_end'] = ['default' => '']; + return $options; + } + + /** + * {@inheritdoc} + */ + public function buildOptionsForm(&$form, FormStateInterface $form_state): void { + parent::buildOptionsForm($form, $form_state); + $form['api_options'] = [ + '#type' => 'select', + '#title' => $this->t('Trellis Date Options'), + '#options' => $this->trellisDateOptions(), + '#multiple' => TRUE, + '#required' => TRUE, + '#default_value' => $this->options['api_options'], + ]; + $form['api_param'] = [ + '#title' => $this->t('API get parameter for date'), + '#type' => 'textfield', + '#default_value' => $this->options['api_param'] ?? '', + '#required' => TRUE, + ]; + $form['api_param_custom_begin'] = [ + '#title' => $this->t('API get parameter for custom begin date'), + '#type' => 'textfield', + '#default_value' => $this->options['api_param_custom_begin'] ?? '', + '#required' => TRUE, + ]; + $form['api_param_custom_end'] = [ + '#title' => $this->t('API get parameter for custom end date'), + '#type' => 'textfield', + '#default_value' => $this->options['api_param_custom_end'] ?? '', + '#required' => TRUE, + ]; + + } + + /** + * {@inheritdoc} + */ + public function adminSummary() { + $prop = $this->options['api_param'] ?? ''; + $begin = $this->options['api_param_custom_begin'] ?? ''; + $end = $this->options['api_param_custom_end'] ?? ''; + return 'Date (API ' . $prop . ' ' . $begin . ' ' . $end . ') ' . $this->operator . ' ' . $this->value['value']; + } + + /** + * {@inheritdoc} + */ + public function query($group_by = FALSE): void { + if (!($this->query instanceof RemoteDataQuery)) { + return; + } + $value = $this->value['value'] ?? ''; + $this->query->addWhere( + $this->options['group'], + $this->options['api_param'], + $this->value['value'], + $this->operator + ); + // Handle supplied values if custom range. + if ($value === 'Custom') { + // Compute time offsets for API query. + $begin = $this->value['begin'] ?? ''; + $end = $this->value['end'] ?? ''; + $begin = strtotime($begin); + $end = strtotime($end); + if (($begin !== FALSE) && ($end !== FALSE)) { + // Find begin and end of respective days. + $begin = strtotime("today", $begin); + $end = strtotime("tomorrow", $end); + // Roll over to the previous night. + $end -= 1; + $begin = gmdate(self::TRELLIS_DATE_FORMAT, $begin); + $end = gmdate(self::TRELLIS_DATE_FORMAT, $end); + $this->query->addWhere( + $this->options['group'], + $this->options['api_param_custom_begin'], + $begin, + $this->operator + ); + $this->query->addWhere( + $this->options['group'], + $this->options['api_param_custom_end'], + $end, + $this->operator + ); + } + } + } + +} diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/src/TrellisHelper.php b/modules/custom/az_opportunity/az_opportunity_trellis/src/TrellisHelper.php new file mode 100644 index 0000000000..642d2601b7 --- /dev/null +++ b/modules/custom/az_opportunity/az_opportunity_trellis/src/TrellisHelper.php @@ -0,0 +1,314 @@ +configFactory = $config_factory; + $this->httpClient = $http_client; + $this->cache = $cache; + $this->entityTypeManager = $entity_type_manager; + } + + /** + * Search based on parameters for events. + * + * @param array $query + * Query parameters to use in search. + * + * @return array + * Array of trellis event ids. + */ + public function searchEvents(array $query) { + $ids = []; + // Compute cache key of query. + $key = 'az_trellis_event.search:' . Crypt::hashBase64(serialize($query)); + $cached = $this->cache->get($key); + // If we have this search cached, return it. + if ($cached !== FALSE) { + return $cached->data; + } + + $url = $this->getEventSearchEndpoint(); + try { + // Run search request. + $response = $this->httpClient->request('GET', $url, ['query' => $query]); + if ($response->getStatusCode() === 200) { + $json = (string) $response->getBody(); + $json = json_decode($json, TRUE); + if ($json !== NULL) { + $ids = $json['data']['Event_IDs'] ?? []; + // Ensure events are in Id order. + sort($ids); + // @todo determine cache expiration. + $expire = time() + 1800; + // Cache search result. + $this->cache->set($key, $ids, $expire); + } + } + } + catch (GuzzleException $e) { + } + return $ids; + } + + /** + * Returns event data for an array of ids. + * + * @param array $trellis_ids + * Trellis Event IDs in an array. + * + * @return array + * Event data. + */ + public function getEvents(array $trellis_ids) { + $events = []; + $fetch = []; + $url = $this->getEventEndpoint(); + // Remove any duplicate ids to mimic remote API. + $trellis_ids = array_unique($trellis_ids); + // Grab events that are in cache. + foreach ($trellis_ids as $trellis_id) { + $cached = $this->getTrellisCache($trellis_id); + if ($cached === FALSE) { + $fetch[] = $trellis_id; + } + else { + $events[] = $cached; + } + } + // Fetch events we did not have cached. + if (!empty($fetch)) { + try { + $data = ['ids' => implode(',', $fetch)]; + $response = $this->httpClient->request('POST', $url, ['json' => $data]); + if ($response->getStatusCode() === 200) { + $json = (string) $response->getBody(); + $json = json_decode($json, TRUE); + if ($json !== NULL) { + $results = $json['data'] ?? []; + foreach ($results as $result) { + // Cache the event and add it to the list. + $events[] = $this->setTrellisCache($result); + } + } + } + } + catch (GuzzleException $e) { + } + } + // Make sure events are in Id order regardless of cached/fetched. + usort($events, function ($a, $b) { + return strcmp($a['Id'], $b['Id']); + }); + return $events; + } + + /** + * Fetch the list of trellis event ids currently imported. + * + * @return array + * Returns an array of event ids. + */ + public function getImportedEventIds() { + $nodeStorage = $this->entityTypeManager->getStorage('node'); + // Check for events that have trellis ids. + $query = $nodeStorage->getQuery() + ->accessCheck(FALSE) + ->condition('type', 'az_event') + ->exists('field_az_trellis_id'); + $nids = $query->execute(); + $nodes = $nodeStorage->loadMultiple($nids); + + $event_api_ids = []; + foreach ($nodes as $n) { + $event_api_ids[] = $n->get('field_az_trellis_id')->getString(); + } + return $event_api_ids; + } + + /** + * Fetch the recurring search list of ids to import. + * + * @return array + * Returns an array of event ids. + */ + public function getRecurringEventIds() { + // Find enabled import configurations. + $imports = $this->entityTypeManager->getStorage('az_recurring_import_rule')->loadByProperties([ + 'status' => [1, TRUE], + ]); + + $event_api_ids = []; + foreach ($imports as $import) { + /** @var \Drupal\az_event_trellis\Entity\AZRecurringImportRule $import */ + $event_api_ids += $import->getEventIds(); + } + // Remove duplicates in case searches overlapped. + $event_api_ids = array_unique($event_api_ids); + return $event_api_ids; + } + + /** + * Return mapped array of api names of attributes. + * + * @return array + * The array of attribute ids mapped to API names. + */ + public function getAttributeMappings() { + $mappings = []; + $view = Views::getView('az_event_trellis_import'); + $display = $view->getDisplay() ?? NULL; + $filters = $display->getHandlers('filter'); + foreach ($filters as $filter) { + if ($filter instanceof AZEventTrellisViewsAttributeFilter) { + $mappings += $filter->getApiMapping(); + } + } + return $mappings; + } + + /** + * Returns the cache for an event if possible. + * + * @param string $trellis_id + * The trellis id of the event. + * + * @return mixed + * The cached data for the event, or FALSE. + */ + protected function getTrellisCache(string $trellis_id) { + $key = 'az_trellis_event:' . $trellis_id; + return $this->cache->get($key)->data ?? FALSE; + } + + /** + * Sets the cache for an event if possible. + * + * @param array $event + * The event data result. + * + * @return array + * The data for the event. + */ + protected function setTrellisCache(array $event) { + if (!empty($event['Id'])) { + $key = 'az_trellis_event:' . $event['Id']; + // @todo determine cache expiration. + $expire = time() + 1800; + $this->cache->set($key, $event, $expire); + } + return $event; + } + + /** + * Returns API URL for given Trellis Event ID. + * + * @param string $trellis_id + * Trellis Event ID. + * + * @return string + * Event API URL. + */ + public function getEventUrl($trellis_id) { + $hostname = $this->configFactory->get('az_event_trellis.settings')->get('api_hostname'); + return 'https://' . $hostname . self::$apiBasePath . $trellis_id; + } + + /** + * Returns API URL. + * + * @return string + * Event API URL. + */ + public function getEventEndpoint() { + $hostname = $this->configFactory->get('az_event_trellis.settings')->get('api_hostname'); + return 'https://' . $hostname . self::$apiBasePath; + } + + /** + * Returns API search URL. + * + * @return string + * Event API search URL. + */ + public function getEventSearchEndpoint() { + $hostname = $this->configFactory->get('az_event_trellis.settings')->get('api_hostname'); + return 'https://' . $hostname . self::$apiSearchPath; + } + +} diff --git a/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_row.yml b/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_row.yml index 90667e609f..ac84138058 100644 --- a/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_row.yml +++ b/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_row.yml @@ -73,6 +73,7 @@ third_party_settings: children: - group_col_1 - group_col_2 + - group_col_4 - group_col_3 label: row parent_name: group_opportunity_link @@ -101,7 +102,7 @@ third_party_settings: weight: 3 format_type: html_element format_settings: - classes: col-6 + classes: col-4 show_empty_fields: false id: '' label_as_html: false @@ -138,10 +139,10 @@ third_party_settings: label: 'Col 3' parent_name: group_row region: content - weight: 5 + weight: 6 format_type: html_element format_settings: - classes: col-3 + classes: col-2 show_empty_fields: false id: '' label_as_html: false @@ -153,14 +154,15 @@ third_party_settings: effect: none speed: fast group_col_4: - children: { } + children: + - field_az_program_date label: 'col 4' - parent_name: '' - region: hidden - weight: 1 + parent_name: group_row + region: content + weight: 5 format_type: html_element format_settings: - classes: col-2 + classes: col-3 show_empty_fields: false id: '' label_as_html: false @@ -208,6 +210,17 @@ content: third_party_settings: { } weight: 14 region: content + field_az_program_date: + type: daterange_default + label: inline + settings: + timezone_override: '' + format_type: medium + from_to: both + separator: '-' + third_party_settings: { } + weight: 1 + region: content field_az_topic: type: entity_reference_entity_view label: hidden @@ -240,7 +253,6 @@ hidden: field_az_ongoing: true field_az_opportunity_type: true field_az_parent_account: true - field_az_program_date: true field_az_program_length: true field_az_program_website: true field_az_trellis_id: true diff --git a/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.default.yml b/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.default.yml index 6a0339c207..c03f4243bb 100644 --- a/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.default.yml +++ b/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.default.yml @@ -166,7 +166,7 @@ third_party_settings: label: col7 parent_name: '' region: hidden - weight: 14 + weight: 15 format_type: html_element format_settings: classes: col7 @@ -185,7 +185,7 @@ third_party_settings: label: col8 parent_name: '' region: hidden - weight: 15 + weight: 16 format_type: html_element format_settings: classes: col @@ -338,6 +338,26 @@ third_party_settings: attributes: '' effect: none speed: fast + group_topics: + children: + - field_az_topic + label: Topics + parent_name: '' + region: content + weight: 1 + format_type: html_element + format_settings: + classes: mb-4 + show_empty_fields: false + id: '' + label_as_html: false + element: div + show_label: false + label_element: h3 + label_element_classes: '' + attributes: '' + effect: none + speed: fast smart_title: enabled: false id: node.az_opportunity.default @@ -363,10 +383,10 @@ content: trim_length: 80 url_only: false url_plain: false - rel: '' - target: '' + rel: '0' + target: '0' third_party_settings: { } - weight: 9 + weight: 10 region: content field_az_attachments: type: file_default @@ -452,7 +472,7 @@ content: settings: link: true third_party_settings: { } - weight: 6 + weight: 5 region: content field_az_program_date: type: daterange_default @@ -492,7 +512,7 @@ content: view_mode: az_badge link: false third_party_settings: { } - weight: 1 + weight: 2 region: content links: settings: { } diff --git a/modules/custom/az_opportunity/config/install/core.entity_view_display.taxonomy_term.az_opportunity_topic.az_badge.yml b/modules/custom/az_opportunity/config/install/core.entity_view_display.taxonomy_term.az_opportunity_topic.az_badge.yml index 7a2be9975b..0030b4acef 100644 --- a/modules/custom/az_opportunity/config/install/core.entity_view_display.taxonomy_term.az_opportunity_topic.az_badge.yml +++ b/modules/custom/az_opportunity/config/install/core.entity_view_display.taxonomy_term.az_opportunity_topic.az_badge.yml @@ -18,7 +18,7 @@ third_party_settings: weight: 0 format_type: link format_settings: - classes: 'badge text-bg-light badge-link' + classes: 'badge text-bg-light badge-link d-inline-block' show_empty_fields: false id: '' label_as_html: false diff --git a/modules/custom/az_opportunity/config/install/views.view.az_opportunity.yml b/modules/custom/az_opportunity/config/install/views.view.az_opportunity.yml index a0bce0a21b..4812ed0ad6 100644 --- a/modules/custom/az_opportunity/config/install/views.view.az_opportunity.yml +++ b/modules/custom/az_opportunity/config/install/views.view.az_opportunity.yml @@ -316,7 +316,7 @@ display: tags: { } block_4: id: block_4 - display_title: 'Row View Filter' + display_title: 'Row View Application Dates' display_plugin: block position: 1 display_options: @@ -551,6 +551,322 @@ display: groups: 1: AND 2: AND + 3: AND + style: + type: default + options: + row_class: '' + default_row_class: true + uses_fields: false + row: + type: 'entity:node' + options: + relationship: none + view_mode: az_row + defaults: + style: false + style_options: false + row: false + filters: false + filter_groups: false + display_description: '' + style_options: null + display_extenders: { } + cache_metadata: + max-age: -1 + contexts: + - 'languages:language_content' + - 'languages:language_interface' + - url + - url.query_args + - 'user.node_grants:view' + - user.permissions + tags: { } + block_5: + id: block_5 + display_title: 'Rows View with Filter' + display_plugin: block + position: 1 + display_options: + filters: + status: + id: status + table: node_field_data + field: status + entity_type: node + entity_field: status + plugin_id: boolean + value: '1' + group: 1 + expose: + operator: '' + type: + id: type + table: node_field_data + field: type + entity_type: node + entity_field: type + plugin_id: bundle + value: + az_opportunity: az_opportunity + group: 1 + title: + id: title + table: node_field_data + field: title + relationship: none + group_type: group + admin_label: '' + entity_type: node + entity_field: title + plugin_id: string + operator: '=' + value: '' + group: 1 + exposed: true + expose: + operator_id: title_op + label: Title + description: '' + use_operator: false + operator: title_op + operator_limit_selection: false + operator_list: { } + identifier: title + required: false + remember: false + multiple: false + remember_roles: + authenticated: authenticated + placeholder: '' + is_grouped: false + group_info: + label: '' + description: '' + identifier: '' + optional: true + widget: select + multiple: false + remember: false + default_group: All + default_group_multiple: { } + group_items: { } + field_az_location_options: + id: field_az_location_options + table: node__field_az_location + field: field_az_location_options + relationship: none + group_type: group + admin_label: '' + plugin_id: string + operator: '=' + value: '' + group: 1 + exposed: true + expose: + operator_id: field_az_location_options_op + label: Where + description: '' + use_operator: false + operator: field_az_location_options_op + operator_limit_selection: false + operator_list: { } + identifier: field_az_location_options + required: false + remember: false + multiple: false + remember_roles: + authenticated: authenticated + placeholder: '' + is_grouped: false + group_info: + label: '' + description: '' + identifier: '' + optional: true + widget: select + multiple: false + remember: false + default_group: All + default_group_multiple: { } + group_items: { } + field_az_topic_target_id: + id: field_az_topic_target_id + table: node__field_az_topic + field: field_az_topic_target_id + relationship: none + group_type: group + admin_label: '' + plugin_id: taxonomy_index_tid + operator: or + value: { } + group: 1 + exposed: true + expose: + operator_id: field_az_topic_target_id_op + label: Topic + description: '' + use_operator: false + operator: field_az_topic_target_id_op + operator_limit_selection: false + operator_list: { } + identifier: field_az_topic_target_id + required: false + remember: false + multiple: false + remember_roles: + authenticated: authenticated + reduce: false + is_grouped: false + group_info: + label: '' + description: '' + identifier: '' + optional: true + widget: select + multiple: false + remember: false + default_group: All + default_group_multiple: { } + group_items: { } + reduce_duplicates: false + vid: az_opportunity_topic + type: select + hierarchy: false + limit: true + error_message: true + field_az_modality_target_id: + id: field_az_modality_target_id + table: node__field_az_modality + field: field_az_modality_target_id + relationship: none + group_type: group + admin_label: '' + plugin_id: taxonomy_index_tid + operator: or + value: { } + group: 1 + exposed: true + expose: + operator_id: field_az_modality_target_id_op + label: Modality + description: '' + use_operator: false + operator: field_az_modality_target_id_op + operator_limit_selection: false + operator_list: { } + identifier: field_az_modality_target_id + required: false + remember: false + multiple: false + remember_roles: + authenticated: authenticated + reduce: false + is_grouped: false + group_info: + label: '' + description: '' + identifier: '' + optional: true + widget: select + multiple: false + remember: false + default_group: All + default_group_multiple: { } + group_items: { } + reduce_duplicates: false + vid: az_opportunity_modality + type: select + hierarchy: false + limit: true + error_message: true + field_az_offered_target_id: + id: field_az_offered_target_id + table: node__field_az_offered + field: field_az_offered_target_id + relationship: none + group_type: group + admin_label: '' + plugin_id: taxonomy_index_tid + operator: or + value: { } + group: 1 + exposed: true + expose: + operator_id: field_az_offered_target_id_op + label: Offered + description: '' + use_operator: false + operator: field_az_offered_target_id_op + operator_limit_selection: false + operator_list: { } + identifier: field_az_offered_target_id + required: false + remember: false + multiple: false + remember_roles: + authenticated: authenticated + reduce: false + is_grouped: false + group_info: + label: '' + description: '' + identifier: '' + optional: true + widget: select + multiple: false + remember: false + default_group: All + default_group_multiple: { } + group_items: { } + reduce_duplicates: false + vid: az_opportunity_semester + type: select + hierarchy: false + limit: true + error_message: true + field_az_incentives_value: + id: field_az_incentives_value + table: node__field_az_incentives + field: field_az_incentives_value + relationship: none + group_type: group + admin_label: '' + plugin_id: boolean + operator: '=' + value: All + group: 1 + exposed: true + expose: + operator_id: '' + label: Incentives + description: '' + use_operator: false + operator: field_az_incentives_value_op + operator_limit_selection: false + operator_list: { } + identifier: field_az_incentives_value + required: false + remember: false + multiple: false + remember_roles: + authenticated: authenticated + is_grouped: false + group_info: + label: '' + description: '' + identifier: '' + optional: true + widget: select + multiple: false + remember: false + default_group: All + default_group_multiple: { } + group_items: { } + filter_groups: + operator: AND + groups: + 1: AND style: type: default options: diff --git a/modules/custom/az_opportunity/css/az_opportunity.css b/modules/custom/az_opportunity/css/az_opportunity.css deleted file mode 100644 index 3303e8a737..0000000000 --- a/modules/custom/az_opportunity/css/az_opportunity.css +++ /dev/null @@ -1,17 +0,0 @@ -/* Override for Entity Reference Margins issue. */ - -/* CSS reason: The issue is that inline labels in the views need 0 margin, - * but labels for h3 in the default display need margin. - * @TODO: Possible fix for Barrio Bootstrap Core? - - -.field--type-entity-reference { - margin: 0 !important; -} - -.field--type-entity-reference .field__label:not(.fw-bolder) { - font-weight: 500 !important; - margin: 1.042em 0 .667em !important; -} - -*/ \ No newline at end of file diff --git a/themes/custom/az_barrio/templates/field/field--node--field_az_topic--az_opportunity.html.twig b/themes/custom/az_barrio/templates/field/field--node--field_az_topic--az_opportunity.html.twig new file mode 100644 index 0000000000..d913fad43d --- /dev/null +++ b/themes/custom/az_barrio/templates/field/field--node--field_az_topic--az_opportunity.html.twig @@ -0,0 +1,70 @@ +{# +/** + * @file + * Theme override for AZ Opportunity "topic" field. + * + * To override output, copy the "field.html.twig" from the templates directory + * to your theme's directory and customize it, just like customizing other + * Drupal templates such as page.html.twig or node.html.twig. + * + * Available variables: + * - attributes: HTML attributes for the containing element. + * - label_hidden: Whether to show the field label or not. + * - title_attributes: HTML attributes for the title. + * - label: The label for the field. + * - multiple: TRUE if a field can contain multiple items. + * - items: List of all the field items. Each item contains: + * - attributes: List of HTML attributes for each item. + * - content: The field item's content. + * - entity_type: The entity type to which the field belongs. + * - field_name: The name of the field. + * - field_type: The type of the field. + * - label_display: The display settings for the label. + * + * + * @see template_preprocess_field() + */ +#} +{% + set classes = [ + 'field', + 'field--name-' ~ field_name|clean_class, + 'field--type-' ~ field_type|clean_class, + 'field--label-' ~ label_display, + 'd-inline', + 'az-opportunity-categories-list', + ] +%} +{% + set title_classes = [ + 'field__label', + label_display == 'visually_hidden' ? 'visually-hidden', + ] +%} + +{% if label_hidden %} + {% if multiple %} + + {% for item in items %} + {{ item.content }} + {% endfor %} + + {% else %} + {% for item in items %} + {{ item.content }} + {% endfor %} + {% endif %} +{% else %} + + {{ label }} + {% if multiple %} +
+ {% endif %} + {% for item in items %} + {{ item.content }}
+ {% endfor %} + {% if multiple %} + + {% endif %} + +{% endif %} From 780c28e5e8f3cc4c93a95fb629a32fdf7581af29 Mon Sep 17 00:00:00 2001 From: Z Saenz Date: Mon, 26 Jan 2026 11:40:05 -0700 Subject: [PATCH 09/59] Updates view and style, adds dependency to link_class --- .../az_opportunity/az_opportunity.info.yml | 11 +- .../az_opportunitty_trellis.install | 35 - .../az_opportunity_trellis.info.yml | 21 - .../az_opportunity_trellis.libraries.yml | 18 - .../az_opportunity_trellis.links.action.yml | 5 - .../az_opportunity_trellis.links.task.yml | 18 - .../az_opportunity_trellis.module | 171 --- .../az_opportunity_trellis.routing.yml | 47 - .../az_opportunity_trellis.services.yml | 17 - .../az_opportunity_trellis.views.inc | 69 -- .../az_opportunity_trellis.settings.yml | 1 - ..._plus.migration.az_trellis_opportunity.yml | 135 --- ...migration_group.az_trellis_opportunity.yml | 11 - ....cron_migration.az_opportunity_trellis.yml | 13 - ...ews.view.az_opportunity_trellis_import.yml | 1053 ----------------- .../schema/az_opportunity_trellis.schema.yml | 39 - .../az_opportunity_trellis_datewrapper.css | 3 - .../js/az_opportunity_trellis_date.js | 27 - .../az_trellis_opportunity_files.yml | 42 - .../az_trellis_opportunity_media.yml | 56 - .../src/AZRecurringImportRuleInterface.php | 30 - .../src/AZRecurringImportRuleListBuilder.php | 56 - .../AZRecurringImportModalController.php | 101 -- .../src/Entity/AZRecurringImportRule.php | 129 -- .../AZOpportunityTrellisDataSubscriber.php | 157 --- .../src/Form/AZRecurringImportRuleForm.php | 185 --- .../Form/TrellisOpportunitySettingsForm.php | 53 - .../source/AZTrellisOpportunitySource.php | 144 --- .../field/AZOpportunityTrellisViewsField.php | 160 --- ...ZOpportunityTrellisViewsApprovalFilter.php | 96 -- ...OpportunityTrellisViewsAttributeFilter.php | 170 --- .../AZOpportunityTrellisViewsDateFilter.php | 289 ----- .../src/TrellisHelper.php | 314 ----- .../az_opportunity/config/install/.htaccess | 24 - ...rm_display.node.az_opportunity.default.yml | 6 +- ...ew_display.node.az_opportunity.az_card.yml | 44 +- ...ew_display.node.az_opportunity.default.yml | 123 +- ...storage.node.field_az_application_date.yml | 1 - ...eld.storage.node.field_az_program_date.yml | 1 - .../install/views.view.az_opportunity.yml | 420 +++++-- query.sql | 8 + 41 files changed, 460 insertions(+), 3843 deletions(-) delete mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/az_opportunitty_trellis.install delete mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.info.yml delete mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.libraries.yml delete mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.links.action.yml delete mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.links.task.yml delete mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.module delete mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.routing.yml delete mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.services.yml delete mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.views.inc delete mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/config/install/az_opportunity_trellis.settings.yml delete mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/config/install/migrate_plus.migration.az_trellis_opportunity.yml delete mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/config/install/migrate_plus.migration_group.az_trellis_opportunity.yml delete mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/config/install/migrate_queue_importer.cron_migration.az_opportunity_trellis.yml delete mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/config/install/views.view.az_opportunity_trellis_import.yml delete mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/config/schema/az_opportunity_trellis.schema.yml delete mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/css/az_opportunity_trellis_datewrapper.css delete mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/js/az_opportunity_trellis_date.js delete mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/migrations/az_trellis_opportunity_files.yml delete mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/migrations/az_trellis_opportunity_media.yml delete mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/src/AZRecurringImportRuleInterface.php delete mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/src/AZRecurringImportRuleListBuilder.php delete mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/src/Controller/AZRecurringImportModalController.php delete mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/src/Entity/AZRecurringImportRule.php delete mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/src/EventSubscriber/AZOpportunityTrellisDataSubscriber.php delete mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/src/Form/AZRecurringImportRuleForm.php delete mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/src/Form/TrellisOpportunitySettingsForm.php delete mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/src/Plugin/migrate/source/AZTrellisOpportunitySource.php delete mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/src/Plugin/views/field/AZOpportunityTrellisViewsField.php delete mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/src/Plugin/views/filter/AZOpportunityTrellisViewsApprovalFilter.php delete mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/src/Plugin/views/filter/AZOpportunityTrellisViewsAttributeFilter.php delete mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/src/Plugin/views/filter/AZOpportunityTrellisViewsDateFilter.php delete mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/src/TrellisHelper.php delete mode 100644 modules/custom/az_opportunity/config/install/.htaccess create mode 100644 query.sql diff --git a/modules/custom/az_opportunity/az_opportunity.info.yml b/modules/custom/az_opportunity/az_opportunity.info.yml index 55ab3190e0..b7f81a7a94 100644 --- a/modules/custom/az_opportunity/az_opportunity.info.yml +++ b/modules/custom/az_opportunity/az_opportunity.info.yml @@ -10,22 +10,23 @@ dependencies: - az_core:az_core - calendar_link:calendar_link - date_ap_style:date_ap_style - - drupal:datetime_range - - drupal:field - field_group:field_group - jquery_ui_datepicker:jquery_ui_datepicker + - drupal:datetime_range + - drupal:field - drupal:file - drupal:link + - drupal:link_class - drupal:media - drupal:media_library - drupal:menu_ui - drupal:node - drupal:path + - drupal:taxonomy + - drupal:text + - drupal:user - pathauto:pathauto - smart_date:smart_date - smart_date:smart_date_recur - smart_title:smart_title - - drupal:taxonomy - - drupal:text - - drupal:user - views_bootstrap:views_bootstrap diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunitty_trellis.install b/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunitty_trellis.install deleted file mode 100644 index 9e2cd74a19..0000000000 --- a/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunitty_trellis.install +++ /dev/null @@ -1,35 +0,0 @@ -install(['views_remote_data']); -} - -/** - * Ensure az_recurring_import_rule entity type is installed. - */ -function az_opportunity_trellis_update_1021001() { - $changes = \Drupal::entityDefinitionUpdateManager()->getChangeList(); - $status = $changes['az_recurring_import_rule']['entity_type'] ?? ''; - // Determine if recurring import rule entity needs to be created. - if ($status === EntityDefinitionUpdateManagerInterface::DEFINITION_CREATED) { - $entity_type_definition = \Drupal::service('entity_type.manager')->getDefinition('az_recurring_import_rule'); - \Drupal::entityDefinitionUpdateManager()->installEntityType($entity_type_definition); - } -} - -/** - * Ensure az_migration_remote is installed. - */ -function az_opportunity_trellis_update_1021301() { - \Drupal::service('module_installer')->install(['az_migration_remote']); -} diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.info.yml b/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.info.yml deleted file mode 100644 index 3748a260a9..0000000000 --- a/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.info.yml +++ /dev/null @@ -1,21 +0,0 @@ -name: Quickstart Opportunity - Trellis Importer -type: module -description: 'Import opportunities from Trellis Progrmas, the official University of Arizona programs management tool.' -core_version_requirement: ^10 || ^11 || ^12 -package: 'The University of Arizona - Experimental' -lifecycle: experimental -lifecycle_link: 'https://github.com/az-digital/az_quickstart/blob/main/RELEASES.md#experimental-features' -php: 8.0 - -dependencies: - - az_core:az_core - - az_opportunity:az_opportunity - - az_migration:az_migration_remote - - drupal:views - - drupal:migrate - - migrate_plus:migrate_plus - - migrate_tools:migrate_tools - - migrate_queue_importer:migrate_queue_importer - - views_remote_data:views_remote_data - -configure: az_opportunity_trellis.settings \ No newline at end of file diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.libraries.yml b/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.libraries.yml deleted file mode 100644 index 02849af8d1..0000000000 --- a/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.libraries.yml +++ /dev/null @@ -1,18 +0,0 @@ -az_opportunity_trellis_date: - js: - js/az_opportunity_trellis_date.js: {} - css: - theme: - css/az_opportunity_trellis_datewrapper.css: {} - dependencies: - - core/drupal - - core/drupalSettings - - core/once - - az_opportunity_trellis/easepick_bundle -easepick_bundle: - js: - /libraries/easepick--bundle/dist/index.umd.js: { minified: true } -easepick_styles: - css: - theme: - /libraries/easepick--bundle/dist/index.css: { minified: true } diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.links.action.yml b/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.links.action.yml deleted file mode 100644 index 2fbeb0bbfe..0000000000 --- a/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.links.action.yml +++ /dev/null @@ -1,5 +0,0 @@ -entity.az_recurring_import_rule.add_form: - route_name: 'entity.az_recurring_import_rule.add_form' - title: 'Add Recurring Import Rule' - appears_on: - - entity.az_recurring_import_rule.collection diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.links.task.yml b/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.links.task.yml deleted file mode 100644 index d2b3ae045e..0000000000 --- a/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.links.task.yml +++ /dev/null @@ -1,18 +0,0 @@ -az_opportunity_trellis.az_opportunity_trellis_settings_task: - route_name: az_opportunity_trellis.settings - title: 'AZ Trellis Opportunity Importer' - base_route: az_core.az_settings - weight: 0 - -az_opportunity.import_form_task: - title: 'Trellis opportunity importer' - route_name: view.az_opportunity_trellis_import.page_1 - parent_id: system.admin_content - description: 'Import opportunities from the Trellis Opportunity API.' - weight: 101 - -az_opportunity_trellis.az_recurring_import_rules_tab: - route_name: entity.az_recurring_import_rule.collection - title: 'Recurring Imports' - base_route: az_core.az_settings - weight: 5 diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.module b/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.module deleted file mode 100644 index ae4d6bd17d..0000000000 --- a/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.module +++ /dev/null @@ -1,171 +0,0 @@ -getFormObject(); - if ($form_object instanceof EntityFormInterface) { - /** @var \Drupal\node\NodeInterface $node */ - $node = $form_object->getEntity(); - $trellis_id = $node->get('field_az_trellis_id')->getString(); - if (!empty($trellis_id)) { - $trellis_link_url = TrellisHelper::$eventViewBasePath . $trellis_id . '/view'; - $trellis_warning = t('This opportunity has been imported from Trellis Programs. Opportunity details can only be edited by a Trellis user in Trellis Programs.', [ - '@trellis-url' => $trellis_link_url, - ]); - \Drupal::messenger()->addWarning($trellis_warning); - - $disabled_fields = [ - 'title', - // 'title', // Original fields for reference - // 'field_az_location', - // 'field_az_event_date', - // 'field_az_link', - // 'field_az_summary', - // 'field_az_photos', - // 'field_az_enterprise_attributes', - 'field_az_application_date', - 'field_az_application_link', - 'field_az_audiences', - 'field_az_credit', - 'field_az_incentives', - 'field_az_modality', - 'field_az_offered', - 'field_az_ongoing', - 'field_az_opportunity_type', - 'field_az_media_image', - 'field_az_program_date', - 'field_az_program_length', - 'field_az_program_website', - 'field_az_topic', - 'field_az_location' - ]; - foreach ($disabled_fields as $field) { - $form[$field]['#disabled'] = TRUE; - } - - $no_access_fields = [ - // 'field_az_subheading', - 'field_az_body', - //'field_az_contacts', - 'field_az_attachments', - ]; - foreach ($no_access_fields as $field) { - $form[$field]['#access'] = FALSE; - } - } - } -} - -/** - * Gather exposed API parameters from view. - * - * @param mixed $form - * An associative array containing the structure of the form. - * @param \Drupal\Core\Form\FormStateInterface $form_state - * The current state of the form. - * - * @return array - * The remote API search values. - */ -function az_opportunity_trellis_gather_filter_options(&$form, FormStateInterface $form_state) { - $search = []; - /** @var \Drupal\views\ViewExecutable $view */ - $view = $form_state->get('view'); - // Consult the filter handlers of the view. - if (!empty($view->filter)) { - /** @var \Drupal\views\Plugin\views\ViewsHandlerInterface[] $handlers */ - $handlers = $view->filter; - // Get exposed search information. - $input = $view->getExposedInput(); - if (empty($input)) { - return []; - } - // Loops through handlers to find inputs we want. - /** @var \Drupal\views\Plugin\views\filter\FilterPluginBase $handler */ - foreach ($handlers as $handler) { - if ($handler->isExposed()) { - $info = $handler->exposedInfo(); - $identifier = $info['value'] ?? ''; - // Make sure our input for this exposed filter isn't NULL. - // This won't normally happen in an actual GET form. - if (!isset($input[$identifier])) { - $input[$identifier] = ''; - } - // Check if the handler validates versus the input. - if ($handler->acceptExposedInput($input)) { - // If the handler accepts the input, bundle it up. - $value = $input[$identifier] ?? ''; - if (!empty($identifier) && !empty($value)) { - if ($handler instanceof AZOpportunityTrellisViewsAttributeFilter) { - // Attributes handled separately since they are from a remote API. - $search['attributes'][$identifier] = $value; - } - else { - $search[$identifier] = $value; - } - } - } - } - } - } - // Don't return id or date fields, unnecessary for recurring imports. - unset($search['id']); - unset($search['start']); - unset($search['modified']); - return $search; -} - -/** - * Implements hook_form_FORM_ID_alter(). - * - * Add clickable link that opens import configuration modal. - */ -function az_opportunity_trellis_form_views_exposed_form_alter(&$form, FormStateInterface $form_state, $form_id) { - - $view = $form_state->get('view'); - if (($view->id() === 'az_opportunity_trellis_import') && ($view->current_display === 'page_1')) { - - // Don't create configuration link if user does not have permission. - if (!\Drupal::currentUser()->hasPermission('administer quickstart configuration')) { - return; - } - $search = az_opportunity_trellis_gather_filter_options($form, $form_state); - if (!empty($search)) { - // We cannot use an ajax response here to open a dialog. - // Exposed forms do not support ajax callbacks. Cache search parameters. - // Compute cache key of parameters. - $key = 'az_recurring_import_modal:' . Crypt::hashBase64(serialize($search)); - $expire = time() + 1200; - // Cache the search. - \Drupal::service('cache.default')->set($key, $search, $expire); - $form['#attached']['library'][] = 'core/drupal.dialog.ajax'; - // Add a link to open the modal. - $form['actions']['recurring'] = [ - '#type' => 'link', - '#title' => t('Create Recurring Import'), - '#url' => Url::fromRoute('entity.az_recurring_import_rule.modal'), - // Pass the search parameters cache key as an argument. - '#options' => ['query' => ['search' => $key]], - '#attributes' => ['class' => ['use-ajax', 'button']], - ]; - } - } -} diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.routing.yml b/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.routing.yml deleted file mode 100644 index 607ac65714..0000000000 --- a/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.routing.yml +++ /dev/null @@ -1,47 +0,0 @@ -az_opportunity_trellis.settings: - path: '/admin/config/az-quickstart/settings/az-opportunity-trellis' - defaults: - _form: '\Drupal\az_opportunity_trellis\Form\TrellisOpportunitySettingsForm' - _title: 'Trellis Opportunity Importer Settings' - requirements: - _permission: 'administer quickstart configuration' - -entity.az_recurring_import_rule.collection: - path: '/admin/config/az-quickstart/settings/az-recurring-import-rule' - defaults: - _entity_list: 'az_recurring_import_rule' - _title: 'Recurring Import Rule configuration' - requirements: - _permission: 'administer quickstart configuration' - -entity.az_recurring_import_rule.add_form: - path: '/admin/config/az-quickstart/settings/az-recurring-import-rule/add' - defaults: - _entity_form: 'az_recurring_import_rule.add' - _title: 'Add a recurring import rule' - requirements: - _permission: 'administer quickstart configuration' - -entity.az_recurring_import_rule.edit_form: - path: '/admin/config/az-quickstart/settings/az-recurring-import-rule/{az_recurring_import_rule}' - defaults: - _entity_form: 'az_recurring_import_rule.edit' - _title: 'Edit a recurring import rule' - requirements: - _permission: 'administer quickstart configuration' - -entity.az_recurring_import_rule.delete_form: - path: '/admin/config/az-quickstart/settings/az-recurring-import-rule/{az_recurring_import_rule}/delete' - defaults: - _entity_form: 'az_recurring_import_rule.delete' - _title: 'Delete a recurring import rule' - requirements: - _permission: 'administer quickstart configuration' - -entity.az_recurring_import_rule.modal: - path: '/admin/az-opportunity-trellis-modal' - defaults: - _title: 'Entity Az Recurring Import Rule Modal' - _controller: '\Drupal\az_opportunity_trellis\Controller\AZRecurringImportModalController' - requirements: - _permission: 'administer quickstart configuration' diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.services.yml b/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.services.yml deleted file mode 100644 index cab26fdcf7..0000000000 --- a/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.services.yml +++ /dev/null @@ -1,17 +0,0 @@ -services: - _defaults: - autoconfigure: true - az_opportunity_trellis.trellis_helper: - class: Drupal\az_opportunity_trellis\TrellisHelper - arguments: - - '@config.factory' - - '@http_client' - - '@cache.default' - - '@entity_type.manager' - az_opportunity_trellis.trellis_opportunity_data: - class: Drupal\az_opportunity_trellis\EventSubscriber\AZOpportunityTrellisDataSubscriber - arguments: - - '@az_opportunity_trellis.trellis_helper' - - '@messenger' - - '@entity_type.manager' - - '@current_user' diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.views.inc b/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.views.inc deleted file mode 100644 index 57616a1d11..0000000000 --- a/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.views.inc +++ /dev/null @@ -1,69 +0,0 @@ - t('Trellis Opportunities'), - 'query_id' => 'views_remote_data_query', - ]; - $data['az_opportunity_trellis_data']['Id'] = [ - 'title' => t('Trellis Opportunity ID'), - 'help' => t('Unique key of Trellis opportunity.'), - 'field' => [ - 'id' => 'az_opportunity_trellis_views_field', - ], - ]; - $data['az_opportunity_trellis_data']['Last_Modified_Date'] = [ - 'title' => t('Trellis opportunity modification time'), - 'help' => t('Time of the Trellis opportunity was last modified'), - 'field' => [ - 'id' => 'date', - ], - ]; - $data['az_opportunity_trellis_data']['Start_DateTime'] = [ - 'title' => t('Trellis opportunity start time'), - 'help' => t('Start time of the Trellis opportunity.'), - 'field' => [ - 'id' => 'date', - ], - ]; - $data['az_opportunity_trellis_data']['End_DateTime'] = [ - 'title' => t('Trellis opportunity end time'), - 'help' => t('End time of the Trellis opportunity.'), - 'field' => [ - 'id' => 'date', - ], - ]; - $data['az_opportunity_trellis_data']['Attributes'] = [ - 'title' => t('Enterprise Attribute'), - 'help' => t('Trellis opportunity search API enterprise attributes'), - 'filter' => [ - 'id' => 'az_opportunity_trellis_views_attribute_filter', - ], - ]; - $data['az_opportunity_trellis_data']['Approval'] = [ - 'title' => t('Approval status'), - 'help' => t('Trellis opportunity search API approval status'), - 'filter' => [ - 'id' => 'az_opportunity_trellis_views_approval_filter', - ], - ]; - $data['az_opportunity_trellis_data']['Date'] = [ - 'title' => t('Trellis Date'), - 'help' => t('Trellis opportunity search API dates'), - 'filter' => [ - 'id' => 'az_opportunity_trellis_views_date_filter', - ], - ]; - return $data; -} diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/config/install/az_opportunity_trellis.settings.yml b/modules/custom/az_opportunity/az_opportunity_trellis/config/install/az_opportunity_trellis.settings.yml deleted file mode 100644 index 99487dab9f..0000000000 --- a/modules/custom/az_opportunity/az_opportunity_trellis/config/install/az_opportunity_trellis.settings.yml +++ /dev/null @@ -1 +0,0 @@ -api_hostname: 'api.trellis.arizona.edu' diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/config/install/migrate_plus.migration.az_trellis_opportunity.yml b/modules/custom/az_opportunity/az_opportunity_trellis/config/install/migrate_plus.migration.az_trellis_opportunity.yml deleted file mode 100644 index b21a6f1861..0000000000 --- a/modules/custom/az_opportunity/az_opportunity_trellis/config/install/migrate_plus.migration.az_trellis_opportunity.yml +++ /dev/null @@ -1,135 +0,0 @@ -langcode: en -status: true -dependencies: { } -id: az_trellis_opportunity -class: null -field_plugin_method: null -cck_plugin_method: null -migration_tags: - - Opportunity -migration_group: az_trellis_opportunity -label: 'Trellis Opportunity' -source: - plugin: az_trellis_opportunity_api - trellis_ids: { } - track_changes: true - fields: - - - name: id - label: ID - selector: Id - - - name: name - label: Name - selector: Name - - - name: url - label: URL - selector: Branded_Opportunity_URL - - - name: summary - label: Summary - selector: Summary - - - name: owner - label: 'Owner NetID' - selector: Owner_NetID - - - name: timezone - label: 'Time Zone' - selector: tz_name - - - name: start_date_time - label: 'Start Date and Time' - selector: Start_DateTime - - - name: end_date_time - label: 'End Date and Time' - selector: End_DateTime - - - name: image_url - label: 'Image URL' - selector: Image_URL - - - name: publish - label: Publish - selector: Publish_Formula - - - name: az_enterprise_attributes - label: 'Enterprise Attributes' - selector: Attributes - - - name: format - label: 'Format' - selector: Format - ids: - id: - type: string -process: - field_az_enterprise_attributes: - - plugin: flatten - source: - - az_enterprise_attributes - - format - - - plugin: multiple_values - - - plugin: callback - callable: trim - - - plugin: single_value - - - plugin: entity_lookup - entity_type: taxonomy_term - bundle_key: vid - bundle: az_enterprise_attributes - value_key: name - ignore_case: true - title: name - field_az_trellis_id: id - field_az_link/uri: url - field_az_link/title: - - - plugin: default_value - default_value: 'Event details' - field_az_summary: - - - plugin: skip_on_empty - method: process - source: summary - status: - - - plugin: get - source: publish - - - plugin: default_value - strict: true - default_value: 0 - field_az_photos/target_id: - - - plugin: migration_lookup - migration: az_trellis_opportunity_media - source: id - no_stub: true - - - plugin: skip_on_empty - method: process - field_az_event_date/value: - - - plugin: format_date - source: start_date_time - from_format: 'Y-m-d\TH:i:s.vp' - to_format: U - field_az_event_date/end_value: - - - plugin: format_date - source: end_date_time - from_format: 'Y-m-d\TH:i:s.vp' - to_format: U -destination: - plugin: 'entity:node' - default_bundle: az_opportunity - validate: false -migration_dependencies: - optional: - - az_trellis_opportunity_media diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/config/install/migrate_plus.migration_group.az_trellis_opportunity.yml b/modules/custom/az_opportunity/az_opportunity_trellis/config/install/migrate_plus.migration_group.az_trellis_opportunity.yml deleted file mode 100644 index 4d73287f2a..0000000000 --- a/modules/custom/az_opportunity/az_opportunity_trellis/config/install/migrate_plus.migration_group.az_trellis_opportunity.yml +++ /dev/null @@ -1,11 +0,0 @@ -langcode: en -status: true -dependencies: - module: - - az_opportunity_trellis -id: az_trellis_opportunity -label: 'AZ Trellis Opportunity' -description: 'Import AZ Opportunities from Trellis Programs.' -source_type: 'Trellis Opportunity' -module: az_opportunity_trellis -shared_configuration: null diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/config/install/migrate_queue_importer.cron_migration.az_opportunity_trellis.yml b/modules/custom/az_opportunity/az_opportunity_trellis/config/install/migrate_queue_importer.cron_migration.az_opportunity_trellis.yml deleted file mode 100644 index 44f43b148a..0000000000 --- a/modules/custom/az_opportunity/az_opportunity_trellis/config/install/migrate_queue_importer.cron_migration.az_opportunity_trellis.yml +++ /dev/null @@ -1,13 +0,0 @@ -langcode: en -status: true -dependencies: - enforced: - module: - - az_opportunity_trellis -id: az_opportunity_trellis -label: 'Quickstart Trellis Opportunity' -migration: az_trellis_opportunity -time: 43200 -update: false -sync: false -ignore_dependencies: 0 diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/config/install/views.view.az_opportunity_trellis_import.yml b/modules/custom/az_opportunity/az_opportunity_trellis/config/install/views.view.az_opportunity_trellis_import.yml deleted file mode 100644 index b297b7daca..0000000000 --- a/modules/custom/az_opportunity/az_opportunity_trellis/config/install/views.view.az_opportunity_trellis_import.yml +++ /dev/null @@ -1,1053 +0,0 @@ -langcode: en -status: true -dependencies: - module: - - az_opportunity_trellis - - user - - views_remote_data -id: az_opportunity_trellis_import -label: 'Trellis Opportunity Importer' -module: views -description: '' -tag: '' -base_table: az_opportunity_trellis_data -base_field: '' -display: - default: - id: default - display_title: Default - display_plugin: default - position: 0 - display_options: - title: 'Trellis Opportunity Importer' - fields: - Id: - id: Id - table: az_opportunity_trellis_data - field: Id - relationship: none - group_type: group - admin_label: '' - entity_type: null - entity_field: null - plugin_id: az_opportunity_trellis_views_field - label: 'Trellis Opportunity ID' - exclude: false - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: true - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - action_title: Action - include_exclude: exclude - selected_actions: { } - property_5: - id: property_5 - table: az_opportunity_trellis_data - field: property - relationship: none - group_type: group - admin_label: '' - plugin_id: views_remote_data_property - label: 'Branded Opportunity URL' - exclude: true - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: false - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - property_path: Branded_Opportunity_URL - property: - id: property - table: az_opportunity_trellis_data - field: property - relationship: none - group_type: group - admin_label: '' - plugin_id: views_remote_data_property - label: Name - exclude: false - alter: - alter_text: false - text: '' - make_link: true - path: '{{ property_5 }}' - absolute: false - external: true - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: _blank - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: false - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - property_path: Name - property_1: - id: property_1 - table: az_opportunity_trellis_data - field: property - relationship: none - group_type: group - admin_label: '' - plugin_id: views_remote_data_property - label: Host - exclude: false - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: false - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - property_path: Host - property_2: - id: property_2 - table: az_opportunity_trellis_data - field: property - relationship: none - group_type: group - admin_label: '' - plugin_id: views_remote_data_property - label: Audience - exclude: false - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: true - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - property_path: Attributes.0.Audiences.0 - property_3: - id: property_3 - table: az_opportunity_trellis_data - field: property - relationship: none - group_type: group - admin_label: '' - plugin_id: views_remote_data_property - label: Topic - exclude: false - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: true - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - property_path: Attributes.0.Topic.0 - property_4: - id: property_4 - table: az_opportunity_trellis_data - field: property - relationship: none - group_type: group - admin_label: '' - plugin_id: views_remote_data_property - label: Category - exclude: false - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: true - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - property_path: Attributes.0.Category.0 - Start_DateTime: - id: Start_DateTime - table: az_opportunity_trellis_data - field: Start_DateTime - relationship: none - group_type: group - admin_label: '' - plugin_id: date - label: 'Start Date' - exclude: false - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: true - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - date_format: custom - custom_date_format: 'm/d/Y - h:ia' - timezone: '' - Last_Modified_Date: - id: Last_Modified_Date - table: az_opportunity_trellis_data - field: Last_Modified_Date - relationship: none - group_type: group - admin_label: '' - plugin_id: date - label: Updated - exclude: false - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: true - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - date_format: custom - custom_date_format: 'm/d/Y - h:ia' - timezone: '' - pager: - type: mini - options: - offset: 0 - items_per_page: 10 - total_pages: null - id: 0 - tags: - next: ›› - previous: ‹‹ - expose: - items_per_page: false - items_per_page_label: 'Items per page' - items_per_page_options: '5, 10, 25, 50' - items_per_page_options_all: false - items_per_page_options_all_label: '- All -' - offset: false - offset_label: Offset - pagination_heading_level: h4 - exposed_form: - type: basic - options: - submit_button: Search - reset_button: true - reset_button_label: Reset - exposed_sorts_label: 'Sort by' - expose_sort_order: false - sort_asc_label: Asc - sort_desc_label: Desc - access: - type: perm - options: - perm: 'create az_event content' - cache: - type: none - options: { } - empty: { } - sorts: { } - arguments: { } - filters: - property_1: - id: property_1 - table: az_opportunity_trellis_data - field: property - relationship: none - group_type: group - admin_label: '' - plugin_id: views_remote_data_property - operator: '=' - value: '' - group: 1 - exposed: true - expose: - operator_id: property_1_op - label: Owner - description: '' - use_operator: false - operator: property_1_op - operator_limit_selection: false - operator_list: { } - identifier: owner - required: false - remember: false - multiple: false - remember_roles: - authenticated: authenticated - is_grouped: false - group_info: - label: '' - description: '' - identifier: '' - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: { } - property_path: owner - property_2: - id: property_2 - table: az_opportunity_trellis_data - field: property - relationship: none - group_type: group - admin_label: '' - plugin_id: views_remote_data_property - operator: '=' - value: '' - group: 1 - exposed: true - expose: - operator_id: property_2_op - label: Host - description: '' - use_operator: false - operator: property_2_op - operator_limit_selection: false - operator_list: { } - identifier: host - required: false - remember: false - multiple: false - remember_roles: - authenticated: authenticated - is_grouped: false - group_info: - label: '' - description: '' - identifier: '' - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: { } - property_path: host - property_3: - id: property_3 - table: az_opportunity_trellis_data - field: property - relationship: none - group_type: group - admin_label: '' - plugin_id: views_remote_data_property - operator: '=' - value: '' - group: 1 - exposed: true - expose: - operator_id: property_3_op - label: 'Event ID' - description: '' - use_operator: false - operator: property_3_op - operator_limit_selection: false - operator_list: { } - identifier: id - required: false - remember: false - multiple: false - remember_roles: - authenticated: authenticated - is_grouped: false - group_info: - label: '' - description: '' - identifier: '' - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: { } - property_path: id - Attributes: - id: Attributes - table: az_opportunity_trellis_data - field: Attributes - relationship: none - group_type: group - admin_label: '' - plugin_id: az_opportunity_trellis_views_attribute_filter - operator: '=' - value: '' - group: 1 - exposed: true - expose: - operator_id: Attributes_op - label: Audience - description: '' - use_operator: false - operator: Attributes_op - operator_limit_selection: false - operator_list: { } - identifier: audience - required: false - remember: false - multiple: false - remember_roles: - authenticated: authenticated - is_grouped: false - group_info: - label: '' - description: '' - identifier: '' - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: { } - property_path: audience - az_attribute_key: Audiences__c - Attributes_1: - id: Attributes_1 - table: az_opportunity_trellis_data - field: Attributes - relationship: none - group_type: group - admin_label: '' - plugin_id: az_opportunity_trellis_views_attribute_filter - operator: '=' - value: '' - group: 1 - exposed: true - expose: - operator_id: Attributes_1_op - label: Topic - description: '' - use_operator: false - operator: Attributes_1_op - operator_limit_selection: false - operator_list: { } - identifier: topic - required: false - remember: false - multiple: false - remember_roles: - authenticated: authenticated - is_grouped: false - group_info: - label: '' - description: '' - identifier: '' - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: { } - property_path: topic - az_attribute_key: Topic__c - Attributes_2: - id: Attributes_2 - table: az_opportunity_trellis_data - field: Attributes - relationship: none - group_type: group - admin_label: '' - plugin_id: az_opportunity_trellis_views_attribute_filter - operator: '=' - value: '' - group: 1 - exposed: true - expose: - operator_id: Attributes_2_op - label: Category - description: '' - use_operator: false - operator: Attributes_2_op - operator_limit_selection: false - operator_list: { } - identifier: category - required: false - remember: false - multiple: false - remember_roles: - authenticated: authenticated - is_grouped: false - group_info: - label: '' - description: '' - identifier: '' - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: { } - property_path: category - az_attribute_key: Category1__c - Attributes_3: - id: Attributes_3 - table: az_opportunity_trellis_data - field: Attributes - relationship: none - group_type: group - admin_label: '' - plugin_id: az_opportunity_trellis_views_attribute_filter - operator: '=' - value: '' - group: 1 - exposed: true - expose: - operator_id: Attributes_3_op - label: Format - description: '' - use_operator: false - operator: Attributes_3_op - operator_limit_selection: false - operator_list: { } - identifier: format - required: false - remember: false - multiple: false - remember_roles: - authenticated: authenticated - is_grouped: false - group_info: - label: '' - description: '' - identifier: '' - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: { } - property_path: format - az_attribute_key: Event_Format__c - property: - id: property - table: az_opportunity_trellis_data - field: property - relationship: none - group_type: group - admin_label: '' - plugin_id: views_remote_data_property - operator: '=' - value: '' - group: 1 - exposed: true - expose: - operator_id: property_op - label: Keyword - description: '' - use_operator: false - operator: property_op - operator_limit_selection: false - operator_list: { } - identifier: keyword - required: false - remember: false - multiple: false - remember_roles: - authenticated: authenticated - is_grouped: false - group_info: - label: '' - description: '' - identifier: '' - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: { } - property_path: keyword - Date_1: - id: Date_1 - table: az_opportunity_trellis_data - field: Date - relationship: none - group_type: group - admin_label: '' - plugin_id: az_opportunity_trellis_views_date_filter - operator: '=' - value: - value: '' - begin: '' - end: '' - group: 1 - exposed: true - expose: - operator_id: Date_1_op - label: 'Start Date' - description: '' - use_operator: false - operator: Date_1_op - operator_limit_selection: false - operator_list: { } - identifier: start - required: false - remember: false - multiple: false - remember_roles: - authenticated: authenticated - is_grouped: false - group_info: - label: '' - description: '' - identifier: '' - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: { } - api_param: start - api_options: - 'Next 7 Days': 'Next 7 Days' - 'Next 30 Days': 'Next 30 Days' - Custom: Custom - api_param_custom_begin: start_begin - api_param_custom_end: start_end - Date: - id: Date - table: az_opportunity_trellis_data - field: Date - relationship: none - group_type: group - admin_label: '' - plugin_id: az_opportunity_trellis_views_date_filter - operator: '=' - value: - value: '' - begin: '' - end: '' - group: 1 - exposed: true - expose: - operator_id: Date_op - label: 'Updated Date' - description: '' - use_operator: false - operator: Date_op - operator_limit_selection: false - operator_list: { } - identifier: modified - required: false - remember: false - multiple: false - remember_roles: - authenticated: authenticated - is_grouped: false - group_info: - label: '' - description: '' - identifier: '' - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: { } - api_param: modified - api_options: - 'Last 7 Days': 'Last 7 Days' - 'Last 30 Days': 'Last 30 Days' - Custom: Custom - api_param_custom_begin: modified_begin - api_param_custom_end: modified_end - property_4: - id: property_4 - table: az_opportunity_trellis_data - field: property - relationship: none - group_type: group - admin_label: '' - plugin_id: views_remote_data_property - operator: '=' - value: 'true' - group: 1 - exposed: false - expose: - operator_id: '' - label: '' - description: '' - use_operator: false - operator: '' - operator_limit_selection: false - operator_list: { } - identifier: '' - required: false - remember: false - multiple: false - remember_roles: - authenticated: authenticated - is_grouped: false - group_info: - label: '' - description: '' - identifier: '' - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: { } - property_path: publish - Approval: - id: Approval - table: az_opportunity_trellis_data - field: Approval - relationship: none - group_type: group - admin_label: '' - plugin_id: az_opportunity_trellis_views_approval_filter - operator: '=' - value: approved - group: 1 - exposed: true - expose: - operator_id: Approval_op - label: 'Approved for University Calendar' - description: 'Limits results to events curated by University Communications for the University Calendar.' - use_operator: false - operator: Approval_op - operator_limit_selection: false - operator_list: { } - identifier: approval - required: false - remember: false - multiple: false - remember_roles: - authenticated: authenticated - is_grouped: false - group_info: - label: '' - description: '' - identifier: '' - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: { } - property_path: approval - filter_groups: - operator: AND - groups: - 1: AND - style: - type: table - row: - type: fields - query: - type: views_query - options: { } - relationships: { } - use_ajax: true - header: { } - footer: { } - display_extenders: { } - cache_metadata: - max-age: 0 - contexts: - - 'languages:language_interface' - - url - - url.query_args - - user.permissions - tags: - - views_remote_data - page_1: - id: page_1 - display_title: Page - display_plugin: page - position: 1 - display_options: - display_extenders: { } - path: admin/trellis-opportunity-importer - cache_metadata: - max-age: 0 - contexts: - - 'languages:language_interface' - - url - - url.query_args - - user.permissions - tags: - - views_remote_data diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/config/schema/az_opportunity_trellis.schema.yml b/modules/custom/az_opportunity/az_opportunity_trellis/config/schema/az_opportunity_trellis.schema.yml deleted file mode 100644 index 576f05a01c..0000000000 --- a/modules/custom/az_opportunity/az_opportunity_trellis/config/schema/az_opportunity_trellis.schema.yml +++ /dev/null @@ -1,39 +0,0 @@ -views.filter_value.az_opportunity_trellis_views_date_filter: - type: views_filter - label: 'Trellis filter' - mapping: - value: - type: string - label: 'Value' - begin: - type: string - label: 'Custom Date Range Begin' - end: - type: string - label: 'Custom Date Range End' -az_opportunity_trellis.az_recurring_import_rule.*: - type: config_entity - label: Trellis Opportunity Import - mapping: - id: - type: machine_name - label: ID - label: - type: label - label: Label - uuid: - type: uuid - host: - type: string - owner: - type: string - keyword: - type: string - attributes: - type: sequence - label: ‘Enterprise Attributes’ - sequence: - type: string - label: ‘Attribute’ - approval: - type: string diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/css/az_opportunity_trellis_datewrapper.css b/modules/custom/az_opportunity/az_opportunity_trellis/css/az_opportunity_trellis_datewrapper.css deleted file mode 100644 index 6fef13e186..0000000000 --- a/modules/custom/az_opportunity/az_opportunity_trellis/css/az_opportunity_trellis_datewrapper.css +++ /dev/null @@ -1,3 +0,0 @@ -.az-opportunity-trellis-datewrapper.views-exposed-form__item .form-item:first-child { - margin-top: 0; -} \ No newline at end of file diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/js/az_opportunity_trellis_date.js b/modules/custom/az_opportunity/az_opportunity_trellis/js/az_opportunity_trellis_date.js deleted file mode 100644 index 911cef299d..0000000000 --- a/modules/custom/az_opportunity/az_opportunity_trellis/js/az_opportunity_trellis_date.js +++ /dev/null @@ -1,27 +0,0 @@ -/** - * @file - * Trellis date range picker. - */ - -((Drupal, drupalSettings, once) => { - Drupal.behaviors.trellisDatePicker = { - attach(context) { - const elements = once('aztrellisdate', '.az-trellis-daterange', context); - elements.forEach((element) => { - const begin = element; - const id = element.dataset.azTrellisDaterangeEnd; - const end = document.getElementById(id); - // eslint-disable-next-line no-unused-vars, no-undef, new-cap - const picker = new easepick.create({ - element: begin, - css: drupalSettings.trellisDatePicker.css, - zIndex: 10, - RangePlugin: { - elementEnd: end, - }, - plugins: ['RangePlugin'], - }); - }); - }, - }; -})(Drupal, drupalSettings, once); diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/migrations/az_trellis_opportunity_files.yml b/modules/custom/az_opportunity/az_opportunity_trellis/migrations/az_trellis_opportunity_files.yml deleted file mode 100644 index 969e87e18b..0000000000 --- a/modules/custom/az_opportunity/az_opportunity_trellis/migrations/az_trellis_opportunity_files.yml +++ /dev/null @@ -1,42 +0,0 @@ -id: az_trellis_opportunity_files -label: Trellis Opportunity Files -source: - plugin: az_trellis_opportunity_api - trellis_ids: { } - track_changes: true - fields: - - - name: id - label: ID - selector: Id - - - name: image_url - label: 'Image URL' - selector: Image_URL - ids: - id: - type: string - -process: - status: - plugin: default_value - default_value: 1 - - uri: - - - plugin: az_migration_remote_file - migration: az_trellis_opportunity_files - default_filename: id - directory: 'public://trellis-opportunity' - source_ids: - - id - source: image_url - - - plugin: skip_on_empty - method: row - uid: - plugin: default_value - default_value: 0 - -destination: - plugin: entity:file diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/migrations/az_trellis_opportunity_media.yml b/modules/custom/az_opportunity/az_opportunity_trellis/migrations/az_trellis_opportunity_media.yml deleted file mode 100644 index f23e074c80..0000000000 --- a/modules/custom/az_opportunity/az_opportunity_trellis/migrations/az_trellis_opportunity_media.yml +++ /dev/null @@ -1,56 +0,0 @@ -id: az_trellis_opportunity_media -label: Trellis Opportunity Media -source: - plugin: az_trellis_opportunity_api - trellis_ids: { } - track_changes: true - fields: - - - name: id - label: ID - selector: Id - - - name: image_url - label: 'Image URL' - selector: Image_URL - - - name: name - label: Name - selector: Name - ids: - id: - type: string - -process: - uid: - plugin: default_value - default_value: 0 - bundle: - plugin: default_value - default_value: az_image - field_media_az_image/target_id: - - - plugin: migration_lookup - migration: az_trellis_opportunity_files - source: id - no_stub: true - - - plugin: skip_on_empty - method: row - field_media_az_image/alt: name - field_media_az_image/title: name - status: - plugin: default_value - default_value: 1 - -destination: - plugin: entity:media - -dependencies: - enforced: - module: - - az_opportunity_trellis - - az_media -migration_dependencies: - optional: - - az_trellis_opportunity_files diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/src/AZRecurringImportRuleInterface.php b/modules/custom/az_opportunity/az_opportunity_trellis/src/AZRecurringImportRuleInterface.php deleted file mode 100644 index 8ba5f5d470..0000000000 --- a/modules/custom/az_opportunity/az_opportunity_trellis/src/AZRecurringImportRuleInterface.php +++ /dev/null @@ -1,30 +0,0 @@ -t('Label'); - $header['id'] = $this->t('Machine name'); - $header['results'] = $this->t('Results'); - $header['status'] = $this->t('Status'); - return $header + parent::buildHeader(); - } - - /** - * {@inheritdoc} - */ - public function buildRow(EntityInterface $entity): array { - /** @var \Drupal\az_event_trellis\AZRecurringImportRuleInterface $entity */ - $row['label'] = $entity->label(); - $row['id'] = $entity->id(); - - // Get entity's query parameters. - $params = $entity->getQueryParameters(); - unset($params['publish']); - - if (!empty($params)) { - // Generate link to results page. - $row['result']['data'] = [ - '#type' => 'link', - '#title' => $this->t('View Results'), - '#url' => Url::fromRoute('view.az_event_trellis_import.page_1'), - '#options' => ['query' => $params], - '#attributes' => ['class' => 'button'], - ]; - } - else { - $row['result'] = ''; - } - $row['status'] = $entity->status() ? $this->t('Enabled') : $this->t('Disabled'); - return $row + parent::buildRow($entity); - } - -} diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/src/Controller/AZRecurringImportModalController.php b/modules/custom/az_opportunity/az_opportunity_trellis/src/Controller/AZRecurringImportModalController.php deleted file mode 100644 index 1c2af8acc2..0000000000 --- a/modules/custom/az_opportunity/az_opportunity_trellis/src/Controller/AZRecurringImportModalController.php +++ /dev/null @@ -1,101 +0,0 @@ -entityTypeManager = $entityTypeManager; - $this->entityFormBuilder = $entityFormBuilder; - $this->cache = $cache; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container): self { - return new self( - $container->get('entity_type.manager'), - $container->get('entity.form_builder'), - $container->get('cache.default'), - ); - } - - /** - * Open az_recurring_import_rule configuration form as a modal. - * - * @param \Symfony\Component\HttpFoundation\Request $request - * The current request. - * - * @return \Drupal\Core\Ajax\AjaxResponse - * AjaxResponse containing command to open a modal. - */ - public function __invoke(Request $request): AjaxResponse { - $search = []; - $key = $request->query->get('search'); - // Attempt to get cached search if we have a valid cache key. - if (!empty($key) && str_starts_with($key, 'az_recurring_import_modal:')) { - // Get a cached search if there is one for our key. - $search = $this->cache->get($key)->data ?? []; - } - - // Create an AjaxResponse that opens a modal copy of the config form. - $response = new AjaxResponse(); - // Entity forms require an entity. - $config = $this->entityTypeManager->getStorage('az_recurring_import_rule')->create($search); - // Generate a copy of the configuration entity form using the stub as basis. - $config_form = $this->entityFormBuilder->getForm($config, 'add'); - // Forms generated during ajax calls do not have the right action path. - $config_form['#action'] = Url::fromRoute('entity.az_recurring_import_rule.add_form')->toString(); - // Add an ajax command to open the modal. - $response->addCommand(new OpenModalDialogCommand($this->t('Create Recurring Import'), $config_form, ['width' => '1000'])); - return $response; - } - -} diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/src/Entity/AZRecurringImportRule.php b/modules/custom/az_opportunity/az_opportunity_trellis/src/Entity/AZRecurringImportRule.php deleted file mode 100644 index 9d5867b938..0000000000 --- a/modules/custom/az_opportunity/az_opportunity_trellis/src/Entity/AZRecurringImportRule.php +++ /dev/null @@ -1,129 +0,0 @@ - AZRecurringImportRuleListBuilder::class, - 'form' => [ - 'add' => AZRecurringImportRuleForm::class, - 'edit' => AZRecurringImportRuleForm::class, - 'delete' => EntityDeleteForm::class, - ], - ], - config_prefix: 'az_recurring_import_rule', - admin_permission: 'administer quickstart configuration', - label_count: [ - 'singular' => '@count recurring import rule', - 'plural' => '@count recurring import rules', - ], - links: [ - 'collection' => '/admin/config/az-quickstart/settings/az-recurring-import-rule', - 'add-form' => '/admin/config/az-quickstart/settings/az-recurring-import-rule/add', - 'edit-form' => '/admin/config/az-quickstart/settings/az-recurring-import-rule/{az_recurring_import_rule}', - 'delete-form' => '/admin/config/az-quickstart/settings/az-recurring-import-rule/{az_recurring_import_rule}/delete', - ], - entity_keys: [ - 'id' => 'id', - 'label' => 'label', - 'uuid' => 'uuid', - ], - config_export: [ - 'id', - 'label', - 'owner', - 'host', - 'keyword', - 'attributes', - 'approval', - ], -)] -final class AZRecurringImportRule extends ConfigEntityBase implements AZRecurringImportRuleInterface { - - /** - * The az_recurring_import_rule ID. - */ - protected string $id; - - /** - * The az_recurring_import_rule label. - */ - protected string $label; - - /** - * The az_recurring_import_rule keyword. - */ - protected string $keyword; - - /** - * The az_recurring_import_rule owner. - */ - protected string $owner; - - /** - * The az_recurring_import_rule owner. - */ - protected string $host; - - /** - * The az_recurring_import_rule enterprise attributes. - */ - protected ?array $attributes; - - /** - * The az_recurring_import_rule approval status. - */ - protected string $approval; - - /** - * {@inheritdoc} - */ - public function getQueryParameters() { - // Build a list of query parameters. - $params = [ - 'publish' => 'true', - ]; - $attributes = array_filter($this->attributes ?? []); - $params += $attributes; - $params['keyword'] = $this->get('keyword') ?? ''; - $params['owner'] = $this->get('owner') ?? ''; - $params['host'] = $this->get('host') ?? ''; - $params['approval'] = $this->get('approval') ?? ''; - $params = array_filter($params); - return $params; - } - - /** - * {@inheritdoc} - */ - public function getEventIds() { - // Build a list of query parameters. - $params = $this->getQueryParameters(); - - // Let's refuse to search if there are no constraints except published. - if (count($params) === 1) { - return []; - } - - return \Drupal::service('az_opportunity_trellis.trellis_helper')->searchEvents($params); - } - -} diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/src/EventSubscriber/AZOpportunityTrellisDataSubscriber.php b/modules/custom/az_opportunity/az_opportunity_trellis/src/EventSubscriber/AZOpportunityTrellisDataSubscriber.php deleted file mode 100644 index 3ad87067ac..0000000000 --- a/modules/custom/az_opportunity/az_opportunity_trellis/src/EventSubscriber/AZOpportunityTrellisDataSubscriber.php +++ /dev/null @@ -1,157 +0,0 @@ - 'onQuery', - MigrateOpportunity::POST_ROW_SAVE => 'onPostRowSave', - ]; - } - - /** - * Constructs an AZEventTrellisDataSubscriber. - * - * @param \Drupal\az_opportunity_trellis\TrellisHelper $trellisHelper - * The Trellis helper server. - * @param \Drupal\Core\Messenger\Messenger $messenger - * Database connection object. - * @param \Drupal\Core\Entity\EntityTypeManagerInterface $entityTypeManager - * The entity type manager service. - * @param \Drupal\Core\Session\AccountProxy $currentUser - * The currently logged in user. - */ - public function __construct(TrellisHelper $trellisHelper, Messenger $messenger, EntityTypeManagerInterface $entityTypeManager, AccountProxy $currentUser) { - $this->trellisHelper = $trellisHelper; - $this->messenger = $messenger; - $this->entityTypeManager = $entityTypeManager; - $this->nodeStorage = $this->entityTypeManager->getStorage('node'); - $this->currentUser = $currentUser; - } - - /** - * Respond to opportunity on migration import for relevant migrations. - * - * @param \Drupal\migrate\Event\MigratePostRowSaveEvent $event - * The post save event object. - */ - public function onPostRowSave(MigratePostRowSaveEvent $opportunity) { - $migration = $opportunity->getMigration()->getBaseId(); - $ids = $opportunity->getDestinationIdValues(); - $id = reset($ids); - if ($migration === 'az_trellis_opportunity') { - $opportunity = $this->nodeStorage->load($id); - if (!empty($opportunity)) { - $url = $opportunity->toUrl()->toString(); - // Only show message if current user has permission. - if ($this->currentUser->hasPermission('create az_opportunity content')) { - // Show status message that opportunity was imported. - $this->messenger->addMessage($this->t('Imported @opportunitytitle.', [ - '@opportunitylink' => $url, - '@opportunitytitle' => $opportunity->getTitle(), - ])); - } - } - } - } - - /** - * Subscribes to populate Trellis view results. - * - * @param \Drupal\views_remote_data\Opportunity\RemoteDataQueryEvent $opportunity - * The event. - */ - public function onQuery(RemoteDataQueryEvent $event): void { - $supported_bases = ['az_opportunity_trellis_data']; - $base_tables = array_keys($event->getView()->getBaseTables()); - if (count(array_intersect($supported_bases, $base_tables)) > 0) { - $parameters = []; - $condition_groups = $event->getConditions(); - // Check for conditional parameters. - foreach ($condition_groups as $condition_group) { - if (!empty($condition_group['conditions'])) { - foreach ($condition_group['conditions'] as $condition) { - if (!empty($condition['field'][0]) & !empty($condition['value'])) { - $parameters[$condition['field'][0]] = $condition['value']; - } - } - } - } - // Don't perform search if empty or publish is the only field. - if (empty($parameters) || (count($parameters) <= 1)) { - return; - } - $ids = $this->trellisHelper->searchopportunity($parameters); - if (!empty($ids)) { - $offset = $event->getOffset(); - $limit = $event->getLimit(); - if (!empty($limit)) { - $ids = array_slice($ids, $offset, $limit); - } - // Run data fetch request. - $results = $this->trellisHelper->getOpportunity($ids); - $datefields = [ - 'Last_Modified_Date', - 'Start_DateTime', - 'End_DateTime', - ]; - foreach ($results as $result) { - // Change date format fields to what views expects to see. - foreach ($datefields as $datefield) { - if (!empty($result[$datefield])) { - $result[$datefield] = strtotime($result[$datefield]); - } - } - $event->addResult(new ResultRow($result)); - } - } - } - } - -} diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/src/Form/AZRecurringImportRuleForm.php b/modules/custom/az_opportunity/az_opportunity_trellis/src/Form/AZRecurringImportRuleForm.php deleted file mode 100644 index 2fd1df1bb5..0000000000 --- a/modules/custom/az_opportunity/az_opportunity_trellis/src/Form/AZRecurringImportRuleForm.php +++ /dev/null @@ -1,185 +0,0 @@ -entityRepository = $container->get('entity.repository'); - $instance->trellisHelper = $container->get('az_opportunity_trellis.trellis_helper'); - return $instance; - } - - /** - * {@inheritdoc} - */ - public function form(array $form, FormStateInterface $form_state): array { - - $form = parent::form($form, $form_state); - /** @var \Drupal\az_opportunity_trellis\Entity\AZRecurringImportRule $entity */ - $entity = $this->entity; - // Fetch the list of attributes mapped by the API. - $mappings = $this->trellisHelper->getAttributeMappings(); - - $form['label'] = [ - '#type' => 'textfield', - '#title' => $this->t('Import Rule Name'), - '#maxlength' => 255, - '#default_value' => $entity->label(), - '#description' => $this->t('Describe this rule, e.g., Graduate Lecture Series'), - '#required' => TRUE, - ]; - - $form['id'] = [ - '#type' => 'machine_name', - '#default_value' => $this->entity->id(), - '#machine_name' => [ - 'exists' => [AZRecurringImportRule::class, 'load'], - ], - '#disabled' => !$entity->isNew(), - ]; - - $form['status'] = [ - '#type' => 'checkbox', - '#title' => $this->t('Enabled'), - '#default_value' => $entity->status(), - '#description' => $this->t('Enabled import rules will regularly import matching content into the site automatically.'), - ]; - - $form['query_parameters'] = [ - '#type' => 'details', - '#title' => $this->t('Recurring Search Parameters'), - '#description' => $this->t('When this import rule runs, the following search terms will be used.'), - '#open' => TRUE, - ]; - - $form['query_parameters']['owner'] = [ - '#type' => 'textfield', - '#title' => $this->t('Owner'), - '#maxlength' => 255, - '#default_value' => $entity->get('owner'), - ]; - - $form['query_parameters']['host'] = [ - '#type' => 'textfield', - '#title' => $this->t('Host'), - '#maxlength' => 255, - '#default_value' => $entity->get('host'), - ]; - - $form['query_parameters']['keyword'] = [ - '#type' => 'textfield', - '#title' => $this->t('Keyword'), - '#maxlength' => 255, - '#default_value' => $entity->get('keyword'), - ]; - - $form['query_parameters']['attributes']['#tree'] = TRUE; - - // Get the different attributes available. - $term_storage = $this->entityTypeManager->getStorage('taxonomy_term'); - $query = $term_storage->getQuery() - ->accessCheck(TRUE) - ->addTag('taxonomy_term_access') - ->condition('vid', 'az_enterprise_attributes') - ->condition('parent', 0) - ->sort('name') - // Only fetch attributes that have an API mapping. - ->condition('field_az_attribute_key', array_keys($mappings), 'IN'); - $attributes = $query->execute(); - $attributes = $term_storage->loadMultiple($attributes); - - // Build attribute select lists. - foreach ($attributes as $attribute) { - $options = []; - $key = $mappings[$attribute->field_az_attribute_key->value]; - $id = $attribute->id(); - - // Find the options the attribute has, in order. - $query = $term_storage->getQuery() - ->accessCheck(TRUE) - ->addTag('taxonomy_term_access') - ->condition('vid', 'az_enterprise_attributes') - ->condition('parent', $id) - ->sort('name') - ->condition('field_az_attribute_key', '', '<>'); - $terms = $query->execute(); - $terms = $term_storage->loadMultiple($terms); - foreach ($terms as $term) { - $options[$term->field_az_attribute_key->value] = $this->entityRepository->getTranslationFromContext($term)->label(); - } - - // Build the select element for the attribute. - $form['query_parameters']['attributes'][$key] = [ - '#type' => 'select', - '#options' => $options, - '#empty_option' => $this->t('- Any -'), - '#empty_value' => '', - '#title' => $this->entityRepository->getTranslationFromContext($attribute)->label(), - '#required' => FALSE, - '#default_value' => $entity->get('attributes')[$key] ?? NULL, - ]; - } - - $form['query_parameters']['approval'] = [ - '#type' => 'select', - '#title' => $this->t('Approved for University Calendar'), - '#options' => [ - 'approved' => $this->t('Approved'), - 'denied' => $this->t('Denied'), - ], - '#empty_option' => $this->t('- Any -'), - '#empty_value' => '', - '#required' => FALSE, - '#default_value' => $entity->get('approval'), - ]; - - return $form; - } - - /** - * {@inheritdoc} - */ - public function save(array $form, FormStateInterface $form_state): int { - $result = parent::save($form, $form_state); - $message_args = ['%label' => $this->entity->label()]; - $this->messenger()->addStatus( - match($result) { - \SAVED_NEW => $this->t('Created new recurring import rule %label.', $message_args), - \SAVED_UPDATED => $this->t('Updated recurring import rule %label.', $message_args), - } - ); - - $form_state->setRedirectUrl($this->entity->toUrl('collection')); - return $result; - } - -} diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/src/Form/TrellisOpportunitySettingsForm.php b/modules/custom/az_opportunity/az_opportunity_trellis/src/Form/TrellisOpportunitySettingsForm.php deleted file mode 100644 index d018341dda..0000000000 --- a/modules/custom/az_opportunity/az_opportunity_trellis/src/Form/TrellisOpportunitySettingsForm.php +++ /dev/null @@ -1,53 +0,0 @@ -config('az_opportunity_trellis.settings'); - - $form['api_hostname'] = [ - '#title' => $this->t("API Hostname"), - '#type' => 'textfield', - '#default_value' => $az_opportunity_trellis_config->get('api_hostname'), - ]; - - return parent::buildForm($form, $form_state); - } - - /** - * {@inheritdoc} - */ - public function submitForm(array &$form, FormStateInterface $form_state) { - $this->config('az_opportunity_trellis.settings') - ->set('api_hostname', $form_state->getValue('api_hostname')) - ->save(); - - parent::submitForm($form, $form_state); - } - -} diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/src/Plugin/migrate/source/AZTrellisOpportunitySource.php b/modules/custom/az_opportunity/az_opportunity_trellis/src/Plugin/migrate/source/AZTrellisOpportunitySource.php deleted file mode 100644 index 8a2a61b0f3..0000000000 --- a/modules/custom/az_opportunity/az_opportunity_trellis/src/Plugin/migrate/source/AZTrellisOpportunitySource.php +++ /dev/null @@ -1,144 +0,0 @@ -fields = $configuration['fields']; - $this->ids = $configuration['ids']; - // @todo use injection for this. - $this->trellisHelper = \Drupal::service('az_opportunity_trellis.trellis_helper'); - $this->trellisIds = $configuration['trellis_ids'] ?? []; - // If no arguments are supplied, fetch the list currently on the site. - if (empty($this->trellisIds)) { - $ids = $this->trellisHelper->getImportedOpportunityIds(); - $ids += $this->trellisHelper->getRecurringOpportunityIds(); - $this->trellisIds = array_unique($ids); - } - } - - /** - * Initializes the iterator with the source data. - * - * @return \Iterator - * Returns an iterable object of data for this source. - */ - protected function initializeIterator() { - // Fetch the opportunities via trellis API. - $items = $this->trellisHelper->getOpportunities($this->trellisIds); - $results = []; - $fields = []; - // Find field selectors. - foreach ($this->fields as $field) { - $fields[$field['name']] = $field['selector'] ?? $field['name']; - } - foreach ($items as $item) { - $result = []; - // Transform selectors into defined fields. - foreach ($fields as $field => $selector) { - if (isset($item[$selector])) { - $result[$field] = $item[$selector]; - } - } - $results[] = $result; - } - // Return an iterable. - $obj = new \ArrayObject($results); - return $obj->getIterator(); - } - - /** - * {@inheritdoc} - */ - public function prepareRow(Row $row) { - // Trellis IDs from source configuration can affect the hash of the row. - $row->setSourceProperty('trellis_ids', []); - // Perform normal source plugin hashing. - return parent::prepareRow($row); - } - - /** - * Return a string representing the source ids. - * - * @return string - * Comma-separated list of ids being imported. - */ - public function __toString(): string { - $ids = implode(', ', $this->trellisIds); - return $ids; - } - - /** - * {@inheritdoc} - */ - public function fields(): array { - $fields = []; - foreach ($this->fields as $field_info) { - $fields[$field_info['name']] = $field_info['label'] ?? $field_info['name']; - } - return $fields; - } - - /** - * {@inheritdoc} - */ - public function getIds(): array { - return $this->ids; - } - -} diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/src/Plugin/views/field/AZOpportunityTrellisViewsField.php b/modules/custom/az_opportunity/az_opportunity_trellis/src/Plugin/views/field/AZOpportunityTrellisViewsField.php deleted file mode 100644 index b523041695..0000000000 --- a/modules/custom/az_opportunity/az_opportunity_trellis/src/Plugin/views/field/AZOpportunityTrellisViewsField.php +++ /dev/null @@ -1,160 +0,0 @@ -migrationRemoteTools = $container->get('az_migration_remote.tools'); - $instance->trellisHelper = $container->get('az_opportunity_trellis.trellis_helper'); - return $instance; - } - - /** - * {@inheritdoc} - */ - public function init(ViewExecutable $view, DisplayPluginBase $display, ?array &$options = NULL) { - FieldPluginBase::init($view, $display, $options); - $this->actions = []; - } - - /** - * {@inheritdoc} - */ - public function viewsForm(&$form, FormStateInterface $form_state) { - $form['#cache']['max-age'] = 0; - - $form[$this->options['id']] = [ - '#tree' => TRUE, - ]; - - foreach ($this->view->result as $row_index => $row) { - $form[$this->options['id']][$row_index] = [ - '#type' => 'checkbox', - // We are not able to determine a main "title" for each row, so we can - // only output a generic label. - '#title' => $this->t('Update this item'), - '#title_display' => 'invisible', - '#return_value' => $row->Id ?? '', - '#default_value' => !empty($form_state->getValue($this->options['id'])[$row_index]) ? 1 : NULL, - ]; - } - - // Change default BulkForm label. - if (!empty($form['actions']['submit'])) { - $form['actions']['submit']['#value'] = $this->t('Import'); - } - } - - /** - * {@inheritdoc} - */ - public function viewsFormValidate(&$form, FormStateInterface $form_state) { - $ids = $form_state->getValue($this->options['id']); - if (empty($ids) || empty(array_filter($ids))) { - $form_state->setErrorByName('', $this->emptySelectedMessage()); - } - // Unlike parent class, do not throw form error when action is empty. - } - - /** - * Submit handler for the Trellis import form. - * - * @param mixed $form - * An associative array containing the structure of the form. - * @param \Drupal\Core\Form\FormStateInterface $form_state - * The current state of the form. - * - * @throws \Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException - * Thrown when the user tried to access an action without access to it. - */ - public function viewsFormSubmit(&$form, FormStateInterface $form_state) { - $values = $form_state->getValues(); - if (!empty($values[$this->options['id']])) { - $ids = $values[$this->options['id']]; - $ids = array_filter($ids); - foreach ($ids as $value) { - if (!empty($value)) { - \Drupal::service('messenger')->addMessage($this->t('Importing Trellis Opportunity @id.', [ - '@id' => $value, - ])); - } - } - - $migrations = [ - 'az_trellis_opportunity_files' => [ - 'limit' => 0, - 'update' => 0, - 'force' => 0, - 'configuration' => [ - 'source' => [ - 'trellis_ids' => $ids, - ], - ], - ], - 'az_trellis_opportunity_media' => [ - 'limit' => 0, - 'update' => 0, - 'force' => 0, - 'configuration' => [ - 'source' => [ - 'trellis_ids' => $ids, - ], - ], - ], - 'az_trellis_opportunity' => [ - 'limit' => 0, - 'update' => 0, - 'force' => 0, - 'configuration' => [ - 'source' => [ - 'trellis_ids' => $ids, - ], - ], - ], - ]; - - $this->migrationRemoteTools->batch($migrations); - } - - } - - /** - * {@inheritdoc} - */ - public function isWorkspaceSafeForm(array $form, FormStateInterface $form_state): bool { - // This field is not backed by an entity like BulkForm expects. - return FALSE; - } - -} diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/src/Plugin/views/filter/AZOpportunityTrellisViewsApprovalFilter.php b/modules/custom/az_opportunity/az_opportunity_trellis/src/Plugin/views/filter/AZOpportunityTrellisViewsApprovalFilter.php deleted file mode 100644 index 555df5c6f4..0000000000 --- a/modules/custom/az_opportunity/az_opportunity_trellis/src/Plugin/views/filter/AZOpportunityTrellisViewsApprovalFilter.php +++ /dev/null @@ -1,96 +0,0 @@ - 'select', - '#title' => $this->t('Value'), - '#options' => [ - 'approved' => $this->t('Approved'), - 'denied' => $this->t('Denied'), - ], - '#required' => FALSE, - '#default_value' => $this->value, - ]; - } - - /** - * {@inheritdoc} - */ - public function operatorOptions(): array { - return [ - '=' => $this->t('Is equal to'), - '!=' => $this->t('Is not equal to'), - ]; - } - - /** - * {@inheritdoc} - */ - protected function defineOptions(): array { - $options = parent::defineOptions(); - $this->definePropertyPathOption($options); - return $options; - } - - /** - * {@inheritdoc} - */ - public function buildOptionsForm(&$form, FormStateInterface $form_state): void { - $this->propertyPathElement($form, $this->options); - parent::buildOptionsForm($form, $form_state); - } - - /** - * {@inheritdoc} - */ - public function adminSummary() { - $prop = $this->options['property_path'] ?? ''; - return '(API value ' . $prop . ') ' . $this->operator . ' ' . $this->value; - } - - /** - * {@inheritdoc} - */ - public function query($group_by = FALSE): void { - if (!($this->query instanceof RemoteDataQuery)) { - return; - } - $this->query->addWhere( - $this->options['group'], - $this->options['property_path'], - $this->value, - $this->operator - ); - } - -} diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/src/Plugin/views/filter/AZOpportunityTrellisViewsAttributeFilter.php b/modules/custom/az_opportunity/az_opportunity_trellis/src/Plugin/views/filter/AZOpportunityTrellisViewsAttributeFilter.php deleted file mode 100644 index a4e549cd24..0000000000 --- a/modules/custom/az_opportunity/az_opportunity_trellis/src/Plugin/views/filter/AZOpportunityTrellisViewsAttributeFilter.php +++ /dev/null @@ -1,170 +0,0 @@ -entityRepository = $container->get('entity.repository'); - $instance->termStorage = $container->get('entity_type.manager')->getStorage('taxonomy_term'); - return $instance; - } - - /** - * {@inheritdoc} - */ - protected function valueForm(&$form, FormStateInterface $form_state): void { - $options = []; - $key = $this->options['az_attribute_key'] ?? ''; - - // Get the applicable attribute terms. - $query = $this->termStorage->getQuery() - ->accessCheck(TRUE) - ->addTag('taxonomy_term_access') - ->condition('vid', 'az_enterprise_attributes') - ->condition('field_az_attribute_key', $key); - $parents = $query->execute(); - $children = []; - if (!empty($parents)) { - $query = $this->termStorage->getQuery() - ->accessCheck(TRUE) - ->sort('name') - ->addTag('taxonomy_term_access') - ->condition('parent', $parents, 'IN'); - $children = $query->execute(); - } - $terms = Term::loadMultiple($children); - // Build option list. - foreach ($terms as $term) { - if ($term->hasField('field_az_attribute_key') && !empty($term->field_az_attribute_key->value)) { - $options[$term->field_az_attribute_key->value] = $this->entityRepository->getTranslationFromContext($term)->label(); - } - } - $form['value'] = [ - '#type' => 'select', - '#title' => $this->t('Value'), - '#options' => $options, - '#required' => FALSE, - '#access' => !empty($options), - '#default_value' => $this->value, - ]; - } - - /** - * {@inheritdoc} - */ - public function operatorOptions(): array { - return [ - '=' => $this->t('Is equal to'), - '!=' => $this->t('Is not equal to'), - ]; - } - - /** - * {@inheritdoc} - */ - protected function defineOptions(): array { - $options = parent::defineOptions(); - $this->definePropertyPathOption($options); - $options['az_attribute_key'] = ['default' => '']; - return $options; - } - - /** - * {@inheritdoc} - */ - public function buildOptionsForm(&$form, FormStateInterface $form_state): void { - $this->propertyPathElement($form, $this->options); - parent::buildOptionsForm($form, $form_state); - $form['az_attribute_key'] = [ - '#title' => $this->t('Unique key of enterprise attribute'), - '#type' => 'textfield', - '#default_value' => $this->options['az_attribute_key'] ?? '', - '#required' => TRUE, - ]; - } - - /** - * Return the attribute id and api parameter name. - * - * @return array - * An array with the key as the attribute id and the value as the api path. - */ - public function getApiMapping(): array { - $key = $this->options['az_attribute_key'] ?? ''; - $path = $this->options['property_path'] ?? ''; - return [$key => $path]; - } - - /** - * {@inheritdoc} - */ - public function adminSummary() { - $prop = $this->options['property_path'] ?? ''; - $key = $this->options['az_attribute_key'] ?? ''; - return $key . ' (API value ' . $prop . ') ' . $this->operator . ' ' . $this->value; - } - - /** - * {@inheritdoc} - */ - public function query($group_by = FALSE): void { - if (!($this->query instanceof RemoteDataQuery)) { - return; - } - $this->query->addWhere( - $this->options['group'], - $this->options['property_path'], - $this->value, - $this->operator - ); - } - -} diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/src/Plugin/views/filter/AZOpportunityTrellisViewsDateFilter.php b/modules/custom/az_opportunity/az_opportunity_trellis/src/Plugin/views/filter/AZOpportunityTrellisViewsDateFilter.php deleted file mode 100644 index 22bf20d20d..0000000000 --- a/modules/custom/az_opportunity/az_opportunity_trellis/src/Plugin/views/filter/AZOpportunityTrellisViewsDateFilter.php +++ /dev/null @@ -1,289 +0,0 @@ - $this->t('Next 7 Days'), - 'Next 30 Days' => $this->t('Next 30 Days'), - 'Last 7 Days' => $this->t('Last 7 Days'), - 'Last 30 Days' => $this->t('Last 30 Days'), - 'Custom' => $this->t('Custom'), - ]; - return $options; - } - - /** - * The asset resolver service. - * - * @var \Drupal\Core\Asset\AssetResolver - */ - protected $assetResolver; - - /** - * The file url generator service. - * - * @var \Drupal\Core\File\FileUrlGeneratorInterface - */ - protected $fileUrlGenerator; - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) { - $instance = new static( - $configuration, - $plugin_id, - $plugin_definition - ); - - $instance->assetResolver = $container->get('asset.resolver'); - $instance->fileUrlGenerator = $container->get('file_url_generator'); - return $instance; - } - - /** - * {@inheritdoc} - */ - protected function valueForm(&$form, FormStateInterface $form_state): void { - $form['value']['#tree'] = TRUE; - $form['#attached']['library'][] = 'az_opportunity_trellis/az_opportunity_trellis_date'; - // Trim valid options to selected options. - $options = $this->trellisDateOptions(); - $keys = $this->options['api_options'] ?? []; - $options = array_intersect($options, array_flip($keys)); - $form['value']['value'] = [ - '#type' => 'select', - '#options' => $options, - '#empty_option' => $this->t('- Any -'), - '#empty_value' => '', - '#required' => FALSE, - '#default_value' => $this->value['value'], - ]; - // Add label if this is the exposed form. - $exposed_info = $this->exposedInfo(); - if (!empty($exposed_info['label'])) { - $form['value']['value']['#title'] = $exposed_info['label']; - } - // Fetch library information for shadow DOM inclusion. - $css = []; - try { - $attached = AttachedAssets::createFromRenderArray([ - '#attached' => [ - 'library' => [ - 'az_opportunity_trellis/easepick_styles', - ], - ], - ]); - $assets = $this->assetResolver->getCssAssets($attached, TRUE); - foreach ($assets as $asset) { - if (!empty($asset['data'])) { - $css[] = $this->fileUrlGenerator->generateString($asset['data']); - } - } - } - catch (\Exception $e) { - // Failed to fetch assets. - } - $form['#attached']['drupalSettings']['trellisDatePicker']['css'] = $css; - // Prepare unique id for data attribute. - $end_id = Html::getUniqueId('az-trellis-daterange-end'); - $form['value']['begin'] = [ - '#type' => 'textfield', - '#title' => $this->t('Begin'), - '#attributes' => [ - 'data-az-trellis-daterange-end' => $end_id, - 'class' => ['az-trellis-daterange'], - ], - '#size' => 30, - '#default_value' => $this->value['begin'], - ]; - $form['value']['end'] = [ - '#type' => 'textfield', - '#title' => $this->t('End'), - '#attributes' => [ - 'id' => $end_id, - 'class' => ['az-trellis-daterange-end'], - ], - '#size' => 30, - '#default_value' => $this->value['end'], - ]; - // Compute conditional fields using states array. - if ($form_state->get('exposed')) { - $identifier = $this->options['expose']['identifier']; - $source = ':input[name="' . $identifier . '[value]"]'; - $state = [$source => ['value' => 'Custom']]; - $form['value']['begin']['#states']['visible'][] = $state; - $form['value']['end']['#states']['visible'][] = $state; - } - } - - /** - * {@inheritdoc} - */ - protected function buildValueWrapper(&$form, $wrapper_identifier) { - // Modify parent class behavior to be a container rather than a fieldset. - if (!isset($form[$wrapper_identifier])) { - $form[$wrapper_identifier] = [ - '#type' => 'container', - '#attributes' => [ - 'class' => [ - 'views-exposed-form__item', - 'az-opportunity-trellis-datewrapper', - ], - ], - ]; - } - } - - /** - * {@inheritdoc} - */ - public function operatorOptions(): array { - return [ - '=' => $this->t('Is equal to'), - '!=' => $this->t('Is not equal to'), - ]; - } - - /** - * {@inheritdoc} - */ - protected function defineOptions(): array { - $options = parent::defineOptions(); - $options['value'] = [ - 'contains' => [ - 'value' => ['default' => ''], - 'begin' => ['default' => ''], - 'end' => ['default' => ''], - ], - ]; - $options['api_param'] = ['default' => '']; - $options['api_options'] = ['default' => []]; - $options['api_param_custom_begin'] = ['default' => '']; - $options['api_param_custom_end'] = ['default' => '']; - return $options; - } - - /** - * {@inheritdoc} - */ - public function buildOptionsForm(&$form, FormStateInterface $form_state): void { - parent::buildOptionsForm($form, $form_state); - $form['api_options'] = [ - '#type' => 'select', - '#title' => $this->t('Trellis Date Options'), - '#options' => $this->trellisDateOptions(), - '#multiple' => TRUE, - '#required' => TRUE, - '#default_value' => $this->options['api_options'], - ]; - $form['api_param'] = [ - '#title' => $this->t('API get parameter for date'), - '#type' => 'textfield', - '#default_value' => $this->options['api_param'] ?? '', - '#required' => TRUE, - ]; - $form['api_param_custom_begin'] = [ - '#title' => $this->t('API get parameter for custom begin date'), - '#type' => 'textfield', - '#default_value' => $this->options['api_param_custom_begin'] ?? '', - '#required' => TRUE, - ]; - $form['api_param_custom_end'] = [ - '#title' => $this->t('API get parameter for custom end date'), - '#type' => 'textfield', - '#default_value' => $this->options['api_param_custom_end'] ?? '', - '#required' => TRUE, - ]; - - } - - /** - * {@inheritdoc} - */ - public function adminSummary() { - $prop = $this->options['api_param'] ?? ''; - $begin = $this->options['api_param_custom_begin'] ?? ''; - $end = $this->options['api_param_custom_end'] ?? ''; - return 'Date (API ' . $prop . ' ' . $begin . ' ' . $end . ') ' . $this->operator . ' ' . $this->value['value']; - } - - /** - * {@inheritdoc} - */ - public function query($group_by = FALSE): void { - if (!($this->query instanceof RemoteDataQuery)) { - return; - } - $value = $this->value['value'] ?? ''; - $this->query->addWhere( - $this->options['group'], - $this->options['api_param'], - $this->value['value'], - $this->operator - ); - // Handle supplied values if custom range. - if ($value === 'Custom') { - // Compute time offsets for API query. - $begin = $this->value['begin'] ?? ''; - $end = $this->value['end'] ?? ''; - $begin = strtotime($begin); - $end = strtotime($end); - if (($begin !== FALSE) && ($end !== FALSE)) { - // Find begin and end of respective days. - $begin = strtotime("today", $begin); - $end = strtotime("tomorrow", $end); - // Roll over to the previous night. - $end -= 1; - $begin = gmdate(self::TRELLIS_DATE_FORMAT, $begin); - $end = gmdate(self::TRELLIS_DATE_FORMAT, $end); - $this->query->addWhere( - $this->options['group'], - $this->options['api_param_custom_begin'], - $begin, - $this->operator - ); - $this->query->addWhere( - $this->options['group'], - $this->options['api_param_custom_end'], - $end, - $this->operator - ); - } - } - } - -} diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/src/TrellisHelper.php b/modules/custom/az_opportunity/az_opportunity_trellis/src/TrellisHelper.php deleted file mode 100644 index 642d2601b7..0000000000 --- a/modules/custom/az_opportunity/az_opportunity_trellis/src/TrellisHelper.php +++ /dev/null @@ -1,314 +0,0 @@ -configFactory = $config_factory; - $this->httpClient = $http_client; - $this->cache = $cache; - $this->entityTypeManager = $entity_type_manager; - } - - /** - * Search based on parameters for events. - * - * @param array $query - * Query parameters to use in search. - * - * @return array - * Array of trellis event ids. - */ - public function searchEvents(array $query) { - $ids = []; - // Compute cache key of query. - $key = 'az_trellis_event.search:' . Crypt::hashBase64(serialize($query)); - $cached = $this->cache->get($key); - // If we have this search cached, return it. - if ($cached !== FALSE) { - return $cached->data; - } - - $url = $this->getEventSearchEndpoint(); - try { - // Run search request. - $response = $this->httpClient->request('GET', $url, ['query' => $query]); - if ($response->getStatusCode() === 200) { - $json = (string) $response->getBody(); - $json = json_decode($json, TRUE); - if ($json !== NULL) { - $ids = $json['data']['Event_IDs'] ?? []; - // Ensure events are in Id order. - sort($ids); - // @todo determine cache expiration. - $expire = time() + 1800; - // Cache search result. - $this->cache->set($key, $ids, $expire); - } - } - } - catch (GuzzleException $e) { - } - return $ids; - } - - /** - * Returns event data for an array of ids. - * - * @param array $trellis_ids - * Trellis Event IDs in an array. - * - * @return array - * Event data. - */ - public function getEvents(array $trellis_ids) { - $events = []; - $fetch = []; - $url = $this->getEventEndpoint(); - // Remove any duplicate ids to mimic remote API. - $trellis_ids = array_unique($trellis_ids); - // Grab events that are in cache. - foreach ($trellis_ids as $trellis_id) { - $cached = $this->getTrellisCache($trellis_id); - if ($cached === FALSE) { - $fetch[] = $trellis_id; - } - else { - $events[] = $cached; - } - } - // Fetch events we did not have cached. - if (!empty($fetch)) { - try { - $data = ['ids' => implode(',', $fetch)]; - $response = $this->httpClient->request('POST', $url, ['json' => $data]); - if ($response->getStatusCode() === 200) { - $json = (string) $response->getBody(); - $json = json_decode($json, TRUE); - if ($json !== NULL) { - $results = $json['data'] ?? []; - foreach ($results as $result) { - // Cache the event and add it to the list. - $events[] = $this->setTrellisCache($result); - } - } - } - } - catch (GuzzleException $e) { - } - } - // Make sure events are in Id order regardless of cached/fetched. - usort($events, function ($a, $b) { - return strcmp($a['Id'], $b['Id']); - }); - return $events; - } - - /** - * Fetch the list of trellis event ids currently imported. - * - * @return array - * Returns an array of event ids. - */ - public function getImportedEventIds() { - $nodeStorage = $this->entityTypeManager->getStorage('node'); - // Check for events that have trellis ids. - $query = $nodeStorage->getQuery() - ->accessCheck(FALSE) - ->condition('type', 'az_event') - ->exists('field_az_trellis_id'); - $nids = $query->execute(); - $nodes = $nodeStorage->loadMultiple($nids); - - $event_api_ids = []; - foreach ($nodes as $n) { - $event_api_ids[] = $n->get('field_az_trellis_id')->getString(); - } - return $event_api_ids; - } - - /** - * Fetch the recurring search list of ids to import. - * - * @return array - * Returns an array of event ids. - */ - public function getRecurringEventIds() { - // Find enabled import configurations. - $imports = $this->entityTypeManager->getStorage('az_recurring_import_rule')->loadByProperties([ - 'status' => [1, TRUE], - ]); - - $event_api_ids = []; - foreach ($imports as $import) { - /** @var \Drupal\az_event_trellis\Entity\AZRecurringImportRule $import */ - $event_api_ids += $import->getEventIds(); - } - // Remove duplicates in case searches overlapped. - $event_api_ids = array_unique($event_api_ids); - return $event_api_ids; - } - - /** - * Return mapped array of api names of attributes. - * - * @return array - * The array of attribute ids mapped to API names. - */ - public function getAttributeMappings() { - $mappings = []; - $view = Views::getView('az_event_trellis_import'); - $display = $view->getDisplay() ?? NULL; - $filters = $display->getHandlers('filter'); - foreach ($filters as $filter) { - if ($filter instanceof AZEventTrellisViewsAttributeFilter) { - $mappings += $filter->getApiMapping(); - } - } - return $mappings; - } - - /** - * Returns the cache for an event if possible. - * - * @param string $trellis_id - * The trellis id of the event. - * - * @return mixed - * The cached data for the event, or FALSE. - */ - protected function getTrellisCache(string $trellis_id) { - $key = 'az_trellis_event:' . $trellis_id; - return $this->cache->get($key)->data ?? FALSE; - } - - /** - * Sets the cache for an event if possible. - * - * @param array $event - * The event data result. - * - * @return array - * The data for the event. - */ - protected function setTrellisCache(array $event) { - if (!empty($event['Id'])) { - $key = 'az_trellis_event:' . $event['Id']; - // @todo determine cache expiration. - $expire = time() + 1800; - $this->cache->set($key, $event, $expire); - } - return $event; - } - - /** - * Returns API URL for given Trellis Event ID. - * - * @param string $trellis_id - * Trellis Event ID. - * - * @return string - * Event API URL. - */ - public function getEventUrl($trellis_id) { - $hostname = $this->configFactory->get('az_event_trellis.settings')->get('api_hostname'); - return 'https://' . $hostname . self::$apiBasePath . $trellis_id; - } - - /** - * Returns API URL. - * - * @return string - * Event API URL. - */ - public function getEventEndpoint() { - $hostname = $this->configFactory->get('az_event_trellis.settings')->get('api_hostname'); - return 'https://' . $hostname . self::$apiBasePath; - } - - /** - * Returns API search URL. - * - * @return string - * Event API search URL. - */ - public function getEventSearchEndpoint() { - $hostname = $this->configFactory->get('az_event_trellis.settings')->get('api_hostname'); - return 'https://' . $hostname . self::$apiSearchPath; - } - -} diff --git a/modules/custom/az_opportunity/config/install/.htaccess b/modules/custom/az_opportunity/config/install/.htaccess deleted file mode 100644 index b0dc5406e6..0000000000 --- a/modules/custom/az_opportunity/config/install/.htaccess +++ /dev/null @@ -1,24 +0,0 @@ -# Deny all requests from Apache 2.4+. - - Require all denied - - -# Deny all requests from Apache 2.0-2.2. - - Deny from all - - -# Turn off all options we don't need. -Options -Indexes -ExecCGI -Includes -MultiViews - -# Set the catch-all handler to prevent scripts from being executed. -SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006 - - # Override the handler again if we're run later in the evaluation list. - SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003 - - -# If we know how to do it safely, disable the PHP engine entirely. - - php_flag engine off - \ No newline at end of file diff --git a/modules/custom/az_opportunity/config/install/core.entity_form_display.node.az_opportunity.default.yml b/modules/custom/az_opportunity/config/install/core.entity_form_display.node.az_opportunity.default.yml index 24896792a2..52800a90c2 100644 --- a/modules/custom/az_opportunity/config/install/core.entity_form_display.node.az_opportunity.default.yml +++ b/modules/custom/az_opportunity/config/install/core.entity_form_display.node.az_opportunity.default.yml @@ -27,6 +27,7 @@ dependencies: - datetime - file - link + - link_class - media_library - media_library_edit - path @@ -64,12 +65,15 @@ content: duration_overlay: true third_party_settings: { } field_az_application_link: - type: link_default + type: link_class_field_widget weight: 22 region: content settings: placeholder_url: '' placeholder_title: '' + link_class_mode: force_class + link_class_force: 'btn btn-red' + link_class_select: '' third_party_settings: { } field_az_attachments: type: file_generic diff --git a/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_card.yml b/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_card.yml index dc07c4908d..882273237f 100644 --- a/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_card.yml +++ b/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_card.yml @@ -37,7 +37,7 @@ third_party_settings: label: col1 parent_name: '' region: hidden - weight: 19 + weight: 16 format_type: html_element format_settings: classes: col @@ -56,7 +56,7 @@ third_party_settings: label: col2 parent_name: '' region: hidden - weight: 20 + weight: 17 format_type: html_element format_settings: classes: col @@ -75,7 +75,7 @@ third_party_settings: label: col3 parent_name: '' region: hidden - weight: 22 + weight: 19 format_type: html_element format_settings: classes: col @@ -94,7 +94,7 @@ third_party_settings: label: col4 parent_name: '' region: hidden - weight: 23 + weight: 20 format_type: html_element format_settings: classes: col @@ -113,7 +113,7 @@ third_party_settings: label: col5 parent_name: '' region: hidden - weight: 24 + weight: 21 format_type: html_element format_settings: classes: col @@ -132,7 +132,7 @@ third_party_settings: label: col6 parent_name: '' region: hidden - weight: 21 + weight: 18 format_type: html_element format_settings: classes: col @@ -151,7 +151,7 @@ third_party_settings: label: col7 parent_name: '' region: hidden - weight: 25 + weight: 22 format_type: html_element format_settings: classes: col7 @@ -170,7 +170,7 @@ third_party_settings: label: col8 parent_name: '' region: hidden - weight: 26 + weight: 23 format_type: html_element format_settings: classes: col @@ -188,11 +188,12 @@ third_party_settings: children: - group_card_clickable - field_az_program_length + - links - group_read_more label: 'header row' parent_name: '' region: hidden - weight: 18 + weight: 15 format_type: html_element format_settings: classes: row @@ -228,7 +229,6 @@ third_party_settings: speed: fast group_link: children: - - links - field_az_media_image - group_heading - group_text_body_secondary @@ -267,14 +267,14 @@ third_party_settings: speed: fast group_text_body_secondary: children: - - field_az_application_date - field_az_location + - field_az_application_date - field_az_offered - field_az_modality label: 'Text Body Secondary' parent_name: group_link region: content - weight: 19 + weight: 20 format_type: html_element format_settings: classes: 'text-body-secondary fw-normal small mt-2' @@ -347,19 +347,19 @@ content: from_to: both separator: '-' third_party_settings: { } - weight: 2 + weight: 6 region: content field_az_location: type: link - label: inline + label: hidden settings: trim_length: 80 url_only: false url_plain: false - rel: '' - target: '' + rel: '0' + target: '0' third_party_settings: { } - weight: 3 + weight: 5 region: content field_az_media_image: type: entity_reference_entity_view @@ -376,7 +376,7 @@ content: settings: link: false third_party_settings: { } - weight: 5 + weight: 8 region: content field_az_offered: type: entity_reference_label @@ -384,12 +384,7 @@ content: settings: link: false third_party_settings: { } - weight: 4 - region: content - links: - settings: { } - third_party_settings: { } - weight: 16 + weight: 7 region: content smart_title: settings: { } @@ -412,3 +407,4 @@ hidden: field_az_topic: true field_az_trellis_id: true field_az_trellis_imported_date: true + links: true diff --git a/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.default.yml b/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.default.yml index c03f4243bb..831cf68cc3 100644 --- a/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.default.yml +++ b/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.default.yml @@ -36,7 +36,6 @@ third_party_settings: group_col1: children: - group_where - - field_az_location label: col1 parent_name: group_header_row region: content @@ -57,7 +56,6 @@ third_party_settings: group_col2: children: - group_date - - field_az_offered label: col2 parent_name: group_header_row region: content @@ -78,7 +76,6 @@ third_party_settings: group_col3: children: - group_program_length - - field_az_program_length label: col3 parent_name: group_header_row region: content @@ -99,7 +96,6 @@ third_party_settings: group_col4: children: - group_modality - - field_az_modality label: col4 parent_name: group_header_row region: content @@ -120,8 +116,6 @@ third_party_settings: group_col5: children: - group_incentives - - field_az_incentives - - field_az_credit label: col5 parent_name: group_header_row region: content @@ -142,8 +136,6 @@ third_party_settings: group_col6: children: - group_audiences - - field_az_audiences - - field_az_opportunity_type label: col6 parent_name: group_header_row region: content @@ -162,14 +154,15 @@ third_party_settings: effect: none speed: fast group_col7: - children: { } + children: + - field_az_program_website label: col7 - parent_name: '' - region: hidden + parent_name: group_bottom_row + region: content weight: 15 format_type: html_element format_settings: - classes: col7 + classes: col show_empty_fields: false id: '' label_as_html: false @@ -181,11 +174,12 @@ third_party_settings: effect: none speed: fast group_col8: - children: { } + children: + - field_az_application_link label: col8 - parent_name: '' - region: hidden - weight: 16 + parent_name: group_bottom_row + region: content + weight: 17 format_type: html_element format_settings: classes: col @@ -225,7 +219,8 @@ third_party_settings: effect: none speed: fast group_where: - children: { } + children: + - field_az_location label: Where parent_name: group_col1 region: content @@ -233,18 +228,19 @@ third_party_settings: format_type: html_element format_settings: classes: '' - show_empty_fields: true + show_empty_fields: false id: '' label_as_html: false - element: h4 + element: div show_label: true - label_element: Where - label_element_classes: '' + label_element: h2 + label_element_classes: 'h4 fw-bolder' attributes: '' effect: none speed: fast group_date: - children: { } + children: + - field_az_offered label: Date parent_name: group_col2 region: content @@ -252,18 +248,19 @@ third_party_settings: format_type: html_element format_settings: classes: '' - show_empty_fields: true + show_empty_fields: false id: '' label_as_html: false - element: h4 + element: div show_label: true - label_element: Date - label_element_classes: '' + label_element: h2 + label_element_classes: 'h4 fw-bolder' attributes: '' effect: none speed: fast group_modality: - children: { } + children: + - field_az_modality label: Modality parent_name: group_col4 region: content @@ -271,18 +268,20 @@ third_party_settings: format_type: html_element format_settings: classes: '' - show_empty_fields: true + show_empty_fields: false id: '' label_as_html: false - element: h4 + element: div show_label: true - label_element: Modality - label_element_classes: '' + label_element: h2 + label_element_classes: 'h4 fw-bolder' attributes: '' effect: none speed: fast group_incentives: - children: { } + children: + - field_az_incentives + - field_az_credit label: Incentives parent_name: group_col5 region: content @@ -290,18 +289,20 @@ third_party_settings: format_type: html_element format_settings: classes: '' - show_empty_fields: true + show_empty_fields: false id: '' label_as_html: false - element: h4 + element: div show_label: true - label_element: Incentives - label_element_classes: '' + label_element: h2 + label_element_classes: 'h4 fw-bolder' attributes: '' effect: none speed: fast group_audiences: - children: { } + children: + - field_az_audiences + - field_az_opportunity_type label: Audiences parent_name: group_col6 region: content @@ -312,15 +313,16 @@ third_party_settings: show_empty_fields: true id: '' label_as_html: false - element: h4 + element: div show_label: true - label_element: Audiences - label_element_classes: '' + label_element: h2 + label_element_classes: 'h4 fw-bolder' attributes: '' effect: none speed: fast group_program_length: - children: { } + children: + - field_az_program_length label: Length parent_name: group_col3 region: content @@ -328,13 +330,13 @@ third_party_settings: format_type: html_element format_settings: classes: '' - show_empty_fields: true + show_empty_fields: false id: '' label_as_html: false - element: h4 + element: div show_label: true - label_element: Length - label_element_classes: '' + label_element: h4 + label_element_classes: 'h4 fw-bolder' attributes: '' effect: none speed: fast @@ -358,6 +360,27 @@ third_party_settings: attributes: '' effect: none speed: fast + group_bottom_row: + children: + - group_col7 + - group_col8 + label: 'Bottom Row' + parent_name: '' + region: content + weight: 10 + format_type: html_element + format_settings: + classes: row + show_empty_fields: false + id: '' + label_as_html: false + element: div + show_label: false + label_element: h3 + label_element_classes: '' + attributes: '' + effect: none + speed: fast smart_title: enabled: false id: node.az_opportunity.default @@ -378,7 +401,7 @@ content: region: content field_az_application_link: type: link - label: above + label: hidden settings: trim_length: 80 url_only: false @@ -386,7 +409,7 @@ content: rel: '0' target: '0' third_party_settings: { } - weight: 10 + weight: 16 region: content field_az_attachments: type: file_default @@ -400,7 +423,7 @@ content: type: entity_reference_label label: hidden settings: - link: true + link: false third_party_settings: { } weight: 4 region: content @@ -430,7 +453,7 @@ content: weight: 4 region: content field_az_location: - type: link_separate + type: link label: hidden settings: trim_length: 80 @@ -495,7 +518,7 @@ content: region: content field_az_program_website: type: link - label: above + label: hidden settings: trim_length: 80 url_only: false diff --git a/modules/custom/az_opportunity/config/install/field.storage.node.field_az_application_date.yml b/modules/custom/az_opportunity/config/install/field.storage.node.field_az_application_date.yml index 92e1ddc588..84554f56da 100644 --- a/modules/custom/az_opportunity/config/install/field.storage.node.field_az_application_date.yml +++ b/modules/custom/az_opportunity/config/install/field.storage.node.field_az_application_date.yml @@ -10,7 +10,6 @@ entity_type: node type: daterange settings: datetime_type: datetime - optional_end_date: false module: datetime_range locked: false cardinality: 1 diff --git a/modules/custom/az_opportunity/config/install/field.storage.node.field_az_program_date.yml b/modules/custom/az_opportunity/config/install/field.storage.node.field_az_program_date.yml index 9877ec60c6..e0926ea086 100644 --- a/modules/custom/az_opportunity/config/install/field.storage.node.field_az_program_date.yml +++ b/modules/custom/az_opportunity/config/install/field.storage.node.field_az_program_date.yml @@ -10,7 +10,6 @@ entity_type: node type: daterange settings: datetime_type: datetime - optional_end_date: false module: datetime_range locked: false cardinality: 1 diff --git a/modules/custom/az_opportunity/config/install/views.view.az_opportunity.yml b/modules/custom/az_opportunity/config/install/views.view.az_opportunity.yml index 4812ed0ad6..0365d93fb8 100644 --- a/modules/custom/az_opportunity/config/install/views.view.az_opportunity.yml +++ b/modules/custom/az_opportunity/config/install/views.view.az_opportunity.yml @@ -267,6 +267,117 @@ display: label: '' field_identifier: '' exposed: false + filters: + status: + id: status + table: node_field_data + field: status + entity_type: node + entity_field: status + plugin_id: boolean + value: '1' + group: 1 + expose: + operator: '' + type: + id: type + table: node_field_data + field: type + entity_type: node + entity_field: type + plugin_id: bundle + value: + az_opportunity: az_opportunity + group: 1 + field_az_ongoing_value: + id: field_az_ongoing_value + table: node__field_az_ongoing + field: field_az_ongoing_value + relationship: none + group_type: group + admin_label: '' + plugin_id: boolean + operator: '=' + value: '1' + group: 2 + exposed: false + expose: + operator_id: '' + label: '' + description: '' + use_operator: false + operator: '' + operator_limit_selection: false + operator_list: { } + identifier: '' + required: false + remember: false + multiple: false + remember_roles: + authenticated: authenticated + is_grouped: false + group_info: + label: '' + description: '' + identifier: '' + optional: true + widget: select + multiple: false + remember: false + default_group: All + default_group_multiple: { } + group_items: { } + field_az_application_date_end_value: + id: field_az_application_date_end_value + table: node__field_az_application_date + field: field_az_application_date_end_value + relationship: none + group_type: group + admin_label: '' + plugin_id: datetime + operator: '>=' + value: + min: '' + max: '' + value: now + type: offset + group: 2 + exposed: false + expose: + operator_id: '' + label: '' + description: '' + use_operator: false + operator: '' + operator_limit_selection: false + operator_list: { } + identifier: '' + required: false + remember: false + multiple: false + remember_roles: + authenticated: authenticated + min_placeholder: '' + max_placeholder: '' + placeholder: '' + is_grouped: false + group_info: + label: '' + description: '' + identifier: '' + optional: true + widget: select + multiple: false + remember: false + default_group: All + default_group_multiple: { } + group_items: { } + granularity: day + filter_groups: + operator: AND + groups: + 1: AND + 2: OR style: type: default options: @@ -283,6 +394,8 @@ display: style_options: false row: false sorts: false + filters: false + filter_groups: false display_description: '' style_options: null display_extenders: { } @@ -301,24 +414,6 @@ display: display_title: 'Card View' display_plugin: block position: 1 - display_options: - display_description: '' - display_extenders: { } - cache_metadata: - max-age: -1 - contexts: - - 'languages:language_content' - - 'languages:language_interface' - - url - - url.query_args - - 'user.node_grants:view' - - user.permissions - tags: { } - block_4: - id: block_4 - display_title: 'Row View Application Dates' - display_plugin: block - position: 1 display_options: filters: status: @@ -342,8 +437,8 @@ display: value: az_opportunity: az_opportunity group: 1 - field_az_ongoing_value_1: - id: field_az_ongoing_value_1 + field_az_ongoing_value: + id: field_az_ongoing_value table: node__field_az_ongoing field: field_az_ongoing_value relationship: none @@ -351,8 +446,8 @@ display: admin_label: '' plugin_id: boolean operator: '=' - value: '0' - group: 1 + value: '1' + group: 2 exposed: false expose: operator_id: '' @@ -394,7 +489,7 @@ display: max: '' value: now type: offset - group: 1 + group: 2 exposed: false expose: operator_id: '' @@ -426,59 +521,64 @@ display: default_group_multiple: { } group_items: { } granularity: day - status_1: - id: status_1 + filter_groups: + operator: AND + groups: + 1: AND + 2: OR + defaults: + filters: false + filter_groups: false + display_description: '' + display_extenders: { } + cache_metadata: + max-age: -1 + contexts: + - 'languages:language_content' + - 'languages:language_interface' + - url + - url.query_args + - 'user.node_grants:view' + - user.permissions + tags: { } + block_4: + id: block_4 + display_title: 'Row View' + display_plugin: block + position: 1 + display_options: + filters: + status: + id: status table: node_field_data field: status - relationship: none - group_type: group - admin_label: '' entity_type: node entity_field: status plugin_id: boolean - operator: '=' value: '1' - group: 2 - exposed: false + group: 1 expose: - operator_id: '' - label: '' - description: '' - use_operator: false operator: '' - operator_limit_selection: false - operator_list: { } - identifier: '' - required: false - remember: false - multiple: false - remember_roles: - authenticated: authenticated - is_grouped: false - group_info: - label: '' - description: '' - identifier: '' - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: { } - type_1: - id: type_1 + type: + id: type table: node_field_data field: type - relationship: none - group_type: group - admin_label: '' entity_type: node entity_field: type plugin_id: bundle - operator: in value: az_opportunity: az_opportunity + group: 1 + field_az_ongoing_value: + id: field_az_ongoing_value + table: node__field_az_ongoing + field: field_az_ongoing_value + relationship: none + group_type: group + admin_label: '' + plugin_id: boolean + operator: '=' + value: '1' group: 2 exposed: false expose: @@ -495,7 +595,6 @@ display: multiple: false remember_roles: authenticated: authenticated - reduce: false is_grouped: false group_info: label: '' @@ -508,16 +607,20 @@ display: default_group: All default_group_multiple: { } group_items: { } - field_az_ongoing_value: - id: field_az_ongoing_value - table: node__field_az_ongoing - field: field_az_ongoing_value + field_az_application_date_end_value: + id: field_az_application_date_end_value + table: node__field_az_application_date + field: field_az_application_date_end_value relationship: none group_type: group admin_label: '' - plugin_id: boolean - operator: '=' - value: '1' + plugin_id: datetime + operator: '>=' + value: + min: '' + max: '' + value: now + type: offset group: 2 exposed: false expose: @@ -534,6 +637,9 @@ display: multiple: false remember_roles: authenticated: authenticated + min_placeholder: '' + max_placeholder: '' + placeholder: '' is_grouped: false group_info: label: '' @@ -546,12 +652,12 @@ display: default_group: All default_group_multiple: { } group_items: { } + granularity: day filter_groups: - operator: OR + operator: AND groups: 1: AND - 2: AND - 3: AND + 2: OR style: type: default options: @@ -863,10 +969,95 @@ display: default_group: All default_group_multiple: { } group_items: { } + field_az_ongoing_value: + id: field_az_ongoing_value + table: node__field_az_ongoing + field: field_az_ongoing_value + relationship: none + group_type: group + admin_label: '' + plugin_id: boolean + operator: '=' + value: '1' + group: 2 + exposed: false + expose: + operator_id: '' + label: '' + description: '' + use_operator: false + operator: '' + operator_limit_selection: false + operator_list: { } + identifier: '' + required: false + remember: false + multiple: false + remember_roles: + authenticated: authenticated + is_grouped: false + group_info: + label: '' + description: '' + identifier: '' + optional: true + widget: select + multiple: false + remember: false + default_group: All + default_group_multiple: { } + group_items: { } + field_az_application_date_end_value: + id: field_az_application_date_end_value + table: node__field_az_application_date + field: field_az_application_date_end_value + relationship: none + group_type: group + admin_label: '' + plugin_id: datetime + operator: '>=' + value: + min: '' + max: '' + value: now + type: offset + group: 2 + exposed: false + expose: + operator_id: '' + label: '' + description: '' + use_operator: false + operator: '' + operator_limit_selection: false + operator_list: { } + identifier: '' + required: false + remember: false + multiple: false + remember_roles: + authenticated: authenticated + min_placeholder: '' + max_placeholder: '' + placeholder: '' + is_grouped: false + group_info: + label: '' + description: '' + identifier: '' + optional: true + widget: select + multiple: false + remember: false + default_group: All + default_group_multiple: { } + group_items: { } + granularity: day filter_groups: operator: AND groups: 1: AND + 2: OR style: type: default options: @@ -1178,10 +1369,95 @@ display: default_group: All default_group_multiple: { } group_items: { } + field_az_ongoing_value: + id: field_az_ongoing_value + table: node__field_az_ongoing + field: field_az_ongoing_value + relationship: none + group_type: group + admin_label: '' + plugin_id: boolean + operator: '=' + value: '1' + group: 2 + exposed: false + expose: + operator_id: '' + label: '' + description: '' + use_operator: false + operator: '' + operator_limit_selection: false + operator_list: { } + identifier: '' + required: false + remember: false + multiple: false + remember_roles: + authenticated: authenticated + is_grouped: false + group_info: + label: '' + description: '' + identifier: '' + optional: true + widget: select + multiple: false + remember: false + default_group: All + default_group_multiple: { } + group_items: { } + field_az_application_date_end_value: + id: field_az_application_date_end_value + table: node__field_az_application_date + field: field_az_application_date_end_value + relationship: none + group_type: group + admin_label: '' + plugin_id: datetime + operator: '>=' + value: + min: '' + max: '' + value: now + type: offset + group: 2 + exposed: false + expose: + operator_id: '' + label: '' + description: '' + use_operator: false + operator: '' + operator_limit_selection: false + operator_list: { } + identifier: '' + required: false + remember: false + multiple: false + remember_roles: + authenticated: authenticated + min_placeholder: '' + max_placeholder: '' + placeholder: '' + is_grouped: false + group_info: + label: '' + description: '' + identifier: '' + optional: true + widget: select + multiple: false + remember: false + default_group: All + default_group_multiple: { } + group_items: { } + granularity: day filter_groups: operator: AND groups: 1: AND + 2: OR style: type: views_bootstrap_grid options: diff --git a/query.sql b/query.sql new file mode 100644 index 0000000000..236c01a5f7 --- /dev/null +++ b/query.sql @@ -0,0 +1,8 @@ +SELECT "node__field_az_application_date"."field_az_application_date_value" AS "node__field_az_application_date_field_az_application_date_va", "node_field_data"."title" AS "node_field_data_title", "node_field_data"."nid" AS "nid" +FROM +{node_field_data} "node_field_data" +LEFT JOIN {node__field_az_ongoing} "node__field_az_ongoing" ON node_field_data.nid = node__field_az_ongoing.entity_id AND node__field_az_ongoing.deleted = '0' +LEFT JOIN {node__field_az_application_date} "node__field_az_application_date" ON node_field_data.nid = node__field_az_application_date.entity_id AND node__field_az_application_date.deleted = '0' +WHERE (("node_field_data"."status" = '1') AND ("node_field_data"."type" IN ('az_opportunity'))) AND ("node__field_az_ongoing"."field_az_ongoing_value" = '1') AND ((DATE_FORMAT((node__field_az_application_date.field_az_application_date_end_value + INTERVAL -25200 SECOND), '%Y-%m-%d') >= DATE_FORMAT('2026-01-23T15:15:00', '%Y-%m-%d'))) +ORDER BY "node__field_az_application_date_field_az_application_date_va" ASC, "node_field_data_title" ASC +LIMIT 11 OFFSET 0 From 2f9a4ca5cb7c7cdee249a6661972e71ff089f103 Mon Sep 17 00:00:00 2001 From: Z Saenz Date: Mon, 26 Jan 2026 11:51:47 -0700 Subject: [PATCH 10/59] Update modules/custom/az_core/config/install/smart_title.settings.yml Co-authored-by: Joe Parsons <471936+joeparsons@users.noreply.github.com> --- modules/custom/az_core/config/install/smart_title.settings.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/custom/az_core/config/install/smart_title.settings.yml b/modules/custom/az_core/config/install/smart_title.settings.yml index ccacfb8934..020faacb01 100644 --- a/modules/custom/az_core/config/install/smart_title.settings.yml +++ b/modules/custom/az_core/config/install/smart_title.settings.yml @@ -1,4 +1,6 @@ smart_title: + - 'node:az_carousel_item' + - 'node:az_course' - 'node:az_event' - 'node:az_flexible_page' - 'node:az_news' From e429185ec367e5f2e44a3b639d7b0347cea35f17 Mon Sep 17 00:00:00 2001 From: Z Saenz Date: Thu, 29 Jan 2026 09:37:56 -0700 Subject: [PATCH 11/59] Add starter for trellis importer (non-functional) It installs properly, but doesn't work. It causes problems with Trellis Event Importer. --- .../az_opportunitty_trellis.install | 35 + .../az_opportunity_trellis.info.yml | 21 + .../az_opportunity_trellis.libraries.yml | 18 + .../az_opportunity_trellis.links.action.yml | 5 + .../az_opportunity_trellis.links.task.yml | 18 + .../az_opportunity_trellis.module | 171 +++ .../az_opportunity_trellis.routing.yml | 47 + .../az_opportunity_trellis.services.yml | 17 + .../az_opportunity_trellis.views.inc | 69 ++ .../az_opportunity_trellis.settings.yml | 1 + ..._plus.migration.az_trellis_opportunity.yml | 135 +++ ...migration_group.az_trellis_opportunity.yml | 11 + ....cron_migration.az_opportunity_trellis.yml | 13 + ...ews.view.az_opportunity_trellis_import.yml | 1053 +++++++++++++++++ .../schema/az_opportunity_trellis.schema.yml | 39 + .../az_opportunity_trellis_datewrapper.css | 3 + .../js/az_opportunity_trellis_date.js | 27 + .../az_trellis_opportunity_files.yml | 42 + .../az_trellis_opportunity_media.yml | 56 + .../src/AZRecurringImportRuleInterface.php | 30 + .../src/AZRecurringImportRuleListBuilder.php | 56 + .../AZRecurringImportModalController.php | 101 ++ .../src/Entity/AZRecurringImportRule.php | 129 ++ .../AZOpportunityTrellisDataSubscriber.php | 157 +++ .../src/Form/AZRecurringImportRuleForm.php | 185 +++ .../Form/TrellisOpportunitySettingsForm.php | 53 + .../source/AZTrellisOpportunitySource.php | 144 +++ .../field/AZOpportunityTrellisViewsField.php | 160 +++ ...ZOpportunityTrellisViewsApprovalFilter.php | 96 ++ ...OpportunityTrellisViewsAttributeFilter.php | 170 +++ .../AZOpportunityTrellisViewsDateFilter.php | 289 +++++ .../src/TrellisHelper.php | 314 +++++ 32 files changed, 3665 insertions(+) create mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/az_opportunitty_trellis.install create mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.info.yml create mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.libraries.yml create mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.links.action.yml create mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.links.task.yml create mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.module create mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.routing.yml create mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.services.yml create mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.views.inc create mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/config/install/az_opportunity_trellis.settings.yml create mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/config/install/migrate_plus.migration.az_trellis_opportunity.yml create mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/config/install/migrate_plus.migration_group.az_trellis_opportunity.yml create mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/config/install/migrate_queue_importer.cron_migration.az_opportunity_trellis.yml create mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/config/install/views.view.az_opportunity_trellis_import.yml create mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/config/schema/az_opportunity_trellis.schema.yml create mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/css/az_opportunity_trellis_datewrapper.css create mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/js/az_opportunity_trellis_date.js create mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/migrations/az_trellis_opportunity_files.yml create mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/migrations/az_trellis_opportunity_media.yml create mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/src/AZRecurringImportRuleInterface.php create mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/src/AZRecurringImportRuleListBuilder.php create mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/src/Controller/AZRecurringImportModalController.php create mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/src/Entity/AZRecurringImportRule.php create mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/src/EventSubscriber/AZOpportunityTrellisDataSubscriber.php create mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/src/Form/AZRecurringImportRuleForm.php create mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/src/Form/TrellisOpportunitySettingsForm.php create mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/src/Plugin/migrate/source/AZTrellisOpportunitySource.php create mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/src/Plugin/views/field/AZOpportunityTrellisViewsField.php create mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/src/Plugin/views/filter/AZOpportunityTrellisViewsApprovalFilter.php create mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/src/Plugin/views/filter/AZOpportunityTrellisViewsAttributeFilter.php create mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/src/Plugin/views/filter/AZOpportunityTrellisViewsDateFilter.php create mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/src/TrellisHelper.php diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunitty_trellis.install b/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunitty_trellis.install new file mode 100644 index 0000000000..9e2cd74a19 --- /dev/null +++ b/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunitty_trellis.install @@ -0,0 +1,35 @@ +install(['views_remote_data']); +} + +/** + * Ensure az_recurring_import_rule entity type is installed. + */ +function az_opportunity_trellis_update_1021001() { + $changes = \Drupal::entityDefinitionUpdateManager()->getChangeList(); + $status = $changes['az_recurring_import_rule']['entity_type'] ?? ''; + // Determine if recurring import rule entity needs to be created. + if ($status === EntityDefinitionUpdateManagerInterface::DEFINITION_CREATED) { + $entity_type_definition = \Drupal::service('entity_type.manager')->getDefinition('az_recurring_import_rule'); + \Drupal::entityDefinitionUpdateManager()->installEntityType($entity_type_definition); + } +} + +/** + * Ensure az_migration_remote is installed. + */ +function az_opportunity_trellis_update_1021301() { + \Drupal::service('module_installer')->install(['az_migration_remote']); +} diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.info.yml b/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.info.yml new file mode 100644 index 0000000000..3748a260a9 --- /dev/null +++ b/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.info.yml @@ -0,0 +1,21 @@ +name: Quickstart Opportunity - Trellis Importer +type: module +description: 'Import opportunities from Trellis Progrmas, the official University of Arizona programs management tool.' +core_version_requirement: ^10 || ^11 || ^12 +package: 'The University of Arizona - Experimental' +lifecycle: experimental +lifecycle_link: 'https://github.com/az-digital/az_quickstart/blob/main/RELEASES.md#experimental-features' +php: 8.0 + +dependencies: + - az_core:az_core + - az_opportunity:az_opportunity + - az_migration:az_migration_remote + - drupal:views + - drupal:migrate + - migrate_plus:migrate_plus + - migrate_tools:migrate_tools + - migrate_queue_importer:migrate_queue_importer + - views_remote_data:views_remote_data + +configure: az_opportunity_trellis.settings \ No newline at end of file diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.libraries.yml b/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.libraries.yml new file mode 100644 index 0000000000..02849af8d1 --- /dev/null +++ b/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.libraries.yml @@ -0,0 +1,18 @@ +az_opportunity_trellis_date: + js: + js/az_opportunity_trellis_date.js: {} + css: + theme: + css/az_opportunity_trellis_datewrapper.css: {} + dependencies: + - core/drupal + - core/drupalSettings + - core/once + - az_opportunity_trellis/easepick_bundle +easepick_bundle: + js: + /libraries/easepick--bundle/dist/index.umd.js: { minified: true } +easepick_styles: + css: + theme: + /libraries/easepick--bundle/dist/index.css: { minified: true } diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.links.action.yml b/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.links.action.yml new file mode 100644 index 0000000000..2fbeb0bbfe --- /dev/null +++ b/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.links.action.yml @@ -0,0 +1,5 @@ +entity.az_recurring_import_rule.add_form: + route_name: 'entity.az_recurring_import_rule.add_form' + title: 'Add Recurring Import Rule' + appears_on: + - entity.az_recurring_import_rule.collection diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.links.task.yml b/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.links.task.yml new file mode 100644 index 0000000000..d2b3ae045e --- /dev/null +++ b/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.links.task.yml @@ -0,0 +1,18 @@ +az_opportunity_trellis.az_opportunity_trellis_settings_task: + route_name: az_opportunity_trellis.settings + title: 'AZ Trellis Opportunity Importer' + base_route: az_core.az_settings + weight: 0 + +az_opportunity.import_form_task: + title: 'Trellis opportunity importer' + route_name: view.az_opportunity_trellis_import.page_1 + parent_id: system.admin_content + description: 'Import opportunities from the Trellis Opportunity API.' + weight: 101 + +az_opportunity_trellis.az_recurring_import_rules_tab: + route_name: entity.az_recurring_import_rule.collection + title: 'Recurring Imports' + base_route: az_core.az_settings + weight: 5 diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.module b/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.module new file mode 100644 index 0000000000..eb3797575c --- /dev/null +++ b/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.module @@ -0,0 +1,171 @@ +getFormObject(); + if ($form_object instanceof EntityFormInterface) { + /** @var \Drupal\node\NodeInterface $node */ + $node = $form_object->getEntity(); + $trellis_id = $node->get('field_az_trellis_id')->getString(); + if (!empty($trellis_id)) { + $trellis_link_url = TrellisHelper::$opportunityViewBasePath . $trellis_id . '/view'; + $trellis_warning = t('This opportunity has been imported from Trellis Programs. Opportunity details can only be edited by a Trellis user in Trellis Programs.', [ + '@trellis-url' => $trellis_link_url, + ]); + \Drupal::messenger()->addWarning($trellis_warning); + + $disabled_fields = [ + 'title', + // 'title', // Original fields for reference + // 'field_az_location', + // 'field_az_event_date', + // 'field_az_link', + // 'field_az_summary', + // 'field_az_photos', + // 'field_az_enterprise_attributes', + 'field_az_application_date', + 'field_az_application_link', + 'field_az_audiences', + 'field_az_credit', + 'field_az_incentives', + 'field_az_modality', + 'field_az_offered', + 'field_az_ongoing', + 'field_az_opportunity_type', + 'field_az_media_image', + 'field_az_program_date', + 'field_az_program_length', + 'field_az_program_website', + 'field_az_topic', + 'field_az_location' + ]; + foreach ($disabled_fields as $field) { + $form[$field]['#disabled'] = TRUE; + } + + $no_access_fields = [ + // 'field_az_subheading', + 'field_az_body', + //'field_az_contacts', + 'field_az_attachments', + ]; + foreach ($no_access_fields as $field) { + $form[$field]['#access'] = FALSE; + } + } + } +} + +/** + * Gather exposed API parameters from view. + * + * @param mixed $form + * An associative array containing the structure of the form. + * @param \Drupal\Core\Form\FormStateInterface $form_state + * The current state of the form. + * + * @return array + * The remote API search values. + */ +function az_opportunity_trellis_gather_filter_options(&$form, FormStateInterface $form_state) { + $search = []; + /** @var \Drupal\views\ViewExecutable $view */ + $view = $form_state->get('view'); + // Consult the filter handlers of the view. + if (!empty($view->filter)) { + /** @var \Drupal\views\Plugin\views\ViewsHandlerInterface[] $handlers */ + $handlers = $view->filter; + // Get exposed search information. + $input = $view->getExposedInput(); + if (empty($input)) { + return []; + } + // Loops through handlers to find inputs we want. + /** @var \Drupal\views\Plugin\views\filter\FilterPluginBase $handler */ + foreach ($handlers as $handler) { + if ($handler->isExposed()) { + $info = $handler->exposedInfo(); + $identifier = $info['value'] ?? ''; + // Make sure our input for this exposed filter isn't NULL. + // This won't normally happen in an actual GET form. + if (!isset($input[$identifier])) { + $input[$identifier] = ''; + } + // Check if the handler validates versus the input. + if ($handler->acceptExposedInput($input)) { + // If the handler accepts the input, bundle it up. + $value = $input[$identifier] ?? ''; + if (!empty($identifier) && !empty($value)) { + if ($handler instanceof AZOpportunityTrellisViewsAttributeFilter) { + // Attributes handled separately since they are from a remote API. + $search['attributes'][$identifier] = $value; + } + else { + $search[$identifier] = $value; + } + } + } + } + } + } + // Don't return id or date fields, unnecessary for recurring imports. + unset($search['id']); + unset($search['start']); + unset($search['modified']); + return $search; +} + +/** + * Implements hook_form_FORM_ID_alter(). + * + * Add clickable link that opens import configuration modal. + */ +function az_opportunity_trellis_form_views_exposed_form_alter(&$form, FormStateInterface $form_state, $form_id) { + + $view = $form_state->get('view'); + if (($view->id() === 'az_opportunity_trellis_import') && ($view->current_display === 'page_1')) { + + // Don't create configuration link if user does not have permission. + if (!\Drupal::currentUser()->hasPermission('administer quickstart configuration')) { + return; + } + $search = az_opportunity_trellis_gather_filter_options($form, $form_state); + if (!empty($search)) { + // We cannot use an ajax response here to open a dialog. + // Exposed forms do not support ajax callbacks. Cache search parameters. + // Compute cache key of parameters. + $key = 'az_recurring_import_modal:' . Crypt::hashBase64(serialize($search)); + $expire = time() + 1200; + // Cache the search. + \Drupal::service('cache.default')->set($key, $search, $expire); + $form['#attached']['library'][] = 'core/drupal.dialog.ajax'; + // Add a link to open the modal. + $form['actions']['recurring'] = [ + '#type' => 'link', + '#title' => t('Create Recurring Import'), + '#url' => Url::fromRoute('entity.az_recurring_import_rule.modal'), + // Pass the search parameters cache key as an argument. + '#options' => ['query' => ['search' => $key]], + '#attributes' => ['class' => ['use-ajax', 'button']], + ]; + } + } +} diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.routing.yml b/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.routing.yml new file mode 100644 index 0000000000..607ac65714 --- /dev/null +++ b/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.routing.yml @@ -0,0 +1,47 @@ +az_opportunity_trellis.settings: + path: '/admin/config/az-quickstart/settings/az-opportunity-trellis' + defaults: + _form: '\Drupal\az_opportunity_trellis\Form\TrellisOpportunitySettingsForm' + _title: 'Trellis Opportunity Importer Settings' + requirements: + _permission: 'administer quickstart configuration' + +entity.az_recurring_import_rule.collection: + path: '/admin/config/az-quickstart/settings/az-recurring-import-rule' + defaults: + _entity_list: 'az_recurring_import_rule' + _title: 'Recurring Import Rule configuration' + requirements: + _permission: 'administer quickstart configuration' + +entity.az_recurring_import_rule.add_form: + path: '/admin/config/az-quickstart/settings/az-recurring-import-rule/add' + defaults: + _entity_form: 'az_recurring_import_rule.add' + _title: 'Add a recurring import rule' + requirements: + _permission: 'administer quickstart configuration' + +entity.az_recurring_import_rule.edit_form: + path: '/admin/config/az-quickstart/settings/az-recurring-import-rule/{az_recurring_import_rule}' + defaults: + _entity_form: 'az_recurring_import_rule.edit' + _title: 'Edit a recurring import rule' + requirements: + _permission: 'administer quickstart configuration' + +entity.az_recurring_import_rule.delete_form: + path: '/admin/config/az-quickstart/settings/az-recurring-import-rule/{az_recurring_import_rule}/delete' + defaults: + _entity_form: 'az_recurring_import_rule.delete' + _title: 'Delete a recurring import rule' + requirements: + _permission: 'administer quickstart configuration' + +entity.az_recurring_import_rule.modal: + path: '/admin/az-opportunity-trellis-modal' + defaults: + _title: 'Entity Az Recurring Import Rule Modal' + _controller: '\Drupal\az_opportunity_trellis\Controller\AZRecurringImportModalController' + requirements: + _permission: 'administer quickstart configuration' diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.services.yml b/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.services.yml new file mode 100644 index 0000000000..9e8f99e1a6 --- /dev/null +++ b/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.services.yml @@ -0,0 +1,17 @@ +services: + _defaults: + autoconfigure: true + az_opportunity_trellis.trellis_helper: + class: Drupal\az_opportunity_trellis\TrellisHelper + arguments: + - '@config.factory' + - '@http_client' + - '@cache.default' + - '@entity_type.manager' + az_opportunity_trellis.trellis_opportunity_data: + class: Drupal\az_opportunity_trellis\OpportunitySubscriber\AZOpportunityTrellisDataSubscriber + arguments: + - '@az_opportunity_trellis.trellis_helper' + - '@messenger' + - '@entity_type.manager' + - '@current_user' diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.views.inc b/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.views.inc new file mode 100644 index 0000000000..57616a1d11 --- /dev/null +++ b/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.views.inc @@ -0,0 +1,69 @@ + t('Trellis Opportunities'), + 'query_id' => 'views_remote_data_query', + ]; + $data['az_opportunity_trellis_data']['Id'] = [ + 'title' => t('Trellis Opportunity ID'), + 'help' => t('Unique key of Trellis opportunity.'), + 'field' => [ + 'id' => 'az_opportunity_trellis_views_field', + ], + ]; + $data['az_opportunity_trellis_data']['Last_Modified_Date'] = [ + 'title' => t('Trellis opportunity modification time'), + 'help' => t('Time of the Trellis opportunity was last modified'), + 'field' => [ + 'id' => 'date', + ], + ]; + $data['az_opportunity_trellis_data']['Start_DateTime'] = [ + 'title' => t('Trellis opportunity start time'), + 'help' => t('Start time of the Trellis opportunity.'), + 'field' => [ + 'id' => 'date', + ], + ]; + $data['az_opportunity_trellis_data']['End_DateTime'] = [ + 'title' => t('Trellis opportunity end time'), + 'help' => t('End time of the Trellis opportunity.'), + 'field' => [ + 'id' => 'date', + ], + ]; + $data['az_opportunity_trellis_data']['Attributes'] = [ + 'title' => t('Enterprise Attribute'), + 'help' => t('Trellis opportunity search API enterprise attributes'), + 'filter' => [ + 'id' => 'az_opportunity_trellis_views_attribute_filter', + ], + ]; + $data['az_opportunity_trellis_data']['Approval'] = [ + 'title' => t('Approval status'), + 'help' => t('Trellis opportunity search API approval status'), + 'filter' => [ + 'id' => 'az_opportunity_trellis_views_approval_filter', + ], + ]; + $data['az_opportunity_trellis_data']['Date'] = [ + 'title' => t('Trellis Date'), + 'help' => t('Trellis opportunity search API dates'), + 'filter' => [ + 'id' => 'az_opportunity_trellis_views_date_filter', + ], + ]; + return $data; +} diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/config/install/az_opportunity_trellis.settings.yml b/modules/custom/az_opportunity/az_opportunity_trellis/config/install/az_opportunity_trellis.settings.yml new file mode 100644 index 0000000000..99487dab9f --- /dev/null +++ b/modules/custom/az_opportunity/az_opportunity_trellis/config/install/az_opportunity_trellis.settings.yml @@ -0,0 +1 @@ +api_hostname: 'api.trellis.arizona.edu' diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/config/install/migrate_plus.migration.az_trellis_opportunity.yml b/modules/custom/az_opportunity/az_opportunity_trellis/config/install/migrate_plus.migration.az_trellis_opportunity.yml new file mode 100644 index 0000000000..25951449c0 --- /dev/null +++ b/modules/custom/az_opportunity/az_opportunity_trellis/config/install/migrate_plus.migration.az_trellis_opportunity.yml @@ -0,0 +1,135 @@ +langcode: en +status: true +dependencies: { } +id: az_trellis_opportunity +class: null +field_plugin_method: null +cck_plugin_method: null +migration_tags: + - Opportunity +migration_group: az_trellis_opportunity +label: 'Trellis Opportunity' +source: + plugin: az_trellis_opportunity_api + trellis_ids: { } + track_changes: true + fields: + - + name: id + label: ID + selector: Id + - + name: name + label: Name + selector: Name + - + name: url + label: URL + selector: Branded_Opportunity_URL + - + name: summary + label: Summary + selector: Summary + - + name: owner + label: 'Owner NetID' + selector: Owner_NetID + - + name: timezone + label: 'Time Zone' + selector: tz_name + - + name: start_date_time + label: 'Start Date and Time' + selector: Start_DateTime + - + name: end_date_time + label: 'End Date and Time' + selector: End_DateTime + - + name: image_url + label: 'Image URL' + selector: Image_URL + - + name: publish + label: Publish + selector: Publish_Formula + - + name: az_enterprise_attributes + label: 'Enterprise Attributes' + selector: Attributes + - + name: format + label: 'Format' + selector: Format + ids: + id: + type: string +process: + field_az_enterprise_attributes: + - plugin: flatten + source: + - az_enterprise_attributes + - format + - + plugin: multiple_values + - + plugin: callback + callable: trim + - + plugin: single_value + - + plugin: entity_lookup + entity_type: taxonomy_term + bundle_key: vid + bundle: az_enterprise_attributes + value_key: name + ignore_case: true + title: name + field_az_trellis_id: id + field_az_link/uri: url + field_az_link/title: + - + plugin: default_value + default_value: 'Opportunity details' + field_az_summary: + - + plugin: skip_on_empty + method: process + source: summary + status: + - + plugin: get + source: publish + - + plugin: default_value + strict: true + default_value: 0 + field_az_photos/target_id: + - + plugin: migration_lookup + migration: az_trellis_opportunity_media + source: id + no_stub: true + - + plugin: skip_on_empty + method: process + field_az_application_date/value: + - + plugin: format_date + source: start_date_time + from_format: 'Y-m-d\TH:i:s.vp' + to_format: U + field_az_application_date/end_value: + - + plugin: format_date + source: end_date_time + from_format: 'Y-m-d\TH:i:s.vp' + to_format: U +destination: + plugin: 'entity:node' + default_bundle: az_opportunity + validate: false +migration_dependencies: + optional: + - az_trellis_opportunity_media diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/config/install/migrate_plus.migration_group.az_trellis_opportunity.yml b/modules/custom/az_opportunity/az_opportunity_trellis/config/install/migrate_plus.migration_group.az_trellis_opportunity.yml new file mode 100644 index 0000000000..4d73287f2a --- /dev/null +++ b/modules/custom/az_opportunity/az_opportunity_trellis/config/install/migrate_plus.migration_group.az_trellis_opportunity.yml @@ -0,0 +1,11 @@ +langcode: en +status: true +dependencies: + module: + - az_opportunity_trellis +id: az_trellis_opportunity +label: 'AZ Trellis Opportunity' +description: 'Import AZ Opportunities from Trellis Programs.' +source_type: 'Trellis Opportunity' +module: az_opportunity_trellis +shared_configuration: null diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/config/install/migrate_queue_importer.cron_migration.az_opportunity_trellis.yml b/modules/custom/az_opportunity/az_opportunity_trellis/config/install/migrate_queue_importer.cron_migration.az_opportunity_trellis.yml new file mode 100644 index 0000000000..44f43b148a --- /dev/null +++ b/modules/custom/az_opportunity/az_opportunity_trellis/config/install/migrate_queue_importer.cron_migration.az_opportunity_trellis.yml @@ -0,0 +1,13 @@ +langcode: en +status: true +dependencies: + enforced: + module: + - az_opportunity_trellis +id: az_opportunity_trellis +label: 'Quickstart Trellis Opportunity' +migration: az_trellis_opportunity +time: 43200 +update: false +sync: false +ignore_dependencies: 0 diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/config/install/views.view.az_opportunity_trellis_import.yml b/modules/custom/az_opportunity/az_opportunity_trellis/config/install/views.view.az_opportunity_trellis_import.yml new file mode 100644 index 0000000000..c625901e54 --- /dev/null +++ b/modules/custom/az_opportunity/az_opportunity_trellis/config/install/views.view.az_opportunity_trellis_import.yml @@ -0,0 +1,1053 @@ +langcode: en +status: true +dependencies: + module: + - az_opportunity_trellis + - user + - views_remote_data +id: az_opportunity_trellis_import +label: 'Trellis Opportunity Importer' +module: views +description: '' +tag: '' +base_table: az_opportunity_trellis_data +base_field: '' +display: + default: + id: default + display_title: Default + display_plugin: default + position: 0 + display_options: + title: 'Trellis Opportunity Importer' + fields: + Id: + id: Id + table: az_opportunity_trellis_data + field: Id + relationship: none + group_type: group + admin_label: '' + entity_type: null + entity_field: null + plugin_id: az_opportunity_trellis_views_field + label: 'Trellis Opportunity ID' + exclude: false + alter: + alter_text: false + text: '' + make_link: false + path: '' + absolute: false + external: false + replace_spaces: false + path_case: none + trim_whitespace: false + alt: '' + rel: '' + link_class: '' + prefix: '' + suffix: '' + target: '' + nl2br: false + max_length: 0 + word_boundary: true + ellipsis: true + more_link: false + more_link_text: '' + more_link_path: '' + strip_tags: false + trim: false + preserve_tags: '' + html: false + element_type: '' + element_class: '' + element_label_type: '' + element_label_class: '' + element_label_colon: true + element_wrapper_type: '' + element_wrapper_class: '' + element_default_classes: true + empty: '' + hide_empty: false + empty_zero: false + hide_alter_empty: true + action_title: Action + include_exclude: exclude + selected_actions: { } + property_5: + id: property_5 + table: az_opportunity_trellis_data + field: property + relationship: none + group_type: group + admin_label: '' + plugin_id: views_remote_data_property + label: 'Branded Opportunity URL' + exclude: true + alter: + alter_text: false + text: '' + make_link: false + path: '' + absolute: false + external: false + replace_spaces: false + path_case: none + trim_whitespace: false + alt: '' + rel: '' + link_class: '' + prefix: '' + suffix: '' + target: '' + nl2br: false + max_length: 0 + word_boundary: true + ellipsis: true + more_link: false + more_link_text: '' + more_link_path: '' + strip_tags: false + trim: false + preserve_tags: '' + html: false + element_type: '' + element_class: '' + element_label_type: '' + element_label_class: '' + element_label_colon: false + element_wrapper_type: '' + element_wrapper_class: '' + element_default_classes: true + empty: '' + hide_empty: false + empty_zero: false + hide_alter_empty: true + property_path: Branded_Opportunity_URL + property: + id: property + table: az_opportunity_trellis_data + field: property + relationship: none + group_type: group + admin_label: '' + plugin_id: views_remote_data_property + label: Name + exclude: false + alter: + alter_text: false + text: '' + make_link: true + path: '{{ property_5 }}' + absolute: false + external: true + replace_spaces: false + path_case: none + trim_whitespace: false + alt: '' + rel: '' + link_class: '' + prefix: '' + suffix: '' + target: _blank + nl2br: false + max_length: 0 + word_boundary: true + ellipsis: true + more_link: false + more_link_text: '' + more_link_path: '' + strip_tags: false + trim: false + preserve_tags: '' + html: false + element_type: '' + element_class: '' + element_label_type: '' + element_label_class: '' + element_label_colon: false + element_wrapper_type: '' + element_wrapper_class: '' + element_default_classes: true + empty: '' + hide_empty: false + empty_zero: false + hide_alter_empty: true + property_path: Name + property_1: + id: property_1 + table: az_opportunity_trellis_data + field: property + relationship: none + group_type: group + admin_label: '' + plugin_id: views_remote_data_property + label: Host + exclude: false + alter: + alter_text: false + text: '' + make_link: false + path: '' + absolute: false + external: false + replace_spaces: false + path_case: none + trim_whitespace: false + alt: '' + rel: '' + link_class: '' + prefix: '' + suffix: '' + target: '' + nl2br: false + max_length: 0 + word_boundary: true + ellipsis: true + more_link: false + more_link_text: '' + more_link_path: '' + strip_tags: false + trim: false + preserve_tags: '' + html: false + element_type: '' + element_class: '' + element_label_type: '' + element_label_class: '' + element_label_colon: false + element_wrapper_type: '' + element_wrapper_class: '' + element_default_classes: true + empty: '' + hide_empty: false + empty_zero: false + hide_alter_empty: true + property_path: Host + property_2: + id: property_2 + table: az_opportunity_trellis_data + field: property + relationship: none + group_type: group + admin_label: '' + plugin_id: views_remote_data_property + label: Audience + exclude: false + alter: + alter_text: false + text: '' + make_link: false + path: '' + absolute: false + external: false + replace_spaces: false + path_case: none + trim_whitespace: false + alt: '' + rel: '' + link_class: '' + prefix: '' + suffix: '' + target: '' + nl2br: false + max_length: 0 + word_boundary: true + ellipsis: true + more_link: false + more_link_text: '' + more_link_path: '' + strip_tags: false + trim: false + preserve_tags: '' + html: false + element_type: '' + element_class: '' + element_label_type: '' + element_label_class: '' + element_label_colon: true + element_wrapper_type: '' + element_wrapper_class: '' + element_default_classes: true + empty: '' + hide_empty: false + empty_zero: false + hide_alter_empty: true + property_path: Attributes.0.Audiences.0 + property_3: + id: property_3 + table: az_opportunity_trellis_data + field: property + relationship: none + group_type: group + admin_label: '' + plugin_id: views_remote_data_property + label: Topic + exclude: false + alter: + alter_text: false + text: '' + make_link: false + path: '' + absolute: false + external: false + replace_spaces: false + path_case: none + trim_whitespace: false + alt: '' + rel: '' + link_class: '' + prefix: '' + suffix: '' + target: '' + nl2br: false + max_length: 0 + word_boundary: true + ellipsis: true + more_link: false + more_link_text: '' + more_link_path: '' + strip_tags: false + trim: false + preserve_tags: '' + html: false + element_type: '' + element_class: '' + element_label_type: '' + element_label_class: '' + element_label_colon: true + element_wrapper_type: '' + element_wrapper_class: '' + element_default_classes: true + empty: '' + hide_empty: false + empty_zero: false + hide_alter_empty: true + property_path: Attributes.0.Topic.0 + property_4: + id: property_4 + table: az_opportunity_trellis_data + field: property + relationship: none + group_type: group + admin_label: '' + plugin_id: views_remote_data_property + label: Category + exclude: false + alter: + alter_text: false + text: '' + make_link: false + path: '' + absolute: false + external: false + replace_spaces: false + path_case: none + trim_whitespace: false + alt: '' + rel: '' + link_class: '' + prefix: '' + suffix: '' + target: '' + nl2br: false + max_length: 0 + word_boundary: true + ellipsis: true + more_link: false + more_link_text: '' + more_link_path: '' + strip_tags: false + trim: false + preserve_tags: '' + html: false + element_type: '' + element_class: '' + element_label_type: '' + element_label_class: '' + element_label_colon: true + element_wrapper_type: '' + element_wrapper_class: '' + element_default_classes: true + empty: '' + hide_empty: false + empty_zero: false + hide_alter_empty: true + property_path: Attributes.0.Category.0 + Start_DateTime: + id: Start_DateTime + table: az_opportunity_trellis_data + field: Start_DateTime + relationship: none + group_type: group + admin_label: '' + plugin_id: date + label: 'Start Date' + exclude: false + alter: + alter_text: false + text: '' + make_link: false + path: '' + absolute: false + external: false + replace_spaces: false + path_case: none + trim_whitespace: false + alt: '' + rel: '' + link_class: '' + prefix: '' + suffix: '' + target: '' + nl2br: false + max_length: 0 + word_boundary: true + ellipsis: true + more_link: false + more_link_text: '' + more_link_path: '' + strip_tags: false + trim: false + preserve_tags: '' + html: false + element_type: '' + element_class: '' + element_label_type: '' + element_label_class: '' + element_label_colon: true + element_wrapper_type: '' + element_wrapper_class: '' + element_default_classes: true + empty: '' + hide_empty: false + empty_zero: false + hide_alter_empty: true + date_format: custom + custom_date_format: 'm/d/Y - h:ia' + timezone: '' + Last_Modified_Date: + id: Last_Modified_Date + table: az_opportunity_trellis_data + field: Last_Modified_Date + relationship: none + group_type: group + admin_label: '' + plugin_id: date + label: Updated + exclude: false + alter: + alter_text: false + text: '' + make_link: false + path: '' + absolute: false + external: false + replace_spaces: false + path_case: none + trim_whitespace: false + alt: '' + rel: '' + link_class: '' + prefix: '' + suffix: '' + target: '' + nl2br: false + max_length: 0 + word_boundary: true + ellipsis: true + more_link: false + more_link_text: '' + more_link_path: '' + strip_tags: false + trim: false + preserve_tags: '' + html: false + element_type: '' + element_class: '' + element_label_type: '' + element_label_class: '' + element_label_colon: true + element_wrapper_type: '' + element_wrapper_class: '' + element_default_classes: true + empty: '' + hide_empty: false + empty_zero: false + hide_alter_empty: true + date_format: custom + custom_date_format: 'm/d/Y - h:ia' + timezone: '' + pager: + type: mini + options: + offset: 0 + items_per_page: 10 + total_pages: null + id: 0 + tags: + next: ›› + previous: ‹‹ + expose: + items_per_page: false + items_per_page_label: 'Items per page' + items_per_page_options: '5, 10, 25, 50' + items_per_page_options_all: false + items_per_page_options_all_label: '- All -' + offset: false + offset_label: Offset + pagination_heading_level: h4 + exposed_form: + type: basic + options: + submit_button: Search + reset_button: true + reset_button_label: Reset + exposed_sorts_label: 'Sort by' + expose_sort_order: false + sort_asc_label: Asc + sort_desc_label: Desc + access: + type: perm + options: + perm: 'create az_opportunity content' + cache: + type: none + options: { } + empty: { } + sorts: { } + arguments: { } + filters: + property_1: + id: property_1 + table: az_opportunity_trellis_data + field: property + relationship: none + group_type: group + admin_label: '' + plugin_id: views_remote_data_property + operator: '=' + value: '' + group: 1 + exposed: true + expose: + operator_id: property_1_op + label: Owner + description: '' + use_operator: false + operator: property_1_op + operator_limit_selection: false + operator_list: { } + identifier: owner + required: false + remember: false + multiple: false + remember_roles: + authenticated: authenticated + is_grouped: false + group_info: + label: '' + description: '' + identifier: '' + optional: true + widget: select + multiple: false + remember: false + default_group: All + default_group_multiple: { } + group_items: { } + property_path: owner + property_2: + id: property_2 + table: az_opportunity_trellis_data + field: property + relationship: none + group_type: group + admin_label: '' + plugin_id: views_remote_data_property + operator: '=' + value: '' + group: 1 + exposed: true + expose: + operator_id: property_2_op + label: Host + description: '' + use_operator: false + operator: property_2_op + operator_limit_selection: false + operator_list: { } + identifier: host + required: false + remember: false + multiple: false + remember_roles: + authenticated: authenticated + is_grouped: false + group_info: + label: '' + description: '' + identifier: '' + optional: true + widget: select + multiple: false + remember: false + default_group: All + default_group_multiple: { } + group_items: { } + property_path: host + property_3: + id: property_3 + table: az_opportunity_trellis_data + field: property + relationship: none + group_type: group + admin_label: '' + plugin_id: views_remote_data_property + operator: '=' + value: '' + group: 1 + exposed: true + expose: + operator_id: property_3_op + label: 'Opportunity ID' + description: '' + use_operator: false + operator: property_3_op + operator_limit_selection: false + operator_list: { } + identifier: id + required: false + remember: false + multiple: false + remember_roles: + authenticated: authenticated + is_grouped: false + group_info: + label: '' + description: '' + identifier: '' + optional: true + widget: select + multiple: false + remember: false + default_group: All + default_group_multiple: { } + group_items: { } + property_path: id + Attributes: + id: Attributes + table: az_opportunity_trellis_data + field: Attributes + relationship: none + group_type: group + admin_label: '' + plugin_id: az_opportunity_trellis_views_attribute_filter + operator: '=' + value: '' + group: 1 + exposed: true + expose: + operator_id: Attributes_op + label: Audience + description: '' + use_operator: false + operator: Attributes_op + operator_limit_selection: false + operator_list: { } + identifier: audience + required: false + remember: false + multiple: false + remember_roles: + authenticated: authenticated + is_grouped: false + group_info: + label: '' + description: '' + identifier: '' + optional: true + widget: select + multiple: false + remember: false + default_group: All + default_group_multiple: { } + group_items: { } + property_path: audience + az_attribute_key: Audiences__c + Attributes_1: + id: Attributes_1 + table: az_opportunity_trellis_data + field: Attributes + relationship: none + group_type: group + admin_label: '' + plugin_id: az_opportunity_trellis_views_attribute_filter + operator: '=' + value: '' + group: 1 + exposed: true + expose: + operator_id: Attributes_1_op + label: Topic + description: '' + use_operator: false + operator: Attributes_1_op + operator_limit_selection: false + operator_list: { } + identifier: topic + required: false + remember: false + multiple: false + remember_roles: + authenticated: authenticated + is_grouped: false + group_info: + label: '' + description: '' + identifier: '' + optional: true + widget: select + multiple: false + remember: false + default_group: All + default_group_multiple: { } + group_items: { } + property_path: topic + az_attribute_key: Topic__c + Attributes_2: + id: Attributes_2 + table: az_opportunity_trellis_data + field: Attributes + relationship: none + group_type: group + admin_label: '' + plugin_id: az_opportunity_trellis_views_attribute_filter + operator: '=' + value: '' + group: 1 + exposed: true + expose: + operator_id: Attributes_2_op + label: Category + description: '' + use_operator: false + operator: Attributes_2_op + operator_limit_selection: false + operator_list: { } + identifier: category + required: false + remember: false + multiple: false + remember_roles: + authenticated: authenticated + is_grouped: false + group_info: + label: '' + description: '' + identifier: '' + optional: true + widget: select + multiple: false + remember: false + default_group: All + default_group_multiple: { } + group_items: { } + property_path: category + az_attribute_key: Category1__c + Attributes_3: + id: Attributes_3 + table: az_opportunity_trellis_data + field: Attributes + relationship: none + group_type: group + admin_label: '' + plugin_id: az_opportunity_trellis_views_attribute_filter + operator: '=' + value: '' + group: 1 + exposed: true + expose: + operator_id: Attributes_3_op + label: Format + description: '' + use_operator: false + operator: Attributes_3_op + operator_limit_selection: false + operator_list: { } + identifier: format + required: false + remember: false + multiple: false + remember_roles: + authenticated: authenticated + is_grouped: false + group_info: + label: '' + description: '' + identifier: '' + optional: true + widget: select + multiple: false + remember: false + default_group: All + default_group_multiple: { } + group_items: { } + property_path: format + az_attribute_key: Opportunity_Format__c + property: + id: property + table: az_opportunity_trellis_data + field: property + relationship: none + group_type: group + admin_label: '' + plugin_id: views_remote_data_property + operator: '=' + value: '' + group: 1 + exposed: true + expose: + operator_id: property_op + label: Keyword + description: '' + use_operator: false + operator: property_op + operator_limit_selection: false + operator_list: { } + identifier: keyword + required: false + remember: false + multiple: false + remember_roles: + authenticated: authenticated + is_grouped: false + group_info: + label: '' + description: '' + identifier: '' + optional: true + widget: select + multiple: false + remember: false + default_group: All + default_group_multiple: { } + group_items: { } + property_path: keyword + Date_1: + id: Date_1 + table: az_opportunity_trellis_data + field: Date + relationship: none + group_type: group + admin_label: '' + plugin_id: az_opportunity_trellis_views_date_filter + operator: '=' + value: + value: '' + begin: '' + end: '' + group: 1 + exposed: true + expose: + operator_id: Date_1_op + label: 'Start Date' + description: '' + use_operator: false + operator: Date_1_op + operator_limit_selection: false + operator_list: { } + identifier: start + required: false + remember: false + multiple: false + remember_roles: + authenticated: authenticated + is_grouped: false + group_info: + label: '' + description: '' + identifier: '' + optional: true + widget: select + multiple: false + remember: false + default_group: All + default_group_multiple: { } + group_items: { } + api_param: start + api_options: + 'Next 7 Days': 'Next 7 Days' + 'Next 30 Days': 'Next 30 Days' + Custom: Custom + api_param_custom_begin: start_begin + api_param_custom_end: start_end + Date: + id: Date + table: az_opportunity_trellis_data + field: Date + relationship: none + group_type: group + admin_label: '' + plugin_id: az_opportunity_trellis_views_date_filter + operator: '=' + value: + value: '' + begin: '' + end: '' + group: 1 + exposed: true + expose: + operator_id: Date_op + label: 'Updated Date' + description: '' + use_operator: false + operator: Date_op + operator_limit_selection: false + operator_list: { } + identifier: modified + required: false + remember: false + multiple: false + remember_roles: + authenticated: authenticated + is_grouped: false + group_info: + label: '' + description: '' + identifier: '' + optional: true + widget: select + multiple: false + remember: false + default_group: All + default_group_multiple: { } + group_items: { } + api_param: modified + api_options: + 'Last 7 Days': 'Last 7 Days' + 'Last 30 Days': 'Last 30 Days' + Custom: Custom + api_param_custom_begin: modified_begin + api_param_custom_end: modified_end + property_4: + id: property_4 + table: az_opportunity_trellis_data + field: property + relationship: none + group_type: group + admin_label: '' + plugin_id: views_remote_data_property + operator: '=' + value: 'true' + group: 1 + exposed: false + expose: + operator_id: '' + label: '' + description: '' + use_operator: false + operator: '' + operator_limit_selection: false + operator_list: { } + identifier: '' + required: false + remember: false + multiple: false + remember_roles: + authenticated: authenticated + is_grouped: false + group_info: + label: '' + description: '' + identifier: '' + optional: true + widget: select + multiple: false + remember: false + default_group: All + default_group_multiple: { } + group_items: { } + property_path: publish + Approval: + id: Approval + table: az_opportunity_trellis_data + field: Approval + relationship: none + group_type: group + admin_label: '' + plugin_id: az_opportunity_trellis_views_approval_filter + operator: '=' + value: approved + group: 1 + exposed: true + expose: + operator_id: Approval_op + label: 'Approved for University Calendar' + description: 'Limits results to opportunities curated by University Communications for the University Calendar.' + use_operator: false + operator: Approval_op + operator_limit_selection: false + operator_list: { } + identifier: approval + required: false + remember: false + multiple: false + remember_roles: + authenticated: authenticated + is_grouped: false + group_info: + label: '' + description: '' + identifier: '' + optional: true + widget: select + multiple: false + remember: false + default_group: All + default_group_multiple: { } + group_items: { } + property_path: approval + filter_groups: + operator: AND + groups: + 1: AND + style: + type: table + row: + type: fields + query: + type: views_query + options: { } + relationships: { } + use_ajax: true + header: { } + footer: { } + display_extenders: { } + cache_metadata: + max-age: 0 + contexts: + - 'languages:language_interface' + - url + - url.query_args + - user.permissions + tags: + - views_remote_data + page_1: + id: page_1 + display_title: Page + display_plugin: page + position: 1 + display_options: + display_extenders: { } + path: admin/trellis-opportunity-importer + cache_metadata: + max-age: 0 + contexts: + - 'languages:language_interface' + - url + - url.query_args + - user.permissions + tags: + - views_remote_data diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/config/schema/az_opportunity_trellis.schema.yml b/modules/custom/az_opportunity/az_opportunity_trellis/config/schema/az_opportunity_trellis.schema.yml new file mode 100644 index 0000000000..576f05a01c --- /dev/null +++ b/modules/custom/az_opportunity/az_opportunity_trellis/config/schema/az_opportunity_trellis.schema.yml @@ -0,0 +1,39 @@ +views.filter_value.az_opportunity_trellis_views_date_filter: + type: views_filter + label: 'Trellis filter' + mapping: + value: + type: string + label: 'Value' + begin: + type: string + label: 'Custom Date Range Begin' + end: + type: string + label: 'Custom Date Range End' +az_opportunity_trellis.az_recurring_import_rule.*: + type: config_entity + label: Trellis Opportunity Import + mapping: + id: + type: machine_name + label: ID + label: + type: label + label: Label + uuid: + type: uuid + host: + type: string + owner: + type: string + keyword: + type: string + attributes: + type: sequence + label: ‘Enterprise Attributes’ + sequence: + type: string + label: ‘Attribute’ + approval: + type: string diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/css/az_opportunity_trellis_datewrapper.css b/modules/custom/az_opportunity/az_opportunity_trellis/css/az_opportunity_trellis_datewrapper.css new file mode 100644 index 0000000000..6fef13e186 --- /dev/null +++ b/modules/custom/az_opportunity/az_opportunity_trellis/css/az_opportunity_trellis_datewrapper.css @@ -0,0 +1,3 @@ +.az-opportunity-trellis-datewrapper.views-exposed-form__item .form-item:first-child { + margin-top: 0; +} \ No newline at end of file diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/js/az_opportunity_trellis_date.js b/modules/custom/az_opportunity/az_opportunity_trellis/js/az_opportunity_trellis_date.js new file mode 100644 index 0000000000..911cef299d --- /dev/null +++ b/modules/custom/az_opportunity/az_opportunity_trellis/js/az_opportunity_trellis_date.js @@ -0,0 +1,27 @@ +/** + * @file + * Trellis date range picker. + */ + +((Drupal, drupalSettings, once) => { + Drupal.behaviors.trellisDatePicker = { + attach(context) { + const elements = once('aztrellisdate', '.az-trellis-daterange', context); + elements.forEach((element) => { + const begin = element; + const id = element.dataset.azTrellisDaterangeEnd; + const end = document.getElementById(id); + // eslint-disable-next-line no-unused-vars, no-undef, new-cap + const picker = new easepick.create({ + element: begin, + css: drupalSettings.trellisDatePicker.css, + zIndex: 10, + RangePlugin: { + elementEnd: end, + }, + plugins: ['RangePlugin'], + }); + }); + }, + }; +})(Drupal, drupalSettings, once); diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/migrations/az_trellis_opportunity_files.yml b/modules/custom/az_opportunity/az_opportunity_trellis/migrations/az_trellis_opportunity_files.yml new file mode 100644 index 0000000000..969e87e18b --- /dev/null +++ b/modules/custom/az_opportunity/az_opportunity_trellis/migrations/az_trellis_opportunity_files.yml @@ -0,0 +1,42 @@ +id: az_trellis_opportunity_files +label: Trellis Opportunity Files +source: + plugin: az_trellis_opportunity_api + trellis_ids: { } + track_changes: true + fields: + - + name: id + label: ID + selector: Id + - + name: image_url + label: 'Image URL' + selector: Image_URL + ids: + id: + type: string + +process: + status: + plugin: default_value + default_value: 1 + + uri: + - + plugin: az_migration_remote_file + migration: az_trellis_opportunity_files + default_filename: id + directory: 'public://trellis-opportunity' + source_ids: + - id + source: image_url + - + plugin: skip_on_empty + method: row + uid: + plugin: default_value + default_value: 0 + +destination: + plugin: entity:file diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/migrations/az_trellis_opportunity_media.yml b/modules/custom/az_opportunity/az_opportunity_trellis/migrations/az_trellis_opportunity_media.yml new file mode 100644 index 0000000000..f23e074c80 --- /dev/null +++ b/modules/custom/az_opportunity/az_opportunity_trellis/migrations/az_trellis_opportunity_media.yml @@ -0,0 +1,56 @@ +id: az_trellis_opportunity_media +label: Trellis Opportunity Media +source: + plugin: az_trellis_opportunity_api + trellis_ids: { } + track_changes: true + fields: + - + name: id + label: ID + selector: Id + - + name: image_url + label: 'Image URL' + selector: Image_URL + - + name: name + label: Name + selector: Name + ids: + id: + type: string + +process: + uid: + plugin: default_value + default_value: 0 + bundle: + plugin: default_value + default_value: az_image + field_media_az_image/target_id: + - + plugin: migration_lookup + migration: az_trellis_opportunity_files + source: id + no_stub: true + - + plugin: skip_on_empty + method: row + field_media_az_image/alt: name + field_media_az_image/title: name + status: + plugin: default_value + default_value: 1 + +destination: + plugin: entity:media + +dependencies: + enforced: + module: + - az_opportunity_trellis + - az_media +migration_dependencies: + optional: + - az_trellis_opportunity_files diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/src/AZRecurringImportRuleInterface.php b/modules/custom/az_opportunity/az_opportunity_trellis/src/AZRecurringImportRuleInterface.php new file mode 100644 index 0000000000..335b540156 --- /dev/null +++ b/modules/custom/az_opportunity/az_opportunity_trellis/src/AZRecurringImportRuleInterface.php @@ -0,0 +1,30 @@ +t('Label'); + $header['id'] = $this->t('Machine name'); + $header['results'] = $this->t('Results'); + $header['status'] = $this->t('Status'); + return $header + parent::buildHeader(); + } + + /** + * {@inheritdoc} + */ + public function buildRow(EntityInterface $entity): array { + /** @var \Drupal\az_opportunity_trellis\AZRecurringImportRuleInterface $entity */ + $row['label'] = $entity->label(); + $row['id'] = $entity->id(); + + // Get entity's query parameters. + $params = $entity->getQueryParameters(); + unset($params['publish']); + + if (!empty($params)) { + // Generate link to results page. + $row['result']['data'] = [ + '#type' => 'link', + '#title' => $this->t('View Results'), + '#url' => Url::fromRoute('view.az_opportunity_trellis_import.page_1'), + '#options' => ['query' => $params], + '#attributes' => ['class' => 'button'], + ]; + } + else { + $row['result'] = ''; + } + $row['status'] = $entity->status() ? $this->t('Enabled') : $this->t('Disabled'); + return $row + parent::buildRow($entity); + } + +} diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/src/Controller/AZRecurringImportModalController.php b/modules/custom/az_opportunity/az_opportunity_trellis/src/Controller/AZRecurringImportModalController.php new file mode 100644 index 0000000000..1c2af8acc2 --- /dev/null +++ b/modules/custom/az_opportunity/az_opportunity_trellis/src/Controller/AZRecurringImportModalController.php @@ -0,0 +1,101 @@ +entityTypeManager = $entityTypeManager; + $this->entityFormBuilder = $entityFormBuilder; + $this->cache = $cache; + } + + /** + * {@inheritdoc} + */ + public static function create(ContainerInterface $container): self { + return new self( + $container->get('entity_type.manager'), + $container->get('entity.form_builder'), + $container->get('cache.default'), + ); + } + + /** + * Open az_recurring_import_rule configuration form as a modal. + * + * @param \Symfony\Component\HttpFoundation\Request $request + * The current request. + * + * @return \Drupal\Core\Ajax\AjaxResponse + * AjaxResponse containing command to open a modal. + */ + public function __invoke(Request $request): AjaxResponse { + $search = []; + $key = $request->query->get('search'); + // Attempt to get cached search if we have a valid cache key. + if (!empty($key) && str_starts_with($key, 'az_recurring_import_modal:')) { + // Get a cached search if there is one for our key. + $search = $this->cache->get($key)->data ?? []; + } + + // Create an AjaxResponse that opens a modal copy of the config form. + $response = new AjaxResponse(); + // Entity forms require an entity. + $config = $this->entityTypeManager->getStorage('az_recurring_import_rule')->create($search); + // Generate a copy of the configuration entity form using the stub as basis. + $config_form = $this->entityFormBuilder->getForm($config, 'add'); + // Forms generated during ajax calls do not have the right action path. + $config_form['#action'] = Url::fromRoute('entity.az_recurring_import_rule.add_form')->toString(); + // Add an ajax command to open the modal. + $response->addCommand(new OpenModalDialogCommand($this->t('Create Recurring Import'), $config_form, ['width' => '1000'])); + return $response; + } + +} diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/src/Entity/AZRecurringImportRule.php b/modules/custom/az_opportunity/az_opportunity_trellis/src/Entity/AZRecurringImportRule.php new file mode 100644 index 0000000000..e4050abfe8 --- /dev/null +++ b/modules/custom/az_opportunity/az_opportunity_trellis/src/Entity/AZRecurringImportRule.php @@ -0,0 +1,129 @@ + AZRecurringImportRuleListBuilder::class, + 'form' => [ + 'add' => AZRecurringImportRuleForm::class, + 'edit' => AZRecurringImportRuleForm::class, + 'delete' => EntityDeleteForm::class, + ], + ], + config_prefix: 'az_recurring_import_rule', + admin_permission: 'administer quickstart configuration', + label_count: [ + 'singular' => '@count recurring import rule', + 'plural' => '@count recurring import rules', + ], + links: [ + 'collection' => '/admin/config/az-quickstart/settings/az-recurring-import-rule', + 'add-form' => '/admin/config/az-quickstart/settings/az-recurring-import-rule/add', + 'edit-form' => '/admin/config/az-quickstart/settings/az-recurring-import-rule/{az_recurring_import_rule}', + 'delete-form' => '/admin/config/az-quickstart/settings/az-recurring-import-rule/{az_recurring_import_rule}/delete', + ], + entity_keys: [ + 'id' => 'id', + 'label' => 'label', + 'uuid' => 'uuid', + ], + config_export: [ + 'id', + 'label', + 'owner', + 'host', + 'keyword', + 'attributes', + 'approval', + ], +)] +final class AZRecurringImportRule extends ConfigEntityBase implements AZRecurringImportRuleInterface { + + /** + * The az_recurring_import_rule ID. + */ + protected string $id; + + /** + * The az_recurring_import_rule label. + */ + protected string $label; + + /** + * The az_recurring_import_rule keyword. + */ + protected string $keyword; + + /** + * The az_recurring_import_rule owner. + */ + protected string $owner; + + /** + * The az_recurring_import_rule owner. + */ + protected string $host; + + /** + * The az_recurring_import_rule enterprise attributes. + */ + protected ?array $attributes; + + /** + * The az_recurring_import_rule approval status. + */ + protected string $approval; + + /** + * {@inheritdoc} + */ + public function getQueryParameters() { + // Build a list of query parameters. + $params = [ + 'publish' => 'true', + ]; + $attributes = array_filter($this->attributes ?? []); + $params += $attributes; + $params['keyword'] = $this->get('keyword') ?? ''; + $params['owner'] = $this->get('owner') ?? ''; + $params['host'] = $this->get('host') ?? ''; + $params['approval'] = $this->get('approval') ?? ''; + $params = array_filter($params); + return $params; + } + + /** + * {@inheritdoc} + */ + public function getOpportunityIds() { + // Build a list of query parameters. + $params = $this->getQueryParameters(); + + // Let's refuse to search if there are no constraints except published. + if (count($params) === 1) { + return []; + } + + return \Drupal::service('az_opportunity_trellis.trellis_helper')->searchOpportunities($params); + } + +} diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/src/EventSubscriber/AZOpportunityTrellisDataSubscriber.php b/modules/custom/az_opportunity/az_opportunity_trellis/src/EventSubscriber/AZOpportunityTrellisDataSubscriber.php new file mode 100644 index 0000000000..2e436caa8f --- /dev/null +++ b/modules/custom/az_opportunity/az_opportunity_trellis/src/EventSubscriber/AZOpportunityTrellisDataSubscriber.php @@ -0,0 +1,157 @@ + 'onQuery', + MigrateOpportunity::POST_ROW_SAVE => 'onPostRowSave', + ]; + } + + /** + * Constructs an AZOpportunityTrellisDataSubscriber. + * + * @param \Drupal\az_opportunity_trellis\TrellisHelper $trellisHelper + * The Trellis helper server. + * @param \Drupal\Core\Messenger\Messenger $messenger + * Database connection object. + * @param \Drupal\Core\Entity\EntityTypeManagerInterface $entityTypeManager + * The entity type manager service. + * @param \Drupal\Core\Session\AccountProxy $currentUser + * The currently logged in user. + */ + public function __construct(TrellisHelper $trellisHelper, Messenger $messenger, EntityTypeManagerInterface $entityTypeManager, AccountProxy $currentUser) { + $this->trellisHelper = $trellisHelper; + $this->messenger = $messenger; + $this->entityTypeManager = $entityTypeManager; + $this->nodeStorage = $this->entityTypeManager->getStorage('node'); + $this->currentUser = $currentUser; + } + + /** + * Respond to opportunity on migration import for relevant migrations. + * + * @param \Drupal\migrate\Opportunity\MigratePostRowSaveOpportunity $opportunity + * The post save opportunity object. + */ + public function onPostRowSave(MigratePostRowSaveOpportunity $opportunity) { + $migration = $opportunity->getMigration()->getBaseId(); + $ids = $opportunity->getDestinationIdValues(); + $id = reset($ids); + if ($migration === 'az_trellis_opportunity') { + $opportunity = $this->nodeStorage->load($id); + if (!empty($opportunity)) { + $url = $opportunity->toUrl()->toString(); + // Only show message if current user has permission. + if ($this->currentUser->hasPermission('create az_opportunity content')) { + // Show status message that opportunity was imported. + $this->messenger->addMessage($this->t('Imported @opportunitytitle.', [ + '@opportunitylink' => $url, + '@opportunitytitle' => $opportunity->getTitle(), + ])); + } + } + } + } + + /** + * Subscribes to populate Trellis view results. + * + * @param \Drupal\views_remote_data\Opportunity\RemoteDataQueryOpportunity $opportunity + * The opportunity. + */ + public function onQuery(RemoteDataQueryOpportunity $opportunity): void { + $supported_bases = ['az_opportunity_trellis_data']; + $base_tables = array_keys($opportunity->getView()->getBaseTables()); + if (count(array_intersect($supported_bases, $base_tables)) > 0) { + $parameters = []; + $condition_groups = $opportunity->getConditions(); + // Check for conditional parameters. + foreach ($condition_groups as $condition_group) { + if (!empty($condition_group['conditions'])) { + foreach ($condition_group['conditions'] as $condition) { + if (!empty($condition['field'][0]) & !empty($condition['value'])) { + $parameters[$condition['field'][0]] = $condition['value']; + } + } + } + } + // Don't perform search if empty or publish is the only field. + if (empty($parameters) || (count($parameters) <= 1)) { + return; + } + $ids = $this->trellisHelper->searchopportunity($parameters); + if (!empty($ids)) { + $offset = $opportunity->getOffset(); + $limit = $opportunity->getLimit(); + if (!empty($limit)) { + $ids = array_slice($ids, $offset, $limit); + } + // Run data fetch request. + $results = $this->trellisHelper->getOpportunity($ids); + $datefields = [ + 'Last_Modified_Date', + 'Start_DateTime', + 'End_DateTime', + ]; + foreach ($results as $result) { + // Change date format fields to what views expects to see. + foreach ($datefields as $datefield) { + if (!empty($result[$datefield])) { + $result[$datefield] = strtotime($result[$datefield]); + } + } + $opportunity->addResult(new ResultRow($result)); + } + } + } + } + +} diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/src/Form/AZRecurringImportRuleForm.php b/modules/custom/az_opportunity/az_opportunity_trellis/src/Form/AZRecurringImportRuleForm.php new file mode 100644 index 0000000000..2fd1df1bb5 --- /dev/null +++ b/modules/custom/az_opportunity/az_opportunity_trellis/src/Form/AZRecurringImportRuleForm.php @@ -0,0 +1,185 @@ +entityRepository = $container->get('entity.repository'); + $instance->trellisHelper = $container->get('az_opportunity_trellis.trellis_helper'); + return $instance; + } + + /** + * {@inheritdoc} + */ + public function form(array $form, FormStateInterface $form_state): array { + + $form = parent::form($form, $form_state); + /** @var \Drupal\az_opportunity_trellis\Entity\AZRecurringImportRule $entity */ + $entity = $this->entity; + // Fetch the list of attributes mapped by the API. + $mappings = $this->trellisHelper->getAttributeMappings(); + + $form['label'] = [ + '#type' => 'textfield', + '#title' => $this->t('Import Rule Name'), + '#maxlength' => 255, + '#default_value' => $entity->label(), + '#description' => $this->t('Describe this rule, e.g., Graduate Lecture Series'), + '#required' => TRUE, + ]; + + $form['id'] = [ + '#type' => 'machine_name', + '#default_value' => $this->entity->id(), + '#machine_name' => [ + 'exists' => [AZRecurringImportRule::class, 'load'], + ], + '#disabled' => !$entity->isNew(), + ]; + + $form['status'] = [ + '#type' => 'checkbox', + '#title' => $this->t('Enabled'), + '#default_value' => $entity->status(), + '#description' => $this->t('Enabled import rules will regularly import matching content into the site automatically.'), + ]; + + $form['query_parameters'] = [ + '#type' => 'details', + '#title' => $this->t('Recurring Search Parameters'), + '#description' => $this->t('When this import rule runs, the following search terms will be used.'), + '#open' => TRUE, + ]; + + $form['query_parameters']['owner'] = [ + '#type' => 'textfield', + '#title' => $this->t('Owner'), + '#maxlength' => 255, + '#default_value' => $entity->get('owner'), + ]; + + $form['query_parameters']['host'] = [ + '#type' => 'textfield', + '#title' => $this->t('Host'), + '#maxlength' => 255, + '#default_value' => $entity->get('host'), + ]; + + $form['query_parameters']['keyword'] = [ + '#type' => 'textfield', + '#title' => $this->t('Keyword'), + '#maxlength' => 255, + '#default_value' => $entity->get('keyword'), + ]; + + $form['query_parameters']['attributes']['#tree'] = TRUE; + + // Get the different attributes available. + $term_storage = $this->entityTypeManager->getStorage('taxonomy_term'); + $query = $term_storage->getQuery() + ->accessCheck(TRUE) + ->addTag('taxonomy_term_access') + ->condition('vid', 'az_enterprise_attributes') + ->condition('parent', 0) + ->sort('name') + // Only fetch attributes that have an API mapping. + ->condition('field_az_attribute_key', array_keys($mappings), 'IN'); + $attributes = $query->execute(); + $attributes = $term_storage->loadMultiple($attributes); + + // Build attribute select lists. + foreach ($attributes as $attribute) { + $options = []; + $key = $mappings[$attribute->field_az_attribute_key->value]; + $id = $attribute->id(); + + // Find the options the attribute has, in order. + $query = $term_storage->getQuery() + ->accessCheck(TRUE) + ->addTag('taxonomy_term_access') + ->condition('vid', 'az_enterprise_attributes') + ->condition('parent', $id) + ->sort('name') + ->condition('field_az_attribute_key', '', '<>'); + $terms = $query->execute(); + $terms = $term_storage->loadMultiple($terms); + foreach ($terms as $term) { + $options[$term->field_az_attribute_key->value] = $this->entityRepository->getTranslationFromContext($term)->label(); + } + + // Build the select element for the attribute. + $form['query_parameters']['attributes'][$key] = [ + '#type' => 'select', + '#options' => $options, + '#empty_option' => $this->t('- Any -'), + '#empty_value' => '', + '#title' => $this->entityRepository->getTranslationFromContext($attribute)->label(), + '#required' => FALSE, + '#default_value' => $entity->get('attributes')[$key] ?? NULL, + ]; + } + + $form['query_parameters']['approval'] = [ + '#type' => 'select', + '#title' => $this->t('Approved for University Calendar'), + '#options' => [ + 'approved' => $this->t('Approved'), + 'denied' => $this->t('Denied'), + ], + '#empty_option' => $this->t('- Any -'), + '#empty_value' => '', + '#required' => FALSE, + '#default_value' => $entity->get('approval'), + ]; + + return $form; + } + + /** + * {@inheritdoc} + */ + public function save(array $form, FormStateInterface $form_state): int { + $result = parent::save($form, $form_state); + $message_args = ['%label' => $this->entity->label()]; + $this->messenger()->addStatus( + match($result) { + \SAVED_NEW => $this->t('Created new recurring import rule %label.', $message_args), + \SAVED_UPDATED => $this->t('Updated recurring import rule %label.', $message_args), + } + ); + + $form_state->setRedirectUrl($this->entity->toUrl('collection')); + return $result; + } + +} diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/src/Form/TrellisOpportunitySettingsForm.php b/modules/custom/az_opportunity/az_opportunity_trellis/src/Form/TrellisOpportunitySettingsForm.php new file mode 100644 index 0000000000..d018341dda --- /dev/null +++ b/modules/custom/az_opportunity/az_opportunity_trellis/src/Form/TrellisOpportunitySettingsForm.php @@ -0,0 +1,53 @@ +config('az_opportunity_trellis.settings'); + + $form['api_hostname'] = [ + '#title' => $this->t("API Hostname"), + '#type' => 'textfield', + '#default_value' => $az_opportunity_trellis_config->get('api_hostname'), + ]; + + return parent::buildForm($form, $form_state); + } + + /** + * {@inheritdoc} + */ + public function submitForm(array &$form, FormStateInterface $form_state) { + $this->config('az_opportunity_trellis.settings') + ->set('api_hostname', $form_state->getValue('api_hostname')) + ->save(); + + parent::submitForm($form, $form_state); + } + +} diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/src/Plugin/migrate/source/AZTrellisOpportunitySource.php b/modules/custom/az_opportunity/az_opportunity_trellis/src/Plugin/migrate/source/AZTrellisOpportunitySource.php new file mode 100644 index 0000000000..03a3f923b1 --- /dev/null +++ b/modules/custom/az_opportunity/az_opportunity_trellis/src/Plugin/migrate/source/AZTrellisOpportunitySource.php @@ -0,0 +1,144 @@ +fields = $configuration['fields']; + $this->ids = $configuration['ids']; + // @todo use injection for this. + $this->trellisHelper = \Drupal::service('az_opportunity_trellis.trellis_helper'); + $this->trellisIds = $configuration['trellis_ids'] ?? []; + // If no arguments are supplied, fetch the list currently on the site. + if (empty($this->trellisIds)) { + $ids = $this->trellisHelper->getImportedOpportunityIds(); + $ids += $this->trellisHelper->getRecurringOpportunityIds(); + $this->trellisIds = array_unique($ids); + } + } + + /** + * Initializes the iterator with the source data. + * + * @return \Iterator + * Returns an iterable object of data for this source. + */ + protected function initializeIterator() { + // Fetch the opportunities via trellis API. + $items = $this->trellisHelper->getOpportunities($this->trellisIds); + $results = []; + $fields = []; + // Find field selectors. + foreach ($this->fields as $field) { + $fields[$field['name']] = $field['selector'] ?? $field['name']; + } + foreach ($items as $item) { + $result = []; + // Transform selectors into defined fields. + foreach ($fields as $field => $selector) { + if (isset($item[$selector])) { + $result[$field] = $item[$selector]; + } + } + $results[] = $result; + } + // Return an iterable. + $obj = new \ArrayObject($results); + return $obj->getIterator(); + } + + /** + * {@inheritdoc} + */ + public function prepareRow(Row $row) { + // Trellis IDs from source configuration can affect the hash of the row. + $row->setSourceProperty('trellis_ids', []); + // Perform normal source plugin hashing. + return parent::prepareRow($row); + } + + /** + * Return a string representing the source ids. + * + * @return string + * Comma-separated list of ids being imported. + */ + public function __toString(): string { + $ids = implode(', ', $this->trellisIds); + return $ids; + } + + /** + * {@inheritdoc} + */ + public function fields(): array { + $fields = []; + foreach ($this->fields as $field_info) { + $fields[$field_info['name']] = $field_info['label'] ?? $field_info['name']; + } + return $fields; + } + + /** + * {@inheritdoc} + */ + public function getIds(): array { + return $this->ids; + } + +} diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/src/Plugin/views/field/AZOpportunityTrellisViewsField.php b/modules/custom/az_opportunity/az_opportunity_trellis/src/Plugin/views/field/AZOpportunityTrellisViewsField.php new file mode 100644 index 0000000000..b523041695 --- /dev/null +++ b/modules/custom/az_opportunity/az_opportunity_trellis/src/Plugin/views/field/AZOpportunityTrellisViewsField.php @@ -0,0 +1,160 @@ +migrationRemoteTools = $container->get('az_migration_remote.tools'); + $instance->trellisHelper = $container->get('az_opportunity_trellis.trellis_helper'); + return $instance; + } + + /** + * {@inheritdoc} + */ + public function init(ViewExecutable $view, DisplayPluginBase $display, ?array &$options = NULL) { + FieldPluginBase::init($view, $display, $options); + $this->actions = []; + } + + /** + * {@inheritdoc} + */ + public function viewsForm(&$form, FormStateInterface $form_state) { + $form['#cache']['max-age'] = 0; + + $form[$this->options['id']] = [ + '#tree' => TRUE, + ]; + + foreach ($this->view->result as $row_index => $row) { + $form[$this->options['id']][$row_index] = [ + '#type' => 'checkbox', + // We are not able to determine a main "title" for each row, so we can + // only output a generic label. + '#title' => $this->t('Update this item'), + '#title_display' => 'invisible', + '#return_value' => $row->Id ?? '', + '#default_value' => !empty($form_state->getValue($this->options['id'])[$row_index]) ? 1 : NULL, + ]; + } + + // Change default BulkForm label. + if (!empty($form['actions']['submit'])) { + $form['actions']['submit']['#value'] = $this->t('Import'); + } + } + + /** + * {@inheritdoc} + */ + public function viewsFormValidate(&$form, FormStateInterface $form_state) { + $ids = $form_state->getValue($this->options['id']); + if (empty($ids) || empty(array_filter($ids))) { + $form_state->setErrorByName('', $this->emptySelectedMessage()); + } + // Unlike parent class, do not throw form error when action is empty. + } + + /** + * Submit handler for the Trellis import form. + * + * @param mixed $form + * An associative array containing the structure of the form. + * @param \Drupal\Core\Form\FormStateInterface $form_state + * The current state of the form. + * + * @throws \Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException + * Thrown when the user tried to access an action without access to it. + */ + public function viewsFormSubmit(&$form, FormStateInterface $form_state) { + $values = $form_state->getValues(); + if (!empty($values[$this->options['id']])) { + $ids = $values[$this->options['id']]; + $ids = array_filter($ids); + foreach ($ids as $value) { + if (!empty($value)) { + \Drupal::service('messenger')->addMessage($this->t('Importing Trellis Opportunity @id.', [ + '@id' => $value, + ])); + } + } + + $migrations = [ + 'az_trellis_opportunity_files' => [ + 'limit' => 0, + 'update' => 0, + 'force' => 0, + 'configuration' => [ + 'source' => [ + 'trellis_ids' => $ids, + ], + ], + ], + 'az_trellis_opportunity_media' => [ + 'limit' => 0, + 'update' => 0, + 'force' => 0, + 'configuration' => [ + 'source' => [ + 'trellis_ids' => $ids, + ], + ], + ], + 'az_trellis_opportunity' => [ + 'limit' => 0, + 'update' => 0, + 'force' => 0, + 'configuration' => [ + 'source' => [ + 'trellis_ids' => $ids, + ], + ], + ], + ]; + + $this->migrationRemoteTools->batch($migrations); + } + + } + + /** + * {@inheritdoc} + */ + public function isWorkspaceSafeForm(array $form, FormStateInterface $form_state): bool { + // This field is not backed by an entity like BulkForm expects. + return FALSE; + } + +} diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/src/Plugin/views/filter/AZOpportunityTrellisViewsApprovalFilter.php b/modules/custom/az_opportunity/az_opportunity_trellis/src/Plugin/views/filter/AZOpportunityTrellisViewsApprovalFilter.php new file mode 100644 index 0000000000..555df5c6f4 --- /dev/null +++ b/modules/custom/az_opportunity/az_opportunity_trellis/src/Plugin/views/filter/AZOpportunityTrellisViewsApprovalFilter.php @@ -0,0 +1,96 @@ + 'select', + '#title' => $this->t('Value'), + '#options' => [ + 'approved' => $this->t('Approved'), + 'denied' => $this->t('Denied'), + ], + '#required' => FALSE, + '#default_value' => $this->value, + ]; + } + + /** + * {@inheritdoc} + */ + public function operatorOptions(): array { + return [ + '=' => $this->t('Is equal to'), + '!=' => $this->t('Is not equal to'), + ]; + } + + /** + * {@inheritdoc} + */ + protected function defineOptions(): array { + $options = parent::defineOptions(); + $this->definePropertyPathOption($options); + return $options; + } + + /** + * {@inheritdoc} + */ + public function buildOptionsForm(&$form, FormStateInterface $form_state): void { + $this->propertyPathElement($form, $this->options); + parent::buildOptionsForm($form, $form_state); + } + + /** + * {@inheritdoc} + */ + public function adminSummary() { + $prop = $this->options['property_path'] ?? ''; + return '(API value ' . $prop . ') ' . $this->operator . ' ' . $this->value; + } + + /** + * {@inheritdoc} + */ + public function query($group_by = FALSE): void { + if (!($this->query instanceof RemoteDataQuery)) { + return; + } + $this->query->addWhere( + $this->options['group'], + $this->options['property_path'], + $this->value, + $this->operator + ); + } + +} diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/src/Plugin/views/filter/AZOpportunityTrellisViewsAttributeFilter.php b/modules/custom/az_opportunity/az_opportunity_trellis/src/Plugin/views/filter/AZOpportunityTrellisViewsAttributeFilter.php new file mode 100644 index 0000000000..a4e549cd24 --- /dev/null +++ b/modules/custom/az_opportunity/az_opportunity_trellis/src/Plugin/views/filter/AZOpportunityTrellisViewsAttributeFilter.php @@ -0,0 +1,170 @@ +entityRepository = $container->get('entity.repository'); + $instance->termStorage = $container->get('entity_type.manager')->getStorage('taxonomy_term'); + return $instance; + } + + /** + * {@inheritdoc} + */ + protected function valueForm(&$form, FormStateInterface $form_state): void { + $options = []; + $key = $this->options['az_attribute_key'] ?? ''; + + // Get the applicable attribute terms. + $query = $this->termStorage->getQuery() + ->accessCheck(TRUE) + ->addTag('taxonomy_term_access') + ->condition('vid', 'az_enterprise_attributes') + ->condition('field_az_attribute_key', $key); + $parents = $query->execute(); + $children = []; + if (!empty($parents)) { + $query = $this->termStorage->getQuery() + ->accessCheck(TRUE) + ->sort('name') + ->addTag('taxonomy_term_access') + ->condition('parent', $parents, 'IN'); + $children = $query->execute(); + } + $terms = Term::loadMultiple($children); + // Build option list. + foreach ($terms as $term) { + if ($term->hasField('field_az_attribute_key') && !empty($term->field_az_attribute_key->value)) { + $options[$term->field_az_attribute_key->value] = $this->entityRepository->getTranslationFromContext($term)->label(); + } + } + $form['value'] = [ + '#type' => 'select', + '#title' => $this->t('Value'), + '#options' => $options, + '#required' => FALSE, + '#access' => !empty($options), + '#default_value' => $this->value, + ]; + } + + /** + * {@inheritdoc} + */ + public function operatorOptions(): array { + return [ + '=' => $this->t('Is equal to'), + '!=' => $this->t('Is not equal to'), + ]; + } + + /** + * {@inheritdoc} + */ + protected function defineOptions(): array { + $options = parent::defineOptions(); + $this->definePropertyPathOption($options); + $options['az_attribute_key'] = ['default' => '']; + return $options; + } + + /** + * {@inheritdoc} + */ + public function buildOptionsForm(&$form, FormStateInterface $form_state): void { + $this->propertyPathElement($form, $this->options); + parent::buildOptionsForm($form, $form_state); + $form['az_attribute_key'] = [ + '#title' => $this->t('Unique key of enterprise attribute'), + '#type' => 'textfield', + '#default_value' => $this->options['az_attribute_key'] ?? '', + '#required' => TRUE, + ]; + } + + /** + * Return the attribute id and api parameter name. + * + * @return array + * An array with the key as the attribute id and the value as the api path. + */ + public function getApiMapping(): array { + $key = $this->options['az_attribute_key'] ?? ''; + $path = $this->options['property_path'] ?? ''; + return [$key => $path]; + } + + /** + * {@inheritdoc} + */ + public function adminSummary() { + $prop = $this->options['property_path'] ?? ''; + $key = $this->options['az_attribute_key'] ?? ''; + return $key . ' (API value ' . $prop . ') ' . $this->operator . ' ' . $this->value; + } + + /** + * {@inheritdoc} + */ + public function query($group_by = FALSE): void { + if (!($this->query instanceof RemoteDataQuery)) { + return; + } + $this->query->addWhere( + $this->options['group'], + $this->options['property_path'], + $this->value, + $this->operator + ); + } + +} diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/src/Plugin/views/filter/AZOpportunityTrellisViewsDateFilter.php b/modules/custom/az_opportunity/az_opportunity_trellis/src/Plugin/views/filter/AZOpportunityTrellisViewsDateFilter.php new file mode 100644 index 0000000000..22bf20d20d --- /dev/null +++ b/modules/custom/az_opportunity/az_opportunity_trellis/src/Plugin/views/filter/AZOpportunityTrellisViewsDateFilter.php @@ -0,0 +1,289 @@ + $this->t('Next 7 Days'), + 'Next 30 Days' => $this->t('Next 30 Days'), + 'Last 7 Days' => $this->t('Last 7 Days'), + 'Last 30 Days' => $this->t('Last 30 Days'), + 'Custom' => $this->t('Custom'), + ]; + return $options; + } + + /** + * The asset resolver service. + * + * @var \Drupal\Core\Asset\AssetResolver + */ + protected $assetResolver; + + /** + * The file url generator service. + * + * @var \Drupal\Core\File\FileUrlGeneratorInterface + */ + protected $fileUrlGenerator; + + /** + * {@inheritdoc} + */ + public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) { + $instance = new static( + $configuration, + $plugin_id, + $plugin_definition + ); + + $instance->assetResolver = $container->get('asset.resolver'); + $instance->fileUrlGenerator = $container->get('file_url_generator'); + return $instance; + } + + /** + * {@inheritdoc} + */ + protected function valueForm(&$form, FormStateInterface $form_state): void { + $form['value']['#tree'] = TRUE; + $form['#attached']['library'][] = 'az_opportunity_trellis/az_opportunity_trellis_date'; + // Trim valid options to selected options. + $options = $this->trellisDateOptions(); + $keys = $this->options['api_options'] ?? []; + $options = array_intersect($options, array_flip($keys)); + $form['value']['value'] = [ + '#type' => 'select', + '#options' => $options, + '#empty_option' => $this->t('- Any -'), + '#empty_value' => '', + '#required' => FALSE, + '#default_value' => $this->value['value'], + ]; + // Add label if this is the exposed form. + $exposed_info = $this->exposedInfo(); + if (!empty($exposed_info['label'])) { + $form['value']['value']['#title'] = $exposed_info['label']; + } + // Fetch library information for shadow DOM inclusion. + $css = []; + try { + $attached = AttachedAssets::createFromRenderArray([ + '#attached' => [ + 'library' => [ + 'az_opportunity_trellis/easepick_styles', + ], + ], + ]); + $assets = $this->assetResolver->getCssAssets($attached, TRUE); + foreach ($assets as $asset) { + if (!empty($asset['data'])) { + $css[] = $this->fileUrlGenerator->generateString($asset['data']); + } + } + } + catch (\Exception $e) { + // Failed to fetch assets. + } + $form['#attached']['drupalSettings']['trellisDatePicker']['css'] = $css; + // Prepare unique id for data attribute. + $end_id = Html::getUniqueId('az-trellis-daterange-end'); + $form['value']['begin'] = [ + '#type' => 'textfield', + '#title' => $this->t('Begin'), + '#attributes' => [ + 'data-az-trellis-daterange-end' => $end_id, + 'class' => ['az-trellis-daterange'], + ], + '#size' => 30, + '#default_value' => $this->value['begin'], + ]; + $form['value']['end'] = [ + '#type' => 'textfield', + '#title' => $this->t('End'), + '#attributes' => [ + 'id' => $end_id, + 'class' => ['az-trellis-daterange-end'], + ], + '#size' => 30, + '#default_value' => $this->value['end'], + ]; + // Compute conditional fields using states array. + if ($form_state->get('exposed')) { + $identifier = $this->options['expose']['identifier']; + $source = ':input[name="' . $identifier . '[value]"]'; + $state = [$source => ['value' => 'Custom']]; + $form['value']['begin']['#states']['visible'][] = $state; + $form['value']['end']['#states']['visible'][] = $state; + } + } + + /** + * {@inheritdoc} + */ + protected function buildValueWrapper(&$form, $wrapper_identifier) { + // Modify parent class behavior to be a container rather than a fieldset. + if (!isset($form[$wrapper_identifier])) { + $form[$wrapper_identifier] = [ + '#type' => 'container', + '#attributes' => [ + 'class' => [ + 'views-exposed-form__item', + 'az-opportunity-trellis-datewrapper', + ], + ], + ]; + } + } + + /** + * {@inheritdoc} + */ + public function operatorOptions(): array { + return [ + '=' => $this->t('Is equal to'), + '!=' => $this->t('Is not equal to'), + ]; + } + + /** + * {@inheritdoc} + */ + protected function defineOptions(): array { + $options = parent::defineOptions(); + $options['value'] = [ + 'contains' => [ + 'value' => ['default' => ''], + 'begin' => ['default' => ''], + 'end' => ['default' => ''], + ], + ]; + $options['api_param'] = ['default' => '']; + $options['api_options'] = ['default' => []]; + $options['api_param_custom_begin'] = ['default' => '']; + $options['api_param_custom_end'] = ['default' => '']; + return $options; + } + + /** + * {@inheritdoc} + */ + public function buildOptionsForm(&$form, FormStateInterface $form_state): void { + parent::buildOptionsForm($form, $form_state); + $form['api_options'] = [ + '#type' => 'select', + '#title' => $this->t('Trellis Date Options'), + '#options' => $this->trellisDateOptions(), + '#multiple' => TRUE, + '#required' => TRUE, + '#default_value' => $this->options['api_options'], + ]; + $form['api_param'] = [ + '#title' => $this->t('API get parameter for date'), + '#type' => 'textfield', + '#default_value' => $this->options['api_param'] ?? '', + '#required' => TRUE, + ]; + $form['api_param_custom_begin'] = [ + '#title' => $this->t('API get parameter for custom begin date'), + '#type' => 'textfield', + '#default_value' => $this->options['api_param_custom_begin'] ?? '', + '#required' => TRUE, + ]; + $form['api_param_custom_end'] = [ + '#title' => $this->t('API get parameter for custom end date'), + '#type' => 'textfield', + '#default_value' => $this->options['api_param_custom_end'] ?? '', + '#required' => TRUE, + ]; + + } + + /** + * {@inheritdoc} + */ + public function adminSummary() { + $prop = $this->options['api_param'] ?? ''; + $begin = $this->options['api_param_custom_begin'] ?? ''; + $end = $this->options['api_param_custom_end'] ?? ''; + return 'Date (API ' . $prop . ' ' . $begin . ' ' . $end . ') ' . $this->operator . ' ' . $this->value['value']; + } + + /** + * {@inheritdoc} + */ + public function query($group_by = FALSE): void { + if (!($this->query instanceof RemoteDataQuery)) { + return; + } + $value = $this->value['value'] ?? ''; + $this->query->addWhere( + $this->options['group'], + $this->options['api_param'], + $this->value['value'], + $this->operator + ); + // Handle supplied values if custom range. + if ($value === 'Custom') { + // Compute time offsets for API query. + $begin = $this->value['begin'] ?? ''; + $end = $this->value['end'] ?? ''; + $begin = strtotime($begin); + $end = strtotime($end); + if (($begin !== FALSE) && ($end !== FALSE)) { + // Find begin and end of respective days. + $begin = strtotime("today", $begin); + $end = strtotime("tomorrow", $end); + // Roll over to the previous night. + $end -= 1; + $begin = gmdate(self::TRELLIS_DATE_FORMAT, $begin); + $end = gmdate(self::TRELLIS_DATE_FORMAT, $end); + $this->query->addWhere( + $this->options['group'], + $this->options['api_param_custom_begin'], + $begin, + $this->operator + ); + $this->query->addWhere( + $this->options['group'], + $this->options['api_param_custom_end'], + $end, + $this->operator + ); + } + } + } + +} diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/src/TrellisHelper.php b/modules/custom/az_opportunity/az_opportunity_trellis/src/TrellisHelper.php new file mode 100644 index 0000000000..b82f172ed4 --- /dev/null +++ b/modules/custom/az_opportunity/az_opportunity_trellis/src/TrellisHelper.php @@ -0,0 +1,314 @@ +configFactory = $config_factory; + $this->httpClient = $http_client; + $this->cache = $cache; + $this->entityTypeManager = $entity_type_manager; + } + + /** + * Search based on parameters for opportunities. + * + * @param array $query + * Query parameters to use in search. + * + * @return array + * Array of trellis opportunity ids. + */ + public function searchOpportunities(array $query) { + $ids = []; + // Compute cache key of query. + $key = 'az_trellis_opportunity.search:' . Crypt::hashBase64(serialize($query)); + $cached = $this->cache->get($key); + // If we have this search cached, return it. + if ($cached !== FALSE) { + return $cached->data; + } + + $url = $this->getOpportunitiesSearchEndpoint(); + try { + // Run search request. + $response = $this->httpClient->request('GET', $url, ['query' => $query]); + if ($response->getStatusCode() === 200) { + $json = (string) $response->getBody(); + $json = json_decode($json, TRUE); + if ($json !== NULL) { + $ids = $json['data']['Opportunities_IDs'] ?? []; + // Ensure opportunities are in Id order. + sort($ids); + // @todo determine cache expiration. + $expire = time() + 1800; + // Cache search result. + $this->cache->set($key, $ids, $expire); + } + } + } + catch (GuzzleException $e) { + } + return $ids; + } + + /** + * Returns opportunity data for an array of ids. + * + * @param array $trellis_ids + * Trellis Opportunities IDs in an array. + * + * @return array + * Opportunities data. + */ + public function getOpportunities(array $trellis_ids) { + $opportunities = []; + $fetch = []; + $url = $this->getOpportunityEndpoint(); + // Remove any duplicate ids to mimic remote API. + $trellis_ids = array_unique($trellis_ids); + // Grab opportunities that are in cache. + foreach ($trellis_ids as $trellis_id) { + $cached = $this->getTrellisCache($trellis_id); + if ($cached === FALSE) { + $fetch[] = $trellis_id; + } + else { + $opportunities[] = $cached; + } + } + // Fetch opportunities we did not have cached. + if (!empty($fetch)) { + try { + $data = ['ids' => implode(',', $fetch)]; + $response = $this->httpClient->request('POST', $url, ['json' => $data]); + if ($response->getStatusCode() === 200) { + $json = (string) $response->getBody(); + $json = json_decode($json, TRUE); + if ($json !== NULL) { + $results = $json['data'] ?? []; + foreach ($results as $result) { + // Cache the opportunity and add it to the list. + $opportunities[] = $this->setTrellisCache($result); + } + } + } + } + catch (GuzzleException $e) { + } + } + // Make sure opportunities are in Id order regardless of cached/fetched. + usort($opportunities, function ($a, $b) { + return strcmp($a['Id'], $b['Id']); + }); + return $opportunities; + } + + /** + * Fetch the list of trellis opportunity ids currently imported. + * + * @return array + * Returns an array of opportunity ids. + */ + public function getImportedOpportunityIds() { + $nodeStorage = $this->entityTypeManager->getStorage('node'); + // Check for opportunities that have trellis ids. + $query = $nodeStorage->getQuery() + ->accessCheck(FALSE) + ->condition('type', 'az_opportunity') + ->exists('field_az_trellis_id'); + $nids = $query->execute(); + $nodes = $nodeStorage->loadMultiple($nids); + + $opportunity_api_ids = []; + foreach ($nodes as $n) { + $opportunity_api_ids[] = $n->get('field_az_trellis_id')->getString(); + } + return $opportunity_api_ids; + } + + /** + * Fetch the recurring search list of ids to import. + * + * @return array + * Returns an array of opportunity ids. + */ + public function getRecurringOpportunityIds() { + // Find enabled import configurations. + $imports = $this->entityTypeManager->getStorage('az_recurring_import_rule')->loadByProperties([ + 'status' => [1, TRUE], + ]); + + $opportunity_api_ids = []; + foreach ($imports as $import) { + /** @var \Drupal\az_opportunity_trellis\Entity\AZRecurringImportRule $import */ + $opportunity_api_ids += $import->getOpportunityIds(); + } + // Remove duplicates in case searches overlapped. + $opportunity_api_ids = array_unique($opportunity_api_ids); + return $opportunity_api_ids; + } + + /** + * Return mapped array of api names of attributes. + * + * @return array + * The array of attribute ids mapped to API names. + */ + public function getAttributeMappings() { + $mappings = []; + $view = Views::getView('az_opportunity_trellis_import'); + $display = $view->getDisplay() ?? NULL; + $filters = $display->getHandlers('filter'); + foreach ($filters as $filter) { + if ($filter instanceof AZOpportunityTrellisViewsAttributeFilter) { + $mappings += $filter->getApiMapping(); + } + } + return $mappings; + } + + /** + * Returns the cache for an opportunity if possible. + * + * @param string $trellis_id + * The trellis id of the opportunity. + * + * @return mixed + * The cached data for the opportunity, or FALSE. + */ + protected function getTrellisCache(string $trellis_id) { + $key = 'az_trellis_opportunity:' . $trellis_id; + return $this->cache->get($key)->data ?? FALSE; + } + + /** + * Sets the cache for an opportunity if possible. + * + * @param array $opportunity + * The opportunity data result. + * + * @return array + * The data for the opportunity. + */ + protected function setTrellisCache(array $opportunity) { + if (!empty($opportunity['Id'])) { + $key = 'az_trellis_opportunity:' . $opportunity['Id']; + // @todo determine cache expiration. + $expire = time() + 1800; + $this->cache->set($key, $opportunity, $expire); + } + return $opportunity; + } + + /** + * Returns API URL for given Trellis Opportunity ID. + * + * @param string $trellis_id + * Trellis Opportunity ID. + * + * @return string + * Opportunity API URL. + */ + public function getOpportunityUrl($trellis_id) { + $hostname = $this->configFactory->get('az_opportunity_trellis.settings')->get('api_hostname'); + return 'https://' . $hostname . self::$apiBasePath . $trellis_id; + } + + /** + * Returns API URL. + * + * @return string + * Opportunity API URL. + */ + public function getOpportunityEndpoint() { + $hostname = $this->configFactory->get('az_opportunity_trellis.settings')->get('api_hostname'); + return 'https://' . $hostname . self::$apiBasePath; + } + + /** + * Returns API search URL. + * + * @return string + * Opportunity API search URL. + */ + public function getOpportunitySearchEndpoint() { + $hostname = $this->configFactory->get('az_opportunity_trellis.settings')->get('api_hostname'); + return 'https://' . $hostname . self::$apiSearchPath; + } + +} From a2230bd150c771bae1d8b9da709e22540a7afa04 Mon Sep 17 00:00:00 2001 From: Z Saenz Date: Tue, 3 Feb 2026 09:48:44 -0700 Subject: [PATCH 12/59] removes media fields --- ...install => az_opportunity_trellis.install} | 0 .../az_opportunity_trellis.module | 10 --- .../az_opportunity_trellis.views.inc | 8 +- ..._plus.migration.az_trellis_opportunity.yml | 27 +----- .../schema/az_opportunity_trellis.schema.yml | 6 +- .../src/Entity/AZRecurringImportRule.php | 5 -- .../src/Form/AZRecurringImportRuleForm.php | 82 +++++++++---------- ...ortunityTrellisViewsOpportunityTypeFilter} | 28 +++---- ...rm_display.node.az_opportunity.default.yml | 68 ++++----------- ...ew_display.node.az_opportunity.az_card.yml | 53 +++++------- ...iew_display.node.az_opportunity.az_row.yml | 31 ++++--- ....az_opportunity.az_row_with_background.yml | 16 +--- ...splay.node.az_opportunity.az_small_row.yml | 8 +- ...ew_display.node.az_opportunity.default.yml | 81 ++++++++---------- ...y_term.az_opportunity_modality.default.yml | 26 ++++++ ...nomy_term.az_opportunity_type.az_badge.yml | 45 ++++++++++ ...onomy_term.az_opportunity_type.default.yml | 20 +++++ ...de.az_opportunity.field_az_attachments.yml | 27 +----- ....node.az_opportunity.field_az_location.yml | 28 +------ ...de.az_opportunity.field_az_media_image.yml | 29 +------ ...ortunity.field_az_opportunity_location.yml | 18 ++++ ...age.node.field_az_opportunity_location.yml | 20 +++++ .../install/views.view.az_opportunity.yml | 13 +-- 23 files changed, 295 insertions(+), 354 deletions(-) rename modules/custom/az_opportunity/az_opportunity_trellis/{az_opportunitty_trellis.install => az_opportunity_trellis.install} (100%) rename modules/custom/az_opportunity/az_opportunity_trellis/src/Plugin/views/filter/{AZOpportunityTrellisViewsAttributeFilter.php => AZOpportunityTrellisViewsOpportunityTypeFilter} (79%) create mode 100644 modules/custom/az_opportunity/config/install/core.entity_view_display.taxonomy_term.az_opportunity_modality.default.yml create mode 100644 modules/custom/az_opportunity/config/install/core.entity_view_display.taxonomy_term.az_opportunity_type.az_badge.yml create mode 100644 modules/custom/az_opportunity/config/install/core.entity_view_display.taxonomy_term.az_opportunity_type.default.yml create mode 100644 modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_opportunity_location.yml create mode 100644 modules/custom/az_opportunity/config/install/field.storage.node.field_az_opportunity_location.yml diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunitty_trellis.install b/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.install similarity index 100% rename from modules/custom/az_opportunity/az_opportunity_trellis/az_opportunitty_trellis.install rename to modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.install diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.module b/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.module index eb3797575c..ff4574d5f8 100644 --- a/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.module +++ b/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.module @@ -34,13 +34,6 @@ function az_opportunity_trellis_form_node_az_opportunity_edit_form_alter(&$form, $disabled_fields = [ 'title', - // 'title', // Original fields for reference - // 'field_az_location', - // 'field_az_event_date', - // 'field_az_link', - // 'field_az_summary', - // 'field_az_photos', - // 'field_az_enterprise_attributes', 'field_az_application_date', 'field_az_application_link', 'field_az_audiences', @@ -62,10 +55,7 @@ function az_opportunity_trellis_form_node_az_opportunity_edit_form_alter(&$form, } $no_access_fields = [ - // 'field_az_subheading', 'field_az_body', - //'field_az_contacts', - 'field_az_attachments', ]; foreach ($no_access_fields as $field) { $form[$field]['#access'] = FALSE; diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.views.inc b/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.views.inc index 57616a1d11..af8c004b45 100644 --- a/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.views.inc +++ b/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.views.inc @@ -44,11 +44,11 @@ function az_opportunity_trellis_views_data(): array { 'id' => 'date', ], ]; - $data['az_opportunity_trellis_data']['Attributes'] = [ - 'title' => t('Enterprise Attribute'), - 'help' => t('Trellis opportunity search API enterprise attributes'), + $data['az_opportunity_trellis_data']['Program_Type'] = [ + 'title' => t('Program type'), + 'help' => t('Trellis opportunity search API program type'), 'filter' => [ - 'id' => 'az_opportunity_trellis_views_attribute_filter', + 'id' => 'az_opportunity_trellis_views_program_type_filter', ], ]; $data['az_opportunity_trellis_data']['Approval'] = [ diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/config/install/migrate_plus.migration.az_trellis_opportunity.yml b/modules/custom/az_opportunity/az_opportunity_trellis/config/install/migrate_plus.migration.az_trellis_opportunity.yml index 25951449c0..88f2f3539e 100644 --- a/modules/custom/az_opportunity/az_opportunity_trellis/config/install/migrate_plus.migration.az_trellis_opportunity.yml +++ b/modules/custom/az_opportunity/az_opportunity_trellis/config/install/migrate_plus.migration.az_trellis_opportunity.yml @@ -3,6 +3,7 @@ status: true dependencies: { } id: az_trellis_opportunity class: null +idMap: { } field_plugin_method: null cck_plugin_method: null migration_tags: @@ -54,37 +55,14 @@ source: name: publish label: Publish selector: Publish_Formula - - - name: az_enterprise_attributes - label: 'Enterprise Attributes' - selector: Attributes - name: format - label: 'Format' + label: Format selector: Format ids: id: type: string process: - field_az_enterprise_attributes: - - plugin: flatten - source: - - az_enterprise_attributes - - format - - - plugin: multiple_values - - - plugin: callback - callable: trim - - - plugin: single_value - - - plugin: entity_lookup - entity_type: taxonomy_term - bundle_key: vid - bundle: az_enterprise_attributes - value_key: name - ignore_case: true title: name field_az_trellis_id: id field_az_link/uri: url @@ -133,3 +111,4 @@ destination: migration_dependencies: optional: - az_trellis_opportunity_media +include: null diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/config/schema/az_opportunity_trellis.schema.yml b/modules/custom/az_opportunity/az_opportunity_trellis/config/schema/az_opportunity_trellis.schema.yml index 576f05a01c..08d3cffb6c 100644 --- a/modules/custom/az_opportunity/az_opportunity_trellis/config/schema/az_opportunity_trellis.schema.yml +++ b/modules/custom/az_opportunity/az_opportunity_trellis/config/schema/az_opportunity_trellis.schema.yml @@ -29,11 +29,11 @@ az_opportunity_trellis.az_recurring_import_rule.*: type: string keyword: type: string - attributes: + opportunity_type: type: sequence - label: ‘Enterprise Attributes’ + label: 'Opportunity Type' sequence: type: string - label: ‘Attribute’ + label: 'Opportunity Type' approval: type: string diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/src/Entity/AZRecurringImportRule.php b/modules/custom/az_opportunity/az_opportunity_trellis/src/Entity/AZRecurringImportRule.php index e4050abfe8..d8e5002d09 100644 --- a/modules/custom/az_opportunity/az_opportunity_trellis/src/Entity/AZRecurringImportRule.php +++ b/modules/custom/az_opportunity/az_opportunity_trellis/src/Entity/AZRecurringImportRule.php @@ -83,11 +83,6 @@ final class AZRecurringImportRule extends ConfigEntityBase implements AZRecurrin */ protected string $host; - /** - * The az_recurring_import_rule enterprise attributes. - */ - protected ?array $attributes; - /** * The az_recurring_import_rule approval status. */ diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/src/Form/AZRecurringImportRuleForm.php b/modules/custom/az_opportunity/az_opportunity_trellis/src/Form/AZRecurringImportRuleForm.php index 2fd1df1bb5..b32d921b80 100644 --- a/modules/custom/az_opportunity/az_opportunity_trellis/src/Form/AZRecurringImportRuleForm.php +++ b/modules/custom/az_opportunity/az_opportunity_trellis/src/Form/AZRecurringImportRuleForm.php @@ -105,49 +105,49 @@ public function form(array $form, FormStateInterface $form_state): array { $form['query_parameters']['attributes']['#tree'] = TRUE; // Get the different attributes available. - $term_storage = $this->entityTypeManager->getStorage('taxonomy_term'); - $query = $term_storage->getQuery() - ->accessCheck(TRUE) - ->addTag('taxonomy_term_access') - ->condition('vid', 'az_enterprise_attributes') - ->condition('parent', 0) - ->sort('name') - // Only fetch attributes that have an API mapping. - ->condition('field_az_attribute_key', array_keys($mappings), 'IN'); - $attributes = $query->execute(); - $attributes = $term_storage->loadMultiple($attributes); + // $term_storage = $this->entityTypeManager->getStorage('taxonomy_term'); + // $query = $term_storage->getQuery() + // ->accessCheck(TRUE) + // ->addTag('taxonomy_term_access') + // ->condition('vid', 'az_enterprise_attributes') + // ->condition('parent', 0) + // ->sort('name') + // // Only fetch attributes that have an API mapping. + // ->condition('field_az_attribute_key', array_keys($mappings), 'IN'); + // $attributes = $query->execute(); + // $attributes = $term_storage->loadMultiple($attributes); // Build attribute select lists. - foreach ($attributes as $attribute) { - $options = []; - $key = $mappings[$attribute->field_az_attribute_key->value]; - $id = $attribute->id(); - - // Find the options the attribute has, in order. - $query = $term_storage->getQuery() - ->accessCheck(TRUE) - ->addTag('taxonomy_term_access') - ->condition('vid', 'az_enterprise_attributes') - ->condition('parent', $id) - ->sort('name') - ->condition('field_az_attribute_key', '', '<>'); - $terms = $query->execute(); - $terms = $term_storage->loadMultiple($terms); - foreach ($terms as $term) { - $options[$term->field_az_attribute_key->value] = $this->entityRepository->getTranslationFromContext($term)->label(); - } - - // Build the select element for the attribute. - $form['query_parameters']['attributes'][$key] = [ - '#type' => 'select', - '#options' => $options, - '#empty_option' => $this->t('- Any -'), - '#empty_value' => '', - '#title' => $this->entityRepository->getTranslationFromContext($attribute)->label(), - '#required' => FALSE, - '#default_value' => $entity->get('attributes')[$key] ?? NULL, - ]; - } + // foreach ($attributes as $attribute) { + // $options = []; + // $key = $mappings[$attribute->field_az_attribute_key->value]; + // $id = $attribute->id(); + + // // Find the options the attribute has, in order. + // $query = $term_storage->getQuery() + // ->accessCheck(TRUE) + // ->addTag('taxonomy_term_access') + // ->condition('vid', 'az_enterprise_attributes') + // ->condition('parent', $id) + // ->sort('name') + // ->condition('field_az_attribute_key', '', '<>'); + // $terms = $query->execute(); + // $terms = $term_storage->loadMultiple($terms); + // foreach ($terms as $term) { + // $options[$term->field_az_attribute_key->value] = $this->entityRepository->getTranslationFromContext($term)->label(); + // } + + // // Build the select element for the attribute. + // $form['query_parameters']['attributes'][$key] = [ + // '#type' => 'select', + // '#options' => $options, + // '#empty_option' => $this->t('- Any -'), + // '#empty_value' => '', + // '#title' => $this->entityRepository->getTranslationFromContext($attribute)->label(), + // '#required' => FALSE, + // '#default_value' => $entity->get('attributes')[$key] ?? NULL, + // ]; + // } $form['query_parameters']['approval'] = [ '#type' => 'select', diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/src/Plugin/views/filter/AZOpportunityTrellisViewsAttributeFilter.php b/modules/custom/az_opportunity/az_opportunity_trellis/src/Plugin/views/filter/AZOpportunityTrellisViewsOpportunityTypeFilter similarity index 79% rename from modules/custom/az_opportunity/az_opportunity_trellis/src/Plugin/views/filter/AZOpportunityTrellisViewsAttributeFilter.php rename to modules/custom/az_opportunity/az_opportunity_trellis/src/Plugin/views/filter/AZOpportunityTrellisViewsOpportunityTypeFilter index a4e549cd24..f5c5b7fdf5 100644 --- a/modules/custom/az_opportunity/az_opportunity_trellis/src/Plugin/views/filter/AZOpportunityTrellisViewsAttributeFilter.php +++ b/modules/custom/az_opportunity/az_opportunity_trellis/src/Plugin/views/filter/AZOpportunityTrellisViewsOpportunityTypeFilter @@ -13,10 +13,10 @@ use Symfony\Component\DependencyInjection\ContainerInterface; /** - * Filter Trellis opportunity API values according to Enterprise Attributes. + * Filter Trellis event API values according to Enterprise Attributes. */ -#[ViewsFilter("az_opportunity_trellis_views_attribute_filter")] -class AZOpportunityTrellisViewsAttributeFilter extends FilterPluginBase { +#[ViewsFilter("az_opportunity_trellis_views_opportunity_type_filter")] +class AZOpportunityTrellisViewsOpportunityTypeFilter extends FilterPluginBase { use PropertyPluginTrait; @@ -64,12 +64,12 @@ protected function valueForm(&$form, FormStateInterface $form_state): void { $options = []; $key = $this->options['az_attribute_key'] ?? ''; - // Get the applicable attribute terms. + // Get the applicable type terms. $query = $this->termStorage->getQuery() ->accessCheck(TRUE) ->addTag('taxonomy_term_access') - ->condition('vid', 'az_enterprise_attributes') - ->condition('field_az_attribute_key', $key); + ->condition('vid', 'az_opportunity_type') + ->condition('field_az_opportunity_type_key', $key); $parents = $query->execute(); $children = []; if (!empty($parents)) { @@ -83,8 +83,8 @@ protected function valueForm(&$form, FormStateInterface $form_state): void { $terms = Term::loadMultiple($children); // Build option list. foreach ($terms as $term) { - if ($term->hasField('field_az_attribute_key') && !empty($term->field_az_attribute_key->value)) { - $options[$term->field_az_attribute_key->value] = $this->entityRepository->getTranslationFromContext($term)->label(); + if ($term->hasField('field_az_opportunity_type_key') && !empty($term->field_az_attribute_key->value)) { + $options[$term->field_az_opportunity_type_key->value] = $this->entityRepository->getTranslationFromContext($term)->label(); } } $form['value'] = [ @@ -113,7 +113,7 @@ public function operatorOptions(): array { protected function defineOptions(): array { $options = parent::defineOptions(); $this->definePropertyPathOption($options); - $options['az_attribute_key'] = ['default' => '']; + $options['az_opportunity_type_key'] = ['default' => '']; return $options; } @@ -123,10 +123,10 @@ protected function defineOptions(): array { public function buildOptionsForm(&$form, FormStateInterface $form_state): void { $this->propertyPathElement($form, $this->options); parent::buildOptionsForm($form, $form_state); - $form['az_attribute_key'] = [ - '#title' => $this->t('Unique key of enterprise attribute'), + $form['az_opportunity_type_key'] = [ + '#title' => $this->t('Unique key of opportunity type'), '#type' => 'textfield', - '#default_value' => $this->options['az_attribute_key'] ?? '', + '#default_value' => $this->options['az_opportunity_type_key'] ?? '', '#required' => TRUE, ]; } @@ -138,7 +138,7 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state): void { * An array with the key as the attribute id and the value as the api path. */ public function getApiMapping(): array { - $key = $this->options['az_attribute_key'] ?? ''; + $key = $this->options['az_opportunity_type_key'] ?? ''; $path = $this->options['property_path'] ?? ''; return [$key => $path]; } @@ -148,7 +148,7 @@ public function getApiMapping(): array { */ public function adminSummary() { $prop = $this->options['property_path'] ?? ''; - $key = $this->options['az_attribute_key'] ?? ''; + $key = $this->options['az_opportunity_type_key'] ?? ''; return $key . ' (API value ' . $prop . ') ' . $this->operator . ' ' . $this->value; } diff --git a/modules/custom/az_opportunity/config/install/core.entity_form_display.node.az_opportunity.default.yml b/modules/custom/az_opportunity/config/install/core.entity_form_display.node.az_opportunity.default.yml index 52800a90c2..94398af9c6 100644 --- a/modules/custom/az_opportunity/config/install/core.entity_form_display.node.az_opportunity.default.yml +++ b/modules/custom/az_opportunity/config/install/core.entity_form_display.node.az_opportunity.default.yml @@ -4,16 +4,14 @@ dependencies: config: - field.field.node.az_opportunity.field_az_application_date - field.field.node.az_opportunity.field_az_application_link - - field.field.node.az_opportunity.field_az_attachments - field.field.node.az_opportunity.field_az_audiences - field.field.node.az_opportunity.field_az_body - field.field.node.az_opportunity.field_az_credit - field.field.node.az_opportunity.field_az_incentives - - field.field.node.az_opportunity.field_az_location - - field.field.node.az_opportunity.field_az_media_image - field.field.node.az_opportunity.field_az_modality - field.field.node.az_opportunity.field_az_offered - field.field.node.az_opportunity.field_az_ongoing + - field.field.node.az_opportunity.field_az_opportunity_location - field.field.node.az_opportunity.field_az_opportunity_type - field.field.node.az_opportunity.field_az_parent_account - field.field.node.az_opportunity.field_az_program_date @@ -24,12 +22,8 @@ dependencies: - field.field.node.az_opportunity.field_az_trellis_imported_date - node.type.az_opportunity module: - - datetime - - file - link - link_class - - media_library - - media_library_edit - path - smart_date - text @@ -46,7 +40,7 @@ content: third_party_settings: { } field_az_application_date: type: smartdate_only - weight: 10 + weight: 11 region: content settings: separator: to @@ -75,16 +69,9 @@ content: link_class_force: 'btn btn-red' link_class_select: '' third_party_settings: { } - field_az_attachments: - type: file_generic - weight: 18 - region: content - settings: - progress_indicator: throbber - third_party_settings: { } field_az_audiences: type: entity_reference_autocomplete - weight: 23 + weight: 18 region: content settings: match_operator: CONTAINS @@ -115,23 +102,6 @@ content: settings: display_label: true third_party_settings: { } - field_az_location: - type: link_default - weight: 16 - region: content - settings: - placeholder_url: '' - placeholder_title: '' - third_party_settings: { } - field_az_media_image: - type: media_library_widget - weight: 12 - region: content - settings: - media_types: { } - third_party_settings: - media_library_edit: - show_edit: '1' field_az_modality: type: entity_reference_autocomplete weight: 17 @@ -154,11 +124,19 @@ content: third_party_settings: { } field_az_ongoing: type: boolean_checkbox - weight: 13 + weight: 10 region: content settings: display_label: true third_party_settings: { } + field_az_opportunity_location: + type: string_textfield + weight: 23 + region: content + settings: + size: 60 + placeholder: '' + third_party_settings: { } field_az_opportunity_type: type: options_buttons weight: 1 @@ -167,7 +145,7 @@ content: third_party_settings: { } field_az_parent_account: type: string_textfield - weight: 25 + weight: 16 region: content settings: size: 60 @@ -175,7 +153,7 @@ content: third_party_settings: { } field_az_program_date: type: smartdate_only - weight: 11 + weight: 12 region: content settings: separator: to @@ -219,20 +197,6 @@ content: size: 60 placeholder: '' third_party_settings: { } - field_az_trellis_id: - type: string_textfield - weight: 26 - region: content - settings: - size: 60 - placeholder: '' - third_party_settings: { } - field_az_trellis_imported_date: - type: datetime_default - weight: 27 - region: content - settings: { } - third_party_settings: { } path: type: path weight: 6 @@ -283,4 +247,6 @@ content: region: content settings: { } third_party_settings: { } -hidden: { } +hidden: + field_az_trellis_id: true + field_az_trellis_imported_date: true diff --git a/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_card.yml b/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_card.yml index 882273237f..012919d5bc 100644 --- a/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_card.yml +++ b/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_card.yml @@ -5,16 +5,14 @@ dependencies: - core.entity_view_mode.node.az_card - field.field.node.az_opportunity.field_az_application_date - field.field.node.az_opportunity.field_az_application_link - - field.field.node.az_opportunity.field_az_attachments - field.field.node.az_opportunity.field_az_audiences - field.field.node.az_opportunity.field_az_body - field.field.node.az_opportunity.field_az_credit - field.field.node.az_opportunity.field_az_incentives - - field.field.node.az_opportunity.field_az_location - - field.field.node.az_opportunity.field_az_media_image - field.field.node.az_opportunity.field_az_modality - field.field.node.az_opportunity.field_az_offered - field.field.node.az_opportunity.field_az_ongoing + - field.field.node.az_opportunity.field_az_opportunity_location - field.field.node.az_opportunity.field_az_opportunity_type - field.field.node.az_opportunity.field_az_parent_account - field.field.node.az_opportunity.field_az_program_date @@ -27,7 +25,6 @@ dependencies: module: - datetime_range - field_group - - link - smart_title - user third_party_settings: @@ -229,7 +226,6 @@ third_party_settings: speed: fast group_link: children: - - field_az_media_image - group_heading - group_text_body_secondary label: Link @@ -267,10 +263,11 @@ third_party_settings: speed: fast group_text_body_secondary: children: - - field_az_location + - field_az_opportunity_location + - field_az_modality - field_az_application_date - field_az_offered - - field_az_modality + - field_az_parent_account label: 'Text Body Secondary' parent_name: group_link region: content @@ -347,45 +344,41 @@ content: from_to: both separator: '-' third_party_settings: { } - weight: 6 - region: content - field_az_location: - type: link - label: hidden - settings: - trim_length: 80 - url_only: false - url_plain: false - rel: '0' - target: '0' - third_party_settings: { } - weight: 5 + weight: 9 region: content - field_az_media_image: + field_az_modality: type: entity_reference_entity_view - label: hidden + label: inline settings: - view_mode: az_card_image + view_mode: default link: false third_party_settings: { } - weight: 17 + weight: 8 region: content - field_az_modality: + field_az_offered: type: entity_reference_label label: inline settings: link: false third_party_settings: { } - weight: 8 + weight: 10 region: content - field_az_offered: - type: entity_reference_label + field_az_opportunity_location: + type: string label: inline settings: - link: false + link_to_entity: false third_party_settings: { } weight: 7 region: content + field_az_parent_account: + type: string + label: inline + settings: + link_to_entity: false + third_party_settings: { } + weight: 11 + region: content smart_title: settings: { } third_party_settings: { } @@ -393,14 +386,12 @@ content: region: content hidden: field_az_application_link: true - field_az_attachments: true field_az_audiences: true field_az_body: true field_az_credit: true field_az_incentives: true field_az_ongoing: true field_az_opportunity_type: true - field_az_parent_account: true field_az_program_date: true field_az_program_length: true field_az_program_website: true diff --git a/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_row.yml b/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_row.yml index ac84138058..0395fe1d0f 100644 --- a/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_row.yml +++ b/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_row.yml @@ -5,16 +5,14 @@ dependencies: - core.entity_view_mode.node.az_row - field.field.node.az_opportunity.field_az_application_date - field.field.node.az_opportunity.field_az_application_link - - field.field.node.az_opportunity.field_az_attachments - field.field.node.az_opportunity.field_az_audiences - field.field.node.az_opportunity.field_az_body - field.field.node.az_opportunity.field_az_credit - field.field.node.az_opportunity.field_az_incentives - - field.field.node.az_opportunity.field_az_location - - field.field.node.az_opportunity.field_az_media_image - field.field.node.az_opportunity.field_az_modality - field.field.node.az_opportunity.field_az_offered - field.field.node.az_opportunity.field_az_ongoing + - field.field.node.az_opportunity.field_az_opportunity_location - field.field.node.az_opportunity.field_az_opportunity_type - field.field.node.az_opportunity.field_az_parent_account - field.field.node.az_opportunity.field_az_program_date @@ -27,7 +25,6 @@ dependencies: module: - datetime_range - field_group - - link - smart_title - user third_party_settings: @@ -135,7 +132,8 @@ third_party_settings: speed: fast group_col_3: children: - - field_az_location + - field_az_opportunity_location + - field_az_modality label: 'Col 3' parent_name: group_row region: content @@ -198,17 +196,21 @@ content: third_party_settings: { } weight: 13 region: content - field_az_location: - type: link + field_az_modality: + type: entity_reference_label label: inline settings: - trim_length: 80 - url_only: false - url_plain: false - rel: '' - target: '' + link: false + third_party_settings: { } + weight: 10 + region: content + field_az_opportunity_location: + type: string + label: inline + settings: + link_to_entity: false third_party_settings: { } - weight: 14 + weight: 9 region: content field_az_program_date: type: daterange_default @@ -242,13 +244,10 @@ content: region: content hidden: field_az_application_link: true - field_az_attachments: true field_az_audiences: true field_az_body: true field_az_credit: true field_az_incentives: true - field_az_media_image: true - field_az_modality: true field_az_offered: true field_az_ongoing: true field_az_opportunity_type: true diff --git a/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_row_with_background.yml b/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_row_with_background.yml index 22a5fe2348..18f3610333 100644 --- a/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_row_with_background.yml +++ b/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_row_with_background.yml @@ -5,16 +5,14 @@ dependencies: - core.entity_view_mode.node.az_row_with_background - field.field.node.az_opportunity.field_az_application_date - field.field.node.az_opportunity.field_az_application_link - - field.field.node.az_opportunity.field_az_attachments - field.field.node.az_opportunity.field_az_audiences - field.field.node.az_opportunity.field_az_body - field.field.node.az_opportunity.field_az_credit - field.field.node.az_opportunity.field_az_incentives - - field.field.node.az_opportunity.field_az_location - - field.field.node.az_opportunity.field_az_media_image - field.field.node.az_opportunity.field_az_modality - field.field.node.az_opportunity.field_az_offered - field.field.node.az_opportunity.field_az_ongoing + - field.field.node.az_opportunity.field_az_opportunity_location - field.field.node.az_opportunity.field_az_opportunity_type - field.field.node.az_opportunity.field_az_parent_account - field.field.node.az_opportunity.field_az_program_date @@ -31,15 +29,6 @@ targetEntityType: node bundle: az_opportunity mode: az_row_with_background content: - field_az_media_image: - type: entity_reference_entity_view - label: hidden - settings: - view_mode: az_card_image - link: false - third_party_settings: { } - weight: 2 - region: content links: settings: { } third_party_settings: { } @@ -48,15 +37,14 @@ content: hidden: field_az_application_date: true field_az_application_link: true - field_az_attachments: true field_az_audiences: true field_az_body: true field_az_credit: true field_az_incentives: true - field_az_location: true field_az_modality: true field_az_offered: true field_az_ongoing: true + field_az_opportunity_location: true field_az_opportunity_type: true field_az_parent_account: true field_az_program_date: true diff --git a/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_small_row.yml b/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_small_row.yml index 416922125f..27b930a5b7 100644 --- a/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_small_row.yml +++ b/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_small_row.yml @@ -5,16 +5,14 @@ dependencies: - core.entity_view_mode.node.az_small_row - field.field.node.az_opportunity.field_az_application_date - field.field.node.az_opportunity.field_az_application_link - - field.field.node.az_opportunity.field_az_attachments - field.field.node.az_opportunity.field_az_audiences - field.field.node.az_opportunity.field_az_body - field.field.node.az_opportunity.field_az_credit - field.field.node.az_opportunity.field_az_incentives - - field.field.node.az_opportunity.field_az_location - - field.field.node.az_opportunity.field_az_media_image - field.field.node.az_opportunity.field_az_modality - field.field.node.az_opportunity.field_az_offered - field.field.node.az_opportunity.field_az_ongoing + - field.field.node.az_opportunity.field_az_opportunity_location - field.field.node.az_opportunity.field_az_opportunity_type - field.field.node.az_opportunity.field_az_parent_account - field.field.node.az_opportunity.field_az_program_date @@ -239,16 +237,14 @@ content: region: content hidden: field_az_application_link: true - field_az_attachments: true field_az_audiences: true field_az_body: true field_az_credit: true field_az_incentives: true - field_az_location: true - field_az_media_image: true field_az_modality: true field_az_offered: true field_az_ongoing: true + field_az_opportunity_location: true field_az_opportunity_type: true field_az_parent_account: true field_az_program_date: true diff --git a/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.default.yml b/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.default.yml index 831cf68cc3..427a9d851f 100644 --- a/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.default.yml +++ b/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.default.yml @@ -4,16 +4,14 @@ dependencies: config: - field.field.node.az_opportunity.field_az_application_date - field.field.node.az_opportunity.field_az_application_link - - field.field.node.az_opportunity.field_az_attachments - field.field.node.az_opportunity.field_az_audiences - field.field.node.az_opportunity.field_az_body - field.field.node.az_opportunity.field_az_credit - field.field.node.az_opportunity.field_az_incentives - - field.field.node.az_opportunity.field_az_location - - field.field.node.az_opportunity.field_az_media_image - field.field.node.az_opportunity.field_az_modality - field.field.node.az_opportunity.field_az_offered - field.field.node.az_opportunity.field_az_ongoing + - field.field.node.az_opportunity.field_az_opportunity_location - field.field.node.az_opportunity.field_az_opportunity_type - field.field.node.az_opportunity.field_az_parent_account - field.field.node.az_opportunity.field_az_program_date @@ -26,7 +24,6 @@ dependencies: module: - datetime_range - field_group - - file - link - smart_title - text @@ -220,8 +217,9 @@ third_party_settings: speed: fast group_where: children: - - field_az_location - label: Where + - field_az_opportunity_location + - field_az_modality + label: Location parent_name: group_col1 region: content weight: 5 @@ -260,8 +258,8 @@ third_party_settings: speed: fast group_modality: children: - - field_az_modality - label: Modality + - field_az_parent_account + label: 'Parent Account' parent_name: group_col4 region: content weight: 9 @@ -302,11 +300,10 @@ third_party_settings: group_audiences: children: - field_az_audiences - - field_az_opportunity_type label: Audiences parent_name: group_col6 region: content - weight: 3 + weight: 5 format_type: html_element format_settings: classes: '' @@ -323,7 +320,7 @@ third_party_settings: group_program_length: children: - field_az_program_length - label: Length + label: 'Program Length' parent_name: group_col3 region: content weight: 9 @@ -342,6 +339,7 @@ third_party_settings: speed: fast group_topics: children: + - field_az_opportunity_type - field_az_topic label: Topics parent_name: '' @@ -367,7 +365,7 @@ third_party_settings: label: 'Bottom Row' parent_name: '' region: content - weight: 10 + weight: 7 format_type: html_element format_settings: classes: row @@ -411,21 +409,13 @@ content: third_party_settings: { } weight: 16 region: content - field_az_attachments: - type: file_default - label: hidden - settings: - use_description_as_link_text: true - third_party_settings: { } - weight: 6 - region: content field_az_audiences: type: entity_reference_label label: hidden settings: link: false third_party_settings: { } - weight: 4 + weight: 7 region: content field_az_body: type: text_default @@ -452,50 +442,46 @@ content: third_party_settings: { } weight: 4 region: content - field_az_location: - type: link + field_az_modality: + type: entity_reference_label label: hidden settings: - trim_length: 80 - url_only: false - url_plain: false - rel: '' - target: '' + link: false third_party_settings: { } - weight: 6 + weight: 5 region: content - field_az_media_image: - type: entity_reference_entity_view + field_az_offered: + type: entity_reference_label label: hidden settings: - view_mode: az_large link: false third_party_settings: { } - weight: 2 + weight: 15 region: content - field_az_modality: - type: entity_reference_label + field_az_opportunity_location: + type: string label: hidden settings: - link: false + link_to_entity: false third_party_settings: { } - weight: 10 + weight: 4 region: content - field_az_offered: - type: entity_reference_label + field_az_opportunity_type: + type: entity_reference_entity_view label: hidden settings: + view_mode: az_badge link: false third_party_settings: { } - weight: 15 + weight: 3 region: content - field_az_opportunity_type: - type: entity_reference_label + field_az_parent_account: + type: string label: hidden settings: - link: true + link_to_entity: false third_party_settings: { } - weight: 5 + weight: 6 region: content field_az_program_date: type: daterange_default @@ -514,7 +500,7 @@ content: settings: link_to_entity: false third_party_settings: { } - weight: 10 + weight: 5 region: content field_az_program_website: type: link @@ -535,16 +521,15 @@ content: view_mode: az_badge link: false third_party_settings: { } - weight: 2 + weight: 4 region: content links: settings: { } third_party_settings: { } - weight: 7 + weight: 6 region: content hidden: field_az_ongoing: true - field_az_parent_account: true field_az_trellis_id: true field_az_trellis_imported_date: true smart_title: true diff --git a/modules/custom/az_opportunity/config/install/core.entity_view_display.taxonomy_term.az_opportunity_modality.default.yml b/modules/custom/az_opportunity/config/install/core.entity_view_display.taxonomy_term.az_opportunity_modality.default.yml new file mode 100644 index 0000000000..9e0c0656e8 --- /dev/null +++ b/modules/custom/az_opportunity/config/install/core.entity_view_display.taxonomy_term.az_opportunity_modality.default.yml @@ -0,0 +1,26 @@ +langcode: en +status: true +dependencies: + config: + - taxonomy.vocabulary.az_opportunity_modality + module: + - smart_title +third_party_settings: + smart_title: + enabled: true + settings: + smart_title__link: false + smart_title__tag: div + smart_title__classes: { } +id: taxonomy_term.az_opportunity_modality.default +targetEntityType: taxonomy_term +bundle: az_opportunity_modality +mode: default +content: + smart_title: + settings: { } + third_party_settings: { } + weight: 0 + region: content +hidden: + description: true diff --git a/modules/custom/az_opportunity/config/install/core.entity_view_display.taxonomy_term.az_opportunity_type.az_badge.yml b/modules/custom/az_opportunity/config/install/core.entity_view_display.taxonomy_term.az_opportunity_type.az_badge.yml new file mode 100644 index 0000000000..0957cf4930 --- /dev/null +++ b/modules/custom/az_opportunity/config/install/core.entity_view_display.taxonomy_term.az_opportunity_type.az_badge.yml @@ -0,0 +1,45 @@ +langcode: en +status: true +dependencies: + config: + - core.entity_view_mode.taxonomy_term.az_badge + - taxonomy.vocabulary.az_opportunity_type + module: + - field_group + - smart_title +third_party_settings: + field_group: + group_opportunity_type_badge: + children: + - smart_title + label: 'Opportunity Type Badge' + parent_name: '' + region: content + weight: 0 + format_type: link + format_settings: + classes: 'badge text-bg-warm-gray badge-link d-inline-block' + show_empty_fields: false + id: '' + label_as_html: false + target: entity + custom_uri: '' + target_attribute: default + smart_title: + enabled: true + settings: + smart_title__link: false + smart_title__tag: div + smart_title__classes: { } +id: taxonomy_term.az_opportunity_type.az_badge +targetEntityType: taxonomy_term +bundle: az_opportunity_type +mode: az_badge +content: + smart_title: + settings: { } + third_party_settings: { } + weight: 0 + region: content +hidden: + description: true diff --git a/modules/custom/az_opportunity/config/install/core.entity_view_display.taxonomy_term.az_opportunity_type.default.yml b/modules/custom/az_opportunity/config/install/core.entity_view_display.taxonomy_term.az_opportunity_type.default.yml new file mode 100644 index 0000000000..ec32b71904 --- /dev/null +++ b/modules/custom/az_opportunity/config/install/core.entity_view_display.taxonomy_term.az_opportunity_type.default.yml @@ -0,0 +1,20 @@ +langcode: en +status: true +dependencies: + config: + - taxonomy.vocabulary.az_opportunity_type + module: + - text +id: taxonomy_term.az_opportunity_type.default +targetEntityType: taxonomy_term +bundle: az_opportunity_type +mode: default +content: + description: + type: text_default + label: hidden + settings: { } + third_party_settings: { } + weight: 0 + region: content +hidden: { } diff --git a/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_attachments.yml b/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_attachments.yml index f5bcb12f1f..f7bcb871e6 100644 --- a/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_attachments.yml +++ b/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_attachments.yml @@ -1,26 +1 @@ -langcode: en -status: true -dependencies: - config: - - field.storage.node.field_az_attachments - - node.type.az_opportunity - module: - - file -id: node.az_opportunity.field_az_attachments -field_name: field_az_attachments -entity_type: node -bundle: az_opportunity -label: Attachments -description: '' -required: false -translatable: false -default_value: { } -default_value_callback: '' -settings: - handler: 'default:file' - handler_settings: { } - file_directory: documents - file_extensions: pdf - max_filesize: '10 MB' - description_field: true -field_type: file +{ } \ No newline at end of file diff --git a/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_location.yml b/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_location.yml index 99b5d34ab4..f7bcb871e6 100644 --- a/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_location.yml +++ b/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_location.yml @@ -1,27 +1 @@ -langcode: en -status: true -dependencies: - config: - - field.storage.node.field_az_location - - node.type.az_opportunity - module: - - link -id: node.az_opportunity.field_az_location -field_name: field_az_location -entity_type: node -bundle: az_opportunity -label: Where -description: "To link to an online map for the location, enter a URL above.
\r\nOtherwise, enter <nolink> in the URL field and enter the location name or address in the Link text field.
\r\nCampus Map: https://map.arizona.edu
\r\nGoogle Maps: https://maps.google.com" -required: false -translatable: false -default_value: - - - attributes: { } - uri: 'route:' - title: '' - options: { } -default_value_callback: '' -settings: - title: 1 - link_type: 17 -field_type: link +{ } \ No newline at end of file diff --git a/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_media_image.yml b/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_media_image.yml index d58ab01079..f7bcb871e6 100644 --- a/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_media_image.yml +++ b/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_media_image.yml @@ -1,28 +1 @@ -langcode: en -status: true -dependencies: - config: - - field.storage.node.field_az_media_image - - media.type.az_image - - node.type.az_opportunity -id: node.az_opportunity.field_az_media_image -field_name: field_az_media_image -entity_type: node -bundle: az_opportunity -label: Photo -description: '' -required: false -translatable: false -default_value: { } -default_value_callback: '' -settings: - handler: 'default:media' - handler_settings: - target_bundles: - az_image: az_image - sort: - field: _none - direction: ASC - auto_create: false - auto_create_bundle: '' -field_type: entity_reference +{ } \ No newline at end of file diff --git a/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_opportunity_location.yml b/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_opportunity_location.yml new file mode 100644 index 0000000000..12d07281ec --- /dev/null +++ b/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_opportunity_location.yml @@ -0,0 +1,18 @@ +langcode: en +status: true +dependencies: + config: + - field.storage.node.field_az_opportunity_location + - node.type.az_opportunity +id: node.az_opportunity.field_az_opportunity_location +field_name: field_az_opportunity_location +entity_type: node +bundle: az_opportunity +label: Location +description: '' +required: false +translatable: false +default_value: { } +default_value_callback: '' +settings: { } +field_type: string diff --git a/modules/custom/az_opportunity/config/install/field.storage.node.field_az_opportunity_location.yml b/modules/custom/az_opportunity/config/install/field.storage.node.field_az_opportunity_location.yml new file mode 100644 index 0000000000..846023a19b --- /dev/null +++ b/modules/custom/az_opportunity/config/install/field.storage.node.field_az_opportunity_location.yml @@ -0,0 +1,20 @@ +langcode: en +status: true +dependencies: + module: + - node +id: node.field_az_opportunity_location +field_name: field_az_opportunity_location +entity_type: node +type: string +settings: + max_length: 255 + case_sensitive: false + is_ascii: false +module: core +locked: false +cardinality: 1 +translatable: true +indexes: { } +persist_with_no_fields: false +custom_storage: false diff --git a/modules/custom/az_opportunity/config/install/views.view.az_opportunity.yml b/modules/custom/az_opportunity/config/install/views.view.az_opportunity.yml index 0365d93fb8..0c50890274 100644 --- a/modules/custom/az_opportunity/config/install/views.view.az_opportunity.yml +++ b/modules/custom/az_opportunity/config/install/views.view.az_opportunity.yml @@ -9,6 +9,7 @@ dependencies: - taxonomy.vocabulary.az_opportunity_modality - taxonomy.vocabulary.az_opportunity_semester - taxonomy.vocabulary.az_opportunity_topic + - taxonomy.vocabulary.az_opportunity_type module: - datetime - node @@ -145,10 +146,10 @@ display: field_identifier: '' exposed: false arguments: - field_az_topic_target_id: - id: field_az_topic_target_id - table: node__field_az_topic - field: field_az_topic_target_id + field_az_opportunity_type_target_id: + id: field_az_opportunity_type_target_id + table: node__field_az_opportunity_type + field: field_az_opportunity_type_target_id relationship: none group_type: group admin_label: '' @@ -175,10 +176,10 @@ display: specify_validation: true validate: type: 'entity:taxonomy_term' - fail: ignore + fail: 'not found' validate_options: bundles: - az_opportunity_topic: az_opportunity_topic + az_opportunity_type: az_opportunity_type access: false operation: view multiple: 1 From b12e3853bd5c3acd58063f638c54f00a7e33da19 Mon Sep 17 00:00:00 2001 From: Z Saenz Date: Tue, 3 Feb 2026 10:17:32 -0700 Subject: [PATCH 13/59] Fix smart title --- modules/custom/az_core/config/install/smart_title.settings.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/custom/az_core/config/install/smart_title.settings.yml b/modules/custom/az_core/config/install/smart_title.settings.yml index 020faacb01..d6eb0d7055 100644 --- a/modules/custom/az_core/config/install/smart_title.settings.yml +++ b/modules/custom/az_core/config/install/smart_title.settings.yml @@ -9,7 +9,9 @@ smart_title: - 'node:az_publication' - 'taxonomy_term:az_event_categories' - 'taxonomy_term:az_news_tags' + - 'taxonomy_term:az_opportunity_modality' - 'taxonomy_term:az_opportunity_topic' + - 'taxonomy_term:az_opportunity_type' - 'taxonomy_term:az_page_categories' - 'taxonomy_term:az_person_categories' - 'taxonomy_term:az_person_categories_secondary' From c4ce6b7b77d2d2d8b3eaf68d715abdda86d01690 Mon Sep 17 00:00:00 2001 From: Z Saenz Date: Mon, 9 Feb 2026 11:19:18 -0700 Subject: [PATCH 14/59] Fix filters --- ...ew_display.node.az_opportunity.default.yml | 2 +- ...onomy_term.az_opportunity_type.default.yml | 3 +- .../install/views.view.az_opportunity.yml | 800 +++++++++++------- 3 files changed, 510 insertions(+), 295 deletions(-) diff --git a/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.default.yml b/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.default.yml index 427a9d851f..b898b09788 100644 --- a/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.default.yml +++ b/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.default.yml @@ -307,7 +307,7 @@ third_party_settings: format_type: html_element format_settings: classes: '' - show_empty_fields: true + show_empty_fields: false id: '' label_as_html: false element: div diff --git a/modules/custom/az_opportunity/config/install/core.entity_view_display.taxonomy_term.az_opportunity_type.default.yml b/modules/custom/az_opportunity/config/install/core.entity_view_display.taxonomy_term.az_opportunity_type.default.yml index ec32b71904..e12c4d8558 100644 --- a/modules/custom/az_opportunity/config/install/core.entity_view_display.taxonomy_term.az_opportunity_type.default.yml +++ b/modules/custom/az_opportunity/config/install/core.entity_view_display.taxonomy_term.az_opportunity_type.default.yml @@ -17,4 +17,5 @@ content: third_party_settings: { } weight: 0 region: content -hidden: { } +hidden: + smart_title: true diff --git a/modules/custom/az_opportunity/config/install/views.view.az_opportunity.yml b/modules/custom/az_opportunity/config/install/views.view.az_opportunity.yml index 0c50890274..50fa4b2dd9 100644 --- a/modules/custom/az_opportunity/config/install/views.view.az_opportunity.yml +++ b/modules/custom/az_opportunity/config/install/views.view.az_opportunity.yml @@ -11,6 +11,7 @@ dependencies: - taxonomy.vocabulary.az_opportunity_topic - taxonomy.vocabulary.az_opportunity_type module: + - better_exposed_filters - datetime - node - taxonomy @@ -410,12 +411,121 @@ display: - 'user.node_grants:view' - user.permissions tags: { } - block_3: - id: block_3 - display_title: 'Card View' + block_2: + id: block_2 + display_title: 'Card View with Filter' display_plugin: block position: 1 display_options: + exposed_form: + type: bef + options: + submit_button: Apply + reset_button: false + reset_button_label: Reset + exposed_sorts_label: 'Sort by' + expose_sort_order: true + sort_asc_label: Asc + sort_desc_label: Desc + text_input_required: 'Select any filter and click on Apply to see results' + text_input_required_format: az_standard + bef: + general: + autosubmit: false + auto_submit_sort_only: false + autosubmit_breakpoint: '' + autosubmit_exclude_textfield: false + autosubmit_textfield_delay: 500 + autosubmit_textfield_minimum_length: 3 + autosubmit_hide: false + input_required: false + allow_secondary: false + secondary_label: 'Advanced options' + secondary_open: false + reset_button_always_show: false + filter: + title: + plugin_id: default + advanced: + placeholder_text: '' + collapsible: false + collapsible_disable_automatic_open: false + open_by_default: false + is_secondary: false + hide_label: false + field_classes: '' + sort_options_unsupported: '' + field_az_location_options: + plugin_id: default + advanced: + placeholder_text: '' + collapsible: false + collapsible_disable_automatic_open: false + open_by_default: false + is_secondary: false + hide_label: false + field_classes: '' + sort_options_unsupported: '' + field_az_topic_target_id: + plugin_id: default + advanced: + sort_options: false + sort_options_method: alphabetical_asc + sort_options_natural: true + rewrite: + filter_rewrite_values: '' + filter_rewrite_values_key: false + collapsible: false + collapsible_disable_automatic_open: false + open_by_default: false + is_secondary: false + hide_label: false + field_classes: '' + field_az_modality_target_id: + plugin_id: default + advanced: + sort_options: false + sort_options_method: alphabetical_asc + sort_options_natural: true + rewrite: + filter_rewrite_values: '' + filter_rewrite_values_key: false + collapsible: false + collapsible_disable_automatic_open: false + open_by_default: false + is_secondary: false + hide_label: false + field_classes: '' + field_az_offered_target_id: + plugin_id: default + advanced: + sort_options: false + sort_options_method: alphabetical_asc + sort_options_natural: true + rewrite: + filter_rewrite_values: '' + filter_rewrite_values_key: false + collapsible: false + collapsible_disable_automatic_open: false + open_by_default: false + is_secondary: false + hide_label: false + field_classes: '' + field_az_incentives_value: + plugin_id: default + advanced: + sort_options: false + sort_options_method: alphabetical_asc + sort_options_natural: true + rewrite: + filter_rewrite_values: '' + filter_rewrite_values_key: false + collapsible: false + collapsible_disable_automatic_open: false + open_by_default: false + is_secondary: false + hide_label: false + field_classes: '' filters: status: id: status @@ -438,32 +548,35 @@ display: value: az_opportunity: az_opportunity group: 1 - field_az_ongoing_value: - id: field_az_ongoing_value - table: node__field_az_ongoing - field: field_az_ongoing_value + title: + id: title + table: node_field_data + field: title relationship: none group_type: group admin_label: '' - plugin_id: boolean - operator: '=' - value: '1' - group: 2 - exposed: false + entity_type: node + entity_field: title + plugin_id: string + operator: contains + value: '' + group: 1 + exposed: true expose: - operator_id: '' - label: '' + operator_id: title_op + label: Title description: '' use_operator: false - operator: '' + operator: title_op operator_limit_selection: false operator_list: { } - identifier: '' + identifier: title required: false remember: false multiple: false remember_roles: authenticated: authenticated + placeholder: '' is_grouped: false group_info: label: '' @@ -476,38 +589,32 @@ display: default_group: All default_group_multiple: { } group_items: { } - field_az_application_date_end_value: - id: field_az_application_date_end_value - table: node__field_az_application_date - field: field_az_application_date_end_value + field_az_location_options: + id: field_az_location_options + table: node__field_az_location + field: field_az_location_options relationship: none group_type: group admin_label: '' - plugin_id: datetime - operator: '>=' - value: - min: '' - max: '' - value: now - type: offset - group: 2 - exposed: false + plugin_id: string + operator: contains + value: '' + group: 1 + exposed: true expose: - operator_id: '' - label: '' + operator_id: field_az_location_options_op + label: Where description: '' use_operator: false - operator: '' + operator: field_az_location_options_op operator_limit_selection: false operator_list: { } - identifier: '' + identifier: field_az_location_options required: false remember: false multiple: false remember_roles: authenticated: authenticated - min_placeholder: '' - max_placeholder: '' placeholder: '' is_grouped: false group_info: @@ -521,81 +628,33 @@ display: default_group: All default_group_multiple: { } group_items: { } - granularity: day - filter_groups: - operator: AND - groups: - 1: AND - 2: OR - defaults: - filters: false - filter_groups: false - display_description: '' - display_extenders: { } - cache_metadata: - max-age: -1 - contexts: - - 'languages:language_content' - - 'languages:language_interface' - - url - - url.query_args - - 'user.node_grants:view' - - user.permissions - tags: { } - block_4: - id: block_4 - display_title: 'Row View' - display_plugin: block - position: 1 - display_options: - filters: - status: - id: status - table: node_field_data - field: status - entity_type: node - entity_field: status - plugin_id: boolean - value: '1' - group: 1 - expose: - operator: '' - type: - id: type - table: node_field_data - field: type - entity_type: node - entity_field: type - plugin_id: bundle - value: - az_opportunity: az_opportunity - group: 1 - field_az_ongoing_value: - id: field_az_ongoing_value - table: node__field_az_ongoing - field: field_az_ongoing_value + field_az_topic_target_id: + id: field_az_topic_target_id + table: node__field_az_topic + field: field_az_topic_target_id relationship: none group_type: group admin_label: '' - plugin_id: boolean - operator: '=' - value: '1' - group: 2 - exposed: false + plugin_id: taxonomy_index_tid + operator: or + value: { } + group: 1 + exposed: true expose: - operator_id: '' - label: '' + operator_id: field_az_topic_target_id_op + label: Topic description: '' use_operator: false - operator: '' + operator: field_az_topic_target_id_op operator_limit_selection: false operator_list: { } - identifier: '' + identifier: field_az_topic_target_id required: false remember: false multiple: false remember_roles: authenticated: authenticated + reduce: false is_grouped: false group_info: label: '' @@ -608,39 +667,39 @@ display: default_group: All default_group_multiple: { } group_items: { } - field_az_application_date_end_value: - id: field_az_application_date_end_value - table: node__field_az_application_date - field: field_az_application_date_end_value + reduce_duplicates: false + vid: az_opportunity_topic + type: select + hierarchy: false + limit: true + error_message: true + field_az_modality_target_id: + id: field_az_modality_target_id + table: node__field_az_modality + field: field_az_modality_target_id relationship: none group_type: group admin_label: '' - plugin_id: datetime - operator: '>=' - value: - min: '' - max: '' - value: now - type: offset - group: 2 - exposed: false + plugin_id: taxonomy_index_tid + operator: or + value: { } + group: 1 + exposed: true expose: - operator_id: '' - label: '' + operator_id: field_az_modality_target_id_op + label: Modality description: '' use_operator: false - operator: '' + operator: field_az_modality_target_id_op operator_limit_selection: false operator_list: { } - identifier: '' + identifier: field_az_modality_target_id required: false remember: false multiple: false remember_roles: authenticated: authenticated - min_placeholder: '' - max_placeholder: '' - placeholder: '' + reduce: false is_grouped: false group_info: label: '' @@ -653,99 +712,39 @@ display: default_group: All default_group_multiple: { } group_items: { } - granularity: day - filter_groups: - operator: AND - groups: - 1: AND - 2: OR - style: - type: default - options: - row_class: '' - default_row_class: true - uses_fields: false - row: - type: 'entity:node' - options: - relationship: none - view_mode: az_row - defaults: - style: false - style_options: false - row: false - filters: false - filter_groups: false - display_description: '' - style_options: null - display_extenders: { } - cache_metadata: - max-age: -1 - contexts: - - 'languages:language_content' - - 'languages:language_interface' - - url - - url.query_args - - 'user.node_grants:view' - - user.permissions - tags: { } - block_5: - id: block_5 - display_title: 'Rows View with Filter' - display_plugin: block - position: 1 - display_options: - filters: - status: - id: status - table: node_field_data - field: status - entity_type: node - entity_field: status - plugin_id: boolean - value: '1' - group: 1 - expose: - operator: '' - type: - id: type - table: node_field_data - field: type - entity_type: node - entity_field: type - plugin_id: bundle - value: - az_opportunity: az_opportunity - group: 1 - title: - id: title - table: node_field_data - field: title + reduce_duplicates: false + vid: az_opportunity_modality + type: select + hierarchy: false + limit: true + error_message: true + field_az_offered_target_id: + id: field_az_offered_target_id + table: node__field_az_offered + field: field_az_offered_target_id relationship: none group_type: group admin_label: '' - entity_type: node - entity_field: title - plugin_id: string - operator: '=' - value: '' + plugin_id: taxonomy_index_tid + operator: or + value: { } group: 1 exposed: true expose: - operator_id: title_op - label: Title + operator_id: field_az_offered_target_id_op + label: Offered description: '' use_operator: false - operator: title_op + operator: field_az_offered_target_id_op operator_limit_selection: false operator_list: { } - identifier: title + identifier: field_az_offered_target_id required: false remember: false multiple: false remember_roles: authenticated: authenticated - placeholder: '' + reduce: false is_grouped: false group_info: label: '' @@ -758,33 +757,38 @@ display: default_group: All default_group_multiple: { } group_items: { } - field_az_location_options: - id: field_az_location_options - table: node__field_az_location - field: field_az_location_options + reduce_duplicates: false + vid: az_opportunity_semester + type: select + hierarchy: false + limit: true + error_message: true + field_az_incentives_value: + id: field_az_incentives_value + table: node__field_az_incentives + field: field_az_incentives_value relationship: none group_type: group admin_label: '' - plugin_id: string + plugin_id: boolean operator: '=' - value: '' + value: All group: 1 exposed: true expose: - operator_id: field_az_location_options_op - label: Where + operator_id: '' + label: Incentives description: '' use_operator: false - operator: field_az_location_options_op + operator: field_az_incentives_value_op operator_limit_selection: false operator_list: { } - identifier: field_az_location_options + identifier: field_az_incentives_value required: false remember: false multiple: false remember_roles: authenticated: authenticated - placeholder: '' is_grouped: false group_info: label: '' @@ -797,33 +801,32 @@ display: default_group: All default_group_multiple: { } group_items: { } - field_az_topic_target_id: - id: field_az_topic_target_id - table: node__field_az_topic - field: field_az_topic_target_id + field_az_ongoing_value: + id: field_az_ongoing_value + table: node__field_az_ongoing + field: field_az_ongoing_value relationship: none group_type: group admin_label: '' - plugin_id: taxonomy_index_tid - operator: or - value: { } - group: 1 - exposed: true - expose: - operator_id: field_az_topic_target_id_op - label: Topic + plugin_id: boolean + operator: '=' + value: '1' + group: 2 + exposed: false + expose: + operator_id: '' + label: '' description: '' use_operator: false - operator: field_az_topic_target_id_op + operator: '' operator_limit_selection: false operator_list: { } - identifier: field_az_topic_target_id + identifier: '' required: false remember: false multiple: false remember_roles: authenticated: authenticated - reduce: false is_grouped: false group_info: label: '' @@ -836,39 +839,39 @@ display: default_group: All default_group_multiple: { } group_items: { } - reduce_duplicates: false - vid: az_opportunity_topic - type: select - hierarchy: false - limit: true - error_message: true - field_az_modality_target_id: - id: field_az_modality_target_id - table: node__field_az_modality - field: field_az_modality_target_id + field_az_application_date_end_value: + id: field_az_application_date_end_value + table: node__field_az_application_date + field: field_az_application_date_end_value relationship: none group_type: group admin_label: '' - plugin_id: taxonomy_index_tid - operator: or - value: { } - group: 1 - exposed: true + plugin_id: datetime + operator: '>=' + value: + min: '' + max: '' + value: now + type: offset + group: 2 + exposed: false expose: - operator_id: field_az_modality_target_id_op - label: Modality + operator_id: '' + label: '' description: '' use_operator: false - operator: field_az_modality_target_id_op + operator: '' operator_limit_selection: false operator_list: { } - identifier: field_az_modality_target_id + identifier: '' required: false remember: false multiple: false remember_roles: authenticated: authenticated - reduce: false + min_placeholder: '' + max_placeholder: '' + placeholder: '' is_grouped: false group_info: label: '' @@ -881,39 +884,97 @@ display: default_group: All default_group_multiple: { } group_items: { } - reduce_duplicates: false - vid: az_opportunity_modality - type: select - hierarchy: false - limit: true - error_message: true - field_az_offered_target_id: - id: field_az_offered_target_id - table: node__field_az_offered - field: field_az_offered_target_id + granularity: day + filter_groups: + operator: AND + groups: + 1: AND + 2: OR + style: + type: default + options: + row_class: '' + default_row_class: true + uses_fields: false + row: + type: 'entity:node' + options: + relationship: none + view_mode: az_card + defaults: + exposed_form: false + style: false + style_options: false + row: false + filters: false + filter_groups: false + display_description: '' + style_options: null + display_extenders: { } + cache_metadata: + max-age: -1 + contexts: + - 'languages:language_content' + - 'languages:language_interface' + - url + - url.query_args + - 'user.node_grants:view' + - user.permissions + tags: { } + block_3: + id: block_3 + display_title: 'Card View' + display_plugin: block + position: 1 + display_options: + filters: + status: + id: status + table: node_field_data + field: status + entity_type: node + entity_field: status + plugin_id: boolean + value: '1' + group: 1 + expose: + operator: '' + type: + id: type + table: node_field_data + field: type + entity_type: node + entity_field: type + plugin_id: bundle + value: + az_opportunity: az_opportunity + group: 1 + field_az_ongoing_value: + id: field_az_ongoing_value + table: node__field_az_ongoing + field: field_az_ongoing_value relationship: none group_type: group admin_label: '' - plugin_id: taxonomy_index_tid - operator: or - value: { } - group: 1 - exposed: true + plugin_id: boolean + operator: '=' + value: '1' + group: 2 + exposed: false expose: - operator_id: field_az_offered_target_id_op - label: Offered + operator_id: '' + label: '' description: '' use_operator: false - operator: field_az_offered_target_id_op + operator: '' operator_limit_selection: false operator_list: { } - identifier: field_az_offered_target_id + identifier: '' required: false remember: false multiple: false remember_roles: authenticated: authenticated - reduce: false is_grouped: false group_info: label: '' @@ -926,38 +987,39 @@ display: default_group: All default_group_multiple: { } group_items: { } - reduce_duplicates: false - vid: az_opportunity_semester - type: select - hierarchy: false - limit: true - error_message: true - field_az_incentives_value: - id: field_az_incentives_value - table: node__field_az_incentives - field: field_az_incentives_value + field_az_application_date_end_value: + id: field_az_application_date_end_value + table: node__field_az_application_date + field: field_az_application_date_end_value relationship: none group_type: group admin_label: '' - plugin_id: boolean - operator: '=' - value: All - group: 1 - exposed: true + plugin_id: datetime + operator: '>=' + value: + min: '' + max: '' + value: now + type: offset + group: 2 + exposed: false expose: operator_id: '' - label: Incentives + label: '' description: '' use_operator: false - operator: field_az_incentives_value_op + operator: '' operator_limit_selection: false operator_list: { } - identifier: field_az_incentives_value + identifier: '' required: false remember: false multiple: false remember_roles: authenticated: authenticated + min_placeholder: '' + max_placeholder: '' + placeholder: '' is_grouped: false group_info: label: '' @@ -970,6 +1032,55 @@ display: default_group: All default_group_multiple: { } group_items: { } + granularity: day + filter_groups: + operator: AND + groups: + 1: AND + 2: OR + defaults: + filters: false + filter_groups: false + display_description: '' + display_extenders: { } + cache_metadata: + max-age: -1 + contexts: + - 'languages:language_content' + - 'languages:language_interface' + - url + - url.query_args + - 'user.node_grants:view' + - user.permissions + tags: { } + block_4: + id: block_4 + display_title: 'Row View' + display_plugin: block + position: 1 + display_options: + filters: + status: + id: status + table: node_field_data + field: status + entity_type: node + entity_field: status + plugin_id: boolean + value: '1' + group: 1 + expose: + operator: '' + type: + id: type + table: node_field_data + field: type + entity_type: node + entity_field: type + plugin_id: bundle + value: + az_opportunity: az_opportunity + group: 1 field_az_ongoing_value: id: field_az_ongoing_value table: node__field_az_ongoing @@ -1089,12 +1200,121 @@ display: - 'user.node_grants:view' - user.permissions tags: { } - block_6: - id: block_6 - display_title: 'Card View with Filter' + block_5: + id: block_5 + display_title: 'Row View with Filter' display_plugin: block position: 1 display_options: + exposed_form: + type: bef + options: + submit_button: Apply + reset_button: false + reset_button_label: Reset + exposed_sorts_label: 'Sort by' + expose_sort_order: true + sort_asc_label: Asc + sort_desc_label: Desc + text_input_required: 'Select any filter and click on Apply to see results' + text_input_required_format: az_standard + bef: + general: + autosubmit: false + auto_submit_sort_only: false + autosubmit_breakpoint: '' + autosubmit_exclude_textfield: false + autosubmit_textfield_delay: 500 + autosubmit_textfield_minimum_length: 3 + autosubmit_hide: false + input_required: false + allow_secondary: false + secondary_label: 'Advanced options' + secondary_open: false + reset_button_always_show: false + filter: + title: + plugin_id: default + advanced: + placeholder_text: '' + collapsible: false + collapsible_disable_automatic_open: false + open_by_default: false + is_secondary: false + hide_label: false + field_classes: '' + sort_options_unsupported: '' + field_az_location_options: + plugin_id: default + advanced: + placeholder_text: '' + collapsible: false + collapsible_disable_automatic_open: false + open_by_default: false + is_secondary: false + hide_label: false + field_classes: '' + sort_options_unsupported: '' + field_az_topic_target_id: + plugin_id: default + advanced: + sort_options: false + sort_options_method: alphabetical_asc + sort_options_natural: true + rewrite: + filter_rewrite_values: '' + filter_rewrite_values_key: false + collapsible: false + collapsible_disable_automatic_open: false + open_by_default: false + is_secondary: false + hide_label: false + field_classes: '' + field_az_modality_target_id: + plugin_id: default + advanced: + sort_options: false + sort_options_method: alphabetical_asc + sort_options_natural: true + rewrite: + filter_rewrite_values: '' + filter_rewrite_values_key: false + collapsible: false + collapsible_disable_automatic_open: false + open_by_default: false + is_secondary: false + hide_label: false + field_classes: '' + field_az_offered_target_id: + plugin_id: default + advanced: + sort_options: false + sort_options_method: alphabetical_asc + sort_options_natural: true + rewrite: + filter_rewrite_values: '' + filter_rewrite_values_key: false + collapsible: false + collapsible_disable_automatic_open: false + open_by_default: false + is_secondary: false + hide_label: false + field_classes: '' + field_az_incentives_value: + plugin_id: default + advanced: + sort_options: false + sort_options_method: alphabetical_asc + sort_options_natural: true + rewrite: + filter_rewrite_values: '' + filter_rewrite_values_key: false + collapsible: false + collapsible_disable_automatic_open: false + open_by_default: false + is_secondary: false + hide_label: false + field_classes: '' filters: status: id: status @@ -1127,7 +1347,7 @@ display: entity_type: node entity_field: title plugin_id: string - operator: '=' + operator: contains value: '' group: 1 exposed: true @@ -1166,7 +1386,7 @@ display: group_type: group admin_label: '' plugin_id: string - operator: '=' + operator: contains value: '' group: 1 exposed: true @@ -1460,24 +1680,18 @@ display: 1: AND 2: OR style: - type: views_bootstrap_grid + type: default options: row_class: '' default_row_class: true uses_fields: false - grid_class: '' - col_xs: col-1 - col_sm: col-sm-1 - col_md: col-md-4 - col_lg: col-lg-4 - col_xl: col-xl-4 - col_xxl: col-xxl-4 row: type: 'entity:node' options: relationship: none - view_mode: az_card + view_mode: az_row defaults: + exposed_form: false style: false style_options: false row: false From c42b5bfc9e3396ea1e1e06d164ff3be2272ad4e9 Mon Sep 17 00:00:00 2001 From: Z Saenz Date: Tue, 10 Feb 2026 16:39:32 -0700 Subject: [PATCH 15/59] Removes trellis type for use with another PR --- .../az_opportunity_trellis.info.yml | 21 - .../az_opportunity_trellis.install | 35 - .../az_opportunity_trellis.libraries.yml | 18 - .../az_opportunity_trellis.links.action.yml | 5 - .../az_opportunity_trellis.links.task.yml | 18 - .../az_opportunity_trellis.module | 161 --- .../az_opportunity_trellis.routing.yml | 47 - .../az_opportunity_trellis.services.yml | 17 - .../az_opportunity_trellis.views.inc | 69 -- .../az_opportunity_trellis.settings.yml | 1 - ..._plus.migration.az_trellis_opportunity.yml | 114 -- ...migration_group.az_trellis_opportunity.yml | 11 - ....cron_migration.az_opportunity_trellis.yml | 13 - ...ews.view.az_opportunity_trellis_import.yml | 1053 ----------------- .../schema/az_opportunity_trellis.schema.yml | 39 - .../az_opportunity_trellis_datewrapper.css | 3 - .../js/az_opportunity_trellis_date.js | 27 - .../az_trellis_opportunity_files.yml | 42 - .../az_trellis_opportunity_media.yml | 56 - .../src/AZRecurringImportRuleInterface.php | 30 - .../src/AZRecurringImportRuleListBuilder.php | 56 - .../AZRecurringImportModalController.php | 101 -- .../src/Entity/AZRecurringImportRule.php | 124 -- .../AZOpportunityTrellisDataSubscriber.php | 157 --- .../src/Form/AZRecurringImportRuleForm.php | 185 --- .../Form/TrellisOpportunitySettingsForm.php | 53 - .../source/AZTrellisOpportunitySource.php | 144 --- .../field/AZOpportunityTrellisViewsField.php | 160 --- ...ZOpportunityTrellisViewsApprovalFilter.php | 96 -- .../AZOpportunityTrellisViewsDateFilter.php | 289 ----- ...portunityTrellisViewsOpportunityTypeFilter | 170 --- .../src/TrellisHelper.php | 314 ----- 32 files changed, 3629 deletions(-) delete mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.info.yml delete mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.install delete mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.libraries.yml delete mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.links.action.yml delete mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.links.task.yml delete mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.module delete mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.routing.yml delete mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.services.yml delete mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.views.inc delete mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/config/install/az_opportunity_trellis.settings.yml delete mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/config/install/migrate_plus.migration.az_trellis_opportunity.yml delete mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/config/install/migrate_plus.migration_group.az_trellis_opportunity.yml delete mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/config/install/migrate_queue_importer.cron_migration.az_opportunity_trellis.yml delete mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/config/install/views.view.az_opportunity_trellis_import.yml delete mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/config/schema/az_opportunity_trellis.schema.yml delete mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/css/az_opportunity_trellis_datewrapper.css delete mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/js/az_opportunity_trellis_date.js delete mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/migrations/az_trellis_opportunity_files.yml delete mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/migrations/az_trellis_opportunity_media.yml delete mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/src/AZRecurringImportRuleInterface.php delete mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/src/AZRecurringImportRuleListBuilder.php delete mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/src/Controller/AZRecurringImportModalController.php delete mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/src/Entity/AZRecurringImportRule.php delete mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/src/EventSubscriber/AZOpportunityTrellisDataSubscriber.php delete mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/src/Form/AZRecurringImportRuleForm.php delete mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/src/Form/TrellisOpportunitySettingsForm.php delete mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/src/Plugin/migrate/source/AZTrellisOpportunitySource.php delete mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/src/Plugin/views/field/AZOpportunityTrellisViewsField.php delete mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/src/Plugin/views/filter/AZOpportunityTrellisViewsApprovalFilter.php delete mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/src/Plugin/views/filter/AZOpportunityTrellisViewsDateFilter.php delete mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/src/Plugin/views/filter/AZOpportunityTrellisViewsOpportunityTypeFilter delete mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/src/TrellisHelper.php diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.info.yml b/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.info.yml deleted file mode 100644 index 3748a260a9..0000000000 --- a/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.info.yml +++ /dev/null @@ -1,21 +0,0 @@ -name: Quickstart Opportunity - Trellis Importer -type: module -description: 'Import opportunities from Trellis Progrmas, the official University of Arizona programs management tool.' -core_version_requirement: ^10 || ^11 || ^12 -package: 'The University of Arizona - Experimental' -lifecycle: experimental -lifecycle_link: 'https://github.com/az-digital/az_quickstart/blob/main/RELEASES.md#experimental-features' -php: 8.0 - -dependencies: - - az_core:az_core - - az_opportunity:az_opportunity - - az_migration:az_migration_remote - - drupal:views - - drupal:migrate - - migrate_plus:migrate_plus - - migrate_tools:migrate_tools - - migrate_queue_importer:migrate_queue_importer - - views_remote_data:views_remote_data - -configure: az_opportunity_trellis.settings \ No newline at end of file diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.install b/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.install deleted file mode 100644 index 9e2cd74a19..0000000000 --- a/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.install +++ /dev/null @@ -1,35 +0,0 @@ -install(['views_remote_data']); -} - -/** - * Ensure az_recurring_import_rule entity type is installed. - */ -function az_opportunity_trellis_update_1021001() { - $changes = \Drupal::entityDefinitionUpdateManager()->getChangeList(); - $status = $changes['az_recurring_import_rule']['entity_type'] ?? ''; - // Determine if recurring import rule entity needs to be created. - if ($status === EntityDefinitionUpdateManagerInterface::DEFINITION_CREATED) { - $entity_type_definition = \Drupal::service('entity_type.manager')->getDefinition('az_recurring_import_rule'); - \Drupal::entityDefinitionUpdateManager()->installEntityType($entity_type_definition); - } -} - -/** - * Ensure az_migration_remote is installed. - */ -function az_opportunity_trellis_update_1021301() { - \Drupal::service('module_installer')->install(['az_migration_remote']); -} diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.libraries.yml b/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.libraries.yml deleted file mode 100644 index 02849af8d1..0000000000 --- a/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.libraries.yml +++ /dev/null @@ -1,18 +0,0 @@ -az_opportunity_trellis_date: - js: - js/az_opportunity_trellis_date.js: {} - css: - theme: - css/az_opportunity_trellis_datewrapper.css: {} - dependencies: - - core/drupal - - core/drupalSettings - - core/once - - az_opportunity_trellis/easepick_bundle -easepick_bundle: - js: - /libraries/easepick--bundle/dist/index.umd.js: { minified: true } -easepick_styles: - css: - theme: - /libraries/easepick--bundle/dist/index.css: { minified: true } diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.links.action.yml b/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.links.action.yml deleted file mode 100644 index 2fbeb0bbfe..0000000000 --- a/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.links.action.yml +++ /dev/null @@ -1,5 +0,0 @@ -entity.az_recurring_import_rule.add_form: - route_name: 'entity.az_recurring_import_rule.add_form' - title: 'Add Recurring Import Rule' - appears_on: - - entity.az_recurring_import_rule.collection diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.links.task.yml b/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.links.task.yml deleted file mode 100644 index d2b3ae045e..0000000000 --- a/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.links.task.yml +++ /dev/null @@ -1,18 +0,0 @@ -az_opportunity_trellis.az_opportunity_trellis_settings_task: - route_name: az_opportunity_trellis.settings - title: 'AZ Trellis Opportunity Importer' - base_route: az_core.az_settings - weight: 0 - -az_opportunity.import_form_task: - title: 'Trellis opportunity importer' - route_name: view.az_opportunity_trellis_import.page_1 - parent_id: system.admin_content - description: 'Import opportunities from the Trellis Opportunity API.' - weight: 101 - -az_opportunity_trellis.az_recurring_import_rules_tab: - route_name: entity.az_recurring_import_rule.collection - title: 'Recurring Imports' - base_route: az_core.az_settings - weight: 5 diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.module b/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.module deleted file mode 100644 index ff4574d5f8..0000000000 --- a/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.module +++ /dev/null @@ -1,161 +0,0 @@ -getFormObject(); - if ($form_object instanceof EntityFormInterface) { - /** @var \Drupal\node\NodeInterface $node */ - $node = $form_object->getEntity(); - $trellis_id = $node->get('field_az_trellis_id')->getString(); - if (!empty($trellis_id)) { - $trellis_link_url = TrellisHelper::$opportunityViewBasePath . $trellis_id . '/view'; - $trellis_warning = t('This opportunity has been imported from Trellis Programs. Opportunity details can only be edited by a Trellis user in Trellis Programs.', [ - '@trellis-url' => $trellis_link_url, - ]); - \Drupal::messenger()->addWarning($trellis_warning); - - $disabled_fields = [ - 'title', - 'field_az_application_date', - 'field_az_application_link', - 'field_az_audiences', - 'field_az_credit', - 'field_az_incentives', - 'field_az_modality', - 'field_az_offered', - 'field_az_ongoing', - 'field_az_opportunity_type', - 'field_az_media_image', - 'field_az_program_date', - 'field_az_program_length', - 'field_az_program_website', - 'field_az_topic', - 'field_az_location' - ]; - foreach ($disabled_fields as $field) { - $form[$field]['#disabled'] = TRUE; - } - - $no_access_fields = [ - 'field_az_body', - ]; - foreach ($no_access_fields as $field) { - $form[$field]['#access'] = FALSE; - } - } - } -} - -/** - * Gather exposed API parameters from view. - * - * @param mixed $form - * An associative array containing the structure of the form. - * @param \Drupal\Core\Form\FormStateInterface $form_state - * The current state of the form. - * - * @return array - * The remote API search values. - */ -function az_opportunity_trellis_gather_filter_options(&$form, FormStateInterface $form_state) { - $search = []; - /** @var \Drupal\views\ViewExecutable $view */ - $view = $form_state->get('view'); - // Consult the filter handlers of the view. - if (!empty($view->filter)) { - /** @var \Drupal\views\Plugin\views\ViewsHandlerInterface[] $handlers */ - $handlers = $view->filter; - // Get exposed search information. - $input = $view->getExposedInput(); - if (empty($input)) { - return []; - } - // Loops through handlers to find inputs we want. - /** @var \Drupal\views\Plugin\views\filter\FilterPluginBase $handler */ - foreach ($handlers as $handler) { - if ($handler->isExposed()) { - $info = $handler->exposedInfo(); - $identifier = $info['value'] ?? ''; - // Make sure our input for this exposed filter isn't NULL. - // This won't normally happen in an actual GET form. - if (!isset($input[$identifier])) { - $input[$identifier] = ''; - } - // Check if the handler validates versus the input. - if ($handler->acceptExposedInput($input)) { - // If the handler accepts the input, bundle it up. - $value = $input[$identifier] ?? ''; - if (!empty($identifier) && !empty($value)) { - if ($handler instanceof AZOpportunityTrellisViewsAttributeFilter) { - // Attributes handled separately since they are from a remote API. - $search['attributes'][$identifier] = $value; - } - else { - $search[$identifier] = $value; - } - } - } - } - } - } - // Don't return id or date fields, unnecessary for recurring imports. - unset($search['id']); - unset($search['start']); - unset($search['modified']); - return $search; -} - -/** - * Implements hook_form_FORM_ID_alter(). - * - * Add clickable link that opens import configuration modal. - */ -function az_opportunity_trellis_form_views_exposed_form_alter(&$form, FormStateInterface $form_state, $form_id) { - - $view = $form_state->get('view'); - if (($view->id() === 'az_opportunity_trellis_import') && ($view->current_display === 'page_1')) { - - // Don't create configuration link if user does not have permission. - if (!\Drupal::currentUser()->hasPermission('administer quickstart configuration')) { - return; - } - $search = az_opportunity_trellis_gather_filter_options($form, $form_state); - if (!empty($search)) { - // We cannot use an ajax response here to open a dialog. - // Exposed forms do not support ajax callbacks. Cache search parameters. - // Compute cache key of parameters. - $key = 'az_recurring_import_modal:' . Crypt::hashBase64(serialize($search)); - $expire = time() + 1200; - // Cache the search. - \Drupal::service('cache.default')->set($key, $search, $expire); - $form['#attached']['library'][] = 'core/drupal.dialog.ajax'; - // Add a link to open the modal. - $form['actions']['recurring'] = [ - '#type' => 'link', - '#title' => t('Create Recurring Import'), - '#url' => Url::fromRoute('entity.az_recurring_import_rule.modal'), - // Pass the search parameters cache key as an argument. - '#options' => ['query' => ['search' => $key]], - '#attributes' => ['class' => ['use-ajax', 'button']], - ]; - } - } -} diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.routing.yml b/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.routing.yml deleted file mode 100644 index 607ac65714..0000000000 --- a/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.routing.yml +++ /dev/null @@ -1,47 +0,0 @@ -az_opportunity_trellis.settings: - path: '/admin/config/az-quickstart/settings/az-opportunity-trellis' - defaults: - _form: '\Drupal\az_opportunity_trellis\Form\TrellisOpportunitySettingsForm' - _title: 'Trellis Opportunity Importer Settings' - requirements: - _permission: 'administer quickstart configuration' - -entity.az_recurring_import_rule.collection: - path: '/admin/config/az-quickstart/settings/az-recurring-import-rule' - defaults: - _entity_list: 'az_recurring_import_rule' - _title: 'Recurring Import Rule configuration' - requirements: - _permission: 'administer quickstart configuration' - -entity.az_recurring_import_rule.add_form: - path: '/admin/config/az-quickstart/settings/az-recurring-import-rule/add' - defaults: - _entity_form: 'az_recurring_import_rule.add' - _title: 'Add a recurring import rule' - requirements: - _permission: 'administer quickstart configuration' - -entity.az_recurring_import_rule.edit_form: - path: '/admin/config/az-quickstart/settings/az-recurring-import-rule/{az_recurring_import_rule}' - defaults: - _entity_form: 'az_recurring_import_rule.edit' - _title: 'Edit a recurring import rule' - requirements: - _permission: 'administer quickstart configuration' - -entity.az_recurring_import_rule.delete_form: - path: '/admin/config/az-quickstart/settings/az-recurring-import-rule/{az_recurring_import_rule}/delete' - defaults: - _entity_form: 'az_recurring_import_rule.delete' - _title: 'Delete a recurring import rule' - requirements: - _permission: 'administer quickstart configuration' - -entity.az_recurring_import_rule.modal: - path: '/admin/az-opportunity-trellis-modal' - defaults: - _title: 'Entity Az Recurring Import Rule Modal' - _controller: '\Drupal\az_opportunity_trellis\Controller\AZRecurringImportModalController' - requirements: - _permission: 'administer quickstart configuration' diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.services.yml b/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.services.yml deleted file mode 100644 index 9e8f99e1a6..0000000000 --- a/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.services.yml +++ /dev/null @@ -1,17 +0,0 @@ -services: - _defaults: - autoconfigure: true - az_opportunity_trellis.trellis_helper: - class: Drupal\az_opportunity_trellis\TrellisHelper - arguments: - - '@config.factory' - - '@http_client' - - '@cache.default' - - '@entity_type.manager' - az_opportunity_trellis.trellis_opportunity_data: - class: Drupal\az_opportunity_trellis\OpportunitySubscriber\AZOpportunityTrellisDataSubscriber - arguments: - - '@az_opportunity_trellis.trellis_helper' - - '@messenger' - - '@entity_type.manager' - - '@current_user' diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.views.inc b/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.views.inc deleted file mode 100644 index af8c004b45..0000000000 --- a/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.views.inc +++ /dev/null @@ -1,69 +0,0 @@ - t('Trellis Opportunities'), - 'query_id' => 'views_remote_data_query', - ]; - $data['az_opportunity_trellis_data']['Id'] = [ - 'title' => t('Trellis Opportunity ID'), - 'help' => t('Unique key of Trellis opportunity.'), - 'field' => [ - 'id' => 'az_opportunity_trellis_views_field', - ], - ]; - $data['az_opportunity_trellis_data']['Last_Modified_Date'] = [ - 'title' => t('Trellis opportunity modification time'), - 'help' => t('Time of the Trellis opportunity was last modified'), - 'field' => [ - 'id' => 'date', - ], - ]; - $data['az_opportunity_trellis_data']['Start_DateTime'] = [ - 'title' => t('Trellis opportunity start time'), - 'help' => t('Start time of the Trellis opportunity.'), - 'field' => [ - 'id' => 'date', - ], - ]; - $data['az_opportunity_trellis_data']['End_DateTime'] = [ - 'title' => t('Trellis opportunity end time'), - 'help' => t('End time of the Trellis opportunity.'), - 'field' => [ - 'id' => 'date', - ], - ]; - $data['az_opportunity_trellis_data']['Program_Type'] = [ - 'title' => t('Program type'), - 'help' => t('Trellis opportunity search API program type'), - 'filter' => [ - 'id' => 'az_opportunity_trellis_views_program_type_filter', - ], - ]; - $data['az_opportunity_trellis_data']['Approval'] = [ - 'title' => t('Approval status'), - 'help' => t('Trellis opportunity search API approval status'), - 'filter' => [ - 'id' => 'az_opportunity_trellis_views_approval_filter', - ], - ]; - $data['az_opportunity_trellis_data']['Date'] = [ - 'title' => t('Trellis Date'), - 'help' => t('Trellis opportunity search API dates'), - 'filter' => [ - 'id' => 'az_opportunity_trellis_views_date_filter', - ], - ]; - return $data; -} diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/config/install/az_opportunity_trellis.settings.yml b/modules/custom/az_opportunity/az_opportunity_trellis/config/install/az_opportunity_trellis.settings.yml deleted file mode 100644 index 99487dab9f..0000000000 --- a/modules/custom/az_opportunity/az_opportunity_trellis/config/install/az_opportunity_trellis.settings.yml +++ /dev/null @@ -1 +0,0 @@ -api_hostname: 'api.trellis.arizona.edu' diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/config/install/migrate_plus.migration.az_trellis_opportunity.yml b/modules/custom/az_opportunity/az_opportunity_trellis/config/install/migrate_plus.migration.az_trellis_opportunity.yml deleted file mode 100644 index 88f2f3539e..0000000000 --- a/modules/custom/az_opportunity/az_opportunity_trellis/config/install/migrate_plus.migration.az_trellis_opportunity.yml +++ /dev/null @@ -1,114 +0,0 @@ -langcode: en -status: true -dependencies: { } -id: az_trellis_opportunity -class: null -idMap: { } -field_plugin_method: null -cck_plugin_method: null -migration_tags: - - Opportunity -migration_group: az_trellis_opportunity -label: 'Trellis Opportunity' -source: - plugin: az_trellis_opportunity_api - trellis_ids: { } - track_changes: true - fields: - - - name: id - label: ID - selector: Id - - - name: name - label: Name - selector: Name - - - name: url - label: URL - selector: Branded_Opportunity_URL - - - name: summary - label: Summary - selector: Summary - - - name: owner - label: 'Owner NetID' - selector: Owner_NetID - - - name: timezone - label: 'Time Zone' - selector: tz_name - - - name: start_date_time - label: 'Start Date and Time' - selector: Start_DateTime - - - name: end_date_time - label: 'End Date and Time' - selector: End_DateTime - - - name: image_url - label: 'Image URL' - selector: Image_URL - - - name: publish - label: Publish - selector: Publish_Formula - - - name: format - label: Format - selector: Format - ids: - id: - type: string -process: - title: name - field_az_trellis_id: id - field_az_link/uri: url - field_az_link/title: - - - plugin: default_value - default_value: 'Opportunity details' - field_az_summary: - - - plugin: skip_on_empty - method: process - source: summary - status: - - - plugin: get - source: publish - - - plugin: default_value - strict: true - default_value: 0 - field_az_photos/target_id: - - - plugin: migration_lookup - migration: az_trellis_opportunity_media - source: id - no_stub: true - - - plugin: skip_on_empty - method: process - field_az_application_date/value: - - - plugin: format_date - source: start_date_time - from_format: 'Y-m-d\TH:i:s.vp' - to_format: U - field_az_application_date/end_value: - - - plugin: format_date - source: end_date_time - from_format: 'Y-m-d\TH:i:s.vp' - to_format: U -destination: - plugin: 'entity:node' - default_bundle: az_opportunity - validate: false -migration_dependencies: - optional: - - az_trellis_opportunity_media -include: null diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/config/install/migrate_plus.migration_group.az_trellis_opportunity.yml b/modules/custom/az_opportunity/az_opportunity_trellis/config/install/migrate_plus.migration_group.az_trellis_opportunity.yml deleted file mode 100644 index 4d73287f2a..0000000000 --- a/modules/custom/az_opportunity/az_opportunity_trellis/config/install/migrate_plus.migration_group.az_trellis_opportunity.yml +++ /dev/null @@ -1,11 +0,0 @@ -langcode: en -status: true -dependencies: - module: - - az_opportunity_trellis -id: az_trellis_opportunity -label: 'AZ Trellis Opportunity' -description: 'Import AZ Opportunities from Trellis Programs.' -source_type: 'Trellis Opportunity' -module: az_opportunity_trellis -shared_configuration: null diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/config/install/migrate_queue_importer.cron_migration.az_opportunity_trellis.yml b/modules/custom/az_opportunity/az_opportunity_trellis/config/install/migrate_queue_importer.cron_migration.az_opportunity_trellis.yml deleted file mode 100644 index 44f43b148a..0000000000 --- a/modules/custom/az_opportunity/az_opportunity_trellis/config/install/migrate_queue_importer.cron_migration.az_opportunity_trellis.yml +++ /dev/null @@ -1,13 +0,0 @@ -langcode: en -status: true -dependencies: - enforced: - module: - - az_opportunity_trellis -id: az_opportunity_trellis -label: 'Quickstart Trellis Opportunity' -migration: az_trellis_opportunity -time: 43200 -update: false -sync: false -ignore_dependencies: 0 diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/config/install/views.view.az_opportunity_trellis_import.yml b/modules/custom/az_opportunity/az_opportunity_trellis/config/install/views.view.az_opportunity_trellis_import.yml deleted file mode 100644 index c625901e54..0000000000 --- a/modules/custom/az_opportunity/az_opportunity_trellis/config/install/views.view.az_opportunity_trellis_import.yml +++ /dev/null @@ -1,1053 +0,0 @@ -langcode: en -status: true -dependencies: - module: - - az_opportunity_trellis - - user - - views_remote_data -id: az_opportunity_trellis_import -label: 'Trellis Opportunity Importer' -module: views -description: '' -tag: '' -base_table: az_opportunity_trellis_data -base_field: '' -display: - default: - id: default - display_title: Default - display_plugin: default - position: 0 - display_options: - title: 'Trellis Opportunity Importer' - fields: - Id: - id: Id - table: az_opportunity_trellis_data - field: Id - relationship: none - group_type: group - admin_label: '' - entity_type: null - entity_field: null - plugin_id: az_opportunity_trellis_views_field - label: 'Trellis Opportunity ID' - exclude: false - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: true - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - action_title: Action - include_exclude: exclude - selected_actions: { } - property_5: - id: property_5 - table: az_opportunity_trellis_data - field: property - relationship: none - group_type: group - admin_label: '' - plugin_id: views_remote_data_property - label: 'Branded Opportunity URL' - exclude: true - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: false - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - property_path: Branded_Opportunity_URL - property: - id: property - table: az_opportunity_trellis_data - field: property - relationship: none - group_type: group - admin_label: '' - plugin_id: views_remote_data_property - label: Name - exclude: false - alter: - alter_text: false - text: '' - make_link: true - path: '{{ property_5 }}' - absolute: false - external: true - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: _blank - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: false - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - property_path: Name - property_1: - id: property_1 - table: az_opportunity_trellis_data - field: property - relationship: none - group_type: group - admin_label: '' - plugin_id: views_remote_data_property - label: Host - exclude: false - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: false - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - property_path: Host - property_2: - id: property_2 - table: az_opportunity_trellis_data - field: property - relationship: none - group_type: group - admin_label: '' - plugin_id: views_remote_data_property - label: Audience - exclude: false - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: true - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - property_path: Attributes.0.Audiences.0 - property_3: - id: property_3 - table: az_opportunity_trellis_data - field: property - relationship: none - group_type: group - admin_label: '' - plugin_id: views_remote_data_property - label: Topic - exclude: false - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: true - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - property_path: Attributes.0.Topic.0 - property_4: - id: property_4 - table: az_opportunity_trellis_data - field: property - relationship: none - group_type: group - admin_label: '' - plugin_id: views_remote_data_property - label: Category - exclude: false - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: true - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - property_path: Attributes.0.Category.0 - Start_DateTime: - id: Start_DateTime - table: az_opportunity_trellis_data - field: Start_DateTime - relationship: none - group_type: group - admin_label: '' - plugin_id: date - label: 'Start Date' - exclude: false - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: true - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - date_format: custom - custom_date_format: 'm/d/Y - h:ia' - timezone: '' - Last_Modified_Date: - id: Last_Modified_Date - table: az_opportunity_trellis_data - field: Last_Modified_Date - relationship: none - group_type: group - admin_label: '' - plugin_id: date - label: Updated - exclude: false - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: true - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - date_format: custom - custom_date_format: 'm/d/Y - h:ia' - timezone: '' - pager: - type: mini - options: - offset: 0 - items_per_page: 10 - total_pages: null - id: 0 - tags: - next: ›› - previous: ‹‹ - expose: - items_per_page: false - items_per_page_label: 'Items per page' - items_per_page_options: '5, 10, 25, 50' - items_per_page_options_all: false - items_per_page_options_all_label: '- All -' - offset: false - offset_label: Offset - pagination_heading_level: h4 - exposed_form: - type: basic - options: - submit_button: Search - reset_button: true - reset_button_label: Reset - exposed_sorts_label: 'Sort by' - expose_sort_order: false - sort_asc_label: Asc - sort_desc_label: Desc - access: - type: perm - options: - perm: 'create az_opportunity content' - cache: - type: none - options: { } - empty: { } - sorts: { } - arguments: { } - filters: - property_1: - id: property_1 - table: az_opportunity_trellis_data - field: property - relationship: none - group_type: group - admin_label: '' - plugin_id: views_remote_data_property - operator: '=' - value: '' - group: 1 - exposed: true - expose: - operator_id: property_1_op - label: Owner - description: '' - use_operator: false - operator: property_1_op - operator_limit_selection: false - operator_list: { } - identifier: owner - required: false - remember: false - multiple: false - remember_roles: - authenticated: authenticated - is_grouped: false - group_info: - label: '' - description: '' - identifier: '' - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: { } - property_path: owner - property_2: - id: property_2 - table: az_opportunity_trellis_data - field: property - relationship: none - group_type: group - admin_label: '' - plugin_id: views_remote_data_property - operator: '=' - value: '' - group: 1 - exposed: true - expose: - operator_id: property_2_op - label: Host - description: '' - use_operator: false - operator: property_2_op - operator_limit_selection: false - operator_list: { } - identifier: host - required: false - remember: false - multiple: false - remember_roles: - authenticated: authenticated - is_grouped: false - group_info: - label: '' - description: '' - identifier: '' - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: { } - property_path: host - property_3: - id: property_3 - table: az_opportunity_trellis_data - field: property - relationship: none - group_type: group - admin_label: '' - plugin_id: views_remote_data_property - operator: '=' - value: '' - group: 1 - exposed: true - expose: - operator_id: property_3_op - label: 'Opportunity ID' - description: '' - use_operator: false - operator: property_3_op - operator_limit_selection: false - operator_list: { } - identifier: id - required: false - remember: false - multiple: false - remember_roles: - authenticated: authenticated - is_grouped: false - group_info: - label: '' - description: '' - identifier: '' - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: { } - property_path: id - Attributes: - id: Attributes - table: az_opportunity_trellis_data - field: Attributes - relationship: none - group_type: group - admin_label: '' - plugin_id: az_opportunity_trellis_views_attribute_filter - operator: '=' - value: '' - group: 1 - exposed: true - expose: - operator_id: Attributes_op - label: Audience - description: '' - use_operator: false - operator: Attributes_op - operator_limit_selection: false - operator_list: { } - identifier: audience - required: false - remember: false - multiple: false - remember_roles: - authenticated: authenticated - is_grouped: false - group_info: - label: '' - description: '' - identifier: '' - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: { } - property_path: audience - az_attribute_key: Audiences__c - Attributes_1: - id: Attributes_1 - table: az_opportunity_trellis_data - field: Attributes - relationship: none - group_type: group - admin_label: '' - plugin_id: az_opportunity_trellis_views_attribute_filter - operator: '=' - value: '' - group: 1 - exposed: true - expose: - operator_id: Attributes_1_op - label: Topic - description: '' - use_operator: false - operator: Attributes_1_op - operator_limit_selection: false - operator_list: { } - identifier: topic - required: false - remember: false - multiple: false - remember_roles: - authenticated: authenticated - is_grouped: false - group_info: - label: '' - description: '' - identifier: '' - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: { } - property_path: topic - az_attribute_key: Topic__c - Attributes_2: - id: Attributes_2 - table: az_opportunity_trellis_data - field: Attributes - relationship: none - group_type: group - admin_label: '' - plugin_id: az_opportunity_trellis_views_attribute_filter - operator: '=' - value: '' - group: 1 - exposed: true - expose: - operator_id: Attributes_2_op - label: Category - description: '' - use_operator: false - operator: Attributes_2_op - operator_limit_selection: false - operator_list: { } - identifier: category - required: false - remember: false - multiple: false - remember_roles: - authenticated: authenticated - is_grouped: false - group_info: - label: '' - description: '' - identifier: '' - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: { } - property_path: category - az_attribute_key: Category1__c - Attributes_3: - id: Attributes_3 - table: az_opportunity_trellis_data - field: Attributes - relationship: none - group_type: group - admin_label: '' - plugin_id: az_opportunity_trellis_views_attribute_filter - operator: '=' - value: '' - group: 1 - exposed: true - expose: - operator_id: Attributes_3_op - label: Format - description: '' - use_operator: false - operator: Attributes_3_op - operator_limit_selection: false - operator_list: { } - identifier: format - required: false - remember: false - multiple: false - remember_roles: - authenticated: authenticated - is_grouped: false - group_info: - label: '' - description: '' - identifier: '' - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: { } - property_path: format - az_attribute_key: Opportunity_Format__c - property: - id: property - table: az_opportunity_trellis_data - field: property - relationship: none - group_type: group - admin_label: '' - plugin_id: views_remote_data_property - operator: '=' - value: '' - group: 1 - exposed: true - expose: - operator_id: property_op - label: Keyword - description: '' - use_operator: false - operator: property_op - operator_limit_selection: false - operator_list: { } - identifier: keyword - required: false - remember: false - multiple: false - remember_roles: - authenticated: authenticated - is_grouped: false - group_info: - label: '' - description: '' - identifier: '' - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: { } - property_path: keyword - Date_1: - id: Date_1 - table: az_opportunity_trellis_data - field: Date - relationship: none - group_type: group - admin_label: '' - plugin_id: az_opportunity_trellis_views_date_filter - operator: '=' - value: - value: '' - begin: '' - end: '' - group: 1 - exposed: true - expose: - operator_id: Date_1_op - label: 'Start Date' - description: '' - use_operator: false - operator: Date_1_op - operator_limit_selection: false - operator_list: { } - identifier: start - required: false - remember: false - multiple: false - remember_roles: - authenticated: authenticated - is_grouped: false - group_info: - label: '' - description: '' - identifier: '' - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: { } - api_param: start - api_options: - 'Next 7 Days': 'Next 7 Days' - 'Next 30 Days': 'Next 30 Days' - Custom: Custom - api_param_custom_begin: start_begin - api_param_custom_end: start_end - Date: - id: Date - table: az_opportunity_trellis_data - field: Date - relationship: none - group_type: group - admin_label: '' - plugin_id: az_opportunity_trellis_views_date_filter - operator: '=' - value: - value: '' - begin: '' - end: '' - group: 1 - exposed: true - expose: - operator_id: Date_op - label: 'Updated Date' - description: '' - use_operator: false - operator: Date_op - operator_limit_selection: false - operator_list: { } - identifier: modified - required: false - remember: false - multiple: false - remember_roles: - authenticated: authenticated - is_grouped: false - group_info: - label: '' - description: '' - identifier: '' - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: { } - api_param: modified - api_options: - 'Last 7 Days': 'Last 7 Days' - 'Last 30 Days': 'Last 30 Days' - Custom: Custom - api_param_custom_begin: modified_begin - api_param_custom_end: modified_end - property_4: - id: property_4 - table: az_opportunity_trellis_data - field: property - relationship: none - group_type: group - admin_label: '' - plugin_id: views_remote_data_property - operator: '=' - value: 'true' - group: 1 - exposed: false - expose: - operator_id: '' - label: '' - description: '' - use_operator: false - operator: '' - operator_limit_selection: false - operator_list: { } - identifier: '' - required: false - remember: false - multiple: false - remember_roles: - authenticated: authenticated - is_grouped: false - group_info: - label: '' - description: '' - identifier: '' - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: { } - property_path: publish - Approval: - id: Approval - table: az_opportunity_trellis_data - field: Approval - relationship: none - group_type: group - admin_label: '' - plugin_id: az_opportunity_trellis_views_approval_filter - operator: '=' - value: approved - group: 1 - exposed: true - expose: - operator_id: Approval_op - label: 'Approved for University Calendar' - description: 'Limits results to opportunities curated by University Communications for the University Calendar.' - use_operator: false - operator: Approval_op - operator_limit_selection: false - operator_list: { } - identifier: approval - required: false - remember: false - multiple: false - remember_roles: - authenticated: authenticated - is_grouped: false - group_info: - label: '' - description: '' - identifier: '' - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: { } - property_path: approval - filter_groups: - operator: AND - groups: - 1: AND - style: - type: table - row: - type: fields - query: - type: views_query - options: { } - relationships: { } - use_ajax: true - header: { } - footer: { } - display_extenders: { } - cache_metadata: - max-age: 0 - contexts: - - 'languages:language_interface' - - url - - url.query_args - - user.permissions - tags: - - views_remote_data - page_1: - id: page_1 - display_title: Page - display_plugin: page - position: 1 - display_options: - display_extenders: { } - path: admin/trellis-opportunity-importer - cache_metadata: - max-age: 0 - contexts: - - 'languages:language_interface' - - url - - url.query_args - - user.permissions - tags: - - views_remote_data diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/config/schema/az_opportunity_trellis.schema.yml b/modules/custom/az_opportunity/az_opportunity_trellis/config/schema/az_opportunity_trellis.schema.yml deleted file mode 100644 index 08d3cffb6c..0000000000 --- a/modules/custom/az_opportunity/az_opportunity_trellis/config/schema/az_opportunity_trellis.schema.yml +++ /dev/null @@ -1,39 +0,0 @@ -views.filter_value.az_opportunity_trellis_views_date_filter: - type: views_filter - label: 'Trellis filter' - mapping: - value: - type: string - label: 'Value' - begin: - type: string - label: 'Custom Date Range Begin' - end: - type: string - label: 'Custom Date Range End' -az_opportunity_trellis.az_recurring_import_rule.*: - type: config_entity - label: Trellis Opportunity Import - mapping: - id: - type: machine_name - label: ID - label: - type: label - label: Label - uuid: - type: uuid - host: - type: string - owner: - type: string - keyword: - type: string - opportunity_type: - type: sequence - label: 'Opportunity Type' - sequence: - type: string - label: 'Opportunity Type' - approval: - type: string diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/css/az_opportunity_trellis_datewrapper.css b/modules/custom/az_opportunity/az_opportunity_trellis/css/az_opportunity_trellis_datewrapper.css deleted file mode 100644 index 6fef13e186..0000000000 --- a/modules/custom/az_opportunity/az_opportunity_trellis/css/az_opportunity_trellis_datewrapper.css +++ /dev/null @@ -1,3 +0,0 @@ -.az-opportunity-trellis-datewrapper.views-exposed-form__item .form-item:first-child { - margin-top: 0; -} \ No newline at end of file diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/js/az_opportunity_trellis_date.js b/modules/custom/az_opportunity/az_opportunity_trellis/js/az_opportunity_trellis_date.js deleted file mode 100644 index 911cef299d..0000000000 --- a/modules/custom/az_opportunity/az_opportunity_trellis/js/az_opportunity_trellis_date.js +++ /dev/null @@ -1,27 +0,0 @@ -/** - * @file - * Trellis date range picker. - */ - -((Drupal, drupalSettings, once) => { - Drupal.behaviors.trellisDatePicker = { - attach(context) { - const elements = once('aztrellisdate', '.az-trellis-daterange', context); - elements.forEach((element) => { - const begin = element; - const id = element.dataset.azTrellisDaterangeEnd; - const end = document.getElementById(id); - // eslint-disable-next-line no-unused-vars, no-undef, new-cap - const picker = new easepick.create({ - element: begin, - css: drupalSettings.trellisDatePicker.css, - zIndex: 10, - RangePlugin: { - elementEnd: end, - }, - plugins: ['RangePlugin'], - }); - }); - }, - }; -})(Drupal, drupalSettings, once); diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/migrations/az_trellis_opportunity_files.yml b/modules/custom/az_opportunity/az_opportunity_trellis/migrations/az_trellis_opportunity_files.yml deleted file mode 100644 index 969e87e18b..0000000000 --- a/modules/custom/az_opportunity/az_opportunity_trellis/migrations/az_trellis_opportunity_files.yml +++ /dev/null @@ -1,42 +0,0 @@ -id: az_trellis_opportunity_files -label: Trellis Opportunity Files -source: - plugin: az_trellis_opportunity_api - trellis_ids: { } - track_changes: true - fields: - - - name: id - label: ID - selector: Id - - - name: image_url - label: 'Image URL' - selector: Image_URL - ids: - id: - type: string - -process: - status: - plugin: default_value - default_value: 1 - - uri: - - - plugin: az_migration_remote_file - migration: az_trellis_opportunity_files - default_filename: id - directory: 'public://trellis-opportunity' - source_ids: - - id - source: image_url - - - plugin: skip_on_empty - method: row - uid: - plugin: default_value - default_value: 0 - -destination: - plugin: entity:file diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/migrations/az_trellis_opportunity_media.yml b/modules/custom/az_opportunity/az_opportunity_trellis/migrations/az_trellis_opportunity_media.yml deleted file mode 100644 index f23e074c80..0000000000 --- a/modules/custom/az_opportunity/az_opportunity_trellis/migrations/az_trellis_opportunity_media.yml +++ /dev/null @@ -1,56 +0,0 @@ -id: az_trellis_opportunity_media -label: Trellis Opportunity Media -source: - plugin: az_trellis_opportunity_api - trellis_ids: { } - track_changes: true - fields: - - - name: id - label: ID - selector: Id - - - name: image_url - label: 'Image URL' - selector: Image_URL - - - name: name - label: Name - selector: Name - ids: - id: - type: string - -process: - uid: - plugin: default_value - default_value: 0 - bundle: - plugin: default_value - default_value: az_image - field_media_az_image/target_id: - - - plugin: migration_lookup - migration: az_trellis_opportunity_files - source: id - no_stub: true - - - plugin: skip_on_empty - method: row - field_media_az_image/alt: name - field_media_az_image/title: name - status: - plugin: default_value - default_value: 1 - -destination: - plugin: entity:media - -dependencies: - enforced: - module: - - az_opportunity_trellis - - az_media -migration_dependencies: - optional: - - az_trellis_opportunity_files diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/src/AZRecurringImportRuleInterface.php b/modules/custom/az_opportunity/az_opportunity_trellis/src/AZRecurringImportRuleInterface.php deleted file mode 100644 index 335b540156..0000000000 --- a/modules/custom/az_opportunity/az_opportunity_trellis/src/AZRecurringImportRuleInterface.php +++ /dev/null @@ -1,30 +0,0 @@ -t('Label'); - $header['id'] = $this->t('Machine name'); - $header['results'] = $this->t('Results'); - $header['status'] = $this->t('Status'); - return $header + parent::buildHeader(); - } - - /** - * {@inheritdoc} - */ - public function buildRow(EntityInterface $entity): array { - /** @var \Drupal\az_opportunity_trellis\AZRecurringImportRuleInterface $entity */ - $row['label'] = $entity->label(); - $row['id'] = $entity->id(); - - // Get entity's query parameters. - $params = $entity->getQueryParameters(); - unset($params['publish']); - - if (!empty($params)) { - // Generate link to results page. - $row['result']['data'] = [ - '#type' => 'link', - '#title' => $this->t('View Results'), - '#url' => Url::fromRoute('view.az_opportunity_trellis_import.page_1'), - '#options' => ['query' => $params], - '#attributes' => ['class' => 'button'], - ]; - } - else { - $row['result'] = ''; - } - $row['status'] = $entity->status() ? $this->t('Enabled') : $this->t('Disabled'); - return $row + parent::buildRow($entity); - } - -} diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/src/Controller/AZRecurringImportModalController.php b/modules/custom/az_opportunity/az_opportunity_trellis/src/Controller/AZRecurringImportModalController.php deleted file mode 100644 index 1c2af8acc2..0000000000 --- a/modules/custom/az_opportunity/az_opportunity_trellis/src/Controller/AZRecurringImportModalController.php +++ /dev/null @@ -1,101 +0,0 @@ -entityTypeManager = $entityTypeManager; - $this->entityFormBuilder = $entityFormBuilder; - $this->cache = $cache; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container): self { - return new self( - $container->get('entity_type.manager'), - $container->get('entity.form_builder'), - $container->get('cache.default'), - ); - } - - /** - * Open az_recurring_import_rule configuration form as a modal. - * - * @param \Symfony\Component\HttpFoundation\Request $request - * The current request. - * - * @return \Drupal\Core\Ajax\AjaxResponse - * AjaxResponse containing command to open a modal. - */ - public function __invoke(Request $request): AjaxResponse { - $search = []; - $key = $request->query->get('search'); - // Attempt to get cached search if we have a valid cache key. - if (!empty($key) && str_starts_with($key, 'az_recurring_import_modal:')) { - // Get a cached search if there is one for our key. - $search = $this->cache->get($key)->data ?? []; - } - - // Create an AjaxResponse that opens a modal copy of the config form. - $response = new AjaxResponse(); - // Entity forms require an entity. - $config = $this->entityTypeManager->getStorage('az_recurring_import_rule')->create($search); - // Generate a copy of the configuration entity form using the stub as basis. - $config_form = $this->entityFormBuilder->getForm($config, 'add'); - // Forms generated during ajax calls do not have the right action path. - $config_form['#action'] = Url::fromRoute('entity.az_recurring_import_rule.add_form')->toString(); - // Add an ajax command to open the modal. - $response->addCommand(new OpenModalDialogCommand($this->t('Create Recurring Import'), $config_form, ['width' => '1000'])); - return $response; - } - -} diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/src/Entity/AZRecurringImportRule.php b/modules/custom/az_opportunity/az_opportunity_trellis/src/Entity/AZRecurringImportRule.php deleted file mode 100644 index d8e5002d09..0000000000 --- a/modules/custom/az_opportunity/az_opportunity_trellis/src/Entity/AZRecurringImportRule.php +++ /dev/null @@ -1,124 +0,0 @@ - AZRecurringImportRuleListBuilder::class, - 'form' => [ - 'add' => AZRecurringImportRuleForm::class, - 'edit' => AZRecurringImportRuleForm::class, - 'delete' => EntityDeleteForm::class, - ], - ], - config_prefix: 'az_recurring_import_rule', - admin_permission: 'administer quickstart configuration', - label_count: [ - 'singular' => '@count recurring import rule', - 'plural' => '@count recurring import rules', - ], - links: [ - 'collection' => '/admin/config/az-quickstart/settings/az-recurring-import-rule', - 'add-form' => '/admin/config/az-quickstart/settings/az-recurring-import-rule/add', - 'edit-form' => '/admin/config/az-quickstart/settings/az-recurring-import-rule/{az_recurring_import_rule}', - 'delete-form' => '/admin/config/az-quickstart/settings/az-recurring-import-rule/{az_recurring_import_rule}/delete', - ], - entity_keys: [ - 'id' => 'id', - 'label' => 'label', - 'uuid' => 'uuid', - ], - config_export: [ - 'id', - 'label', - 'owner', - 'host', - 'keyword', - 'attributes', - 'approval', - ], -)] -final class AZRecurringImportRule extends ConfigEntityBase implements AZRecurringImportRuleInterface { - - /** - * The az_recurring_import_rule ID. - */ - protected string $id; - - /** - * The az_recurring_import_rule label. - */ - protected string $label; - - /** - * The az_recurring_import_rule keyword. - */ - protected string $keyword; - - /** - * The az_recurring_import_rule owner. - */ - protected string $owner; - - /** - * The az_recurring_import_rule owner. - */ - protected string $host; - - /** - * The az_recurring_import_rule approval status. - */ - protected string $approval; - - /** - * {@inheritdoc} - */ - public function getQueryParameters() { - // Build a list of query parameters. - $params = [ - 'publish' => 'true', - ]; - $attributes = array_filter($this->attributes ?? []); - $params += $attributes; - $params['keyword'] = $this->get('keyword') ?? ''; - $params['owner'] = $this->get('owner') ?? ''; - $params['host'] = $this->get('host') ?? ''; - $params['approval'] = $this->get('approval') ?? ''; - $params = array_filter($params); - return $params; - } - - /** - * {@inheritdoc} - */ - public function getOpportunityIds() { - // Build a list of query parameters. - $params = $this->getQueryParameters(); - - // Let's refuse to search if there are no constraints except published. - if (count($params) === 1) { - return []; - } - - return \Drupal::service('az_opportunity_trellis.trellis_helper')->searchOpportunities($params); - } - -} diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/src/EventSubscriber/AZOpportunityTrellisDataSubscriber.php b/modules/custom/az_opportunity/az_opportunity_trellis/src/EventSubscriber/AZOpportunityTrellisDataSubscriber.php deleted file mode 100644 index 2e436caa8f..0000000000 --- a/modules/custom/az_opportunity/az_opportunity_trellis/src/EventSubscriber/AZOpportunityTrellisDataSubscriber.php +++ /dev/null @@ -1,157 +0,0 @@ - 'onQuery', - MigrateOpportunity::POST_ROW_SAVE => 'onPostRowSave', - ]; - } - - /** - * Constructs an AZOpportunityTrellisDataSubscriber. - * - * @param \Drupal\az_opportunity_trellis\TrellisHelper $trellisHelper - * The Trellis helper server. - * @param \Drupal\Core\Messenger\Messenger $messenger - * Database connection object. - * @param \Drupal\Core\Entity\EntityTypeManagerInterface $entityTypeManager - * The entity type manager service. - * @param \Drupal\Core\Session\AccountProxy $currentUser - * The currently logged in user. - */ - public function __construct(TrellisHelper $trellisHelper, Messenger $messenger, EntityTypeManagerInterface $entityTypeManager, AccountProxy $currentUser) { - $this->trellisHelper = $trellisHelper; - $this->messenger = $messenger; - $this->entityTypeManager = $entityTypeManager; - $this->nodeStorage = $this->entityTypeManager->getStorage('node'); - $this->currentUser = $currentUser; - } - - /** - * Respond to opportunity on migration import for relevant migrations. - * - * @param \Drupal\migrate\Opportunity\MigratePostRowSaveOpportunity $opportunity - * The post save opportunity object. - */ - public function onPostRowSave(MigratePostRowSaveOpportunity $opportunity) { - $migration = $opportunity->getMigration()->getBaseId(); - $ids = $opportunity->getDestinationIdValues(); - $id = reset($ids); - if ($migration === 'az_trellis_opportunity') { - $opportunity = $this->nodeStorage->load($id); - if (!empty($opportunity)) { - $url = $opportunity->toUrl()->toString(); - // Only show message if current user has permission. - if ($this->currentUser->hasPermission('create az_opportunity content')) { - // Show status message that opportunity was imported. - $this->messenger->addMessage($this->t('Imported @opportunitytitle.', [ - '@opportunitylink' => $url, - '@opportunitytitle' => $opportunity->getTitle(), - ])); - } - } - } - } - - /** - * Subscribes to populate Trellis view results. - * - * @param \Drupal\views_remote_data\Opportunity\RemoteDataQueryOpportunity $opportunity - * The opportunity. - */ - public function onQuery(RemoteDataQueryOpportunity $opportunity): void { - $supported_bases = ['az_opportunity_trellis_data']; - $base_tables = array_keys($opportunity->getView()->getBaseTables()); - if (count(array_intersect($supported_bases, $base_tables)) > 0) { - $parameters = []; - $condition_groups = $opportunity->getConditions(); - // Check for conditional parameters. - foreach ($condition_groups as $condition_group) { - if (!empty($condition_group['conditions'])) { - foreach ($condition_group['conditions'] as $condition) { - if (!empty($condition['field'][0]) & !empty($condition['value'])) { - $parameters[$condition['field'][0]] = $condition['value']; - } - } - } - } - // Don't perform search if empty or publish is the only field. - if (empty($parameters) || (count($parameters) <= 1)) { - return; - } - $ids = $this->trellisHelper->searchopportunity($parameters); - if (!empty($ids)) { - $offset = $opportunity->getOffset(); - $limit = $opportunity->getLimit(); - if (!empty($limit)) { - $ids = array_slice($ids, $offset, $limit); - } - // Run data fetch request. - $results = $this->trellisHelper->getOpportunity($ids); - $datefields = [ - 'Last_Modified_Date', - 'Start_DateTime', - 'End_DateTime', - ]; - foreach ($results as $result) { - // Change date format fields to what views expects to see. - foreach ($datefields as $datefield) { - if (!empty($result[$datefield])) { - $result[$datefield] = strtotime($result[$datefield]); - } - } - $opportunity->addResult(new ResultRow($result)); - } - } - } - } - -} diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/src/Form/AZRecurringImportRuleForm.php b/modules/custom/az_opportunity/az_opportunity_trellis/src/Form/AZRecurringImportRuleForm.php deleted file mode 100644 index b32d921b80..0000000000 --- a/modules/custom/az_opportunity/az_opportunity_trellis/src/Form/AZRecurringImportRuleForm.php +++ /dev/null @@ -1,185 +0,0 @@ -entityRepository = $container->get('entity.repository'); - $instance->trellisHelper = $container->get('az_opportunity_trellis.trellis_helper'); - return $instance; - } - - /** - * {@inheritdoc} - */ - public function form(array $form, FormStateInterface $form_state): array { - - $form = parent::form($form, $form_state); - /** @var \Drupal\az_opportunity_trellis\Entity\AZRecurringImportRule $entity */ - $entity = $this->entity; - // Fetch the list of attributes mapped by the API. - $mappings = $this->trellisHelper->getAttributeMappings(); - - $form['label'] = [ - '#type' => 'textfield', - '#title' => $this->t('Import Rule Name'), - '#maxlength' => 255, - '#default_value' => $entity->label(), - '#description' => $this->t('Describe this rule, e.g., Graduate Lecture Series'), - '#required' => TRUE, - ]; - - $form['id'] = [ - '#type' => 'machine_name', - '#default_value' => $this->entity->id(), - '#machine_name' => [ - 'exists' => [AZRecurringImportRule::class, 'load'], - ], - '#disabled' => !$entity->isNew(), - ]; - - $form['status'] = [ - '#type' => 'checkbox', - '#title' => $this->t('Enabled'), - '#default_value' => $entity->status(), - '#description' => $this->t('Enabled import rules will regularly import matching content into the site automatically.'), - ]; - - $form['query_parameters'] = [ - '#type' => 'details', - '#title' => $this->t('Recurring Search Parameters'), - '#description' => $this->t('When this import rule runs, the following search terms will be used.'), - '#open' => TRUE, - ]; - - $form['query_parameters']['owner'] = [ - '#type' => 'textfield', - '#title' => $this->t('Owner'), - '#maxlength' => 255, - '#default_value' => $entity->get('owner'), - ]; - - $form['query_parameters']['host'] = [ - '#type' => 'textfield', - '#title' => $this->t('Host'), - '#maxlength' => 255, - '#default_value' => $entity->get('host'), - ]; - - $form['query_parameters']['keyword'] = [ - '#type' => 'textfield', - '#title' => $this->t('Keyword'), - '#maxlength' => 255, - '#default_value' => $entity->get('keyword'), - ]; - - $form['query_parameters']['attributes']['#tree'] = TRUE; - - // Get the different attributes available. - // $term_storage = $this->entityTypeManager->getStorage('taxonomy_term'); - // $query = $term_storage->getQuery() - // ->accessCheck(TRUE) - // ->addTag('taxonomy_term_access') - // ->condition('vid', 'az_enterprise_attributes') - // ->condition('parent', 0) - // ->sort('name') - // // Only fetch attributes that have an API mapping. - // ->condition('field_az_attribute_key', array_keys($mappings), 'IN'); - // $attributes = $query->execute(); - // $attributes = $term_storage->loadMultiple($attributes); - - // Build attribute select lists. - // foreach ($attributes as $attribute) { - // $options = []; - // $key = $mappings[$attribute->field_az_attribute_key->value]; - // $id = $attribute->id(); - - // // Find the options the attribute has, in order. - // $query = $term_storage->getQuery() - // ->accessCheck(TRUE) - // ->addTag('taxonomy_term_access') - // ->condition('vid', 'az_enterprise_attributes') - // ->condition('parent', $id) - // ->sort('name') - // ->condition('field_az_attribute_key', '', '<>'); - // $terms = $query->execute(); - // $terms = $term_storage->loadMultiple($terms); - // foreach ($terms as $term) { - // $options[$term->field_az_attribute_key->value] = $this->entityRepository->getTranslationFromContext($term)->label(); - // } - - // // Build the select element for the attribute. - // $form['query_parameters']['attributes'][$key] = [ - // '#type' => 'select', - // '#options' => $options, - // '#empty_option' => $this->t('- Any -'), - // '#empty_value' => '', - // '#title' => $this->entityRepository->getTranslationFromContext($attribute)->label(), - // '#required' => FALSE, - // '#default_value' => $entity->get('attributes')[$key] ?? NULL, - // ]; - // } - - $form['query_parameters']['approval'] = [ - '#type' => 'select', - '#title' => $this->t('Approved for University Calendar'), - '#options' => [ - 'approved' => $this->t('Approved'), - 'denied' => $this->t('Denied'), - ], - '#empty_option' => $this->t('- Any -'), - '#empty_value' => '', - '#required' => FALSE, - '#default_value' => $entity->get('approval'), - ]; - - return $form; - } - - /** - * {@inheritdoc} - */ - public function save(array $form, FormStateInterface $form_state): int { - $result = parent::save($form, $form_state); - $message_args = ['%label' => $this->entity->label()]; - $this->messenger()->addStatus( - match($result) { - \SAVED_NEW => $this->t('Created new recurring import rule %label.', $message_args), - \SAVED_UPDATED => $this->t('Updated recurring import rule %label.', $message_args), - } - ); - - $form_state->setRedirectUrl($this->entity->toUrl('collection')); - return $result; - } - -} diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/src/Form/TrellisOpportunitySettingsForm.php b/modules/custom/az_opportunity/az_opportunity_trellis/src/Form/TrellisOpportunitySettingsForm.php deleted file mode 100644 index d018341dda..0000000000 --- a/modules/custom/az_opportunity/az_opportunity_trellis/src/Form/TrellisOpportunitySettingsForm.php +++ /dev/null @@ -1,53 +0,0 @@ -config('az_opportunity_trellis.settings'); - - $form['api_hostname'] = [ - '#title' => $this->t("API Hostname"), - '#type' => 'textfield', - '#default_value' => $az_opportunity_trellis_config->get('api_hostname'), - ]; - - return parent::buildForm($form, $form_state); - } - - /** - * {@inheritdoc} - */ - public function submitForm(array &$form, FormStateInterface $form_state) { - $this->config('az_opportunity_trellis.settings') - ->set('api_hostname', $form_state->getValue('api_hostname')) - ->save(); - - parent::submitForm($form, $form_state); - } - -} diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/src/Plugin/migrate/source/AZTrellisOpportunitySource.php b/modules/custom/az_opportunity/az_opportunity_trellis/src/Plugin/migrate/source/AZTrellisOpportunitySource.php deleted file mode 100644 index 03a3f923b1..0000000000 --- a/modules/custom/az_opportunity/az_opportunity_trellis/src/Plugin/migrate/source/AZTrellisOpportunitySource.php +++ /dev/null @@ -1,144 +0,0 @@ -fields = $configuration['fields']; - $this->ids = $configuration['ids']; - // @todo use injection for this. - $this->trellisHelper = \Drupal::service('az_opportunity_trellis.trellis_helper'); - $this->trellisIds = $configuration['trellis_ids'] ?? []; - // If no arguments are supplied, fetch the list currently on the site. - if (empty($this->trellisIds)) { - $ids = $this->trellisHelper->getImportedOpportunityIds(); - $ids += $this->trellisHelper->getRecurringOpportunityIds(); - $this->trellisIds = array_unique($ids); - } - } - - /** - * Initializes the iterator with the source data. - * - * @return \Iterator - * Returns an iterable object of data for this source. - */ - protected function initializeIterator() { - // Fetch the opportunities via trellis API. - $items = $this->trellisHelper->getOpportunities($this->trellisIds); - $results = []; - $fields = []; - // Find field selectors. - foreach ($this->fields as $field) { - $fields[$field['name']] = $field['selector'] ?? $field['name']; - } - foreach ($items as $item) { - $result = []; - // Transform selectors into defined fields. - foreach ($fields as $field => $selector) { - if (isset($item[$selector])) { - $result[$field] = $item[$selector]; - } - } - $results[] = $result; - } - // Return an iterable. - $obj = new \ArrayObject($results); - return $obj->getIterator(); - } - - /** - * {@inheritdoc} - */ - public function prepareRow(Row $row) { - // Trellis IDs from source configuration can affect the hash of the row. - $row->setSourceProperty('trellis_ids', []); - // Perform normal source plugin hashing. - return parent::prepareRow($row); - } - - /** - * Return a string representing the source ids. - * - * @return string - * Comma-separated list of ids being imported. - */ - public function __toString(): string { - $ids = implode(', ', $this->trellisIds); - return $ids; - } - - /** - * {@inheritdoc} - */ - public function fields(): array { - $fields = []; - foreach ($this->fields as $field_info) { - $fields[$field_info['name']] = $field_info['label'] ?? $field_info['name']; - } - return $fields; - } - - /** - * {@inheritdoc} - */ - public function getIds(): array { - return $this->ids; - } - -} diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/src/Plugin/views/field/AZOpportunityTrellisViewsField.php b/modules/custom/az_opportunity/az_opportunity_trellis/src/Plugin/views/field/AZOpportunityTrellisViewsField.php deleted file mode 100644 index b523041695..0000000000 --- a/modules/custom/az_opportunity/az_opportunity_trellis/src/Plugin/views/field/AZOpportunityTrellisViewsField.php +++ /dev/null @@ -1,160 +0,0 @@ -migrationRemoteTools = $container->get('az_migration_remote.tools'); - $instance->trellisHelper = $container->get('az_opportunity_trellis.trellis_helper'); - return $instance; - } - - /** - * {@inheritdoc} - */ - public function init(ViewExecutable $view, DisplayPluginBase $display, ?array &$options = NULL) { - FieldPluginBase::init($view, $display, $options); - $this->actions = []; - } - - /** - * {@inheritdoc} - */ - public function viewsForm(&$form, FormStateInterface $form_state) { - $form['#cache']['max-age'] = 0; - - $form[$this->options['id']] = [ - '#tree' => TRUE, - ]; - - foreach ($this->view->result as $row_index => $row) { - $form[$this->options['id']][$row_index] = [ - '#type' => 'checkbox', - // We are not able to determine a main "title" for each row, so we can - // only output a generic label. - '#title' => $this->t('Update this item'), - '#title_display' => 'invisible', - '#return_value' => $row->Id ?? '', - '#default_value' => !empty($form_state->getValue($this->options['id'])[$row_index]) ? 1 : NULL, - ]; - } - - // Change default BulkForm label. - if (!empty($form['actions']['submit'])) { - $form['actions']['submit']['#value'] = $this->t('Import'); - } - } - - /** - * {@inheritdoc} - */ - public function viewsFormValidate(&$form, FormStateInterface $form_state) { - $ids = $form_state->getValue($this->options['id']); - if (empty($ids) || empty(array_filter($ids))) { - $form_state->setErrorByName('', $this->emptySelectedMessage()); - } - // Unlike parent class, do not throw form error when action is empty. - } - - /** - * Submit handler for the Trellis import form. - * - * @param mixed $form - * An associative array containing the structure of the form. - * @param \Drupal\Core\Form\FormStateInterface $form_state - * The current state of the form. - * - * @throws \Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException - * Thrown when the user tried to access an action without access to it. - */ - public function viewsFormSubmit(&$form, FormStateInterface $form_state) { - $values = $form_state->getValues(); - if (!empty($values[$this->options['id']])) { - $ids = $values[$this->options['id']]; - $ids = array_filter($ids); - foreach ($ids as $value) { - if (!empty($value)) { - \Drupal::service('messenger')->addMessage($this->t('Importing Trellis Opportunity @id.', [ - '@id' => $value, - ])); - } - } - - $migrations = [ - 'az_trellis_opportunity_files' => [ - 'limit' => 0, - 'update' => 0, - 'force' => 0, - 'configuration' => [ - 'source' => [ - 'trellis_ids' => $ids, - ], - ], - ], - 'az_trellis_opportunity_media' => [ - 'limit' => 0, - 'update' => 0, - 'force' => 0, - 'configuration' => [ - 'source' => [ - 'trellis_ids' => $ids, - ], - ], - ], - 'az_trellis_opportunity' => [ - 'limit' => 0, - 'update' => 0, - 'force' => 0, - 'configuration' => [ - 'source' => [ - 'trellis_ids' => $ids, - ], - ], - ], - ]; - - $this->migrationRemoteTools->batch($migrations); - } - - } - - /** - * {@inheritdoc} - */ - public function isWorkspaceSafeForm(array $form, FormStateInterface $form_state): bool { - // This field is not backed by an entity like BulkForm expects. - return FALSE; - } - -} diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/src/Plugin/views/filter/AZOpportunityTrellisViewsApprovalFilter.php b/modules/custom/az_opportunity/az_opportunity_trellis/src/Plugin/views/filter/AZOpportunityTrellisViewsApprovalFilter.php deleted file mode 100644 index 555df5c6f4..0000000000 --- a/modules/custom/az_opportunity/az_opportunity_trellis/src/Plugin/views/filter/AZOpportunityTrellisViewsApprovalFilter.php +++ /dev/null @@ -1,96 +0,0 @@ - 'select', - '#title' => $this->t('Value'), - '#options' => [ - 'approved' => $this->t('Approved'), - 'denied' => $this->t('Denied'), - ], - '#required' => FALSE, - '#default_value' => $this->value, - ]; - } - - /** - * {@inheritdoc} - */ - public function operatorOptions(): array { - return [ - '=' => $this->t('Is equal to'), - '!=' => $this->t('Is not equal to'), - ]; - } - - /** - * {@inheritdoc} - */ - protected function defineOptions(): array { - $options = parent::defineOptions(); - $this->definePropertyPathOption($options); - return $options; - } - - /** - * {@inheritdoc} - */ - public function buildOptionsForm(&$form, FormStateInterface $form_state): void { - $this->propertyPathElement($form, $this->options); - parent::buildOptionsForm($form, $form_state); - } - - /** - * {@inheritdoc} - */ - public function adminSummary() { - $prop = $this->options['property_path'] ?? ''; - return '(API value ' . $prop . ') ' . $this->operator . ' ' . $this->value; - } - - /** - * {@inheritdoc} - */ - public function query($group_by = FALSE): void { - if (!($this->query instanceof RemoteDataQuery)) { - return; - } - $this->query->addWhere( - $this->options['group'], - $this->options['property_path'], - $this->value, - $this->operator - ); - } - -} diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/src/Plugin/views/filter/AZOpportunityTrellisViewsDateFilter.php b/modules/custom/az_opportunity/az_opportunity_trellis/src/Plugin/views/filter/AZOpportunityTrellisViewsDateFilter.php deleted file mode 100644 index 22bf20d20d..0000000000 --- a/modules/custom/az_opportunity/az_opportunity_trellis/src/Plugin/views/filter/AZOpportunityTrellisViewsDateFilter.php +++ /dev/null @@ -1,289 +0,0 @@ - $this->t('Next 7 Days'), - 'Next 30 Days' => $this->t('Next 30 Days'), - 'Last 7 Days' => $this->t('Last 7 Days'), - 'Last 30 Days' => $this->t('Last 30 Days'), - 'Custom' => $this->t('Custom'), - ]; - return $options; - } - - /** - * The asset resolver service. - * - * @var \Drupal\Core\Asset\AssetResolver - */ - protected $assetResolver; - - /** - * The file url generator service. - * - * @var \Drupal\Core\File\FileUrlGeneratorInterface - */ - protected $fileUrlGenerator; - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) { - $instance = new static( - $configuration, - $plugin_id, - $plugin_definition - ); - - $instance->assetResolver = $container->get('asset.resolver'); - $instance->fileUrlGenerator = $container->get('file_url_generator'); - return $instance; - } - - /** - * {@inheritdoc} - */ - protected function valueForm(&$form, FormStateInterface $form_state): void { - $form['value']['#tree'] = TRUE; - $form['#attached']['library'][] = 'az_opportunity_trellis/az_opportunity_trellis_date'; - // Trim valid options to selected options. - $options = $this->trellisDateOptions(); - $keys = $this->options['api_options'] ?? []; - $options = array_intersect($options, array_flip($keys)); - $form['value']['value'] = [ - '#type' => 'select', - '#options' => $options, - '#empty_option' => $this->t('- Any -'), - '#empty_value' => '', - '#required' => FALSE, - '#default_value' => $this->value['value'], - ]; - // Add label if this is the exposed form. - $exposed_info = $this->exposedInfo(); - if (!empty($exposed_info['label'])) { - $form['value']['value']['#title'] = $exposed_info['label']; - } - // Fetch library information for shadow DOM inclusion. - $css = []; - try { - $attached = AttachedAssets::createFromRenderArray([ - '#attached' => [ - 'library' => [ - 'az_opportunity_trellis/easepick_styles', - ], - ], - ]); - $assets = $this->assetResolver->getCssAssets($attached, TRUE); - foreach ($assets as $asset) { - if (!empty($asset['data'])) { - $css[] = $this->fileUrlGenerator->generateString($asset['data']); - } - } - } - catch (\Exception $e) { - // Failed to fetch assets. - } - $form['#attached']['drupalSettings']['trellisDatePicker']['css'] = $css; - // Prepare unique id for data attribute. - $end_id = Html::getUniqueId('az-trellis-daterange-end'); - $form['value']['begin'] = [ - '#type' => 'textfield', - '#title' => $this->t('Begin'), - '#attributes' => [ - 'data-az-trellis-daterange-end' => $end_id, - 'class' => ['az-trellis-daterange'], - ], - '#size' => 30, - '#default_value' => $this->value['begin'], - ]; - $form['value']['end'] = [ - '#type' => 'textfield', - '#title' => $this->t('End'), - '#attributes' => [ - 'id' => $end_id, - 'class' => ['az-trellis-daterange-end'], - ], - '#size' => 30, - '#default_value' => $this->value['end'], - ]; - // Compute conditional fields using states array. - if ($form_state->get('exposed')) { - $identifier = $this->options['expose']['identifier']; - $source = ':input[name="' . $identifier . '[value]"]'; - $state = [$source => ['value' => 'Custom']]; - $form['value']['begin']['#states']['visible'][] = $state; - $form['value']['end']['#states']['visible'][] = $state; - } - } - - /** - * {@inheritdoc} - */ - protected function buildValueWrapper(&$form, $wrapper_identifier) { - // Modify parent class behavior to be a container rather than a fieldset. - if (!isset($form[$wrapper_identifier])) { - $form[$wrapper_identifier] = [ - '#type' => 'container', - '#attributes' => [ - 'class' => [ - 'views-exposed-form__item', - 'az-opportunity-trellis-datewrapper', - ], - ], - ]; - } - } - - /** - * {@inheritdoc} - */ - public function operatorOptions(): array { - return [ - '=' => $this->t('Is equal to'), - '!=' => $this->t('Is not equal to'), - ]; - } - - /** - * {@inheritdoc} - */ - protected function defineOptions(): array { - $options = parent::defineOptions(); - $options['value'] = [ - 'contains' => [ - 'value' => ['default' => ''], - 'begin' => ['default' => ''], - 'end' => ['default' => ''], - ], - ]; - $options['api_param'] = ['default' => '']; - $options['api_options'] = ['default' => []]; - $options['api_param_custom_begin'] = ['default' => '']; - $options['api_param_custom_end'] = ['default' => '']; - return $options; - } - - /** - * {@inheritdoc} - */ - public function buildOptionsForm(&$form, FormStateInterface $form_state): void { - parent::buildOptionsForm($form, $form_state); - $form['api_options'] = [ - '#type' => 'select', - '#title' => $this->t('Trellis Date Options'), - '#options' => $this->trellisDateOptions(), - '#multiple' => TRUE, - '#required' => TRUE, - '#default_value' => $this->options['api_options'], - ]; - $form['api_param'] = [ - '#title' => $this->t('API get parameter for date'), - '#type' => 'textfield', - '#default_value' => $this->options['api_param'] ?? '', - '#required' => TRUE, - ]; - $form['api_param_custom_begin'] = [ - '#title' => $this->t('API get parameter for custom begin date'), - '#type' => 'textfield', - '#default_value' => $this->options['api_param_custom_begin'] ?? '', - '#required' => TRUE, - ]; - $form['api_param_custom_end'] = [ - '#title' => $this->t('API get parameter for custom end date'), - '#type' => 'textfield', - '#default_value' => $this->options['api_param_custom_end'] ?? '', - '#required' => TRUE, - ]; - - } - - /** - * {@inheritdoc} - */ - public function adminSummary() { - $prop = $this->options['api_param'] ?? ''; - $begin = $this->options['api_param_custom_begin'] ?? ''; - $end = $this->options['api_param_custom_end'] ?? ''; - return 'Date (API ' . $prop . ' ' . $begin . ' ' . $end . ') ' . $this->operator . ' ' . $this->value['value']; - } - - /** - * {@inheritdoc} - */ - public function query($group_by = FALSE): void { - if (!($this->query instanceof RemoteDataQuery)) { - return; - } - $value = $this->value['value'] ?? ''; - $this->query->addWhere( - $this->options['group'], - $this->options['api_param'], - $this->value['value'], - $this->operator - ); - // Handle supplied values if custom range. - if ($value === 'Custom') { - // Compute time offsets for API query. - $begin = $this->value['begin'] ?? ''; - $end = $this->value['end'] ?? ''; - $begin = strtotime($begin); - $end = strtotime($end); - if (($begin !== FALSE) && ($end !== FALSE)) { - // Find begin and end of respective days. - $begin = strtotime("today", $begin); - $end = strtotime("tomorrow", $end); - // Roll over to the previous night. - $end -= 1; - $begin = gmdate(self::TRELLIS_DATE_FORMAT, $begin); - $end = gmdate(self::TRELLIS_DATE_FORMAT, $end); - $this->query->addWhere( - $this->options['group'], - $this->options['api_param_custom_begin'], - $begin, - $this->operator - ); - $this->query->addWhere( - $this->options['group'], - $this->options['api_param_custom_end'], - $end, - $this->operator - ); - } - } - } - -} diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/src/Plugin/views/filter/AZOpportunityTrellisViewsOpportunityTypeFilter b/modules/custom/az_opportunity/az_opportunity_trellis/src/Plugin/views/filter/AZOpportunityTrellisViewsOpportunityTypeFilter deleted file mode 100644 index f5c5b7fdf5..0000000000 --- a/modules/custom/az_opportunity/az_opportunity_trellis/src/Plugin/views/filter/AZOpportunityTrellisViewsOpportunityTypeFilter +++ /dev/null @@ -1,170 +0,0 @@ -entityRepository = $container->get('entity.repository'); - $instance->termStorage = $container->get('entity_type.manager')->getStorage('taxonomy_term'); - return $instance; - } - - /** - * {@inheritdoc} - */ - protected function valueForm(&$form, FormStateInterface $form_state): void { - $options = []; - $key = $this->options['az_attribute_key'] ?? ''; - - // Get the applicable type terms. - $query = $this->termStorage->getQuery() - ->accessCheck(TRUE) - ->addTag('taxonomy_term_access') - ->condition('vid', 'az_opportunity_type') - ->condition('field_az_opportunity_type_key', $key); - $parents = $query->execute(); - $children = []; - if (!empty($parents)) { - $query = $this->termStorage->getQuery() - ->accessCheck(TRUE) - ->sort('name') - ->addTag('taxonomy_term_access') - ->condition('parent', $parents, 'IN'); - $children = $query->execute(); - } - $terms = Term::loadMultiple($children); - // Build option list. - foreach ($terms as $term) { - if ($term->hasField('field_az_opportunity_type_key') && !empty($term->field_az_attribute_key->value)) { - $options[$term->field_az_opportunity_type_key->value] = $this->entityRepository->getTranslationFromContext($term)->label(); - } - } - $form['value'] = [ - '#type' => 'select', - '#title' => $this->t('Value'), - '#options' => $options, - '#required' => FALSE, - '#access' => !empty($options), - '#default_value' => $this->value, - ]; - } - - /** - * {@inheritdoc} - */ - public function operatorOptions(): array { - return [ - '=' => $this->t('Is equal to'), - '!=' => $this->t('Is not equal to'), - ]; - } - - /** - * {@inheritdoc} - */ - protected function defineOptions(): array { - $options = parent::defineOptions(); - $this->definePropertyPathOption($options); - $options['az_opportunity_type_key'] = ['default' => '']; - return $options; - } - - /** - * {@inheritdoc} - */ - public function buildOptionsForm(&$form, FormStateInterface $form_state): void { - $this->propertyPathElement($form, $this->options); - parent::buildOptionsForm($form, $form_state); - $form['az_opportunity_type_key'] = [ - '#title' => $this->t('Unique key of opportunity type'), - '#type' => 'textfield', - '#default_value' => $this->options['az_opportunity_type_key'] ?? '', - '#required' => TRUE, - ]; - } - - /** - * Return the attribute id and api parameter name. - * - * @return array - * An array with the key as the attribute id and the value as the api path. - */ - public function getApiMapping(): array { - $key = $this->options['az_opportunity_type_key'] ?? ''; - $path = $this->options['property_path'] ?? ''; - return [$key => $path]; - } - - /** - * {@inheritdoc} - */ - public function adminSummary() { - $prop = $this->options['property_path'] ?? ''; - $key = $this->options['az_opportunity_type_key'] ?? ''; - return $key . ' (API value ' . $prop . ') ' . $this->operator . ' ' . $this->value; - } - - /** - * {@inheritdoc} - */ - public function query($group_by = FALSE): void { - if (!($this->query instanceof RemoteDataQuery)) { - return; - } - $this->query->addWhere( - $this->options['group'], - $this->options['property_path'], - $this->value, - $this->operator - ); - } - -} diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/src/TrellisHelper.php b/modules/custom/az_opportunity/az_opportunity_trellis/src/TrellisHelper.php deleted file mode 100644 index b82f172ed4..0000000000 --- a/modules/custom/az_opportunity/az_opportunity_trellis/src/TrellisHelper.php +++ /dev/null @@ -1,314 +0,0 @@ -configFactory = $config_factory; - $this->httpClient = $http_client; - $this->cache = $cache; - $this->entityTypeManager = $entity_type_manager; - } - - /** - * Search based on parameters for opportunities. - * - * @param array $query - * Query parameters to use in search. - * - * @return array - * Array of trellis opportunity ids. - */ - public function searchOpportunities(array $query) { - $ids = []; - // Compute cache key of query. - $key = 'az_trellis_opportunity.search:' . Crypt::hashBase64(serialize($query)); - $cached = $this->cache->get($key); - // If we have this search cached, return it. - if ($cached !== FALSE) { - return $cached->data; - } - - $url = $this->getOpportunitiesSearchEndpoint(); - try { - // Run search request. - $response = $this->httpClient->request('GET', $url, ['query' => $query]); - if ($response->getStatusCode() === 200) { - $json = (string) $response->getBody(); - $json = json_decode($json, TRUE); - if ($json !== NULL) { - $ids = $json['data']['Opportunities_IDs'] ?? []; - // Ensure opportunities are in Id order. - sort($ids); - // @todo determine cache expiration. - $expire = time() + 1800; - // Cache search result. - $this->cache->set($key, $ids, $expire); - } - } - } - catch (GuzzleException $e) { - } - return $ids; - } - - /** - * Returns opportunity data for an array of ids. - * - * @param array $trellis_ids - * Trellis Opportunities IDs in an array. - * - * @return array - * Opportunities data. - */ - public function getOpportunities(array $trellis_ids) { - $opportunities = []; - $fetch = []; - $url = $this->getOpportunityEndpoint(); - // Remove any duplicate ids to mimic remote API. - $trellis_ids = array_unique($trellis_ids); - // Grab opportunities that are in cache. - foreach ($trellis_ids as $trellis_id) { - $cached = $this->getTrellisCache($trellis_id); - if ($cached === FALSE) { - $fetch[] = $trellis_id; - } - else { - $opportunities[] = $cached; - } - } - // Fetch opportunities we did not have cached. - if (!empty($fetch)) { - try { - $data = ['ids' => implode(',', $fetch)]; - $response = $this->httpClient->request('POST', $url, ['json' => $data]); - if ($response->getStatusCode() === 200) { - $json = (string) $response->getBody(); - $json = json_decode($json, TRUE); - if ($json !== NULL) { - $results = $json['data'] ?? []; - foreach ($results as $result) { - // Cache the opportunity and add it to the list. - $opportunities[] = $this->setTrellisCache($result); - } - } - } - } - catch (GuzzleException $e) { - } - } - // Make sure opportunities are in Id order regardless of cached/fetched. - usort($opportunities, function ($a, $b) { - return strcmp($a['Id'], $b['Id']); - }); - return $opportunities; - } - - /** - * Fetch the list of trellis opportunity ids currently imported. - * - * @return array - * Returns an array of opportunity ids. - */ - public function getImportedOpportunityIds() { - $nodeStorage = $this->entityTypeManager->getStorage('node'); - // Check for opportunities that have trellis ids. - $query = $nodeStorage->getQuery() - ->accessCheck(FALSE) - ->condition('type', 'az_opportunity') - ->exists('field_az_trellis_id'); - $nids = $query->execute(); - $nodes = $nodeStorage->loadMultiple($nids); - - $opportunity_api_ids = []; - foreach ($nodes as $n) { - $opportunity_api_ids[] = $n->get('field_az_trellis_id')->getString(); - } - return $opportunity_api_ids; - } - - /** - * Fetch the recurring search list of ids to import. - * - * @return array - * Returns an array of opportunity ids. - */ - public function getRecurringOpportunityIds() { - // Find enabled import configurations. - $imports = $this->entityTypeManager->getStorage('az_recurring_import_rule')->loadByProperties([ - 'status' => [1, TRUE], - ]); - - $opportunity_api_ids = []; - foreach ($imports as $import) { - /** @var \Drupal\az_opportunity_trellis\Entity\AZRecurringImportRule $import */ - $opportunity_api_ids += $import->getOpportunityIds(); - } - // Remove duplicates in case searches overlapped. - $opportunity_api_ids = array_unique($opportunity_api_ids); - return $opportunity_api_ids; - } - - /** - * Return mapped array of api names of attributes. - * - * @return array - * The array of attribute ids mapped to API names. - */ - public function getAttributeMappings() { - $mappings = []; - $view = Views::getView('az_opportunity_trellis_import'); - $display = $view->getDisplay() ?? NULL; - $filters = $display->getHandlers('filter'); - foreach ($filters as $filter) { - if ($filter instanceof AZOpportunityTrellisViewsAttributeFilter) { - $mappings += $filter->getApiMapping(); - } - } - return $mappings; - } - - /** - * Returns the cache for an opportunity if possible. - * - * @param string $trellis_id - * The trellis id of the opportunity. - * - * @return mixed - * The cached data for the opportunity, or FALSE. - */ - protected function getTrellisCache(string $trellis_id) { - $key = 'az_trellis_opportunity:' . $trellis_id; - return $this->cache->get($key)->data ?? FALSE; - } - - /** - * Sets the cache for an opportunity if possible. - * - * @param array $opportunity - * The opportunity data result. - * - * @return array - * The data for the opportunity. - */ - protected function setTrellisCache(array $opportunity) { - if (!empty($opportunity['Id'])) { - $key = 'az_trellis_opportunity:' . $opportunity['Id']; - // @todo determine cache expiration. - $expire = time() + 1800; - $this->cache->set($key, $opportunity, $expire); - } - return $opportunity; - } - - /** - * Returns API URL for given Trellis Opportunity ID. - * - * @param string $trellis_id - * Trellis Opportunity ID. - * - * @return string - * Opportunity API URL. - */ - public function getOpportunityUrl($trellis_id) { - $hostname = $this->configFactory->get('az_opportunity_trellis.settings')->get('api_hostname'); - return 'https://' . $hostname . self::$apiBasePath . $trellis_id; - } - - /** - * Returns API URL. - * - * @return string - * Opportunity API URL. - */ - public function getOpportunityEndpoint() { - $hostname = $this->configFactory->get('az_opportunity_trellis.settings')->get('api_hostname'); - return 'https://' . $hostname . self::$apiBasePath; - } - - /** - * Returns API search URL. - * - * @return string - * Opportunity API search URL. - */ - public function getOpportunitySearchEndpoint() { - $hostname = $this->configFactory->get('az_opportunity_trellis.settings')->get('api_hostname'); - return 'https://' . $hostname . self::$apiSearchPath; - } - -} From 49cf9e1972129a6a2189d37f026ffc9d70a2546b Mon Sep 17 00:00:00 2001 From: Z Saenz Date: Wed, 11 Feb 2026 07:58:36 -0700 Subject: [PATCH 16/59] phpcbf --- .../field.field.node.az_opportunity.field_az_attachments.yml | 2 +- .../field.field.node.az_opportunity.field_az_location.yml | 2 +- .../field.field.node.az_opportunity.field_az_media_image.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_attachments.yml b/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_attachments.yml index f7bcb871e6..6578fd5a5c 100644 --- a/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_attachments.yml +++ b/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_attachments.yml @@ -1 +1 @@ -{ } \ No newline at end of file +{ } diff --git a/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_location.yml b/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_location.yml index f7bcb871e6..6578fd5a5c 100644 --- a/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_location.yml +++ b/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_location.yml @@ -1 +1 @@ -{ } \ No newline at end of file +{ } diff --git a/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_media_image.yml b/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_media_image.yml index f7bcb871e6..6578fd5a5c 100644 --- a/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_media_image.yml +++ b/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_media_image.yml @@ -1 +1 @@ -{ } \ No newline at end of file +{ } From 075301ce3ff369a78b0d5d792a8f442ed5ca50c0 Mon Sep 17 00:00:00 2001 From: Z Saenz Date: Wed, 11 Feb 2026 08:09:16 -0700 Subject: [PATCH 17/59] removes devel file --- query.sql | 8 -------- 1 file changed, 8 deletions(-) delete mode 100644 query.sql diff --git a/query.sql b/query.sql deleted file mode 100644 index 236c01a5f7..0000000000 --- a/query.sql +++ /dev/null @@ -1,8 +0,0 @@ -SELECT "node__field_az_application_date"."field_az_application_date_value" AS "node__field_az_application_date_field_az_application_date_va", "node_field_data"."title" AS "node_field_data_title", "node_field_data"."nid" AS "nid" -FROM -{node_field_data} "node_field_data" -LEFT JOIN {node__field_az_ongoing} "node__field_az_ongoing" ON node_field_data.nid = node__field_az_ongoing.entity_id AND node__field_az_ongoing.deleted = '0' -LEFT JOIN {node__field_az_application_date} "node__field_az_application_date" ON node_field_data.nid = node__field_az_application_date.entity_id AND node__field_az_application_date.deleted = '0' -WHERE (("node_field_data"."status" = '1') AND ("node_field_data"."type" IN ('az_opportunity'))) AND ("node__field_az_ongoing"."field_az_ongoing_value" = '1') AND ((DATE_FORMAT((node__field_az_application_date.field_az_application_date_end_value + INTERVAL -25200 SECOND), '%Y-%m-%d') >= DATE_FORMAT('2026-01-23T15:15:00', '%Y-%m-%d'))) -ORDER BY "node__field_az_application_date_field_az_application_date_va" ASC, "node_field_data_title" ASC -LIMIT 11 OFFSET 0 From 22fc9032b88d2f284188ef3c5b87470188928a94 Mon Sep 17 00:00:00 2001 From: Z Saenz Date: Tue, 10 Mar 2026 13:22:47 -0700 Subject: [PATCH 18/59] First try for Trellis Importing - data pulls, importing and view not ready --- .../az_opportunity_trellis.info.yml | 21 + .../az_opportunity_trellis.install | 35 ++ .../az_opportunity_trellis.libraries.yml | 18 + .../az_opportunity_trellis.links.action.yml | 5 + .../az_opportunity_trellis.links.task.yml | 18 + .../az_opportunity_trellis.module | 155 ++++++ .../az_opportunity_trellis.routing.yml | 47 ++ .../az_opportunity_trellis.services.yml | 17 + .../az_opportunity_trellis.views.inc | 174 +++++++ .../az_opportunity_trellis.settings.yml | 1 + ...lus.migration.az_trellis_opportunities.yml | 36 ++ ...gration_group.az_trellis_opportunities.yml | 11 + ....cron_migration.az_opportunity_trellis.yml | 13 + ...ews.view.az_opportunity_trellis_import.yml | 487 ++++++++++++++++++ .../schema/az_opportunity_trellis.schema.yml | 39 ++ .../az_opportunity_trellis_datewrapper.css | 3 + .../js/az_opportunity_trellis_date.js | 27 + .../az_trellis_opportunities_files.yml | 42 ++ .../az_trellis_opportunities_media.yml | 56 ++ .../src/AZRecurringImportRuleInterface.php | 30 ++ .../src/AZRecurringImportRuleListBuilder.php | 56 ++ .../AZRecurringImportModalController.php | 101 ++++ .../src/Entity/AZRecurringImportRule.php | 129 +++++ .../AZOpportunityTrellisDataSubscriber.php | 158 ++++++ .../src/Form/AZRecurringImportRuleForm.php | 185 +++++++ .../Form/TrellisOpportunitySettingsForm.php | 53 ++ .../source/AZTrellisOpportunitySource.php | 144 ++++++ .../field/AZOpportunityTrellisViewsField.php | 160 ++++++ ...ZOpportunityTrellisViewsApprovalFilter.php | 96 ++++ ...OpportunityTrellisViewsAttributeFilter.php | 170 ++++++ .../AZOpportunityTrellisViewsDateFilter.php | 289 +++++++++++ .../src/TrellisHelper.php | 314 +++++++++++ 32 files changed, 3090 insertions(+) create mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.info.yml create mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.install create mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.libraries.yml create mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.links.action.yml create mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.links.task.yml create mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.module create mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.routing.yml create mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.services.yml create mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.views.inc create mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/config/install/az_opportunity_trellis.settings.yml create mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/config/install/migrate_plus.migration.az_trellis_opportunities.yml create mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/config/install/migrate_plus.migration_group.az_trellis_opportunities.yml create mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/config/install/migrate_queue_importer.cron_migration.az_opportunity_trellis.yml create mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/config/install/views.view.az_opportunity_trellis_import.yml create mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/config/schema/az_opportunity_trellis.schema.yml create mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/css/az_opportunity_trellis_datewrapper.css create mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/js/az_opportunity_trellis_date.js create mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/migrations/az_trellis_opportunities_files.yml create mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/migrations/az_trellis_opportunities_media.yml create mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/src/AZRecurringImportRuleInterface.php create mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/src/AZRecurringImportRuleListBuilder.php create mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/src/Controller/AZRecurringImportModalController.php create mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/src/Entity/AZRecurringImportRule.php create mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/src/EventSubscriber/AZOpportunityTrellisDataSubscriber.php create mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/src/Form/AZRecurringImportRuleForm.php create mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/src/Form/TrellisOpportunitySettingsForm.php create mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/src/Plugin/migrate/source/AZTrellisOpportunitySource.php create mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/src/Plugin/views/field/AZOpportunityTrellisViewsField.php create mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/src/Plugin/views/filter/AZOpportunityTrellisViewsApprovalFilter.php create mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/src/Plugin/views/filter/AZOpportunityTrellisViewsAttributeFilter.php create mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/src/Plugin/views/filter/AZOpportunityTrellisViewsDateFilter.php create mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/src/TrellisHelper.php diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.info.yml b/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.info.yml new file mode 100644 index 0000000000..342e9d52c1 --- /dev/null +++ b/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.info.yml @@ -0,0 +1,21 @@ +name: Quickstart Opportunity - Trellis Opportunity Importer +type: module +description: 'Import opportunities from Trellis Programs, the official University of Arizona program management tool.' +core_version_requirement: ^11.3 || ^12 +package: 'The University of Arizona - Experimental' +lifecycle: experimental +lifecycle_link: 'https://github.com/az-digital/az_quickstart/blob/main/RELEASES.md#experimental-features' +php: 8.0 + +dependencies: + - az_core:az_core + - az_opportunity:az_opportunity + - az_migration:az_migration_remote + - drupal:views + - drupal:migrate + - migrate_plus:migrate_plus + - migrate_tools:migrate_tools + - migrate_queue_importer:migrate_queue_importer + - views_remote_data:views_remote_data + +configure: az_opportunity_trellis.settings diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.install b/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.install new file mode 100644 index 0000000000..8f6afbf8ca --- /dev/null +++ b/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.install @@ -0,0 +1,35 @@ +install(['views_remote_data']); +} + +/** + * Ensure az_recurring_import_rule entity type is installed. + */ +function az_opportunity_trellis_update_1021001() { + $changes = \Drupal::entityDefinitionUpdateManager()->getChangeList(); + $status = $changes['az_recurring_import_rule']['entity_type'] ?? ''; + // Determine if recurring import rule entity needs to be created. + if ($status === EntityDefinitionUpdateManagerInterface::DEFINITION_CREATED) { + $entity_type_definition = \Drupal::service('entity_type.manager')->getDefinition('az_recurring_import_rule'); + \Drupal::entityDefinitionUpdateManager()->installEntityType($entity_type_definition); + } +} + +/** + * Ensure az_migration_remote is installed. + */ +function az_opportunity_trellis_update_1021301() { + \Drupal::service('module_installer')->install(['az_migration_remote']); +} diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.libraries.yml b/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.libraries.yml new file mode 100644 index 0000000000..02849af8d1 --- /dev/null +++ b/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.libraries.yml @@ -0,0 +1,18 @@ +az_opportunity_trellis_date: + js: + js/az_opportunity_trellis_date.js: {} + css: + theme: + css/az_opportunity_trellis_datewrapper.css: {} + dependencies: + - core/drupal + - core/drupalSettings + - core/once + - az_opportunity_trellis/easepick_bundle +easepick_bundle: + js: + /libraries/easepick--bundle/dist/index.umd.js: { minified: true } +easepick_styles: + css: + theme: + /libraries/easepick--bundle/dist/index.css: { minified: true } diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.links.action.yml b/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.links.action.yml new file mode 100644 index 0000000000..2fbeb0bbfe --- /dev/null +++ b/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.links.action.yml @@ -0,0 +1,5 @@ +entity.az_recurring_import_rule.add_form: + route_name: 'entity.az_recurring_import_rule.add_form' + title: 'Add Recurring Import Rule' + appears_on: + - entity.az_recurring_import_rule.collection diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.links.task.yml b/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.links.task.yml new file mode 100644 index 0000000000..d2b3ae045e --- /dev/null +++ b/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.links.task.yml @@ -0,0 +1,18 @@ +az_opportunity_trellis.az_opportunity_trellis_settings_task: + route_name: az_opportunity_trellis.settings + title: 'AZ Trellis Opportunity Importer' + base_route: az_core.az_settings + weight: 0 + +az_opportunity.import_form_task: + title: 'Trellis opportunity importer' + route_name: view.az_opportunity_trellis_import.page_1 + parent_id: system.admin_content + description: 'Import opportunities from the Trellis Opportunity API.' + weight: 101 + +az_opportunity_trellis.az_recurring_import_rules_tab: + route_name: entity.az_recurring_import_rule.collection + title: 'Recurring Imports' + base_route: az_core.az_settings + weight: 5 diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.module b/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.module new file mode 100644 index 0000000000..69af532bcd --- /dev/null +++ b/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.module @@ -0,0 +1,155 @@ +getFormObject(); + if ($form_object instanceof EntityFormInterface) { + /** @var \Drupal\node\NodeInterface $node */ + $node = $form_object->getEntity(); + $trellis_id = $node->get('field_az_trellis_id')->getString(); + if (!empty($trellis_id)) { + $trellis_link_url = TrellisHelper::$opportunityViewBasePath . $trellis_id . '/view'; + $trellis_warning = t('This opportunity has been imported from Trellis Opportunities. Opportunity details can only be edited by a Trellis user in Trellis Opportunities.', [ + '@trellis-url' => $trellis_link_url, + ]); + \Drupal::messenger()->addWarning($trellis_warning); + + $disabled_fields = [ + 'title', + // 'field_az_location', + // 'field_az_event_date', + // 'field_az_link', + // 'field_az_summary', + // 'field_az_photos', + // 'field_az_enterprise_attributes', + ]; + foreach ($disabled_fields as $field) { + $form[$field]['#disabled'] = TRUE; + } + + $no_access_fields = [ + // 'field_az_subheading', + 'field_az_body', + // 'field_az_contacts', + // 'field_az_attachments', + ]; + foreach ($no_access_fields as $field) { + $form[$field]['#access'] = FALSE; + } + } + } +} + +/** + * Gather exposed API parameters from view. + * + * @param mixed $form + * An associative array containing the structure of the form. + * @param \Drupal\Core\Form\FormStateInterface $form_state + * The current state of the form. + * + * @return array + * The remote API search values. + */ +function az_opportunity_trellis_gather_filter_options(&$form, FormStateInterface $form_state) { + $search = []; + /** @var \Drupal\views\ViewExecutable $view */ + $view = $form_state->get('view'); + // Consult the filter handlers of the view. + if (!empty($view->filter)) { + /** @var \Drupal\views\Plugin\views\ViewsHandlerInterface[] $handlers */ + $handlers = $view->filter; + // Get exposed search information. + $input = $view->getExposedInput(); + if (empty($input)) { + return []; + } + // Loops through handlers to find inputs we want. + /** @var \Drupal\views\Plugin\views\filter\FilterPluginBase $handler */ + foreach ($handlers as $handler) { + if ($handler->isExposed()) { + $info = $handler->exposedInfo(); + $identifier = $info['value'] ?? ''; + // Make sure our input for this exposed filter isn't NULL. + // This won't normally happen in an actual GET form. + if (!isset($input[$identifier])) { + $input[$identifier] = ''; + } + // Check if the handler validates versus the input. + if ($handler->acceptExposedInput($input)) { + // If the handler accepts the input, bundle it up. + $value = $input[$identifier] ?? ''; + if (!empty($identifier) && !empty($value)) { + if ($handler instanceof AZOpportunityTrellisViewsAttributeFilter) { + // Attributes handled separately since they are from a remote API. + $search['attributes'][$identifier] = $value; + } + else { + $search[$identifier] = $value; + } + } + } + } + } + } + // Don't return id or date fields, unnecessary for recurring imports. + unset($search['id']); + unset($search['start']); + unset($search['modified']); + return $search; +} + +/** + * Implements hook_form_FORM_ID_alter(). + * + * Add clickable link that opens import configuration modal. + */ +function az_opportunity_trellis_form_views_exposed_form_alter(&$form, FormStateInterface $form_state, $form_id) { + + $view = $form_state->get('view'); + if (($view->id() === 'az_opportunity_trellis_import') && ($view->current_display === 'page_1')) { + + // Don't create configuration link if user does not have permission. + if (!\Drupal::currentUser()->hasPermission('administer quickstart configuration')) { + return; + } + $search = az_opportunity_trellis_gather_filter_options($form, $form_state); + if (!empty($search)) { + // We cannot use an ajax response here to open a dialog. + // Exposed forms do not support ajax callbacks. Cache search parameters. + // Compute cache key of parameters. + $key = 'az_recurring_import_modal:' . Crypt::hashBase64(serialize($search)); + $expire = time() + 1200; + // Cache the search. + \Drupal::service('cache.default')->set($key, $search, $expire); + $form['#attached']['library'][] = 'core/drupal.dialog.ajax'; + // Add a link to open the modal. + $form['actions']['recurring'] = [ + '#type' => 'link', + '#title' => t('Create Recurring Import'), + '#url' => Url::fromRoute('entity.az_recurring_import_rule.modal'), + // Pass the search parameters cache key as an argument. + '#options' => ['query' => ['search' => $key]], + '#attributes' => ['class' => ['use-ajax', 'button']], + ]; + } + } +} diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.routing.yml b/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.routing.yml new file mode 100644 index 0000000000..607ac65714 --- /dev/null +++ b/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.routing.yml @@ -0,0 +1,47 @@ +az_opportunity_trellis.settings: + path: '/admin/config/az-quickstart/settings/az-opportunity-trellis' + defaults: + _form: '\Drupal\az_opportunity_trellis\Form\TrellisOpportunitySettingsForm' + _title: 'Trellis Opportunity Importer Settings' + requirements: + _permission: 'administer quickstart configuration' + +entity.az_recurring_import_rule.collection: + path: '/admin/config/az-quickstart/settings/az-recurring-import-rule' + defaults: + _entity_list: 'az_recurring_import_rule' + _title: 'Recurring Import Rule configuration' + requirements: + _permission: 'administer quickstart configuration' + +entity.az_recurring_import_rule.add_form: + path: '/admin/config/az-quickstart/settings/az-recurring-import-rule/add' + defaults: + _entity_form: 'az_recurring_import_rule.add' + _title: 'Add a recurring import rule' + requirements: + _permission: 'administer quickstart configuration' + +entity.az_recurring_import_rule.edit_form: + path: '/admin/config/az-quickstart/settings/az-recurring-import-rule/{az_recurring_import_rule}' + defaults: + _entity_form: 'az_recurring_import_rule.edit' + _title: 'Edit a recurring import rule' + requirements: + _permission: 'administer quickstart configuration' + +entity.az_recurring_import_rule.delete_form: + path: '/admin/config/az-quickstart/settings/az-recurring-import-rule/{az_recurring_import_rule}/delete' + defaults: + _entity_form: 'az_recurring_import_rule.delete' + _title: 'Delete a recurring import rule' + requirements: + _permission: 'administer quickstart configuration' + +entity.az_recurring_import_rule.modal: + path: '/admin/az-opportunity-trellis-modal' + defaults: + _title: 'Entity Az Recurring Import Rule Modal' + _controller: '\Drupal\az_opportunity_trellis\Controller\AZRecurringImportModalController' + requirements: + _permission: 'administer quickstart configuration' diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.services.yml b/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.services.yml new file mode 100644 index 0000000000..cab26fdcf7 --- /dev/null +++ b/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.services.yml @@ -0,0 +1,17 @@ +services: + _defaults: + autoconfigure: true + az_opportunity_trellis.trellis_helper: + class: Drupal\az_opportunity_trellis\TrellisHelper + arguments: + - '@config.factory' + - '@http_client' + - '@cache.default' + - '@entity_type.manager' + az_opportunity_trellis.trellis_opportunity_data: + class: Drupal\az_opportunity_trellis\EventSubscriber\AZOpportunityTrellisDataSubscriber + arguments: + - '@az_opportunity_trellis.trellis_helper' + - '@messenger' + - '@entity_type.manager' + - '@current_user' diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.views.inc b/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.views.inc new file mode 100644 index 0000000000..cf65728f8f --- /dev/null +++ b/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.views.inc @@ -0,0 +1,174 @@ + t('Trellis Opportunities'), + 'query_id' => 'views_remote_data_query', + ]; + $data['az_opportunity_trellis_data']['Id'] = [ + 'title' => t('Trellis Opportunity ID'), + 'help' => t('Unique key of Trellis opportunity.'), + 'field' => [ + 'id' => 'az_opportunity_trellis_views_field', + ], + ]; + $data['az_opportunity_trellis_data']['Start_Options__c'] = [ + 'title' => t('Trellis Opportunity Start Options'), + 'help' => t('When the opportunity usually begins'), + 'field' => [ + 'id' => 'az_opportunity_trellis_views_start_options', + ], + ]; + $data['az_opportunity_trellis_data']['Program_Format__c'] = [ + 'title' => t('Trellis Opportunity Program Format'), + 'help' => t('Modality for the program attendance'), + 'field' => [ + 'id' => 'az_opportunity_trellis_views_modality', + ], + ]; + $data['az_opportunity_trellis_data']['Length_Of_Program__c'] = [ + 'title' => t('Trellis Opportunity Length of Program'), + 'help' => t('How long does this program typically last'), + 'field' => [ + 'id' => 'az_opportunity_trellis_views_length_of_program', + ], + ]; + $data['az_opportunity_trellis_data']['Incentives__c'] = [ + 'title' => t('Trellis Opportunity Incentives'), + 'help' => t('Does this program have incentives?'), + 'field' => [ + 'id' => 'az_opportunity_trellis_views_incentives', + ], + ]; + $data['az_opportunity_trellis_data']['Credit_Type__c'] = [ + 'title' => t('Trellis Opportunity Credits'), + 'help' => t('What credits does this opportunity offer'), + 'field' => [ + 'id' => 'az_opportunity_trellis_views_credits', + ], + ]; + $data['az_opportunity_trellis_data']['Location__c'] = [ + 'title' => t('Trellis Opportunity Location'), + 'help' => t('Where this opportunity takes place'), + 'field' => [ + 'id' => 'az_opportunity_trellis_views_location', + ], + ]; + $data['az_opportunity_trellis_data']['Program_Website__c'] = [ + 'title' => t('Trellis Opportunity Program Website'), + 'help' => t('Link to Program website'), + 'field' => [ + 'id' => 'az_opportunity_trellis_views_program_website', + ], + ]; + $data['az_opportunity_trellis_data']['Program_Description__c'] = [ + 'title' => t('Trellis Opportunity Description'), + 'help' => t('Description'), + 'field' => [ + 'id' => 'az_opportunity_trellis_views_description', + ], + ]; + $data['az_opportunity_trellis_data']['Eligibility__c'] = [ + 'title' => t('Trellis Opportunity Eligibility'), + 'help' => t('Eligibility'), + 'field' => [ + 'id' => 'az_opportunity_trellis_views_eligibility', + ], + ]; + $data['az_opportunity_trellis_data']['Topic__c'] = [ + 'title' => t('Trellis Opportunity Topic'), + 'help' => t('Topics'), + 'field' => [ + 'id' => 'az_opportunity_trellis_views_topic', + ], + ]; + $data['az_opportunity_trellis_data']['Audiences__c'] = [ + 'title' => t('Trellis Opportunity Topic'), + 'help' => t('Topics'), + 'field' => [ + 'id' => 'az_opportunity_trellis_views_audiences', + ], + ]; + $data['az_opportunity_trellis_data']['Application_Open__c'] = [ + 'title' => t('Trellis Opportunity Application Open Date'), + 'help' => t('When the applications are open'), + 'field' => [ + 'id' => 'az_opportunity_trellis_views_application_open', + ], + ]; + $data['az_opportunity_trellis_data']['Application_Closed__c'] = [ + 'title' => t('Trellis Opportunity Application Closed Date'), + 'help' => t('When the applications are closed'), + 'field' => [ + 'id' => 'az_opportunity_trellis_views_application_closed', + ], + ]; + $data['az_opportunity_trellis_data']['Start_Date__c'] = [ + 'title' => t('Trellis Opportunity Program Start Date'), + 'help' => t('When the Program starts'), + 'field' => [ + 'id' => 'az_opportunity_trellis_views_program_start_date', + ], + ]; + $data['az_opportunity_trellis_data']['End_Date__c'] = [ + 'title' => t('Trellis Opportunity Program End Date'), + 'help' => t('When the Program ends'), + 'field' => [ + 'id' => 'az_opportunity_trellis_views_program_end_date', + ], + ]; + $data['az_opportunity_trellis_data']['Ongoing__c'] = [ + 'title' => t('Trellis Opportunity Ongoing'), + 'help' => t('Does this opportunity repeat'), + 'field' => [ + 'id' => 'az_opportunity_trellis_views_ongoing', + ], + ]; + $data['az_opportunity_trellis_data']['Last_Modified_Date'] = [ + 'title' => t('Trellis Opportunity Last Modified Date'), + 'help' => t('When the opportunity was last edited'), + 'field' => [ + 'id' => 'az_opportunity_trellis_views_last_modified', + ], + ]; + $data['az_opportunity_trellis_data']['Parent_Account_Name'] = [ + 'title' => t('Trellis Opportunity Parent Account Name'), + 'help' => t('Parent Opportunity Name'), + 'field' => [ + 'id' => 'az_opportunity_trellis_views_parent_name', + ], + ]; + $data['az_opportunity_trellis_data']['Parent_Id'] = [ + 'title' => t('Trellis Opportunity Parent Id'), + 'help' => t('Parent Opportunity ID'), + 'field' => [ + 'id' => 'az_opportunity_trellis_views_parent_id', + ], + ]; + $data['az_opportunity_trellis_data']['Owner_NetID'] = [ + 'title' => t('Trellis Opportunity Owner NetID'), + 'help' => t('Parent Opportunity Owner Netid'), + 'field' => [ + 'id' => 'az_opportunity_trellis_views_owner_netid', + ], + ]; + $data['az_opportunity_trellis_data']['Program_Type__c'] = [ + 'title' => t('Trellis Opportunity Program Type'), + 'help' => t('Parent Opportunity Program Type'), + 'field' => [ + 'id' => 'az_opportunity_trellis_views_program_type', + ], + ]; + return $data; +} \ No newline at end of file diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/config/install/az_opportunity_trellis.settings.yml b/modules/custom/az_opportunity/az_opportunity_trellis/config/install/az_opportunity_trellis.settings.yml new file mode 100644 index 0000000000..64c46470c0 --- /dev/null +++ b/modules/custom/az_opportunity/az_opportunity_trellis/config/install/az_opportunity_trellis.settings.yml @@ -0,0 +1 @@ +api_hostname: 'api.qa.eips.arizona.edu' \ No newline at end of file diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/config/install/migrate_plus.migration.az_trellis_opportunities.yml b/modules/custom/az_opportunity/az_opportunity_trellis/config/install/migrate_plus.migration.az_trellis_opportunities.yml new file mode 100644 index 0000000000..bec3b19129 --- /dev/null +++ b/modules/custom/az_opportunity/az_opportunity_trellis/config/install/migrate_plus.migration.az_trellis_opportunities.yml @@ -0,0 +1,36 @@ +langcode: en +status: true +dependencies: { } +id: az_trellis_opportunities +class: null +field_plugin_method: null +cck_plugin_method: null +migration_tags: + - Opportunities +migration_group: az_trellis_opportunities +label: 'Trellis Opportunities' +source: + plugin: az_trellis_opportunities_api + trellis_ids: { } + track_changes: true + fields: + - + name: id + label: ID + selector: Id + - + name: name + label: Name + selector: Name + ids: + id: + type: string +process: + title: name +destination: + plugin: 'entity:node' + default_bundle: az_opportunity + validate: false +migration_dependencies: + optional: + - az_trellis_opportunities_media diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/config/install/migrate_plus.migration_group.az_trellis_opportunities.yml b/modules/custom/az_opportunity/az_opportunity_trellis/config/install/migrate_plus.migration_group.az_trellis_opportunities.yml new file mode 100644 index 0000000000..a6694b66d8 --- /dev/null +++ b/modules/custom/az_opportunity/az_opportunity_trellis/config/install/migrate_plus.migration_group.az_trellis_opportunities.yml @@ -0,0 +1,11 @@ +langcode: en +status: true +dependencies: + module: + - az_opportunity_trellis +id: az_trellis_opportunities +label: 'AZ Trellis Opportunities' +description: 'Import AZ Opportunities from Trellis Programs.' +source_type: 'Trellis Opportunity' +module: az_opportunity_trellis +shared_configuration: null diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/config/install/migrate_queue_importer.cron_migration.az_opportunity_trellis.yml b/modules/custom/az_opportunity/az_opportunity_trellis/config/install/migrate_queue_importer.cron_migration.az_opportunity_trellis.yml new file mode 100644 index 0000000000..26216a73d0 --- /dev/null +++ b/modules/custom/az_opportunity/az_opportunity_trellis/config/install/migrate_queue_importer.cron_migration.az_opportunity_trellis.yml @@ -0,0 +1,13 @@ +langcode: en +status: true +dependencies: + enforced: + module: + - az_opportunity_trellis +id: az_opportunity_trellis +label: 'Quickstart Trellis Opportunites' +migration: az_trellis_opportunities +time: 43200 +update: false +sync: false +ignore_dependencies: 0 diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/config/install/views.view.az_opportunity_trellis_import.yml b/modules/custom/az_opportunity/az_opportunity_trellis/config/install/views.view.az_opportunity_trellis_import.yml new file mode 100644 index 0000000000..e06ec3bde7 --- /dev/null +++ b/modules/custom/az_opportunity/az_opportunity_trellis/config/install/views.view.az_opportunity_trellis_import.yml @@ -0,0 +1,487 @@ +langcode: en +status: true +dependencies: + module: + - az_opportunity_trellis + - user + - views_remote_data +id: az_opportunity_trellis_import +label: 'Trellis Opportunity Importer' +module: views +description: '' +tag: '' +base_table: az_opportunity_trellis_data +base_field: '' +display: + default: + id: default + display_title: Default + display_plugin: default + position: 0 + display_options: + title: 'Trellis Opportunity Importer' + fields: + Id: + id: Id + table: az_opportunity_trellis_data + field: Id + relationship: none + group_type: group + admin_label: '' + entity_type: null + entity_field: null + plugin_id: az_opportunity_trellis_views_field + label: 'Trellis Opportunity ID' + exclude: false + alter: + alter_text: false + text: '' + make_link: false + path: '' + absolute: false + external: false + replace_spaces: false + path_case: none + trim_whitespace: false + alt: '' + rel: '' + link_class: '' + prefix: '' + suffix: '' + target: '' + nl2br: false + max_length: 0 + word_boundary: true + ellipsis: true + more_link: false + more_link_text: '' + more_link_path: '' + strip_tags: false + trim: false + preserve_tags: '' + html: false + element_type: '' + element_class: '' + element_label_type: '' + element_label_class: '' + element_label_colon: true + element_wrapper_type: '' + element_wrapper_class: '' + element_default_classes: true + empty: '' + hide_empty: false + empty_zero: false + hide_alter_empty: true + action_title: Action + include_exclude: exclude + selected_actions: { } + property: + id: property + table: az_opportunity_trellis_data + field: property + relationship: none + group_type: group + admin_label: '' + plugin_id: views_remote_data_property + label: Name + exclude: false + alter: + alter_text: false + text: '' + make_link: false + path: '' + absolute: false + external: false + replace_spaces: false + path_case: none + trim_whitespace: false + alt: '' + rel: '' + link_class: '' + prefix: '' + suffix: '' + target: '' + nl2br: false + max_length: 0 + word_boundary: true + ellipsis: true + more_link: false + more_link_text: '' + more_link_path: '' + strip_tags: false + trim: false + preserve_tags: '' + html: false + element_type: '' + element_class: '' + element_label_type: '' + element_label_class: '' + element_label_colon: true + element_wrapper_type: '' + element_wrapper_class: '' + element_default_classes: true + empty: '' + hide_empty: false + empty_zero: false + hide_alter_empty: true + property_path: Name + property_1: + id: property_1 + table: az_opportunity_trellis_data + field: property + relationship: none + group_type: group + admin_label: '' + plugin_id: views_remote_data_property + label: 'Program Website' + exclude: false + alter: + alter_text: false + text: '' + make_link: false + path: '' + absolute: false + external: false + replace_spaces: false + path_case: none + trim_whitespace: false + alt: '' + rel: '' + link_class: '' + prefix: '' + suffix: '' + target: '' + nl2br: false + max_length: 0 + word_boundary: true + ellipsis: true + more_link: false + more_link_text: '' + more_link_path: '' + strip_tags: false + trim: false + preserve_tags: '' + html: false + element_type: '' + element_class: '' + element_label_type: '' + element_label_class: '' + element_label_colon: true + element_wrapper_type: '' + element_wrapper_class: '' + element_default_classes: true + empty: '' + hide_empty: false + empty_zero: false + hide_alter_empty: true + property_path: Program_Website__c + property_2: + id: property_2 + table: az_opportunity_trellis_data + field: property + relationship: none + group_type: group + admin_label: '' + plugin_id: views_remote_data_property + label: 'Start Date' + exclude: false + alter: + alter_text: false + text: '' + make_link: false + path: '' + absolute: false + external: false + replace_spaces: false + path_case: none + trim_whitespace: false + alt: '' + rel: '' + link_class: '' + prefix: '' + suffix: '' + target: '' + nl2br: false + max_length: 0 + word_boundary: true + ellipsis: true + more_link: false + more_link_text: '' + more_link_path: '' + strip_tags: false + trim: false + preserve_tags: '' + html: false + element_type: '' + element_class: '' + element_label_type: '' + element_label_class: '' + element_label_colon: false + element_wrapper_type: '' + element_wrapper_class: '' + element_default_classes: true + empty: '' + hide_empty: false + empty_zero: false + hide_alter_empty: true + property_path: Start_Date__c + property_3: + id: property_3 + table: az_opportunity_trellis_data + field: property + relationship: none + group_type: group + admin_label: '' + plugin_id: views_remote_data_property + label: NetID + exclude: false + alter: + alter_text: false + text: '' + make_link: false + path: '' + absolute: false + external: false + replace_spaces: false + path_case: none + trim_whitespace: false + alt: '' + rel: '' + link_class: '' + prefix: '' + suffix: '' + target: '' + nl2br: false + max_length: 0 + word_boundary: true + ellipsis: true + more_link: false + more_link_text: '' + more_link_path: '' + strip_tags: false + trim: false + preserve_tags: '' + html: false + element_type: '' + element_class: '' + element_label_type: '' + element_label_class: '' + element_label_colon: true + element_wrapper_type: '' + element_wrapper_class: '' + element_default_classes: true + empty: '' + hide_empty: false + empty_zero: false + hide_alter_empty: true + property_path: Owner_NetID + property_4: + id: property_4 + table: az_opportunity_trellis_data + field: property + relationship: none + group_type: group + admin_label: '' + plugin_id: views_remote_data_property + label: 'Parent ID' + exclude: false + alter: + alter_text: false + text: '' + make_link: false + path: '' + absolute: false + external: false + replace_spaces: false + path_case: none + trim_whitespace: false + alt: '' + rel: '' + link_class: '' + prefix: '' + suffix: '' + target: '' + nl2br: false + max_length: 0 + word_boundary: true + ellipsis: true + more_link: false + more_link_text: '' + more_link_path: '' + strip_tags: false + trim: false + preserve_tags: '' + html: false + element_type: '' + element_class: '' + element_label_type: '' + element_label_class: '' + element_label_colon: false + element_wrapper_type: '' + element_wrapper_class: '' + element_default_classes: true + empty: '' + hide_empty: false + empty_zero: false + hide_alter_empty: true + property_path: Parent_Id + pager: + type: mini + options: + offset: 0 + pagination_heading_level: h4 + items_per_page: 10 + total_pages: null + id: 0 + tags: + next: ›› + previous: ‹‹ + expose: + items_per_page: false + items_per_page_label: 'Items per page' + items_per_page_options: '5, 10, 25, 50' + items_per_page_options_all: false + items_per_page_options_all_label: '- All -' + offset: false + offset_label: Offset + exposed_form: + type: basic + options: + submit_button: Search + reset_button: true + reset_button_label: Reset + exposed_sorts_label: 'Sort by' + expose_sort_order: false + sort_asc_label: Asc + sort_desc_label: Desc + access: + type: perm + options: + perm: 'create az_opportunity content' + cache: + type: none + options: { } + empty: { } + sorts: { } + arguments: { } + filters: + property: + id: property + table: az_opportunity_trellis_data + field: property + relationship: none + group_type: group + admin_label: '' + plugin_id: views_remote_data_property + operator: '=' + value: '' + group: 1 + exposed: true + expose: + operator_id: property_op + label: Name + description: '' + use_operator: false + operator: property_op + operator_limit_selection: false + operator_list: { } + identifier: property + required: false + remember: false + multiple: false + remember_roles: + authenticated: authenticated + is_grouped: false + group_info: + label: '' + description: '' + identifier: '' + optional: true + widget: select + multiple: false + remember: false + default_group: All + default_group_multiple: { } + group_items: { } + property_path: Name + property_1: + id: property_1 + table: az_opportunity_trellis_data + field: property + relationship: none + group_type: group + admin_label: '' + plugin_id: views_remote_data_property + operator: '=' + value: '' + group: 1 + exposed: true + expose: + operator_id: property_1_op + label: 'Owner NetID' + description: '' + use_operator: false + operator: property_1_op + operator_limit_selection: false + operator_list: { } + identifier: property_1 + required: false + remember: false + multiple: false + remember_roles: + authenticated: authenticated + is_grouped: false + group_info: + label: '' + description: '' + identifier: '' + optional: true + widget: select + multiple: false + remember: false + default_group: All + default_group_multiple: { } + group_items: { } + property_path: Owner_NetID + filter_groups: + operator: AND + groups: + 1: AND + style: + type: table + row: + type: fields + query: + type: views_query + options: { } + relationships: { } + use_ajax: true + header: { } + footer: { } + display_extenders: { } + cache_metadata: + max-age: 0 + contexts: + - 'languages:language_interface' + - url + - url.query_args + - user.permissions + tags: + - views_remote_data + page_1: + id: page_1 + display_title: Page + display_plugin: page + position: 1 + display_options: + display_extenders: { } + path: admin/trellis-opportunity-importer + cache_metadata: + max-age: 0 + contexts: + - 'languages:language_interface' + - url + - url.query_args + - user.permissions + tags: + - views_remote_data diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/config/schema/az_opportunity_trellis.schema.yml b/modules/custom/az_opportunity/az_opportunity_trellis/config/schema/az_opportunity_trellis.schema.yml new file mode 100644 index 0000000000..576f05a01c --- /dev/null +++ b/modules/custom/az_opportunity/az_opportunity_trellis/config/schema/az_opportunity_trellis.schema.yml @@ -0,0 +1,39 @@ +views.filter_value.az_opportunity_trellis_views_date_filter: + type: views_filter + label: 'Trellis filter' + mapping: + value: + type: string + label: 'Value' + begin: + type: string + label: 'Custom Date Range Begin' + end: + type: string + label: 'Custom Date Range End' +az_opportunity_trellis.az_recurring_import_rule.*: + type: config_entity + label: Trellis Opportunity Import + mapping: + id: + type: machine_name + label: ID + label: + type: label + label: Label + uuid: + type: uuid + host: + type: string + owner: + type: string + keyword: + type: string + attributes: + type: sequence + label: ‘Enterprise Attributes’ + sequence: + type: string + label: ‘Attribute’ + approval: + type: string diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/css/az_opportunity_trellis_datewrapper.css b/modules/custom/az_opportunity/az_opportunity_trellis/css/az_opportunity_trellis_datewrapper.css new file mode 100644 index 0000000000..6fef13e186 --- /dev/null +++ b/modules/custom/az_opportunity/az_opportunity_trellis/css/az_opportunity_trellis_datewrapper.css @@ -0,0 +1,3 @@ +.az-opportunity-trellis-datewrapper.views-exposed-form__item .form-item:first-child { + margin-top: 0; +} \ No newline at end of file diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/js/az_opportunity_trellis_date.js b/modules/custom/az_opportunity/az_opportunity_trellis/js/az_opportunity_trellis_date.js new file mode 100644 index 0000000000..911cef299d --- /dev/null +++ b/modules/custom/az_opportunity/az_opportunity_trellis/js/az_opportunity_trellis_date.js @@ -0,0 +1,27 @@ +/** + * @file + * Trellis date range picker. + */ + +((Drupal, drupalSettings, once) => { + Drupal.behaviors.trellisDatePicker = { + attach(context) { + const elements = once('aztrellisdate', '.az-trellis-daterange', context); + elements.forEach((element) => { + const begin = element; + const id = element.dataset.azTrellisDaterangeEnd; + const end = document.getElementById(id); + // eslint-disable-next-line no-unused-vars, no-undef, new-cap + const picker = new easepick.create({ + element: begin, + css: drupalSettings.trellisDatePicker.css, + zIndex: 10, + RangePlugin: { + elementEnd: end, + }, + plugins: ['RangePlugin'], + }); + }); + }, + }; +})(Drupal, drupalSettings, once); diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/migrations/az_trellis_opportunities_files.yml b/modules/custom/az_opportunity/az_opportunity_trellis/migrations/az_trellis_opportunities_files.yml new file mode 100644 index 0000000000..9c68873b56 --- /dev/null +++ b/modules/custom/az_opportunity/az_opportunity_trellis/migrations/az_trellis_opportunities_files.yml @@ -0,0 +1,42 @@ +id: az_trellis_opportunities_files +label: Trellis Opportunities Files +source: + plugin: az_trellis_opportunities_api + trellis_ids: { } + track_changes: true + fields: + - + name: id + label: ID + selector: Id + - + name: image_url + label: 'Image URL' + selector: Image_URL + ids: + id: + type: string + +process: + status: + plugin: default_value + default_value: 1 + + uri: + - + plugin: az_migration_remote_file + migration: az_trellis_opportunities_files + default_filename: id + directory: 'public://trellis-opportunities' + source_ids: + - id + source: image_url + - + plugin: skip_on_empty + method: row + uid: + plugin: default_value + default_value: 0 + +destination: + plugin: entity:file diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/migrations/az_trellis_opportunities_media.yml b/modules/custom/az_opportunity/az_opportunity_trellis/migrations/az_trellis_opportunities_media.yml new file mode 100644 index 0000000000..a9b0888f7e --- /dev/null +++ b/modules/custom/az_opportunity/az_opportunity_trellis/migrations/az_trellis_opportunities_media.yml @@ -0,0 +1,56 @@ +id: az_trellis_opportunities_media +label: Trellis Opportunities Media +source: + plugin: az_trellis_opportunities_api + trellis_ids: { } + track_changes: true + fields: + - + name: id + label: ID + selector: Id + - + name: image_url + label: 'Image URL' + selector: Image_URL + - + name: name + label: Name + selector: Name + ids: + id: + type: string + +process: + uid: + plugin: default_value + default_value: 0 + bundle: + plugin: default_value + default_value: az_image + field_media_az_image/target_id: + - + plugin: migration_lookup + migration: az_trellis_opportunities_files + source: id + no_stub: true + - + plugin: skip_on_empty + method: row + field_media_az_image/alt: name + field_media_az_image/title: name + status: + plugin: default_value + default_value: 1 + +destination: + plugin: entity:media + +dependencies: + enforced: + module: + - az_opportunity_trellis + - az_media +migration_dependencies: + optional: + - az_trellis_opportunities_files diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/src/AZRecurringImportRuleInterface.php b/modules/custom/az_opportunity/az_opportunity_trellis/src/AZRecurringImportRuleInterface.php new file mode 100644 index 0000000000..335b540156 --- /dev/null +++ b/modules/custom/az_opportunity/az_opportunity_trellis/src/AZRecurringImportRuleInterface.php @@ -0,0 +1,30 @@ +t('Label'); + $header['id'] = $this->t('Machine name'); + $header['results'] = $this->t('Results'); + $header['status'] = $this->t('Status'); + return $header + parent::buildHeader(); + } + + /** + * {@inheritdoc} + */ + public function buildRow(EntityInterface $entity): array { + /** @var \Drupal\az_opportunity_trellis\AZRecurringImportRuleInterface $entity */ + $row['label'] = $entity->label(); + $row['id'] = $entity->id(); + + // Get entity's query parameters. + $params = $entity->getQueryParameters(); + unset($params['publish']); + + if (!empty($params)) { + // Generate link to results page. + $row['result']['data'] = [ + '#type' => 'link', + '#title' => $this->t('View Results'), + '#url' => Url::fromRoute('view.az_opportunity_trellis_import.page_1'), + '#options' => ['query' => $params], + '#attributes' => ['class' => 'button'], + ]; + } + else { + $row['result'] = ''; + } + $row['status'] = $entity->status() ? $this->t('Enabled') : $this->t('Disabled'); + return $row + parent::buildRow($entity); + } + +} diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/src/Controller/AZRecurringImportModalController.php b/modules/custom/az_opportunity/az_opportunity_trellis/src/Controller/AZRecurringImportModalController.php new file mode 100644 index 0000000000..1c2af8acc2 --- /dev/null +++ b/modules/custom/az_opportunity/az_opportunity_trellis/src/Controller/AZRecurringImportModalController.php @@ -0,0 +1,101 @@ +entityTypeManager = $entityTypeManager; + $this->entityFormBuilder = $entityFormBuilder; + $this->cache = $cache; + } + + /** + * {@inheritdoc} + */ + public static function create(ContainerInterface $container): self { + return new self( + $container->get('entity_type.manager'), + $container->get('entity.form_builder'), + $container->get('cache.default'), + ); + } + + /** + * Open az_recurring_import_rule configuration form as a modal. + * + * @param \Symfony\Component\HttpFoundation\Request $request + * The current request. + * + * @return \Drupal\Core\Ajax\AjaxResponse + * AjaxResponse containing command to open a modal. + */ + public function __invoke(Request $request): AjaxResponse { + $search = []; + $key = $request->query->get('search'); + // Attempt to get cached search if we have a valid cache key. + if (!empty($key) && str_starts_with($key, 'az_recurring_import_modal:')) { + // Get a cached search if there is one for our key. + $search = $this->cache->get($key)->data ?? []; + } + + // Create an AjaxResponse that opens a modal copy of the config form. + $response = new AjaxResponse(); + // Entity forms require an entity. + $config = $this->entityTypeManager->getStorage('az_recurring_import_rule')->create($search); + // Generate a copy of the configuration entity form using the stub as basis. + $config_form = $this->entityFormBuilder->getForm($config, 'add'); + // Forms generated during ajax calls do not have the right action path. + $config_form['#action'] = Url::fromRoute('entity.az_recurring_import_rule.add_form')->toString(); + // Add an ajax command to open the modal. + $response->addCommand(new OpenModalDialogCommand($this->t('Create Recurring Import'), $config_form, ['width' => '1000'])); + return $response; + } + +} diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/src/Entity/AZRecurringImportRule.php b/modules/custom/az_opportunity/az_opportunity_trellis/src/Entity/AZRecurringImportRule.php new file mode 100644 index 0000000000..0da25b2bb5 --- /dev/null +++ b/modules/custom/az_opportunity/az_opportunity_trellis/src/Entity/AZRecurringImportRule.php @@ -0,0 +1,129 @@ + AZRecurringImportRuleListBuilder::class, + 'form' => [ + 'add' => AZRecurringImportRuleForm::class, + 'edit' => AZRecurringImportRuleForm::class, + 'delete' => EntityDeleteForm::class, + ], + ], + config_prefix: 'az_recurring_import_rule', + admin_permission: 'administer quickstart configuration', + label_count: [ + 'singular' => '@count recurring import rule', + 'plural' => '@count recurring import rules', + ], + links: [ + 'collection' => '/admin/config/az-quickstart/settings/az-recurring-import-rule', + 'add-form' => '/admin/config/az-quickstart/settings/az-recurring-import-rule/add', + 'edit-form' => '/admin/config/az-quickstart/settings/az-recurring-import-rule/{az_recurring_import_rule}', + 'delete-form' => '/admin/config/az-quickstart/settings/az-recurring-import-rule/{az_recurring_import_rule}/delete', + ], + entity_keys: [ + 'id' => 'id', + 'label' => 'label', + 'uuid' => 'uuid', + ], + config_export: [ + 'id', + 'label', + 'owner', + 'host', + 'keyword', + 'attributes', + 'approval', + ], +)] +final class AZRecurringImportRule extends ConfigEntityBase implements AZRecurringImportRuleInterface { + + /** + * The az_recurring_import_rule ID. + */ + protected string $id; + + /** + * The az_recurring_import_rule label. + */ + protected string $label; + + /** + * The az_recurring_import_rule keyword. + */ + protected string $keyword; + + /** + * The az_recurring_import_rule owner. + */ + protected string $owner; + + /** + * The az_recurring_import_rule owner. + */ + protected string $host; + + /** + * The az_recurring_import_rule enterprise attributes. + */ + protected ?array $attributes; + + /** + * The az_recurring_import_rule approval status. + */ + protected string $approval; + + /** + * {@inheritdoc} + */ + public function getQueryParameters() { + // Build a list of query parameters. + $params = [ + 'publish' => 'true', + ]; + $attributes = array_filter($this->attributes ?? []); + $params += $attributes; + $params['keyword'] = $this->get('keyword') ?? ''; + $params['owner'] = $this->get('owner') ?? ''; + $params['host'] = $this->get('host') ?? ''; + $params['approval'] = $this->get('approval') ?? ''; + $params = array_filter($params); + return $params; + } + + /** + * {@inheritdoc} + */ + public function getOpportunityIds() { + // Build a list of query parameters. + $params = $this->getQueryParameters(); + + // Let's refuse to search if there are no constraints except published. +// if (count($params) === 1) { +// return []; +// } + + return \Drupal::service('az_opportunity_trellis.trellis_helper')->searchOpportunities($params); + } + +} diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/src/EventSubscriber/AZOpportunityTrellisDataSubscriber.php b/modules/custom/az_opportunity/az_opportunity_trellis/src/EventSubscriber/AZOpportunityTrellisDataSubscriber.php new file mode 100644 index 0000000000..ec671bc69e --- /dev/null +++ b/modules/custom/az_opportunity/az_opportunity_trellis/src/EventSubscriber/AZOpportunityTrellisDataSubscriber.php @@ -0,0 +1,158 @@ + 'onQuery', + MigrateEvents::POST_ROW_SAVE => 'onPostRowSave', + ]; + } + + /** + * Constructs an AZOpportunitiesTrellisDataSubscriber. + * + * @param \Drupal\az_opportunity_trellis\TrellisHelper $trellisHelper + * The Trellis helper server. + * @param \Drupal\Core\Messenger\Messenger $messenger + * Database connection object. + * @param \Drupal\Core\Entity\EntityTypeManagerInterface $entityTypeManager + * The entity type manager service. + * @param \Drupal\Core\Session\AccountProxy $currentUser + * The currently logged in user. + */ + public function __construct(TrellisHelper $trellisHelper, Messenger $messenger, EntityTypeManagerInterface $entityTypeManager, AccountProxy $currentUser) { + $this->trellisHelper = $trellisHelper; + $this->messenger = $messenger; + $this->entityTypeManager = $entityTypeManager; + $this->nodeStorage = $this->entityTypeManager->getStorage('node'); + $this->currentUser = $currentUser; + } + + /** + * Respond to events on migration import for relevant migrations. + * + * @param \Drupal\migrate\Event\MigratePostRowSaveEvent $event + * The post save event object. + */ + public function onPostRowSave(MigratePostRowSaveEvent $event) { + $migration = $event->getMigration()->getBaseId(); + $ids = $event->getDestinationIdValues(); + $id = reset($ids); + if ($migration === 'az_trellis_opportunities') { + $opportunity = $this->nodeStorage->load($id); + if (!empty($opportunity)) { + $url = $opportunity->toUrl()->toString(); + // Only show message if current user has permission. + if ($this->currentUser->hasPermission('create az_opportunity content')) { + // Show status message that opportunity was imported. + $this->messenger->addMessage($this->t('Imported @opportunitytitle.', [ + '@opportunitylink' => $url, + '@opportunitytitle' => $opportunity->getTitle(), + ])); + } + } + } + } + + /** + * Subscribes to populate Trellis view results. + * + * @param \Drupal\views_remote_data\Events\RemoteDataQueryEvent $event + * The event. + */ + public function onQuery(RemoteDataQueryEvent $event): void { + $supported_bases = ['az_opportunity_trellis_data']; + $base_tables = array_keys($event->getView()->getBaseTables()); + if (count(array_intersect($supported_bases, $base_tables)) > 0) { + $parameters = []; + $condition_groups = $event->getConditions(); + // Check for conditional parameters. + foreach ($condition_groups as $condition_group) { + if (!empty($condition_group['conditions'])) { + foreach ($condition_group['conditions'] as $condition) { + if (!empty($condition['field'][0]) && !empty($condition['value'])) { + $parameters[$condition['field'][0]] = $condition['value']; + } + } + } + } + // Don't perform search if empty or publish is the only field. + if (empty($parameters)) { + //if (empty($parameters) || (count($parameters) <= 1)) { + return; + } + $ids = $this->trellisHelper->searchOpportunities($parameters); + if (!empty($ids)) { + $offset = $event->getOffset(); + $limit = $event->getLimit(); + if (!empty($limit)) { + $ids = array_slice($ids, $offset, $limit); + } + // Run data fetch request. + $results = $this->trellisHelper->getOpportunities($ids); + $datefields = [ + 'Last_Modified_Date', + 'Start_Date__c', + 'End_Date__c', + ]; + foreach ($results as $result) { + // Change date format fields to what views expects to see. + foreach ($datefields as $datefield) { + if (!empty($result[$datefield])) { + $result[$datefield] = strtotime($result[$datefield]); + } + } + $event->addResult(new ResultRow($result)); + } + } + } + } + +} diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/src/Form/AZRecurringImportRuleForm.php b/modules/custom/az_opportunity/az_opportunity_trellis/src/Form/AZRecurringImportRuleForm.php new file mode 100644 index 0000000000..93e821e48c --- /dev/null +++ b/modules/custom/az_opportunity/az_opportunity_trellis/src/Form/AZRecurringImportRuleForm.php @@ -0,0 +1,185 @@ +entityRepository = $container->get('entity.repository'); + $instance->trellisHelper = $container->get('az_opportunity_trellis.trellis_helper'); + return $instance; + } + + /** + * {@inheritdoc} + */ + public function form(array $form, FormStateInterface $form_state): array { + + $form = parent::form($form, $form_state); + /** @var \Drupal\az_opportunity_trellis\Entity\AZRecurringImportRule $entity */ + $entity = $this->entity; + // Fetch the list of attributes mapped by the API. + $mappings = $this->trellisHelper->getAttributeMappings(); + + $form['label'] = [ + '#type' => 'textfield', + '#title' => $this->t('Import Rule Name'), + '#maxlength' => 255, + '#default_value' => $entity->label(), + '#description' => $this->t('Describe this rule, e.g., Graduate Lecture Series'), + '#required' => TRUE, + ]; + + $form['id'] = [ + '#type' => 'machine_name', + '#default_value' => $this->entity->id(), + '#machine_name' => [ + 'exists' => [AZRecurringImportRule::class, 'load'], + ], + '#disabled' => !$entity->isNew(), + ]; + + $form['status'] = [ + '#type' => 'checkbox', + '#title' => $this->t('Enabled'), + '#default_value' => $entity->status(), + '#description' => $this->t('Enabled import rules will regularly import matching content into the site automatically.'), + ]; + + $form['query_parameters'] = [ + '#type' => 'details', + '#title' => $this->t('Recurring Search Parameters'), + '#description' => $this->t('When this import rule runs, the following search terms will be used.'), + '#open' => TRUE, + ]; + + $form['query_parameters']['owner'] = [ + '#type' => 'textfield', + '#title' => $this->t('Owner'), + '#maxlength' => 255, + '#default_value' => $entity->get('owner'), + ]; + + // $form['query_parameters']['host'] = [ + // '#type' => 'textfield', + // '#title' => $this->t('Host'), + // '#maxlength' => 255, + // '#default_value' => $entity->get('host'), + // ]; + + $form['query_parameters']['keyword'] = [ + '#type' => 'textfield', + '#title' => $this->t('Keyword'), + '#maxlength' => 255, + '#default_value' => $entity->get('keyword'), + ]; + + $form['query_parameters']['attributes']['#tree'] = TRUE; + + // Get the different attributes available. + $term_storage = $this->entityTypeManager->getStorage('taxonomy_term'); + $query = $term_storage->getQuery() + ->accessCheck(TRUE) + ->addTag('taxonomy_term_access') + ->condition('vid', 'az_enterprise_attributes') + ->condition('parent', 0) + ->sort('name') + // Only fetch attributes that have an API mapping. + ->condition('field_az_attribute_key', array_keys($mappings), 'IN'); + $attributes = $query->execute(); + $attributes = $term_storage->loadMultiple($attributes); + + // Build attribute select lists. + foreach ($attributes as $attribute) { + $options = []; + $key = $mappings[$attribute->field_az_attribute_key->value]; + $id = $attribute->id(); + + // Find the options the attribute has, in order. + $query = $term_storage->getQuery() + ->accessCheck(TRUE) + ->addTag('taxonomy_term_access') + ->condition('vid', 'az_enterprise_attributes') + ->condition('parent', $id) + ->sort('name') + ->condition('field_az_attribute_key', '', '<>'); + $terms = $query->execute(); + $terms = $term_storage->loadMultiple($terms); + foreach ($terms as $term) { + $options[$term->field_az_attribute_key->value] = $this->entityRepository->getTranslationFromContext($term)->label(); + } + + // Build the select element for the attribute. + $form['query_parameters']['attributes'][$key] = [ + '#type' => 'select', + '#options' => $options, + '#empty_option' => $this->t('- Any -'), + '#empty_value' => '', + '#title' => $this->entityRepository->getTranslationFromContext($attribute)->label(), + '#required' => FALSE, + '#default_value' => $entity->get('attributes')[$key] ?? NULL, + ]; + } + + $form['query_parameters']['approval'] = [ + '#type' => 'select', + '#title' => $this->t('Approved for University Calendar'), + '#options' => [ + 'approved' => $this->t('Approved'), + 'denied' => $this->t('Denied'), + ], + '#empty_option' => $this->t('- Any -'), + '#empty_value' => '', + '#required' => FALSE, + '#default_value' => $entity->get('approval'), + ]; + + return $form; + } + + /** + * {@inheritdoc} + */ + public function save(array $form, FormStateInterface $form_state): int { + $result = parent::save($form, $form_state); + $message_args = ['%label' => $this->entity->label()]; + $this->messenger()->addStatus( + match($result) { + \SAVED_NEW => $this->t('Created new recurring import rule %label.', $message_args), + \SAVED_UPDATED => $this->t('Updated recurring import rule %label.', $message_args), + } + ); + + $form_state->setRedirectUrl($this->entity->toUrl('collection')); + return $result; + } + +} diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/src/Form/TrellisOpportunitySettingsForm.php b/modules/custom/az_opportunity/az_opportunity_trellis/src/Form/TrellisOpportunitySettingsForm.php new file mode 100644 index 0000000000..47814d18ed --- /dev/null +++ b/modules/custom/az_opportunity/az_opportunity_trellis/src/Form/TrellisOpportunitySettingsForm.php @@ -0,0 +1,53 @@ +config('az_opportunity_trellis.settings'); + + $form['api_hostname'] = [ + '#title' => $this->t("API Hostname"), + '#type' => 'textfield', + '#default_value' => $az_opportunity_trellis_config->get('api_hostname'), + ]; + + return parent::buildForm($form, $form_state); + } + + /** + * {@inheritdoc} + */ + public function submitForm(array &$form, FormStateInterface $form_state) { + $this->config('az_opportunity_trellis.settings') + ->set('api_hostname', $form_state->getValue('api_hostname')) + ->save(); + + parent::submitForm($form, $form_state); + } + +} diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/src/Plugin/migrate/source/AZTrellisOpportunitySource.php b/modules/custom/az_opportunity/az_opportunity_trellis/src/Plugin/migrate/source/AZTrellisOpportunitySource.php new file mode 100644 index 0000000000..03a3f923b1 --- /dev/null +++ b/modules/custom/az_opportunity/az_opportunity_trellis/src/Plugin/migrate/source/AZTrellisOpportunitySource.php @@ -0,0 +1,144 @@ +fields = $configuration['fields']; + $this->ids = $configuration['ids']; + // @todo use injection for this. + $this->trellisHelper = \Drupal::service('az_opportunity_trellis.trellis_helper'); + $this->trellisIds = $configuration['trellis_ids'] ?? []; + // If no arguments are supplied, fetch the list currently on the site. + if (empty($this->trellisIds)) { + $ids = $this->trellisHelper->getImportedOpportunityIds(); + $ids += $this->trellisHelper->getRecurringOpportunityIds(); + $this->trellisIds = array_unique($ids); + } + } + + /** + * Initializes the iterator with the source data. + * + * @return \Iterator + * Returns an iterable object of data for this source. + */ + protected function initializeIterator() { + // Fetch the opportunities via trellis API. + $items = $this->trellisHelper->getOpportunities($this->trellisIds); + $results = []; + $fields = []; + // Find field selectors. + foreach ($this->fields as $field) { + $fields[$field['name']] = $field['selector'] ?? $field['name']; + } + foreach ($items as $item) { + $result = []; + // Transform selectors into defined fields. + foreach ($fields as $field => $selector) { + if (isset($item[$selector])) { + $result[$field] = $item[$selector]; + } + } + $results[] = $result; + } + // Return an iterable. + $obj = new \ArrayObject($results); + return $obj->getIterator(); + } + + /** + * {@inheritdoc} + */ + public function prepareRow(Row $row) { + // Trellis IDs from source configuration can affect the hash of the row. + $row->setSourceProperty('trellis_ids', []); + // Perform normal source plugin hashing. + return parent::prepareRow($row); + } + + /** + * Return a string representing the source ids. + * + * @return string + * Comma-separated list of ids being imported. + */ + public function __toString(): string { + $ids = implode(', ', $this->trellisIds); + return $ids; + } + + /** + * {@inheritdoc} + */ + public function fields(): array { + $fields = []; + foreach ($this->fields as $field_info) { + $fields[$field_info['name']] = $field_info['label'] ?? $field_info['name']; + } + return $fields; + } + + /** + * {@inheritdoc} + */ + public function getIds(): array { + return $this->ids; + } + +} diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/src/Plugin/views/field/AZOpportunityTrellisViewsField.php b/modules/custom/az_opportunity/az_opportunity_trellis/src/Plugin/views/field/AZOpportunityTrellisViewsField.php new file mode 100644 index 0000000000..8b4a00c970 --- /dev/null +++ b/modules/custom/az_opportunity/az_opportunity_trellis/src/Plugin/views/field/AZOpportunityTrellisViewsField.php @@ -0,0 +1,160 @@ +migrationRemoteTools = $container->get('az_migration_remote.tools'); + $instance->trellisHelper = $container->get('az_opportunity_trellis.trellis_helper'); + return $instance; + } + + /** + * {@inheritdoc} + */ + public function init(ViewExecutable $view, DisplayPluginBase $display, ?array &$options = NULL) { + FieldPluginBase::init($view, $display, $options); + $this->actions = []; + } + + /** + * {@inheritdoc} + */ + public function viewsForm(&$form, FormStateInterface $form_state) { + $form['#cache']['max-age'] = 0; + + $form[$this->options['id']] = [ + '#tree' => TRUE, + ]; + + foreach ($this->view->result as $row_index => $row) { + $form[$this->options['id']][$row_index] = [ + '#type' => 'checkbox', + // We are not able to determine a main "title" for each row, so we can + // only output a generic label. + '#title' => $this->t('Update this item'), + '#title_display' => 'invisible', + '#return_value' => $row->Id ?? '', + '#default_value' => !empty($form_state->getValue($this->options['id'])[$row_index]) ? 1 : NULL, + ]; + } + + // Change default BulkForm label. + if (!empty($form['actions']['submit'])) { + $form['actions']['submit']['#value'] = $this->t('Import'); + } + } + + /** + * {@inheritdoc} + */ + public function viewsFormValidate(&$form, FormStateInterface $form_state) { + $ids = $form_state->getValue($this->options['id']); + if (empty($ids) || empty(array_filter($ids))) { + $form_state->setErrorByName('', $this->emptySelectedMessage()); + } + // Unlike parent class, do not throw form error when action is empty. + } + + /** + * Submit handler for the Trellis import form. + * + * @param mixed $form + * An associative array containing the structure of the form. + * @param \Drupal\Core\Form\FormStateInterface $form_state + * The current state of the form. + * + * @throws \Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException + * Thrown when the user tried to access an action without access to it. + */ + public function viewsFormSubmit(&$form, FormStateInterface $form_state) { + $values = $form_state->getValues(); + if (!empty($values[$this->options['id']])) { + $ids = $values[$this->options['id']]; + $ids = array_filter($ids); + foreach ($ids as $value) { + if (!empty($value)) { + \Drupal::service('messenger')->addMessage($this->t('Importing Trellis Opportunity @id.', [ + '@id' => $value, + ])); + } + } + + $migrations = [ + 'az_trellis_opportunities_files' => [ + 'limit' => 0, + 'update' => 0, + 'force' => 0, + 'configuration' => [ + 'source' => [ + 'trellis_ids' => $ids, + ], + ], + ], + 'az_trellis_opportunities_media' => [ + 'limit' => 0, + 'update' => 0, + 'force' => 0, + 'configuration' => [ + 'source' => [ + 'trellis_ids' => $ids, + ], + ], + ], + 'az_trellis_opportunities' => [ + 'limit' => 0, + 'update' => 0, + 'force' => 0, + 'configuration' => [ + 'source' => [ + 'trellis_ids' => $ids, + ], + ], + ], + ]; + + $this->migrationRemoteTools->batch($migrations); + } + + } + + /** + * {@inheritdoc} + */ + public function isWorkspaceSafeForm(array $form, FormStateInterface $form_state): bool { + // This field is not backed by an entity like BulkForm expects. + return FALSE; + } + +} diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/src/Plugin/views/filter/AZOpportunityTrellisViewsApprovalFilter.php b/modules/custom/az_opportunity/az_opportunity_trellis/src/Plugin/views/filter/AZOpportunityTrellisViewsApprovalFilter.php new file mode 100644 index 0000000000..555df5c6f4 --- /dev/null +++ b/modules/custom/az_opportunity/az_opportunity_trellis/src/Plugin/views/filter/AZOpportunityTrellisViewsApprovalFilter.php @@ -0,0 +1,96 @@ + 'select', + '#title' => $this->t('Value'), + '#options' => [ + 'approved' => $this->t('Approved'), + 'denied' => $this->t('Denied'), + ], + '#required' => FALSE, + '#default_value' => $this->value, + ]; + } + + /** + * {@inheritdoc} + */ + public function operatorOptions(): array { + return [ + '=' => $this->t('Is equal to'), + '!=' => $this->t('Is not equal to'), + ]; + } + + /** + * {@inheritdoc} + */ + protected function defineOptions(): array { + $options = parent::defineOptions(); + $this->definePropertyPathOption($options); + return $options; + } + + /** + * {@inheritdoc} + */ + public function buildOptionsForm(&$form, FormStateInterface $form_state): void { + $this->propertyPathElement($form, $this->options); + parent::buildOptionsForm($form, $form_state); + } + + /** + * {@inheritdoc} + */ + public function adminSummary() { + $prop = $this->options['property_path'] ?? ''; + return '(API value ' . $prop . ') ' . $this->operator . ' ' . $this->value; + } + + /** + * {@inheritdoc} + */ + public function query($group_by = FALSE): void { + if (!($this->query instanceof RemoteDataQuery)) { + return; + } + $this->query->addWhere( + $this->options['group'], + $this->options['property_path'], + $this->value, + $this->operator + ); + } + +} diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/src/Plugin/views/filter/AZOpportunityTrellisViewsAttributeFilter.php b/modules/custom/az_opportunity/az_opportunity_trellis/src/Plugin/views/filter/AZOpportunityTrellisViewsAttributeFilter.php new file mode 100644 index 0000000000..a4e549cd24 --- /dev/null +++ b/modules/custom/az_opportunity/az_opportunity_trellis/src/Plugin/views/filter/AZOpportunityTrellisViewsAttributeFilter.php @@ -0,0 +1,170 @@ +entityRepository = $container->get('entity.repository'); + $instance->termStorage = $container->get('entity_type.manager')->getStorage('taxonomy_term'); + return $instance; + } + + /** + * {@inheritdoc} + */ + protected function valueForm(&$form, FormStateInterface $form_state): void { + $options = []; + $key = $this->options['az_attribute_key'] ?? ''; + + // Get the applicable attribute terms. + $query = $this->termStorage->getQuery() + ->accessCheck(TRUE) + ->addTag('taxonomy_term_access') + ->condition('vid', 'az_enterprise_attributes') + ->condition('field_az_attribute_key', $key); + $parents = $query->execute(); + $children = []; + if (!empty($parents)) { + $query = $this->termStorage->getQuery() + ->accessCheck(TRUE) + ->sort('name') + ->addTag('taxonomy_term_access') + ->condition('parent', $parents, 'IN'); + $children = $query->execute(); + } + $terms = Term::loadMultiple($children); + // Build option list. + foreach ($terms as $term) { + if ($term->hasField('field_az_attribute_key') && !empty($term->field_az_attribute_key->value)) { + $options[$term->field_az_attribute_key->value] = $this->entityRepository->getTranslationFromContext($term)->label(); + } + } + $form['value'] = [ + '#type' => 'select', + '#title' => $this->t('Value'), + '#options' => $options, + '#required' => FALSE, + '#access' => !empty($options), + '#default_value' => $this->value, + ]; + } + + /** + * {@inheritdoc} + */ + public function operatorOptions(): array { + return [ + '=' => $this->t('Is equal to'), + '!=' => $this->t('Is not equal to'), + ]; + } + + /** + * {@inheritdoc} + */ + protected function defineOptions(): array { + $options = parent::defineOptions(); + $this->definePropertyPathOption($options); + $options['az_attribute_key'] = ['default' => '']; + return $options; + } + + /** + * {@inheritdoc} + */ + public function buildOptionsForm(&$form, FormStateInterface $form_state): void { + $this->propertyPathElement($form, $this->options); + parent::buildOptionsForm($form, $form_state); + $form['az_attribute_key'] = [ + '#title' => $this->t('Unique key of enterprise attribute'), + '#type' => 'textfield', + '#default_value' => $this->options['az_attribute_key'] ?? '', + '#required' => TRUE, + ]; + } + + /** + * Return the attribute id and api parameter name. + * + * @return array + * An array with the key as the attribute id and the value as the api path. + */ + public function getApiMapping(): array { + $key = $this->options['az_attribute_key'] ?? ''; + $path = $this->options['property_path'] ?? ''; + return [$key => $path]; + } + + /** + * {@inheritdoc} + */ + public function adminSummary() { + $prop = $this->options['property_path'] ?? ''; + $key = $this->options['az_attribute_key'] ?? ''; + return $key . ' (API value ' . $prop . ') ' . $this->operator . ' ' . $this->value; + } + + /** + * {@inheritdoc} + */ + public function query($group_by = FALSE): void { + if (!($this->query instanceof RemoteDataQuery)) { + return; + } + $this->query->addWhere( + $this->options['group'], + $this->options['property_path'], + $this->value, + $this->operator + ); + } + +} diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/src/Plugin/views/filter/AZOpportunityTrellisViewsDateFilter.php b/modules/custom/az_opportunity/az_opportunity_trellis/src/Plugin/views/filter/AZOpportunityTrellisViewsDateFilter.php new file mode 100644 index 0000000000..22bf20d20d --- /dev/null +++ b/modules/custom/az_opportunity/az_opportunity_trellis/src/Plugin/views/filter/AZOpportunityTrellisViewsDateFilter.php @@ -0,0 +1,289 @@ + $this->t('Next 7 Days'), + 'Next 30 Days' => $this->t('Next 30 Days'), + 'Last 7 Days' => $this->t('Last 7 Days'), + 'Last 30 Days' => $this->t('Last 30 Days'), + 'Custom' => $this->t('Custom'), + ]; + return $options; + } + + /** + * The asset resolver service. + * + * @var \Drupal\Core\Asset\AssetResolver + */ + protected $assetResolver; + + /** + * The file url generator service. + * + * @var \Drupal\Core\File\FileUrlGeneratorInterface + */ + protected $fileUrlGenerator; + + /** + * {@inheritdoc} + */ + public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) { + $instance = new static( + $configuration, + $plugin_id, + $plugin_definition + ); + + $instance->assetResolver = $container->get('asset.resolver'); + $instance->fileUrlGenerator = $container->get('file_url_generator'); + return $instance; + } + + /** + * {@inheritdoc} + */ + protected function valueForm(&$form, FormStateInterface $form_state): void { + $form['value']['#tree'] = TRUE; + $form['#attached']['library'][] = 'az_opportunity_trellis/az_opportunity_trellis_date'; + // Trim valid options to selected options. + $options = $this->trellisDateOptions(); + $keys = $this->options['api_options'] ?? []; + $options = array_intersect($options, array_flip($keys)); + $form['value']['value'] = [ + '#type' => 'select', + '#options' => $options, + '#empty_option' => $this->t('- Any -'), + '#empty_value' => '', + '#required' => FALSE, + '#default_value' => $this->value['value'], + ]; + // Add label if this is the exposed form. + $exposed_info = $this->exposedInfo(); + if (!empty($exposed_info['label'])) { + $form['value']['value']['#title'] = $exposed_info['label']; + } + // Fetch library information for shadow DOM inclusion. + $css = []; + try { + $attached = AttachedAssets::createFromRenderArray([ + '#attached' => [ + 'library' => [ + 'az_opportunity_trellis/easepick_styles', + ], + ], + ]); + $assets = $this->assetResolver->getCssAssets($attached, TRUE); + foreach ($assets as $asset) { + if (!empty($asset['data'])) { + $css[] = $this->fileUrlGenerator->generateString($asset['data']); + } + } + } + catch (\Exception $e) { + // Failed to fetch assets. + } + $form['#attached']['drupalSettings']['trellisDatePicker']['css'] = $css; + // Prepare unique id for data attribute. + $end_id = Html::getUniqueId('az-trellis-daterange-end'); + $form['value']['begin'] = [ + '#type' => 'textfield', + '#title' => $this->t('Begin'), + '#attributes' => [ + 'data-az-trellis-daterange-end' => $end_id, + 'class' => ['az-trellis-daterange'], + ], + '#size' => 30, + '#default_value' => $this->value['begin'], + ]; + $form['value']['end'] = [ + '#type' => 'textfield', + '#title' => $this->t('End'), + '#attributes' => [ + 'id' => $end_id, + 'class' => ['az-trellis-daterange-end'], + ], + '#size' => 30, + '#default_value' => $this->value['end'], + ]; + // Compute conditional fields using states array. + if ($form_state->get('exposed')) { + $identifier = $this->options['expose']['identifier']; + $source = ':input[name="' . $identifier . '[value]"]'; + $state = [$source => ['value' => 'Custom']]; + $form['value']['begin']['#states']['visible'][] = $state; + $form['value']['end']['#states']['visible'][] = $state; + } + } + + /** + * {@inheritdoc} + */ + protected function buildValueWrapper(&$form, $wrapper_identifier) { + // Modify parent class behavior to be a container rather than a fieldset. + if (!isset($form[$wrapper_identifier])) { + $form[$wrapper_identifier] = [ + '#type' => 'container', + '#attributes' => [ + 'class' => [ + 'views-exposed-form__item', + 'az-opportunity-trellis-datewrapper', + ], + ], + ]; + } + } + + /** + * {@inheritdoc} + */ + public function operatorOptions(): array { + return [ + '=' => $this->t('Is equal to'), + '!=' => $this->t('Is not equal to'), + ]; + } + + /** + * {@inheritdoc} + */ + protected function defineOptions(): array { + $options = parent::defineOptions(); + $options['value'] = [ + 'contains' => [ + 'value' => ['default' => ''], + 'begin' => ['default' => ''], + 'end' => ['default' => ''], + ], + ]; + $options['api_param'] = ['default' => '']; + $options['api_options'] = ['default' => []]; + $options['api_param_custom_begin'] = ['default' => '']; + $options['api_param_custom_end'] = ['default' => '']; + return $options; + } + + /** + * {@inheritdoc} + */ + public function buildOptionsForm(&$form, FormStateInterface $form_state): void { + parent::buildOptionsForm($form, $form_state); + $form['api_options'] = [ + '#type' => 'select', + '#title' => $this->t('Trellis Date Options'), + '#options' => $this->trellisDateOptions(), + '#multiple' => TRUE, + '#required' => TRUE, + '#default_value' => $this->options['api_options'], + ]; + $form['api_param'] = [ + '#title' => $this->t('API get parameter for date'), + '#type' => 'textfield', + '#default_value' => $this->options['api_param'] ?? '', + '#required' => TRUE, + ]; + $form['api_param_custom_begin'] = [ + '#title' => $this->t('API get parameter for custom begin date'), + '#type' => 'textfield', + '#default_value' => $this->options['api_param_custom_begin'] ?? '', + '#required' => TRUE, + ]; + $form['api_param_custom_end'] = [ + '#title' => $this->t('API get parameter for custom end date'), + '#type' => 'textfield', + '#default_value' => $this->options['api_param_custom_end'] ?? '', + '#required' => TRUE, + ]; + + } + + /** + * {@inheritdoc} + */ + public function adminSummary() { + $prop = $this->options['api_param'] ?? ''; + $begin = $this->options['api_param_custom_begin'] ?? ''; + $end = $this->options['api_param_custom_end'] ?? ''; + return 'Date (API ' . $prop . ' ' . $begin . ' ' . $end . ') ' . $this->operator . ' ' . $this->value['value']; + } + + /** + * {@inheritdoc} + */ + public function query($group_by = FALSE): void { + if (!($this->query instanceof RemoteDataQuery)) { + return; + } + $value = $this->value['value'] ?? ''; + $this->query->addWhere( + $this->options['group'], + $this->options['api_param'], + $this->value['value'], + $this->operator + ); + // Handle supplied values if custom range. + if ($value === 'Custom') { + // Compute time offsets for API query. + $begin = $this->value['begin'] ?? ''; + $end = $this->value['end'] ?? ''; + $begin = strtotime($begin); + $end = strtotime($end); + if (($begin !== FALSE) && ($end !== FALSE)) { + // Find begin and end of respective days. + $begin = strtotime("today", $begin); + $end = strtotime("tomorrow", $end); + // Roll over to the previous night. + $end -= 1; + $begin = gmdate(self::TRELLIS_DATE_FORMAT, $begin); + $end = gmdate(self::TRELLIS_DATE_FORMAT, $end); + $this->query->addWhere( + $this->options['group'], + $this->options['api_param_custom_begin'], + $begin, + $this->operator + ); + $this->query->addWhere( + $this->options['group'], + $this->options['api_param_custom_end'], + $end, + $this->operator + ); + } + } + } + +} diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/src/TrellisHelper.php b/modules/custom/az_opportunity/az_opportunity_trellis/src/TrellisHelper.php new file mode 100644 index 0000000000..9cc8eaa657 --- /dev/null +++ b/modules/custom/az_opportunity/az_opportunity_trellis/src/TrellisHelper.php @@ -0,0 +1,314 @@ +configFactory = $config_factory; + $this->httpClient = $http_client; + $this->cache = $cache; + $this->entityTypeManager = $entity_type_manager; + } + + /** + * Search based on parameters for opportunities. + * + * @param array $query + * Query parameters to use in search. + * + * @return array + * Array of trellis opportunity ids. + */ + public function searchOpportunities(array $query) { + $ids = []; + // Compute cache key of query. + $key = 'az_trellis_opportunities.search:' . Crypt::hashBase64(serialize($query)); + $cached = $this->cache->get($key); + // If we have this search cached, return it. + if ($cached !== FALSE) { + return $cached->data; + } + + $url = $this->getOpportunitySearchEndpoint(); + try { + // Run search request. + $response = $this->httpClient->request('GET', $url, ['query' => $query]); + if ($response->getStatusCode() === 200) { + $json = (string) $response->getBody(); + $json = json_decode($json, TRUE); + if ($json !== NULL) { + $ids = $json['data']['Program_Cycle_IDs'] ?? []; + // Ensure opportunities are in Id order. + sort($ids); + // @todo determine cache expiration. + $expire = time() + 1800; + // Cache search result. + $this->cache->set($key, $ids, $expire); + } + } + } + catch (GuzzleException $e) { + } + return $ids; + } + + /** + * Returns opportunity data for an array of ids. + * + * @param array $trellis_ids + * Trellis Opportunity IDs in an array. + * + * @return array + * Opportunity data. + */ + public function getOpportunities(array $trellis_ids) { + $opportunities = []; + $fetch = []; + $url = $this->getOpportunityEndpoint(); + // Remove any duplicate ids to mimic remote API. + $trellis_ids = array_unique($trellis_ids); + // Grab opportunities that are in cache. + foreach ($trellis_ids as $trellis_id) { + $cached = $this->getTrellisCache($trellis_id); + if ($cached === FALSE) { + $fetch[] = $trellis_id; + } + else { + $opportunities[] = $cached; + } + } + // Fetch opportunities we did not have cached. + if (!empty($fetch)) { + try { + $data = ['ids' => implode(',', $fetch)]; + $response = $this->httpClient->request('POST', $url, ['json' => $data]); + if ($response->getStatusCode() === 200) { + $json = (string) $response->getBody(); + $json = json_decode($json, TRUE); + if ($json !== NULL) { + $results = $json['data'] ?? []; + foreach ($results as $result) { + // Cache the opportunity and add it to the list. + $opportunities[] = $this->setTrellisCache($result); + } + } + } + } + catch (GuzzleException $e) { + } + } + // Make sure opportunities are in Id order regardless of cached/fetched. + usort($opportunities, function ($a, $b) { + return strcmp($a['Id'], $b['Id']); + }); + return $opportunities; + } + + /** + * Fetch the list of trellis opportunity ids currently imported. + * + * @return array + * Returns an array of opportunity ids. + */ + public function getImportedOpportunityIds() { + $nodeStorage = $this->entityTypeManager->getStorage('node'); + // Check for opportunities that have trellis ids. + $query = $nodeStorage->getQuery() + ->accessCheck(FALSE) + ->condition('type', 'az_opportunity') + ->exists('field_az_trellis_id'); + $nids = $query->execute(); + $nodes = $nodeStorage->loadMultiple($nids); + + $opportunity_api_ids = []; + foreach ($nodes as $n) { + $opportunity_api_ids[] = $n->get('field_az_trellis_id')->getString(); + } + return $opportunity_api_ids; + } + + /** + * Fetch the recurring search list of ids to import. + * + * @return array + * Returns an array of opportunity ids. + */ + public function getRecurringOpportunityIds() { + // Find enabled import configurations. + $imports = $this->entityTypeManager->getStorage('az_recurring_import_rule')->loadByProperties([ + 'status' => [1, TRUE], + ]); + + $opportunity_api_ids = []; + foreach ($imports as $import) { + /** @var \Drupal\az_opportunity_trellis\Entity\AZRecurringImportRule $import */ + $opportunity_api_ids += $import->getOpportunityIds(); + } + // Remove duplicates in case searches overlapped. + $opportunity_api_ids = array_unique($opportunity_api_ids); + return $opportunity_api_ids; + } + + /** + * Return mapped array of api names of attributes. + * + * @return array + * The array of attribute ids mapped to API names. + */ + public function getAttributeMappings() { + $mappings = []; + $view = Views::getView('az_opportunity_trellis_import'); + $display = $view->getDisplay() ?? NULL; + $filters = $display->getHandlers('filter'); + foreach ($filters as $filter) { + if ($filter instanceof AZOpportunityTrellisViewsAttributeFilter) { + $mappings += $filter->getApiMapping(); + } + } + return $mappings; + } + + /** + * Returns the cache for an opportunity if possible. + * + * @param string $trellis_id + * The trellis id of the opportunity. + * + * @return mixed + * The cached data for the opportunity, or FALSE. + */ + protected function getTrellisCache(string $trellis_id) { + $key = 'az_trellis_opportunities:' . $trellis_id; + return $this->cache->get($key)->data ?? FALSE; + } + + /** + * Sets the cache for an opportunity if possible. + * + * @param array $opportunity + * The opportunity data result. + * + * @return array + * The data for the opportunity. + */ + protected function setTrellisCache(array $opportunity) { + if (!empty($opportunity['Id'])) { + $key = 'az_trellis_opportunities:' . $opportunity['Id']; + // @todo determine cache expiration. + $expire = time() + 1800; + $this->cache->set($key, $opportunity, $expire); + } + return $opportunity; + } + + /** + * Returns API URL for given Trellis Opportunity ID. + * + * @param string $trellis_id + * Trellis Opportunity ID. + * + * @return string + * Opportunity API URL. + */ + public function getOpportunityUrl($trellis_id) { + $hostname = $this->configFactory->get('az_opportunity_trellis.settings')->get('api_hostname'); + return 'https://' . $hostname . self::$apiBasePath . $trellis_id; + } + + /** + * Returns API URL. + * + * @return string + * Opportunity API URL. + */ + public function getOpportunityEndpoint() { + $hostname = $this->configFactory->get('az_opportunity_trellis.settings')->get('api_hostname'); + return 'https://' . $hostname . self::$apiBasePath; + } + + /** + * Returns API search URL. + * + * @return string + * Opportunity API search URL. + */ + public function getOpportunitySearchEndpoint() { + $hostname = $this->configFactory->get('az_opportunity_trellis.settings')->get('api_hostname'); + return 'https://' . $hostname . self::$apiSearchPath; + } + +} From c8902155c81c3423677b9a7c9b0f91867ff801f9 Mon Sep 17 00:00:00 2001 From: Z Saenz Date: Tue, 10 Mar 2026 15:00:04 -0700 Subject: [PATCH 19/59] Most recent tests --- .../az_opportunity_trellis.links.task.yml | 2 +- .../src/Form/AZRecurringImportRuleForm.php | 24 +++++++++---------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.links.task.yml b/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.links.task.yml index d2b3ae045e..255bb688e9 100644 --- a/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.links.task.yml +++ b/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.links.task.yml @@ -5,7 +5,7 @@ az_opportunity_trellis.az_opportunity_trellis_settings_task: weight: 0 az_opportunity.import_form_task: - title: 'Trellis opportunity importer' + title: 'Trellis Opportunity Importer' route_name: view.az_opportunity_trellis_import.page_1 parent_id: system.admin_content description: 'Import opportunities from the Trellis Opportunity API.' diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/src/Form/AZRecurringImportRuleForm.php b/modules/custom/az_opportunity/az_opportunity_trellis/src/Form/AZRecurringImportRuleForm.php index 93e821e48c..49f1df58ef 100644 --- a/modules/custom/az_opportunity/az_opportunity_trellis/src/Form/AZRecurringImportRuleForm.php +++ b/modules/custom/az_opportunity/az_opportunity_trellis/src/Form/AZRecurringImportRuleForm.php @@ -149,18 +149,18 @@ public function form(array $form, FormStateInterface $form_state): array { ]; } - $form['query_parameters']['approval'] = [ - '#type' => 'select', - '#title' => $this->t('Approved for University Calendar'), - '#options' => [ - 'approved' => $this->t('Approved'), - 'denied' => $this->t('Denied'), - ], - '#empty_option' => $this->t('- Any -'), - '#empty_value' => '', - '#required' => FALSE, - '#default_value' => $entity->get('approval'), - ]; + // $form['query_parameters']['approval'] = [ + // '#type' => 'select', + // '#title' => $this->t('Approved for University Calendar'), + // '#options' => [ + // 'approved' => $this->t('Approved'), + // 'denied' => $this->t('Denied'), + // ], + // '#empty_option' => $this->t('- Any -'), + // '#empty_value' => '', + // '#required' => FALSE, + // '#default_value' => $entity->get('approval'), + // ]; return $form; } From 9d263685d32ace8d68d3c3774476468fb2c7c761 Mon Sep 17 00:00:00 2001 From: Z Saenz Date: Wed, 11 Mar 2026 13:02:37 -0700 Subject: [PATCH 20/59] updates view --- ...ews.view.az_opportunity_trellis_import.yml | 260 +++++++++++++++++- 1 file changed, 258 insertions(+), 2 deletions(-) diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/config/install/views.view.az_opportunity_trellis_import.yml b/modules/custom/az_opportunity/az_opportunity_trellis/config/install/views.view.az_opportunity_trellis_import.yml index e06ec3bde7..d25844f07b 100644 --- a/modules/custom/az_opportunity/az_opportunity_trellis/config/install/views.view.az_opportunity_trellis_import.yml +++ b/modules/custom/az_opportunity/az_opportunity_trellis/config/install/views.view.az_opportunity_trellis_import.yml @@ -275,6 +275,56 @@ display: empty_zero: false hide_alter_empty: true property_path: Owner_NetID + property_5: + id: property_5 + table: az_opportunity_trellis_data + field: property + relationship: none + group_type: group + admin_label: '' + plugin_id: views_remote_data_property + label: Topic + exclude: false + alter: + alter_text: false + text: '' + make_link: false + path: '' + absolute: false + external: false + replace_spaces: false + path_case: none + trim_whitespace: false + alt: '' + rel: '' + link_class: '' + prefix: '' + suffix: '' + target: '' + nl2br: false + max_length: 0 + word_boundary: true + ellipsis: true + more_link: false + more_link_text: '' + more_link_path: '' + strip_tags: false + trim: false + preserve_tags: '' + html: false + element_type: '' + element_class: '' + element_label_type: '' + element_label_class: '' + element_label_colon: true + element_wrapper_type: '' + element_wrapper_class: '' + element_default_classes: true + empty: '' + hide_empty: false + empty_zero: false + hide_alter_empty: true + property_path: Topic__c property_4: id: property_4 table: az_opportunity_trellis_data @@ -325,6 +375,56 @@ display: empty_zero: false hide_alter_empty: true property_path: Parent_Id + property_6: + id: property_6 + table: az_opportunity_trellis_data + field: property + relationship: none + group_type: group + admin_label: '' + plugin_id: views_remote_data_property + label: 'Parent Account Name' + exclude: false + alter: + alter_text: false + text: '' + make_link: false + path: '' + absolute: false + external: false + replace_spaces: false + path_case: none + trim_whitespace: false + alt: '' + rel: '' + link_class: '' + prefix: '' + suffix: '' + target: '' + nl2br: false + max_length: 0 + word_boundary: true + ellipsis: true + more_link: false + more_link_text: '' + more_link_path: '' + strip_tags: false + trim: false + preserve_tags: '' + html: false + element_type: '' + element_class: '' + element_label_type: '' + element_label_class: '' + element_label_colon: true + element_wrapper_type: '' + element_wrapper_class: '' + element_default_classes: true + empty: '' + hide_empty: false + empty_zero: false + hide_alter_empty: true + property_path: Parent_Account_Name pager: type: mini options: @@ -403,7 +503,7 @@ display: default_group: All default_group_multiple: { } group_items: { } - property_path: Name + property_path: name property_1: id: property_1 table: az_opportunity_trellis_data @@ -442,7 +542,163 @@ display: default_group: All default_group_multiple: { } group_items: { } - property_path: Owner_NetID + property_path: owner + property_2: + id: property_2 + table: az_opportunity_trellis_data + field: property + relationship: none + group_type: group + admin_label: '' + plugin_id: views_remote_data_property + operator: '=' + value: '' + group: 1 + exposed: true + expose: + operator_id: property_2_op + label: 'Account ID' + description: '' + use_operator: false + operator: property_2_op + operator_limit_selection: false + operator_list: { } + identifier: property_2 + required: false + remember: false + multiple: false + remember_roles: + authenticated: authenticated + is_grouped: false + group_info: + label: '' + description: '' + identifier: '' + optional: true + widget: select + multiple: false + remember: false + default_group: All + default_group_multiple: { } + group_items: { } + property_path: account_id + property_3: + id: property_3 + table: az_opportunity_trellis_data + field: property + relationship: none + group_type: group + admin_label: '' + plugin_id: views_remote_data_property + operator: '=' + value: '' + group: 1 + exposed: true + expose: + operator_id: property_3_op + label: Topic + description: '' + use_operator: false + operator: property_3_op + operator_limit_selection: false + operator_list: { } + identifier: property_3 + required: false + remember: false + multiple: false + remember_roles: + authenticated: authenticated + is_grouped: false + group_info: + label: '' + description: '' + identifier: '' + optional: true + widget: select + multiple: false + remember: false + default_group: All + default_group_multiple: { } + group_items: { } + property_path: topic + property_4: + id: property_4 + table: az_opportunity_trellis_data + field: property + relationship: none + group_type: group + admin_label: '' + plugin_id: views_remote_data_property + operator: '=' + value: '' + group: 1 + exposed: true + expose: + operator_id: property_4_op + label: 'Parent Account' + description: '' + use_operator: false + operator: property_4_op + operator_limit_selection: false + operator_list: { } + identifier: property_4 + required: false + remember: false + multiple: false + remember_roles: + authenticated: authenticated + is_grouped: false + group_info: + label: '' + description: '' + identifier: '' + optional: true + widget: select + multiple: false + remember: false + default_group: All + default_group_multiple: { } + group_items: { } + property_path: parent_account + property_5: + id: property_5 + table: az_opportunity_trellis_data + field: property + relationship: none + group_type: group + admin_label: '' + plugin_id: views_remote_data_property + operator: '=' + value: '' + group: 1 + exposed: true + expose: + operator_id: property_5_op + label: Keyword + description: '' + use_operator: false + operator: property_5_op + operator_limit_selection: false + operator_list: { } + identifier: property_5 + required: false + remember: false + multiple: false + remember_roles: + authenticated: authenticated + is_grouped: false + group_info: + label: '' + description: '' + identifier: '' + optional: true + widget: select + multiple: false + remember: false + default_group: All + default_group_multiple: { } + group_items: { } + property_path: keyword filter_groups: operator: AND groups: From 57e1bcb5d79162b6d1e52823d7c2e8336299bbe4 Mon Sep 17 00:00:00 2001 From: Z Saenz Date: Wed, 11 Mar 2026 14:47:03 -0700 Subject: [PATCH 21/59] Update migrations to import some data from Trellis. --- ...lus.migration.az_trellis_opportunities.yml | 194 ++++++++++++++++++ 1 file changed, 194 insertions(+) diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/config/install/migrate_plus.migration.az_trellis_opportunities.yml b/modules/custom/az_opportunity/az_opportunity_trellis/config/install/migrate_plus.migration.az_trellis_opportunities.yml index bec3b19129..c9ce502cec 100644 --- a/modules/custom/az_opportunity/az_opportunity_trellis/config/install/migrate_plus.migration.az_trellis_opportunities.yml +++ b/modules/custom/az_opportunity/az_opportunity_trellis/config/install/migrate_plus.migration.az_trellis_opportunities.yml @@ -22,11 +22,205 @@ source: name: name label: Name selector: Name + - + name: start_options + label: 'Start Options' + selector: Start_Options__c + - + name: program_format + label: 'Program Format' + selector: Program_Format__c + - + name: program_length + label: 'Program Length' + selector: Length_Of_Program__c + - + name: incentives + label: Incentives + selector: Incentives__c + - + name: location + label: Location + selector: Location__c + - + name: program_website + label: 'Program Website' + selector: Program_Website__c + - + name: description + label: 'Program Description' + selector: Program_Description__c + - + name: eligibility + label: Eligibility + selector: Eligibility__c + - + name: topic + label: Topic + selector: Topic__c + - + name: application_form_url + label: 'Application Form URL' + selector: Application_Form_URL__c + - + name: audiences + label: Audiences + selector: Audiences__c + - + name: application_open + label: 'Application Open Date' + selector: Application_Open__c + - + name: application_closed + label: 'Application Closed Date' + selector: Application_Closed__c + - + name: start_date + label: 'Program Start Date' + selector: Start_Date__c + - + name: end_date + label: 'Program End Date' + selector: End_Date__c + - + name: ongoing + label: Ongoing + selector: Ongoing__c + - + name: imported_date + label: 'Last Modified Date' + selector: Last_Modified_Date + - + name: parent_account + label: 'Parent Account Name' + selector: Parent_Account_Name + - + name: program_type + label: 'Program Type' + selector: Program_Type__c + - + name: owner_netid + label: 'Owner NetID' + selector: Owner_NetID ids: id: type: string process: title: name + field_az_trellis_id: id + field_az_start_options: start_options + field_az_modality: + - + plugin: skip_on_empty + method: process + source: program_format + - + plugin: entity_lookup + entity_type: taxonomy_term + bundle_key: vid + bundle: az_opportunity_modality + value_key: name + ignore_case: true + field_az_program_length: program_length + field_az_incentives: + - + plugin: skip_on_empty + method: process + source: incentives + - + plugin: callback + callable: trim + field_az_opportunity_location: location + field_az_program_website/uri: program_website + field_az_program_website/title: + - + plugin: default_value + default_value: 'Program details' + field_az_body: description + field_az_topic: + - + plugin: skip_on_empty + method: process + source: topic + - + plugin: entity_lookup + entity_type: taxonomy_term + bundle_key: vid + bundle: az_opportunity_topic + value_key: name + ignore_case: true + field_az_application_link/uri: application_form_url + field_az_application_link/title: + - + plugin: default_value + default_value: 'Apply now' + field_az_audiences: + - + plugin: skip_on_empty + method: process + source: audiences + - + plugin: entity_lookup + entity_type: taxonomy_term + bundle_key: vid + bundle: az_opportunity_audience + value_key: name + ignore_case: true + field_az_application_date/value: + - + plugin: format_date + source: application_open + from_format: 'Y-m-d' + to_format: U + field_az_application_date/end_value: + - + plugin: format_date + source: application_closed + from_format: 'Y-m-d' + to_format: U + field_az_program_date/value: + - + plugin: format_date + source: start_date + from_format: 'Y-m-d' + to_format: U + field_az_program_date/end_value: + - + plugin: format_date + source: end_date + from_format: 'Y-m-d' + to_format: U + field_az_ongoing: + - + plugin: skip_on_empty + method: process + source: ongoing + - + plugin: callback + callable: trim + field_az_trellis_imported_date: + - + plugin: format_date + source: imported_date + from_format: 'Y-m-d\TH:i:s.vp' + to_format: U + field_az_parent_account: parent_account + field_az_opportunity_type: + - + plugin: skip_on_empty + method: process + source: program_type + - + plugin: entity_lookup + entity_type: taxonomy_term + bundle_key: vid + bundle: az_opportunity_type + value_key: name + ignore_case: true + status: + - + plugin: default_value + default_value: 1 destination: plugin: 'entity:node' default_bundle: az_opportunity From d76a34676e064603107ade577a1f3ecd10ff7673 Mon Sep 17 00:00:00 2001 From: Z Saenz Date: Thu, 12 Mar 2026 16:28:01 -0700 Subject: [PATCH 22/59] Migrates trellis content into opportunity content --- ...lus.migration.az_trellis_opportunities.yml | 54 ++++++++++++++----- 1 file changed, 40 insertions(+), 14 deletions(-) diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/config/install/migrate_plus.migration.az_trellis_opportunities.yml b/modules/custom/az_opportunity/az_opportunity_trellis/config/install/migrate_plus.migration.az_trellis_opportunities.yml index c9ce502cec..7e4b80cbc5 100644 --- a/modules/custom/az_opportunity/az_opportunity_trellis/config/install/migrate_plus.migration.az_trellis_opportunities.yml +++ b/modules/custom/az_opportunity/az_opportunity_trellis/config/install/migrate_plus.migration.az_trellis_opportunities.yml @@ -38,6 +38,10 @@ source: name: incentives label: Incentives selector: Incentives__c + - + name: credit_type + label: Credit Type + selector: Credit_Type__c - name: location label: Location @@ -108,17 +112,30 @@ source: process: title: name field_az_trellis_id: id - field_az_start_options: start_options + field_az_offered: + - + plugin: skip_on_empty + method: process + source: start_options + - + plugin: entity_generate + entity_type: taxonomy_term + bundle_key: vid + bundle: az_opportunity_semester + source: start_options + value_key: name + ignore_case: true field_az_modality: - plugin: skip_on_empty method: process source: program_format - - plugin: entity_lookup + plugin: entity_generate entity_type: taxonomy_term bundle_key: vid bundle: az_opportunity_modality + source: program_format value_key: name ignore_case: true field_az_program_length: program_length @@ -128,8 +145,12 @@ process: method: process source: incentives - - plugin: callback - callable: trim + plugin: static_map + source: incentives + map: + Yes: 1 + No: 0 + field_az_credit: credit_type field_az_opportunity_location: location field_az_program_website/uri: program_website field_az_program_website/title: @@ -143,10 +164,11 @@ process: method: process source: topic - - plugin: entity_lookup + plugin: entity_generate entity_type: taxonomy_term bundle_key: vid bundle: az_opportunity_topic + source: topic value_key: name ignore_case: true field_az_application_link/uri: application_form_url @@ -160,10 +182,11 @@ process: method: process source: audiences - - plugin: entity_lookup + plugin: entity_generate entity_type: taxonomy_term bundle_key: vid bundle: az_opportunity_audience + source: audiences value_key: name ignore_case: true field_az_application_date/value: @@ -171,39 +194,42 @@ process: plugin: format_date source: application_open from_format: 'Y-m-d' - to_format: U + to_format: 'Y-m-d\TH:i:s' field_az_application_date/end_value: - plugin: format_date source: application_closed from_format: 'Y-m-d' - to_format: U + to_format: 'Y-m-d\TH:i:s' field_az_program_date/value: - plugin: format_date source: start_date from_format: 'Y-m-d' - to_format: U + to_format: 'Y-m-d\TH:i:s' field_az_program_date/end_value: - plugin: format_date source: end_date from_format: 'Y-m-d' - to_format: U + to_format: 'Y-m-d\TH:i:s' field_az_ongoing: - plugin: skip_on_empty method: process source: ongoing - - plugin: callback - callable: trim + plugin: static_map + source: ongoing + map: + 'false': 0 + 'true': 1 field_az_trellis_imported_date: - plugin: format_date source: imported_date from_format: 'Y-m-d\TH:i:s.vp' - to_format: U + to_format: 'Y-m-d\TH:i:s' field_az_parent_account: parent_account field_az_opportunity_type: - @@ -211,7 +237,7 @@ process: method: process source: program_type - - plugin: entity_lookup + plugin: entity_generate entity_type: taxonomy_term bundle_key: vid bundle: az_opportunity_type From 2abca824bce55bef55104e5e19553d453b3692a7 Mon Sep 17 00:00:00 2001 From: Z Saenz Date: Tue, 17 Mar 2026 08:14:46 -0700 Subject: [PATCH 23/59] Add eligibility field --- .../az_opportunity_trellis.module | 27 +++++++--- ...lus.migration.az_trellis_opportunities.yml | 16 +++--- ...rm_display.node.az_opportunity.default.yml | 50 +++++++++++++------ ...ew_display.node.az_opportunity.az_card.yml | 2 + ...iew_display.node.az_opportunity.az_row.yml | 2 + ....az_opportunity.az_row_with_background.yml | 2 + ...splay.node.az_opportunity.az_small_row.yml | 2 + ...ew_display.node.az_opportunity.default.yml | 10 +++- ...de.az_opportunity.field_az_eligibility.yml | 23 +++++++++ ...ield.storage.node.field_az_eligibility.yml | 18 +++++++ 10 files changed, 123 insertions(+), 29 deletions(-) create mode 100644 modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_eligibility.yml create mode 100644 modules/custom/az_opportunity/config/install/field.storage.node.field_az_eligibility.yml diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.module b/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.module index 69af532bcd..881cb48a51 100644 --- a/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.module +++ b/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.module @@ -34,12 +34,25 @@ function az_opportunity_trellis_form_node_az_opportunity_edit_form_alter(&$form, $disabled_fields = [ 'title', - // 'field_az_location', - // 'field_az_event_date', - // 'field_az_link', - // 'field_az_summary', - // 'field_az_photos', - // 'field_az_enterprise_attributes', + 'field_az_application_date', + 'field_az_application_link', + 'field_az_audiences', + 'field_az_credit', + 'field_az_eligibility', + 'field_az_incentives', + 'field_az_opportunity_location', + 'field_az_modality', + 'field_az_offered', + 'field_az_ongoing', + 'field_az_opportunity_type', + 'field_az_body', + 'field_az_parent_account', + 'field_az_program_date', + 'field_az_program_length', + 'field_az_program_website', + 'field_az_topic', + 'field_az_trellis_imported_date', + 'field_az_trellis_id', ]; foreach ($disabled_fields as $field) { $form[$field]['#disabled'] = TRUE; @@ -48,7 +61,7 @@ function az_opportunity_trellis_form_node_az_opportunity_edit_form_alter(&$form, $no_access_fields = [ // 'field_az_subheading', 'field_az_body', - // 'field_az_contacts', + 'field_az_eligibility', // 'field_az_attachments', ]; foreach ($no_access_fields as $field) { diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/config/install/migrate_plus.migration.az_trellis_opportunities.yml b/modules/custom/az_opportunity/az_opportunity_trellis/config/install/migrate_plus.migration.az_trellis_opportunities.yml index 7e4b80cbc5..e49d5cb164 100644 --- a/modules/custom/az_opportunity/az_opportunity_trellis/config/install/migrate_plus.migration.az_trellis_opportunities.yml +++ b/modules/custom/az_opportunity/az_opportunity_trellis/config/install/migrate_plus.migration.az_trellis_opportunities.yml @@ -3,6 +3,7 @@ status: true dependencies: { } id: az_trellis_opportunities class: null +idMap: { } field_plugin_method: null cck_plugin_method: null migration_tags: @@ -40,7 +41,7 @@ source: selector: Incentives__c - name: credit_type - label: Credit Type + label: 'Credit Type' selector: Credit_Type__c - name: location @@ -148,8 +149,8 @@ process: plugin: static_map source: incentives map: - Yes: 1 - No: 0 + 'Yes': 1 + 'No': 0 field_az_credit: credit_type field_az_opportunity_location: location field_az_program_website/uri: program_website @@ -193,25 +194,25 @@ process: - plugin: format_date source: application_open - from_format: 'Y-m-d' + from_format: Y-m-d to_format: 'Y-m-d\TH:i:s' field_az_application_date/end_value: - plugin: format_date source: application_closed - from_format: 'Y-m-d' + from_format: Y-m-d to_format: 'Y-m-d\TH:i:s' field_az_program_date/value: - plugin: format_date source: start_date - from_format: 'Y-m-d' + from_format: Y-m-d to_format: 'Y-m-d\TH:i:s' field_az_program_date/end_value: - plugin: format_date source: end_date - from_format: 'Y-m-d' + from_format: Y-m-d to_format: 'Y-m-d\TH:i:s' field_az_ongoing: - @@ -254,3 +255,4 @@ destination: migration_dependencies: optional: - az_trellis_opportunities_media +include: null diff --git a/modules/custom/az_opportunity/config/install/core.entity_form_display.node.az_opportunity.default.yml b/modules/custom/az_opportunity/config/install/core.entity_form_display.node.az_opportunity.default.yml index 94398af9c6..9a2924dbbe 100644 --- a/modules/custom/az_opportunity/config/install/core.entity_form_display.node.az_opportunity.default.yml +++ b/modules/custom/az_opportunity/config/install/core.entity_form_display.node.az_opportunity.default.yml @@ -7,6 +7,7 @@ dependencies: - field.field.node.az_opportunity.field_az_audiences - field.field.node.az_opportunity.field_az_body - field.field.node.az_opportunity.field_az_credit + - field.field.node.az_opportunity.field_az_eligibility - field.field.node.az_opportunity.field_az_incentives - field.field.node.az_opportunity.field_az_modality - field.field.node.az_opportunity.field_az_offered @@ -22,6 +23,7 @@ dependencies: - field.field.node.az_opportunity.field_az_trellis_imported_date - node.type.az_opportunity module: + - datetime - link - link_class - path @@ -60,7 +62,7 @@ content: third_party_settings: { } field_az_application_link: type: link_class_field_widget - weight: 22 + weight: 21 region: content settings: placeholder_url: '' @@ -71,7 +73,7 @@ content: third_party_settings: { } field_az_audiences: type: entity_reference_autocomplete - weight: 18 + weight: 17 region: content settings: match_operator: CONTAINS @@ -81,7 +83,7 @@ content: third_party_settings: { } field_az_body: type: text_textarea - weight: 24 + weight: 23 region: content settings: rows: 9 @@ -89,22 +91,30 @@ content: third_party_settings: { } field_az_credit: type: string_textfield - weight: 15 + weight: 14 region: content settings: size: 60 placeholder: '' third_party_settings: { } + field_az_eligibility: + type: text_textarea + weight: 24 + region: content + settings: + rows: 5 + placeholder: '' + third_party_settings: { } field_az_incentives: type: boolean_checkbox - weight: 14 + weight: 13 region: content settings: display_label: true third_party_settings: { } field_az_modality: type: entity_reference_autocomplete - weight: 17 + weight: 16 region: content settings: match_operator: CONTAINS @@ -114,7 +124,7 @@ content: third_party_settings: { } field_az_offered: type: entity_reference_autocomplete - weight: 19 + weight: 18 region: content settings: match_operator: CONTAINS @@ -131,7 +141,7 @@ content: third_party_settings: { } field_az_opportunity_location: type: string_textfield - weight: 23 + weight: 22 region: content settings: size: 60 @@ -145,7 +155,7 @@ content: third_party_settings: { } field_az_parent_account: type: string_textfield - weight: 16 + weight: 15 region: content settings: size: 60 @@ -181,7 +191,7 @@ content: third_party_settings: { } field_az_program_website: type: link_default - weight: 21 + weight: 20 region: content settings: placeholder_url: '' @@ -189,7 +199,7 @@ content: third_party_settings: { } field_az_topic: type: entity_reference_autocomplete - weight: 20 + weight: 19 region: content settings: match_operator: CONTAINS @@ -197,6 +207,20 @@ content: size: 60 placeholder: '' third_party_settings: { } + field_az_trellis_id: + type: string_textfield + weight: 25 + region: content + settings: + size: 60 + placeholder: '' + third_party_settings: { } + field_az_trellis_imported_date: + type: datetime_default + weight: 26 + region: content + settings: { } + third_party_settings: { } path: type: path weight: 6 @@ -247,6 +271,4 @@ content: region: content settings: { } third_party_settings: { } -hidden: - field_az_trellis_id: true - field_az_trellis_imported_date: true +hidden: { } diff --git a/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_card.yml b/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_card.yml index 012919d5bc..8ea3903b5e 100644 --- a/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_card.yml +++ b/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_card.yml @@ -8,6 +8,7 @@ dependencies: - field.field.node.az_opportunity.field_az_audiences - field.field.node.az_opportunity.field_az_body - field.field.node.az_opportunity.field_az_credit + - field.field.node.az_opportunity.field_az_eligibility - field.field.node.az_opportunity.field_az_incentives - field.field.node.az_opportunity.field_az_modality - field.field.node.az_opportunity.field_az_offered @@ -389,6 +390,7 @@ hidden: field_az_audiences: true field_az_body: true field_az_credit: true + field_az_eligibility: true field_az_incentives: true field_az_ongoing: true field_az_opportunity_type: true diff --git a/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_row.yml b/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_row.yml index 0395fe1d0f..d7af44fb9c 100644 --- a/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_row.yml +++ b/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_row.yml @@ -8,6 +8,7 @@ dependencies: - field.field.node.az_opportunity.field_az_audiences - field.field.node.az_opportunity.field_az_body - field.field.node.az_opportunity.field_az_credit + - field.field.node.az_opportunity.field_az_eligibility - field.field.node.az_opportunity.field_az_incentives - field.field.node.az_opportunity.field_az_modality - field.field.node.az_opportunity.field_az_offered @@ -247,6 +248,7 @@ hidden: field_az_audiences: true field_az_body: true field_az_credit: true + field_az_eligibility: true field_az_incentives: true field_az_offered: true field_az_ongoing: true diff --git a/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_row_with_background.yml b/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_row_with_background.yml index 18f3610333..21d12303c5 100644 --- a/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_row_with_background.yml +++ b/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_row_with_background.yml @@ -8,6 +8,7 @@ dependencies: - field.field.node.az_opportunity.field_az_audiences - field.field.node.az_opportunity.field_az_body - field.field.node.az_opportunity.field_az_credit + - field.field.node.az_opportunity.field_az_eligibility - field.field.node.az_opportunity.field_az_incentives - field.field.node.az_opportunity.field_az_modality - field.field.node.az_opportunity.field_az_offered @@ -40,6 +41,7 @@ hidden: field_az_audiences: true field_az_body: true field_az_credit: true + field_az_eligibility: true field_az_incentives: true field_az_modality: true field_az_offered: true diff --git a/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_small_row.yml b/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_small_row.yml index 27b930a5b7..ad098e57c4 100644 --- a/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_small_row.yml +++ b/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_small_row.yml @@ -8,6 +8,7 @@ dependencies: - field.field.node.az_opportunity.field_az_audiences - field.field.node.az_opportunity.field_az_body - field.field.node.az_opportunity.field_az_credit + - field.field.node.az_opportunity.field_az_eligibility - field.field.node.az_opportunity.field_az_incentives - field.field.node.az_opportunity.field_az_modality - field.field.node.az_opportunity.field_az_offered @@ -240,6 +241,7 @@ hidden: field_az_audiences: true field_az_body: true field_az_credit: true + field_az_eligibility: true field_az_incentives: true field_az_modality: true field_az_offered: true diff --git a/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.default.yml b/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.default.yml index b898b09788..ac877f52eb 100644 --- a/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.default.yml +++ b/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.default.yml @@ -7,6 +7,7 @@ dependencies: - field.field.node.az_opportunity.field_az_audiences - field.field.node.az_opportunity.field_az_body - field.field.node.az_opportunity.field_az_credit + - field.field.node.az_opportunity.field_az_eligibility - field.field.node.az_opportunity.field_az_incentives - field.field.node.az_opportunity.field_az_modality - field.field.node.az_opportunity.field_az_offered @@ -422,7 +423,7 @@ content: label: above settings: { } third_party_settings: { } - weight: 3 + weight: 2 region: content field_az_credit: type: string @@ -432,6 +433,13 @@ content: third_party_settings: { } weight: 5 region: content + field_az_eligibility: + type: text_default + label: above + settings: { } + third_party_settings: { } + weight: 3 + region: content field_az_incentives: type: boolean label: hidden diff --git a/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_eligibility.yml b/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_eligibility.yml new file mode 100644 index 0000000000..12361bc4b5 --- /dev/null +++ b/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_eligibility.yml @@ -0,0 +1,23 @@ +langcode: en +status: true +dependencies: + config: + - field.storage.node.field_az_eligibility + - filter.format.az_standard + - node.type.az_opportunity + module: + - text +id: node.az_opportunity.field_az_eligibility +field_name: field_az_eligibility +entity_type: node +bundle: az_opportunity +label: Eligibility +description: '' +required: false +translatable: false +default_value: { } +default_value_callback: '' +settings: + allowed_formats: + - az_standard +field_type: text_long diff --git a/modules/custom/az_opportunity/config/install/field.storage.node.field_az_eligibility.yml b/modules/custom/az_opportunity/config/install/field.storage.node.field_az_eligibility.yml new file mode 100644 index 0000000000..ad58d78c55 --- /dev/null +++ b/modules/custom/az_opportunity/config/install/field.storage.node.field_az_eligibility.yml @@ -0,0 +1,18 @@ +langcode: en +status: true +dependencies: + module: + - node + - text +id: node.field_az_eligibility +field_name: field_az_eligibility +entity_type: node +type: text_long +settings: { } +module: text +locked: false +cardinality: 1 +translatable: true +indexes: { } +persist_with_no_fields: false +custom_storage: false From b7376d6668b0756825c62f5af73264b9c56d6e22 Mon Sep 17 00:00:00 2001 From: Z Saenz Date: Fri, 20 Mar 2026 09:35:19 -0700 Subject: [PATCH 24/59] Update migrations, merge event date picker fix --- ...lus.migration.az_trellis_opportunities.yml | 14 +- .../js/az_opportunity_trellis_date.js | 182 ++++++++++++++++-- .../az_trellis_opportunities_files.yml | 42 ---- .../az_trellis_opportunities_media.yml | 56 ------ .../field/AZOpportunityTrellisViewsField.php | 20 -- 5 files changed, 181 insertions(+), 133 deletions(-) delete mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/migrations/az_trellis_opportunities_files.yml delete mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/migrations/az_trellis_opportunities_media.yml diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/config/install/migrate_plus.migration.az_trellis_opportunities.yml b/modules/custom/az_opportunity/az_opportunity_trellis/config/install/migrate_plus.migration.az_trellis_opportunities.yml index e49d5cb164..a4b2e4745a 100644 --- a/modules/custom/az_opportunity/az_opportunity_trellis/config/install/migrate_plus.migration.az_trellis_opportunities.yml +++ b/modules/custom/az_opportunity/az_opportunity_trellis/config/install/migrate_plus.migration.az_trellis_opportunities.yml @@ -103,6 +103,10 @@ source: name: program_type label: 'Program Type' selector: Program_Type__c + - + name: publish + label: Publish + selector: Publish_Formula - name: owner_netid label: 'Owner NetID' @@ -245,14 +249,16 @@ process: value_key: name ignore_case: true status: + - + plugin: get + source: publish - plugin: default_value - default_value: 1 + strict: true + default_value: 0 destination: plugin: 'entity:node' default_bundle: az_opportunity validate: false -migration_dependencies: - optional: - - az_trellis_opportunities_media +migration_dependencies: null include: null diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/js/az_opportunity_trellis_date.js b/modules/custom/az_opportunity/az_opportunity_trellis/js/az_opportunity_trellis_date.js index 911cef299d..740110ec42 100644 --- a/modules/custom/az_opportunity/az_opportunity_trellis/js/az_opportunity_trellis_date.js +++ b/modules/custom/az_opportunity/az_opportunity_trellis/js/az_opportunity_trellis_date.js @@ -1,27 +1,187 @@ /** * @file - * Trellis date range picker. + * Trellis date picker behavior. */ -((Drupal, drupalSettings, once) => { +/* global VanillaCalendarPro */ + +((Drupal, once) => { + /** + * Normalizes begin/end input values to a calendar selectedDates array. + * + * @param {HTMLInputElement} begin + * Begin date input element. + * @param {HTMLInputElement} end + * End date input element. + * @param {Object} datePickerIntegration + * Shared date picker integration helpers. + * + * @return {string[]} + * Selected date values for Vanilla Calendar Pro. + */ + const getSelectedDatesFromInputs = (begin, end, datePickerIntegration) => { + const selectedDates = []; + const beginDate = datePickerIntegration.normalizeIsoDate(begin.value); + const endDate = datePickerIntegration.normalizeIsoDate(end.value); + if (beginDate && endDate) { + selectedDates.push(`${beginDate}:${endDate}`); + } else if (beginDate) { + selectedDates.push(beginDate); + } + return selectedDates; + }; + Drupal.behaviors.trellisDatePicker = { attach(context) { + const datePickerIntegration = Drupal.azCore?.datePickerIntegration; + const elements = once('aztrellisdate', '.az-trellis-daterange', context); elements.forEach((element) => { const begin = element; const id = element.dataset.azTrellisDaterangeEnd; const end = document.getElementById(id); - // eslint-disable-next-line no-unused-vars, no-undef, new-cap - const picker = new easepick.create({ - element: begin, - css: drupalSettings.trellisDatePicker.css, - zIndex: 10, - RangePlugin: { - elementEnd: end, + + if (!end || !window.VanillaCalendarPro || !datePickerIntegration) { + return; + } + + const selectedDates = getSelectedDatesFromInputs( + begin, + end, + datePickerIntegration, + ); + + let calendarTabHandler = null; + let suppressOnHideFocus = false; + + const config = { + inputMode: true, + openOnFocus: false, + selectedTheme: 'light', + themeAttrDetect: false, + selectionDatesMode: 'multiple-ranged', + enableEdgeDatesOnly: true, + enableJumpToSelectedDate: true, + selectedDates, + onChangeToInput(self) { + const values = datePickerIntegration + .getNormalizedSelectedDates(self) + .slice(0, 2); + begin.value = values[0] || ''; + end.value = values[1] || ''; + + if (values.length === 2) { + self.hide(); + } + }, + onShow(self) { + const calendarEl = self.context.mainElement; + calendarTabHandler = (event) => { + if (event.key !== 'Tab') return; + + if ( + !datePickerIntegration.shouldExitCalendarOnTab( + event, + calendarEl, + ) + ) { + return; + } + + event.preventDefault(); + suppressOnHideFocus = true; + // onHide fires synchronously, resets inputElement to begin and focuses it. + self.hide(); + // Move focus in natural tab order around the begin/end pair. + datePickerIntegration.focusRelativeToAnchor( + calendarEl, + event.shiftKey ? begin : end, + event.shiftKey ? 'previous' : 'next', + ); + }; + calendarEl.addEventListener('keydown', calendarTabHandler); }, - plugins: ['RangePlugin'], + onHide(self) { + if (calendarTabHandler) { + self.context.mainElement.removeEventListener( + 'keydown', + calendarTabHandler, + ); + calendarTabHandler = null; + } + // Reset to begin input after closing so default input-mode behavior + // stays anchored to the primary field. + self.context.inputElement = begin; + if (suppressOnHideFocus) { + suppressOnHideFocus = false; + } else { + begin.focus(); + } + }, + }; + + const calendar = new VanillaCalendarPro.Calendar(begin, config); + calendar.init(); + + // Enable keyboard opening for begin input (Enter/Arrow/Space). + datePickerIntegration.bindCalendarOpenHandlers(begin, () => { + calendar.context.inputElement = begin; + calendar.show(); + }); + + const syncFromInputs = () => { + const beginRaw = String(begin.value || '').trim(); + const endRaw = String(end.value || '').trim(); + let beginValue = datePickerIntegration.normalizeIsoDate(beginRaw); + let endValue = datePickerIntegration.normalizeIsoDate(endRaw); + + // Silently discard invalid manual values. + if (beginRaw && !beginValue) { + begin.value = ''; + } + if (endRaw && !endValue) { + end.value = ''; + } + + beginValue = datePickerIntegration.normalizeIsoDate(begin.value); + endValue = datePickerIntegration.normalizeIsoDate(end.value); + + const newDates = []; + if (beginValue && endValue) { + begin.value = beginValue; + end.value = endValue; + newDates.push(`${beginValue}:${endValue}`); + } else if (beginValue) { + begin.value = beginValue; + newDates.push(beginValue); + } + + calendar.set( + { selectedDates: newDates }, + { dates: true, year: true, month: true }, + ); + }; + + // Allow direct text editing on begin/end inputs. + begin.addEventListener('change', syncFromInputs); + end.addEventListener('change', syncFromInputs); + + let endOpenQueued = false; + datePickerIntegration.bindCalendarOpenHandlers(end, () => { + if (endOpenQueued) { + return; + } + + // Treat End as the active input while opening from End so this click + // is not interpreted as an outside click by input-mode handlers. + calendar.context.inputElement = end; + endOpenQueued = true; + requestAnimationFrame(() => { + calendar.show(); + endOpenQueued = false; + }); }); }); }, }; -})(Drupal, drupalSettings, once); +})(Drupal, once); diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/migrations/az_trellis_opportunities_files.yml b/modules/custom/az_opportunity/az_opportunity_trellis/migrations/az_trellis_opportunities_files.yml deleted file mode 100644 index 9c68873b56..0000000000 --- a/modules/custom/az_opportunity/az_opportunity_trellis/migrations/az_trellis_opportunities_files.yml +++ /dev/null @@ -1,42 +0,0 @@ -id: az_trellis_opportunities_files -label: Trellis Opportunities Files -source: - plugin: az_trellis_opportunities_api - trellis_ids: { } - track_changes: true - fields: - - - name: id - label: ID - selector: Id - - - name: image_url - label: 'Image URL' - selector: Image_URL - ids: - id: - type: string - -process: - status: - plugin: default_value - default_value: 1 - - uri: - - - plugin: az_migration_remote_file - migration: az_trellis_opportunities_files - default_filename: id - directory: 'public://trellis-opportunities' - source_ids: - - id - source: image_url - - - plugin: skip_on_empty - method: row - uid: - plugin: default_value - default_value: 0 - -destination: - plugin: entity:file diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/migrations/az_trellis_opportunities_media.yml b/modules/custom/az_opportunity/az_opportunity_trellis/migrations/az_trellis_opportunities_media.yml deleted file mode 100644 index a9b0888f7e..0000000000 --- a/modules/custom/az_opportunity/az_opportunity_trellis/migrations/az_trellis_opportunities_media.yml +++ /dev/null @@ -1,56 +0,0 @@ -id: az_trellis_opportunities_media -label: Trellis Opportunities Media -source: - plugin: az_trellis_opportunities_api - trellis_ids: { } - track_changes: true - fields: - - - name: id - label: ID - selector: Id - - - name: image_url - label: 'Image URL' - selector: Image_URL - - - name: name - label: Name - selector: Name - ids: - id: - type: string - -process: - uid: - plugin: default_value - default_value: 0 - bundle: - plugin: default_value - default_value: az_image - field_media_az_image/target_id: - - - plugin: migration_lookup - migration: az_trellis_opportunities_files - source: id - no_stub: true - - - plugin: skip_on_empty - method: row - field_media_az_image/alt: name - field_media_az_image/title: name - status: - plugin: default_value - default_value: 1 - -destination: - plugin: entity:media - -dependencies: - enforced: - module: - - az_opportunity_trellis - - az_media -migration_dependencies: - optional: - - az_trellis_opportunities_files diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/src/Plugin/views/field/AZOpportunityTrellisViewsField.php b/modules/custom/az_opportunity/az_opportunity_trellis/src/Plugin/views/field/AZOpportunityTrellisViewsField.php index 8b4a00c970..3fcb9aa7cd 100644 --- a/modules/custom/az_opportunity/az_opportunity_trellis/src/Plugin/views/field/AZOpportunityTrellisViewsField.php +++ b/modules/custom/az_opportunity/az_opportunity_trellis/src/Plugin/views/field/AZOpportunityTrellisViewsField.php @@ -112,26 +112,6 @@ public function viewsFormSubmit(&$form, FormStateInterface $form_state) { } $migrations = [ - 'az_trellis_opportunities_files' => [ - 'limit' => 0, - 'update' => 0, - 'force' => 0, - 'configuration' => [ - 'source' => [ - 'trellis_ids' => $ids, - ], - ], - ], - 'az_trellis_opportunities_media' => [ - 'limit' => 0, - 'update' => 0, - 'force' => 0, - 'configuration' => [ - 'source' => [ - 'trellis_ids' => $ids, - ], - ], - ], 'az_trellis_opportunities' => [ 'limit' => 0, 'update' => 0, From 06cdac9704519eda6ca1c1ca1bca9d1249c7d687 Mon Sep 17 00:00:00 2001 From: Z Saenz Date: Tue, 24 Mar 2026 09:27:49 -0700 Subject: [PATCH 25/59] adding enterprise attributes --- .../az_opportunity/az_opportunity.info.yml | 1 + .../az_opportunity_trellis.info.yml | 1 + ...rm_display.node.az_opportunity.default.yml | 122 +- ...ew_display.node.az_opportunity.az_card.yml | 24 +- ...iew_display.node.az_opportunity.az_row.yml | 31 +- ....az_opportunity.az_row_with_background.yml | 16 +- ...splay.node.az_opportunity.az_small_row.yml | 16 +- ...ew_display.node.az_opportunity.default.yml | 95 +- ...y_term.az_opportunity_audience.default.yml | 21 +- ...erm.az_opportunity_categories.az_badge.yml | 45 + ...term.az_opportunity_categories.default.yml | 20 + ...y_term.az_opportunity_modality.default.yml | 27 +- ...omy_term.az_opportunity_topic.az_badge.yml | 46 +- ...nomy_term.az_opportunity_topic.default.yml | 28 +- ...nomy_term.az_opportunity_type.az_badge.yml | 46 +- ...onomy_term.az_opportunity_type.default.yml | 22 +- ...node.az_opportunity.field_az_audiences.yml | 29 +- ...ld.node.az_opportunity.field_az_credit.yml | 19 +- ...rtunity.field_az_enterprise_attributes.yml | 28 + ...ode.az_opportunity.field_az_incentives.yml | 10 +- ....node.az_opportunity.field_az_modality.yml | 29 +- ...ortunity.field_az_opportunity_category.yml | 28 + ...pportunity.field_az_opportunity_credit.yml | 20 + ..._opportunity.field_az_opportunity_type.yml | 29 +- ...az_opportunity.field_az_parent_account.yml | 2 +- ...eld.node.az_opportunity.field_az_topic.yml | 29 +- .../field.storage.node.field_az_audiences.yml | 20 +- .../field.storage.node.field_az_credit.yml | 21 +- ...field.storage.node.field_az_incentives.yml | 12 +- .../field.storage.node.field_az_modality.yml | 20 +- ...age.node.field_az_opportunity_category.yml | 19 + ...orage.node.field_az_opportunity_credit.yml | 29 + ...storage.node.field_az_opportunity_type.yml | 20 +- .../field.storage.node.field_az_topic.yml | 20 +- ...omy.vocabulary.az_opportunity_audience.yml | 9 +- ...y.vocabulary.az_opportunity_categories.yml | 8 + ...omy.vocabulary.az_opportunity_modality.yml | 9 +- ...xonomy.vocabulary.az_opportunity_topic.yml | 9 +- ...axonomy.vocabulary.az_opportunity_type.yml | 9 +- .../install/views.view.az_opportunity.yml | 1549 +---------------- 40 files changed, 359 insertions(+), 2179 deletions(-) create mode 100644 modules/custom/az_opportunity/config/install/core.entity_view_display.taxonomy_term.az_opportunity_categories.az_badge.yml create mode 100644 modules/custom/az_opportunity/config/install/core.entity_view_display.taxonomy_term.az_opportunity_categories.default.yml create mode 100644 modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_enterprise_attributes.yml create mode 100644 modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_opportunity_category.yml create mode 100644 modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_opportunity_credit.yml create mode 100644 modules/custom/az_opportunity/config/install/field.storage.node.field_az_opportunity_category.yml create mode 100644 modules/custom/az_opportunity/config/install/field.storage.node.field_az_opportunity_credit.yml create mode 100644 modules/custom/az_opportunity/config/install/taxonomy.vocabulary.az_opportunity_categories.yml diff --git a/modules/custom/az_opportunity/az_opportunity.info.yml b/modules/custom/az_opportunity/az_opportunity.info.yml index b7f81a7a94..e3c02b3821 100644 --- a/modules/custom/az_opportunity/az_opportunity.info.yml +++ b/modules/custom/az_opportunity/az_opportunity.info.yml @@ -8,6 +8,7 @@ lifecycle_link: 'https://github.com/az-digital/az_quickstart/blob/main/RELEASES. dependencies: - az_core:az_core + - az_enterprise_attributes_import:az_enterprise_attributes_import - calendar_link:calendar_link - date_ap_style:date_ap_style - field_group:field_group diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.info.yml b/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.info.yml index 342e9d52c1..68857f3e5e 100644 --- a/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.info.yml +++ b/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.info.yml @@ -9,6 +9,7 @@ php: 8.0 dependencies: - az_core:az_core + - az_enterprise_attributes_import:az_enterprise_attributes_import - az_opportunity:az_opportunity - az_migration:az_migration_remote - drupal:views diff --git a/modules/custom/az_opportunity/config/install/core.entity_form_display.node.az_opportunity.default.yml b/modules/custom/az_opportunity/config/install/core.entity_form_display.node.az_opportunity.default.yml index 9a2924dbbe..395ace6998 100644 --- a/modules/custom/az_opportunity/config/install/core.entity_form_display.node.az_opportunity.default.yml +++ b/modules/custom/az_opportunity/config/install/core.entity_form_display.node.az_opportunity.default.yml @@ -4,25 +4,24 @@ dependencies: config: - field.field.node.az_opportunity.field_az_application_date - field.field.node.az_opportunity.field_az_application_link - - field.field.node.az_opportunity.field_az_audiences - field.field.node.az_opportunity.field_az_body - - field.field.node.az_opportunity.field_az_credit - field.field.node.az_opportunity.field_az_eligibility + - field.field.node.az_opportunity.field_az_enterprise_attributes - field.field.node.az_opportunity.field_az_incentives - - field.field.node.az_opportunity.field_az_modality - field.field.node.az_opportunity.field_az_offered - field.field.node.az_opportunity.field_az_ongoing + - field.field.node.az_opportunity.field_az_opportunity_category + - field.field.node.az_opportunity.field_az_opportunity_credit - field.field.node.az_opportunity.field_az_opportunity_location - - field.field.node.az_opportunity.field_az_opportunity_type - field.field.node.az_opportunity.field_az_parent_account - field.field.node.az_opportunity.field_az_program_date - field.field.node.az_opportunity.field_az_program_length - field.field.node.az_opportunity.field_az_program_website - - field.field.node.az_opportunity.field_az_topic - field.field.node.az_opportunity.field_az_trellis_id - field.field.node.az_opportunity.field_az_trellis_imported_date - node.type.az_opportunity module: + - az_core - datetime - link - link_class @@ -36,13 +35,13 @@ mode: default content: created: type: datetime_timestamp - weight: 3 + weight: 20 region: content settings: { } third_party_settings: { } field_az_application_date: type: smartdate_only - weight: 11 + weight: 5 region: content settings: separator: to @@ -62,7 +61,7 @@ content: third_party_settings: { } field_az_application_link: type: link_class_field_widget - weight: 21 + weight: 9 region: content settings: placeholder_url: '' @@ -71,50 +70,45 @@ content: link_class_force: 'btn btn-red' link_class_select: '' third_party_settings: { } - field_az_audiences: - type: entity_reference_autocomplete - weight: 17 - region: content - settings: - match_operator: CONTAINS - match_limit: 10 - size: 60 - placeholder: '' - third_party_settings: { } field_az_body: type: text_textarea - weight: 23 + weight: 13 region: content settings: rows: 9 placeholder: '' third_party_settings: { } - field_az_credit: - type: string_textfield + field_az_eligibility: + type: text_textarea weight: 14 region: content settings: - size: 60 + rows: 5 placeholder: '' third_party_settings: { } - field_az_eligibility: - type: text_textarea - weight: 24 + field_az_enterprise_attributes: + type: attributes_select + weight: 2 region: content settings: - rows: 5 - placeholder: '' + allowed_attributes: + Audiences__c: Audiences__c + Event_Format__c: Event_Format__c + Topic__c: Topic__c + Arizona_County__c: 0 + Category1__c: 0 + Tribal_Nation__c: 0 + Display_Name_Formula__c: 0 third_party_settings: { } field_az_incentives: - type: boolean_checkbox - weight: 13 + type: options_select + weight: 11 region: content - settings: - display_label: true + settings: { } third_party_settings: { } - field_az_modality: + field_az_offered: type: entity_reference_autocomplete - weight: 16 + weight: 7 region: content settings: match_operator: CONTAINS @@ -122,9 +116,16 @@ content: size: 60 placeholder: '' third_party_settings: { } - field_az_offered: + field_az_ongoing: + type: boolean_checkbox + weight: 4 + region: content + settings: + display_label: true + third_party_settings: { } + field_az_opportunity_category: type: entity_reference_autocomplete - weight: 18 + weight: 1 region: content settings: match_operator: CONTAINS @@ -132,30 +133,23 @@ content: size: 60 placeholder: '' third_party_settings: { } - field_az_ongoing: - type: boolean_checkbox - weight: 10 + field_az_opportunity_credit: + type: options_select + weight: 12 region: content - settings: - display_label: true + settings: { } third_party_settings: { } field_az_opportunity_location: type: string_textfield - weight: 22 + weight: 10 region: content settings: size: 60 placeholder: '' third_party_settings: { } - field_az_opportunity_type: - type: options_buttons - weight: 1 - region: content - settings: { } - third_party_settings: { } field_az_parent_account: type: string_textfield - weight: 15 + weight: 16 region: content settings: size: 60 @@ -163,7 +157,7 @@ content: third_party_settings: { } field_az_program_date: type: smartdate_only - weight: 12 + weight: 6 region: content settings: separator: to @@ -183,7 +177,7 @@ content: third_party_settings: { } field_az_program_length: type: string_textfield - weight: 9 + weight: 3 region: content settings: size: 60 @@ -191,25 +185,15 @@ content: third_party_settings: { } field_az_program_website: type: link_default - weight: 20 + weight: 8 region: content settings: placeholder_url: '' placeholder_title: '' third_party_settings: { } - field_az_topic: - type: entity_reference_autocomplete - weight: 19 - region: content - settings: - match_operator: CONTAINS - match_limit: 10 - size: 60 - placeholder: '' - third_party_settings: { } field_az_trellis_id: type: string_textfield - weight: 25 + weight: 15 region: content settings: size: 60 @@ -217,33 +201,33 @@ content: third_party_settings: { } field_az_trellis_imported_date: type: datetime_default - weight: 26 + weight: 17 region: content settings: { } third_party_settings: { } path: type: path - weight: 6 + weight: 23 region: content settings: { } third_party_settings: { } promote: type: boolean_checkbox - weight: 4 + weight: 21 region: content settings: display_label: true third_party_settings: { } status: type: boolean_checkbox - weight: 8 + weight: 18 region: content settings: display_label: true third_party_settings: { } sticky: type: boolean_checkbox - weight: 5 + weight: 22 region: content settings: display_label: true @@ -258,7 +242,7 @@ content: third_party_settings: { } uid: type: entity_reference_autocomplete - weight: 2 + weight: 19 region: content settings: match_operator: CONTAINS @@ -267,7 +251,7 @@ content: placeholder: '' third_party_settings: { } url_redirects: - weight: 7 + weight: 24 region: content settings: { } third_party_settings: { } diff --git a/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_card.yml b/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_card.yml index 8ea3903b5e..70ce182fb4 100644 --- a/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_card.yml +++ b/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_card.yml @@ -5,21 +5,19 @@ dependencies: - core.entity_view_mode.node.az_card - field.field.node.az_opportunity.field_az_application_date - field.field.node.az_opportunity.field_az_application_link - - field.field.node.az_opportunity.field_az_audiences - field.field.node.az_opportunity.field_az_body - - field.field.node.az_opportunity.field_az_credit - field.field.node.az_opportunity.field_az_eligibility + - field.field.node.az_opportunity.field_az_enterprise_attributes - field.field.node.az_opportunity.field_az_incentives - - field.field.node.az_opportunity.field_az_modality - field.field.node.az_opportunity.field_az_offered - field.field.node.az_opportunity.field_az_ongoing + - field.field.node.az_opportunity.field_az_opportunity_category + - field.field.node.az_opportunity.field_az_opportunity_credit - field.field.node.az_opportunity.field_az_opportunity_location - - field.field.node.az_opportunity.field_az_opportunity_type - field.field.node.az_opportunity.field_az_parent_account - field.field.node.az_opportunity.field_az_program_date - field.field.node.az_opportunity.field_az_program_length - field.field.node.az_opportunity.field_az_program_website - - field.field.node.az_opportunity.field_az_topic - field.field.node.az_opportunity.field_az_trellis_id - field.field.node.az_opportunity.field_az_trellis_imported_date - node.type.az_opportunity @@ -347,15 +345,6 @@ content: third_party_settings: { } weight: 9 region: content - field_az_modality: - type: entity_reference_entity_view - label: inline - settings: - view_mode: default - link: false - third_party_settings: { } - weight: 8 - region: content field_az_offered: type: entity_reference_label label: inline @@ -387,17 +376,16 @@ content: region: content hidden: field_az_application_link: true - field_az_audiences: true field_az_body: true - field_az_credit: true field_az_eligibility: true + field_az_enterprise_attributes: true field_az_incentives: true field_az_ongoing: true - field_az_opportunity_type: true + field_az_opportunity_category: true + field_az_opportunity_credit: true field_az_program_date: true field_az_program_length: true field_az_program_website: true - field_az_topic: true field_az_trellis_id: true field_az_trellis_imported_date: true links: true diff --git a/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_row.yml b/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_row.yml index d7af44fb9c..712b8aee47 100644 --- a/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_row.yml +++ b/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_row.yml @@ -5,21 +5,19 @@ dependencies: - core.entity_view_mode.node.az_row - field.field.node.az_opportunity.field_az_application_date - field.field.node.az_opportunity.field_az_application_link - - field.field.node.az_opportunity.field_az_audiences - field.field.node.az_opportunity.field_az_body - - field.field.node.az_opportunity.field_az_credit - field.field.node.az_opportunity.field_az_eligibility + - field.field.node.az_opportunity.field_az_enterprise_attributes - field.field.node.az_opportunity.field_az_incentives - - field.field.node.az_opportunity.field_az_modality - field.field.node.az_opportunity.field_az_offered - field.field.node.az_opportunity.field_az_ongoing + - field.field.node.az_opportunity.field_az_opportunity_category + - field.field.node.az_opportunity.field_az_opportunity_credit - field.field.node.az_opportunity.field_az_opportunity_location - - field.field.node.az_opportunity.field_az_opportunity_type - field.field.node.az_opportunity.field_az_parent_account - field.field.node.az_opportunity.field_az_program_date - field.field.node.az_opportunity.field_az_program_length - field.field.node.az_opportunity.field_az_program_website - - field.field.node.az_opportunity.field_az_topic - field.field.node.az_opportunity.field_az_trellis_id - field.field.node.az_opportunity.field_az_trellis_imported_date - node.type.az_opportunity @@ -197,14 +195,6 @@ content: third_party_settings: { } weight: 13 region: content - field_az_modality: - type: entity_reference_label - label: inline - settings: - link: false - third_party_settings: { } - weight: 10 - region: content field_az_opportunity_location: type: string label: inline @@ -224,15 +214,6 @@ content: third_party_settings: { } weight: 1 region: content - field_az_topic: - type: entity_reference_entity_view - label: hidden - settings: - view_mode: az_badge - link: false - third_party_settings: { } - weight: 1 - region: content links: settings: { } third_party_settings: { } @@ -245,14 +226,14 @@ content: region: content hidden: field_az_application_link: true - field_az_audiences: true field_az_body: true - field_az_credit: true field_az_eligibility: true + field_az_enterprise_attributes: true field_az_incentives: true field_az_offered: true field_az_ongoing: true - field_az_opportunity_type: true + field_az_opportunity_category: true + field_az_opportunity_credit: true field_az_parent_account: true field_az_program_length: true field_az_program_website: true diff --git a/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_row_with_background.yml b/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_row_with_background.yml index 21d12303c5..ce2f91ba3f 100644 --- a/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_row_with_background.yml +++ b/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_row_with_background.yml @@ -5,21 +5,19 @@ dependencies: - core.entity_view_mode.node.az_row_with_background - field.field.node.az_opportunity.field_az_application_date - field.field.node.az_opportunity.field_az_application_link - - field.field.node.az_opportunity.field_az_audiences - field.field.node.az_opportunity.field_az_body - - field.field.node.az_opportunity.field_az_credit - field.field.node.az_opportunity.field_az_eligibility + - field.field.node.az_opportunity.field_az_enterprise_attributes - field.field.node.az_opportunity.field_az_incentives - - field.field.node.az_opportunity.field_az_modality - field.field.node.az_opportunity.field_az_offered - field.field.node.az_opportunity.field_az_ongoing + - field.field.node.az_opportunity.field_az_opportunity_category + - field.field.node.az_opportunity.field_az_opportunity_credit - field.field.node.az_opportunity.field_az_opportunity_location - - field.field.node.az_opportunity.field_az_opportunity_type - field.field.node.az_opportunity.field_az_parent_account - field.field.node.az_opportunity.field_az_program_date - field.field.node.az_opportunity.field_az_program_length - field.field.node.az_opportunity.field_az_program_website - - field.field.node.az_opportunity.field_az_topic - field.field.node.az_opportunity.field_az_trellis_id - field.field.node.az_opportunity.field_az_trellis_imported_date - node.type.az_opportunity @@ -38,21 +36,19 @@ content: hidden: field_az_application_date: true field_az_application_link: true - field_az_audiences: true field_az_body: true - field_az_credit: true field_az_eligibility: true + field_az_enterprise_attributes: true field_az_incentives: true - field_az_modality: true field_az_offered: true field_az_ongoing: true + field_az_opportunity_category: true + field_az_opportunity_credit: true field_az_opportunity_location: true - field_az_opportunity_type: true field_az_parent_account: true field_az_program_date: true field_az_program_length: true field_az_program_website: true - field_az_topic: true field_az_trellis_id: true field_az_trellis_imported_date: true smart_title: true diff --git a/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_small_row.yml b/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_small_row.yml index ad098e57c4..80576f4d67 100644 --- a/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_small_row.yml +++ b/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_small_row.yml @@ -5,21 +5,19 @@ dependencies: - core.entity_view_mode.node.az_small_row - field.field.node.az_opportunity.field_az_application_date - field.field.node.az_opportunity.field_az_application_link - - field.field.node.az_opportunity.field_az_audiences - field.field.node.az_opportunity.field_az_body - - field.field.node.az_opportunity.field_az_credit - field.field.node.az_opportunity.field_az_eligibility + - field.field.node.az_opportunity.field_az_enterprise_attributes - field.field.node.az_opportunity.field_az_incentives - - field.field.node.az_opportunity.field_az_modality - field.field.node.az_opportunity.field_az_offered - field.field.node.az_opportunity.field_az_ongoing + - field.field.node.az_opportunity.field_az_opportunity_category + - field.field.node.az_opportunity.field_az_opportunity_credit - field.field.node.az_opportunity.field_az_opportunity_location - - field.field.node.az_opportunity.field_az_opportunity_type - field.field.node.az_opportunity.field_az_parent_account - field.field.node.az_opportunity.field_az_program_date - field.field.node.az_opportunity.field_az_program_length - field.field.node.az_opportunity.field_az_program_website - - field.field.node.az_opportunity.field_az_topic - field.field.node.az_opportunity.field_az_trellis_id - field.field.node.az_opportunity.field_az_trellis_imported_date - node.type.az_opportunity @@ -238,21 +236,19 @@ content: region: content hidden: field_az_application_link: true - field_az_audiences: true field_az_body: true - field_az_credit: true field_az_eligibility: true + field_az_enterprise_attributes: true field_az_incentives: true - field_az_modality: true field_az_offered: true field_az_ongoing: true + field_az_opportunity_category: true + field_az_opportunity_credit: true field_az_opportunity_location: true - field_az_opportunity_type: true field_az_parent_account: true field_az_program_date: true field_az_program_length: true field_az_program_website: true - field_az_topic: true field_az_trellis_id: true field_az_trellis_imported_date: true links: true diff --git a/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.default.yml b/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.default.yml index ac877f52eb..27a55b29ea 100644 --- a/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.default.yml +++ b/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.default.yml @@ -4,21 +4,19 @@ dependencies: config: - field.field.node.az_opportunity.field_az_application_date - field.field.node.az_opportunity.field_az_application_link - - field.field.node.az_opportunity.field_az_audiences - field.field.node.az_opportunity.field_az_body - - field.field.node.az_opportunity.field_az_credit - field.field.node.az_opportunity.field_az_eligibility + - field.field.node.az_opportunity.field_az_enterprise_attributes - field.field.node.az_opportunity.field_az_incentives - - field.field.node.az_opportunity.field_az_modality - field.field.node.az_opportunity.field_az_offered - field.field.node.az_opportunity.field_az_ongoing + - field.field.node.az_opportunity.field_az_opportunity_category + - field.field.node.az_opportunity.field_az_opportunity_credit - field.field.node.az_opportunity.field_az_opportunity_location - - field.field.node.az_opportunity.field_az_opportunity_type - field.field.node.az_opportunity.field_az_parent_account - field.field.node.az_opportunity.field_az_program_date - field.field.node.az_opportunity.field_az_program_length - field.field.node.az_opportunity.field_az_program_website - - field.field.node.az_opportunity.field_az_topic - field.field.node.az_opportunity.field_az_trellis_id - field.field.node.az_opportunity.field_az_trellis_imported_date - node.type.az_opportunity @@ -26,6 +24,7 @@ dependencies: - datetime_range - field_group - link + - options - smart_title - text - user @@ -157,7 +156,7 @@ third_party_settings: label: col7 parent_name: group_bottom_row region: content - weight: 15 + weight: 1 format_type: html_element format_settings: classes: col @@ -177,7 +176,7 @@ third_party_settings: label: col8 parent_name: group_bottom_row region: content - weight: 17 + weight: 2 format_type: html_element format_settings: classes: col @@ -219,7 +218,6 @@ third_party_settings: group_where: children: - field_az_opportunity_location - - field_az_modality label: Location parent_name: group_col1 region: content @@ -280,7 +278,6 @@ third_party_settings: group_incentives: children: - field_az_incentives - - field_az_credit label: Incentives parent_name: group_col5 region: content @@ -299,8 +296,7 @@ third_party_settings: effect: none speed: fast group_audiences: - children: - - field_az_audiences + children: { } label: Audiences parent_name: group_col6 region: content @@ -339,9 +335,7 @@ third_party_settings: effect: none speed: fast group_topics: - children: - - field_az_opportunity_type - - field_az_topic + children: { } label: Topics parent_name: '' region: content @@ -366,7 +360,7 @@ third_party_settings: label: 'Bottom Row' parent_name: '' region: content - weight: 7 + weight: 2 format_type: html_element format_settings: classes: row @@ -410,61 +404,51 @@ content: third_party_settings: { } weight: 16 region: content - field_az_audiences: - type: entity_reference_label - label: hidden - settings: - link: false - third_party_settings: { } - weight: 7 - region: content field_az_body: type: text_default label: above settings: { } third_party_settings: { } - weight: 2 - region: content - field_az_credit: - type: string - label: hidden - settings: - link_to_entity: false - third_party_settings: { } - weight: 5 + weight: 6 region: content field_az_eligibility: type: text_default label: above settings: { } third_party_settings: { } - weight: 3 + weight: 7 + region: content + field_az_enterprise_attributes: + type: entity_reference_label + label: above + settings: + link: true + third_party_settings: { } + weight: 9 region: content field_az_incentives: - type: boolean + type: list_default label: hidden - settings: - format: default - format_custom_false: '' - format_custom_true: '' + settings: { } third_party_settings: { } - weight: 4 + weight: 18 region: content - field_az_modality: + field_az_offered: type: entity_reference_label label: hidden settings: link: false third_party_settings: { } - weight: 5 + weight: 15 region: content - field_az_offered: - type: entity_reference_label + field_az_opportunity_category: + type: entity_reference_entity_view label: hidden settings: + view_mode: az_badge link: false third_party_settings: { } - weight: 15 + weight: 5 region: content field_az_opportunity_location: type: string @@ -474,15 +458,6 @@ content: third_party_settings: { } weight: 4 region: content - field_az_opportunity_type: - type: entity_reference_entity_view - label: hidden - settings: - view_mode: az_badge - link: false - third_party_settings: { } - weight: 3 - region: content field_az_parent_account: type: string label: hidden @@ -500,7 +475,7 @@ content: from_to: both separator: '-' third_party_settings: { } - weight: 5 + weight: 3 region: content field_az_program_length: type: string @@ -522,22 +497,14 @@ content: third_party_settings: { } weight: 8 region: content - field_az_topic: - type: entity_reference_entity_view - label: hidden - settings: - view_mode: az_badge - link: false - third_party_settings: { } - weight: 4 - region: content links: settings: { } third_party_settings: { } - weight: 6 + weight: 8 region: content hidden: field_az_ongoing: true + field_az_opportunity_credit: true field_az_trellis_id: true field_az_trellis_imported_date: true smart_title: true diff --git a/modules/custom/az_opportunity/config/install/core.entity_view_display.taxonomy_term.az_opportunity_audience.default.yml b/modules/custom/az_opportunity/config/install/core.entity_view_display.taxonomy_term.az_opportunity_audience.default.yml index 784d6a84bd..f7bcb871e6 100644 --- a/modules/custom/az_opportunity/config/install/core.entity_view_display.taxonomy_term.az_opportunity_audience.default.yml +++ b/modules/custom/az_opportunity/config/install/core.entity_view_display.taxonomy_term.az_opportunity_audience.default.yml @@ -1,20 +1 @@ -langcode: en -status: true -dependencies: - config: - - taxonomy.vocabulary.az_opportunity_audience - module: - - az_core -id: taxonomy_term.az_opportunity_audience.default -targetEntityType: taxonomy_term -bundle: az_opportunity_audience -mode: default -content: - description: - type: az_text_summary - label: hidden - settings: { } - third_party_settings: { } - weight: 0 - region: content -hidden: { } +{ } \ No newline at end of file diff --git a/modules/custom/az_opportunity/config/install/core.entity_view_display.taxonomy_term.az_opportunity_categories.az_badge.yml b/modules/custom/az_opportunity/config/install/core.entity_view_display.taxonomy_term.az_opportunity_categories.az_badge.yml new file mode 100644 index 0000000000..e5f8f8982f --- /dev/null +++ b/modules/custom/az_opportunity/config/install/core.entity_view_display.taxonomy_term.az_opportunity_categories.az_badge.yml @@ -0,0 +1,45 @@ +langcode: en +status: true +dependencies: + config: + - core.entity_view_mode.taxonomy_term.az_badge + - taxonomy.vocabulary.az_opportunity_categories + module: + - field_group + - smart_title +third_party_settings: + field_group: + group_link: + children: + - smart_title + label: Link + parent_name: '' + region: content + weight: 0 + format_type: link + format_settings: + classes: 'badge text-bg-light badge-link' + show_empty_fields: false + id: '' + label_as_html: false + target: entity + custom_uri: '' + target_attribute: default + smart_title: + enabled: true + settings: + smart_title__link: false + smart_title__tag: div + smart_title__classes: { } +id: taxonomy_term.az_opportunity_categories.az_badge +targetEntityType: taxonomy_term +bundle: az_opportunity_categories +mode: az_badge +content: + smart_title: + settings: { } + third_party_settings: { } + weight: 0 + region: content +hidden: + description: true diff --git a/modules/custom/az_opportunity/config/install/core.entity_view_display.taxonomy_term.az_opportunity_categories.default.yml b/modules/custom/az_opportunity/config/install/core.entity_view_display.taxonomy_term.az_opportunity_categories.default.yml new file mode 100644 index 0000000000..dbff65ca0c --- /dev/null +++ b/modules/custom/az_opportunity/config/install/core.entity_view_display.taxonomy_term.az_opportunity_categories.default.yml @@ -0,0 +1,20 @@ +langcode: en +status: true +dependencies: + config: + - taxonomy.vocabulary.az_opportunity_categories + module: + - text +id: taxonomy_term.az_opportunity_categories.default +targetEntityType: taxonomy_term +bundle: az_opportunity_categories +mode: default +content: + description: + type: text_default + label: hidden + settings: { } + third_party_settings: { } + weight: 0 + region: content +hidden: { } diff --git a/modules/custom/az_opportunity/config/install/core.entity_view_display.taxonomy_term.az_opportunity_modality.default.yml b/modules/custom/az_opportunity/config/install/core.entity_view_display.taxonomy_term.az_opportunity_modality.default.yml index 9e0c0656e8..f7bcb871e6 100644 --- a/modules/custom/az_opportunity/config/install/core.entity_view_display.taxonomy_term.az_opportunity_modality.default.yml +++ b/modules/custom/az_opportunity/config/install/core.entity_view_display.taxonomy_term.az_opportunity_modality.default.yml @@ -1,26 +1 @@ -langcode: en -status: true -dependencies: - config: - - taxonomy.vocabulary.az_opportunity_modality - module: - - smart_title -third_party_settings: - smart_title: - enabled: true - settings: - smart_title__link: false - smart_title__tag: div - smart_title__classes: { } -id: taxonomy_term.az_opportunity_modality.default -targetEntityType: taxonomy_term -bundle: az_opportunity_modality -mode: default -content: - smart_title: - settings: { } - third_party_settings: { } - weight: 0 - region: content -hidden: - description: true +{ } \ No newline at end of file diff --git a/modules/custom/az_opportunity/config/install/core.entity_view_display.taxonomy_term.az_opportunity_topic.az_badge.yml b/modules/custom/az_opportunity/config/install/core.entity_view_display.taxonomy_term.az_opportunity_topic.az_badge.yml index 0030b4acef..f7bcb871e6 100644 --- a/modules/custom/az_opportunity/config/install/core.entity_view_display.taxonomy_term.az_opportunity_topic.az_badge.yml +++ b/modules/custom/az_opportunity/config/install/core.entity_view_display.taxonomy_term.az_opportunity_topic.az_badge.yml @@ -1,45 +1 @@ -langcode: en -status: true -dependencies: - config: - - core.entity_view_mode.taxonomy_term.az_badge - - taxonomy.vocabulary.az_opportunity_topic - module: - - field_group - - smart_title -third_party_settings: - field_group: - group_opportunity_tags: - children: - - smart_title - label: 'Opportunity Tags' - parent_name: '' - region: content - weight: 0 - format_type: link - format_settings: - classes: 'badge text-bg-light badge-link d-inline-block' - show_empty_fields: false - id: '' - label_as_html: false - target: entity - custom_uri: '' - target_attribute: default - smart_title: - enabled: true - settings: - smart_title__link: false - smart_title__tag: div - smart_title__classes: { } -id: taxonomy_term.az_opportunity_topic.az_badge -targetEntityType: taxonomy_term -bundle: az_opportunity_topic -mode: az_badge -content: - smart_title: - settings: { } - third_party_settings: { } - weight: 0 - region: content -hidden: - description: true +{ } \ No newline at end of file diff --git a/modules/custom/az_opportunity/config/install/core.entity_view_display.taxonomy_term.az_opportunity_topic.default.yml b/modules/custom/az_opportunity/config/install/core.entity_view_display.taxonomy_term.az_opportunity_topic.default.yml index 6b585cfa50..f7bcb871e6 100644 --- a/modules/custom/az_opportunity/config/install/core.entity_view_display.taxonomy_term.az_opportunity_topic.default.yml +++ b/modules/custom/az_opportunity/config/install/core.entity_view_display.taxonomy_term.az_opportunity_topic.default.yml @@ -1,27 +1 @@ -langcode: en -status: true -dependencies: - config: - - taxonomy.vocabulary.az_opportunity_topic - module: - - smart_title -third_party_settings: - smart_title: - enabled: true - settings: - smart_title__link: true - smart_title__tag: h2 - smart_title__classes: - - taxonomy-term__title -id: taxonomy_term.az_opportunity_topic.default -targetEntityType: taxonomy_term -bundle: az_opportunity_topic -mode: default -content: - smart_title: - settings: { } - third_party_settings: { } - weight: 0 - region: content -hidden: - description: true +{ } \ No newline at end of file diff --git a/modules/custom/az_opportunity/config/install/core.entity_view_display.taxonomy_term.az_opportunity_type.az_badge.yml b/modules/custom/az_opportunity/config/install/core.entity_view_display.taxonomy_term.az_opportunity_type.az_badge.yml index 0957cf4930..f7bcb871e6 100644 --- a/modules/custom/az_opportunity/config/install/core.entity_view_display.taxonomy_term.az_opportunity_type.az_badge.yml +++ b/modules/custom/az_opportunity/config/install/core.entity_view_display.taxonomy_term.az_opportunity_type.az_badge.yml @@ -1,45 +1 @@ -langcode: en -status: true -dependencies: - config: - - core.entity_view_mode.taxonomy_term.az_badge - - taxonomy.vocabulary.az_opportunity_type - module: - - field_group - - smart_title -third_party_settings: - field_group: - group_opportunity_type_badge: - children: - - smart_title - label: 'Opportunity Type Badge' - parent_name: '' - region: content - weight: 0 - format_type: link - format_settings: - classes: 'badge text-bg-warm-gray badge-link d-inline-block' - show_empty_fields: false - id: '' - label_as_html: false - target: entity - custom_uri: '' - target_attribute: default - smart_title: - enabled: true - settings: - smart_title__link: false - smart_title__tag: div - smart_title__classes: { } -id: taxonomy_term.az_opportunity_type.az_badge -targetEntityType: taxonomy_term -bundle: az_opportunity_type -mode: az_badge -content: - smart_title: - settings: { } - third_party_settings: { } - weight: 0 - region: content -hidden: - description: true +{ } \ No newline at end of file diff --git a/modules/custom/az_opportunity/config/install/core.entity_view_display.taxonomy_term.az_opportunity_type.default.yml b/modules/custom/az_opportunity/config/install/core.entity_view_display.taxonomy_term.az_opportunity_type.default.yml index e12c4d8558..f7bcb871e6 100644 --- a/modules/custom/az_opportunity/config/install/core.entity_view_display.taxonomy_term.az_opportunity_type.default.yml +++ b/modules/custom/az_opportunity/config/install/core.entity_view_display.taxonomy_term.az_opportunity_type.default.yml @@ -1,21 +1 @@ -langcode: en -status: true -dependencies: - config: - - taxonomy.vocabulary.az_opportunity_type - module: - - text -id: taxonomy_term.az_opportunity_type.default -targetEntityType: taxonomy_term -bundle: az_opportunity_type -mode: default -content: - description: - type: text_default - label: hidden - settings: { } - third_party_settings: { } - weight: 0 - region: content -hidden: - smart_title: true +{ } \ No newline at end of file diff --git a/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_audiences.yml b/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_audiences.yml index 7a2a5fb77f..f7bcb871e6 100644 --- a/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_audiences.yml +++ b/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_audiences.yml @@ -1,28 +1 @@ -langcode: en -status: true -dependencies: - config: - - field.storage.node.field_az_audiences - - node.type.az_opportunity - - taxonomy.vocabulary.az_opportunity_audience -id: node.az_opportunity.field_az_audiences -field_name: field_az_audiences -entity_type: node -bundle: az_opportunity -label: Audiences -description: '' -required: false -translatable: false -default_value: { } -default_value_callback: '' -settings: - handler: 'default:taxonomy_term' - handler_settings: - target_bundles: - az_opportunity_audience: az_opportunity_audience - sort: - field: name - direction: asc - auto_create: true - auto_create_bundle: '' -field_type: entity_reference +{ } \ No newline at end of file diff --git a/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_credit.yml b/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_credit.yml index de6c3577ed..f7bcb871e6 100644 --- a/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_credit.yml +++ b/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_credit.yml @@ -1,18 +1 @@ -langcode: en -status: true -dependencies: - config: - - field.storage.node.field_az_credit - - node.type.az_opportunity -id: node.az_opportunity.field_az_credit -field_name: field_az_credit -entity_type: node -bundle: az_opportunity -label: Credit -description: 'Whether this opportunity earns university credit.' -required: false -translatable: false -default_value: { } -default_value_callback: '' -settings: { } -field_type: string +{ } \ No newline at end of file diff --git a/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_enterprise_attributes.yml b/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_enterprise_attributes.yml new file mode 100644 index 0000000000..d055642067 --- /dev/null +++ b/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_enterprise_attributes.yml @@ -0,0 +1,28 @@ +langcode: en +status: true +dependencies: + config: + - field.storage.node.field_az_enterprise_attributes + - node.type.az_opportunity + - taxonomy.vocabulary.az_enterprise_attributes +id: node.az_opportunity.field_az_enterprise_attributes +field_name: field_az_enterprise_attributes +entity_type: node +bundle: az_opportunity +label: 'Enterprise Attributes' +description: '' +required: false +translatable: false +default_value: { } +default_value_callback: '' +settings: + handler: 'default:taxonomy_term' + handler_settings: + target_bundles: + az_enterprise_attributes: az_enterprise_attributes + sort: + field: name + direction: asc + auto_create: false + auto_create_bundle: '' +field_type: entity_reference diff --git a/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_incentives.yml b/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_incentives.yml index 0c17dc6b62..abe4e12489 100644 --- a/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_incentives.yml +++ b/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_incentives.yml @@ -4,17 +4,17 @@ dependencies: config: - field.storage.node.field_az_incentives - node.type.az_opportunity + module: + - options id: node.az_opportunity.field_az_incentives field_name: field_az_incentives entity_type: node bundle: az_opportunity label: Incentives -description: 'Indicates if this opportunity is paid or has other incentives.' +description: '' required: false translatable: false default_value: { } default_value_callback: '' -settings: - on_label: 'Has incentives' - off_label: 'No incentives' -field_type: boolean +settings: { } +field_type: list_string diff --git a/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_modality.yml b/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_modality.yml index d17389b583..f7bcb871e6 100644 --- a/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_modality.yml +++ b/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_modality.yml @@ -1,28 +1 @@ -langcode: en -status: true -dependencies: - config: - - field.storage.node.field_az_modality - - node.type.az_opportunity - - taxonomy.vocabulary.az_opportunity_modality -id: node.az_opportunity.field_az_modality -field_name: field_az_modality -entity_type: node -bundle: az_opportunity -label: Modality -description: 'How this opportunity is attended.' -required: false -translatable: false -default_value: { } -default_value_callback: '' -settings: - handler: 'default:taxonomy_term' - handler_settings: - target_bundles: - az_opportunity_modality: az_opportunity_modality - sort: - field: name - direction: asc - auto_create: true - auto_create_bundle: '' -field_type: entity_reference +{ } \ No newline at end of file diff --git a/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_opportunity_category.yml b/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_opportunity_category.yml new file mode 100644 index 0000000000..579546fa76 --- /dev/null +++ b/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_opportunity_category.yml @@ -0,0 +1,28 @@ +langcode: en +status: true +dependencies: + config: + - field.storage.node.field_az_opportunity_category + - node.type.az_opportunity + - taxonomy.vocabulary.az_opportunity_categories +id: node.az_opportunity.field_az_opportunity_category +field_name: field_az_opportunity_category +entity_type: node +bundle: az_opportunity +label: Category +description: '' +required: false +translatable: false +default_value: { } +default_value_callback: '' +settings: + handler: 'default:taxonomy_term' + handler_settings: + target_bundles: + az_opportunity_categories: az_opportunity_categories + sort: + field: name + direction: asc + auto_create: true + auto_create_bundle: '' +field_type: entity_reference diff --git a/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_opportunity_credit.yml b/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_opportunity_credit.yml new file mode 100644 index 0000000000..8a7b22aaa8 --- /dev/null +++ b/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_opportunity_credit.yml @@ -0,0 +1,20 @@ +langcode: en +status: true +dependencies: + config: + - field.storage.node.field_az_opportunity_credit + - node.type.az_opportunity + module: + - options +id: node.az_opportunity.field_az_opportunity_credit +field_name: field_az_opportunity_credit +entity_type: node +bundle: az_opportunity +label: Credit +description: '' +required: false +translatable: false +default_value: { } +default_value_callback: '' +settings: { } +field_type: list_string diff --git a/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_opportunity_type.yml b/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_opportunity_type.yml index 9b4fb62f65..f7bcb871e6 100644 --- a/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_opportunity_type.yml +++ b/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_opportunity_type.yml @@ -1,28 +1 @@ -langcode: en -status: true -dependencies: - config: - - field.storage.node.field_az_opportunity_type - - node.type.az_opportunity - - taxonomy.vocabulary.az_opportunity_type -id: node.az_opportunity.field_az_opportunity_type -field_name: field_az_opportunity_type -entity_type: node -bundle: az_opportunity -label: 'Opportunity Type' -description: '' -required: false -translatable: false -default_value: { } -default_value_callback: '' -settings: - handler: 'default:taxonomy_term' - handler_settings: - target_bundles: - az_opportunity_type: az_opportunity_type - sort: - field: name - direction: asc - auto_create: true - auto_create_bundle: '' -field_type: entity_reference +{ } \ No newline at end of file diff --git a/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_parent_account.yml b/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_parent_account.yml index df222c0db8..fbc693d390 100644 --- a/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_parent_account.yml +++ b/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_parent_account.yml @@ -8,7 +8,7 @@ id: node.az_opportunity.field_az_parent_account field_name: field_az_parent_account entity_type: node bundle: az_opportunity -label: 'Parent Account' +label: 'Trellis Parent Account' description: 'Trellis specific field that checks for Parent Accounts, or the parent program content.' required: false translatable: false diff --git a/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_topic.yml b/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_topic.yml index 055def15e9..f7bcb871e6 100644 --- a/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_topic.yml +++ b/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_topic.yml @@ -1,28 +1 @@ -langcode: en -status: true -dependencies: - config: - - field.storage.node.field_az_topic - - node.type.az_opportunity - - taxonomy.vocabulary.az_opportunity_topic -id: node.az_opportunity.field_az_topic -field_name: field_az_topic -entity_type: node -bundle: az_opportunity -label: Topic -description: '' -required: false -translatable: false -default_value: { } -default_value_callback: '' -settings: - handler: 'default:taxonomy_term' - handler_settings: - target_bundles: - az_opportunity_topic: az_opportunity_topic - sort: - field: name - direction: asc - auto_create: true - auto_create_bundle: '' -field_type: entity_reference +{ } \ No newline at end of file diff --git a/modules/custom/az_opportunity/config/install/field.storage.node.field_az_audiences.yml b/modules/custom/az_opportunity/config/install/field.storage.node.field_az_audiences.yml index 2e64f0704f..f7bcb871e6 100644 --- a/modules/custom/az_opportunity/config/install/field.storage.node.field_az_audiences.yml +++ b/modules/custom/az_opportunity/config/install/field.storage.node.field_az_audiences.yml @@ -1,19 +1 @@ -langcode: en -status: true -dependencies: - module: - - node - - taxonomy -id: node.field_az_audiences -field_name: field_az_audiences -entity_type: node -type: entity_reference -settings: - target_type: taxonomy_term -module: core -locked: false -cardinality: -1 -translatable: true -indexes: { } -persist_with_no_fields: false -custom_storage: false +{ } \ No newline at end of file diff --git a/modules/custom/az_opportunity/config/install/field.storage.node.field_az_credit.yml b/modules/custom/az_opportunity/config/install/field.storage.node.field_az_credit.yml index 2c11b0e58d..f7bcb871e6 100644 --- a/modules/custom/az_opportunity/config/install/field.storage.node.field_az_credit.yml +++ b/modules/custom/az_opportunity/config/install/field.storage.node.field_az_credit.yml @@ -1,20 +1 @@ -langcode: en -status: true -dependencies: - module: - - node -id: node.field_az_credit -field_name: field_az_credit -entity_type: node -type: string -settings: - max_length: 255 - case_sensitive: false - is_ascii: false -module: core -locked: false -cardinality: 1 -translatable: true -indexes: { } -persist_with_no_fields: false -custom_storage: false +{ } \ No newline at end of file diff --git a/modules/custom/az_opportunity/config/install/field.storage.node.field_az_incentives.yml b/modules/custom/az_opportunity/config/install/field.storage.node.field_az_incentives.yml index 1cb25341b6..29cd108387 100644 --- a/modules/custom/az_opportunity/config/install/field.storage.node.field_az_incentives.yml +++ b/modules/custom/az_opportunity/config/install/field.storage.node.field_az_incentives.yml @@ -3,12 +3,18 @@ status: true dependencies: module: - node + - options id: node.field_az_incentives field_name: field_az_incentives entity_type: node -type: boolean -settings: { } -module: core +type: list_string +settings: + allowed_values: + - + value: 'yes' + label: 'Yes' + allowed_values_function: '' +module: options locked: false cardinality: 1 translatable: true diff --git a/modules/custom/az_opportunity/config/install/field.storage.node.field_az_modality.yml b/modules/custom/az_opportunity/config/install/field.storage.node.field_az_modality.yml index f44b383e75..f7bcb871e6 100644 --- a/modules/custom/az_opportunity/config/install/field.storage.node.field_az_modality.yml +++ b/modules/custom/az_opportunity/config/install/field.storage.node.field_az_modality.yml @@ -1,19 +1 @@ -langcode: en -status: true -dependencies: - module: - - node - - taxonomy -id: node.field_az_modality -field_name: field_az_modality -entity_type: node -type: entity_reference -settings: - target_type: taxonomy_term -module: core -locked: false -cardinality: 1 -translatable: true -indexes: { } -persist_with_no_fields: false -custom_storage: false +{ } \ No newline at end of file diff --git a/modules/custom/az_opportunity/config/install/field.storage.node.field_az_opportunity_category.yml b/modules/custom/az_opportunity/config/install/field.storage.node.field_az_opportunity_category.yml new file mode 100644 index 0000000000..53976583a0 --- /dev/null +++ b/modules/custom/az_opportunity/config/install/field.storage.node.field_az_opportunity_category.yml @@ -0,0 +1,19 @@ +langcode: en +status: true +dependencies: + module: + - node + - taxonomy +id: node.field_az_opportunity_category +field_name: field_az_opportunity_category +entity_type: node +type: entity_reference +settings: + target_type: taxonomy_term +module: core +locked: false +cardinality: -1 +translatable: true +indexes: { } +persist_with_no_fields: false +custom_storage: false diff --git a/modules/custom/az_opportunity/config/install/field.storage.node.field_az_opportunity_credit.yml b/modules/custom/az_opportunity/config/install/field.storage.node.field_az_opportunity_credit.yml new file mode 100644 index 0000000000..bcbcff3c7f --- /dev/null +++ b/modules/custom/az_opportunity/config/install/field.storage.node.field_az_opportunity_credit.yml @@ -0,0 +1,29 @@ +langcode: en +status: true +dependencies: + module: + - node + - options +id: node.field_az_opportunity_credit +field_name: field_az_opportunity_credit +entity_type: node +type: list_string +settings: + allowed_values: + - + value: non_credit + label: Non-Credit + - + value: ua_credit + label: 'UA Credit' + - + value: transfer_credit + label: 'Transfer Credit' + allowed_values_function: '' +module: options +locked: false +cardinality: 1 +translatable: true +indexes: { } +persist_with_no_fields: false +custom_storage: false diff --git a/modules/custom/az_opportunity/config/install/field.storage.node.field_az_opportunity_type.yml b/modules/custom/az_opportunity/config/install/field.storage.node.field_az_opportunity_type.yml index 0718b23d17..f7bcb871e6 100644 --- a/modules/custom/az_opportunity/config/install/field.storage.node.field_az_opportunity_type.yml +++ b/modules/custom/az_opportunity/config/install/field.storage.node.field_az_opportunity_type.yml @@ -1,19 +1 @@ -langcode: en -status: true -dependencies: - module: - - node - - taxonomy -id: node.field_az_opportunity_type -field_name: field_az_opportunity_type -entity_type: node -type: entity_reference -settings: - target_type: taxonomy_term -module: core -locked: false -cardinality: -1 -translatable: true -indexes: { } -persist_with_no_fields: false -custom_storage: false +{ } \ No newline at end of file diff --git a/modules/custom/az_opportunity/config/install/field.storage.node.field_az_topic.yml b/modules/custom/az_opportunity/config/install/field.storage.node.field_az_topic.yml index 7503690d35..f7bcb871e6 100644 --- a/modules/custom/az_opportunity/config/install/field.storage.node.field_az_topic.yml +++ b/modules/custom/az_opportunity/config/install/field.storage.node.field_az_topic.yml @@ -1,19 +1 @@ -langcode: en -status: true -dependencies: - module: - - node - - taxonomy -id: node.field_az_topic -field_name: field_az_topic -entity_type: node -type: entity_reference -settings: - target_type: taxonomy_term -module: core -locked: false -cardinality: -1 -translatable: true -indexes: { } -persist_with_no_fields: false -custom_storage: false +{ } \ No newline at end of file diff --git a/modules/custom/az_opportunity/config/install/taxonomy.vocabulary.az_opportunity_audience.yml b/modules/custom/az_opportunity/config/install/taxonomy.vocabulary.az_opportunity_audience.yml index d93aff8a1f..f7bcb871e6 100644 --- a/modules/custom/az_opportunity/config/install/taxonomy.vocabulary.az_opportunity_audience.yml +++ b/modules/custom/az_opportunity/config/install/taxonomy.vocabulary.az_opportunity_audience.yml @@ -1,8 +1 @@ -langcode: en -status: true -dependencies: { } -name: 'Opportunity Audience' -vid: az_opportunity_audience -description: 'Taxonomy for the Opportunity content type' -weight: 0 -new_revision: false +{ } \ No newline at end of file diff --git a/modules/custom/az_opportunity/config/install/taxonomy.vocabulary.az_opportunity_categories.yml b/modules/custom/az_opportunity/config/install/taxonomy.vocabulary.az_opportunity_categories.yml new file mode 100644 index 0000000000..1d181386fc --- /dev/null +++ b/modules/custom/az_opportunity/config/install/taxonomy.vocabulary.az_opportunity_categories.yml @@ -0,0 +1,8 @@ +langcode: en +status: true +dependencies: { } +name: 'Opportunity Categories' +vid: az_opportunity_categories +description: null +weight: 0 +new_revision: false diff --git a/modules/custom/az_opportunity/config/install/taxonomy.vocabulary.az_opportunity_modality.yml b/modules/custom/az_opportunity/config/install/taxonomy.vocabulary.az_opportunity_modality.yml index f21972ca48..f7bcb871e6 100644 --- a/modules/custom/az_opportunity/config/install/taxonomy.vocabulary.az_opportunity_modality.yml +++ b/modules/custom/az_opportunity/config/install/taxonomy.vocabulary.az_opportunity_modality.yml @@ -1,8 +1 @@ -langcode: en -status: true -dependencies: { } -name: 'Opportunity Modality' -vid: az_opportunity_modality -description: 'Taxonomy for the Opportunity content type' -weight: 0 -new_revision: false +{ } \ No newline at end of file diff --git a/modules/custom/az_opportunity/config/install/taxonomy.vocabulary.az_opportunity_topic.yml b/modules/custom/az_opportunity/config/install/taxonomy.vocabulary.az_opportunity_topic.yml index 894d532413..f7bcb871e6 100644 --- a/modules/custom/az_opportunity/config/install/taxonomy.vocabulary.az_opportunity_topic.yml +++ b/modules/custom/az_opportunity/config/install/taxonomy.vocabulary.az_opportunity_topic.yml @@ -1,8 +1 @@ -langcode: en -status: true -dependencies: { } -name: 'Opportunity Topic' -vid: az_opportunity_topic -description: 'Taxonomy for the Opportunity content type' -weight: 0 -new_revision: false +{ } \ No newline at end of file diff --git a/modules/custom/az_opportunity/config/install/taxonomy.vocabulary.az_opportunity_type.yml b/modules/custom/az_opportunity/config/install/taxonomy.vocabulary.az_opportunity_type.yml index 73ef2feed4..f7bcb871e6 100644 --- a/modules/custom/az_opportunity/config/install/taxonomy.vocabulary.az_opportunity_type.yml +++ b/modules/custom/az_opportunity/config/install/taxonomy.vocabulary.az_opportunity_type.yml @@ -1,8 +1 @@ -langcode: en -status: true -dependencies: { } -name: 'Opportunity Type' -vid: az_opportunity_type -description: 'Taxonomy for the Opportunity content type' -weight: 0 -new_revision: false +{ } \ No newline at end of file diff --git a/modules/custom/az_opportunity/config/install/views.view.az_opportunity.yml b/modules/custom/az_opportunity/config/install/views.view.az_opportunity.yml index 50fa4b2dd9..9f662329f6 100644 --- a/modules/custom/az_opportunity/config/install/views.view.az_opportunity.yml +++ b/modules/custom/az_opportunity/config/install/views.view.az_opportunity.yml @@ -2,25 +2,14 @@ langcode: en status: true dependencies: config: - - core.entity_view_mode.node.az_card - - core.entity_view_mode.node.az_row - - core.entity_view_mode.node.az_small_row - node.type.az_opportunity - - taxonomy.vocabulary.az_opportunity_modality - - taxonomy.vocabulary.az_opportunity_semester - - taxonomy.vocabulary.az_opportunity_topic - - taxonomy.vocabulary.az_opportunity_type module: - - better_exposed_filters - - datetime - node - - taxonomy - user - - views_bootstrap id: az_opportunity label: 'AZ Opportunity' module: views -description: 'Use this view to display Opportunities content type' +description: '' tag: '' base_table: node_field_data base_field: nid @@ -117,75 +106,23 @@ display: options: { } empty: { } sorts: - field_az_application_date_value: - id: field_az_application_date_value - table: node__field_az_application_date - field: field_az_application_date_value - relationship: none - group_type: group - admin_label: '' - plugin_id: datetime - order: ASC - expose: - label: '' - field_identifier: '' - exposed: false - granularity: second - title: - id: title + created: + id: created table: node_field_data - field: title + field: created relationship: none group_type: group admin_label: '' entity_type: node - entity_field: title - plugin_id: standard - order: ASC + entity_field: created + plugin_id: date + order: DESC expose: label: '' field_identifier: '' exposed: false - arguments: - field_az_opportunity_type_target_id: - id: field_az_opportunity_type_target_id - table: node__field_az_opportunity_type - field: field_az_opportunity_type_target_id - relationship: none - group_type: group - admin_label: '' - plugin_id: entity_target_id - default_action: ignore - exception: - value: all - title_enable: false - title: All - title_enable: false - title: '' - default_argument_type: fixed - default_argument_options: - argument: '' - summary_options: - base_path: '' - count: true - override: false - items_per_page: 25 - summary: - sort_order: asc - number_of_records: 0 - format: default_summary - specify_validation: true - validate: - type: 'entity:taxonomy_term' - fail: 'not found' - validate_options: - bundles: - az_opportunity_type: az_opportunity_type - access: false - operation: view - multiple: 1 - break_phrase: false - not: false + granularity: second + arguments: { } filters: status: id: status @@ -208,23 +145,19 @@ display: value: az_opportunity: az_opportunity style: - type: views_bootstrap_grid + type: default options: + grouping: { } row_class: '' default_row_class: true uses_fields: false - grid_class: '' - col_xs: col-1 - col_sm: col-sm-1 - col_md: col-md-4 - col_lg: col-lg-4 - col_xl: col-xl-4 - col_xxl: col-xxl-4 row: - type: 'entity:node' + type: fields options: - relationship: none - view_mode: az_card + default_field_elements: true + inline: { } + separator: '' + hide_empty: false query: type: views_query options: @@ -242,1470 +175,22 @@ display: contexts: - 'languages:language_content' - 'languages:language_interface' - - url - url.query_args - 'user.node_grants:view' - user.permissions tags: { } block_1: id: block_1 - display_title: 'Small Row View' - display_plugin: block - position: 1 - display_options: - sorts: - title: - id: title - table: node_field_data - field: title - relationship: none - group_type: group - admin_label: '' - entity_type: node - entity_field: title - plugin_id: standard - order: ASC - expose: - label: '' - field_identifier: '' - exposed: false - filters: - status: - id: status - table: node_field_data - field: status - entity_type: node - entity_field: status - plugin_id: boolean - value: '1' - group: 1 - expose: - operator: '' - type: - id: type - table: node_field_data - field: type - entity_type: node - entity_field: type - plugin_id: bundle - value: - az_opportunity: az_opportunity - group: 1 - field_az_ongoing_value: - id: field_az_ongoing_value - table: node__field_az_ongoing - field: field_az_ongoing_value - relationship: none - group_type: group - admin_label: '' - plugin_id: boolean - operator: '=' - value: '1' - group: 2 - exposed: false - expose: - operator_id: '' - label: '' - description: '' - use_operator: false - operator: '' - operator_limit_selection: false - operator_list: { } - identifier: '' - required: false - remember: false - multiple: false - remember_roles: - authenticated: authenticated - is_grouped: false - group_info: - label: '' - description: '' - identifier: '' - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: { } - field_az_application_date_end_value: - id: field_az_application_date_end_value - table: node__field_az_application_date - field: field_az_application_date_end_value - relationship: none - group_type: group - admin_label: '' - plugin_id: datetime - operator: '>=' - value: - min: '' - max: '' - value: now - type: offset - group: 2 - exposed: false - expose: - operator_id: '' - label: '' - description: '' - use_operator: false - operator: '' - operator_limit_selection: false - operator_list: { } - identifier: '' - required: false - remember: false - multiple: false - remember_roles: - authenticated: authenticated - min_placeholder: '' - max_placeholder: '' - placeholder: '' - is_grouped: false - group_info: - label: '' - description: '' - identifier: '' - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: { } - granularity: day - filter_groups: - operator: AND - groups: - 1: AND - 2: OR - style: - type: default - options: - row_class: '' - default_row_class: true - uses_fields: false - row: - type: 'entity:node' - options: - relationship: none - view_mode: az_small_row - defaults: - style: false - style_options: false - row: false - sorts: false - filters: false - filter_groups: false - display_description: '' - style_options: null - display_extenders: { } - cache_metadata: - max-age: -1 - contexts: - - 'languages:language_content' - - 'languages:language_interface' - - url - - url.query_args - - 'user.node_grants:view' - - user.permissions - tags: { } - block_2: - id: block_2 - display_title: 'Card View with Filter' - display_plugin: block - position: 1 - display_options: - exposed_form: - type: bef - options: - submit_button: Apply - reset_button: false - reset_button_label: Reset - exposed_sorts_label: 'Sort by' - expose_sort_order: true - sort_asc_label: Asc - sort_desc_label: Desc - text_input_required: 'Select any filter and click on Apply to see results' - text_input_required_format: az_standard - bef: - general: - autosubmit: false - auto_submit_sort_only: false - autosubmit_breakpoint: '' - autosubmit_exclude_textfield: false - autosubmit_textfield_delay: 500 - autosubmit_textfield_minimum_length: 3 - autosubmit_hide: false - input_required: false - allow_secondary: false - secondary_label: 'Advanced options' - secondary_open: false - reset_button_always_show: false - filter: - title: - plugin_id: default - advanced: - placeholder_text: '' - collapsible: false - collapsible_disable_automatic_open: false - open_by_default: false - is_secondary: false - hide_label: false - field_classes: '' - sort_options_unsupported: '' - field_az_location_options: - plugin_id: default - advanced: - placeholder_text: '' - collapsible: false - collapsible_disable_automatic_open: false - open_by_default: false - is_secondary: false - hide_label: false - field_classes: '' - sort_options_unsupported: '' - field_az_topic_target_id: - plugin_id: default - advanced: - sort_options: false - sort_options_method: alphabetical_asc - sort_options_natural: true - rewrite: - filter_rewrite_values: '' - filter_rewrite_values_key: false - collapsible: false - collapsible_disable_automatic_open: false - open_by_default: false - is_secondary: false - hide_label: false - field_classes: '' - field_az_modality_target_id: - plugin_id: default - advanced: - sort_options: false - sort_options_method: alphabetical_asc - sort_options_natural: true - rewrite: - filter_rewrite_values: '' - filter_rewrite_values_key: false - collapsible: false - collapsible_disable_automatic_open: false - open_by_default: false - is_secondary: false - hide_label: false - field_classes: '' - field_az_offered_target_id: - plugin_id: default - advanced: - sort_options: false - sort_options_method: alphabetical_asc - sort_options_natural: true - rewrite: - filter_rewrite_values: '' - filter_rewrite_values_key: false - collapsible: false - collapsible_disable_automatic_open: false - open_by_default: false - is_secondary: false - hide_label: false - field_classes: '' - field_az_incentives_value: - plugin_id: default - advanced: - sort_options: false - sort_options_method: alphabetical_asc - sort_options_natural: true - rewrite: - filter_rewrite_values: '' - filter_rewrite_values_key: false - collapsible: false - collapsible_disable_automatic_open: false - open_by_default: false - is_secondary: false - hide_label: false - field_classes: '' - filters: - status: - id: status - table: node_field_data - field: status - entity_type: node - entity_field: status - plugin_id: boolean - value: '1' - group: 1 - expose: - operator: '' - type: - id: type - table: node_field_data - field: type - entity_type: node - entity_field: type - plugin_id: bundle - value: - az_opportunity: az_opportunity - group: 1 - title: - id: title - table: node_field_data - field: title - relationship: none - group_type: group - admin_label: '' - entity_type: node - entity_field: title - plugin_id: string - operator: contains - value: '' - group: 1 - exposed: true - expose: - operator_id: title_op - label: Title - description: '' - use_operator: false - operator: title_op - operator_limit_selection: false - operator_list: { } - identifier: title - required: false - remember: false - multiple: false - remember_roles: - authenticated: authenticated - placeholder: '' - is_grouped: false - group_info: - label: '' - description: '' - identifier: '' - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: { } - field_az_location_options: - id: field_az_location_options - table: node__field_az_location - field: field_az_location_options - relationship: none - group_type: group - admin_label: '' - plugin_id: string - operator: contains - value: '' - group: 1 - exposed: true - expose: - operator_id: field_az_location_options_op - label: Where - description: '' - use_operator: false - operator: field_az_location_options_op - operator_limit_selection: false - operator_list: { } - identifier: field_az_location_options - required: false - remember: false - multiple: false - remember_roles: - authenticated: authenticated - placeholder: '' - is_grouped: false - group_info: - label: '' - description: '' - identifier: '' - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: { } - field_az_topic_target_id: - id: field_az_topic_target_id - table: node__field_az_topic - field: field_az_topic_target_id - relationship: none - group_type: group - admin_label: '' - plugin_id: taxonomy_index_tid - operator: or - value: { } - group: 1 - exposed: true - expose: - operator_id: field_az_topic_target_id_op - label: Topic - description: '' - use_operator: false - operator: field_az_topic_target_id_op - operator_limit_selection: false - operator_list: { } - identifier: field_az_topic_target_id - required: false - remember: false - multiple: false - remember_roles: - authenticated: authenticated - reduce: false - is_grouped: false - group_info: - label: '' - description: '' - identifier: '' - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: { } - reduce_duplicates: false - vid: az_opportunity_topic - type: select - hierarchy: false - limit: true - error_message: true - field_az_modality_target_id: - id: field_az_modality_target_id - table: node__field_az_modality - field: field_az_modality_target_id - relationship: none - group_type: group - admin_label: '' - plugin_id: taxonomy_index_tid - operator: or - value: { } - group: 1 - exposed: true - expose: - operator_id: field_az_modality_target_id_op - label: Modality - description: '' - use_operator: false - operator: field_az_modality_target_id_op - operator_limit_selection: false - operator_list: { } - identifier: field_az_modality_target_id - required: false - remember: false - multiple: false - remember_roles: - authenticated: authenticated - reduce: false - is_grouped: false - group_info: - label: '' - description: '' - identifier: '' - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: { } - reduce_duplicates: false - vid: az_opportunity_modality - type: select - hierarchy: false - limit: true - error_message: true - field_az_offered_target_id: - id: field_az_offered_target_id - table: node__field_az_offered - field: field_az_offered_target_id - relationship: none - group_type: group - admin_label: '' - plugin_id: taxonomy_index_tid - operator: or - value: { } - group: 1 - exposed: true - expose: - operator_id: field_az_offered_target_id_op - label: Offered - description: '' - use_operator: false - operator: field_az_offered_target_id_op - operator_limit_selection: false - operator_list: { } - identifier: field_az_offered_target_id - required: false - remember: false - multiple: false - remember_roles: - authenticated: authenticated - reduce: false - is_grouped: false - group_info: - label: '' - description: '' - identifier: '' - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: { } - reduce_duplicates: false - vid: az_opportunity_semester - type: select - hierarchy: false - limit: true - error_message: true - field_az_incentives_value: - id: field_az_incentives_value - table: node__field_az_incentives - field: field_az_incentives_value - relationship: none - group_type: group - admin_label: '' - plugin_id: boolean - operator: '=' - value: All - group: 1 - exposed: true - expose: - operator_id: '' - label: Incentives - description: '' - use_operator: false - operator: field_az_incentives_value_op - operator_limit_selection: false - operator_list: { } - identifier: field_az_incentives_value - required: false - remember: false - multiple: false - remember_roles: - authenticated: authenticated - is_grouped: false - group_info: - label: '' - description: '' - identifier: '' - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: { } - field_az_ongoing_value: - id: field_az_ongoing_value - table: node__field_az_ongoing - field: field_az_ongoing_value - relationship: none - group_type: group - admin_label: '' - plugin_id: boolean - operator: '=' - value: '1' - group: 2 - exposed: false - expose: - operator_id: '' - label: '' - description: '' - use_operator: false - operator: '' - operator_limit_selection: false - operator_list: { } - identifier: '' - required: false - remember: false - multiple: false - remember_roles: - authenticated: authenticated - is_grouped: false - group_info: - label: '' - description: '' - identifier: '' - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: { } - field_az_application_date_end_value: - id: field_az_application_date_end_value - table: node__field_az_application_date - field: field_az_application_date_end_value - relationship: none - group_type: group - admin_label: '' - plugin_id: datetime - operator: '>=' - value: - min: '' - max: '' - value: now - type: offset - group: 2 - exposed: false - expose: - operator_id: '' - label: '' - description: '' - use_operator: false - operator: '' - operator_limit_selection: false - operator_list: { } - identifier: '' - required: false - remember: false - multiple: false - remember_roles: - authenticated: authenticated - min_placeholder: '' - max_placeholder: '' - placeholder: '' - is_grouped: false - group_info: - label: '' - description: '' - identifier: '' - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: { } - granularity: day - filter_groups: - operator: AND - groups: - 1: AND - 2: OR - style: - type: default - options: - row_class: '' - default_row_class: true - uses_fields: false - row: - type: 'entity:node' - options: - relationship: none - view_mode: az_card - defaults: - exposed_form: false - style: false - style_options: false - row: false - filters: false - filter_groups: false - display_description: '' - style_options: null - display_extenders: { } - cache_metadata: - max-age: -1 - contexts: - - 'languages:language_content' - - 'languages:language_interface' - - url - - url.query_args - - 'user.node_grants:view' - - user.permissions - tags: { } - block_3: - id: block_3 - display_title: 'Card View' - display_plugin: block - position: 1 - display_options: - filters: - status: - id: status - table: node_field_data - field: status - entity_type: node - entity_field: status - plugin_id: boolean - value: '1' - group: 1 - expose: - operator: '' - type: - id: type - table: node_field_data - field: type - entity_type: node - entity_field: type - plugin_id: bundle - value: - az_opportunity: az_opportunity - group: 1 - field_az_ongoing_value: - id: field_az_ongoing_value - table: node__field_az_ongoing - field: field_az_ongoing_value - relationship: none - group_type: group - admin_label: '' - plugin_id: boolean - operator: '=' - value: '1' - group: 2 - exposed: false - expose: - operator_id: '' - label: '' - description: '' - use_operator: false - operator: '' - operator_limit_selection: false - operator_list: { } - identifier: '' - required: false - remember: false - multiple: false - remember_roles: - authenticated: authenticated - is_grouped: false - group_info: - label: '' - description: '' - identifier: '' - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: { } - field_az_application_date_end_value: - id: field_az_application_date_end_value - table: node__field_az_application_date - field: field_az_application_date_end_value - relationship: none - group_type: group - admin_label: '' - plugin_id: datetime - operator: '>=' - value: - min: '' - max: '' - value: now - type: offset - group: 2 - exposed: false - expose: - operator_id: '' - label: '' - description: '' - use_operator: false - operator: '' - operator_limit_selection: false - operator_list: { } - identifier: '' - required: false - remember: false - multiple: false - remember_roles: - authenticated: authenticated - min_placeholder: '' - max_placeholder: '' - placeholder: '' - is_grouped: false - group_info: - label: '' - description: '' - identifier: '' - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: { } - granularity: day - filter_groups: - operator: AND - groups: - 1: AND - 2: OR - defaults: - filters: false - filter_groups: false - display_description: '' - display_extenders: { } - cache_metadata: - max-age: -1 - contexts: - - 'languages:language_content' - - 'languages:language_interface' - - url - - url.query_args - - 'user.node_grants:view' - - user.permissions - tags: { } - block_4: - id: block_4 - display_title: 'Row View' + display_title: Block display_plugin: block position: 1 display_options: - filters: - status: - id: status - table: node_field_data - field: status - entity_type: node - entity_field: status - plugin_id: boolean - value: '1' - group: 1 - expose: - operator: '' - type: - id: type - table: node_field_data - field: type - entity_type: node - entity_field: type - plugin_id: bundle - value: - az_opportunity: az_opportunity - group: 1 - field_az_ongoing_value: - id: field_az_ongoing_value - table: node__field_az_ongoing - field: field_az_ongoing_value - relationship: none - group_type: group - admin_label: '' - plugin_id: boolean - operator: '=' - value: '1' - group: 2 - exposed: false - expose: - operator_id: '' - label: '' - description: '' - use_operator: false - operator: '' - operator_limit_selection: false - operator_list: { } - identifier: '' - required: false - remember: false - multiple: false - remember_roles: - authenticated: authenticated - is_grouped: false - group_info: - label: '' - description: '' - identifier: '' - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: { } - field_az_application_date_end_value: - id: field_az_application_date_end_value - table: node__field_az_application_date - field: field_az_application_date_end_value - relationship: none - group_type: group - admin_label: '' - plugin_id: datetime - operator: '>=' - value: - min: '' - max: '' - value: now - type: offset - group: 2 - exposed: false - expose: - operator_id: '' - label: '' - description: '' - use_operator: false - operator: '' - operator_limit_selection: false - operator_list: { } - identifier: '' - required: false - remember: false - multiple: false - remember_roles: - authenticated: authenticated - min_placeholder: '' - max_placeholder: '' - placeholder: '' - is_grouped: false - group_info: - label: '' - description: '' - identifier: '' - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: { } - granularity: day - filter_groups: - operator: AND - groups: - 1: AND - 2: OR - style: - type: default - options: - row_class: '' - default_row_class: true - uses_fields: false - row: - type: 'entity:node' - options: - relationship: none - view_mode: az_row - defaults: - style: false - style_options: false - row: false - filters: false - filter_groups: false - display_description: '' - style_options: null - display_extenders: { } - cache_metadata: - max-age: -1 - contexts: - - 'languages:language_content' - - 'languages:language_interface' - - url - - url.query_args - - 'user.node_grants:view' - - user.permissions - tags: { } - block_5: - id: block_5 - display_title: 'Row View with Filter' - display_plugin: block - position: 1 - display_options: - exposed_form: - type: bef - options: - submit_button: Apply - reset_button: false - reset_button_label: Reset - exposed_sorts_label: 'Sort by' - expose_sort_order: true - sort_asc_label: Asc - sort_desc_label: Desc - text_input_required: 'Select any filter and click on Apply to see results' - text_input_required_format: az_standard - bef: - general: - autosubmit: false - auto_submit_sort_only: false - autosubmit_breakpoint: '' - autosubmit_exclude_textfield: false - autosubmit_textfield_delay: 500 - autosubmit_textfield_minimum_length: 3 - autosubmit_hide: false - input_required: false - allow_secondary: false - secondary_label: 'Advanced options' - secondary_open: false - reset_button_always_show: false - filter: - title: - plugin_id: default - advanced: - placeholder_text: '' - collapsible: false - collapsible_disable_automatic_open: false - open_by_default: false - is_secondary: false - hide_label: false - field_classes: '' - sort_options_unsupported: '' - field_az_location_options: - plugin_id: default - advanced: - placeholder_text: '' - collapsible: false - collapsible_disable_automatic_open: false - open_by_default: false - is_secondary: false - hide_label: false - field_classes: '' - sort_options_unsupported: '' - field_az_topic_target_id: - plugin_id: default - advanced: - sort_options: false - sort_options_method: alphabetical_asc - sort_options_natural: true - rewrite: - filter_rewrite_values: '' - filter_rewrite_values_key: false - collapsible: false - collapsible_disable_automatic_open: false - open_by_default: false - is_secondary: false - hide_label: false - field_classes: '' - field_az_modality_target_id: - plugin_id: default - advanced: - sort_options: false - sort_options_method: alphabetical_asc - sort_options_natural: true - rewrite: - filter_rewrite_values: '' - filter_rewrite_values_key: false - collapsible: false - collapsible_disable_automatic_open: false - open_by_default: false - is_secondary: false - hide_label: false - field_classes: '' - field_az_offered_target_id: - plugin_id: default - advanced: - sort_options: false - sort_options_method: alphabetical_asc - sort_options_natural: true - rewrite: - filter_rewrite_values: '' - filter_rewrite_values_key: false - collapsible: false - collapsible_disable_automatic_open: false - open_by_default: false - is_secondary: false - hide_label: false - field_classes: '' - field_az_incentives_value: - plugin_id: default - advanced: - sort_options: false - sort_options_method: alphabetical_asc - sort_options_natural: true - rewrite: - filter_rewrite_values: '' - filter_rewrite_values_key: false - collapsible: false - collapsible_disable_automatic_open: false - open_by_default: false - is_secondary: false - hide_label: false - field_classes: '' - filters: - status: - id: status - table: node_field_data - field: status - entity_type: node - entity_field: status - plugin_id: boolean - value: '1' - group: 1 - expose: - operator: '' - type: - id: type - table: node_field_data - field: type - entity_type: node - entity_field: type - plugin_id: bundle - value: - az_opportunity: az_opportunity - group: 1 - title: - id: title - table: node_field_data - field: title - relationship: none - group_type: group - admin_label: '' - entity_type: node - entity_field: title - plugin_id: string - operator: contains - value: '' - group: 1 - exposed: true - expose: - operator_id: title_op - label: Title - description: '' - use_operator: false - operator: title_op - operator_limit_selection: false - operator_list: { } - identifier: title - required: false - remember: false - multiple: false - remember_roles: - authenticated: authenticated - placeholder: '' - is_grouped: false - group_info: - label: '' - description: '' - identifier: '' - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: { } - field_az_location_options: - id: field_az_location_options - table: node__field_az_location - field: field_az_location_options - relationship: none - group_type: group - admin_label: '' - plugin_id: string - operator: contains - value: '' - group: 1 - exposed: true - expose: - operator_id: field_az_location_options_op - label: Where - description: '' - use_operator: false - operator: field_az_location_options_op - operator_limit_selection: false - operator_list: { } - identifier: field_az_location_options - required: false - remember: false - multiple: false - remember_roles: - authenticated: authenticated - placeholder: '' - is_grouped: false - group_info: - label: '' - description: '' - identifier: '' - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: { } - field_az_topic_target_id: - id: field_az_topic_target_id - table: node__field_az_topic - field: field_az_topic_target_id - relationship: none - group_type: group - admin_label: '' - plugin_id: taxonomy_index_tid - operator: or - value: { } - group: 1 - exposed: true - expose: - operator_id: field_az_topic_target_id_op - label: Topic - description: '' - use_operator: false - operator: field_az_topic_target_id_op - operator_limit_selection: false - operator_list: { } - identifier: field_az_topic_target_id - required: false - remember: false - multiple: false - remember_roles: - authenticated: authenticated - reduce: false - is_grouped: false - group_info: - label: '' - description: '' - identifier: '' - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: { } - reduce_duplicates: false - vid: az_opportunity_topic - type: select - hierarchy: false - limit: true - error_message: true - field_az_modality_target_id: - id: field_az_modality_target_id - table: node__field_az_modality - field: field_az_modality_target_id - relationship: none - group_type: group - admin_label: '' - plugin_id: taxonomy_index_tid - operator: or - value: { } - group: 1 - exposed: true - expose: - operator_id: field_az_modality_target_id_op - label: Modality - description: '' - use_operator: false - operator: field_az_modality_target_id_op - operator_limit_selection: false - operator_list: { } - identifier: field_az_modality_target_id - required: false - remember: false - multiple: false - remember_roles: - authenticated: authenticated - reduce: false - is_grouped: false - group_info: - label: '' - description: '' - identifier: '' - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: { } - reduce_duplicates: false - vid: az_opportunity_modality - type: select - hierarchy: false - limit: true - error_message: true - field_az_offered_target_id: - id: field_az_offered_target_id - table: node__field_az_offered - field: field_az_offered_target_id - relationship: none - group_type: group - admin_label: '' - plugin_id: taxonomy_index_tid - operator: or - value: { } - group: 1 - exposed: true - expose: - operator_id: field_az_offered_target_id_op - label: Offered - description: '' - use_operator: false - operator: field_az_offered_target_id_op - operator_limit_selection: false - operator_list: { } - identifier: field_az_offered_target_id - required: false - remember: false - multiple: false - remember_roles: - authenticated: authenticated - reduce: false - is_grouped: false - group_info: - label: '' - description: '' - identifier: '' - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: { } - reduce_duplicates: false - vid: az_opportunity_semester - type: select - hierarchy: false - limit: true - error_message: true - field_az_incentives_value: - id: field_az_incentives_value - table: node__field_az_incentives - field: field_az_incentives_value - relationship: none - group_type: group - admin_label: '' - plugin_id: boolean - operator: '=' - value: All - group: 1 - exposed: true - expose: - operator_id: '' - label: Incentives - description: '' - use_operator: false - operator: field_az_incentives_value_op - operator_limit_selection: false - operator_list: { } - identifier: field_az_incentives_value - required: false - remember: false - multiple: false - remember_roles: - authenticated: authenticated - is_grouped: false - group_info: - label: '' - description: '' - identifier: '' - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: { } - field_az_ongoing_value: - id: field_az_ongoing_value - table: node__field_az_ongoing - field: field_az_ongoing_value - relationship: none - group_type: group - admin_label: '' - plugin_id: boolean - operator: '=' - value: '1' - group: 2 - exposed: false - expose: - operator_id: '' - label: '' - description: '' - use_operator: false - operator: '' - operator_limit_selection: false - operator_list: { } - identifier: '' - required: false - remember: false - multiple: false - remember_roles: - authenticated: authenticated - is_grouped: false - group_info: - label: '' - description: '' - identifier: '' - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: { } - field_az_application_date_end_value: - id: field_az_application_date_end_value - table: node__field_az_application_date - field: field_az_application_date_end_value - relationship: none - group_type: group - admin_label: '' - plugin_id: datetime - operator: '>=' - value: - min: '' - max: '' - value: now - type: offset - group: 2 - exposed: false - expose: - operator_id: '' - label: '' - description: '' - use_operator: false - operator: '' - operator_limit_selection: false - operator_list: { } - identifier: '' - required: false - remember: false - multiple: false - remember_roles: - authenticated: authenticated - min_placeholder: '' - max_placeholder: '' - placeholder: '' - is_grouped: false - group_info: - label: '' - description: '' - identifier: '' - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: { } - granularity: day - filter_groups: - operator: AND - groups: - 1: AND - 2: OR - style: - type: default - options: - row_class: '' - default_row_class: true - uses_fields: false - row: - type: 'entity:node' - options: - relationship: none - view_mode: az_row - defaults: - exposed_form: false - style: false - style_options: false - row: false - filters: false - filter_groups: false - display_description: '' - style_options: null display_extenders: { } cache_metadata: max-age: -1 contexts: - 'languages:language_content' - 'languages:language_interface' - - url - url.query_args - 'user.node_grants:view' - user.permissions From ce31a91f7afdf02bfda82e8c33cbcd141add7dc3 Mon Sep 17 00:00:00 2001 From: Z Saenz Date: Tue, 24 Mar 2026 16:15:40 -0700 Subject: [PATCH 26/59] Re-adds modality as program format, organizes fields --- ...rm_display.node.az_opportunity.default.yml | 35 ++-- ...ew_display.node.az_opportunity.az_card.yml | 2 + ...iew_display.node.az_opportunity.az_row.yml | 2 + ....az_opportunity.az_row_with_background.yml | 2 + ...splay.node.az_opportunity.az_small_row.yml | 2 + ...ew_display.node.az_opportunity.default.yml | 150 +++++++++--------- ...pportunity.field_az_opportunity_format.yml | 20 +++ ...orage.node.field_az_opportunity_format.yml | 29 ++++ 8 files changed, 157 insertions(+), 85 deletions(-) create mode 100644 modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_opportunity_format.yml create mode 100644 modules/custom/az_opportunity/config/install/field.storage.node.field_az_opportunity_format.yml diff --git a/modules/custom/az_opportunity/config/install/core.entity_form_display.node.az_opportunity.default.yml b/modules/custom/az_opportunity/config/install/core.entity_form_display.node.az_opportunity.default.yml index 395ace6998..c11625f4d8 100644 --- a/modules/custom/az_opportunity/config/install/core.entity_form_display.node.az_opportunity.default.yml +++ b/modules/custom/az_opportunity/config/install/core.entity_form_display.node.az_opportunity.default.yml @@ -12,6 +12,7 @@ dependencies: - field.field.node.az_opportunity.field_az_ongoing - field.field.node.az_opportunity.field_az_opportunity_category - field.field.node.az_opportunity.field_az_opportunity_credit + - field.field.node.az_opportunity.field_az_opportunity_format - field.field.node.az_opportunity.field_az_opportunity_location - field.field.node.az_opportunity.field_az_parent_account - field.field.node.az_opportunity.field_az_program_date @@ -35,7 +36,7 @@ mode: default content: created: type: datetime_timestamp - weight: 20 + weight: 21 region: content settings: { } third_party_settings: { } @@ -72,7 +73,7 @@ content: third_party_settings: { } field_az_body: type: text_textarea - weight: 13 + weight: 14 region: content settings: rows: 9 @@ -80,7 +81,7 @@ content: third_party_settings: { } field_az_eligibility: type: text_textarea - weight: 14 + weight: 15 region: content settings: rows: 5 @@ -102,7 +103,7 @@ content: third_party_settings: { } field_az_incentives: type: options_select - weight: 11 + weight: 12 region: content settings: { } third_party_settings: { } @@ -135,7 +136,13 @@ content: third_party_settings: { } field_az_opportunity_credit: type: options_select - weight: 12 + weight: 13 + region: content + settings: { } + third_party_settings: { } + field_az_opportunity_format: + type: options_select + weight: 11 region: content settings: { } third_party_settings: { } @@ -149,7 +156,7 @@ content: third_party_settings: { } field_az_parent_account: type: string_textfield - weight: 16 + weight: 17 region: content settings: size: 60 @@ -193,7 +200,7 @@ content: third_party_settings: { } field_az_trellis_id: type: string_textfield - weight: 15 + weight: 16 region: content settings: size: 60 @@ -201,33 +208,33 @@ content: third_party_settings: { } field_az_trellis_imported_date: type: datetime_default - weight: 17 + weight: 18 region: content settings: { } third_party_settings: { } path: type: path - weight: 23 + weight: 24 region: content settings: { } third_party_settings: { } promote: type: boolean_checkbox - weight: 21 + weight: 22 region: content settings: display_label: true third_party_settings: { } status: type: boolean_checkbox - weight: 18 + weight: 19 region: content settings: display_label: true third_party_settings: { } sticky: type: boolean_checkbox - weight: 22 + weight: 23 region: content settings: display_label: true @@ -242,7 +249,7 @@ content: third_party_settings: { } uid: type: entity_reference_autocomplete - weight: 19 + weight: 20 region: content settings: match_operator: CONTAINS @@ -251,7 +258,7 @@ content: placeholder: '' third_party_settings: { } url_redirects: - weight: 24 + weight: 25 region: content settings: { } third_party_settings: { } diff --git a/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_card.yml b/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_card.yml index 70ce182fb4..a4a09bbb39 100644 --- a/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_card.yml +++ b/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_card.yml @@ -13,6 +13,7 @@ dependencies: - field.field.node.az_opportunity.field_az_ongoing - field.field.node.az_opportunity.field_az_opportunity_category - field.field.node.az_opportunity.field_az_opportunity_credit + - field.field.node.az_opportunity.field_az_opportunity_format - field.field.node.az_opportunity.field_az_opportunity_location - field.field.node.az_opportunity.field_az_parent_account - field.field.node.az_opportunity.field_az_program_date @@ -383,6 +384,7 @@ hidden: field_az_ongoing: true field_az_opportunity_category: true field_az_opportunity_credit: true + field_az_opportunity_format: true field_az_program_date: true field_az_program_length: true field_az_program_website: true diff --git a/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_row.yml b/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_row.yml index 712b8aee47..adb7fdf433 100644 --- a/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_row.yml +++ b/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_row.yml @@ -13,6 +13,7 @@ dependencies: - field.field.node.az_opportunity.field_az_ongoing - field.field.node.az_opportunity.field_az_opportunity_category - field.field.node.az_opportunity.field_az_opportunity_credit + - field.field.node.az_opportunity.field_az_opportunity_format - field.field.node.az_opportunity.field_az_opportunity_location - field.field.node.az_opportunity.field_az_parent_account - field.field.node.az_opportunity.field_az_program_date @@ -234,6 +235,7 @@ hidden: field_az_ongoing: true field_az_opportunity_category: true field_az_opportunity_credit: true + field_az_opportunity_format: true field_az_parent_account: true field_az_program_length: true field_az_program_website: true diff --git a/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_row_with_background.yml b/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_row_with_background.yml index ce2f91ba3f..0bb95e2467 100644 --- a/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_row_with_background.yml +++ b/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_row_with_background.yml @@ -13,6 +13,7 @@ dependencies: - field.field.node.az_opportunity.field_az_ongoing - field.field.node.az_opportunity.field_az_opportunity_category - field.field.node.az_opportunity.field_az_opportunity_credit + - field.field.node.az_opportunity.field_az_opportunity_format - field.field.node.az_opportunity.field_az_opportunity_location - field.field.node.az_opportunity.field_az_parent_account - field.field.node.az_opportunity.field_az_program_date @@ -44,6 +45,7 @@ hidden: field_az_ongoing: true field_az_opportunity_category: true field_az_opportunity_credit: true + field_az_opportunity_format: true field_az_opportunity_location: true field_az_parent_account: true field_az_program_date: true diff --git a/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_small_row.yml b/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_small_row.yml index 80576f4d67..01142f2481 100644 --- a/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_small_row.yml +++ b/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_small_row.yml @@ -13,6 +13,7 @@ dependencies: - field.field.node.az_opportunity.field_az_ongoing - field.field.node.az_opportunity.field_az_opportunity_category - field.field.node.az_opportunity.field_az_opportunity_credit + - field.field.node.az_opportunity.field_az_opportunity_format - field.field.node.az_opportunity.field_az_opportunity_location - field.field.node.az_opportunity.field_az_parent_account - field.field.node.az_opportunity.field_az_program_date @@ -244,6 +245,7 @@ hidden: field_az_ongoing: true field_az_opportunity_category: true field_az_opportunity_credit: true + field_az_opportunity_format: true field_az_opportunity_location: true field_az_parent_account: true field_az_program_date: true diff --git a/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.default.yml b/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.default.yml index 27a55b29ea..59f9a6ee0c 100644 --- a/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.default.yml +++ b/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.default.yml @@ -12,6 +12,7 @@ dependencies: - field.field.node.az_opportunity.field_az_ongoing - field.field.node.az_opportunity.field_az_opportunity_category - field.field.node.az_opportunity.field_az_opportunity_credit + - field.field.node.az_opportunity.field_az_opportunity_format - field.field.node.az_opportunity.field_az_opportunity_location - field.field.node.az_opportunity.field_az_parent_account - field.field.node.az_opportunity.field_az_program_date @@ -51,12 +52,11 @@ third_party_settings: effect: none speed: fast group_col2: - children: - - group_date + children: { } label: col2 - parent_name: group_header_row - region: content - weight: 2 + parent_name: '' + region: hidden + weight: 14 format_type: html_element format_settings: classes: col @@ -76,7 +76,7 @@ third_party_settings: label: col3 parent_name: group_header_row region: content - weight: 3 + weight: 2 format_type: html_element format_settings: classes: col @@ -91,12 +91,11 @@ third_party_settings: effect: none speed: fast group_col4: - children: - - group_modality + children: { } label: col4 - parent_name: group_header_row - region: content - weight: 4 + parent_name: '' + region: hidden + weight: 11 format_type: html_element format_settings: classes: col @@ -116,7 +115,7 @@ third_party_settings: label: col5 parent_name: group_header_row region: content - weight: 5 + weight: 3 format_type: html_element format_settings: classes: col @@ -134,9 +133,9 @@ third_party_settings: children: - group_audiences label: col6 - parent_name: group_header_row - region: content - weight: 7 + parent_name: '' + region: hidden + weight: 12 format_type: html_element format_settings: classes: col @@ -152,11 +151,12 @@ third_party_settings: speed: fast group_col7: children: - - field_az_program_website + - group_date + - group_modality label: col7 - parent_name: group_bottom_row + parent_name: group_header_row region: content - weight: 1 + weight: 4 format_type: html_element format_settings: classes: col @@ -172,11 +172,11 @@ third_party_settings: speed: fast group_col8: children: - - field_az_application_link + - group_topics label: col8 - parent_name: group_bottom_row + parent_name: group_header_row region: content - weight: 2 + weight: 6 format_type: html_element format_settings: classes: col @@ -193,11 +193,10 @@ third_party_settings: group_header_row: children: - group_col1 - - group_col2 - group_col3 - - group_col4 - group_col5 - - group_col6 + - group_col7 + - group_col8 label: 'header row' parent_name: '' region: content @@ -218,6 +217,7 @@ third_party_settings: group_where: children: - field_az_opportunity_location + - field_az_opportunity_format label: Location parent_name: group_col1 region: content @@ -237,11 +237,12 @@ third_party_settings: speed: fast group_date: children: - - field_az_offered - label: Date - parent_name: group_col2 + - field_az_program_date + - field_az_program_website + label: 'Program Info' + parent_name: group_col7 region: content - weight: 14 + weight: 5 format_type: html_element format_settings: classes: '' @@ -256,12 +257,11 @@ third_party_settings: effect: none speed: fast group_modality: - children: - - field_az_parent_account + children: { } label: 'Parent Account' - parent_name: group_col4 - region: content - weight: 9 + parent_name: group_col7 + region: hidden + weight: 6 format_type: html_element format_settings: classes: '' @@ -278,6 +278,7 @@ third_party_settings: group_incentives: children: - field_az_incentives + - field_az_opportunity_credit label: Incentives parent_name: group_col5 region: content @@ -299,7 +300,7 @@ third_party_settings: children: { } label: Audiences parent_name: group_col6 - region: content + region: hidden weight: 5 format_type: html_element format_settings: @@ -316,8 +317,9 @@ third_party_settings: speed: fast group_program_length: children: + - field_az_offered - field_az_program_length - label: 'Program Length' + label: 'Start Options' parent_name: group_col3 region: content weight: 9 @@ -335,32 +337,32 @@ third_party_settings: effect: none speed: fast group_topics: - children: { } - label: Topics - parent_name: '' + children: + - field_az_application_date + - field_az_application_link + label: 'Application Info' + parent_name: group_col8 region: content - weight: 1 + weight: 6 format_type: html_element format_settings: - classes: mb-4 + classes: '' show_empty_fields: false id: '' label_as_html: false element: div - show_label: false - label_element: h3 - label_element_classes: '' + show_label: true + label_element: h2 + label_element_classes: 'h4 fw-bolder' attributes: '' effect: none speed: fast group_bottom_row: - children: - - group_col7 - - group_col8 + children: { } label: 'Bottom Row' parent_name: '' - region: content - weight: 2 + region: hidden + weight: 13 format_type: html_element format_settings: classes: row @@ -383,14 +385,14 @@ mode: default content: field_az_application_date: type: daterange_default - label: inline + label: hidden settings: timezone_override: '' - format_type: short + format_type: html_date from_to: both separator: '-' third_party_settings: { } - weight: 4 + weight: 7 region: content field_az_application_link: type: link @@ -402,29 +404,21 @@ content: rel: '0' target: '0' third_party_settings: { } - weight: 16 + weight: 8 region: content field_az_body: type: text_default label: above settings: { } third_party_settings: { } - weight: 6 + weight: 2 region: content field_az_eligibility: type: text_default label: above settings: { } third_party_settings: { } - weight: 7 - region: content - field_az_enterprise_attributes: - type: entity_reference_label - label: above - settings: - link: true - third_party_settings: { } - weight: 9 + weight: 3 region: content field_az_incentives: type: list_default @@ -437,9 +431,9 @@ content: type: entity_reference_label label: hidden settings: - link: false + link: true third_party_settings: { } - weight: 15 + weight: 7 region: content field_az_opportunity_category: type: entity_reference_entity_view @@ -448,6 +442,20 @@ content: view_mode: az_badge link: false third_party_settings: { } + weight: 1 + region: content + field_az_opportunity_credit: + type: list_default + label: hidden + settings: { } + third_party_settings: { } + weight: 19 + region: content + field_az_opportunity_format: + type: list_default + label: hidden + settings: { } + third_party_settings: { } weight: 5 region: content field_az_opportunity_location: @@ -464,18 +472,18 @@ content: settings: link_to_entity: false third_party_settings: { } - weight: 6 + weight: 5 region: content field_az_program_date: type: daterange_default - label: inline + label: hidden settings: timezone_override: '' - format_type: short + format_type: html_date from_to: both separator: '-' third_party_settings: { } - weight: 3 + weight: 7 region: content field_az_program_length: type: string @@ -483,7 +491,7 @@ content: settings: link_to_entity: false third_party_settings: { } - weight: 5 + weight: 8 region: content field_az_program_website: type: link @@ -500,11 +508,11 @@ content: links: settings: { } third_party_settings: { } - weight: 8 + weight: 4 region: content hidden: + field_az_enterprise_attributes: true field_az_ongoing: true - field_az_opportunity_credit: true field_az_trellis_id: true field_az_trellis_imported_date: true smart_title: true diff --git a/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_opportunity_format.yml b/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_opportunity_format.yml new file mode 100644 index 0000000000..c89cc57ac8 --- /dev/null +++ b/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_opportunity_format.yml @@ -0,0 +1,20 @@ +langcode: en +status: true +dependencies: + config: + - field.storage.node.field_az_opportunity_format + - node.type.az_opportunity + module: + - options +id: node.az_opportunity.field_az_opportunity_format +field_name: field_az_opportunity_format +entity_type: node +bundle: az_opportunity +label: 'Opportunity Format' +description: '' +required: false +translatable: false +default_value: { } +default_value_callback: '' +settings: { } +field_type: list_string diff --git a/modules/custom/az_opportunity/config/install/field.storage.node.field_az_opportunity_format.yml b/modules/custom/az_opportunity/config/install/field.storage.node.field_az_opportunity_format.yml new file mode 100644 index 0000000000..0f03d46603 --- /dev/null +++ b/modules/custom/az_opportunity/config/install/field.storage.node.field_az_opportunity_format.yml @@ -0,0 +1,29 @@ +langcode: en +status: true +dependencies: + module: + - node + - options +id: node.field_az_opportunity_format +field_name: field_az_opportunity_format +entity_type: node +type: list_string +settings: + allowed_values: + - + value: virtual + label: Virtual + - + value: hybrid + label: Hybrid + - + value: in_person + label: 'In Person' + allowed_values_function: '' +module: options +locked: false +cardinality: 1 +translatable: true +indexes: { } +persist_with_no_fields: false +custom_storage: false From 4681a6326df4832c257c95e9d30043b794570e79 Mon Sep 17 00:00:00 2001 From: Z Saenz Date: Thu, 26 Mar 2026 09:40:25 -0700 Subject: [PATCH 27/59] update displays and views --- .../az_opportunity_trellis.module | 1 + ...lus.migration.az_trellis_opportunities.yml | 108 ++-- ...ews.view.az_opportunity_trellis_import.yml | 82 ++- .../src/Form/AZRecurringImportRuleForm.php | 20 - ...rm_display.node.az_opportunity.default.yml | 37 +- ...ew_display.node.az_opportunity.az_card.yml | 1 - ...iew_display.node.az_opportunity.az_row.yml | 6 +- ...field.storage.node.field_az_incentives.yml | 6 + .../install/views.view.az_opportunity.yml | 471 +++++++++++++++++- 9 files changed, 610 insertions(+), 122 deletions(-) diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.module b/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.module index 881cb48a51..d8300b5102 100644 --- a/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.module +++ b/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.module @@ -39,6 +39,7 @@ function az_opportunity_trellis_form_node_az_opportunity_edit_form_alter(&$form, 'field_az_audiences', 'field_az_credit', 'field_az_eligibility', + 'field_az_enterprise_attributes', 'field_az_incentives', 'field_az_opportunity_location', 'field_az_modality', diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/config/install/migrate_plus.migration.az_trellis_opportunities.yml b/modules/custom/az_opportunity/az_opportunity_trellis/config/install/migrate_plus.migration.az_trellis_opportunities.yml index a4b2e4745a..91a0309f15 100644 --- a/modules/custom/az_opportunity/az_opportunity_trellis/config/install/migrate_plus.migration.az_trellis_opportunities.yml +++ b/modules/custom/az_opportunity/az_opportunity_trellis/config/install/migrate_plus.migration.az_trellis_opportunities.yml @@ -103,6 +103,18 @@ source: name: program_type label: 'Program Type' selector: Program_Type__c + - + name: audiences + label: Audiences + selector: Audiences__c + - + name: topic + label: Topic + selector: Topic__c + - + name: program_type + label: 'Program Type' + selector: Program_Type__c - name: publish label: Publish @@ -115,6 +127,28 @@ source: id: type: string process: + field_az_enterprise_attributes: + - plugin: callback + callable: array_filter + source: + - audiences + - topic + - program_type + - program_format + - + plugin: multiple_values + - + plugin: callback + callable: trim + - + plugin: single_value + - + plugin: entity_lookup + entity_type: taxonomy_term + bundle_key: vid + bundle: az_enterprise_attributes + value_key: name + ignore_case: true title: name field_az_trellis_id: id field_az_offered: @@ -130,19 +164,18 @@ process: source: start_options value_key: name ignore_case: true - field_az_modality: + field_az_opportunity_format: - plugin: skip_on_empty method: process source: program_format - - plugin: entity_generate - entity_type: taxonomy_term - bundle_key: vid - bundle: az_opportunity_modality + plugin: static_map source: program_format - value_key: name - ignore_case: true + map: + 'Hybrid': hybrid + 'In-Person': in_person + 'Virtual': virtual field_az_program_length: program_length field_az_incentives: - @@ -153,47 +186,33 @@ process: plugin: static_map source: incentives map: - 'Yes': 1 - 'No': 0 - field_az_credit: credit_type + 'Yes': yes + 'No': no + 'Inquire Within': inquire_within + field_az_opportunity_credit: + - + plugin: skip_on_empty + method: process + source: credit_type + - + plugin: static_map + source: credit_type + map: + 'Non-Credit': non_credit + 'UA Credit': ua_credit + 'Transfer Credit': transfer_credit field_az_opportunity_location: location field_az_program_website/uri: program_website field_az_program_website/title: - plugin: default_value - default_value: 'Program details' + default_value: 'Program Website' field_az_body: description - field_az_topic: - - - plugin: skip_on_empty - method: process - source: topic - - - plugin: entity_generate - entity_type: taxonomy_term - bundle_key: vid - bundle: az_opportunity_topic - source: topic - value_key: name - ignore_case: true field_az_application_link/uri: application_form_url field_az_application_link/title: - plugin: default_value default_value: 'Apply now' - field_az_audiences: - - - plugin: skip_on_empty - method: process - source: audiences - - - plugin: entity_generate - entity_type: taxonomy_term - bundle_key: vid - bundle: az_opportunity_audience - source: audiences - value_key: name - ignore_case: true field_az_application_date/value: - plugin: format_date @@ -236,18 +255,6 @@ process: from_format: 'Y-m-d\TH:i:s.vp' to_format: 'Y-m-d\TH:i:s' field_az_parent_account: parent_account - field_az_opportunity_type: - - - plugin: skip_on_empty - method: process - source: program_type - - - plugin: entity_generate - entity_type: taxonomy_term - bundle_key: vid - bundle: az_opportunity_type - value_key: name - ignore_case: true status: - plugin: get @@ -260,5 +267,6 @@ destination: plugin: 'entity:node' default_bundle: az_opportunity validate: false -migration_dependencies: null +migration_dependencies: + null include: null diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/config/install/views.view.az_opportunity_trellis_import.yml b/modules/custom/az_opportunity/az_opportunity_trellis/config/install/views.view.az_opportunity_trellis_import.yml index d25844f07b..e186e17643 100644 --- a/modules/custom/az_opportunity/az_opportunity_trellis/config/install/views.view.az_opportunity_trellis_import.yml +++ b/modules/custom/az_opportunity/az_opportunity_trellis/config/install/views.view.az_opportunity_trellis_import.yml @@ -125,15 +125,15 @@ display: empty_zero: false hide_alter_empty: true property_path: Name - property_1: - id: property_1 + property_2: + id: property_2 table: az_opportunity_trellis_data field: property relationship: none group_type: group admin_label: '' plugin_id: views_remote_data_property - label: 'Program Website' + label: 'Start Date' exclude: false alter: alter_text: false @@ -166,7 +166,7 @@ display: element_class: '' element_label_type: '' element_label_class: '' - element_label_colon: true + element_label_colon: false element_wrapper_type: '' element_wrapper_class: '' element_default_classes: true @@ -174,16 +174,16 @@ display: hide_empty: false empty_zero: false hide_alter_empty: true - property_path: Program_Website__c - property_2: - id: property_2 + property_path: Start_Date__c + property_3: + id: property_3 table: az_opportunity_trellis_data field: property relationship: none group_type: group admin_label: '' plugin_id: views_remote_data_property - label: 'Start Date' + label: NetID exclude: false alter: alter_text: false @@ -216,7 +216,7 @@ display: element_class: '' element_label_type: '' element_label_class: '' - element_label_colon: false + element_label_colon: true element_wrapper_type: '' element_wrapper_class: '' element_default_classes: true @@ -224,16 +224,16 @@ display: hide_empty: false empty_zero: false hide_alter_empty: true - property_path: Start_Date__c - property_3: - id: property_3 + property_path: Owner_NetID + property_5: + id: property_5 table: az_opportunity_trellis_data field: property relationship: none group_type: group admin_label: '' plugin_id: views_remote_data_property - label: NetID + label: Audience exclude: false alter: alter_text: false @@ -274,9 +274,9 @@ display: hide_empty: false empty_zero: false hide_alter_empty: true - property_path: Owner_NetID - property_5: - id: property_5 + property_path: Audiences__c + property_7: + id: property_7 table: az_opportunity_trellis_data field: property relationship: none @@ -325,6 +325,56 @@ display: empty_zero: false hide_alter_empty: true property_path: Topic__c + property_8: + id: property_8 + table: az_opportunity_trellis_data + field: property + relationship: none + group_type: group + admin_label: '' + plugin_id: views_remote_data_property + label: 'Program Type' + exclude: false + alter: + alter_text: false + text: '' + make_link: false + path: '' + absolute: false + external: false + replace_spaces: false + path_case: none + trim_whitespace: false + alt: '' + rel: '' + link_class: '' + prefix: '' + suffix: '' + target: '' + nl2br: false + max_length: 0 + word_boundary: true + ellipsis: true + more_link: false + more_link_text: '' + more_link_path: '' + strip_tags: false + trim: false + preserve_tags: '' + html: false + element_type: '' + element_class: '' + element_label_type: '' + element_label_class: '' + element_label_colon: true + element_wrapper_type: '' + element_wrapper_class: '' + element_default_classes: true + empty: '' + hide_empty: false + empty_zero: false + hide_alter_empty: true + property_path: Program_Type__c property_4: id: property_4 table: az_opportunity_trellis_data diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/src/Form/AZRecurringImportRuleForm.php b/modules/custom/az_opportunity/az_opportunity_trellis/src/Form/AZRecurringImportRuleForm.php index 49f1df58ef..f05077959b 100644 --- a/modules/custom/az_opportunity/az_opportunity_trellis/src/Form/AZRecurringImportRuleForm.php +++ b/modules/custom/az_opportunity/az_opportunity_trellis/src/Form/AZRecurringImportRuleForm.php @@ -88,13 +88,6 @@ public function form(array $form, FormStateInterface $form_state): array { '#default_value' => $entity->get('owner'), ]; - // $form['query_parameters']['host'] = [ - // '#type' => 'textfield', - // '#title' => $this->t('Host'), - // '#maxlength' => 255, - // '#default_value' => $entity->get('host'), - // ]; - $form['query_parameters']['keyword'] = [ '#type' => 'textfield', '#title' => $this->t('Keyword'), @@ -149,19 +142,6 @@ public function form(array $form, FormStateInterface $form_state): array { ]; } - // $form['query_parameters']['approval'] = [ - // '#type' => 'select', - // '#title' => $this->t('Approved for University Calendar'), - // '#options' => [ - // 'approved' => $this->t('Approved'), - // 'denied' => $this->t('Denied'), - // ], - // '#empty_option' => $this->t('- Any -'), - // '#empty_value' => '', - // '#required' => FALSE, - // '#default_value' => $entity->get('approval'), - // ]; - return $form; } diff --git a/modules/custom/az_opportunity/config/install/core.entity_form_display.node.az_opportunity.default.yml b/modules/custom/az_opportunity/config/install/core.entity_form_display.node.az_opportunity.default.yml index c11625f4d8..7bf1f633e2 100644 --- a/modules/custom/az_opportunity/config/install/core.entity_form_display.node.az_opportunity.default.yml +++ b/modules/custom/az_opportunity/config/install/core.entity_form_display.node.az_opportunity.default.yml @@ -36,7 +36,7 @@ mode: default content: created: type: datetime_timestamp - weight: 21 + weight: 20 region: content settings: { } third_party_settings: { } @@ -73,7 +73,7 @@ content: third_party_settings: { } field_az_body: type: text_textarea - weight: 14 + weight: 13 region: content settings: rows: 9 @@ -81,7 +81,7 @@ content: third_party_settings: { } field_az_eligibility: type: text_textarea - weight: 15 + weight: 14 region: content settings: rows: 5 @@ -103,7 +103,7 @@ content: third_party_settings: { } field_az_incentives: type: options_select - weight: 12 + weight: 11 region: content settings: { } third_party_settings: { } @@ -136,13 +136,7 @@ content: third_party_settings: { } field_az_opportunity_credit: type: options_select - weight: 13 - region: content - settings: { } - third_party_settings: { } - field_az_opportunity_format: - type: options_select - weight: 11 + weight: 12 region: content settings: { } third_party_settings: { } @@ -156,7 +150,7 @@ content: third_party_settings: { } field_az_parent_account: type: string_textfield - weight: 17 + weight: 16 region: content settings: size: 60 @@ -200,7 +194,7 @@ content: third_party_settings: { } field_az_trellis_id: type: string_textfield - weight: 16 + weight: 15 region: content settings: size: 60 @@ -208,33 +202,33 @@ content: third_party_settings: { } field_az_trellis_imported_date: type: datetime_default - weight: 18 + weight: 17 region: content settings: { } third_party_settings: { } path: type: path - weight: 24 + weight: 23 region: content settings: { } third_party_settings: { } promote: type: boolean_checkbox - weight: 22 + weight: 21 region: content settings: display_label: true third_party_settings: { } status: type: boolean_checkbox - weight: 19 + weight: 18 region: content settings: display_label: true third_party_settings: { } sticky: type: boolean_checkbox - weight: 23 + weight: 22 region: content settings: display_label: true @@ -249,7 +243,7 @@ content: third_party_settings: { } uid: type: entity_reference_autocomplete - weight: 20 + weight: 19 region: content settings: match_operator: CONTAINS @@ -258,8 +252,9 @@ content: placeholder: '' third_party_settings: { } url_redirects: - weight: 25 + weight: 24 region: content settings: { } third_party_settings: { } -hidden: { } +hidden: + field_az_opportunity_format: true diff --git a/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_card.yml b/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_card.yml index a4a09bbb39..250bc82a15 100644 --- a/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_card.yml +++ b/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_card.yml @@ -264,7 +264,6 @@ third_party_settings: group_text_body_secondary: children: - field_az_opportunity_location - - field_az_modality - field_az_application_date - field_az_offered - field_az_parent_account diff --git a/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_row.yml b/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_row.yml index adb7fdf433..e4dc40e57c 100644 --- a/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_row.yml +++ b/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_row.yml @@ -92,7 +92,6 @@ third_party_settings: group_col_1: children: - smart_title - - field_az_topic label: 'col 1' parent_name: group_row region: content @@ -133,7 +132,6 @@ third_party_settings: group_col_3: children: - field_az_opportunity_location - - field_az_modality label: 'Col 3' parent_name: group_row region: content @@ -190,7 +188,7 @@ content: label: inline settings: timezone_override: '' - format_type: short + format_type: html_date from_to: both separator: '-' third_party_settings: { } @@ -209,7 +207,7 @@ content: label: inline settings: timezone_override: '' - format_type: medium + format_type: html_date from_to: both separator: '-' third_party_settings: { } diff --git a/modules/custom/az_opportunity/config/install/field.storage.node.field_az_incentives.yml b/modules/custom/az_opportunity/config/install/field.storage.node.field_az_incentives.yml index 29cd108387..ade805f693 100644 --- a/modules/custom/az_opportunity/config/install/field.storage.node.field_az_incentives.yml +++ b/modules/custom/az_opportunity/config/install/field.storage.node.field_az_incentives.yml @@ -13,6 +13,12 @@ settings: - value: 'yes' label: 'Yes' + - + value: 'no' + label: 'No' + - + value: inquire_within + label: 'Inquire Within' allowed_values_function: '' module: options locked: false diff --git a/modules/custom/az_opportunity/config/install/views.view.az_opportunity.yml b/modules/custom/az_opportunity/config/install/views.view.az_opportunity.yml index 9f662329f6..09bdee31a5 100644 --- a/modules/custom/az_opportunity/config/install/views.view.az_opportunity.yml +++ b/modules/custom/az_opportunity/config/install/views.view.az_opportunity.yml @@ -2,9 +2,14 @@ langcode: en status: true dependencies: config: + - core.entity_view_mode.node.az_card + - core.entity_view_mode.node.az_row + - core.entity_view_mode.node.az_small_row - node.type.az_opportunity module: + - datetime - node + - options - user id: az_opportunity label: 'AZ Opportunity' @@ -106,22 +111,34 @@ display: options: { } empty: { } sorts: - created: - id: created - table: node_field_data - field: created + field_az_application_date_value: + id: field_az_application_date_value + table: node__field_az_application_date + field: field_az_application_date_value relationship: none group_type: group admin_label: '' - entity_type: node - entity_field: created - plugin_id: date - order: DESC + plugin_id: datetime + order: ASC expose: label: '' field_identifier: '' exposed: false - granularity: second + granularity: day + field_az_program_date_value: + id: field_az_program_date_value + table: node__field_az_program_date + field: field_az_program_date_value + relationship: none + group_type: group + admin_label: '' + plugin_id: datetime + order: ASC + expose: + label: '' + field_identifier: '' + exposed: false + granularity: day arguments: { } filters: status: @@ -181,16 +198,450 @@ display: tags: { } block_1: id: block_1 - display_title: Block + display_title: 'Row View with Filter' display_plugin: block position: 1 display_options: + pager: + type: full + options: + offset: 0 + pagination_heading_level: h4 + items_per_page: 10 + total_pages: null + id: 0 + tags: + next: ›› + previous: ‹‹ + first: '« First' + last: 'Last »' + expose: + items_per_page: false + items_per_page_label: 'Items per page' + items_per_page_options: '5, 10, 25, 50' + items_per_page_options_all: false + items_per_page_options_all_label: '- All -' + offset: false + offset_label: Offset + quantity: 9 + filters: + status: + id: status + table: node_field_data + field: status + entity_type: node + entity_field: status + plugin_id: boolean + value: '1' + group: 1 + expose: + operator: '' + type: + id: type + table: node_field_data + field: type + entity_type: node + entity_field: type + plugin_id: bundle + value: + az_opportunity: az_opportunity + group: 1 + title: + id: title + table: node_field_data + field: title + relationship: none + group_type: group + admin_label: '' + entity_type: node + entity_field: title + plugin_id: string + operator: contains + value: '' + group: 1 + exposed: true + expose: + operator_id: title_op + label: Title + description: '' + use_operator: false + operator: title_op + operator_limit_selection: false + operator_list: { } + identifier: title + required: false + remember: false + multiple: false + remember_roles: + authenticated: authenticated + placeholder: '' + is_grouped: false + group_info: + label: '' + description: '' + identifier: '' + optional: true + widget: select + multiple: false + remember: false + default_group: All + default_group_multiple: { } + group_items: { } + field_az_opportunity_location_value: + id: field_az_opportunity_location_value + table: node__field_az_opportunity_location + field: field_az_opportunity_location_value + relationship: none + group_type: group + admin_label: '' + plugin_id: string + operator: contains + value: '' + group: 1 + exposed: true + expose: + operator_id: field_az_opportunity_location_value_op + label: Location + description: '' + use_operator: false + operator: field_az_opportunity_location_value_op + operator_limit_selection: false + operator_list: { } + identifier: field_az_opportunity_location_value + required: false + remember: false + multiple: false + remember_roles: + authenticated: authenticated + placeholder: '' + is_grouped: false + group_info: + label: '' + description: '' + identifier: '' + optional: true + widget: select + multiple: false + remember: false + default_group: All + default_group_multiple: { } + group_items: { } + field_az_incentives_value: + id: field_az_incentives_value + table: node__field_az_incentives + field: field_az_incentives_value + relationship: none + group_type: group + admin_label: '' + plugin_id: list_field + operator: or + value: { } + group: 1 + exposed: true + expose: + operator_id: field_az_incentives_value_op + label: Incentives + description: '' + use_operator: false + operator: field_az_incentives_value_op + operator_limit_selection: false + operator_list: { } + identifier: field_az_incentives_value + required: false + remember: false + multiple: false + remember_roles: + authenticated: authenticated + reduce: false + is_grouped: false + group_info: + label: '' + description: '' + identifier: '' + optional: true + widget: select + multiple: false + remember: false + default_group: All + default_group_multiple: { } + group_items: { } + reduce_duplicates: false + filter_groups: + operator: AND + groups: + 1: AND + style: + type: default + options: + grouping: { } + row_class: '' + default_row_class: true + uses_fields: false + row: + type: 'entity:node' + options: + relationship: none + view_mode: az_row + defaults: + pager: false + pager_options: false + style: false + style_options: false + row: false + filters: false + filter_groups: false + display_description: '' + pager_options: null + style_options: null + display_extenders: { } + cache_metadata: + max-age: -1 + contexts: + - 'languages:language_content' + - 'languages:language_interface' + - url + - url.query_args + - 'user.node_grants:view' + - user.permissions + tags: { } + block_2: + id: block_2 + display_title: 'Card View' + display_plugin: block + position: 1 + display_options: + style: + type: default + options: + grouping: { } + row_class: '' + default_row_class: true + uses_fields: false + row: + type: 'entity:node' + options: + relationship: none + view_mode: az_card + defaults: + style: false + style_options: false + row: false + display_description: '' + style_options: null + display_extenders: { } + cache_metadata: + max-age: -1 + contexts: + - 'languages:language_content' + - 'languages:language_interface' + - url.query_args + - 'user.node_grants:view' + - user.permissions + tags: { } + block_3: + id: block_3 + display_title: 'Small Row' + display_plugin: block + position: 1 + display_options: + pager: + type: full + options: + offset: 0 + pagination_heading_level: h4 + items_per_page: 10 + total_pages: null + id: 0 + tags: + next: ›› + previous: ‹‹ + first: '« First' + last: 'Last »' + expose: + items_per_page: false + items_per_page_label: 'Items per page' + items_per_page_options: '5, 10, 25, 50' + items_per_page_options_all: false + items_per_page_options_all_label: '- All -' + offset: false + offset_label: Offset + quantity: 9 + filters: + status: + id: status + table: node_field_data + field: status + entity_type: node + entity_field: status + plugin_id: boolean + value: '1' + group: 1 + expose: + operator: '' + type: + id: type + table: node_field_data + field: type + entity_type: node + entity_field: type + plugin_id: bundle + value: + az_opportunity: az_opportunity + group: 1 + title: + id: title + table: node_field_data + field: title + relationship: none + group_type: group + admin_label: '' + entity_type: node + entity_field: title + plugin_id: string + operator: contains + value: '' + group: 1 + exposed: true + expose: + operator_id: title_op + label: Title + description: '' + use_operator: false + operator: title_op + operator_limit_selection: false + operator_list: { } + identifier: title + required: false + remember: false + multiple: false + remember_roles: + authenticated: authenticated + placeholder: '' + is_grouped: false + group_info: + label: '' + description: '' + identifier: '' + optional: true + widget: select + multiple: false + remember: false + default_group: All + default_group_multiple: { } + group_items: { } + field_az_opportunity_location_value: + id: field_az_opportunity_location_value + table: node__field_az_opportunity_location + field: field_az_opportunity_location_value + relationship: none + group_type: group + admin_label: '' + plugin_id: string + operator: contains + value: '' + group: 1 + exposed: true + expose: + operator_id: field_az_opportunity_location_value_op + label: Location + description: '' + use_operator: false + operator: field_az_opportunity_location_value_op + operator_limit_selection: false + operator_list: { } + identifier: field_az_opportunity_location_value + required: false + remember: false + multiple: false + remember_roles: + authenticated: authenticated + placeholder: '' + is_grouped: false + group_info: + label: '' + description: '' + identifier: '' + optional: true + widget: select + multiple: false + remember: false + default_group: All + default_group_multiple: { } + group_items: { } + field_az_incentives_value: + id: field_az_incentives_value + table: node__field_az_incentives + field: field_az_incentives_value + relationship: none + group_type: group + admin_label: '' + plugin_id: list_field + operator: or + value: { } + group: 1 + exposed: true + expose: + operator_id: field_az_incentives_value_op + label: Incentives + description: '' + use_operator: false + operator: field_az_incentives_value_op + operator_limit_selection: false + operator_list: { } + identifier: field_az_incentives_value + required: false + remember: false + multiple: false + remember_roles: + authenticated: authenticated + reduce: false + is_grouped: false + group_info: + label: '' + description: '' + identifier: '' + optional: true + widget: select + multiple: false + remember: false + default_group: All + default_group_multiple: { } + group_items: { } + reduce_duplicates: false + filter_groups: + operator: AND + groups: + 1: AND + style: + type: default + options: + grouping: { } + row_class: '' + default_row_class: true + uses_fields: false + row: + type: 'entity:node' + options: + relationship: none + view_mode: az_small_row + defaults: + pager: false + pager_options: false + style: false + style_options: false + row: false + filters: false + filter_groups: false + display_description: '' + pager_options: null + style_options: null display_extenders: { } cache_metadata: max-age: -1 contexts: - 'languages:language_content' - 'languages:language_interface' + - url - url.query_args - 'user.node_grants:view' - user.permissions From 0805ab7222ca0b69752c241a58e9be9259d9319e Mon Sep 17 00:00:00 2001 From: Z Saenz Date: Mon, 30 Mar 2026 11:20:14 -0700 Subject: [PATCH 28/59] Added Program Type, clearing empty fields --- ...ews.view.az_opportunity_trellis_import.yml | 4 +-- ...rm_display.node.az_opportunity.default.yml | 5 ++-- ...ew_display.node.az_opportunity.az_card.yml | 2 -- ...iew_display.node.az_opportunity.az_row.yml | 2 -- ....az_opportunity.az_row_with_background.yml | 2 -- ...splay.node.az_opportunity.az_small_row.yml | 2 -- ...ew_display.node.az_opportunity.default.yml | 8 ----- ...y_term.az_opportunity_audience.default.yml | 1 - ...y_term.az_opportunity_modality.default.yml | 1 - ...omy_term.az_opportunity_topic.az_badge.yml | 1 - ...nomy_term.az_opportunity_type.az_badge.yml | 1 - ...de.az_opportunity.field_az_attachments.yml | 1 - ...node.az_opportunity.field_az_audiences.yml | 1 - ...ld.node.az_opportunity.field_az_credit.yml | 1 - ....node.az_opportunity.field_az_location.yml | 1 - ...de.az_opportunity.field_az_media_image.yml | 1 - ....node.az_opportunity.field_az_modality.yml | 1 - ...pportunity.field_az_opportunity_format.yml | 20 ------------- ..._opportunity.field_az_opportunity_type.yml | 1 - ....az_opportunity.field_az_start_options.yml | 1 - ...eld.node.az_opportunity.field_az_topic.yml | 1 - ...ortunity.field_opportunity_attachments.yml | 1 - .../field.storage.node.field_az_audiences.yml | 1 - .../field.storage.node.field_az_credit.yml | 1 - .../field.storage.node.field_az_modality.yml | 1 - ...orage.node.field_az_opportunity_format.yml | 29 ------------------- ...storage.node.field_az_opportunity_type.yml | 1 - ...ld.storage.node.field_az_start_options.yml | 1 - .../field.storage.node.field_az_topic.yml | 1 - ...age.node.field_opportunity_attachments.yml | 1 - ...omy.vocabulary.az_opportunity_audience.yml | 1 - ...onomy.vocabulary.az_opportunity_credit.yml | 1 - ...omy.vocabulary.az_opportunity_modality.yml | 1 - ...xonomy.vocabulary.az_opportunity_topic.yml | 1 - ...axonomy.vocabulary.az_opportunity_type.yml | 1 - 35 files changed, 4 insertions(+), 96 deletions(-) delete mode 100644 modules/custom/az_opportunity/config/install/core.entity_view_display.taxonomy_term.az_opportunity_audience.default.yml delete mode 100644 modules/custom/az_opportunity/config/install/core.entity_view_display.taxonomy_term.az_opportunity_modality.default.yml delete mode 100644 modules/custom/az_opportunity/config/install/core.entity_view_display.taxonomy_term.az_opportunity_topic.az_badge.yml delete mode 100644 modules/custom/az_opportunity/config/install/core.entity_view_display.taxonomy_term.az_opportunity_type.az_badge.yml delete mode 100644 modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_attachments.yml delete mode 100644 modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_audiences.yml delete mode 100644 modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_credit.yml delete mode 100644 modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_location.yml delete mode 100644 modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_media_image.yml delete mode 100644 modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_modality.yml delete mode 100644 modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_opportunity_format.yml delete mode 100644 modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_opportunity_type.yml delete mode 100644 modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_start_options.yml delete mode 100644 modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_topic.yml delete mode 100644 modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_opportunity_attachments.yml delete mode 100644 modules/custom/az_opportunity/config/install/field.storage.node.field_az_audiences.yml delete mode 100644 modules/custom/az_opportunity/config/install/field.storage.node.field_az_credit.yml delete mode 100644 modules/custom/az_opportunity/config/install/field.storage.node.field_az_modality.yml delete mode 100644 modules/custom/az_opportunity/config/install/field.storage.node.field_az_opportunity_format.yml delete mode 100644 modules/custom/az_opportunity/config/install/field.storage.node.field_az_opportunity_type.yml delete mode 100644 modules/custom/az_opportunity/config/install/field.storage.node.field_az_start_options.yml delete mode 100644 modules/custom/az_opportunity/config/install/field.storage.node.field_az_topic.yml delete mode 100644 modules/custom/az_opportunity/config/install/field.storage.node.field_opportunity_attachments.yml delete mode 100644 modules/custom/az_opportunity/config/install/taxonomy.vocabulary.az_opportunity_audience.yml delete mode 100644 modules/custom/az_opportunity/config/install/taxonomy.vocabulary.az_opportunity_credit.yml delete mode 100644 modules/custom/az_opportunity/config/install/taxonomy.vocabulary.az_opportunity_modality.yml delete mode 100644 modules/custom/az_opportunity/config/install/taxonomy.vocabulary.az_opportunity_topic.yml delete mode 100644 modules/custom/az_opportunity/config/install/taxonomy.vocabulary.az_opportunity_type.yml diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/config/install/views.view.az_opportunity_trellis_import.yml b/modules/custom/az_opportunity/az_opportunity_trellis/config/install/views.view.az_opportunity_trellis_import.yml index e186e17643..be514f2aa2 100644 --- a/modules/custom/az_opportunity/az_opportunity_trellis/config/install/views.view.az_opportunity_trellis_import.yml +++ b/modules/custom/az_opportunity/az_opportunity_trellis/config/install/views.view.az_opportunity_trellis_import.yml @@ -136,8 +136,8 @@ display: label: 'Start Date' exclude: false alter: - alter_text: false - text: '' + alter_text: true + text: "{{ property_2 | date('Y-m-d') }}" make_link: false path: '' absolute: false diff --git a/modules/custom/az_opportunity/config/install/core.entity_form_display.node.az_opportunity.default.yml b/modules/custom/az_opportunity/config/install/core.entity_form_display.node.az_opportunity.default.yml index 7bf1f633e2..5fff77627e 100644 --- a/modules/custom/az_opportunity/config/install/core.entity_form_display.node.az_opportunity.default.yml +++ b/modules/custom/az_opportunity/config/install/core.entity_form_display.node.az_opportunity.default.yml @@ -12,7 +12,6 @@ dependencies: - field.field.node.az_opportunity.field_az_ongoing - field.field.node.az_opportunity.field_az_opportunity_category - field.field.node.az_opportunity.field_az_opportunity_credit - - field.field.node.az_opportunity.field_az_opportunity_format - field.field.node.az_opportunity.field_az_opportunity_location - field.field.node.az_opportunity.field_az_parent_account - field.field.node.az_opportunity.field_az_program_date @@ -95,6 +94,7 @@ content: allowed_attributes: Audiences__c: Audiences__c Event_Format__c: Event_Format__c + Program_Type__c: Program_Type__c Topic__c: Topic__c Arizona_County__c: 0 Category1__c: 0 @@ -256,5 +256,4 @@ content: region: content settings: { } third_party_settings: { } -hidden: - field_az_opportunity_format: true +hidden: { } diff --git a/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_card.yml b/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_card.yml index 250bc82a15..a055c7055a 100644 --- a/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_card.yml +++ b/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_card.yml @@ -13,7 +13,6 @@ dependencies: - field.field.node.az_opportunity.field_az_ongoing - field.field.node.az_opportunity.field_az_opportunity_category - field.field.node.az_opportunity.field_az_opportunity_credit - - field.field.node.az_opportunity.field_az_opportunity_format - field.field.node.az_opportunity.field_az_opportunity_location - field.field.node.az_opportunity.field_az_parent_account - field.field.node.az_opportunity.field_az_program_date @@ -383,7 +382,6 @@ hidden: field_az_ongoing: true field_az_opportunity_category: true field_az_opportunity_credit: true - field_az_opportunity_format: true field_az_program_date: true field_az_program_length: true field_az_program_website: true diff --git a/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_row.yml b/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_row.yml index e4dc40e57c..7a638b3236 100644 --- a/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_row.yml +++ b/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_row.yml @@ -13,7 +13,6 @@ dependencies: - field.field.node.az_opportunity.field_az_ongoing - field.field.node.az_opportunity.field_az_opportunity_category - field.field.node.az_opportunity.field_az_opportunity_credit - - field.field.node.az_opportunity.field_az_opportunity_format - field.field.node.az_opportunity.field_az_opportunity_location - field.field.node.az_opportunity.field_az_parent_account - field.field.node.az_opportunity.field_az_program_date @@ -233,7 +232,6 @@ hidden: field_az_ongoing: true field_az_opportunity_category: true field_az_opportunity_credit: true - field_az_opportunity_format: true field_az_parent_account: true field_az_program_length: true field_az_program_website: true diff --git a/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_row_with_background.yml b/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_row_with_background.yml index 0bb95e2467..ce2f91ba3f 100644 --- a/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_row_with_background.yml +++ b/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_row_with_background.yml @@ -13,7 +13,6 @@ dependencies: - field.field.node.az_opportunity.field_az_ongoing - field.field.node.az_opportunity.field_az_opportunity_category - field.field.node.az_opportunity.field_az_opportunity_credit - - field.field.node.az_opportunity.field_az_opportunity_format - field.field.node.az_opportunity.field_az_opportunity_location - field.field.node.az_opportunity.field_az_parent_account - field.field.node.az_opportunity.field_az_program_date @@ -45,7 +44,6 @@ hidden: field_az_ongoing: true field_az_opportunity_category: true field_az_opportunity_credit: true - field_az_opportunity_format: true field_az_opportunity_location: true field_az_parent_account: true field_az_program_date: true diff --git a/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_small_row.yml b/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_small_row.yml index 01142f2481..80576f4d67 100644 --- a/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_small_row.yml +++ b/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_small_row.yml @@ -13,7 +13,6 @@ dependencies: - field.field.node.az_opportunity.field_az_ongoing - field.field.node.az_opportunity.field_az_opportunity_category - field.field.node.az_opportunity.field_az_opportunity_credit - - field.field.node.az_opportunity.field_az_opportunity_format - field.field.node.az_opportunity.field_az_opportunity_location - field.field.node.az_opportunity.field_az_parent_account - field.field.node.az_opportunity.field_az_program_date @@ -245,7 +244,6 @@ hidden: field_az_ongoing: true field_az_opportunity_category: true field_az_opportunity_credit: true - field_az_opportunity_format: true field_az_opportunity_location: true field_az_parent_account: true field_az_program_date: true diff --git a/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.default.yml b/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.default.yml index 59f9a6ee0c..66b392a326 100644 --- a/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.default.yml +++ b/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.default.yml @@ -12,7 +12,6 @@ dependencies: - field.field.node.az_opportunity.field_az_ongoing - field.field.node.az_opportunity.field_az_opportunity_category - field.field.node.az_opportunity.field_az_opportunity_credit - - field.field.node.az_opportunity.field_az_opportunity_format - field.field.node.az_opportunity.field_az_opportunity_location - field.field.node.az_opportunity.field_az_parent_account - field.field.node.az_opportunity.field_az_program_date @@ -451,13 +450,6 @@ content: third_party_settings: { } weight: 19 region: content - field_az_opportunity_format: - type: list_default - label: hidden - settings: { } - third_party_settings: { } - weight: 5 - region: content field_az_opportunity_location: type: string label: hidden diff --git a/modules/custom/az_opportunity/config/install/core.entity_view_display.taxonomy_term.az_opportunity_audience.default.yml b/modules/custom/az_opportunity/config/install/core.entity_view_display.taxonomy_term.az_opportunity_audience.default.yml deleted file mode 100644 index f7bcb871e6..0000000000 --- a/modules/custom/az_opportunity/config/install/core.entity_view_display.taxonomy_term.az_opportunity_audience.default.yml +++ /dev/null @@ -1 +0,0 @@ -{ } \ No newline at end of file diff --git a/modules/custom/az_opportunity/config/install/core.entity_view_display.taxonomy_term.az_opportunity_modality.default.yml b/modules/custom/az_opportunity/config/install/core.entity_view_display.taxonomy_term.az_opportunity_modality.default.yml deleted file mode 100644 index f7bcb871e6..0000000000 --- a/modules/custom/az_opportunity/config/install/core.entity_view_display.taxonomy_term.az_opportunity_modality.default.yml +++ /dev/null @@ -1 +0,0 @@ -{ } \ No newline at end of file diff --git a/modules/custom/az_opportunity/config/install/core.entity_view_display.taxonomy_term.az_opportunity_topic.az_badge.yml b/modules/custom/az_opportunity/config/install/core.entity_view_display.taxonomy_term.az_opportunity_topic.az_badge.yml deleted file mode 100644 index f7bcb871e6..0000000000 --- a/modules/custom/az_opportunity/config/install/core.entity_view_display.taxonomy_term.az_opportunity_topic.az_badge.yml +++ /dev/null @@ -1 +0,0 @@ -{ } \ No newline at end of file diff --git a/modules/custom/az_opportunity/config/install/core.entity_view_display.taxonomy_term.az_opportunity_type.az_badge.yml b/modules/custom/az_opportunity/config/install/core.entity_view_display.taxonomy_term.az_opportunity_type.az_badge.yml deleted file mode 100644 index f7bcb871e6..0000000000 --- a/modules/custom/az_opportunity/config/install/core.entity_view_display.taxonomy_term.az_opportunity_type.az_badge.yml +++ /dev/null @@ -1 +0,0 @@ -{ } \ No newline at end of file diff --git a/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_attachments.yml b/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_attachments.yml deleted file mode 100644 index 6578fd5a5c..0000000000 --- a/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_attachments.yml +++ /dev/null @@ -1 +0,0 @@ -{ } diff --git a/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_audiences.yml b/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_audiences.yml deleted file mode 100644 index f7bcb871e6..0000000000 --- a/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_audiences.yml +++ /dev/null @@ -1 +0,0 @@ -{ } \ No newline at end of file diff --git a/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_credit.yml b/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_credit.yml deleted file mode 100644 index f7bcb871e6..0000000000 --- a/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_credit.yml +++ /dev/null @@ -1 +0,0 @@ -{ } \ No newline at end of file diff --git a/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_location.yml b/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_location.yml deleted file mode 100644 index 6578fd5a5c..0000000000 --- a/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_location.yml +++ /dev/null @@ -1 +0,0 @@ -{ } diff --git a/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_media_image.yml b/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_media_image.yml deleted file mode 100644 index 6578fd5a5c..0000000000 --- a/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_media_image.yml +++ /dev/null @@ -1 +0,0 @@ -{ } diff --git a/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_modality.yml b/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_modality.yml deleted file mode 100644 index f7bcb871e6..0000000000 --- a/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_modality.yml +++ /dev/null @@ -1 +0,0 @@ -{ } \ No newline at end of file diff --git a/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_opportunity_format.yml b/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_opportunity_format.yml deleted file mode 100644 index c89cc57ac8..0000000000 --- a/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_opportunity_format.yml +++ /dev/null @@ -1,20 +0,0 @@ -langcode: en -status: true -dependencies: - config: - - field.storage.node.field_az_opportunity_format - - node.type.az_opportunity - module: - - options -id: node.az_opportunity.field_az_opportunity_format -field_name: field_az_opportunity_format -entity_type: node -bundle: az_opportunity -label: 'Opportunity Format' -description: '' -required: false -translatable: false -default_value: { } -default_value_callback: '' -settings: { } -field_type: list_string diff --git a/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_opportunity_type.yml b/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_opportunity_type.yml deleted file mode 100644 index f7bcb871e6..0000000000 --- a/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_opportunity_type.yml +++ /dev/null @@ -1 +0,0 @@ -{ } \ No newline at end of file diff --git a/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_start_options.yml b/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_start_options.yml deleted file mode 100644 index 6578fd5a5c..0000000000 --- a/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_start_options.yml +++ /dev/null @@ -1 +0,0 @@ -{ } diff --git a/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_topic.yml b/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_topic.yml deleted file mode 100644 index f7bcb871e6..0000000000 --- a/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_az_topic.yml +++ /dev/null @@ -1 +0,0 @@ -{ } \ No newline at end of file diff --git a/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_opportunity_attachments.yml b/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_opportunity_attachments.yml deleted file mode 100644 index 6578fd5a5c..0000000000 --- a/modules/custom/az_opportunity/config/install/field.field.node.az_opportunity.field_opportunity_attachments.yml +++ /dev/null @@ -1 +0,0 @@ -{ } diff --git a/modules/custom/az_opportunity/config/install/field.storage.node.field_az_audiences.yml b/modules/custom/az_opportunity/config/install/field.storage.node.field_az_audiences.yml deleted file mode 100644 index f7bcb871e6..0000000000 --- a/modules/custom/az_opportunity/config/install/field.storage.node.field_az_audiences.yml +++ /dev/null @@ -1 +0,0 @@ -{ } \ No newline at end of file diff --git a/modules/custom/az_opportunity/config/install/field.storage.node.field_az_credit.yml b/modules/custom/az_opportunity/config/install/field.storage.node.field_az_credit.yml deleted file mode 100644 index f7bcb871e6..0000000000 --- a/modules/custom/az_opportunity/config/install/field.storage.node.field_az_credit.yml +++ /dev/null @@ -1 +0,0 @@ -{ } \ No newline at end of file diff --git a/modules/custom/az_opportunity/config/install/field.storage.node.field_az_modality.yml b/modules/custom/az_opportunity/config/install/field.storage.node.field_az_modality.yml deleted file mode 100644 index f7bcb871e6..0000000000 --- a/modules/custom/az_opportunity/config/install/field.storage.node.field_az_modality.yml +++ /dev/null @@ -1 +0,0 @@ -{ } \ No newline at end of file diff --git a/modules/custom/az_opportunity/config/install/field.storage.node.field_az_opportunity_format.yml b/modules/custom/az_opportunity/config/install/field.storage.node.field_az_opportunity_format.yml deleted file mode 100644 index 0f03d46603..0000000000 --- a/modules/custom/az_opportunity/config/install/field.storage.node.field_az_opportunity_format.yml +++ /dev/null @@ -1,29 +0,0 @@ -langcode: en -status: true -dependencies: - module: - - node - - options -id: node.field_az_opportunity_format -field_name: field_az_opportunity_format -entity_type: node -type: list_string -settings: - allowed_values: - - - value: virtual - label: Virtual - - - value: hybrid - label: Hybrid - - - value: in_person - label: 'In Person' - allowed_values_function: '' -module: options -locked: false -cardinality: 1 -translatable: true -indexes: { } -persist_with_no_fields: false -custom_storage: false diff --git a/modules/custom/az_opportunity/config/install/field.storage.node.field_az_opportunity_type.yml b/modules/custom/az_opportunity/config/install/field.storage.node.field_az_opportunity_type.yml deleted file mode 100644 index f7bcb871e6..0000000000 --- a/modules/custom/az_opportunity/config/install/field.storage.node.field_az_opportunity_type.yml +++ /dev/null @@ -1 +0,0 @@ -{ } \ No newline at end of file diff --git a/modules/custom/az_opportunity/config/install/field.storage.node.field_az_start_options.yml b/modules/custom/az_opportunity/config/install/field.storage.node.field_az_start_options.yml deleted file mode 100644 index 6578fd5a5c..0000000000 --- a/modules/custom/az_opportunity/config/install/field.storage.node.field_az_start_options.yml +++ /dev/null @@ -1 +0,0 @@ -{ } diff --git a/modules/custom/az_opportunity/config/install/field.storage.node.field_az_topic.yml b/modules/custom/az_opportunity/config/install/field.storage.node.field_az_topic.yml deleted file mode 100644 index f7bcb871e6..0000000000 --- a/modules/custom/az_opportunity/config/install/field.storage.node.field_az_topic.yml +++ /dev/null @@ -1 +0,0 @@ -{ } \ No newline at end of file diff --git a/modules/custom/az_opportunity/config/install/field.storage.node.field_opportunity_attachments.yml b/modules/custom/az_opportunity/config/install/field.storage.node.field_opportunity_attachments.yml deleted file mode 100644 index 6578fd5a5c..0000000000 --- a/modules/custom/az_opportunity/config/install/field.storage.node.field_opportunity_attachments.yml +++ /dev/null @@ -1 +0,0 @@ -{ } diff --git a/modules/custom/az_opportunity/config/install/taxonomy.vocabulary.az_opportunity_audience.yml b/modules/custom/az_opportunity/config/install/taxonomy.vocabulary.az_opportunity_audience.yml deleted file mode 100644 index f7bcb871e6..0000000000 --- a/modules/custom/az_opportunity/config/install/taxonomy.vocabulary.az_opportunity_audience.yml +++ /dev/null @@ -1 +0,0 @@ -{ } \ No newline at end of file diff --git a/modules/custom/az_opportunity/config/install/taxonomy.vocabulary.az_opportunity_credit.yml b/modules/custom/az_opportunity/config/install/taxonomy.vocabulary.az_opportunity_credit.yml deleted file mode 100644 index 6578fd5a5c..0000000000 --- a/modules/custom/az_opportunity/config/install/taxonomy.vocabulary.az_opportunity_credit.yml +++ /dev/null @@ -1 +0,0 @@ -{ } diff --git a/modules/custom/az_opportunity/config/install/taxonomy.vocabulary.az_opportunity_modality.yml b/modules/custom/az_opportunity/config/install/taxonomy.vocabulary.az_opportunity_modality.yml deleted file mode 100644 index f7bcb871e6..0000000000 --- a/modules/custom/az_opportunity/config/install/taxonomy.vocabulary.az_opportunity_modality.yml +++ /dev/null @@ -1 +0,0 @@ -{ } \ No newline at end of file diff --git a/modules/custom/az_opportunity/config/install/taxonomy.vocabulary.az_opportunity_topic.yml b/modules/custom/az_opportunity/config/install/taxonomy.vocabulary.az_opportunity_topic.yml deleted file mode 100644 index f7bcb871e6..0000000000 --- a/modules/custom/az_opportunity/config/install/taxonomy.vocabulary.az_opportunity_topic.yml +++ /dev/null @@ -1 +0,0 @@ -{ } \ No newline at end of file diff --git a/modules/custom/az_opportunity/config/install/taxonomy.vocabulary.az_opportunity_type.yml b/modules/custom/az_opportunity/config/install/taxonomy.vocabulary.az_opportunity_type.yml deleted file mode 100644 index f7bcb871e6..0000000000 --- a/modules/custom/az_opportunity/config/install/taxonomy.vocabulary.az_opportunity_type.yml +++ /dev/null @@ -1 +0,0 @@ -{ } \ No newline at end of file From f9a8ec412273ebaf6d803fe34b3e7b307ce89318 Mon Sep 17 00:00:00 2001 From: Z Saenz Date: Fri, 3 Apr 2026 09:10:40 -0700 Subject: [PATCH 29/59] Fixes empty attribute issue with AI --- .../az_opportunity_trellis.settings.yml | 2 +- ...ews.view.az_opportunity_trellis_import.yml | 160 ++++++++++++++++++ .../src/Entity/AZRecurringImportRule.php | 10 +- .../src/Form/AZRecurringImportRuleForm.php | 93 +++++----- .../src/TrellisHelper.php | 21 ++- 5 files changed, 237 insertions(+), 49 deletions(-) diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/config/install/az_opportunity_trellis.settings.yml b/modules/custom/az_opportunity/az_opportunity_trellis/config/install/az_opportunity_trellis.settings.yml index 64c46470c0..f0aedb5998 100644 --- a/modules/custom/az_opportunity/az_opportunity_trellis/config/install/az_opportunity_trellis.settings.yml +++ b/modules/custom/az_opportunity/az_opportunity_trellis/config/install/az_opportunity_trellis.settings.yml @@ -1 +1 @@ -api_hostname: 'api.qa.eips.arizona.edu' \ No newline at end of file +api_hostname: 'api.eips.arizona.edu' \ No newline at end of file diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/config/install/views.view.az_opportunity_trellis_import.yml b/modules/custom/az_opportunity/az_opportunity_trellis/config/install/views.view.az_opportunity_trellis_import.yml index be514f2aa2..edf88609dc 100644 --- a/modules/custom/az_opportunity/az_opportunity_trellis/config/install/views.view.az_opportunity_trellis_import.yml +++ b/modules/custom/az_opportunity/az_opportunity_trellis/config/install/views.view.az_opportunity_trellis_import.yml @@ -749,6 +749,166 @@ display: default_group_multiple: { } group_items: { } property_path: keyword + Attributes: + id: Attributes + table: az_opportunity_trellis_data + field: Attributes + relationship: none + group_type: group + admin_label: '' + plugin_id: az_opportunity_trellis_views_attribute_filter + operator: '=' + value: '' + group: 1 + exposed: true + expose: + operator_id: Attributes_op + label: Audience + description: '' + use_operator: false + operator: Attributes_op + operator_limit_selection: false + operator_list: { } + identifier: audience + required: false + remember: false + multiple: false + remember_roles: + authenticated: authenticated + is_grouped: false + group_info: + label: '' + description: '' + identifier: '' + optional: true + widget: select + multiple: false + remember: false + default_group: All + default_group_multiple: { } + group_items: { } + property_path: audience + az_attribute_key: Audiences__c + Attributes_1: + id: Attributes_1 + table: az_opportunity_trellis_data + field: Attributes + relationship: none + group_type: group + admin_label: '' + plugin_id: az_opportunity_trellis_views_attribute_filter + operator: '=' + value: '' + group: 1 + exposed: true + expose: + operator_id: Attributes_1_op + label: Topic + description: '' + use_operator: false + operator: Attributes_1_op + operator_limit_selection: false + operator_list: { } + identifier: topic + required: false + remember: false + multiple: false + remember_roles: + authenticated: authenticated + is_grouped: false + group_info: + label: '' + description: '' + identifier: '' + optional: true + widget: select + multiple: false + remember: false + default_group: All + default_group_multiple: { } + group_items: { } + property_path: topic + az_attribute_key: Topic__c + Attributes_2: + id: Attributes_2 + table: az_opportunity_trellis_data + field: Attributes + relationship: none + group_type: group + admin_label: '' + plugin_id: az_opportunity_trellis_views_attribute_filter + operator: '=' + value: '' + group: 1 + exposed: true + expose: + operator_id: Attributes_2_op + label: Category + description: '' + use_operator: false + operator: Attributes_2_op + operator_limit_selection: false + operator_list: { } + identifier: category + required: false + remember: false + multiple: false + remember_roles: + authenticated: authenticated + is_grouped: false + group_info: + label: '' + description: '' + identifier: '' + optional: true + widget: select + multiple: false + remember: false + default_group: All + default_group_multiple: { } + group_items: { } + property_path: category + az_attribute_key: Category1__c + Attributes_3: + id: Attributes_3 + table: az_opportunity_trellis_data + field: Attributes + relationship: none + group_type: group + admin_label: '' + plugin_id: az_opportunity_trellis_views_attribute_filter + operator: '=' + value: '' + group: 1 + exposed: true + expose: + operator_id: Attributes_3_op + label: Format + description: '' + use_operator: false + operator: Attributes_3_op + operator_limit_selection: false + operator_list: { } + identifier: format + required: false + remember: false + multiple: false + remember_roles: + authenticated: authenticated + is_grouped: false + group_info: + label: '' + description: '' + identifier: '' + optional: true + widget: select + multiple: false + remember: false + default_group: All + default_group_multiple: { } + group_items: { } + property_path: format + az_attribute_key: Event_Format__c filter_groups: operator: AND groups: diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/src/Entity/AZRecurringImportRule.php b/modules/custom/az_opportunity/az_opportunity_trellis/src/Entity/AZRecurringImportRule.php index 0da25b2bb5..81c2267f30 100644 --- a/modules/custom/az_opportunity/az_opportunity_trellis/src/Entity/AZRecurringImportRule.php +++ b/modules/custom/az_opportunity/az_opportunity_trellis/src/Entity/AZRecurringImportRule.php @@ -50,10 +50,10 @@ 'id', 'label', 'owner', - 'host', +// 'host', 'keyword', 'attributes', - 'approval', +// 'approval', ], )] final class AZRecurringImportRule extends ConfigEntityBase implements AZRecurringImportRuleInterface { @@ -81,7 +81,7 @@ final class AZRecurringImportRule extends ConfigEntityBase implements AZRecurrin /** * The az_recurring_import_rule owner. */ - protected string $host; + //protected string $host; /** * The az_recurring_import_rule enterprise attributes. @@ -105,8 +105,8 @@ public function getQueryParameters() { $params += $attributes; $params['keyword'] = $this->get('keyword') ?? ''; $params['owner'] = $this->get('owner') ?? ''; - $params['host'] = $this->get('host') ?? ''; - $params['approval'] = $this->get('approval') ?? ''; + // $params['host'] = $this->get('host') ?? ''; + // $params['approval'] = $this->get('approval') ?? ''; $params = array_filter($params); return $params; } diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/src/Form/AZRecurringImportRuleForm.php b/modules/custom/az_opportunity/az_opportunity_trellis/src/Form/AZRecurringImportRuleForm.php index f05077959b..bb67610de7 100644 --- a/modules/custom/az_opportunity/az_opportunity_trellis/src/Form/AZRecurringImportRuleForm.php +++ b/modules/custom/az_opportunity/az_opportunity_trellis/src/Form/AZRecurringImportRuleForm.php @@ -88,60 +88,69 @@ public function form(array $form, FormStateInterface $form_state): array { '#default_value' => $entity->get('owner'), ]; - $form['query_parameters']['keyword'] = [ - '#type' => 'textfield', - '#title' => $this->t('Keyword'), - '#maxlength' => 255, - '#default_value' => $entity->get('keyword'), - ]; $form['query_parameters']['attributes']['#tree'] = TRUE; - // Get the different attributes available. - $term_storage = $this->entityTypeManager->getStorage('taxonomy_term'); - $query = $term_storage->getQuery() - ->accessCheck(TRUE) - ->addTag('taxonomy_term_access') - ->condition('vid', 'az_enterprise_attributes') - ->condition('parent', 0) - ->sort('name') - // Only fetch attributes that have an API mapping. - ->condition('field_az_attribute_key', array_keys($mappings), 'IN'); - $attributes = $query->execute(); - $attributes = $term_storage->loadMultiple($attributes); - - // Build attribute select lists. - foreach ($attributes as $attribute) { - $options = []; - $key = $mappings[$attribute->field_az_attribute_key->value]; - $id = $attribute->id(); - - // Find the options the attribute has, in order. + if (!empty($mappings)) { + // Get the different attributes available. + $term_storage = $this->entityTypeManager->getStorage('taxonomy_term'); $query = $term_storage->getQuery() ->accessCheck(TRUE) ->addTag('taxonomy_term_access') ->condition('vid', 'az_enterprise_attributes') - ->condition('parent', $id) + ->condition('parent', 0) ->sort('name') - ->condition('field_az_attribute_key', '', '<>'); - $terms = $query->execute(); - $terms = $term_storage->loadMultiple($terms); - foreach ($terms as $term) { - $options[$term->field_az_attribute_key->value] = $this->entityRepository->getTranslationFromContext($term)->label(); + // Only fetch attributes that have an API mapping. + ->condition('field_az_attribute_key', array_keys($mappings), 'IN'); + $attributes = $query->execute(); + $attributes = $term_storage->loadMultiple($attributes); + + // Build attribute select lists. + foreach ($attributes as $attribute) { + $options = []; + $key = $mappings[$attribute->field_az_attribute_key->value]; + $id = $attribute->id(); + + // Find the options the attribute has, in order. + $query = $term_storage->getQuery() + ->accessCheck(TRUE) + ->addTag('taxonomy_term_access') + ->condition('vid', 'az_enterprise_attributes') + ->condition('parent', $id) + ->sort('name') + ->condition('field_az_attribute_key', '', '<>'); + $terms = $query->execute(); + $terms = $term_storage->loadMultiple($terms); + foreach ($terms as $term) { + $options[$term->field_az_attribute_key->value] = $this->entityRepository->getTranslationFromContext($term)->label(); + } + + // Build the select element for the attribute. + $form['query_parameters']['attributes'][$key] = [ + '#type' => 'select', + '#options' => $options, + '#empty_option' => $this->t('- Any -'), + '#empty_value' => '', + '#title' => $this->entityRepository->getTranslationFromContext($attribute)->label(), + '#required' => FALSE, + '#default_value' => $entity->get('attributes')[$key] ?? NULL, + ]; } - - // Build the select element for the attribute. - $form['query_parameters']['attributes'][$key] = [ - '#type' => 'select', - '#options' => $options, - '#empty_option' => $this->t('- Any -'), - '#empty_value' => '', - '#title' => $this->entityRepository->getTranslationFromContext($attribute)->label(), - '#required' => FALSE, - '#default_value' => $entity->get('attributes')[$key] ?? NULL, + } + else { + $form['query_parameters']['attributes']['empty'] = [ + '#type' => 'item', + '#markup' => $this->t('No mapped enterprise attributes found, so the attribute controls are unavailable.'), ]; } + $form['query_parameters']['keyword'] = [ + '#type' => 'textfield', + '#title' => $this->t('Keyword'), + '#maxlength' => 255, + '#default_value' => $entity->get('keyword'), + ]; + return $form; } diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/src/TrellisHelper.php b/modules/custom/az_opportunity/az_opportunity_trellis/src/TrellisHelper.php index 9cc8eaa657..19ffa2cc6b 100644 --- a/modules/custom/az_opportunity/az_opportunity_trellis/src/TrellisHelper.php +++ b/modules/custom/az_opportunity/az_opportunity_trellis/src/TrellisHelper.php @@ -231,14 +231,33 @@ public function getRecurringOpportunityIds() { */ public function getAttributeMappings() { $mappings = []; + $view = Views::getView('az_opportunity_trellis_import'); - $display = $view->getDisplay() ?? NULL; + if (!$view) { + return $mappings; + } + + // Ensure we are on a display that has filter handlers. + if (!$view->getDisplay()) { + $display_id = $view->current_display ?? 'default'; + if (!$display_id) { + $display_id = 'default'; + } + $view->setDisplay($display_id); + } + + $display = $view->getDisplay(); + if (!$display) { + return $mappings; + } + $filters = $display->getHandlers('filter'); foreach ($filters as $filter) { if ($filter instanceof AZOpportunityTrellisViewsAttributeFilter) { $mappings += $filter->getApiMapping(); } } + return $mappings; } From ddcb9fa8ffce1374c4b83d041011da5b787b8bd0 Mon Sep 17 00:00:00 2001 From: Z Saenz Date: Fri, 3 Apr 2026 15:01:14 -0700 Subject: [PATCH 30/59] Fixes double routing, adds parent account name --- .../az_opportunity_trellis.links.task.yml | 2 +- .../az_opportunity_trellis.routing.yml | 8 +- ...ews.view.az_opportunity_trellis_import.yml | 170 +----------------- .../schema/az_opportunity_trellis.schema.yml | 2 + .../src/Entity/AZRecurringImportRule.php | 15 +- .../src/Form/AZRecurringImportRuleForm.php | 21 ++- 6 files changed, 36 insertions(+), 182 deletions(-) diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.links.task.yml b/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.links.task.yml index 255bb688e9..ca44b1604c 100644 --- a/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.links.task.yml +++ b/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.links.task.yml @@ -13,6 +13,6 @@ az_opportunity.import_form_task: az_opportunity_trellis.az_recurring_import_rules_tab: route_name: entity.az_recurring_import_rule.collection - title: 'Recurring Imports' + title: 'Recurring Opportunity Imports' base_route: az_core.az_settings weight: 5 diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.routing.yml b/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.routing.yml index 607ac65714..77c5fe6d30 100644 --- a/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.routing.yml +++ b/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.routing.yml @@ -7,7 +7,7 @@ az_opportunity_trellis.settings: _permission: 'administer quickstart configuration' entity.az_recurring_import_rule.collection: - path: '/admin/config/az-quickstart/settings/az-recurring-import-rule' + path: '/admin/config/az-quickstart/settings/az-opportunity-recurring-import-rule' defaults: _entity_list: 'az_recurring_import_rule' _title: 'Recurring Import Rule configuration' @@ -15,7 +15,7 @@ entity.az_recurring_import_rule.collection: _permission: 'administer quickstart configuration' entity.az_recurring_import_rule.add_form: - path: '/admin/config/az-quickstart/settings/az-recurring-import-rule/add' + path: '/admin/config/az-quickstart/settings/az-opportunity-recurring-import-rule/add' defaults: _entity_form: 'az_recurring_import_rule.add' _title: 'Add a recurring import rule' @@ -23,7 +23,7 @@ entity.az_recurring_import_rule.add_form: _permission: 'administer quickstart configuration' entity.az_recurring_import_rule.edit_form: - path: '/admin/config/az-quickstart/settings/az-recurring-import-rule/{az_recurring_import_rule}' + path: '/admin/config/az-quickstart/settings/az-opportunity-recurring-import-rule/{az_recurring_import_rule}' defaults: _entity_form: 'az_recurring_import_rule.edit' _title: 'Edit a recurring import rule' @@ -31,7 +31,7 @@ entity.az_recurring_import_rule.edit_form: _permission: 'administer quickstart configuration' entity.az_recurring_import_rule.delete_form: - path: '/admin/config/az-quickstart/settings/az-recurring-import-rule/{az_recurring_import_rule}/delete' + path: '/admin/config/az-quickstart/settings/az-opportunity-recurring-import-rule/{az_recurring_import_rule}/delete' defaults: _entity_form: 'az_recurring_import_rule.delete' _title: 'Delete a recurring import rule' diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/config/install/views.view.az_opportunity_trellis_import.yml b/modules/custom/az_opportunity/az_opportunity_trellis/config/install/views.view.az_opportunity_trellis_import.yml index edf88609dc..48fea52b7d 100644 --- a/modules/custom/az_opportunity/az_opportunity_trellis/config/install/views.view.az_opportunity_trellis_import.yml +++ b/modules/custom/az_opportunity/az_opportunity_trellis/config/install/views.view.az_opportunity_trellis_import.yml @@ -574,7 +574,7 @@ display: operator: property_1_op operator_limit_selection: false operator_list: { } - identifier: property_1 + identifier: owner required: false remember: false multiple: false @@ -685,13 +685,13 @@ display: exposed: true expose: operator_id: property_4_op - label: 'Parent Account' + label: 'Parent Account Name' description: '' use_operator: false operator: property_4_op operator_limit_selection: false operator_list: { } - identifier: property_4 + identifier: parent_account_name required: false remember: false multiple: false @@ -709,7 +709,7 @@ display: default_group: All default_group_multiple: { } group_items: { } - property_path: parent_account + property_path: parent_account_name property_5: id: property_5 table: az_opportunity_trellis_data @@ -730,7 +730,7 @@ display: operator: property_5_op operator_limit_selection: false operator_list: { } - identifier: property_5 + identifier: keyword required: false remember: false multiple: false @@ -749,166 +749,6 @@ display: default_group_multiple: { } group_items: { } property_path: keyword - Attributes: - id: Attributes - table: az_opportunity_trellis_data - field: Attributes - relationship: none - group_type: group - admin_label: '' - plugin_id: az_opportunity_trellis_views_attribute_filter - operator: '=' - value: '' - group: 1 - exposed: true - expose: - operator_id: Attributes_op - label: Audience - description: '' - use_operator: false - operator: Attributes_op - operator_limit_selection: false - operator_list: { } - identifier: audience - required: false - remember: false - multiple: false - remember_roles: - authenticated: authenticated - is_grouped: false - group_info: - label: '' - description: '' - identifier: '' - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: { } - property_path: audience - az_attribute_key: Audiences__c - Attributes_1: - id: Attributes_1 - table: az_opportunity_trellis_data - field: Attributes - relationship: none - group_type: group - admin_label: '' - plugin_id: az_opportunity_trellis_views_attribute_filter - operator: '=' - value: '' - group: 1 - exposed: true - expose: - operator_id: Attributes_1_op - label: Topic - description: '' - use_operator: false - operator: Attributes_1_op - operator_limit_selection: false - operator_list: { } - identifier: topic - required: false - remember: false - multiple: false - remember_roles: - authenticated: authenticated - is_grouped: false - group_info: - label: '' - description: '' - identifier: '' - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: { } - property_path: topic - az_attribute_key: Topic__c - Attributes_2: - id: Attributes_2 - table: az_opportunity_trellis_data - field: Attributes - relationship: none - group_type: group - admin_label: '' - plugin_id: az_opportunity_trellis_views_attribute_filter - operator: '=' - value: '' - group: 1 - exposed: true - expose: - operator_id: Attributes_2_op - label: Category - description: '' - use_operator: false - operator: Attributes_2_op - operator_limit_selection: false - operator_list: { } - identifier: category - required: false - remember: false - multiple: false - remember_roles: - authenticated: authenticated - is_grouped: false - group_info: - label: '' - description: '' - identifier: '' - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: { } - property_path: category - az_attribute_key: Category1__c - Attributes_3: - id: Attributes_3 - table: az_opportunity_trellis_data - field: Attributes - relationship: none - group_type: group - admin_label: '' - plugin_id: az_opportunity_trellis_views_attribute_filter - operator: '=' - value: '' - group: 1 - exposed: true - expose: - operator_id: Attributes_3_op - label: Format - description: '' - use_operator: false - operator: Attributes_3_op - operator_limit_selection: false - operator_list: { } - identifier: format - required: false - remember: false - multiple: false - remember_roles: - authenticated: authenticated - is_grouped: false - group_info: - label: '' - description: '' - identifier: '' - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: { } - property_path: format - az_attribute_key: Event_Format__c filter_groups: operator: AND groups: diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/config/schema/az_opportunity_trellis.schema.yml b/modules/custom/az_opportunity/az_opportunity_trellis/config/schema/az_opportunity_trellis.schema.yml index 576f05a01c..16876a851f 100644 --- a/modules/custom/az_opportunity/az_opportunity_trellis/config/schema/az_opportunity_trellis.schema.yml +++ b/modules/custom/az_opportunity/az_opportunity_trellis/config/schema/az_opportunity_trellis.schema.yml @@ -29,6 +29,8 @@ az_opportunity_trellis.az_recurring_import_rule.*: type: string keyword: type: string + parent_account_name: + type: string attributes: type: sequence label: ‘Enterprise Attributes’ diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/src/Entity/AZRecurringImportRule.php b/modules/custom/az_opportunity/az_opportunity_trellis/src/Entity/AZRecurringImportRule.php index 81c2267f30..c8963670f6 100644 --- a/modules/custom/az_opportunity/az_opportunity_trellis/src/Entity/AZRecurringImportRule.php +++ b/modules/custom/az_opportunity/az_opportunity_trellis/src/Entity/AZRecurringImportRule.php @@ -36,10 +36,10 @@ 'plural' => '@count recurring import rules', ], links: [ - 'collection' => '/admin/config/az-quickstart/settings/az-recurring-import-rule', - 'add-form' => '/admin/config/az-quickstart/settings/az-recurring-import-rule/add', - 'edit-form' => '/admin/config/az-quickstart/settings/az-recurring-import-rule/{az_recurring_import_rule}', - 'delete-form' => '/admin/config/az-quickstart/settings/az-recurring-import-rule/{az_recurring_import_rule}/delete', + 'collection' => '/admin/config/az-quickstart/settings/az-opportunity-recurring-import-rule', + 'add-form' => '/admin/config/az-quickstart/settings/az-opportunity-recurring-import-rule/add', + 'edit-form' => '/admin/config/az-quickstart/settings/az-opportunity-recurring-import-rule/{az_recurring_import_rule}', + 'delete-form' => '/admin/config/az-quickstart/settings/az-opportunity-recurring-import-rule/{az_recurring_import_rule}/delete', ], entity_keys: [ 'id' => 'id', @@ -53,6 +53,7 @@ // 'host', 'keyword', 'attributes', + 'parent_account_name', // 'approval', ], )] @@ -93,6 +94,11 @@ final class AZRecurringImportRule extends ConfigEntityBase implements AZRecurrin */ protected string $approval; + /** + * The az_recurring_import_rule parent account name. + */ + protected string $parent_account_name; + /** * {@inheritdoc} */ @@ -105,6 +111,7 @@ public function getQueryParameters() { $params += $attributes; $params['keyword'] = $this->get('keyword') ?? ''; $params['owner'] = $this->get('owner') ?? ''; + $params['parent_account_name'] = $this->get('parent_account_name') ?? ''; // $params['host'] = $this->get('host') ?? ''; // $params['approval'] = $this->get('approval') ?? ''; $params = array_filter($params); diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/src/Form/AZRecurringImportRuleForm.php b/modules/custom/az_opportunity/az_opportunity_trellis/src/Form/AZRecurringImportRuleForm.php index bb67610de7..7306f4b08e 100644 --- a/modules/custom/az_opportunity/az_opportunity_trellis/src/Form/AZRecurringImportRuleForm.php +++ b/modules/custom/az_opportunity/az_opportunity_trellis/src/Form/AZRecurringImportRuleForm.php @@ -88,6 +88,19 @@ public function form(array $form, FormStateInterface $form_state): array { '#default_value' => $entity->get('owner'), ]; + $form['query_parameters']['keyword'] = [ // cut from line 146 + '#type' => 'textfield', + '#title' => $this->t('Keyword'), + '#maxlength' => 255, + '#default_value' => $entity->get('keyword'), + ]; + + $form['query_parameters']['parent_account_name'] = [ + '#type' => 'textfield', + '#title' => $this->t('Parent Account'), + '#maxlength' => 255, + '#default_value' => $entity->get('parent_account_name'), + ]; $form['query_parameters']['attributes']['#tree'] = TRUE; @@ -143,14 +156,6 @@ public function form(array $form, FormStateInterface $form_state): array { '#markup' => $this->t('No mapped enterprise attributes found, so the attribute controls are unavailable.'), ]; } - - $form['query_parameters']['keyword'] = [ - '#type' => 'textfield', - '#title' => $this->t('Keyword'), - '#maxlength' => 255, - '#default_value' => $entity->get('keyword'), - ]; - return $form; } From e12c4d6174462d0615c94c2f087128c073a371a8 Mon Sep 17 00:00:00 2001 From: Z Saenz Date: Fri, 3 Apr 2026 17:05:33 -0700 Subject: [PATCH 31/59] Hides trellis fields for preview --- ...rm_display.node.az_opportunity.default.yml | 42 +++++-------------- ...ew_display.node.az_opportunity.az_card.yml | 29 +++++-------- ...ew_display.node.az_opportunity.default.yml | 18 +++----- 3 files changed, 27 insertions(+), 62 deletions(-) diff --git a/modules/custom/az_opportunity/config/install/core.entity_form_display.node.az_opportunity.default.yml b/modules/custom/az_opportunity/config/install/core.entity_form_display.node.az_opportunity.default.yml index 5fff77627e..bd1d0c674b 100644 --- a/modules/custom/az_opportunity/config/install/core.entity_form_display.node.az_opportunity.default.yml +++ b/modules/custom/az_opportunity/config/install/core.entity_form_display.node.az_opportunity.default.yml @@ -22,7 +22,6 @@ dependencies: - node.type.az_opportunity module: - az_core - - datetime - link - link_class - path @@ -35,7 +34,7 @@ mode: default content: created: type: datetime_timestamp - weight: 20 + weight: 17 region: content settings: { } third_party_settings: { } @@ -148,14 +147,6 @@ content: size: 60 placeholder: '' third_party_settings: { } - field_az_parent_account: - type: string_textfield - weight: 16 - region: content - settings: - size: 60 - placeholder: '' - third_party_settings: { } field_az_program_date: type: smartdate_only weight: 6 @@ -192,43 +183,29 @@ content: placeholder_url: '' placeholder_title: '' third_party_settings: { } - field_az_trellis_id: - type: string_textfield - weight: 15 - region: content - settings: - size: 60 - placeholder: '' - third_party_settings: { } - field_az_trellis_imported_date: - type: datetime_default - weight: 17 - region: content - settings: { } - third_party_settings: { } path: type: path - weight: 23 + weight: 20 region: content settings: { } third_party_settings: { } promote: type: boolean_checkbox - weight: 21 + weight: 18 region: content settings: display_label: true third_party_settings: { } status: type: boolean_checkbox - weight: 18 + weight: 15 region: content settings: display_label: true third_party_settings: { } sticky: type: boolean_checkbox - weight: 22 + weight: 19 region: content settings: display_label: true @@ -243,7 +220,7 @@ content: third_party_settings: { } uid: type: entity_reference_autocomplete - weight: 19 + weight: 16 region: content settings: match_operator: CONTAINS @@ -252,8 +229,11 @@ content: placeholder: '' third_party_settings: { } url_redirects: - weight: 24 + weight: 21 region: content settings: { } third_party_settings: { } -hidden: { } +hidden: + field_az_parent_account: true + field_az_trellis_id: true + field_az_trellis_imported_date: true diff --git a/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_card.yml b/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_card.yml index a055c7055a..6328334558 100644 --- a/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_card.yml +++ b/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_card.yml @@ -33,7 +33,7 @@ third_party_settings: label: col1 parent_name: '' region: hidden - weight: 16 + weight: 14 format_type: html_element format_settings: classes: col @@ -52,7 +52,7 @@ third_party_settings: label: col2 parent_name: '' region: hidden - weight: 17 + weight: 15 format_type: html_element format_settings: classes: col @@ -71,7 +71,7 @@ third_party_settings: label: col3 parent_name: '' region: hidden - weight: 19 + weight: 17 format_type: html_element format_settings: classes: col @@ -90,7 +90,7 @@ third_party_settings: label: col4 parent_name: '' region: hidden - weight: 20 + weight: 18 format_type: html_element format_settings: classes: col @@ -109,7 +109,7 @@ third_party_settings: label: col5 parent_name: '' region: hidden - weight: 21 + weight: 19 format_type: html_element format_settings: classes: col @@ -128,7 +128,7 @@ third_party_settings: label: col6 parent_name: '' region: hidden - weight: 18 + weight: 16 format_type: html_element format_settings: classes: col @@ -147,7 +147,7 @@ third_party_settings: label: col7 parent_name: '' region: hidden - weight: 22 + weight: 20 format_type: html_element format_settings: classes: col7 @@ -166,7 +166,7 @@ third_party_settings: label: col8 parent_name: '' region: hidden - weight: 23 + weight: 21 format_type: html_element format_settings: classes: col @@ -183,13 +183,14 @@ third_party_settings: group_header_row: children: - group_card_clickable + - field_az_parent_account - field_az_program_length - links - group_read_more label: 'header row' parent_name: '' region: hidden - weight: 15 + weight: 13 format_type: html_element format_settings: classes: row @@ -265,7 +266,6 @@ third_party_settings: - field_az_opportunity_location - field_az_application_date - field_az_offered - - field_az_parent_account label: 'Text Body Secondary' parent_name: group_link region: content @@ -360,14 +360,6 @@ content: third_party_settings: { } weight: 7 region: content - field_az_parent_account: - type: string - label: inline - settings: - link_to_entity: false - third_party_settings: { } - weight: 11 - region: content smart_title: settings: { } third_party_settings: { } @@ -382,6 +374,7 @@ hidden: field_az_ongoing: true field_az_opportunity_category: true field_az_opportunity_credit: true + field_az_parent_account: true field_az_program_date: true field_az_program_length: true field_az_program_website: true diff --git a/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.default.yml b/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.default.yml index 66b392a326..6382e83e57 100644 --- a/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.default.yml +++ b/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.default.yml @@ -55,7 +55,7 @@ third_party_settings: label: col2 parent_name: '' region: hidden - weight: 14 + weight: 13 format_type: html_element format_settings: classes: col @@ -94,7 +94,7 @@ third_party_settings: label: col4 parent_name: '' region: hidden - weight: 11 + weight: 10 format_type: html_element format_settings: classes: col @@ -134,7 +134,7 @@ third_party_settings: label: col6 parent_name: '' region: hidden - weight: 12 + weight: 11 format_type: html_element format_settings: classes: col @@ -216,7 +216,6 @@ third_party_settings: group_where: children: - field_az_opportunity_location - - field_az_opportunity_format label: Location parent_name: group_col1 region: content @@ -361,7 +360,7 @@ third_party_settings: label: 'Bottom Row' parent_name: '' region: hidden - weight: 13 + weight: 12 format_type: html_element format_settings: classes: row @@ -458,14 +457,6 @@ content: third_party_settings: { } weight: 4 region: content - field_az_parent_account: - type: string - label: hidden - settings: - link_to_entity: false - third_party_settings: { } - weight: 5 - region: content field_az_program_date: type: daterange_default label: hidden @@ -505,6 +496,7 @@ content: hidden: field_az_enterprise_attributes: true field_az_ongoing: true + field_az_parent_account: true field_az_trellis_id: true field_az_trellis_imported_date: true smart_title: true From c838b1cbd55a5cd8e5d1ec38f33815b1e552a461 Mon Sep 17 00:00:00 2001 From: Z Saenz Date: Mon, 6 Apr 2026 13:08:59 -0700 Subject: [PATCH 32/59] Fix body and eligibility importing, removes old twig file --- .../az_opportunity/az_opportunity.info.yml | 1 - ...lus.migration.az_trellis_opportunities.yml | 9 ++- ...--field_az_topic--az_opportunity.html.twig | 70 ------------------- 3 files changed, 8 insertions(+), 72 deletions(-) delete mode 100644 themes/custom/az_barrio/templates/field/field--node--field_az_topic--az_opportunity.html.twig diff --git a/modules/custom/az_opportunity/az_opportunity.info.yml b/modules/custom/az_opportunity/az_opportunity.info.yml index e3c02b3821..b7f81a7a94 100644 --- a/modules/custom/az_opportunity/az_opportunity.info.yml +++ b/modules/custom/az_opportunity/az_opportunity.info.yml @@ -8,7 +8,6 @@ lifecycle_link: 'https://github.com/az-digital/az_quickstart/blob/main/RELEASES. dependencies: - az_core:az_core - - az_enterprise_attributes_import:az_enterprise_attributes_import - calendar_link:calendar_link - date_ap_style:date_ap_style - field_group:field_group diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/config/install/migrate_plus.migration.az_trellis_opportunities.yml b/modules/custom/az_opportunity/az_opportunity_trellis/config/install/migrate_plus.migration.az_trellis_opportunities.yml index 91a0309f15..754900b7ce 100644 --- a/modules/custom/az_opportunity/az_opportunity_trellis/config/install/migrate_plus.migration.az_trellis_opportunities.yml +++ b/modules/custom/az_opportunity/az_opportunity_trellis/config/install/migrate_plus.migration.az_trellis_opportunities.yml @@ -207,7 +207,14 @@ process: - plugin: default_value default_value: 'Program Website' - field_az_body: description + field_az_eligibility/value: eligibility + field_az_eligibility/format: + plugin: default_value + default_value: az_standard + field_az_body/value: description + field_az_body/format: + plugin: default_value + default_value: az_standard field_az_application_link/uri: application_form_url field_az_application_link/title: - diff --git a/themes/custom/az_barrio/templates/field/field--node--field_az_topic--az_opportunity.html.twig b/themes/custom/az_barrio/templates/field/field--node--field_az_topic--az_opportunity.html.twig deleted file mode 100644 index d913fad43d..0000000000 --- a/themes/custom/az_barrio/templates/field/field--node--field_az_topic--az_opportunity.html.twig +++ /dev/null @@ -1,70 +0,0 @@ -{# -/** - * @file - * Theme override for AZ Opportunity "topic" field. - * - * To override output, copy the "field.html.twig" from the templates directory - * to your theme's directory and customize it, just like customizing other - * Drupal templates such as page.html.twig or node.html.twig. - * - * Available variables: - * - attributes: HTML attributes for the containing element. - * - label_hidden: Whether to show the field label or not. - * - title_attributes: HTML attributes for the title. - * - label: The label for the field. - * - multiple: TRUE if a field can contain multiple items. - * - items: List of all the field items. Each item contains: - * - attributes: List of HTML attributes for each item. - * - content: The field item's content. - * - entity_type: The entity type to which the field belongs. - * - field_name: The name of the field. - * - field_type: The type of the field. - * - label_display: The display settings for the label. - * - * - * @see template_preprocess_field() - */ -#} -{% - set classes = [ - 'field', - 'field--name-' ~ field_name|clean_class, - 'field--type-' ~ field_type|clean_class, - 'field--label-' ~ label_display, - 'd-inline', - 'az-opportunity-categories-list', - ] -%} -{% - set title_classes = [ - 'field__label', - label_display == 'visually_hidden' ? 'visually-hidden', - ] -%} - -{% if label_hidden %} - {% if multiple %} - - {% for item in items %} - {{ item.content }} - {% endfor %} - - {% else %} - {% for item in items %} - {{ item.content }} - {% endfor %} - {% endif %} -{% else %} - - {{ label }} - {% if multiple %} -
- {% endif %} - {% for item in items %} - {{ item.content }}
- {% endfor %} - {% if multiple %} - - {% endif %} - -{% endif %} From 2a3fba96fdc82fd75442ed38572cf7fc86fcf005 Mon Sep 17 00:00:00 2001 From: Z Saenz Date: Mon, 6 Apr 2026 14:16:01 -0700 Subject: [PATCH 33/59] Moves opportunity trellis importer into its own page (id size cant exceed 32 char) --- .../az_opportunity_trellis.install | 6 ++--- .../az_opportunity_trellis.links.action.yml | 6 ++--- .../az_opportunity_trellis.links.task.yml | 4 ++-- .../az_opportunity_trellis.module | 4 ++-- .../az_opportunity_trellis.routing.yml | 22 ++++++++--------- .../schema/az_opportunity_trellis.schema.yml | 2 +- .../AZRecurringImportModalController.php | 10 ++++---- .../src/Entity/AZRecurringImportRule.php | 24 +++++++++---------- .../src/TrellisHelper.php | 2 +- 9 files changed, 40 insertions(+), 40 deletions(-) diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.install b/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.install index 8f6afbf8ca..4906f07e42 100644 --- a/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.install +++ b/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.install @@ -15,14 +15,14 @@ function az_opportunity_trellis_update_1020801() { } /** - * Ensure az_recurring_import_rule entity type is installed. + * Ensure az_opp_recurring_import_rule entity type is installed. */ function az_opportunity_trellis_update_1021001() { $changes = \Drupal::entityDefinitionUpdateManager()->getChangeList(); - $status = $changes['az_recurring_import_rule']['entity_type'] ?? ''; + $status = $changes['az_opp_recurring_import_rule']['entity_type'] ?? ''; // Determine if recurring import rule entity needs to be created. if ($status === EntityDefinitionUpdateManagerInterface::DEFINITION_CREATED) { - $entity_type_definition = \Drupal::service('entity_type.manager')->getDefinition('az_recurring_import_rule'); + $entity_type_definition = \Drupal::service('entity_type.manager')->getDefinition('az_opp_recurring_import_rule'); \Drupal::entityDefinitionUpdateManager()->installEntityType($entity_type_definition); } } diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.links.action.yml b/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.links.action.yml index 2fbeb0bbfe..a5e45f3e3a 100644 --- a/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.links.action.yml +++ b/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.links.action.yml @@ -1,5 +1,5 @@ -entity.az_recurring_import_rule.add_form: - route_name: 'entity.az_recurring_import_rule.add_form' +entity.az_opp_recurring_import_rule.add_form: + route_name: 'entity.az_opp_recurring_import_rule.add_form' title: 'Add Recurring Import Rule' appears_on: - - entity.az_recurring_import_rule.collection + - entity.az_opp_recurring_import_rule.collection diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.links.task.yml b/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.links.task.yml index ca44b1604c..1ab4e71584 100644 --- a/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.links.task.yml +++ b/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.links.task.yml @@ -11,8 +11,8 @@ az_opportunity.import_form_task: description: 'Import opportunities from the Trellis Opportunity API.' weight: 101 -az_opportunity_trellis.az_recurring_import_rules_tab: - route_name: entity.az_recurring_import_rule.collection +az_opportunity_trellis.az_opp_recurring_import_rules_tab: + route_name: entity.az_opp_recurring_import_rule.collection title: 'Recurring Opportunity Imports' base_route: az_core.az_settings weight: 5 diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.module b/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.module index d8300b5102..87a90931c5 100644 --- a/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.module +++ b/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.module @@ -150,7 +150,7 @@ function az_opportunity_trellis_form_views_exposed_form_alter(&$form, FormStateI // We cannot use an ajax response here to open a dialog. // Exposed forms do not support ajax callbacks. Cache search parameters. // Compute cache key of parameters. - $key = 'az_recurring_import_modal:' . Crypt::hashBase64(serialize($search)); + $key = 'az_opp_recurring_import_modal:' . Crypt::hashBase64(serialize($search)); $expire = time() + 1200; // Cache the search. \Drupal::service('cache.default')->set($key, $search, $expire); @@ -159,7 +159,7 @@ function az_opportunity_trellis_form_views_exposed_form_alter(&$form, FormStateI $form['actions']['recurring'] = [ '#type' => 'link', '#title' => t('Create Recurring Import'), - '#url' => Url::fromRoute('entity.az_recurring_import_rule.modal'), + '#url' => Url::fromRoute('entity.az_opp_recurring_import_rule.modal'), // Pass the search parameters cache key as an argument. '#options' => ['query' => ['search' => $key]], '#attributes' => ['class' => ['use-ajax', 'button']], diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.routing.yml b/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.routing.yml index 77c5fe6d30..26155ef254 100644 --- a/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.routing.yml +++ b/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.routing.yml @@ -6,39 +6,39 @@ az_opportunity_trellis.settings: requirements: _permission: 'administer quickstart configuration' -entity.az_recurring_import_rule.collection: +entity.az_opp_recurring_import_rule.collection: path: '/admin/config/az-quickstart/settings/az-opportunity-recurring-import-rule' defaults: - _entity_list: 'az_recurring_import_rule' + _entity_list: 'az_opp_recurring_import_rule' _title: 'Recurring Import Rule configuration' requirements: _permission: 'administer quickstart configuration' -entity.az_recurring_import_rule.add_form: +entity.az_opp_recurring_import_rule.add_form: path: '/admin/config/az-quickstart/settings/az-opportunity-recurring-import-rule/add' defaults: - _entity_form: 'az_recurring_import_rule.add' + _entity_form: 'az_opp_recurring_import_rule.add' _title: 'Add a recurring import rule' requirements: _permission: 'administer quickstart configuration' -entity.az_recurring_import_rule.edit_form: - path: '/admin/config/az-quickstart/settings/az-opportunity-recurring-import-rule/{az_recurring_import_rule}' +entity.az_opp_recurring_import_rule.edit_form: + path: '/admin/config/az-quickstart/settings/az-opportunity-recurring-import-rule/{az_opp_recurring_import_rule}' defaults: - _entity_form: 'az_recurring_import_rule.edit' + _entity_form: 'az_opp_recurring_import_rule.edit' _title: 'Edit a recurring import rule' requirements: _permission: 'administer quickstart configuration' -entity.az_recurring_import_rule.delete_form: - path: '/admin/config/az-quickstart/settings/az-opportunity-recurring-import-rule/{az_recurring_import_rule}/delete' +entity.az_opp_recurring_import_rule.delete_form: + path: '/admin/config/az-quickstart/settings/az-opportunity-recurring-import-rule/{az_opp_recurring_import_rule}/delete' defaults: - _entity_form: 'az_recurring_import_rule.delete' + _entity_form: 'az_opp_recurring_import_rule.delete' _title: 'Delete a recurring import rule' requirements: _permission: 'administer quickstart configuration' -entity.az_recurring_import_rule.modal: +entity.az_opp_recurring_import_rule.modal: path: '/admin/az-opportunity-trellis-modal' defaults: _title: 'Entity Az Recurring Import Rule Modal' diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/config/schema/az_opportunity_trellis.schema.yml b/modules/custom/az_opportunity/az_opportunity_trellis/config/schema/az_opportunity_trellis.schema.yml index 16876a851f..c0e5e1b44f 100644 --- a/modules/custom/az_opportunity/az_opportunity_trellis/config/schema/az_opportunity_trellis.schema.yml +++ b/modules/custom/az_opportunity/az_opportunity_trellis/config/schema/az_opportunity_trellis.schema.yml @@ -11,7 +11,7 @@ views.filter_value.az_opportunity_trellis_views_date_filter: end: type: string label: 'Custom Date Range End' -az_opportunity_trellis.az_recurring_import_rule.*: +az_opportunity_trellis.az_opp_recurring_import_rule.*: type: config_entity label: Trellis Opportunity Import mapping: diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/src/Controller/AZRecurringImportModalController.php b/modules/custom/az_opportunity/az_opportunity_trellis/src/Controller/AZRecurringImportModalController.php index 1c2af8acc2..146eb21d30 100644 --- a/modules/custom/az_opportunity/az_opportunity_trellis/src/Controller/AZRecurringImportModalController.php +++ b/modules/custom/az_opportunity/az_opportunity_trellis/src/Controller/AZRecurringImportModalController.php @@ -15,7 +15,7 @@ use Symfony\Component\HttpFoundation\Request; /** - * Returns a modal copy of the az_recurring_import_rule configuration form. + * Returns a modal copy of the az_opp_recurring_import_rule configuration form. */ final class AZRecurringImportModalController extends ControllerBase { @@ -68,7 +68,7 @@ public static function create(ContainerInterface $container): self { } /** - * Open az_recurring_import_rule configuration form as a modal. + * Open az_opp_recurring_import_rule configuration form as a modal. * * @param \Symfony\Component\HttpFoundation\Request $request * The current request. @@ -80,7 +80,7 @@ public function __invoke(Request $request): AjaxResponse { $search = []; $key = $request->query->get('search'); // Attempt to get cached search if we have a valid cache key. - if (!empty($key) && str_starts_with($key, 'az_recurring_import_modal:')) { + if (!empty($key) && str_starts_with($key, 'az_opp_recurring_import_modal:')) { // Get a cached search if there is one for our key. $search = $this->cache->get($key)->data ?? []; } @@ -88,11 +88,11 @@ public function __invoke(Request $request): AjaxResponse { // Create an AjaxResponse that opens a modal copy of the config form. $response = new AjaxResponse(); // Entity forms require an entity. - $config = $this->entityTypeManager->getStorage('az_recurring_import_rule')->create($search); + $config = $this->entityTypeManager->getStorage('az_opp_recurring_import_rule')->create($search); // Generate a copy of the configuration entity form using the stub as basis. $config_form = $this->entityFormBuilder->getForm($config, 'add'); // Forms generated during ajax calls do not have the right action path. - $config_form['#action'] = Url::fromRoute('entity.az_recurring_import_rule.add_form')->toString(); + $config_form['#action'] = Url::fromRoute('entity.az_opp_recurring_import_rule.add_form')->toString(); // Add an ajax command to open the modal. $response->addCommand(new OpenModalDialogCommand($this->t('Create Recurring Import'), $config_form, ['width' => '1000'])); return $response; diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/src/Entity/AZRecurringImportRule.php b/modules/custom/az_opportunity/az_opportunity_trellis/src/Entity/AZRecurringImportRule.php index c8963670f6..d7fe6829e4 100644 --- a/modules/custom/az_opportunity/az_opportunity_trellis/src/Entity/AZRecurringImportRule.php +++ b/modules/custom/az_opportunity/az_opportunity_trellis/src/Entity/AZRecurringImportRule.php @@ -16,7 +16,7 @@ * Defines the recurring import rule entity type. */ #[ConfigEntityType( - id: 'az_recurring_import_rule', + id: 'az_opp_recurring_import_rule', label: new TranslatableMarkup('Recurring Import Rule'), label_collection: new TranslatableMarkup('Recurring Import Rules'), label_singular: new TranslatableMarkup('recurring import rule'), @@ -29,7 +29,7 @@ 'delete' => EntityDeleteForm::class, ], ], - config_prefix: 'az_recurring_import_rule', + config_prefix: 'az_opp_recurring_import_rule', admin_permission: 'administer quickstart configuration', label_count: [ 'singular' => '@count recurring import rule', @@ -38,8 +38,8 @@ links: [ 'collection' => '/admin/config/az-quickstart/settings/az-opportunity-recurring-import-rule', 'add-form' => '/admin/config/az-quickstart/settings/az-opportunity-recurring-import-rule/add', - 'edit-form' => '/admin/config/az-quickstart/settings/az-opportunity-recurring-import-rule/{az_recurring_import_rule}', - 'delete-form' => '/admin/config/az-quickstart/settings/az-opportunity-recurring-import-rule/{az_recurring_import_rule}/delete', + 'edit-form' => '/admin/config/az-quickstart/settings/az-opportunity-recurring-import-rule/{az_opp_recurring_import_rule}', + 'delete-form' => '/admin/config/az-quickstart/settings/az-opportunity-recurring-import-rule/{az_opp_recurring_import_rule}/delete', ], entity_keys: [ 'id' => 'id', @@ -60,42 +60,42 @@ final class AZRecurringImportRule extends ConfigEntityBase implements AZRecurringImportRuleInterface { /** - * The az_recurring_import_rule ID. + * The az_opp_recurring_import_rule ID. */ protected string $id; /** - * The az_recurring_import_rule label. + * The az_opp_recurring_import_rule label. */ protected string $label; /** - * The az_recurring_import_rule keyword. + * The az_opp_recurring_import_rule keyword. */ protected string $keyword; /** - * The az_recurring_import_rule owner. + * The az_opp_recurring_import_rule owner. */ protected string $owner; /** - * The az_recurring_import_rule owner. + * The az_opp_recurring_import_rule owner. */ //protected string $host; /** - * The az_recurring_import_rule enterprise attributes. + * The az_opp_recurring_import_rule enterprise attributes. */ protected ?array $attributes; /** - * The az_recurring_import_rule approval status. + * The az_opp_recurring_import_rule approval status. */ protected string $approval; /** - * The az_recurring_import_rule parent account name. + * The az_opp_recurring_import_rule parent account name. */ protected string $parent_account_name; diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/src/TrellisHelper.php b/modules/custom/az_opportunity/az_opportunity_trellis/src/TrellisHelper.php index 19ffa2cc6b..6341ce9096 100644 --- a/modules/custom/az_opportunity/az_opportunity_trellis/src/TrellisHelper.php +++ b/modules/custom/az_opportunity/az_opportunity_trellis/src/TrellisHelper.php @@ -209,7 +209,7 @@ public function getImportedOpportunityIds() { */ public function getRecurringOpportunityIds() { // Find enabled import configurations. - $imports = $this->entityTypeManager->getStorage('az_recurring_import_rule')->loadByProperties([ + $imports = $this->entityTypeManager->getStorage('az_opp_recurring_import_rule')->loadByProperties([ 'status' => [1, TRUE], ]); From 1c0a6c54f5a080314aa17fb5fb1245a7645a9e61 Mon Sep 17 00:00:00 2001 From: Z Saenz Date: Tue, 7 Apr 2026 10:06:15 -0700 Subject: [PATCH 34/59] Fixes attributes, removes old program type --- .../az_opportunity_trellis.views.inc | 10 +- ...ews.view.az_opportunity_trellis_import.yml | 169 +++++++++++++++--- 2 files changed, 150 insertions(+), 29 deletions(-) diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.views.inc b/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.views.inc index cf65728f8f..b3fadca084 100644 --- a/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.views.inc +++ b/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.views.inc @@ -163,11 +163,11 @@ function az_opportunity_trellis_views_data(): array { 'id' => 'az_opportunity_trellis_views_owner_netid', ], ]; - $data['az_opportunity_trellis_data']['Program_Type__c'] = [ - 'title' => t('Trellis Opportunity Program Type'), - 'help' => t('Parent Opportunity Program Type'), - 'field' => [ - 'id' => 'az_opportunity_trellis_views_program_type', + $data['az_opportunity_trellis_data']['Attributes'] = [ + 'title' => t('Enterprise Attribute'), + 'help' => t('Trellis opportunity search API enterprise attributes'), + 'filter' => [ + 'id' => 'az_opportunity_trellis_views_attribute_filter', ], ]; return $data; diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/config/install/views.view.az_opportunity_trellis_import.yml b/modules/custom/az_opportunity/az_opportunity_trellis/config/install/views.view.az_opportunity_trellis_import.yml index 48fea52b7d..6bf8ff12b7 100644 --- a/modules/custom/az_opportunity/az_opportunity_trellis/config/install/views.view.az_opportunity_trellis_import.yml +++ b/modules/custom/az_opportunity/az_opportunity_trellis/config/install/views.view.az_opportunity_trellis_import.yml @@ -274,7 +274,7 @@ display: hide_empty: false empty_zero: false hide_alter_empty: true - property_path: Audiences__c + property_path: Attributes.0.Audiences__c property_7: id: property_7 table: az_opportunity_trellis_data @@ -632,8 +632,8 @@ display: default_group_multiple: { } group_items: { } property_path: account_id - property_3: - id: property_3 + property_4: + id: property_4 table: az_opportunity_trellis_data field: property relationship: none @@ -645,14 +645,14 @@ display: group: 1 exposed: true expose: - operator_id: property_3_op - label: Topic + operator_id: property_4_op + label: 'Parent Account Name' description: '' use_operator: false - operator: property_3_op + operator: property_4_op operator_limit_selection: false operator_list: { } - identifier: property_3 + identifier: parent_account_name required: false remember: false multiple: false @@ -670,9 +670,9 @@ display: default_group: All default_group_multiple: { } group_items: { } - property_path: topic - property_4: - id: property_4 + property_path: parent_account_name + property_5: + id: property_5 table: az_opportunity_trellis_data field: property relationship: none @@ -684,14 +684,14 @@ display: group: 1 exposed: true expose: - operator_id: property_4_op - label: 'Parent Account Name' + operator_id: property_5_op + label: Keyword description: '' use_operator: false - operator: property_4_op + operator: property_5_op operator_limit_selection: false operator_list: { } - identifier: parent_account_name + identifier: keyword required: false remember: false multiple: false @@ -709,28 +709,148 @@ display: default_group: All default_group_multiple: { } group_items: { } - property_path: parent_account_name - property_5: - id: property_5 + property_path: keyword + Attributes: + id: Attributes table: az_opportunity_trellis_data - field: property + field: Attributes relationship: none group_type: group admin_label: '' - plugin_id: views_remote_data_property + plugin_id: az_opportunity_trellis_views_attribute_filter operator: '=' value: '' group: 1 exposed: true expose: - operator_id: property_5_op - label: Keyword + operator_id: Attributes_op + label: Audience description: '' use_operator: false - operator: property_5_op + operator: Attributes_op + operator_limit_selection: false + operator_list: { } + identifier: audience + required: false + remember: false + multiple: false + remember_roles: + authenticated: authenticated + is_grouped: false + group_info: + label: '' + description: '' + identifier: '' + optional: true + widget: select + multiple: false + remember: false + default_group: All + default_group_multiple: { } + group_items: { } + property_path: audience + az_attribute_key: Audiences__c + Attributes_1: + id: Attributes_1 + table: az_opportunity_trellis_data + field: Attributes + relationship: none + group_type: group + admin_label: '' + plugin_id: az_opportunity_trellis_views_attribute_filter + operator: '=' + value: '' + group: 1 + exposed: true + expose: + operator_id: Attributes_1_op + label: Topic + description: '' + use_operator: false + operator: Attributes_1_op + operator_limit_selection: false + operator_list: { } + identifier: topic + required: false + remember: false + multiple: false + remember_roles: + authenticated: authenticated + is_grouped: false + group_info: + label: '' + description: '' + identifier: '' + optional: true + widget: select + multiple: false + remember: false + default_group: All + default_group_multiple: { } + group_items: { } + property_path: topic + az_attribute_key: Topic__c + Attributes_2: + id: Attributes_2 + table: az_opportunity_trellis_data + field: Attributes + relationship: none + group_type: group + admin_label: '' + plugin_id: az_opportunity_trellis_views_attribute_filter + operator: '=' + value: '' + group: 1 + exposed: true + expose: + operator_id: Attributes_2_op + label: Program Type + description: '' + use_operator: false + operator: Attributes_2_op + operator_limit_selection: false + operator_list: { } + identifier: program_type + required: false + remember: false + multiple: false + remember_roles: + authenticated: authenticated + is_grouped: false + group_info: + label: '' + description: '' + identifier: '' + optional: true + widget: select + multiple: false + remember: false + default_group: All + default_group_multiple: { } + group_items: { } + property_path: program_type + az_attribute_key: Program_Type__c + Attributes_3: + id: Attributes_3 + table: az_opportunity_trellis_data + field: Attributes + relationship: none + group_type: group + admin_label: '' + plugin_id: az_opportunity_trellis_views_attribute_filter + operator: '=' + value: '' + group: 1 + exposed: true + expose: + operator_id: Attributes_3_op + label: Format + description: '' + use_operator: false + operator: Attributes_3_op operator_limit_selection: false operator_list: { } - identifier: keyword + identifier: program_format required: false remember: false multiple: false @@ -748,7 +868,8 @@ display: default_group: All default_group_multiple: { } group_items: { } - property_path: keyword + property_path: program_format + az_attribute_key: Program_Format__c filter_groups: operator: AND groups: From 839ff767e2416e5355c23d0e68a983e8b3a5d7a5 Mon Sep 17 00:00:00 2001 From: Z Saenz Date: Tue, 7 Apr 2026 10:07:23 -0700 Subject: [PATCH 35/59] phpcbf --- .../az_opportunity_trellis.views.inc | 2 +- .../install/az_opportunity_trellis.settings.yml | 2 +- .../src/Entity/AZRecurringImportRule.php | 17 ++++++++--------- .../AZOpportunityTrellisDataSubscriber.php | 2 +- .../src/Form/AZRecurringImportRuleForm.php | 3 ++- ...xonomy_term.az_opportunity_topic.default.yml | 2 +- ...axonomy_term.az_opportunity_type.default.yml | 2 +- 7 files changed, 15 insertions(+), 15 deletions(-) diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.views.inc b/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.views.inc index b3fadca084..6ffecc7bd9 100644 --- a/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.views.inc +++ b/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.views.inc @@ -171,4 +171,4 @@ function az_opportunity_trellis_views_data(): array { ], ]; return $data; -} \ No newline at end of file +} diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/config/install/az_opportunity_trellis.settings.yml b/modules/custom/az_opportunity/az_opportunity_trellis/config/install/az_opportunity_trellis.settings.yml index f0aedb5998..1797962824 100644 --- a/modules/custom/az_opportunity/az_opportunity_trellis/config/install/az_opportunity_trellis.settings.yml +++ b/modules/custom/az_opportunity/az_opportunity_trellis/config/install/az_opportunity_trellis.settings.yml @@ -1 +1 @@ -api_hostname: 'api.eips.arizona.edu' \ No newline at end of file +api_hostname: 'api.eips.arizona.edu' diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/src/Entity/AZRecurringImportRule.php b/modules/custom/az_opportunity/az_opportunity_trellis/src/Entity/AZRecurringImportRule.php index d7fe6829e4..bbf50f47d7 100644 --- a/modules/custom/az_opportunity/az_opportunity_trellis/src/Entity/AZRecurringImportRule.php +++ b/modules/custom/az_opportunity/az_opportunity_trellis/src/Entity/AZRecurringImportRule.php @@ -50,11 +50,11 @@ 'id', 'label', 'owner', -// 'host', + // 'host', 'keyword', 'attributes', 'parent_account_name', -// 'approval', + // 'approval', ], )] final class AZRecurringImportRule extends ConfigEntityBase implements AZRecurringImportRuleInterface { @@ -82,7 +82,7 @@ final class AZRecurringImportRule extends ConfigEntityBase implements AZRecurrin /** * The az_opp_recurring_import_rule owner. */ - //protected string $host; + // Protected string $host;. /** * The az_opp_recurring_import_rule enterprise attributes. @@ -112,8 +112,8 @@ public function getQueryParameters() { $params['keyword'] = $this->get('keyword') ?? ''; $params['owner'] = $this->get('owner') ?? ''; $params['parent_account_name'] = $this->get('parent_account_name') ?? ''; - // $params['host'] = $this->get('host') ?? ''; - // $params['approval'] = $this->get('approval') ?? ''; + // $params['host'] = $this->get('host') ?? ''; + // $params['approval'] = $this->get('approval') ?? ''; $params = array_filter($params); return $params; } @@ -126,10 +126,9 @@ public function getOpportunityIds() { $params = $this->getQueryParameters(); // Let's refuse to search if there are no constraints except published. -// if (count($params) === 1) { -// return []; -// } - + // if (count($params) === 1) { + // return []; + // }. return \Drupal::service('az_opportunity_trellis.trellis_helper')->searchOpportunities($params); } diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/src/EventSubscriber/AZOpportunityTrellisDataSubscriber.php b/modules/custom/az_opportunity/az_opportunity_trellis/src/EventSubscriber/AZOpportunityTrellisDataSubscriber.php index ec671bc69e..c909932204 100644 --- a/modules/custom/az_opportunity/az_opportunity_trellis/src/EventSubscriber/AZOpportunityTrellisDataSubscriber.php +++ b/modules/custom/az_opportunity/az_opportunity_trellis/src/EventSubscriber/AZOpportunityTrellisDataSubscriber.php @@ -125,7 +125,7 @@ public function onQuery(RemoteDataQueryEvent $event): void { } // Don't perform search if empty or publish is the only field. if (empty($parameters)) { - //if (empty($parameters) || (count($parameters) <= 1)) { + // If (empty($parameters) || (count($parameters) <= 1)) {. return; } $ids = $this->trellisHelper->searchOpportunities($parameters); diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/src/Form/AZRecurringImportRuleForm.php b/modules/custom/az_opportunity/az_opportunity_trellis/src/Form/AZRecurringImportRuleForm.php index 7306f4b08e..a33f69b88d 100644 --- a/modules/custom/az_opportunity/az_opportunity_trellis/src/Form/AZRecurringImportRuleForm.php +++ b/modules/custom/az_opportunity/az_opportunity_trellis/src/Form/AZRecurringImportRuleForm.php @@ -88,7 +88,8 @@ public function form(array $form, FormStateInterface $form_state): array { '#default_value' => $entity->get('owner'), ]; - $form['query_parameters']['keyword'] = [ // cut from line 146 + // Cut from line 146. + $form['query_parameters']['keyword'] = [ '#type' => 'textfield', '#title' => $this->t('Keyword'), '#maxlength' => 255, diff --git a/modules/custom/az_opportunity/config/install/core.entity_view_display.taxonomy_term.az_opportunity_topic.default.yml b/modules/custom/az_opportunity/config/install/core.entity_view_display.taxonomy_term.az_opportunity_topic.default.yml index f7bcb871e6..6578fd5a5c 100644 --- a/modules/custom/az_opportunity/config/install/core.entity_view_display.taxonomy_term.az_opportunity_topic.default.yml +++ b/modules/custom/az_opportunity/config/install/core.entity_view_display.taxonomy_term.az_opportunity_topic.default.yml @@ -1 +1 @@ -{ } \ No newline at end of file +{ } diff --git a/modules/custom/az_opportunity/config/install/core.entity_view_display.taxonomy_term.az_opportunity_type.default.yml b/modules/custom/az_opportunity/config/install/core.entity_view_display.taxonomy_term.az_opportunity_type.default.yml index f7bcb871e6..6578fd5a5c 100644 --- a/modules/custom/az_opportunity/config/install/core.entity_view_display.taxonomy_term.az_opportunity_type.default.yml +++ b/modules/custom/az_opportunity/config/install/core.entity_view_display.taxonomy_term.az_opportunity_type.default.yml @@ -1 +1 @@ -{ } \ No newline at end of file +{ } From 43df943973246e9daa0a869419250616d445db61 Mon Sep 17 00:00:00 2001 From: Z Saenz Date: Tue, 7 Apr 2026 17:21:29 -0700 Subject: [PATCH 36/59] Add create permissions (core install) --- config/install/user.role.az_content_admin.yml | 2 ++ config/install/user.role.az_content_editor.yml | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/config/install/user.role.az_content_admin.yml b/config/install/user.role.az_content_admin.yml index a0c0d26f32..8c5ff1a8d9 100644 --- a/config/install/user.role.az_content_admin.yml +++ b/config/install/user.role.az_content_admin.yml @@ -35,6 +35,7 @@ permissions: - 'batch update workbench access' - 'bypass node access' - 'bypass workbench access' + - 'create az_opportunity content' - 'create content translations' - 'create new books' - 'create terms in az_academic_programs' @@ -56,6 +57,7 @@ permissions: - 'delete any az_flexible_page content' - 'delete any az_image media' - 'delete any az_news content' + - 'delete any az_opportunity content' - 'delete any az_person content' - 'delete any az_publication content' - 'delete any az_remote_video media' diff --git a/config/install/user.role.az_content_editor.yml b/config/install/user.role.az_content_editor.yml index 1273afece8..e6228a7531 100644 --- a/config/install/user.role.az_content_editor.yml +++ b/config/install/user.role.az_content_editor.yml @@ -49,6 +49,7 @@ permissions: - 'create az_flexible_page content' - 'create az_image media' - 'create az_news content' + - 'create az_opportunity content' - 'create az_person content' - 'create az_publication content' - 'create az_quick_links block content' @@ -70,6 +71,7 @@ permissions: - 'delete own az_flexible_page content' - 'delete own az_image media' - 'delete own az_news content' + - 'delete own az_opportunity content' - 'delete own az_person content' - 'delete own az_publication content' - 'delete own az_remote_video media' @@ -86,6 +88,7 @@ permissions: - 'edit any az_flexible_page content' - 'edit any az_image media' - 'edit any az_news content' + - 'edit any az_opportunity content' - 'edit any az_person content' - 'edit any az_publication content' - 'edit any az_quick_links block content' @@ -102,6 +105,7 @@ permissions: - 'edit own az_flexible_page content' - 'edit own az_image media' - 'edit own az_news content' + - 'edit own az_opportunity content' - 'edit own az_person content' - 'edit own az_publication content' - 'edit own az_remote_video media' @@ -128,6 +132,7 @@ permissions: - 'revert az_event revisions' - 'revert az_flexible_page revisions' - 'revert az_news revisions' + - 'revert az_opportunity revisions' - 'revert az_person revisions' - 'revert az_publication revisions' - 'revert book revisions' @@ -158,6 +163,7 @@ permissions: - 'view az_event revisions' - 'view az_flexible_page revisions' - 'view az_news revisions' + - 'view az_opportunity revisions' - 'view az_person revisions' - 'view az_publication revisions' - 'view book revisions' From 6d437e5440295a509fd41fca0ec4599a3ec86bd7 Mon Sep 17 00:00:00 2001 From: Z Saenz Date: Tue, 7 Apr 2026 18:32:08 -0700 Subject: [PATCH 37/59] Fix audiences --- .../config/install/views.view.az_opportunity_trellis_import.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/config/install/views.view.az_opportunity_trellis_import.yml b/modules/custom/az_opportunity/az_opportunity_trellis/config/install/views.view.az_opportunity_trellis_import.yml index 6bf8ff12b7..18524c5346 100644 --- a/modules/custom/az_opportunity/az_opportunity_trellis/config/install/views.view.az_opportunity_trellis_import.yml +++ b/modules/custom/az_opportunity/az_opportunity_trellis/config/install/views.view.az_opportunity_trellis_import.yml @@ -274,7 +274,7 @@ display: hide_empty: false empty_zero: false hide_alter_empty: true - property_path: Attributes.0.Audiences__c + property_path: Audiences__c property_7: id: property_7 table: az_opportunity_trellis_data From 1f08643feca70d8c889381d72727e4ac12919641 Mon Sep 17 00:00:00 2001 From: Z Saenz Date: Wed, 8 Apr 2026 08:33:40 -0700 Subject: [PATCH 38/59] phpcbf --- .../src/Entity/AZRecurringImportRule.php | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/src/Entity/AZRecurringImportRule.php b/modules/custom/az_opportunity/az_opportunity_trellis/src/Entity/AZRecurringImportRule.php index bbf50f47d7..2d5d0755d9 100644 --- a/modules/custom/az_opportunity/az_opportunity_trellis/src/Entity/AZRecurringImportRule.php +++ b/modules/custom/az_opportunity/az_opportunity_trellis/src/Entity/AZRecurringImportRule.php @@ -50,11 +50,9 @@ 'id', 'label', 'owner', - // 'host', 'keyword', 'attributes', 'parent_account_name', - // 'approval', ], )] final class AZRecurringImportRule extends ConfigEntityBase implements AZRecurringImportRuleInterface { @@ -79,11 +77,6 @@ final class AZRecurringImportRule extends ConfigEntityBase implements AZRecurrin */ protected string $owner; - /** - * The az_opp_recurring_import_rule owner. - */ - // Protected string $host;. - /** * The az_opp_recurring_import_rule enterprise attributes. */ @@ -112,8 +105,6 @@ public function getQueryParameters() { $params['keyword'] = $this->get('keyword') ?? ''; $params['owner'] = $this->get('owner') ?? ''; $params['parent_account_name'] = $this->get('parent_account_name') ?? ''; - // $params['host'] = $this->get('host') ?? ''; - // $params['approval'] = $this->get('approval') ?? ''; $params = array_filter($params); return $params; } @@ -125,10 +116,6 @@ public function getOpportunityIds() { // Build a list of query parameters. $params = $this->getQueryParameters(); - // Let's refuse to search if there are no constraints except published. - // if (count($params) === 1) { - // return []; - // }. return \Drupal::service('az_opportunity_trellis.trellis_helper')->searchOpportunities($params); } From 5de1f0c5c9717ab83f14adfb8e856ad420cbff8a Mon Sep 17 00:00:00 2001 From: Z Saenz Date: Wed, 8 Apr 2026 12:28:03 -0700 Subject: [PATCH 39/59] Credit and Format cardinality and null fix --- ...lus.migration.az_trellis_opportunities.yml | 19 +++++++++++++++---- ...orage.node.field_az_opportunity_credit.yml | 2 +- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/config/install/migrate_plus.migration.az_trellis_opportunities.yml b/modules/custom/az_opportunity/az_opportunity_trellis/config/install/migrate_plus.migration.az_trellis_opportunities.yml index 754900b7ce..fca511c112 100644 --- a/modules/custom/az_opportunity/az_opportunity_trellis/config/install/migrate_plus.migration.az_trellis_opportunities.yml +++ b/modules/custom/az_opportunity/az_opportunity_trellis/config/install/migrate_plus.migration.az_trellis_opportunities.yml @@ -165,13 +165,17 @@ process: value_key: name ignore_case: true field_az_opportunity_format: + - + plugin: explode + source: program_format + delimiter: ', ' + - + plugin: multiple_values - plugin: skip_on_empty method: process - source: program_format - plugin: static_map - source: program_format map: 'Hybrid': hybrid 'In-Person': in_person @@ -190,13 +194,20 @@ process: 'No': no 'Inquire Within': inquire_within field_az_opportunity_credit: + - + plugin: explode + source: credit_type + delimiter: ';' + - + plugin: callback + callable: trim + - + plugin: multiple_values - plugin: skip_on_empty method: process - source: credit_type - plugin: static_map - source: credit_type map: 'Non-Credit': non_credit 'UA Credit': ua_credit diff --git a/modules/custom/az_opportunity/config/install/field.storage.node.field_az_opportunity_credit.yml b/modules/custom/az_opportunity/config/install/field.storage.node.field_az_opportunity_credit.yml index bcbcff3c7f..665d4f891f 100644 --- a/modules/custom/az_opportunity/config/install/field.storage.node.field_az_opportunity_credit.yml +++ b/modules/custom/az_opportunity/config/install/field.storage.node.field_az_opportunity_credit.yml @@ -22,7 +22,7 @@ settings: allowed_values_function: '' module: options locked: false -cardinality: 1 +cardinality: -1 translatable: true indexes: { } persist_with_no_fields: false From e9468ee17068948c20879a214f0fccf8f44baebd Mon Sep 17 00:00:00 2001 From: Z Saenz Date: Wed, 8 Apr 2026 13:06:27 -0700 Subject: [PATCH 40/59] View Fix --- .../az_opportunity_trellis.views.inc | 40 +++++++++---------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.views.inc b/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.views.inc index 6ffecc7bd9..589a2750a9 100644 --- a/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.views.inc +++ b/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.views.inc @@ -27,140 +27,140 @@ function az_opportunity_trellis_views_data(): array { 'title' => t('Trellis Opportunity Start Options'), 'help' => t('When the opportunity usually begins'), 'field' => [ - 'id' => 'az_opportunity_trellis_views_start_options', + 'id' => 'az_opportunity_trellis_views_attribute_filter', ], ]; $data['az_opportunity_trellis_data']['Program_Format__c'] = [ 'title' => t('Trellis Opportunity Program Format'), 'help' => t('Modality for the program attendance'), 'field' => [ - 'id' => 'az_opportunity_trellis_views_modality', + 'id' => 'az_opportunity_trellis_views_attribute_filter', ], ]; $data['az_opportunity_trellis_data']['Length_Of_Program__c'] = [ 'title' => t('Trellis Opportunity Length of Program'), 'help' => t('How long does this program typically last'), 'field' => [ - 'id' => 'az_opportunity_trellis_views_length_of_program', + 'id' => 'az_opportunity_trellis_views_field', ], ]; $data['az_opportunity_trellis_data']['Incentives__c'] = [ 'title' => t('Trellis Opportunity Incentives'), 'help' => t('Does this program have incentives?'), 'field' => [ - 'id' => 'az_opportunity_trellis_views_incentives', + 'id' => 'az_opportunity_trellis_views_field', ], ]; $data['az_opportunity_trellis_data']['Credit_Type__c'] = [ 'title' => t('Trellis Opportunity Credits'), 'help' => t('What credits does this opportunity offer'), 'field' => [ - 'id' => 'az_opportunity_trellis_views_credits', + 'id' => 'az_opportunity_trellis_views_field', ], ]; $data['az_opportunity_trellis_data']['Location__c'] = [ 'title' => t('Trellis Opportunity Location'), 'help' => t('Where this opportunity takes place'), 'field' => [ - 'id' => 'az_opportunity_trellis_views_location', + 'id' => 'az_opportunity_trellis_views_field', ], ]; $data['az_opportunity_trellis_data']['Program_Website__c'] = [ 'title' => t('Trellis Opportunity Program Website'), 'help' => t('Link to Program website'), 'field' => [ - 'id' => 'az_opportunity_trellis_views_program_website', + 'id' => 'az_opportunity_trellis_views_field', ], ]; $data['az_opportunity_trellis_data']['Program_Description__c'] = [ 'title' => t('Trellis Opportunity Description'), 'help' => t('Description'), 'field' => [ - 'id' => 'az_opportunity_trellis_views_description', + 'id' => 'az_opportunity_trellis_views_field', ], ]; $data['az_opportunity_trellis_data']['Eligibility__c'] = [ 'title' => t('Trellis Opportunity Eligibility'), 'help' => t('Eligibility'), 'field' => [ - 'id' => 'az_opportunity_trellis_views_eligibility', + 'id' => 'az_opportunity_trellis_views_field', ], ]; $data['az_opportunity_trellis_data']['Topic__c'] = [ 'title' => t('Trellis Opportunity Topic'), 'help' => t('Topics'), 'field' => [ - 'id' => 'az_opportunity_trellis_views_topic', + 'id' => 'az_opportunity_trellis_views_attribute_filter', ], ]; $data['az_opportunity_trellis_data']['Audiences__c'] = [ 'title' => t('Trellis Opportunity Topic'), 'help' => t('Topics'), 'field' => [ - 'id' => 'az_opportunity_trellis_views_audiences', + 'id' => 'az_opportunity_trellis_views_attribute_filter', ], ]; $data['az_opportunity_trellis_data']['Application_Open__c'] = [ 'title' => t('Trellis Opportunity Application Open Date'), 'help' => t('When the applications are open'), 'field' => [ - 'id' => 'az_opportunity_trellis_views_application_open', + 'id' => 'az_opportunity_trellis_views_field', ], ]; $data['az_opportunity_trellis_data']['Application_Closed__c'] = [ 'title' => t('Trellis Opportunity Application Closed Date'), 'help' => t('When the applications are closed'), 'field' => [ - 'id' => 'az_opportunity_trellis_views_application_closed', + 'id' => 'az_opportunity_trellis_views_field', ], ]; $data['az_opportunity_trellis_data']['Start_Date__c'] = [ 'title' => t('Trellis Opportunity Program Start Date'), 'help' => t('When the Program starts'), 'field' => [ - 'id' => 'az_opportunity_trellis_views_program_start_date', + 'id' => 'az_opportunity_trellis_views_field', ], ]; $data['az_opportunity_trellis_data']['End_Date__c'] = [ 'title' => t('Trellis Opportunity Program End Date'), 'help' => t('When the Program ends'), 'field' => [ - 'id' => 'az_opportunity_trellis_views_program_end_date', + 'id' => 'az_opportunity_trellis_views_field', ], ]; $data['az_opportunity_trellis_data']['Ongoing__c'] = [ 'title' => t('Trellis Opportunity Ongoing'), 'help' => t('Does this opportunity repeat'), 'field' => [ - 'id' => 'az_opportunity_trellis_views_ongoing', + 'id' => 'az_opportunity_trellis_views_field', ], ]; $data['az_opportunity_trellis_data']['Last_Modified_Date'] = [ 'title' => t('Trellis Opportunity Last Modified Date'), 'help' => t('When the opportunity was last edited'), 'field' => [ - 'id' => 'az_opportunity_trellis_views_last_modified', + 'id' => 'az_opportunity_trellis_views_field', ], ]; $data['az_opportunity_trellis_data']['Parent_Account_Name'] = [ 'title' => t('Trellis Opportunity Parent Account Name'), 'help' => t('Parent Opportunity Name'), 'field' => [ - 'id' => 'az_opportunity_trellis_views_parent_name', + 'id' => 'az_opportunity_trellis_views_field', ], ]; $data['az_opportunity_trellis_data']['Parent_Id'] = [ 'title' => t('Trellis Opportunity Parent Id'), 'help' => t('Parent Opportunity ID'), 'field' => [ - 'id' => 'az_opportunity_trellis_views_parent_id', + 'id' => 'az_opportunity_trellis_views_field', ], ]; $data['az_opportunity_trellis_data']['Owner_NetID'] = [ 'title' => t('Trellis Opportunity Owner NetID'), 'help' => t('Parent Opportunity Owner Netid'), 'field' => [ - 'id' => 'az_opportunity_trellis_views_owner_netid', + 'id' => 'az_opportunity_trellis_views_field', ], ]; $data['az_opportunity_trellis_data']['Attributes'] = [ From b316dd51f9886765a23c0fafddcbe2aefb963c73 Mon Sep 17 00:00:00 2001 From: Z Saenz Date: Wed, 8 Apr 2026 17:49:39 -0700 Subject: [PATCH 41/59] Fixes multiple_values migrations for format and credits, removes broken missing handler fields --- .../az_opportunity_trellis.views.inc | 28 ------------------- ...lus.migration.az_trellis_opportunities.yml | 14 +++++----- 2 files changed, 7 insertions(+), 35 deletions(-) diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.views.inc b/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.views.inc index 589a2750a9..84b30e4d53 100644 --- a/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.views.inc +++ b/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.views.inc @@ -23,20 +23,6 @@ function az_opportunity_trellis_views_data(): array { 'id' => 'az_opportunity_trellis_views_field', ], ]; - $data['az_opportunity_trellis_data']['Start_Options__c'] = [ - 'title' => t('Trellis Opportunity Start Options'), - 'help' => t('When the opportunity usually begins'), - 'field' => [ - 'id' => 'az_opportunity_trellis_views_attribute_filter', - ], - ]; - $data['az_opportunity_trellis_data']['Program_Format__c'] = [ - 'title' => t('Trellis Opportunity Program Format'), - 'help' => t('Modality for the program attendance'), - 'field' => [ - 'id' => 'az_opportunity_trellis_views_attribute_filter', - ], - ]; $data['az_opportunity_trellis_data']['Length_Of_Program__c'] = [ 'title' => t('Trellis Opportunity Length of Program'), 'help' => t('How long does this program typically last'), @@ -86,20 +72,6 @@ function az_opportunity_trellis_views_data(): array { 'id' => 'az_opportunity_trellis_views_field', ], ]; - $data['az_opportunity_trellis_data']['Topic__c'] = [ - 'title' => t('Trellis Opportunity Topic'), - 'help' => t('Topics'), - 'field' => [ - 'id' => 'az_opportunity_trellis_views_attribute_filter', - ], - ]; - $data['az_opportunity_trellis_data']['Audiences__c'] = [ - 'title' => t('Trellis Opportunity Topic'), - 'help' => t('Topics'), - 'field' => [ - 'id' => 'az_opportunity_trellis_views_attribute_filter', - ], - ]; $data['az_opportunity_trellis_data']['Application_Open__c'] = [ 'title' => t('Trellis Opportunity Application Open Date'), 'help' => t('When the applications are open'), diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/config/install/migrate_plus.migration.az_trellis_opportunities.yml b/modules/custom/az_opportunity/az_opportunity_trellis/config/install/migrate_plus.migration.az_trellis_opportunities.yml index fca511c112..8569cbd40c 100644 --- a/modules/custom/az_opportunity/az_opportunity_trellis/config/install/migrate_plus.migration.az_trellis_opportunities.yml +++ b/modules/custom/az_opportunity/az_opportunity_trellis/config/install/migrate_plus.migration.az_trellis_opportunities.yml @@ -165,15 +165,15 @@ process: value_key: name ignore_case: true field_az_opportunity_format: + - + plugin: skip_on_empty + method: process - plugin: explode source: program_format delimiter: ', ' - plugin: multiple_values - - - plugin: skip_on_empty - method: process - plugin: static_map map: @@ -195,17 +195,17 @@ process: 'Inquire Within': inquire_within field_az_opportunity_credit: - - plugin: explode + plugin: skip_on_empty + method: process source: credit_type + - + plugin: explode delimiter: ';' - plugin: callback callable: trim - plugin: multiple_values - - - plugin: skip_on_empty - method: process - plugin: static_map map: From 93656b7420aee9251eb8931b802634dbd0764398 Mon Sep 17 00:00:00 2001 From: Z Saenz Date: Thu, 9 Apr 2026 10:28:03 -0700 Subject: [PATCH 42/59] CodeSniffer update --- .../az_opportunity_trellis/az_opportunity_trellis.module | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.module b/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.module index 87a90931c5..c9a5f2ae2c 100644 --- a/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.module +++ b/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.module @@ -15,7 +15,8 @@ use Drupal\az_opportunity_trellis\TrellisHelper; /** * Implements hook_form_FORM_ID_alter() for node_az_opportunity_edit_form. * - * Adds warning message and disables opportunity detail form elements on opportunities + * Adds warning message and disables opportunity detail + * form elements on opportunities * imported from Trellis Opportunities. */ function az_opportunity_trellis_form_node_az_opportunity_edit_form_alter(&$form, FormStateInterface $form_state, $form_id) { @@ -60,10 +61,8 @@ function az_opportunity_trellis_form_node_az_opportunity_edit_form_alter(&$form, } $no_access_fields = [ - // 'field_az_subheading', 'field_az_body', 'field_az_eligibility', - // 'field_az_attachments', ]; foreach ($no_access_fields as $field) { $form[$field]['#access'] = FALSE; From 899c7c850dd23d3c20a0aff652e6feffb1974f5b Mon Sep 17 00:00:00 2001 From: Z Saenz Date: Thu, 9 Apr 2026 16:45:35 -0700 Subject: [PATCH 43/59] Clears unnecessary changes from distribution config --- .../custom/az_core/config/install/smart_title.settings.yml | 5 +---- .../taxonomy.vocabulary.az_opportunity_categories.yml | 2 +- .../install/taxonomy.vocabulary.az_opportunity_semester.yml | 2 +- ...d.paragraph.az_view_reference.field_az_view_reference.yml | 4 ++-- 4 files changed, 5 insertions(+), 8 deletions(-) diff --git a/modules/custom/az_core/config/install/smart_title.settings.yml b/modules/custom/az_core/config/install/smart_title.settings.yml index d6eb0d7055..4c6b7a82b6 100644 --- a/modules/custom/az_core/config/install/smart_title.settings.yml +++ b/modules/custom/az_core/config/install/smart_title.settings.yml @@ -2,16 +2,13 @@ smart_title: - 'node:az_carousel_item' - 'node:az_course' - 'node:az_event' - - 'node:az_flexible_page' - 'node:az_news' + - 'node:az_flexible_page' - 'node:az_opportunity' - 'node:az_person' - 'node:az_publication' - 'taxonomy_term:az_event_categories' - 'taxonomy_term:az_news_tags' - - 'taxonomy_term:az_opportunity_modality' - - 'taxonomy_term:az_opportunity_topic' - - 'taxonomy_term:az_opportunity_type' - 'taxonomy_term:az_page_categories' - 'taxonomy_term:az_person_categories' - 'taxonomy_term:az_person_categories_secondary' diff --git a/modules/custom/az_opportunity/config/install/taxonomy.vocabulary.az_opportunity_categories.yml b/modules/custom/az_opportunity/config/install/taxonomy.vocabulary.az_opportunity_categories.yml index 1d181386fc..de94915eba 100644 --- a/modules/custom/az_opportunity/config/install/taxonomy.vocabulary.az_opportunity_categories.yml +++ b/modules/custom/az_opportunity/config/install/taxonomy.vocabulary.az_opportunity_categories.yml @@ -3,6 +3,6 @@ status: true dependencies: { } name: 'Opportunity Categories' vid: az_opportunity_categories -description: null +description: 'Taxonomy for categorizing the Opportunity content type' weight: 0 new_revision: false diff --git a/modules/custom/az_opportunity/config/install/taxonomy.vocabulary.az_opportunity_semester.yml b/modules/custom/az_opportunity/config/install/taxonomy.vocabulary.az_opportunity_semester.yml index 3aa129511a..1560c66d2e 100644 --- a/modules/custom/az_opportunity/config/install/taxonomy.vocabulary.az_opportunity_semester.yml +++ b/modules/custom/az_opportunity/config/install/taxonomy.vocabulary.az_opportunity_semester.yml @@ -3,6 +3,6 @@ status: true dependencies: { } name: 'Opportunity Semester' vid: az_opportunity_semester -description: 'Taxonomy for the Opportunity content type' +description: 'Taxonomy for the semester in Opportunity content type' weight: 0 new_revision: false diff --git a/modules/custom/az_paragraphs/az_paragraphs_view/config/install/field.field.paragraph.az_view_reference.field_az_view_reference.yml b/modules/custom/az_paragraphs/az_paragraphs_view/config/install/field.field.paragraph.az_view_reference.field_az_view_reference.yml index b90e2b8b67..3da243d0d4 100644 --- a/modules/custom/az_paragraphs/az_paragraphs_view/config/install/field.field.paragraph.az_view_reference.field_az_view_reference.yml +++ b/modules/custom/az_paragraphs/az_paragraphs_view/config/install/field.field.paragraph.az_view_reference.field_az_view_reference.yml @@ -23,8 +23,8 @@ settings: auto_create: false plugin_types: default: default - page: page block: block + page: page preselect_views: az_courses: az_courses az_events: az_events @@ -34,9 +34,9 @@ settings: az_person: az_person az_publications: az_publications enabled_settings: + pager: pager offset: offset argument: argument title: title - pager: pager limit: limit field_type: viewsreference From b6ed790f6beb70962ff2fcbe59dcc4783ba92a58 Mon Sep 17 00:00:00 2001 From: Z Saenz Date: Fri, 10 Apr 2026 14:54:43 -0700 Subject: [PATCH 44/59] Removes datepicker (date not asked for in filters) --- .../az_opportunity_trellis.libraries.yml | 18 -- .../az_opportunity_trellis_datewrapper.css | 3 - .../js/az_opportunity_trellis_date.js | 187 ------------ .../AZOpportunityTrellisViewsDateFilter.php | 289 ------------------ 4 files changed, 497 deletions(-) delete mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.libraries.yml delete mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/css/az_opportunity_trellis_datewrapper.css delete mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/js/az_opportunity_trellis_date.js delete mode 100644 modules/custom/az_opportunity/az_opportunity_trellis/src/Plugin/views/filter/AZOpportunityTrellisViewsDateFilter.php diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.libraries.yml b/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.libraries.yml deleted file mode 100644 index 02849af8d1..0000000000 --- a/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.libraries.yml +++ /dev/null @@ -1,18 +0,0 @@ -az_opportunity_trellis_date: - js: - js/az_opportunity_trellis_date.js: {} - css: - theme: - css/az_opportunity_trellis_datewrapper.css: {} - dependencies: - - core/drupal - - core/drupalSettings - - core/once - - az_opportunity_trellis/easepick_bundle -easepick_bundle: - js: - /libraries/easepick--bundle/dist/index.umd.js: { minified: true } -easepick_styles: - css: - theme: - /libraries/easepick--bundle/dist/index.css: { minified: true } diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/css/az_opportunity_trellis_datewrapper.css b/modules/custom/az_opportunity/az_opportunity_trellis/css/az_opportunity_trellis_datewrapper.css deleted file mode 100644 index 6fef13e186..0000000000 --- a/modules/custom/az_opportunity/az_opportunity_trellis/css/az_opportunity_trellis_datewrapper.css +++ /dev/null @@ -1,3 +0,0 @@ -.az-opportunity-trellis-datewrapper.views-exposed-form__item .form-item:first-child { - margin-top: 0; -} \ No newline at end of file diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/js/az_opportunity_trellis_date.js b/modules/custom/az_opportunity/az_opportunity_trellis/js/az_opportunity_trellis_date.js deleted file mode 100644 index 740110ec42..0000000000 --- a/modules/custom/az_opportunity/az_opportunity_trellis/js/az_opportunity_trellis_date.js +++ /dev/null @@ -1,187 +0,0 @@ -/** - * @file - * Trellis date picker behavior. - */ - -/* global VanillaCalendarPro */ - -((Drupal, once) => { - /** - * Normalizes begin/end input values to a calendar selectedDates array. - * - * @param {HTMLInputElement} begin - * Begin date input element. - * @param {HTMLInputElement} end - * End date input element. - * @param {Object} datePickerIntegration - * Shared date picker integration helpers. - * - * @return {string[]} - * Selected date values for Vanilla Calendar Pro. - */ - const getSelectedDatesFromInputs = (begin, end, datePickerIntegration) => { - const selectedDates = []; - const beginDate = datePickerIntegration.normalizeIsoDate(begin.value); - const endDate = datePickerIntegration.normalizeIsoDate(end.value); - if (beginDate && endDate) { - selectedDates.push(`${beginDate}:${endDate}`); - } else if (beginDate) { - selectedDates.push(beginDate); - } - return selectedDates; - }; - - Drupal.behaviors.trellisDatePicker = { - attach(context) { - const datePickerIntegration = Drupal.azCore?.datePickerIntegration; - - const elements = once('aztrellisdate', '.az-trellis-daterange', context); - elements.forEach((element) => { - const begin = element; - const id = element.dataset.azTrellisDaterangeEnd; - const end = document.getElementById(id); - - if (!end || !window.VanillaCalendarPro || !datePickerIntegration) { - return; - } - - const selectedDates = getSelectedDatesFromInputs( - begin, - end, - datePickerIntegration, - ); - - let calendarTabHandler = null; - let suppressOnHideFocus = false; - - const config = { - inputMode: true, - openOnFocus: false, - selectedTheme: 'light', - themeAttrDetect: false, - selectionDatesMode: 'multiple-ranged', - enableEdgeDatesOnly: true, - enableJumpToSelectedDate: true, - selectedDates, - onChangeToInput(self) { - const values = datePickerIntegration - .getNormalizedSelectedDates(self) - .slice(0, 2); - begin.value = values[0] || ''; - end.value = values[1] || ''; - - if (values.length === 2) { - self.hide(); - } - }, - onShow(self) { - const calendarEl = self.context.mainElement; - calendarTabHandler = (event) => { - if (event.key !== 'Tab') return; - - if ( - !datePickerIntegration.shouldExitCalendarOnTab( - event, - calendarEl, - ) - ) { - return; - } - - event.preventDefault(); - suppressOnHideFocus = true; - // onHide fires synchronously, resets inputElement to begin and focuses it. - self.hide(); - // Move focus in natural tab order around the begin/end pair. - datePickerIntegration.focusRelativeToAnchor( - calendarEl, - event.shiftKey ? begin : end, - event.shiftKey ? 'previous' : 'next', - ); - }; - calendarEl.addEventListener('keydown', calendarTabHandler); - }, - onHide(self) { - if (calendarTabHandler) { - self.context.mainElement.removeEventListener( - 'keydown', - calendarTabHandler, - ); - calendarTabHandler = null; - } - // Reset to begin input after closing so default input-mode behavior - // stays anchored to the primary field. - self.context.inputElement = begin; - if (suppressOnHideFocus) { - suppressOnHideFocus = false; - } else { - begin.focus(); - } - }, - }; - - const calendar = new VanillaCalendarPro.Calendar(begin, config); - calendar.init(); - - // Enable keyboard opening for begin input (Enter/Arrow/Space). - datePickerIntegration.bindCalendarOpenHandlers(begin, () => { - calendar.context.inputElement = begin; - calendar.show(); - }); - - const syncFromInputs = () => { - const beginRaw = String(begin.value || '').trim(); - const endRaw = String(end.value || '').trim(); - let beginValue = datePickerIntegration.normalizeIsoDate(beginRaw); - let endValue = datePickerIntegration.normalizeIsoDate(endRaw); - - // Silently discard invalid manual values. - if (beginRaw && !beginValue) { - begin.value = ''; - } - if (endRaw && !endValue) { - end.value = ''; - } - - beginValue = datePickerIntegration.normalizeIsoDate(begin.value); - endValue = datePickerIntegration.normalizeIsoDate(end.value); - - const newDates = []; - if (beginValue && endValue) { - begin.value = beginValue; - end.value = endValue; - newDates.push(`${beginValue}:${endValue}`); - } else if (beginValue) { - begin.value = beginValue; - newDates.push(beginValue); - } - - calendar.set( - { selectedDates: newDates }, - { dates: true, year: true, month: true }, - ); - }; - - // Allow direct text editing on begin/end inputs. - begin.addEventListener('change', syncFromInputs); - end.addEventListener('change', syncFromInputs); - - let endOpenQueued = false; - datePickerIntegration.bindCalendarOpenHandlers(end, () => { - if (endOpenQueued) { - return; - } - - // Treat End as the active input while opening from End so this click - // is not interpreted as an outside click by input-mode handlers. - calendar.context.inputElement = end; - endOpenQueued = true; - requestAnimationFrame(() => { - calendar.show(); - endOpenQueued = false; - }); - }); - }); - }, - }; -})(Drupal, once); diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/src/Plugin/views/filter/AZOpportunityTrellisViewsDateFilter.php b/modules/custom/az_opportunity/az_opportunity_trellis/src/Plugin/views/filter/AZOpportunityTrellisViewsDateFilter.php deleted file mode 100644 index 22bf20d20d..0000000000 --- a/modules/custom/az_opportunity/az_opportunity_trellis/src/Plugin/views/filter/AZOpportunityTrellisViewsDateFilter.php +++ /dev/null @@ -1,289 +0,0 @@ - $this->t('Next 7 Days'), - 'Next 30 Days' => $this->t('Next 30 Days'), - 'Last 7 Days' => $this->t('Last 7 Days'), - 'Last 30 Days' => $this->t('Last 30 Days'), - 'Custom' => $this->t('Custom'), - ]; - return $options; - } - - /** - * The asset resolver service. - * - * @var \Drupal\Core\Asset\AssetResolver - */ - protected $assetResolver; - - /** - * The file url generator service. - * - * @var \Drupal\Core\File\FileUrlGeneratorInterface - */ - protected $fileUrlGenerator; - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) { - $instance = new static( - $configuration, - $plugin_id, - $plugin_definition - ); - - $instance->assetResolver = $container->get('asset.resolver'); - $instance->fileUrlGenerator = $container->get('file_url_generator'); - return $instance; - } - - /** - * {@inheritdoc} - */ - protected function valueForm(&$form, FormStateInterface $form_state): void { - $form['value']['#tree'] = TRUE; - $form['#attached']['library'][] = 'az_opportunity_trellis/az_opportunity_trellis_date'; - // Trim valid options to selected options. - $options = $this->trellisDateOptions(); - $keys = $this->options['api_options'] ?? []; - $options = array_intersect($options, array_flip($keys)); - $form['value']['value'] = [ - '#type' => 'select', - '#options' => $options, - '#empty_option' => $this->t('- Any -'), - '#empty_value' => '', - '#required' => FALSE, - '#default_value' => $this->value['value'], - ]; - // Add label if this is the exposed form. - $exposed_info = $this->exposedInfo(); - if (!empty($exposed_info['label'])) { - $form['value']['value']['#title'] = $exposed_info['label']; - } - // Fetch library information for shadow DOM inclusion. - $css = []; - try { - $attached = AttachedAssets::createFromRenderArray([ - '#attached' => [ - 'library' => [ - 'az_opportunity_trellis/easepick_styles', - ], - ], - ]); - $assets = $this->assetResolver->getCssAssets($attached, TRUE); - foreach ($assets as $asset) { - if (!empty($asset['data'])) { - $css[] = $this->fileUrlGenerator->generateString($asset['data']); - } - } - } - catch (\Exception $e) { - // Failed to fetch assets. - } - $form['#attached']['drupalSettings']['trellisDatePicker']['css'] = $css; - // Prepare unique id for data attribute. - $end_id = Html::getUniqueId('az-trellis-daterange-end'); - $form['value']['begin'] = [ - '#type' => 'textfield', - '#title' => $this->t('Begin'), - '#attributes' => [ - 'data-az-trellis-daterange-end' => $end_id, - 'class' => ['az-trellis-daterange'], - ], - '#size' => 30, - '#default_value' => $this->value['begin'], - ]; - $form['value']['end'] = [ - '#type' => 'textfield', - '#title' => $this->t('End'), - '#attributes' => [ - 'id' => $end_id, - 'class' => ['az-trellis-daterange-end'], - ], - '#size' => 30, - '#default_value' => $this->value['end'], - ]; - // Compute conditional fields using states array. - if ($form_state->get('exposed')) { - $identifier = $this->options['expose']['identifier']; - $source = ':input[name="' . $identifier . '[value]"]'; - $state = [$source => ['value' => 'Custom']]; - $form['value']['begin']['#states']['visible'][] = $state; - $form['value']['end']['#states']['visible'][] = $state; - } - } - - /** - * {@inheritdoc} - */ - protected function buildValueWrapper(&$form, $wrapper_identifier) { - // Modify parent class behavior to be a container rather than a fieldset. - if (!isset($form[$wrapper_identifier])) { - $form[$wrapper_identifier] = [ - '#type' => 'container', - '#attributes' => [ - 'class' => [ - 'views-exposed-form__item', - 'az-opportunity-trellis-datewrapper', - ], - ], - ]; - } - } - - /** - * {@inheritdoc} - */ - public function operatorOptions(): array { - return [ - '=' => $this->t('Is equal to'), - '!=' => $this->t('Is not equal to'), - ]; - } - - /** - * {@inheritdoc} - */ - protected function defineOptions(): array { - $options = parent::defineOptions(); - $options['value'] = [ - 'contains' => [ - 'value' => ['default' => ''], - 'begin' => ['default' => ''], - 'end' => ['default' => ''], - ], - ]; - $options['api_param'] = ['default' => '']; - $options['api_options'] = ['default' => []]; - $options['api_param_custom_begin'] = ['default' => '']; - $options['api_param_custom_end'] = ['default' => '']; - return $options; - } - - /** - * {@inheritdoc} - */ - public function buildOptionsForm(&$form, FormStateInterface $form_state): void { - parent::buildOptionsForm($form, $form_state); - $form['api_options'] = [ - '#type' => 'select', - '#title' => $this->t('Trellis Date Options'), - '#options' => $this->trellisDateOptions(), - '#multiple' => TRUE, - '#required' => TRUE, - '#default_value' => $this->options['api_options'], - ]; - $form['api_param'] = [ - '#title' => $this->t('API get parameter for date'), - '#type' => 'textfield', - '#default_value' => $this->options['api_param'] ?? '', - '#required' => TRUE, - ]; - $form['api_param_custom_begin'] = [ - '#title' => $this->t('API get parameter for custom begin date'), - '#type' => 'textfield', - '#default_value' => $this->options['api_param_custom_begin'] ?? '', - '#required' => TRUE, - ]; - $form['api_param_custom_end'] = [ - '#title' => $this->t('API get parameter for custom end date'), - '#type' => 'textfield', - '#default_value' => $this->options['api_param_custom_end'] ?? '', - '#required' => TRUE, - ]; - - } - - /** - * {@inheritdoc} - */ - public function adminSummary() { - $prop = $this->options['api_param'] ?? ''; - $begin = $this->options['api_param_custom_begin'] ?? ''; - $end = $this->options['api_param_custom_end'] ?? ''; - return 'Date (API ' . $prop . ' ' . $begin . ' ' . $end . ') ' . $this->operator . ' ' . $this->value['value']; - } - - /** - * {@inheritdoc} - */ - public function query($group_by = FALSE): void { - if (!($this->query instanceof RemoteDataQuery)) { - return; - } - $value = $this->value['value'] ?? ''; - $this->query->addWhere( - $this->options['group'], - $this->options['api_param'], - $this->value['value'], - $this->operator - ); - // Handle supplied values if custom range. - if ($value === 'Custom') { - // Compute time offsets for API query. - $begin = $this->value['begin'] ?? ''; - $end = $this->value['end'] ?? ''; - $begin = strtotime($begin); - $end = strtotime($end); - if (($begin !== FALSE) && ($end !== FALSE)) { - // Find begin and end of respective days. - $begin = strtotime("today", $begin); - $end = strtotime("tomorrow", $end); - // Roll over to the previous night. - $end -= 1; - $begin = gmdate(self::TRELLIS_DATE_FORMAT, $begin); - $end = gmdate(self::TRELLIS_DATE_FORMAT, $end); - $this->query->addWhere( - $this->options['group'], - $this->options['api_param_custom_begin'], - $begin, - $this->operator - ); - $this->query->addWhere( - $this->options['group'], - $this->options['api_param_custom_end'], - $end, - $this->operator - ); - } - } - } - -} From 7caba714c18daa9b3e53666c26c334abd3b40a9a Mon Sep 17 00:00:00 2001 From: Z Saenz Date: Fri, 10 Apr 2026 16:31:53 -0700 Subject: [PATCH 45/59] More date_filter fix, fix parent_account_name filter --- .../az_opportunity_trellis.views.inc | 2 +- .../views.view.az_opportunity_trellis_import.yml | 4 ++-- .../config/schema/az_opportunity_trellis.schema.yml | 13 ------------- 3 files changed, 3 insertions(+), 16 deletions(-) diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.views.inc b/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.views.inc index 84b30e4d53..f9b70955c3 100644 --- a/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.views.inc +++ b/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.views.inc @@ -130,7 +130,7 @@ function az_opportunity_trellis_views_data(): array { ]; $data['az_opportunity_trellis_data']['Owner_NetID'] = [ 'title' => t('Trellis Opportunity Owner NetID'), - 'help' => t('Parent Opportunity Owner Netid'), + 'help' => t('Opportunity Owner Netid'), 'field' => [ 'id' => 'az_opportunity_trellis_views_field', ], diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/config/install/views.view.az_opportunity_trellis_import.yml b/modules/custom/az_opportunity/az_opportunity_trellis/config/install/views.view.az_opportunity_trellis_import.yml index 18524c5346..4f8a84b82b 100644 --- a/modules/custom/az_opportunity/az_opportunity_trellis/config/install/views.view.az_opportunity_trellis_import.yml +++ b/modules/custom/az_opportunity/az_opportunity_trellis/config/install/views.view.az_opportunity_trellis_import.yml @@ -652,7 +652,7 @@ display: operator: property_4_op operator_limit_selection: false operator_list: { } - identifier: parent_account_name + identifier: parent_account required: false remember: false multiple: false @@ -670,7 +670,7 @@ display: default_group: All default_group_multiple: { } group_items: { } - property_path: parent_account_name + property_path: parent_account property_5: id: property_5 table: az_opportunity_trellis_data diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/config/schema/az_opportunity_trellis.schema.yml b/modules/custom/az_opportunity/az_opportunity_trellis/config/schema/az_opportunity_trellis.schema.yml index c0e5e1b44f..a571572fbe 100644 --- a/modules/custom/az_opportunity/az_opportunity_trellis/config/schema/az_opportunity_trellis.schema.yml +++ b/modules/custom/az_opportunity/az_opportunity_trellis/config/schema/az_opportunity_trellis.schema.yml @@ -1,16 +1,3 @@ -views.filter_value.az_opportunity_trellis_views_date_filter: - type: views_filter - label: 'Trellis filter' - mapping: - value: - type: string - label: 'Value' - begin: - type: string - label: 'Custom Date Range Begin' - end: - type: string - label: 'Custom Date Range End' az_opportunity_trellis.az_opp_recurring_import_rule.*: type: config_entity label: Trellis Opportunity Import From 5e1e39b796d55e83999d1323e494f9e254694c7f Mon Sep 17 00:00:00 2001 From: Dana Hertzberg <59745109+danahertzberg@users.noreply.github.com> Date: Mon, 13 Apr 2026 10:16:47 -0400 Subject: [PATCH 46/59] Opportunity content type visual changes (#5485) * Update default display * Update default display of dates (ap date style) * Update Row content type display * Update views and content type displays --- ...ew_display.node.az_opportunity.az_card.yml | 303 ++++-------------- ...iew_display.node.az_opportunity.az_row.yml | 109 ++++--- ...splay.node.az_opportunity.az_small_row.yml | 156 ++------- ...ew_display.node.az_opportunity.default.yml | 215 +++++-------- .../install/views.view.az_opportunity.yml | 11 +- 5 files changed, 245 insertions(+), 549 deletions(-) diff --git a/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_card.yml b/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_card.yml index 6328334558..93914a05b2 100644 --- a/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_card.yml +++ b/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_card.yml @@ -22,198 +22,24 @@ dependencies: - field.field.node.az_opportunity.field_az_trellis_imported_date - node.type.az_opportunity module: - - datetime_range + - date_ap_style - field_group - smart_title - user third_party_settings: field_group: - group_col1: - children: { } - label: col1 - parent_name: '' - region: hidden - weight: 14 - format_type: html_element - format_settings: - classes: col - show_empty_fields: false - id: '' - label_as_html: false - element: div - show_label: false - label_element: h3 - label_element_classes: '' - attributes: '' - effect: none - speed: fast - group_col2: - children: { } - label: col2 - parent_name: '' - region: hidden - weight: 15 - format_type: html_element - format_settings: - classes: col - show_empty_fields: false - id: '' - label_as_html: false - element: div - show_label: false - label_element: h3 - label_element_classes: '' - attributes: '' - effect: none - speed: fast - group_col3: - children: { } - label: col3 - parent_name: '' - region: hidden - weight: 17 - format_type: html_element - format_settings: - classes: col - show_empty_fields: false - id: '' - label_as_html: false - element: div - show_label: false - label_element: h3 - label_element_classes: '' - attributes: '' - effect: none - speed: fast - group_col4: - children: { } - label: col4 - parent_name: '' - region: hidden - weight: 18 - format_type: html_element - format_settings: - classes: col - show_empty_fields: false - id: '' - label_as_html: false - element: div - show_label: false - label_element: h3 - label_element_classes: '' - attributes: '' - effect: none - speed: fast - group_col5: - children: { } - label: col5 - parent_name: '' - region: hidden - weight: 19 - format_type: html_element - format_settings: - classes: col - show_empty_fields: false - id: '' - label_as_html: false - element: div - show_label: false - label_element: h3 - label_element_classes: '' - attributes: '' - effect: none - speed: fast - group_col6: - children: { } - label: col6 - parent_name: '' - region: hidden - weight: 16 - format_type: html_element - format_settings: - classes: col - show_empty_fields: false - id: '' - label_as_html: false - element: div - show_label: false - label_element: h3 - label_element_classes: '' - attributes: '' - effect: none - speed: fast - group_col7: - children: { } - label: col7 - parent_name: '' - region: hidden - weight: 20 - format_type: html_element - format_settings: - classes: col7 - show_empty_fields: false - id: '' - label_as_html: false - element: div - show_label: false - label_element: h3 - label_element_classes: '' - attributes: '' - effect: none - speed: fast - group_col8: - children: { } - label: col8 - parent_name: '' - region: hidden - weight: 21 - format_type: html_element - format_settings: - classes: col - show_empty_fields: false - id: '' - label_as_html: false - element: div - show_label: false - label_element: h3 - label_element_classes: '' - attributes: '' - effect: none - speed: fast - group_header_row: - children: - - group_card_clickable - - field_az_parent_account - - field_az_program_length - - links - - group_read_more - label: 'header row' - parent_name: '' - region: hidden - weight: 13 - format_type: html_element - format_settings: - classes: row - show_empty_fields: false - id: '' - label_as_html: false - element: div - show_label: false - label_element: h3 - label_element_classes: '' - attributes: '' - effect: none - speed: fast group_card_clickable: children: + - group_heading + - group_text_body_secondary - group_link label: 'Card Clickable' - parent_name: group_header_row + parent_name: '' region: content weight: 0 format_type: html_element format_settings: - classes: 'card border-0 mb-4 hover' + classes: 'card card-body mb-3 hover shadow h-100' show_empty_fields: false id: '' label_as_html: false @@ -226,15 +52,14 @@ third_party_settings: speed: fast group_link: children: - - group_heading - - group_text_body_secondary + - links label: Link parent_name: group_card_clickable region: content - weight: 16 + weight: 3 format_type: link format_settings: - classes: 'card-body p-0 stretched-link link-primary text-decoration-none' + classes: stretched-link show_empty_fields: false id: '' label_as_html: false @@ -245,16 +70,16 @@ third_party_settings: children: - smart_title label: Heading - parent_name: group_link + parent_name: group_card_clickable region: content - weight: 18 + weight: 1 format_type: html_element format_settings: - classes: 'card-title text-midnight h5 mb-0' + classes: 'card-title text-midnight h5 mb-2 hover-text-underline' show_empty_fields: false id: '' label_as_html: false - element: h4 + element: h3 show_label: false label_element: h3 label_element_classes: '' @@ -263,55 +88,16 @@ third_party_settings: speed: fast group_text_body_secondary: children: - - field_az_opportunity_location + - field_az_program_date - field_az_application_date - - field_az_offered + - field_az_opportunity_location label: 'Text Body Secondary' - parent_name: group_link + parent_name: group_card_clickable region: content - weight: 20 - format_type: html_element - format_settings: - classes: 'text-body-secondary fw-normal small mt-2' - show_empty_fields: false - id: '' - label_as_html: false - element: div - show_label: false - label_element: h3 - label_element_classes: '' - attributes: '' - effect: none - speed: fast - group_read_more: - children: - - group_read_more_text - label: 'Read more' - parent_name: group_header_row - region: hidden - weight: 6 - format_type: html_element - format_settings: - classes: mt-2 - show_empty_fields: false - id: '' - label_as_html: false - element: div - show_label: false - label_element: h3 - label_element_classes: '' - attributes: '' - effect: none - speed: fast - group_read_more_text: - children: { } - label: 'Read more text' - parent_name: group_read_more - region: hidden - weight: 4 + weight: 2 format_type: html_element format_settings: - classes: 'text-start hover-text-underline' + classes: 'small card-text' show_empty_fields: false id: '' label_as_html: false @@ -334,36 +120,62 @@ bundle: az_opportunity mode: az_card content: field_az_application_date: - type: daterange_default + type: daterange_ap_style label: inline settings: - timezone_override: '' - format_type: html_date - from_to: both - separator: '-' + always_display_year: false + use_today: false + cap_today: false + display_day: false + display_time: false + hide_date: false + time_before_date: false + display_noon_and_midnight: false + capitalize_noon_and_midnight: false + use_all_day: false + separator: endash + timezone: '' + month_only: false third_party_settings: { } weight: 9 region: content - field_az_offered: - type: entity_reference_label + field_az_opportunity_location: + type: string label: inline settings: - link: false + link_to_entity: false third_party_settings: { } weight: 10 region: content - field_az_opportunity_location: - type: string + field_az_program_date: + type: daterange_ap_style label: inline settings: - link_to_entity: false + always_display_year: false + use_today: false + cap_today: false + display_day: false + display_time: false + hide_date: false + time_before_date: false + display_noon_and_midnight: false + capitalize_noon_and_midnight: false + use_all_day: false + separator: endash + timezone: '' + month_only: false + third_party_settings: { } + weight: 8 + region: content + links: + settings: { } third_party_settings: { } - weight: 7 + weight: 0 region: content smart_title: settings: { } third_party_settings: { } - weight: 3 + weight: 1 region: content hidden: field_az_application_link: true @@ -371,13 +183,12 @@ hidden: field_az_eligibility: true field_az_enterprise_attributes: true field_az_incentives: true + field_az_offered: true field_az_ongoing: true field_az_opportunity_category: true field_az_opportunity_credit: true field_az_parent_account: true - field_az_program_date: true field_az_program_length: true field_az_program_website: true field_az_trellis_id: true field_az_trellis_imported_date: true - links: true diff --git a/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_row.yml b/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_row.yml index 7a638b3236..70e9052b63 100644 --- a/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_row.yml +++ b/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_row.yml @@ -22,7 +22,7 @@ dependencies: - field.field.node.az_opportunity.field_az_trellis_imported_date - node.type.az_opportunity module: - - datetime_range + - date_ap_style - field_group - smart_title - user @@ -31,13 +31,14 @@ third_party_settings: group_row_wrap: children: - group_opportunity_link + - group_row label: 'row wrap' parent_name: '' region: content - weight: 0 + weight: 1 format_type: html_element format_settings: - classes: 'position-relative d-block list-group-item-action' + classes: 'position-relative d-block list-group-item-action hover container' show_empty_fields: false id: '' label_as_html: false @@ -51,11 +52,10 @@ third_party_settings: group_opportunity_link: children: - links - - group_row label: 'opportunity link' parent_name: group_row_wrap region: content - weight: 1 + weight: 0 format_type: link format_settings: classes: 'text-decoration-none stretched-link' @@ -68,16 +68,16 @@ third_party_settings: group_row: children: - group_col_1 - - group_col_2 - group_col_4 + - group_col_2 - group_col_3 label: row - parent_name: group_opportunity_link + parent_name: group_row_wrap region: content - weight: 8 + weight: 2 format_type: html_element format_settings: - classes: row + classes: 'row shadow-sm p-2 p-md-1 border rounded' show_empty_fields: false id: '' label_as_html: false @@ -94,10 +94,10 @@ third_party_settings: label: 'col 1' parent_name: group_row region: content - weight: 3 + weight: 2 format_type: html_element format_settings: - classes: col-4 + classes: 'col-12 col-md-4 align-content-center' show_empty_fields: false id: '' label_as_html: false @@ -111,104 +111,123 @@ third_party_settings: group_col_2: children: - field_az_application_date - label: 'col 2' + label: 'Application date' parent_name: group_row region: content weight: 4 format_type: html_element format_settings: - classes: col-3 + classes: 'col-12 col-md-3' show_empty_fields: false id: '' label_as_html: false element: div - show_label: false - label_element: h3 - label_element_classes: '' + show_label: true + label_element: h4 + label_element_classes: 'fs-6 fw-bold mb-0 mt-2 mt-md-1' attributes: '' effect: none speed: fast group_col_3: children: - field_az_opportunity_location - label: 'Col 3' + label: Location parent_name: group_row region: content - weight: 6 + weight: 5 format_type: html_element format_settings: - classes: col-2 + classes: 'col-12 col-md-2' show_empty_fields: false id: '' label_as_html: false element: div - show_label: false - label_element: h3 - label_element_classes: '' + show_label: true + label_element: h4 + label_element_classes: 'fs-6 fw-bold mb-0 mt-2 mt-md-1' attributes: '' effect: none speed: fast group_col_4: children: - field_az_program_date - label: 'col 4' + label: 'Program Date' parent_name: group_row region: content - weight: 5 + weight: 3 format_type: html_element format_settings: - classes: col-3 + classes: 'col-12 col-md-3' show_empty_fields: false id: '' label_as_html: false element: div - show_label: false - label_element: h3 - label_element_classes: '' + show_label: true + label_element: h4 + label_element_classes: 'fs-6 fw-bold mb-0 mt-2 mt-md-1' attributes: '' effect: none speed: fast smart_title: enabled: true settings: - smart_title__link: true - smart_title__tag: h2 + smart_title__link: false + smart_title__tag: h3 smart_title__classes: - - node__title - h5 - - m-0 + - my-2 + - my-md-0 + - hover-text-underline id: node.az_opportunity.az_row targetEntityType: node bundle: az_opportunity mode: az_row content: field_az_application_date: - type: daterange_default - label: inline + type: daterange_ap_style + label: hidden settings: - timezone_override: '' - format_type: html_date - from_to: both - separator: '-' + always_display_year: false + use_today: false + cap_today: false + display_day: false + display_time: false + hide_date: false + time_before_date: false + display_noon_and_midnight: false + capitalize_noon_and_midnight: false + use_all_day: false + separator: endash + timezone: '' + month_only: false third_party_settings: { } weight: 13 region: content field_az_opportunity_location: type: string - label: inline + label: hidden settings: link_to_entity: false third_party_settings: { } weight: 9 region: content field_az_program_date: - type: daterange_default - label: inline + type: daterange_ap_style + label: hidden settings: - timezone_override: '' - format_type: html_date - from_to: both - separator: '-' + always_display_year: false + use_today: false + cap_today: false + display_day: false + display_time: false + hide_date: false + time_before_date: false + display_noon_and_midnight: false + capitalize_noon_and_midnight: false + use_all_day: false + separator: endash + timezone: '' + month_only: false third_party_settings: { } weight: 1 region: content diff --git a/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_small_row.yml b/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_small_row.yml index 80576f4d67..327a06352a 100644 --- a/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_small_row.yml +++ b/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.az_small_row.yml @@ -22,7 +22,7 @@ dependencies: - field.field.node.az_opportunity.field_az_trellis_imported_date - node.type.az_opportunity module: - - datetime_range + - date_ap_style - field_group - smart_title - user @@ -34,10 +34,10 @@ third_party_settings: label: col1 parent_name: group_header_row region: content - weight: 7 + weight: 21 format_type: html_element format_settings: - classes: col + classes: 'col-12 col-md-6' show_empty_fields: false id: '' label_as_html: true @@ -54,86 +54,10 @@ third_party_settings: label: col2 parent_name: group_header_row region: content - weight: 8 - format_type: html_element - format_settings: - classes: col - show_empty_fields: false - id: '' - label_as_html: false - element: div - show_label: false - label_element: h3 - label_element_classes: '' - attributes: '' - effect: none - speed: fast - group_col3: - children: { } - label: col3 - parent_name: '' - region: hidden - weight: 20 - format_type: html_element - format_settings: - classes: col - show_empty_fields: false - id: '' - label_as_html: false - element: div - show_label: false - label_element: h3 - label_element_classes: '' - attributes: '' - effect: none - speed: fast - group_col4: - children: { } - label: col4 - parent_name: '' - region: hidden - weight: 21 - format_type: html_element - format_settings: - classes: col - show_empty_fields: false - id: '' - label_as_html: false - element: div - show_label: false - label_element: h3 - label_element_classes: '' - attributes: '' - effect: none - speed: fast - group_col5: - children: { } - label: col5 - parent_name: '' - region: hidden weight: 22 format_type: html_element format_settings: - classes: col - show_empty_fields: false - id: '' - label_as_html: false - element: div - show_label: false - label_element: h3 - label_element_classes: '' - attributes: '' - effect: none - speed: fast - group_col6: - children: { } - label: col6 - parent_name: '' - region: hidden - weight: 23 - format_type: html_element - format_settings: - classes: col + classes: 'col-12 col-md-6' show_empty_fields: false id: '' label_as_html: false @@ -144,34 +68,17 @@ third_party_settings: attributes: '' effect: none speed: fast - group_col7: - children: { } - label: col7 - parent_name: '' - region: hidden - weight: 24 - format_type: html_element - format_settings: - classes: col7 - show_empty_fields: false - id: '' - label_as_html: false - element: div - show_label: false - label_element: h3 - label_element_classes: '' - attributes: '' - effect: none - speed: fast - group_col8: - children: { } - label: col8 - parent_name: '' - region: hidden - weight: 25 + group_header_row: + children: + - group_col1 + - group_col2 + label: 'header row' + parent_name: group_container + region: content + weight: 1 format_type: html_element format_settings: - classes: col + classes: 'row border-bottom pb-2 mb-2' show_empty_fields: false id: '' label_as_html: false @@ -182,17 +89,16 @@ third_party_settings: attributes: '' effect: none speed: fast - group_header_row: + group_container: children: - - group_col1 - - group_col2 - label: 'header row' + - group_header_row + label: Container parent_name: '' region: content weight: 0 format_type: html_element format_settings: - classes: row + classes: container show_empty_fields: false id: '' label_as_html: false @@ -207,25 +113,33 @@ third_party_settings: enabled: true settings: smart_title__link: true - smart_title__tag: h5 + smart_title__tag: h3 smart_title__classes: - - node__title + - fs-5 - fw-bold - - mt-0 - - mb-0 + - m-0 id: node.az_opportunity.az_small_row targetEntityType: node bundle: az_opportunity mode: az_small_row content: field_az_application_date: - type: daterange_default - label: hidden + type: daterange_ap_style + label: inline settings: - timezone_override: '' - format_type: short - from_to: both - separator: '-' + always_display_year: false + use_today: false + cap_today: false + display_day: false + display_time: false + hide_date: false + time_before_date: false + display_noon_and_midnight: false + capitalize_noon_and_midnight: false + use_all_day: false + separator: endash + timezone: '' + month_only: false third_party_settings: { } weight: 5 region: content diff --git a/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.default.yml b/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.default.yml index 6382e83e57..54c060a90f 100644 --- a/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.default.yml +++ b/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.default.yml @@ -21,7 +21,7 @@ dependencies: - field.field.node.az_opportunity.field_az_trellis_imported_date - node.type.az_opportunity module: - - datetime_range + - date_ap_style - field_group - link - options @@ -39,7 +39,7 @@ third_party_settings: weight: 1 format_type: html_element format_settings: - classes: col + classes: 'col-12 col-sm-6 col-lg p-card' show_empty_fields: false id: '' label_as_html: false @@ -50,54 +50,16 @@ third_party_settings: attributes: '' effect: none speed: fast - group_col2: - children: { } - label: col2 - parent_name: '' - region: hidden - weight: 13 - format_type: html_element - format_settings: - classes: col - show_empty_fields: false - id: '' - label_as_html: false - element: div - show_label: false - label_element: h3 - label_element_classes: '' - attributes: '' - effect: none - speed: fast group_col3: children: - group_program_length - label: col3 + label: col2 parent_name: group_header_row region: content - weight: 2 - format_type: html_element - format_settings: - classes: col - show_empty_fields: false - id: '' - label_as_html: false - element: div - show_label: false - label_element: h3 - label_element_classes: '' - attributes: '' - effect: none - speed: fast - group_col4: - children: { } - label: col4 - parent_name: '' - region: hidden - weight: 10 + weight: 3 format_type: html_element format_settings: - classes: col + classes: 'col-12 col-sm-6 col-lg p-card' show_empty_fields: false id: '' label_as_html: false @@ -111,33 +73,13 @@ third_party_settings: group_col5: children: - group_incentives - label: col5 + label: col3 parent_name: group_header_row region: content - weight: 3 - format_type: html_element - format_settings: - classes: col - show_empty_fields: false - id: '' - label_as_html: false - element: div - show_label: false - label_element: h3 - label_element_classes: '' - attributes: '' - effect: none - speed: fast - group_col6: - children: - - group_audiences - label: col6 - parent_name: '' - region: hidden - weight: 11 + weight: 4 format_type: html_element format_settings: - classes: col + classes: 'col-12 col-sm-6 col-lg p-card' show_empty_fields: false id: '' label_as_html: false @@ -151,14 +93,13 @@ third_party_settings: group_col7: children: - group_date - - group_modality - label: col7 + label: col4 parent_name: group_header_row region: content - weight: 4 + weight: 5 format_type: html_element format_settings: - classes: col + classes: 'col-12 col-sm-6 col-lg p-card' show_empty_fields: false id: '' label_as_html: false @@ -172,13 +113,13 @@ third_party_settings: group_col8: children: - group_topics - label: col8 + label: col5 parent_name: group_header_row region: content weight: 6 format_type: html_element format_settings: - classes: col + classes: 'col-12 col-sm-6 col-lg p-card' show_empty_fields: false id: '' label_as_html: false @@ -197,12 +138,12 @@ third_party_settings: - group_col7 - group_col8 label: 'header row' - parent_name: '' + parent_name: group_container region: content - weight: 0 + weight: 1 format_type: html_element format_settings: - classes: 'row text-bg-cool-gray rounded pb-4 mb-4' + classes: 'row rounded border' show_empty_fields: false id: '' label_as_html: false @@ -229,7 +170,7 @@ third_party_settings: element: div show_label: true label_element: h2 - label_element_classes: 'h4 fw-bolder' + label_element_classes: 'h5 fw-bolder mt-0' attributes: '' effect: none speed: fast @@ -250,26 +191,7 @@ third_party_settings: element: div show_label: true label_element: h2 - label_element_classes: 'h4 fw-bolder' - attributes: '' - effect: none - speed: fast - group_modality: - children: { } - label: 'Parent Account' - parent_name: group_col7 - region: hidden - weight: 6 - format_type: html_element - format_settings: - classes: '' - show_empty_fields: false - id: '' - label_as_html: false - element: div - show_label: true - label_element: h2 - label_element_classes: 'h4 fw-bolder' + label_element_classes: 'h5 fw-bolder mt-0' attributes: '' effect: none speed: fast @@ -290,26 +212,7 @@ third_party_settings: element: div show_label: true label_element: h2 - label_element_classes: 'h4 fw-bolder' - attributes: '' - effect: none - speed: fast - group_audiences: - children: { } - label: Audiences - parent_name: group_col6 - region: hidden - weight: 5 - format_type: html_element - format_settings: - classes: '' - show_empty_fields: false - id: '' - label_as_html: false - element: div - show_label: true - label_element: h2 - label_element_classes: 'h4 fw-bolder' + label_element_classes: 'h5 fw-bolder mt-0' attributes: '' effect: none speed: fast @@ -329,8 +232,8 @@ third_party_settings: label_as_html: false element: div show_label: true - label_element: h4 - label_element_classes: 'h4 fw-bolder' + label_element: h2 + label_element_classes: 'h5 fw-bolder mt-0' attributes: '' effect: none speed: fast @@ -351,19 +254,20 @@ third_party_settings: element: div show_label: true label_element: h2 - label_element_classes: 'h4 fw-bolder' + label_element_classes: 'h5 fw-bolder mt-0' attributes: '' effect: none speed: fast - group_bottom_row: - children: { } - label: 'Bottom Row' + group_container: + children: + - group_header_row + label: container parent_name: '' - region: hidden - weight: 12 + region: content + weight: 0 format_type: html_element format_settings: - classes: row + classes: container show_empty_fields: false id: '' label_as_html: false @@ -374,6 +278,29 @@ third_party_settings: attributes: '' effect: none speed: fast + group_content_row: + children: + - field_az_opportunity_category + - field_az_body + - field_az_eligibility + - links + label: 'Content row' + parent_name: '' + region: content + weight: 5 + format_type: html_element + format_settings: + classes: 'row mb-5' + show_empty_fields: true + id: '' + label_as_html: false + element: div + show_label: false + label_element: h3 + label_element_classes: '' + attributes: '' + effect: none + speed: fast smart_title: enabled: false id: node.az_opportunity.default @@ -382,13 +309,22 @@ bundle: az_opportunity mode: default content: field_az_application_date: - type: daterange_default + type: daterange_ap_style label: hidden settings: - timezone_override: '' - format_type: html_date - from_to: both - separator: '-' + always_display_year: false + use_today: false + cap_today: false + display_day: false + display_time: false + hide_date: false + time_before_date: false + display_noon_and_midnight: false + capitalize_noon_and_midnight: false + use_all_day: false + separator: endash + timezone: '' + month_only: false third_party_settings: { } weight: 7 region: content @@ -458,13 +394,22 @@ content: weight: 4 region: content field_az_program_date: - type: daterange_default + type: daterange_ap_style label: hidden settings: - timezone_override: '' - format_type: html_date - from_to: both - separator: '-' + always_display_year: false + use_today: false + cap_today: false + display_day: false + display_time: false + hide_date: false + time_before_date: false + display_noon_and_midnight: false + capitalize_noon_and_midnight: false + use_all_day: false + separator: endash + timezone: '' + month_only: false third_party_settings: { } weight: 7 region: content diff --git a/modules/custom/az_opportunity/config/install/views.view.az_opportunity.yml b/modules/custom/az_opportunity/config/install/views.view.az_opportunity.yml index 09bdee31a5..1ad01e323e 100644 --- a/modules/custom/az_opportunity/config/install/views.view.az_opportunity.yml +++ b/modules/custom/az_opportunity/config/install/views.view.az_opportunity.yml @@ -11,6 +11,7 @@ dependencies: - node - options - user + - views_bootstrap id: az_opportunity label: 'AZ Opportunity' module: views @@ -411,12 +412,18 @@ display: position: 1 display_options: style: - type: default + type: views_bootstrap_grid options: - grouping: { } row_class: '' default_row_class: true uses_fields: false + grid_class: '' + col_xs: col-12 + col_sm: none + col_md: col-md-6 + col_lg: col-lg-4 + col_xl: none + col_xxl: none row: type: 'entity:node' options: From 10ececdef2210d1b92ac2cc156dbba85c690d0ce Mon Sep 17 00:00:00 2001 From: Kevin Lu <79181817+kevdevlu@users.noreply.github.com> Date: Fri, 17 Apr 2026 10:07:07 +0000 Subject: [PATCH 47/59] Address reviewer feedback and fix recurring import API param mismatch MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Fix AZRecurringImportRule::getQueryParameters() to send `parent_account` instead of `parent_account_name` — the Boomi search API does not recognize `parent_account_name` and silently returns all results - Remove Parent ID column from the Trellis import admin results view per Dana's feedback - Relabel "Account ID" filter to "Opportunity ID" with help text per Dana's feedback Co-Authored-By: Claude Sonnet 4.6 --- ...ews.view.az_opportunity_trellis_import.yml | 54 +------------------ .../src/Entity/AZRecurringImportRule.php | 2 +- 2 files changed, 3 insertions(+), 53 deletions(-) diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/config/install/views.view.az_opportunity_trellis_import.yml b/modules/custom/az_opportunity/az_opportunity_trellis/config/install/views.view.az_opportunity_trellis_import.yml index 4f8a84b82b..002310454e 100644 --- a/modules/custom/az_opportunity/az_opportunity_trellis/config/install/views.view.az_opportunity_trellis_import.yml +++ b/modules/custom/az_opportunity/az_opportunity_trellis/config/install/views.view.az_opportunity_trellis_import.yml @@ -375,56 +375,6 @@ display: empty_zero: false hide_alter_empty: true property_path: Program_Type__c - property_4: - id: property_4 - table: az_opportunity_trellis_data - field: property - relationship: none - group_type: group - admin_label: '' - plugin_id: views_remote_data_property - label: 'Parent ID' - exclude: false - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: false - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - property_path: Parent_Id property_6: id: property_6 table: az_opportunity_trellis_data @@ -607,8 +557,8 @@ display: exposed: true expose: operator_id: property_2_op - label: 'Account ID' - description: '' + label: 'Opportunity ID' + description: 'The ID of the Program''s Account' use_operator: false operator: property_2_op operator_limit_selection: false diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/src/Entity/AZRecurringImportRule.php b/modules/custom/az_opportunity/az_opportunity_trellis/src/Entity/AZRecurringImportRule.php index 2d5d0755d9..110cd0b18f 100644 --- a/modules/custom/az_opportunity/az_opportunity_trellis/src/Entity/AZRecurringImportRule.php +++ b/modules/custom/az_opportunity/az_opportunity_trellis/src/Entity/AZRecurringImportRule.php @@ -104,7 +104,7 @@ public function getQueryParameters() { $params += $attributes; $params['keyword'] = $this->get('keyword') ?? ''; $params['owner'] = $this->get('owner') ?? ''; - $params['parent_account_name'] = $this->get('parent_account_name') ?? ''; + $params['parent_account'] = $this->get('parent_account_name') ?? ''; $params = array_filter($params); return $params; } From 2ecf674284f9520e2ab899527420ebc18431ab08 Mon Sep 17 00:00:00 2001 From: Kevin Lu <79181817+kevdevlu@users.noreply.github.com> Date: Fri, 17 Apr 2026 11:10:03 +0000 Subject: [PATCH 48/59] Move opportunity category tags to bottom of node display, render horizontally - Adds group_tags field group to move field_az_opportunity_category below body and eligibility content, per Dana's feedback - Adds az_opportunity.module, az_opportunity.libraries.yml, and css/az_opportunity.css to load flex styles scoped to the content type, following the az_person module pattern Co-Authored-By: Claude Sonnet 4.6 --- .../az_opportunity.libraries.yml | 6 +++++ .../az_opportunity/az_opportunity.module | 15 ++++++++++++ ...ew_display.node.az_opportunity.default.yml | 23 +++++++++++++++++-- .../az_opportunity/css/az_opportunity.css | 11 +++++++++ 4 files changed, 53 insertions(+), 2 deletions(-) create mode 100644 modules/custom/az_opportunity/az_opportunity.libraries.yml create mode 100644 modules/custom/az_opportunity/az_opportunity.module create mode 100644 modules/custom/az_opportunity/css/az_opportunity.css diff --git a/modules/custom/az_opportunity/az_opportunity.libraries.yml b/modules/custom/az_opportunity/az_opportunity.libraries.yml new file mode 100644 index 0000000000..580f650c10 --- /dev/null +++ b/modules/custom/az_opportunity/az_opportunity.libraries.yml @@ -0,0 +1,6 @@ +az_opportunity: + css: + theme: + css/az_opportunity.css: {} + dependencies: + - az_barrio/arizona-bootstrap-css diff --git a/modules/custom/az_opportunity/az_opportunity.module b/modules/custom/az_opportunity/az_opportunity.module new file mode 100644 index 0000000000..e4e8247bb4 --- /dev/null +++ b/modules/custom/az_opportunity/az_opportunity.module @@ -0,0 +1,15 @@ +getType() === 'az_opportunity') { + $variables['#attached']['library'][] = 'az_opportunity/az_opportunity'; + } +} diff --git a/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.default.yml b/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.default.yml index 54c060a90f..836e96493c 100644 --- a/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.default.yml +++ b/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.default.yml @@ -278,9 +278,28 @@ third_party_settings: attributes: '' effect: none speed: fast - group_content_row: + group_tags: children: - field_az_opportunity_category + label: Tags + parent_name: '' + region: content + weight: 20 + format_type: html_element + format_settings: + classes: '' + show_empty_fields: false + id: '' + label_as_html: false + element: div + show_label: false + label_element: h3 + label_element_classes: '' + attributes: '' + effect: none + speed: fast + group_content_row: + children: - field_az_body - field_az_eligibility - links @@ -376,7 +395,7 @@ content: view_mode: az_badge link: false third_party_settings: { } - weight: 1 + weight: 20 region: content field_az_opportunity_credit: type: list_default diff --git a/modules/custom/az_opportunity/css/az_opportunity.css b/modules/custom/az_opportunity/css/az_opportunity.css new file mode 100644 index 0000000000..c4c8554008 --- /dev/null +++ b/modules/custom/az_opportunity/css/az_opportunity.css @@ -0,0 +1,11 @@ +/** + * @file + * Styles for the az_opportunity content type. + */ + +.field--name-field-az-opportunity-category.field__items { + display: flex; + flex-wrap: wrap; + gap: 0.5rem; + padding-bottom: 1.5rem; +} From f08b6c6014682794744b645795b1fee7edd5d35f Mon Sep 17 00:00:00 2001 From: Kevin Lu <79181817+kevdevlu@users.noreply.github.com> Date: Fri, 24 Apr 2026 06:03:36 -0700 Subject: [PATCH 49/59] Use lower case in "Trellis opportunity importer" Matches existing tab titles convention for Content Subtabs Co-authored-by: Dana Hertzberg <59745109+danahertzberg@users.noreply.github.com> --- .../az_opportunity_trellis.links.task.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.links.task.yml b/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.links.task.yml index 1ab4e71584..bb1e30e836 100644 --- a/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.links.task.yml +++ b/modules/custom/az_opportunity/az_opportunity_trellis/az_opportunity_trellis.links.task.yml @@ -5,7 +5,7 @@ az_opportunity_trellis.az_opportunity_trellis_settings_task: weight: 0 az_opportunity.import_form_task: - title: 'Trellis Opportunity Importer' + title: 'Trellis opportunity importer' route_name: view.az_opportunity_trellis_import.page_1 parent_id: system.admin_content description: 'Import opportunities from the Trellis Opportunity API.' From b85b4e84ee5aab685852340bd01487937a91e69e Mon Sep 17 00:00:00 2001 From: Kevin Lu <79181817+kevdevlu@users.noreply.github.com> Date: Fri, 24 Apr 2026 06:40:38 -0700 Subject: [PATCH 50/59] Update trellis importer title row, entity view display structure * Trellis Importer: Rename NetID to "Owner NetID" in results table title * Entity View Display: Move Category tags into Content Row (`group_content_row`), remove unneeded `group_tags` --- ...ews.view.az_opportunity_trellis_import.yml | 2 +- ...ew_display.node.az_opportunity.default.yml | 23 ++----------------- 2 files changed, 3 insertions(+), 22 deletions(-) diff --git a/modules/custom/az_opportunity/az_opportunity_trellis/config/install/views.view.az_opportunity_trellis_import.yml b/modules/custom/az_opportunity/az_opportunity_trellis/config/install/views.view.az_opportunity_trellis_import.yml index 002310454e..2bf1b75a72 100644 --- a/modules/custom/az_opportunity/az_opportunity_trellis/config/install/views.view.az_opportunity_trellis_import.yml +++ b/modules/custom/az_opportunity/az_opportunity_trellis/config/install/views.view.az_opportunity_trellis_import.yml @@ -183,7 +183,7 @@ display: group_type: group admin_label: '' plugin_id: views_remote_data_property - label: NetID + label: 'Owner NetID' exclude: false alter: alter_text: false diff --git a/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.default.yml b/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.default.yml index 836e96493c..2d2dc0d792 100644 --- a/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.default.yml +++ b/modules/custom/az_opportunity/config/install/core.entity_view_display.node.az_opportunity.default.yml @@ -278,31 +278,12 @@ third_party_settings: attributes: '' effect: none speed: fast - group_tags: - children: - - field_az_opportunity_category - label: Tags - parent_name: '' - region: content - weight: 20 - format_type: html_element - format_settings: - classes: '' - show_empty_fields: false - id: '' - label_as_html: false - element: div - show_label: false - label_element: h3 - label_element_classes: '' - attributes: '' - effect: none - speed: fast group_content_row: children: - field_az_body - field_az_eligibility - links + - field_az_opportunity_category label: 'Content row' parent_name: '' region: content @@ -395,7 +376,7 @@ content: view_mode: az_badge link: false third_party_settings: { } - weight: 20 + weight: 5 region: content field_az_opportunity_credit: type: list_default From 95d4bda935433bc0a3abce611c61cf49bcafabda Mon Sep 17 00:00:00 2001 From: Kevin Lu <79181817+kevdevlu@users.noreply.github.com> Date: Fri, 24 Apr 2026 07:18:04 -0700 Subject: [PATCH 51/59] Add Results Count and Full Pager to Trellis Opportunity Importer (#5506) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. Add result count, full pager, no-results message, and result summary placement - Switch import view pager from mini to full so total pages are displayed - Set pager total_items from search API ID count before slicing, enabling accurate page count without a separate count query - Add result summary header showing "Displaying X-Y of Z results" - Add template override to render result summary between filters and table rather than above the exposed form - Add empty state message "No results found. Try adjusting your search filters." 2. Add conditional empty state and fix result message for import view Suppress the "no results" message on initial page load by implementing hook_views_pre_render — the empty area is only shown when the user has submitted meaningful filter values. Also updates the empty state text to "No results found. Try adjusting search filters above." 3. Add ARIA live regions to import view template for screen reader support The view uses AJAX, so filter submissions silently rewrite the result count and empty state without notifying assistive technology. Keeps .view-header persistent in the DOM so its aria-live region fires on every AJAX update; wraps only the empty state message (not the full results table) in a second live region to avoid reading the entire table aloud on each filter change. Also replaces