Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions src/wizards/audience/views/integrations/configure-view.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,16 +144,21 @@ export const ConfigureView = ( { integrations, loading, pendingChanges, saving,
<Grid columns={ 2 } gutter={ 32 } noMargin>
<SectionHeader heading={ 2 } title={ __( 'Inbound', 'newspack-plugin' ) } noMargin />
<Grid columns={ 1 } rowGap={ 8 } noMargin>
{ ( inboundField.options || [] ).map( optionName => {
{ ( inboundField.options || [] ).map( option => {
// Framework injects options as { value, label } objects
// (see class-integration.php:get_settings_config()), but accepts bare strings
// for backward compatibility.
const optionValue = typeof option === 'string' ? option : option.value;
const optionLabel = typeof option === 'string' ? option : option.label || option.value;
const currentValue = getFieldValue( inboundField );
const selected = Array.isArray( currentValue ) ? currentValue : [];
return (
<CheckboxControl
className="newspack-checkbox-control"
key={ optionName }
label={ optionName }
checked={ selected.includes( optionName ) }
onChange={ checked => handleCheckboxListChange( inboundField.key, currentValue, optionName, checked ) }
key={ optionValue }
label={ optionLabel }
checked={ selected.includes( optionValue ) }
onChange={ checked => handleCheckboxListChange( inboundField.key, currentValue, optionValue, checked ) }
Comment thread
miguelpeixe marked this conversation as resolved.
/>
);
} ) }
Expand Down
Loading