Improve messaging for Interactive Search

This commit is contained in:
Bogdan 2023-08-01 09:19:04 +03:00 committed by Mark McDowall
parent e8855c312d
commit 7893fdde10
2 changed files with 12 additions and 8 deletions

View File

@ -1,12 +1,13 @@
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import React, { Fragment } from 'react'; import React, { Fragment } from 'react';
import Alert from 'Components/Alert';
import Icon from 'Components/Icon'; import Icon from 'Components/Icon';
import LoadingIndicator from 'Components/Loading/LoadingIndicator'; import LoadingIndicator from 'Components/Loading/LoadingIndicator';
import FilterMenu from 'Components/Menu/FilterMenu'; import FilterMenu from 'Components/Menu/FilterMenu';
import PageMenuButton from 'Components/Menu/PageMenuButton'; import PageMenuButton from 'Components/Menu/PageMenuButton';
import Table from 'Components/Table/Table'; import Table from 'Components/Table/Table';
import TableBody from 'Components/Table/TableBody'; import TableBody from 'Components/Table/TableBody';
import { align, icons, sortDirections } from 'Helpers/Props'; import { align, icons, kinds, sortDirections } from 'Helpers/Props';
import getErrorMessage from 'Utilities/Object/getErrorMessage'; import getErrorMessage from 'Utilities/Object/getErrorMessage';
import translate from 'Utilities/String/translate'; import translate from 'Utilities/String/translate';
import InteractiveSearchFilterModalConnector from './InteractiveSearchFilterModalConnector'; import InteractiveSearchFilterModalConnector from './InteractiveSearchFilterModalConnector';
@ -149,17 +150,17 @@ function InteractiveSearch(props) {
{ {
!isFetching && isPopulated && !totalReleasesCount ? !isFetching && isPopulated && !totalReleasesCount ?
<div> <Alert kind={kinds.INFO}>
No results found {translate('NoResultsFound')}
</div> : </Alert> :
null null
} }
{ {
!!totalReleasesCount && isPopulated && !items.length ? !!totalReleasesCount && isPopulated && !items.length ?
<div> <Alert kind={kinds.WARNING}>
All results are hidden by the applied filter {translate('AllResultsAreHiddenByTheAppliedFilter')}
</div> : </Alert> :
null null
} }
@ -194,7 +195,7 @@ function InteractiveSearch(props) {
{ {
totalReleasesCount !== items.length && !!items.length ? totalReleasesCount !== items.length && !!items.length ?
<div className={styles.filteredMessage}> <div className={styles.filteredMessage}>
Some results are hidden by the applied filter {translate('SomeResultsAreHiddenByTheAppliedFilter')}
</div> : </div> :
null null
} }

View File

@ -13,6 +13,7 @@
"Age": "Age", "Age": "Age",
"AirDate": "Air Date", "AirDate": "Air Date",
"All": "All", "All": "All",
"AllResultsAreHiddenByTheAppliedFilter": "All results are hidden by the applied filter",
"AllTitles": "All Titles", "AllTitles": "All Titles",
"ApiKeyValidationHealthCheckMessage": "Please update your API key to be at least {0} characters long. You can do this via settings or the config file", "ApiKeyValidationHealthCheckMessage": "Please update your API key to be at least {0} characters long. You can do this via settings or the config file",
"AppDataDirectory": "AppData directory", "AppDataDirectory": "AppData directory",
@ -239,6 +240,7 @@
"NoIssuesWithYourConfiguration": "No issues with your configuration", "NoIssuesWithYourConfiguration": "No issues with your configuration",
"NoLeaveIt": "No, Leave It", "NoLeaveIt": "No, Leave It",
"NoLogFiles": "No log files", "NoLogFiles": "No log files",
"NoResultsFound": "No results found",
"NoSeasons": "No seasons", "NoSeasons": "No seasons",
"NoUpdatesAreAvailable": "No updates are available", "NoUpdatesAreAvailable": "No updates are available",
"NotSeasonPack": "Not Season Pack", "NotSeasonPack": "Not Season Pack",
@ -356,6 +358,7 @@
"SizeOnDisk": "Size on disk", "SizeOnDisk": "Size on disk",
"SkipRedownload": "Skip Redownload", "SkipRedownload": "Skip Redownload",
"SkipRedownloadHelpText": "Prevents Sonarr from trying to download an alternative release for this item", "SkipRedownloadHelpText": "Prevents Sonarr from trying to download an alternative release for this item",
"SomeResultsAreHiddenByTheAppliedFilter": "Some results are hidden by the applied filter",
"Source": "Source", "Source": "Source",
"SourceTitle": "Source Title", "SourceTitle": "Source Title",
"Special": "Special", "Special": "Special",