Skip to content

Commit d8b672a

Browse files
committed
Merge branch '5.0' into release_notes
# Conflicts: # docs/release_notes/ibexa_dxp_v4.6.md # docs/release_notes/ibexa_dxp_v5.0.md
2 parents ae9603d + 374471e commit d8b672a

3,605 files changed

Lines changed: 68068 additions & 26587 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.

.github/workflows/build.yaml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,18 @@ jobs:
6565
exit 1
6666
fi
6767
68+
markdownlint:
69+
runs-on: ubuntu-latest
70+
if: github.event_name == 'pull_request'
71+
72+
steps:
73+
- uses: actions/checkout@v4
74+
75+
- name: Run markdownlint
76+
uses: DavidAnson/markdownlint-cli2-action@v20
77+
with:
78+
globs: "docs/**/*.md"
79+
6880
vale-check:
6981
runs-on: ubuntu-latest
7082
if: github.event_name == 'pull_request'
@@ -82,7 +94,7 @@ jobs:
8294
mv vale-styles-main/* vale-styles-main/.vale.ini .
8395
8496
- name: Run Vale.sh
85-
uses: errata-ai/vale-action@reviewdog
97+
uses: vale-cli/vale-action@v2
8698
with:
8799
reporter: github-check
88100
filter_mode: added

.markdownlint-cli2.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
config:
2+
default: false
3+
heading-style: consistent
4+
list-indent: true
5+
no-reversed-links: true
6+
no-missing-space-atx: true
7+
heading-start-left: true
8+
no-multiple-space-blockquote: true
9+
no-blanks-blockquote: true
10+
hr-style: true
11+
no-empty-links: true
12+
code-fence-style: backtick
13+
strong-style: asterisk
14+
table-pipe-style:
15+
style: leading_and_trailing
16+
17+
ignores:
18+
- "docs/snippets/**"
19+
- "docs/index.md"

README.md

Lines changed: 25 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,9 @@ If you'd like to see Ibexa DXP in your language, you can [contribute to the tran
2020

2121
### Contribute to API reference
2222

23-
The REST API Reference is located in the `docs/api/rest_api/rest_api_reference/rest_api_reference.html`
24-
file, which is generated automatically by the RAML2HTML tool.
25-
It is based on `*.raml` files located in the `docs/api/rest_api/rest_api_reference/input` directory that you can edit in your editor/IDE.
26-
27-
After you modify relevant files in the input folder, you can generate an HTML file from repository root (this step can also be performed by one of the Tech Writers during PR review):
28-
29-
`php tools/raml2html/raml2html.php build --non-standard-http-methods=COPY,MOVE,PUBLISH,SWAP -t default -o docs/api/rest_api/rest_api_reference/output/ docs/api/rest_api/rest_api_reference/input/ibexa.raml`
30-
31-
In case of errors, look for mistakes in the RAML file, for example, double apostrophes.
32-
Move `rest_api_reference.html` from the output folder to `docs/api/rest_api/rest_api_reference/` root.
33-
34-
See `tools/raml2html/README.md` for more information.
23+
The REST API Reference is located in the `docs/api/rest_api/rest_api_reference/` directory.
24+
It is based on an OpenAPI specification (`openapi.yaml` / `openapi.json`) generated from the Ibexa DXP source code.
25+
To contribute to the REST API reference, you must modify the source code annotations directly.
3526

3627
## Build and preview documentation
3728

@@ -53,6 +44,28 @@ of the command.
5344

5445
## Testing the code samples
5546

47+
### markdownlint
48+
49+
This repository uses [markdownlint-cli2](https://github.com/DavidAnson/markdownlint-cli2) to check Markdown formatting, including table syntax.
50+
51+
Install dependencies:
52+
53+
```bash
54+
yarn install
55+
```
56+
57+
Run the linter:
58+
59+
```bash
60+
yarn markdownlint
61+
```
62+
63+
Some issues can be fixed automatically:
64+
65+
```bash
66+
yarn markdownlint --fix
67+
```
68+
5669
### PHPStan
5770

5871
This repository uses PHPStan to test the code samples. To run the tests locally execute the commands below:
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
ibexa_connector_gemini:
2+
text_to_text:
3+
models:
4+
gemini-pro-latest:
5+
label: 'Gemini Pro Latest'
6+
max_tokens: 4096
7+
gemini-flash-latest:
8+
label: 'Gemini Flash Latest'
9+
max_tokens: 4096
10+
default_model: gemini-pro-latest
11+
default_max_tokens: 4096 # Must be <= the model’s max_tokens
12+
default_temperature: 0.8
13+
image_to_text:
14+
models:
15+
gemini-flash-latest:
16+
label: 'Gemini Flash Latest'
17+
max_tokens: 4096
18+
default_model: gemini-flash-latest
19+
default_max_tokens: 4096
20+
default_temperature: 1.0
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: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
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 readonly class NotificationScenarioSubscriber implements EventSubscriberInterface
15+
{
16+
public function __construct(private NotificationService $notificationService)
17+
{
18+
}
19+
20+
public static function getSubscribedEvents(): array
21+
{
22+
return [
23+
RenderProductTourScenarioEvent::class => ['onRenderScenario'],
24+
];
25+
}
26+
27+
public function onRenderScenario(RenderProductTourScenarioEvent $event): void
28+
{
29+
$scenario = $event->getScenario();
30+
$steps = $scenario->getSteps();
31+
32+
if ($scenario->getIdentifier() !== 'notifications') {
33+
return;
34+
}
35+
36+
foreach ($steps as $step) {
37+
$scenario->removeStep($step);
38+
}
39+
40+
if (!$this->hasUnreadNotifications()) {
41+
return;
42+
}
43+
44+
$customStep = new ProductTourStep();
45+
$customStep->setIdentifier('custom_step_identifier');
46+
$customStep->setInteractionMode('clickable');
47+
$customStep->setTarget('.ibexa-header-user-menu__notifications-toggler');
48+
$customStep->setTitle('You have unread notifications');
49+
$customStep->addBlock(new TextBlock('Click here to preview your unread notifications.'));
50+
$customStep->addBlock(new LinkBlock(
51+
'https://doc.ibexa.co/projects/userguide/en/latest/getting_started/notifications/',
52+
'Learn more about notifications'
53+
));
54+
55+
$scenario->addStep($customStep);
56+
}
57+
58+
private function hasUnreadNotifications(): bool
59+
{
60+
return $this->notificationService->getPendingNotificationCount() > 0;
61+
}
62+
}
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);

0 commit comments

Comments
 (0)