Skip to content

Commit

Permalink
Merge pull request #46 from localgovdrupal/1.x
Browse files Browse the repository at this point in the history
1.0.0-beta2 release
  • Loading branch information
finnlewis authored Sep 26, 2023
2 parents c784893 + dd559a3 commit 95560d0
Show file tree
Hide file tree
Showing 16 changed files with 56 additions and 50 deletions.
56 changes: 28 additions & 28 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ jobs:
strategy:
fail-fast: false
matrix:
localgov-version:
- '2.x'
drupal-version:
- '~9.3'
php-version:
- '7.4'
- '8.1'
include:
- localgov-version: '2.x'
drupal-version: '~9.4'
php-version: '8.1'
- localgov-version: '3.x'
drupal-version: '~10.0'
php-version: '8.1'

steps:

Expand Down Expand Up @@ -110,13 +110,13 @@ jobs:
strategy:
fail-fast: false
matrix:
localgov-version:
- '2.x'
drupal-version:
- '~9.3'
php-version:
- '7.4'
- '8.1'
include:
- localgov-version: '2.x'
drupal-version: '~9.4'
php-version: '8.1'
- localgov-version: '3.x'
drupal-version: '~10.0'
php-version: '8.1'

steps:

Expand Down Expand Up @@ -146,13 +146,13 @@ jobs:
strategy:
fail-fast: false
matrix:
localgov-version:
- '2.x'
drupal-version:
- '~9.3'
php-version:
- '7.4'
- '8.1'
include:
- localgov-version: '2.x'
drupal-version: '~9.4'
php-version: '8.1'
- localgov-version: '3.x'
drupal-version: '~10.0'
php-version: '8.1'

steps:

Expand Down Expand Up @@ -181,13 +181,13 @@ jobs:
strategy:
fail-fast: false
matrix:
localgov-version:
- '2.x'
drupal-version:
- '~9.3'
php-version:
- '7.4'
- '8.1'
include:
- localgov-version: '2.x'
drupal-version: '~9.4'
php-version: '8.1'
- localgov-version: '3.x'
drupal-version: '~10.0'
php-version: '8.1'

steps:

