Skip to content
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

Conversation

VitaliyBoyko
Copy link
Contributor

@VitaliyBoyko VitaliyBoyko commented Jun 22, 2018

Description

Added plugin for prevent disable Default Source using Switcher.

Fixed Issues (if relevant)

  1. Prevent Disabling Default Source by Disabling 'Is Enabled' Switcher #1250: Prevent Disabling Default Source by Disabling 'Is Enabled' Switcher

Manual testing scenarios

Go to:
Edit Source: Default Source
Switcher should be disabled.

@VitaliyBoyko VitaliyBoyko self-assigned this Jun 22, 2018
@VitaliyBoyko VitaliyBoyko requested a review from naydav June 22, 2018 10:06
* @var DefaultSourceProviderInterface
*/
private $defaultSourceProvider;
/**
Copy link

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;
Copy link

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
Copy link

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
Copy link

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"/>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

prevent_disabling_default_source

@VitaliyBoyko VitaliyBoyko requested a review from naydav June 22, 2018 11:43
*/
declare(strict_types=1);

namespace Magento\InventoryAdminUi\Plugin\InventoryAdminUi\Ui\DataProvider;
Copy link

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

@VitaliyBoyko VitaliyBoyko requested a review from naydav June 27, 2018 08:44
@naydav naydav merged commit a840950 into 2.3-develop Jun 29, 2018
@ishakhsuvarov ishakhsuvarov deleted the MSI-1250-Prevent-Disabling-Default-Source-by-Disabling-Is-Enabled-Switcher branch June 19, 2019 16:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants