Skip to content

Commit ab983e3

Browse files
mnoconjulitafalconduszadabrtadriendupuis
authored
Release 4.6.29 (#3135)G
* Added doc for TaxonomyNoEntries & TaxonomySubtree (#3082) * Added doc for TaxonomyNoEntries * Added doc for Taxonomy subtree * Fixed CS * Apply suggestions from code review Co-authored-by: julitafalcondusza <117284672+julitafalcondusza@users.noreply.github.com> Co-authored-by: Tomasz Dąbrowski <64841871+dabrt@users.noreply.github.com> * Apply suggestion from @mnocon * Rebuild --------- Co-authored-by: julitafalcondusza <117284672+julitafalcondusza@users.noreply.github.com> Co-authored-by: Tomasz Dąbrowski <64841871+dabrt@users.noreply.github.com> * Product tour (#3065) * Product tour doc skeleton * Review feedback * Vale * Review feedback - part 2 * Added doc for the new config * Review feedback * Adjusted includes * Wording * Specified button name * Removed TODO * Help Center and Product tour enabled by default * Added images and interactive demo * Apply suggestions from code review Co-authored-by: Tomasz Dąbrowski <64841871+dabrt@users.noreply.github.com> Co-authored-by: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> * Manual changes * [TMP] Fix build * Fixed build * Reworded --------- Co-authored-by: Tomasz Dąbrowski <64841871+dabrt@users.noreply.github.com> Co-authored-by: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> * Added doc for additional parameter for ibexa_render (#3043) * Added doc for additional parameter for ibexa_render * Added update sections * Update docs/update_and_migration/from_5.0/update_from_5.0.md Co-authored-by: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> * Reworked RN drafts * Update docs/release_notes/ibexa_dxp_v4.6.md Co-authored-by: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> * Removed RN entries --------- Co-authored-by: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> * Release 4.6.29 fixes (#3139) * Highlight and wording fixes * Added mention of Product Tour to 4.6 * search_api.md: Minor fixes * Release 4.6.29 update (#3144) * Extracted GraphQL samples to separate files * Fixed GraphQL code samples * Updated GraphQl sample * DB update added * Added description * Added GrpahQL Security issue to ignore list * Added regenration mention * Selfreview * Ignore security warning conditionally * Simplified the examples * Wording * Apply suggestions from code review Co-authored-by: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> --------- Co-authored-by: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> --------- Co-authored-by: julitafalcondusza <117284672+julitafalcondusza@users.noreply.github.com> Co-authored-by: Tomasz Dąbrowski <64841871+dabrt@users.noreply.github.com> Co-authored-by: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com>
1 parent 9c623c2 commit ab983e3

34 files changed

Lines changed: 902 additions & 99 deletions

.github/workflows/code_samples.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ jobs:
4141
SATIS_NETWORK_TOKEN: ${{ secrets.SATIS_NETWORK_TOKEN }}
4242
GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }}
4343

44+
- name: Ignore audit advisory for PHP 7.4
45+
if: matrix.php == '7.4'
46+
run: composer config audit.ignore --json '{"GHSA-68jq-c3rv-pcrr": "As this is for code quality tests and not to run a production DXP, this can be ignored."}'
47+
4448
- uses: ramsey/composer-install@v3
4549
with:
4650
dependency-versions: highest
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
services:
2+
App\GraphQL\Schema\MyFieldDefinitionMapper:
3+
decorates: Ibexa\GraphQL\Schema\Domain\Content\Mapper\FieldDefinition\DecoratingFieldDefinitionMapper
4+
arguments:
5+
$innerMapper: '@.inner'

code_samples/api/graphql/src/GraphQL/Schema/MyCustomFieldDefinitionMapper.php

Lines changed: 0 additions & 14 deletions
This file was deleted.
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<?php declare(strict_types=1);
2+
3+
namespace App\GraphQL\Schema;
4+
5+
use Ibexa\Contracts\Core\Repository\Values\ContentType\ContentType;
6+
use Ibexa\Contracts\Core\Repository\Values\ContentType\FieldDefinition;
7+
use Ibexa\Contracts\GraphQL\Schema\Domain\Content\Mapper\FieldDefinition\FieldDefinitionMapper;
8+
use Ibexa\GraphQL\Schema\Domain\Content\Mapper\FieldDefinition\DecoratingFieldDefinitionMapper;
9+
use Symfony\Component\Serializer\NameConverter\CamelCaseToSnakeCaseNameConverter;
10+
11+
class MyFieldDefinitionMapper extends DecoratingFieldDefinitionMapper implements FieldDefinitionMapper
12+
{
13+
protected function getFieldTypeIdentifier(): string
14+
{
15+
return 'my_field_type';
16+
}
17+
18+
public function mapToFieldValueInputType(ContentType $contentType, FieldDefinition $fieldDefinition): ?string
19+
{
20+
if (!$this->canMap($fieldDefinition)) {
21+
return parent::mapToFieldValueInputType($contentType, $fieldDefinition);
22+
}
23+
24+
return $this->nameMyFieldInputType($contentType, $fieldDefinition);
25+
}
26+
27+
private function nameMyFieldInputType(ContentType $contentType, FieldDefinition $fieldDefinition): string
28+
{
29+
$converter = new CamelCaseToSnakeCaseNameConverter(null, false);
30+
31+
return sprintf(
32+
'%s%sInput',
33+
$converter->denormalize($contentType->identifier),
34+
$converter->denormalize($fieldDefinition->identifier)
35+
);
36+
}
37+
}
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: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
use Ibexa\Contracts\Core\Repository\Values\Content\Query;
6+
use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion\ContentTypeIdentifier;
7+
use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion\LogicalAnd;
8+
use Ibexa\Contracts\Taxonomy\Search\Query\Criterion\TaxonomyNoEntries;
9+
10+
$query = new Query();
11+
$query->query = new LogicalAnd(
12+
[
13+
new TaxonomyNoEntries('tags'),
14+
new ContentTypeIdentifier('article'),
15+
]
16+
);
17+
18+
/** @var \Ibexa\Contracts\Core\Repository\SearchService $searchService */
19+
$results = $searchService->findContent($query);
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
use Ibexa\Contracts\Core\Repository\Values\Content\Query;
6+
use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion\ContentTypeIdentifier;
7+
use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion\LogicalAnd;
8+
use Ibexa\Contracts\Taxonomy\Search\Query\Criterion\TaxonomySubtree;
9+
10+
$query = new Query();
11+
$query->query = new LogicalAnd(
12+
[
13+
new TaxonomySubtree(42),
14+
new ContentTypeIdentifier('article'),
15+
]
16+
);
17+
18+
/** @var \Ibexa\Contracts\Core\Repository\SearchService $searchService */
19+
$results = $searchService->findContent($query);

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@
7676
"ibexa/collaboration": "~4.6.x-dev",
7777
"ibexa/share": "~4.6.x-dev",
7878
"ibexa/phpstan": "~4.6.-dev",
79+
"ibexa/integrated-help": "~4.6.x-dev",
7980
"ibexa/cdp": "~4.6.x-dev",
8081
"ibexa/image-editor": "~4.6.x-dev"
8182
},

0 commit comments

Comments
 (0)