1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2024-11-28 08:58:41 +02:00

New: Display tags on import list cards

This commit is contained in:
Bogdan 2024-10-27 00:17:18 +03:00 committed by GitHub
parent 1e89a1a3cb
commit 57534db2f8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 25 additions and 5 deletions

View File

@ -3,6 +3,7 @@ import React, { Component } from 'react';
import Card from 'Components/Card';
import Label from 'Components/Label';
import ConfirmModal from 'Components/Modal/ConfirmModal';
import TagList from 'Components/TagList';
import { kinds } from 'Helpers/Props';
import formatShortTimeSpan from 'Utilities/Date/formatShortTimeSpan';
import translate from 'Utilities/String/translate';
@ -57,6 +58,8 @@ class ImportList extends Component {
id,
name,
enableAutomaticAdd,
tags,
tagList,
minRefreshInterval
} = this.props;
@ -72,16 +75,21 @@ class ImportList extends Component {
<div className={styles.enabled}>
{
enableAutomaticAdd &&
enableAutomaticAdd ?
<Label kind={kinds.SUCCESS}>
{translate('AutomaticAdd')}
</Label>
</Label> :
null
}
</div>
<TagList
tags={tags}
tagList={tagList}
/>
<div className={styles.enabled}>
<Label kind={kinds.INFO} title='List Refresh Interval'>
<Label kind={kinds.DEFAULT} title='List Refresh Interval'>
{`${translate('Refresh')}: ${formatShortTimeSpan(minRefreshInterval)}`}
</Label>
</div>
@ -111,6 +119,8 @@ ImportList.propTypes = {
id: PropTypes.number.isRequired,
name: PropTypes.string.isRequired,
enableAutomaticAdd: PropTypes.bool.isRequired,
tags: PropTypes.arrayOf(PropTypes.number).isRequired,
tagList: PropTypes.arrayOf(PropTypes.object).isRequired,
minRefreshInterval: PropTypes.string.isRequired,
onConfirmDeleteImportList: PropTypes.func.isRequired
};

View File

@ -49,6 +49,7 @@ class ImportLists extends Component {
render() {
const {
items,
tagList,
onConfirmDeleteImportList,
...otherProps
} = this.props;
@ -71,6 +72,7 @@ class ImportLists extends Component {
<ImportList
key={item.id}
{...item}
tagList={tagList}
onConfirmDeleteImportList={onConfirmDeleteImportList}
/>
);
@ -109,6 +111,7 @@ ImportLists.propTypes = {
isFetching: PropTypes.bool.isRequired,
error: PropTypes.object,
items: PropTypes.arrayOf(PropTypes.object).isRequired,
tagList: PropTypes.arrayOf(PropTypes.object).isRequired,
onConfirmDeleteImportList: PropTypes.func.isRequired
};

View File

@ -5,13 +5,20 @@ import { createSelector } from 'reselect';
import { fetchRootFolders } from 'Store/Actions/rootFolderActions';
import { deleteImportList, fetchImportLists } from 'Store/Actions/settingsActions';
import createSortedSectionSelector from 'Store/Selectors/createSortedSectionSelector';
import createTagsSelector from 'Store/Selectors/createTagsSelector';
import sortByProp from 'Utilities/Array/sortByProp';
import ImportLists from './ImportLists';
function createMapStateToProps() {
return createSelector(
createSortedSectionSelector('settings.importLists', sortByProp('name')),
(importLists) => importLists
createTagsSelector(),
(importLists, tagList) => {
return {
...importLists,
tagList
};
}
);
}