diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000000..be66ccfbef --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,35 @@ +version: 2 +updates: + # Update root composer.json and drupal/core only. + - package-ecosystem: "composer" + open-pull-requests-limit: 5 + target-branch: "develop" + schedule: + interval: "monthly" + directory: "/" + versioning-strategy: increase + commit-message: + prefix: "chore" + include: "scope" + allow: + - dependency-name: "drupal/core-*" + groups: + drupal-core: + patterns: + - "drupal/core-*" + + # Update yalesites_profile composer.json. + - package-ecosystem: "composer" + open-pull-requests-limit: 5 + target-branch: "develop" + schedule: + interval: "monthly" + directory: "/web/profiles/custom/yalesites_profile" + versioning-strategy: increase + commit-message: + prefix: "chore" + include: "scope" + groups: + yalesites-profile: + patterns: + - "*" diff --git a/.github/workflows/build_deploy_and_test.yml b/.github/workflows/build_deploy_and_test.yml index e09066be14..d489389a5b 100644 --- a/.github/workflows/build_deploy_and_test.yml +++ b/.github/workflows/build_deploy_and_test.yml @@ -115,6 +115,12 @@ jobs: if [ -n "$contrib_check" ]; then echo "::error::$contrib_check found in /composer.json and should be moved to /web/profiles/custom/yalesites_profile/composer.json" && exit 1 fi + - name: Check for unpinned dependencies + run: | + unpinned_dependencies=$(jq -r '.require | to_entries | map(select(.value | test("\\^|\\~|\\>|\\<")) | "\(.key): \(.value)") | join(", ")' ./web/profiles/custom/yalesites_profile/composer.json) + if [ -n "$unpinned_dependencies" ]; then + echo "::error::$unpinned_dependencies found in /web/profiles/custom/yalesites_profile/composer.json. Please switch to pinned versions." && exit 1 + fi - name: run static tests run: | diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d6632cb701..ae897c4d51 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -4,6 +4,7 @@ on: branches: master env: GH_TOKEN: ${{ secrets.YALESITES_BUILD_TOKEN }} + YALESITES_BUILD_TOKEN: ${{ secrets.YALESITES_BUILD_TOKEN }} jobs: build: runs-on: ubuntu-latest @@ -15,8 +16,6 @@ jobs: uses: actions/setup-node@v3 - name: Install - env: - GH_TOKEN: ${{ secrets.GH_TOKEN }} run: npm install - name: Release diff --git a/.gitignore b/.gitignore index fa11765e87..722ca9fef3 100644 --- a/.gitignore +++ b/.gitignore @@ -22,7 +22,6 @@ # Ignore SimpleTest multi-site environment. /web/sites/simpletest - # Ignore custom modules managed by Composer. # # When a development team creates one or more custom modules that @@ -130,3 +129,6 @@ web/profiles/custom/yalesites_profile/vendor/ /atomic /component-library-twig /tokens + +# Secrets for local use +secrets.json diff --git a/.lando.local.example.yml b/.lando.local.example.yml index 3d1162d2fc..c2631df289 100644 --- a/.lando.local.example.yml +++ b/.lando.local.example.yml @@ -42,5 +42,6 @@ services: overrides: environment: COMPOSER_PROCESS_TIMEOUT: 1800 + CUSTOMER_SECRETS_FAKE_FILE: /app/secrets.json # This is needed to expose the reverse proxy to the xdebug port (9003) xdebug: true diff --git a/docs/development.md b/docs/development.md index 2362ddde52..029b11a304 100644 --- a/docs/development.md +++ b/docs/development.md @@ -91,3 +91,25 @@ lando drush migrate-rollback --group ys_starterkit # Update partial configuration if altering the migration configuration. lando drush cim --partial --source=/app/web/profiles/custom/yalesites_profile/modules/custom/ys_starterkit/config/install -y ``` + +## Data model best practices + +A well-structured data model ensures efficiency, maintainability, and scalability within the YaleSites platform. Below are some guiding principles adopted by the platform maintainers: + +- **Documentation Maintenance**: Keep the data model documentation up to date. This Teams document includes entity definitions, text formats, display mode definitions, and other content settings. Whenever there's a change to a content type, block, paragraph, taxonomy, or any other entity, make it a priority to update this central documentation source. Maintaining accurate documentation is crucial for team collaboration and project continuity. +- **Normalize Data**: Follow established principles of database normalization to minimize data redundancy and enhance data integrity. Leverage reference fields and relationships to establish connections between related content instead of duplicating data. This approach ensures that the data remains consistent and predictable. +- **Reuse Fields**: Reduce the proliferation of field definitions by reusing fields across multiple content bundles, as long as they serve a similar business purpose. For instance, if several content types (e.g., pull quote, video description, banner intro) require a 'field_text' storage, consider reusing this field definition to maintain consistency and simplify content management. +- **Avoid Single-Purpose Fields or Entities**: When adding fields or entities, strive to make them versatile enough to fulfill multiple purposes across YaleSites. For example, while a dedicated 'Speaker' field might seem useful for an event content type, evaluate whether this feature could be addressed using a content-spotlight block. Add new fields only when they contribute to sorting, filtering, or theming content in specific ways. +- **Build with Blocks**: Embrace the power of the layout builder by utilizing blocks to define new components. YaleSites relies on blocks for editorial controls and mapping content to the component library. This includes both custom blocks (content entities) and programmatically defined blocks (plugins). +- **Use Paragraphs for Nested Content**: Paragraphs remain a valuable tool, particularly when dealing with components that contain an indeterminate number of children, such as accordion items, tab items, or gallery items. The Paragraphs module provides intuitive widgets that offer an effective editorial interface for managing reference content within these complex components. + +## Adding a 'dial' for theming a component + +This project features custom fields for block theming. For example, the divider block includes settings for position, width, and animation style. In contrast to traditional Drupal projects using predefined list-field options in the configuration file, we've chosen a distinct approach. Our approach prioritizes the ability to add, remove, and dynamically adjust these options in future YaleSites themes and platform iterations, ensuring enduring flexibility. This system accommodates unique values for each field instance and supports changes over time, avoiding database integrity concerns. To add a dial: + +1. Begin by adding the desired style field to the custom block using the standard field UI. Whenever feasible, utilize an existing field like field_style_position, field_style_width, or field_style_variation. +2. Configure the display of this field using the Field UI. Ensure that the style field is presented without a label and employs the 'key' formatter. +3. Export the site configuration to generate all the associated field YAML files. +4. In the event that this is a newly created field, update the field storage configuration file. Specify the callback function for values using `allowed_values_function: ys_themes_allowed_values_function`. +5. Proceed to update the key-value pairs within `ys_themes.component_overrides.yml`. Remember to make these updates in two locations: the config/sync directory and the module/install directory. +6. With these adjustments in place, you can now connect these values to components within the theme templates, achieving the desired styling and functionality. diff --git a/package.json b/package.json index e6397dcffc..941512f18f 100644 --- a/package.json +++ b/package.json @@ -61,7 +61,7 @@ "files": [ "web/profiles/custom/yalesites_profile/yalesites_profile.info.yml" ], - "from": "version: .*", + "from": "#version:", "to": "version: ${nextRelease.version}", "results": [ { @@ -76,14 +76,6 @@ ] } ], - [ - "@semantic-release/git", - { - "assets": [ - "web/profiles/custom/yalesites_profile/yalesites_profile.info.yml" - ] - } - ], "@semantic-release/release-notes-generator", "@semantic-release/github" ] diff --git a/scripts/local/images/calculateMB.sh b/scripts/local/images/calculateMB.sh new file mode 100755 index 0000000000..8073f1ec54 --- /dev/null +++ b/scripts/local/images/calculateMB.sh @@ -0,0 +1,49 @@ +#!/usr/bin/env bash + +# This script is used to check the possible memory +# allocation ImageMagick would need to convert a base image +# into our currently largest resolution of a file. +# +# Usage: ./calculateMB.sh +# - image: The image to check the memory usage for +# +# Example: ./calculateMB.sh ~/Pictures/IMG_0001.JPG +# - This will return the memory usage for IMG_0001.JPG in megabytes + +getMB() { + local resolution + resolution=$(getResolutionFromImage "$1") + calculateMemoryUsage "$(retrieveWidth "$resolution")" "$(retrieveHeight "$resolution")" +} + +getResolutionFromImage() { + local image="$1" + local resolution + + # Use double quotes around "$image" to handle spaces in the filename + resolution=$(identify -format "%wx%h" "$image") + + echo "$resolution" +} + +retrieveWidth() { + echo "${1%x*}" +} + +retrieveHeight() { + echo "${1#*x}" +} + +calculateMemoryUsage() { + local bitsPerPixel=3 + local tweakFactor=1.8 + local width="$1" + local height="$2" + + local largestWidth=2400 + local largestHeight=1600 + + echo "($largestWidth * $largestHeight * $bitsPerPixel + $width * $height * $bitsPerPixel) * $tweakFactor / 1024 / 1024" | bc +} + +getMB "$1" diff --git a/scripts/local/images/doItAll.sh b/scripts/local/images/doItAll.sh new file mode 100755 index 0000000000..d3f9ceaa47 --- /dev/null +++ b/scripts/local/images/doItAll.sh @@ -0,0 +1,11 @@ +#!/usr/bin/env bash + +# Check arguments +if [[ $# -ne 3 ]]; then + echo "Usage: ./doItAll.sh " + exit 1 +fi + +./get_images.sh "$1" "$2" && +./convert_images.sh "$2" 3840 2160 && +./put_images.sh "$1" "$3" "$2" diff --git a/scripts/local/images/fix_images.sh b/scripts/local/images/fix_images.sh new file mode 100755 index 0000000000..99da6ce747 --- /dev/null +++ b/scripts/local/images/fix_images.sh @@ -0,0 +1,120 @@ +#!/usr/bin/env bash + +# This script will attempt to convert any images that are greater than the +# desired width and height into the desired width and height. +# +# Requirements: +# - ImageMagick +# - bc +# +# Usage: ./fix_images.sh +# - path_to_where_images_are: The path to where the images are +# - desired_max_width: The desired maximum width of the images +# - desired_max_height: The desired maximum height of the images +# +# Example: ./fix_images.sh ~/Pictures 3840 2160 +# - This will convert any images in ~/Pictures that are greater than 3840x2160 +# to 3840x2160 or close to it. +# - This will also print out the memory usage for each image (before and after) +# - This will also print out the command that will be used to convert the image +# (in case you want to copy and paste it to run it yourself) + +getImages() { + local dirsToExclude=("library-definitions" "media-icons" "private" "styles" "js" "oembed_thumbnails" "paragraphs_type_icon" "css") + local dirToLook="$1" + + # Get rid of excluded directories--will make find easier + for dir in "${dirsToExclude[@]}"; do + rm -rf "$dirToLook/$dir" + done + + find "$dirToLook" -type f \( -name "*.jpg" -o -name "*.jpeg" -o -name "*.JPEG" -o -name "*.JPG" \) +} + +convertImages() { + local desiredWidth=$2 + local desiredHeight=$3 + local height + local width + local resolution + local directory="$1" + + local red='\033[0;31m' + local green='\033[0;32m' + local yellow='\033[0;33m' + local noColor='\033[0m' + + # Use an array to store file paths and prevent splitting + local files=() + IFS=$'\n' # Set the Internal Field Separator to newline + + # Use the getImages function to populate the array + readarray -t files <<< "$(getImages "$directory")" + + for file in "${files[@]}"; do + resolution=$(getResolutionFromImage "$file") + width=$(retrieveWidth "$resolution") + height=$(retrieveHeight "$resolution") + + if [[ $height -gt $desiredHeight ]]; then + echo -e "$red [Will Convert] $file has a resolution of $resolution: w: $width, h: $height (Target: $desiredWidth x $desiredHeight, Current memory usage: $(calculateMemoryUsage "$width" "$height") MB) $noColor" + echo convert -resize 3840x2160\> -quality 100 "$file" "$file" + echo -e "$yellow" convert "$file" -resize 3840x2160\> -quality 100 "$file" "$noColor" + convert "$file" -resize 3840x2160\> -quality 100 "$file" + + # Retrieve the new resolution, width, and height to recalculate the new memory usage + resolution=$(getResolutionFromImage "$file") + width=$(retrieveWidth "$resolution") + height=$(retrieveHeight "$resolution") + echo -e "$green [Converted] $file has been converted to $(getResolutionFromImage "$file") : Current memory usage: $(calculateMemoryUsage "$width" "$height") MB $noColor" + else + echo -e "$green [Will Not Convert] $file has a resolution of $resolution: w: $width, h: $height, Current memory usage: $(calculateMemoryUsage "$width" "$height") MB) $noColor" + fi + done +} + +getResolutionFromImage() { + local image="$1" + local resolution + + # Use double quotes around "$image" to handle spaces in the filename + resolution=$(identify -format "%wx%h" "$image") + + echo "$resolution" +} + +retrieveWidth() { + echo "${1%x*}" +} + +retrieveHeight() { + echo "${1#*x}" +} + +calculateMemoryUsage() { + local bitsPerPixel=3 + local tweakFactor=1.8 + local width="$1" + local height="$2" + + # This is currently our largest generated image resolution + # Should we ever update this, we will need to update this script + local largestWidth=2400 + local largestHeight=1600 + + echo "($largestWidth * $largestHeight * $bitsPerPixel + $width * $height * $bitsPerPixel) * $tweakFactor / 1024 / 1024" | bc +} + +# Ensure that they pass the right parameters +if [ $# -ne 3 ]; then + echo "Usage: ./fix_images.sh " + exit 1 +fi + +# Ensure directory exists +if [ ! -d "$1" ]; then + echo "Directory $1 does not exist" + exit 2 +fi + +convertImages "$1" "$2" "$3" diff --git a/scripts/local/images/get_images.sh b/scripts/local/images/get_images.sh new file mode 100755 index 0000000000..3d29261e88 --- /dev/null +++ b/scripts/local/images/get_images.sh @@ -0,0 +1,39 @@ +#!/usr/bin/env bash + +# This will attempt to retrieve all files under the /files +# directory on a remote Pantheon server. +# +# The motivation for this script is to convert all images to a smaller format. + +getFiles() { + local port=2222 + + sftp -o Port="$port" "$1" < " + exit 1 +fi + +# Test if destination exists +if [ ! -d "$2" ]; then + echo "Destination $2 does not exist; attempting to make directory" + + if ! mkdir -p "$2"; then + echo "Could not create directory $2" + exit 2 + fi +fi + +getFiles "$1" "$2" diff --git a/scripts/local/images/put_images.sh b/scripts/local/images/put_images.sh new file mode 100755 index 0000000000..82a6b82689 --- /dev/null +++ b/scripts/local/images/put_images.sh @@ -0,0 +1,35 @@ +#!/usr/bin/env bash + +# This will upload images processed to a destination Pantheon server +# +# The motivation for this script is to convert all images to a smaller format. + +uploadImages() { + local destinationServer="$1" + local destinationDirectory="$2" + local sourceDirectory="$3" + local port=2222 + + echo "Uploading images to $destinationServer:$destinationDirectory" + sftp -o Port="$port" "$destinationServer" < " + exit 1 +fi + +# Directory check +if [ ! -d "$3" ]; then + echo "Source directory $3 does not exist" + exit 2 +fi + +uploadImages "$1" "$2" "$3" diff --git a/scripts/local/setup.sh b/scripts/local/setup.sh index 155fc3f8c6..f6d206ce59 100755 --- a/scripts/local/setup.sh +++ b/scripts/local/setup.sh @@ -28,6 +28,10 @@ fi # Start lando and create containers. lando start +# Generate local secrets file. +terminus plugin:install pantheon-systems/terminus-secrets-manager-plugin +terminus secret:site:local-generate yalesites-platform --filepath=./secrets.json + # Install packages and install Drupal using yalesites_profile. npm install npm run build-with-install diff --git a/web/profiles/custom/yalesites_profile/composer.json b/web/profiles/custom/yalesites_profile/composer.json index b5de00ad1a..74196fb190 100644 --- a/web/profiles/custom/yalesites_profile/composer.json +++ b/web/profiles/custom/yalesites_profile/composer.json @@ -62,6 +62,7 @@ "drupal/metatag": "2.0.0", "drupal/migrate_plus": "6.0.1", "drupal/migrate_tools": "6.0.2", + "drupal/multiple_fields_remove_button": "2.2", "drupal/multivalue_form_element": "1.0-beta6", "drupal/node_revision_delete": "2.0.0-alpha2", "drupal/override_node_options": "2.7", @@ -129,7 +130,8 @@ "update dark mode localstorage https://www.drupal.org/project/gin/issues/3387653": "https://git.drupalcode.org/project/gin/-/merge_requests/304.diff" }, "drupal/media_library_form_element": { - "Order Media items https://www.drupal.org/project/media_library_form_element/issues/3168027":"https://www.drupal.org/files/issues/2022-01-22/order_media_items-3168027-8.patch" + "Order Media items https://www.drupal.org/project/media_library_form_element/issues/3168027":"https://www.drupal.org/files/issues/2022-01-22/order_media_items-3168027-8.patch", + "Deprecated function: explode(): Passing null to parameter #2 ($string) of type string is deprecated https://www.drupal.org/project/media_library_form_element/issues/3277273": "https://www.drupal.org/files/issues/2023-01-25/deprecated-explode-3277273-11.patch" }, "drupal/redirect": { "fix validation issue on adding url redirect": "https://www.drupal.org/files/issues/2023-08-09/3057250-65.patch" @@ -139,6 +141,12 @@ }, "drupal/google_analytics": { "Cannot install from existing config https://www.drupal.org/project/google_analytics/issues/3373921": "https://www.drupal.org/files/issues/2023-08-07/google-analytics-issues-3373921-cannot-install-from-existing-config-11.patch" + }, + "drupal/linkit": { + "Add phone number matcher https://www.drupal.org/project/linkit/issues/3273630": "https://git.drupalcode.org/project/linkit/-/merge_requests/36.diff" + }, + "drupal/quick_node_clone": { + "Fix cloning of inline blocks and paragraphs: https://www.drupal.org/project/quick_node_clone/issues/3100117": "https://www.drupal.org/files/issues/2023-04-25/quick-node-clone--inline-blocks--3100117-32.patch" } } } diff --git a/web/profiles/custom/yalesites_profile/config/sync/core.entity_form_display.block_content.accordion.default.yml b/web/profiles/custom/yalesites_profile/config/sync/core.entity_form_display.block_content.accordion.default.yml index b63ac7f67a..20138a1d24 100644 --- a/web/profiles/custom/yalesites_profile/config/sync/core.entity_form_display.block_content.accordion.default.yml +++ b/web/profiles/custom/yalesites_profile/config/sync/core.entity_form_display.block_content.accordion.default.yml @@ -56,7 +56,7 @@ content: hide_guidelines: '1' maxlength: maxlength_js: 50 - maxlength_js_label: 'Content limited to @limit characters, remaining: @remaining' + maxlength_js_label: 'Content recommended length set to @limit characters, remaining: @remaining' maxlength_js_enforce: false field_instructions: type: markup diff --git a/web/profiles/custom/yalesites_profile/config/sync/core.entity_form_display.block_content.callout.default.yml b/web/profiles/custom/yalesites_profile/config/sync/core.entity_form_display.block_content.callout.default.yml index 59881aefbd..d148a30ebd 100644 --- a/web/profiles/custom/yalesites_profile/config/sync/core.entity_form_display.block_content.callout.default.yml +++ b/web/profiles/custom/yalesites_profile/config/sync/core.entity_form_display.block_content.callout.default.yml @@ -6,6 +6,7 @@ dependencies: - block_content.type.callout - field.field.block_content.callout.field_callout - field.field.block_content.callout.field_instructions + - field.field.block_content.callout.field_style_alignment - field.field.block_content.callout.field_style_color module: - markup @@ -46,6 +47,12 @@ content: region: content settings: { } third_party_settings: { } + field_style_alignment: + type: options_select + weight: 3 + region: content + settings: { } + third_party_settings: { } field_style_color: type: options_select weight: 2 diff --git a/web/profiles/custom/yalesites_profile/config/sync/core.entity_form_display.block_content.content_spotlight.default.yml b/web/profiles/custom/yalesites_profile/config/sync/core.entity_form_display.block_content.content_spotlight.default.yml index 6e6089d435..2410f253e1 100644 --- a/web/profiles/custom/yalesites_profile/config/sync/core.entity_form_display.block_content.content_spotlight.default.yml +++ b/web/profiles/custom/yalesites_profile/config/sync/core.entity_form_display.block_content.content_spotlight.default.yml @@ -39,7 +39,7 @@ content: hide_guidelines: '1' maxlength: maxlength_js: 80 - maxlength_js_label: 'Content limited to @limit characters, remaining: @remaining' + maxlength_js_label: 'Content recommended length set to @limit characters, remaining: @remaining' maxlength_js_enforce: false field_instructions: type: markup @@ -99,7 +99,7 @@ content: hide_guidelines: '1' maxlength: maxlength_js: 50 - maxlength_js_label: 'Content limited to @limit characters, remaining: @remaining' + maxlength_js_label: 'Content recommended length set to @limit characters, remaining: @remaining' maxlength_js_enforce: false field_text: type: text_textarea diff --git a/web/profiles/custom/yalesites_profile/config/sync/core.entity_form_display.block_content.cta_banner.default.yml b/web/profiles/custom/yalesites_profile/config/sync/core.entity_form_display.block_content.cta_banner.default.yml index 8956dbd94a..02db80496c 100644 --- a/web/profiles/custom/yalesites_profile/config/sync/core.entity_form_display.block_content.cta_banner.default.yml +++ b/web/profiles/custom/yalesites_profile/config/sync/core.entity_form_display.block_content.cta_banner.default.yml @@ -38,7 +38,7 @@ content: hide_guidelines: '1' maxlength: maxlength_js: 50 - maxlength_js_label: 'Content limited to @limit characters, remaining: @remaining' + maxlength_js_label: 'Content recommended length set to @limit characters, remaining: @remaining' maxlength_js_enforce: false field_heading_level: type: options_select diff --git a/web/profiles/custom/yalesites_profile/config/sync/core.entity_form_display.block_content.custom_cards.default.yml b/web/profiles/custom/yalesites_profile/config/sync/core.entity_form_display.block_content.custom_cards.default.yml index d57aab67f5..4f9a7e7f8c 100644 --- a/web/profiles/custom/yalesites_profile/config/sync/core.entity_form_display.block_content.custom_cards.default.yml +++ b/web/profiles/custom/yalesites_profile/config/sync/core.entity_form_display.block_content.custom_cards.default.yml @@ -56,7 +56,7 @@ content: hide_guidelines: '1' maxlength: maxlength_js: 50 - maxlength_js_label: 'Content limited to @limit characters, remaining: @remaining' + maxlength_js_label: 'Content recommended length set to @limit characters, remaining: @remaining' maxlength_js_enforce: false field_instructions: type: markup diff --git a/web/profiles/custom/yalesites_profile/config/sync/core.entity_form_display.block_content.directory.default.yml b/web/profiles/custom/yalesites_profile/config/sync/core.entity_form_display.block_content.directory.default.yml index d9bcce115f..a287c462bd 100644 --- a/web/profiles/custom/yalesites_profile/config/sync/core.entity_form_display.block_content.directory.default.yml +++ b/web/profiles/custom/yalesites_profile/config/sync/core.entity_form_display.block_content.directory.default.yml @@ -29,7 +29,7 @@ content: hide_guidelines: '1' maxlength: maxlength_js: 50 - maxlength_js_label: 'Content limited to @limit characters, remaining: @remaining' + maxlength_js_label: 'Content recommended length set to @limit characters, remaining: @remaining' maxlength_js_enforce: false field_instructions: type: markup diff --git a/web/profiles/custom/yalesites_profile/config/sync/core.entity_form_display.block_content.event_list.default.yml b/web/profiles/custom/yalesites_profile/config/sync/core.entity_form_display.block_content.event_list.default.yml index 5dbd0eb88c..e7d8f5282b 100644 --- a/web/profiles/custom/yalesites_profile/config/sync/core.entity_form_display.block_content.event_list.default.yml +++ b/web/profiles/custom/yalesites_profile/config/sync/core.entity_form_display.block_content.event_list.default.yml @@ -29,7 +29,7 @@ content: hide_guidelines: '1' maxlength: maxlength_js: 50 - maxlength_js_label: 'Content limited to @limit characters, remaining: @remaining' + maxlength_js_label: 'Content recommended length set to @limit characters, remaining: @remaining' maxlength_js_enforce: false field_instructions: type: markup diff --git a/web/profiles/custom/yalesites_profile/config/sync/core.entity_form_display.block_content.gallery.default.yml b/web/profiles/custom/yalesites_profile/config/sync/core.entity_form_display.block_content.gallery.default.yml index 88b58d4b7c..065caa4027 100644 --- a/web/profiles/custom/yalesites_profile/config/sync/core.entity_form_display.block_content.gallery.default.yml +++ b/web/profiles/custom/yalesites_profile/config/sync/core.entity_form_display.block_content.gallery.default.yml @@ -56,7 +56,7 @@ content: hide_guidelines: '1' maxlength: maxlength_js: 50 - maxlength_js_label: 'Content limited to @limit characters, remaining: @remaining' + maxlength_js_label: 'Content recommended length set to @limit characters, remaining: @remaining' maxlength_js_enforce: false field_instructions: type: markup diff --git a/web/profiles/custom/yalesites_profile/config/sync/core.entity_form_display.block_content.grand_hero.default.yml b/web/profiles/custom/yalesites_profile/config/sync/core.entity_form_display.block_content.grand_hero.default.yml index 9641bcb843..b780112791 100644 --- a/web/profiles/custom/yalesites_profile/config/sync/core.entity_form_display.block_content.grand_hero.default.yml +++ b/web/profiles/custom/yalesites_profile/config/sync/core.entity_form_display.block_content.grand_hero.default.yml @@ -38,7 +38,7 @@ content: hide_guidelines: '1' maxlength: maxlength_js: 50 - maxlength_js_label: 'Content limited to @limit characters, remaining: @remaining' + maxlength_js_label: 'Content recommended length set to @limit characters, remaining: @remaining' maxlength_js_enforce: false field_heading_level: type: options_select @@ -66,8 +66,8 @@ content: region: content settings: media_types: - - background_video - image + - background_video third_party_settings: media_library_edit: show_edit: '1' @@ -96,7 +96,7 @@ content: hide_guidelines: '1' maxlength: maxlength_js: 90 - maxlength_js_label: 'Content limited to @limit characters, remaining: @remaining' + maxlength_js_label: 'Content recommended length set to @limit characters, remaining: @remaining' maxlength_js_enforce: false hidden: info: true diff --git a/web/profiles/custom/yalesites_profile/config/sync/core.entity_form_display.block_content.image.default.yml b/web/profiles/custom/yalesites_profile/config/sync/core.entity_form_display.block_content.image.default.yml index 0b8a92ba39..7cc6879d28 100644 --- a/web/profiles/custom/yalesites_profile/config/sync/core.entity_form_display.block_content.image.default.yml +++ b/web/profiles/custom/yalesites_profile/config/sync/core.entity_form_display.block_content.image.default.yml @@ -47,7 +47,7 @@ content: hide_guidelines: '1' maxlength: maxlength_js: 200 - maxlength_js_label: 'Content limited to @limit characters, remaining: @remaining' + maxlength_js_label: 'Content recommended length set to @limit characters, remaining: @remaining' maxlength_js_enforce: false hidden: info: true diff --git a/web/profiles/custom/yalesites_profile/config/sync/core.entity_form_display.block_content.media_grid.default.yml b/web/profiles/custom/yalesites_profile/config/sync/core.entity_form_display.block_content.media_grid.default.yml index fcd0c98c09..67a89c3fec 100644 --- a/web/profiles/custom/yalesites_profile/config/sync/core.entity_form_display.block_content.media_grid.default.yml +++ b/web/profiles/custom/yalesites_profile/config/sync/core.entity_form_display.block_content.media_grid.default.yml @@ -32,7 +32,7 @@ content: hide_guidelines: '1' maxlength: maxlength_js: 50 - maxlength_js_label: 'Content limited to @limit characters, remaining: @remaining' + maxlength_js_label: 'Content recommended length set to @limit characters, remaining: @remaining' maxlength_js_enforce: false field_instructions: type: markup diff --git a/web/profiles/custom/yalesites_profile/config/sync/core.entity_form_display.block_content.post_list.default.yml b/web/profiles/custom/yalesites_profile/config/sync/core.entity_form_display.block_content.post_list.default.yml index aeb017d48d..c8ddd320f5 100644 --- a/web/profiles/custom/yalesites_profile/config/sync/core.entity_form_display.block_content.post_list.default.yml +++ b/web/profiles/custom/yalesites_profile/config/sync/core.entity_form_display.block_content.post_list.default.yml @@ -29,7 +29,7 @@ content: hide_guidelines: '1' maxlength: maxlength_js: 50 - maxlength_js_label: 'Content limited to @limit characters, remaining: @remaining' + maxlength_js_label: 'Content recommended length set to @limit characters, remaining: @remaining' maxlength_js_enforce: false field_instructions: type: markup diff --git a/web/profiles/custom/yalesites_profile/config/sync/core.entity_form_display.block_content.pull_quote.default.yml b/web/profiles/custom/yalesites_profile/config/sync/core.entity_form_display.block_content.pull_quote.default.yml index 35584397a8..ffb8a05dad 100644 --- a/web/profiles/custom/yalesites_profile/config/sync/core.entity_form_display.block_content.pull_quote.default.yml +++ b/web/profiles/custom/yalesites_profile/config/sync/core.entity_form_display.block_content.pull_quote.default.yml @@ -31,7 +31,7 @@ content: hide_guidelines: '1' maxlength: maxlength_js: 90 - maxlength_js_label: 'Content limited to @limit characters, remaining: @remaining' + maxlength_js_label: 'Content recommended length set to @limit characters, remaining: @remaining' maxlength_js_enforce: false field_instructions: type: markup diff --git a/web/profiles/custom/yalesites_profile/config/sync/core.entity_form_display.block_content.quick_links.default.yml b/web/profiles/custom/yalesites_profile/config/sync/core.entity_form_display.block_content.quick_links.default.yml index 08f765cca6..624c78d3d4 100644 --- a/web/profiles/custom/yalesites_profile/config/sync/core.entity_form_display.block_content.quick_links.default.yml +++ b/web/profiles/custom/yalesites_profile/config/sync/core.entity_form_display.block_content.quick_links.default.yml @@ -35,7 +35,7 @@ content: hide_guidelines: '1' maxlength: maxlength_js: 50 - maxlength_js_label: 'Content limited to @limit characters, remaining: @remaining' + maxlength_js_label: 'Content recommended length set to @limit characters, remaining: @remaining' maxlength_js_enforce: false field_instructions: type: markup diff --git a/web/profiles/custom/yalesites_profile/config/sync/core.entity_form_display.block_content.text.default.yml b/web/profiles/custom/yalesites_profile/config/sync/core.entity_form_display.block_content.text.default.yml index b77b880344..bd8888d662 100644 --- a/web/profiles/custom/yalesites_profile/config/sync/core.entity_form_display.block_content.text.default.yml +++ b/web/profiles/custom/yalesites_profile/config/sync/core.entity_form_display.block_content.text.default.yml @@ -5,6 +5,7 @@ dependencies: config: - block_content.type.text - field.field.block_content.text.field_instructions + - field.field.block_content.text.field_style_variation - field.field.block_content.text.field_text module: - allowed_formats @@ -22,6 +23,12 @@ content: region: content settings: { } third_party_settings: { } + field_style_variation: + type: options_select + weight: 10 + region: content + settings: { } + third_party_settings: { } field_text: type: text_textarea weight: 1 diff --git a/web/profiles/custom/yalesites_profile/config/sync/core.entity_form_display.block_content.video.default.yml b/web/profiles/custom/yalesites_profile/config/sync/core.entity_form_display.block_content.video.default.yml index 10bdba6a98..7879b96248 100644 --- a/web/profiles/custom/yalesites_profile/config/sync/core.entity_form_display.block_content.video.default.yml +++ b/web/profiles/custom/yalesites_profile/config/sync/core.entity_form_display.block_content.video.default.yml @@ -33,7 +33,7 @@ content: hide_guidelines: '1' maxlength: maxlength_js: null - maxlength_js_label: 'Content limited to @limit characters, remaining: @remaining' + maxlength_js_label: 'Content recommended length set to @limit characters, remaining: @remaining' maxlength_js_enforce: false field_instructions: type: markup @@ -63,7 +63,7 @@ content: hide_guidelines: '1' maxlength: maxlength_js: 200 - maxlength_js_label: 'Content limited to @limit characters, remaining: @remaining' + maxlength_js_label: 'Content recommended length set to @limit characters, remaining: @remaining' maxlength_js_enforce: false hidden: info: true diff --git a/web/profiles/custom/yalesites_profile/config/sync/core.entity_form_display.block_content.view.default.yml b/web/profiles/custom/yalesites_profile/config/sync/core.entity_form_display.block_content.view.default.yml index 9fdf29700a..20f19b00d1 100644 --- a/web/profiles/custom/yalesites_profile/config/sync/core.entity_form_display.block_content.view.default.yml +++ b/web/profiles/custom/yalesites_profile/config/sync/core.entity_form_display.block_content.view.default.yml @@ -31,7 +31,7 @@ content: hide_guidelines: '1' maxlength: maxlength_js: 50 - maxlength_js_label: 'Content limited to @limit characters, remaining: @remaining' + maxlength_js_label: 'Content recommended length set to @limit characters, remaining: @remaining' maxlength_js_enforce: false field_instructions: type: markup diff --git a/web/profiles/custom/yalesites_profile/config/sync/core.entity_form_display.block_content.webform.default.yml b/web/profiles/custom/yalesites_profile/config/sync/core.entity_form_display.block_content.webform.default.yml index d6d65f0b88..f523a3ed8b 100644 --- a/web/profiles/custom/yalesites_profile/config/sync/core.entity_form_display.block_content.webform.default.yml +++ b/web/profiles/custom/yalesites_profile/config/sync/core.entity_form_display.block_content.webform.default.yml @@ -39,7 +39,7 @@ content: hide_guidelines: '1' maxlength: maxlength_js: 80 - maxlength_js_label: 'Content limited to @limit characters, remaining: @remaining' + maxlength_js_label: 'Content recommended length set to @limit characters, remaining: @remaining' maxlength_js_enforce: false field_instructions: type: markup diff --git a/web/profiles/custom/yalesites_profile/config/sync/core.entity_form_display.paragraph.accordion_item.default.yml b/web/profiles/custom/yalesites_profile/config/sync/core.entity_form_display.paragraph.accordion_item.default.yml index 9547831bd9..10b4b3b7aa 100644 --- a/web/profiles/custom/yalesites_profile/config/sync/core.entity_form_display.paragraph.accordion_item.default.yml +++ b/web/profiles/custom/yalesites_profile/config/sync/core.entity_form_display.paragraph.accordion_item.default.yml @@ -41,7 +41,8 @@ content: hide_guidelines: '1' maxlength: maxlength_js: 80 - maxlength_js_label: 'Content limited to @limit characters, remaining: @remaining' + maxlength_js_label: 'Content recommended length set to @limit characters, remaining: @remaining' + maxlength_js_enforce: false hidden: created: true status: true diff --git a/web/profiles/custom/yalesites_profile/config/sync/core.entity_form_display.paragraph.callout_item.default.yml b/web/profiles/custom/yalesites_profile/config/sync/core.entity_form_display.paragraph.callout_item.default.yml index 395f8cf58a..531beb3621 100644 --- a/web/profiles/custom/yalesites_profile/config/sync/core.entity_form_display.paragraph.callout_item.default.yml +++ b/web/profiles/custom/yalesites_profile/config/sync/core.entity_form_display.paragraph.callout_item.default.yml @@ -30,7 +30,8 @@ content: hide_guidelines: '1' maxlength: maxlength_js: 80 - maxlength_js_label: 'Content limited to @limit characters, remaining: @remaining' + maxlength_js_label: 'Content recommended length set to @limit characters, remaining: @remaining' + maxlength_js_enforce: false field_link: type: link_default weight: 3 diff --git a/web/profiles/custom/yalesites_profile/config/sync/core.entity_form_display.paragraph.custom_card.default.yml b/web/profiles/custom/yalesites_profile/config/sync/core.entity_form_display.paragraph.custom_card.default.yml index 765d50505a..71ba888e58 100644 --- a/web/profiles/custom/yalesites_profile/config/sync/core.entity_form_display.paragraph.custom_card.default.yml +++ b/web/profiles/custom/yalesites_profile/config/sync/core.entity_form_display.paragraph.custom_card.default.yml @@ -33,7 +33,8 @@ content: hide_guidelines: '1' maxlength: maxlength_js: 80 - maxlength_js_label: 'Content limited to @limit characters, remaining: @remaining' + maxlength_js_label: 'Content recommended length set to @limit characters, remaining: @remaining' + maxlength_js_enforce: false field_image: type: media_library_widget weight: 0 diff --git a/web/profiles/custom/yalesites_profile/config/sync/core.entity_form_display.paragraph.gallery_item.default.yml b/web/profiles/custom/yalesites_profile/config/sync/core.entity_form_display.paragraph.gallery_item.default.yml index 741b54db36..7ac3567c23 100644 --- a/web/profiles/custom/yalesites_profile/config/sync/core.entity_form_display.paragraph.gallery_item.default.yml +++ b/web/profiles/custom/yalesites_profile/config/sync/core.entity_form_display.paragraph.gallery_item.default.yml @@ -30,7 +30,8 @@ content: hide_guidelines: '1' maxlength: maxlength_js: 80 - maxlength_js_label: 'Content limited to @limit characters, remaining: @remaining' + maxlength_js_label: 'Content recommended length set to @limit characters, remaining: @remaining' + maxlength_js_enforce: false field_media: type: media_library_widget weight: 0 @@ -51,7 +52,7 @@ content: hide_guidelines: '1' maxlength: maxlength_js: 200 - maxlength_js_label: 'Content limited to @limit characters, remaining: @remaining' + maxlength_js_label: 'Content recommended length set to @limit characters, remaining: @remaining' maxlength_js_enforce: false hidden: created: true diff --git a/web/profiles/custom/yalesites_profile/config/sync/core.entity_form_display.paragraph.tab.default.yml b/web/profiles/custom/yalesites_profile/config/sync/core.entity_form_display.paragraph.tab.default.yml index 3fa6816408..0515c56f2c 100644 --- a/web/profiles/custom/yalesites_profile/config/sync/core.entity_form_display.paragraph.tab.default.yml +++ b/web/profiles/custom/yalesites_profile/config/sync/core.entity_form_display.paragraph.tab.default.yml @@ -55,7 +55,8 @@ content: hide_guidelines: '1' maxlength: maxlength_js: 40 - maxlength_js_label: 'Content limited to @limit characters, remaining: @remaining' + maxlength_js_label: 'Content recommended length set to @limit characters, remaining: @remaining' + maxlength_js_enforce: false hidden: created: true status: true diff --git a/web/profiles/custom/yalesites_profile/config/sync/core.entity_view_display.block_content.callout.default.yml b/web/profiles/custom/yalesites_profile/config/sync/core.entity_view_display.block_content.callout.default.yml index 0d36cef14b..c6d3c2c570 100644 --- a/web/profiles/custom/yalesites_profile/config/sync/core.entity_view_display.block_content.callout.default.yml +++ b/web/profiles/custom/yalesites_profile/config/sync/core.entity_view_display.block_content.callout.default.yml @@ -6,6 +6,7 @@ dependencies: - block_content.type.callout - field.field.block_content.callout.field_callout - field.field.block_content.callout.field_instructions + - field.field.block_content.callout.field_style_alignment - field.field.block_content.callout.field_style_color module: - entity_reference_revisions @@ -24,6 +25,13 @@ content: third_party_settings: { } weight: 0 region: content + field_style_alignment: + type: list_key + label: hidden + settings: { } + third_party_settings: { } + weight: 2 + region: content field_style_color: type: list_key label: hidden diff --git a/web/profiles/custom/yalesites_profile/config/sync/core.entity_view_display.block_content.text.default.yml b/web/profiles/custom/yalesites_profile/config/sync/core.entity_view_display.block_content.text.default.yml index 83f92d3c9f..c417897038 100644 --- a/web/profiles/custom/yalesites_profile/config/sync/core.entity_view_display.block_content.text.default.yml +++ b/web/profiles/custom/yalesites_profile/config/sync/core.entity_view_display.block_content.text.default.yml @@ -5,14 +5,23 @@ dependencies: config: - block_content.type.text - field.field.block_content.text.field_instructions + - field.field.block_content.text.field_style_variation - field.field.block_content.text.field_text module: + - options - text id: block_content.text.default targetEntityType: block_content bundle: text mode: default content: + field_style_variation: + type: list_key + label: hidden + settings: { } + third_party_settings: { } + weight: 5 + region: content field_text: type: text_default label: hidden diff --git a/web/profiles/custom/yalesites_profile/config/sync/core.entity_view_display.media.image.background_image_16_9_focus_header.yml b/web/profiles/custom/yalesites_profile/config/sync/core.entity_view_display.media.image.background_image_16_9_focus_header.yml new file mode 100644 index 0000000000..d39aebabce --- /dev/null +++ b/web/profiles/custom/yalesites_profile/config/sync/core.entity_view_display.media.image.background_image_16_9_focus_header.yml @@ -0,0 +1,38 @@ +uuid: c8e77859-a557-41b4-b240-2869c47c5b87 +langcode: en +status: true +dependencies: + config: + - core.entity_view_mode.media.background_image_16_9_focus_header + - field.field.media.image.field_media_image + - media.type.image + - responsive_image.styles.background_image_focus_header + module: + - layout_builder + - responsive_image +third_party_settings: + layout_builder: + enabled: false + allow_custom: false +id: media.image.background_image_16_9_focus_header +targetEntityType: media +bundle: image +mode: background_image_16_9_focus_header +content: + field_media_image: + type: responsive_image + label: hidden + settings: + responsive_image_style: background_image_focus_header + image_link: '' + image_loading: + attribute: eager + third_party_settings: { } + weight: 0 + region: content +hidden: + created: true + name: true + search_api_excerpt: true + thumbnail: true + uid: true diff --git a/web/profiles/custom/yalesites_profile/config/sync/core.entity_view_display.media.image.banner_profile.yml b/web/profiles/custom/yalesites_profile/config/sync/core.entity_view_display.media.image.banner_profile.yml new file mode 100644 index 0000000000..7373f67129 --- /dev/null +++ b/web/profiles/custom/yalesites_profile/config/sync/core.entity_view_display.media.image.banner_profile.yml @@ -0,0 +1,38 @@ +uuid: 38cdb103-9f65-4764-acd9-2c65b7e3c1c3 +langcode: en +status: true +dependencies: + config: + - core.entity_view_mode.media.banner_profile + - field.field.media.image.field_media_image + - media.type.image + - responsive_image.styles.banner_profile + module: + - layout_builder + - responsive_image +third_party_settings: + layout_builder: + enabled: false + allow_custom: false +id: media.image.banner_profile +targetEntityType: media +bundle: image +mode: banner_profile +content: + field_media_image: + type: responsive_image + label: hidden + settings: + responsive_image_style: banner_profile + image_link: '' + image_loading: + attribute: eager + third_party_settings: { } + weight: 0 + region: content +hidden: + created: true + name: true + search_api_excerpt: true + thumbnail: true + uid: true diff --git a/web/profiles/custom/yalesites_profile/config/sync/core.entity_view_display.node.event.condensed.yml b/web/profiles/custom/yalesites_profile/config/sync/core.entity_view_display.node.event.condensed.yml index ad3e2ea0fb..58ad79c2d5 100644 --- a/web/profiles/custom/yalesites_profile/config/sync/core.entity_view_display.node.event.condensed.yml +++ b/web/profiles/custom/yalesites_profile/config/sync/core.entity_view_display.node.event.condensed.yml @@ -54,15 +54,11 @@ bundle: event mode: condensed content: field_event_date: - type: smartdate_default + type: smartdate_plain label: hidden settings: timezone_override: '' - format_type: medium - format: html_datetime - force_chronological: false - add_classes: false - time_wrapper: true + separator: '-' third_party_settings: { } weight: 0 region: content diff --git a/web/profiles/custom/yalesites_profile/config/sync/core.entity_view_display.node.profile.card.yml b/web/profiles/custom/yalesites_profile/config/sync/core.entity_view_display.node.profile.card.yml index 06002b1e39..9e7afa834b 100644 --- a/web/profiles/custom/yalesites_profile/config/sync/core.entity_view_display.node.profile.card.yml +++ b/web/profiles/custom/yalesites_profile/config/sync/core.entity_view_display.node.profile.card.yml @@ -60,6 +60,15 @@ content: third_party_settings: { } weight: 4 region: content + field_teaser_media: + type: entity_reference_entity_view + label: hidden + settings: + view_mode: profile_directory_card_1_1_ + link: false + third_party_settings: { } + weight: 5 + region: content field_teaser_text: type: text_default label: hidden @@ -86,7 +95,6 @@ hidden: field_login_required: true field_metatags: true field_tags: true - field_teaser_media: true field_telephone: true layout_builder__layout: true links: true diff --git a/web/profiles/custom/yalesites_profile/config/sync/core.entity_view_display.node.profile.directory.yml b/web/profiles/custom/yalesites_profile/config/sync/core.entity_view_display.node.profile.directory.yml index 7012d62d41..abc30de218 100644 --- a/web/profiles/custom/yalesites_profile/config/sync/core.entity_view_display.node.profile.directory.yml +++ b/web/profiles/custom/yalesites_profile/config/sync/core.entity_view_display.node.profile.directory.yml @@ -93,6 +93,15 @@ content: third_party_settings: { } weight: 1 region: content + field_teaser_media: + type: entity_reference_entity_view + label: hidden + settings: + view_mode: profile_directory_card_1_1_ + link: false + third_party_settings: { } + weight: 7 + region: content field_telephone: type: string label: hidden @@ -109,7 +118,6 @@ hidden: field_login_required: true field_metatags: true field_tags: true - field_teaser_media: true field_teaser_text: true field_teaser_title: true layout_builder__layout: true diff --git a/web/profiles/custom/yalesites_profile/config/sync/core.entity_view_display.node.profile.list_item.yml b/web/profiles/custom/yalesites_profile/config/sync/core.entity_view_display.node.profile.list_item.yml index c1ed09f3e5..0649c31f3a 100644 --- a/web/profiles/custom/yalesites_profile/config/sync/core.entity_view_display.node.profile.list_item.yml +++ b/web/profiles/custom/yalesites_profile/config/sync/core.entity_view_display.node.profile.list_item.yml @@ -51,21 +51,30 @@ content: settings: link_to_entity: false third_party_settings: { } - weight: 3 + weight: 4 region: content field_subtitle: type: text_default label: hidden settings: { } third_party_settings: { } - weight: 4 + weight: 5 + region: content + field_teaser_media: + type: entity_reference_entity_view + label: hidden + settings: + view_mode: profile_directory_card_1_1_ + link: false + third_party_settings: { } + weight: 1 region: content field_teaser_text: type: text_default label: hidden settings: { } third_party_settings: { } - weight: 2 + weight: 3 region: content field_teaser_title: type: string @@ -73,7 +82,7 @@ content: settings: link_to_entity: false third_party_settings: { } - weight: 1 + weight: 2 region: content hidden: field_address: true @@ -86,7 +95,6 @@ hidden: field_login_required: true field_metatags: true field_tags: true - field_teaser_media: true field_telephone: true layout_builder__layout: true links: true diff --git a/web/profiles/custom/yalesites_profile/config/sync/core.entity_view_mode.media.background_image_16_9_focus_header.yml b/web/profiles/custom/yalesites_profile/config/sync/core.entity_view_mode.media.background_image_16_9_focus_header.yml new file mode 100644 index 0000000000..52614e40ce --- /dev/null +++ b/web/profiles/custom/yalesites_profile/config/sync/core.entity_view_mode.media.background_image_16_9_focus_header.yml @@ -0,0 +1,10 @@ +uuid: a71d250d-989a-4554-95cb-f04af8833400 +langcode: en +status: true +dependencies: + module: + - media +id: media.background_image_16_9_focus_header +label: 'Background Image (16:9) | Focus Header' +targetEntityType: media +cache: true diff --git a/web/profiles/custom/yalesites_profile/config/sync/core.entity_view_mode.media.banner_profile.yml b/web/profiles/custom/yalesites_profile/config/sync/core.entity_view_mode.media.banner_profile.yml new file mode 100644 index 0000000000..713cd81cb5 --- /dev/null +++ b/web/profiles/custom/yalesites_profile/config/sync/core.entity_view_mode.media.banner_profile.yml @@ -0,0 +1,10 @@ +uuid: 0c1f8db3-f81e-4e91-9ee2-a8ab5eb89ed3 +langcode: en +status: true +dependencies: + module: + - media +id: media.banner_profile +label: 'Banner Profile' +targetEntityType: media +cache: true diff --git a/web/profiles/custom/yalesites_profile/config/sync/core.extension.yml b/web/profiles/custom/yalesites_profile/config/sync/core.extension.yml index 8f51697110..530f1042f0 100644 --- a/web/profiles/custom/yalesites_profile/config/sync/core.extension.yml +++ b/web/profiles/custom/yalesites_profile/config/sync/core.extension.yml @@ -84,6 +84,7 @@ module: migrate: 0 migrate_plus: 0 migrate_tools: 0 + multiple_fields_remove_button: 0 multivalue_form_element: 0 mysql: 0 node: 0 diff --git a/web/profiles/custom/yalesites_profile/config/sync/field.field.block_content.callout.field_style_alignment.yml b/web/profiles/custom/yalesites_profile/config/sync/field.field.block_content.callout.field_style_alignment.yml new file mode 100644 index 0000000000..ebc920c170 --- /dev/null +++ b/web/profiles/custom/yalesites_profile/config/sync/field.field.block_content.callout.field_style_alignment.yml @@ -0,0 +1,21 @@ +uuid: 8f6c0de5-11eb-44b0-92d9-11748df84be8 +langcode: en +status: true +dependencies: + config: + - block_content.type.callout + - field.storage.block_content.field_style_alignment + module: + - options +id: block_content.callout.field_style_alignment +field_name: field_style_alignment +entity_type: block_content +bundle: callout +label: Alignment +description: '' +required: true +translatable: false +default_value: { } +default_value_callback: ys_themes_default_value_function +settings: { } +field_type: list_string diff --git a/web/profiles/custom/yalesites_profile/config/sync/field.field.block_content.content_spotlight.field_style_position.yml b/web/profiles/custom/yalesites_profile/config/sync/field.field.block_content.content_spotlight.field_style_position.yml index fb3a189c10..e07bc72a37 100644 --- a/web/profiles/custom/yalesites_profile/config/sync/field.field.block_content.content_spotlight.field_style_position.yml +++ b/web/profiles/custom/yalesites_profile/config/sync/field.field.block_content.content_spotlight.field_style_position.yml @@ -13,9 +13,9 @@ entity_type: block_content bundle: content_spotlight label: 'Image Position' description: '' -required: false +required: true translatable: true default_value: { } -default_value_callback: '' +default_value_callback: ys_themes_default_value_function settings: { } field_type: list_string diff --git a/web/profiles/custom/yalesites_profile/config/sync/field.field.block_content.content_spotlight.field_style_variation.yml b/web/profiles/custom/yalesites_profile/config/sync/field.field.block_content.content_spotlight.field_style_variation.yml index 7d5e665807..e8cd6700d8 100644 --- a/web/profiles/custom/yalesites_profile/config/sync/field.field.block_content.content_spotlight.field_style_variation.yml +++ b/web/profiles/custom/yalesites_profile/config/sync/field.field.block_content.content_spotlight.field_style_variation.yml @@ -13,9 +13,9 @@ entity_type: block_content bundle: content_spotlight label: Focus description: '' -required: false +required: true translatable: true default_value: { } -default_value_callback: '' +default_value_callback: ys_themes_default_value_function settings: { } field_type: list_string diff --git a/web/profiles/custom/yalesites_profile/config/sync/field.field.block_content.content_spotlight.field_style_width.yml b/web/profiles/custom/yalesites_profile/config/sync/field.field.block_content.content_spotlight.field_style_width.yml index 37b28b3812..38f4e56e31 100644 --- a/web/profiles/custom/yalesites_profile/config/sync/field.field.block_content.content_spotlight.field_style_width.yml +++ b/web/profiles/custom/yalesites_profile/config/sync/field.field.block_content.content_spotlight.field_style_width.yml @@ -13,9 +13,9 @@ entity_type: block_content bundle: content_spotlight label: 'Image Size' description: '' -required: false +required: true translatable: false default_value: { } -default_value_callback: '' +default_value_callback: ys_themes_default_value_function settings: { } field_type: list_string diff --git a/web/profiles/custom/yalesites_profile/config/sync/field.field.block_content.divider.field_style_position.yml b/web/profiles/custom/yalesites_profile/config/sync/field.field.block_content.divider.field_style_position.yml index d18e611f49..fb5996bb4f 100644 --- a/web/profiles/custom/yalesites_profile/config/sync/field.field.block_content.divider.field_style_position.yml +++ b/web/profiles/custom/yalesites_profile/config/sync/field.field.block_content.divider.field_style_position.yml @@ -15,9 +15,7 @@ label: 'Divider Position' description: '' required: true translatable: true -default_value: - - - value: left -default_value_callback: '' +default_value: { } +default_value_callback: ys_themes_default_value_function settings: { } field_type: list_string diff --git a/web/profiles/custom/yalesites_profile/config/sync/field.field.block_content.divider.field_style_width.yml b/web/profiles/custom/yalesites_profile/config/sync/field.field.block_content.divider.field_style_width.yml index bef7143d4c..85e9b1d7a2 100644 --- a/web/profiles/custom/yalesites_profile/config/sync/field.field.block_content.divider.field_style_width.yml +++ b/web/profiles/custom/yalesites_profile/config/sync/field.field.block_content.divider.field_style_width.yml @@ -15,9 +15,7 @@ label: 'Divider Width' description: '' required: true translatable: true -default_value: - - - value: 100% -default_value_callback: '' +default_value: { } +default_value_callback: ys_themes_default_value_function settings: { } field_type: list_string diff --git a/web/profiles/custom/yalesites_profile/config/sync/field.field.block_content.grand_hero.field_style_position.yml b/web/profiles/custom/yalesites_profile/config/sync/field.field.block_content.grand_hero.field_style_position.yml index 140c80abd1..e0a7bd02e0 100644 --- a/web/profiles/custom/yalesites_profile/config/sync/field.field.block_content.grand_hero.field_style_position.yml +++ b/web/profiles/custom/yalesites_profile/config/sync/field.field.block_content.grand_hero.field_style_position.yml @@ -13,9 +13,9 @@ entity_type: block_content bundle: grand_hero label: 'Overlay Position' description: '' -required: false +required: true translatable: true default_value: { } -default_value_callback: '' +default_value_callback: ys_themes_default_value_function settings: { } field_type: list_string diff --git a/web/profiles/custom/yalesites_profile/config/sync/field.field.block_content.grand_hero.field_style_variation.yml b/web/profiles/custom/yalesites_profile/config/sync/field.field.block_content.grand_hero.field_style_variation.yml index 059a628c9f..c60d7d44ac 100644 --- a/web/profiles/custom/yalesites_profile/config/sync/field.field.block_content.grand_hero.field_style_variation.yml +++ b/web/profiles/custom/yalesites_profile/config/sync/field.field.block_content.grand_hero.field_style_variation.yml @@ -13,9 +13,9 @@ entity_type: block_content bundle: grand_hero label: 'Media Size' description: '' -required: false +required: true translatable: true default_value: { } -default_value_callback: '' +default_value_callback: ys_themes_default_value_function settings: { } field_type: list_string diff --git a/web/profiles/custom/yalesites_profile/config/sync/field.field.block_content.text.field_style_variation.yml b/web/profiles/custom/yalesites_profile/config/sync/field.field.block_content.text.field_style_variation.yml new file mode 100644 index 0000000000..609266d8de --- /dev/null +++ b/web/profiles/custom/yalesites_profile/config/sync/field.field.block_content.text.field_style_variation.yml @@ -0,0 +1,21 @@ +uuid: 423a367c-5159-4a40-a107-031f8c53c99e +langcode: en +status: true +dependencies: + config: + - block_content.type.text + - field.storage.block_content.field_style_variation + module: + - options +id: block_content.text.field_style_variation +field_name: field_style_variation +entity_type: block_content +bundle: text +label: Text Style Variation +description: '' +required: true +translatable: false +default_value: {} +default_value_callback: ys_themes_default_value_function +settings: {} +field_type: list_string diff --git a/web/profiles/custom/yalesites_profile/config/sync/field.field.block_content.wrapped_image.field_style_position.yml b/web/profiles/custom/yalesites_profile/config/sync/field.field.block_content.wrapped_image.field_style_position.yml index f19edb8f6c..f3923cbac1 100644 --- a/web/profiles/custom/yalesites_profile/config/sync/field.field.block_content.wrapped_image.field_style_position.yml +++ b/web/profiles/custom/yalesites_profile/config/sync/field.field.block_content.wrapped_image.field_style_position.yml @@ -13,9 +13,9 @@ entity_type: block_content bundle: wrapped_image label: Position description: '' -required: false +required: true translatable: true default_value: { } -default_value_callback: '' +default_value_callback: ys_themes_default_value_function settings: { } field_type: list_string diff --git a/web/profiles/custom/yalesites_profile/config/sync/field.field.block_content.wrapped_image.field_style_variation.yml b/web/profiles/custom/yalesites_profile/config/sync/field.field.block_content.wrapped_image.field_style_variation.yml index b37de3190d..63bba84e34 100644 --- a/web/profiles/custom/yalesites_profile/config/sync/field.field.block_content.wrapped_image.field_style_variation.yml +++ b/web/profiles/custom/yalesites_profile/config/sync/field.field.block_content.wrapped_image.field_style_variation.yml @@ -13,9 +13,9 @@ entity_type: block_content bundle: wrapped_image label: Style description: '' -required: false +required: true translatable: true default_value: { } -default_value_callback: '' +default_value_callback: ys_themes_default_value_function settings: { } field_type: list_string diff --git a/web/profiles/custom/yalesites_profile/config/sync/field.field.media.image.field_media_image.yml b/web/profiles/custom/yalesites_profile/config/sync/field.field.media.image.field_media_image.yml index 4a2ca6e6da..616ab9ff68 100644 --- a/web/profiles/custom/yalesites_profile/config/sync/field.field.media.image.field_media_image.yml +++ b/web/profiles/custom/yalesites_profile/config/sync/field.field.media.image.field_media_image.yml @@ -26,7 +26,7 @@ settings: file_directory: '[date:custom:Y]-[date:custom:m]' file_extensions: 'png jpg jpeg' max_filesize: '' - max_resolution: '' + max_resolution: 3840x2160 min_resolution: '' alt_field: true alt_field_required: true diff --git a/web/profiles/custom/yalesites_profile/config/sync/field.storage.block_content.field_style_alignment.yml b/web/profiles/custom/yalesites_profile/config/sync/field.storage.block_content.field_style_alignment.yml new file mode 100644 index 0000000000..2fe798014d --- /dev/null +++ b/web/profiles/custom/yalesites_profile/config/sync/field.storage.block_content.field_style_alignment.yml @@ -0,0 +1,21 @@ +uuid: 1ec88178-c5cf-4f76-a3d4-05bfd6a8fbbc +langcode: en +status: true +dependencies: + module: + - block_content + - options +id: block_content.field_style_alignment +field_name: field_style_alignment +entity_type: block_content +type: list_string +settings: + allowed_values: { } + allowed_values_function: ys_themes_allowed_values_function +module: options +locked: false +cardinality: 1 +translatable: true +indexes: { } +persist_with_no_fields: false +custom_storage: false diff --git a/web/profiles/custom/yalesites_profile/config/sync/google_analytics.settings.yml b/web/profiles/custom/yalesites_profile/config/sync/google_analytics.settings.yml index 3434b3a348..0a1a70c3c0 100644 --- a/web/profiles/custom/yalesites_profile/config/sync/google_analytics.settings.yml +++ b/web/profiles/custom/yalesites_profile/config/sync/google_analytics.settings.yml @@ -1,7 +1,7 @@ _core: default_config_hash: dwMYPgAnj9KBO77SLEv9Z42NDJAbuxe0uU9eGC8qw3M account: '' -domain_mode: 0 +domain_mode: 1 cross_domains: '' visibility: request_path_mode: 0 diff --git a/web/profiles/custom/yalesites_profile/config/sync/image.style.16_9_1000.yml b/web/profiles/custom/yalesites_profile/config/sync/image.style.16_9_1000.yml new file mode 100644 index 0000000000..4793eb21bd --- /dev/null +++ b/web/profiles/custom/yalesites_profile/config/sync/image.style.16_9_1000.yml @@ -0,0 +1,15 @@ +uuid: 0b295375-1072-4e02-a73e-35304ffaad03 +langcode: en +status: true +dependencies: { } +name: '16_9_1000' +label: '16:9 (1000)' +effects: + cab9f2b4-8b0c-43c6-9870-30d9574bd201: + uuid: cab9f2b4-8b0c-43c6-9870-30d9574bd201 + id: image_scale_and_crop + weight: 1 + data: + width: 1000 + height: 562 + anchor: center-center diff --git a/web/profiles/custom/yalesites_profile/config/sync/image.style.16_9_1400.yml b/web/profiles/custom/yalesites_profile/config/sync/image.style.16_9_1400.yml new file mode 100644 index 0000000000..5250327b50 --- /dev/null +++ b/web/profiles/custom/yalesites_profile/config/sync/image.style.16_9_1400.yml @@ -0,0 +1,15 @@ +uuid: 03a3c61b-838d-4c25-93b3-b96953412b31 +langcode: en +status: true +dependencies: { } +name: '16_9_1400' +label: '16:9 (1400)' +effects: + 77d3ea85-f0ea-40b8-abf2-57bad7ed7000: + uuid: 77d3ea85-f0ea-40b8-abf2-57bad7ed7000 + id: image_scale_and_crop + weight: 1 + data: + width: 1400 + height: 787 + anchor: center-center diff --git a/web/profiles/custom/yalesites_profile/config/sync/image.style.16_9_1800.yml b/web/profiles/custom/yalesites_profile/config/sync/image.style.16_9_1800.yml new file mode 100644 index 0000000000..24a1fa8a55 --- /dev/null +++ b/web/profiles/custom/yalesites_profile/config/sync/image.style.16_9_1800.yml @@ -0,0 +1,15 @@ +uuid: 7712b420-e9fe-4d3d-bf4c-9bfe78b184d6 +langcode: en +status: true +dependencies: { } +name: '16_9_1800' +label: '16:9 (1800)' +effects: + 49278a79-9e9c-4983-9c28-41cee26e5167: + uuid: 49278a79-9e9c-4983-9c28-41cee26e5167 + id: image_scale_and_crop + weight: 1 + data: + width: 1800 + height: 1012 + anchor: center-center diff --git a/web/profiles/custom/yalesites_profile/config/sync/image.style.16_9_2400.yml b/web/profiles/custom/yalesites_profile/config/sync/image.style.16_9_2400.yml new file mode 100644 index 0000000000..6c9fa6a064 --- /dev/null +++ b/web/profiles/custom/yalesites_profile/config/sync/image.style.16_9_2400.yml @@ -0,0 +1,15 @@ +uuid: a28b30bb-3075-4d17-9d9d-11e14e704f29 +langcode: en +status: true +dependencies: { } +name: '16_9_2400' +label: '16:9 (2400)' +effects: + 85d811de-88a2-4dc4-818a-a7151fbcdcd8: + uuid: 85d811de-88a2-4dc4-818a-a7151fbcdcd8 + id: image_scale_and_crop + weight: 1 + data: + width: 2400 + height: 1350 + anchor: center-center diff --git a/web/profiles/custom/yalesites_profile/config/sync/image.style.16_9_400.yml b/web/profiles/custom/yalesites_profile/config/sync/image.style.16_9_400.yml new file mode 100644 index 0000000000..f4793b0e73 --- /dev/null +++ b/web/profiles/custom/yalesites_profile/config/sync/image.style.16_9_400.yml @@ -0,0 +1,15 @@ +uuid: 4bc48e22-88eb-4945-ba3f-e071ddc4330c +langcode: en +status: true +dependencies: { } +name: '16_9_400' +label: '16:9 (400)' +effects: + 9c3740b8-e036-48ea-a554-ebe961085911: + uuid: 9c3740b8-e036-48ea-a554-ebe961085911 + id: image_scale_and_crop + weight: 1 + data: + width: 400 + height: 225 + anchor: center-center diff --git a/web/profiles/custom/yalesites_profile/config/sync/image.style.16_9_600.yml b/web/profiles/custom/yalesites_profile/config/sync/image.style.16_9_600.yml new file mode 100644 index 0000000000..81ed0d984b --- /dev/null +++ b/web/profiles/custom/yalesites_profile/config/sync/image.style.16_9_600.yml @@ -0,0 +1,15 @@ +uuid: b7a8dfd5-46ad-4c2a-9d97-531eb8d0ee4d +langcode: en +status: true +dependencies: { } +name: '16_9_600' +label: '16:9 (600)' +effects: + 20ecb5c2-8cb1-4e89-aa5d-0f4e4bf7bdff: + uuid: 20ecb5c2-8cb1-4e89-aa5d-0f4e4bf7bdff + id: image_scale_and_crop + weight: 1 + data: + width: 600 + height: 337 + anchor: center-center diff --git a/web/profiles/custom/yalesites_profile/config/sync/image.style.16_9_800.yml b/web/profiles/custom/yalesites_profile/config/sync/image.style.16_9_800.yml new file mode 100644 index 0000000000..da61e8439f --- /dev/null +++ b/web/profiles/custom/yalesites_profile/config/sync/image.style.16_9_800.yml @@ -0,0 +1,15 @@ +uuid: 950f3472-0e74-4207-8f5e-a2227e52b6c3 +langcode: en +status: true +dependencies: { } +name: '16_9_800' +label: '16:9 (800)' +effects: + 0206d396-5fbd-431e-aacf-eff3f88ff7e3: + uuid: 0206d396-5fbd-431e-aacf-eff3f88ff7e3 + id: image_scale_and_crop + weight: 1 + data: + width: 800 + height: 450 + anchor: center-center diff --git a/web/profiles/custom/yalesites_profile/config/sync/imagemagick.settings.yml b/web/profiles/custom/yalesites_profile/config/sync/imagemagick.settings.yml index 9a86e390a4..57a60707ef 100644 --- a/web/profiles/custom/yalesites_profile/config/sync/imagemagick.settings.yml +++ b/web/profiles/custom/yalesites_profile/config/sync/imagemagick.settings.yml @@ -3,7 +3,7 @@ _core: quality: 100 binaries: imagemagick path_to_binaries: '' -prepend: '' +prepend: '-limit area 20MP -limit memory 96MB -limit map 192MB' log_warnings: true debug: false locale: en_US.UTF-8 diff --git a/web/profiles/custom/yalesites_profile/config/sync/linkit.linkit_profile.default.yml b/web/profiles/custom/yalesites_profile/config/sync/linkit.linkit_profile.default.yml index 7a9e0f0f64..8509e244ff 100644 --- a/web/profiles/custom/yalesites_profile/config/sync/linkit.linkit_profile.default.yml +++ b/web/profiles/custom/yalesites_profile/config/sync/linkit.linkit_profile.default.yml @@ -21,7 +21,7 @@ matchers: substitution_type: canonical limit: 100 include_unpublished: false - weight: 0 + weight: -9 9a7ef5fd-456e-45c4-b6be-7b2f60f82084: id: 'entity:file' uuid: 9a7ef5fd-456e-45c4-b6be-7b2f60f82084 @@ -37,4 +37,14 @@ matchers: show_dimensions: false show_thumbnail: false thumbnail_image_style: null + weight: -8 + 90c3f3be-adc6-4ba4-93cc-24915c7aa69d: + id: email + uuid: 90c3f3be-adc6-4ba4-93cc-24915c7aa69d + settings: { } + weight: -10 + 5d407f45-1ebb-45c7-8659-fa367cc55944: + id: phone + uuid: 5d407f45-1ebb-45c7-8659-fa367cc55944 + settings: { } weight: 0 diff --git a/web/profiles/custom/yalesites_profile/config/sync/responsive_image.styles.background_image_focus_header.yml b/web/profiles/custom/yalesites_profile/config/sync/responsive_image.styles.background_image_focus_header.yml new file mode 100644 index 0000000000..03e0bd7f18 --- /dev/null +++ b/web/profiles/custom/yalesites_profile/config/sync/responsive_image.styles.background_image_focus_header.yml @@ -0,0 +1,31 @@ +uuid: 4e08ad05-a17d-486f-b391-d017ca163c66 +langcode: en +status: true +dependencies: + config: + - image.style.16_9_1000 + - image.style.16_9_1400 + - image.style.16_9_1800 + - image.style.16_9_2400 + - image.style.16_9_400 + - image.style.16_9_600 + - image.style.16_9_800 +id: background_image_focus_header +label: 'Background Image - Focus Header' +image_style_mappings: + - + image_mapping_type: sizes + image_mapping: + sizes: 100vw + sizes_image_styles: + - '16_9_400' + - '16_9_1000' + - '16_9_1400' + - '16_9_1800' + - '16_9_2400' + - '16_9_600' + - '16_9_800' + breakpoint_id: responsive_image.viewport_sizing + multiplier: 1x +breakpoint_group: responsive_image +fallback_image_style: '16_9_1000' diff --git a/web/profiles/custom/yalesites_profile/config/sync/responsive_image.styles.banner_profile.yml b/web/profiles/custom/yalesites_profile/config/sync/responsive_image.styles.banner_profile.yml new file mode 100644 index 0000000000..3fce7871b4 --- /dev/null +++ b/web/profiles/custom/yalesites_profile/config/sync/responsive_image.styles.banner_profile.yml @@ -0,0 +1,27 @@ +uuid: 506ffaab-1da4-48a7-9356-1d89c25bd6c7 +langcode: en +status: true +dependencies: + config: + - image.style.3_2_175 + - image.style.3_2_320 + - image.style.3_2_480 + - image.style.3_2_540 + - image.style.3_2_640 +id: banner_profile +label: 'Banner Profile (3:2)' +image_style_mappings: + - + image_mapping_type: sizes + image_mapping: + sizes: '(min-width: 1344px) 640px, (min-width: 991px) 640px, 100vw' + sizes_image_styles: + - '3_2_175' + - '3_2_320' + - '3_2_480' + - '3_2_540' + - '3_2_640' + breakpoint_id: responsive_image.viewport_sizing + multiplier: 1x +breakpoint_group: responsive_image +fallback_image_style: '3_2_480' diff --git a/web/profiles/custom/yalesites_profile/config/sync/user.role.platform_admin.yml b/web/profiles/custom/yalesites_profile/config/sync/user.role.platform_admin.yml index 344768d379..ae3cced740 100644 --- a/web/profiles/custom/yalesites_profile/config/sync/user.role.platform_admin.yml +++ b/web/profiles/custom/yalesites_profile/config/sync/user.role.platform_admin.yml @@ -39,6 +39,7 @@ dependencies: - node.type.page - node.type.post - node.type.profile + - taxonomy.vocabulary.affiliation - taxonomy.vocabulary.event_category - taxonomy.vocabulary.post_category - taxonomy.vocabulary.tags @@ -124,6 +125,7 @@ permissions: - 'create pull_quote block content' - 'create quick_links block content' - 'create tabs block content' + - 'create terms in affiliation' - 'create terms in event_category' - 'create terms in post_category' - 'create terms in tags' @@ -200,6 +202,7 @@ permissions: - 'delete own post content' - 'delete own profile content' - 'delete own video media' + - 'delete terms in affiliation' - 'delete terms in event_category' - 'delete terms in post_category' - 'delete terms in tags' @@ -246,6 +249,7 @@ permissions: - 'edit own profile content' - 'edit own video media' - 'edit own webform submission' + - 'edit terms in affiliation' - 'edit terms in event_category' - 'edit terms in post_category' - 'edit terms in tags' diff --git a/web/profiles/custom/yalesites_profile/config/sync/user.role.site_admin.yml b/web/profiles/custom/yalesites_profile/config/sync/user.role.site_admin.yml index a1e679fa8b..89cb244eb9 100644 --- a/web/profiles/custom/yalesites_profile/config/sync/user.role.site_admin.yml +++ b/web/profiles/custom/yalesites_profile/config/sync/user.role.site_admin.yml @@ -39,6 +39,7 @@ dependencies: - node.type.page - node.type.post - node.type.profile + - taxonomy.vocabulary.affiliation - taxonomy.vocabulary.event_category - taxonomy.vocabulary.post_category - taxonomy.vocabulary.tags @@ -118,6 +119,7 @@ permissions: - 'create pull_quote block content' - 'create quick_links block content' - 'create tabs block content' + - 'create terms in affiliation' - 'create terms in event_category' - 'create terms in post_category' - 'create terms in tags' @@ -194,6 +196,7 @@ permissions: - 'delete own post content' - 'delete own profile content' - 'delete own video media' + - 'delete terms in affiliation' - 'delete terms in event_category' - 'delete terms in post_category' - 'delete terms in tags' @@ -240,6 +243,7 @@ permissions: - 'edit own profile content' - 'edit own video media' - 'edit own webform submission' + - 'edit terms in affiliation' - 'edit terms in event_category' - 'edit terms in post_category' - 'edit terms in tags' diff --git a/web/profiles/custom/yalesites_profile/config/sync/views.view.search.yml b/web/profiles/custom/yalesites_profile/config/sync/views.view.search.yml index 9827ffc37f..ede11ae221 100644 --- a/web/profiles/custom/yalesites_profile/config/sync/views.view.search.yml +++ b/web/profiles/custom/yalesites_profile/config/sync/views.view.search.yml @@ -97,7 +97,7 @@ display: multi_type: separator multi_separator: ', ' pager: - type: mini + type: full options: offset: 0 items_per_page: 10 @@ -106,6 +106,8 @@ display: tags: next: ›› previous: ‹‹ + first: '« First' + last: 'Last »' expose: items_per_page: false items_per_page_label: 'Items per page' @@ -114,6 +116,7 @@ display: items_per_page_options_all_label: '- All -' offset: false offset_label: Offset + quantity: 9 exposed_form: type: basic options: @@ -207,6 +210,7 @@ display: event: search_result page: search_result post: search_result + profile: search_result query: type: search_api_query options: diff --git a/web/profiles/custom/yalesites_profile/config/sync/ys_themes.component_overrides.yml b/web/profiles/custom/yalesites_profile/config/sync/ys_themes.component_overrides.yml index 4d699122c2..3124bc526f 100644 --- a/web/profiles/custom/yalesites_profile/config/sync/ys_themes.component_overrides.yml +++ b/web/profiles/custom/yalesites_profile/config/sync/ys_themes.component_overrides.yml @@ -5,6 +5,11 @@ callout: two: Two three: Three default: one + field_style_alignment: + values: + left: Left + center: Center + default: center cta_banner: field_style_color: values: @@ -106,3 +111,9 @@ divider: 50%: 50 25%: 25 default: 100% +text: + field_style_variation: + values: + default: 'Default' + emphasized: 'Emphasized' + default: default diff --git a/web/profiles/custom/yalesites_profile/config/sync/ys_themes.theme_settings.yml b/web/profiles/custom/yalesites_profile/config/sync/ys_themes.theme_settings.yml index 09d799da8e..05ae06fbbb 100644 --- a/web/profiles/custom/yalesites_profile/config/sync/ys_themes.theme_settings.yml +++ b/web/profiles/custom/yalesites_profile/config/sync/ys_themes.theme_settings.yml @@ -3,4 +3,6 @@ nav_type: basic header_theme: one footer_theme: one global_theme: one -button_theme: two +button_theme: one +header_accent: one +footer_accent: one diff --git a/web/profiles/custom/yalesites_profile/modules/custom/ys_alert/README.md b/web/profiles/custom/yalesites_profile/modules/custom/ys_alert/README.md index 436aa138a6..f7a7ca7100 100644 --- a/web/profiles/custom/yalesites_profile/modules/custom/ys_alert/README.md +++ b/web/profiles/custom/yalesites_profile/modules/custom/ys_alert/README.md @@ -1,5 +1,11 @@ # YaleSites Alert -This module creates an alert banner to display a message across all pages of a -YaleSite. A backend interface allows site owners to enable or disable alerts. -Message can be an announcement, marketing, or emergency alert. +## Description +The YaleSite Alert Banner module enhances your website by providing a versatile alert banner that can display messages on all pages. Whether you want to make announcements, run marketing campaigns, or communicate emergency information, this module has got you covered. + +## Features +- **Alert Management Interface**: We offer a user-friendly admin interface at admin/yalesites/alert for efficient management of alerts. +- **Global Alert Display**: Enabled alerts are prominently displayed across all pages of your website, ensuring your message reaches your audience effectively. +- **Toggle Switch**: A convenient toggle switch allows site owners to enable or disable alerts at their convenience. +- **Alert Types**: Customize your message by specifying the alert type: announcement, marketing, or emergency. Each type has a different visual treatment and mechanism for minimizing or dismissing. +- **Confirmation Message**: For emergency alerts, we've added an extra layer of caution. Authors will receive a confirmation message before setting emergency alerts, helping prevent accidental broadcasts. diff --git a/web/profiles/custom/yalesites_profile/modules/custom/ys_captcha/README.md b/web/profiles/custom/yalesites_profile/modules/custom/ys_captcha/README.md index 8feba4298a..fd18350ca0 100644 --- a/web/profiles/custom/yalesites_profile/modules/custom/ys_captcha/README.md +++ b/web/profiles/custom/yalesites_profile/modules/custom/ys_captcha/README.md @@ -1,24 +1,3 @@ # YaleSites Recaptcha -This module customizes recaptcha settings for the YaleSites platform. - -This includes: - -- Setting the recaptcha v2 and v3 API keys from a value stored in a Terminus secrets file. -- Disabling the recaptcha API key field to improve the admin interface. - -## Requirements - -Recaptcha API keys must be set in a `secrets.json` file to use the service. -After enabling this module, verify that the API keys are set. - -```bash -lando drush config-get recaptcha.settings --include-overridden -lando drush config-get recaptcha_v3.settings --include-overridden -``` - -If this file is missing, then pull the latest files into the local environment. - -```bash -lando pull --database=none --files=dev --code=none -``` +This module ensures all sites on the YaleSites platform have Google ReCaptcha setup in a consistant way. Currently this module is only used to obfuscate the API keys within the Drupal admin interface. diff --git a/web/profiles/custom/yalesites_profile/modules/custom/ys_core/README.md b/web/profiles/custom/yalesites_profile/modules/custom/ys_core/README.md index 8edcfa9f98..08c940efb8 100644 --- a/web/profiles/custom/yalesites_profile/modules/custom/ys_core/README.md +++ b/web/profiles/custom/yalesites_profile/modules/custom/ys_core/README.md @@ -1,6 +1,11 @@ -# YaleSites Starterkit +# YaleSites Core -This module is used to organize custom functionality that is core to the -YaleSites platform. Code is included in the ys_core module if it does not fit -within an existing custom module. Custom code should be placed in a different -module if it can offer utility to non-YaleSites properties. +## Description +The YaleSites Core Functionality module serves as the central repository for organizing custom functionality that is fundamental to the YaleSites platform. Within this module, you'll find templates, assets, configuration overrides, and custom code that are vital for the seamless operation of all sites hosted on the platform. + +However, before adding new features or functionality to this module, platform developers are encouraged to contemplate the creation of separate custom modules. These custom modules can encapsulate specific sets of features, enhancing modularity and ensuring that the codebase remains clean and organized. This approach promotes a more efficient and maintainable development process for the YaleSites platform. + +## Features +- **Sitewide Elements**: This category covers a wide array of elements including plugins, forms, templates, and various assets used for managing sitewide components such as the site header, footer, and breadcrumbs. These elements may also extend into the styling realm within the Atomic theme and the component library. +- **Install Configuration**: The module houses default values for YaleSites-specific configuration files used during the creation of new sites on the platform. While technically not mandatory, maintaining these install files is considered a best practice, as they ensure consistency and serve as a reference point for values that should ideally reside in the profile's config/sync directory. +- **Hooks and Custom Functionality**: It provides a growing list of hooks for adding and altering form elements, tokens, caching rules, and website behavior. These hooks empower developers to customize and fine-tune the platform's behavior to meet specific requirements. diff --git a/web/profiles/custom/yalesites_profile/modules/custom/ys_core/config/install/ys_core.header_settings.yml b/web/profiles/custom/yalesites_profile/modules/custom/ys_core/config/install/ys_core.header_settings.yml new file mode 100644 index 0000000000..f301f4e8f4 --- /dev/null +++ b/web/profiles/custom/yalesites_profile/modules/custom/ys_core/config/install/ys_core.header_settings.yml @@ -0,0 +1,6 @@ +header_variation: 'basic' +nav_position: 'left' +focus_header_image: '' +site_name_image: '' +search: + enable_search_form: 1 diff --git a/web/profiles/custom/yalesites_profile/modules/custom/ys_core/config/install/ys_core.site.yml b/web/profiles/custom/yalesites_profile/modules/custom/ys_core/config/install/ys_core.site.yml index 36a71fa660..0e719a0ab1 100644 --- a/web/profiles/custom/yalesites_profile/modules/custom/ys_core/config/install/ys_core.site.yml +++ b/web/profiles/custom/yalesites_profile/modules/custom/ys_core/config/install/ys_core.site.yml @@ -1,8 +1,6 @@ page: posts: '' events: '' -search: - enable_search_form: 1 seo: google_site_verification: '' google_analytics_id: '' diff --git a/web/profiles/custom/yalesites_profile/modules/custom/ys_core/css/footer-settings-form.css b/web/profiles/custom/yalesites_profile/modules/custom/ys_core/css/header-footer-settings.css similarity index 66% rename from web/profiles/custom/yalesites_profile/modules/custom/ys_core/css/footer-settings-form.css rename to web/profiles/custom/yalesites_profile/modules/custom/ys_core/css/header-footer-settings.css index 01b37bff33..70cf2d3cf8 100644 --- a/web/profiles/custom/yalesites_profile/modules/custom/ys_core/css/footer-settings-form.css +++ b/web/profiles/custom/yalesites_profile/modules/custom/ys_core/css/header-footer-settings.css @@ -7,27 +7,27 @@ } } -.ys-core-footer-settings-form +.ys-core-header-footer-settings .claro-details.form-disabled .claro-details__summary { background-color: #6f6f6f !important; } -.ys-core-footer-settings-form .form-element { +.ys-core-header-footer-settings .form-element { width: 100%; } -.ys-core-footer-settings-form .preview-icon { +.ys-core-header-footer-settings .preview-icon { width: 190px; height: 137px; } -.ys-core-footer-settings-form .claro-details.form-disabled { +.ys-core-header-footer-settings .claro-details.form-disabled { pointer-events: none; user-select: none; } -.ys-core-footer-settings-form +.ys-core-header-footer-settings .claro-details.form-disabled .claro-details__summary::after { background-image: url("../images/icons/disabled-details.svg"); @@ -37,7 +37,7 @@ content: ""; display: inline-block; height: 2rem; - left: 11rem; + left: 17rem; opacity: 1; position: absolute; top: 50%; @@ -45,15 +45,16 @@ width: 2rem; } -.footer-variation-radios .form-radios { +.variation-radios .form-radios { display: flex; + margin-top: 1rem; } -.footer-variation-radios .form-type--radio:first-child { +.variation-radios .form-type--radio:first-child { margin-left: 0; } -.form-item--footer-variation.form-type--radio input { +.variation-radios .form-type--radio input { border: 0; clip: rect(0 0 0 0); height: 1px; @@ -64,7 +65,7 @@ width: 1px; } -.form-item--footer-variation.form-type--radio label { +.variation-radios .form-type--radio label { display: flex; flex-direction: column; align-items: center; @@ -74,20 +75,17 @@ padding: 0.5rem; } -.form-item--footer-variation input[checked="checked"] + label, -.form-item--footer-variation input[checked="checked"] + label:hover, -.form-item--footer-variation +.variation-radios .form-type--radio input:focus + label { + outline: 2px solid var(--wool); +} + +.variation-radios .form-type--radio input[checked="checked"] + label, +.variation-radios .form-type--radio input[checked="checked"] + label:hover, +.variation-radios + .form-type--radio .form-boolean--type-radio:hover input[checked="checked"] + label { background-color: var(--darkest-gray); color: var(--color-background-primary) !important; } - -.form-item--footer-variation.form-type--radio input:focus + label { - outline: 2px solid var(--wool); -} - -#edit-footer-variation { - margin-top: 1rem; -} diff --git a/web/profiles/custom/yalesites_profile/modules/custom/ys_core/images/preview-icons/header-basic.svg b/web/profiles/custom/yalesites_profile/modules/custom/ys_core/images/preview-icons/header-basic.svg new file mode 100644 index 0000000000..cb04d46d3c --- /dev/null +++ b/web/profiles/custom/yalesites_profile/modules/custom/ys_core/images/preview-icons/header-basic.svg @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/web/profiles/custom/yalesites_profile/modules/custom/ys_core/images/preview-icons/header-focus.svg b/web/profiles/custom/yalesites_profile/modules/custom/ys_core/images/preview-icons/header-focus.svg new file mode 100644 index 0000000000..182c465792 --- /dev/null +++ b/web/profiles/custom/yalesites_profile/modules/custom/ys_core/images/preview-icons/header-focus.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/web/profiles/custom/yalesites_profile/modules/custom/ys_core/images/preview-icons/header-mega.svg b/web/profiles/custom/yalesites_profile/modules/custom/ys_core/images/preview-icons/header-mega.svg new file mode 100644 index 0000000000..9fc151acb5 --- /dev/null +++ b/web/profiles/custom/yalesites_profile/modules/custom/ys_core/images/preview-icons/header-mega.svg @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/web/profiles/custom/yalesites_profile/modules/custom/ys_themes/icons/lever-nav-center.svg b/web/profiles/custom/yalesites_profile/modules/custom/ys_core/images/preview-icons/lever-nav-center.svg similarity index 100% rename from web/profiles/custom/yalesites_profile/modules/custom/ys_themes/icons/lever-nav-center.svg rename to web/profiles/custom/yalesites_profile/modules/custom/ys_core/images/preview-icons/lever-nav-center.svg diff --git a/web/profiles/custom/yalesites_profile/modules/custom/ys_themes/icons/lever-nav-left.svg b/web/profiles/custom/yalesites_profile/modules/custom/ys_core/images/preview-icons/lever-nav-left.svg similarity index 100% rename from web/profiles/custom/yalesites_profile/modules/custom/ys_themes/icons/lever-nav-left.svg rename to web/profiles/custom/yalesites_profile/modules/custom/ys_core/images/preview-icons/lever-nav-left.svg diff --git a/web/profiles/custom/yalesites_profile/modules/custom/ys_themes/icons/lever-nav-right.svg b/web/profiles/custom/yalesites_profile/modules/custom/ys_core/images/preview-icons/lever-nav-right.svg similarity index 100% rename from web/profiles/custom/yalesites_profile/modules/custom/ys_themes/icons/lever-nav-right.svg rename to web/profiles/custom/yalesites_profile/modules/custom/ys_core/images/preview-icons/lever-nav-right.svg diff --git a/web/profiles/custom/yalesites_profile/modules/custom/ys_core/js/footer-settings.js b/web/profiles/custom/yalesites_profile/modules/custom/ys_core/js/header-footer-settings.js similarity index 87% rename from web/profiles/custom/yalesites_profile/modules/custom/ys_core/js/footer-settings.js rename to web/profiles/custom/yalesites_profile/modules/custom/ys_core/js/header-footer-settings.js index edb637c504..fc19616114 100644 --- a/web/profiles/custom/yalesites_profile/modules/custom/ys_core/js/footer-settings.js +++ b/web/profiles/custom/yalesites_profile/modules/custom/ys_core/js/header-footer-settings.js @@ -1,5 +1,5 @@ ((Drupal) => { - Drupal.behaviors.ysCoreFooterSettings = { + Drupal.behaviors.ysCoreHeaderFooterSettings = { attach: function() { // eslint-disable-line // Function to handle radio input checked behavior based on radio element selection. function handleRadioInputs(radioGroup) { @@ -31,7 +31,11 @@ } // Store radio input groups in an array - const radioGroups = ['input[name="footer_variation"]']; + const radioGroups = [ + 'input[name="header_variation"]', + 'input[name="footer_variation"]', + 'input[name="nav_position"]', + ]; // Apply the function to each radio input group radioGroups.forEach((group) => { diff --git a/web/profiles/custom/yalesites_profile/modules/custom/ys_core/src/CoreTwigExtension.php b/web/profiles/custom/yalesites_profile/modules/custom/ys_core/src/CoreTwigExtension.php index deebaf910d..fd8e8abfac 100644 --- a/web/profiles/custom/yalesites_profile/modules/custom/ys_core/src/CoreTwigExtension.php +++ b/web/profiles/custom/yalesites_profile/modules/custom/ys_core/src/CoreTwigExtension.php @@ -18,14 +18,32 @@ class CoreTwigExtension extends AbstractExtension { */ protected $yaleCoreSettings; + /** + * Configuration Factory. + * + * @var \Drupal\Core\Config\ConfigFactoryInterface + */ + protected $yaleHeaderSettings; + + /** + * The YaleSites Media Manager. + * + * @var \Drupal\ys_core\YaleSitesMediaManager + */ + protected $yaleMediaManager; + /** * Constructs the object. * * @param \Drupal\Core\Config\ConfigFactoryInterface $configFactory * The configuration interface. + * @param \Drupal\ys_core\YaleSitesMediaManager $yale_media_manager + * The YaleSites Media Manager. */ - public function __construct(ConfigFactoryInterface $configFactory) { + public function __construct(ConfigFactoryInterface $configFactory, YaleSitesMediaManager $yale_media_manager) { $this->yaleCoreSettings = $configFactory->getEditable('ys_core.site'); + $this->yaleHeaderSettings = $configFactory->getEditable('ys_core.header_settings'); + $this->yaleMediaManager = $yale_media_manager; } /** @@ -34,6 +52,7 @@ public function __construct(ConfigFactoryInterface $configFactory) { public function getFunctions() { return [ new TwigFunction('getCoreSetting', [$this, 'getCoreSetting']), + new TwigFunction('getHeaderSetting', [$this, 'getHeaderSetting']), ]; } @@ -50,4 +69,27 @@ public function getCoreSetting($setting_name) { return($this->yaleCoreSettings->get($setting_name)); } + /** + * Actual function that returns header setting based on setting machine name. + * + * @param string $setting_name + * Setting machine name to pass in to retrieve setting from config. + * + * @return string + * Setting value from ys_core.site. + */ + public function getHeaderSetting($setting_name) { + if ($setting_name == 'site_name_image') { + $siteNameSVG = FALSE; + if ($fid = $this->yaleHeaderSettings->get('site_name_image')) { + $siteNameSVG = $this->yaleMediaManager->getSiteNameImage($fid[0]); + } + + return $siteNameSVG; + } + else { + return($this->yaleHeaderSettings->get($setting_name)); + } + } + } diff --git a/web/profiles/custom/yalesites_profile/modules/custom/ys_core/src/Form/FooterSettingsForm.php b/web/profiles/custom/yalesites_profile/modules/custom/ys_core/src/Form/FooterSettingsForm.php index 5fa29bc92e..8e0027aadf 100644 --- a/web/profiles/custom/yalesites_profile/modules/custom/ys_core/src/Form/FooterSettingsForm.php +++ b/web/profiles/custom/yalesites_profile/modules/custom/ys_core/src/Form/FooterSettingsForm.php @@ -62,7 +62,8 @@ public function buildForm(array $form, FormStateInterface $form_state) { $socialConfig = $this->config('ys_core.social_links'); $footerConfig = $this->config('ys_core.footer_settings'); - $form['#attached']['library'][] = 'ys_core/footer_settings_form'; + $form['#attached']['library'][] = 'ys_core/header_footer_settings'; + $form['#attributes']['class'][] = 'ys-core-header-footer-settings'; $form['footer_variation'] = [ '#type' => 'radios', @@ -74,7 +75,7 @@ public function buildForm(array $form, FormStateInterface $form_state) { '#default_value' => ($footerConfig->get('footer_variation')) ? $footerConfig->get('footer_variation') : 'basic', '#attributes' => [ 'class' => [ - 'footer-variation-radios', + 'variation-radios', ], ], ]; diff --git a/web/profiles/custom/yalesites_profile/modules/custom/ys_core/src/Form/HeaderSettingsForm.php b/web/profiles/custom/yalesites_profile/modules/custom/ys_core/src/Form/HeaderSettingsForm.php new file mode 100644 index 0000000000..b49ff11525 --- /dev/null +++ b/web/profiles/custom/yalesites_profile/modules/custom/ys_core/src/Form/HeaderSettingsForm.php @@ -0,0 +1,337 @@ +cacheRender = $cache_render; + $this->currentUserSession = $current_user_session; + $this->ysMediaManager = $ys_media_manager; + } + + /** + * {@inheritdoc} + */ + public static function create(ContainerInterface $container) { + return new static( + $container->get('config.factory'), + $container->get('cache.render'), + $container->get('current_user'), + $container->get('ys_core.media_manager'), + ); + } + + /** + * Settings configuration form. + * + * @param array $form + * Form array. + * @param \Drupal\Core\Form\FormStateInterface $form_state + * Form state. + * + * @return array + * Form array to render. + */ + public function buildForm(array $form, FormStateInterface $form_state) { + + $form = parent::buildForm($form, $form_state); + $headerConfig = $this->config('ys_core.header_settings'); + + $form['#attached']['library'][] = 'ys_core/header_footer_settings'; + $form['#attributes']['class'][] = 'ys-core-header-footer-settings'; + + $form['header_variation'] = [ + '#type' => 'radios', + '#options' => [ + 'basic' => $this->t('Basic Nav') . 'Basic header icon showing a site title and a simplified navigation.', + 'mega' => $this->t('Mega Nav') . 'Mega header icon showing a site title and a flyout style mega menu.', + 'focus' => $this->t('Focus Nav') . 'Focus header icon showing single level navigation and simplified header.', + ], + '#title' => $this->t('Header variation'), + '#default_value' => ($headerConfig->get('header_variation')) ? $headerConfig->get('header_variation') : 'basic', + '#attributes' => [ + 'class' => [ + 'variation-radios', + ], + ], + ]; + + $form['desc_basic_container'] = [ + '#type' => 'container', + '#title' => $this->t('Basic'), + '#states' => [ + 'visible' => [ + ':input[name="header_variation"]' => ['value' => 'basic'], + ], + ], + ]; + + $form['desc_mega_container'] = [ + '#type' => 'container', + '#title' => $this->t('Mega'), + '#states' => [ + 'visible' => [ + ':input[name="header_variation"]' => ['value' => 'mega'], + ], + ], + ]; + + $form['desc_focus_container'] = [ + '#type' => 'container', + '#title' => $this->t('Focus'), + '#states' => [ + 'visible' => [ + ':input[name="header_variation"]' => ['value' => 'focus'], + ], + ], + ]; + + if ($this->allowSecretItems()) { + $form['site_name_image_container'] = [ + '#type' => 'details', + '#title' => $this->t('Site Name Image'), + ]; + } + + $form['nav_position_container'] = [ + '#type' => 'details', + '#title' => $this->t('Navigation Position'), + '#states' => [ + 'disabled' => [ + ':input[name="header_variation"]' => [ + 'value' => 'focus', + ], + ], + ], + ]; + + $form['site_search_container'] = [ + '#type' => 'details', + '#title' => $this->t('Site Search'), + '#states' => [ + 'disabled' => [ + ':input[name="header_variation"]' => [ + 'value' => 'focus', + ], + ], + ], + ]; + + $form['full_screen_homepage_image_container'] = [ + '#type' => 'details', + '#title' => $this->t('Full Screen Homepage Image'), + '#states' => [ + 'enabled' => [ + ':input[name="header_variation"]' => [ + 'value' => 'focus', + ], + ], + ], + ]; + + $form['desc_basic_container']['desc_basic'] = [ + '#type' => 'markup', + '#prefix' => '

