Skip to content

Commit

Permalink
Add missing .prettierrc.json and fix up style
Browse files Browse the repository at this point in the history
Drupal proscribe (by example and its .prettierrc.json) use of single
quotes in YAML files. But nobody told our instance of prettier.
  • Loading branch information
xendk committed Nov 20, 2024
1 parent 2b05573 commit 2076c3b
Show file tree
Hide file tree
Showing 162 changed files with 699 additions and 683 deletions.
16 changes: 16 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"printWidth": 80,
"semi": true,
"singleQuote": true,
"trailingComma": "all",
"overrides": [
{
"files": ["*.css"],
"options": {
"parser": "css",
"printWidth": 10000,
"singleQuote": false
}
}
]
}
4 changes: 2 additions & 2 deletions web/modules/custom/collation_fixer/collation_fixer.info.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
type: module
name: "Collation Fixer"
description: "Fix MySQL Collations"
name: 'Collation Fixer'
description: 'Fix MySQL Collations'
core_version_requirement: ^10
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
fix database collation:
title: "Fix database collation"
description: "Performs corrections of database collations."
title: 'Fix database collation'
description: 'Performs corrections of database collations.'
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
collation_fixer.confirm:
path: "admin/collation-fixer/{table}/confirm"
path: 'admin/collation-fixer/{table}/confirm'
defaults:
_title: "Fix collation"
_title: 'Fix collation'
_form: 'Drupal\collation_fixer\Form\CollationFixerForm'
requirements:
_permission: "fix database collation"
_permission: 'fix database collation'
10 changes: 5 additions & 5 deletions web/modules/custom/collation_fixer/collation_fixer.services.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ services:
collation_fixer.collation_fixer:
class: Drupal\collation_fixer\CollationFixer
arguments:
- "@database"
- "@module_handler"
- "@entity_type.manager"
- "@entity_field.manager"
- '@database'
- '@module_handler'
- '@entity_type.manager'
- '@entity_field.manager'

Drupal\collation_fixer\CollationFixer: "@collation_fixer.collation_fixer"
Drupal\collation_fixer\CollationFixer: '@collation_fixer.collation_fixer'
2 changes: 1 addition & 1 deletion web/modules/custom/collation_fixer/drush.services.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ services:
collation_fixer.commands:
class: \Drupal\collation_fixer\Commands\CollationFixerCommands
arguments:
- "@collation_fixer.collation_fixer"
- '@collation_fixer.collation_fixer'
tags:
- { name: drush.command }
18 changes: 9 additions & 9 deletions web/modules/custom/dpl_admin/assets/dpl_admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,19 @@ Drupal.behaviors.dpl_admin = {

const dateTimeFields = context.querySelectorAll(
'[type="date"][name$="[value][date]"]:not(.is-dpl-admin-range-initialized),' +
'[type="time"][name$="[value][time]"]:not(.is-dpl-admin-range-initialized)'
'[type="time"][name$="[value][time]"]:not(.is-dpl-admin-range-initialized)',
);

dateTimeFields.forEach((input) => {
input.classList.add("is-dpl-admin-range-initialized");
input.classList.add('is-dpl-admin-range-initialized');
that.dateRangeInit(input, context);
});
},