Expand Down
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,13 @@ $ composer require --dev geocoder-php/nominatim-provider
```

The localgovdrupal/localgov_geo and localgovdrupal/localgov_os_places_geocoder_provider packages are needed to use the Ordnance Survey Places API-based address lookup plugin. Once these packages are installed, the *Localgov OS Places* plugin will become available for selection from the Localgov address lookup element's configuration form.

## Editing webforms
Webforms in Drupal are config entities, therefore are by default exported with the website configuration.
It is often desirable that webforms are built and maintained by non-developers.
To avoid the configuration being removed by deployments, install the [Config ignore](https://www.drupal.org/project/config_ignore) module and under `/admin/config/development/configuration/ignore` add the following:
```
webform.webform.*
webform.webform_options.*
```

2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"minimum-stability": "dev",
"require": {
"drupal/webform": "^6.0",
"drupal/geocoder": "^3.20",
"drupal/geocoder": "^3.20 || ^4.0",
"localgovdrupal/localgov_os_places_geocoder_provider": "1.x-dev"
},
"require-dev": {
Expand Down
2 changes: 0 additions & 2 deletions config/install/localgov_forms.webform.settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,6 @@ element:
default_description_display: ''
default_more_title: More
default_section_title_tag: h2
default_algolia_places_app_id: ''
default_algolia_places_api_key: ''
default_empty_option: true
default_empty_option_required: ''
default_empty_option_optional: ''
Expand Down
2 changes: 1 addition & 1 deletion js/address_change.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
attach: function (context, settings) {

// Behaviors to only attach once.
$('.js-centralhub-address-lookup', context).once('central-hub-behaviours').each(function () {
$(once('central-hub-behaviours', '.js-centralhub-address-lookup', context)).each(function () {
// Get form elements.
var addressLookupElement = $(this);
var searchElement = addressLookupElement.find('.js-address-searchstring');
Expand Down
10 changes: 3 additions & 7 deletions js/address_select.js
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@
// Attach after an ajax refresh
Drupal.behaviors.localgov_forms_webform = {
attach: function (context, settings) {
$('.js-webform-type-localgov-webform-uk-address', context).once('localgov-address-webform').each(function () {
$(once('localgov-address-webform', '.js-webform-type-localgov-webform-uk-address', context)).each(function () {
var centralHubElement = $(this);
addManualEntryButton(centralHubElement);

Expand All @@ -226,14 +226,10 @@
});

// Manual address change handler first.
$(document).once('.js-address-entry-container input', context).ajaxSuccess(function (event, data) {
$('.js-address-entry-container input').on('change', localgov_forms_webform_manual_address_change_handler);
});
$('.js-address-entry-container input').on('change', localgov_forms_webform_manual_address_change_handler);

// Select box change handler.
$(document).once('.js-address-select-container', context).ajaxSuccess(function (event, data) {
$('.js-address-select').on('change', localgov_forms_webform_change_handler);
});
$('.js-address-select').on('change', localgov_forms_webform_change_handler);
},
detach: function (context, settings, trigger) {
$('.js-address-entry-container input').off('change', localgov_forms_webform_manual_address_change_handler);
Expand Down
2 changes: 1 addition & 1 deletion localgov_forms.info.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: LocalGov Forms
type: module
description: Provides additional configuration, styling and components for the Drupal Webform module.
core_version_requirement: ^8.8 || ^9
core_version_requirement: ^8.8 || ^9 || ^10
package: LocalGov Drupal

dependencies:
Expand Down
2 changes: 2 additions & 0 deletions localgov_forms.libraries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ localgov_forms.address_select:
dependencies:
- localgov_forms/localgov_forms.address_change
- core/drupal
- core/once
- core/jquery

localgov_forms.address_change:
Expand All @@ -29,4 +30,5 @@ localgov_forms.address_change:
js/address_change.js: {}
dependencies:
- core/drupal
- core/once
- core/jquery
2 changes: 1 addition & 1 deletion modules/localgov_forms_date/localgov_forms_date.info.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: 'LocalGov Forms: Date'
type: module
description: 'A custom Date component'
package: LocalGov Drupal
core_version_requirement: ^8 || ^9
core_version_requirement: ^8 || ^9 || ^10
dependencies:
- 'webform:webform'
- 'localgov_forms:localgov_forms'
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace Drupal\localgov_forms_date\Plugin\WebformElement;

use Drupal\webform\Plugin\WebformElement\DateList;
use Drupal\Core\Form\FormStateInterface;
use Drupal\webform\Plugin\WebformElement\DateList;

/**
* Provides a 'localgov_forms_date' element.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: 'Localgov form date test'
description: 'Helper module to setup a webform with a localgov_forms_date field.'
type: module
package: Testing
core_version_requirement: ^8.8 || ^9
core_version_requirement: ^8.8 || ^9 || ^10

dependencies:
- webform:webform
Expand Down
2 changes: 1 addition & 1 deletion src/Element/AddressLookupElement.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

namespace Drupal\localgov_forms\Element;

use Drupal\Component\Utility\Html;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Render\Element\FormElement;
use Drupal\Component\Utility\Html;

/**
* Provides a central hub address lookup element.
Expand Down
6 changes: 3 additions & 3 deletions src/Element/LocalgovWebformUKAddress.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

namespace Drupal\localgov_forms\Element;

use Drupal\Core\Form\FormStateInterface;
use Drupal\Component\Utility\NestedArray;
use Drupal\webform\Utility\WebformElementHelper;
use Drupal\localgov_forms\WebformHelper;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Render\Element;
use Drupal\localgov_forms\WebformHelper;
use Drupal\webform\Utility\WebformElementHelper;

/**
* Provides a 'localgov_webform_uk_address' form element.
Expand Down
2 changes: 1 addition & 1 deletion src/Plugin/WebformElement/LocalgovWebformUKAddress.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace Drupal\localgov_forms\Plugin\WebformElement;

use Drupal\webform\WebformSubmissionInterface;
use Drupal\Core\Form\FormStateInterface;
use Drupal\webform\WebformSubmissionInterface;

/**
* Provides a 'localgov_webform_uk_address' Webform element.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: 'Localgov form test'
description: 'Helper module to setup a Contact webform.'
type: module
package: Testing
core_version_requirement: ^8.8 || ^9
core_version_requirement: ^8.8 || ^9 || ^10

dependencies:
- webform:webform
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
use Geocoder\Collection as LocationCollectionInterface;
use Geocoder\Exception\UnsupportedOperation;
use Geocoder\Model\AddressCollection;
use Geocoder\Provider\Provider as ProviderInterface;
use Geocoder\Query\GeocodeQuery;
use Geocoder\Query\ReverseQuery;
use Geocoder\Provider\Provider as ProviderInterface;
use LocalgovDrupal\OsPlacesGeocoder\Model\OsPlacesAddress;

/**
Expand Down

0 comments on commit 95560d0

Please sign in to comment.