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

DP-35898: Add Social Media Support for Bluesky #2771

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
41 changes: 41 additions & 0 deletions changelogs/DP-35898.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#
# Write your changelog entry here. Every pull request must have a changelog yml file.
#
# Change types:
# #############################################################################
# You can use one of the following types:
# - Added: For new features.
# - Changed: For changes to existing functionality.
# - Deprecated: For soon-to-be removed features.
# - Removed: For removed features.
# - Fixed: For any bug fixes.
# - Security: In case of vulnerabilities.
#
# Format
# #############################################################################
# The format is crucial. Please follow the examples below. For reference, the requirements are:
# - All 3 parts are required and you must include "Type", "description" and "issue".
# - "Type" must be left aligned and followed by a colon.
# - "description" must be indented with 2 spaces followed by a colon
# - "issue" must be indented with 4 spaces followed by a colon.
# - "issue" is for the Jira ticket number only e.g. DP-1234
# - No extra spaces, indents, or blank lines are allowed.
#
# Example:
# #############################################################################
# Fixed:
# - description: Fixes scrolling on edit pages in Safari.
# issue: DP-13314
#
# You may add more than 1 description & issue for each type using the following format:
# Changed:
# - description: Automating the release branch.
# issue: DP-10166
# - description: Second change item that needs a description.
# issue: DP-19875
# - description: Third change item that needs a description along with an issue.
# issue: DP-19843
#
Added:
- description: Add Social Media Support for Bluesky.
issue: DP-35898
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@
"enyo/dropzone": "5.7.2",
"geocoder-php/open-cage-provider": "^4.6",
"google/cloud-bigquery": "^1.25",
"massgov/mayflower-artifacts": "dev-develop",
"massgov/mayflower-artifacts": "dev-DP-35898/add-icon-bluesky",
"monolog/monolog": "^3",
"phlak/semver": "^2.0",
"previousnext/drupal-test-utils": "^0.0.1",
Expand Down
14 changes: 7 additions & 7 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions docroot/modules/custom/mass_content/src/Field/SocialLinks.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public function computeValue() {
'instagram',
'medium',
'youtube',
'bluesky',
];
parent::computeValue();

Expand All @@ -34,6 +35,10 @@ public function computeValue() {
$item->set('icon', Helper::getIconPath($service));
break;
}
elseif (strpos($item->uri, 'bsky')) {
$item->set('icon', Helper::getIconPath('bluesky'));
break;
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ function mass_validation_entity_bundle_field_info_alter(&$fields, EntityTypeInte
'medium.com',
'blog.mass.gov',
'www.mass.gov',
'bsky.app',
],
]);
}
Expand Down
5 changes: 5 additions & 0 deletions docroot/themes/custom/mass_theme/mass_theme.theme
Original file line number Diff line number Diff line change
Expand Up @@ -5044,6 +5044,7 @@ function mass_theme_preprocess_field(&$variables, $hook) {
'medium',
'youtube',
'vimeo',
'bluesky'
];

foreach ($variables['items'] as $index => &$item) {
Expand Down Expand Up @@ -6969,6 +6970,7 @@ function mass_theme_preprocess_field__node__field_social_links(&$variables) {
'instagram',
'medium',
'youtube',
'bluesky',
];

foreach ($variables['items'] as $index => &$item) {
Expand All @@ -6977,6 +6979,9 @@ function mass_theme_preprocess_field__node__field_social_links(&$variables) {
if (strpos($url, $service)) {
$item['icon'] = Helper::getIconPath($service);
}
elseif (strpos($url, 'bsky')) {
$item['icon'] = Helper::getIconPath('bluesky');
}
}
}
}
Expand Down