Skip to content

Commit

Permalink
Merge pull request #4 from stefanpoensgen/feature/shopware-6.6
Browse files Browse the repository at this point in the history
feat: shopware 6.6
  • Loading branch information
stefanpoensgen authored Apr 6, 2024
2 parents 20424ac + 2d95a61 commit 7e5d0b3
Show file tree
Hide file tree
Showing 37 changed files with 142 additions and 203 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/github.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ jobs:
uses: FriendsOfShopware/actions/.github/workflows/github.yml@main
with:
extensionName: ${{ github.event.repository.name }}
shopwareVersion: '6.5.0'
shopwareVersion: '6.6.0'
secrets:
ghToken: ${{ secrets.GITHUB_TOKEN }}
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "Comments on the order",
"type": "shopware-platform-plugin",
"license": "MIT",
"version": "2.0.1",
"version": "3.0.0",
"authors": [
{
"name": "Stefan Poensgen"
Expand Down Expand Up @@ -39,7 +39,7 @@
}
},
"require": {
"shopware/core": "~6.5.0",
"shopware/administration": "~6.5.0"
"shopware/core": "~6.6.0",
"shopware/administration": "~6.6.0"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ public function __construct(
private readonly OrderEntity $order,
private readonly OrderCommentEntity $orderComment,
private readonly Context $context
) {
}
) {}

public function getName(): string
{
Expand All @@ -54,6 +53,7 @@ public static function getAvailableData(): EventDataCollection
->add('orderComment', new EntityType(OrderCommentDefinition::class));
}

#[\Override]
public function getMailStruct(): MailRecipientStruct
{
if (!$this->order->getOrderCustomer() instanceof OrderCustomerEntity) {
Expand All @@ -65,6 +65,7 @@ public function getMailStruct(): MailRecipientStruct
]);
}

#[\Override]
public function getSalesChannelId(): string
{
return $this->order->getSalesChannelId();
Expand All @@ -75,11 +76,13 @@ public function getContext(): Context
return $this->context;
}

#[\Override]
public function getOrderId(): string
{
return $this->getOrder()->getId();
}

