Skip to content
Snippets Groups Projects
Commit 2b2f5877 authored by Owen Bush's avatar Owen Bush
Browse files

Merge branch '8.x-1.x' into unit-tests

parents ee060279 2c23bd24
No related branches found
No related tags found
No related merge requests found
Showing
with 343 additions and 41 deletions
language: php
# The Travis CI container mode has random functional test fails, so we must use
# sudo here.
sudo: true
php:
- 7.1
- 7.2
- 7.3
services:
- mysql
env:
global:
- MODULE=recurring_events
matrix:
- DRUPAL_CORE=8.8.x DRUSH_VER=9.0
- DRUPAL_CORE=8.9.x DRUSH_VER=9.0
- DRUPAL_CORE=9.0.x DRUSH_VER=10.0
matrix:
fast_finish: true
exclude:
- php: 7.1
env: DRUPAL_CORE=9.0.x DRUSH_VER=10.0
- php: 7.2
env: DRUPAL_CORE=9.0.x DRUSH_VER=10.0
# Be sure to cache composer downloads.
cache:
directories:
- $HOME/.composer
before_script:
# Remove Xdebug as we don't need it and it causes
# PHP Fatal error: Maximum function nesting level of '256' reached.
# We also don't care if that file exists or not on PHP 7.
- phpenv config-rm xdebug.ini || true
# Navigate out of module directory to prevent blown stack by recursive module
# lookup.
- cd ..
# Create database.
- mysql -e "create database $MODULE"
# Export database variable for kernel tests.
- export SIMPLETEST_DB=mysql://root:@127.0.0.1/$MODULE
# Create a new Drupal project using the appropriate version using Composer.
- COMPOSER_MEMORY_LIMIT=-1 composer create-project drupal/recommended-project:$DRUPAL_CORE drupal --stability dev --no-interaction
- cd drupal
- DRUPAL_ROOT=$(pwd)
# Add the necessary third party dependencies to run these tests.
- COMPOSER_MEMORY_LIMIT=-1 composer require drupal/field_inheritance
- COMPOSER_MEMORY_LIMIT=-1 composer require drush/drush:^$DRUSH_VER
- COMPOSER_MEMORY_LIMIT=-1 composer require mglaman/drupal-check --dev
- COMPOSER_MEMORY_LIMIT=-1 composer require drupal/group:1.x-dev
- cd $DRUPAL_ROOT
# The recurring events module artifact is already available, so copy it in
# to the contrib module directory so we can run our tests.
- cp -R $TRAVIS_BUILD_DIR web/modules/contrib/$MODULE
# Coder is already installed as part of composer install. We just need to set
# the installed_paths to pick up the Drupal standards.
- $DRUPAL_ROOT/vendor/bin/phpcs --config-set installed_paths $DRUPAL_ROOT/vendor/drupal/coder/coder_sniffer
# Export web server URL for browser tests.
- export SIMPLETEST_BASE_URL=http://localhost:8888
script:
# Install the site using Drush and set up some configuration.
- ./vendor/bin/drush site-install standard --yes --account-pass=admin --db-url=$SIMPLETEST_DB
- ./vendor/bin/drush config-set system.performance css.preprocess 0 --yes
- ./vendor/bin/drush config-set system.performance js.preprocess 0 --yes
- ./vendor/bin/drush config-set system.logging error_level all --yes
# Enable the modules we care to run the tests.
- ./vendor/bin/drush en simpletest $MODULE recurring_events_registration recurring_events_views --yes
# Start up a HTTP server for tests.
- ./vendor/bin/drush runserver --default-server=builtin 8888 > /dev/null &
# Run the PHPUnit tests.
- ./vendor/bin/phpunit -c ./web/core/phpunit.xml.dist --verbose --group=$MODULE ./web/modules/contrib/$MODULE
# Run the deprecation checks.
- ./vendor/bin/drupal-check ./web/modules/contrib/$MODULE
# Check for coding standards. First change directory to our module.
- cd $DRUPAL_ROOT/web/modules/contrib/$MODULE
# Show the violations in detail and do not fail for any errors or warnings.
- $DRUPAL_ROOT/vendor/bin/phpcs --standard=drupal,drupalPractice --ignore=vendor --report-width=130 --colors --runtime-set ignore_warnings_on_exit 1 --runtime-set ignore_errors_on_exit 0 .
# Run again to give a summary and total count.
- $DRUPAL_ROOT/vendor/bin/phpcs --standard=drupal,drupalPractice --ignore=vendor --report-width=130 --colors --runtime-set ignore_warnings_on_exit 1 --runtime-set ignore_errors_on_exit 0 --report=summary .
Recurring Events (recurring_events)
============
## Introduction
The Recurring Events module is a plug-and-play recurring events and registration system designed to be site agnostic and extensible. Detailed information about the module is available on the module's help page at /admin/help/recurring_events.
\ No newline at end of file
{ {
"name": "drupal/recurring_events", "name": "drupal/recurring_events",
"type": "drupal-module", "type": "drupal-module",
"description": "Events and Registration Management Module", "description": "Recurring Events and Registration Management Module",
"keywords": ["Drupal"], "keywords": ["Drupal"],
"license": "GPL-2.0+", "license": "GPL-2.0+",
"homepage": "https://www.drupal.org/project/recurring_events", "homepage": "https://www.drupal.org/project/recurring_events",
...@@ -10,5 +10,7 @@ ...@@ -10,5 +10,7 @@
"issues": "https://www.drupal.org/project/issues/recurring_events", "issues": "https://www.drupal.org/project/issues/recurring_events",
"source": "http://cgit.drupalcode.org/recurring_events" "source": "http://cgit.drupalcode.org/recurring_events"
}, },
"require": { } "require": {
"drupal/field_inheritance": "^1"
}
} }
langcode: en langcode: en
status: true status: true
dependencies: dependencies:
config:
- recurring_events.eventseries_type.default
module: module:
- datetime_range - datetime_range
- recurring_events - recurring_events
- text - text
id: eventseries.eventseries.default id: eventseries.default.default
targetEntityType: eventseries targetEntityType: eventseries
bundle: eventseries bundle: default
mode: default mode: default
content: content:
body: body:
...@@ -26,7 +28,6 @@ content: ...@@ -26,7 +28,6 @@ content:
third_party_settings: { } third_party_settings: { }
custom_date: custom_date:
type: daterange_default type: daterange_default
label: above
weight: 7 weight: 7
region: content region: content
settings: { } settings: { }
...@@ -39,14 +40,12 @@ content: ...@@ -39,14 +40,12 @@ content:
third_party_settings: { } third_party_settings: { }
excluded_dates: excluded_dates:
type: daterange_default type: daterange_default
label: above
weight: 8 weight: 8
settings: { } settings: { }
region: content region: content
third_party_settings: { } third_party_settings: { }
included_dates: included_dates:
type: daterange_default type: daterange_default
label: above
weight: 9 weight: 9
settings: { } settings: { }
region: content region: content
...@@ -85,6 +84,7 @@ content: ...@@ -85,6 +84,7 @@ content:
match_operator: CONTAINS match_operator: CONTAINS
size: 60 size: 60
placeholder: '' placeholder: ''
match_limit: 10
region: content region: content
third_party_settings: { } third_party_settings: { }
weekly_recurring_date: weekly_recurring_date:
......
langcode: en langcode: en
status: true status: true
dependencies: dependencies:
config:
- recurring_events.eventinstance_type.default
module: module:
- datetime_range - datetime_range
- recurring_events - recurring_events
- text - text
id: eventinstance.eventinstance.default id: eventinstance.default.default
targetEntityType: eventinstance targetEntityType: eventinstance
bundle: eventinstance bundle: default
mode: default mode: default
content: content:
date: date:
label: above label: above
type: daterange_default type: daterange_default
weight: 2 weight: 1
settings: settings:
fromto: both
separator: '-'
format_type: medium
timezone_override: '' timezone_override: ''
format_type: long
separator: '-'
region: content region: content
third_party_settings: { } third_party_settings: { }
description: description:
type: text_default type: text_default
weight: 1 weight: 2
region: content region: content
label: above label: above
settings: { } settings: { }
third_party_settings: { } third_party_settings: { }
title:
type: string
weight: 0
region: content
label: above
settings:
link_to_entity: false
third_party_settings: { }
hidden: hidden:
body: true body: true
title: true
langcode: en
status: true
dependencies:
config:
- core.entity_view_mode.eventinstance.list
- recurring_events.eventinstance_type.default
module:
- datetime_range
- text
id: eventinstance.default.list
targetEntityType: eventinstance
bundle: default
mode: list
content:
date:
label: hidden
type: daterange_default
weight: 1
settings:
timezone_override: ''
format_type: short
separator: '-'
region: content
third_party_settings: { }
description:
type: text_trimmed
weight: 2
region: content
label: visually_hidden
settings:
trim_length: 200
third_party_settings: { }
title:
type: string
weight: 0
region: content
label: hidden
settings:
link_to_entity: true
third_party_settings: { }
hidden:
body: true
langcode: en langcode: en
status: true status: true
dependencies: dependencies:
config:
- recurring_events.eventseries_type.default
module: module:
- options - options
- recurring_events - recurring_events
- text - text
id: eventseries.eventseries.default id: eventseries.default.default
targetEntityType: eventseries targetEntityType: eventseries
bundle: eventseries bundle: default
mode: default mode: default
content: content:
body: body:
label: above label: above
weight: 10 weight: 1
region: content region: content
settings: { } settings: { }
third_party_settings: { } third_party_settings: { }
type: text_default type: text_default
event_instances: event_instances:
type: recurring_events_eventinstance_date type: recurring_events_eventinstance_date
weight: 3
region: content
label: above label: above
weight: 10
settings: settings:
link: true link: '1'
date_format: 'F jS, Y h:iA' date_format: 'F jS, Y h:iA'
separator: ' - ' separator: ' - '
region: content
third_party_settings: { } third_party_settings: { }
recur_type: recur_type:
label: above label: above
weight: 10 weight: 2
region: content region: content
settings: { } settings: { }
third_party_settings: { } third_party_settings: { }
type: list_default type: list_default
title: title:
label: above label: above
weight: 10 weight: 0
region: content region: content
settings: settings:
link_to_entity: false link_to_entity: false
third_party_settings: { } third_party_settings: { }
type: string type: string
hidden: hidden:
consecutive_recurring_date: true
custom_date: true custom_date: true
daily_recurring_date: true
event_registration: true event_registration: true
monthly_recurring_date: true monthly_recurring_date: true
weekly_recurring_date: true weekly_recurring_date: true
langcode: en
status: true
dependencies:
config:
- core.entity_view_mode.eventseries.list
- recurring_events.eventseries_type.default
module:
- text
id: eventseries.default.list
targetEntityType: eventseries
bundle: default
mode: list
content:
body:
label: hidden
weight: 1
region: content
settings:
trim_length: 200
third_party_settings: { }
type: text_trimmed
title:
label: hidden
weight: 0
region: content
settings:
link_to_entity: true
third_party_settings: { }
type: string
hidden:
consecutive_recurring_date: true
custom_date: true
daily_recurring_date: true
event_instances: true
event_registration: true
monthly_recurring_date: true
recur_type: true
weekly_recurring_date: true
langcode: en
status: true
dependencies:
module:
- recurring_events
id: eventinstance.list
label: List
targetEntityType: eventinstance
cache: true
langcode: en
status: true
dependencies:
module:
- recurring_events
id: eventseries.list
label: List
targetEntityType: eventseries
cache: true
langcode: en langcode: en
status: true status: true
dependencies: { } dependencies: { }
id: description id: eventinstance_default_description
label: Description label: Description
type: append type: append
sourceEntityType: eventseries
sourceEntityBundle: default
sourceField: body sourceField: body
entityField: body destinationEntityType: eventinstance
plugin: text_inheritance destinationEntityBundle: default
destinationField: body
plugin: default_inheritance
langcode: en langcode: en
status: true status: true
dependencies: { } dependencies: { }
id: title id: eventinstance_default_title
label: Title label: Title
type: inherit type: inherit
sourceEntityType: eventseries
sourceEntityBundle: default
sourceField: title sourceField: title
entityField: '' destinationEntityType: eventinstance
plugin: string_inheritance destinationEntityBundle: default
plugin: default_inheritance
langcode: en
status: true
dependencies: { }
label: Default
id: default
description: 'A default event instance type.'
langcode: en
status: true
dependencies: { }
label: Default
id: default
description: 'A default event series type.'
recurring_events.field_inheritance.*: recurring_events.eventinstance_type.*:
type: config_entity type: config_entity
label: 'Field inheritance config' label: 'Event instance type config'
mapping: mapping:
id: id:
type: string type: string
...@@ -8,13 +8,8 @@ recurring_events.field_inheritance.*: ...@@ -8,13 +8,8 @@ recurring_events.field_inheritance.*:
label: label:
type: label type: label
label: 'Label' label: 'Label'
uuid: description:
type: string
type:
type: string
sourceField:
type: string type: string
entityField: label: 'Description'
type: string uuid:
plugin:
type: string type: string
recurring_events.eventseries_type.*:
type: config_entity
label: 'Event series type config'
mapping:
id:
type: string
label: 'ID'
label:
type: label
label: 'Label'
description:
type: string
label: 'Description'
uuid:
type: string
...@@ -55,3 +55,17 @@ recurring_events.eventinstance.config: ...@@ -55,3 +55,17 @@ recurring_events.eventinstance.config:
limit: limit:
type: integer type: integer
label: 'The items per page to show on event instance listing' label: 'The items per page to show on event instance listing'
field.formatter.settings.recurring_events_eventinstance_date:
type: mapping
label: 'Recurring Events Event Instance Date Formatter'
mapping:
link:
type: string
label: 'Whether to format the date as a link'
date_format:
type: string
label: 'The date format to use to display the date'
separator:
type: string
label: 'The separator to use between start and end dates'
/**
* @file
* Javascript functionality for the recurring events create form.
*/
(function ($) { (function ($) {
'use strict'; 'use strict';
...@@ -5,7 +10,7 @@ ...@@ -5,7 +10,7 @@
* Add weekday selection based on date range. * Add weekday selection based on date range.
*/ */
Drupal.behaviors.recurring_events_weekday_selection = { Drupal.behaviors.recurring_events_weekday_selection = {
attach: function(context, settings) { attach: function (context, settings) {
var weekdays = new Array(7); var weekdays = new Array(7);
weekdays[0] = "sunday"; weekdays[0] = "sunday";
weekdays[1] = "monday"; weekdays[1] = "monday";
...@@ -16,7 +21,7 @@ ...@@ -16,7 +21,7 @@
weekdays[6] = "saturday"; weekdays[6] = "saturday";
// When the weekly occurrence start date is changed. // When the weekly occurrence start date is changed.
$('#edit-weekly-recurring-date-0-value-date').on('change', function(event) { $('#edit-weekly-recurring-date-0-value-date').on('change', function (event) {
var value = $(this).val(); var value = $(this).val();
var date_parts = value.split('-'); var date_parts = value.split('-');
if (date_parts.length > 0) { if (date_parts.length > 0) {
...@@ -24,7 +29,7 @@ ...@@ -24,7 +29,7 @@
var weekday = weekdays[date.getDay()]; var weekday = weekdays[date.getDay()];
// Remove all the weekday recurrence options. // Remove all the weekday recurrence options.
$('#edit-weekly-recurring-date-0-days').find('input').each(function(key, item) { $('#edit-weekly-recurring-date-0-days').find('input').each(function (key, item) {
$(item).prop('checked', false); $(item).prop('checked', false);
}); });
...@@ -35,7 +40,7 @@ ...@@ -35,7 +40,7 @@
}); });
// When the monthly occurrence start date is changed. // When the monthly occurrence start date is changed.
$('#edit-monthly-recurring-date-0-value-date').on('change', function(event) { $('#edit-monthly-recurring-date-0-value-date').on('change', function (event) {
var value = $(this).val(); var value = $(this).val();
var date_parts = value.split('-'); var date_parts = value.split('-');
if (date_parts.length > 0) { if (date_parts.length > 0) {
...@@ -43,7 +48,7 @@ ...@@ -43,7 +48,7 @@
var weekday = weekdays[date.getDay()]; var weekday = weekdays[date.getDay()];
// Remove all the monthly recurrence options. // Remove all the monthly recurrence options.
$('#edit-monthly-recurring-date-0-days').find('input').each(function(key, item) { $('#edit-monthly-recurring-date-0-days').find('input').each(function (key, item) {
$(item).prop('checked', false); $(item).prop('checked', false);
}); });
...@@ -59,12 +64,12 @@ ...@@ -59,12 +64,12 @@
* Set end date for excluded and included dates to be the same as the start. * Set end date for excluded and included dates to be the same as the start.
*/ */
Drupal.behaviors.recurring_events_excluded_included_dates = { Drupal.behaviors.recurring_events_excluded_included_dates = {
attach: function(context, settings) { attach: function (context, settings) {
$('#edit-excluded-dates-wrapper, #edit-included-dates-wrapper').find('input.form-date').once().on('change', function(e) { $('#edit-excluded-dates-wrapper, #edit-included-dates-wrapper').find('input.form-date').once().on('change', function (e) {
if ($(this).attr('name').includes('[value][date]')) { if ($(this).attr('name').includes('[value][date]')) {
var start_date = this; var start_date = this;
var parent = $(this).closest('.form-wrapper'); var parent = $(this).closest('.form-wrapper');
$(parent).find('input.form-date').each(function(index, item) { $(parent).find('input.form-date').each(function (index, item) {
if (index == 1) { if (index == 1) {
if ($(item).val() == '') { if ($(item).val() == '') {
$(item).val($(start_date).val()); $(item).val($(start_date).val());
...@@ -76,4 +81,4 @@ ...@@ -76,4 +81,4 @@
} }
}; };
}(jQuery)); }(jQuery));
\ No newline at end of file
/**
* @file
* Javascript functionality for the included/excluded date forms.
*/
(function ($) { (function ($) {
'use strict'; 'use strict';
...@@ -5,9 +10,9 @@ ...@@ -5,9 +10,9 @@
* Set end date for excluded and included dates to be the same as the start. * Set end date for excluded and included dates to be the same as the start.
*/ */
Drupal.behaviors.recurring_events_excluded_included_config_dates = { Drupal.behaviors.recurring_events_excluded_included_config_dates = {
attach: function(context, settings) { attach: function (context, settings) {
$('#edit-start').once().on('change', function(e) { $('#edit-start').once().on('change', function (e) {
if ($('#edit-end').val() == '') { if ($('#edit-end').val() == '') {
$('#edit-end').val($(this).val()); $('#edit-end').val($(this).val());
} }
...@@ -15,4 +20,4 @@ ...@@ -15,4 +20,4 @@
} }
}; };
}(jQuery)); }(jQuery));
\ No newline at end of file
...@@ -2,4 +2,7 @@ Recurring Events (recurring_events) ...@@ -2,4 +2,7 @@ Recurring Events (recurring_events)
============ ============
## Introduction ## Introduction
The Recurring Events Registration module is a submodule of recurring_events. It provides a registration system designed to be site agnostic and extensible. Detailed information about the module is available on the module's help page at /admin/help/recurring_events_registration. The Recurring Events Registration module is a submodule of recurring_events. It
\ No newline at end of file provides a registration system designed to be site agnostic and extensible.
Detailed information about the module is available on the module's help page at
/admin/help/recurring_events_registration.
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