-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support import of HTML variant for detail text
Provide a new option within configurations to turn on import of HTML from destination.one for detail text of each event. Resolves: #10629
- Loading branch information
1 parent
39dfc0b
commit a4f8e2a
Showing
17 changed files
with
648 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/* | ||
* Copyright (C) 2024 Daniel Siepmann <[email protected]> | ||
* | ||
* This program is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU General Public License | ||
* as published by the Free Software Foundation; either version 2 | ||
* of the License, or (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program; if not, write to the Free Software | ||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA | ||
* 02110-1301, USA. | ||
*/ | ||
|
||
namespace WerkraumMedia\Events\Domain\Model\Import; | ||
|
||
use TYPO3\CMS\Core\Type\BitSet; | ||
|
||
final class Features extends BitSet | ||
{ | ||
public const HTML_FOR_DETAIL = 0b1; | ||
|
||
public function hasHtmlForDetailEnabled(): bool | ||
{ | ||
return $this->get(self::HTML_FOR_DETAIL); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
4.2.0 | ||
===== | ||
|
||
Breaking | ||
-------- | ||
|
||
Nothing | ||
|
||
Features | ||
-------- | ||
|
||
* Support HTML for detail text of events when importing data from destination.one. | ||
|
||
This can be enabled within the import configuration. That way one can restrict the | ||
HTML import to certain import configurations. | ||
|
||
Ensure to adjust the templates when turning on the feature. | ||
Either use `f:format.html` or `f:sanitize.html` as content might be unsafe. | ||
|
||
Fixes | ||
----- | ||
|
||
Nothing | ||
|
||
Tasks | ||
----- | ||
|
||
Nothing | ||
|
||
Deprecation | ||
----------- | ||
|
||
Nothing |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
Tests/Functional/Import/DestinationDataTest/Assertions/ImportsHtmlTextIfConfigured.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
return [ | ||
'tx_events_domain_model_event' => [ | ||
0 => [ | ||
'uid' => '1', | ||
'global_id' => 'e_100354481', | ||
'details' => 'Die Lichter sind entzündet, die Plätzchen duften, man rückt endlich wieder näher zusammen und lauscht den Geschichten. Vier Schauspieler*innen unseres Theaters überraschen mit ihren weihnachtlichen Texten, die sie für uns ausgewählt haben. Dazu plaudern sie über persönliche Anekdoten und erinnern sich an ihre schönsten und verrücktesten Weihnachtsfeste. Und da der Genuss in der Vorweihnachtszeit nicht fehlen darf, wird an jedem Adventssonntag eine andere weihnachtliche Spezialität serviert.<br>Eintritt: 10 € (inkl. Gedeck mit weihnachtlicher Schillerlocke)<br>Um Voranmeldung unter 03672-486470 oder <a data-cke-saved-href="mailto:[email protected]" href="mailto:[email protected]">[email protected]</a> wird gebeten. <br><strong>Es gilt die 2G-PLUS-Regel.</strong> <br>', | ||
], | ||
], | ||
]; |
18 changes: 18 additions & 0 deletions
18
Tests/Functional/Import/DestinationDataTest/Assertions/ImportsPlainTextIfConfigured.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
return [ | ||
'tx_events_domain_model_event' => [ | ||
0 => [ | ||
'uid' => '1', | ||
'global_id' => 'e_100354481', | ||
'details' => implode("\n", [ | ||
'Die Lichter sind entzündet, die Plätzchen duften, man rückt endlich wieder näher zusammen und lauscht den Geschichten. Vier Schauspieler*innen unseres Theaters überraschen mit ihren weihnachtlichen Texten, die sie für uns ausgewählt haben. Dazu plaudern sie über persönliche Anekdoten und erinnern sich an ihre schönsten und verrücktesten Weihnachtsfeste. Und da der Genuss in der Vorweihnachtszeit nicht fehlen darf, wird an jedem Adventssonntag eine andere weihnachtliche Spezialität serviert.', | ||
'Eintritt: 10 € (inkl. Gedeck mit weihnachtlicher Schillerlocke)', | ||
'Um Voranmeldung unter 03672-486470 oder [email protected] wird gebeten.', | ||
'Es gilt die 2G-PLUS-Regel.', | ||
]), | ||
], | ||
], | ||
]; |
18 changes: 18 additions & 0 deletions
18
...mport/DestinationDataTest/Assertions/ImportsPlainTextIfHtmlIsConfiguredButUnavailable.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
return [ | ||
'tx_events_domain_model_event' => [ | ||
0 => [ | ||
'uid' => '1', | ||
'global_id' => 'e_100354481', | ||
'details' => implode("\n", [ | ||
'Die Lichter sind entzündet, die Plätzchen duften, man rückt endlich wieder näher zusammen und lauscht den Geschichten. Vier Schauspieler*innen unseres Theaters überraschen mit ihren weihnachtlichen Texten, die sie für uns ausgewählt haben. Dazu plaudern sie über persönliche Anekdoten und erinnern sich an ihre schönsten und verrücktesten Weihnachtsfeste. Und da der Genuss in der Vorweihnachtszeit nicht fehlen darf, wird an jedem Adventssonntag eine andere weihnachtliche Spezialität serviert.', | ||
'Eintritt: 10 € (inkl. Gedeck mit weihnachtlicher Schillerlocke)', | ||
'Um Voranmeldung unter 03672-486470 oder [email protected] wird gebeten.', | ||
'Es gilt die 2G-PLUS-Regel.', | ||
]), | ||
], | ||
], | ||
]; |
18 changes: 18 additions & 0 deletions
18
...s/Functional/Import/DestinationDataTest/Fixtures/Database/ImportConfigurationWithHtml.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
return [ | ||
'tx_events_domain_model_import' => [ | ||
[ | ||
'uid' => '1', | ||
'pid' => '2', | ||
'title' => 'Example import configuration', | ||
'storage_pid' => '2', | ||
'files_folder' => '1:/staedte/beispielstadt/events/', | ||
'region' => '1', | ||
'rest_experience' => 'beispielstadt', | ||
'import_features' => '1', | ||
], | ||
], | ||
]; |
84 changes: 84 additions & 0 deletions
84
Tests/Functional/Import/DestinationDataTest/Fixtures/ResponseWithHtmlTextTexts.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
{ | ||
"status": "OK", | ||
"count": 1, | ||
"overallcount": 50, | ||
"channels": [], | ||
"facetGroups": [], | ||
"items": [ | ||
{ | ||
"global_id": "e_100354481", | ||
"id": "100354481", | ||
"type": "Event", | ||
"country": "Deutschland", | ||
"areas": [ | ||
"Rudolstadt und Umgebung" | ||
], | ||
"city": "Rudolstadt", | ||
"zip": "07407", | ||
"street": "Schulplatz 13", | ||
"phone": "0 36 72 - 48 64 20", | ||
"fax": "0 36 72 - 48 64 30", | ||
"web": "http://www.stadtbibliothek-rudolstadt.de/", | ||
"email": "[email protected]", | ||
"author": "[email protected]", | ||
"cuisine_types": [], | ||
"payment": [], | ||
"keywords": [], | ||
"timeIntervals": [ | ||
{ | ||
"weekdays": [], | ||
"start": "2022-07-13T15:00:00+02:00", | ||
"end": "2022-07-13T16:30:00+02:00", | ||
"tz": "Europe/Berlin", | ||
"interval": 1 | ||
} | ||
], | ||
"numbers": [], | ||
"name": "Stadtbibliothek Rudolstadt", | ||
"attributes": [ | ||
], | ||
"features": [ | ||
], | ||
"addresses": [ | ||
{ | ||
"name": "Städtetourismus in Thüringen e.V.", | ||
"city": "Weimar", | ||
"zip": "99423", | ||
"street": "UNESCO-Platz 1", | ||
"phone": "+49 (3643) 745 314", | ||
"web": "http://www.thueringer-staedte.de", | ||
"email": "[email protected]", | ||
"rel": "author" | ||
} | ||
], | ||
"created": "2099-11-10T23:02:00+00:00", | ||
"changed": "2099-12-14T08:28:00+00:00", | ||
"source": { | ||
"url": "http://destination.one/", | ||
"value": "destination.one" | ||
}, | ||
"company": "", | ||
"district": "", | ||
"postoffice": "", | ||
"phone2": "", | ||
"seasons": [], | ||
"subitems": [], | ||
"texts": [ | ||
{ | ||
"rel": "details", | ||
"type": "text/html", | ||
"value": "Die Lichter sind entzündet, die Plätzchen duften, man rückt endlich wieder näher zusammen und lauscht den Geschichten. Vier Schauspieler*innen unseres Theaters überraschen mit ihren weihnachtlichen Texten, die sie für uns ausgewählt haben. Dazu plaudern sie über persönliche Anekdoten und erinnern sich an ihre schönsten und verrücktesten Weihnachtsfeste. Und da der Genuss in der Vorweihnachtszeit nicht fehlen darf, wird an jedem Adventssonntag eine andere weihnachtliche Spezialität serviert.<br>Eintritt: 10 € (inkl. Gedeck mit weihnachtlicher Schillerlocke)<br>Um Voranmeldung unter 03672-486470 oder <a data-cke-saved-href=\"mailto:[email protected]\" href=\"mailto:[email protected]\">[email protected]</a> wird gebeten. <br><strong>Es gilt die 2G-PLUS-Regel.</strong> <br>" | ||
}, | ||
{ | ||
"rel": "details", | ||
"type": "text/plain", | ||
"value": "Die Lichter sind entzündet, die Plätzchen duften, man rückt endlich wieder näher zusammen und lauscht den Geschichten. Vier Schauspieler*innen unseres Theaters überraschen mit ihren weihnachtlichen Texten, die sie für uns ausgewählt haben. Dazu plaudern sie über persönliche Anekdoten und erinnern sich an ihre schönsten und verrücktesten Weihnachtsfeste. Und da der Genuss in der Vorweihnachtszeit nicht fehlen darf, wird an jedem Adventssonntag eine andere weihnachtliche Spezialität serviert.\nEintritt: 10 € (inkl. Gedeck mit weihnachtlicher Schillerlocke)\nUm Voranmeldung unter 03672-486470 oder [email protected] wird gebeten.\nEs gilt die 2G-PLUS-Regel." | ||
} | ||
], | ||
"title": "Kurzf\u00fchrung - Historische Altstadt", | ||
"type": "Event", | ||
"web": "http://www.erfurt-tourismus.de/stadtfuehrung/individuell/kurzfuehrung-historische-altstadt/", | ||
"zip": "99084" | ||
} | ||
] | ||
} |
Oops, something went wrong.