Skip to content
This repository was archived by the owner on Feb 13, 2023. It is now read-only.

Commit 2094f22

Browse files
authored
Merge pull request #46 from ergonode/develop
Develop to Master
2 parents 5c9e1ce + 45dc428 commit 2094f22

File tree

102 files changed

+2351
-117
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

102 files changed

+2351
-117
lines changed

docs/_sidebar.md

Lines changed: 34 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
<!-- * [**Backend - production**](installation/backend-production.md) -->
66
* [**Frontend**](installation/frontend.md)
77
* [**Docker - contribution**](installation/docker.md)
8+
* [**Documentation**](installation/docs.md)
89
* [**Backend**](backend.md)
910
* [Architecture](backend/architecture.md)
1011
* [Coding standards](backend/coding_standards.md)
@@ -24,14 +25,44 @@
2425
* [Account](backend/modules/account.md)
2526
* [Core](backend/modules/core.md)
2627
* [Attribute](backend/modules/attribute.md)
27-
* [Importer](backend/modules/importer.md)
28+
* [Importer](backend/modules/importer.md)
2829
* [Transformer](backend/modules/transformer.md)
2930
* [Configuration](backend/configuration.md)
3031
* [Tests](backend/tests.md)
3132
* [Changelog](backend/changelog.md)
3233
* [**Frontend**](frontend.md)
33-
* [Architecture](frontend/architecture.md)
34-
* [Quality](frontend/quality.md)
34+
* [**Technologies**](frontend/technologies.md)
35+
* [**Architecture**](frontend/architecture.md)
36+
* [**Application structure**](frontend/architecture/app-structure.md)
37+
* [**Module structure**](frontend/architecture/module-structure.md)
38+
* [**Module configurations**](frontend/configurations.md)
39+
* [**Modules**](frontend/modules.md)
40+
* [**Core**](frontend/modules/core.md)
41+
* [**Authentication**](frontend/modules/authentication.md)
42+
* [**Users**](frontend/modules/users.md)
43+
* [**Notifications**](frontend/modules/notifications.md)
44+
* [**Attributes**](frontend/modules/attributes.md)
45+
* [**Categories**](frontend/modules/categories.md)
46+
* [**Products**](frontend/modules/products.md)
47+
* [**Templates**](frontend/modules/templates.md)
48+
* [**Product Statuses**](frontend/modules/statuses.md)
49+
* [**Category Trees**](frontend/modules/tree.md)
50+
* [**Activity Logs**](frontend/modules/activity_logs.md)
51+
* [**Conditions**](frontend/modules/conditions.md)
52+
* [**Collections**](frontend/modules/collections.md)
53+
* [**Segments**](frontend/modules/segments.md)
54+
* [**Status Transitions**](frontend/modules/transitions.md)
55+
* [**Media**](frontend/modules/media.md)
56+
* [**Comments**](frontend/modules/comments.md)
57+
* [**Import**](frontend/modules/import.md)
58+
* [**Channels**](frontend/modules/channels.md)
59+
* [**Dashboard**](frontend/modules/dashboard.md)
60+
* [**Cookbook**](frontend/cookbook.md)
61+
* [**Create New Project**](frontend/cookbook/new_project.md)
62+
* [**Create New Module**](frontend/cookbook/new_module.md)
63+
* [**Extend Toolbar Menu**](frontend/cookbook/extend_toolbar_menu.md)
64+
* [**In depth**](frontend/in-depth/in-depth.md)
65+
* [**Autosave**](frontend/in-depth/autosave.md)
3566
* [**Community**](community.md)
3667
* [Contribution](community/contribution.md)
3768
* [Code of Conduct](community/code_of_conduct.md)

docs/backend/cookbook.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,6 @@
1010
* [New Grid Column Type](backend/cookbook/new_grid_column_type.md)
1111
* [New Condition](backend/cookbook/new_condition.md)
1212
* [New Channel](backend/cookbook/new_channel.md)
13+
* [New Mass Action](backend/cookbook/new_mass_action.md)
1314

1415

docs/backend/cookbook/new_attribute.md

Lines changed: 59 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@ This file should live in `Your-module\Application\Form\Attribute\` namespace ext
1212
In Ergonode system we have several Abstract Attribute classes (you can find them in `Ergonode\Attribute\Domain\Entity\Attribute` namespace), it depends on what kind of attribute you want to create, you can either use one of already created or create a custom one.
1313

1414
Keep in mind that Abstract Attribute class should extend `\Ergonode\Attribute\Domain\Entity\AbstractAttribute`.
15+
1516
```php
16-
namespace Ergonode\Attribute\Domain\Entity\Attribute;
17+
namespace YourNameSpace\Domain\Entity\Attribute;
1718

