From 3129a0d3295f137136836e3ed47460a93d4520c1 Mon Sep 17 00:00:00 2001 From: Nathaniel Woodland Date: Thu, 21 Nov 2024 14:10:39 -0500 Subject: [PATCH 01/15] NYS-83: Add initial nodes, fields, and views to support core-based nys_school_forms refactor --- ...label.settings.node.student_submission.yml | 10 + ...ings.node.student_submission_container.yml | 10 + ...erride.node.student_submission.promote.yml | 22 + ...verride.node.student_submission.status.yml | 22 + ...override.node.student_submission.title.yml | 18 + ...e.student_submission_container.promote.yml | 22 + ...de.student_submission_container.status.yml | 22 + ...isplay.node.student_submission.default.yml | 61 +++ ...e.student_submission_container.default.yml | 83 +++ ...isplay.node.student_submission.default.yml | 70 +++ ...display.node.student_submission.teaser.yml | 34 ++ ...e.student_submission_container.default.yml | 77 +++ ...de.student_submission_container.teaser.yml | 38 ++ ...udent_submission.field_file_submission.yml | 46 ++ ...dent_submission.field_image_submission.yml | 57 +++ ....student_submission.field_student_name.yml | 19 + ...udent_submission.field_submission_type.yml | 21 + ...t_submission_container.field_form_type.yml | 21 + ...udent_submission_container.field_grade.yml | 21 + ...dent_submission_container.field_school.yml | 29 ++ ...on_container.field_student_submissions.yml | 29 ++ ...bmission_container.field_teacher_email.yml | 19 + ...ubmission_container.field_teacher_name.yml | 19 + ...eld.storage.node.field_file_submission.yml | 23 + .../field.storage.node.field_form_type.yml | 27 + .../sync/field.storage.node.field_grade.yml | 63 +++ ...ld.storage.node.field_image_submission.yml | 30 ++ .../sync/field.storage.node.field_school.yml | 19 + .../field.storage.node.field_student_name.yml | 21 + ...storage.node.field_student_submissions.yml | 19 + ...eld.storage.node.field_submission_type.yml | 30 ++ ...field.storage.node.field_teacher_email.yml | 18 + .../field.storage.node.field_teacher_name.yml | 21 + ...ntent_settings.node.student_submission.yml | 11 + ...ings.node.student_submission_container.yml | 11 + config/sync/node.type.student_submission.yml | 49 ++ ...node.type.student_submission_container.yml | 49 ++ config/sync/user.role.anonymous.yml | 6 + config/sync/user.role.authenticated.yml | 1 - config/sync/user.role.frontpage_editor.yml | 5 + .../sync/views.view.student_submissions.yml | 473 ++++++++++++++++++ 41 files changed, 1645 insertions(+), 1 deletion(-) create mode 100644 config/sync/auto_entitylabel.settings.node.student_submission.yml create mode 100644 config/sync/auto_entitylabel.settings.node.student_submission_container.yml create mode 100644 config/sync/core.base_field_override.node.student_submission.promote.yml create mode 100644 config/sync/core.base_field_override.node.student_submission.status.yml create mode 100644 config/sync/core.base_field_override.node.student_submission.title.yml create mode 100644 config/sync/core.base_field_override.node.student_submission_container.promote.yml create mode 100644 config/sync/core.base_field_override.node.student_submission_container.status.yml create mode 100644 config/sync/core.entity_form_display.node.student_submission.default.yml create mode 100644 config/sync/core.entity_form_display.node.student_submission_container.default.yml create mode 100644 config/sync/core.entity_view_display.node.student_submission.default.yml create mode 100644 config/sync/core.entity_view_display.node.student_submission.teaser.yml create mode 100644 config/sync/core.entity_view_display.node.student_submission_container.default.yml create mode 100644 config/sync/core.entity_view_display.node.student_submission_container.teaser.yml create mode 100644 config/sync/field.field.node.student_submission.field_file_submission.yml create mode 100644 config/sync/field.field.node.student_submission.field_image_submission.yml create mode 100644 config/sync/field.field.node.student_submission.field_student_name.yml create mode 100644 config/sync/field.field.node.student_submission.field_submission_type.yml create mode 100644 config/sync/field.field.node.student_submission_container.field_form_type.yml create mode 100644 config/sync/field.field.node.student_submission_container.field_grade.yml create mode 100644 config/sync/field.field.node.student_submission_container.field_school.yml create mode 100644 config/sync/field.field.node.student_submission_container.field_student_submissions.yml create mode 100644 config/sync/field.field.node.student_submission_container.field_teacher_email.yml create mode 100644 config/sync/field.field.node.student_submission_container.field_teacher_name.yml create mode 100644 config/sync/field.storage.node.field_file_submission.yml create mode 100644 config/sync/field.storage.node.field_form_type.yml create mode 100644 config/sync/field.storage.node.field_grade.yml create mode 100644 config/sync/field.storage.node.field_image_submission.yml create mode 100644 config/sync/field.storage.node.field_school.yml create mode 100644 config/sync/field.storage.node.field_student_name.yml create mode 100644 config/sync/field.storage.node.field_student_submissions.yml create mode 100644 config/sync/field.storage.node.field_submission_type.yml create mode 100644 config/sync/field.storage.node.field_teacher_email.yml create mode 100644 config/sync/field.storage.node.field_teacher_name.yml create mode 100644 config/sync/language.content_settings.node.student_submission.yml create mode 100644 config/sync/language.content_settings.node.student_submission_container.yml create mode 100644 config/sync/node.type.student_submission.yml create mode 100644 config/sync/node.type.student_submission_container.yml create mode 100644 config/sync/views.view.student_submissions.yml diff --git a/config/sync/auto_entitylabel.settings.node.student_submission.yml b/config/sync/auto_entitylabel.settings.node.student_submission.yml new file mode 100644 index 0000000000..1aa1148c7c --- /dev/null +++ b/config/sync/auto_entitylabel.settings.node.student_submission.yml @@ -0,0 +1,10 @@ +status: 1 +pattern: "[node:field_student_name]'s [node:field_submission_type] submission" +escape: false +preserve_titles: false +save: false +chunk: 50 +dependencies: + config: + - node.type.student_submission +new_content_behavior: 0 diff --git a/config/sync/auto_entitylabel.settings.node.student_submission_container.yml b/config/sync/auto_entitylabel.settings.node.student_submission_container.yml new file mode 100644 index 0000000000..7ebff2ab3d --- /dev/null +++ b/config/sync/auto_entitylabel.settings.node.student_submission_container.yml @@ -0,0 +1,10 @@ +status: 1 +pattern: "[node:field_teacher_name]'s [node:field_form_type] student submissions" +escape: false +preserve_titles: false +save: false +chunk: 50 +dependencies: + config: + - node.type.student_submission_container +new_content_behavior: 0 diff --git a/config/sync/core.base_field_override.node.student_submission.promote.yml b/config/sync/core.base_field_override.node.student_submission.promote.yml new file mode 100644 index 0000000000..5305ee9aff --- /dev/null +++ b/config/sync/core.base_field_override.node.student_submission.promote.yml @@ -0,0 +1,22 @@ +uuid: 0a834044-34ae-4045-ae7c-4f64c4ad09bb +langcode: en +status: true +dependencies: + config: + - node.type.student_submission +id: node.student_submission.promote +field_name: promote +entity_type: node +bundle: student_submission +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/config/sync/core.base_field_override.node.student_submission.status.yml b/config/sync/core.base_field_override.node.student_submission.status.yml new file mode 100644 index 0000000000..f8b2ca07ae --- /dev/null +++ b/config/sync/core.base_field_override.node.student_submission.status.yml @@ -0,0 +1,22 @@ +uuid: e01291e5-b854-44f2-88ea-ff656593de7a +langcode: en +status: true +dependencies: + config: + - node.type.student_submission +id: node.student_submission.status +field_name: status +entity_type: node +bundle: student_submission +label: Published +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/config/sync/core.base_field_override.node.student_submission.title.yml b/config/sync/core.base_field_override.node.student_submission.title.yml new file mode 100644 index 0000000000..5ee1217087 --- /dev/null +++ b/config/sync/core.base_field_override.node.student_submission.title.yml @@ -0,0 +1,18 @@ +uuid: 735fd96e-97a7-4cdb-a287-dbf9dbc3a057 +langcode: en +status: true +dependencies: + config: + - node.type.student_submission +id: node.student_submission.title +field_name: title +entity_type: node +bundle: student_submission +label: Title +description: '' +required: true +translatable: true +default_value: { } +default_value_callback: '' +settings: { } +field_type: string diff --git a/config/sync/core.base_field_override.node.student_submission_container.promote.yml b/config/sync/core.base_field_override.node.student_submission_container.promote.yml new file mode 100644 index 0000000000..017576c20e --- /dev/null +++ b/config/sync/core.base_field_override.node.student_submission_container.promote.yml @@ -0,0 +1,22 @@ +uuid: d2cfa0fd-ef8e-402d-a79e-2aa106e6e4a5 +langcode: en +status: true +dependencies: + config: + - node.type.student_submission_container +id: node.student_submission_container.promote +field_name: promote +entity_type: node +bundle: student_submission_container +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/config/sync/core.base_field_override.node.student_submission_container.status.yml b/config/sync/core.base_field_override.node.student_submission_container.status.yml new file mode 100644 index 0000000000..f30e1ea2f7 --- /dev/null +++ b/config/sync/core.base_field_override.node.student_submission_container.status.yml @@ -0,0 +1,22 @@ +uuid: 5764062d-c986-4176-8e97-fd0f1088f2ea +langcode: en +status: true +dependencies: + config: + - node.type.student_submission_container +id: node.student_submission_container.status +field_name: status +entity_type: node +bundle: student_submission_container +label: Published +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/config/sync/core.entity_form_display.node.student_submission.default.yml b/config/sync/core.entity_form_display.node.student_submission.default.yml new file mode 100644 index 0000000000..284466537e --- /dev/null +++ b/config/sync/core.entity_form_display.node.student_submission.default.yml @@ -0,0 +1,61 @@ +uuid: 99a7cb85-eb46-42a3-8680-cf44e09e3e3f +langcode: en +status: true +dependencies: + config: + - field.field.node.student_submission.field_file_submission + - field.field.node.student_submission.field_image_submission + - field.field.node.student_submission.field_student_name + - field.field.node.student_submission.field_submission_type + - image.style.thumbnail + - node.type.student_submission + module: + - file + - svg_image +id: node.student_submission.default +targetEntityType: node +bundle: student_submission +mode: default +content: + field_file_submission: + type: file_generic + weight: 3 + region: content + settings: + progress_indicator: throbber + third_party_settings: { } + field_image_submission: + type: image_image + weight: 2 + region: content + settings: + progress_indicator: throbber + preview_image_style: thumbnail + third_party_settings: { } + field_student_name: + type: string_textfield + weight: 0 + region: content + settings: + size: 60 + placeholder: '' + third_party_settings: { } + field_submission_type: + type: options_select + weight: 1 + region: content + settings: { } + third_party_settings: { } +hidden: + created: true + langcode: true + path: true + promote: true + publish_on: true + simple_sitemap: true + status: true + sticky: true + title: true + uid: true + unpublish_on: true + url_redirects: true diff --git a/config/sync/core.entity_form_display.node.student_submission_container.default.yml b/config/sync/core.entity_form_display.node.student_submission_container.default.yml new file mode 100644 index 0000000000..8afa527d87 --- /dev/null +++ b/config/sync/core.entity_form_display.node.student_submission_container.default.yml @@ -0,0 +1,83 @@ +uuid: 3d3eb0c9-3301-4643-b63c-166c9afd9b82 +langcode: en +status: true +dependencies: + config: + - field.field.node.student_submission_container.field_form_type + - field.field.node.student_submission_container.field_grade + - field.field.node.student_submission_container.field_school + - field.field.node.student_submission_container.field_student_submissions + - field.field.node.student_submission_container.field_teacher_email + - field.field.node.student_submission_container.field_teacher_name + - node.type.student_submission_container + module: + - inline_entity_form +id: node.student_submission_container.default +targetEntityType: node +bundle: student_submission_container +mode: default +content: + field_form_type: + type: options_select + weight: -1 + region: content + settings: { } + third_party_settings: { } + field_grade: + type: options_select + weight: 3 + region: content + settings: { } + third_party_settings: { } + field_school: + type: entity_reference_autocomplete + weight: 0 + region: content + settings: + match_operator: CONTAINS + match_limit: 10 + size: 60 + placeholder: '' + third_party_settings: { } + field_student_submissions: + type: inline_entity_form_simple + weight: 4 + region: content + settings: + form_mode: default + override_labels: false + label_singular: '' + label_plural: '' + collapsible: false + collapsed: false + revision: false + third_party_settings: { } + field_teacher_email: + type: email_default + weight: 2 + region: content + settings: + placeholder: '' + size: 60 + third_party_settings: { } + field_teacher_name: + type: string_textfield + weight: 1 + region: content + settings: + size: 60 + placeholder: '' + third_party_settings: { } +hidden: + created: true + langcode: true + path: true + promote: true + publish_on: true + simple_sitemap: true + status: true + sticky: true + title: true + uid: true + unpublish_on: true + url_redirects: true diff --git a/config/sync/core.entity_view_display.node.student_submission.default.yml b/config/sync/core.entity_view_display.node.student_submission.default.yml new file mode 100644 index 0000000000..258af09c65 --- /dev/null +++ b/config/sync/core.entity_view_display.node.student_submission.default.yml @@ -0,0 +1,70 @@ +uuid: 3bad3737-8935-4a79-b606-df3969ae90da +langcode: en +status: true +dependencies: + config: + - field.field.node.student_submission.field_file_submission + - field.field.node.student_submission.field_image_submission + - field.field.node.student_submission.field_student_name + - field.field.node.student_submission.field_submission_type + - node.type.student_submission + module: + - file + - options + - svg_image + - user +id: node.student_submission.default +targetEntityType: node +bundle: student_submission +mode: default +content: + field_file_submission: + type: file_default + label: above + settings: + use_description_as_link_text: true + third_party_settings: { } + weight: 103 + region: content + field_image_submission: + type: image + label: above + settings: + image_link: '' + image_style: '' + image_loading: + attribute: lazy + svg_attributes: + width: null + height: null + svg_render_as_image: true + third_party_settings: { } + weight: 102 + region: content + field_student_name: + type: string + label: above + settings: + link_to_entity: false + third_party_settings: { } + weight: 104 + region: content + field_submission_type: + type: list_default + label: above + settings: { } + third_party_settings: { } + weight: 101 + region: content + links: + settings: { } + third_party_settings: { } + weight: 100 + region: content +hidden: + entity_print_view_epub: true + entity_print_view_pdf: true + entity_print_view_word_docx: true + langcode: true + private_message_link: true + search_api_excerpt: true diff --git a/config/sync/core.entity_view_display.node.student_submission.teaser.yml b/config/sync/core.entity_view_display.node.student_submission.teaser.yml new file mode 100644 index 0000000000..b0e8f1d7e8 --- /dev/null +++ b/config/sync/core.entity_view_display.node.student_submission.teaser.yml @@ -0,0 +1,34 @@ +uuid: 67b5fbdd-78d6-45f5-86c8-b0639328d3e1 +langcode: en +status: true +dependencies: + config: + - core.entity_view_mode.node.teaser + - field.field.node.student_submission.field_file_submission + - field.field.node.student_submission.field_image_submission + - field.field.node.student_submission.field_student_name + - field.field.node.student_submission.field_submission_type + - node.type.student_submission + module: + - user +id: node.student_submission.teaser +targetEntityType: node +bundle: student_submission +mode: teaser +content: + links: + settings: { } + third_party_settings: { } + weight: 100 + region: content +hidden: + entity_print_view_epub: true + entity_print_view_pdf: true + entity_print_view_word_docx: true + field_file_submission: true + field_image_submission: true + field_student_name: true + field_submission_type: true + langcode: true + private_message_link: true + search_api_excerpt: true diff --git a/config/sync/core.entity_view_display.node.student_submission_container.default.yml b/config/sync/core.entity_view_display.node.student_submission_container.default.yml new file mode 100644 index 0000000000..847974e720 --- /dev/null +++ b/config/sync/core.entity_view_display.node.student_submission_container.default.yml @@ -0,0 +1,77 @@ +uuid: c5c06985-ae8a-449d-8459-32e6686b9c31 +langcode: en +status: true +dependencies: + config: + - field.field.node.student_submission_container.field_form_type + - field.field.node.student_submission_container.field_grade + - field.field.node.student_submission_container.field_school + - field.field.node.student_submission_container.field_student_submissions + - field.field.node.student_submission_container.field_teacher_email + - field.field.node.student_submission_container.field_teacher_name + - node.type.student_submission_container + module: + - options + - user +id: node.student_submission_container.default +targetEntityType: node +bundle: student_submission_container +mode: default +content: + field_form_type: + type: list_default + label: above + settings: { } + third_party_settings: { } + weight: 106 + region: content + field_grade: + type: list_default + label: above + settings: { } + third_party_settings: { } + weight: 104 + region: content + field_school: + type: entity_reference_label + label: above + settings: + link: true + third_party_settings: { } + weight: 101 + region: content + field_student_submissions: + type: entity_reference_label + label: above + settings: + link: true + third_party_settings: { } + weight: 105 + region: content + field_teacher_email: + type: basic_string + label: above + settings: { } + third_party_settings: { } + weight: 107 + region: content + field_teacher_name: + type: string + label: above + settings: + link_to_entity: false + third_party_settings: { } + weight: 102 + region: content + links: + settings: { } + third_party_settings: { } + weight: 100 + region: content +hidden: + entity_print_view_epub: true + entity_print_view_pdf: true + entity_print_view_word_docx: true + langcode: true + private_message_link: true + search_api_excerpt: true diff --git a/config/sync/core.entity_view_display.node.student_submission_container.teaser.yml b/config/sync/core.entity_view_display.node.student_submission_container.teaser.yml new file mode 100644 index 0000000000..6f2866058e --- /dev/null +++ b/config/sync/core.entity_view_display.node.student_submission_container.teaser.yml @@ -0,0 +1,38 @@ +uuid: 9083bce5-92ff-429f-8fb6-4e062646da7d +langcode: en +status: true +dependencies: + config: + - core.entity_view_mode.node.teaser + - field.field.node.student_submission_container.field_form_type + - field.field.node.student_submission_container.field_grade + - field.field.node.student_submission_container.field_school + - field.field.node.student_submission_container.field_student_submissions + - field.field.node.student_submission_container.field_teacher_email + - field.field.node.student_submission_container.field_teacher_name + - node.type.student_submission_container + module: + - user +id: node.student_submission_container.teaser +targetEntityType: node +bundle: student_submission_container +mode: teaser +content: + links: + settings: { } + third_party_settings: { } + weight: 100 + region: content +hidden: + entity_print_view_epub: true + entity_print_view_pdf: true + entity_print_view_word_docx: true + field_form_type: true + field_grade: true + field_school: true + field_student_submissions: true + field_teacher_email: true + field_teacher_name: true + langcode: true + private_message_link: true + search_api_excerpt: true diff --git a/config/sync/field.field.node.student_submission.field_file_submission.yml b/config/sync/field.field.node.student_submission.field_file_submission.yml new file mode 100644 index 0000000000..470fce591f --- /dev/null +++ b/config/sync/field.field.node.student_submission.field_file_submission.yml @@ -0,0 +1,46 @@ +uuid: 3129a125-c625-4f4f-a308-ea5970001b91 +langcode: en +status: true +dependencies: + config: + - field.storage.node.field_file_submission + - node.type.student_submission + module: + - file + - filefield_paths +third_party_settings: + filefield_paths: + enabled: true + file_path: + value: student-file-submissions + options: + slashes: false + pathauto: false + transliterate: false + file_name: + value: '[file:ffp-name-only-original].[file:ffp-extension-original]' + options: + slashes: false + pathauto: false + transliterate: false + redirect: false + retroactive_update: false + active_updating: false +id: node.student_submission.field_file_submission +field_name: field_file_submission +entity_type: node +bundle: student_submission +label: 'File submission' +description: '' +required: false +translatable: false +default_value: { } +default_value_callback: '' +settings: + handler: 'default:file' + handler_settings: { } + file_directory: '[date:custom:Y]-[date:custom:m]' + file_extensions: 'txt pdf doc docx' + max_filesize: '' + description_field: false +field_type: file diff --git a/config/sync/field.field.node.student_submission.field_image_submission.yml b/config/sync/field.field.node.student_submission.field_image_submission.yml new file mode 100644 index 0000000000..ff9ed81758 --- /dev/null +++ b/config/sync/field.field.node.student_submission.field_image_submission.yml @@ -0,0 +1,57 @@ +uuid: ce5b0899-1653-43d8-a652-55579c2d384b +langcode: en +status: true +dependencies: + config: + - field.storage.node.field_image_submission + - node.type.student_submission + module: + - filefield_paths + - image +third_party_settings: + filefield_paths: + enabled: true + file_path: + value: student-image-submissions + options: + slashes: false + pathauto: false + transliterate: false + file_name: + value: '[file:ffp-name-only-original].[file:ffp-extension-original]' + options: + slashes: false + pathauto: false + transliterate: false + redirect: false + retroactive_update: false + active_updating: false +id: node.student_submission.field_image_submission +field_name: field_image_submission +entity_type: node +bundle: student_submission +label: 'Image submission' +description: '' +required: false +translatable: false +default_value: { } +default_value_callback: '' +settings: + handler: 'default:file' + handler_settings: { } + file_directory: '[date:custom:Y]-[date:custom:m]' + file_extensions: 'png gif jpg jpeg webp' + max_filesize: '' + max_resolution: '' + min_resolution: '' + alt_field: false + alt_field_required: false + title_field: false + title_field_required: false + default_image: + uuid: '' + alt: '' + title: '' + width: null + height: null +field_type: image diff --git a/config/sync/field.field.node.student_submission.field_student_name.yml b/config/sync/field.field.node.student_submission.field_student_name.yml new file mode 100644 index 0000000000..af7c8d21c5 --- /dev/null +++ b/config/sync/field.field.node.student_submission.field_student_name.yml @@ -0,0 +1,19 @@ +uuid: 4ca3e885-1836-48dc-b60c-b47d47c03973 +langcode: en +status: true +dependencies: + config: + - field.storage.node.field_student_name + - node.type.student_submission +id: node.student_submission.field_student_name +field_name: field_student_name +entity_type: node +bundle: student_submission +label: 'Student name' +description: '' +required: true +translatable: false +default_value: { } +default_value_callback: '' +settings: { } +field_type: string diff --git a/config/sync/field.field.node.student_submission.field_submission_type.yml b/config/sync/field.field.node.student_submission.field_submission_type.yml new file mode 100644 index 0000000000..050d8dff5c --- /dev/null +++ b/config/sync/field.field.node.student_submission.field_submission_type.yml @@ -0,0 +1,21 @@ +uuid: dd71bf6e-d09f-4fa1-8eb2-24db78c42060 +langcode: en +status: true +dependencies: + config: + - field.storage.node.field_submission_type + - node.type.student_submission + module: + - options +id: node.student_submission.field_submission_type +field_name: field_submission_type +entity_type: node +bundle: student_submission +label: 'Submission type' +description: 'Choose the type that dest describes this submission.' +required: false +translatable: false +default_value: { } +default_value_callback: '' +settings: { } +field_type: list_string diff --git a/config/sync/field.field.node.student_submission_container.field_form_type.yml b/config/sync/field.field.node.student_submission_container.field_form_type.yml new file mode 100644 index 0000000000..386dfdd7f2 --- /dev/null +++ b/config/sync/field.field.node.student_submission_container.field_form_type.yml @@ -0,0 +1,21 @@ +uuid: 7f77dfa4-d93c-435d-8fda-476c5e463b5b +langcode: en +status: true +dependencies: + config: + - field.storage.node.field_form_type + - node.type.student_submission_container + module: + - options +id: node.student_submission_container.field_form_type +field_name: field_form_type +entity_type: node +bundle: student_submission_container +label: 'Form type' +description: '' +required: false +translatable: false +default_value: { } +default_value_callback: '' +settings: { } +field_type: list_string diff --git a/config/sync/field.field.node.student_submission_container.field_grade.yml b/config/sync/field.field.node.student_submission_container.field_grade.yml new file mode 100644 index 0000000000..ca4c5eaed3 --- /dev/null +++ b/config/sync/field.field.node.student_submission_container.field_grade.yml @@ -0,0 +1,21 @@ +uuid: 2463ee47-c7c0-405d-8848-a25215126cc7 +langcode: en +status: true +dependencies: + config: + - field.storage.node.field_grade + - node.type.student_submission_container + module: + - options +id: node.student_submission_container.field_grade +field_name: field_grade +entity_type: node +bundle: student_submission_container +label: Grade +description: '' +required: true +translatable: false +default_value: { } +default_value_callback: '' +settings: { } +field_type: list_string diff --git a/config/sync/field.field.node.student_submission_container.field_school.yml b/config/sync/field.field.node.student_submission_container.field_school.yml new file mode 100644 index 0000000000..73b88676fc --- /dev/null +++ b/config/sync/field.field.node.student_submission_container.field_school.yml @@ -0,0 +1,29 @@ +uuid: 48edeec1-7f1e-4446-8788-ea6fc17fa5d4 +langcode: en +status: true +dependencies: + config: + - field.storage.node.field_school + - node.type.school + - node.type.student_submission_container +id: node.student_submission_container.field_school +field_name: field_school +entity_type: node +bundle: student_submission_container +label: School +description: '' +required: true +translatable: false +default_value: { } +default_value_callback: '' +settings: + handler: 'default:node' + handler_settings: + target_bundles: + school: school + sort: + field: field_school_legal_name + direction: ASC + auto_create: false + auto_create_bundle: '' +field_type: entity_reference diff --git a/config/sync/field.field.node.student_submission_container.field_student_submissions.yml b/config/sync/field.field.node.student_submission_container.field_student_submissions.yml new file mode 100644 index 0000000000..f93b55e5ac --- /dev/null +++ b/config/sync/field.field.node.student_submission_container.field_student_submissions.yml @@ -0,0 +1,29 @@ +uuid: 8ca06b78-f18e-49bf-a309-82b2ce5ebd4d +langcode: en +status: true +dependencies: + config: + - field.storage.node.field_student_submissions + - node.type.student_submission + - node.type.student_submission_container +id: node.student_submission_container.field_student_submissions +field_name: field_student_submissions +entity_type: node +bundle: student_submission_container +label: 'Student submission(s)' +description: '' +required: true +translatable: false +default_value: { } +default_value_callback: '' +settings: + handler: 'default:node' + handler_settings: + target_bundles: + student_submission: student_submission + sort: + field: _none + direction: ASC + auto_create: false + auto_create_bundle: '' +field_type: entity_reference diff --git a/config/sync/field.field.node.student_submission_container.field_teacher_email.yml b/config/sync/field.field.node.student_submission_container.field_teacher_email.yml new file mode 100644 index 0000000000..99270b8d43 --- /dev/null +++ b/config/sync/field.field.node.student_submission_container.field_teacher_email.yml @@ -0,0 +1,19 @@ +uuid: a67e82f7-aad4-4140-b143-6090d482f542 +langcode: en +status: true +dependencies: + config: + - field.storage.node.field_teacher_email + - node.type.student_submission_container +id: node.student_submission_container.field_teacher_email +field_name: field_teacher_email +entity_type: node +bundle: student_submission_container +label: 'Teacher email' +description: '' +required: true +translatable: false +default_value: { } +default_value_callback: '' +settings: { } +field_type: email diff --git a/config/sync/field.field.node.student_submission_container.field_teacher_name.yml b/config/sync/field.field.node.student_submission_container.field_teacher_name.yml new file mode 100644 index 0000000000..0a4133bb88 --- /dev/null +++ b/config/sync/field.field.node.student_submission_container.field_teacher_name.yml @@ -0,0 +1,19 @@ +uuid: 9dd5e9d6-71a7-41ec-8fe0-ecee70535d1c +langcode: en +status: true +dependencies: + config: + - field.storage.node.field_teacher_name + - node.type.student_submission_container +id: node.student_submission_container.field_teacher_name +field_name: field_teacher_name +entity_type: node +bundle: student_submission_container +label: 'Teacher name' +description: '' +required: true +translatable: false +default_value: { } +default_value_callback: '' +settings: { } +field_type: string diff --git a/config/sync/field.storage.node.field_file_submission.yml b/config/sync/field.storage.node.field_file_submission.yml new file mode 100644 index 0000000000..98812dec2d --- /dev/null +++ b/config/sync/field.storage.node.field_file_submission.yml @@ -0,0 +1,23 @@ +uuid: 064f3d3a-e0ed-4c4e-8c34-a6e4bae96e3a +langcode: en +status: true +dependencies: + module: + - file + - node +id: node.field_file_submission +field_name: field_file_submission +entity_type: node +type: file +settings: + target_type: file + display_field: false + display_default: false + uri_scheme: private +module: file +locked: false +cardinality: 1 +translatable: true +indexes: { } +persist_with_no_fields: false +custom_storage: false diff --git a/config/sync/field.storage.node.field_form_type.yml b/config/sync/field.storage.node.field_form_type.yml new file mode 100644 index 0000000000..a2133778fc --- /dev/null +++ b/config/sync/field.storage.node.field_form_type.yml @@ -0,0 +1,27 @@ +uuid: 87d48315-3164-4732-8af0-316ef81a511e +langcode: en +status: true +dependencies: + module: + - node + - options +id: node.field_form_type +field_name: field_form_type +entity_type: node +type: list_string +settings: + allowed_values: + - + value: earth_day + label: 'Earth Day' + - + value: thanksgiving + label: Thanksgiving + allowed_values_function: '' +module: options +locked: false +cardinality: 1 +translatable: true +indexes: { } +persist_with_no_fields: false +custom_storage: false diff --git a/config/sync/field.storage.node.field_grade.yml b/config/sync/field.storage.node.field_grade.yml new file mode 100644 index 0000000000..6adad1e2f3 --- /dev/null +++ b/config/sync/field.storage.node.field_grade.yml @@ -0,0 +1,63 @@ +uuid: a26615ba-6608-48e9-890b-7ee8e8d572ee +langcode: en +status: true +dependencies: + module: + - node + - options +id: node.field_grade +field_name: field_grade +entity_type: node +type: list_string +settings: + allowed_values: + - + value: kindergarten + label: Kindergarten + - + value: 1st_grade + label: '1st Grade' + - + value: 2nd_grade + label: '2nd Grade' + - + value: 3rd_grade + label: '3rd Grade' + - + value: 4th_grade + label: '4th Grade' + - + value: 5th_grade + label: '5th Grade' + - + value: 6th_grade + label: '6th Grade' + - + value: 7th_grade + label: '7th Grade' + - + value: 8th_grade + label: '8th Grade' + - + value: 9th_grade + label: '9th Grade' + - + value: 10th_grade + label: '10th Grade' + - + value: 11th_grade + label: '11th Grade' + - + value: 12th_grade + label: '12th Grade' + - + value: homeschool + label: Homeschool + allowed_values_function: '' +module: options +locked: false +cardinality: 1 +translatable: true +indexes: { } +persist_with_no_fields: false +custom_storage: false diff --git a/config/sync/field.storage.node.field_image_submission.yml b/config/sync/field.storage.node.field_image_submission.yml new file mode 100644 index 0000000000..f417cb2366 --- /dev/null +++ b/config/sync/field.storage.node.field_image_submission.yml @@ -0,0 +1,30 @@ +uuid: 10b7cc17-cce0-4a4a-abe5-f7437ee64dd0 +langcode: en +status: true +dependencies: + module: + - file + - image + - node +id: node.field_image_submission +field_name: field_image_submission +entity_type: node +type: image +settings: + target_type: file + display_field: false + display_default: false + uri_scheme: private + default_image: + uuid: '' + alt: '' + title: '' + width: null + height: null +module: image +locked: false +cardinality: 1 +translatable: true +indexes: { } +persist_with_no_fields: false +custom_storage: false diff --git a/config/sync/field.storage.node.field_school.yml b/config/sync/field.storage.node.field_school.yml new file mode 100644 index 0000000000..48bfb64595 --- /dev/null +++ b/config/sync/field.storage.node.field_school.yml @@ -0,0 +1,19 @@ +uuid: 269ea79a-3f2c-4c7a-a1fb-211ae024bd7c +langcode: en +status: true +dependencies: + module: + - node +id: node.field_school +field_name: field_school +entity_type: node +type: entity_reference +settings: + target_type: node +module: core +locked: false +cardinality: 1 +translatable: true +indexes: { } +persist_with_no_fields: false +custom_storage: false diff --git a/config/sync/field.storage.node.field_student_name.yml b/config/sync/field.storage.node.field_student_name.yml new file mode 100644 index 0000000000..d298a20753 --- /dev/null +++ b/config/sync/field.storage.node.field_student_name.yml @@ -0,0 +1,21 @@ +uuid: cc10b8c7-3901-4a83-bb17-9b22a0cb6c72 +langcode: en +status: true +dependencies: + module: + - node +id: node.field_student_name +field_name: field_student_name +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/config/sync/field.storage.node.field_student_submissions.yml b/config/sync/field.storage.node.field_student_submissions.yml new file mode 100644 index 0000000000..a37c7fd4f8 --- /dev/null +++ b/config/sync/field.storage.node.field_student_submissions.yml @@ -0,0 +1,19 @@ +uuid: dbd04b54-37cf-4706-98f7-777dfb03bba4 +langcode: en +status: true +dependencies: + module: + - node +id: node.field_student_submissions +field_name: field_student_submissions +entity_type: node +type: entity_reference +settings: + target_type: node +module: core +locked: false +cardinality: -1 +translatable: true +indexes: { } +persist_with_no_fields: false +custom_storage: false diff --git a/config/sync/field.storage.node.field_submission_type.yml b/config/sync/field.storage.node.field_submission_type.yml new file mode 100644 index 0000000000..f136ec19bb --- /dev/null +++ b/config/sync/field.storage.node.field_submission_type.yml @@ -0,0 +1,30 @@ +uuid: 7f92418a-9b1f-47ac-ad2e-19eed067d8a3 +langcode: en +status: true +dependencies: + module: + - node + - options +id: node.field_submission_type +field_name: field_submission_type +entity_type: node +type: list_string +settings: + allowed_values: + - + value: art + label: Art + - + value: essay + label: Essay + - + value: poem + label: Poem + allowed_values_function: '' +module: options +locked: false +cardinality: 1 +translatable: true +indexes: { } +persist_with_no_fields: false +custom_storage: false diff --git a/config/sync/field.storage.node.field_teacher_email.yml b/config/sync/field.storage.node.field_teacher_email.yml new file mode 100644 index 0000000000..c62ca81245 --- /dev/null +++ b/config/sync/field.storage.node.field_teacher_email.yml @@ -0,0 +1,18 @@ +uuid: 4a30c455-d084-4dd4-aa69-9f95e1898f2a +langcode: en +status: true +dependencies: + module: + - node +id: node.field_teacher_email +field_name: field_teacher_email +entity_type: node +type: email +settings: { } +module: core +locked: false +cardinality: 1 +translatable: true +indexes: { } +persist_with_no_fields: false +custom_storage: false diff --git a/config/sync/field.storage.node.field_teacher_name.yml b/config/sync/field.storage.node.field_teacher_name.yml new file mode 100644 index 0000000000..ba3e1f5226 --- /dev/null +++ b/config/sync/field.storage.node.field_teacher_name.yml @@ -0,0 +1,21 @@ +uuid: 0ffd0f66-ae7f-4774-bc3f-f73daa3a0397 +langcode: en +status: true +dependencies: + module: + - node +id: node.field_teacher_name +field_name: field_teacher_name +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/config/sync/language.content_settings.node.student_submission.yml b/config/sync/language.content_settings.node.student_submission.yml new file mode 100644 index 0000000000..8a4f1be03f --- /dev/null +++ b/config/sync/language.content_settings.node.student_submission.yml @@ -0,0 +1,11 @@ +uuid: 8642bc7c-173b-4bfe-a7c8-509a89991c58 +langcode: en +status: true +dependencies: + config: + - node.type.student_submission +id: node.student_submission +target_entity_type_id: node +target_bundle: student_submission +default_langcode: site_default +language_alterable: false diff --git a/config/sync/language.content_settings.node.student_submission_container.yml b/config/sync/language.content_settings.node.student_submission_container.yml new file mode 100644 index 0000000000..165086d23f --- /dev/null +++ b/config/sync/language.content_settings.node.student_submission_container.yml @@ -0,0 +1,11 @@ +uuid: 9f0fbf4e-8b81-45fb-8c9c-48ba7ed8bd46 +langcode: en +status: true +dependencies: + config: + - node.type.student_submission_container +id: node.student_submission_container +target_entity_type_id: node +target_bundle: student_submission_container +default_langcode: site_default +language_alterable: false diff --git a/config/sync/node.type.student_submission.yml b/config/sync/node.type.student_submission.yml new file mode 100644 index 0000000000..2de672e1ed --- /dev/null +++ b/config/sync/node.type.student_submission.yml @@ -0,0 +1,49 @@ +uuid: 4349b4f1-ef13-4092-b801-168344456a43 +langcode: en +status: true +dependencies: + module: + - menu_ui + - node_revision_delete + - scheduler +third_party_settings: + menu_ui: + available_menus: { } + parent: '' + node_revision_delete: + amount: + status: false + settings: + amount: 0 + created: + status: false + settings: + age: 1 + drafts: + status: false + settings: + age: 1 + only_drafts: + status: false + settings: + age: 0 + scheduler: + expand_fieldset: when_required + fields_display_mode: vertical_tab + publish_enable: false + publish_past_date: error + publish_past_date_created: false + publish_required: false + publish_revision: false + publish_touch: false + show_message_after_update: true + unpublish_enable: false + unpublish_required: false + unpublish_revision: false +name: 'Student submission' +type: student_submission +description: 'An individual student submission, created in batch by anonymous users through the "Student submission container" node type' +help: null +new_revision: false +preview_mode: 0 +display_submitted: false diff --git a/config/sync/node.type.student_submission_container.yml b/config/sync/node.type.student_submission_container.yml new file mode 100644 index 0000000000..14dcd6f920 --- /dev/null +++ b/config/sync/node.type.student_submission_container.yml @@ -0,0 +1,49 @@ +uuid: 9d64785d-d531-4597-a631-982df988db5b +langcode: en +status: true +dependencies: + module: + - menu_ui + - node_revision_delete + - scheduler +third_party_settings: + menu_ui: + available_menus: { } + parent: '' + node_revision_delete: + amount: + status: false + settings: + amount: 0 + created: + status: false + settings: + age: 1 + drafts: + status: false + settings: + age: 1 + only_drafts: + status: false + settings: + age: 0 + scheduler: + expand_fieldset: when_required + fields_display_mode: vertical_tab + publish_enable: false + publish_past_date: error + publish_past_date_created: false + publish_required: false + publish_revision: false + publish_touch: false + show_message_after_update: true + unpublish_enable: false + unpublish_required: false + unpublish_revision: false +name: 'Student submission container' +type: student_submission_container +description: 'For anonymous users to create individual student submissions in batch.' +help: null +new_revision: false +preview_mode: 0 +display_submitted: false diff --git a/config/sync/user.role.anonymous.yml b/config/sync/user.role.anonymous.yml index b6c324a1c8..25d00330d1 100644 --- a/config/sync/user.role.anonymous.yml +++ b/config/sync/user.role.anonymous.yml @@ -2,12 +2,16 @@ uuid: a6aabff9-3e0c-493c-943f-b1e1c1f49ec6 langcode: en status: true dependencies: + config: + - node.type.student_submission + - node.type.student_submission_container module: - comment - contact - entity_print - field_permissions - media + - node - system _core: default_config_hash: j5zLMOdJBqC0bMvSdth5UebkprJB8g_2FXHqhfpJzow @@ -19,6 +23,8 @@ permissions: - 'access comments' - 'access content' - 'access site-wide contact form' + - 'create student_submission content' + - 'create student_submission_container content' - 'entity print access bundle article' - 'entity print access bundle resolution' - 'view field_associated_senators' diff --git a/config/sync/user.role.authenticated.yml b/config/sync/user.role.authenticated.yml index 5d1f1bc187..26700ab25a 100644 --- a/config/sync/user.role.authenticated.yml +++ b/config/sync/user.role.authenticated.yml @@ -9,7 +9,6 @@ dependencies: - contact - entity_print - field_permissions - - file - filter - honeypot - media diff --git a/config/sync/user.role.frontpage_editor.yml b/config/sync/user.role.frontpage_editor.yml index 2571e5ea2d..ccfe2aa05c 100644 --- a/config/sync/user.role.frontpage_editor.yml +++ b/config/sync/user.role.frontpage_editor.yml @@ -3,6 +3,11 @@ langcode: en status: true dependencies: config: + - entityqueue.entity_queue.frontpage_news + - entityqueue.entity_queue.global_promo_banner + - entityqueue.entity_queue.happening_now + - entityqueue.entity_queue.homepage_featured_story + - entityqueue.entity_queue.homepage_hero - filter.format.basic_html - filter.format.full_html - media.type.file diff --git a/config/sync/views.view.student_submissions.yml b/config/sync/views.view.student_submissions.yml new file mode 100644 index 0000000000..38dbd33ab8 --- /dev/null +++ b/config/sync/views.view.student_submissions.yml @@ -0,0 +1,473 @@ +uuid: 95c2bc1a-7a0b-4306-95a5-97e811098173 +langcode: en +status: true +dependencies: + config: + - field.storage.node.field_image_submission + - node.type.student_submission + module: + - node + - svg_image + - user +id: student_submissions +label: 'Student submissions' +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: + title: 'Student submissions' + 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 + 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: true + 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_image_submission: + id: field_image_submission + table: node__field_image_submission + field: field_image_submission + relationship: none + group_type: group + admin_label: '' + plugin_id: field + label: 'Image submission' + 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 + click_sort_column: target_id + type: image + settings: + image_link: '' + image_style: '' + image_loading: + attribute: lazy + svg_attributes: + width: null + height: null + svg_render_as_image: true + 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 + status: + id: status + table: node_field_data + field: status + relationship: none + group_type: group + admin_label: '' + entity_type: node + entity_field: status + plugin_id: field + label: Published + 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 + click_sort_column: value + type: boolean + settings: + format: yes-no + 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 + node_bulk_form: + id: node_bulk_form + table: node + field: node_bulk_form + relationship: none + group_type: group + admin_label: '' + entity_type: node + plugin_id: node_bulk_form + label: 'Node operations bulk form' + 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: include + selected_actions: + - node_delete_action + - node_publish_action + - node_unpublish_action + pager: + type: mini + options: + offset: 0 + pagination_heading_level: h4 + items_per_page: 50 + 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: + created: + id: created + table: node_field_data + field: created + relationship: none + group_type: group + admin_label: '' + entity_type: node + entity_field: created + plugin_id: date + order: DESC + expose: + label: '' + field_identifier: '' + exposed: false + granularity: second + arguments: { } + 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: All + group: 1 + exposed: true + expose: + operator_id: '' + label: 'Published status' + description: '' + use_operator: false + operator: status_op + operator_limit_selection: false + operator_list: { } + identifier: status + required: false + remember: false + multiple: false + remember_roles: + authenticated: authenticated + anonymous: '0' + administrator: '0' + frontpage_editor: '0' + senator: '0' + microsite_content_producer: '0' + legislative_correspondent: '0' + student_programs: '0' + constituent: '0' + comment_moderator: '0' + is_grouped: false + group_info: + label: '' + description: '' + identifier: '' + optional: true + widget: select + multiple: false + remember: false + default_group: All + default_group_multiple: { } + group_items: { } + accept_null: false + 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: + student_submission: student_submission + 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 + 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: { } + style: + type: table + row: + type: fields + query: + type: views_query + options: + query_comment: '' + disable_sql_rewrite: false + distinct: false + disable_automatic_base_fields: false + replica: false + query_tags: { } + relationships: + reverse__node__field_student_submissions: + id: reverse__node__field_student_submissions + table: node_field_data + field: reverse__node__field_student_submissions + relationship: none + group_type: group + admin_label: field_student_submissions + entity_type: node + plugin_id: entity_reverse + required: true + header: { } + footer: { } + display_extenders: { } + cache_metadata: + max-age: 0 + contexts: + - 'languages:language_content' + - 'languages:language_interface' + - url + - url.query_args + - 'user.node_grants:view' + - user.permissions + tags: + - 'config:field.storage.node.field_image_submission' + page_1: + id: page_1 + display_title: Page + display_plugin: page + position: 1 + display_options: + display_extenders: { } + path: student-submissions + use_admin_theme: true + cache_metadata: + max-age: 0 + contexts: + - 'languages:language_content' + - 'languages:language_interface' + - url + - url.query_args + - 'user.node_grants:view' + - user.permissions + tags: + - 'config:field.storage.node.field_image_submission' From b761511f1426cda6afc41c06b655b4473bc8831f Mon Sep 17 00:00:00 2001 From: Nathaniel Woodland Date: Wed, 27 Nov 2024 16:15:19 -0500 Subject: [PATCH 02/15] NYS-83: Replace webform reference field with node forms using formblock --- composer.json | 1 + composer.lock | 59 +++++++++++++- config/sync/block.block.committee.yml | 2 +- config/sync/block.block.contenttype.yml | 2 +- ...ormissues_listingsexplore_issues_alpha.yml | 2 +- config/sync/block.block.issueexplorermenu.yml | 2 +- ...block.nysenate_theme_school_form_block.yml | 36 +++++++++ .../sync/block.block.primaryadminactions.yml | 2 +- config/sync/block.block.senator.yml | 2 +- config/sync/block.block.tabs.yml | 2 +- ...form_display.node.school_forms.default.yml | 46 ----------- ...isplay.node.student_submission.default.yml | 11 ++- ...view_display.node.school_forms.default.yml | 53 +------------ ..._view_display.node.school_forms.teaser.yml | 10 --- ...isplay.node.student_submission.default.yml | 8 ++ ...display.node.student_submission.teaser.yml | 2 + config/sync/core.extension.yml | 1 + ...ield.node.school_forms.field_form_date.yml | 21 ----- ...eld.node.school_forms.field_form_title.yml | 22 ------ ...d.field.node.school_forms.field_issues.yml | 29 ------- ...ld.node.school_forms.field_school_form.yml | 32 -------- ...de.school_forms.field_school_form_type.yml | 29 ------- ...udent_submission.field_file_submission.yml | 4 +- ...dent_submission.field_image_submission.yml | 4 +- ...e.student_submission.field_upload_type.yml | 21 +++++ .../sync/field.storage.block_content.body.yml | 4 - ...e.block_content.field_pg_feature_image.yml | 4 - .../field.storage.node.field_form_date.yml | 24 ------ .../field.storage.node.field_form_title.yml | 24 ------ .../field.storage.node.field_school_form.yml | 24 ------ ...ld.storage.node.field_school_form_type.yml | 24 ------ .../field.storage.node.field_upload_type.yml | 27 +++++++ .../nys_school_forms/nys_school_forms.module | 76 +++++++++++++++++++ 33 files changed, 252 insertions(+), 358 deletions(-) create mode 100644 config/sync/block.block.nysenate_theme_school_form_block.yml delete mode 100644 config/sync/field.field.node.school_forms.field_form_date.yml delete mode 100644 config/sync/field.field.node.school_forms.field_form_title.yml delete mode 100644 config/sync/field.field.node.school_forms.field_issues.yml delete mode 100644 config/sync/field.field.node.school_forms.field_school_form.yml delete mode 100644 config/sync/field.field.node.school_forms.field_school_form_type.yml create mode 100644 config/sync/field.field.node.student_submission.field_upload_type.yml delete mode 100644 config/sync/field.storage.node.field_form_date.yml delete mode 100644 config/sync/field.storage.node.field_form_title.yml delete mode 100644 config/sync/field.storage.node.field_school_form.yml delete mode 100644 config/sync/field.storage.node.field_school_form_type.yml create mode 100644 config/sync/field.storage.node.field_upload_type.yml diff --git a/composer.json b/composer.json index 2764062ee8..217cd08c6f 100644 --- a/composer.json +++ b/composer.json @@ -75,6 +75,7 @@ "drupal/flag": "^4.0@beta", "drupal/flood_control": "^2.2", "drupal/fontawesome": "^2.26", + "drupal/formblock": "^2.0@beta", "drupal/fpa": "^4.0", "drupal/fullcalendar_view": "^5.1", "drupal/geocoder": "^3.25 || ^4.0", diff --git a/composer.lock b/composer.lock index 796315849c..7888f7e7b0 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "2ed7d5e63b735a74267e29d2ed4665de", + "content-hash": "a7ecb1ecc2b8c842c29c833ac51e1505", "packages": [ { "name": "asm89/stack-cors", @@ -5488,6 +5488,62 @@ "issues": "https://drupal.org/project/issues/fontawesome" } }, + { + "name": "drupal/formblock", + "version": "2.0.0-beta3", + "source": { + "type": "git", + "url": "https://git.drupalcode.org/project/formblock.git", + "reference": "2.0.0-beta3" + }, + "dist": { + "type": "zip", + "url": "https://ftp.drupal.org/files/projects/formblock-2.0.0-beta3.zip", + "reference": "2.0.0-beta3", + "shasum": "65d089189a304c6d179c2007b44f6fc3f0bdd57e" + }, + "require": { + "drupal/core": "^9.4 || ^10" + }, + "type": "drupal-module", + "extra": { + "drupal": { + "version": "2.0.0-beta3", + "datestamp": "1674342112", + "security-coverage": { + "status": "not-covered", + "message": "Beta releases are not covered by Drupal security advisories." + } + } + }, + "notification-url": "https://packages.drupal.org/8/downloads", + "license": [ + "GPL-2.0-or-later" + ], + "authors": [ + { + "name": "AndyD328", + "homepage": "https://www.drupal.org/user/2261214" + }, + { + "name": "chx", + "homepage": "https://www.drupal.org/user/9446" + }, + { + "name": "joseph.olstad", + "homepage": "https://www.drupal.org/user/1321830" + }, + { + "name": "mikey_p", + "homepage": "https://www.drupal.org/user/62496" + } + ], + "description": "Enables the presentation of node creation forms in blocks. This is particularly useful for including forms on Layout Builder & Panels.", + "homepage": "https://www.drupal.org/project/formblock", + "support": { + "source": "https://git.drupalcode.org/project/formblock" + } + }, { "name": "drupal/fpa", "version": "4.0.0", @@ -26460,6 +26516,7 @@ "drupal/field_validation": 10, "drupal/filefield_paths": 10, "drupal/flag": 10, + "drupal/formblock": 10, "drupal/gin": 5, "drupal/gin_toolbar": 5, "drupal/guardr_core": 20, diff --git a/config/sync/block.block.committee.yml b/config/sync/block.block.committee.yml index 11bb75e316..17c5735b1e 100644 --- a/config/sync/block.block.committee.yml +++ b/config/sync/block.block.committee.yml @@ -12,7 +12,7 @@ dependencies: id: committee theme: nysenate_theme region: content -weight: -2 +weight: -10 provider: null plugin: 'facet_block:committee' settings: diff --git a/config/sync/block.block.contenttype.yml b/config/sync/block.block.contenttype.yml index f0d94f40f6..a49c49290e 100644 --- a/config/sync/block.block.contenttype.yml +++ b/config/sync/block.block.contenttype.yml @@ -12,7 +12,7 @@ dependencies: id: contenttype theme: nysenate_theme region: content -weight: -1 +weight: -9 provider: null plugin: 'facet_block:content_type' settings: diff --git a/config/sync/block.block.exposedformissues_listingsexplore_issues_alpha.yml b/config/sync/block.block.exposedformissues_listingsexplore_issues_alpha.yml index b530e6188c..6a52f8131b 100644 --- a/config/sync/block.block.exposedformissues_listingsexplore_issues_alpha.yml +++ b/config/sync/block.block.exposedformissues_listingsexplore_issues_alpha.yml @@ -12,7 +12,7 @@ dependencies: id: exposedformissues_listingsexplore_issues_alpha theme: nysenate_theme region: content -weight: 0 +weight: -8 provider: null plugin: 'views_exposed_filter_block:issues_listings-explore_issues_alpha' settings: diff --git a/config/sync/block.block.issueexplorermenu.yml b/config/sync/block.block.issueexplorermenu.yml index 4265cc3b16..2dc03309a9 100644 --- a/config/sync/block.block.issueexplorermenu.yml +++ b/config/sync/block.block.issueexplorermenu.yml @@ -11,7 +11,7 @@ dependencies: id: issueexplorermenu theme: nysenate_theme region: content -weight: 0 +weight: -6 provider: null plugin: 'system_menu_block:menu-issue-explorer' settings: diff --git a/config/sync/block.block.nysenate_theme_school_form_block.yml b/config/sync/block.block.nysenate_theme_school_form_block.yml new file mode 100644 index 0000000000..3e6e217a42 --- /dev/null +++ b/config/sync/block.block.nysenate_theme_school_form_block.yml @@ -0,0 +1,36 @@ +uuid: f84afa03-50c4-4fa0-85a0-063acf48a842 +langcode: en +status: true +dependencies: + module: + - formblock + - node + - system + theme: + - nysenate_theme +id: nysenate_theme_school_form_block +theme: nysenate_theme +region: content +weight: 10 +provider: null +plugin: formblock_node +settings: + id: formblock_node + label: 'Content form' + label_display: '0' + provider: formblock + type: student_submission_container + form_mode: default + show_help: 0 +visibility: + request_path: + id: request_path + negate: false + pages: "/earthday\r\n/questionnaires/what-are-you-thankful" + 'entity_bundle:node': + id: 'entity_bundle:node' + negate: false + context_mapping: + node: '@node.node_route_context:node' + bundles: + school_forms: school_forms diff --git a/config/sync/block.block.primaryadminactions.yml b/config/sync/block.block.primaryadminactions.yml index e2bb406fc7..a0bb9b4bcc 100644 --- a/config/sync/block.block.primaryadminactions.yml +++ b/config/sync/block.block.primaryadminactions.yml @@ -7,7 +7,7 @@ dependencies: id: primaryadminactions theme: nysenate_theme region: content -weight: 1 +weight: -4 provider: null plugin: local_actions_block settings: diff --git a/config/sync/block.block.senator.yml b/config/sync/block.block.senator.yml index 0de33c42f9..8d3930222a 100644 --- a/config/sync/block.block.senator.yml +++ b/config/sync/block.block.senator.yml @@ -12,7 +12,7 @@ dependencies: id: senator theme: nysenate_theme region: content -weight: -3 +weight: -11 provider: null plugin: 'facet_block:senator' settings: diff --git a/config/sync/block.block.tabs.yml b/config/sync/block.block.tabs.yml index 827ed7ddce..7f77016205 100644 --- a/config/sync/block.block.tabs.yml +++ b/config/sync/block.block.tabs.yml @@ -7,7 +7,7 @@ dependencies: id: tabs theme: nysenate_theme region: content -weight: 0 +weight: -5 provider: null plugin: local_tasks_block settings: diff --git a/config/sync/core.entity_form_display.node.school_forms.default.yml b/config/sync/core.entity_form_display.node.school_forms.default.yml index ebc390f30a..214d7fc032 100644 --- a/config/sync/core.entity_form_display.node.school_forms.default.yml +++ b/config/sync/core.entity_form_display.node.school_forms.default.yml @@ -4,21 +4,14 @@ status: true dependencies: config: - field.field.node.school_forms.field_form_banner_image - - field.field.node.school_forms.field_form_date - field.field.node.school_forms.field_form_summary - - field.field.node.school_forms.field_form_title - - field.field.node.school_forms.field_issues - - field.field.node.school_forms.field_school_form - - field.field.node.school_forms.field_school_form_type - field.field.node.school_forms.rabbit_hole__settings - node.type.school_forms module: - - datetime - media_library - path - rabbit_hole - text - - webform id: node.school_forms.default targetEntityType: node bundle: school_forms @@ -37,12 +30,6 @@ content: settings: media_types: { } third_party_settings: { } - field_form_date: - type: datetime_default - weight: 16 - region: content - settings: { } - third_party_settings: { } field_form_summary: type: text_textarea_with_summary weight: 14 @@ -53,39 +40,6 @@ content: placeholder: '' show_summary: false third_party_settings: { } - field_form_title: - type: text_textfield - weight: 15 - region: content - settings: - size: 60 - placeholder: '' - third_party_settings: { } - field_issues: - type: entity_reference_autocomplete_tags - weight: 13 - region: content - settings: - match_operator: CONTAINS - match_limit: 10 - size: 60 - placeholder: '' - third_party_settings: { } - field_school_form: - type: webform_entity_reference_select - weight: 18 - region: content - settings: - allow_status: true - default_data: true - webforms: { } - third_party_settings: { } - field_school_form_type: - type: options_select - weight: 17 - region: content - settings: { } - third_party_settings: { } langcode: type: language_select weight: 1 diff --git a/config/sync/core.entity_form_display.node.student_submission.default.yml b/config/sync/core.entity_form_display.node.student_submission.default.yml index 284466537e..3637f604f3 100644 --- a/config/sync/core.entity_form_display.node.student_submission.default.yml +++ b/config/sync/core.entity_form_display.node.student_submission.default.yml @@ -7,9 +7,11 @@ dependencies: - field.field.node.student_submission.field_image_submission - field.field.node.student_submission.field_student_name - field.field.node.student_submission.field_submission_type + - field.field.node.student_submission.field_upload_type - image.style.thumbnail - node.type.student_submission module: + - conditional_fields - file - svg_image id: node.student_submission.default @@ -23,7 +25,8 @@ content: region: content settings: progress_indicator: throbber - third_party_settings: { } + third_party_settings: + conditional_fields: { } field_image_submission: type: image_image weight: 2 @@ -41,6 +44,12 @@ content: placeholder: '' third_party_settings: { } field_submission_type: + type: options_select + weight: 4 + region: content + settings: { } + third_party_settings: { } + field_upload_type: type: options_select weight: 1 region: content diff --git a/config/sync/core.entity_view_display.node.school_forms.default.yml b/config/sync/core.entity_view_display.node.school_forms.default.yml index acf691b15b..9a396775e1 100644 --- a/config/sync/core.entity_view_display.node.school_forms.default.yml +++ b/config/sync/core.entity_view_display.node.school_forms.default.yml @@ -4,19 +4,12 @@ status: true dependencies: config: - field.field.node.school_forms.field_form_banner_image - - field.field.node.school_forms.field_form_date - field.field.node.school_forms.field_form_summary - - field.field.node.school_forms.field_form_title - - field.field.node.school_forms.field_issues - - field.field.node.school_forms.field_school_form - - field.field.node.school_forms.field_school_form_type - field.field.node.school_forms.rabbit_hole__settings - node.type.school_forms module: - - datetime - text - user - - webform id: node.school_forms.default targetEntityType: node bundle: school_forms @@ -31,15 +24,6 @@ content: third_party_settings: { } weight: 101 region: content - field_form_date: - type: datetime_default - label: above - settings: - timezone_override: '' - format_type: publish_date - third_party_settings: { } - weight: 104 - region: content field_form_summary: type: text_default label: hidden @@ -47,47 +31,12 @@ content: third_party_settings: { } weight: 102 region: content - field_form_title: - type: text_default - label: above - settings: { } - third_party_settings: { } - weight: 103 - region: content - field_issues: - type: entity_reference_label - label: above - settings: - link: true - third_party_settings: { } - weight: 107 - region: content - field_school_form: - type: webform_entity_reference_entity_view - label: above - settings: - source_entity: true - third_party_settings: { } - weight: 105 - region: content - field_school_form_type: - type: entity_reference_label - label: above - settings: - link: true - third_party_settings: { } - weight: 106 - region: content - links: - settings: { } - third_party_settings: { } - weight: 100 - region: content hidden: entity_print_view_epub: true entity_print_view_pdf: true entity_print_view_word_docx: true langcode: true + links: true private_message_link: true rabbit_hole__settings: true search_api_excerpt: true diff --git a/config/sync/core.entity_view_display.node.school_forms.teaser.yml b/config/sync/core.entity_view_display.node.school_forms.teaser.yml index fd2ddecb2d..a7d03fb87e 100644 --- a/config/sync/core.entity_view_display.node.school_forms.teaser.yml +++ b/config/sync/core.entity_view_display.node.school_forms.teaser.yml @@ -5,12 +5,7 @@ dependencies: config: - core.entity_view_mode.node.teaser - field.field.node.school_forms.field_form_banner_image - - field.field.node.school_forms.field_form_date - field.field.node.school_forms.field_form_summary - - field.field.node.school_forms.field_form_title - - field.field.node.school_forms.field_issues - - field.field.node.school_forms.field_school_form - - field.field.node.school_forms.field_school_form_type - field.field.node.school_forms.rabbit_hole__settings - node.type.school_forms module: @@ -30,12 +25,7 @@ hidden: entity_print_view_pdf: true entity_print_view_word_docx: true field_form_banner_image: true - field_form_date: true field_form_summary: true - field_form_title: true - field_issues: true - field_school_form: true - field_school_form_type: true langcode: true private_message_link: true rabbit_hole__settings: true diff --git a/config/sync/core.entity_view_display.node.student_submission.default.yml b/config/sync/core.entity_view_display.node.student_submission.default.yml index 258af09c65..6cbf58076d 100644 --- a/config/sync/core.entity_view_display.node.student_submission.default.yml +++ b/config/sync/core.entity_view_display.node.student_submission.default.yml @@ -7,6 +7,7 @@ dependencies: - field.field.node.student_submission.field_image_submission - field.field.node.student_submission.field_student_name - field.field.node.student_submission.field_submission_type + - field.field.node.student_submission.field_upload_type - node.type.student_submission module: - file @@ -56,6 +57,13 @@ content: third_party_settings: { } weight: 101 region: content + field_upload_type: + type: list_default + label: above + settings: { } + third_party_settings: { } + weight: 105 + region: content links: settings: { } third_party_settings: { } diff --git a/config/sync/core.entity_view_display.node.student_submission.teaser.yml b/config/sync/core.entity_view_display.node.student_submission.teaser.yml index b0e8f1d7e8..5a62d7ec32 100644 --- a/config/sync/core.entity_view_display.node.student_submission.teaser.yml +++ b/config/sync/core.entity_view_display.node.student_submission.teaser.yml @@ -8,6 +8,7 @@ dependencies: - field.field.node.student_submission.field_image_submission - field.field.node.student_submission.field_student_name - field.field.node.student_submission.field_submission_type + - field.field.node.student_submission.field_upload_type - node.type.student_submission module: - user @@ -29,6 +30,7 @@ hidden: field_image_submission: true field_student_name: true field_submission_type: true + field_upload_type: true langcode: true private_message_link: true search_api_excerpt: true diff --git a/config/sync/core.extension.yml b/config/sync/core.extension.yml index 4cc58ef5f5..200e875d21 100644 --- a/config/sync/core.extension.yml +++ b/config/sync/core.extension.yml @@ -62,6 +62,7 @@ module: flag: 0 flood_control: 0 fontawesome: 0 + formblock: 0 fpa: 0 fullcalendar_view: 0 geocoder: 0 diff --git a/config/sync/field.field.node.school_forms.field_form_date.yml b/config/sync/field.field.node.school_forms.field_form_date.yml deleted file mode 100644 index 662cf2f2b4..0000000000 --- a/config/sync/field.field.node.school_forms.field_form_date.yml +++ /dev/null @@ -1,21 +0,0 @@ -uuid: e968c146-5007-490e-afda-b13ee7f396ec -langcode: en -status: true -dependencies: - config: - - field.storage.node.field_form_date - - node.type.school_forms - module: - - datetime -id: node.school_forms.field_form_date -field_name: field_form_date -entity_type: node -bundle: school_forms -label: 'Form Date' -description: '' -required: false -translatable: false -default_value: { } -default_value_callback: '' -settings: { } -field_type: datetime diff --git a/config/sync/field.field.node.school_forms.field_form_title.yml b/config/sync/field.field.node.school_forms.field_form_title.yml deleted file mode 100644 index cf6ba33cac..0000000000 --- a/config/sync/field.field.node.school_forms.field_form_title.yml +++ /dev/null @@ -1,22 +0,0 @@ -uuid: 8174655b-a51c-4579-8ebc-7c3e63bafcb1 -langcode: en -status: true -dependencies: - config: - - field.storage.node.field_form_title - - node.type.school_forms - module: - - text -id: node.school_forms.field_form_title -field_name: field_form_title -entity_type: node -bundle: school_forms -label: 'Form Title' -description: '' -required: false -translatable: false -default_value: { } -default_value_callback: '' -settings: - allowed_formats: { } -field_type: text diff --git a/config/sync/field.field.node.school_forms.field_issues.yml b/config/sync/field.field.node.school_forms.field_issues.yml deleted file mode 100644 index a5cffd8d43..0000000000 --- a/config/sync/field.field.node.school_forms.field_issues.yml +++ /dev/null @@ -1,29 +0,0 @@ -uuid: 8c09915e-a5f7-403e-b533-de9d5a46626e -langcode: en -status: true -dependencies: - config: - - field.storage.node.field_issues - - node.type.school_forms - - taxonomy.vocabulary.issues -id: node.school_forms.field_issues -field_name: field_issues -entity_type: node -bundle: school_forms -label: Issues -description: '' -required: false -translatable: true -default_value: { } -default_value_callback: '' -settings: - handler: 'default:taxonomy_term' - handler_settings: - target_bundles: - issues: issues - sort: - field: name - direction: asc - auto_create: true - auto_create_bundle: '' -field_type: entity_reference diff --git a/config/sync/field.field.node.school_forms.field_school_form.yml b/config/sync/field.field.node.school_forms.field_school_form.yml deleted file mode 100644 index 2b83bc521e..0000000000 --- a/config/sync/field.field.node.school_forms.field_school_form.yml +++ /dev/null @@ -1,32 +0,0 @@ -uuid: 79aabf7d-b175-49cc-bb61-68a2fda7db8d -langcode: en -status: true -dependencies: - config: - - field.storage.node.field_school_form - - node.type.school_forms - - webform.webform.school_form - module: - - webform -id: node.school_forms.field_school_form -field_name: field_school_form -entity_type: node -bundle: school_forms -label: 'School Form' -description: '' -required: false -translatable: false -default_value: - - - target_uuid: e4caeb10-d52b-43f3-a947-b302f83d2e00 - default_data: '' - status: open - open: '' - close: '' -default_value_callback: '' -settings: - handler: 'default:webform' - handler_settings: - target_bundles: null - auto_create: false -field_type: webform diff --git a/config/sync/field.field.node.school_forms.field_school_form_type.yml b/config/sync/field.field.node.school_forms.field_school_form_type.yml deleted file mode 100644 index 8b858f13d4..0000000000 --- a/config/sync/field.field.node.school_forms.field_school_form_type.yml +++ /dev/null @@ -1,29 +0,0 @@ -uuid: 744fdafc-0b9b-4bba-8722-aefeffa5ec96 -langcode: en -status: true -dependencies: - config: - - field.storage.node.field_school_form_type - - node.type.school_forms - - taxonomy.vocabulary.school_form_type -id: node.school_forms.field_school_form_type -field_name: field_school_form_type -entity_type: node -bundle: school_forms -label: 'School Form Type' -description: '' -required: true -translatable: false -default_value: { } -default_value_callback: '' -settings: - handler: 'default:taxonomy_term' - handler_settings: - target_bundles: - school_form_type: school_form_type - sort: - field: name - direction: asc - auto_create: false - auto_create_bundle: '' -field_type: entity_reference diff --git a/config/sync/field.field.node.student_submission.field_file_submission.yml b/config/sync/field.field.node.student_submission.field_file_submission.yml index 470fce591f..be04089cc7 100644 --- a/config/sync/field.field.node.student_submission.field_file_submission.yml +++ b/config/sync/field.field.node.student_submission.field_file_submission.yml @@ -10,7 +10,7 @@ dependencies: - filefield_paths third_party_settings: filefield_paths: - enabled: true + enabled: false file_path: value: student-file-submissions options: @@ -32,7 +32,7 @@ entity_type: node bundle: student_submission label: 'File submission' description: '' -required: false +required: true translatable: false default_value: { } default_value_callback: '' diff --git a/config/sync/field.field.node.student_submission.field_image_submission.yml b/config/sync/field.field.node.student_submission.field_image_submission.yml index ff9ed81758..e96f1bcec0 100644 --- a/config/sync/field.field.node.student_submission.field_image_submission.yml +++ b/config/sync/field.field.node.student_submission.field_image_submission.yml @@ -10,7 +10,7 @@ dependencies: - image third_party_settings: filefield_paths: - enabled: true + enabled: false file_path: value: student-image-submissions options: @@ -32,7 +32,7 @@ entity_type: node bundle: student_submission label: 'Image submission' description: '' -required: false +required: true translatable: false default_value: { } default_value_callback: '' diff --git a/config/sync/field.field.node.student_submission.field_upload_type.yml b/config/sync/field.field.node.student_submission.field_upload_type.yml new file mode 100644 index 0000000000..fc729d8562 --- /dev/null +++ b/config/sync/field.field.node.student_submission.field_upload_type.yml @@ -0,0 +1,21 @@ +uuid: ab30ba50-3d12-4f04-b86d-97ef4e146133 +langcode: en +status: true +dependencies: + config: + - field.storage.node.field_upload_type + - node.type.student_submission + module: + - options +id: node.student_submission.field_upload_type +field_name: field_upload_type +entity_type: node +bundle: student_submission +label: 'Upload type' +description: '' +required: true +translatable: false +default_value: { } +default_value_callback: '' +settings: { } +field_type: list_string diff --git a/config/sync/field.storage.block_content.body.yml b/config/sync/field.storage.block_content.body.yml index 2874ceb657..f00bdc1fa7 100644 --- a/config/sync/field.storage.block_content.body.yml +++ b/config/sync/field.storage.block_content.body.yml @@ -4,11 +4,7 @@ status: true dependencies: module: - block_content - - field_permissions - text -third_party_settings: - field_permissions: - permission_type: public _core: default_config_hash: eS0snV_L3dx9shtWRTzm5eblwOJ7qKWC9IE-4GMTDFc id: block_content.body diff --git a/config/sync/field.storage.block_content.field_pg_feature_image.yml b/config/sync/field.storage.block_content.field_pg_feature_image.yml index 6c2bf51326..9c40e11ef2 100644 --- a/config/sync/field.storage.block_content.field_pg_feature_image.yml +++ b/config/sync/field.storage.block_content.field_pg_feature_image.yml @@ -4,11 +4,7 @@ status: true dependencies: module: - block_content - - field_permissions - media -third_party_settings: - field_permissions: - permission_type: public id: block_content.field_pg_feature_image field_name: field_pg_feature_image entity_type: block_content diff --git a/config/sync/field.storage.node.field_form_date.yml b/config/sync/field.storage.node.field_form_date.yml deleted file mode 100644 index a0be686e8b..0000000000 --- a/config/sync/field.storage.node.field_form_date.yml +++ /dev/null @@ -1,24 +0,0 @@ -uuid: b740fe2d-becb-4931-bb4b-c74b08c67a81 -langcode: en -status: true -dependencies: - module: - - datetime - - field_permissions - - node -third_party_settings: - field_permissions: - permission_type: public -id: node.field_form_date -field_name: field_form_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/config/sync/field.storage.node.field_form_title.yml b/config/sync/field.storage.node.field_form_title.yml deleted file mode 100644 index 454ef2cf20..0000000000 --- a/config/sync/field.storage.node.field_form_title.yml +++ /dev/null @@ -1,24 +0,0 @@ -uuid: 06535888-d2c1-49f1-8545-a6908b5ea896 -langcode: en -status: true -dependencies: - module: - - field_permissions - - node - - text -third_party_settings: - field_permissions: - permission_type: public -id: node.field_form_title -field_name: field_form_title -entity_type: node -type: text -settings: - max_length: 255 -module: text -locked: false -cardinality: 1 -translatable: true -indexes: { } -persist_with_no_fields: false -custom_storage: false diff --git a/config/sync/field.storage.node.field_school_form.yml b/config/sync/field.storage.node.field_school_form.yml deleted file mode 100644 index 5a7f67ce7a..0000000000 --- a/config/sync/field.storage.node.field_school_form.yml +++ /dev/null @@ -1,24 +0,0 @@ -uuid: 455347a2-92be-4e77-b33e-be122b23a1c8 -langcode: en -status: true -dependencies: - module: - - field_permissions - - node - - webform -third_party_settings: - field_permissions: - permission_type: public -id: node.field_school_form -field_name: field_school_form -entity_type: node -type: webform -settings: - target_type: webform -module: webform -locked: false -cardinality: 1 -translatable: true -indexes: { } -persist_with_no_fields: false -custom_storage: false diff --git a/config/sync/field.storage.node.field_school_form_type.yml b/config/sync/field.storage.node.field_school_form_type.yml deleted file mode 100644 index ae014e8506..0000000000 --- a/config/sync/field.storage.node.field_school_form_type.yml +++ /dev/null @@ -1,24 +0,0 @@ -uuid: 6756739c-6937-4c34-8af1-2c9bdb27e920 -langcode: en -status: true -dependencies: - module: - - field_permissions - - node - - taxonomy -third_party_settings: - field_permissions: - permission_type: public -id: node.field_school_form_type -field_name: field_school_form_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/config/sync/field.storage.node.field_upload_type.yml b/config/sync/field.storage.node.field_upload_type.yml new file mode 100644 index 0000000000..9b1a424d43 --- /dev/null +++ b/config/sync/field.storage.node.field_upload_type.yml @@ -0,0 +1,27 @@ +uuid: 573e19aa-2197-48c5-83c7-4892053dbbe4 +langcode: en +status: true +dependencies: + module: + - node + - options +id: node.field_upload_type +field_name: field_upload_type +entity_type: node +type: list_string +settings: + allowed_values: + - + value: image + label: Image + - + value: file + label: File + allowed_values_function: '' +module: options +locked: false +cardinality: 1 +translatable: true +indexes: { } +persist_with_no_fields: false +custom_storage: false diff --git a/web/modules/custom/nys_school_forms/nys_school_forms.module b/web/modules/custom/nys_school_forms/nys_school_forms.module index 29fa172dc5..0e7f4fe0dc 100644 --- a/web/modules/custom/nys_school_forms/nys_school_forms.module +++ b/web/modules/custom/nys_school_forms/nys_school_forms.module @@ -6,6 +6,7 @@ */ use Drupal\Core\Access\AccessResult; +use Drupal\Core\Form\FormStateInterface; use Drupal\webform\WebformSubmissionInterface; /** @@ -47,3 +48,78 @@ function nys_school_forms_webform_submission_access(WebformSubmissionInterface $ // Allow authenticated users to access the webform submission. return AccessResult::allowed(); } + +/** + * Implements hook_form_FORM_ID_alter. + */ +function nys_school_forms_form_node_student_submission_container_form_alter(&$form, FormStateInterface $form_state, $form_id) { + // Set and hide form type field if default available from context. + $current_path = \Drupal::requestStack()->getCurrentRequest()->getPathInfo(); + if ($current_path != '/node/add/student_submission_container') { + $form['field_form_type']['#access'] = FALSE; + } + if ($current_path == '/questionnaires/what-are-you-thankful') { + $form['field_form_type']['widget']['#default_value'] = 'thanksgiving'; + } + elseif ($current_path == '/earthday') { + $form['field_form_type']['widget']['#default_value'] = 'earth_day'; + } + + // Custom validation to make only one upload field required. + array_unshift($form['#validate'], '_nys_school_forms_validate_ss_container_form'); +} + +/** + * Implements hook_inline_entity_form_entity_form_alter. + */ +function nys_school_forms_inline_entity_form_entity_form_alter(&$form, FormStateInterface $form_state) { + // Display image / file upload field based on prior selection. + $upload_types = ['image', 'file']; + foreach ($upload_types as $type) { + $trigger = [":input[name='field_student_submissions[{$form['#ief_row_delta']}][inline_entity_form][field_upload_type]']" => ['value' => $type]]; + $form["field_{$type}_submission"]['#states'] = [ + 'visible' => $trigger, + ]; + } + + // Enable submission type field for thanksgiving form. + $current_path = \Drupal::requestStack()->getCurrentRequest()->getPathInfo(); + if ($current_path == '/questionnaires/what-are-you-thankful') { + $form['field_submission_type']['widget']['#required'] = TRUE; + } + elseif ($current_path == '/earthday') { + $form['field_submission_type']['#access'] = FALSE; + } +} + +/** + * Custom validation to make only one upload field required. + */ +function _nys_school_forms_validate_ss_container_form(array &$form, FormStateInterface $form_state) { + $student_submissions = $form_state->getValue('field_student_submissions'); + $errors = $form_state->getErrors(); + unset($errors['submit']); + $upload_types = ['image', 'file']; + foreach ($upload_types as $type) { + foreach ($student_submissions as $key => $submission) { + if ( + !is_array($submission) + || !isset($submission['inline_entity_form']['field_upload_type'][0]['value']) + ) { + continue; + } + $upload_type = $submission['inline_entity_form']['field_upload_type'][0]['value']; + $field_key = "field_student_submissions][$key][inline_entity_form][field_{$type}_submission][0"; + if ( + $upload_type != $type + && isset($errors[$field_key]) + ) { + $form_state->clearErrors(); + unset($errors[$field_key]); + } + } + } + foreach ($errors as $field_name => $message) { + $form_state->setErrorByName($field_name, $message); + } +} From bc5a0da481d52a75d6c3a4e9c18987ad10eba147 Mon Sep 17 00:00:00 2001 From: Nathaniel Woodland Date: Wed, 4 Dec 2024 17:36:17 -0500 Subject: [PATCH 03/15] NYS-83: Add image rotation and exif data removal to submission form --- composer.json | 2 + composer.lock | 108 +++++++++++++++++- config/sync/core.extension.yml | 2 + ...dent_submission.field_image_submission.yml | 5 +- config/sync/user.role.anonymous.yml | 2 + config/sync/user.role.authenticated.yml | 7 ++ 6 files changed, 124 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 217cd08c6f..dfd33db6bd 100644 --- a/composer.json +++ b/composer.json @@ -66,6 +66,7 @@ "drupal/entityqueue": "^1.2", "drupal/environment_indicator": "^4.0", "drupal/eva": "^3.0", + "drupal/exif_manipulate": "^1.0", "drupal/facets": "^2.0", "drupal/fancy_file_delete": "^2.0", "drupal/field_group": "^3.6", @@ -136,6 +137,7 @@ "drupal/seckit": "^2.0", "drupal/semanticviews": "^3.0", "drupal/seven": "^1.0", + "drupal/simple_image_rotate": "^2.0", "drupal/simple_sitemap": "^4.2", "drupal/site_verify": "^2.0@alpha", "drupal/stage_file_proxy": "^3.1", diff --git a/composer.lock b/composer.lock index 7888f7e7b0..4361586006 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "a7ecb1ecc2b8c842c29c833ac51e1505", + "content-hash": "ac91b4931ab49d247d28942b41608380", "packages": [ { "name": "asm89/stack-cors", @@ -4865,6 +4865,60 @@ "source": "https://git.drupalcode.org/project/eva" } }, + { + "name": "drupal/exif_manipulate", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://git.drupalcode.org/project/exif_manipulate.git", + "reference": "1.0.0" + }, + "dist": { + "type": "zip", + "url": "https://ftp.drupal.org/files/projects/exif_manipulate-1.0.0.zip", + "reference": "1.0.0", + "shasum": "040459ef9905c7659f7e707f31be974496a8f1a2" + }, + "require": { + "drupal/core": "^10.0", + "fileeye/pel": "^0.10.0" + }, + "type": "drupal-module", + "extra": { + "drupal": { + "version": "1.0.0", + "datestamp": "1712572368", + "security-coverage": { + "status": "covered", + "message": "Covered by Drupal's security advisory policy" + } + } + }, + "notification-url": "https://packages.drupal.org/8/downloads", + "license": [ + "GPL-2.0-or-later" + ], + "authors": [ + { + "name": "ahmetburkan", + "homepage": "https://www.drupal.org/user/3683654" + }, + { + "name": "eelkeblok", + "homepage": "https://www.drupal.org/user/423078" + }, + { + "name": "jaapjan", + "homepage": "https://www.drupal.org/user/555428" + } + ], + "description": " Clean EXIF data from uploaded images.", + "homepage": "https://www.drupal.org/project/exif_manipulate", + "support": { + "source": "https://www.drupal.org/project/exif_manipulate", + "issues": "https://www.drupal.org/project/exif_manipulate" + } + }, { "name": "drupal/facets", "version": "2.0.9", @@ -10811,6 +10865,58 @@ "source": "https://git.drupalcode.org/project/seven" } }, + { + "name": "drupal/simple_image_rotate", + "version": "2.3.0-alpha1", + "source": { + "type": "git", + "url": "https://git.drupalcode.org/project/simple_image_rotate.git", + "reference": "2.3.0-alpha1" + }, + "dist": { + "type": "zip", + "url": "https://ftp.drupal.org/files/projects/simple_image_rotate-2.3.0-alpha1.zip", + "reference": "2.3.0-alpha1", + "shasum": "feef5a818d9aabe283d34ff6b352d3a26d992dc3" + }, + "require": { + "drupal/core": "^8.8 || ^9.5 || ^10" + }, + "type": "drupal-module", + "extra": { + "drupal": { + "version": "2.3.0-alpha1", + "datestamp": "1703368746", + "security-coverage": { + "status": "not-covered", + "message": "Alpha releases are not covered by Drupal security advisories." + } + } + }, + "notification-url": "https://packages.drupal.org/8/downloads", + "license": [ + "GPL-2.0-or-later" + ], + "authors": [ + { + "name": "afagioli", + "homepage": "https://www.drupal.org/user/50680" + }, + { + "name": "khoomy", + "homepage": "https://www.drupal.org/user/135921" + }, + { + "name": "leevh", + "homepage": "https://www.drupal.org/user/426580" + } + ], + "description": "Simple image rotation", + "homepage": "https://www.drupal.org/project/simple_image_rotate", + "support": { + "source": "https://git.drupalcode.org/project/simple_image_rotate" + } + }, { "name": "drupal/simple_sitemap", "version": "4.2.2", diff --git a/config/sync/core.extension.yml b/config/sync/core.extension.yml index 200e875d21..b017b72b29 100644 --- a/config/sync/core.extension.yml +++ b/config/sync/core.extension.yml @@ -49,6 +49,7 @@ module: entity_reference_revisions: 0 entityqueue: 0 eva: 0 + exif_manipulate: 0 facets: 0 fancy_file_delete: 0 field: 0 @@ -179,6 +180,7 @@ module: semanticviews: 0 serialization: 0 shortcut: 0 + simple_image_rotate: 0 simple_sitemap: 0 site_verify: 0 svg_image: 0 diff --git a/config/sync/field.field.node.student_submission.field_image_submission.yml b/config/sync/field.field.node.student_submission.field_image_submission.yml index e96f1bcec0..f1fb526b0f 100644 --- a/config/sync/field.field.node.student_submission.field_image_submission.yml +++ b/config/sync/field.field.node.student_submission.field_image_submission.yml @@ -8,6 +8,7 @@ dependencies: module: - filefield_paths - image + - simple_image_rotate third_party_settings: filefield_paths: enabled: false @@ -26,12 +27,14 @@ third_party_settings: redirect: false retroactive_update: false active_updating: false + simple_image_rotate: + enable_rotate: 1 id: node.student_submission.field_image_submission field_name: field_image_submission entity_type: node bundle: student_submission label: 'Image submission' -description: '' +description: 'After choosing your image, use the rotate image button to ensure your image is properly oriented.' required: true translatable: false default_value: { } diff --git a/config/sync/user.role.anonymous.yml b/config/sync/user.role.anonymous.yml index 25d00330d1..76a6c6c2e1 100644 --- a/config/sync/user.role.anonymous.yml +++ b/config/sync/user.role.anonymous.yml @@ -12,6 +12,7 @@ dependencies: - field_permissions - media - node + - simple_image_rotate - system _core: default_config_hash: j5zLMOdJBqC0bMvSdth5UebkprJB8g_2FXHqhfpJzow @@ -27,6 +28,7 @@ permissions: - 'create student_submission_container content' - 'entity print access bundle article' - 'entity print access bundle resolution' + - 'rotate images' - 'view field_associated_senators' - 'view field_inactive_senator_message' - 'view media' diff --git a/config/sync/user.role.authenticated.yml b/config/sync/user.role.authenticated.yml index 26700ab25a..dde4a0b87a 100644 --- a/config/sync/user.role.authenticated.yml +++ b/config/sync/user.role.authenticated.yml @@ -4,6 +4,8 @@ status: true dependencies: config: - filter.format.webform_default + - node.type.student_submission + - node.type.student_submission_container module: - comment - contact @@ -12,6 +14,8 @@ dependencies: - filter - honeypot - media + - node + - simple_image_rotate - system - webform _core: @@ -25,9 +29,12 @@ permissions: - 'access content' - 'access site-wide contact form' - 'bypass honeypot protection' + - 'create student_submission content' + - 'create student_submission_container content' - 'entity print access bundle article' - 'entity print access bundle resolution' - 'post comments' + - 'rotate images' - 'use text format webform_default' - 'view field_associated_senators' - 'view media' From d80e65c7f5b253e92817a01cc248dfe7336f812e Mon Sep 17 00:00:00 2001 From: Nathaniel Woodland Date: Thu, 5 Dec 2024 14:45:09 -0500 Subject: [PATCH 04/15] NYS-83: Refine student submission form UX --- ...node_student_submission_container_form.yml | 7 ++++ ...cha_point.node_student_submission_form.yml | 7 ++++ ...udent_submission.field_submission_type.yml | 2 +- .../nys_school_forms/nys_school_forms.module | 2 +- .../src/patterns/global/forms/_forms.scss | 36 +++++++++++++++++++ 5 files changed, 52 insertions(+), 2 deletions(-) create mode 100644 config/sync/captcha.captcha_point.node_student_submission_container_form.yml create mode 100644 config/sync/captcha.captcha_point.node_student_submission_form.yml diff --git a/config/sync/captcha.captcha_point.node_student_submission_container_form.yml b/config/sync/captcha.captcha_point.node_student_submission_container_form.yml new file mode 100644 index 0000000000..d5e9aaa75c --- /dev/null +++ b/config/sync/captcha.captcha_point.node_student_submission_container_form.yml @@ -0,0 +1,7 @@ +uuid: b0afa567-c110-42b5-b337-c38ef9981bf9 +langcode: en +status: false +dependencies: { } +formId: node_student_submission_container_form +captchaType: default +label: node_student_submission_container_form diff --git a/config/sync/captcha.captcha_point.node_student_submission_form.yml b/config/sync/captcha.captcha_point.node_student_submission_form.yml new file mode 100644 index 0000000000..31eabd1520 --- /dev/null +++ b/config/sync/captcha.captcha_point.node_student_submission_form.yml @@ -0,0 +1,7 @@ +uuid: d6086859-adaf-4899-9c63-0cca12298423 +langcode: en +status: false +dependencies: { } +formId: node_student_submission_form +captchaType: default +label: node_student_submission_form diff --git a/config/sync/field.field.node.student_submission.field_submission_type.yml b/config/sync/field.field.node.student_submission.field_submission_type.yml index 050d8dff5c..9769fd46b6 100644 --- a/config/sync/field.field.node.student_submission.field_submission_type.yml +++ b/config/sync/field.field.node.student_submission.field_submission_type.yml @@ -12,7 +12,7 @@ field_name: field_submission_type entity_type: node bundle: student_submission label: 'Submission type' -description: 'Choose the type that dest describes this submission.' +description: '' required: false translatable: false default_value: { } diff --git a/web/modules/custom/nys_school_forms/nys_school_forms.module b/web/modules/custom/nys_school_forms/nys_school_forms.module index 0e7f4fe0dc..15fb3c9130 100644 --- a/web/modules/custom/nys_school_forms/nys_school_forms.module +++ b/web/modules/custom/nys_school_forms/nys_school_forms.module @@ -66,7 +66,7 @@ function nys_school_forms_form_node_student_submission_container_form_alter(&$fo } // Custom validation to make only one upload field required. - array_unshift($form['#validate'], '_nys_school_forms_validate_ss_container_form'); + $form['#validate'][] = '_nys_school_forms_validate_ss_container_form'; } /** diff --git a/web/themes/custom/nysenate_theme/src/patterns/global/forms/_forms.scss b/web/themes/custom/nysenate_theme/src/patterns/global/forms/_forms.scss index 7b5be1d8ab..c88911fbcd 100644 --- a/web/themes/custom/nysenate_theme/src/patterns/global/forms/_forms.scss +++ b/web/themes/custom/nysenate_theme/src/patterns/global/forms/_forms.scss @@ -458,3 +458,39 @@ } } } + +// Form block styling tweaks. +.block-formblock { + // Hide submission reordering. + #field-student-submissions-add-more-wrapper { + .tabledrag-toggle-weight-wrapper, .field-multiple-drag { + display: none; + } + } + + // Normalize select elements. + .js-form-type-select { + float: none; + width: 100%; + margin-right: 0; + + select { + margin-bottom: 16px; + } + } + + // Ensure room for image to rotate without overlap. + .js-form-wrapper .form-type-managed-file { + margin-bottom: 1em; + .image-preview { + min-height: 70px; + margin: 35px; + } + } + + // Padding fix. + td.field-multiple-drag + td { + max-width: 548px; + padding: 10px; + } +} From 5aa367a2be17eff56bb4ed098bba3fb62d0aa2d9 Mon Sep 17 00:00:00 2001 From: Nathaniel Woodland Date: Thu, 5 Dec 2024 17:27:26 -0500 Subject: [PATCH 05/15] NYS-83: Implement views-based mgmt of student submissions --- .../sync/views.view.student_submissions.yml | 1216 ++++++++++++++++- 1 file changed, 1171 insertions(+), 45 deletions(-) diff --git a/config/sync/views.view.student_submissions.yml b/config/sync/views.view.student_submissions.yml index 38dbd33ab8..8de71f25e6 100644 --- a/config/sync/views.view.student_submissions.yml +++ b/config/sync/views.view.student_submissions.yml @@ -3,11 +3,25 @@ langcode: en status: true dependencies: config: + - field.storage.node.field_file_submission + - field.storage.node.field_form_type - field.storage.node.field_image_submission + - field.storage.node.field_school + - field.storage.node.field_student_name + - field.storage.node.field_submission_type + - field.storage.node.field_teacher_email + - field.storage.node.field_teacher_name + - field.storage.node.field_upload_type + - image.style.thumbnail - node.type.student_submission + - system.menu.admin module: + - better_exposed_filters + - file - node + - options - svg_image + - taxonomy - user id: student_submissions label: 'Student submissions' @@ -23,28 +37,102 @@ display: display_plugin: default position: 0 display_options: - title: 'Student submissions' + title: 'Manage student submissions' fields: - title: - id: title + node_bulk_form: + id: node_bulk_form + table: node + field: node_bulk_form + relationship: none + group_type: group + admin_label: '' + entity_type: node + plugin_id: node_bulk_form + label: 'Node operations bulk form' + 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: include + selected_actions: + - node_delete_action + - node_publish_action + - node_unpublish_action + created: + id: created table: node_field_data - field: title + field: created relationship: none group_type: group admin_label: '' entity_type: node - entity_field: title + entity_field: created plugin_id: field - label: Title + label: 'Submission date' exclude: false alter: alter_text: false + text: '' make_link: false + path: '' absolute: false - word_boundary: false - ellipsis: 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: '' @@ -59,9 +147,21 @@ display: empty_zero: false hide_alter_empty: true click_sort_column: value - type: string + type: timestamp settings: - link_to_entity: true + date_format: publish_date + custom_date_format: '' + timezone: '' + tooltip: + date_format: long + custom_date_format: '' + time_diff: + enabled: false + future_format: '@interval hence' + past_format: '@interval ago' + granularity: 2 + refresh: 60 + description: '' group_column: value group_columns: { } group_rows: true @@ -81,10 +181,10 @@ display: admin_label: '' plugin_id: field label: 'Image submission' - exclude: false + exclude: true alter: - alter_text: false - text: '' + alter_text: true + text: '{{ field_image_submission }}
' make_link: false path: '' absolute: false @@ -124,14 +224,77 @@ display: click_sort_column: target_id type: image settings: - image_link: '' - image_style: '' + image_link: file + image_style: thumbnail image_loading: attribute: lazy svg_attributes: width: null height: null - svg_render_as_image: true + svg_render_as_image: false + 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 + field_file_submission: + id: field_file_submission + table: node__field_file_submission + field: field_file_submission + relationship: none + group_type: group + admin_label: '' + plugin_id: field + label: 'File submission' + exclude: true + alter: + alter_text: true + text: '{{ field_file_submission }}
' + 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 + click_sort_column: target_id + type: file_default + settings: + use_description_as_link_text: true group_column: '' group_columns: { } group_rows: true @@ -142,17 +305,456 @@ display: multi_type: separator separator: ', ' field_api_classes: false - status: - id: status - table: node_field_data - field: status - relationship: none + field_submission_type: + id: field_submission_type + table: node__field_submission_type + field: field_submission_type + relationship: none + group_type: group + admin_label: '' + plugin_id: field + label: 'Submission type' + exclude: true + alter: + alter_text: true + text: 'Submission type: {{ field_submission_type }}
' + 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 + click_sort_column: value + type: list_default + settings: { } + 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_upload_type: + id: field_upload_type + table: node__field_upload_type + field: field_upload_type + relationship: none + group_type: group + admin_label: '' + plugin_id: field + label: 'Upload type' + exclude: true + alter: + alter_text: true + text: 'Upload type: {{ field_upload_type }}
' + 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 + click_sort_column: value + type: list_default + settings: { } + 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_student_name: + id: field_student_name + table: node__field_student_name + field: field_student_name + relationship: none + group_type: group + admin_label: '' + plugin_id: field + label: Submission + exclude: false + alter: + alter_text: true + text: "{{ field_image_submission }}\r\n{{ field_file_submission }}\r\nStudent name: {{ field_student_name }}
\r\n{{ field_upload_type }}\r\n{{ field_submission_type }}" + 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 + click_sort_column: value + type: string + settings: + link_to_entity: false + 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_teacher_email: + id: field_teacher_email + table: node__field_teacher_email + field: field_teacher_email + relationship: reverse__node__field_student_submissions + group_type: group + admin_label: '' + plugin_id: field + label: 'Teacher email' + 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: true + 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: basic_string + settings: { } + 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_teacher_name: + id: field_teacher_name + table: node__field_teacher_name + field: field_teacher_name + relationship: reverse__node__field_student_submissions + group_type: group + admin_label: '' + plugin_id: field + label: Teacher + exclude: false + alter: + alter_text: true + text: "{{ field_teacher_name }}
\r\nEmail: {{ field_teacher_email }}" + 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 + click_sort_column: value + type: string + settings: + link_to_entity: false + 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_school: + id: field_school + table: node__field_school + field: field_school + relationship: reverse__node__field_student_submissions + group_type: group + admin_label: '' + plugin_id: field + label: School + 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 + 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 + name: + id: name + table: taxonomy_term_field_data + field: name + relationship: field_senator + group_type: group + admin_label: '' + entity_type: taxonomy_term + entity_field: name + plugin_id: term_name + label: Senator + 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 + 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 + convert_spaces: false + field_form_type: + id: field_form_type + table: node__field_form_type + field: field_form_type + relationship: reverse__node__field_student_submissions group_type: group admin_label: '' - entity_type: node - entity_field: status plugin_id: field - label: Published + label: 'School form type' exclude: false alter: alter_text: false @@ -194,11 +796,8 @@ display: empty_zero: false hide_alter_empty: true click_sort_column: value - type: boolean - settings: - format: yes-no - format_custom_false: '' - format_custom_true: '' + type: list_default + settings: { } group_column: value group_columns: { } group_rows: true @@ -209,16 +808,17 @@ display: multi_type: separator separator: ', ' field_api_classes: false - node_bulk_form: - id: node_bulk_form - table: node - field: node_bulk_form + status: + id: status + table: node_field_data + field: status relationship: none group_type: group admin_label: '' entity_type: node - plugin_id: node_bulk_form - label: 'Node operations bulk form' + entity_field: status + plugin_id: field + label: Published exclude: false alter: alter_text: false @@ -259,23 +859,35 @@ display: hide_empty: false empty_zero: false hide_alter_empty: true - action_title: Action - include_exclude: include - selected_actions: - - node_delete_action - - node_publish_action - - node_unpublish_action + click_sort_column: value + type: boolean + settings: + format: yes-no + 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 pager: - type: mini + type: full options: offset: 0 pagination_heading_level: h4 - items_per_page: 50 + items_per_page: 100 total_pages: null id: 0 tags: next: ›› previous: ‹‹ + first: '« First' + last: 'Last »' expose: items_per_page: false items_per_page_label: 'Items per page' @@ -284,8 +896,9 @@ display: items_per_page_options_all_label: '- All -' offset: false offset_label: Offset + quantity: 9 exposed_form: - type: basic + type: bef options: submit_button: Apply reset_button: false @@ -294,6 +907,65 @@ display: 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: basic_html + bef: + general: + autosubmit: false + autosubmit_exclude_textfield: false + autosubmit_textfield_delay: 500 + autosubmit_hide: false + input_required: false + allow_secondary: false + secondary_label: 'Advanced options' + secondary_open: false + reset_button_always_show: false + filter: + status: + plugin_id: default + advanced: + sort_options: false + rewrite: + filter_rewrite_values: '' + filter_rewrite_values_key: false + collapsible: false + collapsible_disable_automatic_open: false + is_secondary: false + name: + plugin_id: default + advanced: + placeholder_text: '' + collapsible: false + collapsible_disable_automatic_open: false + is_secondary: false + title: + plugin_id: default + advanced: + placeholder_text: '' + collapsible: false + collapsible_disable_automatic_open: false + is_secondary: false + field_teacher_name_value: + plugin_id: default + advanced: + placeholder_text: '' + collapsible: false + collapsible_disable_automatic_open: false + is_secondary: false + created: + plugin_id: bef_datepicker + advanced: + placeholder_text: '' + collapsible: false + collapsible_disable_automatic_open: false + is_secondary: false + created_1: + plugin_id: bef_datepicker + advanced: + placeholder_text: '' + collapsible: false + collapsible_disable_automatic_open: false + is_secondary: false access: type: perm options: @@ -413,8 +1085,410 @@ display: default_group: All default_group_multiple: { } group_items: { } + name: + id: name + table: taxonomy_term_field_data + field: name + relationship: field_senator + group_type: group + admin_label: '' + entity_type: taxonomy_term + entity_field: name + plugin_id: string + operator: '=' + value: '' + group: 1 + exposed: true + expose: + operator_id: name_op + label: Senator + description: '' + use_operator: false + operator: name_op + operator_limit_selection: false + operator_list: { } + identifier: name + required: false + remember: false + multiple: false + remember_roles: + authenticated: authenticated + anonymous: '0' + administrator: '0' + frontpage_editor: '0' + senator: '0' + microsite_content_producer: '0' + legislative_correspondent: '0' + student_programs: '0' + constituent: '0' + comment_moderator: '0' + placeholder: '' + autocomplete_filter: 1 + autocomplete_min_chars: '0' + autocomplete_items: '10' + autocomplete_field: name + autocomplete_raw_suggestion: 1 + autocomplete_raw_dropdown: 1 + autocomplete_dependent: 0 + autocomplete_contextual: 0 + autocomplete_autosubmit: 0 + is_grouped: false + group_info: + label: '' + description: '' + identifier: '' + optional: true + widget: select + multiple: false + remember: false + default_group: All + default_group_multiple: { } + group_items: { } + title: + id: title + table: node_field_data + field: title + relationship: field_school + 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: School + 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 + anonymous: '0' + administrator: '0' + frontpage_editor: '0' + senator: '0' + microsite_content_producer: '0' + legislative_correspondent: '0' + student_programs: '0' + constituent: '0' + comment_moderator: '0' + placeholder: '' + autocomplete_filter: 1 + autocomplete_min_chars: '0' + autocomplete_items: '10' + autocomplete_field: '' + autocomplete_raw_suggestion: 1 + autocomplete_raw_dropdown: 1 + autocomplete_dependent: 0 + autocomplete_contextual: 0 + autocomplete_autosubmit: 0 + 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_teacher_name_value: + id: field_teacher_name_value + table: node__field_teacher_name + field: field_teacher_name_value + relationship: none + group_type: group + admin_label: '' + plugin_id: string + operator: '=' + value: '' + group: 1 + exposed: true + expose: + operator_id: field_teacher_name_value_op + label: 'Teacher name' + description: '' + use_operator: false + operator: field_teacher_name_value_op + operator_limit_selection: false + operator_list: { } + identifier: field_teacher_name_value + required: false + remember: false + multiple: false + remember_roles: + authenticated: authenticated + anonymous: '0' + administrator: '0' + frontpage_editor: '0' + senator: '0' + microsite_content_producer: '0' + legislative_correspondent: '0' + student_programs: '0' + constituent: '0' + comment_moderator: '0' + placeholder: '' + autocomplete_filter: 1 + autocomplete_min_chars: '0' + autocomplete_items: '10' + autocomplete_field: field_teacher_name + autocomplete_raw_suggestion: 1 + autocomplete_raw_dropdown: 1 + autocomplete_dependent: 0 + autocomplete_contextual: 0 + autocomplete_autosubmit: 0 + is_grouped: false + group_info: + label: '' + description: '' + identifier: '' + optional: true + widget: select + multiple: false + remember: false + default_group: All + default_group_multiple: { } + group_items: { } + created: + id: created + table: node_field_data + field: created + relationship: none + group_type: group + admin_label: '' + entity_type: node + entity_field: created + plugin_id: date + operator: '>=' + value: + min: '' + max: '' + value: '' + type: date + group: 1 + exposed: true + expose: + operator_id: created_op + label: From + description: '' + use_operator: false + operator: created_op + operator_limit_selection: false + operator_list: { } + identifier: created + required: false + remember: false + multiple: false + remember_roles: + authenticated: authenticated + anonymous: '0' + administrator: '0' + frontpage_editor: '0' + senator: '0' + microsite_content_producer: '0' + legislative_correspondent: '0' + student_programs: '0' + constituent: '0' + comment_moderator: '0' + 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: { } + created_1: + id: created_1 + table: node_field_data + field: created + relationship: none + group_type: group + admin_label: '' + entity_type: node + entity_field: created + plugin_id: date + operator: '<=' + value: + min: '' + max: '' + value: '' + type: date + group: 1 + exposed: true + expose: + operator_id: created_1_op + label: To + description: '' + use_operator: false + operator: created_1_op + operator_limit_selection: false + operator_list: { } + identifier: created_1 + required: false + remember: false + multiple: false + remember_roles: + authenticated: authenticated + anonymous: '0' + administrator: '0' + frontpage_editor: '0' + senator: '0' + microsite_content_producer: '0' + legislative_correspondent: '0' + student_programs: '0' + constituent: '0' + comment_moderator: '0' + 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: { } style: type: table + options: + grouping: { } + row_class: '' + default_row_class: true + columns: + node_bulk_form: node_bulk_form + created: created + field_image_submission: field_image_submission + field_file_submission: field_file_submission + field_submission_type: field_submission_type + field_upload_type: field_upload_type + field_student_name: field_student_name + field_teacher_email: field_teacher_email + field_teacher_name: field_teacher_name + field_school: field_school + name: name + field_form_type: field_form_type + status: status + default: created + info: + node_bulk_form: + align: '' + separator: '' + empty_column: false + responsive: '' + created: + sortable: true + default_sort_order: desc + align: '' + separator: '' + empty_column: false + responsive: '' + field_image_submission: + sortable: false + default_sort_order: asc + align: '' + separator: '' + empty_column: false + responsive: '' + field_file_submission: + sortable: false + default_sort_order: asc + align: '' + separator: '' + empty_column: false + responsive: '' + field_submission_type: + sortable: false + default_sort_order: asc + align: '' + separator: '' + empty_column: false + responsive: '' + field_upload_type: + sortable: false + default_sort_order: asc + align: '' + separator: '' + empty_column: false + responsive: '' + field_student_name: + sortable: true + default_sort_order: asc + align: '' + separator: '' + empty_column: false + responsive: '' + field_teacher_email: + sortable: false + default_sort_order: asc + align: '' + separator: '' + empty_column: false + responsive: '' + field_teacher_name: + sortable: true + default_sort_order: asc + align: '' + separator: '' + empty_column: false + responsive: '' + field_school: + sortable: true + default_sort_order: asc + align: '' + separator: '' + empty_column: false + responsive: '' + name: + sortable: true + default_sort_order: asc + align: '' + separator: '' + empty_column: false + responsive: '' + field_form_type: + sortable: true + default_sort_order: asc + align: '' + separator: '' + empty_column: false + responsive: '' + status: + sortable: true + default_sort_order: asc + align: '' + separator: '' + empty_column: false + responsive: '' + override: true + sticky: false + summary: '' + empty_table: false + caption: '' + description: '' row: type: fields query: @@ -437,6 +1511,33 @@ display: entity_type: node plugin_id: entity_reverse required: true + field_school: + id: field_school + table: node__field_school + field: field_school + relationship: reverse__node__field_student_submissions + group_type: group + admin_label: 'field_school: Content' + plugin_id: standard + required: false + field_district: + id: field_district + table: node__field_district + field: field_district + relationship: field_school + group_type: group + admin_label: 'field_district: Taxonomy term' + plugin_id: standard + required: false + field_senator: + id: field_senator + table: taxonomy_term__field_senator + field: field_senator + relationship: field_district + group_type: group + admin_label: 'field_senator: Taxonomy term' + plugin_id: standard + required: false header: { } footer: { } display_extenders: { } @@ -450,7 +1551,15 @@ display: - 'user.node_grants:view' - user.permissions tags: + - 'config:field.storage.node.field_file_submission' + - 'config:field.storage.node.field_form_type' - 'config:field.storage.node.field_image_submission' + - 'config:field.storage.node.field_school' + - 'config:field.storage.node.field_student_name' + - 'config:field.storage.node.field_submission_type' + - 'config:field.storage.node.field_teacher_email' + - 'config:field.storage.node.field_teacher_name' + - 'config:field.storage.node.field_upload_type' page_1: id: page_1 display_title: Page @@ -458,7 +1567,16 @@ display: position: 1 display_options: display_extenders: { } - path: student-submissions + path: admin/content/student-submissions + menu: + type: normal + title: 'Manage student submissions' + description: '' + weight: 20 + expanded: false + menu_name: admin + parent: system.admin_content + context: '0' use_admin_theme: true cache_metadata: max-age: 0 @@ -470,4 +1588,12 @@ display: - 'user.node_grants:view' - user.permissions tags: + - 'config:field.storage.node.field_file_submission' + - 'config:field.storage.node.field_form_type' - 'config:field.storage.node.field_image_submission' + - 'config:field.storage.node.field_school' + - 'config:field.storage.node.field_student_name' + - 'config:field.storage.node.field_submission_type' + - 'config:field.storage.node.field_teacher_email' + - 'config:field.storage.node.field_teacher_name' + - 'config:field.storage.node.field_upload_type' From 7f812163af64cfc77fa96249c8ff0cfe70ec98c0 Mon Sep 17 00:00:00 2001 From: Nathaniel Woodland Date: Tue, 10 Dec 2024 12:10:41 -0500 Subject: [PATCH 06/15] NYS-83: Implement view for displaying student submissions [WIP] --- composer.json | 1 + composer.lock | 66 +- config/sync/colorbox.settings.yml | 33 + ...de.student_submission_container.status.yml | 2 +- config/sync/core.extension.yml | 1 + ...views.view.display_student_submissions.yml | 1085 +++++++++++++++++ ...views.view.manage_student_submissions.yml} | 6 +- .../nys_school_forms/nys_school_forms.module | 15 + .../custom/nys_senators/nys_senators.module | 40 + .../nysenate_theme/nysenate_theme.theme | 22 - .../submission-results.scss | 86 ++ .../submission-results.twig | 2 +- 12 files changed, 1331 insertions(+), 28 deletions(-) create mode 100644 config/sync/colorbox.settings.yml create mode 100644 config/sync/views.view.display_student_submissions.yml rename config/sync/{views.view.student_submissions.yml => views.view.manage_student_submissions.yml} (99%) diff --git a/composer.json b/composer.json index dfd33db6bd..ff6745f295 100644 --- a/composer.json +++ b/composer.json @@ -43,6 +43,7 @@ "drupal/charts": "^5.0", "drupal/clamav": "^2.0", "drupal/classy": "^1.0", + "drupal/colorbox": "^2.1", "drupal/comments_ban": "^1.0", "drupal/components": "^3.1", "drupal/conditional_fields": "^4.0@alpha", diff --git a/composer.lock b/composer.lock index 4361586006..558b7a6872 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "ac91b4931ab49d247d28942b41608380", + "content-hash": "a11da89fdd4c71eaadece2de1b66338a", "packages": [ { "name": "asm89/stack-cors", @@ -3023,6 +3023,70 @@ "issues": "https://drupal.org/project/issues/classy" } }, + { + "name": "drupal/colorbox", + "version": "2.1.1", + "source": { + "type": "git", + "url": "https://git.drupalcode.org/project/colorbox.git", + "reference": "2.1.1" + }, + "dist": { + "type": "zip", + "url": "https://ftp.drupal.org/files/projects/colorbox-2.1.1.zip", + "reference": "2.1.1", + "shasum": "59f2fc48ba12ebc91293f7d33138ae6a7761b4b1" + }, + "require": { + "drupal/core": "^9 || ^10 || ^11" + }, + "suggest": { + "jackmoore/colorbox": "The Colorbox library is required to use the drupal/colorbox module." + }, + "type": "drupal-module", + "extra": { + "drupal": { + "version": "2.1.1", + "datestamp": "1723487172", + "security-coverage": { + "status": "covered", + "message": "Covered by Drupal's security advisory policy" + } + }, + "drush": { + "services": { + "drush.services.yml": "^9 || ^10 || ^11" + } + } + }, + "notification-url": "https://packages.drupal.org/8/downloads", + "license": [ + "GPL-2.0-or-later" + ], + "authors": [ + { + "name": "Paul McKibben", + "homepage": "https://www.drupal.org/u/paulmckibben", + "role": "Maintainer" + }, + { + "name": "Neslee Canil Pinto", + "homepage": "https://www.drupal.org/u/neslee-canil-pinto", + "role": "Former Maintainer" + }, + { + "name": "Fredrik Jonsson", + "homepage": "https://www.drupal.org/u/frjo", + "role": "Former Maintainer" + } + ], + "description": "A light-weight, customizable lightbox plugin for jQuery.", + "homepage": "https://www.drupal.org/project/colorbox", + "support": { + "source": "https://git.drupalcode.org/project/colorbox", + "issues": "https://www.drupal.org/project/issues/colorbox" + } + }, { "name": "drupal/comments_ban", "version": "1.0.3", diff --git a/config/sync/colorbox.settings.yml b/config/sync/colorbox.settings.yml new file mode 100644 index 0000000000..ff81a59198 --- /dev/null +++ b/config/sync/colorbox.settings.yml @@ -0,0 +1,33 @@ +_core: + default_config_hash: GXgpFNb8H7n-27gImTB9s1A2lE-lmH43d6qf2KMYp_A +custom: + style: default + activate: 0 + transition_type: elastic + transition_speed: 350 + opacity: 0.85 + text_current: '{current} of {total}' + text_previous: '« Prev' + text_next: 'Next »' + text_close: Close + maxwidth: 98% + maxheight: 98% + initialwidth: '300' + initialheight: '250' + overlayclose: true + returnfocus: true + fixed: true + scrolling: true + slideshow: + slideshow: 0 + auto: true + speed: 2500 + text_start: 'start slideshow' + text_stop: 'stop slideshow' +advanced: + unique_token: 1 + mobile_detect: 1 + mobile_device_width: 480px + caption_trim: 0 + caption_trim_length: 75 + compression_type: minified diff --git a/config/sync/core.base_field_override.node.student_submission_container.status.yml b/config/sync/core.base_field_override.node.student_submission_container.status.yml index f30e1ea2f7..ed0fabe842 100644 --- a/config/sync/core.base_field_override.node.student_submission_container.status.yml +++ b/config/sync/core.base_field_override.node.student_submission_container.status.yml @@ -14,7 +14,7 @@ required: false translatable: true default_value: - - value: 0 + value: 1 default_value_callback: '' settings: on_label: 'On' diff --git a/config/sync/core.extension.yml b/config/sync/core.extension.yml index b017b72b29..b7eb9e5727 100644 --- a/config/sync/core.extension.yml +++ b/config/sync/core.extension.yml @@ -21,6 +21,7 @@ module: captcha: 0 charts: 0 ckeditor5: 0 + colorbox: 0 comment: 0 components: 0 conditional_fields: 0 diff --git a/config/sync/views.view.display_student_submissions.yml b/config/sync/views.view.display_student_submissions.yml new file mode 100644 index 0000000000..acf55e0abf --- /dev/null +++ b/config/sync/views.view.display_student_submissions.yml @@ -0,0 +1,1085 @@ +uuid: ce90fe7e-c375-4e78-832a-74f650e77f10 +langcode: en +status: true +dependencies: + config: + - field.storage.node.field_file_submission + - field.storage.node.field_grade + - field.storage.node.field_image_submission + - field.storage.node.field_student_name + - image.style.thumbnail + - node.type.student_submission + module: + - better_exposed_filters + - colorbox + - file + - node + - options + - user + - views_list_sort +id: display_student_submissions +label: 'Display student submissions' +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: + title: 'Display student submissions' + fields: + title: + id: title + table: node_field_data + field: title + relationship: field_school + group_type: group + admin_label: '' + entity_type: node + entity_field: title + plugin_id: field + label: School + 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 + click_sort_column: value + type: string + settings: + link_to_entity: false + 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_grade: + id: field_grade + table: node__field_grade + field: field_grade + relationship: reverse__node__field_student_submissions + group_type: group + admin_label: '' + plugin_id: field + label: Grade + 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 + click_sort_column: value + type: list_default + settings: { } + 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_student_name: + id: field_student_name + table: node__field_student_name + field: field_student_name + relationship: none + group_type: group + admin_label: '' + plugin_id: field + label: 'Student 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 + click_sort_column: value + type: string + settings: + link_to_entity: false + 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_image_submission: + id: field_image_submission + table: node__field_image_submission + field: field_image_submission + relationship: none + group_type: group + admin_label: '' + plugin_id: field + label: 'Image submission' + exclude: true + alter: + alter_text: true + text: '{{ field_image_submission }}
' + 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 + click_sort_column: target_id + type: colorbox + settings: + colorbox_image_style: '' + colorbox_gallery: page + colorbox_gallery_custom: '' + colorbox_caption: auto + colorbox_caption_custom: '' + colorbox_node_style: thumbnail + colorbox_node_style_first: '' + 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 + field_file_submission: + id: field_file_submission + table: node__field_file_submission + field: field_file_submission + relationship: none + group_type: group + admin_label: '' + plugin_id: field + label: 'File submission' + exclude: true + alter: + alter_text: true + text: '{{ field_file_submission }}
' + 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 + click_sort_column: target_id + type: file_default + settings: + use_description_as_link_text: true + 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 + nothing: + id: nothing + table: views + field: nothing + relationship: none + group_type: group + admin_label: '' + plugin_id: custom + label: Submission + exclude: false + alter: + alter_text: true + text: "{{ field_image_submission }}\r\n{{ field_file_submission }}" + 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: false + created: + id: created + table: node_field_data + field: created + relationship: none + group_type: group + admin_label: '' + entity_type: node + entity_field: created + plugin_id: field + label: 'Submission year' + 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 + click_sort_column: value + type: timestamp + settings: + date_format: html_year + custom_date_format: '' + timezone: '' + tooltip: + date_format: html_year + custom_date_format: '' + time_diff: + enabled: false + future_format: '@interval hence' + past_format: '@interval ago' + granularity: 2 + refresh: 60 + description: '' + 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: full + options: + offset: 0 + pagination_heading_level: h4 + items_per_page: 100 + 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 + exposed_form: + type: bef + options: + submit_button: Apply + reset_button: true + 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: basic_html + bef: + general: + autosubmit: false + autosubmit_exclude_textfield: false + autosubmit_textfield_delay: 500 + 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 + is_secondary: false + field_grade_value: + plugin_id: default + advanced: + sort_options: false + rewrite: + filter_rewrite_values: '' + filter_rewrite_values_key: false + collapsible: false + collapsible_disable_automatic_open: false + is_secondary: false + field_student_name_value: + plugin_id: default + advanced: + placeholder_text: '' + collapsible: false + collapsible_disable_automatic_open: false + is_secondary: false + created: + plugin_id: default + advanced: + placeholder_text: '' + collapsible: false + collapsible_disable_automatic_open: false + is_secondary: false + access: + type: perm + options: + perm: 'access content' + cache: + type: none + options: { } + empty: + area: + id: area + table: views + field: area + relationship: none + group_type: group + admin_label: '' + plugin_id: text + empty: true + content: + value: '

No submissions found. Please check your filters.

' + format: basic_html + tokenize: false + sorts: + title: + id: title + table: node_field_data + field: title + relationship: field_school + group_type: group + admin_label: '' + entity_type: node + entity_field: title + plugin_id: standard + order: ASC + expose: + label: '' + field_identifier: '' + exposed: false + field_grade_value: + id: field_grade_value + table: node__field_grade + field: field_grade_value + relationship: reverse__node__field_student_submissions + group_type: group + admin_label: '' + plugin_id: sort_allowed_values + order: ASC + expose: + label: '' + field_identifier: '' + exposed: false + allowed_values: '0' + null_heavy: '0' + arguments: { } + 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: 1 + exposed: false + expose: + operator_id: '' + label: 'Published status' + description: '' + use_operator: false + operator: status_op + operator_limit_selection: false + operator_list: { } + identifier: status + required: false + remember: false + multiple: false + remember_roles: + authenticated: authenticated + anonymous: '0' + administrator: '0' + frontpage_editor: '0' + senator: '0' + microsite_content_producer: '0' + legislative_correspondent: '0' + student_programs: '0' + constituent: '0' + comment_moderator: '0' + is_grouped: false + group_info: + label: '' + description: '' + identifier: '' + optional: true + widget: select + multiple: false + remember: false + default_group: All + default_group_multiple: { } + group_items: { } + accept_null: false + 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: + student_submission: student_submission + 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 + 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: { } + title: + id: title + table: node_field_data + field: title + relationship: field_school + 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: School + 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 + anonymous: '0' + administrator: '0' + frontpage_editor: '0' + senator: '0' + microsite_content_producer: '0' + legislative_correspondent: '0' + student_programs: '0' + constituent: '0' + comment_moderator: '0' + placeholder: '' + autocomplete_filter: 1 + autocomplete_min_chars: '0' + autocomplete_items: '10' + autocomplete_field: title + autocomplete_raw_suggestion: 0 + autocomplete_raw_dropdown: 0 + autocomplete_dependent: 0 + autocomplete_contextual: 0 + autocomplete_autosubmit: 0 + 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_grade_value: + id: field_grade_value + table: node__field_grade + field: field_grade_value + relationship: reverse__node__field_student_submissions + group_type: group + admin_label: '' + plugin_id: list_field + operator: or + value: { } + group: 1 + exposed: true + expose: + operator_id: field_grade_value_op + label: Grade + description: '' + use_operator: false + operator: field_grade_value_op + operator_limit_selection: false + operator_list: { } + identifier: field_grade_value + required: false + remember: false + multiple: false + remember_roles: + authenticated: authenticated + anonymous: '0' + administrator: '0' + frontpage_editor: '0' + senator: '0' + microsite_content_producer: '0' + legislative_correspondent: '0' + student_programs: '0' + constituent: '0' + comment_moderator: '0' + 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 + field_student_name_value: + id: field_student_name_value + table: node__field_student_name + field: field_student_name_value + relationship: none + group_type: group + admin_label: '' + plugin_id: string + operator: contains + value: '' + group: 1 + exposed: true + expose: + operator_id: field_student_name_value_op + label: 'Student name' + description: '' + use_operator: false + operator: field_student_name_value_op + operator_limit_selection: false + operator_list: { } + identifier: field_student_name_value + required: false + remember: false + multiple: false + remember_roles: + authenticated: authenticated + anonymous: '0' + administrator: '0' + frontpage_editor: '0' + senator: '0' + microsite_content_producer: '0' + legislative_correspondent: '0' + student_programs: '0' + constituent: '0' + comment_moderator: '0' + placeholder: '' + autocomplete_filter: 1 + autocomplete_min_chars: '0' + autocomplete_items: '10' + autocomplete_field: field_student_name + autocomplete_raw_suggestion: 1 + autocomplete_raw_dropdown: 1 + autocomplete_dependent: 0 + autocomplete_contextual: 0 + autocomplete_autosubmit: 0 + is_grouped: false + group_info: + label: '' + description: '' + identifier: '' + optional: true + widget: select + multiple: false + remember: false + default_group: All + default_group_multiple: { } + group_items: { } + created: + id: created + table: node_field_data + field: created + relationship: none + group_type: group + admin_label: '' + entity_type: node + entity_field: created + plugin_id: date + operator: '=' + value: + min: '' + max: '' + value: '' + type: date_year + group: 1 + exposed: true + expose: + operator_id: created_op + label: 'Submission year' + description: '' + use_operator: false + operator: created_op + operator_limit_selection: false + operator_list: { } + identifier: created + required: false + remember: false + multiple: false + remember_roles: + authenticated: authenticated + anonymous: '0' + administrator: '0' + frontpage_editor: '0' + senator: '0' + microsite_content_producer: '0' + legislative_correspondent: '0' + student_programs: '0' + constituent: '0' + comment_moderator: '0' + 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: { } + filter_groups: + operator: AND + groups: + 1: AND + style: + type: table + options: + grouping: { } + row_class: '' + default_row_class: true + columns: + title: title + field_grade: field_grade + field_student_name: field_student_name + field_image_submission: field_image_submission + field_file_submission: field_file_submission + nothing: nothing + created: created + default: title + info: + title: + sortable: true + default_sort_order: asc + align: '' + separator: '' + empty_column: false + responsive: '' + field_grade: + sortable: true + default_sort_order: asc + align: '' + separator: '' + empty_column: false + responsive: '' + field_student_name: + sortable: true + default_sort_order: asc + align: '' + separator: '' + empty_column: false + responsive: '' + field_image_submission: + sortable: false + default_sort_order: asc + align: '' + separator: '' + empty_column: false + responsive: '' + field_file_submission: + sortable: false + default_sort_order: asc + align: '' + separator: '' + empty_column: false + responsive: '' + nothing: + align: '' + separator: '' + empty_column: false + responsive: '' + created: + sortable: true + default_sort_order: asc + align: '' + separator: '' + empty_column: false + responsive: '' + override: true + sticky: false + summary: '' + empty_table: false + caption: '' + description: '' + row: + type: fields + query: + type: views_query + options: + query_comment: '' + disable_sql_rewrite: false + distinct: false + disable_automatic_base_fields: false + replica: false + query_tags: { } + relationships: + reverse__node__field_student_submissions: + id: reverse__node__field_student_submissions + table: node_field_data + field: reverse__node__field_student_submissions + relationship: none + group_type: group + admin_label: field_student_submissions + entity_type: node + plugin_id: entity_reverse + required: true + field_school: + id: field_school + table: node__field_school + field: field_school + relationship: reverse__node__field_student_submissions + group_type: group + admin_label: 'field_school: Content' + plugin_id: standard + required: false + use_ajax: true + group_by: false + header: + area: + id: area + table: views + field: area + relationship: none + group_type: group + admin_label: '' + plugin_id: text + empty: false + content: + value: '

{{ created }} Student Submissions

' + format: basic_html + tokenize: true + footer: { } + 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_file_submission' + - 'config:field.storage.node.field_grade' + - 'config:field.storage.node.field_image_submission' + - 'config:field.storage.node.field_student_name' + block_1: + id: block_1 + display_title: Block + display_plugin: block + position: 2 + display_options: + display_extenders: { } + block_hide_empty: false + 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_file_submission' + - 'config:field.storage.node.field_grade' + - 'config:field.storage.node.field_image_submission' + - 'config:field.storage.node.field_student_name' diff --git a/config/sync/views.view.student_submissions.yml b/config/sync/views.view.manage_student_submissions.yml similarity index 99% rename from config/sync/views.view.student_submissions.yml rename to config/sync/views.view.manage_student_submissions.yml index 8de71f25e6..c3058b082c 100644 --- a/config/sync/views.view.student_submissions.yml +++ b/config/sync/views.view.manage_student_submissions.yml @@ -1,4 +1,4 @@ -uuid: 95c2bc1a-7a0b-4306-95a5-97e811098173 +uuid: 6a2bc278-3d56-4741-884b-76acb8150710 langcode: en status: true dependencies: @@ -23,8 +23,8 @@ dependencies: - svg_image - taxonomy - user -id: student_submissions -label: 'Student submissions' +id: manage_student_submissions +label: 'Manage student submissions' module: views description: '' tag: '' diff --git a/web/modules/custom/nys_school_forms/nys_school_forms.module b/web/modules/custom/nys_school_forms/nys_school_forms.module index 15fb3c9130..1d4838c6ba 100644 --- a/web/modules/custom/nys_school_forms/nys_school_forms.module +++ b/web/modules/custom/nys_school_forms/nys_school_forms.module @@ -92,6 +92,21 @@ function nys_school_forms_inline_entity_form_entity_form_alter(&$form, FormState } } +/** + * Implements hook_form_FORM_ID_alter() for views_exposed_form. + */ +function nys_school_forms_form_views_exposed_form_alter(&$form, FormStateInterface $form_state, $form_id) { + if ($form['#id'] === 'views-exposed-form-display-student-submissions-block-1') { + // Set submission year filter to current year, if no user input. + $user_input = $form_state->getUserInput(); + $default_empty_fields = ['title', 'field_student_name_value', 'created']; + $default_empty_fields_empty = empty(array_filter(array_intersect_key($user_input, array_flip($default_empty_fields)))); + if ($default_empty_fields_empty && $user_input['field_grade_value'] === 'All') { + $form_state->setUserInput(['created' => date('Y')]); + } + } +} + /** * Custom validation to make only one upload field required. */ diff --git a/web/modules/custom/nys_senators/nys_senators.module b/web/modules/custom/nys_senators/nys_senators.module index c83e03e37f..dea5183d30 100644 --- a/web/modules/custom/nys_senators/nys_senators.module +++ b/web/modules/custom/nys_senators/nys_senators.module @@ -23,6 +23,7 @@ use Drupal\taxonomy\Entity\Term; use Drupal\taxonomy\TermInterface; use Drupal\user\Entity\User; use Drupal\user\UserInterface; +use Drupal\views\Views; /** * Implements hook_theme(). @@ -1324,6 +1325,45 @@ function nys_senators_query_taxonomy_term_access_alter(AlterableInterface $query $query->condition($or); } +/** + * Implements hook_preprocess_HOOK(). + */ +function nys_senators_preprocess_field__node__field_block(&$variables) { + $block_types_to_remove = [ + 'microsite_hero', + 'senator_microsite_menu', + ]; + foreach (($variables['items'] ?? []) as $key => $item) { + /** @var \Drupal\block_content\Entity\BlockContent $block_content */ + $block_content = ($item['content']['#block_content'] ?? []); + if ($block_content instanceof BlockContent) { + // Remove microsite_hero and senator_microsite_menu blocks from field + // rendering, as these blocks are rendered directly through + // page--node--microsite-page.html.twig + if (in_array($block_content->bundle(), $block_types_to_remove)) { + unset($variables['items'][$key]); + } + + // Add new student submissions view above old student submission form + // block. + if ($block_content->bundle() == 'senator_microsite_school_forms') { + $old_student_submissions = $variables['items'][$key]; + unset($variables['items'][$key]); + $view = Views::getView('display_student_submissions'); + if ($view) { + $view->setDisplay('block_1'); + $view->preExecute(); + $view->execute(); + if (!empty($view->total_rows)) { + $variables['items'][]['content'] = $view->render(); + } + } + $variables['items'][] = $old_student_submissions; + } + } + } +} + /** * Rearrange the Earth Day & Thankful Microsite pages blocks order. */ diff --git a/web/themes/custom/nysenate_theme/nysenate_theme.theme b/web/themes/custom/nysenate_theme/nysenate_theme.theme index c4bfa1d99b..0f3191988d 100644 --- a/web/themes/custom/nysenate_theme/nysenate_theme.theme +++ b/web/themes/custom/nysenate_theme/nysenate_theme.theme @@ -2778,28 +2778,6 @@ function get_issue_card($term) { return $issue_card; } -/** - * Implements hook_preprocess_HOOK(). - */ -function nysenate_theme_preprocess_field__node__field_block(&$variables) { - // Remove microsite_hero and senator_microsite_menu blocks from field - // rendering, as these blocks are rendered directly through - // page--node--microsite-page.html.twig - $block_types = [ - 'microsite_hero', - 'senator_microsite_menu', - ]; - foreach (($variables['items'] ?? []) as $key => $item) { - /** @var \Drupal\block_content\Entity\BlockContent $block_content */ - $block_content = ($item['content']['#block_content'] ?? []); - if ($block_content instanceof BlockContent) { - if (in_array($block_content->bundle(), $block_types)) { - unset($variables['items'][$key]); - } - } - } -} - /** * Implements hook_preprocess_page__node__TYPE(). */ diff --git a/web/themes/custom/nysenate_theme/src/patterns/components/submission-results/submission-results.scss b/web/themes/custom/nysenate_theme/src/patterns/components/submission-results/submission-results.scss index a9650b2521..27cce917cc 100644 --- a/web/themes/custom/nysenate_theme/src/patterns/components/submission-results/submission-results.scss +++ b/web/themes/custom/nysenate_theme/src/patterns/components/submission-results/submission-results.scss @@ -217,3 +217,89 @@ } } } + +// Styling for new views-based submissions results. +.view-id-display_student_submissions { + h2 { + font-size: 37px; + } + + .js-form-item { + float: left; + width: 27%; + margin: 0 1% 0 0; + padding: 0; + + &.js-form-item-created { + width: 15% + } + + input, select { + min-height: 45px; + margin-bottom: 20px; + } + + input.form-autocomplete { + background-position: 95% center; + } + + &.js-form-type-select { + &::after { + top: 30px; + } + } + } + + .form-actions { + clear: both; + margin-bottom: 30px; + } + + .view-content { + line-height: 20px; + + thead th { + padding: 10px; + font-size: 20px; + font-weight: normal; + border: none; + + a { + color: #fff; + font-weight: normal; + text-decoration: underline; + text-underline-offset: 3px; + text-decoration-thickness: 1.5px; + + &:hover { + text-decoration: none; + } + } + } + + tbody td { + border: 1px solid $grey15; + + a { + word-break: break-all; + } + } + } + +} + +// Override to ensure datepicker JS doesn't get confused. +body[class*="thankful"], body[class*="earthday"] { + margin-top: 0; + padding-top: 100px; + + .datepicker-years { + thead tr { + background-color: $gen_blue_drk; + + th:hover { + background-color: $gen_blue_drk; + } + } + } +} diff --git a/web/themes/custom/nysenate_theme/src/patterns/components/submission-results/submission-results.twig b/web/themes/custom/nysenate_theme/src/patterns/components/submission-results/submission-results.twig index 743ea382c3..e7c9a4e3e8 100644 --- a/web/themes/custom/nysenate_theme/src/patterns/components/submission-results/submission-results.twig +++ b/web/themes/custom/nysenate_theme/src/patterns/components/submission-results/submission-results.twig @@ -19,7 +19,7 @@ {% elseif panel.filter == false and loop.index == 1%} checked = "checked" {% endif %}> - + {% endif %} {% endfor %} From 06145fc624cc3ebe3a7ffbd234a59039b23d2111 Mon Sep 17 00:00:00 2001 From: Nathaniel Woodland Date: Thu, 12 Dec 2024 15:23:19 -0500 Subject: [PATCH 07/15] NYS-83: Implement view for displaying student submissions --- ...views.view.display_student_submissions.yml | 102 +++++++++++++++++- .../nys_school_forms/nys_school_forms.module | 35 ++++++ .../submission-results.scss | 4 + 3 files changed, 139 insertions(+), 2 deletions(-) diff --git a/config/sync/views.view.display_student_submissions.yml b/config/sync/views.view.display_student_submissions.yml index acf55e0abf..b467b082ff 100644 --- a/config/sync/views.view.display_student_submissions.yml +++ b/config/sync/views.view.display_student_submissions.yml @@ -15,6 +15,7 @@ dependencies: - file - node - options + - taxonomy - user - views_list_sort id: display_student_submissions @@ -610,7 +611,86 @@ display: exposed: false allowed_values: '0' null_heavy: '0' - arguments: { } + arguments: + field_form_type_value: + id: field_form_type_value + table: node__field_form_type + field: field_form_type_value + relationship: reverse__node__field_student_submissions + group_type: group + admin_label: '' + plugin_id: string_list_field + default_action: empty + 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 + human: false + specify_validation: false + validate: + type: none + fail: 'not found' + validate_options: { } + glossary: false + limit: 0 + case: none + path_case: none + transform_dash: false + break_phrase: false + tid: + id: tid + table: taxonomy_term_field_data + field: tid + relationship: field_senator + group_type: group + admin_label: '' + entity_type: taxonomy_term + entity_field: tid + plugin_id: taxonomy + default_action: empty + exception: + value: all + title_enable: false + title: All + title_enable: false + title: '' + default_argument_type: taxonomy_tid + default_argument_options: + term_page: '1' + node: false + limit: false + vids: { } + anyall: ',' + 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: false + validate: + type: none + fail: 'not found' + validate_options: { } + break_phrase: false + not: false filters: status: id: status @@ -1029,6 +1109,24 @@ display: admin_label: 'field_school: Content' plugin_id: standard required: false + field_district: + id: field_district + table: node__field_district + field: field_district + relationship: field_school + group_type: group + admin_label: 'field_district: Taxonomy term' + plugin_id: standard + required: false + field_senator: + id: field_senator + table: taxonomy_term__field_senator + field: field_senator + relationship: field_district + group_type: group + admin_label: 'field_senator: Taxonomy term' + plugin_id: standard + required: false use_ajax: true group_by: false header: @@ -1042,7 +1140,7 @@ display: plugin_id: text empty: false content: - value: '

{{ created }} Student Submissions

' + value: '

{{ created }} Submissions

' format: basic_html tokenize: true footer: { } diff --git a/web/modules/custom/nys_school_forms/nys_school_forms.module b/web/modules/custom/nys_school_forms/nys_school_forms.module index 1d4838c6ba..0cbb6d08d2 100644 --- a/web/modules/custom/nys_school_forms/nys_school_forms.module +++ b/web/modules/custom/nys_school_forms/nys_school_forms.module @@ -7,6 +7,8 @@ use Drupal\Core\Access\AccessResult; use Drupal\Core\Form\FormStateInterface; +use Drupal\node\Entity\Node; +use Drupal\views\ViewExecutable; use Drupal\webform\WebformSubmissionInterface; /** @@ -107,6 +109,39 @@ function nys_school_forms_form_views_exposed_form_alter(&$form, FormStateInterfa } } +/** + * Implements hook_views_pre_view(). + */ +function nys_school_forms_views_pre_view(ViewExecutable $view, $display_id, &$args) { + if ($view->id() === 'display_student_submissions' && $display_id === 'block_1') { + $aliased_path = \Drupal::requestStack()->getCurrentRequest()->getPathInfo(); + $source_path = \Drupal::service('path_alias.manager')->getPathByAlias($aliased_path); + + // Contextual filter to limit results to proper form type. + $form_type = substr($aliased_path, strrpos($aliased_path, '/') + 1); + switch ($form_type) { + case 'earthday': + $args[0] = 'earth_day'; + break; + case 'thankful': + $args[0] = 'thanksgiving'; + break; + } + + // Contextual filter to limit results to schools in senator's district. + if (preg_match('/^\/node\/(\d+)$/', $source_path, $matches)) { + $node_id = $matches[1]; + $microsite_node = Node::load($node_id); + if ( + $microsite_node instanceof \Drupal\node\NodeInterface + && !empty($microsite_node->field_senator_multiref->target_id) + ) { + $args[1] = $microsite_node->field_senator_multiref->target_id; + } + } + } +} + /** * Custom validation to make only one upload field required. */ diff --git a/web/themes/custom/nysenate_theme/src/patterns/components/submission-results/submission-results.scss b/web/themes/custom/nysenate_theme/src/patterns/components/submission-results/submission-results.scss index 27cce917cc..9353b5a232 100644 --- a/web/themes/custom/nysenate_theme/src/patterns/components/submission-results/submission-results.scss +++ b/web/themes/custom/nysenate_theme/src/patterns/components/submission-results/submission-results.scss @@ -220,8 +220,12 @@ // Styling for new views-based submissions results. .view-id-display_student_submissions { + margin-bottom: 90px; + margin-top: 30px; + h2 { font-size: 37px; + font-family: $font-serif-semibold; } .js-form-item { From 94138d94083ebb4192f7478ba5d8d04171e9aac6 Mon Sep 17 00:00:00 2001 From: Nathaniel Woodland Date: Thu, 12 Dec 2024 16:39:52 -0500 Subject: [PATCH 08/15] NYS-83: Implement admin UI for establishing submission periods --- .../views.view.manage_student_submissions.yml | 15 ++- .../nys_school_forms.links.task.yml | 4 + .../nys_school_forms/nys_school_forms.module | 42 ++++++- .../nys_school_forms.routing.yml | 9 ++ .../src/Form/SubmissionPeriodForm.php | 104 ++++++++++++++++++ 5 files changed, 171 insertions(+), 3 deletions(-) create mode 100644 web/modules/custom/nys_school_forms/src/Form/SubmissionPeriodForm.php diff --git a/config/sync/views.view.manage_student_submissions.yml b/config/sync/views.view.manage_student_submissions.yml index c3058b082c..c73d3a988e 100644 --- a/config/sync/views.view.manage_student_submissions.yml +++ b/config/sync/views.view.manage_student_submissions.yml @@ -973,7 +973,20 @@ display: cache: type: tag options: { } - empty: { } + empty: + area: + id: area + table: views + field: area + relationship: none + group_type: group + admin_label: '' + plugin_id: text + empty: true + content: + value: '

