Skip to content

Commit

Permalink
Merge pull request #741 from City-of-Helsinki/UHF-9280
Browse files Browse the repository at this point in the history
UHF-9280 Chat trigger
  • Loading branch information
Arkkimaagi authored Apr 12, 2024
2 parents cb3a7b8 + a189ca2 commit 714f675
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 5 deletions.
6 changes: 6 additions & 0 deletions modules/helfi_ckeditor/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ Related files.
- `package.json and package-lock.json` : Defines the node modules and scripts for compiling the theme.
- `webpack.config.js` : Configuration file for the webpack-tool

## Features

### Chat trigger
The Hel.fi CKEditor supports a data attribute for opening a chat from a button or link within content. To utilize this feature, add `<p data-chat-trigger="#trigger-listener">Open chat</p>` to the CKEditor source.


## Known issues

### My CKEditor plugin custom elements/attributes do not appear on the "Allowed HTML tags" list
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ settings:
allowed_tags:
- '<figure tabindex>'
- '<figcaption>'
- '<p data-chat-trigger>'
helfi_ckeditor_helfi_link:
helfi_link_attributes:
- '<a data-hds-icon-start data-is-external data-protocol data-hds-component data-hds-variant rel target="_blank">'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,8 @@ settings:
search: '<a name="[^"]*">(.*?)<\/a>'
replace: $1
ckeditor5_sourceEditing:
allowed_tags: { }
allowed_tags:
- '<p data-chat-trigger>'
helfi_ckeditor_helfi_link:
helfi_link_attributes:
- '<a data-hds-icon-start data-is-external data-protocol data-hds-component data-hds-variant rel target="_blank">'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ filters:
status: true
weight: -50
settings:
allowed_html: '<br> <p data-helfi-quote-text> <h2> <h3> <h4> <h5> <h6> <blockquote data-helfi-quote> <span dir> <ul> <ol start> <li> <strong> <em> <s> <sub> <sup> <a href data-entity-type data-entity-uuid data-entity-substitution data-hds-icon-start data-is-external data-protocol data-hds-component data-hds-variant rel target="_blank"> <table> <tr> <td> <th> <thead> <tbody> <footer data-helfi-quote-author> <cite> <figure tabindex> <figcaption>'
allowed_html: '<br> <p data-chat-trigger data-helfi-quote-text> <h2> <h3> <h4> <h5> <h6> <blockquote data-helfi-quote> <span dir> <ul> <ol start> <li> <strong> <em> <s> <sub> <sup> <a href data-entity-type data-entity-uuid data-entity-substitution data-hds-icon-start data-is-external data-protocol data-hds-component data-hds-variant rel target="_blank"> <table> <tr> <td> <th> <thead> <tbody> <footer data-helfi-quote-author> <cite> <figure tabindex> <figcaption>'
filter_html_help: true
filter_html_nofollow: false
filter_html_escape:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ filters:
status: true
weight: -50
settings:
allowed_html: '<br> <p> <span dir> <ul> <ol start> <li> <a href data-entity-type data-entity-uuid data-entity-substitution data-hds-icon-start data-is-external data-protocol data-hds-component data-hds-variant rel target="_blank"> <strong> <em>'
allowed_html: '<br> <p data-chat-trigger> <span dir> <ul> <ol start> <li> <a href data-entity-type data-entity-uuid data-entity-substitution data-hds-icon-start data-is-external data-protocol data-hds-component data-hds-variant rel target="_blank"> <strong> <em>'
filter_html_help: true
filter_html_nofollow: false
filter_html_escape:
Expand Down
4 changes: 2 additions & 2 deletions modules/helfi_ckeditor/helfi_ckeditor.install
Original file line number Diff line number Diff line change
Expand Up @@ -270,9 +270,9 @@ function helfi_ckeditor_update_9007(): void {
}

/**
* UHF-9497 Added missing figcaption and figure elements.
* UHF-9497 Added chat-trigger element to ckeditor configurations.
*/
function helfi_ckeditor_update_9008(): void {
function helfi_ckeditor_update_9009(): void {
\Drupal::service('helfi_platform_config.config_update_helper')
->update('helfi_ckeditor');
}

0 comments on commit 714f675

Please sign in to comment.