Skip to content

Commit

Permalink
fix: elimate column Notify Quantity Use Default and move checkbox to …
Browse files Browse the repository at this point in the history
…Notify Qty column

Issue: #2132

These changes have been made in the Assigned Source panel:
  - Eliminated column "Notify Quantity Use Default"
  - Moved checkbox which was in column "Notify Quantity Use Default"
    to "Notifiy Qty" column below the number input
   - Added "Use Default" description to the checkbox
  • Loading branch information
fratob85 committed Apr 6, 2019
1 parent e8547be commit 9a7973f
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 38 deletions.
Expand Up @@ -9,3 +9,5 @@ Quantity,Quantity
"Source Code","Source Code"
"Notify Quantity","Notify Quantity"
"Notify Quantity Use Default","Notify Quantity Use Default"
"Notify Qty","Notify Qty"
"Use Default","Use Default"
Expand Up @@ -6,7 +6,7 @@
*/
-->
<form xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
<fieldset name="sources">
<container name="sources">
<dynamicRows name="assigned_sources" component="Magento_Ui/js/dynamic-rows/dynamic-rows-grid">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
Expand All @@ -18,47 +18,57 @@
</item>
</argument>
<container name="record" component="Magento_Ui/js/dynamic-rows/record">
<field name="notify_stock_qty" formElement="input" sortOrder="60" component="Magento_InventoryLowQuantityNotificationAdminUi/js/components/notify-stock-qty">
<settings>
<dataType>text</dataType>
<dataScope>notify_stock_qty</dataScope>
<label translate="true">Notify Quantity</label>
<imports>
<link name="notifyStockQtyUseDefault">${$.parentName}.notify_stock_qty_use_default:checked</link>
<link name="manageStock">!${ $.provider }:data.product.stock_data.manage_stock</link>
</imports>
</settings>
</field>
<field name="notify_stock_qty_use_default" component="Magento_InventoryLowQuantityNotificationAdminUi/js/components/use-config-settings" formElement="checkbox" sortOrder="70">
<container component="Magento_Ui/js/form/components/group" sortOrder="60">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="valueFromConfig" xsi:type="object">Magento\CatalogInventory\Model\Source\StockConfiguration</item>
<item name="keyInConfiguration" xsi:type="string">notify_stock_qty</item>
<item name="default" xsi:type="number">1</item>
<item name="label" xsi:type="string" translate="true">Notify Qty</item>
<item name="showLabel" xsi:type="boolean">false</item>
</item>
</argument>
<settings>
<dataScope>notify_stock_qty_use_default</dataScope>
<label translate="true">Notify Quantity Use Default</label>
<links>
<link name="linkedValue">${$.provider}:${$.parentScope}.notify_stock_qty</link>
</links>
<imports>
<link name="disabled">!${ $.provider }:data.product.stock_data.manage_stock</link>
</imports>
</settings>
<formElements>
<checkbox class="Magento\InventoryLowQuantityNotificationAdminUi\Ui\Component\Product\Form\Element\UseConfigSettings">
<settings>
<valueMap>
<map name="false" xsi:type="string">0</map>
<map name="true" xsi:type="string">1</map>
</valueMap>
</settings>
</checkbox>
</formElements>
</field>
<field name="notify_stock_qty" formElement="input" sortOrder="60"
component="Magento_InventoryLowQuantityNotificationAdminUi/js/components/notify-stock-qty">
<settings>
<labelVisible>false</labelVisible>
<dataType>text</dataType>
<dataScope>notify_stock_qty</dataScope>
<imports>
<link name="notifyStockQtyUseDefault">${$.parentName}.notify_stock_qty_use_default:checked</link>
<link name="manageStock">!${ $.provider }:data.product.stock_data.manage_stock</link>
</imports>
</settings>
</field>
<field name="notify_stock_qty_use_default" component="Magento_InventoryLowQuantityNotificationAdminUi/js/components/use-config-settings" formElement="checkbox" sortOrder="70">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="valueFromConfig" xsi:type="object">Magento\CatalogInventory\Model\Source\StockConfiguration</item>
<item name="keyInConfiguration" xsi:type="string">notify_stock_qty</item>
<item name="default" xsi:type="number">1</item>
</item>
</argument>
<settings>
<labelVisible>false</labelVisible>
<dataScope>notify_stock_qty_use_default</dataScope>
<links>
<link name="linkedValue">${$.provider}:${$.parentScope}.notify_stock_qty</link>
</links>
<imports>
<link name="disabled">!${ $.provider }:data.product.stock_data.manage_stock</link>
</imports>
</settings>
<formElements>
<checkbox class="Magento\InventoryLowQuantityNotificationAdminUi\Ui\Component\Product\Form\Element\UseConfigSettings">
<settings>
<description translate="true">Use Default</description>
<valueMap>
<map name="false" xsi:type="string">0</map>
<map name="true" xsi:type="string">1</map>
</valueMap>
</settings>
</checkbox>
</formElements>
</field>
</container>
</container>
</dynamicRows>
</fieldset>
</container>
</form>

0 comments on commit 9a7973f

Please sign in to comment.