Skip to content

Commit

Permalink
Fixed: Limit titles in task name to 10 series
Browse files Browse the repository at this point in the history
  • Loading branch information
mynameisbogdan authored and markus101 committed Apr 28, 2024
1 parent efb3fa9 commit c81ae65
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion frontend/src/System/Tasks/Queued/QueuedTaskRowNameCell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,22 @@ import createMultiSeriesSelector from 'Store/Selectors/createMultiSeriesSelector
import translate from 'Utilities/String/translate';
import styles from './QueuedTaskRowNameCell.css';

function formatTitles(titles: string[]) {
if (!titles) {
return null;
}

if (titles.length > 11) {
return (
<span title={titles.join(', ')}>
{titles.slice(0, 10).join(', ')}, {titles.length - 10} more
</span>
);
}

return <span>{titles.join(', ')}</span>;
}

export interface QueuedTaskRowNameCellProps {
commandName: string;
body: CommandBody;
Expand All @@ -32,7 +48,7 @@ export default function QueuedTaskRowNameCell(
<span className={styles.commandName}>
{commandName}
{sortedSeries.length ? (
<span> - {sortedSeries.map((s) => s.title).join(', ')}</span>
<span> - {formatTitles(sortedSeries.map((s) => s.title))}</span>
) : null}
{body.seasonNumber ? (
<span>
Expand Down

0 comments on commit c81ae65

Please sign in to comment.