Skip to content

Commit

Permalink
OP-344: Fix for entity relations + translations
Browse files Browse the repository at this point in the history
  • Loading branch information
jkindly committed Aug 14, 2024
1 parent 8912311 commit dda16c2
Show file tree
Hide file tree
Showing 16 changed files with 193 additions and 20 deletions.
2 changes: 1 addition & 1 deletion src/Migrations/Version20240808102216.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public function getDescription(): string
public function up(Schema $schema): void
{
$this->addSql('ALTER TABLE bitbag_cms_page ADD teaser_image_id INT DEFAULT NULL, ADD teaser_title VARCHAR(255) DEFAULT NULL, ADD teaser_content LONGTEXT DEFAULT NULL');
$this->addSql('ALTER TABLE bitbag_cms_page ADD CONSTRAINT FK_18F07F1BF56F16CF FOREIGN KEY (teaser_image_id) REFERENCES bitbag_cms_media (id)');
$this->addSql('ALTER TABLE bitbag_cms_page ADD CONSTRAINT FK_18F07F1BF56F16CF FOREIGN KEY (teaser_image_id) REFERENCES bitbag_cms_media (id) ON DELETE SET NULL');
$this->addSql('CREATE INDEX IDX_18F07F1BF56F16CF ON bitbag_cms_page (teaser_image_id)');
}

Expand Down
9 changes: 1 addition & 8 deletions src/Resources/config/doctrine/Media.orm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,7 @@
</join-table>
</many-to-many>

<one-to-many field="pages" target-entity="BitBag\SyliusCmsPlugin\Entity\PageInterface" mapped-by="teaserImage" orphan-removal="true">
<cascade>
<cascade-all />
</cascade>
<order-by>
<order-by-field name="id" />
</order-by>
</one-to-many>
<one-to-many field="pages" target-entity="BitBag\SyliusCmsPlugin\Entity\PageInterface" mapped-by="teaserImage"/>

</mapped-superclass>
</doctrine-mapping>
2 changes: 1 addition & 1 deletion src/Resources/config/doctrine/Page.orm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
<field name="teaserContent" column="teaser_content" type="text" nullable="true"/>

<many-to-one field="teaserImage" target-entity="BitBag\SyliusCmsPlugin\Entity\MediaInterface" inversed-by="pages">
<join-column name="teaser_image_id" referenced-column-name="id" nullable="true" />
<join-column name="teaser_image_id" referenced-column-name="id" nullable="true" on-delete="SET NULL"/>
</many-to-one>

</mapped-superclass>
Expand Down
20 changes: 10 additions & 10 deletions src/Resources/config/services/form.xml
Original file line number Diff line number Diff line change
Expand Up @@ -94,57 +94,57 @@
<tag name="form.type" />
</service>

<service id="bitbag_sylius_cms_plugin.form.type.content_element.single_media" class="BitBag\SyliusCmsPlugin\Form\Type\ContentElements\SingleMediaContentElementType">
<service id="bitbag_sylius_cms_plugin.form.type.content_element.single_media" class="BitBag\SyliusCmsPlugin\Form\Type\ContentElements\SingleMediaContentElementType">
<argument type="service" id="bitbag_sylius_cms_plugin.repository.media" />
<tag name="bitbag_sylius_cms_plugin.content_elements.type" key="%bitbag_sylius_cms_plugin.content_elements.type.single_media%" />
<tag name="form.type" />
</service>

<service id="bitbag_sylius_cms_plugin.form.type.content_element.multiple_media" class="BitBag\SyliusCmsPlugin\Form\Type\ContentElements\MultipleMediaContentElementType">
<service id="bitbag_sylius_cms_plugin.form.type.content_element.multiple_media" class="BitBag\SyliusCmsPlugin\Form\Type\ContentElements\MultipleMediaContentElementType">
<argument type="service" id="bitbag_sylius_cms_plugin.form.type.data_transformer.multiple_media_to_codes" />
<tag name="bitbag_sylius_cms_plugin.content_elements.type" key="%bitbag_sylius_cms_plugin.content_elements.type.multiple_media%" />
<tag name="form.type" />
</service>

