feat: add entry, collection and config prop to control widget (#3672)

This commit is contained in:
Hannes Küttner 2020-04-30 09:52:42 +02:00 committed by GitHub
parent 2580251208
commit 3e5ff71846
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 0 deletions

View File

@ -126,6 +126,9 @@ class EditorControl extends React.Component {
render() {
const {
value,
entry,
collection,
config,
field,
fieldsMetaData,
fieldsErrors,
@ -217,6 +220,9 @@ class EditorControl extends React.Component {
${styleStrings.labelActive};
`}
controlComponent={widget.control}
entry={entry}
collection={collection}
config={config}
field={field}
uniqueFieldId={this.uniqueFieldId}
value={value}
@ -283,6 +289,7 @@ const mapStateToProps = state => {
mediaPaths: state.mediaLibrary.get('controlMedia'),
isFetching: state.search.get('isFetching'),
queryHits: state.search.get('queryHits'),
config: state.config,
collection,
entry,
isLoadingAsset,

View File

@ -219,6 +219,9 @@ export default class Widget extends Component {
render() {
const {
controlComponent,
entry,
collection,
config,
field,
value,
mediaPaths,
@ -257,6 +260,9 @@ export default class Widget extends Component {
t,
} = this.props;
return React.createElement(controlComponent, {
entry,
collection,
config,
field,
value,
mediaPaths,