No student submissions found. Please check your filters.' + format: basic_html + tokenize: false sorts: created: id: created diff --git a/web/modules/custom/nys_school_forms/nys_school_forms.links.task.yml b/web/modules/custom/nys_school_forms/nys_school_forms.links.task.yml index 7233fe7a07..c6d57b24f3 100644 --- a/web/modules/custom/nys_school_forms/nys_school_forms.links.task.yml +++ b/web/modules/custom/nys_school_forms/nys_school_forms.links.task.yml @@ -2,3 +2,7 @@ nys_school_forms.config_tab: title: "Webform Events" route_name: nys_school_forms.config base_route: nys_config.config +nys_school_forms.open_submission_tab: + title: "School Forms submission periods" + route_name: nys_school_forms.submission_period + base_route: nys_config.config diff --git a/web/modules/custom/nys_school_forms/nys_school_forms.module b/web/modules/custom/nys_school_forms/nys_school_forms.module index 0cbb6d08d2..44e4d193d5 100644 --- a/web/modules/custom/nys_school_forms/nys_school_forms.module +++ b/web/modules/custom/nys_school_forms/nys_school_forms.module @@ -61,14 +61,44 @@ function nys_school_forms_form_node_student_submission_container_form_alter(&$fo $form['field_form_type']['#access'] = FALSE; } if ($current_path == '/questionnaires/what-are-you-thankful') { - $form['field_form_type']['widget']['#default_value'] = 'thanksgiving'; + $form_type = 'thanksgiving'; + $form['field_form_type']['widget']['#default_value'] = $form_type; } elseif ($current_path == '/earthday') { - $form['field_form_type']['widget']['#default_value'] = 'earth_day'; + $form_type = 'earth_day'; + $form['field_form_type']['widget']['#default_value'] = $form_type; } // Custom validation to make only one upload field required. $form['#validate'][] = '_nys_school_forms_validate_ss_container_form'; + + // Custom submit handler to alter redirect and success message. + $form['actions']['submit']['#submit'][] = '_nys_school_forms_ss_container_submit_handler'; + + // Disable form if not in submission period. + $is_form_active = FALSE; + $form_open_time = strtotime(\Drupal::state()->get('nys_school_forms.submission_periods')[$form_type]['begin']); + $form_close_time = strtotime(\Drupal::state()->get('nys_school_forms.submission_periods')[$form_type]['end']); + if ($form_open_time <= time() && $form_close_time >= time()) { + $is_form_active = TRUE; + } + if (!$is_form_active) { + foreach ($form as $key => $value) { + // Removes all input fields. + if (!str_starts_with($key, '#')) { + unset($form[$key]); + } + } + $form['#attached']['library'][] = 'rain_theme/message'; + $form['#markup'] = << +

