When a plugin has a manifest like this:
reducer: {
initialState,
actions
},
controls: [{
id: 'search',
mobile: {
slot: 'top-right',
showLabel: false
},
tablet: {
slot: 'top-left',
showLabel: false
},
desktop: {
slot: 'top-left',
showLabel: false
},
render: Search
}],
}
and the implementation config overrides it like this
manifest: {
controls: [{id: 'search', desktop: { showLabel: true }}]
},
Expected
Overriding a plugin manifest button showLabel property, should render as per the new showLabel config
export const manifest = {
reducer: {
initialState,
actions
},
controls: [{
id: 'search',
mobile: {
slot: 'top-right',
showLabel: false
},
tablet: {
slot: 'top-left',
showLabel: false
},
desktop: {
slot: 'top-left',
showLabel: true
},
render: Search
}],
}
Actual
The button disappears.
export const manifest = {
reducer: {
initialState,
actions
},
controls: [{
id: 'search',
mobile: {
slot: 'top-right',
showLabel: false
},
tablet: {
slot: 'top-left',
showLabel: false
},
desktop: { showLabel: true } // Note that slot has been dropped
,
render: Search
}],
}
Propsed fix
The merge manifest process is replacing the slot object rather than doing a deep merge. We need to ensure this is a deep merge and not a replace
See /src/App/registry/mergeManifest.js
When a plugin has a manifest like this:
and the implementation config overrides it like this
Expected
Overriding a plugin manifest button showLabel property, should render as per the new showLabel config
Actual
The button disappears.
Propsed fix
The merge manifest process is replacing the slot object rather than doing a deep merge. We need to ensure this is a deep merge and not a replace
See /src/App/registry/mergeManifest.js