Skip to content

Commit 68e62d4

Browse files
committed
Merge branch 'v1-develop' into v1
2 parents 2cbbcc1 + dbd9277 commit 68e62d4

10 files changed

+1810
-3322
lines changed

Cron/ScheduleJob.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ public function schedule(string $jobCode): bool
4242
$schedule
4343
->setJobCode($jobCode)
4444
->setStatus(CronScheduleModel::STATUS_PENDING)
45-
->setCreatedAt(date('Y-m-d H:i:s', $createdAtTime) ?: '')
46-
->setScheduledAt(date('Y-m-d H:i', $scheduledAtTime) ?: '')
45+
->setCreatedAt(date('Y-m-d H:i:s', $createdAtTime))
46+
->setScheduledAt(date('Y-m-d H:i', $scheduledAtTime))
4747
->save();
4848

4949
return true;

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ check: checkstyle checkquality test
1111
.PHONY: checkstyle
1212
checkstyle:
1313
vendor/bin/php-cs-fixer fix --dry-run --diff --stop-on-violation --allow-risky=yes
14-
vendor/bin/phpcs -s --standard=Magento2 --exclude=Magento2.Security.InsecureFunction --ignore=./vendor/ .
14+
vendor/bin/phpcs -s --standard=Magento2 --exclude=Magento2.Security.InsecureFunction,Magento2.Commenting.ClassPropertyPHPDocFormatting,Magento2.Annotation.MethodAnnotationStructure,Magento2.Annotation.MethodArguments,PSR12.Properties.ConstantVisibility --ignore=./vendor/ .
1515
vendor/bin/phpcs -s --standard=PHPCompatibility --runtime-set testVersion 7.0- --ignore=./vendor/,./Test/ .
1616
vendor/bin/phpcs -s --standard=PHPCompatibility --runtime-set testVersion 7.1- ./Test/
1717
vendor/bin/composer normalize --dry-run
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace Baldwin\UrlDataIntegrityChecker\Ui\Component\Listing\Column;
6+
7+
use Magento\Theme\Ui\Component\Listing\Column\EditAction as ColumnEditAction;
8+
9+
class EditAction extends ColumnEditAction
10+
{
11+
/**
12+
* @param array{
13+
* data: ?array{
14+
* items: array{
15+
* array<string, mixed>
16+
* },
17+
* totalRecords: int
18+
* }
19+
* } $dataSource
20+
*
21+
* @return array{
22+
* data: ?array{
23+
* items: array{
24+
* array<string, mixed>
25+
* },
26+
* totalRecords: int
27+
* }
28+
* }
29+
*/
30+
public function prepareDataSource(array $dataSource)
31+
{
32+
$indexField = $this->getData('config/indexField');
33+
$editUrlPath = $this->getData('config/editUrlPath');
34+
35+
if (!is_string($indexField) || $indexField === '' || !is_string($editUrlPath) || $editUrlPath === '') {
36+
return $dataSource;
37+
}
38+
39+
if (isset($dataSource['data']['items'])) {
40+
foreach ($dataSource['data']['items'] as &$item) {
41+
if (isset($item[$indexField])) {
42+
$entityId = $item[$indexField];
43+
44+
$storeId = null;
45+
if (isset($item['storeId'])) {
46+
$storeId = $item['storeId'];
47+
}
48+
49+
$item[$this->getData('name')] = [
50+
'edit' => [
51+
'href' => $this->urlBuilder->getUrl(
52+
$editUrlPath,
53+
[
54+
'id' => $entityId,
55+
'store' => $storeId,
56+
]
57+
),
58+
'label' => __('Edit'),
59+
],
60+
];
61+
}
62+
}
63+
}
64+
65+
return $dataSource;
66+
}
67+
}

composer.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,15 @@
1818
"magento/module-config": "^100.1 || ^101.0",
1919
"magento/module-cron": "^100.1",
2020
"magento/module-store": "^100.1 || ^101.0",
21+
"magento/module-theme": "^100.1 || ^101.0",
2122
"magento/module-ui": "^100.1 || ^101.0",
2223
"symfony/console": "^2.5 || ^3.0 || ^4.0 || ^5.0"
2324
},
2425
"require-dev": {
25-
"bitexpert/phpstan-magento": "^0.17.0",
26-
"ergebnis/composer-normalize": "^2.2",
26+
"bitexpert/phpstan-magento": "^0.23.0",
27+
"ergebnis/composer-normalize": "^2.17",
2728
"friendsofphp/php-cs-fixer": "^3.0",
28-
"magento/magento-coding-standard": "^6.0",
29+
"magento/magento-coding-standard": ">=6",
2930
"mikey179/vfsstream": "^1.6",
3031
"phpcompatibility/php-compatibility": "^9.2",
3132
"phpstan/extension-installer": "^1.0",
@@ -50,6 +51,7 @@
5051
"config": {
5152
"allow-plugins": {
5253
"ergebnis/composer-normalize": true,
54+
"magento/composer-dependency-version-audit-plugin": true,
5355
"phpstan/extension-installer": true
5456
},
5557
"sort-packages": true

0 commit comments

Comments
 (0)