mirror of
https://github.com/strapi/strapi.git
synced 2025-09-26 00:39:49 +00:00
chore: rename prop
This commit is contained in:
parent
c062b84dbf
commit
d5081aedc2
@ -53,6 +53,7 @@ const DisconnectButton = styled.button`
|
|||||||
`;
|
`;
|
||||||
|
|
||||||
const RelationInput = ({
|
const RelationInput = ({
|
||||||
|
canReorder,
|
||||||
description,
|
description,
|
||||||
disabled,
|
disabled,
|
||||||
error,
|
error,
|
||||||
@ -81,7 +82,6 @@ const RelationInput = ({
|
|||||||
publicationStateTranslations,
|
publicationStateTranslations,
|
||||||
required,
|
required,
|
||||||
relations: paginatedRelations,
|
relations: paginatedRelations,
|
||||||
toOneRelation,
|
|
||||||
searchResults,
|
searchResults,
|
||||||
size,
|
size,
|
||||||
}) => {
|
}) => {
|
||||||
@ -336,7 +336,7 @@ const RelationInput = ({
|
|||||||
itemSize={RELATION_ITEM_HEIGHT + RELATION_GUTTER}
|
itemSize={RELATION_ITEM_HEIGHT + RELATION_GUTTER}
|
||||||
itemData={{
|
itemData={{
|
||||||
ariaDescribedBy: ariaDescriptionId,
|
ariaDescribedBy: ariaDescriptionId,
|
||||||
canDrag: !toOneRelation,
|
canDrag: canReorder,
|
||||||
disabled,
|
disabled,
|
||||||
handleCancel: onCancel,
|
handleCancel: onCancel,
|
||||||
handleDropItem: onDropItem,
|
handleDropItem: onDropItem,
|
||||||
@ -395,6 +395,7 @@ const SearchResults = PropTypes.shape({
|
|||||||
});
|
});
|
||||||
|
|
||||||
RelationInput.defaultProps = {
|
RelationInput.defaultProps = {
|
||||||
|
canReorder: false,
|
||||||
description: undefined,
|
description: undefined,
|
||||||
disabled: false,
|
disabled: false,
|
||||||
error: undefined,
|
error: undefined,
|
||||||
@ -406,12 +407,12 @@ RelationInput.defaultProps = {
|
|||||||
onGrabItem: undefined,
|
onGrabItem: undefined,
|
||||||
required: false,
|
required: false,
|
||||||
relations: { data: [] },
|
relations: { data: [] },
|
||||||
toOneRelation: false,
|
|
||||||
searchResults: { data: [] },
|
searchResults: { data: [] },
|
||||||
};
|
};
|
||||||
|
|
||||||
RelationInput.propTypes = {
|
RelationInput.propTypes = {
|
||||||
error: PropTypes.string,
|
error: PropTypes.string,
|
||||||
|
canReorder: PropTypes.bool,
|
||||||
description: PropTypes.string,
|
description: PropTypes.string,
|
||||||
disabled: PropTypes.bool,
|
disabled: PropTypes.bool,
|
||||||
iconButtonAriaLabel: PropTypes.string.isRequired,
|
iconButtonAriaLabel: PropTypes.string.isRequired,
|
||||||
@ -441,7 +442,6 @@ RelationInput.propTypes = {
|
|||||||
published: PropTypes.string.isRequired,
|
published: PropTypes.string.isRequired,
|
||||||
}).isRequired,
|
}).isRequired,
|
||||||
required: PropTypes.bool,
|
required: PropTypes.bool,
|
||||||
toOneRelation: PropTypes.bool,
|
|
||||||
searchResults: SearchResults,
|
searchResults: SearchResults,
|
||||||
size: PropTypes.number.isRequired,
|
size: PropTypes.number.isRequired,
|
||||||
relations: RelationsResult,
|
relations: RelationsResult,
|
||||||
|
@ -271,6 +271,7 @@ export const RelationInputDataManager = ({
|
|||||||
return (
|
return (
|
||||||
<RelationInput
|
<RelationInput
|
||||||
error={error}
|
error={error}
|
||||||
|
canReorder={!toOneRelation}
|
||||||
description={description}
|
description={description}
|
||||||
disabled={isDisabled}
|
disabled={isDisabled}
|
||||||
iconButtonAriaLabel={formatMessage({
|
iconButtonAriaLabel={formatMessage({
|
||||||
@ -346,7 +347,6 @@ export const RelationInputDataManager = ({
|
|||||||
'isSuccess'
|
'isSuccess'
|
||||||
)}
|
)}
|
||||||
required={required}
|
required={required}
|
||||||
toOneRelation={toOneRelation}
|
|
||||||
searchResults={normalizeSearchResults(search, {
|
searchResults={normalizeSearchResults(search, {
|
||||||
mainFieldName: mainField.name,
|
mainFieldName: mainField.name,
|
||||||
})}
|
})}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user