mirror of
https://github.com/Readarr/Readarr.git
synced 2026-03-05 13:20:32 -05:00
Fixed: Limit titles in task name to 10 authors
(cherry picked from commit c81ae6546118e954e481894d0b3fa6e9a20359c7) Closes #3449
This commit is contained in:
@@ -6,6 +6,22 @@ import createMultiAuthorsSelector from 'Store/Selectors/createMultiAuthorsSelect
|
|||||||
import translate from 'Utilities/String/translate';
|
import translate from 'Utilities/String/translate';
|
||||||
import styles from './QueuedTaskRowNameCell.css';
|
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 {
|
export interface QueuedTaskRowNameCellProps {
|
||||||
commandName: string;
|
commandName: string;
|
||||||
body: CommandBody;
|
body: CommandBody;
|
||||||
@@ -32,7 +48,7 @@ export default function QueuedTaskRowNameCell(
|
|||||||
<span className={styles.commandName}>
|
<span className={styles.commandName}>
|
||||||
{commandName}
|
{commandName}
|
||||||
{sortedAuthors.length ? (
|
{sortedAuthors.length ? (
|
||||||
<span> - {sortedAuthors.map((a) => a.authorName).join(', ')}</span>
|
<span> - {formatTitles(sortedAuthors.map((a) => a.authorName))}</span>
|
||||||
) : null}
|
) : null}
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user