Basic Nav

', + '#markup' => '

' . $this->t('The basic nav can have any number of items but only displays up to two levels of navigation using single-column dropdown menus.') . '

', + ]; + + $form['desc_mega_container']['desc_mega'] = [ + '#type' => 'markup', + '#prefix' => '

Mega Nav

', + '#markup' => '

' . $this->t('The mega nav provides a third level of navigation, giving you the ability to organize menu links into columns with dropdown menus.') . '

', + ]; + + $form['desc_focus_container']['desc_focus'] = [ + '#type' => 'markup', + '#prefix' => '

Focus Nav

', + '#markup' => '

' . $this->t('The focus nav combines a full image landing page with a single level of navigation.') . '

', + ]; + + if ($this->allowSecretItems()) { + $form['site_name_image_container']['site_name_image'] = [ + '#type' => 'managed_file', + '#upload_location' => 'public://site-name-images', + '#multiple' => FALSE, + '#description' => $this->t('Replaces the site name text with an image.
Allowed extensions: svg'), + '#upload_validators' => [ + 'file_validate_extensions' => ['svg'], + ], + '#title' => $this->t('Site Name Image'), + '#default_value' => ($headerConfig->get('site_name_image')) ? $headerConfig->get('site_name_image') : NULL, + '#theme' => 'image_widget', + '#preview_image_style' => 'media_library', + '#use_preview' => TRUE, + '#use_svg_preview' => TRUE, + ]; + } + + $form['nav_position_container']['nav_position'] = [ + '#type' => 'radios', + '#options' => [ + 'left' => $this->t('Left') . 'Icon showing a left aligned main navigation menu and left aligned site title above the navigation.', + 'center' => $this->t('Center') . 'Icon showing a center aligned main navigation menu and centered site title above the navigation.', + 'right' => $this->t('Right') . 'Icon showing a right aligned main navigation menu and left aligned site title on the same level as the main navigation.', + ], + '#title' => $this->t('Navigation Position'), + '#description' => $this->t('Justifies the menu to the left, center, or right.'), + '#default_value' => ($headerConfig->get('nav_position')) ? $headerConfig->get('nav_position') : 'left', + '#attributes' => [ + 'class' => [ + 'variation-radios', + ], + ], + ]; + + $form['site_search_container']['enable_search_form'] = [ + '#type' => 'checkbox', + '#description' => $this->t('When enabled, a site search form will be displayed in the Utility Menu.'), + '#title' => $this->t('Enable search form'), + '#default_value' => $headerConfig->get('search.enable_search_form'), + '#states' => [ + 'invisible' => [ + ':input[name="header_variation"]' => ['value' => 'focus'], + ], + ], + ]; + + $form['full_screen_homepage_image_container']['focus_header_image'] = [ + '#type' => 'media_library', + '#allowed_bundles' => ['image'], + '#title' => $this->t('Homepage header image'), + '#required' => FALSE, + '#default_value' => ($headerConfig->get('focus_header_image')) ? $headerConfig->get('focus_header_image') : NULL, + '#description' => $this->t('Used for the full-screen homepage image when the Focus Header is selected.'), + ]; + + return $form; + } + + /** + * {@inheritdoc} + */ + public function validateForm(array &$form, FormStateInterface $form_state) { + if ($form_state->getValue('header_variation') == 'focus' && !$form_state->getValue('focus_header_image')) { + $form_state->setErrorByName( + 'focus_header_image', + $this->t("The homepage header image is required when Focus nav is selected") + ); + } + } + + /** + * Submit form action. + * + * @param array $form + * Form array. + * @param \Drupal\Core\Form\FormStateInterface $form_state + * Form state. + */ + public function submitForm(array &$form, FormStateInterface $form_state) { + + // Header settings config. + $headerConfig = $this->config('ys_core.header_settings'); + + // Handle the filesystem if needed. + $this->ysMediaManager->handleMediaFilesystem( + $form_state->getValue('site_name_image'), + $headerConfig->get('site_name_image') + ); + + $headerConfig->set('header_variation', $form_state->getValue('header_variation')); + $headerConfig->set('site_name_image', $form_state->getValue('site_name_image')); + $headerConfig->set('nav_position', $form_state->getValue('nav_position')); + $headerConfig->set('search.enable_search_form', $form_state->getValue('enable_search_form')); + $headerConfig->set('focus_header_image', $form_state->getValue('focus_header_image')); + + $headerConfig->save(); + + $this->cacheRender->invalidateAll(); + return parent::submitForm($form, $form_state); + } + + /** + * {@inheritdoc} + */ + protected function getEditableConfigNames() { + return [ + 'ys_core.header_settings', + ]; + } + + /** + * If current user is platform admin or user 1, allow secret items. + * + * @return bool + * Returns TRUE if current user is a platform admin or user 1. + */ + private function allowSecretItems() { + $allowSecretItems = FALSE; + + if ($this->currentUserSession->getAccount()->id() == 1 || in_array('platform_admin', $this->currentUserSession->getAccount()->getRoles())) { + $allowSecretItems = TRUE; + } + + return $allowSecretItems; + } + +} diff --git a/web/profiles/custom/yalesites_profile/modules/custom/ys_core/src/Form/SiteSettingsForm.php b/web/profiles/custom/yalesites_profile/modules/custom/ys_core/src/Form/SiteSettingsForm.php index 010ca52b41..0e57b2e3bb 100644 --- a/web/profiles/custom/yalesites_profile/modules/custom/ys_core/src/Form/SiteSettingsForm.php +++ b/web/profiles/custom/yalesites_profile/modules/custom/ys_core/src/Form/SiteSettingsForm.php @@ -10,7 +10,7 @@ use Drupal\Core\Routing\RequestContext; use Drupal\google_analytics\Constants\GoogleAnalyticsPatterns; use Drupal\path_alias\AliasManagerInterface; -use Drupal\ys_core\FaviconManager; +use Drupal\ys_core\YaleSitesMediaManager; use Symfony\Component\DependencyInjection\ContainerInterface; /** @@ -46,11 +46,11 @@ class SiteSettingsForm extends ConfigFormBase implements ContainerInjectionInter protected $requestContext; /** - * The favicon manager. + * The ys media manager. * - * @var \Drupal\ys_core\FaviconManager + * @var \Drupal\ys_core\YaleSitesMediaManager */ - protected $faviconManager; + protected $ysMediaManager; /** * Constructs a SiteInformationForm object. @@ -63,21 +63,21 @@ class SiteSettingsForm extends ConfigFormBase implements ContainerInjectionInter * The path validator. * @param \Drupal\Core\Routing\RequestContext $request_context * The request context. - * @param \Drupal\ys_core\FaviconManager $favicon_manager - * The favicon manager. + * @param \Drupal\ys_core\YaleSitesMediaManager $ys_media_manager + * The media manager. */ public function __construct( ConfigFactoryInterface $config_factory, AliasManagerInterface $alias_manager, PathValidatorInterface $path_validator, RequestContext $request_context, - FaviconManager $favicon_manager, + YaleSitesMediaManager $ys_media_manager, ) { parent::__construct($config_factory); $this->aliasManager = $alias_manager; $this->pathValidator = $path_validator; $this->requestContext = $request_context; - $this->faviconManager = $favicon_manager; + $this->ysMediaManager = $ys_media_manager; } /** @@ -89,7 +89,7 @@ public static function create(ContainerInterface $container) { $container->get('path_alias.manager'), $container->get('path.validator'), $container->get('router.request_context'), - $container->get('ys_core.favicon_manager'), + $container->get('ys_core.media_manager'), ); } @@ -185,13 +185,6 @@ public function buildForm(array $form, FormStateInterface $form_state) { '#default_value' => $yaleConfig->get('seo')['google_analytics_id'], ]; - $form['enable_search_form'] = [ - '#type' => 'checkbox', - '#description' => $this->t('Enable the search form located in the utility navigation area.'), - '#title' => $this->t('Enable search form'), - '#default_value' => $yaleConfig->get('search')['enable_search_form'], - ]; - $form['teaser_image_fallback'] = [ '#type' => 'media_library', '#allowed_bundles' => ['image'], @@ -215,6 +208,7 @@ public function buildForm(array $form, FormStateInterface $form_state) { '#default_value' => ($yaleConfig->get('custom_favicon')) ? $yaleConfig->get('custom_favicon') : NULL, '#theme' => 'image_widget', '#preview_image_style' => 'favicon_16x16', + '#use_preview' => TRUE, '#use_favicon_preview' => TRUE, ]; @@ -268,7 +262,7 @@ public function validateForm(array &$form, FormStateInterface $form_state) { public function submitForm(array &$form, FormStateInterface $form_state) { // Handle the favicon filesystem if needed. - $this->faviconManager->handleFaviconFilesystem( + $this->ysMediaManager->handleMediaFilesystem( $form_state->getValue('favicon'), $this->configFactory->getEditable('ys_core.site')->get('custom_favicon') ); @@ -283,7 +277,6 @@ public function submitForm(array &$form, FormStateInterface $form_state) { $this->configFactory->getEditable('ys_core.site') ->set('page.posts', $form_state->getValue('site_page_posts')) ->set('page.events', $form_state->getValue('site_page_events')) - ->set('search.enable_search_form', $form_state->getValue('enable_search_form')) ->set('seo.google_site_verification', $form_state->getValue('google_site_verification')) ->set('seo.google_analytics_id', $form_state->getValue('google_analytics_id')) ->set('image_fallback.teaser', $form_state->getValue('teaser_image_fallback')) diff --git a/web/profiles/custom/yalesites_profile/modules/custom/ys_core/src/Plugin/Block/YaleSitesDashboardResourcesBlock.php b/web/profiles/custom/yalesites_profile/modules/custom/ys_core/src/Plugin/Block/YaleSitesDashboardResourcesBlock.php deleted file mode 100644 index 24cadc873e..0000000000 --- a/web/profiles/custom/yalesites_profile/modules/custom/ys_core/src/Plugin/Block/YaleSitesDashboardResourcesBlock.php +++ /dev/null @@ -1,27 +0,0 @@ - 'ys_dashboard_resources', - ]; - } - -} diff --git a/web/profiles/custom/yalesites_profile/modules/custom/ys_core/src/Plugin/Block/YaleSitesFooterBlock.php b/web/profiles/custom/yalesites_profile/modules/custom/ys_core/src/Plugin/Block/YaleSitesFooterBlock.php index 361e53abf0..26197ca800 100644 --- a/web/profiles/custom/yalesites_profile/modules/custom/ys_core/src/Plugin/Block/YaleSitesFooterBlock.php +++ b/web/profiles/custom/yalesites_profile/modules/custom/ys_core/src/Plugin/Block/YaleSitesFooterBlock.php @@ -84,16 +84,18 @@ public function build() { foreach ($footerLogosConfig as $key => $logoData) { if ($logoData['logo']) { $footerLogoMedia = $this->entityTypeManager->getStorage('media')->load($logoData['logo']); - $footerLogoFileUri = $fileEntity->load($footerLogoMedia->field_media_image->target_id)->getFileUri(); - $footerLogosRender[$key]['url'] = $logoData['logo_url'] ?? NULL; - $footerLogosRender[$key]['logo'] = [ - '#type' => 'responsive_image', - '#responsive_image_style_id' => 'image_logos', - '#uri' => $footerLogoFileUri, - '#attributes' => [ - 'alt' => $footerLogoMedia->get('field_media_image')->first()->get('alt')->getValue(), - ], - ]; + if ($footerLogoMedia) { + $footerLogoFileUri = $fileEntity->load($footerLogoMedia->field_media_image->target_id)->getFileUri(); + $footerLogosRender[$key]['url'] = $logoData['logo_url'] ?? NULL; + $footerLogosRender[$key]['logo'] = [ + '#type' => 'responsive_image', + '#responsive_image_style_id' => 'image_logos', + '#uri' => $footerLogoFileUri, + '#attributes' => [ + 'alt' => $footerLogoMedia->get('field_media_image')->first()->get('alt')->getValue(), + ], + ]; + } } } } diff --git a/web/profiles/custom/yalesites_profile/modules/custom/ys_core/src/Plugin/Block/YaleSitesSupportFormBlock.php b/web/profiles/custom/yalesites_profile/modules/custom/ys_core/src/Plugin/Block/YaleSitesSupportFormBlock.php deleted file mode 100644 index dade0e5ba7..0000000000 --- a/web/profiles/custom/yalesites_profile/modules/custom/ys_core/src/Plugin/Block/YaleSitesSupportFormBlock.php +++ /dev/null @@ -1,83 +0,0 @@ -get('config.factory'), - $container->get('request_stack'), - $container->get('current_user'), - ); - } - - /** - * {@inheritdoc} - */ - public function __construct(array $configuration, $plugin_id, $plugin_definition, ConfigFactoryInterface $config_factory, RequestStack $request_stack, AccountInterface $account) { - parent::__construct($configuration, $plugin_id, $plugin_definition); - $this->siteSettings = $config_factory->get('system.site'); - $this->request = $request_stack->getCurrentRequest(); - $this->account = $account; - } - - /** - * {@inheritdoc} - */ - public function build() { - $userAgent = $_SERVER['HTTP_USER_AGENT']; - $siteURL = $this->request->getSchemeAndHttpHost(); - $siteName = $this->siteSettings->get('name'); - $currentUserName = $this->account->getAccountName(); - $currentUserRoles = implode(", ", $this->account->getRoles()); - return [ - '#theme' => 'ys_support_form', - '#link' => "https://yale.service-now.com/it?id=incident_form&prefill_u_business_service=e9688dcd6fbb31007ee2abcf9f3ee40c&prefill_u_category=b74b15c16ffb31007ee2abcf9f3ee4b3&prefill_short_description=Yalesites%20Service%20Request:%20{$siteURL}&prefill_description=Please%20enter%20your%20support%20request%20here:%0d%0d%0d%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%0dDiagnostic%20info%20(do%20not%20edit%20this%20section)%0dSite Name:%20{$siteName}%0dUser Name:%20{$currentUserName}%0dUser Roles:%20{$currentUserRoles}%0dUser-agent:%20{$userAgent}%0d%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D", - ]; - } - -} diff --git a/web/profiles/custom/yalesites_profile/modules/custom/ys_core/src/FaviconManager.php b/web/profiles/custom/yalesites_profile/modules/custom/ys_core/src/YaleSitesMediaManager.php similarity index 67% rename from web/profiles/custom/yalesites_profile/modules/custom/ys_core/src/FaviconManager.php rename to web/profiles/custom/yalesites_profile/modules/custom/ys_core/src/YaleSitesMediaManager.php index ad19a6d295..cebf578079 100644 --- a/web/profiles/custom/yalesites_profile/modules/custom/ys_core/src/FaviconManager.php +++ b/web/profiles/custom/yalesites_profile/modules/custom/ys_core/src/YaleSitesMediaManager.php @@ -10,9 +10,9 @@ use Symfony\Component\DependencyInjection\ContainerInterface; /** - * Service for managing the favicon associated with a YaleSite. + * Service for managing custom media associated with a YaleSite. */ -class FaviconManager extends ControllerBase implements ContainerInjectionInterface { +class YaleSitesMediaManager extends ControllerBase implements ContainerInjectionInterface { /** * Configuration Factory. @@ -21,6 +21,13 @@ class FaviconManager extends ControllerBase implements ContainerInjectionInterfa */ protected $yaleSettings; + /** + * Configuration Factory. + * + * @var \Drupal\Core\Config\ConfigFactoryInterface + */ + protected $siteSettings; + /** * The entity type manager. * @@ -51,6 +58,7 @@ public function __construct( FileUrlGenerator $file_url_generator ) { $this->yaleSettings = $config_factory->get('ys_core.site'); + $this->siteSettings = $config_factory->get('system.site'); $this->entityTypeManager = $entity_type_manager; $this->fileUrlGenerator = $file_url_generator; } @@ -141,33 +149,33 @@ public function getFavicons() { } /** - * Handles the creation and deletion of favicons in the filesystem. + * Handles the creation and deletion of custom media in the filesystem. * * @param array $formValue - * An array with the form value of the favicon selected, if any. + * An array with the form value of the media selected, if any. * @param array $configValue - * An array with the config value of the favicon saved, if any. + * An array with the config value of the media saved, if any. */ - public function handleFaviconFilesystem($formValue, $configValue) { - $faviconFormValue = $formValue ? $formValue[0] : NULL; - $faviconConfigValue = $configValue ? $configValue[0] : NULL; + public function handleMediaFilesystem($formValue, $configValue) { + $incomingFormValue = $formValue ? $formValue[0] : NULL; + $incomingConfigValue = $configValue ? $configValue[0] : NULL; - if ($faviconFormValue != $faviconConfigValue) { + if ($incomingFormValue != $incomingConfigValue) { $fileEntity = $this->entityTypeManager->getStorage('file'); - // First, delete any previously set favicons. - if ($faviconConfigValue) { + // First, delete any previously set media. + if ($incomingConfigValue) { /** @var \Drupal\file\Entity $file */ - $file = $fileEntity->load($faviconConfigValue); + $file = $fileEntity->load($incomingConfigValue); if ($file) { $file->delete(); } } - // Next, set the new favicon. - if ($faviconFormValue) { + // Next, set the new media. + if ($incomingFormValue) { /** @var \Drupal\file\Entity $file */ - $file = $fileEntity->load($faviconFormValue); + $file = $fileEntity->load($incomingFormValue); $file->setPermanent(); $file->save(); } @@ -175,4 +183,41 @@ public function handleFaviconFilesystem($formValue, $configValue) { } } + /** + * Gets SVG for the uploaded site name as image and adds site name as title. + * + * @param int $fid + * File ID. + * + * @return string + * SVG in raw form for use in twig templates. + */ + public function getSiteNameImage($fid) { + + /** @var \Drupal\file\Entity\File $file */ + if ($file = $this->entityTypeManager() + ->getStorage('file') + ->load($fid)) { + $title = $this->siteSettings->get('name'); + if (str_ends_with($file->getFilename(), '.svg')) { + $fileData = file_get_contents($file->getFileUri(), TRUE); + $titlePattern = "/]*>(.*?)<\\/title>/"; + + if (preg_match($titlePattern, $fileData)) { + // We have a title tag, let's replace it. + $replacement = "{$title}"; + $replacementSVG = preg_replace($titlePattern, $replacement, $fileData); + } + else { + // No title tag, so let's add one right below the opening svg tag. + $svgPattern = "/(]*>)/"; + $replacement = "$1\n{$title}"; + $replacementSVG = preg_replace($svgPattern, $replacement, $fileData); + } + + return $replacementSVG; + } + } + } + } diff --git a/web/profiles/custom/yalesites_profile/modules/custom/ys_core/templates/ys-dashboard-resources.html.twig b/web/profiles/custom/yalesites_profile/modules/custom/ys_core/templates/ys-dashboard-resources.html.twig deleted file mode 100644 index a59725ee42..0000000000 --- a/web/profiles/custom/yalesites_profile/modules/custom/ys_core/templates/ys-dashboard-resources.html.twig +++ /dev/null @@ -1,2 +0,0 @@ -

