mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-10-10 06:33:47 +00:00
Name the preselected data sources that cannot be used right now
This commit is contained in:
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()
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user