1819
/**
1920
*/
@@ -22,7 +23,7 @@ class YourAttribute extends AbstractCollectionAttribute implements AttributeInte
2223
public const TYPE = 'YOUR_ATTRIBUTE';
2324

2425
/**
25-
* @JMS\virtualProperty();
26+
* @JMS\VirtualProperty();
2627
* @JMS\SerializedName("type")
2728
*
2829
* @return string
@@ -42,7 +43,7 @@ Create a command for creation `CreateYourAttributeCommand`.
4243
This file should live in `Your-module\Domain\Command\Attribute\Create` namespace and extends `Ergonode\Attribute\Domain\Command\Attribute\AbstractCreateAttributeCommand`.
4344

4445
```php
45-
namespace Ergonode\Attribute\Domain\Command\Attribute\Create;
46+
namespace YourNameSpace\Domain\Command\Attribute\Create;
4647

4748
/**
4849
*/
@@ -55,9 +56,10 @@ Each command needs to have handler, class that handles the logic represented by
5556

5657
Create a handler `CreateYourAttributeCommandHandler`.
5758
This file should live in `Your-module\Infrastructure\Handler\Attribute\Create` namespace.
59+
Remember to tag the handler with `messenger.message_handler`
5860

5961
```php
60-
namespace Ergonode\Attribute\Infrastructure\Handler\Attribute\Create;
62+
namespace YourNameSpace\Infrastructure\Handler\Attribute\Create;
6163

6264
/**
6365
*/
@@ -93,7 +95,7 @@ class CreateYourAttributeCommandHandler
9395
);
9496

9597
foreach ($command->getGroups() as $group) {
96-
$attribute->addGroup(new AttributeGroupId($group));
98+
$attribute->addGroup($group);
9799
}
98100

99101
$this->attributeRepository->save($attribute);
@@ -104,7 +106,7 @@ class CreateYourAttributeCommandHandler
104106
Create a command for update `UpdateYourAttributeCommand`.This file should live in `Your-module\Domain\Command\Attribute\Update` namespace and extends `Ergonode\Attribute\Domain\Command\Attribute\AbstractUpdateAttributeCommand`.
105107

106108
```php
107-
namespace Ergonode\Attribute\Domain\Command\Attribute\Update;
109+
namespace YourNameSpace\Domain\Command\Attribute\Update;
108110

109111
/**
110112
*/
@@ -114,9 +116,10 @@ class UpdateYourAttributeCommand extends AbstractUpdateAttributeCommand
114116
```
115117

116118
Create a handler `UpdateYourAttributeCommandHandler`.This file should live in `Your-module\Infrastructure\Handler\Attribute\Upadate` namespace.
119+
Remember to tag the handler with `messenger.message_handler`
117120

118121
```php
119-
namespace Ergonode\Attribute\Infrastructure\Handler\Attribute\Update;
122+
namespace YourNameSpace\Infrastructure\Handler\Attribute\Update;
120123

121124
/**
122125
*/
@@ -154,11 +157,11 @@ class UpdateYourAttributeCommandHandler extends AbstractUpdateAttributeCommandHa
154157

155158
## Command factories
156159

157-
Create a handler for creation command `CreateYourAttributeCommandFactory`.This file should live in `Your-module\Infrastructure\Factory\Command\Create` namespace and implements `Ergonode\Attribute\Infrastructure\Factory\Command\CreateAttributeCommandFactoryInterface`
158-
160+
Create a handler for creation command `CreateYourAttributeCommandFactory`.This file should live in `Your-module\Infrastructure\Factory\Command\Create` namespace and implements `Ergonode\Attribute\Infrastructure\Factory\Command\CreateAttributeCommandFactoryInterface`
161+
If autoconfiguration is not used remember to tag your service with `component.attribute.create_attribute_command_factory_interface`
159162

160163
```php
161-
namespace Ergonode\Attribute\Infrastructure\Factory\Command\Create;
164+
namespace YourNameSpace\Infrastructure\Factory\Command\Create;
162165

163166
/**
164167
*/
@@ -199,9 +202,10 @@ class CreateYourAttributeCommandFactory implements CreateAttributeCommandFactory
199202
```
200203

