Skip to content

Commit 6ec40e6

Browse files
author
joiecaquicla
committed
Merge branch '2.0-develop' of github.com:magento/adobe-stock-integration into 1523-switching-between-views-does-not-change-the-selected-folder
2 parents 7826162 + ca076e6 commit 6ec40e6

File tree

187 files changed

+2577
-1481
lines changed

Some content is hidden

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

187 files changed

+2577
-1481
lines changed

AdobeStockAdminUi/Controller/Adminhtml/System/Config/TestConnection.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ public function execute() : ResultInterface
8888
$message = __('An error occurred during test Adobe Stock API connection');
8989
$isConnectionEstablished = false;
9090
}
91-
/** @var Json $resultJson */
91+
9292
$resultJson = $this->resultJsonFactory->create();
9393
return $resultJson->setData(
9494
[

AdobeStockAdminUi/view/adminhtml/web/template/connection.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@
55
*/
66
-->
77
<div if="visible" attr="class: messageClass" translate="message"></div>
8-
<button class="scalable" type="button" data-bind="click: testConnection" data-ui-id="adobe-stock-integration-buttons-test-connection">
8+
<button class="scalable" type="button" click="testConnection" data-ui-id="adobe-stock-integration-buttons-test-connection">
99
<span text="buttonLabel"></span>
1010
</button>

AdobeStockAsset/Model/AppendAttributes.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
use Magento\Framework\Api\AttributeValueFactory;
1212
use Magento\Framework\Api\Search\Document;
1313
use Magento\Framework\Api\Search\SearchResultInterface;
14-
use Magento\MediaGalleryApi\Model\Asset\Command\GetByIdInterface;
14+
use Magento\MediaGalleryApi\Api\GetAssetsByIdsInterface;
1515

1616
/**
1717
* Class is used for adding an additional assets attributes such as is_downloaded or path to the search results
@@ -33,23 +33,23 @@ class AppendAttributes
3333
private $loadByIds;
3434

3535
/**
36-
* @var GetByIdInterface
36+
* @var GetAssetsByIdsInterface
3737
*/
38-
private $getMediaGalleryAssetById;
38+
private $getMediaGalleryAssetsByIds;
3939

4040
/**
4141
* @param AttributeValueFactory $attributeValueFactory
4242
* @param LoadByIdsInterface $loadByIds
43-
* @param GetByIdInterface $getMediaGalleryAssetById
43+
* @param GetAssetsByIdsInterface $getMediaGalleryAssetById
4444
*/
4545
public function __construct(
4646
AttributeValueFactory $attributeValueFactory,
4747
LoadByIdsInterface $loadByIds,
48-
GetByIdInterface $getMediaGalleryAssetById
48+
GetAssetsByIdsInterface $getMediaGalleryAssetById
4949
) {
5050
$this->attributeValueFactory = $attributeValueFactory;
5151
$this->loadByIds = $loadByIds;
52-
$this->getMediaGalleryAssetById = $getMediaGalleryAssetById;
52+
$this->getMediaGalleryAssetsByIds = $getMediaGalleryAssetById;
5353
}
5454

5555
/**
@@ -89,9 +89,9 @@ static function ($item) {
8989
continue;
9090
}
9191

92-
$path = $this->getMediaGalleryAssetById->execute(
93-
$assets[$item->getId()]->getMediaGalleryId()
94-
)->getPath();
92+
$path = $this->getMediaGalleryAssetsByIds->execute(
93+
[$assets[$item->getId()]->getMediaGalleryId()]
94+
)[0]->getPath();
9595

9696
$this->addAttributes(
9797
$item,

AdobeStockAsset/Model/AssetRepository.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,6 @@ public function save(AssetInterface $asset): void
116116
public function getList(SearchCriteriaInterface $searchCriteria): AssetSearchResultsInterface
117117
{
118118
try {
119-
/** @var AssetCollection $collection */
120119
$collection = $this->collectionFactory->create();
121120
$this->joinProcessor->process(
122121
$collection,
@@ -125,7 +124,6 @@ public function getList(SearchCriteriaInterface $searchCriteria): AssetSearchRes
125124

126125
$this->collectionProcessor->process($searchCriteria, $collection);
127126

128-
/** @var AssetSearchResultsInterface $searchResults */
129127
$searchResults = $this->searchResultFactory->create();
130128
$searchResults->setItems($collection->getItems());
131129
$searchResults->setSearchCriteria($searchCriteria);

AdobeStockAsset/Model/CategoryRepository.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,6 @@ public function delete(CategoryInterface $item): void
116116
*/
117117
public function getList(SearchCriteriaInterface $searchCriteria) : CategorySearchResultsInterface
118118
{
119-
/** @var CategoryCollection $collection */
120119
$collection = $this->collectionFactory->create();
121120
$this->joinProcessor->process(
122121
$collection,
@@ -125,7 +124,6 @@ public function getList(SearchCriteriaInterface $searchCriteria) : CategorySearc
125124

126125
$this->collectionProcessor->process($searchCriteria, $collection);
127126

128-
/** @var CategorySearchResultsInterface $searchResults */
129127
$searchResults = $this->searchResultFactory->create();
130128
$searchResults->setItems($collection->getItems());
131129
$searchResults->setSearchCriteria($searchCriteria);

AdobeStockAsset/Model/CreatorRepository.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,6 @@ public function delete(CreatorInterface $item): void
113113
*/
114114
public function getList(SearchCriteriaInterface $searchCriteria) : CreatorSearchResultsInterface
115115
{
116-
/** @var CreatorCollection $collection */
117116
$collection = $this->collectionFactory->create();
118117
$this->joinProcessor->process(
119118
$collection,
@@ -122,7 +121,6 @@ public function getList(SearchCriteriaInterface $searchCriteria) : CreatorSearch
122121

123122
$this->collectionProcessor->process($searchCriteria, $collection);
124123

125-
/** @var CreatorSearchResultsInterface $searchResults */
126124
$searchResults = $this->searchResultFactory->create();
127125
$searchResults->setItems($collection->getItems());
128126
$searchResults->setSearchCriteria($searchCriteria);

AdobeStockAsset/Model/GetAssetList.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,13 @@ public function execute(SearchCriteriaInterface $searchCriteria): SearchResultIn
7676
__(
7777
'Failed to authenticate to Adobe Stock API. <br> Please correct the API credentials in '
7878
. '<a href="%1">Configuration → System → Adobe Stock Integration.</a>',
79-
$this->url->getUrl('adminhtml/system_config/edit/section/system')
79+
$this->url->getUrl(
80+
'adminhtml/system_config/edit',
81+
[
82+
'section' => 'system',
83+
'_fragment' => 'system_adobe_stock_integration-link'
84+
]
85+
)
8086
),
8187
$exception
8288
);

AdobeStockAsset/Model/ResourceModel/Asset/Command/DeleteById.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ public function __construct(
5757
public function execute(int $adobeStockAssetId): void
5858
{
5959
try {
60-
/** @var AdapterInterface $connection */
6160
$connection = $this->resourceConnection->getConnection();
6261
$tableName = $this->resourceConnection->getTableName(self::ADOBE_STOCK_ASSET_TABLE_NAME);
6362
$connection->delete($tableName, [self::ADOBE_STOCK_ASSET_ID . ' = ?' => $adobeStockAssetId]);

AdobeStockAsset/Model/ResourceModel/Category/Command/DeleteById.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ public function __construct(
5757
public function execute(int $categoryId): void
5858
{
5959
try {
60-
/** @var AdapterInterface $connection */
6160
$connection = $this->resourceConnection->getConnection();
6261
$tableName = $this->resourceConnection->getTableName(self::ADOBE_STOCK_ASSET_CATEGORY_TABLE_NAME);
6362
$connection->delete($tableName, [self::ADOBE_STOCK_ASSET_CATEGORY_ID . ' = ?' => $categoryId]);

AdobeStockAsset/Model/ResourceModel/Creator/Command/DeleteById.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ public function __construct(
5757
public function execute(int $creatorId): void
5858
{
5959
try {
60-
/** @var AdapterInterface $connection */
6160
$connection = $this->resourceConnection->getConnection();
6261
$tableName = $this->resourceConnection->getTableName(self::ADOBE_STOCK_ASSET_CREATOR_TABLE_NAME);
6362
$connection->delete($tableName, [self::ADOBE_STOCK_ASSET_CREATOR_ID . ' = ?' => $creatorId]);

0 commit comments

Comments
 (0)