Browse Source

Merge branch 'hotfix/update-liip-cache'

Vincent 1 year ago
parent
commit
ab8881c85b

+ 4 - 2
sql/schema-extensions/001-view_public_events.sql

@@ -25,8 +25,8 @@ CREATE OR REPLACE VIEW view_public_events AS
         r.localisation AS roomLocalisation,
         r.capacity AS roomCapacity,
         r.floorSize AS roomFloorSize,
-        IF(b.image_id is not null, CONCAT('https://api.opentalent.fr/app.php/_internal/secure/files/', b.image_id, '/raw'), null) AS imageUrl,
-        IF(b.image_id is not null, CONCAT('https://api.opentalent.fr/app.php/_internal/secure/files/', b.image_id, '/300x0'), null) AS thumbnailUrl,
+        IF(b.image_id is not null, CONCAT('https://api.opentalent.fr/api/public/files/', b.image_id, '/download/lg'), null) AS imageUrl,
+        IF(b.image_id is not null, CONCAT('https://api.opentalent.fr/api/public/files/', b.image_id, '/download/md'), null) AS thumbnailUrl,
         (SELECT GROUP_CONCAT(DISTINCT CONCAT(f.code))
          FROM event_categories AS ec
             LEFT JOIN Categories AS cs ON(cs.id = ec.categories_id)
@@ -34,6 +34,7 @@ CREATE OR REPLACE VIEW view_public_events AS
          WHERE ec.event_id = b.id
         ) AS categories,
         'opentalent' as origin,
+        b.image_id as imgId,
         b.id as entityId
     FROM Booking AS b
         INNER JOIN Organization o ON o.id = b.organization_id
@@ -77,6 +78,7 @@ CREATE OR REPLACE VIEW view_public_events AS
         aw.mediumimage as thumbnailUrl,
         aw.categoryCode AS categories,
         'awin' as origin,
+        NULL as imgId,
         aw.id as entityId
     FROM AwinProduct as aw
     WHERE

+ 3 - 1
sql/schema-extensions/002-view_federation_structures.sql

@@ -1,6 +1,8 @@
 CREATE OR REPLACE VIEW view_federation_structures
 AS
-    SELECT o.id, o.name, o.logo_id as logoId, o.description, o.image_id as imageId, o.principalType as type, p.website as website,
+    SELECT o.id, o.name, o.logo_id as logoId, o.description, o.image_id as imageId, o.principalType as type,
+           o.portailVisibility,
+           IF(p.website is not null AND p.website != '', p.website, CONCAT('https://', p.subDomain, '.opentalent.fr')) AS website,
            CONCAT('[', GROUP_CONCAT(COLUMN_JSON(COLUMN_CREATE(
                    'type', oa.type, 'latitude', a.latitude, 'longitude', a.longitude,
                    'streetAddress', TRIM(BOTH '\n' FROM CONCAT_WS('\n', a.streetAddress, a.streetAddressSecond, a.streetAddressThird)),

+ 15 - 0
src/Entity/Public/FederationStructure.php

@@ -4,6 +4,7 @@ declare(strict_types=1);
 
 namespace App\Entity\Public;
 
+use ApiPlatform\Doctrine\Orm\Filter\BooleanFilter;
 use ApiPlatform\Doctrine\Orm\Filter\NumericFilter;
 use ApiPlatform\Doctrine\Orm\Filter\SearchFilter;
 use ApiPlatform\Metadata\ApiFilter;
@@ -39,6 +40,7 @@ use Symfony\Component\Serializer\Annotation\Groups;
 #[ApiFilter(filterClass: SearchFilter::class, properties: ['name' => 'partial', 'city' => 'exact'])]
 #[ApiFilter(filterClass: NumericFilter::class, properties: ['id', 'parentId'])]
 #[ApiFilter(filterClass: FindInSetFilter::class, properties: ['parents'])]
+#[ApiFilter(filterClass: BooleanFilter::class, properties: ['portailVisibility'])]
 class FederationStructure
 {
     #[ORM\Id]
@@ -126,6 +128,10 @@ class FederationStructure
     #[Groups(['federation_structure_item_get', 'federation_structure_collection_get'])]
     private array $parents;
 
+    #[ORM\Column(options: ['default' => false])]
+    #[Groups(['federation_structure_item_get', 'federation_structure_collection_get'])]
+    private bool $portailVisibility = false;
+
     public function getId(): int
     {
         return $this->id;
@@ -389,4 +395,13 @@ class FederationStructure
 
         return $this;
     }
+
+    public function getPortailVisibility(): bool{
+        return $this->portailVisibility;
+    }
+
+    public function setPortailVisibility(bool $portailVisibility) : FederationStructure{
+        $this->portailVisibility = $portailVisibility;
+        return $this;
+    }
 }

+ 15 - 0
src/Entity/Public/PublicEvent.php

@@ -123,6 +123,9 @@ class PublicEvent
     #[ORM\Column]
     private int $priceMaxi;
 
+    #[ORM\Column]
+    private int $imgId;
+
     // categoryCode
     #[ORM\Column]
     private ?string $categoryCode;
@@ -441,6 +444,18 @@ class PublicEvent
         return $this;
     }
 
+    public function getImgId(): int
+    {
+        return $this->imgId;
+    }
+
+    public function setImgId(int $imgId): PublicEvent
+    {
+        $this->imgId = $imgId;
+
+        return $this;
+    }
+
     public function getCategoryCode(): ?string
     {
         return $this->categoryCode;