<service id="bitbag_sylius_cms_plugin.form.type.content_element.heading" class="BitBag\SyliusCmsPlugin\Form\Type\ContentElements\HeadingContentElementType">
<service id="bitbag_sylius_cms_plugin.form.type.content_element.heading" class="BitBag\SyliusCmsPlugin\Form\Type\ContentElements\HeadingContentElementType">
<tag name="bitbag_sylius_cms_plugin.content_elements.type" key="%bitbag_sylius_cms_plugin.content_elements.type.heading%" />
<tag name="form.type" />
</service>

<service id="bitbag_sylius_cms_plugin.form.type.content_element.products_carousel" class="BitBag\SyliusCmsPlugin\Form\Type\ContentElements\ProductsCarouselContentElementType">
<service id="bitbag_sylius_cms_plugin.form.type.content_element.products_carousel" class="BitBag\SyliusCmsPlugin\Form\Type\ContentElements\ProductsCarouselContentElementType">
<tag name="bitbag_sylius_cms_plugin.content_elements.type" key="%bitbag_sylius_cms_plugin.content_elements.type.products_carousel%" />
<tag name="form.type" />
</service>

<service id="bitbag_sylius_cms_plugin.form.type.content_element.products_carousel_by_taxon" class="BitBag\SyliusCmsPlugin\Form\Type\ContentElements\ProductsCarouselByTaxonContentElementType">
<service id="bitbag_sylius_cms_plugin.form.type.content_element.products_carousel_by_taxon" class="BitBag\SyliusCmsPlugin\Form\Type\ContentElements\ProductsCarouselByTaxonContentElementType">
<argument type="service" id="sylius.repository.taxon" />
<tag name="bitbag_sylius_cms_plugin.content_elements.type" key="%bitbag_sylius_cms_plugin.content_elements.type.products_carousel_by_taxon%" />
<tag name="form.type" />
</service>

<service id="bitbag_sylius_cms_plugin.form.type.content_element.products_grid" class="BitBag\SyliusCmsPlugin\Form\Type\ContentElements\ProductsGridContentElementType">
<service id="bitbag_sylius_cms_plugin.form.type.content_element.products_grid" class="BitBag\SyliusCmsPlugin\Form\Type\ContentElements\ProductsGridContentElementType">
<tag name="bitbag_sylius_cms_plugin.content_elements.type" key="%bitbag_sylius_cms_plugin.content_elements.type.products_grid%" />
<tag name="form.type" />
</service>

<service id="bitbag_sylius_cms_plugin.form.type.content_element.products_grid_by_taxon" class="BitBag\SyliusCmsPlugin\Form\Type\ContentElements\ProductsGridByTaxonContentElementType">
<service id="bitbag_sylius_cms_plugin.form.type.content_element.products_grid_by_taxon" class="BitBag\SyliusCmsPlugin\Form\Type\ContentElements\ProductsGridByTaxonContentElementType">
<argument type="service" id="sylius.repository.taxon" />
<tag name="bitbag_sylius_cms_plugin.content_elements.type" key="%bitbag_sylius_cms_plugin.content_elements.type.products_grid_by_taxon%" />
<tag name="form.type" />
</service>

<service id="bitbag_sylius_cms_plugin.form.type.content_element.taxons_list" class="BitBag\SyliusCmsPlugin\Form\Type\ContentElements\TaxonsListContentElementType">
<service id="bitbag_sylius_cms_plugin.form.type.content_element.taxons_list" class="BitBag\SyliusCmsPlugin\Form\Type\ContentElements\TaxonsListContentElementType">
<tag name="bitbag_sylius_cms_plugin.content_elements.type" key="%bitbag_sylius_cms_plugin.content_elements.type.taxons_list%" />
<tag name="form.type" />
</service>

<service id="bitbag_sylius_cms_plugin.form.type.content_element.pages_collection" class="BitBag\SyliusCmsPlugin\Form\Type\ContentElements\PagesCollectionContentElementType">
<service id="bitbag_sylius_cms_plugin.form.type.content_element.pages_collection" class="BitBag\SyliusCmsPlugin\Form\Type\ContentElements\PagesCollectionContentElementType">
<argument type="service" id="bitbag_sylius_cms_plugin.repository.collection" />
<tag name="bitbag_sylius_cms_plugin.content_elements.type" key="%bitbag_sylius_cms_plugin.content_elements.type.pages_collection%" />
<tag name="form.type" />
</service>

