Mostra nell'ispezione le bozze senza reparto
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
0e00fb273a
commit
de889ef8c7
2 files changed
+26
-14
No files matched your search
@@ -157,6 +157,7 @@
|
|||||||
@foreach (var group in SchedeGrouped)
|
@foreach (var group in SchedeGrouped)
|
||||||
{
|
{
|
||||||
var reparto = group.Key;
|
var reparto = group.Key;
|
||||||
|
var senzaReparto = ReferenceEquals(reparto, SenzaReparto);
|
||||||
var chiuso = IsCollapsed(reparto);
|
var chiuso = IsCollapsed(reparto);
|
||||||
var daInviare = group.Value.CountDaInviare();
|
var daInviare = group.Value.CountDaInviare();
|
||||||
|
|
||||||
@@ -172,7 +173,9 @@
|
|||||||
</button>
|
</button>
|
||||||
|
|
||||||
<div class="reparto__actions">
|
<div class="reparto__actions">
|
||||||
@if (!IsCompleted)
|
@* Il gruppo "Senza reparto" raccoglie solo bozze da
|
||||||
|
sistemare: non ha un "+" ne' un invio suo. *@
|
||||||
|
@if (!IsCompleted && !senzaReparto)
|
||||||
{
|
{
|
||||||
@* Da qui la scheda nasce gia' con il suo reparto: e'
|
@* Da qui la scheda nasce gia' con il suo reparto: e'
|
||||||
l'unica differenza con il "+" della barra. *@
|
l'unica differenza con il "+" della barra. *@
|
||||||
@@ -326,13 +329,15 @@
|
|||||||
// schermata, non del documento.
|
// schermata, non del documento.
|
||||||
private readonly HashSet<string> _collapsed = new(StringComparer.OrdinalIgnoreCase);
|
private readonly HashSet<string> _collapsed = new(StringComparer.OrdinalIgnoreCase);
|
||||||
|
|
||||||
private bool IsCollapsed(JtbFasiDto reparto) =>
|
// Il gruppo "Senza reparto" non ha codice: la chiave vuota e' la sua.
|
||||||
reparto.CodJfas is not null && _collapsed.Contains(reparto.CodJfas);
|
private static string CollapseKey(JtbFasiDto reparto) => reparto.CodJfas ?? string.Empty;
|
||||||
|
|
||||||
|
private bool IsCollapsed(JtbFasiDto reparto) => _collapsed.Contains(CollapseKey(reparto));
|
||||||
|
|
||||||
private void Toggle(JtbFasiDto reparto)
|
private void Toggle(JtbFasiDto reparto)
|
||||||
{
|
{
|
||||||
if (reparto.CodJfas is null) return;
|
var key = CollapseKey(reparto);
|
||||||
if (!_collapsed.Remove(reparto.CodJfas)) _collapsed.Add(reparto.CodJfas);
|
if (!_collapsed.Remove(key)) _collapsed.Add(key);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static string Conteggi(List<Scheda> schede)
|
private static string Conteggi(List<Scheda> schede)
|
||||||
@@ -542,15 +547,22 @@
|
|||||||
StateHasChanged();
|
StateHasChanged();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Una bozza si puo' salvare anche senza reparto: senza questo gruppo
|
||||||
|
// sparirebbe dall'elenco pur restando sul dispositivo e contata fra le bozze.
|
||||||
|
private static readonly JtbFasiDto SenzaReparto = new() { Descrizione = "Senza reparto" };
|
||||||
|
|
||||||
private void GroupSchede()
|
private void GroupSchede()
|
||||||
{
|
{
|
||||||
SchedeGrouped = SchedeList
|
var grouped = new Dictionary<JtbFasiDto, List<Scheda>>();
|
||||||
.Where(s => s.Reparto != null)
|
|
||||||
.GroupBy(s => s.CodJfas)
|
// In testa: sono schede a meta' che chiedono di essere completate.
|
||||||
.ToDictionary(
|
var senzaReparto = SchedeList.FindAll(s => s.Reparto == null);
|
||||||
g => g.First().Reparto!,
|
if (senzaReparto.Count > 0) grouped[SenzaReparto] = senzaReparto;
|
||||||
g => g.ToList()
|
|
||||||
);
|
foreach (var g in SchedeList.Where(s => s.Reparto != null).GroupBy(s => s.CodJfas))
|
||||||
|
grouped[g.First().Reparto!] = g.ToList();
|
||||||
|
|
||||||
|
SchedeGrouped = grouped;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnSchedaModified(Scheda obj)
|
private void OnSchedaModified(Scheda obj)
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
<div class="list-card" aria-label="@SemanticLabel">
|
<div class="list-card" aria-label="@SemanticLabel">
|
||||||
<div class="list-card__head">
|
<div class="list-card__head">
|
||||||
<div class="list-card__ident">
|
<div class="list-card__ident">
|
||||||
<div class="t-ident">@Scheda.DescrizioneReparto</div>
|
<div class="t-ident">@(Scheda.DescrizioneReparto ?? "Senza reparto")</div>
|
||||||
<h3 class="list-card__title">@Titolo</h3>
|
<h3 class="list-card__title">@Titolo</h3>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -125,7 +125,7 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
private string SemanticLabel =>
|
private string SemanticLabel =>
|
||||||
$"Scheda {Titolo}, reparto {Scheda.DescrizioneReparto}, {SyncState.ToBadge().Label}, {ArticoliLabel}, {FotoLabel}";
|
$"Scheda {Titolo}, reparto {Scheda.DescrizioneReparto ?? "non indicato"},{SyncState.ToBadge().Label}, {ArticoliLabel}, {FotoLabel}";
|
||||||
|
|
||||||
private async Task SetBusy(bool value)
|
private async Task SetBusy(bool value)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in new issue
Block a user