Skip to content

Commit 7c5e266

Browse files
mnoconjulitafalconduszakonradobozaadriendupuis
authored
Release 4.6.22 (#2867)
* Added new Twig Component group (#2790) * Twig Component follow ups (#2792) * Added Priority for YAML configuration * Added doc for storefront groups * Adjusted paths * Update docs/templating/layout/customize_storefront_layout.md Co-authored-by: julitafalcondusza <[email protected]> --------- Co-authored-by: julitafalcondusza <[email protected]> * [Twig Components] Added Menu component (#2799) * Docs: Add Menu component to Twig Components documentation * Docs: Extend Twig Components YAML example with Menu component * Discounts 4.6.22 (#2810) * Adjusted code samples * [Discounts] Added doc for 4.6.22 * Fixed limit mention * Added update mention * Removed mentions of OverridePrioritatization * Wording * Update code_samples/discounts/src/Command/ManageDiscountsCommand.php Co-authored-by: Konrad Oboza <[email protected]> * Fixed highlights * Review suggestions * Added missing v prefix --------- Co-authored-by: Konrad Oboza <[email protected]> * IBX-9147: Symbol attribute type described in Developer Documentation - v4.6 (#2525) * Symbol attribute type described * Fixes after review * PHP CS Fixes * Resolved conflicts in product search criteria * Added composer dependency * fixes * review fixes * PHP & JS CS Fixes * symbol_attribute_type.md moved to Attributes folder * fixes; mysql added * fix in the table * fix --------- Co-authored-by: julitafalcondusza <[email protected]> Co-authored-by: Marek Nocoń <[email protected]> * Update 4.6.22 (#2851) * Adjusted code samples * [Discounts] Added doc for 4.6.22 * Fixed limit mention * Added update mention * Removed mentions of OverridePrioritatization * Wording * Update code_samples/discounts/src/Command/ManageDiscountsCommand.php Co-authored-by: Konrad Oboza <[email protected]> * Fixed highlights * Review suggestions * Added missing v prefix * Added doc for IBX-9933 * Fixed badge --------- Co-authored-by: Konrad Oboza <[email protected]> * IBX-9845: Solr9 (#2866) * Adjusted code samples * [Discounts] Added doc for 4.6.22 * Fixed limit mention * Added update mention * Removed mentions of OverridePrioritatization * Wording * Update code_samples/discounts/src/Command/ManageDiscountsCommand.php Co-authored-by: Konrad Oboza <[email protected]> * Fixed highlights * Review suggestions * Added missing v prefix * Described requirements * Added Solr 9 instructions * Fixed link * Updated instructions * Apply suggestions from code review Co-authored-by: julitafalcondusza <[email protected]> --------- Co-authored-by: Konrad Oboza <[email protected]> Co-authored-by: julitafalcondusza <[email protected]> * Release notes (#2869) * IBX-10262: Added mention of the renamed class * Release notes for 4.6.22 * Apply suggestions from code review Co-authored-by: julitafalcondusza <[email protected]> * Review fixes * Fixed link * Last minute fixes --------- Co-authored-by: julitafalcondusza <[email protected]> * Regenerated baseline * Removed bullet * Bumped latest tag * Added PHP API links * Added mention about Symbol attribute * Fixed link * Moved PHP API Symbol links * symbol_attribute_type.md: Link to PHP API Ref --------- Co-authored-by: julitafalcondusza <[email protected]> Co-authored-by: Konrad Oboza <[email protected]> Co-authored-by: julitafalcondusza <[email protected]> Co-authored-by: Adrien Dupuis <[email protected]>
1 parent 1bc83bc commit 7c5e266

File tree

31 files changed

+723
-89
lines changed

31 files changed

+723
-89
lines changed
Lines changed: 31 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,24 @@
11
ibexa_twig_components:
22
admin-ui-user-menu:
3-
custom-html-component:
4-
type: html
5-
arguments:
6-
content: '<b>Hello world!</b>'
7-
custom-template-component:
8-
type: template
9-
arguments:
10-
template: '@ibexadesign/ui/component/user_thumbnail/user_thumbnail.html.twig'
11-
parameters:
12-
user_content:
13-
name: "Thumbnail"
14-
thumbnail:
15-
resource: https://placecats.com/100/100
163
custom-controller-component:
174
type: controller
185
arguments:
196
controller: '\App\Controller\MyController::requestAction'
207
parameters:
218
parameter1: 'custom'
229
parameter2: true
23-
admin-ui-stylesheet-head:
24-
custom-link-component:
25-
type: stylesheet
10+
custom-html-component:
11+
type: html
12+
priority: 0
2613
arguments:
27-
href: 'https://fonts.googleapis.com/css?family=Roboto:300,300i,400,400i,700,700i%7CRoboto+Mono:400,400i,700,700i&amp;display=fallback'
28-
rel: stylesheet
29-
crossorigin: anonymous
30-
integrity: sha384-LN/mLhO/GN6Ge8ZPvI7uRsZpiXmtSkep+aFlJcHa8by4TvA34o1am9sa88eUzKTD
31-
type: text/css
14+
content: '<b>Hello world!</b>'
15+
admin-ui-user-menu:
16+
duplicated_user_menu:
17+
type: menu
18+
arguments:
19+
name: ezplatform_admin_ui.menu.user
20+
template: '@ibexadesign/ui/menu/user.html.twig'
21+
depth: 1
3222
admin-ui-script-head:
3323
custom-script-component:
3424
type: script
@@ -39,3 +29,23 @@ ibexa_twig_components:
3929
async: true
4030
integrity: sha384-Ewi2bBDtPbbu4/+fs8sIbBJ3zVl0LDOSznfhFR/JBK+SzggdRdX8XQKauWmI9HH2
4131
type: text/javascript
32+
admin-ui-stylesheet-head:
33+
custom-link-component:
34+
type: stylesheet
35+
arguments:
36+
href: 'https://fonts.googleapis.com/css?family=Roboto:300,300i,400,400i,700,700i%7CRoboto+Mono:400,400i,700,700i&amp;display=fallback'
37+
rel: stylesheet
38+
crossorigin: anonymous
39+
integrity: sha384-LN/mLhO/GN6Ge8ZPvI7uRsZpiXmtSkep+aFlJcHa8by4TvA34o1am9sa88eUzKTD
40+
type: text/css
41+
admin-ui-global-search:
42+
custom-template-component:
43+
type: template
44+
priority: 50
45+
arguments:
46+
template: '@ibexadesign/ui/component/user_thumbnail/user_thumbnail.html.twig'
47+
parameters:
48+
user_content:
49+
name: "Thumbnail"
50+
thumbnail:
51+
resource: https://placecats.com/100/100
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?php declare(strict_types=1);
2+
3+
use Ibexa\Contracts\ProductCatalog\Values\Product\ProductQuery;
4+
use Ibexa\Contracts\ProductCatalogSymbolAttribute\Search\Criterion\SymbolAttribute;
5+
6+
$query = new ProductQuery();
7+
$query->setFilter(new SymbolAttribute('ean', ['5023920187205']));
8+
/** @var \Ibexa\Contracts\ProductCatalog\ProductServiceInterface $productService */
9+
$results = $productService->findProducts($query);
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
type: discount_code
2+
mode: create
3+
code: summer10
4+
global_usage_limit: 100 # Optional
5+
user_usage_limit: 5 # Optional
6+
created_at: '2023-01-01T12:00:00+00:00' # Optional
7+
creator_id: 42 # Optional

code_samples/discounts/src/Command/ManageDiscountsCommand.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@ protected function execute(InputInterface $input, OutputInterface $output): int
5959

6060
$discountCodeCreateStruct = new DiscountCodeCreateStruct(
6161
'summer10',
62-
null, // Unlimited usage
62+
10, // Global usage limit
63+
null, // Unlimited usage per customer
6364
$this->permissionResolver->getCurrentUserReference()->getUserId(),
6465
$now
6566
);
@@ -78,7 +79,11 @@ protected function execute(InputInterface $input, OutputInterface $output): int
7879
new IsInRegions(['germany', 'france']),
7980
new IsProductInArray(['product-1', 'product-2']),
8081
new IsInCurrency('EUR'),
81-
new IsValidDiscountCode($discountCode->getCode(), $discountCode->getUsedLimit()),
82+
new IsValidDiscountCode(
83+
$discountCode->getCode(),
84+
$discountCode->getGlobalLimit(),
85+
$discountCode->getUsedLimit()
86+
),
8287
])
8388
->setTranslations([
8489
new DiscountTranslationStruct('eng-GB', 'Discount name', 'This is a discount description', 'Promotion Label', 'Promotion Description'),
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace App\PIM\Symbol\Format\Checksum;
6+
7+
use Ibexa\Contracts\ProductCatalog\Values\AttributeDefinitionInterface;
8+
use Ibexa\Contracts\ProductCatalogSymbolAttribute\Value\ChecksumInterface;
9+
10+
final class LuhnChecksum implements ChecksumInterface
11+
{
12+
public function validate(AttributeDefinitionInterface $attributeDefinition, string $value): bool
13+
{
14+
$digits = $this->getDigits($value);
15+
16+
$count = count($digits);
17+
$total = 0;
18+
for ($i = $count - 2; $i >= 0; $i -= 2) {
19+
$digit = $digits[$i];
20+
if ($i % 2 === 0) {
21+
$digit *= 2;
22+
}
23+
24+
$total += $digit > 9 ? $digit - 9 : $digit;
25+
}
26+
27+
$checksum = $digits[$count - 1];
28+
29+
return $total + $checksum === 0;
30+
}
31+
32+
/**
33+
* Returns an array of digits from the given value (skipping any formatting characters).
34+
*
35+
* @return int[]
36+
*/
37+
private function getDigits(string $value): array
38+
{
39+
$chars = array_filter(
40+
str_split($value),
41+
static fn (string $char): bool => $char !== '-'
42+
);
43+
44+
return array_map('intval', array_values($chars));
45+
}
46+
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
CREATE TABLE ibexa_product_specification_attribute_symbol (id INT NOT NULL, value VARCHAR(160) DEFAULT NULL, INDEX ibexa_product_specification_attribute_symbol_value_idx (value), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_520_ci` ENGINE = InnoDB;
2+
ALTER TABLE ibexa_product_specification_attribute_symbol ADD CONSTRAINT ibexa_product_specification_attribute_symbol_fk FOREIGN KEY (id) REFERENCES ibexa_product_specification_attribute (id) ON UPDATE CASCADE ON DELETE CASCADE
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
CREATE TABLE ibexa_product_specification_attribute_symbol (id INT NOT NULL, value VARCHAR(160) DEFAULT NULL, PRIMARY KEY(id));
2+
CREATE INDEX ibexa_product_specification_attribute_symbol_value_idx ON ibexa_product_specification_attribute_symbol (value);
3+
ALTER TABLE ibexa_product_specification_attribute_symbol ADD CONSTRAINT ibexa_product_specification_attribute_symbol_fk FOREIGN KEY (id) REFERENCES ibexa_product_specification_attribute (id) ON UPDATE CASCADE ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE;

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,8 @@
7070
"ibexa/twig-components": "~4.6.x-dev",
7171
"ibexa/tree-builder": "~4.6.x-dev",
7272
"ibexa/discounts": "~4.6.x-dev",
73-
"ibexa/discounts-codes": "~4.6.x-dev"
73+
"ibexa/discounts-codes": "~4.6.x-dev",
74+
"ibexa/product-catalog-symbol-attribute": "~4.6.x-dev"
7475
},
7576
"scripts": {
7677
"fix-cs": "php-cs-fixer fix --config=.php-cs-fixer.php -v --show-progress=dots",

docs/administration/back_office/back_office_elements/custom_components.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ The available groups for the back office are:
4747
|`admin-ui-systeminfo-tab-groups`| `vendor/ibexa/system-info/src/bundle/Resources/views/themes/admin/system_info/info.html.twig` |
4848
|`admin-ui-user-menu`| `vendor/ibexa/admin-ui-ui/src/bundle/Resources/views/themes/admin/ui/layout.html.twig` |
4949
|`admin-ui-user-profile-blocks`| `vendor/ibexa/admin-ui/src/bundle/Resources/views/themes/admin/account/profile/view.html.twig` |
50+
|`admin-ui-versions-table-before`|`vendor/ibexa/admin-ui/src/bundle/Resources/views/themes/admin/content/tab/versions/table.html.twig`|
5051

5152
For more information, see [this example using few of those components](components.md#example).
5253

docs/api/event_reference/discounts_events.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ The events below are dispatched when managing [discounts](discounts_guide.md):
1515

1616
| Event | Dispatched by |
1717
|---|---|
18-
|[BeforeCreateDiscountEvent](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Discounts-Event-BeforeCreateDiscountEvent.html)| [DiscountServiceInterface](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Discounts-DiscountServiceInterface.html)
19-
|[CreateDiscountEvent](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Discounts-Event-CreateDiscountEvent.html)| [DiscountServiceInterface](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Discounts-DiscountServiceInterface.html)
20-
|[BeforeDeleteDiscountEvent](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Discounts-Event-BeforeDeleteDiscountEvent.html)| [DiscountServiceInterface](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Discounts-DiscountServiceInterface.html)
21-
|[DeleteDiscountEvent](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Discounts-Event-DeleteDiscountEvent.html)| [DiscountServiceInterface](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Discounts-DiscountServiceInterface.html)
18+
|[BeforeCreateDiscountEvent](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Discounts-Event-BeforeCreateDiscountEvent.html)| [DiscountServiceInterface](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Discounts-DiscountServiceInterface.html) |
19+
|[CreateDiscountEvent](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Discounts-Event-CreateDiscountEvent.html)| [DiscountServiceInterface](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Discounts-DiscountServiceInterface.html) |
20+
|[BeforeDeleteDiscountEvent](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Discounts-Event-BeforeDeleteDiscountEvent.html)| [DiscountServiceInterface](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Discounts-DiscountServiceInterface.html) |
21+
|[DeleteDiscountEvent](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Discounts-Event-DeleteDiscountEvent.html)| [DiscountServiceInterface](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Discounts-DiscountServiceInterface.html) |
2222
|[BeforeUpdateDiscountEvent](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Discounts-Event-BeforeUpdateDiscountEvent.html)| [DiscountServiceInterface](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Discounts-DiscountServiceInterface.html)|
23-
|[UpdateDiscountEvent](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Discounts-Event-UpdateDiscountEvent.html)| [DiscountServiceInterface](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Discounts-DiscountServiceInterface.html)|
23+
|[UpdateDiscountEvent](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Discounts-Event-UpdateDiscountEvent.html)| [DiscountServiceInterface](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Discounts-DiscountServiceInterface.html) |
2424

2525
## Form events
2626

0 commit comments

Comments
 (0)