mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-10-09 07:29:40 +00:00
List the preselected data sources that cannot be used right now
This commit is contained in:
5 files changed
+46
-22
No files matched your search
@@ -67,13 +67,6 @@
|
||||
<MudTextSwitch Label="@T("AI-based data validation")" Value="@this.aiBasedValidation" LabelOn="@T("Yes, let the AI validate & filter the retrieved data.")" LabelOff="@T("No, use all data retrieved from the data sources.")" ValueChanged="@this.ValidationModeChanged"/>
|
||||
}
|
||||
|
||||
@if (!this.aiBasedSourceSelection && this.GetUnavailablePreselectedDataSourceNames().Length > 0)
|
||||
{
|
||||
<MudText Typo="Typo.body2" Color="Color.Warning" Class="mb-3">
|
||||
@T("These data sources are preselected, but cannot be used right now, either due to data privacy or confidence-level requirements, or because they are unavailable:") @this.GetUnavailablePreselectedDataSourceNames()
|
||||
</MudText>
|
||||
}
|
||||
|
||||
@switch (this.aiBasedSourceSelection)
|
||||
{
|
||||
case true when this.availableDataSources.Count == 0:
|
||||
@@ -172,11 +165,24 @@
|
||||
</MudExpansionPanels>
|
||||
break;
|
||||
}
|
||||
|
||||
@if (!this.aiBasedSourceSelection && this.GetUnavailablePreselectedDataSources().Count > 0)
|
||||
{
|
||||
<MudJustifiedText Typo="Typo.body2" Color="Color.Warning">
|
||||
@T("These data sources are preselected, but cannot be used right now, either due to data privacy or confidence-level requirements, or because they are unavailable:")
|
||||
</MudJustifiedText>
|
||||
<ul class="unavailable-data-sources mb-3 mt-1">
|
||||
@foreach (var source in this.GetUnavailablePreselectedDataSources())
|
||||
{
|
||||
<li>@source.Name</li>
|
||||
}
|
||||
</ul>
|
||||
}
|
||||
}
|
||||
}
|
||||
</MudCardContent>
|
||||
<MudCardActions>
|
||||
<MudButton Variant="Variant.Filled" OnClick="@(() => this.HideDataSourceSelection())">
|
||||
<MudButton Variant="Variant.Filled" OnClick="@this.HideDataSourceSelection">
|
||||
@T("Close")
|
||||
</MudButton>
|
||||
</MudCardActions>
|
||||
|
||||
@@ -183,19 +183,19 @@ public partial class DataSourceSelection : MSGComponentBase
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Names the preselected data sources which the filters removed.
|
||||
/// Collects 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.
|
||||
/// The list of available sources 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 that 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()
|
||||
/// <returns>The unusable preselected data sources, or an empty list when there are none.</returns>
|
||||
private IReadOnlyList<IDataSource> GetUnavailablePreselectedDataSources()
|
||||
{
|
||||
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));
|
||||
return this.GetDataSourcesFromConfiguredIds().Where(ds => !availableDataSourceIds.Contains(ds.Id)).ToList();
|
||||
}
|
||||
|
||||
private async Task LoadAndApplyFilters()
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
/*
|
||||
* A plain list renders without markers and without indentation here: something in the global
|
||||
* styles takes both off. This is an enumeration of names and wants to read as one, so it states
|
||||
* marker, indentation and spacing itself. MudBlazor's Markdown styles fight the same fight for
|
||||
* their own lists, and need an !important on the display to win it -- hence the one below.
|
||||
*/
|
||||
.unavailable-data-sources {
|
||||
max-height: 10em;
|
||||
overflow-y: auto;
|
||||
overflow-wrap: anywhere;
|
||||
margin-top: 0;
|
||||
padding-left: 1.5em;
|
||||
list-style: disc outside;
|
||||
}
|
||||
|
||||
.unavailable-data-sources li {
|
||||
display: list-item !important;
|
||||
}
|
||||
Reference in new issue
Block a user