201204
Create a handler for updating command `UpdateYourAttributeCommandFactory`.This file should live in `Your-module\Infrastructure\Factory\Command\Update` namespace and implements `Ergonode\Attribute\Infrastructure\Factory\Command\UpdateAttributeCommandFactoryInterface`
205+
If autoconfiguration is not used remember to tag your service with `component.attribute.update_attribute_command_factory_interface`
202206

203207
```php
204-
namespace Ergonode\Attribute\Infrastructure\Factory\Command\Update;
208+
namespace YourNameSpace\Infrastructure\Factory\Command\Update;
205209

206210
/**
207211
*/
@@ -235,7 +239,7 @@ class UpdateYourAttributeCommandFactory implements UpdateAttributeCommandFactory
235239
new TranslatableString($data->hint),
236240
new TranslatableString($data->placeholder),
237241
new AttributeScope($data->scope),
238-
$data->groups,
242+
array_map(fn($group) => new AttributeGroupId($group), $data->groups),
239243
);
240244
}
241245
}
@@ -244,12 +248,11 @@ class UpdateYourAttributeCommandFactory implements UpdateAttributeCommandFactory
244248
## Value Constrain Strategy
245249

246250
To be able to validate values which are used in our new attribute `YourAttributeValueConstraintStrategy` needs to be created. This file should live in `Your-module\Infrastructure\Provider\Strategy` namespace and implements `Ergonode\Attribute\Infrastructure\Provider\AttributeValueConstraintStrategyInterface`
251+
If autoconfiguration is not used remember to tag your service with `component.attribute.attribute_validation_interface`
247252

248253
```php
249-
namespace Ergonode\Attribute\Infrastructure\Provider\Strategy;
254+
namespace YourNameSpace\Infrastructure\Provider\Strategy;
250255

