-
Notifications
You must be signed in to change notification settings - Fork 247
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
1250: added plugin to prevent disabling default source #1410
1250: added plugin to prevent disabling default source #1410
Conversation
* @var DefaultSourceProviderInterface | ||
*/ | ||
private $defaultSourceProvider; | ||
/** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add empty line
return $meta; | ||
} | ||
|
||
//$result[$defaultSourceCode]['general']['switcher_disabled'] = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove comment string
* @param SourceDataProvider $subject | ||
* @return bool | ||
*/ | ||
private function isFormComponent(SourceDataProvider $subject): bool |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need to incapsulate one string in the separate function?
/** | ||
* @return bool | ||
*/ | ||
private function isFormComponent(): bool |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The same as bellow
@@ -25,4 +25,7 @@ | |||
<argument name="sortOrder" xsi:type="number">30</argument> | |||
</arguments> | |||
</virtualType> | |||
<type name="Magento\InventoryAdminUi\Ui\DataProvider\SourceDataProvider"> | |||
<plugin name="prevent_disabling_default_source_plugin" type="Magento\InventoryAdminUi\Plugin\InventoryAdminUi\Ui\DataProvider\PreventDisablingDefaultSourcePlugin"/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
prevent_disabling_default_source
*/ | ||
declare(strict_types=1); | ||
|
||
namespace Magento\InventoryAdminUi\Plugin\InventoryAdminUi\Ui\DataProvider; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to move plugin and declaration to InventoryCatalogAdminUi
because
Default Source is concept of InventoryCatalog
Description
Added plugin for prevent disable Default Source using Switcher.
Fixed Issues (if relevant)
Manual testing scenarios
Go to:
Edit Source: Default Source
Switcher should be disabled.