-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OEL-3178: Add maps version 3.0 #254
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't need a new major, we can provide an update path that creates the configuration and sets it to 2.0 for existing installations. New installations can be on 3.0. Sites like EWPP can stick on 2.0 by exporting the configuration.
@@ -0,0 +1,2 @@ | |||
administer webtools maps form: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not in line with the remaining permissions, it should be administer webtools maps
https://github.com/openeuropa/oe_webtools/blob/master/modules/oe_webtools_cookie_consent/oe_webtools_cookie_consent.permissions.yml#L1
https://github.com/openeuropa/oe_webtools/blob/master/modules/oe_webtools_globan/oe_webtools_globan.permissions.yml#L1
https://github.com/openeuropa/oe_webtools/blob/master/modules/oe_webtools_cookie_consent/oe_webtools_cookie_consent.permissions.yml#L1
path: '/admin/config/system/oe_webtools_maps' | ||
defaults: | ||
_form: 'Drupal\oe_webtools_maps\Form\WebtoolsMapsSettingsForm' | ||
_title: 'Webtools Maps Form settings' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
_title: 'Webtools Maps Form settings' | |
_title: 'Webtools Maps settings' |
Drop the form a bit everywhere :)
mapping: | ||
map_version: | ||
type: string | ||
label: 'Map Version' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
label: 'Map Version' | |
label: 'Map version' |
Hello @drishu,
|
@@ -1,3 +1,11 @@ | |||
oe_webtools_maps.settings: | |||
type: config_object | |||
label: 'Webtools Maps Settings' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
label: 'Webtools Maps Settings' | |
label: 'Webtools Maps settings' |
'2.0' => $this->t('Version 2.0'), | ||
'3.0' => $this->t('Version 3.0'), | ||
], | ||
'#default_value' => $config->get('map_version') ?? '2.0', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@piotrsmykaj no need for "hook_post_update() and set version 2.0 for the existing websites." as we have this here
Unfortunately, somehow, I overlooked this PR regarding the webtools map upgrade and worked on almost the same independently. See PR: #258. |
|
||
foreach ($items as $delta => $item) { | ||
$data_array = [ | ||
'service' => 'map', | ||
'version' => '2.0', | ||
// Fallback to version 2.0 for BC. | ||
'version' => $config->get('map_version') ?? '2.0', | ||
'map' => [ | ||
'zoom' => $this->getSetting('zoom_level'), | ||
'center' => [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if ($this->getSetting('show_marker')) {
$data_array['layers'] = [
should be updated according to changes in Webtools Maps UEC for maps 3.0. See this changes: https://github.com/openeuropa/oe_webtools/pull/258/files#diff-d5788593f82f730c0aae0cc4840492e4a812488fa1fb087015bec48283327268L90
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I confirm that, without this change, the marker does not appear on the map.
/** | ||
* Tests if changing configuration changes the map JSON. | ||
*/ | ||
public function testConfigurationChanges(): void { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As we didn't have at all test coverage for oe_webtools_maps probably it makes sense to extend test coverage to assert field formatter settings. See https://github.com/openeuropa/oe_webtools/pull/258/files#diff-93e9dfce3433d92e9cae1a182d4fb153f8b8169475098c75580da33298e5a187R71
OEL-3178
Description
Add support for maps version 3
Change log