Skip to content

Commit 0703eb0

Browse files
committed
Revert "cap the display and mounting of more than 50 pinboards"
1 parent f74e79f commit 0703eb0

File tree

2 files changed

+18
-56
lines changed

2 files changed

+18
-56
lines changed

client/src/panel.tsx

+17-24
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,7 @@ import {
99
top,
1010
} from "./styling";
1111
import { Pinboard } from "./pinboard";
12-
import {
13-
MAX_OPEN_PINBOARDS_TO_DISPLAY,
14-
SelectPinboard,
15-
} from "./selectPinboard";
12+
import { SelectPinboard } from "./selectPinboard";
1613
import { neutral, space } from "@guardian/source-foundations";
1714
import { Navigation } from "./navigation";
1815
import { useGlobalStateContext } from "./globalState";
@@ -271,26 +268,22 @@ export const Panel = ({
271268
{
272269
// The active pinboards are always mounted, so that we receive new item notifications
273270
// Note that the pinboard hides itself based on 'isSelected' prop
274-
activePinboardIds
275-
.slice(0, MAX_OPEN_PINBOARDS_TO_DISPLAY)
276-
.map((pinboardId) => (
277-
<Pinboard
278-
key={pinboardId}
279-
pinboardId={pinboardId}
280-
composerId={useMemo(
281-
() =>
282-
activePinboards.find((_) => _.id === pinboardId)
283-
?.composerId || null,
284-
[activePinboards, pinboardId]
285-
)}
286-
isExpanded={pinboardId === selectedPinboardId && isExpanded}
287-
isSelected={pinboardId === selectedPinboardId}
288-
panelElement={panelRef.current}
289-
setMaybeInlineSelectedPinboardId={
290-
setMaybeInlineSelectedPinboardId
291-
}
292-
/>
293-
))
271+
activePinboardIds.map((pinboardId) => (
272+
<Pinboard
273+
key={pinboardId}
274+
pinboardId={pinboardId}
275+
composerId={useMemo(
276+
() =>
277+
activePinboards.find((_) => _.id === pinboardId)?.composerId ||
278+
null,
279+
[activePinboards, pinboardId]
280+
)}
281+
isExpanded={pinboardId === selectedPinboardId && isExpanded}
282+
isSelected={pinboardId === selectedPinboardId}
283+
panelElement={panelRef.current}
284+
setMaybeInlineSelectedPinboardId={setMaybeInlineSelectedPinboardId}
285+
/>
286+
))
294287
}
295288
</div>
296289
);

client/src/selectPinboard.tsx

+1-32
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,6 @@ const SectionHeading: React.FC = ({ children }) => (
5050
<div css={{ ...textMarginCss, color: palette.neutral["46"] }}>{children}</div>
5151
);
5252

53-
export const MAX_OPEN_PINBOARDS_TO_DISPLAY = 50;
54-
5553
interface SelectPinboardProps {
5654
pinboardsWithClaimCounts: PinboardDataWithClaimCounts[];
5755
noOfTeamPinboardsNotShown: number;
@@ -119,22 +117,10 @@ export const SelectPinboard = ({
119117
};
120118
}, []);
121119

122-
const _allActivePinboardsWithoutPreselected = isPinboardData(
123-
preselectedPinboard
124-
)
120+
const activePinboardsWithoutPreselected = isPinboardData(preselectedPinboard)
125121
? activePinboards.filter((_) => _.id !== preselectedPinboard.id)
126122
: activePinboards;
127123

128-
const activePinboardsWithoutPreselected =
129-
_allActivePinboardsWithoutPreselected.slice(
130-
0,
131-
MAX_OPEN_PINBOARDS_TO_DISPLAY
132-
);
133-
134-
const numberOfPinboardsOverDisplayLimit =
135-
_allActivePinboardsWithoutPreselected.length -
136-
activePinboardsWithoutPreselected.length;
137-
138124
const [searchPinboards, { data, loading, stopPolling, startPolling }] =
139125
useLazyQuery<{
140126
listPinboards: PinboardData[];
@@ -466,23 +452,6 @@ export const SelectPinboard = ({
466452
: activePinboardsWithoutPreselected
467453
).map(OpenPinboardButton)}
468454
{isLoadingActivePinboardList && <SvgSpinner size="xsmall" />}
469-
{numberOfPinboardsOverDisplayLimit > 0 && (
470-
<div
471-
css={css`
472-
padding: ${space[2]}px;
473-
font-weight: normal;
474-
font-style: italic;
475-
`}
476-
>
477-
<strong>
478-
PLUS {numberOfPinboardsOverDisplayLimit} more, which cannot
479-
be displayed.
480-
</strong>{" "}
481-
Please close some unused pinboards and raise with production
482-
staff to ensure workflow items have the correct status so they
483-
get cleaned up accordingly.
484-
</div>
485-
)}
486455
<div css={{ height: space[2] }} />
487456
</React.Fragment>
488457
)}

0 commit comments

Comments
 (0)