Skip to content

Commit 95560d0

Browse files
authored
Merge pull request #46 from localgovdrupal/1.x
1.0.0-beta2 release
2 parents c784893 + dd559a3 commit 95560d0

File tree

16 files changed

+56
-50
lines changed

16 files changed

+56
-50
lines changed

.github/workflows/test.yml

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@ jobs:
2424
strategy:
2525
fail-fast: false
2626
matrix:
27-
localgov-version:
28-
- '2.x'
29-
drupal-version:
30-
- '~9.3'
31-
php-version:
32-
- '7.4'
33-
- '8.1'
27+
include:
28+
- localgov-version: '2.x'
29+
drupal-version: '~9.4'
30+
php-version: '8.1'
31+
- localgov-version: '3.x'
32+
drupal-version: '~10.0'
33+
php-version: '8.1'
3434

3535
steps:
3636

@@ -110,13 +110,13 @@ jobs:
110110
strategy:
111111
fail-fast: false
112112
matrix:
113-
localgov-version:
114-
- '2.x'
115-
drupal-version:
116-
- '~9.3'
117-
php-version:
118-
- '7.4'
119-
- '8.1'
113+
include:
114+
- localgov-version: '2.x'
115+
drupal-version: '~9.4'
116+
php-version: '8.1'
117+
- localgov-version: '3.x'
118+
drupal-version: '~10.0'
119+
php-version: '8.1'
120120

121121
steps:
122122

@@ -146,13 +146,13 @@ jobs:
146146
strategy:
147147
fail-fast: false
148148
matrix:
149-
localgov-version:
150-
- '2.x'
151-
drupal-version:
152-
- '~9.3'
153-
php-version:
154-
- '7.4'
155-
- '8.1'
149+
include:
150+
- localgov-version: '2.x'
151+
drupal-version: '~9.4'
152+
php-version: '8.1'
153+
- localgov-version: '3.x'
154+
drupal-version: '~10.0'
155+
php-version: '8.1'
156156

157157
steps:
158158

@@ -181,13 +181,13 @@ jobs:
181181
strategy:
182182
fail-fast: false
183183
matrix:
184-
localgov-version:
185-
- '2.x'
186-
drupal-version:
187-
- '~9.3'
188-
php-version:
189-
- '7.4'
190-
- '8.1'
184+
include:
185+
- localgov-version: '2.x'
186+
drupal-version: '~9.4'
187+
php-version: '8.1'
188+
- localgov-version: '3.x'
189+
drupal-version: '~10.0'
190+
php-version: '8.1'
191191

192192
steps:
193193

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,13 @@ $ composer require --dev geocoder-php/nominatim-provider
1414
```
1515

1616
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.
17+
18+
## Editing webforms
19+
Webforms in Drupal are config entities, therefore are by default exported with the website configuration.
20+
It is often desirable that webforms are built and maintained by non-developers.
21+
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:
22+
```
23+
webform.webform.*
24+
webform.webform_options.*
25+
```
26+

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"minimum-stability": "dev",
88
"require": {
99
"drupal/webform": "^6.0",
10-
"drupal/geocoder": "^3.20",
10+
"drupal/geocoder": "^3.20 || ^4.0",
1111
"localgovdrupal/localgov_os_places_geocoder_provider": "1.x-dev"
1212
},
1313
"require-dev": {

config/install/localgov_forms.webform.settings.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,6 @@ element:
132132
default_description_display: ''
133133
default_more_title: More
134134
default_section_title_tag: h2
135-
default_algolia_places_app_id: ''
136-
default_algolia_places_api_key: ''
137135
default_empty_option: true
138136
default_empty_option_required: ''
139137
default_empty_option_optional: ''

js/address_change.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@
8080
attach: function (context, settings) {
8181

8282
// Behaviors to only attach once.
83-
$('.js-centralhub-address-lookup', context).once('central-hub-behaviours').each(function () {
83+
$(once('central-hub-behaviours', '.js-centralhub-address-lookup', context)).each(function () {
8484
// Get form elements.
8585
var addressLookupElement = $(this);
8686
var searchElement = addressLookupElement.find('.js-address-searchstring');

js/address_select.js

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@
207207
// Attach after an ajax refresh
208208
Drupal.behaviors.localgov_forms_webform = {
209209
attach: function (context, settings) {
210-
$('.js-webform-type-localgov-webform-uk-address', context).once('localgov-address-webform').each(function () {
210+
$(once('localgov-address-webform', '.js-webform-type-localgov-webform-uk-address', context)).each(function () {
211211
var centralHubElement = $(this);
212212
addManualEntryButton(centralHubElement);
213213

@@ -226,14 +226,10 @@
226226
});
227227

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

233231
// Select box change handler.
234-
$(document).once('.js-address-select-container', context).ajaxSuccess(function (event, data) {
235-
$('.js-address-select').on('change', localgov_forms_webform_change_handler);
236-
});
232+
$('.js-address-select').on('change', localgov_forms_webform_change_handler);
237233
},
238234
detach: function (context, settings, trigger) {
239235
$('.js-address-entry-container input').off('change', localgov_forms_webform_manual_address_change_handler);

localgov_forms.info.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: LocalGov Forms
22
type: module
33
description: Provides additional configuration, styling and components for the Drupal Webform module.
4-
core_version_requirement: ^8.8 || ^9
4+
core_version_requirement: ^8.8 || ^9 || ^10
55
package: LocalGov Drupal
66

77
dependencies:

localgov_forms.libraries.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ localgov_forms.address_select:
2121
dependencies:
2222
- localgov_forms/localgov_forms.address_change
2323
- core/drupal
24+
- core/once
2425
- core/jquery
2526

2627
localgov_forms.address_change:
@@ -29,4 +30,5 @@ localgov_forms.address_change:
2930
js/address_change.js: {}
3031
dependencies:
3132
- core/drupal
33+
- core/once
3234
- core/jquery

modules/localgov_forms_date/localgov_forms_date.info.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: 'LocalGov Forms: Date'
22
type: module
33
description: 'A custom Date component'
44
package: LocalGov Drupal
5-
core_version_requirement: ^8 || ^9
5+
core_version_requirement: ^8 || ^9 || ^10
66
dependencies:
77
- 'webform:webform'
88
- 'localgov_forms:localgov_forms'

modules/localgov_forms_date/src/Plugin/WebformElement/LocalgovFormsDate.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
namespace Drupal\localgov_forms_date\Plugin\WebformElement;
44

5-
use Drupal\webform\Plugin\WebformElement\DateList;
65
use Drupal\Core\Form\FormStateInterface;
6+
use Drupal\webform\Plugin\WebformElement\DateList;
77

88
/**
99
* Provides a 'localgov_forms_date' element.

0 commit comments

Comments
 (0)