File tree Expand file tree Collapse file tree 6 files changed +46
-6
lines changed
app/code/Magento/PageBuilder
Controller/Adminhtml/Form/Element Expand file tree Collapse file tree 6 files changed +46
-6
lines changed Original file line number Diff line number Diff line change @@ -134,7 +134,12 @@ private function createCollection()
134
134
public function execute ()
135
135
{
136
136
/** @var \Magento\Catalog\Model\ResourceModel\Product\Collection $collection */
137
- $ collection = $ this ->createCollection ();
137
+ $ collection = $ this ->createCollection ()
138
+ ->getSelect ()->joinLeft (
139
+ ['link_table ' => $ collection ->getTable ('catalog_product_super_link ' )],
140
+ 'link_table.product_id = e.entity_id ' ,
141
+ ['product_id ' ]
142
+ )->where ('link_table.product_id IS NULL ' );
138
143
$ totalProducts = $ collection ->getSize ();
139
144
$ disabledProducts = $ collection
140
145
->addAttributeToFilter ('status ' , Status::STATUS_DISABLED )
Original file line number Diff line number Diff line change 227
227
</item >
228
228
</argument >
229
229
<settings >
230
- <elementTmpl >ui /form/element/text </elementTmpl >
230
+ <elementTmpl >Magento_PageBuilder /form/element/product-totals </elementTmpl >
231
231
<dataType >text</dataType >
232
232
<imports >
233
233
<link name =" conditionOption" >ns = ${ $.ns }, index = condition_option:value</link >
Original file line number Diff line number Diff line change 12
12
@import ' _margins-and-padding.less' ;
13
13
@import ' uploader/preview/_image.less' ;
14
14
@import ' _visual-select.less' ;
15
+ @import ' _product-totals.less' ;
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
+ .admin__data-grid-loading-mask {
7
+ font-size : 2em ;
8
+ }
Original file line number Diff line number Diff line change @@ -31,22 +31,23 @@ define([
31
31
value : false
32
32
} ,
33
33
url : null ,
34
- valuePlaceholder : $t ( 'of %1 (%2 disabled)' )
34
+ valuePlaceholder : $t ( 'of %1 (%2 disabled)' ) ,
35
+ showSpinner : true ,
36
+ loading : false
35
37
} ,
36
38
37
39
/** @inheritdoc */
38
40
initObservable : function ( ) {
39
41
return this . _super ( )
40
- . observe ( 'value totalProductCount totalDisabledProducts' ) ;
42
+ . observe ( 'value totalProductCount totalDisabledProducts loading ' ) ;
41
43
} ,
42
44
43
45
/**
44
46
* Update product count.
45
47
*
46
48
*/
47
49
updateProductTotals : _ . debounce ( function ( ) {
48
- if ( ! this . conditionOption || _ . isEmpty ( this . formData ) ||
49
- ( this . conditionOption === 'sku' && ( ! this . formData [ 'sku' ] || this . formData [ 'sku' ] === '' ) ) ) {
50
+ if ( ! this . conditionOption || _ . isEmpty ( this . formData ) ) {
50
51
return ;
51
52
}
52
53
@@ -57,6 +58,7 @@ define([
57
58
_ . extend ( this . formData , this . conditionValue ) ;
58
59
conditionsDataProcessor ( this . formData , this . conditionOption + '_source' ) ;
59
60
61
+ this . loading ( true ) ;
60
62
$ . ajax ( {
61
63
url : this . url ,
62
64
method : 'POST' ,
@@ -71,9 +73,11 @@ define([
71
73
. replace ( '%1' , this . totalProductCount ( ) )
72
74
. replace ( '%2' , this . totalDisabledProducts ( ) )
73
75
) ;
76
+ this . loading ( false ) ;
74
77
} . bind ( this )
75
78
) . fail ( function ( ) {
76
79
this . value ( $t ( 'An unknown error occurred. Please try again.' ) ) ;
80
+ this . loading ( false ) ;
77
81
} . bind ( this ) ) ;
78
82
} , 10 ) ,
79
83
} ) ;
Original file line number Diff line number Diff line change
1
+ <!--
2
+ /**
3
+ * Copyright © Magento, Inc. All rights reserved.
4
+ * See COPYING.txt for license details.
5
+ */
6
+ -->
7
+ < div data-role ="spinner "
8
+ class ="admin__data-grid-loading-mask "
9
+ visible ="loading "
10
+ if ="showSpinner ">
11
+ < div class ="spinner ">
12
+ < span repeat ="8 "/>
13
+ </ div >
14
+ </ div >
15
+ < span class ="admin__field-value "
16
+ data-bind ="
17
+ text: value,
18
+ attr: {
19
+ name: inputName,
20
+ id: uid
21
+ } ">
22
+ </ span >
You can’t perform that action at this time.
0 commit comments