mirror of
https://github.com/Unleash/unleash.git
synced 2025-06-04 01:18:20 +02:00
Inline paginate strategies
This commit is contained in:
parent
c1cea1e5a6
commit
c08a334f98
@ -244,46 +244,6 @@ export const EnvironmentAccordionBody = ({
|
|||||||
const paginateStrategies =
|
const paginateStrategies =
|
||||||
strategies.length >= 50 && manyStrategiesPagination;
|
strategies.length >= 50 && manyStrategiesPagination;
|
||||||
|
|
||||||
const strategyList = paginateStrategies ? (
|
|
||||||
<>
|
|
||||||
{page.map((strategy, index) => (
|
|
||||||
<StyledListItem key={strategy.id}>
|
|
||||||
{index > 0 || releasePlans.length > 0 ? (
|
|
||||||
<StyledStrategySeparator />
|
|
||||||
) : null}
|
|
||||||
|
|
||||||
<ProjectEnvironmentStrategyDraggableItem
|
|
||||||
strategy={strategy}
|
|
||||||
index={index + pageIndex * pageSize}
|
|
||||||
environmentName={featureEnvironment.name}
|
|
||||||
otherEnvironments={otherEnvironments}
|
|
||||||
/>
|
|
||||||
</StyledListItem>
|
|
||||||
))}
|
|
||||||
</>
|
|
||||||
) : (
|
|
||||||
<>
|
|
||||||
{strategies.map((strategy, index) => (
|
|
||||||
<StyledListItem key={strategy.id}>
|
|
||||||
{index > 0 || releasePlans.length > 0 ? (
|
|
||||||
<StyledStrategySeparator />
|
|
||||||
) : null}
|
|
||||||
|
|
||||||
<ProjectEnvironmentStrategyDraggableItem
|
|
||||||
strategy={strategy}
|
|
||||||
index={index}
|
|
||||||
environmentName={featureEnvironment.name}
|
|
||||||
otherEnvironments={otherEnvironments}
|
|
||||||
isDragging={dragItem?.id === strategy.id}
|
|
||||||
onDragStartRef={onDragStartRef}
|
|
||||||
onDragOver={onDragOver(strategy.id)}
|
|
||||||
onDragEnd={onDragEnd}
|
|
||||||
/>
|
|
||||||
</StyledListItem>
|
|
||||||
))}
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<StyledAccordionBodyInnerContainer>
|
<StyledAccordionBodyInnerContainer>
|
||||||
{paginateStrategies ? (
|
{paginateStrategies ? (
|
||||||
@ -304,9 +264,46 @@ export const EnvironmentAccordionBody = ({
|
|||||||
/>
|
/>
|
||||||
</StyledListItem>
|
</StyledListItem>
|
||||||
))}
|
))}
|
||||||
{strategyList}
|
{paginateStrategies ? (
|
||||||
</StyledContentList>
|
<>
|
||||||
|
{page.map((strategy, index) => (
|
||||||
|
<StyledListItem key={strategy.id}>
|
||||||
|
{index > 0 || releasePlans.length > 0 ? (
|
||||||
|
<StyledStrategySeparator />
|
||||||
|
) : null}
|
||||||
|
|
||||||
|
<ProjectEnvironmentStrategyDraggableItem
|
||||||
|
strategy={strategy}
|
||||||
|
index={index + pageIndex * pageSize}
|
||||||
|
environmentName={featureEnvironment.name}
|
||||||
|
otherEnvironments={otherEnvironments}
|
||||||
|
/>
|
||||||
|
</StyledListItem>
|
||||||
|
))}
|
||||||
|
</>
|
||||||
|
) : (
|
||||||
|
<>
|
||||||
|
{strategies.map((strategy, index) => (
|
||||||
|
<StyledListItem key={strategy.id}>
|
||||||
|
{index > 0 || releasePlans.length > 0 ? (
|
||||||
|
<StyledStrategySeparator />
|
||||||
|
) : null}
|
||||||
|
|
||||||
|
<ProjectEnvironmentStrategyDraggableItem
|
||||||
|
strategy={strategy}
|
||||||
|
index={index}
|
||||||
|
environmentName={featureEnvironment.name}
|
||||||
|
otherEnvironments={otherEnvironments}
|
||||||
|
isDragging={dragItem?.id === strategy.id}
|
||||||
|
onDragStartRef={onDragStartRef}
|
||||||
|
onDragOver={onDragOver(strategy.id)}
|
||||||
|
onDragEnd={onDragEnd}
|
||||||
|
/>
|
||||||
|
</StyledListItem>
|
||||||
|
))}
|
||||||
|
</>
|
||||||
|
)}
|
||||||
|
</StyledContentList>
|
||||||
{paginateStrategies ? (
|
{paginateStrategies ? (
|
||||||
<Pagination
|
<Pagination
|
||||||
count={pages.length}
|
count={pages.length}
|
||||||
|
Loading…
Reference in New Issue
Block a user