Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release #520

Merged
merged 127 commits into from
Jan 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
127 commits
Select commit Hold shift + click to select a range
854f4e8
fix (YALB-1579): fixing theme form errors
nJim Oct 5, 2023
7dc480b
fix (YALB-1577): fix time format on condenced events
nJim Oct 5, 2023
0877512
chore: add default values for theme settings
nJim Oct 5, 2023
449677a
feat(YALB-1563): WIP Header settings form
codechefmarc Oct 6, 2023
3db4f94
refactor(YALB-1563): Refactor to allow styles and JS to be used on bo…
codechefmarc Oct 7, 2023
78686c9
fix (YALB-863): set default callbacks for all dials
nJim Oct 7, 2023
77838ce
chore(YALB-1565): set ga cookie_domain to subdomain scope (#451)
vinmassaro Oct 10, 2023
0d0b2f2
feat(YALB-1674): Add more items to the header settings form and start…
codechefmarc Oct 12, 2023
f77f97b
feat(YALB-1574): WIP start validation code for SVG
codechefmarc Oct 12, 2023
61eaded
feat(YALB-1574): Refactor some existing classes to use in header sett…
codechefmarc Oct 13, 2023
f3155b9
YALB-1443: Bug: Disable links in quicklink content field (#431)
dblanken-yale Oct 17, 2023
462d36b
Merge branch 'develop' into YALB-1579-errors
dblanken-yale Oct 18, 2023
75fa6d4
Merge branch 'develop' into YALB-1577-event-date-bug
dblanken-yale Oct 18, 2023
aa0b7e3
Merge branch 'develop' into YALB-863-defaults
dblanken-yale Oct 18, 2023
9fd2692
Merge pull request #458 from yalesites-org/YALB-863-defaults
nJim Oct 18, 2023
3e5eedc
Merge pull request #453 from yalesites-org/YALB-1577-event-date-bug
nJim Oct 18, 2023
d27f2ea
Merge pull request #452 from yalesites-org/YALB-1579-errors
nJim Oct 18, 2023
9727383
feat(YALB-1242): allow localdev to use pantheon secrets
vinmassaro Oct 19, 2023
77670d3
docs(YALB-1204): updating all custom module readme files
nJim Oct 19, 2023
5513986
docs(YALB-1155): Add data model best practices do developer Readme file
nJim Oct 19, 2023
d772d58
ci: add YALESITES_BUILD_TOKEN to semantic release action
vinmassaro Oct 20, 2023
cf08000
YALB-1472: Bug: Image generation failures (#423)
dblanken-yale Oct 23, 2023
49e6f97
YALB-1593: Bug: FE: Views pagination not showing on front end (#462)
dblanken-yale Oct 24, 2023
87e7758
Merge branch 'develop' into YALB-1563-simple-header
codechefmarc Oct 26, 2023
d77b471
feat(YALB-1574): WIP add dynamic title tag to uploaded SVG
codechefmarc Oct 27, 2023
f46dd4e
feat(YALB-1574): Move SVG logic into mediaManager
codechefmarc Oct 27, 2023
d29f3df
feat(YALB-1563): Wiring of new header settings and migration of confi…
codechefmarc Oct 28, 2023
8df0bd5
feat(YALB-1574): Wire site name as image and move SVG title to an on-…
codechefmarc Oct 30, 2023
3178f9b
docs(YALB-1574): fix linting and comments
codechefmarc Oct 30, 2023
d1c9ff7
fix(YALB-1574): Fix linting error
codechefmarc Oct 30, 2023
c3bb69c
fix(YALB-1563): Remove unused use statement
codechefmarc Oct 30, 2023
ffe6590
feat(YALB-1574): Update old footer theme setting four to one as four …
codechefmarc Oct 31, 2023
bfaa364
YALB-1387: WYSIWYG: Clarity on maxlength (#474)
dblanken-yale Nov 14, 2023
07e8343
fix(YALB-1593): add new image sizes and responsive image styles for 1…
joetower Nov 14, 2023
76e0b62
Update develop from master (#482)
vinmassaro Nov 17, 2023
b49afee
Merge branch 'develop' into YALB-1563-simple-header
nJim Nov 17, 2023
bdb0fdf
feat(YALB-656): enable email matcher in default linkit profile (#485)
hectorlj Nov 17, 2023
b9e28e9
fix(YALB-1578): use full pager on search page
joetower Nov 17, 2023
4a0c90a
feat(YALB-1537): install and enable multiple_fields_remove_button mod…
hectorlj Nov 18, 2023
5193ce7
fix (YALB-1584): update dashboard content (#488)
nJim Nov 20, 2023
c7e9906
feat(YALB-1574): Update alt text for header settings icons
codechefmarc Nov 21, 2023
22b1ddb
fix(YALB-1574): Fix linkit new id key
codechefmarc Nov 21, 2023
5a3e09c
Merge pull request #469 from yalesites-org/YALB-1563-simple-header
codechefmarc Nov 21, 2023
6b344c5
YALB-1574: Branding: Header Variation Backend Front Page Alias Fix (#…
dblanken-yale Nov 22, 2023
e5b2274
feat(YALB-1169): enable the anchor_links module and add the anchor_li…
hectorlj Nov 22, 2023
c3a6cb9
feat(YALB-1169): enable anchor links in the basic and restricted text…
hectorlj Nov 27, 2023
26df4b3
feat(YALB-578): enable the linkit phone matcher (#489)
hectorlj Nov 27, 2023
bbe04f5
feat (YALB-1573): allow admins to manage affiliation terms (#487)
nJim Nov 27, 2023
0f28abd
temp: building multidev
nJim Nov 27, 2023
7e8c49a
Merge remote-tracking branch 'origin/develop' into YALB-1169-anchor-l…
hectorlj Nov 27, 2023
7ca4bb9
fix(YALB-1648): check if $footerLogoMedia exists and is not null (#494)
vinmassaro Nov 28, 2023
b20c748
Merge remote-tracking branch 'origin/develop' into YALB-1169-anchor-l…
hectorlj Nov 29, 2023
654a0b0
feat(YALB-1654): Temporarily hide the blocks overview page from site …
codechefmarc Nov 30, 2023
d52c33a
fix(YALB-1602): paragraph references cloned (#496)
dblanken-yale Nov 30, 2023
4c7a488
Merge branch 'develop' into YALB-1654--block-library
codechefmarc Nov 30, 2023
606fa5e
Merge pull request #498 from yalesites-org/YALB-1654--block-library
codechefmarc Dec 5, 2023
c139403
YALB-1586: Add Dependabot to project repo (#461)
vinmassaro Dec 7, 2023
2620a0a
Merge remote-tracking branch 'origin/develop' into YALB-1169-anchor-l…
hectorlj Dec 8, 2023
d758e34
fix(YALB-1564): Add permission back in to allow custom block library …
codechefmarc Dec 11, 2023
78b6a1a
fix(YALB-1654): Fix linting error
codechefmarc Dec 11, 2023
3ab576e
fix: yalb-1629 fix for node access error
laura-johnson Dec 12, 2023
6e5b238
feat(YALB-1169): add ckeditor5-anchor-drupal to repositories section …
hectorlj Dec 12, 2023
5eb8473
Merge branch 'develop' into YALB-1629-bug-node-access-error
laura-johnson Dec 13, 2023
3756e38
feat(YALB-1169): move northernco/ckeditor5-anchor-drupal to profile c…
hectorlj Dec 14, 2023
13f256c
feat(YALB-1169): switching to pinned version
hectorlj Dec 14, 2023
b70c936
Merge pull request #505 from yalesites-org/YALB-1654--bug-fix
codechefmarc Dec 14, 2023
197a707
Merge pull request #507 from yalesites-org/YALB-1629-bug-node-access-…
laura-johnson Dec 15, 2023
ab563f6
feat(YALB-1169): update anchor link and set external library in root …
hectorlj Dec 15, 2023
4abc78c
Merge remote-tracking branch 'origin/develop' into YALB-1169-anchor-l…
hectorlj Dec 15, 2023
1264671
fix(YALB: 1429): wysiwyg growing indefinitely (#509)
laura-johnson Dec 21, 2023
4c395f6
feat(YALB-1306): add variation to emphasized text component (#508)
joetower Dec 21, 2023
070784f
feat(YALB-1402): update media library to use image by default (#504)
hectorlj Dec 21, 2023
55397e4
fix(YALB-1660): Quality of profile page media image in responsive des…
joetower Dec 21, 2023
4bb5957
fix(YALB-1644): Dial: Center-align callout with content-width content…
joetower Dec 21, 2023
de9a9ec
feat(YALB-1674): add new content spotlight portrait component
joetower Jan 2, 2024
97d99dd
feat: yalb-959 add min/max help text and constraints on specified cus…
laura-johnson Dec 15, 2023
9fc6921
feat: yalb-959 add custom js to layout builder block form
laura-johnson Dec 18, 2023
996a231
feat: yalb-959 remove constraints and add client-side validation for …
laura-johnson Jan 2, 2024
fc774b4
feat: yalb-959 cleanup
laura-johnson Jan 2, 2024
9a00b32
feat: yalb-959 add edit block content forms
laura-johnson Jan 2, 2024
14a4a69
feat: yalb-959 fix code-sniff violation
laura-johnson Jan 2, 2024
11e89fa
feat(YALB-1674): add new responsive image style for content spotlight…
joetower Jan 2, 2024
3c0a8f0
feat(YALB-1674): add options and defaults values for content spotligh…
joetower Jan 2, 2024
71fdac3
feat(YALB-1674): add options and defaults values for content spotligh…
joetower Jan 2, 2024
6a4dd0d
feat(YALB-1674): add options and defaults values for content spotligh…
joetower Jan 2, 2024
544d17b
YALB-1588: Starterkit: Install ys_starterkit content on new sites (#471)
vinmassaro Jan 2, 2024
96be5d6
feat(YALB-1674): add color theme dials
joetower Jan 2, 2024
c5aadf0
feat(YALB-1674): add color theme dials
joetower Jan 2, 2024
7b1d0de
Merge branch 'develop' into YALB-1674-1675-1676-spotlights
joetower Jan 2, 2024
47ef5de
chore: resolve conflicts merging master into develop
vinmassaro Jan 3, 2024
9705a63
Merge branch 'develop' of https://github.com/yalesites-org/yalesites-…
nJim Jan 3, 2024
d045469
Merge branch 'develop' into merge-master-into-develop
nJim Jan 3, 2024
117f1f1
Merge pull request #518 from yalesites-org/merge-master-into-develop
nJim Jan 3, 2024
17efab9
Merge branch 'develop' into YALB-1674-1675-1676-spotlights
joetower Jan 3, 2024
e3401ce
Merge pull request #492 from yalesites-org/YALB-1169-anchor-links
nJim Jan 4, 2024
c750b3e
Merge branch 'develop' into YALB-1674-1675-1676-spotlights
joetower Jan 4, 2024
56a51c9
feat: add action workflow for release pull request
vinmassaro Jan 4, 2024
9443d77
Merge pull request #519 from yalesites-org/actions_release_pr
vinmassaro Jan 4, 2024
2082a93
fix: fix jq errors when creating a PR from action
vinmassaro Jan 5, 2024
2cb4843
Merge branch 'develop' into YALB-1674-1675-1676-spotlights
joetower Jan 8, 2024
f9293f4
feat(YALB-1674): add color theme options to content spotlight
joetower Jan 8, 2024
8a32a01
feat(YALB-1674): add color theme options to content spotlight
joetower Jan 8, 2024
a5029fb
feat(YALB-1674): update content spotlight (portrait) labels to be the…
joetower Jan 8, 2024
c893000
feat(YALB-1674): update content spotlight (portrait) permissions to m…
joetower Jan 8, 2024
8802e58
feat(YALB-1674): update content spotlight (portrait) color theme defa…
joetower Jan 8, 2024
d7406cc
fix(YALB-1686): allow rtf file uploads
nJim Jan 10, 2024
dd5fe23
feat(YALB-1674): update content spotlight block labels to Spotlight -
joetower Jan 10, 2024
09937fb
Merge pull request #515 from yalesites-org/YALB-959-min-max-reference…
laura-johnson Jan 10, 2024
bdcbcd4
feat: support updating existing release PRs
vinmassaro Jan 10, 2024
998675f
feat(YALB-1674): add new preview icons as SVG for spotlight-landscape…
joetower Jan 10, 2024
57b6842
feat(YALB-1674): update labels in layout builder
joetower Jan 10, 2024
2e97fc6
Merge pull request #529 from yalesites-org/release_pr_updates
vinmassaro Jan 11, 2024
65bd722
YALB-1663: User getting error page when clicking "edit layout and con…
dblanken-yale Jan 11, 2024
bbf67b1
feat: content on install to environments other than dev
vinmassaro Jan 12, 2024
22a62f4
Merge pull request #532 from yalesites-org/content_on_install_env
vinmassaro Jan 12, 2024
42e3365
Merge pull request #526 from yalesites-org/YALB-1686-rtf
nJim Jan 16, 2024
3b90de6
Merge pull request #514 from yalesites-org/YALB-1674-1675-1676-spotli…
joetower Jan 17, 2024
09ea402
feat: bump atomic to 1.24.0
vinmassaro Jan 17, 2024
ecf0c1d
fix: update existing release PRs correctly without errors
vinmassaro Jan 18, 2024
14a72e0
Merge pull request #538 from yalesites-org/fix-actions-release-pr
vinmassaro Jan 18, 2024
1873b74
fix: filter out merge commits that do not have a PR
vinmassaro Jan 18, 2024
d468dfb
Merge pull request #539 from yalesites-org/fix-actions-release-pr
vinmassaro Jan 18, 2024
36cf63f
fix(rel-100-quicklink-format-fix): re-introduce heading_html format (…
dblanken-yale Jan 18, 2024
eb51e1d
fix: update jq condition to properly filter merge commits from diff
vinmassaro Jan 18, 2024
19f1917
Merge pull request #540 from yalesites-org/fix-actions-release-pr
vinmassaro Jan 18, 2024
bb95f69
fix: properly filter merges out that are returning null from github API
vinmassaro Jan 18, 2024
dfff05d
feat: bump atomic to 1.25.0
vinmassaro Jan 18, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
107 changes: 107 additions & 0 deletions .ci/github/create_release_pull_request
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
#!/bin/bash

set -eo pipefail

# If we aren't updating an existing pull request, create one to merge develop into master.
if [[ -z "$PR_NUMBER" ]]; then
pull_request_response=$(curl -s -H "Accept: application/vnd.github+json" \
-H "Authorization: token $ACCESS_TOKEN" \
-X POST -d '{"title": "Release", "head": "develop", "base": "master"}' \
"https://api.github.com/repos/$REPO/pulls")

message=$(echo "$pull_request_response" | jq -r 'if has("errors") then .errors[].message else null end')

# Check if the pull request creation was successful.
if [[ -n "$message" ]]; then
echo "Failed to create pull request."
echo "Error: $message"
exit 1
else
pr_url=$(echo "$pull_request_response" | jq -r '.html_url')
fi

# Extract the pull request number from the response.
PR_NUMBER=$(echo "$pull_request_response" | jq -r '.number')

# If there is an existing PR number, get the PR.
else
pull_request_response=$(curl --silent -H "Authorization: token $ACCESS_TOKEN" \
"https://api.github.com/repos/$REPO/pulls/$PR_NUMBER")

pr_url=$(echo "$pull_request_response" | jq -r '.html_url')
fi

# Page through the /pulls/#/commits endpoint.
page=1
per_page=100

while true; do
# Get the list of commits from the pull request and extract commit SHAs.
commits_response=$(curl --silent -H "Authorization: token $ACCESS_TOKEN" \
"https://api.github.com/repos/$REPO/pulls/$PR_NUMBER/commits?per_page=$per_page&page=$page")

current_commit_shas=$(echo "$commits_response" | jq -r '.[].sha')

# Append current commit SHAs to the overall list.
commit_shas+="$current_commit_shas"

# Check if there are more pages, otherwise finish.
if [[ $(echo "$commits_response" | jq -r '. | length') -lt "$per_page" ]]; then
break
fi

# Increment page number for the next API call.
((page++))
done

# Create list of unique pull requests based on commit SHAs, and another for changes without PRs.
pull_requests=()
changes_without_pr=()

for sha in $commit_shas; do
single_pr_url=$(curl -s -H "Authorization: token $ACCESS_TOKEN" \
"https://api.github.com/repos/$REPO/commits/$sha/pulls" \
| jq -r 'if type == "object" and has("message") and length > 0 then null else .[].html_url // empty end')

if [[ -n "$single_pr_url" && "$single_pr_url" != "null" ]]; then
pull_requests+=("$single_pr_url")
elif [[ "$single_pr_url" == "null" ]]; then
:
else
changes_without_pr+=("$sha")
fi
done

# Dedupe pull request URLs.
pull_requests=($(printf '%s\n' "${pull_requests[@]}" | sort -u))

# Begin outputting description if there are PRs.
if [[ -n "${pull_requests[*]}" ]]; then
description+="## Pull requests\n"

# Create pull request description with list of pull requests as a markdown list.
for pr in "${pull_requests[@]}"; do
description+="- $pr\n"
done

fi

# Output changes that are not in a pull request.
if [[ -n "${changes_without_pr[*]}" ]]; then
description+="\n## Changes without a pull request:\n"

for sha in "${changes_without_pr[@]}"; do
description+="- $sha\n"
done
fi

# Update pull request with new description.
update_pull_request=$(curl -s -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: token $ACCESS_TOKEN" \
-X PATCH -d "{\"body\": \"$description\"}" \
"https://api.github.com/repos/$REPO/pulls/$PR_NUMBER")

if [[ -n "$pull_request_response" || -n "$update_pull_request" ]]; then
echo "Pull request created or updated: $pr_url"
fi
35 changes: 35 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -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:
- "*"
6 changes: 6 additions & 0 deletions .github/workflows/build_deploy_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -15,8 +16,6 @@ jobs:
uses: actions/setup-node@v3

- name: Install
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
run: npm install

- name: Release
Expand Down
19 changes: 19 additions & 0 deletions .github/workflows/release_pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Create release pull request
on:
pull_request:
branches:
- master
workflow_dispatch:
jobs:
create_pull_request:
runs-on: ubuntu-latest
env:
ACCESS_TOKEN: ${{ secrets.YALESITES_BUILD_TOKEN }}
REPO: ${{ github.repository }}
PR_NUMBER: ${{ github.event.number }}
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Create pull request
run: ./.ci/github/create_release_pull_request
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -113,6 +112,7 @@ package-lock.json

# Local files
.DS_Store
.zip

# Database references
reference
Expand All @@ -130,3 +130,6 @@ web/profiles/custom/yalesites_profile/vendor/
/atomic
/component-library-twig
/tokens

# Secrets for local use
secrets.json
1 change: 1 addition & 0 deletions .lando.local.example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# YaleSites Project
# YaleSites Project.

The YaleSites platform empowers the Yale community to create digital experiences for the web in applications that are secure, cost-effective, accessible, and sustainable. This project repository contains the tooling, configuration, and scaffolding required to create sites on the platform. This project includes:

Expand Down
12 changes: 12 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,18 @@
"drupal": {
"type": "composer",
"url": "https://packages.drupal.org/8"
},
"ckeditor5-anchor-drupal": {
"type": "package",
"package": {
"name": "northernco/ckeditor5-anchor-drupal",
"version": "0.4.0",
"type": "drupal-library",
"dist": {
"url": "https://registry.npmjs.org/@northernco/ckeditor5-anchor-drupal/-/ckeditor5-anchor-drupal-0.4.0.tgz",
"type": "tar"
}
}
}
},
"require": {
Expand Down
22 changes: 22 additions & 0 deletions docs/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
47 changes: 47 additions & 0 deletions docs/export-starterkit-content.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Exporting starterkit content

## Purpose

There are certain YaleSite sites whose purpose is to provide a starting set of
pages for new YaleSites to use. This is a way to export the content of those
sites for import into a new site. This document will focus on the yalesites
starterkit site. (ys-starterkit)

## What does it do?

This will attempt to execute an export of the pantheon site using the terminus
command, then SFTP to it to retrieve the zip file, and attempt to unzip it into
a git repository to make a new commit.

New commits will look like the following:

`Content update: <date>`

## Prerequisites

1. The following installed:
1. Terminus
2. Sftp
3. Git
4. tr (most linux/bsd/unix based systems have this)
1. [Terminus with auth tokens already provided](https://github.com/yalesites-org/yalesites-project/blob/develop/docs/setup.md#terminus)

## Usage

1. Clone this repository.
1. Clone the [yalesites-starterkit](https://github.com/yalesites-org/yalesites-starterkit) repository at a separate location.
1. In this local repository, you'll run the following:

```sh
SITE_MACHINE_NAME=<pantheon site name> \
./scripts/local/starterkit/create-export \
<location of yalesites-starterkit>/starterkit
```

4. SITE_MACHINE_NAME is the name of the Pantheon site you want to export from.
(i.e. ys-starterkit.dev)

## Where can I get this information?

* PANTHEON_NAME: This is the name of the site as it appears in the Pantheon
dashboard.
11 changes: 2 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"build-with-install": "./scripts/local/build-with-install.sh",
"build-with-assets": "./scripts/local/build-with-assets.sh",
"confex": "./scripts/local/confex.sh",
"content-import": "./scripts/shared/content-import.sh",
"confim": "./scripts/local/confim.sh",
"db:get": "./scripts/local/db-get.sh",
"files:get": "./scripts/local/files-get.sh",
Expand Down Expand Up @@ -61,7 +62,7 @@
"files": [
"web/profiles/custom/yalesites_profile/yalesites_profile.info.yml"
],
"from": "version: .*",
"from": "#version:",
"to": "version: ${nextRelease.version}",
"results": [
{
Expand All @@ -76,14 +77,6 @@
]
}
],
[
"@semantic-release/git",
{
"assets": [
"web/profiles/custom/yalesites_profile/yalesites_profile.info.yml"
]
}
],
"@semantic-release/release-notes-generator",
"@semantic-release/github"
]
Expand Down
3 changes: 2 additions & 1 deletion scripts/local/build-with-install.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/bin/bash

export YALESITES_IS_LOCAL=1
lando drush si yalesites_profile -y
lando drush cr
lando drush migrate:import --group=ys_starterkit
npm run content-import
npm run build
Loading