mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-10-17 17:57:59 +00:00
First review
This commit is contained in:
1 parent
0e63f93696
commit
ad6b700978
10 files changed
+108
-99
No files matched your search
+10
-14
@@ -245,7 +245,7 @@ public partial class DocumentAnalysisAssistant : AssistantBaseCore<NoSettingsPan
|
||||
this.selectedPolicy = this.SettingsManager.ConfigurationData.DocumentAnalysis.Policies.FirstOrDefault();
|
||||
if(this.selectedPolicy is null)
|
||||
{
|
||||
await this.AddInitialPolicy();
|
||||
await this.AddPolicy();
|
||||
this.selectedPolicy = this.SettingsManager.ConfigurationData.DocumentAnalysis.Policies.First();
|
||||
}
|
||||
|
||||
@@ -484,32 +484,28 @@ public partial class DocumentAnalysisAssistant : AssistantBaseCore<NoSettingsPan
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
private Task AddPolicy() => this.AddPolicy(null);
|
||||
|
||||
private async Task ImportPolicy()
|
||||
{
|
||||
if (this.ArePolicyControlsDisabled || !this.SettingsManager.ConfigurationData.App.CanImportConfigurationSnippet("DOCUMENT_ANALYSIS_POLICIES"))
|
||||
return;
|
||||
var table = await ConfigurationSnippetImportDialog.ShowAsync(this.DialogService, "DOCUMENT_ANALYSIS_POLICIES", T("Import document analysis policy"));
|
||||
if (table is not null && this.SettingsManager.ConfigurationData.App.CanImportConfigurationSnippet("DOCUMENT_ANALYSIS_POLICIES"))
|
||||
await this.AddPolicy(table);
|
||||
await this.AddImportedPolicy(table);
|
||||
}
|
||||
|
||||
private async Task AddPolicy(LuaTable? importedConfiguration)
|
||||
private async Task AddImportedPolicy(LuaTable importedConfiguration)
|
||||
{
|
||||
if (this.ArePolicyControlsDisabled)
|
||||
if (this.ArePolicyControlsDisabled || !this.SettingsManager.ConfigurationData.App.CanImportConfigurationSnippet("DOCUMENT_ANALYSIS_POLICIES"))
|
||||
return;
|
||||
|
||||
if (importedConfiguration is not null && !this.SettingsManager.ConfigurationData.App.CanImportConfigurationSnippet("DOCUMENT_ANALYSIS_POLICIES"))
|
||||
return;
|
||||
|
||||
var parameters = new DialogParameters<DocumentAnalysisPolicyDialog>();
|
||||
if (importedConfiguration is not null)
|
||||
parameters.Add(x => x.ImportedConfiguration, importedConfiguration);
|
||||
var parameters = new DialogParameters<DocumentAnalysisPolicyDialog>
|
||||
{
|
||||
{ x => x.ImportedConfiguration, importedConfiguration },
|
||||
};
|
||||
var dialogReference = await this.DialogService.ShowAsync<DocumentAnalysisPolicyDialog>(T("Add policy"), parameters, DialogOptions.FULLSCREEN);
|
||||
var result = await dialogReference.Result;
|
||||
if (result is null || result.Canceled || result.Data is not DataDocumentAnalysisPolicy policy ||
|
||||
(importedConfiguration is not null && !this.SettingsManager.ConfigurationData.App.CanImportConfigurationSnippet("DOCUMENT_ANALYSIS_POLICIES")))
|
||||
!this.SettingsManager.ConfigurationData.App.CanImportConfigurationSnippet("DOCUMENT_ANALYSIS_POLICIES"))
|
||||
return;
|
||||
|
||||
var addedPolicy = policy with
|
||||
@@ -521,7 +517,7 @@ public partial class DocumentAnalysisAssistant : AssistantBaseCore<NoSettingsPan
|
||||
this.SelectedPolicyChanged(addedPolicy);
|
||||
}
|
||||
|
||||
private async Task AddInitialPolicy()
|
||||
private async Task AddPolicy()
|
||||
{
|
||||
if (this.ArePolicyControlsDisabled)
|
||||
return;
|
||||
|
||||
Reference in new issue
Block a user