@@ -73,35 +73,43 @@ export function withSelectedMultiContext<TCtor extends MultiCompConstructor>(
73
73
comp . getOriginalComp ( ) . setParams ( comp . cacheParamsMap . get ( selection ) ! )
74
74
) ;
75
75
}
76
- } else if ( (
77
- ! action . editDSL
78
- && ! isCustomAction < LazyCompReadyAction > ( action , "LazyCompReady" )
79
- && ! isCustomAction < RemoteCompReadyAction > ( action , "RemoteCompReady" )
80
- && ! isCustomAction < ModuleReadyAction > ( action , "moduleReady" )
81
- ) || action . path [ 0 ] !== MAP_KEY || _ . isNil ( action . path [ 1 ] )
82
- ) {
83
- if ( action . path [ 0 ] === MAP_KEY && action . path [ 1 ] === SELECTED_KEY ) {
84
- action . path [ 1 ] = this . selection ;
85
- }
86
- comp = super . reduce ( action ) ;
87
76
} else if ( (
88
77
action . editDSL
89
78
|| isCustomAction < LazyCompReadyAction > ( action , "LazyCompReady" )
90
79
|| isCustomAction < RemoteCompReadyAction > ( action , "RemoteCompReady" )
91
80
|| isCustomAction < ModuleReadyAction > ( action , "moduleReady" )
92
81
) && (
93
82
action . path [ 1 ] === SELECTED_KEY
94
- || ( // special check added for modules inside list view
83
+ || (
95
84
isCustomAction < ModuleReadyAction > ( action , "moduleReady" )
96
85
&& action . path [ 1 ] === this . selection )
97
86
) ) {
98
- // broadcast
87
+ // broadcast edits from the selected design-time view to all instances and template
88
+ const newAction = {
89
+ ...action ,
90
+ path : action . path . slice ( 2 ) ,
91
+ } ;
92
+ comp = comp . reduce ( WithMultiContextComp . forEachAction ( newAction ) ) ;
93
+ comp = comp . reduce ( wrapChildAction ( COMP_KEY , newAction ) ) ;
94
+ } else if (
95
+ // ensure edits made in the expanded view configurator (SELECTED key)
96
+ // also update the template
97
+ action . path [ 0 ] === MAP_KEY && action . path [ 1 ] === SELECTED_KEY
98
+ ) {
99
99
const newAction = {
100
100
...action ,
101
101
path : action . path . slice ( 2 ) ,
102
102
} ;
103
103
comp = comp . reduce ( WithMultiContextComp . forEachAction ( newAction ) ) ;
104
104
comp = comp . reduce ( wrapChildAction ( COMP_KEY , newAction ) ) ;
105
+ } else if ( (
106
+ ! action . editDSL
107
+ && ! isCustomAction < LazyCompReadyAction > ( action , "LazyCompReady" )
108
+ && ! isCustomAction < RemoteCompReadyAction > ( action , "RemoteCompReady" )
109
+ && ! isCustomAction < ModuleReadyAction > ( action , "moduleReady" )
110
+ ) || action . path [ 0 ] !== MAP_KEY || _ . isNil ( action . path [ 1 ] )
111
+ ) {
112
+ comp = super . reduce ( action ) ;
105
113
} else if (
106
114
! action . editDSL
107
115
&& (
@@ -112,8 +120,6 @@ export function withSelectedMultiContext<TCtor extends MultiCompConstructor>(
112
120
) {
113
121
comp = super . reduce ( action ) ;
114
122
}
115
-
116
- // console.info("exit withSelectedMultiContext reduce. action: ", action, "\nthis:", this, "\ncomp:", comp);
117
123
return comp ;
118
124
}
119
125
0 commit comments