required fields reworked
This commit is contained in:
@@ -68,6 +68,39 @@
|
|||||||
Padding="2" />
|
Padding="2" />
|
||||||
</Border>
|
</Border>
|
||||||
</ControlTemplate>
|
</ControlTemplate>
|
||||||
|
|
||||||
|
<Style x:Key="MandatoryFieldLabelStyle"
|
||||||
|
TargetType="TextBlock">
|
||||||
|
<Setter Property="FontWeight"
|
||||||
|
Value="Bold" />
|
||||||
|
<Setter Property="Margin"
|
||||||
|
Value="0 10 0 0" />
|
||||||
|
<Setter Property="Foreground"
|
||||||
|
Value="{DynamicResource FontColor.Menu.Categories}" />
|
||||||
|
</Style>
|
||||||
|
|
||||||
|
<Style x:Key="MandatoryFieldBorderStyle"
|
||||||
|
TargetType="Border">
|
||||||
|
<Setter Property="Margin"
|
||||||
|
Value="0 5 0 0" />
|
||||||
|
<Setter Property="BorderThickness"
|
||||||
|
Value="1" />
|
||||||
|
<Setter Property="Padding"
|
||||||
|
Value="1" />
|
||||||
|
<Setter Property="CornerRadius"
|
||||||
|
Value="7.5" />
|
||||||
|
<Setter Property="Background"
|
||||||
|
Value="{DynamicResource BackgroundColor.DetailsPage.DataHistory.ValueColumn}" />
|
||||||
|
<Setter Property="BorderBrush"
|
||||||
|
Value="{DynamicResource BackgroundColor.Menu.SubCategory.Hover}" />
|
||||||
|
</Style>
|
||||||
|
|
||||||
|
<Style x:Key="MandatoryEditableTextBoxStyle"
|
||||||
|
TargetType="TextBox"
|
||||||
|
BasedOn="{StaticResource Customizable.Editable.TextBox.EditOnly}">
|
||||||
|
<Setter Property="AutomationProperties.IsRequiredForForm"
|
||||||
|
Value="True" />
|
||||||
|
</Style>
|
||||||
</UserControl.Resources>
|
</UserControl.Resources>
|
||||||
|
|
||||||
<ScrollViewer Height="570"
|
<ScrollViewer Height="570"
|
||||||
@@ -156,17 +189,10 @@
|
|||||||
<StackPanel x:Name="MainStack">
|
<StackPanel x:Name="MainStack">
|
||||||
<StackPanel x:Name="CategoryLabelPanel">
|
<StackPanel x:Name="CategoryLabelPanel">
|
||||||
<TextBlock Text="{Binding Converter={StaticResource LanguageConverter}, ConverterParameter=Dialog.CloseCase.Category}"
|
<TextBlock Text="{Binding Converter={StaticResource LanguageConverter}, ConverterParameter=Dialog.CloseCase.Category}"
|
||||||
FontWeight="Bold"
|
Style="{StaticResource MandatoryFieldLabelStyle}" />
|
||||||
Margin="0 10 0 0"
|
|
||||||
Foreground="{DynamicResource FontColor.Menu.Categories}" />
|
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
<Border x:Name="CategoryValidationBorder"
|
<Border x:Name="CategoryValidationBorder"
|
||||||
Margin="0 5 0 0"
|
Style="{StaticResource MandatoryFieldBorderStyle}">
|
||||||
BorderThickness="1"
|
|
||||||
Padding="1"
|
|
||||||
CornerRadius="7.5"
|
|
||||||
Background="{DynamicResource BackgroundColor.DetailsPage.DataHistory.ValueColumn}"
|
|
||||||
BorderBrush="{DynamicResource BackgroundColor.Menu.SubCategory.Hover}">
|
|
||||||
<local:HierarchicalSelectionControl x:Name="CategorySelectionControl"
|
<local:HierarchicalSelectionControl x:Name="CategorySelectionControl"
|
||||||
SelectedItem="{Binding SelectedCategory, ElementName=CloseCaseDialogUc, Mode=TwoWay}"
|
SelectedItem="{Binding SelectedCategory, ElementName=CloseCaseDialogUc, Mode=TwoWay}"
|
||||||
ComboBoxBackground="{DynamicResource BackgroundColor.DetailsPage.DataHistory.ValueColumn}"
|
ComboBoxBackground="{DynamicResource BackgroundColor.DetailsPage.DataHistory.ValueColumn}"
|
||||||
@@ -174,21 +200,16 @@
|
|||||||
SearchPlaceholderText="{Binding Converter={StaticResource LanguageConverter}, ConverterParameter=Searchbar.Placeholder}"
|
SearchPlaceholderText="{Binding Converter={StaticResource LanguageConverter}, ConverterParameter=Searchbar.Placeholder}"
|
||||||
DropDownOpened="DropDownOpened"
|
DropDownOpened="DropDownOpened"
|
||||||
DropDownClosed="DropDownClosed"
|
DropDownClosed="DropDownClosed"
|
||||||
PreviewKeyDown="Combobox_PreviewKeyDown" />
|
PreviewKeyDown="Combobox_PreviewKeyDown"
|
||||||
|
AutomationProperties.IsRequiredForForm="True"
|
||||||
|
AutomationProperties.HelpText="{Binding Converter={StaticResource LanguageConverter}, ConverterParameter=Dialog.CloseCase.ValidationErrorCategoryEmpty}" />
|
||||||
</Border>
|
</Border>
|
||||||
<StackPanel>
|
<StackPanel>
|
||||||
<TextBlock Text="{Binding Converter={StaticResource LanguageConverter}, ConverterParameter=Dialog.CloseCase.Template}"
|
<TextBlock Text="{Binding Converter={StaticResource LanguageConverter}, ConverterParameter=Dialog.CloseCase.Template}"
|
||||||
FontWeight="Bold"
|
Style="{StaticResource MandatoryFieldLabelStyle}" />
|
||||||
Margin="0 10 0 0"
|
|
||||||
Foreground="{DynamicResource FontColor.Menu.Categories}" />
|
|
||||||
|
|
||||||
<Border x:Name="QuickTicketValidationBorder"
|
<Border x:Name="QuickTicketValidationBorder"
|
||||||
Margin="0 5 0 0"
|
Style="{StaticResource MandatoryFieldBorderStyle}">
|
||||||
BorderThickness="1"
|
|
||||||
Padding="1"
|
|
||||||
CornerRadius="7.5"
|
|
||||||
Background="{DynamicResource BackgroundColor.DetailsPage.DataHistory.ValueColumn}"
|
|
||||||
BorderBrush="{DynamicResource BackgroundColor.Menu.SubCategory.Hover}">
|
|
||||||
<ComboBox x:Name="QuickTicketSelection"
|
<ComboBox x:Name="QuickTicketSelection"
|
||||||
Background="{DynamicResource BackgroundColor.DetailsPage.DataHistory.ValueColumn}"
|
Background="{DynamicResource BackgroundColor.DetailsPage.DataHistory.ValueColumn}"
|
||||||
BorderBrush="Transparent"
|
BorderBrush="Transparent"
|
||||||
@@ -197,7 +218,9 @@
|
|||||||
SelectionChanged="QuickTicketSelection_SelectionChanged"
|
SelectionChanged="QuickTicketSelection_SelectionChanged"
|
||||||
PreviewKeyDown="Combobox_PreviewKeyDown"
|
PreviewKeyDown="Combobox_PreviewKeyDown"
|
||||||
DropDownOpened="DropDownOpened"
|
DropDownOpened="DropDownOpened"
|
||||||
DropDownClosed="DropDownClosed">
|
DropDownClosed="DropDownClosed"
|
||||||
|
AutomationProperties.IsRequiredForForm="True"
|
||||||
|
AutomationProperties.HelpText="{Binding Converter={StaticResource LanguageConverter}, ConverterParameter=Dialog.CloseCase.ValidationErrorQuickCallEmpty}">
|
||||||
</ComboBox>
|
</ComboBox>
|
||||||
</Border>
|
</Border>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
@@ -273,16 +296,15 @@
|
|||||||
|
|
||||||
<StackPanel>
|
<StackPanel>
|
||||||
<TextBlock Text="{Binding Converter={StaticResource LanguageConverter}, ConverterParameter=Dialog.CloseCase.Summary}"
|
<TextBlock Text="{Binding Converter={StaticResource LanguageConverter}, ConverterParameter=Dialog.CloseCase.Summary}"
|
||||||
FontWeight="Bold"
|
Style="{StaticResource MandatoryFieldLabelStyle}" />
|
||||||
Margin="0 10 0 0"
|
|
||||||
Foreground="{DynamicResource FontColor.Menu.Categories}" />
|
|
||||||
|
|
||||||
<TextBox x:Name="TicketSummaryTextBox"
|
<TextBox x:Name="TicketSummaryTextBox"
|
||||||
Margin="0 5 0 10"
|
Margin="0 5 0 10"
|
||||||
Style="{DynamicResource Customizable.Editable.TextBox.EditOnly}"
|
Style="{StaticResource MandatoryEditableTextBoxStyle}"
|
||||||
Padding="7.5 5"
|
Padding="7.5 5"
|
||||||
Background="{DynamicResource BackgroundColor.DetailsPage.DataHistory.ValueColumn}"
|
Background="{DynamicResource BackgroundColor.DetailsPage.DataHistory.ValueColumn}"
|
||||||
TextChanged="TicketSummaryTextBox_TextChanged" />
|
TextChanged="TicketSummaryTextBox_TextChanged"
|
||||||
|
AutomationProperties.HelpText="{Binding Converter={StaticResource LanguageConverter}, ConverterParameter=Dialog.CloseCase.ValidationErrorSummaryEmpty}" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
@@ -296,8 +318,8 @@
|
|||||||
<StackPanel>
|
<StackPanel>
|
||||||
<StackPanel Orientation="Horizontal">
|
<StackPanel Orientation="Horizontal">
|
||||||
<TextBlock Text="{Binding Converter={StaticResource LanguageConverter}, ConverterParameter=Dialog.CloseCase.Status}"
|
<TextBlock Text="{Binding Converter={StaticResource LanguageConverter}, ConverterParameter=Dialog.CloseCase.Status}"
|
||||||
FontWeight="Bold"
|
Style="{StaticResource MandatoryFieldLabelStyle}"
|
||||||
Foreground="{DynamicResource FontColor.Menu.Categories}" />
|
Margin="0" />
|
||||||
<ico:AdaptableIcon x:Name="WarningTicketAction"
|
<ico:AdaptableIcon x:Name="WarningTicketAction"
|
||||||
Visibility="{Binding ShowAssetWarningTicketAction, ElementName=CloseCaseDialogUc, Converter={StaticResource BooleanToVisibility}}"
|
Visibility="{Binding ShowAssetWarningTicketAction, ElementName=CloseCaseDialogUc, Converter={StaticResource BooleanToVisibility}}"
|
||||||
ToolTip=""
|
ToolTip=""
|
||||||
@@ -308,12 +330,7 @@
|
|||||||
VerticalAlignment="Bottom" />
|
VerticalAlignment="Bottom" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
<Border x:Name="TicketStatusValidationBorder"
|
<Border x:Name="TicketStatusValidationBorder"
|
||||||
Margin="0 5 0 0"
|
Style="{StaticResource MandatoryFieldBorderStyle}">
|
||||||
BorderThickness="1"
|
|
||||||
Padding="1"
|
|
||||||
CornerRadius="7.5"
|
|
||||||
Background="{DynamicResource BackgroundColor.DetailsPage.DataHistory.ValueColumn}"
|
|
||||||
BorderBrush="{DynamicResource BackgroundColor.Menu.SubCategory.Hover}">
|
|
||||||
<ComboBox x:Name="TicketStatusCombobox"
|
<ComboBox x:Name="TicketStatusCombobox"
|
||||||
Background="{DynamicResource BackgroundColor.DetailsPage.DataHistory.ValueColumn}"
|
Background="{DynamicResource BackgroundColor.DetailsPage.DataHistory.ValueColumn}"
|
||||||
BorderBrush="Transparent"
|
BorderBrush="Transparent"
|
||||||
@@ -322,7 +339,9 @@
|
|||||||
DropDownClosed="DropDownClosed"
|
DropDownClosed="DropDownClosed"
|
||||||
PreviewKeyDown="Combobox_PreviewKeyDown"
|
PreviewKeyDown="Combobox_PreviewKeyDown"
|
||||||
SelectionChanged="TicketStatusCombobox_SelectionChanged"
|
SelectionChanged="TicketStatusCombobox_SelectionChanged"
|
||||||
SelectedIndex="0">
|
SelectedIndex="0"
|
||||||
|
AutomationProperties.IsRequiredForForm="True"
|
||||||
|
AutomationProperties.HelpText="{Binding Converter={StaticResource LanguageConverter}, ConverterParameter=Dialog.CloseCase.ValidationErrorTicketActionEmpty}">
|
||||||
<ComboBoxItem Content="{Binding Converter={StaticResource LanguageConverter}, ConverterParameter=Dialog.CloseCase.Status.Select}" />
|
<ComboBoxItem Content="{Binding Converter={StaticResource LanguageConverter}, ConverterParameter=Dialog.CloseCase.Status.Select}" />
|
||||||
<ComboBoxItem Content="{Binding Converter={StaticResource LanguageConverter}, ConverterParameter=Dialog.CloseCase.Status.Close}"
|
<ComboBoxItem Content="{Binding Converter={StaticResource LanguageConverter}, ConverterParameter=Dialog.CloseCase.Status.Close}"
|
||||||
Visibility="{Binding EnableCloseTicketAction, ElementName=CloseCaseDialogUc, Converter={StaticResource BooleanToVisibility}}"
|
Visibility="{Binding EnableCloseTicketAction, ElementName=CloseCaseDialogUc, Converter={StaticResource BooleanToVisibility}}"
|
||||||
@@ -422,6 +441,8 @@
|
|||||||
Foreground="{DynamicResource FontColor.Menu.Categories}"
|
Foreground="{DynamicResource FontColor.Menu.Categories}"
|
||||||
FontSize="13"
|
FontSize="13"
|
||||||
Cursor="Pen"
|
Cursor="Pen"
|
||||||
|
AutomationProperties.IsRequiredForForm="{Binding AreCaseNotesMandatory, ElementName=CloseCaseDialogUc}"
|
||||||
|
AutomationProperties.HelpText="{Binding Converter={StaticResource LanguageConverter}, ConverterParameter=Dialog.CloseCase.ValidationErrorCaseNoteEmpty}"
|
||||||
MouseLeftButtonUp="EditCaseNotesButton_MouseLeftButtonUp"
|
MouseLeftButtonUp="EditCaseNotesButton_MouseLeftButtonUp"
|
||||||
TouchDown="EditCaseNotesButton_TouchDown"/>
|
TouchDown="EditCaseNotesButton_TouchDown"/>
|
||||||
</Border>
|
</Border>
|
||||||
|
|||||||
@@ -88,6 +88,9 @@ namespace FasdDesktopUi.Basics.UserControls
|
|||||||
private readonly Brush validationErrorBrush = SharedValidationBorderBrush;
|
private readonly Brush validationErrorBrush = SharedValidationBorderBrush;
|
||||||
private Brush defaultTicketStatusBorderBrush;
|
private Brush defaultTicketStatusBorderBrush;
|
||||||
|
|
||||||
|
public bool AreCaseNotesMandatory =>
|
||||||
|
cFasdCockpitConfig.Instance?.Global?.TicketConfiguration?.NotesMandatory ?? false;
|
||||||
|
|
||||||
public bool IsTicket
|
public bool IsTicket
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
|
|||||||
Reference in New Issue
Block a user