<service id="bitbag_sylius_cms_plugin.form.type.content_element.spacer" class="BitBag\SyliusCmsPlugin\Form\Type\ContentElements\SpacerContentElementType">
<service id="bitbag_sylius_cms_plugin.form.type.content_element.spacer" class="BitBag\SyliusCmsPlugin\Form\Type\ContentElements\SpacerContentElementType">
<tag name="bitbag_sylius_cms_plugin.content_elements.type" key="%bitbag_sylius_cms_plugin.content_elements.type.spacer%" />
<tag name="form.type" />
</service>
Expand Down
15 changes: 15 additions & 0 deletions src/Resources/translations/messages.cs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ bitbag_sylius_cms_plugin:
taxons_list: Seznam taxonů
products_grid: Produkty v mřížce
products_grid_by_taxon: Produkty v mřížce podle taxonu
pages_collection: Kolekce stránek
spacer: Oddělovač
spacer_height: Výška oddělovače v pixelech
heading_type: Typ nadpisu
taxon: Taxon
display_for_products:
Expand All @@ -30,6 +33,18 @@ bitbag_sylius_cms_plugin:
label: Zobrazit pro taxony
help: Vyberte taxony, ve kterých se bude tento blok zobrazovat
manage_block_display: Správa zobrazení bloku
templates: Šablony
new_template: Nová šablona
edit_template: Upravit šablonu
use_page_template: Použít šablonu stránky
use_this_template: Použít tuto šablonu
load_template_confirmation_modal_text: Tato operace vymaže aktuální konfiguraci prvků obsahu. Opravdu si přejete pokračovat?
teaser:
header: Ukázka
title: Název ukázky
content: Obsah ukázky
image: Obrázek ukázky
help: Jedná se o malý náhled stránky. Používá se při vykreslování kolekce stránek.
cms:
content_management: Obsahový management
cms: Obsahový management
Expand Down
15 changes: 15 additions & 0 deletions src/Resources/translations/messages.cs_CZ.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ bitbag_sylius_cms_plugin:
taxons_list: Seznam taxonů
products_grid: Produkty v mřížce
products_grid_by_taxon: Produkty v mřížce podle taxonu
pages_collection: Kolekce stránek
spacer: Oddělovač
spacer_height: Výška oddělovače v pixelech
heading_type: Typ nadpisu
taxon: Taxon
display_for_products:
Expand All @@ -30,6 +33,18 @@ bitbag_sylius_cms_plugin:
label: Zobrazit pro taxony
help: Vyberte taxony, ve kterých se bude tento blok zobrazovat
manage_block_display: Správa zobrazení bloku
templates: Šablony
new_template: Nová šablona
edit_template: Upravit šablonu
use_page_template: Použít šablonu stránky
use_this_template: Použít tuto šablonu
load_template_confirmation_modal_text: Tato operace vymaže aktuální konfiguraci prvků obsahu. Opravdu si přejete pokračovat?
teaser:
header: Ukázka
title: Název ukázky
content: Obsah ukázky
image: Obrázek ukázky
help: Jedná se o malý náhled stránky. Používá se při vykreslování kolekce stránek.
cms:
content_management: Obsahový management
cms: Obsahový management
Expand Down
15 changes: 15 additions & 0 deletions src/Resources/translations/messages.de.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ bitbag_sylius_cms_plugin:
taxons_list: Taxon-Liste
products_grid: Produkte im Raster
products_grid_by_taxon: Produkte im Raster nach Taxon
pages_collection: Seitenkollektion
spacer: Abstandshalter
spacer_height: Höhe des Abstandshalters in Pixeln
heading_type: Überschrift-Typ
taxon: Taxon
display_for_products:
Expand All @@ -80,3 +83,15 @@ bitbag_sylius_cms_plugin:
label: Display für Taxons
help: Wählen Sie Taxonen aus, in denen dieser Block angezeigt wird
manage_block_display: Blockanzeige verwalten
templates: Vorlagen
new_template: Neue Vorlage
edit_template: Vorlage bearbeiten
use_page_template: Seitenschablone verwenden
use_this_template: Diese Vorlage verwenden
load_template_confirmation_modal_text: Dieser Vorgang wird die aktuelle Konfiguration der Inhaltselemente löschen. Sind Sie sicher, dass Sie fortfahren möchten?
teaser:
header: Vorschau
title: Vorschau-Titel
content: Vorschau-Inhalt
image: Vorschau-Bild
help: Es ist eine kleine Vorschau der Seite. Sie wird beim Rendern einer Sammlung von Seiten verwendet.
15 changes: 15 additions & 0 deletions src/Resources/translations/messages.es.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ bitbag_sylius_cms_plugin:
taxons_list: Lista de taxones
products_grid: Productos en cuadrícula
products_grid_by_taxon: Productos en cuadrícula por taxón
pages_collection: Colección de páginas
spacer: Separador
spacer_height: Altura del separador en píxeles
heading_type: Tipo de encabezado
taxon: Taxón
display_for_products:
Expand All @@ -59,3 +62,15 @@ bitbag_sylius_cms_plugin:
label: Mostrar para taxones
help: Seleccione taxones en los que se mostrará este bloque
manage_block_display: Administrar visualización de bloques
templates: Plantillas
new_template: Nueva plantilla
edit_template: Editar plantilla
use_page_template: Usar plantilla de página
use_this_template: Usar esta plantilla
load_template_confirmation_modal_text: Esta operación borrará la configuración actual de los elementos de contenido. ¿Está seguro de que desea continuar?
teaser:
header: Avance
title: Título del avance
content: Contenido del avance
image: Imagen del avance
help: Es una pequeña vista previa de la página. Se utiliza al renderizar una colección de páginas.
15 changes: 15 additions & 0 deletions src/Resources/translations/messages.fr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ bitbag_sylius_cms_plugin:
taxons_list: Liste de taxons
products_grid: Produits en grille
products_grid_by_taxon: Produits en grille par taxon
pages_collection: Collection de pages
spacer: Espacement
spacer_height: Hauteur de l'espacement en pixels
heading_type: Type d'en-tête
taxon: Taxon
display_for_products:
Expand All @@ -77,3 +80,15 @@ bitbag_sylius_cms_plugin:
label: Afficher pour les taxons
help: Ce bloc sera affiché pour les taxons sélectionnés
manage_block_display: Gérer l'affichage du bloc
templates: Modèles
new_template: Nouveau modèle
edit_template: Modifier le modèle
use_page_template: Utiliser le modèle de page
use_this_template: Utiliser ce modèle
load_template_confirmation_modal_text: Cette opération effacera la configuration actuelle des éléments de contenu. Êtes-vous sûr de vouloir continuer ?
teaser:
header: Aperçu
title: Titre de l'aperçu
content: Contenu de l'aperçu
image: Image de l'aperçu
help: Il s'agit d'un petit aperçu de la page. Il est utilisé lors du rendu d'une collection de pages.
15 changes: 15 additions & 0 deletions src/Resources/translations/messages.hr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ bitbag_sylius_cms_plugin:
taxons_list: Lista taksona
products_grid: Proizvodi u mreži
products_grid_by_taxon: Proizvodi u mreži po taksonu
pages_collection: Kolekcija stranica
spacer: Razmak
spacer_height: Visina razmaka u pikselima
heading_type: Tip naslova
taxon: Takson
display_for_products:
Expand All @@ -59,3 +62,15 @@ bitbag_sylius_cms_plugin:
label: Prikaz za takson
help: Odaberite taksone u kojima će se ovaj blok prikazati
manage_block_display: Upravljanje prikazom bloka
templates: Predlošci
new_template: Novi predložak
edit_template: Uredi predložak
use_page_template: Koristi predložak stranice
use_this_template: Koristi ovaj predložak
load_template_confirmation_modal_text: Ova operacija će izbrisati trenutnu konfiguraciju elemenata sadržaja. Jeste li sigurni da želite nastaviti?
teaser:
header: Pregled
title: Naslov pregleda
content: Sadržaj pregleda
image: Slika pregleda
help: Ovo je mali pregled stranice. Koristi se prilikom prikazivanja zbirke stranica.
15 changes: 15 additions & 0 deletions src/Resources/translations/messages.lt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ bitbag_sylius_cms_plugin:
taxons_list: Taksonų sąrašas
products_grid: Produktų tinklelis
products_grid_by_taxon: Produktų tinklelis pagal taksoną
pages_collection: Puslapių kolekcija
spacer: Tarpo elementas
spacer_height: Tarpo aukštis pikseliais
heading_type: Antraštės tipas
taxon: Taksonas
display_for_products:
Expand All @@ -76,3 +79,15 @@ bitbag_sylius_cms_plugin:
label: Rodyti taksonams
help: Pasirinkite taksonus, kuriuose šis blokas bus rodomas
manage_block_display: Bloko rodymo valdymas
templates: Šablonai
new_template: Naujas šablonas
edit_template: Redaguoti šabloną
use_page_template: Naudoti puslapio šabloną
use_this_template: Naudoti šį šabloną
load_template_confirmation_modal_text: Ši operacija ištrins dabartinę turinio elementų konfigūraciją. Ar tikrai norite tęsti?
teaser:
header: Anonsas
title: Anonso pavadinimas
content: Anonso turinys
image: Anonso nuotrauka
help: Tai mažas puslapio peržiūra. Ji naudojama kuriant puslapių kolekciją.
15 changes: 15 additions & 0 deletions src/Resources/translations/messages.nl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ bitbag_sylius_cms_plugin:
taxons_list: Taxon lijst
products_grid: Producten grid
products_grid_by_taxon: Producten grid per taxon
pages_collection: Pagina collectie
spacer: Afstandhouder
spacer_height: Hoogte van de afstandhouder in pixels
heading_type: Kop type
taxon: Taxon
display_for_products:
Expand All @@ -58,3 +61,15 @@ bitbag_sylius_cms_plugin:
label: Display voor taxons
help: Selecteer taxonen waarin dit blok wordt weergegeven
manage_block_display: Beheer blok weergave
templates: Sjablonen
new_template: Nieuwe sjabloon
edit_template: Sjabloon bewerken
use_page_template: Sjabloon voor pagina gebruiken
use_this_template: Deze sjabloon gebruiken
load_template_confirmation_modal_text: Deze actie zal de huidige configuratie van inhoudselementen wissen. Weet je zeker dat je verder wilt gaan?
teaser:
header: Voorbeeld
title: Voorbeeldtitel
content: Voorbeeldinhoud
image: Voorbeeldafbeelding
help: Dit is een kleine preview van de pagina. Het wordt gebruikt bij het renderen van een verzameling pagina's.
15 changes: 15 additions & 0 deletions src/Resources/translations/messages.pl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ bitbag_sylius_cms_plugin:
taxons_list: Lista taksonomii
products_grid: Siatka produktów
products_grid_by_taxon: Siatka produktów według taksonomii
pages_collection: Kolekcja stron
spacer: Odstęp
spacer_height: Wysokość odstępu w pikselach
heading_type: Typ nagłówka
taxon: Taksonomia
display_for_products:
Expand All @@ -63,3 +66,15 @@ bitbag_sylius_cms_plugin:
label: Wyświetlaj dla taksonomii
help: Wybież taksonomie, dla których ten blok będzie wyświetlany
manage_block_display: Zarządzaj wyświetlaniem bloku
templates: Szablony
new_template: Nowy szablon
edit_template: Edytuj szablon
use_page_template: Użyj szablonu strony
use_this_template: Użyj tego szablonu
load_template_confirmation_modal_text: Ta operacja spowoduje usunięcie bieżącej konfiguracji elementów zawartości. Czy na pewno chcesz kontynuować?
teaser:
header: Zapowiedź
title: Tytuł zapowiedzi
content: Treść zapowiedzi
image: Obrazek zapowiedzi
help: To mały podgląd strony. Używa się go podczas renderowania kolekcji stron.
Loading

0 comments on commit dda16c2

Please sign in to comment.