251-
/**
252-
*/
253256
class YourAttributeValueConstraintStrategy implements AttributeValueConstraintStrategyInterface
254257
{
255258
/**
@@ -283,9 +286,10 @@ Create form class `YouAttributeForm`
283286
This file should live in `Your-module\Application\Form\Attribute` namespace and extends:
284287
* `Symfony\Component\Form\AbstractType`
285288
* `Ergonode\Attribute\Application\Form\Attribute\AttributeFormInterface`
289+
If autoconfiguration is not used remember to tag your service with `attribute.form.attribute_form_interface`
286290

287291
```php
288-
namespace Ergonode\Attribute\Application\Form\Attribute;
292+
namespace YourNameSpace\Application\Form\Attribute;
289293

290294
class YourAttributeForm extends AbstractType implements AttributeFormInterface
291295
{
@@ -358,12 +362,36 @@ class YourAttributeForm extends AbstractType implements AttributeFormInterface
358362

359363
If you want be able to use your attribute on a grid you need to create following classes.
360364

365+
366+
Create column class `YourAttributeColumn`
367+
368+
This file should live in `Your-module\Grid\Column` namespace and extends `\Ergonode\Grid\Column\AbstractColumn`
369+
370+
```php
371+
namespace YourNameSpace\Grid\Column;
372+
373+
/**
374+
*/
375+
class YourColumn extends AbstractColumn
376+
{
377+
public const TYPE = 'YOUR_ATTRIBUTE';
378+
379+
/**
380+
* {@inheritDoc}
381+
*/
382+
public function getType(): string
383+
{
384+
return self::TYPE;
385+
}
386+
}
387+
```
388+
361389
Create strategy class `YourAttributeColumnStrategy`
362390

363391
This file should live in `Your-module\Infrastructure\Grid\Column\Provider\Strategy` namespace and implements `Ergonode\Product\Infrastructure\Grid\Column\Provider\Strategy\AttributeColumnStrategyInterface`
364392

365393
```php
366-
namespace Ergonode\Product\Infrastructure\Grid\Column\Provider\Strategy;
394+
namespace YourNameSpace\Infrastructure\Grid\Column\Provider\Strategy;
367395

368396
/**
369397
*/
@@ -395,7 +423,7 @@ Create DataSet Builder class `YourAttributeDataSetQueryBuilder`
395423
This file should live in `Your-module\Infrastructure\Grid\Builder\Query` namespace and extends `Ergonode\Product\Infrastructure\Grid\Builder\Query\AbstractAttributeDataSetBuilder`
396424

397425
```php
398-
namespace Ergonode\Product\Infrastructure\Grid\Builder\Query;
426+
namespace YourNameSpace\Infrastructure\Grid\Builder\Query;
399427

400428
/**
401429
*/
@@ -411,25 +439,30 @@ class YourAttributeDataSetQueryBuilder extends AbstractAttributeDataSetBuilder
411439
}
412440
```
413441

414-
Create column class `YourAttributeColumn`
415-
416-
This file should live in `Your-module\Grid\Column` namespace and extends `\Ergonode\Grid\Column\AbstractColumn`
442+
Create renderer class `YourAttributeColumnRenderer`
417443

418444
```php
419-
namespace Ergonode\Grid\Column;
445+
namespace YourNameSpace\Infrastructure\Grid\Column\Renderer;
420446

421447
/**
422448
*/
423-
class YourColumn extends AbstractColumn
449+
class YourAttributeColumnRenderer extends \Ergonode\Grid\Column\Renderer\ColumnRendererInterface
424450
{
425-
public const TYPE = 'YOUR_ATTRIBUTE';
451+
/**
452+
* {@inheritDoc}
453+
*/
454+
public function supports(ColumnInterface $column): bool
455+
{
456+
return $column instanceof YourAttributeColumn;
457+
}
426458

427459
/**
428460
* {@inheritDoc}
429461
*/
430-
public function getType(): string
462+
463+
public function render(ColumnInterface $column, string $id, array $row)
431464
{
432-
return self::TYPE;
465+
// TODO return your column value
433466
}
434467
}
435468
```
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# How to create new mass action
2+
3+
## Mass action processor class
4+
5+
Any custom mass action process must implement ```BatchActionProcessorInterface```
6+
7+
```php
8+
namespace YourNameSpace\Infrastructure\Processor;
9+
10+
use Ergonode\BatchAction\Domain\Entity\BatchActionId;
11+
use Ergonode\BatchAction\Domain\ValueObject\BatchActionMessage;
12+
use Ergonode\BatchAction\Domain\ValueObject\BatchActionType;
13+
use Ergonode\BatchAction\Infrastructure\Provider\BatchActionProcessorInterface;
14+
use Ergonode\SharedKernel\Domain\AggregateId;
15+
16+
class YourBatchActionProcessor implements BatchActionProcessorInterface
17+
{
18+
public function supports(BatchActionType $type): bool
19+
{
20+
return $type->getValue() === 'you type';
21+
}
22+
23+
/**
24+
* @return BatchActionMessage[]
25+
*/
26+
public function process(BatchActionId $id, AggregateId $resourceId): array
27+
{
28+
// here implement your action for given AggregateId
29+
}
30+
}
31+
```
32+
33+
If, for some reason, a mass action can't be processed for a given object, you can return information about it as array of ```BatchActionMessage``` objects
34+
In whole batch action this object is marked processed as unsuccessful.

docs/backend/modules/api.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Api
2+
3+
-----
4+
5+
Api module provides API related exception handling.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Authentication
2+
3+
----------------
4+
5+
Authentication module provides JWT token authentication integration with `lexik/jwt-authentication-bundle`.

docs/backend/modules/category.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Category
2+
3+
----------
4+
5+
Adds the possibility to create a tree structure of categories to organize products.

docs/backend/modules/comment.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Comment
2+
3+
---------
4+
5+
The module brings the possibility to comment on different types of Ergonode resources.

docs/backend/modules/completeness.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Completeness
2+
3+
--------------
4+
5+
Provides statistics for completeness of product creation with needed translations.

docs/backend/modules/condition.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Condition
2+
3+
-----------
4+
5+
Brings powerful abstraction and a handful of useful condition strategies implementation for different cases:
6+
* attribute exists
7+
* language completeness
8+
* numeric attribute value
9+
* option attribute value
10+
* product belongs to category
11+
* product belongs to category tree
12+
* product completeness
13+
* product has status
14+
* product has template
15+
* product sku exists
16+
* role exactly
17+
* test attribute value
18+
* user exactly

docs/backend/modules/designer.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Designer
2+
3+
----------
4+
5+
Introduces functionality and management of product templates.

docs/backend/modules/editor.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Editor
2+
3+
--------
4+
5+
The module gives the possibility to maintain product drafts.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Event-sourcing
2+
3+
----------------
4+
5+
The module provides an implementation for Event Sourcing with ready abstraction for Aggregates and Entities.

docs/backend/modules/exporter-file.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Exporter file
2+
3+
---------------
4+
5+
Based on the `ergonode/exporter` the modules brings the possibility to export Ergonode PIM data to file.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Exporter Magento 2
2+
3+
--------------------
4+
5+
Export functionality compliant with Magento 2.

0 commit comments

Comments
 (0)