New: Display items tags on import lists index

pull/10548/head v5.12.2.9335
Bogdan 3 months ago
parent 0049922ab6
commit 889d071004

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

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

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

Loading…
Cancel
Save