Skip to content

Commit c13c53e

Browse files
authored
Merge branch 'release-5.0.7' into release_notes_v5.0.7
2 parents cd5e0b2 + 89920b4 commit c13c53e

150 files changed

Lines changed: 8904 additions & 233 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
ibexa:
2+
system:
3+
admin_group:
4+
product_tour:
5+
my_general_scenario:
6+
type: 'general'
7+
scenario_title_translation_key: tour.my_general_scenario.title
8+
steps:
9+
welcome_step:
10+
step_title_translation_key: title
11+
background_image: /public/img/background.jpg
12+
blocks:
13+
- type: title
14+
params:
15+
text_translation_key: subtitle
16+
- type: text
17+
params:
18+
text_translation_key: tour.step.description
19+
- type: link
20+
params:
21+
url: https://doc.ibexa.co
22+
text_translation_key: tour.link.documentation
23+
- type: image
24+
params:
25+
src: /public/img/diagram.jpg
26+
alt_translation_key: tour.image.alt
27+
- type: video
28+
params:
29+
# 'Big Buck Bunny' licensed under CC 3.0 by the Blender foundation. Hosted by archive.org
30+
url: https://archive.org/download/BigBuckBunny_124/Content/big_buck_bunny_720p_surround.mp4
31+
- type: list
32+
params:
33+
title_translation_key: tour.list.title
34+
items_translation_keys:
35+
- tour.list.item1
36+
- tour.list.item2
37+
- tour.list.item3
38+
- type: twig_template
39+
params:
40+
template: custom_template.html.twig
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
ibexa:
2+
system:
3+
admin_group:
4+
product_tour:
5+
targetable_dashboard_scenario:
6+
type: 'targetable'
7+
scenario_title_translation_key: tour.targetable_dashboard_scenario.title
8+
steps:
9+
dashboard_options:
10+
step_title_translation_key: Open Dashboard options
11+
target: ".ibexa-db-header__more"
12+
# No interaction_mode specified or the value is set to null
13+
blocks:
14+
- type: text
15+
params:
16+
text_translation_key: Learn how to customize the blocks displayed on your dashboard
17+
open_dashboard_options:
18+
step_title_translation_key: Open Dashboard options
19+
target: '.ibexa-db-header__more'
20+
interaction_mode: clickable
21+
blocks:
22+
- type: text
23+
params:
24+
text_translation_key: Click here to customize your dashboard
25+
customize_dashboard:
26+
step_title_translation_key: Customize Dashboard
27+
target: '.ibexa-db-actions-popup-menu'
28+
interaction_mode: clickable
29+
blocks:
30+
- type: text
31+
params:
32+
text_translation_key: Choose "Customize dashboard"
33+
drag_and_drop_step:
34+
step_title_translation_key: Drag-and-drop blocks
35+
target: ".c-pb-toolbox-blocks-group__blocks > * .c-pb-toolbox-block__content:first-of-type"
36+
interaction_mode: draggable
37+
blocks:
38+
- type: text
39+
params:
40+
text_translation_key: Drag-and-drop blocks from the sidebar to the dashboard to customize it
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace App\EventSubscriber;
6+
7+
use Ibexa\Contracts\Core\Repository\NotificationService;
8+
use Ibexa\Contracts\IntegratedHelp\Event\RenderProductTourScenarioEvent;
9+
use Ibexa\IntegratedHelp\ProductTour\Block\LinkBlock;
10+
use Ibexa\IntegratedHelp\ProductTour\Block\TextBlock;
11+
use Ibexa\IntegratedHelp\ProductTour\ProductTourStep;
12+
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
13+
14+
final class NotificationScenarioSubscriber implements EventSubscriberInterface
15+
{
16+
private NotificationService $notificationService;
17+
18+
public function __construct(NotificationService $notificationService)
19+
{
20+
$this->notificationService = $notificationService;
21+
}
22+
23+
public static function getSubscribedEvents(): array
24+
{
25+
return [
26+
RenderProductTourScenarioEvent::class => ['onRenderScenario'],
27+
];
28+
}
29+
30+
public function onRenderScenario(RenderProductTourScenarioEvent $event): void
31+
{
32+
$scenario = $event->getScenario();
33+
$steps = $scenario->getSteps();
34+
35+
if ($scenario->getIdentifier() !== 'notifications') {
36+
return;
37+
}
38+
39+
foreach ($steps as $step) {
40+
$scenario->removeStep($step);
41+
}
42+
43+
if (!$this->hasUnreadNotifications()) {
44+
return;
45+
}
46+
47+
$customStep = new ProductTourStep();
48+
$customStep->setIdentifier('custom_step_identifier');
49+
$customStep->setInteractionMode('clickable');
50+
$customStep->setTarget('.ibexa-header-user-menu__notifications-toggler');
51+
$customStep->setTitle('You have unread notifications');
52+
$customStep->addBlock(new TextBlock('Click here to preview your unread notifications.'));
53+
$customStep->addBlock(new LinkBlock(
54+
'https://doc.ibexa.co/projects/userguide/en/latest/getting_started/notifications/',
55+
'Learn more about notifications'
56+
));
57+
58+
$scenario->addStep($customStep);
59+
}
60+
61+
private function hasUnreadNotifications(): bool
62+
{
63+
return $this->notificationService->getPendingNotificationCount() > 0;
64+
}
65+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?php declare(strict_types=1);
2+
3+
use Ibexa\Contracts\ProductCatalog\Values\Product\ProductQuery;
4+
use Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion\ProductCategorySubtree;
5+
6+
$taxonomyEntryId = 42;
7+
$criteria = new ProductCategorySubtree($taxonomyEntryId);
8+
9+
/** @var \Ibexa\Contracts\ProductCatalog\ProductServiceInterface $productService */
10+
$productQuery = new ProductQuery();
11+
$productQuery->setQuery($criteria);
12+
$results = $productService->findProducts($productQuery);
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?php declare(strict_types=1);
2+
3+
use DateTimeImmutable;
4+
use Ibexa\Contracts\ProductCatalog\Values\Product\ProductQuery;
5+
use Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion\Operator;
6+
use Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion\UpdatedAt;
7+
8+
$criteria = new UpdatedAt(
9+
new DateTimeImmutable('2023-03-01'),
10+
Operator::GTE,
11+
);
12+
13+
/** @var \Ibexa\Contracts\ProductCatalog\ProductServiceInterface $productService */
14+
$productQuery = new ProductQuery();
15+
$productQuery->setQuery($criteria);
16+
$results = $productService->findProducts($productQuery);
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?php declare(strict_types=1);
2+
3+
use DateTimeImmutable;
4+
use Ibexa\Contracts\ProductCatalog\Values\Product\ProductQuery;
5+
use Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion\UpdatedAtRange;
6+
7+
$criteria = new UpdatedAtRange(
8+
new DateTimeImmutable('2020-07-10T00:00:00+00:00'),
9+
new DateTimeImmutable('2023-07-12T00:00:00+00:00'),
10+
);
11+
12+
/** @var \Ibexa\Contracts\ProductCatalog\ProductServiceInterface $productService */
13+
$productQuery = new ProductQuery();
14+
$productQuery->setQuery($criteria);
15+
$results = $productService->findProducts($productQuery);
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
-
2+
type: sql
3+
mode: execute
4+
query:
5+
-
6+
driver: mysql
7+
sql: 'INSERT INTO test_table (test_value) VALUES ("foo");'
8+
-
9+
driver: sqlite
10+
sql: 'INSERT INTO test_table (test_value) VALUES ("foo");'
11+
-
12+
driver: postgresql
13+
sql: "INSERT INTO test_table (test_value) VALUES ('foo');"
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
-
2+
type: try_catch
3+
mode: execute
4+
allowed_exceptions:
5+
- Ibexa\Contracts\Core\Repository\Exceptions\InvalidArgumentException
6+
stop_after_first_exception: true
7+
steps:
8+
-
9+
type: language
10+
mode: create
11+
metadata:
12+
languageCode: ger-DE
13+
name: German
14+
enabled: true

code_samples/pim/Symbol/Format/Checksum/LuhnChecksum.php renamed to code_samples/product_catalog/Symbol/Format/Checksum/LuhnChecksum.php

File renamed without changes.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?php declare(strict_types=1);
2+
3+
namespace App\EventSubscriber;
4+
5+
use Ibexa\Contracts\ProductCatalog\Events\ProductAttributeRenderEvent;
6+
use Symfony\Component\EventDispatcher\Attribute\AsEventListener;
7+
8+
final readonly class MyAttributeRenderSubscriber
9+
{
10+
#[AsEventListener]
11+
public function onAttributeRender(ProductAttributeRenderEvent $event): void
12+
{
13+
$event->addTemplateBefore(
14+
'templates/product/attributes/integer_attribute.html.twig',
15+
'@ibexadesign/product_catalog/product/attributes/attribute_blocks.html.twig',
16+
);
17+
}
18+
}

0 commit comments

Comments
 (0)