Status message

+
    +
  • The submission period is currently closed.
  • +
+ + HTML; + } } /** @@ -173,3 +203,11 @@ function _nys_school_forms_validate_ss_container_form(array &$form, FormStateInt $form_state->setErrorByName($field_name, $message); } } + +/** + * Custom submit handler for custom redirect. + */ +function _nys_school_forms_ss_container_submit_handler(array &$form, \Drupal\Core\Form\FormStateInterface $form_state) { + $form_state->setRedirect(''); + \Drupal::messenger()->addMessage(t('Your student submission has been received.')); +} diff --git a/web/modules/custom/nys_school_forms/nys_school_forms.routing.yml b/web/modules/custom/nys_school_forms/nys_school_forms.routing.yml index def81bc9ac..cd1ce84c50 100644 --- a/web/modules/custom/nys_school_forms/nys_school_forms.routing.yml +++ b/web/modules/custom/nys_school_forms/nys_school_forms.routing.yml @@ -59,3 +59,12 @@ nys_school_forms.config: _permission: 'administer site configuration' options: _admin_route: TRUE +nys_school_forms.submission_period: + path: /admin/settings/nysenate/submission-period + defaults: + _form: '\Drupal\nys_school_forms\Form\SubmissionPeriodForm' + _title: 'Configure open submission periods' + requirements: + _permission: 'administer site configuration' + options: + _admin_route: TRUE diff --git a/web/modules/custom/nys_school_forms/src/Form/SubmissionPeriodForm.php b/web/modules/custom/nys_school_forms/src/Form/SubmissionPeriodForm.php new file mode 100644 index 0000000000..b6bf66ed6e --- /dev/null +++ b/web/modules/custom/nys_school_forms/src/Form/SubmissionPeriodForm.php @@ -0,0 +1,104 @@ + 'Thanksgiving', + 'earth_day' => 'Earth Day', + ]; + + /** + * Drupal's state interface for non-exportable config. + * + * @var \Drupal\Core\State\StateInterface + */ + protected $stateInterface; + + /** + * Constructs the settings form. + * + * @param \Drupal\Core\State\StateInterface $stateInterface + * The state service. + */ + public function __construct($stateInterface) { + $this->stateInterface = $stateInterface; + } + + /** + * {@inheritdoc} + */ + public static function create(ContainerInterface $container) { + return new static( + $container->get('state') + ); + } + + /** + * {@inheritdoc} + */ + public function getFormId() { + return 'nys_school_forms_submission_period_form'; + } + + /** + * {@inheritdoc} + */ + protected function getEditableConfigNames() { + // No config schema needed when using stateInterface. + return []; + } + + /** + * {@inheritdoc} + */ + public function buildForm(array $form, FormStateInterface $form_state) { + $form['submission_periods'] = [ + '#type' => 'fieldset', + '#title' => $this->t('Open submission periods'), + '#description' => $this->t('Sets the open submission periods for the Thanksgiving and Earth Day school forms.'), + '#description_display' => 'before', + '#tree' => TRUE, + ]; + foreach ($this::SCHOOL_FORM_TYPES as $type => $label) { + $submission_period_field = [ + '#type' => 'fieldset', + '#title' => "$label submission period", + ]; + $submission_period_field['begin'] = [ + '#type' => 'date', + '#title' => 'Start', + '#date_date_format' => 'Y-m-d', + '#default_value' => $this->stateInterface->get('nys_school_forms.submission_periods')[$type]['begin'], + ]; + $submission_period_field['end'] = [ + '#type' => 'date', + '#title' => 'End', + '#date_date_format' => 'Y-m-d', + '#default_value' => $this->stateInterface->get('nys_school_forms.submission_periods')[$type]['end'], + ]; + $form['submission_periods'][$type] = $submission_period_field; + } + return parent::buildForm($form, $form_state); + } + + /** + * {@inheritdoc} + */ + public function submitForm(array &$form, FormStateInterface $form_state) { + $this->stateInterface->set('nys_school_forms.submission_periods', $form_state->getValue('submission_periods')); + parent::submitForm($form, $form_state); + } + +} From d81d034ceb8affe895300236d58eb718b9ca77a1 Mon Sep 17 00:00:00 2001 From: Nathaniel Woodland Date: Tue, 17 Dec 2024 11:46:27 -0500 Subject: [PATCH 09/15] NYS-83: Account for NULL configs --- .../custom/nys_school_forms/nys_school_forms.module | 12 +++++++++--- .../src/Form/SubmissionPeriodForm.php | 4 ++-- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/web/modules/custom/nys_school_forms/nys_school_forms.module b/web/modules/custom/nys_school_forms/nys_school_forms.module index 44e4d193d5..997f344c5d 100644 --- a/web/modules/custom/nys_school_forms/nys_school_forms.module +++ b/web/modules/custom/nys_school_forms/nys_school_forms.module @@ -77,9 +77,15 @@ function nys_school_forms_form_node_student_submission_container_form_alter(&$fo // Disable form if not in submission period. $is_form_active = FALSE; - $form_open_time = strtotime(\Drupal::state()->get('nys_school_forms.submission_periods')[$form_type]['begin']); - $form_close_time = strtotime(\Drupal::state()->get('nys_school_forms.submission_periods')[$form_type]['end']); - if ($form_open_time <= time() && $form_close_time >= time()) { + $submission_periods = \Drupal::state()->get('nys_school_forms.submission_periods'); + if (!empty($submission_periods[$form_type]['begin']) && !empty($submission_periods[$form_type]['end'])) { + $form_open_time = strtotime($submission_periods[$form_type]['begin']); + $form_close_time = strtotime($submission_periods[$form_type]['end']); + } + if ( + isset($form_open_time) && isset($form_close_time) + && $form_open_time <= time() && $form_close_time >= time() + ) { $is_form_active = TRUE; } if (!$is_form_active) { diff --git a/web/modules/custom/nys_school_forms/src/Form/SubmissionPeriodForm.php b/web/modules/custom/nys_school_forms/src/Form/SubmissionPeriodForm.php index b6bf66ed6e..389f8c5257 100644 --- a/web/modules/custom/nys_school_forms/src/Form/SubmissionPeriodForm.php +++ b/web/modules/custom/nys_school_forms/src/Form/SubmissionPeriodForm.php @@ -80,13 +80,13 @@ public function buildForm(array $form, FormStateInterface $form_state) { '#type' => 'date', '#title' => 'Start', '#date_date_format' => 'Y-m-d', - '#default_value' => $this->stateInterface->get('nys_school_forms.submission_periods')[$type]['begin'], + '#default_value' => $this->stateInterface->get('nys_school_forms.submission_periods')[$type]['begin'] ?? NULL, ]; $submission_period_field['end'] = [ '#type' => 'date', '#title' => 'End', '#date_date_format' => 'Y-m-d', - '#default_value' => $this->stateInterface->get('nys_school_forms.submission_periods')[$type]['end'], + '#default_value' => $this->stateInterface->get('nys_school_forms.submission_periods')[$type]['end'] ?? NULL, ]; $form['submission_periods'][$type] = $submission_period_field; } From caadcd721fc20bcb24cbd6df12f90cbe6793a458 Mon Sep 17 00:00:00 2001 From: Nathaniel Woodland Date: Tue, 17 Dec 2024 17:11:15 -0500 Subject: [PATCH 10/15] NYS-83: Add image orientation confirmation pop-up to student submissions form --- .../css/submission-confirmation-popup.css | 54 +++++++++++++++++++ .../js/submission-confirmation-popup.js | 40 ++++++++++++++ .../nys_school_forms.libraries.yml | 10 ++++ .../nys_school_forms/nys_school_forms.module | 3 ++ 4 files changed, 107 insertions(+) create mode 100644 web/modules/custom/nys_school_forms/css/submission-confirmation-popup.css create mode 100644 web/modules/custom/nys_school_forms/js/submission-confirmation-popup.js create mode 100644 web/modules/custom/nys_school_forms/nys_school_forms.libraries.yml diff --git a/web/modules/custom/nys_school_forms/css/submission-confirmation-popup.css b/web/modules/custom/nys_school_forms/css/submission-confirmation-popup.css new file mode 100644 index 0000000000..f6948ab05d --- /dev/null +++ b/web/modules/custom/nys_school_forms/css/submission-confirmation-popup.css @@ -0,0 +1,54 @@ +.submission-modal-overlay { + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; + background: rgba(0, 0, 0, 0.6); + display: flex; + justify-content: center; + align-items: center; + z-index: 1000; +} + +.submission-modal { + width: 80%; + background: white; + padding: 20px; + border-radius: 8px; + text-align: center; + box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3); +} + +.modal-buttons { + margin-top: 15px; + display: flex; + justify-content: center; + gap: 10px; +} + +.modal-button { + padding: 10px 20px; + border: none; + border-radius: 4px; + cursor: pointer; + font-size: 16px; +} + +#confirm-yes { + background-color: #87002f; + color: white; +} + +#confirm-yes:hover { + background-color: rgba(135, 0, 47, 0.85); +} + +#confirm-no { + background-color: #004d71; + color: white; +} + +#confirm-no:hover { + background-color: rgba(0, 77, 113, 0.85); +} diff --git a/web/modules/custom/nys_school_forms/js/submission-confirmation-popup.js b/web/modules/custom/nys_school_forms/js/submission-confirmation-popup.js new file mode 100644 index 0000000000..11b69678be --- /dev/null +++ b/web/modules/custom/nys_school_forms/js/submission-confirmation-popup.js @@ -0,0 +1,40 @@ +(function (Drupal) { + Drupal.behaviors.nysSchoolFormsConfirmationPopup = { + attach: function (context) { + const form = document.querySelector('form.node-student-submission-container-form'); + form.addEventListener('submit', (e) => { + if (form.dataset.confirmationHandled === 'true') { + return; + } + e.preventDefault(); + if (!document.getElementById('submission-confirmation-modal')) { + const modal = document.createElement('div'); + modal.id = 'submission-confirmation-modal'; + modal.className = 'submission-modal-overlay'; + modal.innerHTML = ` +
+

Wait!

+

Have you double-checked that all uploaded images have been rotated to their correct orientations? (There is a rotate button next to each uploaded image.)

+ +
+ `; + document.body.appendChild(modal); + document.getElementById('confirm-yes').addEventListener('click', () => { + modal.remove(); + const submitButton = form.querySelector('div#edit-actions input.js-form-submit'); + if (submitButton) { + form.dataset.confirmationHandled = 'true'; + submitButton.click(); + } + }); + document.getElementById('confirm-no').addEventListener('click', () => { + modal.remove(); + }); + } + }); + }, + }; +})(Drupal); diff --git a/web/modules/custom/nys_school_forms/nys_school_forms.libraries.yml b/web/modules/custom/nys_school_forms/nys_school_forms.libraries.yml new file mode 100644 index 0000000000..d1200c73c9 --- /dev/null +++ b/web/modules/custom/nys_school_forms/nys_school_forms.libraries.yml @@ -0,0 +1,10 @@ +submission_confirmation_popup: + version: 1.x + css: + component: + css/submission-confirmation-popup.css: { } + js: + js/submission-confirmation-popup.js: {} + dependencies: + - core/drupal + - core/drupalSettings diff --git a/web/modules/custom/nys_school_forms/nys_school_forms.module b/web/modules/custom/nys_school_forms/nys_school_forms.module index 997f344c5d..640995619d 100644 --- a/web/modules/custom/nys_school_forms/nys_school_forms.module +++ b/web/modules/custom/nys_school_forms/nys_school_forms.module @@ -75,6 +75,9 @@ function nys_school_forms_form_node_student_submission_container_form_alter(&$fo // Custom submit handler to alter redirect and success message. $form['actions']['submit']['#submit'][] = '_nys_school_forms_ss_container_submit_handler'; + // Add JS confirmation pop-up to form. + $form['#attached']['library'][] = 'nys_school_forms/submission_confirmation_popup'; + // Disable form if not in submission period. $is_form_active = FALSE; $submission_periods = \Drupal::state()->get('nys_school_forms.submission_periods'); From 126082c0438977f73edbbc57eecc261938cd11f9 Mon Sep 17 00:00:00 2001 From: Nathaniel Woodland Date: Wed, 18 Dec 2024 13:06:47 -0500 Subject: [PATCH 11/15] NYS-83: Fix image rotate reset issue and implement various UX improvements --- composer.json | 3 ++ composer.lock | 2 +- .../css/submission-confirmation-popup.css | 16 ++++++++-- .../js/submission-confirmation-popup.js | 4 ++- .../nys_school_forms/nys_school_forms.module | 18 ++++++------ .../src/patterns/global/forms/_forms.scss | 29 ++++++++++++++++--- 6 files changed, 54 insertions(+), 18 deletions(-) diff --git a/composer.json b/composer.json index ff6745f295..7806b65ca7 100644 --- a/composer.json +++ b/composer.json @@ -328,6 +328,9 @@ "drupal/clamav": { "3383653 -Support image upload plugin for CKEditor5\n": "https://git.drupalcode.org/project/clamav/-/merge_requests/7.patch" }, + "drupal/simple_image_rotate": { + "3374358 - Inverted picture returns to its original form after adding another picture": "https://www.drupal.org/files/issues/2024-02-09/3374358-inverted-picture-returns-4.patch" + }, "drupal/stage_file_proxy": { "3457368 - createProxyHeadersArray(): Argument #1 ($headers_string) must be of type string": "https://git.drupalcode.org/project/stage_file_proxy/-/merge_requests/74.patch" }, diff --git a/composer.lock b/composer.lock index 558b7a6872..669d0ea308 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "a11da89fdd4c71eaadece2de1b66338a", + "content-hash": "5ded73f638e084b1db1318ccca7b91ce", "packages": [ { "name": "asm89/stack-cors", diff --git a/web/modules/custom/nys_school_forms/css/submission-confirmation-popup.css b/web/modules/custom/nys_school_forms/css/submission-confirmation-popup.css index f6948ab05d..cd58a29fc4 100644 --- a/web/modules/custom/nys_school_forms/css/submission-confirmation-popup.css +++ b/web/modules/custom/nys_school_forms/css/submission-confirmation-popup.css @@ -20,8 +20,18 @@ box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3); } +.submission-modal h2 { + font-size: 30px; + color: #a00101; +} + +.submission-modal p { + font-size: 18px; + line-height: 18px; +} + .modal-buttons { - margin-top: 15px; + margin-top: 25px; display: flex; justify-content: center; gap: 10px; @@ -36,12 +46,12 @@ } #confirm-yes { - background-color: #87002f; + background-color: #a00101; color: white; } #confirm-yes:hover { - background-color: rgba(135, 0, 47, 0.85); + background-color: #c62526; } #confirm-no { diff --git a/web/modules/custom/nys_school_forms/js/submission-confirmation-popup.js b/web/modules/custom/nys_school_forms/js/submission-confirmation-popup.js index 11b69678be..ebdad87552 100644 --- a/web/modules/custom/nys_school_forms/js/submission-confirmation-popup.js +++ b/web/modules/custom/nys_school_forms/js/submission-confirmation-popup.js @@ -14,7 +14,9 @@ modal.innerHTML = `

Wait!

-

Have you double-checked that all uploaded images have been rotated to their correct orientations? (There is a rotate button next to each uploaded image.)

+

Image orientations can change after upload.

+

Have you double-checked that all uploaded images have been rotated to their proper orientations?

+

(There is a rotate button next to each uploaded image.)

- HTML; + $form['status_message'] = [ + '#theme' => 'status_messages', + '#message_list' => [ + 'status' => ['The submission period is currently closed.'], + ], + '#status_headings' => [ + 'status' => t('Status message'), + ], + ]; } + + // Attach confirmation modal HTML to form, for later rendering using jQuery UI. + $form['confirmation_modal'] = [ + '#type' => 'container', + '#weight' => 100, + '#attributes' => [ + 'id' => 'submission-confirmation-modal', + 'title' => t('Wait!'), + ], + 'content' => [ + 'warning' => [ + '#type' => 'html_tag', + '#tag' => 'p', + '#value' => t('Image orientations can change after upload.'), + ], + 'question' => [ + '#type' => 'html_tag', + '#tag' => 'p', + '#value' => t('Have you double-checked that all uploaded images have been rotated to their proper orientations?', [], ['context' => 'html']), + ], + 'note' => [ + '#type' => 'html_tag', + '#tag' => 'p', + '#value' => ('(There is a rotate button next to each uploaded image.)'), + ], + ], + ]; + } /** @@ -124,13 +139,10 @@ function nys_school_forms_inline_entity_form_entity_form_alter(&$form, FormState } // Enable submission type field for thanksgiving form. - $current_path = \Drupal::requestStack()->getCurrentRequest()->getPathInfo(); - if ($current_path == '/questionnaires/what-are-you-thankful') { - $form['field_submission_type']['widget']['#required'] = TRUE; - } - elseif ($current_path == '/earthday') { - $form['field_submission_type']['#access'] = FALSE; - } + match(_nys_school_forms_get_form_type()) { + 'thanksgiving' => $form['field_submission_type']['widget']['#required'] = TRUE, + 'earth_day' => $form['field_submission_type']['#access'] = FALSE, + }; } /** @@ -183,7 +195,7 @@ function nys_school_forms_views_pre_view(ViewExecutable $view, $display_id, &$ar // Contextual filter to limit results to schools in senator's district. if (preg_match('/^\/node\/(\d+)$/', $source_path, $matches)) { - $node_id = $matches[1]; + $node_id = $matches[1] ?? 0; $microsite_node = Node::load($node_id); if ( $microsite_node instanceof \Drupal\node\NodeInterface @@ -231,7 +243,28 @@ function _nys_school_forms_validate_ss_container_form(array &$form, FormStateInt * Custom submit handler for custom redirect. */ function _nys_school_forms_ss_container_submit_handler(array &$form, \Drupal\Core\Form\FormStateInterface $form_state) { - $form_state->setRedirect(''); + $form_type = $form_state->getValue('field_form_type')[0]['value'] ?? NULL; + $redirect_uri = match($form_type) { + 'thanksgiving' => 'internal:/questionnaires/what-are-you-thankful/received', + 'earth_day' => 'internal:/earthday/received', + default => 'internal:/', + }; + $redirect_url = Url::fromUri($redirect_uri); + $form_state->setRedirectUrl($redirect_url); \Drupal::messenger()->deleteAll(); - \Drupal::messenger()->addMessage(t('Your student submission has been received.')); } + +/** + * Helper function to get field_form_type from the current node request. + */ +function _nys_school_forms_get_form_type() { + $form_type = NULL; + $request = \Drupal::requestStack()->getCurrentRequest(); + if ($request->attributes->has('node')) { + $node = $request->attributes->get('node'); + if ($node instanceof Node) { + $form_type = $node->get('field_form_type')->value; + } + } + return $form_type; +}; \ No newline at end of file From 35314de7a30f4ab07fe6ad7f97f5ad088f24f064 Mon Sep 17 00:00:00 2001 From: Nathaniel Woodland Date: Tue, 14 Jan 2025 16:34:37 -0500 Subject: [PATCH 14/15] Address PR comments and 2nd demo feedback --- ...node_student_submission_container_form.yml | 2 +- ...cha_point.node_student_submission_form.yml | 2 +- ...udent_submission.field_file_submission.yml | 2 +- .../views.view.manage_student_submissions.yml | 14 ++-- .../css/submission-confirmation-popup.css | 4 +- .../nys_school_forms/nys_school_forms.module | 67 +++++++++++++++++-- 6 files changed, 76 insertions(+), 15 deletions(-) diff --git a/config/sync/captcha.captcha_point.node_student_submission_container_form.yml b/config/sync/captcha.captcha_point.node_student_submission_container_form.yml index d5e9aaa75c..a0a99ed6b3 100644 --- a/config/sync/captcha.captcha_point.node_student_submission_container_form.yml +++ b/config/sync/captcha.captcha_point.node_student_submission_container_form.yml @@ -1,6 +1,6 @@ uuid: b0afa567-c110-42b5-b337-c38ef9981bf9 langcode: en -status: false +status: true dependencies: { } formId: node_student_submission_container_form captchaType: default diff --git a/config/sync/captcha.captcha_point.node_student_submission_form.yml b/config/sync/captcha.captcha_point.node_student_submission_form.yml index 31eabd1520..3bea173e2a 100644 --- a/config/sync/captcha.captcha_point.node_student_submission_form.yml +++ b/config/sync/captcha.captcha_point.node_student_submission_form.yml @@ -1,6 +1,6 @@ uuid: d6086859-adaf-4899-9c63-0cca12298423 langcode: en -status: false +status: true dependencies: { } formId: node_student_submission_form captchaType: default diff --git a/config/sync/field.field.node.student_submission.field_file_submission.yml b/config/sync/field.field.node.student_submission.field_file_submission.yml index 03a71a6b5a..9d14abb162 100644 --- a/config/sync/field.field.node.student_submission.field_file_submission.yml +++ b/config/sync/field.field.node.student_submission.field_file_submission.yml @@ -31,7 +31,7 @@ field_name: field_file_submission entity_type: node bundle: student_submission label: 'File submission' -description: 'Filenames will be visible to the public, so please ensure that they are suitable.' +description: 'On submission, files will be renamed using the Student Name field. Use full names as appropriate.' required: true translatable: false default_value: { } diff --git a/config/sync/views.view.manage_student_submissions.yml b/config/sync/views.view.manage_student_submissions.yml index f70821e8e1..332bcb1e73 100644 --- a/config/sync/views.view.manage_student_submissions.yml +++ b/config/sync/views.view.manage_student_submissions.yml @@ -879,15 +879,15 @@ display: multi_type: separator separator: ', ' field_api_classes: false - operations: - id: operations + edit_node: + id: edit_node table: node - field: operations - relationship: none + field: edit_node + relationship: reverse__node__field_student_submissions group_type: group admin_label: '' entity_type: node - plugin_id: entity_operations + plugin_id: entity_link_edit label: Operations exclude: false alter: @@ -929,7 +929,9 @@ display: hide_empty: false empty_zero: false hide_alter_empty: true - destination: false + text: Edit + output_url_as_text: false + absolute: false pager: type: full options: diff --git a/web/modules/custom/nys_school_forms/css/submission-confirmation-popup.css b/web/modules/custom/nys_school_forms/css/submission-confirmation-popup.css index 56914bd3b7..00b6d465ed 100644 --- a/web/modules/custom/nys_school_forms/css/submission-confirmation-popup.css +++ b/web/modules/custom/nys_school_forms/css/submission-confirmation-popup.css @@ -1,3 +1,5 @@ -form.node-student-submission-container-form #submission-confirmation-modal { +form.node-student-submission-container-form #submission-confirmation-modal, +form.node-student-submission-container-form .field--name-field-file-submission .message--status, +form.node-student-submission-container-form .field--name-field-image-submission .message--status { display: none; } diff --git a/web/modules/custom/nys_school_forms/nys_school_forms.module b/web/modules/custom/nys_school_forms/nys_school_forms.module index cdf52b6cb7..53d13c7633 100644 --- a/web/modules/custom/nys_school_forms/nys_school_forms.module +++ b/web/modules/custom/nys_school_forms/nys_school_forms.module @@ -6,8 +6,11 @@ */ use Drupal\Core\Access\AccessResult; +use Drupal\Core\File\FileExists; +use Drupal\Core\File\FileSystemInterface; use Drupal\Core\Form\FormStateInterface; use Drupal\Core\Url; +use Drupal\file\Entity\File; use Drupal\node\Entity\Node; use Drupal\views\ViewExecutable; use Drupal\webform\WebformSubmissionInterface; @@ -125,6 +128,14 @@ function nys_school_forms_form_node_student_submission_container_form_alter(&$fo } +/** + * Implements hook_form_FORM_ID_alter. + */ +function nys_school_forms_form_node_student_submission_container_edit_form_alter(&$form, FormStateInterface $form_state, $form_id) { + // Custom validation to make only one upload field required. + $form['#validate'][] = '_nys_school_forms_validate_ss_container_form'; +} + /** * Implements hook_inline_entity_form_entity_form_alter. */ @@ -239,6 +250,45 @@ function _nys_school_forms_validate_ss_container_form(array &$form, FormStateInt } } +/** + * Implements hook_entity_presave(). + * + * Rename the file in the field_file_submission field of a student_submission node + * during node creation or update. + */ +function nys_school_forms_entity_presave(Drupal\Core\Entity\EntityInterface $entity) { + if ($entity->bundle() === 'student_submission') { + $student_name = $entity->field_student_name->value ?? 'Student'; + $current_year = date('Y'); + $form_type = _nys_school_forms_get_form_type('label'); + if ( + $entity->hasField('field_file_submission') + && !$entity->field_file_submission->isEmpty() + ) { + $file = File::load($entity->field_file_submission->target_id); + if ($file) { + $new_filename = "$student_name's $form_type $current_year submission.pdf"; + $original_uri = $file->getFileUri(); + $file_directory = dirname($original_uri); + $new_uri = $file_directory . '/' . $new_filename; + // Use FileExists::Rename to ensure unique filename in filesystem. + $final_uri = \Drupal::service('file_system') + ->move($original_uri, $new_uri, FileExists::Rename); + if ($final_uri) { + $file->setFilename($new_filename); + $file->setFileUri($final_uri); + try { + $file->save(); + } + catch (\Exception $e) { + \Drupal::logger('nys_school_forms')->error('Failed to save file: @message', ['@message' => $e->getMessage()]); + } + } + } + } + } +} + /** * Custom submit handler for custom redirect. */ @@ -257,14 +307,21 @@ function _nys_school_forms_ss_container_submit_handler(array &$form, \Drupal\Cor /** * Helper function to get field_form_type from the current node request. */ -function _nys_school_forms_get_form_type() { - $form_type = NULL; +function _nys_school_forms_get_form_type($string_type = 'machine_name') { + $form_type_value = NULL; $request = \Drupal::requestStack()->getCurrentRequest(); if ($request->attributes->has('node')) { $node = $request->attributes->get('node'); if ($node instanceof Node) { - $form_type = $node->get('field_form_type')->value; + $form_type_value = $node->field_form_type->value ?? NULL; + if ($string_type === 'label') { + $allowed_values = $node->get('field_form_type') + ?->getFieldDefinition() + ?->getFieldStorageDefinition() + ?->getSetting('allowed_values') ?? []; + $form_type_label = $allowed_values[$form_type_value] ?? NULL; + } } } - return $form_type; -}; \ No newline at end of file + return $form_type_label ?? $form_type_value; +} From dbc9bbe7cc692a8536b36588d89bf76292d19ca1 Mon Sep 17 00:00:00 2001 From: Nathaniel Woodland Date: Wed, 15 Jan 2025 14:19:24 -0500 Subject: [PATCH 15/15] NYS-83: Ensure inline_entity_form hook targets relevant bundle; add default condition to match(); add missing use to install file --- .../nys_school_forms/nys_school_forms.install | 4 ++- .../nys_school_forms/nys_school_forms.module | 34 ++++++++++++------- 2 files changed, 24 insertions(+), 14 deletions(-) diff --git a/web/modules/custom/nys_school_forms/nys_school_forms.install b/web/modules/custom/nys_school_forms/nys_school_forms.install index 1b0a5d01de..da34da6d15 100644 --- a/web/modules/custom/nys_school_forms/nys_school_forms.install +++ b/web/modules/custom/nys_school_forms/nys_school_forms.install @@ -5,6 +5,8 @@ * Install and update hooks for the "nys_school_forms" module. */ +use Drupal\node\Entity\Node; + /** * Implements hook_update_N(). * @@ -53,7 +55,7 @@ function nys_school_forms_update_8001() { * * Updates the "field_form_type" field for original school form nodes. */ -function nys_school_forms_update_8002() { +function nys_school_forms_update_8003() { $nid_to_field_value = [ 12017207 => 'thanksgiving', 12007481 => 'earth_day', diff --git a/web/modules/custom/nys_school_forms/nys_school_forms.module b/web/modules/custom/nys_school_forms/nys_school_forms.module index 53d13c7633..fbe3dcb6be 100644 --- a/web/modules/custom/nys_school_forms/nys_school_forms.module +++ b/web/modules/custom/nys_school_forms/nys_school_forms.module @@ -140,20 +140,23 @@ function nys_school_forms_form_node_student_submission_container_edit_form_alter * Implements hook_inline_entity_form_entity_form_alter. */ function nys_school_forms_inline_entity_form_entity_form_alter(&$form, FormStateInterface $form_state) { - // Display image / file upload field based on prior selection. - $upload_types = ['image', 'file']; - foreach ($upload_types as $type) { - $trigger = [":input[name='field_student_submissions[{$form['#ief_row_delta']}][inline_entity_form][field_upload_type]']" => ['value' => $type]]; - $form["field_{$type}_submission"]['#states'] = [ - 'visible' => $trigger, - ]; - } + if ($form['#bundle'] == 'student_submission') { + // Display image / file upload field based on prior selection. + $upload_types = ['image', 'file']; + foreach ($upload_types as $type) { + $trigger = [":input[name='field_student_submissions[{$form['#ief_row_delta']}][inline_entity_form][field_upload_type]']" => ['value' => $type]]; + $form["field_{$type}_submission"]['#states'] = [ + 'visible' => $trigger, + ]; + } - // Enable submission type field for thanksgiving form. - match(_nys_school_forms_get_form_type()) { - 'thanksgiving' => $form['field_submission_type']['widget']['#required'] = TRUE, - 'earth_day' => $form['field_submission_type']['#access'] = FALSE, - }; + // Enable submission type field for thanksgiving form. + match (_nys_school_forms_get_form_type()) { + 'thanksgiving' => $form['field_submission_type']['widget']['#required'] = TRUE, + 'earth_day' => $form['field_submission_type']['#access'] = FALSE, + default => NULL, + }; + } } /** @@ -306,6 +309,11 @@ function _nys_school_forms_ss_container_submit_handler(array &$form, \Drupal\Cor /** * Helper function to get field_form_type from the current node request. + * + * @param string $string_type + * Optional. Set to 'label' to return the value's label. + * + * @return mixed|null */ function _nys_school_forms_get_form_type($string_type = 'machine_name') { $form_type_value = NULL;