Skip to content

Commit

Permalink
Merge branch 'v1-develop' into v1
Browse files Browse the repository at this point in the history
  • Loading branch information
hostep committed Jul 7, 2022
2 parents 2cbbcc1 + dbd9277 commit 68e62d4
Show file tree
Hide file tree
Showing 10 changed files with 1,810 additions and 3,322 deletions.
4 changes: 2 additions & 2 deletions Cron/ScheduleJob.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ public function schedule(string $jobCode): bool
$schedule
->setJobCode($jobCode)
->setStatus(CronScheduleModel::STATUS_PENDING)
->setCreatedAt(date('Y-m-d H:i:s', $createdAtTime) ?: '')
->setScheduledAt(date('Y-m-d H:i', $scheduledAtTime) ?: '')
->setCreatedAt(date('Y-m-d H:i:s', $createdAtTime))
->setScheduledAt(date('Y-m-d H:i', $scheduledAtTime))
->save();

return true;
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ check: checkstyle checkquality test
.PHONY: checkstyle
checkstyle:
vendor/bin/php-cs-fixer fix --dry-run --diff --stop-on-violation --allow-risky=yes
vendor/bin/phpcs -s --standard=Magento2 --exclude=Magento2.Security.InsecureFunction --ignore=./vendor/ .
vendor/bin/phpcs -s --standard=Magento2 --exclude=Magento2.Security.InsecureFunction,Magento2.Commenting.ClassPropertyPHPDocFormatting,Magento2.Annotation.MethodAnnotationStructure,Magento2.Annotation.MethodArguments,PSR12.Properties.ConstantVisibility --ignore=./vendor/ .
vendor/bin/phpcs -s --standard=PHPCompatibility --runtime-set testVersion 7.0- --ignore=./vendor/,./Test/ .
vendor/bin/phpcs -s --standard=PHPCompatibility --runtime-set testVersion 7.1- ./Test/
vendor/bin/composer normalize --dry-run
Expand Down
67 changes: 67 additions & 0 deletions Ui/Component/Listing/Column/EditAction.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
<?php

declare(strict_types=1);

namespace Baldwin\UrlDataIntegrityChecker\Ui\Component\Listing\Column;

use Magento\Theme\Ui\Component\Listing\Column\EditAction as ColumnEditAction;

class EditAction extends ColumnEditAction
{
/**
* @param array{
* data: ?array{
* items: array{
* array<string, mixed>
* },
* totalRecords: int
* }
* } $dataSource
*
* @return array{
* data: ?array{
* items: array{
* array<string, mixed>
* },
* totalRecords: int
* }
* }
*/
public function prepareDataSource(array $dataSource)
{
$indexField = $this->getData('config/indexField');
$editUrlPath = $this->getData('config/editUrlPath');

if (!is_string($indexField) || $indexField === '' || !is_string($editUrlPath) || $editUrlPath === '') {
return $dataSource;
}

if (isset($dataSource['data']['items'])) {
foreach ($dataSource['data']['items'] as &$item) {
if (isset($item[$indexField])) {
$entityId = $item[$indexField];

$storeId = null;
if (isset($item['storeId'])) {
$storeId = $item['storeId'];
}

$item[$this->getData('name')] = [
'edit' => [
'href' => $this->urlBuilder->getUrl(
$editUrlPath,
[
'id' => $entityId,
'store' => $storeId,
]
),
'label' => __('Edit'),
],
];
}
}
}

return $dataSource;
}
}
8 changes: 5 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,15 @@
"magento/module-config": "^100.1 || ^101.0",
"magento/module-cron": "^100.1",
"magento/module-store": "^100.1 || ^101.0",
"magento/module-theme": "^100.1 || ^101.0",
"magento/module-ui": "^100.1 || ^101.0",
"symfony/console": "^2.5 || ^3.0 || ^4.0 || ^5.0"
},
"require-dev": {
"bitexpert/phpstan-magento": "^0.17.0",
"ergebnis/composer-normalize": "^2.2",
"bitexpert/phpstan-magento": "^0.23.0",
"ergebnis/composer-normalize": "^2.17",
"friendsofphp/php-cs-fixer": "^3.0",
"magento/magento-coding-standard": "^6.0",
"magento/magento-coding-standard": ">=6",
"mikey179/vfsstream": "^1.6",
"phpcompatibility/php-compatibility": "^9.2",
"phpstan/extension-installer": "^1.0",
Expand All @@ -50,6 +51,7 @@
"config": {
"allow-plugins": {
"ergebnis/composer-normalize": true,
"magento/composer-dependency-version-audit-plugin": true,
"phpstan/extension-installer": true
},
"sort-packages": true
Expand Down
Loading

0 comments on commit 68e62d4

Please sign in to comment.