Skip to content
Snippets Groups Projects
Commit e6f55448 authored by Ruud Simons's avatar Ruud Simons
Browse files

Enable gitlab-ci pipelines, fixes for #3450370 and #3360121.

parent 6da8f787
No related branches found
No related tags found
No related merge requests found
/composer.lock
/vendor/
/.editorconfig
/.gitattributes
\ No newline at end of file
################
# GitLabCI template for Drupal projects.
#
# This template is designed to give any Contrib maintainer everything they need to test, without requiring modification.
# It is also designed to keep up to date with Core Development automatically through the use of include files that can be centrally maintained.
# As long as you include the project, ref and three files below, any future updates added by the Drupal Association will be used in your
# pipelines automatically. However, you can modify this template if you have additional needs for your project.
# The full documentation is on https://project.pages.drupalcode.org/gitlab_templates/
################
# For information on alternative values for 'ref' see https://project.pages.drupalcode.org/gitlab_templates/info/templates-version/
# To test a Drupal 7 project, change the first include filename from .main.yml to .main-d7.yml
include:
- project: $_GITLAB_TEMPLATES_REPO
ref: $_GITLAB_TEMPLATES_REF
file:
- "/includes/include.drupalci.main.yml"
- "/includes/include.drupalci.variables.yml"
- "/includes/include.drupalci.workflows.yml"
################
# Pipeline configuration variables are defined with default values and descriptions in the file
# https://git.drupalcode.org/project/gitlab_templates/-/blob/main/includes/include.drupalci.variables.yml
# Uncomment the lines below if you want to override any of the variables. The following is just an example.
################
# variables:
# SKIP_ESLINT: '1'
# OPT_IN_TEST_NEXT_MAJOR: '1'
# _CURL_TEMPLATES_REF: 'main'
......@@ -5,6 +5,7 @@
* Block button modal module file.
*/
use Drupal\Core\Config\Entity\ThirdPartySettingsInterface;
use Drupal\Core\Form\FormStateInterface;
/**
......@@ -22,16 +23,19 @@ function block_button_modal_form_block_form_alter(&$form, FormStateInterface $fo
'#description' => t('Show a button instead of the actual block. When the button is clicked, the block will show in a modal dialog.'),
'#default_value' => $block->getThirdPartySetting('block_button_modal', 'enabled', FALSE),
];
}
/**
* Implements hook_ENTITY_TYPE_view_alter().
*/
function block_button_modal_block_view_alter(array &$build, $entity, $display) {
if (!isset($build['#configuration']['third_party_settings']['block_button_modal']) || !$build['#configuration']['third_party_settings']['block_button_modal']['enabled']) {
if (!$build['#block'] instanceof ThirdPartySettingsInterface) {
return;
}
if (!$build['#block']->getThirdPartySetting('block_button_modal', 'enabled')) {
return;
}
$build['#theme'] = 'block_button_modal_block';
$build['#block_label'] = $build['#configuration']['label'];
}
......
{
"name": "drupal/block_button_modal",
"type": "drupal-module",
"description": "The Block Button Modal module allows you to show a block\u0027s content in a modal dialog.",
"license": "GPL-2.0-or-later",
"repositories": {
"drupal": {
"type": "composer",
"url": "https://packages.drupal.org/8"
}
},
"require-dev": {
"composer/installers": "^1 || ^2",
"drupal/core-composer-scaffold": "10.2.x-dev",
"cweagans/composer-patches": "~1.0",
"drupal/core-recommended": "10.2.x-dev",
"drupal/core-dev": "10.2.x-dev",
"php-parallel-lint/php-parallel-lint": "^1.2",
"drush/drush": "^12.5"
},
"minimum-stability": "dev",
"prefer-stable": true,
"config": {
"process-timeout": 36000,
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true,
"composer/installers": true,
"cweagans/composer-patches": true,
"drupal/core-composer-scaffold": true,
"drupalspoons/composer-plugin": true,
"phpstan/extension-installer": true
}
},
"extra": {
"installer-paths": {
"web/core": [
"type:drupal-core"
],
"web/libraries/{$name}": [
"type:drupal-library"
],
"web/modules/contrib/{$name}": [
"type:drupal-module"
],
"web/profiles/{$name}": [
"type:drupal-profile"
],
"web/themes/{$name}": [
"type:drupal-theme"
],
"drush/{$name}": [
"type:drupal-drush"
]
},
"drupal-scaffold": {
"locations": {
"web-root": "web/"
}
},
"drush": {
"services": {
"drush.services.yml": "^9 || ^10 || ^11"
}
}
},
"authors": [
{
"name": "Ruud Simons",
"email": "ruud@groowup.nl"
}
]
}
......@@ -10,19 +10,23 @@
wrappers = context.querySelectorAll('.block-button-modal-block-wrapper');
}
wrappers.forEach(function (wrapper) {
var button = wrapper.querySelector('button'),
var button = wrapper.querySelectorAll('button, input[type="submit"]'),
block = wrapper.querySelector('.block');
button.dialog = Drupal.dialog('#' + block.getAttribute('id'), {
title: button.getAttribute('data-block-button-modal-title'),
width: '100%'
if (!button[0] || !block) {
return;
}
button[0].dialog = Drupal.dialog('#' + block.getAttribute('id'), {
title: button[0].getAttribute('data-block-button-modal-title'),
width: '100%',
});
button.addEventListener('click', function (e) {
button[0].addEventListener('click', function (e) {
e.preventDefault();
this.dialog.showModal();
})
});
});
}
},
};
})(Drupal);
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment