-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from justbetter/feature/refactor
Refactor
- Loading branch information
Showing
25 changed files
with
270 additions
and
314 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Upgrade guide | ||
|
||
## 4.2.x to 4.3.x | ||
|
||
The 4.3.x release adds support for `justbetter/laravel-magento-prices` version `^2.0`. | ||
|
||
### Refactor | ||
|
||
A few classes like the resource have been renamed. The resource `Prices` is now `PriceResource`. Make sure to update all references if you make use of it manually. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
includes: | ||
- ./vendor/larastan/larastan/extension.neon | ||
- ./vendor/phpstan/phpstan-mockery/extension.neon | ||
|
||
parameters: | ||
paths: | ||
- src | ||
level: 8 | ||
ignoreErrors: | ||
- identifier: missingType.iterableValue | ||
- identifier: missingType.generics |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?php | ||
|
||
namespace JustBetter\MagentoPricesNova\Nova\Actions; | ||
|
||
use Illuminate\Support\Collection; | ||
use JustBetter\MagentoPrices\Jobs\Utility\ProcessProductsWithMissingPricesJob; | ||
use Laravel\Nova\Actions\Action; | ||
use Laravel\Nova\Actions\ActionResponse; | ||
use Laravel\Nova\Fields\ActionFields; | ||
|
||
class ProcessProductsWithMissingPrices extends Action | ||
{ | ||
public function __construct() | ||
{ | ||
$this | ||
->withName(__('Search missing prices in Magento')) | ||
->standalone(); | ||
} | ||
|
||
public function handle(ActionFields $fields, Collection $models): ActionResponse | ||
{ | ||
ProcessProductsWithMissingPricesJob::dispatch(); | ||
|
||
return ActionResponse::message(__('Searching...')); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
<?php | ||
|
||
namespace JustBetter\MagentoPricesNova\Nova\Actions; | ||
|
||
use Illuminate\Support\Collection; | ||
use JustBetter\MagentoPrices\Models\Price; | ||
use Laravel\Nova\Actions\Action; | ||
use Laravel\Nova\Actions\ActionResponse; | ||
use Laravel\Nova\Fields\ActionFields; | ||
use Laravel\Nova\Fields\Boolean; | ||
use Laravel\Nova\Http\Requests\NovaRequest; | ||
|
||
class ResetFailures extends Action | ||
{ | ||
public function __construct() | ||
{ | ||
$this->withName(__('Reset failures')); | ||
} | ||
|
||
public function handle(ActionFields $fields, Collection $models): ActionResponse | ||
{ | ||
/** @var bool $retrieve */ | ||
$retrieve = $fields->get('retrieve'); | ||
|
||
/** @var bool $update */ | ||
$update = $fields->get('update'); | ||
|
||
$models->each(fn (Price $price): bool => $price->update([ | ||
'sync' => true, | ||
'failed_at' => null, | ||
'fail_count' => 0, | ||
'retrieve' => $retrieve, | ||
'update' => $update, | ||
])); | ||
|
||
return ActionResponse::message(__('Failures reset!')); | ||
} | ||
|
||
public function fields(NovaRequest $request): array | ||
{ | ||
return [ | ||
Boolean::make(__('Retrieve'), 'retrieve') | ||
->help(__('Set the retrieve flag')), | ||
|
||
Boolean::make(__('Update'), 'update') | ||
->help(__('Set the update flag')), | ||
]; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.