From fa1033dafe66c7a490e534b0d0c98025c7544f14 Mon Sep 17 00:00:00 2001 From: Troy Dean Date: Thu, 20 Jun 2024 12:26:31 -0700 Subject: [PATCH] Fixes #3470 Additional Course Fields --- ...ty_form_display.node.az_course.default.yml | 18 ++++++++++----- ...ty_view_display.node.az_course.az_card.yml | 13 ++++++++++- ...ty_view_display.node.az_course.default.yml | 10 +++++++++ ...ity_view_display.node.az_course.teaser.yml | 2 ++ ...d.node.az_course.field_az_course_units.yml | 22 +++++++++++++++++++ ...eld.storage.node.field_az_course_units.yml | 19 ++++++++++++++++ .../config/install/views.view.az_courses.yml | 1 - .../az_course/migrations/az_courses.yml | 8 +++++++ 8 files changed, 86 insertions(+), 7 deletions(-) create mode 100644 modules/custom/az_course/config/install/field.field.node.az_course.field_az_course_units.yml create mode 100644 modules/custom/az_course/config/install/field.storage.node.field_az_course_units.yml diff --git a/modules/custom/az_course/config/install/core.entity_form_display.node.az_course.default.yml b/modules/custom/az_course/config/install/core.entity_form_display.node.az_course.default.yml index 4247c44122..180f9bbefb 100644 --- a/modules/custom/az_course/config/install/core.entity_form_display.node.az_course.default.yml +++ b/modules/custom/az_course/config/install/core.entity_form_display.node.az_course.default.yml @@ -10,6 +10,7 @@ dependencies: - field.field.node.az_course.field_az_course_term - field.field.node.az_course.field_az_course_title - field.field.node.az_course.field_az_course_types + - field.field.node.az_course.field_az_course_units - field.field.node.az_course.field_az_subject_and_catalog - field.field.node.az_course.field_az_subject_code - node.type.az_course @@ -30,7 +31,7 @@ content: third_party_settings: { } field_az_academic_program: type: options_select - weight: 16 + weight: 17 region: content settings: { } third_party_settings: { } @@ -44,7 +45,7 @@ content: third_party_settings: { } field_az_course_attributes: type: options_select - weight: 14 + weight: 15 region: content settings: { } third_party_settings: { } @@ -58,7 +59,7 @@ content: third_party_settings: { } field_az_course_instructor: type: link_default - weight: 17 + weight: 18 region: content settings: placeholder_url: '' @@ -66,7 +67,7 @@ content: third_party_settings: { } field_az_course_term: type: options_select - weight: 15 + weight: 16 region: content settings: { } third_party_settings: { } @@ -80,10 +81,17 @@ content: third_party_settings: { } field_az_course_types: type: options_select - weight: 13 + weight: 14 region: content settings: { } third_party_settings: { } + field_az_course_units: + type: number + weight: 13 + region: content + settings: + placeholder: '' + third_party_settings: { } field_az_subject_and_catalog: type: string_textfield weight: 10 diff --git a/modules/custom/az_course/config/install/core.entity_view_display.node.az_course.az_card.yml b/modules/custom/az_course/config/install/core.entity_view_display.node.az_course.az_card.yml index 436c25ec8d..a7efb9062a 100644 --- a/modules/custom/az_course/config/install/core.entity_view_display.node.az_course.az_card.yml +++ b/modules/custom/az_course/config/install/core.entity_view_display.node.az_course.az_card.yml @@ -11,6 +11,7 @@ dependencies: - field.field.node.az_course.field_az_course_term - field.field.node.az_course.field_az_course_title - field.field.node.az_course.field_az_course_types + - field.field.node.az_course.field_az_course_units - field.field.node.az_course.field_az_subject_and_catalog - field.field.node.az_course.field_az_subject_code - node.type.az_course @@ -44,6 +45,7 @@ third_party_settings: children: - smart_title - field_az_course_description + - field_az_course_units - links label: 'Card Body' parent_name: group_card @@ -81,10 +83,19 @@ content: third_party_settings: { } weight: 4 region: content + field_az_course_units: + type: number_integer + label: inline + settings: + thousand_separator: '' + prefix_suffix: true + third_party_settings: { } + weight: 5 + region: content links: settings: { } third_party_settings: { } - weight: 5 + weight: 6 region: content smart_title: settings: { } diff --git a/modules/custom/az_course/config/install/core.entity_view_display.node.az_course.default.yml b/modules/custom/az_course/config/install/core.entity_view_display.node.az_course.default.yml index 55669d5cb2..133849cd1e 100644 --- a/modules/custom/az_course/config/install/core.entity_view_display.node.az_course.default.yml +++ b/modules/custom/az_course/config/install/core.entity_view_display.node.az_course.default.yml @@ -10,6 +10,7 @@ dependencies: - field.field.node.az_course.field_az_course_term - field.field.node.az_course.field_az_course_title - field.field.node.az_course.field_az_course_types + - field.field.node.az_course.field_az_course_units - field.field.node.az_course.field_az_subject_and_catalog - field.field.node.az_course.field_az_subject_code - node.type.az_course @@ -32,6 +33,15 @@ content: third_party_settings: { } weight: 1 region: content + field_az_course_units: + type: number_integer + label: inline + settings: + thousand_separator: '' + prefix_suffix: true + third_party_settings: { } + weight: 2 + region: content links: settings: { } third_party_settings: { } diff --git a/modules/custom/az_course/config/install/core.entity_view_display.node.az_course.teaser.yml b/modules/custom/az_course/config/install/core.entity_view_display.node.az_course.teaser.yml index 9b02dd780d..57e921f4d7 100644 --- a/modules/custom/az_course/config/install/core.entity_view_display.node.az_course.teaser.yml +++ b/modules/custom/az_course/config/install/core.entity_view_display.node.az_course.teaser.yml @@ -11,6 +11,7 @@ dependencies: - field.field.node.az_course.field_az_course_term - field.field.node.az_course.field_az_course_title - field.field.node.az_course.field_az_course_types + - field.field.node.az_course.field_az_course_units - field.field.node.az_course.field_az_subject_and_catalog - field.field.node.az_course.field_az_subject_code - node.type.az_course @@ -39,6 +40,7 @@ hidden: field_az_course_term: true field_az_course_title: true field_az_course_types: true + field_az_course_units: true field_az_subject_and_catalog: true field_az_subject_code: true smart_title: true diff --git a/modules/custom/az_course/config/install/field.field.node.az_course.field_az_course_units.yml b/modules/custom/az_course/config/install/field.field.node.az_course.field_az_course_units.yml new file mode 100644 index 0000000000..15c24f6e98 --- /dev/null +++ b/modules/custom/az_course/config/install/field.field.node.az_course.field_az_course_units.yml @@ -0,0 +1,22 @@ +langcode: en +status: true +dependencies: + config: + - field.storage.node.field_az_course_units + - node.type.az_course +id: node.az_course.field_az_course_units +field_name: field_az_course_units +entity_type: node +bundle: az_course +label: 'Course Units' +description: '' +required: false +translatable: false +default_value: { } +default_value_callback: '' +settings: + min: 0 + max: null + prefix: '' + suffix: '' +field_type: integer diff --git a/modules/custom/az_course/config/install/field.storage.node.field_az_course_units.yml b/modules/custom/az_course/config/install/field.storage.node.field_az_course_units.yml new file mode 100644 index 0000000000..d2e6150166 --- /dev/null +++ b/modules/custom/az_course/config/install/field.storage.node.field_az_course_units.yml @@ -0,0 +1,19 @@ +langcode: en +status: true +dependencies: + module: + - node +id: node.field_az_course_units +field_name: field_az_course_units +entity_type: node +type: integer +settings: + unsigned: false + size: normal +module: core +locked: false +cardinality: 1 +translatable: true +indexes: { } +persist_with_no_fields: false +custom_storage: false diff --git a/modules/custom/az_course/config/install/views.view.az_courses.yml b/modules/custom/az_course/config/install/views.view.az_courses.yml index 075b87e677..5a3d1948e4 100644 --- a/modules/custom/az_course/config/install/views.view.az_courses.yml +++ b/modules/custom/az_course/config/install/views.view.az_courses.yml @@ -172,7 +172,6 @@ display: default_argument_type: fixed default_argument_options: argument: '' - default_argument_skip_url: false summary_options: base_path: '' count: true diff --git a/modules/custom/az_course/migrations/az_courses.yml b/modules/custom/az_course/migrations/az_courses.yml index 863d7131bb..be4283e607 100644 --- a/modules/custom/az_course/migrations/az_courses.yml +++ b/modules/custom/az_course/migrations/az_courses.yml @@ -31,6 +31,10 @@ source: name: catalog_number label: Catalog Number selector: ns1:catalog_nbr + - + name: units + label: Units + selector: ns1:units - # Squash data from multiple sections into this one. name: course_type @@ -58,6 +62,10 @@ process: field_az_course_description/value: description field_az_subject_code: subject_code field_az_catalog_number: catalog_number + field_az_course_units: + plugin: callback + callable: intval + source: units field_az_subject_and_catalog: plugin: concat source: