File tree Expand file tree Collapse file tree 2 files changed +34
-1
lines changed
app/code/Magento/InventoryCatalog/view/adminhtml
web/js/form/components/fieldset Expand file tree Collapse file tree 2 files changed +34
-1
lines changed Original file line number Diff line number Diff line change 6
6
*/
7
7
-->
8
8
<form xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance" xsi : noNamespaceSchemaLocation =" urn:magento:module:Magento_Ui:etc/ui_configuration.xsd" >
9
- <fieldset name =" sources" sortOrder =" 5" >
9
+ <fieldset name =" sources" sortOrder =" 5" component = " Magento_InventoryCatalog/js/form/components/fieldset/manage-stock " >
10
10
<settings >
11
11
<label translate =" true" >Sources</label >
12
12
<collapsible >true</collapsible >
Original file line number Diff line number Diff line change
1
+ /**
2
+ * Copyright © Magento, Inc. All rights reserved.
3
+ * See COPYING.txt for license details.
4
+ */
5
+
6
+ /**
7
+ * @api
8
+ */
9
+ define ( [
10
+ 'Magento_Ui/js/form/components/fieldset'
11
+ ] , function ( Fieldset ) {
12
+ 'use strict' ;
13
+
14
+ return Fieldset . extend ( {
15
+ defaults : {
16
+ additionalClasses : { } ,
17
+ imports : {
18
+ onStockChange : '${ $.provider }:data.product.stock_data.manage_stock'
19
+ }
20
+ } ,
21
+
22
+ /**
23
+ * Disable all child elements if manage stock is zero
24
+ * @param manageStockValue
25
+ */
26
+ onStockChange : function ( manageStockValue ) {
27
+ if ( manageStockValue === 0 ) {
28
+ this . delegate ( 'disabled' , true ) ;
29
+ }
30
+ }
31
+
32
+ } ) ;
33
+ } ) ;
You can’t perform that action at this time.
0 commit comments