Skip to content

Commit 761738a

Browse files
mstegmeyerBird87ZA
authored andcommitted
NEXT-36303 - Feature: In App Purchases
1 parent fcfc995 commit 761738a

File tree

149 files changed

+4861
-365
lines changed

Some content is hidden

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

149 files changed

+4861
-365
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
title: Allow injection of additional context actions above dangerous actions in sw-extension-card-base
3+
issue: NEXT-37409
4+
author: Lennart Tinkloh
5+
author_email: [email protected]
6+
author_github: @lernhart
7+
---
8+
# Administration
9+
* Added block `sw_extension_card_base_context_menu_actions_additional` in `sw-extension-card-base` to allow injection of additional context actions above dangerous actions like uninstall.

devenv.lock

+8-8
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
"devenv": {
44
"locked": {
55
"dir": "src/modules",
6-
"lastModified": 1731361978,
6+
"lastModified": 1732585607,
77
"owner": "cachix",
88
"repo": "devenv",
9-
"rev": "4b770aa91211fc1875d9d07aedf80ea2eae012d5",
9+
"rev": "a520f05c40ebecaf5e17064b27e28ba8e70c49fb",
1010
"type": "github"
1111
},
1212
"original": {
@@ -53,10 +53,10 @@
5353
},
5454
"nixpkgs": {
5555
"locked": {
56-
"lastModified": 1731245184,
56+
"lastModified": 1732238832,
5757
"owner": "NixOS",
5858
"repo": "nixpkgs",
59-
"rev": "aebe249544837ce42588aa4b2e7972222ba12e8f",
59+
"rev": "8edf06bea5bcbee082df1b7369ff973b91618b8d",
6060
"type": "github"
6161
},
6262
"original": {
@@ -68,10 +68,10 @@
6868
},
6969
"nixpkgs-stable": {
7070
"locked": {
71-
"lastModified": 1731239293,
71+
"lastModified": 1731797254,
7272
"owner": "NixOS",
7373
"repo": "nixpkgs",
74-
"rev": "9256f7c71a195ebe7a218043d9f93390d49e6884",
74+
"rev": "e8c38b73aeb218e27163376a2d617e61a2ad9b59",
7575
"type": "github"
7676
},
7777
"original": {
@@ -91,10 +91,10 @@
9191
"nixpkgs-stable": "nixpkgs-stable"
9292
},
9393
"locked": {
94-
"lastModified": 1731363552,
94+
"lastModified": 1732021966,
9595
"owner": "cachix",
9696
"repo": "pre-commit-hooks.nix",
97-
"rev": "cd1af27aa85026ac759d5d3fccf650abe7e1bbf0",
97+
"rev": "3308484d1a443fc5bc92012435d79e80458fe43c",
9898
"type": "github"
9999
},
100100
"original": {

phpstan-baseline.neon

-5
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
parameters:
22
ignoreErrors:
3-
-
4-
message: "#^Throwing new exceptions within classes are not allowed\\. Please use domain exception pattern\\. See https\\://github\\.com/shopware/platform/blob/v6\\.4\\.20\\.0/adr/2022\\-02\\-24\\-domain\\-exceptions\\.md$#"
5-
count: 5
6-
path: src/Administration/Controller/AdminExtensionApiController.php
7-
83
-
94
message: "#^Throwing new exceptions within classes are not allowed\\. Please use domain exception pattern\\. See https\\://github\\.com/shopware/platform/blob/v6\\.4\\.20\\.0/adr/2022\\-02\\-24\\-domain\\-exceptions\\.md$#"
105
count: 2

src/Administration/Controller/AdminExtensionApiController.php

+11-9
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,17 @@
22

33
namespace Shopware\Administration\Controller;
44

5-
use Shopware\Administration\Controller\Exception\AppByNameNotFoundException;
6-
use Shopware\Administration\Controller\Exception\MissingAppSecretException;
75
use Shopware\Core\Framework\App\ActionButton\AppAction;
86
use Shopware\Core\Framework\App\ActionButton\Executor;
97
use Shopware\Core\Framework\App\AppEntity;
8+
use Shopware\Core\Framework\App\AppException;
109
use Shopware\Core\Framework\App\Hmac\QuerySigner;
11-
use Shopware\Core\Framework\App\Manifest\Exception\UnallowedHostException;
1210
use Shopware\Core\Framework\App\Payload\AppPayloadServiceHelper;
1311
use Shopware\Core\Framework\Context;
1412
use Shopware\Core\Framework\DataAbstractionLayer\EntityRepository;
1513
use Shopware\Core\Framework\DataAbstractionLayer\Search\Criteria;
1614
use Shopware\Core\Framework\DataAbstractionLayer\Search\Filter\EqualsFilter;
15+
use Shopware\Core\Framework\Feature;
1716
use Shopware\Core\Framework\Log\Package;
1817
use Shopware\Core\Framework\Uuid\Uuid;
1918
use Shopware\Core\Framework\Validation\DataBag\RequestDataBag;
@@ -49,28 +48,31 @@ public function runAction(RequestDataBag $requestDataBag, Context $context): Res
4948
/** @var AppEntity|null $app */
5049
$app = $this->appRepository->search($criteria, $context)->first();
5150
if ($app === null) {
52-
throw new AppByNameNotFoundException($appName);
51+
throw AppException::appNotFoundByName($appName);
5352
}
5453

5554
if ($app->getAppSecret() === null) {
56-
throw new MissingAppSecretException();
55+
if (Feature::isActive('v6.7.0.0')) {
56+
throw AppException::appSecretMissing($app->getName());
57+
}
58+
throw AppException::secretMissing();
5759
}
5860

5961
$targetUrl = $requestDataBag->getString('url');
6062
$targetHost = \parse_url($targetUrl, \PHP_URL_HOST);
6163
$allowedHosts = $app->getAllowedHosts() ?? [];
6264
if (!$targetHost || !\in_array($targetHost, $allowedHosts, true)) {
63-
throw new UnallowedHostException($targetUrl, $allowedHosts, $app->getName());
65+
throw AppException::hostNotAllowed($targetUrl, $app->getName());
6466
}
6567

6668
$ids = $requestDataBag->get('ids', []);
6769
if (!$ids instanceof RequestDataBag) {
68-
throw new \InvalidArgumentException('Ids must be an array');
70+
throw AppException::invalidArgument('Ids must be an array');
6971
}
7072

7173
$action = new AppAction(
7274
$app,
73-
$this->appPayloadServiceHelper->buildSource($app->getVersion()),
75+
$this->appPayloadServiceHelper->buildSource($app->getVersion(), $app->getId()),
7476
$targetUrl,
7577
$requestDataBag->getString('entity'),
7678
$requestDataBag->getString('action'),
@@ -93,7 +95,7 @@ public function signUri(RequestDataBag $requestDataBag, Context $context): Respo
9395
/** @var AppEntity|null $app */
9496
$app = $this->appRepository->search($criteria, $context)->first();
9597
if ($app === null) {
96-
throw new AppByNameNotFoundException($appName);
98+
throw AppException::appNotFoundByName($appName);
9799
}
98100

99101
$uri = $this->querySigner->signUri($requestDataBag->get('uri'), $app, $context)->__toString();

src/Administration/Resources/app/administration/package-lock.json

+51-32
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Administration/Resources/app/administration/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
"safari >= 7"
5454
],
5555
"dependencies": {
56-
"@shopware-ag/meteor-admin-sdk": "5.5.0",
56+
"@shopware-ag/meteor-admin-sdk": "5.6.1",
5757
"@shopware-ag/meteor-component-library": "3.11.0",
5858
"@shopware-ag/meteor-icon-kit": "5.4.0",
5959
"@shopware-ag/webpack-copy-after-build": "1.0.1",

src/Administration/Resources/app/administration/src/app/component/structure/sw-admin/sw-admin.html.twig

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
<sw-license-violation />
2424
<sw-hidden-iframes />
2525
<sw-modals-renderer />
26+
<sw-in-app-purchase-checkout v-if="isLoggedIn" />
2627
<sw-app-wrong-app-url-modal v-if="isLoggedIn" />
2728

2829
<mt-toast

src/Administration/Resources/app/administration/src/app/component/structure/sw-admin/sw-admin.spec.js

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ async function createWrapper(isLoggedIn, forwardLogout = () => {}, route = 'sw.w
1616
'sw-license-violation': true,
1717
'sw-hidden-iframes': true,
1818
'sw-modals-renderer': true,
19+
'sw-in-app-purchase-checkout': true,
1920
'sw-app-wrong-app-url-modal': true,
2021
'router-view': true,
2122
},

0 commit comments

Comments
 (0)