Name the preselected data sources that cannot be used right now

This commit is contained in:
Thorsten Sommer committed 2026-09-14 12:14:49 +02:00
1 parent a886d8dbf9
commit e71e389392
3 files changed
+26 -3

No files matched your search

@@ -181,6 +181,22 @@ public partial class DataSourceSelection : MSGComponentBase
var preselectedDataSourceIds = this.DataSourceOptions.PreselectedDataSourceIds.ToHashSet(StringComparer.Ordinal);
return this.GetConfiguredDataSourcesSnapshot().Where(ds => preselectedDataSourceIds.Contains(ds.Id)).ToList();
}
/// <summary>
/// Names the preselected data sources which the filters removed.
/// </summary>
/// <remarks>
/// This list shows what survived the filters, while the preselection keeps what the user asked
/// for. Without this, a preselected source which cannot be used right now is simply missing
/// from the list, and nothing says so. Preselected ids without a configured source are left
/// out: that source is gone, not unavailable.
/// </remarks>
/// <returns>The names of the unusable preselected data sources, or an empty string when there are none.</returns>
private string GetUnavailablePreselectedDataSourceNames()
{
var availableDataSourceIds = this.availableDataSources.Select(ds => ds.Id).ToHashSet(StringComparer.Ordinal);
return string.Join(", ", this.GetDataSourcesFromConfiguredIds().Where(ds => !availableDataSourceIds.Contains(ds.Id)).Select(ds => ds.Name));
}
private async Task LoadAndApplyFilters()
{