AiRoutinen View+AddEditDelete
--- Wer reitet so spät durch Nacht und Wind? Es ist der Vater mit seinem Kind; Er hat den Knaben wohn in dem Arm, Er faβt ihn sicher, er hält ihn warm.
This commit is contained in:
@@ -165,6 +165,7 @@
|
||||
<Compile Include="ViewModel\View\Administration\AiPromptbausteinComplexTreeViewModel.cs" />
|
||||
<Compile Include="ViewModel\View\Administration\AiPromptbausteinFolderViewModel.cs" />
|
||||
<Compile Include="ViewModel\View\Administration\AiPromptbausteinPromptViewModel.cs" />
|
||||
<Compile Include="ViewModel\View\Administration\AiPromptbausteinRoutineViewModel.cs" />
|
||||
<Compile Include="ViewModel\View\AI\AiConversationChatViewModel.cs" />
|
||||
<Compile Include="ViewModel\View\AI\AiPromptbausteinActionResultViewModel.cs" />
|
||||
<Compile Include="ViewModel\View\AI\AiPromptbausteinComplexSelectionViewModel.cs" />
|
||||
@@ -205,6 +206,9 @@
|
||||
<Compile Include="View\Detail\AI\AiConfigView.xaml.cs">
|
||||
<DependentUpon>AiConfigView.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="View\Detail\AI\AiPromptbausteinRoutineView.xaml.cs">
|
||||
<DependentUpon>AiPromptbausteinRoutineView.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="View\Detail\Report\DatenbereinigungView.xaml.cs">
|
||||
<DependentUpon>DatenbereinigungView.xaml</DependentUpon>
|
||||
</Compile>
|
||||
@@ -216,6 +220,7 @@
|
||||
</Compile>
|
||||
<Compile Include="View\Navigation\Filter\ValueListFilter.cs" />
|
||||
<Compile Include="View\TemplateSelectors\AiConversationMessageTemplateSelector.cs" />
|
||||
<Compile Include="View\TemplateSelectors\AiPromptbausteinFolderItemTemplateSelector.cs" />
|
||||
<Compile Include="View\Windows\AnimatedBeWoWindow.xaml.cs">
|
||||
<DependentUpon>AnimatedBeWoWindow.xaml</DependentUpon>
|
||||
</Compile>
|
||||
@@ -343,6 +348,10 @@
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="View\Detail\AI\AiPromptbausteinRoutineView.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="View\Detail\Report\DatenbereinigungView.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
|
||||
@@ -75,6 +75,11 @@ namespace BeWo.ServiceProxy
|
||||
[System.ServiceModel.FaultContractAttribute(typeof(BS.Shared.Core.BeWoFault), Action="http://tempuri.org/IAiEnhancedService/InsertAiPromptbausteinPromptBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BS.Shared.Core")]
|
||||
System.Collections.Generic.List<BS.Shared.DataContracts.Feature.AI.AiPromptbausteinPromptDC> InsertAiPromptbausteinPrompt(System.Collections.Generic.List<BS.Shared.DataContracts.Feature.AI.AiPromptbausteinPromptDC> prompts);
|
||||
|
||||
[System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IAiEnhancedService/InsertAiPromptbausteinRoutine", ReplyAction="http://tempuri.org/IAiEnhancedService/InsertAiPromptbausteinRoutineResponse")]
|
||||
[System.ServiceModel.FaultContractAttribute(typeof(BS.Shared.Core.BeWoFault), Action="http://tempuri.org/IAiEnhancedService/InsertAiPromptbausteinRoutineBeWoFaultFault" +
|
||||
"", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BS.Shared.Core")]
|
||||
System.Collections.Generic.List<BS.Shared.DataContracts.Feature.AI.AiPromptbausteinRoutineDC> InsertAiPromptbausteinRoutine(System.Collections.Generic.List<BS.Shared.DataContracts.Feature.AI.AiPromptbausteinRoutineDC> routine);
|
||||
|
||||
[System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IAiEnhancedService/UpdateAiPromptbausteinFolder", ReplyAction="http://tempuri.org/IAiEnhancedService/UpdateAiPromptbausteinFolderResponse")]
|
||||
[System.ServiceModel.FaultContractAttribute(typeof(BS.Shared.Core.BeWoFault), Action="http://tempuri.org/IAiEnhancedService/UpdateAiPromptbausteinFolderBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BS.Shared.Core")]
|
||||
System.Collections.Generic.List<BS.Shared.DataContracts.Feature.AI.AiPromptbausteinFolderDC> UpdateAiPromptbausteinFolder(System.Collections.Generic.List<BS.Shared.DataContracts.Feature.AI.AiPromptbausteinFolderDC> folders);
|
||||
@@ -83,6 +88,11 @@ namespace BeWo.ServiceProxy
|
||||
[System.ServiceModel.FaultContractAttribute(typeof(BS.Shared.Core.BeWoFault), Action="http://tempuri.org/IAiEnhancedService/UpdateAiPromptbausteinPromptBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BS.Shared.Core")]
|
||||
System.Collections.Generic.List<BS.Shared.DataContracts.Feature.AI.AiPromptbausteinPromptDC> UpdateAiPromptbausteinPrompt(System.Collections.Generic.List<BS.Shared.DataContracts.Feature.AI.AiPromptbausteinPromptDC> prompts);
|
||||
|
||||
[System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IAiEnhancedService/UpdateAiPromptbausteinRoutine", ReplyAction="http://tempuri.org/IAiEnhancedService/UpdateAiPromptbausteinRoutineResponse")]
|
||||
[System.ServiceModel.FaultContractAttribute(typeof(BS.Shared.Core.BeWoFault), Action="http://tempuri.org/IAiEnhancedService/UpdateAiPromptbausteinRoutineBeWoFaultFault" +
|
||||
"", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BS.Shared.Core")]
|
||||
System.Collections.Generic.List<BS.Shared.DataContracts.Feature.AI.AiPromptbausteinRoutineDC> UpdateAiPromptbausteinRoutine(System.Collections.Generic.List<BS.Shared.DataContracts.Feature.AI.AiPromptbausteinRoutineDC> routine);
|
||||
|
||||
[System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IAiEnhancedService/DeleteAiPromptbausteinFolder", ReplyAction="http://tempuri.org/IAiEnhancedService/DeleteAiPromptbausteinFolderResponse")]
|
||||
[System.ServiceModel.FaultContractAttribute(typeof(BS.Shared.Core.BeWoFault), Action="http://tempuri.org/IAiEnhancedService/DeleteAiPromptbausteinFolderBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BS.Shared.Core")]
|
||||
void DeleteAiPromptbausteinFolder(System.Collections.Generic.Dictionary<long, long> oid2version);
|
||||
@@ -91,6 +101,11 @@ namespace BeWo.ServiceProxy
|
||||
[System.ServiceModel.FaultContractAttribute(typeof(BS.Shared.Core.BeWoFault), Action="http://tempuri.org/IAiEnhancedService/DeleteAiPromptbausteinPromptBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BS.Shared.Core")]
|
||||
void DeleteAiPromptbausteinPrompt(System.Collections.Generic.Dictionary<long, long> oid2version);
|
||||
|
||||
[System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IAiEnhancedService/DeleteAiPromptbausteinRoutine", ReplyAction="http://tempuri.org/IAiEnhancedService/DeleteAiPromptbausteinRoutineResponse")]
|
||||
[System.ServiceModel.FaultContractAttribute(typeof(BS.Shared.Core.BeWoFault), Action="http://tempuri.org/IAiEnhancedService/DeleteAiPromptbausteinRoutineBeWoFaultFault" +
|
||||
"", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BS.Shared.Core")]
|
||||
void DeleteAiPromptbausteinRoutine(System.Collections.Generic.Dictionary<long, long> oid2version);
|
||||
|
||||
[System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IAiEnhancedService/ExecuteAiFunctionServiceRecordDocumentation" +
|
||||
"", ReplyAction="http://tempuri.org/IAiEnhancedService/ExecuteAiFunctionServiceRecordDocumentation" +
|
||||
"Response")]
|
||||
@@ -211,6 +226,11 @@ namespace BeWo.ServiceProxy
|
||||
return base.Channel.InsertAiPromptbausteinPrompt(prompts);
|
||||
}
|
||||
|
||||
public System.Collections.Generic.List<BS.Shared.DataContracts.Feature.AI.AiPromptbausteinRoutineDC> InsertAiPromptbausteinRoutine(System.Collections.Generic.List<BS.Shared.DataContracts.Feature.AI.AiPromptbausteinRoutineDC> routine)
|
||||
{
|
||||
return base.Channel.InsertAiPromptbausteinRoutine(routine);
|
||||
}
|
||||
|
||||
public System.Collections.Generic.List<BS.Shared.DataContracts.Feature.AI.AiPromptbausteinFolderDC> UpdateAiPromptbausteinFolder(System.Collections.Generic.List<BS.Shared.DataContracts.Feature.AI.AiPromptbausteinFolderDC> folders)
|
||||
{
|
||||
return base.Channel.UpdateAiPromptbausteinFolder(folders);
|
||||
@@ -221,6 +241,11 @@ namespace BeWo.ServiceProxy
|
||||
return base.Channel.UpdateAiPromptbausteinPrompt(prompts);
|
||||
}
|
||||
|
||||
public System.Collections.Generic.List<BS.Shared.DataContracts.Feature.AI.AiPromptbausteinRoutineDC> UpdateAiPromptbausteinRoutine(System.Collections.Generic.List<BS.Shared.DataContracts.Feature.AI.AiPromptbausteinRoutineDC> routine)
|
||||
{
|
||||
return base.Channel.UpdateAiPromptbausteinRoutine(routine);
|
||||
}
|
||||
|
||||
public void DeleteAiPromptbausteinFolder(System.Collections.Generic.Dictionary<long, long> oid2version)
|
||||
{
|
||||
base.Channel.DeleteAiPromptbausteinFolder(oid2version);
|
||||
@@ -231,6 +256,11 @@ namespace BeWo.ServiceProxy
|
||||
base.Channel.DeleteAiPromptbausteinPrompt(oid2version);
|
||||
}
|
||||
|
||||
public void DeleteAiPromptbausteinRoutine(System.Collections.Generic.Dictionary<long, long> oid2version)
|
||||
{
|
||||
base.Channel.DeleteAiPromptbausteinRoutine(oid2version);
|
||||
}
|
||||
|
||||
public BS.Shared.DataContracts.Feature.AI.Functions.ServiceRecords.AiFunctionDocResponse ExecuteAiFunctionServiceRecordDocumentation(BS.Shared.DataContracts.Feature.AI.Functions.ServiceRecords.AiFunctionDocRequest request)
|
||||
{
|
||||
return base.Channel.ExecuteAiFunctionServiceRecordDocumentation(request);
|
||||
|
||||
@@ -68,6 +68,10 @@ namespace BeWo.Services
|
||||
{
|
||||
ShowAiPromptbausteinSelectionComplexWindow(viewModel6);
|
||||
}
|
||||
else if (windowViewModel is AiPromptbausteinRoutineViewModel viewModel7)
|
||||
{
|
||||
ShowAiPromptbausteinRoutineWindow(viewModel7);
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new NotImplementedException($"type not implemented: {typeof(T)}");
|
||||
@@ -105,6 +109,16 @@ namespace BeWo.Services
|
||||
};
|
||||
Show("KI Promptbaustein Prompt", control, viewModel, options);
|
||||
}
|
||||
public void ShowAiPromptbausteinRoutineWindow(AiPromptbausteinRoutineViewModel viewModel)
|
||||
{
|
||||
var control = new AiPromptbausteinRoutineView(viewModel);
|
||||
var options = new BeWoWindowOptions()
|
||||
{
|
||||
Height = 400,
|
||||
Width = 600
|
||||
};
|
||||
Show("KI Promptbaustein Prompt", control, viewModel, options);
|
||||
}
|
||||
public void ShowAiPromptbausteinActionResultWindow(AiPromptbausteinActionResultViewModel viewModel)
|
||||
{
|
||||
var control = new AiPromptbausteinActionResultView(viewModel);
|
||||
|
||||
@@ -12,14 +12,25 @@
|
||||
ItemsSource="{Binding Path=SubFolders.VMList}">
|
||||
<Grid Background="Transparent">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
<Image
|
||||
Name="img"
|
||||
Width="16"
|
||||
Height="16"
|
||||
Margin="0,0,0,2"
|
||||
Source="..\..\Ressources\Icons\Folder.png"
|
||||
Stretch="Fill" />
|
||||
<TextBox
|
||||
Grid.Column="1"
|
||||
Height="21"
|
||||
Margin="0,0,0,0"
|
||||
Padding="0,3,0,0"
|
||||
@@ -30,7 +41,7 @@
|
||||
Focusable="False"
|
||||
FontWeight="{Binding FontWeight}"
|
||||
IsReadOnly="True"
|
||||
Text="{Binding Path=Displayname, UpdateSourceTrigger=PropertyChanged, Mode=OneWay}"
|
||||
Text="{Binding Path=Title, UpdateSourceTrigger=PropertyChanged, Mode=OneWay}"
|
||||
ToolTipService.ShowDuration="100000">
|
||||
<TextBox.ToolTip>
|
||||
<StackPanel Orientation="Vertical">
|
||||
@@ -48,6 +59,49 @@
|
||||
</StackPanel>
|
||||
</TextBox.ToolTip>
|
||||
</TextBox>
|
||||
<Border
|
||||
x:Name="border1"
|
||||
Grid.Column="3"
|
||||
MinWidth="24"
|
||||
Margin="0,0,3,0"
|
||||
Padding="3"
|
||||
VerticalAlignment="Stretch"
|
||||
Background="#EEEDFE"
|
||||
CornerRadius="7">
|
||||
<TextBlock
|
||||
Margin="1,0,0,0"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
FontSize="10"
|
||||
Text="{Binding TotalPromptCount, StringFormat={}{0}P}"
|
||||
TextWrapping="Wrap" />
|
||||
</Border>
|
||||
|
||||
<Border
|
||||
x:Name="border2"
|
||||
Grid.Column="4"
|
||||
MinWidth="24"
|
||||
Margin="0,0,3,0"
|
||||
Padding="3"
|
||||
VerticalAlignment="Stretch"
|
||||
Background="#E1F5EE"
|
||||
CornerRadius="7">
|
||||
<TextBlock
|
||||
Margin="1,0,0,0"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
FontSize="10"
|
||||
Text="{Binding TotalRoutineCount, StringFormat={}{0}R}"
|
||||
TextWrapping="Wrap" />
|
||||
</Border>
|
||||
</Grid>
|
||||
<HierarchicalDataTemplate.Triggers>
|
||||
<DataTrigger Binding="{Binding TotalPromptCount}" Value="0">
|
||||
<Setter TargetName="border1" Property="Visibility" Value="Collapsed" />
|
||||
</DataTrigger>
|
||||
<DataTrigger Binding="{Binding TotalRoutineCount}" Value="0">
|
||||
<Setter TargetName="border2" Property="Visibility" Value="Collapsed" />
|
||||
</DataTrigger>
|
||||
</HierarchicalDataTemplate.Triggers>
|
||||
</HierarchicalDataTemplate>
|
||||
</ResourceDictionary>
|
||||
@@ -37,7 +37,10 @@
|
||||
<Separator Tag="Vorlage" />
|
||||
<MenuItem Header="Neues Dokument aus Vorlage erstellen" Tag="Vorlage">
|
||||
<MenuItem.Icon>
|
||||
<Image Source="..\Ressources\Icons\DocumentWithAdd2.png" Width="24" Height="24" />
|
||||
<Image
|
||||
Width="24"
|
||||
Height="24"
|
||||
Source="..\Ressources\Icons\DocumentWithAdd2.png" />
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
</ContextMenu>
|
||||
@@ -54,7 +57,6 @@
|
||||
Height="20"
|
||||
Source="..\Ressources\Icons\Folder.png"
|
||||
Stretch="Fill" />
|
||||
|
||||
<TextBox
|
||||
Padding="2,1"
|
||||
Background="Transparent"
|
||||
@@ -184,26 +186,57 @@
|
||||
</DataTemplate>
|
||||
</dxg:GridColumn.CellTemplate>
|
||||
</dxg:GridColumn>
|
||||
<dxg:GridColumn FieldName="InsertedOn" AllowEditing="False" Header="hinterlegt am" Width="150" SortOrder="Ascending"/>
|
||||
<dxg:GridColumn FieldName="InsertedBy" AllowEditing="False" Header="hinterlegt von" Width="150" />
|
||||
<dxg:GridColumn FieldName="FileName" AllowEditing="False" Header="Dateiname" Width="180" />
|
||||
<dxg:GridColumn FieldName="Description" AllowEditing="False" Header="Beschreibung" Width="180" />
|
||||
<dxg:GridColumn FieldName="URL" Header="" Width="100" MinWidth="90" x:Name="ColumnDownload">
|
||||
<dxg:GridColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock>
|
||||
<Hyperlink TargetName="inexistent" NavigateUri="{Binding Path=Value, Converter={StaticResource DownloadURLConverter}}" RequestNavigate="Hyperlink_OnRequestNavigate">
|
||||
<TextBlock Text="herunterladen" />
|
||||
</Hyperlink>
|
||||
</TextBlock>
|
||||
</DataTemplate>
|
||||
</dxg:GridColumn.CellTemplate>
|
||||
</dxg:GridColumn>
|
||||
</dxg:GridControl.Columns>
|
||||
<dxg:GridControl.View>
|
||||
<dxg:TableView AutoWidth="false" ShowGroupPanel="False" ShowGroupedColumns="false" ShowTotalSummary="False" NavigationStyle="Cell" x:Name="DocumentTableView" />
|
||||
</dxg:GridControl.View>
|
||||
</dxg:GridControl>
|
||||
<dxg:GridColumn
|
||||
Width="150"
|
||||
AllowEditing="False"
|
||||
FieldName="InsertedOn"
|
||||
Header="hinterlegt am"
|
||||
SortOrder="Ascending" />
|
||||
<dxg:GridColumn
|
||||
Width="150"
|
||||
AllowEditing="False"
|
||||
FieldName="InsertedBy"
|
||||
Header="hinterlegt von" />
|
||||
<dxg:GridColumn
|
||||
Width="180"
|
||||
AllowEditing="False"
|
||||
FieldName="FileName"
|
||||
Header="Dateiname" />
|
||||
<dxg:GridColumn
|
||||
Width="180"
|
||||
AllowEditing="False"
|
||||
FieldName="Description"
|
||||
Header="Beschreibung" />
|
||||
<dxg:GridColumn
|
||||
x:Name="ColumnDownload"
|
||||
Width="100"
|
||||
MinWidth="90"
|
||||
FieldName="URL"
|
||||
Header="">
|
||||
<dxg:GridColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock>
|
||||
<Hyperlink
|
||||
NavigateUri="{Binding Path=Value, Converter={StaticResource DownloadURLConverter}}"
|
||||
RequestNavigate="Hyperlink_OnRequestNavigate"
|
||||
TargetName="inexistent">
|
||||
<TextBlock Text="herunterladen" />
|
||||
</Hyperlink>
|
||||
</TextBlock>
|
||||
</DataTemplate>
|
||||
</dxg:GridColumn.CellTemplate>
|
||||
</dxg:GridColumn>
|
||||
</dxg:GridControl.Columns>
|
||||
<dxg:GridControl.View>
|
||||
<dxg:TableView
|
||||
x:Name="DocumentTableView"
|
||||
AutoWidth="false"
|
||||
NavigationStyle="Cell"
|
||||
ShowGroupPanel="False"
|
||||
ShowGroupedColumns="false"
|
||||
ShowTotalSummary="False" />
|
||||
</dxg:GridControl.View>
|
||||
</dxg:GridControl>
|
||||
|
||||
</Grid>
|
||||
<Canvas>
|
||||
|
||||
@@ -60,6 +60,7 @@
|
||||
Padding="4,16,4,16"
|
||||
AllowDrop="True"
|
||||
ContextMenuOpening="treeView_ContextMenuOpening"
|
||||
ContextMenuService.IsEnabled="{Binding CanOpenContextMenu}"
|
||||
ItemContainerStyle="{DynamicResource igoal_treeitemstyle}"
|
||||
ItemTemplate="{StaticResource ai_promptbaustein_folder_itemtemplate}"
|
||||
ItemsSource="{Binding Folders.VMList, UpdateSourceTrigger=PropertyChanged}"
|
||||
@@ -122,6 +123,7 @@
|
||||
VerticalContentAlignment="Stretch"
|
||||
AllowDrop="False"
|
||||
ContextMenuOpening="ListBox_ContextMenuOpening"
|
||||
ContextMenuService.IsEnabled="{Binding CanOpenContextMenu}"
|
||||
EditValue="{Binding SelectedPrompt, Mode=TwoWay}"
|
||||
ItemContainerStyle="{StaticResource PromptListBoxItem}"
|
||||
ItemsSource="{Binding SelectedFolder.Prompts, UpdateSourceTrigger=PropertyChanged}"
|
||||
@@ -300,10 +302,10 @@ Style="{StaticResource ObjectEditGroupBox}">
|
||||
<Button
|
||||
Grid.Row="1"
|
||||
Grid.ColumnSpan="3"
|
||||
MinWidth="50"
|
||||
Command="{Binding SendCommand}"
|
||||
Style="{StaticResource PrimaryButton}">
|
||||
Absenden
|
||||
</Button>
|
||||
Content="{Binding AcceptButtonText}"
|
||||
Style="{StaticResource PrimaryButton}" />
|
||||
</Grid>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
xmlns:dxlc="http://schemas.devexpress.com/winfx/2008/xaml/layoutcontrol"
|
||||
xmlns:local1="clr-namespace:BeWo.View.Detail.AI"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:templateselectors="clr-namespace:BeWo.View.TemplateSelectors"
|
||||
xmlns:view="clr-namespace:BeWo.View"
|
||||
xmlns:vm="clr-namespace:BeWo.ViewModel"
|
||||
d:DataContext="{d:DesignInstance Type=administration:AiPromptbausteinComplexTreeViewModel,
|
||||
@@ -27,6 +28,256 @@
|
||||
TargetType="ListBoxItem">
|
||||
<Setter Property="IsSelected" Value="{Binding IsSelected}" />
|
||||
</Style>
|
||||
<DataTemplate x:Key="AiPromptbausteinPromptItemTemplate">
|
||||
<Border
|
||||
Background="#09000000"
|
||||
BorderThickness="1"
|
||||
CornerRadius="5">
|
||||
|
||||
<Grid
|
||||
Margin="6"
|
||||
Background="Transparent"
|
||||
PreviewMouseDown="Grid_PreviewMouseDown_1">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="6" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
<Rectangle
|
||||
Grid.RowSpan="2"
|
||||
Width="24"
|
||||
Height="24"
|
||||
Fill="White" />
|
||||
<StackPanel Grid.Column="2" Orientation="Horizontal">
|
||||
<TextBox
|
||||
Height="21"
|
||||
Margin="2,0,0,0"
|
||||
Padding="0"
|
||||
VerticalAlignment="Center"
|
||||
Background="Transparent"
|
||||
BorderThickness="0"
|
||||
Cursor="Arrow"
|
||||
Focusable="False"
|
||||
FontWeight="{Binding FontWeight, UpdateSourceTrigger=PropertyChanged}"
|
||||
IsReadOnly="True"
|
||||
Text="{Binding Path=Title, UpdateSourceTrigger=PropertyChanged, Mode=OneWay}"
|
||||
ToolTipService.ShowDuration="100000">
|
||||
<TextBox.ToolTip>
|
||||
<StackPanel Orientation="Vertical">
|
||||
<Label Content="{Binding Path=Title, Mode=OneWay}" FontWeight="Bold" />
|
||||
<TextBox
|
||||
MaxWidth="500"
|
||||
Padding="3,1,0,0"
|
||||
VerticalAlignment="Center"
|
||||
AcceptsReturn="True"
|
||||
Background="Transparent"
|
||||
BorderThickness="0"
|
||||
IsReadOnly="True"
|
||||
Text="{Binding Path=Description}"
|
||||
TextWrapping="Wrap" />
|
||||
</StackPanel>
|
||||
</TextBox.ToolTip>
|
||||
</TextBox>
|
||||
<TextBlock
|
||||
Margin="0"
|
||||
Padding="0"
|
||||
Visibility="{Binding IsInfoVisible, Converter={StaticResource BoolVisibilityConverter}}">
|
||||
<Hyperlink NavigateUri="{Binding OwnsoftRefLink}" RequestNavigate="Hyperlink_RequestNavigate">
|
||||
(i)
|
||||
</Hyperlink>
|
||||
</TextBlock>
|
||||
</StackPanel>
|
||||
<StackPanel
|
||||
Grid.Row="1"
|
||||
Grid.Column="2"
|
||||
Orientation="Horizontal">
|
||||
<Border
|
||||
x:Name="border1"
|
||||
Width="46"
|
||||
Margin="0,0,3,0"
|
||||
Padding="3"
|
||||
HorizontalAlignment="Left"
|
||||
Background="#EEEDFE"
|
||||
CornerRadius="7">
|
||||
<TextBlock
|
||||
Margin="1,0,0,0"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
FontSize="10"
|
||||
Text="Prompt"
|
||||
TextWrapping="Wrap" />
|
||||
</Border>
|
||||
<TextBlock
|
||||
Margin="3,0,0,0"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
FontSize="10">
|
||||
Bearbeitet vor x Minuten
|
||||
</TextBlock>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Border>
|
||||
</DataTemplate>
|
||||
<DataTemplate x:Key="AiPromptbausteinRoutineItemTemplate">
|
||||
<Border
|
||||
Background="#09000000"
|
||||
BorderThickness="1"
|
||||
CornerRadius="5">
|
||||
|
||||
<Grid
|
||||
Margin="6"
|
||||
Background="Transparent"
|
||||
PreviewMouseDown="Grid_PreviewMouseDown_1">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="9" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
<Rectangle
|
||||
Grid.RowSpan="2"
|
||||
Width="24"
|
||||
Height="24"
|
||||
Fill="White" />
|
||||
<StackPanel Grid.Column="2" Orientation="Horizontal">
|
||||
<TextBox
|
||||
Height="21"
|
||||
Margin="0,0,0,0"
|
||||
Padding="0"
|
||||
VerticalAlignment="Center"
|
||||
Background="Transparent"
|
||||
BorderThickness="0"
|
||||
Cursor="Arrow"
|
||||
Focusable="False"
|
||||
FontWeight="{Binding FontWeight, UpdateSourceTrigger=PropertyChanged}"
|
||||
IsReadOnly="True"
|
||||
Text="{Binding Path=Title, UpdateSourceTrigger=PropertyChanged, Mode=OneWay}"
|
||||
ToolTipService.ShowDuration="100000">
|
||||
<TextBox.ToolTip>
|
||||
<StackPanel Orientation="Vertical">
|
||||
<Label Content="{Binding Path=Title, Mode=OneWay}" FontWeight="Bold" />
|
||||
<TextBox
|
||||
MaxWidth="500"
|
||||
Padding="3,1,0,0"
|
||||
VerticalAlignment="Center"
|
||||
AcceptsReturn="True"
|
||||
Background="Transparent"
|
||||
BorderThickness="0"
|
||||
IsReadOnly="True"
|
||||
Text="{Binding Path=Description}"
|
||||
TextWrapping="Wrap" />
|
||||
</StackPanel>
|
||||
</TextBox.ToolTip>
|
||||
</TextBox>
|
||||
<TextBlock
|
||||
Margin="0"
|
||||
Padding="0"
|
||||
Visibility="{Binding IsInfoVisible, Converter={StaticResource BoolVisibilityConverter}}">
|
||||
<Hyperlink NavigateUri="{Binding OwnsoftRefLink}" RequestNavigate="Hyperlink_RequestNavigate">
|
||||
(i)
|
||||
</Hyperlink>
|
||||
</TextBlock>
|
||||
</StackPanel>
|
||||
<StackPanel
|
||||
Grid.Row="1"
|
||||
Grid.Column="2"
|
||||
Margin="0,-1,0,0"
|
||||
Orientation="Horizontal">
|
||||
<Border
|
||||
x:Name="border1"
|
||||
Width="46"
|
||||
Margin="0,0,3,0"
|
||||
Padding="3"
|
||||
HorizontalAlignment="Left"
|
||||
Background="#E1F5EE"
|
||||
CornerRadius="7">
|
||||
<TextBlock
|
||||
Margin="1,0,0,0"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
FontSize="10"
|
||||
Text="Routine"
|
||||
TextWrapping="Wrap" />
|
||||
</Border>
|
||||
<TextBlock
|
||||
Margin="3,0,0,0"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
FontSize="10">
|
||||
3 Schritte · 2 min
|
||||
</TextBlock>
|
||||
</StackPanel>
|
||||
<ListBox
|
||||
Grid.Row="2"
|
||||
Grid.Column="2"
|
||||
Margin="3,9,3,3"
|
||||
AllowDrop="False"
|
||||
Background="Transparent"
|
||||
BorderThickness="0"
|
||||
Focusable="False"
|
||||
IsHitTestVisible="False"
|
||||
ItemsSource="{Binding Steps.VMList}">
|
||||
<ListBox.ItemContainerStyle>
|
||||
<Style TargetType="ListBoxItem">
|
||||
<Setter Property="Padding" Value="0" />
|
||||
</Style>
|
||||
</ListBox.ItemContainerStyle>
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock
|
||||
x:Name="arrow"
|
||||
Margin="3"
|
||||
VerticalAlignment="Center"
|
||||
Text="➔" />
|
||||
<Border
|
||||
x:Name="border1"
|
||||
Height="19"
|
||||
Margin="0"
|
||||
Padding="3"
|
||||
HorizontalAlignment="Left"
|
||||
Background="DarkGray"
|
||||
CornerRadius="7">
|
||||
<TextBlock
|
||||
Margin="3,0,3,0"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
FontSize="10"
|
||||
Text="{Binding PromptReference.Title, StringFormat={}✦ {0}}"
|
||||
TextWrapping="Wrap" />
|
||||
</Border>
|
||||
</StackPanel>
|
||||
<DataTemplate.Triggers>
|
||||
<DataTrigger Binding="{Binding RelativeSource={RelativeSource PreviousData}}" Value="{x:Null}">
|
||||
<Setter TargetName="arrow" Property="Visibility" Value="Collapsed" />
|
||||
</DataTrigger>
|
||||
</DataTemplate.Triggers>
|
||||
</DataTemplate>
|
||||
</ListBox.ItemTemplate>
|
||||
<ListBox.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<StackPanel Orientation="Horizontal" />
|
||||
</ItemsPanelTemplate>
|
||||
</ListBox.ItemsPanel>
|
||||
</ListBox>
|
||||
</Grid>
|
||||
</Border>
|
||||
</DataTemplate>
|
||||
|
||||
<templateselectors:AiPromptbausteinFolderItemTemplateSelector
|
||||
x:Key="AiPromptbausteinFolderItemTemplateSelector"
|
||||
AiPromptbausteinPromptTemplate="{StaticResource AiPromptbausteinPromptItemTemplate}"
|
||||
AiPromptbausteinRoutineTemplate="{StaticResource AiPromptbausteinRoutineItemTemplate}" />
|
||||
</ResourceDictionary>
|
||||
</view:BeWoView.Resources>
|
||||
<GroupBox Style="{StaticResource ObjectEditGroupBox}">
|
||||
@@ -57,8 +308,10 @@
|
||||
<GroupBox
|
||||
Grid.Row="1"
|
||||
Grid.Column="0"
|
||||
Margin="0,7,0,0"
|
||||
Padding="0"
|
||||
HorizontalAlignment="Stretch"
|
||||
Header="Ordner"
|
||||
Header="Bibliothek"
|
||||
Style="{StaticResource ObjectEditGroupBox}">
|
||||
<TreeView
|
||||
x:Name="treeView"
|
||||
@@ -67,6 +320,7 @@
|
||||
HorizontalContentAlignment="Stretch"
|
||||
VerticalContentAlignment="Stretch"
|
||||
AllowDrop="True"
|
||||
BorderThickness="1,0,0,1"
|
||||
ContextMenuOpening="treeView_ContextMenuOpening"
|
||||
ItemContainerStyle="{DynamicResource igoal_treeitemstyle}"
|
||||
ItemTemplate="{StaticResource ai_promptbaustein_folder_itemtemplate}"
|
||||
@@ -127,129 +381,235 @@
|
||||
Width="1"
|
||||
HorizontalAlignment="Center"
|
||||
Background="#878890" />
|
||||
<GroupBox
|
||||
|
||||
<TabControl
|
||||
Grid.Row="1"
|
||||
Grid.Column="2"
|
||||
Grid.ColumnSpan="2"
|
||||
HorizontalAlignment="Stretch"
|
||||
Header="Prompts"
|
||||
Style="{StaticResource ObjectEditGroupBox}">
|
||||
<dxe:ListBoxEdit
|
||||
x:Name="listBoxEdit1"
|
||||
Padding="4,16,4,16"
|
||||
HorizontalContentAlignment="Stretch"
|
||||
VerticalContentAlignment="Stretch"
|
||||
AllowDrop="False"
|
||||
ContextMenuOpening="ListBox_ContextMenuOpening"
|
||||
ItemContainerStyle="{StaticResource PromptListBoxItem}"
|
||||
ItemsSource="{Binding SelectedFolder.Prompts, UpdateSourceTrigger=PropertyChanged}"
|
||||
SelectedItem="{Binding SelectedPrompt, Mode=TwoWay}"
|
||||
SelectionMode="Single">
|
||||
<dxe:ListBoxEdit.ContextMenu>
|
||||
<ContextMenu>
|
||||
<ContextMenu.Resources>
|
||||
<ResourceDictionary>
|
||||
<Style TargetType="{x:Type Image}">
|
||||
<Setter Property="Height" Value="24" />
|
||||
</Style>
|
||||
</ResourceDictionary>
|
||||
</ContextMenu.Resources>
|
||||
<MenuItem Command="{Binding OpenAddPromptDialogCommand}" Header="Neu">
|
||||
<MenuItem.Icon>
|
||||
<Image Source="..\..\..\Ressources\Icons\Add24.png" />
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
<MenuItem Command="{Binding OpenEditPromptDialogCommand}" Header="Bearbeiten">
|
||||
<MenuItem.Icon>
|
||||
<Image Source="..\..\..\Ressources\Icons\Rename24.png" />
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
<Separator />
|
||||
<MenuItem
|
||||
x:Name="favorite"
|
||||
Command="{Binding ChangeFavoritenStatePromptCommand}"
|
||||
Header="Kopieren">
|
||||
<MenuItem.Icon>
|
||||
<Image Source="..\..\..\Ressources\Icons\Favorites32.png" />
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
<Separator />
|
||||
<MenuItem Command="{Binding CopyPromptCommand}" Header="Kopieren">
|
||||
<MenuItem.Icon>
|
||||
<Image Source="..\..\..\Ressources\Icons\Copy24.png" />
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
<MenuItem Command="{Binding PastePromptCommand}" Header="Einfügen">
|
||||
<MenuItem.Icon>
|
||||
<Image Source="..\..\..\Ressources\Icons\Paste24.png" />
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
<Separator />
|
||||
<MenuItem Command="{Binding DeletePromptCommand}" Header="Löschen">
|
||||
<MenuItem.Icon>
|
||||
<Image Source="..\..\..\Ressources\Icons\Delete24.png" />
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
</ContextMenu>
|
||||
</dxe:ListBoxEdit.ContextMenu>
|
||||
<dxe:ListBoxEdit.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Grid
|
||||
Margin="0,3,0,0"
|
||||
Background="Transparent"
|
||||
PreviewMouseDown="Grid_PreviewMouseDown_1">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
<TextBox
|
||||
Height="21"
|
||||
Margin="0"
|
||||
Padding="0"
|
||||
VerticalAlignment="Center"
|
||||
Background="Transparent"
|
||||
BorderThickness="0"
|
||||
Cursor="Arrow"
|
||||
Focusable="False"
|
||||
FontWeight="{Binding FontWeight, UpdateSourceTrigger=PropertyChanged}"
|
||||
IsReadOnly="True"
|
||||
Text="{Binding Path=Title, UpdateSourceTrigger=PropertyChanged, Mode=OneWay}"
|
||||
ToolTipService.ShowDuration="100000">
|
||||
<TextBox.ToolTip>
|
||||
<StackPanel Orientation="Vertical">
|
||||
<Label Content="{Binding Path=Title, Mode=OneWay}" FontWeight="Bold" />
|
||||
<TextBox
|
||||
MaxWidth="500"
|
||||
Padding="3,1,0,0"
|
||||
VerticalAlignment="Center"
|
||||
AcceptsReturn="True"
|
||||
Background="Transparent"
|
||||
BorderThickness="0"
|
||||
IsReadOnly="True"
|
||||
Text="{Binding Path=Description}"
|
||||
TextWrapping="Wrap" />
|
||||
</StackPanel>
|
||||
</TextBox.ToolTip>
|
||||
</TextBox>
|
||||
<TextBlock
|
||||
Grid.Column="1"
|
||||
Margin="0"
|
||||
Padding="0"
|
||||
Visibility="{Binding IsInfoVisible, Converter={StaticResource BoolVisibilityConverter}}">
|
||||
<Hyperlink NavigateUri="{Binding OwnsoftRefLink}" RequestNavigate="Hyperlink_RequestNavigate">
|
||||
(i)
|
||||
</Hyperlink>
|
||||
</TextBlock>
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
</dxe:ListBoxEdit.ItemTemplate>
|
||||
</dxe:ListBoxEdit>
|
||||
</GroupBox>
|
||||
Padding="0"
|
||||
BorderThickness="0,1,1,1"
|
||||
BorderBrush="Gray"
|
||||
SelectionChanged="TabControl_SelectionChanged">
|
||||
<TabControl.Resources>
|
||||
<Style TargetType="TabControl">
|
||||
<Style.Triggers>
|
||||
<DataTrigger Binding="{Binding ElementName=treeView, Path=SelectedItem}" Value="{x:Null}">
|
||||
<Setter Property="Visibility" Value="Hidden" />
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
<Style TargetType="{x:Type TabItem}">
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type TabItem}">
|
||||
<Border
|
||||
x:Name="Border"
|
||||
Grid.Row="0"
|
||||
Grid.Column="0"
|
||||
MinHeight="20"
|
||||
Padding="12,3,12,3"
|
||||
Background="Transparent"
|
||||
TextElement.FontFamily="Microsoft Sans Serif"
|
||||
TextElement.FontSize="16"
|
||||
TextElement.Foreground="{StaticResource TabItemHotTextBrush}">
|
||||
<ContentPresenter ContentSource="Header" RecognizesAccessKey="True" />
|
||||
</Border>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsSelected" Value="True">
|
||||
<Setter Property="Panel.ZIndex" Value="100" />
|
||||
<Setter TargetName="Border" Property="Background" Value="#22000000" />
|
||||
<Setter TargetName="Border" Property="BorderThickness" Value="1,1,1,0" />
|
||||
</Trigger>
|
||||
<Trigger Property="IsEnabled" Value="False">
|
||||
<Setter TargetName="Border" Property="Background" Value="DarkRed" />
|
||||
<Setter TargetName="Border" Property="BorderBrush" Value="Black" />
|
||||
<Setter Property="Foreground" Value="DarkGray" />
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
</TabControl.Resources>
|
||||
|
||||
<TabItem Header="Alle">
|
||||
<dxe:ListBoxEdit
|
||||
x:Name="listBoxEdit3"
|
||||
Padding="8,16,8,16"
|
||||
HorizontalContentAlignment="Stretch"
|
||||
VerticalContentAlignment="Stretch"
|
||||
AllowDrop="False"
|
||||
ContextMenuOpening="ListBox_ContextMenuOpening"
|
||||
ItemContainerStyle="{StaticResource PromptListBoxItem}"
|
||||
ItemTemplateSelector="{StaticResource AiPromptbausteinFolderItemTemplateSelector}"
|
||||
ItemsSource="{Binding SelectedFolder.AlleFolderItems, UpdateSourceTrigger=PropertyChanged}"
|
||||
SelectedItem="{Binding SelectedItem, Mode=TwoWay}"
|
||||
SelectionMode="Single"
|
||||
ShowBorder="False">
|
||||
<dxe:ListBoxEdit.ContextMenu>
|
||||
<ContextMenu>
|
||||
<ContextMenu.Resources>
|
||||
<ResourceDictionary>
|
||||
<Style TargetType="{x:Type Image}">
|
||||
<Setter Property="Height" Value="24" />
|
||||
</Style>
|
||||
</ResourceDictionary>
|
||||
</ContextMenu.Resources>
|
||||
<MenuItem Command="{Binding OpenAddPromptDialogCommand}" Header="Neu">
|
||||
<MenuItem.Icon>
|
||||
<Image Source="..\..\..\Ressources\Icons\Add24.png" />
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
<MenuItem Command="{Binding OpenEditPromptDialogCommand}" Header="Bearbeiten">
|
||||
<MenuItem.Icon>
|
||||
<Image Source="..\..\..\Ressources\Icons\Rename24.png" />
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
<Separator />
|
||||
<MenuItem Command="{Binding ChangeFavoritenStatePromptCommand}" Header="Kopieren">
|
||||
<MenuItem.Icon>
|
||||
<Image Source="..\..\..\Ressources\Icons\Favorites32.png" />
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
<Separator />
|
||||
<MenuItem Command="{Binding CopyPromptCommand}" Header="Kopieren">
|
||||
<MenuItem.Icon>
|
||||
<Image Source="..\..\..\Ressources\Icons\Copy24.png" />
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
<MenuItem Command="{Binding PastePromptCommand}" Header="Einfügen">
|
||||
<MenuItem.Icon>
|
||||
<Image Source="..\..\..\Ressources\Icons\Paste24.png" />
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
<Separator />
|
||||
<MenuItem Command="{Binding DeletePromptCommand}" Header="Löschen">
|
||||
<MenuItem.Icon>
|
||||
<Image Source="..\..\..\Ressources\Icons\Delete24.png" />
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
</ContextMenu>
|
||||
</dxe:ListBoxEdit.ContextMenu>
|
||||
</dxe:ListBoxEdit>
|
||||
</TabItem>
|
||||
<TabItem Header="Prompts">
|
||||
<dxe:ListBoxEdit
|
||||
x:Name="listBoxEdit1"
|
||||
Padding="8,16,8,16"
|
||||
HorizontalContentAlignment="Stretch"
|
||||
VerticalContentAlignment="Stretch"
|
||||
AllowDrop="False"
|
||||
ContextMenuOpening="ListBox_ContextMenuOpening"
|
||||
ItemContainerStyle="{StaticResource PromptListBoxItem}"
|
||||
ItemTemplate="{StaticResource AiPromptbausteinPromptItemTemplate}"
|
||||
ItemsSource="{Binding SelectedFolder.Prompts, UpdateSourceTrigger=PropertyChanged}"
|
||||
SelectedItem="{Binding SelectedItem, Mode=TwoWay}"
|
||||
SelectionMode="Single"
|
||||
ShowBorder="False">
|
||||
<dxe:ListBoxEdit.ContextMenu>
|
||||
<ContextMenu>
|
||||
<ContextMenu.Resources>
|
||||
<ResourceDictionary>
|
||||
<Style TargetType="{x:Type Image}">
|
||||
<Setter Property="Height" Value="24" />
|
||||
</Style>
|
||||
</ResourceDictionary>
|
||||
</ContextMenu.Resources>
|
||||
<MenuItem Command="{Binding OpenAddPromptDialogCommand}" Header="Neu">
|
||||
<MenuItem.Icon>
|
||||
<Image Source="..\..\..\Ressources\Icons\Add24.png" />
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
<MenuItem Command="{Binding OpenEditPromptDialogCommand}" Header="Bearbeiten">
|
||||
<MenuItem.Icon>
|
||||
<Image Source="..\..\..\Ressources\Icons\Rename24.png" />
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
<Separator />
|
||||
<MenuItem
|
||||
x:Name="favorite"
|
||||
Command="{Binding ChangeFavoritenStatePromptCommand}"
|
||||
Header="Kopieren">
|
||||
<MenuItem.Icon>
|
||||
<Image Source="..\..\..\Ressources\Icons\Favorites32.png" />
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
<Separator />
|
||||
<MenuItem Command="{Binding CopyPromptCommand}" Header="Kopieren">
|
||||
<MenuItem.Icon>
|
||||
<Image Source="..\..\..\Ressources\Icons\Copy24.png" />
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
<MenuItem Command="{Binding PastePromptCommand}" Header="Einfügen">
|
||||
<MenuItem.Icon>
|
||||
<Image Source="..\..\..\Ressources\Icons\Paste24.png" />
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
<Separator />
|
||||
<MenuItem Command="{Binding DeletePromptCommand}" Header="Löschen">
|
||||
<MenuItem.Icon>
|
||||
<Image Source="..\..\..\Ressources\Icons\Delete24.png" />
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
</ContextMenu>
|
||||
</dxe:ListBoxEdit.ContextMenu>
|
||||
</dxe:ListBoxEdit>
|
||||
</TabItem>
|
||||
<TabItem Header="Routinen">
|
||||
<dxe:ListBoxEdit
|
||||
x:Name="listBoxEdit2"
|
||||
Padding="8,16,8,16"
|
||||
HorizontalContentAlignment="Stretch"
|
||||
VerticalContentAlignment="Stretch"
|
||||
AllowDrop="False"
|
||||
ContextMenuOpening="ListBox_ContextMenuOpening"
|
||||
ItemContainerStyle="{StaticResource PromptListBoxItem}"
|
||||
ItemTemplate="{StaticResource AiPromptbausteinRoutineItemTemplate}"
|
||||
ItemsSource="{Binding SelectedFolder.Routines, UpdateSourceTrigger=PropertyChanged}"
|
||||
SelectedItem="{Binding SelectedItem, Mode=TwoWay}"
|
||||
SelectionMode="Single"
|
||||
ShowBorder="False">
|
||||
<dxe:ListBoxEdit.ContextMenu>
|
||||
<ContextMenu>
|
||||
<ContextMenu.Resources>
|
||||
<ResourceDictionary>
|
||||
<Style TargetType="{x:Type Image}">
|
||||
<Setter Property="Height" Value="24" />
|
||||
</Style>
|
||||
</ResourceDictionary>
|
||||
</ContextMenu.Resources>
|
||||
<MenuItem Command="{Binding OpenAddRoutineDialogCommand}" Header="Neu">
|
||||
<MenuItem.Icon>
|
||||
<Image Source="..\..\..\Ressources\Icons\Add24.png" />
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
<MenuItem Command="{Binding OpenEditRoutineDialogCommand}" Header="Bearbeiten">
|
||||
<MenuItem.Icon>
|
||||
<Image Source="..\..\..\Ressources\Icons\Rename24.png" />
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
<Separator />
|
||||
<MenuItem
|
||||
x:Name="favorite2"
|
||||
Command="{Binding ChangeFavoritenStateRoutineCommand}"
|
||||
Header="Kopieren">
|
||||
<MenuItem.Icon>
|
||||
<Image Source="..\..\..\Ressources\Icons\Favorites32.png" />
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
<Separator />
|
||||
<MenuItem Command="{Binding DeleteRoutineCommand}" Header="Löschen">
|
||||
<MenuItem.Icon>
|
||||
<Image Source="..\..\..\Ressources\Icons\Delete24.png" />
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
</ContextMenu>
|
||||
</dxe:ListBoxEdit.ContextMenu>
|
||||
</dxe:ListBoxEdit>
|
||||
</TabItem>
|
||||
</TabControl>
|
||||
|
||||
|
||||
</Grid>
|
||||
</GroupBox>
|
||||
</view:BeWoView>
|
||||
|
||||
@@ -118,38 +118,9 @@ namespace BeWo.View.Detail.AI
|
||||
private void ListBox_ContextMenuOpening(object sender, ContextMenuEventArgs e)
|
||||
{
|
||||
ViewModel.UpdatePromptCommands();
|
||||
favorite.Header = (ViewModel.SelectedPrompt?.IsFavorite ?? false) ? "Favorit entfernen" : "Favorit hinzufügen";
|
||||
favorite.Header = ((ViewModel.SelectedItem as AiPromptbausteinPromptVM)?.IsFavorite ?? false) ? "Favorit entfernen" : "Favorit hinzufügen";
|
||||
}
|
||||
|
||||
//private void listBox_Prompts_PreviewMouseUp(object sender, MouseButtonEventArgs e)
|
||||
//{
|
||||
// IsDragging = false;
|
||||
//}
|
||||
|
||||
//private void listBox_Prompts_Drop(object sender, DragEventArgs e)
|
||||
//{
|
||||
// HitTestResult hitTest = VisualTreeHelper.HitTest(listBoxEdit1, e.GetPosition(listBoxEdit1));
|
||||
// ListBoxEditItem item = LayoutHelper.FindParentObject<ListBoxEditItem>((DependencyObject)hitTest.VisualHit);
|
||||
// int insertIndex = ViewModel.SelectedFolder.SubPrompts.VMList.IndexOf((AiPromptbausteinPromptVM)item.Content);
|
||||
// ViewModel.SelectedFolder.SubPrompts.VMList.Remove((AiPromptbausteinPromptVM)e.Data.GetData(typeof(AiPromptbausteinPromptVM)));
|
||||
// if (listBoxEdit1.SelectedIndex > insertIndex)
|
||||
// insertIndex++;
|
||||
// ViewModel.SelectedFolder.SubPrompts.VMList.Insert(insertIndex, (AiPromptbausteinPromptVM)e.Data.GetData(typeof(AiPromptbausteinPromptVM)));
|
||||
//}
|
||||
|
||||
//private void listBox_Prompts_DragOver(object sender, DragEventArgs e)
|
||||
//{
|
||||
// e.Effects = DragDropEffects.Move;
|
||||
//}
|
||||
|
||||
//private void listBox_Prompts_MouseMove(object sender, MouseEventArgs e)
|
||||
//{
|
||||
// if (IsDragging && listBoxEdit1.SelectedItem != null)
|
||||
// {
|
||||
// DragDrop.DoDragDrop(listBoxEdit1, listBoxEdit1.SelectedItem, DragDropEffects.Move);
|
||||
// }
|
||||
//}
|
||||
|
||||
private void Hyperlink_RequestNavigate(object sender, System.Windows.Navigation.RequestNavigateEventArgs e)
|
||||
{
|
||||
Process.Start(new ProcessStartInfo(e.Uri.AbsoluteUri));
|
||||
@@ -167,5 +138,13 @@ namespace BeWo.View.Detail.AI
|
||||
e.Handled = true;
|
||||
}
|
||||
}
|
||||
|
||||
private void TabControl_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||
{
|
||||
if(e.OriginalSource is TabControl)
|
||||
{
|
||||
ViewModel.SelectedItem = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
195
BeWo/View/Detail/AI/AiPromptbausteinRoutineView.xaml
Normal file
195
BeWo/View/Detail/AI/AiPromptbausteinRoutineView.xaml
Normal file
@@ -0,0 +1,195 @@
|
||||
<UserControl
|
||||
x:Class="BeWo.View.Detail.AI.AiPromptbausteinRoutineView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:comboboxes="clr-namespace:BeWo.View.Controls.ComboBoxes"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
|
||||
xmlns:local="clr-namespace:BeWo.View.Detail.AI"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:viewmodel="clr-namespace:BeWo.ViewModel.View.Administration"
|
||||
d:DataContext="{d:DesignInstance Type=viewmodel:AiPromptbausteinRoutineViewModel}"
|
||||
d:DesignHeight="450"
|
||||
d:DesignWidth="800"
|
||||
Background="{StaticResource ObjectEditBackgroundBrush}"
|
||||
mc:Ignorable="d">
|
||||
<UserControl.Resources>
|
||||
<ResourceDictionary>
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceDictionary Source="..\..\..\Styles\ModernOrangeBlack.xaml" />
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
</ResourceDictionary>
|
||||
</UserControl.Resources>
|
||||
<Grid HorizontalAlignment="Stretch">
|
||||
<Grid Margin="8,4,8,4">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="auto" MinWidth="80" />
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="3*" MinWidth="100" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="auto" />
|
||||
<RowDefinition Height="auto" />
|
||||
<RowDefinition Height="*" />
|
||||
<RowDefinition Height="auto" />
|
||||
<RowDefinition Height="auto" />
|
||||
<RowDefinition Height="auto" />
|
||||
<RowDefinition Height="auto" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Label Grid.Row="0" Grid.Column="0">Name</Label>
|
||||
<TextBox
|
||||
Grid.Row="0"
|
||||
Grid.Column="2"
|
||||
Text="{Binding ViewModel.Title, UpdateSourceTrigger=PropertyChanged}" />
|
||||
|
||||
<Label
|
||||
Grid.Row="1"
|
||||
Grid.Column="0"
|
||||
Content="Beschreibung" />
|
||||
<TextBox
|
||||
Grid.Row="1"
|
||||
Grid.Column="2"
|
||||
MaxHeight="100"
|
||||
MaxLength="1024"
|
||||
Style="{StaticResource TextBoxNotice}"
|
||||
Text="{Binding ViewModel.Description, UpdateSourceTrigger=PropertyChanged}"
|
||||
TextWrapping="Wrap" />
|
||||
|
||||
<Label
|
||||
Grid.Row="2"
|
||||
Grid.Column="0"
|
||||
Content="Prompts" />
|
||||
<Grid
|
||||
Grid.Row="2"
|
||||
Grid.Column="2"
|
||||
Margin="3">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="*" />
|
||||
<RowDefinition Height="auto" />
|
||||
</Grid.RowDefinitions>
|
||||
<ListBox
|
||||
x:Name="steps"
|
||||
Grid.ColumnSpan="2"
|
||||
Margin="0,0,0,3"
|
||||
HorizontalContentAlignment="Center"
|
||||
ItemsSource="{Binding ViewModel.Steps.VMList}"
|
||||
SelectedItem="{Binding SelectedStep}">
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel Margin="3" Orientation="Horizontal">
|
||||
<!--<TextBlock
|
||||
x:Name="arrow"
|
||||
Margin="3"
|
||||
VerticalAlignment="Center"
|
||||
Text="➔" />-->
|
||||
<Border
|
||||
x:Name="border1"
|
||||
Height="19"
|
||||
Margin="0"
|
||||
Padding="3"
|
||||
HorizontalAlignment="Left"
|
||||
Background="DarkGray"
|
||||
CornerRadius="7">
|
||||
<TextBlock
|
||||
Margin="3,0,3,0"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
FontSize="10"
|
||||
Text="{Binding PromptReference.Title, StringFormat={}✦ {0}}"
|
||||
TextWrapping="Wrap" />
|
||||
</Border>
|
||||
</StackPanel>
|
||||
<!--<DataTemplate.Triggers>
|
||||
<DataTrigger Binding="{Binding RelativeSource={RelativeSource PreviousData}}" Value="{x:Null}">
|
||||
<Setter TargetName="arrow" Property="Visibility" Value="Collapsed" />
|
||||
</DataTrigger>
|
||||
</DataTemplate.Triggers>-->
|
||||
</DataTemplate>
|
||||
</ListBox.ItemTemplate>
|
||||
</ListBox>
|
||||
<StackPanel
|
||||
Grid.Row="1"
|
||||
HorizontalAlignment="Center"
|
||||
Orientation="Horizontal">
|
||||
<Button Width="24" Click="Button_Plus_Click">+</Button>
|
||||
<Button Width="24" Click="Button_Minus_Click">
|
||||
<Button.Style>
|
||||
<Style BasedOn="{StaticResource PrimaryButton}" TargetType="Button">
|
||||
<Style.Triggers>
|
||||
<DataTrigger Binding="{Binding SelectedStep}" Value="{x:Null}">
|
||||
<Setter Property="IsEnabled" Value="False" />
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</Button.Style>
|
||||
-
|
||||
</Button>
|
||||
<Popup
|
||||
x:Name="myPopup"
|
||||
Placement="Top"
|
||||
PlacementTarget="{Binding ElementName=myButton}"
|
||||
StaysOpen="False">
|
||||
<Border
|
||||
x:Name="myPopupBorder"
|
||||
BorderBrush="Black"
|
||||
BorderThickness="1">
|
||||
<TextBlock Text="Ich bin ein Popup!" />
|
||||
</Border>
|
||||
</Popup>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
|
||||
<Label
|
||||
Grid.Row="3"
|
||||
Grid.Column="0"
|
||||
Content="Ersteller" />
|
||||
<comboboxes:ComboBoxEmployeeSearch
|
||||
Grid.Row="3"
|
||||
Grid.Column="2"
|
||||
Margin="3"
|
||||
IsEnabled="False"
|
||||
SelectedCompactEmployeeDC="{Binding ViewModel.Creator}" />
|
||||
|
||||
<Label Grid.Row="4" Grid.Column="0">Öffentlich</Label>
|
||||
<dxe:CheckEdit
|
||||
Grid.Row="4"
|
||||
Grid.Column="2"
|
||||
Margin="3"
|
||||
IsChecked="{Binding ViewModel.IsPublic}"
|
||||
IsEnabled="{Binding ViewModel.CanShareEdit, UpdateSourceTrigger=PropertyChanged}" />
|
||||
|
||||
<Label Grid.Row="5" Grid.Column="0">Favorit</Label>
|
||||
<dxe:CheckEdit
|
||||
Grid.Row="5"
|
||||
Grid.Column="2"
|
||||
Margin="3"
|
||||
IsChecked="{Binding ViewModel.IsFavorite}"
|
||||
IsEnabled="true" />
|
||||
|
||||
|
||||
<StackPanel
|
||||
Grid.Row="6"
|
||||
Grid.ColumnSpan="3"
|
||||
Margin="0,19,0,0"
|
||||
HorizontalAlignment="Right"
|
||||
Orientation="Horizontal">
|
||||
<!--<Button
|
||||
Width="100"
|
||||
Command="{Binding CancelCommand}"
|
||||
Visibility="Collapsed">
|
||||
Abbrechen
|
||||
</Button>-->
|
||||
<Button
|
||||
Width="100"
|
||||
Command="{Binding AcceptCommand}"
|
||||
Visibility="Visible">
|
||||
Speichern
|
||||
</Button>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
93
BeWo/View/Detail/AI/AiPromptbausteinRoutineView.xaml.cs
Normal file
93
BeWo/View/Detail/AI/AiPromptbausteinRoutineView.xaml.cs
Normal file
@@ -0,0 +1,93 @@
|
||||
using BeWo.ViewModel;
|
||||
using BeWo.ViewModel.ListViewModel;
|
||||
using BeWo.ViewModel.View.Administration;
|
||||
using BeWo.ViewModel.View.AI;
|
||||
using BS.Shared.DataContracts.Feature.AI;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
|
||||
namespace BeWo.View.Detail.AI
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaktionslogik für AiPromptbausteinRoutineView.xaml
|
||||
/// </summary>
|
||||
public partial class AiPromptbausteinRoutineView : UserControl
|
||||
{
|
||||
//public static readonly DependencyProperty RoutineProperty =
|
||||
// DependencyProperty.Register("Routine", typeof(AiPromptbausteinRoutineVM), typeof(AiPromptbausteinRoutineView), new PropertyMetadata(null));
|
||||
|
||||
//public static readonly DependencyProperty FolderListVMProperty =
|
||||
// DependencyProperty.Register("FolderListVM", typeof(AiPromptbausteinFolderListVM), typeof(AiPromptbausteinRoutineView), new PropertyMetadata(null));
|
||||
|
||||
//public AiPromptbausteinRoutineVM Routine
|
||||
//{
|
||||
// get { return (AiPromptbausteinRoutineVM)GetValue(RoutineProperty); }
|
||||
// set { SetValue(RoutineProperty, value); }
|
||||
//}
|
||||
|
||||
//public AiPromptbausteinFolderListVM FolderListVM
|
||||
//{
|
||||
// get { return (AiPromptbausteinFolderListVM)GetValue(FolderListVMProperty); }
|
||||
// set { SetValue(FolderListVMProperty, value); }
|
||||
//}
|
||||
|
||||
public AiPromptbausteinRoutineViewModel ViewModel { get; set; }
|
||||
|
||||
public AiPromptbausteinRoutineView(AiPromptbausteinRoutineViewModel viewmodel)
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
DataContext = ViewModel = viewmodel;
|
||||
|
||||
var viewmodel2 = new AiPromptbausteinSelectionComplexViewModel(ViewModel.ViewModel.ActionType, ViewModel.FolderListVM, false, false);
|
||||
var control = new AiPromptbausteinComplexSelectionView(viewmodel2);
|
||||
|
||||
viewmodel2.PromptAccepted += (s, e) =>
|
||||
{
|
||||
if (e is null)
|
||||
return;
|
||||
|
||||
if (e.DataContract.Version is null)
|
||||
{
|
||||
MessageBox.Show("Es können keine Promptbausteine hinzugefügt werden, die noch nicht gespeichert wurden. Speichern Sie bitte zuvor.");
|
||||
return;
|
||||
}
|
||||
|
||||
var step = new AiPromptbausteinRoutineStepDC();
|
||||
step.PromptReference = e.DataContract;
|
||||
step.ReferenceVersion = e.DataContract.Version.Value;
|
||||
var step_vm = new AiPromptbausteinRoutineStepVM(step);
|
||||
|
||||
ViewModel.ViewModel.Steps.VMList.Add(step_vm);
|
||||
myPopup.IsOpen = false;
|
||||
};
|
||||
|
||||
myPopupBorder.Child = control;
|
||||
}
|
||||
|
||||
private void Button_Plus_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
myPopup.IsOpen = true;
|
||||
}
|
||||
|
||||
private void Button_Minus_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (!(steps.SelectedItem is AiPromptbausteinRoutineStepVM step))
|
||||
return;
|
||||
|
||||
ViewModel.ViewModel.Steps.VMList.Remove(step);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
using BeWo.ViewModel;
|
||||
using DevExpress.Web.Internal.XmlProcessor;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
|
||||
namespace BeWo.View.TemplateSelectors
|
||||
{
|
||||
public class AiPromptbausteinFolderItemTemplateSelector : DataTemplateSelector
|
||||
{
|
||||
public DataTemplate AiPromptbausteinPromptTemplate { get; set; }
|
||||
public DataTemplate AiPromptbausteinRoutineTemplate { get; set; }
|
||||
|
||||
public override DataTemplate SelectTemplate(object item, DependencyObject container)
|
||||
{
|
||||
if (item is AiPromptbausteinPromptVM prompt)
|
||||
return AiPromptbausteinPromptTemplate;
|
||||
|
||||
if (item is AiPromptbausteinRoutineVM routine)
|
||||
return AiPromptbausteinRoutineTemplate;
|
||||
|
||||
throw new NotImplementedException("item is not AiPromptbausteinPromptVM or AiPromptbausteinRoutineVM");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -22,6 +22,7 @@ namespace BeWo.ViewModel
|
||||
private AiActionType _ActionType;
|
||||
private AiPromptbausteinFolderListVM _SubFolders;
|
||||
private AiPromptbausteinPromptListVM _SubPrompts;
|
||||
private AiPromptbausteinRoutineListVM _SubRoutines;
|
||||
|
||||
public AiPromptbausteinFolderVM(AiPromptbausteinFolderDC dc) : base(dc, dc.Oid)
|
||||
{
|
||||
@@ -36,8 +37,6 @@ namespace BeWo.ViewModel
|
||||
var success = SetProperty(ref _Title, value, nameof(Title), () => DataContract.Title);
|
||||
if (!success)
|
||||
return;
|
||||
|
||||
FirePropertyChanged(nameof(Displayname));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -99,7 +98,8 @@ namespace BeWo.ViewModel
|
||||
return;
|
||||
|
||||
_SubPrompts.VMList.ListChanged += (s, e) => {
|
||||
FirePropertyChanged(nameof(Displayname));
|
||||
FirePropertyChanged(nameof(TotalPromptCount));
|
||||
FirePropertyChanged(nameof(AlleFolderItems));
|
||||
|
||||
if (e.ListChangedType == System.ComponentModel.ListChangedType.ItemChanged)
|
||||
return;
|
||||
@@ -109,6 +109,40 @@ namespace BeWo.ViewModel
|
||||
}
|
||||
}
|
||||
|
||||
public AiPromptbausteinRoutineListVM SubRoutines
|
||||
{
|
||||
get => _SubRoutines;
|
||||
set
|
||||
{
|
||||
var success = SetProperty(ref _SubRoutines, value, nameof(SubRoutines));
|
||||
if (!success)
|
||||
return;
|
||||
|
||||
_SubRoutines.VMList.ListChanged += (s, e) => {
|
||||
FirePropertyChanged(nameof(TotalRoutineCount));
|
||||
FirePropertyChanged(nameof(AlleFolderItems));
|
||||
|
||||
if (e.ListChangedType == System.ComponentModel.ListChangedType.ItemChanged)
|
||||
return;
|
||||
|
||||
FirePropertyChanged(nameof(Routines));
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
public List<AbstractBaseVM> AlleFolderItems
|
||||
{
|
||||
get
|
||||
{
|
||||
var l1 = Prompts.Cast<AbstractBaseVM>();
|
||||
var l2 = Routines.Cast<AbstractBaseVM>();
|
||||
|
||||
var l12 = l1.Union(l2);
|
||||
|
||||
return l12.ToList();
|
||||
}
|
||||
}
|
||||
|
||||
public List<AiPromptbausteinPromptVM> Prompts
|
||||
{
|
||||
get
|
||||
@@ -126,6 +160,23 @@ namespace BeWo.ViewModel
|
||||
}
|
||||
}
|
||||
|
||||
public List<AiPromptbausteinRoutineVM> Routines
|
||||
{
|
||||
get
|
||||
{
|
||||
var res = new List<AiPromptbausteinRoutineVM>();
|
||||
|
||||
res.AddRange(SubRoutines.VMList);
|
||||
|
||||
foreach (var folder in SubFolders.VMList)
|
||||
{
|
||||
res.AddRange(folder.Routines);
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
||||
public bool CanAddFolder
|
||||
{
|
||||
get => DataContract.CanAddFolder;
|
||||
@@ -136,6 +187,11 @@ namespace BeWo.ViewModel
|
||||
get => DataContract.CanAddPrompt;
|
||||
set => DataContract.CanAddPrompt = value;
|
||||
}
|
||||
public bool CanAddRoutine
|
||||
{
|
||||
get => DataContract.CanAddRoutine;
|
||||
set => DataContract.CanAddRoutine = value;
|
||||
}
|
||||
public bool CanEdit
|
||||
{
|
||||
get => DataContract.CanEdit && BeWoApp.HasLoggedOnUserRight(UserRightType.AiModulePromptbausteineEdit);
|
||||
@@ -155,18 +211,18 @@ namespace BeWo.ViewModel
|
||||
|
||||
public FontWeight FontWeight => !IsNew && Parent is null ? FontWeights.SemiBold : FontWeights.Medium;
|
||||
public bool HasSubFolders => SubFolders is object && SubFolders.Count > 0;
|
||||
public string Displayname
|
||||
{
|
||||
get
|
||||
{
|
||||
if (TotalPromptCount > 0)
|
||||
{
|
||||
return $"{Title} ({TotalPromptCount})";
|
||||
}
|
||||
//public string Displayname
|
||||
//{
|
||||
// get
|
||||
// {
|
||||
// if (TotalPromptCount > 0)
|
||||
// {
|
||||
// return $"{Title} ({TotalPromptCount})";
|
||||
// }
|
||||
|
||||
return Title;
|
||||
}
|
||||
}
|
||||
// return Title;
|
||||
// }
|
||||
//}
|
||||
|
||||
public int TotalPromptCount
|
||||
{
|
||||
@@ -183,6 +239,21 @@ namespace BeWo.ViewModel
|
||||
}
|
||||
}
|
||||
|
||||
public int TotalRoutineCount
|
||||
{
|
||||
get
|
||||
{
|
||||
var total = SubRoutines.Count;
|
||||
|
||||
foreach (var folder in SubFolders.VMList)
|
||||
{
|
||||
total += folder.TotalRoutineCount;
|
||||
}
|
||||
|
||||
return total;
|
||||
}
|
||||
}
|
||||
|
||||
protected override void InitByDataContract(AiPromptbausteinFolderDC pDataContract)
|
||||
{
|
||||
_Title = pDataContract.Title;
|
||||
@@ -193,8 +264,9 @@ namespace BeWo.ViewModel
|
||||
_Position = pDataContract.Position;
|
||||
_IsExpanded = pDataContract.IsExpanded;
|
||||
_ActionType = pDataContract.ActionType;
|
||||
_SubFolders = new AiPromptbausteinFolderListVM(pDataContract.SubFolders, this);
|
||||
SubFolders = new AiPromptbausteinFolderListVM(pDataContract.SubFolders, this);
|
||||
SubPrompts = new AiPromptbausteinPromptListVM(pDataContract.SubPrompts);
|
||||
SubRoutines = new AiPromptbausteinRoutineListVM(pDataContract.SubRoutines);
|
||||
}
|
||||
|
||||
protected override AiPromptbausteinFolderDC MapToDataContract(AiPromptbausteinFolderDC pDataContract, bool doCommit)
|
||||
@@ -208,6 +280,7 @@ namespace BeWo.ViewModel
|
||||
pDataContract.ActionType = _ActionType;
|
||||
pDataContract.SubFolders = _SubFolders.CopyToDCList(doCommit);
|
||||
pDataContract.SubPrompts = _SubPrompts.CopyToDCList(doCommit);
|
||||
pDataContract.SubRoutines = _SubRoutines.CopyToDCList(doCommit);
|
||||
|
||||
return pDataContract;
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ using BS.Shared;
|
||||
using BS.Shared.DataContracts;
|
||||
using BS.Shared.DataContracts.Compact;
|
||||
using BS.Shared.DataContracts.Feature.AI;
|
||||
using BS.Shared.Extensions;
|
||||
|
||||
namespace BeWo.ViewModel
|
||||
{
|
||||
@@ -85,6 +86,13 @@ namespace BeWo.ViewModel
|
||||
set => SetProperty(ref _Steps, value, nameof(Steps));
|
||||
}
|
||||
|
||||
public bool CanShareEdit
|
||||
{
|
||||
get => BeWoApp.HasLoggedOnUserRight(UserRightType.AiModulePromptbausteinShare);
|
||||
}
|
||||
|
||||
public override bool IsDirty => base.IsDirty || Steps.IsDirty;
|
||||
|
||||
protected override void InitByDataContract(AiPromptbausteinRoutineDC pDataContract)
|
||||
{
|
||||
_Title = pDataContract.Title;
|
||||
@@ -111,10 +119,22 @@ namespace BeWo.ViewModel
|
||||
pDataContract.IsFavorite = _IsFavorite;
|
||||
pDataContract.ActionType = _ActionType;
|
||||
pDataContract.CanEdit = _CanEdit;
|
||||
|
||||
pDataContract.Steps = _Steps.CopyToDCList(doCommit);
|
||||
pDataContract.Steps = _Steps.CopyToDCList(true);
|
||||
|
||||
return pDataContract;
|
||||
}
|
||||
|
||||
public override void UpdateByDataContract(AiPromptbausteinRoutineDC pDataContract)
|
||||
{
|
||||
Title = pDataContract.Title;
|
||||
Description = pDataContract.Description;
|
||||
IsPublic = pDataContract.IsPublic;
|
||||
IsFavorite = pDataContract.IsFavorite;
|
||||
|
||||
var steps = new AiPromptbausteinRoutineStepListVM(pDataContract.Steps);
|
||||
|
||||
Steps.VMList.Clear();
|
||||
Steps.VMList.AddRange(steps.VMList);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -58,6 +58,9 @@ namespace BeWo.ViewModel.View.AI
|
||||
public bool HasCopiedPrompt => CopiedPrompt is object;
|
||||
public CompactEmployeeDC CurrentEmployee => BeWoApp.CompactLoggedOnEmployee;
|
||||
|
||||
public bool CanOpenContextMenu { get; set; }
|
||||
public string AcceptButtonText => CanOpenContextMenu ? "Absenden" : "Hinzufügen";
|
||||
|
||||
public AiPromptbausteinSelectionComplexViewModel()
|
||||
{
|
||||
SendCommand = new DelegateCommand(Send, CanSend, true);
|
||||
@@ -73,11 +76,12 @@ namespace BeWo.ViewModel.View.AI
|
||||
WindowService = BeWoApp.MainControl.WindowService;
|
||||
InitCommands();
|
||||
}
|
||||
public AiPromptbausteinSelectionComplexViewModel(AiActionType aiActionType, AiPromptbausteinFolderListVM viewModel, bool isFavorite = false) : this(aiActionType)
|
||||
public AiPromptbausteinSelectionComplexViewModel(AiActionType aiActionType, AiPromptbausteinFolderListVM viewModel, bool isFavorite = false, bool canOpen = true) : this(aiActionType)
|
||||
{
|
||||
LoadedActionType = aiActionType;
|
||||
Folders = viewModel;
|
||||
IsFavorite = isFavorite;
|
||||
CanOpenContextMenu = canOpen;
|
||||
}
|
||||
|
||||
private void InitCommands()
|
||||
@@ -387,7 +391,27 @@ namespace BeWo.ViewModel.View.AI
|
||||
|
||||
void OpenAddRoutineDialog()
|
||||
{
|
||||
|
||||
//var sel_folder = SelectedFolder;
|
||||
//var new_vm = sel_folder.SubRoutines.CreateNewVM();
|
||||
|
||||
//new_vm.Creator = CurrentEmployee;
|
||||
//new_vm.ParentFolderOid = sel_folder.DataContract.Oid;
|
||||
//new_vm.CanEdit = true;
|
||||
//new_vm.ActionType = AiActionType;
|
||||
|
||||
//var vm = new AiPromptbausteinRoutineViewModel(new_vm, Folders, true);
|
||||
|
||||
//vm.Accept_Button_Clicked += (s, e) =>
|
||||
//{
|
||||
// var new_dc = new_vm.CommitToDataContract();
|
||||
|
||||
// ServiceFacade.DoAiEnhancedServiceAsnyc(x => x.InsertAiPromptbausteinPrompt(new List<AiPromptbausteinRoutineDC> { new_dc }),
|
||||
// (new_dcs) => ReloadVMList());
|
||||
//};
|
||||
|
||||
//Close();
|
||||
|
||||
//WindowService.Show(vm);
|
||||
}
|
||||
void OpenEditRoutineDialog()
|
||||
{
|
||||
|
||||
@@ -21,6 +21,7 @@ namespace BeWo.ViewModel.View.Administration
|
||||
public class AiPromptbausteinComplexTreeViewModel : WindowViewModel
|
||||
{
|
||||
private AiPromptbausteinFolderVM _SelectedFolder;
|
||||
private AbstractBaseVM _SelectedItem;
|
||||
|
||||
private IBeWoWindowService WindowService { get; set; }
|
||||
private AiActionType AiActionType { get; set; }
|
||||
@@ -28,7 +29,6 @@ namespace BeWo.ViewModel.View.Administration
|
||||
public AiPromptbausteinFolderListVM Folders { get; set; }
|
||||
public AiPromptbausteinFolderVM Favoriten { get; set; }
|
||||
|
||||
public AiPromptbausteinPromptVM SelectedPrompt { get; set; }
|
||||
public AiPromptbausteinFolderVM CopiedFolder { get; set; }
|
||||
public AiPromptbausteinPromptVM CopiedPrompt { get; set; }
|
||||
|
||||
@@ -45,6 +45,11 @@ namespace BeWo.ViewModel.View.Administration
|
||||
public DelegateCommand DeletePromptCommand { get; private set; }
|
||||
public DelegateCommand ChangeFavoritenStatePromptCommand { get; private set; }
|
||||
|
||||
public DelegateCommand OpenAddRoutineDialogCommand { get; private set; }
|
||||
public DelegateCommand OpenEditRoutineDialogCommand { get; private set; }
|
||||
public DelegateCommand DeleteRoutineCommand { get; private set; }
|
||||
public DelegateCommand ChangeFavoritenStateRoutineCommand { get; private set; }
|
||||
|
||||
public bool CanEditPromptbausteine { get; set; }
|
||||
|
||||
public AiPromptbausteinFolderVM SelectedFolder
|
||||
@@ -52,13 +57,19 @@ namespace BeWo.ViewModel.View.Administration
|
||||
get => _SelectedFolder;
|
||||
set => SetProperty(ref _SelectedFolder, value, nameof(SelectedFolder));
|
||||
}
|
||||
|
||||
|
||||
public AbstractBaseVM SelectedItem
|
||||
{
|
||||
get => _SelectedItem;
|
||||
set => SetProperty(ref _SelectedItem, value, nameof(SelectedItem));
|
||||
}
|
||||
|
||||
public AiPromptbausteinComplexTreeViewModel() : this(null, AiActionType.ServiceRecordConversation)
|
||||
{
|
||||
if (BeWoApp.IsInDesignMode)
|
||||
{
|
||||
ReloadVMList();
|
||||
//ReloadVMList();
|
||||
InitDesigner();
|
||||
SelectedFolder = Folders.VMList.FirstOrDefault();
|
||||
return;
|
||||
}
|
||||
@@ -81,6 +92,11 @@ namespace BeWo.ViewModel.View.Administration
|
||||
DeletePromptCommand = new DelegateCommand(OpenDeletePromptDialog, canOpenDeletePromptDialog, false);
|
||||
ChangeFavoritenStatePromptCommand = new DelegateCommand(ChangeFavoritenStatePrompt, canChangeFavoritenStatePrompt, false);
|
||||
|
||||
OpenAddRoutineDialogCommand = new DelegateCommand(OpenAddRoutineDialog, canOpenAddRoutineDialog, false);
|
||||
OpenEditRoutineDialogCommand = new DelegateCommand(OpenEditRoutineDialog, canOpenEditRoutineDialog, false);
|
||||
DeleteRoutineCommand = new DelegateCommand(OpenDeleteRoutineDialog, canOpenDeleteRoutineDialog, false);
|
||||
ChangeFavoritenStateRoutineCommand = new DelegateCommand(ChangeFavoritenStateRoutine, canChangeFavoritenStateRoutine, false);
|
||||
|
||||
CanEditPromptbausteine = BeWoApp.HasLoggedOnUserRight(UserRightType.AiModulePromptbausteineEdit);
|
||||
}
|
||||
|
||||
@@ -111,6 +127,10 @@ namespace BeWo.ViewModel.View.Administration
|
||||
PastePromptCommand.RaiseCanExecuteChanged();
|
||||
DeletePromptCommand.RaiseCanExecuteChanged();
|
||||
ChangeFavoritenStatePromptCommand.RaiseCanExecuteChanged();
|
||||
OpenAddRoutineDialogCommand.RaiseCanExecuteChanged();
|
||||
OpenEditRoutineDialogCommand.RaiseCanExecuteChanged();
|
||||
DeleteRoutineCommand.RaiseCanExecuteChanged();
|
||||
ChangeFavoritenStateRoutineCommand.RaiseCanExecuteChanged();
|
||||
}
|
||||
|
||||
public void SaveVMList()
|
||||
@@ -355,16 +375,20 @@ namespace BeWo.ViewModel.View.Administration
|
||||
vm.Accept_Button_Clicked += (s, e) =>
|
||||
{
|
||||
sel_folder.SubPrompts.VMList.Add(new_vm);
|
||||
SelectedPrompt = new_vm;
|
||||
SelectedItem = new_vm;
|
||||
};
|
||||
|
||||
WindowService.Show(vm);
|
||||
}
|
||||
void OpenEditPromptDialog()
|
||||
{
|
||||
var sel_prompt = SelectedPrompt;
|
||||
var sel_prompt = SelectedItem as AiPromptbausteinPromptVM;
|
||||
|
||||
if (SelectedItem is null)
|
||||
throw new Exception("invalid operation");
|
||||
|
||||
var sel_dc = sel_prompt.CopyToEmptyDataContract();
|
||||
sel_dc.CanEdit = SelectedPrompt.CanEdit;
|
||||
sel_dc.CanEdit = sel_prompt.CanEdit;
|
||||
var edit_vm = new AiPromptbausteinPromptVM(sel_dc);
|
||||
|
||||
var vm = new AiPromptbausteinPromptViewModel(edit_vm, false);
|
||||
@@ -383,7 +407,7 @@ namespace BeWo.ViewModel.View.Administration
|
||||
private void UpdateSelectedPromptFavorite(AiPromptbausteinPromptVM sel_prompt = null)
|
||||
{
|
||||
if (sel_prompt is null)
|
||||
sel_prompt = SelectedPrompt;
|
||||
sel_prompt = SelectedItem as AiPromptbausteinPromptVM;
|
||||
|
||||
if (sel_prompt.IsFavorite && !Favoriten.SubPrompts.VMList.Contains(sel_prompt))
|
||||
Favoriten.SubPrompts.VMList.Add(sel_prompt);
|
||||
@@ -391,7 +415,27 @@ namespace BeWo.ViewModel.View.Administration
|
||||
{
|
||||
Favoriten.SubPrompts.VMList.Remove(sel_prompt);
|
||||
|
||||
if (Favoriten.SubPrompts.Count == 0)
|
||||
if (Favoriten.SubRoutines.Count == 0 && Favoriten.SubPrompts.Count == 0)
|
||||
{
|
||||
var selected_folder = SelectedFolder;
|
||||
SelectedFolder = null;
|
||||
SelectedFolder = selected_folder;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void UpdateSelectedRoutineFavorite(AiPromptbausteinRoutineVM sel_routine = null)
|
||||
{
|
||||
if (sel_routine is null)
|
||||
sel_routine = SelectedItem as AiPromptbausteinRoutineVM;
|
||||
|
||||
if (sel_routine.IsFavorite && !Favoriten.SubRoutines.VMList.Contains(sel_routine))
|
||||
Favoriten.SubRoutines.VMList.Add(sel_routine);
|
||||
else if (!sel_routine.IsFavorite && Favoriten.SubRoutines.VMList.Contains(sel_routine))
|
||||
{
|
||||
Favoriten.SubRoutines.VMList.Remove(sel_routine);
|
||||
|
||||
if (Favoriten.SubRoutines.Count == 0 && Favoriten.SubPrompts.Count == 0)
|
||||
{
|
||||
var selected_folder = SelectedFolder;
|
||||
SelectedFolder = null;
|
||||
@@ -402,7 +446,7 @@ namespace BeWo.ViewModel.View.Administration
|
||||
|
||||
void CopyPrompt()
|
||||
{
|
||||
CopiedPrompt = SelectedPrompt;
|
||||
CopiedPrompt = SelectedItem as AiPromptbausteinPromptVM;
|
||||
}
|
||||
void PastePrompt()
|
||||
{
|
||||
@@ -421,7 +465,7 @@ namespace BeWo.ViewModel.View.Administration
|
||||
}
|
||||
void OpenDeletePromptDialog()
|
||||
{
|
||||
var sel_prompt = SelectedPrompt;
|
||||
var sel_prompt = SelectedItem as AiPromptbausteinPromptVM;
|
||||
var folder = SelectedFolder;
|
||||
|
||||
var txt = "Möchten Sie den ausgewählten Prompt wirklich löschen?";
|
||||
@@ -430,12 +474,12 @@ namespace BeWo.ViewModel.View.Administration
|
||||
if (result != MessageBoxResult.OK)
|
||||
return;
|
||||
|
||||
folder.SubPrompts.VMList.Remove(SelectedPrompt);
|
||||
folder.SubPrompts.VMList.Remove(sel_prompt);
|
||||
}
|
||||
|
||||
void ChangeFavoritenStatePrompt()
|
||||
{
|
||||
var sel_prompt = SelectedPrompt;
|
||||
var sel_prompt = SelectedItem as AiPromptbausteinPromptVM;
|
||||
|
||||
sel_prompt.IsFavorite = !sel_prompt.IsFavorite;
|
||||
|
||||
@@ -448,11 +492,11 @@ namespace BeWo.ViewModel.View.Administration
|
||||
}
|
||||
bool canOpenEditPromptDialog()
|
||||
{
|
||||
return SelectedPrompt is object;
|
||||
return SelectedItem as AiPromptbausteinPromptVM is object;
|
||||
}
|
||||
bool canCopyPrompt()
|
||||
{
|
||||
return CanEditPromptbausteine && SelectedPrompt is object;
|
||||
return CanEditPromptbausteine && SelectedItem as AiPromptbausteinPromptVM is object;
|
||||
}
|
||||
bool canPastePrompt()
|
||||
{
|
||||
@@ -460,36 +504,93 @@ namespace BeWo.ViewModel.View.Administration
|
||||
}
|
||||
bool canOpenDeletePromptDialog()
|
||||
{
|
||||
return CanEditPromptbausteine && (SelectedPrompt?.CanEdit ?? false);
|
||||
return CanEditPromptbausteine && ((SelectedItem as AiPromptbausteinPromptVM)?.CanEdit ?? false);
|
||||
}
|
||||
|
||||
bool canChangeFavoritenStatePrompt()
|
||||
{
|
||||
return SelectedPrompt is object;
|
||||
return SelectedItem as AiPromptbausteinPromptVM is object;
|
||||
}
|
||||
|
||||
// --- Routine Commands
|
||||
|
||||
void OpenAddRoutineDialog()
|
||||
{
|
||||
var sel_folder = SelectedFolder;
|
||||
var new_vm = sel_folder.SubRoutines.CreateNewVM();
|
||||
|
||||
new_vm.Creator = CurrentEmployee;
|
||||
new_vm.ParentFolderOid = sel_folder.DataContract.Oid;
|
||||
new_vm.CanEdit = true;
|
||||
new_vm.ActionType = AiActionType;
|
||||
|
||||
var vm = new AiPromptbausteinRoutineViewModel(new_vm, Folders, true);
|
||||
|
||||
vm.Accept_Button_Clicked += (s, e) =>
|
||||
{
|
||||
sel_folder.SubRoutines.VMList.Add(new_vm);
|
||||
SelectedItem = new_vm;
|
||||
};
|
||||
|
||||
WindowService.Show(vm);
|
||||
}
|
||||
void OpenEditRoutineDialog()
|
||||
{
|
||||
var sel_prompt = SelectedItem as AiPromptbausteinRoutineVM;
|
||||
|
||||
if (SelectedItem is null)
|
||||
throw new Exception("invalid operation");
|
||||
|
||||
var sel_dc = sel_prompt.CopyToEmptyDataContract();
|
||||
sel_dc.CanEdit = sel_prompt.CanEdit;
|
||||
var edit_vm = new AiPromptbausteinRoutineVM(sel_dc);
|
||||
|
||||
var vm = new AiPromptbausteinRoutineViewModel(edit_vm, Folders, false);
|
||||
|
||||
vm.Accept_Button_Clicked += (s, e) =>
|
||||
{
|
||||
var edit_dc = edit_vm.CommitToDataContract();
|
||||
sel_prompt.UpdateByDataContract(edit_dc);
|
||||
|
||||
UpdateSelectedRoutineFavorite(sel_prompt);
|
||||
};
|
||||
|
||||
WindowService.Show(vm);
|
||||
}
|
||||
void OpenDeleteRoutineDialog()
|
||||
{
|
||||
var sel_prompt = SelectedItem as AiPromptbausteinRoutineVM;
|
||||
var folder = SelectedFolder;
|
||||
|
||||
var txt = "Möchten Sie die ausgewählte Routine wirklich löschen?";
|
||||
var result = MessageBox.Show(txt, "Hinweis", MessageBoxButton.OKCancel);
|
||||
|
||||
if (result != MessageBoxResult.OK)
|
||||
return;
|
||||
|
||||
folder.SubRoutines.VMList.Remove(sel_prompt);
|
||||
}
|
||||
void ChangeFavoritenStateRoutine()
|
||||
{
|
||||
var sel_routine = SelectedItem as AiPromptbausteinRoutineVM;
|
||||
|
||||
sel_routine.IsFavorite = !sel_routine.IsFavorite;
|
||||
|
||||
UpdateSelectedRoutineFavorite(sel_routine);
|
||||
}
|
||||
|
||||
//bool canOpenAddRoutineDialog() => CanEditPromptbausteine && (SelectedFolder?.CanAddPrompt ?? false);
|
||||
//bool canOpenEditRoutineDialog() => SelectedRoutine is object;
|
||||
//bool canOpenDeleteRoutineDialog() => CanEditPromptbausteine && (SelectedRoutine?.CanEdit ?? false);
|
||||
//bool canChangeFavoritenStateRoutine() => SelectedRoutine is object;
|
||||
bool canOpenAddRoutineDialog() => CanEditPromptbausteine && (SelectedFolder?.CanAddPrompt ?? false);
|
||||
bool canOpenEditRoutineDialog() => SelectedItem is AiPromptbausteinRoutineVM;
|
||||
bool canOpenDeleteRoutineDialog() => CanEditPromptbausteine && ((SelectedItem as AiPromptbausteinRoutineVM)?.CanEdit ?? false);
|
||||
bool canChangeFavoritenStateRoutine() => SelectedItem is AiPromptbausteinRoutineVM;
|
||||
|
||||
void InitDesigner()
|
||||
{
|
||||
var root = PredefinedAiPromptbausteinFolders.CreateSubTree(AiActionType.ServiceRecordConversation);
|
||||
|
||||
var root_vm = new AiPromptbausteinFolderListVM(root);
|
||||
|
||||
Folders = root_vm;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
using BeWo.ViewModel.ListViewModel;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace BeWo.ViewModel.View.Administration
|
||||
{
|
||||
public class AiPromptbausteinRoutineViewModel : AcceptCancelDialogViewModel
|
||||
{
|
||||
private readonly bool _IsNew;
|
||||
public AiPromptbausteinRoutineStepVM _SelectedStep;
|
||||
|
||||
public AiPromptbausteinRoutineViewModel(AiPromptbausteinRoutineVM viewModel, AiPromptbausteinFolderListVM folders, bool isNew) : base()
|
||||
{
|
||||
ViewModel = viewModel;
|
||||
FolderListVM = folders;
|
||||
_IsNew = isNew;
|
||||
|
||||
ViewModel.PropertyChanged += (s, e) =>
|
||||
{
|
||||
AcceptCommand.RaiseCanExecuteChanged();
|
||||
};
|
||||
|
||||
ViewModel.Steps.VMList.ListChanged += (s, e) =>
|
||||
{
|
||||
AcceptCommand.RaiseCanExecuteChanged();
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
public AiPromptbausteinFolderListVM FolderListVM { get; set; }
|
||||
public AiPromptbausteinRoutineVM ViewModel { get; private set; }
|
||||
|
||||
public AiPromptbausteinRoutineStepVM SelectedStep
|
||||
{
|
||||
get => _SelectedStep;
|
||||
set => SetProperty(ref _SelectedStep, value, nameof(SelectedStep));
|
||||
}
|
||||
|
||||
public string AcceptButtonText => _IsNew ? "Hinzufügen" : "Speichern";
|
||||
|
||||
protected override bool canAccept()
|
||||
{
|
||||
return (_IsNew || ViewModel.IsDirty) && !string.IsNullOrWhiteSpace(ViewModel.Title) && (ViewModel.Steps?.VMList.Any() ?? false);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -41,7 +41,6 @@ namespace BeWo.Service.Plugins
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public IEnumerable<AiPromptbausteinFolderDC> InsertAiPromptbausteinFolder(IEnumerable<AiPromptbausteinFolderDC> folders)
|
||||
{
|
||||
var entities = MapperFactory.AiPromptbausteinFolder.MapToNewEntities(folders);
|
||||
@@ -50,7 +49,6 @@ namespace BeWo.Service.Plugins
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public IEnumerable<AiPromptbausteinPromptDC> InsertAiPromptbausteinPrompt(IEnumerable<AiPromptbausteinPromptDC> prompts)
|
||||
{
|
||||
var entities = MapperFactory.AiPromptbausteinPrompt.MapToNewEntities(prompts);
|
||||
@@ -59,7 +57,14 @@ namespace BeWo.Service.Plugins
|
||||
|
||||
return null;
|
||||
}
|
||||
public IEnumerable<AiPromptbausteinRoutineDC> InsertAiPromptbausteinRoutine(IEnumerable<AiPromptbausteinRoutineDC> routine)
|
||||
{
|
||||
var entities = MapperFactory.AiPromptbausteinRoutine.MapToNewEntities(routine);
|
||||
|
||||
DAOFactory.GenericDAO.Insert(entities);
|
||||
|
||||
return null;
|
||||
}
|
||||
public IEnumerable<AiPromptbausteinFolderDC> UpdateAiPromptbausteinFolder(IEnumerable<AiPromptbausteinFolderDC> folders)
|
||||
{
|
||||
var originale = DAOFactory.GenericDAO.LoadByIDs<AiPromptbausteinFolder>(folders.Select(sc => sc.Oid.Value));
|
||||
@@ -70,7 +75,6 @@ namespace BeWo.Service.Plugins
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public IEnumerable<AiPromptbausteinPromptDC> UpdateAiPromptbausteinPrompt(IEnumerable<AiPromptbausteinPromptDC> prompts)
|
||||
{
|
||||
var originale = DAOFactory.GenericDAO.LoadByIDs<AiPromptbausteinPrompt>(prompts.Select(sc => sc.Oid.Value));
|
||||
@@ -81,6 +85,16 @@ namespace BeWo.Service.Plugins
|
||||
|
||||
return null;
|
||||
}
|
||||
public IEnumerable<AiPromptbausteinRoutineDC> UpdateAiPromptbausteinRoutine(IEnumerable<AiPromptbausteinRoutineDC> routine)
|
||||
{
|
||||
var originale = DAOFactory.GenericDAO.LoadByIDs<AiPromptbausteinRoutine>(routine.Select(sc => sc.Oid.Value));
|
||||
var routine2 = routine.ToList();
|
||||
MapperFactory.AiPromptbausteinRoutine.MergeWithEntitys(routine2, originale);
|
||||
|
||||
DAOFactory.GenericDAO.Update(originale);
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public void DeleteAiPromptbausteinFolder(Dictionary<long, long> oid2version)
|
||||
{
|
||||
@@ -107,6 +121,13 @@ namespace BeWo.Service.Plugins
|
||||
|
||||
DAOFactory.GenericDAO.SetActivationType(originale, BS.Shared.ActivationTypeId.Deleted);
|
||||
}
|
||||
public void DeleteAiPromptbausteinRoutine(Dictionary<long, long> oid2version)
|
||||
{
|
||||
var originale = DAOFactory.GenericDAO.LoadByIDs<AiPromptbausteinRoutine>(oid2version.Select(e => e.Key));
|
||||
originale.DoForEach(or => MapperFactory.AiPromptbausteinRoutine.ConcurrencyCheck(oid2version[or.Oid.Value], or));
|
||||
|
||||
DAOFactory.GenericDAO.SetActivationType(originale, BS.Shared.ActivationTypeId.Deleted);
|
||||
}
|
||||
|
||||
private AiPromptbausteinFolderDC getOwnFolder(AiActionType aiActionType)
|
||||
{
|
||||
@@ -134,6 +155,39 @@ namespace BeWo.Service.Plugins
|
||||
|
||||
own_bib.SubPrompts.AddRange(own_prompts_dcs);
|
||||
|
||||
|
||||
|
||||
var example_routine = new AiPromptbausteinRoutineDC();
|
||||
example_routine.ActionType = aiActionType;
|
||||
example_routine.CanEdit = true;
|
||||
example_routine.IsPublic = true;
|
||||
example_routine.Description = "Beschreibung";
|
||||
example_routine.Oid = 1000;
|
||||
example_routine.ParentFolderOid = own_bib.Oid;
|
||||
example_routine.Title = "Routine Title";
|
||||
example_routine.Steps = new List<AiPromptbausteinRoutineStepDC>();
|
||||
|
||||
if (own_prompts_dcs.Count > 0)
|
||||
example_routine.Steps.Add(new AiPromptbausteinRoutineStepDC()
|
||||
{
|
||||
Oid = 1001,
|
||||
Position = 0,
|
||||
PromptReference = own_prompts_dcs?[0],
|
||||
});
|
||||
|
||||
if (own_bib.SubFolders.Count > 0 && own_bib.SubFolders[0].SubPrompts.Count > 0)
|
||||
example_routine.Steps.Add(new AiPromptbausteinRoutineStepDC()
|
||||
{
|
||||
Oid = 1001,
|
||||
Position = 0,
|
||||
PromptReference = own_bib.SubFolders[0].SubPrompts[0],
|
||||
});
|
||||
|
||||
if (own_prompts_dcs.Count > 0)
|
||||
{
|
||||
own_bib.SubRoutines = new List<AiPromptbausteinRoutineDC> { example_routine };
|
||||
}
|
||||
|
||||
return own_bib;
|
||||
}
|
||||
private void initOwnFolder(AiPromptbausteinFolderDC folder)
|
||||
|
||||
@@ -86,6 +86,11 @@ namespace BeWo.Service.ServiceContracts.Enhanced
|
||||
[OperationContract]
|
||||
[RequireWcfAuthorization(UserRightType.AiModulePromptbausteineEdit)]
|
||||
IEnumerable<AiPromptbausteinPromptDC> InsertAiPromptbausteinPrompt(IEnumerable<AiPromptbausteinPromptDC> prompts);
|
||||
|
||||
[FaultContract(typeof(BeWoFault))]
|
||||
[OperationContract]
|
||||
[RequireWcfAuthorization(UserRightType.AiModulePromptbausteineEdit)]
|
||||
IEnumerable<AiPromptbausteinRoutineDC> InsertAiPromptbausteinRoutine(IEnumerable<AiPromptbausteinRoutineDC> routine);
|
||||
|
||||
[FaultContract(typeof(BeWoFault))]
|
||||
[OperationContract]
|
||||
@@ -94,8 +99,13 @@ namespace BeWo.Service.ServiceContracts.Enhanced
|
||||
|
||||
[FaultContract(typeof(BeWoFault))]
|
||||
[OperationContract]
|
||||
[RequireWcfAuthorization(UserRightType.AiModulePromptbausteineView)]
|
||||
[RequireWcfAuthorization(UserRightType.AiModulePromptbausteineEdit)]
|
||||
IEnumerable<AiPromptbausteinPromptDC> UpdateAiPromptbausteinPrompt(IEnumerable<AiPromptbausteinPromptDC> prompts);
|
||||
|
||||
[FaultContract(typeof(BeWoFault))]
|
||||
[OperationContract]
|
||||
[RequireWcfAuthorization(UserRightType.AiModulePromptbausteineEdit)]
|
||||
IEnumerable<AiPromptbausteinRoutineDC> UpdateAiPromptbausteinRoutine(IEnumerable<AiPromptbausteinRoutineDC> routine);
|
||||
|
||||
[FaultContract(typeof(BeWoFault))]
|
||||
[OperationContract]
|
||||
@@ -106,6 +116,11 @@ namespace BeWo.Service.ServiceContracts.Enhanced
|
||||
[OperationContract]
|
||||
[RequireWcfAuthorization(UserRightType.AiModulePromptbausteineEdit)]
|
||||
void DeleteAiPromptbausteinPrompt(Dictionary<long, long> oid2version);
|
||||
|
||||
[FaultContract(typeof(BeWoFault))]
|
||||
[OperationContract]
|
||||
[RequireWcfAuthorization(UserRightType.AiModulePromptbausteineEdit)]
|
||||
void DeleteAiPromptbausteinRoutine(Dictionary<long, long> oid2version);
|
||||
|
||||
[FaultContract(typeof(BeWoFault))]
|
||||
[OperationContract]
|
||||
|
||||
@@ -71,18 +71,27 @@ namespace BeWo.Service.ServiceImplementations.Enhanced
|
||||
|
||||
public IEnumerable<AiPromptbausteinPromptDC> InsertAiPromptbausteinPrompt(IEnumerable<AiPromptbausteinPromptDC> prompts)
|
||||
=> GetAiPromptbausteineService().InsertAiPromptbausteinPrompt(prompts);
|
||||
|
||||
public IEnumerable<AiPromptbausteinRoutineDC> InsertAiPromptbausteinRoutine(IEnumerable<AiPromptbausteinRoutineDC> routine)
|
||||
=> GetAiPromptbausteineService().InsertAiPromptbausteinRoutine(routine);
|
||||
|
||||
public IEnumerable<AiPromptbausteinFolderDC> UpdateAiPromptbausteinFolder(IEnumerable<AiPromptbausteinFolderDC> folders)
|
||||
=> GetAiPromptbausteineService().UpdateAiPromptbausteinFolder(folders);
|
||||
|
||||
public IEnumerable<AiPromptbausteinPromptDC> UpdateAiPromptbausteinPrompt(IEnumerable<AiPromptbausteinPromptDC> prompts)
|
||||
=> GetAiPromptbausteineService().UpdateAiPromptbausteinPrompt(prompts);
|
||||
|
||||
public IEnumerable<AiPromptbausteinRoutineDC> UpdateAiPromptbausteinRoutine(IEnumerable<AiPromptbausteinRoutineDC> routine)
|
||||
=> GetAiPromptbausteineService().UpdateAiPromptbausteinRoutine(routine);
|
||||
|
||||
public void DeleteAiPromptbausteinFolder(Dictionary<long, long> oid2version)
|
||||
=> GetAiPromptbausteineService().DeleteAiPromptbausteinFolder(oid2version);
|
||||
|
||||
public void DeleteAiPromptbausteinPrompt(Dictionary<long, long> oid2version)
|
||||
=> GetAiPromptbausteineService().DeleteAiPromptbausteinPrompt(oid2version);
|
||||
|
||||
public void DeleteAiPromptbausteinRoutine(Dictionary<long, long> oid2version)
|
||||
=> GetAiPromptbausteineService().DeleteAiPromptbausteinRoutine(oid2version);
|
||||
|
||||
private AiPromptbausteineService GetAiPromptbausteineService()
|
||||
{
|
||||
|
||||
@@ -19,9 +19,11 @@ namespace BS.Shared.DataContracts.Feature.AI
|
||||
[DataMember] public AiActionType ActionType { get; set; }
|
||||
[DataMember] public List<AiPromptbausteinFolderDC> SubFolders { get; set; }
|
||||
[DataMember] public List<AiPromptbausteinPromptDC> SubPrompts { get; set; }
|
||||
[DataMember] public List<AiPromptbausteinRoutineDC> SubRoutines { get; set; }
|
||||
|
||||
[DataMember] public bool CanAddFolder { get; set; }
|
||||
[DataMember] public bool CanAddPrompt { get; set; }
|
||||
[DataMember] public bool CanAddRoutine { get; set; }
|
||||
[DataMember] public bool CanEdit { get; set; }
|
||||
[DataMember] public bool IsNewFeature { get; set; }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user