mirror of
https://github.com/strapi/strapi.git
synced 2025-08-08 00:37:38 +00:00
RelationInputWrapper: Move relations to display into a constant
This commit is contained in:
parent
ddfaeed2af
commit
1fddf048db
@ -7,7 +7,7 @@ import { useCMEditViewDataManager, NotAllowedInput } from '@strapi/helper-plugin
|
|||||||
import { RelationInput } from '../RelationInput';
|
import { RelationInput } from '../RelationInput';
|
||||||
import { useRelation } from '../../hooks/useRelation';
|
import { useRelation } from '../../hooks/useRelation';
|
||||||
import { connect, select, normalizeRelations } from './utils';
|
import { connect, select, normalizeRelations } from './utils';
|
||||||
import { PUBLICATION_STATES } from './constants';
|
import { PUBLICATION_STATES, RELATIONS_TO_DISPLAY, SEARCH_RESULTS_TO_DISPLAY } from './constants';
|
||||||
import { getTrad } from '../../utils';
|
import { getTrad } from '../../utils';
|
||||||
|
|
||||||
export const RelationInputWrapper = ({
|
export const RelationInputWrapper = ({
|
||||||
@ -37,7 +37,7 @@ export const RelationInputWrapper = ({
|
|||||||
},
|
},
|
||||||
pageParams: {
|
pageParams: {
|
||||||
...defaultParams,
|
...defaultParams,
|
||||||
pageSize: 10,
|
pageSize: RELATIONS_TO_DISPLAY,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -46,7 +46,7 @@ export const RelationInputWrapper = ({
|
|||||||
pageParams: {
|
pageParams: {
|
||||||
...defaultParams,
|
...defaultParams,
|
||||||
entityId: isCreatingEntry ? undefined : initialData.id,
|
entityId: isCreatingEntry ? undefined : initialData.id,
|
||||||
pageSize: 10,
|
pageSize: SEARCH_RESULTS_TO_DISPLAY,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
@ -131,7 +131,7 @@ export const RelationInputWrapper = ({
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
name={name}
|
name={name}
|
||||||
numberOfRelationsToDisplay={5}
|
numberOfRelationsToDisplay={RELATIONS_TO_DISPLAY}
|
||||||
onRelationAdd={(relation) => handleRelationAdd(relation)}
|
onRelationAdd={(relation) => handleRelationAdd(relation)}
|
||||||
onRelationRemove={(relation) => handleRelationRemove(relation)}
|
onRelationRemove={(relation) => handleRelationRemove(relation)}
|
||||||
onRelationLoadMore={() => handleRelationLoadMore()}
|
onRelationLoadMore={() => handleRelationLoadMore()}
|
||||||
|
@ -2,3 +2,7 @@ export const PUBLICATION_STATES = {
|
|||||||
DRAFT: 'draft',
|
DRAFT: 'draft',
|
||||||
PUBLISHED: 'published',
|
PUBLISHED: 'published',
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const RELATIONS_TO_DISPLAY = 5;
|
||||||
|
|
||||||
|
export const SEARCH_RESULTS_TO_DISPLAY = 10;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user