Commit f0409ec 1 parent 8b8d227 commit f0409ec Copy full SHA for f0409ec
File tree 2 files changed +9
-8
lines changed
packages/sitecore-jss-react/src
2 files changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -12,9 +12,6 @@ import {
12
12
import { convertAttributesToReactProps } from '../utils' ;
13
13
import { HiddenRendering , HIDDEN_RENDERING_NAME } from './HiddenRendering' ;
14
14
15
- /** [SXA] common marker by which we find container fo replacing **/
16
- const PREFIX_PLACEHOLDER = 'container-{*}' ;
17
-
18
15
type ErrorComponentProps = {
19
16
[ prop : string ] : unknown ;
20
17
} ;
@@ -121,10 +118,14 @@ export class PlaceholderCommon<T extends PlaceholderProps> extends React.Compone
121
118
) {
122
119
let result ;
123
120
/** [SXA] it needs for deleting dynamics placeholder when we set him number(props.name) of container.
124
- from backend side we get common name of placeholder is called 'container-{*}' where '{*}' marker for replacing **/
125
- if ( rendering && rendering . placeholders && rendering . placeholders [ PREFIX_PLACEHOLDER ] ) {
126
- rendering . placeholders [ name ] = rendering . placeholders [ PREFIX_PLACEHOLDER ] ;
127
- delete rendering . placeholders [ PREFIX_PLACEHOLDER ] ;
121
+ from backend side we get common name of placeholder is called 'nameOfContainer-{*}' where '{*}' marker for replacing **/
122
+ if ( rendering ?. placeholders ) {
123
+ Object . keys ( rendering . placeholders ) . forEach ( ( placeholder ) => {
124
+ if ( placeholder . indexOf ( '{*}' ) !== - 1 ) {
125
+ rendering . placeholders [ name ] = rendering . placeholders [ placeholder ] ;
126
+ delete rendering . placeholders [ placeholder ] ;
127
+ }
128
+ } ) ;
128
129
}
129
130
130
131
if ( rendering && rendering . placeholders && Object . keys ( rendering . placeholders ) . length > 0 ) {
Original file line number Diff line number Diff line change @@ -245,7 +245,7 @@ export const sxaRenderingVariantDataWithoutCommonContainerName = {
245
245
} ,
246
246
} ,
247
247
placeholders : {
248
- 'no-container-{*} ' : [
248
+ 'no-container' : [
249
249
{
250
250
uid : 'c4d5d43b-5aa8-4e03-8f16-9428f3e02d5c' ,
251
251
componentName : 'RichText' ,
You can’t perform that action at this time.
0 commit comments