Skip to content

Commit

Permalink
Merge pull request magento#650 from magento-engcom/569
Browse files Browse the repository at this point in the history
MSI: 569: Add Column Source Status for all SourceItem grids
  • Loading branch information
Valeriy Nayda authored Mar 9, 2018
2 parents 3ba68fa + af0273e commit ab4fc02
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ private function getSourceItemsData(): array
$collection->join(
['s' => $this->resourceConnection->getTableName(SourceResourceModel::TABLE_NAME_SOURCE)],
sprintf('s.%s = main_table.%s', SourceInterface::SOURCE_CODE, SourceItemInterface::SOURCE_CODE),
['source_name' => SourceInterface::NAME]
['source_name' => SourceInterface::NAME, 'source_status' => SourceInterface::ENABLED]
);

$sourceItemsData = [];
Expand All @@ -110,6 +110,7 @@ private function getSourceItemsData(): array
SourceItemInterface::QUANTITY => $row[SourceItemInterface::QUANTITY],
SourceItemInterface::STATUS => $row[SourceItemInterface::STATUS],
SourceInterface::NAME => $row['source_name'],
'source_status' => $row['source_status'] ? __('Enabled') : __('Disabled')
];
}
return $sourceItemsData;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,19 @@
<label translate="true">Name</label>
</settings>
</field>
<field name="status" formElement="select" sortOrder="30">
<field name="source_status" formElement="input" sortOrder="30">
<settings>
<elementTmpl>ui/dynamic-rows/cells/text</elementTmpl>
<dataType>text</dataType>
<dataScope>source_status</dataScope>
<label translate="true">Source Status</label>
</settings>
</field>
<field name="status" formElement="select" sortOrder="40">
<settings>
<dataType>text</dataType>
<dataScope>status</dataScope>
<label translate="true">Status</label>
<label translate="true">Source Item Status</label>
</settings>
<formElements>
<select>
Expand All @@ -123,14 +131,14 @@
</select>
</formElements>
</field>
<field name="quantity" formElement="input" sortOrder="40">
<field name="quantity" formElement="input" sortOrder="50">
<settings>
<dataType>text</dataType>
<dataScope>quantity</dataScope>
<label translate="true">Qty</label>
</settings>
</field>
<field name="actionDelete" formElement="actionDelete" sortOrder="50">
<field name="actionDelete" formElement="actionDelete" sortOrder="90">
<settings>
<label translate="true">Unassign</label>
</settings>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
<item name="map" xsi:type="array">
<item name="source" xsi:type="string">source</item>
<item name="source_code" xsi:type="string">source_code</item>
<item name="source_status" xsi:type="string">source_status</item>
</item>
</item>
</argument>
Expand Down Expand Up @@ -87,7 +88,13 @@
<dataType>text</dataType>
<label translate="true">Source</label>
<elementTmpl>ui/dynamic-rows/cells/text</elementTmpl>
</settings>
</field>
<field name="source_status" formElement="input">
<settings>
<dataType>text</dataType>
<label translate="true">Source Status</label>
<elementTmpl>ui/dynamic-rows/cells/text</elementTmpl>
</settings>
</field>
<field name="quantity" formElement="input">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ define([
_.each(data, function (item) {
items.push({
'source': item.name,
'source_code': item[this.identifier]
'source_code': item[this.identifier],
'source_status': parseInt(item.enabled, 10) ? $.mage.__('Enabled') : $.mage.__('Disabled')
});
}.bind(this));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
</item>
</argument>
<container name="record" component="Magento_Ui/js/dynamic-rows/record">
<field name="notify_stock_qty" formElement="input" sortOrder="45">
<field name="notify_stock_qty" formElement="input" sortOrder="60">
<settings>
<dataType>text</dataType>
<dataScope>notify_stock_qty</dataScope>
Expand All @@ -28,7 +28,7 @@
</imports>
</settings>
</field>
<field name="notify_stock_qty_use_default" component="Magento_InventoryLowQuantityNotification/js/components/use-config-settings" formElement="checkbox" sortOrder="55">
<field name="notify_stock_qty_use_default" component="Magento_InventoryLowQuantityNotification/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>
Expand Down

0 comments on commit ab4fc02

Please sign in to comment.