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,7 +244,27 @@ export const EnvironmentAccordionBody = ({
|
||||
const paginateStrategies =
|
||||
strategies.length >= 50 && manyStrategiesPagination;
|
||||
|
||||
const strategyList = paginateStrategies ? (
|
||||
return (
|
||||
<StyledAccordionBodyInnerContainer>
|
||||
{paginateStrategies ? (
|
||||
<AlertContainer>
|
||||
<Alert severity='warning'>
|
||||
We noticed you're using a high number of activation
|
||||
strategies. To ensure a more targeted approach, consider
|
||||
leveraging constraints or segments.
|
||||
</Alert>
|
||||
</AlertContainer>
|
||||
) : null}
|
||||
<StyledContentList>
|
||||
{releasePlans.map((plan) => (
|
||||
<StyledListItem data-type='release-plan' key={plan.id}>
|
||||
<ReleasePlan
|
||||
plan={plan}
|
||||
environmentIsDisabled={isDisabled}
|
||||
/>
|
||||
</StyledListItem>
|
||||
))}
|
||||
{paginateStrategies ? (
|
||||
<>
|
||||
{page.map((strategy, index) => (
|
||||
<StyledListItem key={strategy.id}>
|
||||
@ -282,31 +302,8 @@ export const EnvironmentAccordionBody = ({
|
||||
</StyledListItem>
|
||||
))}
|
||||
</>
|
||||
);
|
||||
|
||||
return (
|
||||
<StyledAccordionBodyInnerContainer>
|
||||
{paginateStrategies ? (
|
||||
<AlertContainer>
|
||||
<Alert severity='warning'>
|
||||
We noticed you're using a high number of activation
|
||||
strategies. To ensure a more targeted approach, consider
|
||||
leveraging constraints or segments.
|
||||
</Alert>
|
||||
</AlertContainer>
|
||||
) : null}
|
||||
<StyledContentList>
|
||||
{releasePlans.map((plan) => (
|
||||
<StyledListItem data-type='release-plan' key={plan.id}>
|
||||
<ReleasePlan
|
||||
plan={plan}
|
||||
environmentIsDisabled={isDisabled}
|
||||
/>
|
||||
</StyledListItem>
|
||||
))}
|
||||
{strategyList}
|
||||
)}
|
||||
</StyledContentList>
|
||||
|
||||
{paginateStrategies ? (
|
||||
<Pagination
|
||||
count={pages.length}
|
||||
|
Loading…
Reference in New Issue
Block a user