1
0
Fork 0
mirror of https://github.com/Sonarr/Sonarr synced 2024-12-21 23:33:00 +00:00

New: Reactive search button on Wanted pages

Closes #7449
This commit is contained in:
Stevie Robinson 2024-12-09 04:36:10 +01:00 committed by GitHub
parent 6c231cbe6a
commit e8c3aa20bd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 18 additions and 31 deletions

View file

@ -153,12 +153,15 @@ class CutoffUnmet extends Component {
<PageToolbar>
<PageToolbarSection>
<PageToolbarButton
label={translate('SearchSelected')}
label={itemsSelected ? translate('SearchSelected') : translate('SearchAll')}
iconName={icons.SEARCH}
isDisabled={!itemsSelected || isSearchingForCutoffUnmetEpisodes}
onPress={this.onSearchSelectedPress}
isDisabled={isSearchingForCutoffUnmetEpisodes}
isSpinning={isSearchingForCutoffUnmetEpisodes}
onPress={itemsSelected ? this.onSearchSelectedPress : this.onSearchAllCutoffUnmetPress}
/>
<PageToolbarSeparator />
<PageToolbarButton
label={isShowingMonitored ? translate('UnmonitorSelected') : translate('MonitorSelected')}
iconName={icons.MONITORED}
@ -167,17 +170,6 @@ class CutoffUnmet extends Component {
onPress={this.onToggleSelectedPress}
/>
<PageToolbarSeparator />
<PageToolbarButton
label={translate('SearchAll')}
iconName={icons.SEARCH}
isDisabled={!items.length}
isSpinning={isSearchingForCutoffUnmetEpisodes}
onPress={this.onSearchAllCutoffUnmetPress}
/>
<PageToolbarSeparator />
</PageToolbarSection>
<PageToolbarSection alignContent={align.RIGHT}>

View file

@ -18,9 +18,10 @@ function createMapStateToProps() {
return createSelector(
(state) => state.wanted.cutoffUnmet,
createCommandExecutingSelector(commandNames.CUTOFF_UNMET_EPISODE_SEARCH),
(cutoffUnmet, isSearchingForCutoffUnmetEpisodes) => {
createCommandExecutingSelector(commandNames.EPISODE_SEARCH),
(cutoffUnmet, isSearchingForAllCutoffUnmetEpisodes, isSearchingForSelectedCutoffUnmetEpisodes) => {
return {
isSearchingForCutoffUnmetEpisodes,
isSearchingForCutoffUnmetEpisodes: isSearchingForAllCutoffUnmetEpisodes || isSearchingForSelectedCutoffUnmetEpisodes,
isSaving: cutoffUnmet.items.filter((m) => m.isSaving).length > 1,
...cutoffUnmet
};

View file

@ -159,12 +159,15 @@ class Missing extends Component {
<PageToolbar>
<PageToolbarSection>
<PageToolbarButton
label={translate('SearchSelected')}
label={itemsSelected ? translate('SearchSelected') : translate('SearchAll')}
iconName={icons.SEARCH}
isDisabled={!itemsSelected || isSearchingForMissingEpisodes}
onPress={this.onSearchSelectedPress}
isSpinning={isSearchingForMissingEpisodes}
isDisabled={isSearchingForMissingEpisodes}
onPress={itemsSelected ? this.onSearchSelectedPress : this.onSearchAllMissingPress}
/>
<PageToolbarSeparator />
<PageToolbarButton
label={isShowingMonitored ? translate('UnmonitorSelected') : translate('MonitorSelected')}
iconName={icons.MONITORED}
@ -175,16 +178,6 @@ class Missing extends Component {
<PageToolbarSeparator />
<PageToolbarButton
label={translate('SearchAll')}
iconName={icons.SEARCH}
isDisabled={!items.length}
isSpinning={isSearchingForMissingEpisodes}
onPress={this.onSearchAllMissingPress}
/>
<PageToolbarSeparator />
<PageToolbarButton
label={translate('ManualImport')}
iconName={icons.INTERACTIVE}

View file

@ -17,9 +17,10 @@ function createMapStateToProps() {
return createSelector(
(state) => state.wanted.missing,
createCommandExecutingSelector(commandNames.MISSING_EPISODE_SEARCH),
(missing, isSearchingForMissingEpisodes) => {
createCommandExecutingSelector(commandNames.EPISODE_SEARCH),
(missing, isSearchingForAllMissingEpisodes, isSearchingForSelectedMissingEpisodes) => {
return {
isSearchingForMissingEpisodes,
isSearchingForMissingEpisodes: isSearchingForAllMissingEpisodes || isSearchingForSelectedMissingEpisodes,
isSaving: missing.items.filter((m) => m.isSaving).length > 1,
...missing
};