Skip to content
Snippets Groups Projects
Commit e63b808c authored by Youri van Koppen's avatar Youri van Koppen
Browse files

Issue #3457244 by megachriz: Added Drupal 11 support.

parent 46f7547b
No related branches found
No related tags found
1 merge request!13Added Drupal 11 compatibility.
Pipeline #301571 passed with warnings
################
# DrupalCI GitLabCI template
# GitLabCI template for Drupal projects.
#
# Gitlab-ci.yml to replicate DrupalCI testing for Contrib
#
# With thanks to:
# * The GitLab Acceleration Initiative participants
# * DrupalSpoons
################
################
# Guidelines
#
# 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.
#
# However, you can modify this template if you have additional needs for your project.
################
################
# Includes
#
# Additional configuration can be provided through includes.
# One advantage of include files is that if they are updated upstream, the changes affect all pipelines using that include.
#
# Includes can be overridden by re-declaring anything provided in an include, here in gitlab-ci.yml
# https://docs.gitlab.com/ee/ci/yaml/includes.html#override-included-configuration-values
# 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:
################
# DrupalCI includes:
# As long as you include this, any future includes added by the Drupal Association will be accessible to your pipelines automatically.
# View these include files at https://git.drupalcode.org/project/gitlab_templates/
################
- project: $_GITLAB_TEMPLATES_REPO
ref: $_GITLAB_TEMPLATES_REF
file:
- '/includes/include.drupalci.main.yml'
- '/includes/include.drupalci.variables.yml'
- '/includes/include.drupalci.workflows.yml'
phpcs:
script:
- curl -OL https://git.drupalcode.org/project/drupal/-/raw/10.1.x/core/phpcs.xml.dist
- vendor/bin/phpcs -s $_WEB_ROOT/modules/custom --report-junit=junit.xml --report-full --report-summary --report-source
- "/includes/include.drupalci.main.yml"
- "/includes/include.drupalci.variables.yml"
- "/includes/include.drupalci.workflows.yml"
################
# Pipeline configuration variables
#
# These are the variables provided to the Run Pipeline form that a user may want to override.
#
# Docs at https://git.drupalcode.org/project/gitlab_templates/-/blob/1.0.x/includes/include.drupalci.variables.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'
variables:
_CSPELL_WORDS: 'Pott, alexpott'
_PHPUNIT_CONCURRENT: "1"
_PHPUNIT_EXTRA: "--suppress-deprecations"
###################################################################################
#
# *
# /(
# ((((,
# /(((((((
# ((((((((((*
# ,(((((((((((((((
# ,(((((((((((((((((((
# ((((((((((((((((((((((((*
# *(((((((((((((((((((((((((((((
# ((((((((((((((((((((((((((((((((((*
# *(((((((((((((((((( .((((((((((((((((((
# ((((((((((((((((((. /(((((((((((((((((*
# /((((((((((((((((( .(((((((((((((((((,
# ,(((((((((((((((((( ((((((((((((((((((
# .(((((((((((((((((((( .(((((((((((((((((
# ((((((((((((((((((((((( ((((((((((((((((/
# (((((((((((((((((((((((((((/ ,(((((((((((((((*
# .((((((((((((((/ /(((((((((((((. ,(((((((((((((((
# *(((((((((((((( ,(((((((((((((/ *((((((((((((((.
# ((((((((((((((, /(((((((((((((. ((((((((((((((,
# (((((((((((((/ ,(((((((((((((* ,(((((((((((((,
# *((((((((((((( .((((((((((((((( ,(((((((((((((
# ((((((((((((/ /((((((((((((((((((. ,((((((((((((/
# ((((((((((((( *(((((((((((((((((((((((* *((((((((((((
# ((((((((((((( ,(((((((((((((..((((((((((((( *((((((((((((
# ((((((((((((, /((((((((((((* /((((((((((((/ ((((((((((((
# ((((((((((((( /((((((((((((/ (((((((((((((* ((((((((((((
# (((((((((((((/ /(((((((((((( ,((((((((((((, *((((((((((((
# (((((((((((((( *(((((((((((/ *((((((((((((. ((((((((((((/
# *((((((((((((((((((((((((((, /(((((((((((((((((((((((((
# ((((((((((((((((((((((((( ((((((((((((((((((((((((,
# .(((((((((((((((((((((((/ ,(((((((((((((((((((((((
# ((((((((((((((((((((((/ ,(((((((((((((((((((((/
# *((((((((((((((((((((( (((((((((((((((((((((,
# ,(((((((((((((((((((((, ((((((((((((((((((((/
# ,(((((((((((((((((((((* /((((((((((((((((((((
# ((((((((((((((((((((((, ,/((((((((((((((((((((,
# ,(((((((((((((((((((((((((((((((((((((((((((((((((((
# .(((((((((((((((((((((((((((((((((((((((((((((
# .((((((((((((((((((((((((((((((((((((,.
# .,(((((((((((((((((((((((((.
#
###################################################################################
OPT_IN_TEST_NEXT_MAJOR: '1'
......@@ -25,7 +25,7 @@ None.
## CONFIGURATION
Configure which htmls blocks to apply the effect to in
Configure which html blocks to apply the effect to in
Administration > Configuration > User interface > Floating block
Customize the menu settings in Administer Site configuration
......
name: Floating Block
type: module
description: Allows regions of the site to float.
core_version_requirement: ^9.3 || ^10
core_version_requirement: ^10.2 || ^11
dependencies:
- drupal:block
configure: floating_block.admin_settings
......@@ -18,9 +18,9 @@
attach(context, settings) {
settings = settings.floatingBlock.blocks;
// If this behaviour is being called as part of processing an ajax
// If this behavior is being called as part of processing an ajax
// callback.
if (jQuery.isFunction(context.parent)) {
if (typeof context.parent === 'function') {
context = context.parent();
}
......@@ -38,12 +38,13 @@
const blockInfo = [];
blockInfo.original_css = [];
blockInfo.original_css.left = Drupal.blockFloatCleanCssValue(
$(block).css('left'),
window.getComputedStyle(block).left,
);
blockInfo.original_css.top = Drupal.blockFloatCleanCssValue(
$(block).css('top'),
window.getComputedStyle(block).top,
);
blockInfo.original_css.position = $(block).css('position');
blockInfo.original_css.position =
window.getComputedStyle(block).position;
blockInfo.floating = false;
blockInfo.reset = true;
blockInfo.original_identifier = `blockFloat-${
......@@ -128,7 +129,7 @@
blockInfo.minOffset =
blockInfo.original_offset.top - blockInfo.padding_top;
// Calulate the maxOffset which depends on whether or not a container is
// Calculate the maxOffset which depends on whether or not a container is
// defined. Otherwise use the scrollHeight.
if (blockInfo.container) {
blockInfo.maxOffset =
......@@ -173,7 +174,7 @@
blockInfo.floating = true;
} else {
// Put the block back in it's original postion
// Put the block back in its original position.
Drupal.blockFloatResetPosition(block, blockInfo);
}
};
......
......@@ -3,6 +3,7 @@
namespace Drupal\floating_block\Form;
use Drupal\Core\Config\ConfigFactoryInterface;
use Drupal\Core\Config\TypedConfigManagerInterface;
use Drupal\Core\Form\ConfigFormBase;
use Drupal\Core\Form\FormStateInterface;
use Drupal\floating_block\HelperInterface;
......@@ -25,11 +26,13 @@ final class SettingsForm extends ConfigFormBase {
*
* @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory
* The factory for configuration objects.
* @param \Drupal\Core\Config\TypedConfigManagerInterface|null $typedConfigManager
* The typed config manager.
* @param \Drupal\floating_block\HelperInterface $helper
* The Floating Block helper service.
*/
public function __construct(ConfigFactoryInterface $config_factory, HelperInterface $helper) {
parent::__construct($config_factory);
public function __construct(ConfigFactoryInterface $config_factory, TypedConfigManagerInterface $typedConfigManager, HelperInterface $helper) {
parent::__construct($config_factory, $typedConfigManager);
$this->helper = $helper;
}
......@@ -39,6 +42,7 @@ final class SettingsForm extends ConfigFormBase {
public static function create(ContainerInterface $container) {
return new static(
$container->get('config.factory'),
$container->get('config.typed'),
$container->get('floating_block')
);
}
......
......@@ -11,7 +11,7 @@ body {
float: left;
width: 300px;
height: 600px;
background-color: #FED499;
background-color: #fed499;
}
.fb-menu {
......@@ -19,7 +19,7 @@ body {
width: 270px;
height: 100px;
padding: 0;
background-color: #B5FCB8;
background-color: #b5fcb8;
}
.fb-container::after {
......@@ -30,5 +30,9 @@ body {
.fb-footer {
height: 400px;
background: linear-gradient(180deg, rgba(150,115,240,1) 0%, rgba(295,170,240,1) 100%);
background: linear-gradient(
180deg,
rgba(150, 115, 240, 1) 0%,
rgba(295, 170, 240, 1) 100%
);
}
<?php
// phpcs:disable Drupal.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
namespace Drupal\Tests\floating_block\FunctionalJavascript;
use Drupal\FunctionalJavascriptTests\WebDriverTestBase;
......@@ -66,7 +68,7 @@ class FloatTest extends WebDriverTestBase {
$this->assertElementYPosition(50, $fb_content_xpath);
// Now scroll down to below the container's height and ensure that the
// element is stil floating.
// element is still floating.
$this->scrollTo(0, 750);
$this->assertElementYPosition(750, $fb_menu_xpath);
}
......
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