PromptIsPublic wird gespeichert

This commit is contained in:
2026-06-19 11:22:05 +02:00
parent 24ffb8603d
commit b39bbd5316
3 changed files with 13 additions and 6 deletions

View File

@@ -46,7 +46,7 @@
<TextBox
Grid.Row="0"
Grid.Column="2"
IsEnabled="{Binding IsEditingMode}"
IsEnabled="{Binding ViewModel.CanEdit}"
Text="{Binding ViewModel.Title, UpdateSourceTrigger=PropertyChanged}" />
<Label Grid.Row="1" Grid.Column="0">
@@ -55,7 +55,7 @@
<TextBox
Grid.Row="1"
Grid.Column="2"
IsEnabled="{Binding IsEditingMode}"
IsEnabled="{Binding ViewModel.CanEdit}"
MaxLength="1024"
Style="{StaticResource TextBoxNoticeLarge}"
Text="{Binding ViewModel.Description, UpdateSourceTrigger=PropertyChanged}"
@@ -77,7 +77,7 @@
Grid.Column="2"
Margin="3"
IsChecked="{Binding ViewModel.IsPublic}"
IsEnabled="{Binding ViewModel.CanShareEdit, UpdateSourceTrigger=PropertyChanged}" />
IsEnabled="{Binding ViewModel.CanShareEdit}" />
<StackPanel
Grid.Row="6"

View File

@@ -81,9 +81,9 @@
<Label
Grid.Row="2"
Grid.Column="2"
HorizontalAlignment="Center"
FontSize="10"
Foreground="DarkGray"
HorizontalAlignment="Center"
Visibility="{Binding ViewModel.IsPromptVisible, Converter={StaticResource BoolVisibilityConverter}, ConverterParameter=Reverse}">
nicht sichtbar
</Label>
@@ -99,13 +99,13 @@
IsEnabled="False"
SelectedCompactEmployeeDC="{Binding ViewModel.Creator}" />
<!--<Label Grid.Row="4" Grid.Column="0">Öffentlich</Label>
<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}" />-->
IsEnabled="{Binding ViewModel.CanShareEdit}" />
<Label Grid.Row="5" Grid.Column="0">Favorit</Label>
<dxe:CheckEdit

View File

@@ -126,6 +126,13 @@ namespace BeWo.ViewModel
get => ShowPrompt && ShowPromptByTenant;
}
public bool CanShareEdit
{
get => BeWoApp.HasLoggedOnUserRight(UserRightType.AiModulePromptbausteinShare)
&& Creator?.EmployeeOid is long owner
&& owner == BeWoApp.CompactLoggedOnEmployee.EmployeeOid;
}
public string FavoritenHeader => IsFavorite ? "Favorit entfernen" : "Favorit hinzufügen";
protected override void InitByDataContract(AiPromptbausteinPromptDC pDataContract)