diff --git a/newIDE/app/src/AssetStore/BehaviorStore/BehaviorListItem.js b/newIDE/app/src/AssetStore/BehaviorStore/BehaviorListItem.js index b455681022ba..c3ad78cc7235 100644 --- a/newIDE/app/src/AssetStore/BehaviorStore/BehaviorListItem.js +++ b/newIDE/app/src/AssetStore/BehaviorStore/BehaviorListItem.js @@ -35,6 +35,7 @@ type Props = {| objectType: string, objectBehaviorsTypes: Array, isChildObject: boolean, + shouldCheckCapabilityBehaviors: boolean, behaviorShortHeader: BehaviorShortHeader, matches: ?Array, onChoose: () => void, @@ -48,6 +49,7 @@ export const BehaviorListItem = ({ objectType, objectBehaviorsTypes, isChildObject, + shouldCheckCapabilityBehaviors, behaviorShortHeader, matches, onChoose, @@ -75,7 +77,11 @@ export const BehaviorListItem = ({ ); return ( (!isChildObject || behaviorMetadata.isRelevantForChildObjects()) && - (!behaviorMetadata.isHidden() || + // Behavior parameters and properties don't need to declare all + // capabilities, they will be required by transitivity when attaching + // the behavior to the object. + (!shouldCheckCapabilityBehaviors || + !behaviorMetadata.isHidden() || objectBehaviorsTypes.includes(requiredBehaviorType)) ); }); diff --git a/newIDE/app/src/AssetStore/BehaviorStore/index.js b/newIDE/app/src/AssetStore/BehaviorStore/index.js index 07b55d73135a..802d992eb32c 100644 --- a/newIDE/app/src/AssetStore/BehaviorStore/index.js +++ b/newIDE/app/src/AssetStore/BehaviorStore/index.js @@ -71,6 +71,7 @@ type Props = {| deprecatedBehaviorMetadataList: Array, onInstall: (behaviorShortHeader: BehaviorShortHeader) => Promise, onChoose: (behaviorType: string) => void, + shouldCheckCapabilityBehaviors: boolean, |}; const getBehaviorType = (behaviorShortHeader: BehaviorShortHeader) => @@ -86,6 +87,7 @@ export const BehaviorStore = ({ deprecatedBehaviorMetadataList, onInstall, onChoose, + shouldCheckCapabilityBehaviors, }: Props): React.Node => { const preferences = React.useContext(PreferencesContext); const [ @@ -305,8 +307,10 @@ export const BehaviorStore = ({ filteredSearchResults.map(({ item }) => item) } getSearchItemUniqueId={getBehaviorType} - // $FlowFixMe[missing-local-annot] - renderSearchItem={(behaviorShortHeader, onHeightComputed) => ( + renderSearchItem={( + behaviorShortHeader: BehaviorShortHeader, + onHeightComputed + ): React.Node => ( chooseBehavior(i18n, behaviorType)} installedBehaviorMetadataList={installedBehaviorMetadataList} deprecatedBehaviorMetadataList={deprecatedBehaviorMetadataList} + shouldCheckCapabilityBehaviors={!shouldShowCapabilityBehaviors} /> )}