Resources

-A resource to help you create useful, usable websites. diff --git a/web/profiles/custom/yalesites_profile/modules/custom/ys_core/templates/ys-dashboard.html.twig b/web/profiles/custom/yalesites_profile/modules/custom/ys_core/templates/ys-dashboard.html.twig index a4f1f32a1b..7d012a6910 100644 --- a/web/profiles/custom/yalesites_profile/modules/custom/ys_core/templates/ys-dashboard.html.twig +++ b/web/profiles/custom/yalesites_profile/modules/custom/ys_core/templates/ys-dashboard.html.twig @@ -1,3 +1,32 @@
Welcome to the YaleSites dashboard. + {{ drupal_view('content', 'block_1') }} +

Resources

+ + +

Report Feedback or a Bug

+ + yalesitesupgradeprogram@yale.edu +
diff --git a/web/profiles/custom/yalesites_profile/modules/custom/ys_core/templates/ys-social-links.html.twig b/web/profiles/custom/yalesites_profile/modules/custom/ys_core/templates/ys-social-links.html.twig deleted file mode 100644 index b928583d93..0000000000 --- a/web/profiles/custom/yalesites_profile/modules/custom/ys_core/templates/ys-social-links.html.twig +++ /dev/null @@ -1,17 +0,0 @@ -{# - # Available Variables: - # - icons (array) - # - url: url the icon links to - # - name: Visually hidden text (for screen readers) - # - icon: the actual image - #} - - diff --git a/web/profiles/custom/yalesites_profile/modules/custom/ys_core/templates/ys-support-form.html.twig b/web/profiles/custom/yalesites_profile/modules/custom/ys_core/templates/ys-support-form.html.twig deleted file mode 100644 index 3b5c16152b..0000000000 --- a/web/profiles/custom/yalesites_profile/modules/custom/ys_core/templates/ys-support-form.html.twig +++ /dev/null @@ -1,6 +0,0 @@ -{# - # Available Variables: - # - link (string) - #} - -Start a Support Request diff --git a/web/profiles/custom/yalesites_profile/modules/custom/ys_core/ys_core.install b/web/profiles/custom/yalesites_profile/modules/custom/ys_core/ys_core.install new file mode 100644 index 0000000000..03a22614fc --- /dev/null +++ b/web/profiles/custom/yalesites_profile/modules/custom/ys_core/ys_core.install @@ -0,0 +1,115 @@ +accessCheck(FALSE) + ->condition('type', 'quick_links') + ->allRevisions(); + + $ids = $query->execute(); + $block_content_storage = \Drupal::entityTypeManager()->getStorage('block_content'); + + foreach ($ids as $revision_id => $id) { + $block = $block_content_storage->loadRevision($revision_id); + + if ($block && $block->id() == $id) { + $body = $block->get('field_text')->getValue(); + foreach ($body as $key => $array_value) { + $array_value = ys_core_sanitize_content( + $array_value, ['em', 'p', 'strong'] + ); + $array_value = ys_core_set_format($array_value, 'heading_html'); + + $body[$key] = $array_value; + } + $block->set('field_text', $body); + $block->save(); + } + } +} + +/** + * Implements hook_update(). + * + * This update will migrate old theme settings to the new header settings. + */ +function ys_core_update_9002() { + $ysCoreConfig = \Drupal::config('ys_core.site'); + $themeConfig = \Drupal::config('ys_themes.theme_settings'); + $headerConfig = \Drupal::service('config.factory')->getEditable('ys_core.header_settings'); + + // Migrate search setting from core to header. + if ($ysCoreConfig->get('search')) { + $oldSearchSetting = $ysCoreConfig->get('search')['enable_search_form']; + $headerConfig->set('search.enable_search_form', $oldSearchSetting)->save(); + } + + // Migrate nav_position setting from themes to header settings. + $oldNavPosition = $themeConfig->get('nav_position'); + if ($oldNavPosition) { + $headerConfig->set('nav_position', $oldNavPosition)->save(); + } + + // Migrate nav_type setting from themes to header settings header_variation. + $oldNavType = $themeConfig->get('nav_type'); + if ($oldNavType) { + $headerConfig->set('header_variation', $oldNavType)->save(); + } + +} + +/** + * Sanitizes the value of an array object with allowed_tags. + * + * @param array $content_array + * The content array. + * @param array $allowed_tags + * The allowed tags. + * + * @return array + * The sanitized content array. + */ +function ys_core_sanitize_content($content_array, $allowed_tags = []) { + if (!array_key_exists('value', $content_array)) { + return $content_array; + } + + $value = $content_array['value']; + $content_array['value'] = Xss::filter($value, $allowed_tags); + + return $content_array; +} + +/** + * Sets the format of an array object. + * + * @param array $content_array + * The content array. + * @param string $new_format + * The new format. + * + * @return array + * The content array with the new format. + */ +function ys_core_set_format($content_array, $new_format = 'heading_html') { + if (!array_key_exists('format', $content_array)) { + return $content_array; + } + + $content_array['format'] = $new_format; + + return $content_array; +} diff --git a/web/profiles/custom/yalesites_profile/modules/custom/ys_core/ys_core.libraries.yml b/web/profiles/custom/yalesites_profile/modules/custom/ys_core/ys_core.libraries.yml index 4d17465dec..149c9fb7a2 100644 --- a/web/profiles/custom/yalesites_profile/modules/custom/ys_core/ys_core.libraries.yml +++ b/web/profiles/custom/yalesites_profile/modules/custom/ys_core/ys_core.libraries.yml @@ -10,9 +10,9 @@ taxonomy_form: siteimprove: js: https://siteimproveanalytics.com/js/siteanalyze_66356571.js: { type: external, attributes: { async: true } } -footer_settings_form: +header_footer_settings: css: theme: - css/footer-settings-form.css: {} + css/header-footer-settings.css: {} js: - js/footer-settings.js: {} + js/header-footer-settings.js: {} diff --git a/web/profiles/custom/yalesites_profile/modules/custom/ys_core/ys_core.links.menu.yml b/web/profiles/custom/yalesites_profile/modules/custom/ys_core/ys_core.links.menu.yml index d522415283..ae094c457d 100644 --- a/web/profiles/custom/yalesites_profile/modules/custom/ys_core/ys_core.links.menu.yml +++ b/web/profiles/custom/yalesites_profile/modules/custom/ys_core/ys_core.links.menu.yml @@ -26,6 +26,13 @@ ys_core.admin_site_settings: route_name: ys_core.admin_site_settings title: "Site Settings" weight: 10 +# Header settings form. +ys_core.admin_header_settings: + description: "Header settings." + parent: ys_core.admin_yalesites + route_name: ys_core.admin_header_settings + title: "Header Settings" + weight: 15 # Footer settings form. ys_core.admin_footer_settings: description: "Footer settings." @@ -73,6 +80,14 @@ ys_core.taxonomy_interface_post_category: title: Post Category route_parameters: taxonomy_vocabulary: "post_category" +# Taxonomy interface - Profile Affiliation +ys_core.taxonomy_interface_affiliation: + description: "Manage profile affiliation taxonomy" + parent: ys_core.taxonomy_interface + route_name: entity.taxonomy_vocabulary.overview_form + title: Profile Affiliation + route_parameters: + taxonomy_vocabulary: "affiliation" # Taxonomy interface - Tags ys_core.taxonomy_interface_tags: description: "Manage tags taxonomy" diff --git a/web/profiles/custom/yalesites_profile/modules/custom/ys_core/ys_core.module b/web/profiles/custom/yalesites_profile/modules/custom/ys_core/ys_core.module index 5c62009014..6bc108e820 100644 --- a/web/profiles/custom/yalesites_profile/modules/custom/ys_core/ys_core.module +++ b/web/profiles/custom/yalesites_profile/modules/custom/ys_core/ys_core.module @@ -30,17 +30,9 @@ function ys_core_theme($existing, $type, $theme, $path): array { 'items' => [], ], ], - 'ys_support_form' => [ - 'variables' => [ - 'link' => NULL, - ], - ], 'ys_dashboard' => [ 'variables' => [], ], - 'ys_dashboard_resources' => [ - 'variables' => [], - ], 'ys_social_links' => [ 'variables' => [ 'icons' => [], @@ -146,9 +138,33 @@ function ys_core_preprocess_block(&$variables) { * Implements hook_preprocess_region(). */ function ys_core_preprocess_region(&$variables) { - $config = \Drupal::config('ys_core.site'); - if ($variables['elements']['#region'] == 'header' && $config->get('search')) { - $variables['utility_nav__search'] = $config->get('search')['enable_search_form']; + $config = \Drupal::config('ys_core.header_settings'); + if ($variables['elements']['#region'] == 'header') { + $variables['utility_nav__search'] = ($config->get('search')) ? $config->get('search')['enable_search_form'] : NULL; + + // Responsive image render array for focus header image. + if ($focusHeaderImageId = $config->get('focus_header_image')) { + $focusHeaderImageMedia = \Drupal::service('entity_type.manager')->getStorage('media')->load($focusHeaderImageId); + $fileEntity = \Drupal::service('entity_type.manager')->getStorage('file'); + $focusHeaderImageFileUri = $fileEntity->load($focusHeaderImageMedia->field_media_image->target_id)->getFileUri(); + $focusHeaderImageRender = [ + '#type' => 'responsive_image', + '#responsive_image_style_id' => 'background_image_focus_header', + '#uri' => $focusHeaderImageFileUri, + '#attributes' => [ + 'alt' => $focusHeaderImageMedia->get('field_media_image')->first()->get('alt')->getValue(), + ], + ]; + + $path = \Drupal::service('path.current')->getPath(); + $alias = \Drupal::service('path_alias.manager')->getAliasByPath($path); + $frontPage = \Drupal::config('system.site')->get('page.front'); + + // See if the path is the front page. + $isFrontPage = ($alias == $frontPage || $path == $frontPage || \Drupal::service('path.matcher')->isFrontPage()); + $variables['site_header__background_image'] = $isFrontPage ? $focusHeaderImageRender : FALSE; + } + } } @@ -225,6 +241,11 @@ function ys_core_help($route_name, RouteMatchInterface $route_match) { $output = '

' . t('Taxonomy is used to classify website content into groups called vocabularies. Each vocabulary contains a set of terms used to categorize content. For example, an "Event Type" vocabulary contains terms like "Online" and "In-Person". This allows for easy categorization and organization of content on a website.') . '

'; return $output; + + case 'entity.block_content.collection': + + $output = '

' . t('Blocks are used for reusable content. Create global blocks here, and they will show up in layout builder at the bottom of the list under a reusable section to place on any page. If the block is updated here, the content will be updated anywhere the block is used.') . '

'; + return $output; } } @@ -239,7 +260,7 @@ function ys_core_page_attachments(array &$page) { } // Custom or fallback favicons. - $favicons = \Drupal::service('ys_core.favicon_manager')->getFavicons(); + $favicons = \Drupal::service('ys_core.media_manager')->getFavicons(); foreach ($favicons as $name => $favicon) { $page['#attached']['html_head'][] = [$favicon, $name]; } @@ -258,7 +279,7 @@ function ys_core_preprocess_image_widget(&$variables) { */ $element = $variables['element']; - if (isset($element['#use_favicon_preview'])) { + if (isset($element['#use_preview'])) { $variables['attributes'] = [ 'class' => [ @@ -322,7 +343,8 @@ function ys_core_preprocess_image_widget(&$variables) { // Sets a twig variable to use the favicon preview. // @see web/themes/custom/ys_admin_theme/templates/content-edit/image-widget.html.twig - $variables['use_favicon_preview'] = $element['#use_favicon_preview']; + $variables['use_favicon_preview'] = $element['#use_favicon_preview'] ?? NULL; + $variables['use_svg_preview'] = $element['#use_svg_preview'] ?? NULL; $variables['data'] = []; foreach (Element::children($element) as $child) { @@ -431,3 +453,14 @@ function _ys_core_get_link(FormStateInterface $form_state) { /** * End allow menu item extras fields to be included on node add and edit forms. */ + +/** + * Implements hook_preprocess_page(). + */ +function ys_core_preprocess_page(&$variables) { + // Add the cache tag, so that the theme setting information is rebuilt + // when the config is saved. + // Via: https://drupal.stackexchange.com/questions/266379/how-to-clear-cache-for-config-entity-after-making-changes + $config = \Drupal::config('ys_core.header_settings'); + \Drupal::service('renderer')->addCacheableDependency($variables, $config); +} diff --git a/web/profiles/custom/yalesites_profile/modules/custom/ys_core/ys_core.routing.yml b/web/profiles/custom/yalesites_profile/modules/custom/ys_core/ys_core.routing.yml index 58cbd5a08d..6b5b2a0730 100644 --- a/web/profiles/custom/yalesites_profile/modules/custom/ys_core/ys_core.routing.yml +++ b/web/profiles/custom/yalesites_profile/modules/custom/ys_core/ys_core.routing.yml @@ -14,6 +14,14 @@ ys_core.admin_site_settings: _title: 'Site Settings' requirements: _permission: 'yalesites manage settings' +# Header settings form. +ys_core.admin_header_settings: + path: '/admin/yalesites/header' + defaults: + _form: 'Drupal\ys_core\Form\HeaderSettingsForm' + _title: 'Header Settings' + requirements: + _permission: 'yalesites manage settings' # Footer settings form. ys_core.admin_footer_settings: path: '/admin/yalesites/footer' diff --git a/web/profiles/custom/yalesites_profile/modules/custom/ys_core/ys_core.services.yml b/web/profiles/custom/yalesites_profile/modules/custom/ys_core/ys_core.services.yml index 4911ae2a7a..8b1ded2e1f 100644 --- a/web/profiles/custom/yalesites_profile/modules/custom/ys_core/ys_core.services.yml +++ b/web/profiles/custom/yalesites_profile/modules/custom/ys_core/ys_core.services.yml @@ -9,9 +9,9 @@ services: # Twig functions for passing core settings to templates. ys_core.core_twig_extension: class: Drupal\ys_core\CoreTwigExtension - arguments: ['@config.factory'] + arguments: ['@config.factory', '@ys_core.media_manager'] tags: - { name: twig.extension } - ys_core.favicon_manager: - class: Drupal\ys_core\FaviconManager + ys_core.media_manager: + class: Drupal\ys_core\YaleSitesMediaManager arguments: ['@config.factory', '@entity_type.manager', '@file_url_generator'] diff --git a/web/profiles/custom/yalesites_profile/modules/custom/ys_layouts/README.md b/web/profiles/custom/yalesites_profile/modules/custom/ys_layouts/README.md new file mode 100644 index 0000000000..b53a6890de --- /dev/null +++ b/web/profiles/custom/yalesites_profile/modules/custom/ys_layouts/README.md @@ -0,0 +1,4 @@ +# YaleSites Layouts + +## Description +The layouts module organizes work related to YaleSite's implementation of Layout Builder. This includes the definition of custom layouts including the banner, page meta, and two column sections. diff --git a/web/profiles/custom/yalesites_profile/modules/custom/ys_layouts/templates/ys-profile-meta-block.html.twig b/web/profiles/custom/yalesites_profile/modules/custom/ys_layouts/templates/ys-profile-meta-block.html.twig index e8367a811d..698f910ced 100644 --- a/web/profiles/custom/yalesites_profile/modules/custom/ys_layouts/templates/ys-profile-meta-block.html.twig +++ b/web/profiles/custom/yalesites_profile/modules/custom/ys_layouts/templates/ys-profile-meta-block.html.twig @@ -1,7 +1,7 @@ {% embed '@molecules/meta/profile-meta/yds-profile-meta.twig' %} {% block profile__image %} {% if media_id %} - {{ drupal_entity('media', media_id, 'card_secondary_3_2') }} + {{ drupal_entity('media', media_id, 'banner_profile') }} {% endif %} {% endblock %} {% endembed %} diff --git a/web/profiles/custom/yalesites_profile/modules/custom/ys_mail/README.md b/web/profiles/custom/yalesites_profile/modules/custom/ys_mail/README.md index 5480d71253..81cb49613b 100644 --- a/web/profiles/custom/yalesites_profile/modules/custom/ys_mail/README.md +++ b/web/profiles/custom/yalesites_profile/modules/custom/ys_mail/README.md @@ -1,25 +1,3 @@ # YaleSites Mail -This module customizes emails sent from sites on the YaleSites platform. - -This includes: - -- Setting the MailChimp API from a value stored in a Terminus secrets file. -- Disabling the MailChimp API key field to improve the admin interface. -- Altering email metadata to ensure useful data is sent to MailChimp. - -## Requirements - -A MailChimp API key must be set in a `secrets.json` file to use the -transactional email service. After enabling this module, verify that -the api key is set. - -```bash -lando drush config-get mailchimp_transactional.settings mailchimp_transactional_api_key --include-overridden -``` - -If this file is missing, then pull the latest files into the local environment. - -```bash -lando pull --database=none --files=dev --code=none -``` +The YaleSites Mail module ensures all sites on the platform have the MailChimp transactional email handling setup in a consistant way. Currently this module is only used to obfuscate the API keys within the Drupal admin interface and make minor changes to email handling. \ No newline at end of file diff --git a/web/profiles/custom/yalesites_profile/modules/custom/ys_node_access/README.md b/web/profiles/custom/yalesites_profile/modules/custom/ys_node_access/README.md new file mode 100644 index 0000000000..912f8b47cc --- /dev/null +++ b/web/profiles/custom/yalesites_profile/modules/custom/ys_node_access/README.md @@ -0,0 +1,4 @@ +# YaleSites Node Access + +## Description +The YaleSites Node Access module offers a flexible mechanism that allows site authors to control access to the canonical view of a node exclusively for CAS authenticated users. This feature serves as a valuable tool for selectively restricting access to specific page content. However, it is important to note that this module is not intended to function as a secure repository for sensitive content. Other mechanisms within the platform may still expose assets and metadata associated with these nodes to users who are not authenticated, which means that sensitive content should be handled through alternative, more secure means. diff --git a/web/profiles/custom/yalesites_profile/modules/custom/ys_node_access/ys_node_access.module b/web/profiles/custom/yalesites_profile/modules/custom/ys_node_access/ys_node_access.module index 2b7c149696..f8bac38612 100644 --- a/web/profiles/custom/yalesites_profile/modules/custom/ys_node_access/ys_node_access.module +++ b/web/profiles/custom/yalesites_profile/modules/custom/ys_node_access/ys_node_access.module @@ -40,6 +40,8 @@ function ys_node_access_node_grants($account, $op) { */ function ys_node_access_node_access_records($node) { + $private = FALSE; + $nodeAccessManager = new NodeAccessManager(); // Saving a node, check login required field to set the appropriate grants. if ($node->hasField('field_login_required')) { diff --git a/web/profiles/custom/yalesites_profile/modules/custom/ys_secrets/README.md b/web/profiles/custom/yalesites_profile/modules/custom/ys_secrets/README.md index ce93feb29a..478ff77bc9 100644 --- a/web/profiles/custom/yalesites_profile/modules/custom/ys_secrets/README.md +++ b/web/profiles/custom/yalesites_profile/modules/custom/ys_secrets/README.md @@ -1,29 +1,3 @@ # YaleSites Secrets Mannager -The YaleSites upstream project and all of its configurations are stored in a -public repository. As a result sensative information such as API keys are stored -in the Pantheon secrets.json file instead of the standard Drupal config YAML -files. Utilities in this module help to load API keys from the secrets file at -runtime. - -## How to add a secret API key to the platform - -Step 1. Within the Drupal interface add a fake API key with the value 'HIDDEN'. -Config-export the changes to store the value as stagged configuration. For -example, see: web/profiles/custom/yalesites_profile/config/sync/mailchimp_transactional.settings.yml - -Step 2. Disable the API key field within the Drupal interface using a -ys_mail_form_FORM_ID_alter() so that future site builders are not confused by -the 'HIDDEN' value. The `disableField` method is useful for disabling the field. -It is not obvious when Drupal's config-override system is being used to replace -a value so we want to leave clues for future developers. For example, see -ys_mail_form_mailchimp_transactional_admin_settings_alter() - -Step 3. Set the API key in the appropriate Pantheon environment. This will -require the [Terminus Secrets Plugin](https://github.com/pantheon-systems/terminus-secrets-plugin). -Following the format: `terminus secrets:set site.env key value` - -Step 4. Create a class to override Drupal configuration with values stored in -the secrets.json file. This class will map the name of the configuration in -Drupal with the key in the secrets.json file. See example: -Drupal/ys_mail/Config/MailConfigOverrides +This module is no longer used and can be removed once all sites adopt the new environmented variables. diff --git a/web/profiles/custom/yalesites_profile/modules/custom/ys_themes/README.md b/web/profiles/custom/yalesites_profile/modules/custom/ys_themes/README.md index 3e9ca02834..afe37cf78f 100644 --- a/web/profiles/custom/yalesites_profile/modules/custom/ys_themes/README.md +++ b/web/profiles/custom/yalesites_profile/modules/custom/ys_themes/README.md @@ -1,4 +1,10 @@ # YaleSites Themes -This module is used to support YaleSites themes. This includes functionality -that allows site owners to override global theme settings. +## Description +The YaleSites Themes module empowers site administrators with a suite of features that put them in control of their website's visual identity. Our primary objective is to offer site owners the tools they need to personalize the look and feel of their websites. This feature-rich module not only enhances customization capabilities but also instills confidence in site owners, enabling them to make informed decisions and achieve their desired outcomes. + +## Features +- **Levers**: This module introduces a user-friendly theme settings form accessible via the admin toolbar. This intuitive form opens in a modal dialog and guides site owners through the process of selecting site colors from a curated set of palettes. Additionally, it provides control over other site-wide settings, influencing the global styling of the website. The tool's preview functionality allows authors to visualize theme settings before implementation, ensuring their decisions align with their vision. +- **Dials**: The module offers granular control over theme settings at the level of individual components. Site authors can fine-tune background colors, layouts, and orientations of these components, providing them with the flexibility to craft their unique narrative and visual experience. +- **Theme Settings Management**: This module streamlines the organization of theme settings and incorporates them into the code as data attributes and CSS custom variables. This approach enhances the maintainability and consistency of the theme settings, making it easier for developers to manage and customize the site's visual elements. +- **Install Configuration**: The module houses default values for theme-related configuration files used during the creation of new sites on the platform. While technically not mandatory, maintaining these install files is considered a best practice, as they ensure consistency and serve as a reference point for values that should ideally reside in the profile's config/sync directory. diff --git a/web/profiles/custom/yalesites_profile/modules/custom/ys_themes/config/install/ys_themes.component_overrides.yml b/web/profiles/custom/yalesites_profile/modules/custom/ys_themes/config/install/ys_themes.component_overrides.yml index e19238552b..5903b9dcf4 100644 --- a/web/profiles/custom/yalesites_profile/modules/custom/ys_themes/config/install/ys_themes.component_overrides.yml +++ b/web/profiles/custom/yalesites_profile/modules/custom/ys_themes/config/install/ys_themes.component_overrides.yml @@ -5,6 +5,11 @@ callout: two: Two three: Three default: one + field_style_alignment: + values: + left: Left + center: Center + default: center cta_banner: field_style_color: values: @@ -106,3 +111,9 @@ divider: '50%': 50 '25%': 25 default: 100% +text: + field_style_variation: + values: + default: 'Default' + emphasized: 'Emphasized' + default: default diff --git a/web/profiles/custom/yalesites_profile/modules/custom/ys_themes/config/install/ys_themes.theme_settings.yml b/web/profiles/custom/yalesites_profile/modules/custom/ys_themes/config/install/ys_themes.theme_settings.yml index 94be8c3cf1..8ab22d91b2 100644 --- a/web/profiles/custom/yalesites_profile/modules/custom/ys_themes/config/install/ys_themes.theme_settings.yml +++ b/web/profiles/custom/yalesites_profile/modules/custom/ys_themes/config/install/ys_themes.theme_settings.yml @@ -1,5 +1,3 @@ -nav_position: 'left' -nav_type: 'basic' header_theme: 'one' header_accent: 'one' footer_theme: 'one' diff --git a/web/profiles/custom/yalesites_profile/modules/custom/ys_themes/src/ThemeSettingsManager.php b/web/profiles/custom/yalesites_profile/modules/custom/ys_themes/src/ThemeSettingsManager.php index acb7e0130d..486d74881a 100644 --- a/web/profiles/custom/yalesites_profile/modules/custom/ys_themes/src/ThemeSettingsManager.php +++ b/web/profiles/custom/yalesites_profile/modules/custom/ys_themes/src/ThemeSettingsManager.php @@ -46,37 +46,6 @@ class ThemeSettingsManager { ], ], ], - 'nav_position' => [ - 'name' => 'Navigation Position', - 'prop_type' => 'element', - 'selector' => '[data-site-header-nav-position]', - 'default' => 'left', - 'values' => [ - 'right' => [ - 'label' => 'Right', - ], - 'center' => [ - 'label' => 'Center', - ], - 'left' => [ - 'label' => 'Left', - ], - ], - ], - 'nav_type' => [ - 'name' => 'Navigation Type', - 'prop_type' => 'element', - 'selector' => '[data-menu-variation]', - 'default' => 'mega', - 'values' => [ - 'mega' => [ - 'label' => 'Mega Menu', - ], - 'basic' => [ - 'label' => 'Basic Menu', - ], - ], - ], 'button_theme' => [ 'name' => 'Button Theme', 'prop_type' => 'element', diff --git a/web/profiles/custom/yalesites_profile/modules/custom/ys_themes/ys_themes.install b/web/profiles/custom/yalesites_profile/modules/custom/ys_themes/ys_themes.install index 905e360c5f..92feb91c47 100644 --- a/web/profiles/custom/yalesites_profile/modules/custom/ys_themes/ys_themes.install +++ b/web/profiles/custom/yalesites_profile/modules/custom/ys_themes/ys_themes.install @@ -43,3 +43,20 @@ function ys_themes_update_9001() { } } + +/** + * Implements hook_update(). + * + * This update will migrate old footer setting theme four to theme one. + */ +function ys_themes_update_9002() { + $themeConfig = \Drupal::service('config.factory')->getEditable('ys_themes.theme_settings'); + + // Migrate search setting from core to header. + if ($themeConfig->get('footer_theme')) { + if ($themeConfig->get('footer_theme') == 'four') { + $themeConfig->set('footer_theme', 'one')->save(); + } + } + +} diff --git a/web/profiles/custom/yalesites_profile/modules/custom/ys_themes/ys_themes.module b/web/profiles/custom/yalesites_profile/modules/custom/ys_themes/ys_themes.module index ecbe62fc91..50598818e1 100644 --- a/web/profiles/custom/yalesites_profile/modules/custom/ys_themes/ys_themes.module +++ b/web/profiles/custom/yalesites_profile/modules/custom/ys_themes/ys_themes.module @@ -258,10 +258,14 @@ function ys_themes_preprocess_form_element(array &$variables) { // Sets various values related to current element as well as global theme // to twig for cleaner twig templates. - $variables['label']['color_theme'] = $allOptions[$elementName]['values'][$value]['color_theme']; - $variables['label']['color_theme_2'] = $allOptions[$elementName]['values'][$value]['color_theme_2']; - $variables['label']['current_global_theme'] = $globalTheme; - $variables['label']['value'] = $value; + if (isset($allOptions[$elementName]['values'][$value]['color_theme'])) { + $variables['label']['#context']['color_theme'] = $allOptions[$elementName]['values'][$value]['color_theme']; + } + if (isset($allOptions[$elementName]['values'][$value]['color_theme_2'])) { + $variables['label']['#context']['color_theme_2'] = $allOptions[$elementName]['values'][$value]['color_theme_2']; + } + $variables['label']['#context']['current_global_theme'] = $globalTheme; + $variables['label']['#context']['value'] = $value; } } } diff --git a/web/profiles/custom/yalesites_profile/modules/custom/ys_toolbar/README.md b/web/profiles/custom/yalesites_profile/modules/custom/ys_toolbar/README.md new file mode 100644 index 0000000000..6cb3306987 --- /dev/null +++ b/web/profiles/custom/yalesites_profile/modules/custom/ys_toolbar/README.md @@ -0,0 +1,8 @@ +# YaleSites Toolbar + +## Description +The YaleSites Toolbar module enhances the Drupal Admin toolbar, tailored to empower site owners in managing their websites effectively. This module integrates with and builds upon the Toolbar and Gin Toolbar modules, customizing the authoring experience for the YaleSites community. + +## Features +- **Enhanced Local Task Links**: The module introduces a collection of new local task links, offering quick access to essential functions such as editing, publishing, unpublishing, and changing the layout of a node. These links provide a consistent and efficient toolset for site authors, simplifying common tasks and streamlining content management. +- **Labels and Icons**: To enhance usability and user understanding, several toolbar items receive refreshed names and icons. This thoughtful approach establishes a standardized naming convention that aligns with Yale's training practices, ensuring that all authors have a clear grasp of content management intricacies. diff --git a/web/profiles/custom/yalesites_profile/modules/custom/ys_views_basic/README.md b/web/profiles/custom/yalesites_profile/modules/custom/ys_views_basic/README.md new file mode 100644 index 0000000000..128e633bb3 --- /dev/null +++ b/web/profiles/custom/yalesites_profile/modules/custom/ys_views_basic/README.md @@ -0,0 +1,10 @@ +# YaleSites Views Basic + +## Description +The View Basic module is a custom utility, built on Drupal Views, that gives advanced users with the ability to generate dynamic content lists based on content metadata. This feature lets users curate the collections of news, events, people, and pages across various sections of their website more effectively. This module serves as a valuable resource for authors seeking to create multiple content streams, leveraging taxonomy and other filters to tailor their content displays. It gives them the ability to create custom queries with little training and in a no-code interface. + +## Features +- **Field Plugin**: Data describing a view is stored within a custom schema as a serialized object. This modular design allows for seamless addition and removal of features without compromising metadata storage integrity. +- **Field Widget**: Users interact with a specialized form for constructing queries and render logic using a user-friendly, no-code interface. Natural language and intuitive icons simplify query building, requiring minimal training for authors. +- **Field Formatter**: Metadata is rendered consistently through custom templates, blocks, display modes, and a Drupal View. This consistency ensures that content creators construct Views that align with the YaleSites Design System. +- **View Plugins**: The module incorporates numerous view plugins that interpret view definitions into sorts, filters, pagers, and styles compatible with the core Drupal Views module, enhancing functionality and flexibility. diff --git a/web/profiles/custom/yalesites_profile/modules/custom/ys_views_basic/ys_views_basic.module b/web/profiles/custom/yalesites_profile/modules/custom/ys_views_basic/ys_views_basic.module index 68bdd1bfe1..e174d2a6ad 100644 --- a/web/profiles/custom/yalesites_profile/modules/custom/ys_views_basic/ys_views_basic.module +++ b/web/profiles/custom/yalesites_profile/modules/custom/ys_views_basic/ys_views_basic.module @@ -59,3 +59,14 @@ function ys_views_basic_views_data_alter(array &$data) { ]; } + +/** + * Implements hook_views_pre_build(). + */ +function ys_views_basic_views_pre_build($view) { + static $counter = 0; + + if (empty($view->dom_id)) { + $view->dom_id = "view_" . $counter++; + } +} diff --git a/web/profiles/custom/yalesites_profile/yalesites_profile.info.yml b/web/profiles/custom/yalesites_profile/yalesites_profile.info.yml index fcbb53f4d6..3818e01ef7 100644 --- a/web/profiles/custom/yalesites_profile/yalesites_profile.info.yml +++ b/web/profiles/custom/yalesites_profile/yalesites_profile.info.yml @@ -1,6 +1,6 @@ name: YaleSites Profile type: profile -version: 1.0 +#version: description: 'Install profile for managing YaleSites platform sites.' core_version_requirement: '^9 || ^10' diff --git a/web/themes/custom/ys_admin_theme/css/admin-ui.css b/web/themes/custom/ys_admin_theme/css/admin-ui.css index ebc9ff0b2b..678e19799b 100644 --- a/web/themes/custom/ys_admin_theme/css/admin-ui.css +++ b/web/themes/custom/ys_admin_theme/css/admin-ui.css @@ -1,3 +1,8 @@ +:root { + --drupal-displace-offset-top: 35rem; + --drupal-displace-offset-bottom: 35rem; +} + .media-library-edit__link { overflow: hidden; color: transparent !important; diff --git a/web/themes/custom/ys_admin_theme/css/admin-ui.css.map b/web/themes/custom/ys_admin_theme/css/admin-ui.css.map index a7ca5589a1..91a4e84f60 100644 --- a/web/themes/custom/ys_admin_theme/css/admin-ui.css.map +++ b/web/themes/custom/ys_admin_theme/css/admin-ui.css.map @@ -1 +1 @@ -{"version":3,"sourceRoot":"","sources":["../scss/admin-ui.scss"],"names":[],"mappings":"AAAA;EACE;EACA;;;AAGF;EACE","file":"admin-ui.css"} \ No newline at end of file +{"version":3,"sourceRoot":"","sources":["../scss/admin-ui.scss"],"names":[],"mappings":"AAAA;EAEE;EACA;;;AAGF;EACE;EACA;;;AAGF;EACE","file":"admin-ui.css"} \ No newline at end of file diff --git a/web/themes/custom/ys_admin_theme/scss/admin-ui.scss b/web/themes/custom/ys_admin_theme/scss/admin-ui.scss index 607b9e4d8d..13b00416f5 100644 --- a/web/themes/custom/ys_admin_theme/scss/admin-ui.scss +++ b/web/themes/custom/ys_admin_theme/scss/admin-ui.scss @@ -1,3 +1,9 @@ +:root { + // Set drupal displace variables for ckeditor5. + --drupal-displace-offset-top: 35rem; + --drupal-displace-offset-bottom: 35rem; +} + .media-library-edit__link { overflow: hidden; color: transparent !important; diff --git a/web/themes/custom/ys_admin_theme/templates/content-edit/file-managed-file--svg.html.twig b/web/themes/custom/ys_admin_theme/templates/content-edit/file-managed-file--svg.html.twig new file mode 100644 index 0000000000..818cb54485 --- /dev/null +++ b/web/themes/custom/ys_admin_theme/templates/content-edit/file-managed-file--svg.html.twig @@ -0,0 +1,67 @@ +{# +/** + * @file + * Theme override to display a file form widget. + * + * Available variables: + * - main_items: Main render elements of the file or image widget: + * file name, upload input, upload and remove buttons and hidden inputs. + * - data: Other render elements of the image widget like preview, alt or title, + * or the description input and the display checkbox of the file widget. + * - display: A flag indicating whether the display field is visible. + * - attributes: HTML attributes for the containing element. + * - multiple: Whether this widget is the part of a multi-value file widget or + * not. + * - upload: Whether the file upload input is displayed or not. + * - has_value: true if the widget already contains a file. + * - has_meta: true when the display checkbox or the description, alt or title + * inputs are enabled and at least one of them is visible. + * + * @see template_preprocess_file_managed_file() + * @see claro_preprocess_file_managed_file() + */ +#} +{% + set classes = [ + 'js-form-managed-file', + 'form-managed-file', + multiple ? 'is-multiple' : 'is-single', + upload ? 'has-upload' : 'no-upload', + has_value ? 'has-value' : 'no-value', + has_meta ? 'has-meta' : 'no-meta', + ] +%} + +
+ {{ main_items.filename }} + {{ main_items|without('filename') }} +
+ + {% if has_meta or data.preview %} +
+
+ {% if data.preview %} +
+
+ Currently selected site name image +
+
+ {% endif %} + + {% if data.description or display or data.alt or data.title %} +
+ {{ data.description }} + {% if display %} + {{ data.display }} + {% endif %} + {{ data.alt }} + {{ data.title }} +
+ {% endif %} +
+
+ {% endif %} + + {# Every third-party addition will be rendered here. #} + {{ data|without('preview', 'alt', 'title', 'description', 'display') }} + diff --git a/web/themes/custom/ys_admin_theme/templates/content-edit/image-widget.html.twig b/web/themes/custom/ys_admin_theme/templates/content-edit/image-widget.html.twig index 1cfa01fa4e..a97bc8558c 100644 --- a/web/themes/custom/ys_admin_theme/templates/content-edit/image-widget.html.twig +++ b/web/themes/custom/ys_admin_theme/templates/content-edit/image-widget.html.twig @@ -26,9 +26,10 @@ it will load the default Claro version #} {% if use_favicon_preview %} {% include 'file-managed-file--favicon.html.twig' %} +{% elseif use_svg_preview %} + {% include 'file-managed-file--svg.html.twig' %} {% else %} {% include 'file-managed-file.html.twig' %} {% endif %} {% set attributes = attributes.addClass('form-managed-file--image') %} - diff --git a/web/themes/custom/ys_admin_theme/templates/ys/ys-dashboard-resources.html.twig b/web/themes/custom/ys_admin_theme/templates/ys/ys-dashboard-resources.html.twig deleted file mode 100644 index 904eaa59f5..0000000000 --- a/web/themes/custom/ys_admin_theme/templates/ys/ys-dashboard-resources.html.twig +++ /dev/null @@ -1,18 +0,0 @@ -

Resources

- - diff --git a/web/themes/custom/ys_admin_theme/templates/ys/ys-dashboard.html.twig b/web/themes/custom/ys_admin_theme/templates/ys/ys-dashboard.html.twig deleted file mode 100644 index c2460ac46f..0000000000 --- a/web/themes/custom/ys_admin_theme/templates/ys/ys-dashboard.html.twig +++ /dev/null @@ -1,6 +0,0 @@ -
- Welcome to the YaleSites dashboard. - {{ drupal_view('content', 'block_1') }} - {{ drupal_block('dashboard_resources_block') }} - {{ drupal_block('support_form_block') }} -