#[\Override]
public function getCustomerId(): string
{
$customer = $this->getOrder()->getOrderCustomer();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ class CheckoutOrderCommentUpdatedEvent extends CheckoutOrderCommentCreatedEvent
{
public const EVENT_NAME = 'checkout.order.comment.updated';

#[\Override]
public function getName(): string
{
return self::EVENT_NAME;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,11 @@
use SptecOrderComments\Core\Checkout\Order\Event\CheckoutOrderCommentUpdatedEvent;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;

class BusinessEventCollectorSubscriber implements EventSubscriberInterface
readonly class BusinessEventCollectorSubscriber implements EventSubscriberInterface
{
public function __construct(private readonly BusinessEventCollector $businessEventCollector)
{
}
public function __construct(private BusinessEventCollector $businessEventCollector) {}

#[\Override]
public static function getSubscribedEvents(): array
{
return [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
*/
class OrderCommentCollection extends EntityCollection
{
#[\Override]
protected function getExpectedClass(): string
{
return OrderCommentEntity::class;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,25 +24,29 @@

class OrderCommentDefinition extends EntityDefinition
{
final public const ENTITY_NAME = 'sptec_order_comment';
final public const string ENTITY_NAME = 'sptec_order_comment';

final public const EXTENSION_NAME = 'sptecOrderComments';
final public const string EXTENSION_NAME = 'sptecOrderComments';

#[\Override]
public function getEntityName(): string
{
return self::ENTITY_NAME;
}

#[\Override]
public function getEntityClass(): string
{
return OrderCommentEntity::class;
}

#[\Override]
public function getCollectionClass(): string
{
return OrderCommentCollection::class;
}

#[\Override]
protected function defineFields(): FieldCollection
{
return new FieldCollection([
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

class OrderCommentExtension extends EntityExtension
{
#[\Override]
public function extendFields(FieldCollection $collection): void
{
$collection->add(
Expand All @@ -25,6 +26,7 @@ public function extendFields(FieldCollection $collection): void
);
}

#[\Override]
public function getDefinitionClass(): string
{
return OrderDefinition::class;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
*/
class OrderCommentMediaCollection extends EntityCollection
{
#[\Override]
protected function getExpectedClass(): string
{
return OrderCommentMediaEntity::class;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,28 +18,33 @@

class OrderCommentMediaDefinition extends EntityDefinition
{
final public const ENTITY_NAME = 'sptec_order_comment_media';
final public const string ENTITY_NAME = 'sptec_order_comment_media';

#[\Override]
public function getEntityName(): string
{
return self::ENTITY_NAME;
}

#[\Override]
public function getCollectionClass(): string
{
return OrderCommentMediaCollection::class;
}

#[\Override]
public function getEntityClass(): string
{
return OrderCommentMediaEntity::class;
}

#[\Override]
protected function getParentDefinitionClass(): ?string
{
return OrderCommentDefinition::class;
}

#[\Override]
protected function defineFields(): FieldCollection
{
return new FieldCollection([
Expand Down
2 changes: 2 additions & 0 deletions src/Extension/Content/Media/MediaExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

class MediaExtension extends EntityExtension
{
#[\Override]
public function extendFields(FieldCollection $collection): void
{
$collection->add(
Expand All @@ -24,6 +25,7 @@ public function extendFields(FieldCollection $collection): void
);
}

#[\Override]
public function getDefinitionClass(): string
{
return MediaDefinition::class;
Expand Down
2 changes: 2 additions & 0 deletions src/Extension/System/User/UserExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

class UserExtension extends EntityExtension
{
#[\Override]
public function extendFields(FieldCollection $collection): void
{
$collection->add(
Expand All @@ -23,6 +24,7 @@ public function extendFields(FieldCollection $collection): void
);
}

#[\Override]
public function getDefinitionClass(): string
{
return UserDefinition::class;
Expand Down
3 changes: 3 additions & 0 deletions src/Migration/Migration1661526504.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,13 @@

class Migration1661526504 extends MigrationStep
{
#[\Override]
public function getCreationTimestamp(): int
{
return 1661526504;
}

#[\Override]
public function update(Connection $connection): void
{
$query = <<<SQL
Expand All @@ -40,6 +42,7 @@ public function update(Connection $connection): void
$connection->executeStatement($query);
}

#[\Override]
public function updateDestructive(Connection $connection): void
{
$connection->executeStatement('DROP TABLE `sptec_order_comment`');
Expand Down
7 changes: 4 additions & 3 deletions src/Migration/Migration1663572635.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,13 @@

class Migration1663572635 extends MigrationStep
{
#[\Override]
public function getCreationTimestamp(): int
{
return 1663572635;
}

#[\Override]
public function update(Connection $connection): void
{
$query = <<<SQL
Expand All @@ -37,7 +39,6 @@ public function update(Connection $connection): void
$connection->executeStatement($query);
}

public function updateDestructive(Connection $connection): void
{
}
#[\Override]
public function updateDestructive(Connection $connection): void {}
}
11 changes: 6 additions & 5 deletions src/Migration/Migration1663665465.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,13 @@

class Migration1663665465 extends MigrationStep
{
#[\Override]
public function getCreationTimestamp(): int
{
return 1663665465;
}

#[\Override]
public function update(Connection $connection): void
{
$defaultFolderId = Uuid::randomBytes();
Expand All @@ -26,15 +28,14 @@ public function update(Connection $connection): void
$this->addMediaFolder($connection, $defaultFolderId, $configurationId);
}

public function updateDestructive(Connection $connection): void
{
}
#[\Override]
public function updateDestructive(Connection $connection): void {}

private function addMediaDefaultFolder(Connection $connection, string $defaultFolderId): void
{
$query = <<<SQL
INSERT IGNORE INTO `media_default_folder` (`id`, `association_fields`, `entity`, `created_at`)
VALUES (:id, '["sptecOrderComment"]', 'sptec_order_comment', :createdAt);
INSERT IGNORE INTO `media_default_folder` (`id`, `entity`, `created_at`)
VALUES (:id, 'sptec_order_comment', :createdAt);
SQL;

$connection->executeStatement($query, [
Expand Down
7 changes: 4 additions & 3 deletions src/Migration/Migration1665773845.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,18 @@

class Migration1665773845 extends MigrationStep
{
#[\Override]
public function getCreationTimestamp(): int
{
return 1665773845;
}

#[\Override]
public function update(Connection $connection): void
{
$connection->executeStatement('ALTER TABLE `sptec_order_comment` ADD `task` TINYINT(1) NULL DEFAULT NULL;');
}

public function updateDestructive(Connection $connection): void
{
}
#[\Override]
public function updateDestructive(Connection $connection): void {}
}
32 changes: 0 additions & 32 deletions src/Migration/Migration1683477576.php

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
import template from './sptec-media-item.html.twig';
import './sptec-media-item.scss';

/**
* @private
*/
Shopware.Component.register('sptec-media-item', {
template,

Expand Down
Loading

0 comments on commit 7e5d0b3

Please sign in to comment.