Skip to content

Commit

Permalink
HRIN-767: Added GIS map token
Browse files Browse the repository at this point in the history
  • Loading branch information
rimi-itk committed Dec 18, 2023
1 parent 097610d commit edb56d2
Show file tree
Hide file tree
Showing 13 changed files with 337 additions and 11 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

* [PR-376](https://github.com/itk-dev/hoeringsportal/pull/376)
Added GIS map token
* [PR-374](https://github.com/itk-dev/hoeringsportal/pull/374)
Fix hidden mobile filters

* [PR-367](https://github.com/itk-dev/hoeringsportal/pull/367)
Added and used Editor Advanced link

Expand Down
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@
"drupal/quick_node_clone": "^1.12",
"drupal/redirect": "^1.6",
"drupal/search_autocomplete": "^3.0",
"drupal/token_filter": "^2.1",
"drupal/toolbar_visibility": "^2.1",
"drupal/twig_tweak": "^3.2",
"drupal/view_custom_table": "^2.0",
Expand Down
93 changes: 86 additions & 7 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions config/sync/core.extension.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ module:
telephone: 0
text: 0
token: 0
token_filter: 0
toolbar: 0
toolbar_visibility: 0
twig_tweak: 0
Expand Down
59 changes: 59 additions & 0 deletions config/sync/editor.editor.hearing_description.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
uuid: d4a16c11-faf2-4617-bd62-c28ad4eb5f31
langcode: da
status: true
dependencies:
config:
- filter.format.hearing_description
module:
- ckeditor5
format: hearing_description
editor: ckeditor5
settings:
toolbar:
items:
- bold
- italic
- '|'
- link
- '|'
- bulletedList
- numberedList
- '|'
- blockQuote
- '|'
- sourceEditing
- '|'
- heading
- tokenBrowser
plugins:
ckeditor5_heading:
enabled_headings:
- heading2
- heading3
- heading4
ckeditor5_list:
reversed: false
startIndex: true
ckeditor5_sourceEditing:
allowed_tags:
- '<cite>'
- '<a hreflang target>'
- '<blockquote cite>'
- '<ul type>'
- '<ol type>'
- '<h2 id>'
- '<h3 id>'
- '<h4 id>'
editor_advanced_link_link:
enabled_attributes:
- target
token_filter_token_browser:
token_types: { }
image_upload:
status: false
scheme: public
directory: inline-images
max_size: ''
max_dimensions:
width: null
height: null
6 changes: 4 additions & 2 deletions config/sync/field.field.node.hearing.field_description.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@ status: true
dependencies:
config:
- field.storage.node.field_description
- filter.format.hearing_description
- node.type.hearing
module:
- allowed_formats
- text
third_party_settings:
allowed_formats:
allowed_formats:
- filtered_html
- hearing_description
id: node.hearing.field_description
field_name: field_description
entity_type: node
Expand All @@ -23,5 +24,6 @@ translatable: true
default_value: { }
default_value_callback: ''
settings:
allowed_formats: { }
allowed_formats:
- hearing_description
field_type: text_long
45 changes: 45 additions & 0 deletions config/sync/filter.format.hearing_description.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
uuid: 15881684-2eac-4426-bae4-7e44d395c82a
langcode: da
status: true
dependencies:
module:
- token_filter
name: 'Hearing description'
format: hearing_description
weight: 0
filters:
filter_autop:
id: filter_autop
provider: filter
status: true
weight: 9
settings: { }
filter_htmlcorrector:
id: filter_htmlcorrector
provider: filter
status: true
weight: -50
settings: { }
filter_url:
id: filter_url
provider: filter
status: false
weight: -50
settings:
filter_url_length: 72
filter_html:
id: filter_html
provider: filter
status: true
weight: 0
settings:
allowed_html: '<br> <p> <h2 id> <h3 id> <h4 id> <cite> <a hreflang target href> <blockquote cite> <ul type> <ol type start> <strong> <em> <li>'
filter_html_help: true
filter_html_nofollow: false
token_filter:
id: token_filter
provider: token_filter
status: true
weight: 15
settings:
replace_empty: '1'
2 changes: 2 additions & 0 deletions config/sync/user.role.authenticated.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ dependencies:
config:
- filter.format.citizen_proposal_content
- filter.format.filtered_html
- filter.format.hearing_description
module:
- file
- filter
Expand All @@ -23,4 +24,5 @@ permissions:
- 'search content'
- 'use text format citizen_proposal_content'
- 'use text format filtered_html'
- 'use text format hearing_description'
- 'view media'
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.hoeringsportal-hearing-gis-minimap {
/* We use a `span` element to render the map (it's most times inside a `p` element). */
display: block;
height: 500px;
}

.hoeringsportal-hearing-gis-minimap.invalid-token {
color: #f00;
background: #ff0;
height: auto;
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,11 @@ hearing-form:
version: VERSION
js:
assets/js/form.js: {}

gis-minimap:
version: VERSION
css:
theme:
assets/css/gis-minimap.css: {}
js:
https://webkort.aarhuskommune.dk/clientapi/minimap2/mmloader.js: { type: external, minified: true }
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@ use Drupal\Core\Entity\Display\EntityViewDisplayInterface;
use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Link;
use Drupal\Core\Render\BubbleableMetadata;
use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\Core\Url;
use Drupal\hoeringsportal_hearing\TokenHelper;

/**
* Implements hook_help().
Expand Down Expand Up @@ -82,6 +84,23 @@ function hoeringsportal_hearing_node_view(array &$build, EntityInterface $entity
$new_title = $title . $state;
$build['title'][0]['#context']['value'] = $new_title;
}

}
}

/**
* Implements hook_token_info().
*
* @see \Drupal\hoeringsportal_hearing\TokenHelper::tokenInfo()
*/
function hoeringsportal_hearing_token_info() {
return \Drupal::service(TokenHelper::class)->tokenInfo();
}

/**
* Implements hook_tokens().
*
* @see \Drupal\hoeringsportal_hearing\TokenHelper::tokens()
*/
function hoeringsportal_hearing_tokens($type, $tokens, array $data, array $options, BubbleableMetadata $bubbleable_metadata) {
return \Drupal::service(TokenHelper::class)->tokens($type, $tokens, $data, $options, $bubbleable_metadata);
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ services:
class: Drupal\hoeringsportal_hearing\EventSubscriber\EventSubscriber
tags:
- {name: event_subscriber}

Drupal\hoeringsportal_hearing\TokenHelper:
Loading

0 comments on commit edb56d2

Please sign in to comment.