Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/+etb-einsatzabschnitt.added.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ETB entries can be filed under an Einsatzabschnitt from the entry line or the edit panel, carry the Abschnitt as a badge in the grid and in the PDF, and a quick filter above the table shows one Abschnitt at a time (#971).
85 changes: 85 additions & 0 deletions src/LageBuch.App.Shared/Views/EtbView.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,37 @@
<Setter Property="FontWeight" Value="SemiBold" />
<Setter Property="Foreground" Value="{StaticResource TextSecondaryBrush}" />
</Style>
<!-- An Einsatzabschnitt (#971): the entry line's and the quick filter's buttons, and the quiet
badge an entry filed under one carries. A chip rather than a full button, so a row of
eight Abschnitte still reads as one choice; the chosen one is lit in the link colour. -->
<Style Selector="Button.section-chip">
<Setter Property="FontFamily" Value="{StaticResource BodyFont}" />
<Setter Property="FontSize" Value="12" />
<Setter Property="Height" Value="28" />
<Setter Property="Padding" Value="12,0" />
<Setter Property="CornerRadius" Value="14" />
<Setter Property="Background" Value="{StaticResource SurfaceBrush}" />
<Setter Property="Foreground" Value="{StaticResource TextSecondaryBrush}" />
</Style>
<Style Selector="Button.section-chip.selected">
<Setter Property="Background" Value="{StaticResource LinkWashBrush}" />
<Setter Property="BorderBrush" Value="{StaticResource LinkBrush}" />
<Setter Property="Foreground" Value="{StaticResource LinkInkBrush}" />
</Style>
<Style Selector="Panel#WorkspaceRoot.narrow Button.section-chip">
<Setter Property="Height" Value="{StaticResource ControlHeightTouch}" />
</Style>
<Style Selector="Border.section-badge">
<Setter Property="Background" Value="{StaticResource LinkWashBrush}" />
<Setter Property="CornerRadius" Value="4" />
<Setter Property="Padding" Value="5,1" />
<Setter Property="VerticalAlignment" Value="Center" />
</Style>
<Style Selector="Border.section-badge > TextBlock">
<Setter Property="FontSize" Value="11" />
<Setter Property="FontWeight" Value="SemiBold" />
<Setter Property="Foreground" Value="{StaticResource LinkInkBrush}" />
</Style>
<Style Selector="StackPanel#EditFields">
<Setter Property="Orientation" Value="Horizontal" />
</Style>
Expand Down Expand Up @@ -115,6 +146,28 @@
IsChecked="{Binding HideSystemEntries}" />
</WrapPanel>

<!-- The quick filter (#971): only the entries of one Einsatzabschnitt, combined with the two
checkboxes above. Shown once the incident has an Abschnitt to filter by. -->
<DockPanel DockPanel.Dock="Top" x:Name="SectionFilterBar" Margin="0,0,0,10"
IsVisible="{Binding HasFilterChoices}"
KeyboardNavigation.TabNavigation="Local" KeyboardNavigation.TabIndex="0">
<TextBlock DockPanel.Dock="Left" Text="ABSCHNITT" Classes="overline" VerticalAlignment="Center" Margin="0,0,12,0" />
<ItemsControl x:Name="SectionFilterStrip" ItemsSource="{Binding FilterChoices}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<WrapPanel ItemSpacing="6" LineSpacing="6" />
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate x:DataType="vm:EtbSectionChoice">
<Button Classes="section-chip" Classes.selected="{Binding IsSelected}"
Content="{Binding Label}" Command="{Binding SelectCommand}"
ToolTip.Tip="Nur die Einträge dieses Abschnitts zeigen" />
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</DockPanel>

<!-- The phone's way in to the dock. Full width and at the bottom edge of the list, where the
thumb already is; on a wide window the dock is simply always open and this never shows. -->
<Button DockPanel.Dock="Bottom" x:Name="OpenComposerButton" Classes="signal"
Expand Down Expand Up @@ -153,6 +206,26 @@
Data="M19,6.41L17.59,5 12,10.59 6.41,5 5,6.41 10.59,12 5,17.59 6.41,19 12,13.41 17.59,19 19,17.59 13.41,12z" />
</Button>
</Grid>
<!-- The Abschnitt the next entry is filed under (#971). Sticky, unlike VON: radio traffic
from one Abschnitt comes in runs, and the lit button says which one is in force.
A second tap on it files the next entry nowhere. Wraps on a phone. -->
<DockPanel x:Name="SectionEntryBar" IsVisible="{Binding HasSectionChoices}" Margin="0,0,0,4">
<TextBlock DockPanel.Dock="Left" Text="ABSCHNITT" Classes="overline" VerticalAlignment="Center" Margin="0,0,12,0" />
<ItemsControl x:Name="SectionEntryStrip" ItemsSource="{Binding SectionChoices}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<WrapPanel ItemSpacing="6" LineSpacing="6" />
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate x:DataType="vm:EtbSectionChoice">
<Button Classes="section-chip" Classes.selected="{Binding IsSelected}"
Content="{Binding Label}" Command="{Binding SelectCommand}"
ToolTip.Tip="Den neuen Eintrag diesem Abschnitt zuordnen" />
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</DockPanel>
<StackPanel x:Name="DockFields" Spacing="8">
<!-- Suggestion list, not a closed set: a sender/recipient outside Stammdaten (e.g. "ELW 1",
a person's name) must stay enterable, so this is an AutoCompleteBox rather than a
Expand Down Expand Up @@ -212,6 +285,12 @@
<TextBox x:Name="EditTextBox" Text="{Binding EditText}" b:SnippetCompletion.Snippets="{Binding TextSnippets}"
b:EnterSubmit.Command="{Binding SaveEditCommand}" />
</HeaderedContentControl>
<!-- Set, change or remove the entry's Einsatzabschnitt (#971); written with SPEICHERN. -->
<HeaderedContentControl Classes="field" Header="ABSCHNITT" IsVisible="{Binding HasEditSectionChoices}">
<ctrl:NodeChoicePicker x:Name="EditSectionPicker" Width="200"
Choices="{Binding EditSectionChoices}" Label="{Binding EditSectionLabel}"
PickerName="Abschnitt des Eintrags wählen" />
</HeaderedContentControl>
<Button x:Name="SaveEditButton" Classes="signal dock-action" Content="SPEICHERN" Command="{Binding SaveEditCommand}"
VerticalAlignment="Bottom" Margin="0,0,0,1" />
<Button x:Name="CancelEditButton" Classes="dock-action" Content="ABBRECHEN" Command="{Binding CancelEditCommand}"
Expand Down Expand Up @@ -284,6 +363,9 @@
Content="{Binding TaskBadge}" Command="{Binding ShowTasksCommand}"
ToolTip.Tip="Die Aufgaben zu diesem Eintrag zeigen" />
<StackPanel Orientation="Horizontal" Spacing="8" VerticalAlignment="Center">
<Border Classes="section-badge" IsVisible="{Binding HasSection}">
<TextBlock Text="{Binding SectionName}" />
</Border>
<Border Classes="lm-badge" IsVisible="{Binding SituationReportLabel, Converter={x:Static ObjectConverters.IsNotNull}}">
<TextBlock Text="{Binding SituationReportLabel}" />
</Border>
Expand Down Expand Up @@ -352,6 +434,9 @@
</MultiBinding>
</TextBlock.Text>
</TextBlock>
<Border Classes="section-badge" HorizontalAlignment="Left" IsVisible="{Binding HasSection}">
<TextBlock Text="{Binding SectionName}" />
</Border>
<Border Classes="lm-badge" HorizontalAlignment="Left"
IsVisible="{Binding SituationReportLabel, Converter={x:Static ObjectConverters.IsNotNull}}">
<TextBlock Text="{Binding SituationReportLabel}" />
Expand Down
7 changes: 5 additions & 2 deletions src/LageBuch.AppLogic/LocalIncidentSession.cs
Original file line number Diff line number Diff line change
Expand Up @@ -125,16 +125,19 @@ public async Task<byte[]> ExportPdfAsync(IIncidentPdfExporter exporter, Incident
}

// --- IIncidentSession mutation surface: apply → persist → notify. ---
public Guid AddJournalEntry(EtbDirection direction, string text, string? from = null, string? to = null)
public Guid AddJournalEntry(EtbDirection direction, string text, string? from = null, string? to = null, Guid? sectionId = null)
{
var id = Guid.Empty;
Mutate(() => id = Incident.AddJournalEntry(_clock, RequireOperator(), direction, text, from, to).Id);
Mutate(() => id = Incident.AddJournalEntry(_clock, RequireOperator(), direction, text, from, to, sectionId: sectionId).Id);
return id;
}

public void EditJournalEntry(Guid entryId, string text) =>
Mutate(() => Incident.EditJournalEntry(_clock, RequireOperator(), entryId, text));

public void AssignJournalEntrySection(Guid entryId, Guid? sectionId) =>
Mutate(() => Incident.AssignJournalEntrySection(_clock, RequireOperator(), entryId, sectionId));

public void ToggleChecklistItem(Guid itemId) => Mutate(() => Incident.ToggleChecklistItem(_clock, RequireOperator(), itemId));

public void AssignRole(
Expand Down
Loading