// A helper function, adding X minutes to a time string ("14:15" => "14:30").
addMinutesToTime(timestring, minutesToAdd) {
// Parse the input time string
const [hours, minutes] = timestring.split(":").map(Number);
const [hours, minutes] = timestring.split(':').map(Number);

// Convert hours and minutes to minutes and add 15 minutes
const totalMinutes = hours * 60 + minutes + minutesToAdd;
Expand All @@ -30,24 +30,24 @@ Drupal.behaviors.dpl_admin = {
const newMinutes = totalMinutes % 60;

// Format the new time as HH:MM, padding with zeroes if necessary
const formattedHours = newHours.toString().padStart(2, "0");
const formattedMinutes = newMinutes.toString().padStart(2, "0");
const formattedHours = newHours.toString().padStart(2, '0');
const formattedMinutes = newMinutes.toString().padStart(2, '0');

return `${formattedHours}:${formattedMinutes}`;
},

// Set the start date as a default date for end date input fields.
dateRangeInit(input, context) {
const that = this;
const name = input.getAttribute("name");
const name = input.getAttribute('name');

if (!name) {
return;
}

// Create the name of the end date element based on the name of the start date element
const endValueName = name.replace("[value]", "[end_value]");
input.addEventListener("change", () => {
const endValueName = name.replace('[value]', '[end_value]');
input.addEventListener('change', () => {
// Recurring events/Drupal appears to insert the end value input using
// AJAX after altering the start value, despite the input already
// existing. We cant really listen for that, so we'll do a poor-mans
Expand All @@ -56,7 +56,7 @@ Drupal.behaviors.dpl_admin = {
setTimeout(() => {
let inputValue = input.value;

if (name.includes("[time]")) {
if (name.includes('[time]')) {
inputValue = that.addMinutesToTime(inputValue, 60);
}

Expand Down
6 changes: 3 additions & 3 deletions web/modules/custom/dpl_admin/dpl_admin.info.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: "Admin"
name: 'Admin'
type: module
description: "Functionality related to the admin/editor experience"
package: "DPL"
description: 'Functionality related to the admin/editor experience'
package: 'DPL'
core_version_requirement: ^10

dependencies:
Expand Down
2 changes: 1 addition & 1 deletion web/modules/custom/dpl_admin/dpl_admin.links.action.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
dpl_admin.add_content:
route_name: dpl_admin.add_content
title: "Add Content"
title: 'Add Content'
appears_on:
- events.admin.content
- view.event_series_admin.page_1
Expand Down
8 changes: 4 additions & 4 deletions web/modules/custom/dpl_admin/dpl_admin.links.menu.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
dpl_admin.add_content:
title: "Add content"
title: 'Add content'
parent: system.admin_content
route_name: dpl_admin.add_content
weight: 5
dpl_admin.redirect:
title: "Redirects"
title: 'Redirects'
parent: system.admin
route_name: redirect.list
weight: 10
dpl_admin.redirect_add:
title: "Add redirect"
title: 'Add redirect'
parent: dpl_admin.redirect
route_name: redirect.add
weight: 1
dpl_admin.logout:
title: "Logout"
title: 'Logout'
parent: system.admin
route_name: user.logout
weight: 9999
4 changes: 2 additions & 2 deletions web/modules/custom/dpl_admin/dpl_admin.links.task.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
dpl_admin.events:
title: "Event series"
title: 'Event series'
route_name: view.event_series_admin.page_1
base_route: system.admin_content
weight: 10

dpl_admin.media:
title: "Media"
title: 'Media'
route_name: view.media_library.page
base_route: system.admin_content
weight: 5
2 changes: 1 addition & 1 deletion web/modules/custom/dpl_admin/dpl_admin.permissions.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
dpl admin access pages:
title: "Access DPL admin pages"
title: 'Access DPL admin pages'
6 changes: 3 additions & 3 deletions web/modules/custom/dpl_admin/dpl_admin.routing.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
dpl_admin.add_content:
path: "/admin/content/add"
path: '/admin/content/add'
defaults:
_controller: '\Drupal\dpl_admin\Controller\AdminPages::addContentPage'
_title: "Add new content"
_title: 'Add new content'
requirements:
_permission: "dpl admin access pages"
_permission: 'dpl admin access pages'
6 changes: 3 additions & 3 deletions web/modules/custom/dpl_article/dpl_article.info.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: "Article"
name: 'Article'
type: module
description: "Functionality related to creating article content."
package: "DPL"
description: 'Functionality related to creating article content.'
package: 'DPL'
core_version_requirement: ^10
4 changes: 2 additions & 2 deletions web/modules/custom/dpl_breadcrumb/dpl_breadcrumb.info.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: "DPL Breadcrumb"
name: 'DPL Breadcrumb'
type: module
description: "Breadcrumbs and automatic URL aliases, based on content structure."
description: 'Breadcrumbs and automatic URL aliases, based on content structure.'
package: DPL
core_version_requirement: ^10
dependencies:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
dpl_breadcrumb.breadcrumb_structure:
title: "Breadcrumb"
title: 'Breadcrumb'
parent: system.admin
route_name: entity.taxonomy_vocabulary.overview_form
route_parameters: { taxonomy_vocabulary: "breadcrumb_structure" }
route_parameters: { taxonomy_vocabulary: 'breadcrumb_structure' }
weight: -8
dpl_breadcrumb.breadcrumb_structure_add:
title: "Add new"
title: 'Add new'
parent: dpl_breadcrumb.breadcrumb_structure
route_name: entity.taxonomy_term.add_form
route_parameters: { taxonomy_vocabulary: "breadcrumb_structure" }
route_parameters: { taxonomy_vocabulary: 'breadcrumb_structure' }
14 changes: 7 additions & 7 deletions web/modules/custom/dpl_breadcrumb/dpl_breadcrumb.services.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
services:
dpl_breadcrumb.logger:
parent: logger.channel_base
arguments: ["dpl_breadcrumb"]
arguments: ['dpl_breadcrumb']
dpl_breadcrumb.breadcrumb_helper:
class: Drupal\dpl_breadcrumb\Services\BreadcrumbHelper
arguments:
[
"@entity_type.manager",
"@language_manager",
"@pathauto.alias_cleaner",
"@string_translation",
"@dpl_breadcrumb.logger",
'@entity_type.manager',
'@language_manager',
'@pathauto.alias_cleaner',
'@string_translation',
'@dpl_breadcrumb.logger',
]
dpl_breadcrumb.redirect_structure_term:
class: Drupal\dpl_breadcrumb\EventSubscriber\StructureTermRedirect
arguments: ["@dpl_breadcrumb.breadcrumb_helper"]
arguments: ['@dpl_breadcrumb.breadcrumb_helper']
tags:
- { name: event_subscriber }
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: "DPL Cache settings"
name: 'DPL Cache settings'
type: module
description: "Giving admins a clearer access to cache-clearing, and the consequences."
package: "DPL"
description: 'Giving admins a clearer access to cache-clearing, and the consequences.'
package: 'DPL'
core_version_requirement: ^10
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
dpl_cache_settings.cache_clear:
title: "Clear cache"
title: 'Clear cache'
route_name: dpl_cache_settings.settings_form
parent: system.admin_config_development
weight: 1000
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
access dpl cache settings:
title: "Access DPL cache settings"
description: "This includes permission for clearing caches."
title: 'Access DPL cache settings'
description: 'This includes permission for clearing caches.'
restrict access: TRUE
access drupal performance settings:
title: "Access Drupal performance settings"
description: "A custom permission, to replace the generic basic settings."
title: 'Access Drupal performance settings'
description: 'A custom permission, to replace the generic basic settings.'
restrict access: TRUE
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
dpl_cache_settings.settings_form:
path: "/admin/dpl/cache_settings"
path: '/admin/dpl/cache_settings'
defaults:
_form: '\Drupal\dpl_cache_settings\Form\CacheSettingsForm'
_title: "Cache settings"
_title: 'Cache settings'
requirements:
_permission: "access dpl cache settings"
_permission: 'access dpl cache settings'
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
services:
logger.channel.dpl_cache_settings:
parent: logger.channel_base
arguments: ["dpl_cache_settings"]
arguments: ['dpl_cache_settings']
dpl_cache_settings.route_subscriber:
class: Drupal\dpl_cache_settings\Routing\RouteSubscriber
tags:
Expand Down
6 changes: 3 additions & 3 deletions web/modules/custom/dpl_campaign/dpl_campaign.info.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: "dpl_campaign"
name: 'dpl_campaign'
type: module
description: "A module that deliveres possibility for campaign CRUD and integration with Dpl React Apps"
package: "DPL"
description: 'A module that deliveres possibility for campaign CRUD and integration with Dpl React Apps'
package: 'DPL'
core_version_requirement: ^9 || ^10
dependencies:
- drupal:serialization
Expand Down
6 changes: 3 additions & 3 deletions web/modules/custom/dpl_campaign/dpl_campaign.services.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ services:
dpl_campaign.serializer:
class: Symfony\Component\Serializer\Serializer
arguments:
- ["@dpl_campaign.normalizer.object", "@dpl_campaign.normalizer.array"]
- ["@serializer.encoder.json", "@serializer.encoder.xml"]
- ['@dpl_campaign.normalizer.object', '@dpl_campaign.normalizer.array']
- ['@serializer.encoder.json', '@serializer.encoder.xml']
dpl_campaign.normalizer.object:
class: Symfony\Component\Serializer\Normalizer\ObjectNormalizer
arguments:
- null
- null
- null
- "@dpl_campaign.extractor.phpdoc"
- '@dpl_campaign.extractor.phpdoc'
dpl_campaign.normalizer.array:
class: Symfony\Component\Serializer\Normalizer\ArrayDenormalizer
dpl_campaign.extractor.phpdoc:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ configuration:
# Values will be merged with existing values.
system.site:
# Configuration values can be set directly
slogan: "Imported by DPL config import"
slogan: 'Imported by DPL config import'
# Nested configuration is also supported
page:
# All values in nested configuration must have a key. This is required to
# support numeric configuration keys.
403: "/user/login"
403: '/user/login'

modules:
# Add module ids to install or uninstall
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
config.sync:
title: "Upload configuration"
description: "Upload and import configuration from a YAML file"
title: 'Upload configuration'
description: 'Upload and import configuration from a YAML file'
route_name: dpl_config_upload.upload_form
parent: system.admin_config_development
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
dpl_config_upload.upload_form:
path: "/admin/config/configuration/import"
path: '/admin/config/configuration/import'
defaults:
_form: 'Drupal\dpl_config_import\Form\UploadForm'
_title: "Upload configuration"
_title: 'Upload configuration'
requirements:
_permission: "import configuration,administer modules"
_permission: 'import configuration,administer modules'
4 changes: 2 additions & 2 deletions web/modules/custom/dpl_consumers/dpl_consumers.info.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: "DPL Consumers"
name: 'DPL Consumers'
type: module
description: "Module for adding consumers to DPL CMS"
description: 'Module for adding consumers to DPL CMS'
package: DPL
core_version_requirement: ^10 || ^11
dependencies:
Expand Down
4 changes: 2 additions & 2 deletions web/modules/custom/dpl_cookies/dpl_cookies.info.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: "DPL Cookies"
name: 'DPL Cookies'
type: module
description: "A module that handles cookie functionality."
description: 'A module that handles cookie functionality.'
package: DPL
core_version_requirement: ^10
dependencies:
Expand Down
4 changes: 2 additions & 2 deletions web/modules/custom/dpl_dashboard/dpl_dashboard.links.menu.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
dpl_dashboard.list:
title: "Dashboard"
title: 'Dashboard'
menu_name: user-profile-menu
route_name: dpl_dashboard.list
description: "User dashboard"
description: 'User dashboard'
Loading

0 comments on commit 2076c3b

Please sign in to comment.