4 Commits
Author SHA1 Message Date
MarcoE deda374b5b Finish v1.2.2 2026-09-29 10:34:45 +02:00
MarcoE 92271e20fb -> v1.2.2 (8) 2026-09-29 10:34:40 +02:00
MarcoEandClaude Opus 5.5 e524c12a96 Riporta a bozza le schede non inviate senza reparto o motivo
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-29 10:33:01 +02:00
MarcoEandClaude Opus 5.5 de889ef8c7 Mostra nell'ispezione le bozze senza reparto
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-29 10:27:22 +02:00
4 changed files with 45 additions and 18 deletions

No files matched your search

@@ -155,14 +155,29 @@ public class IspezioniService(AppDbContext db) : IIspezioniService
await db.SaveChangesAsync();
}
public Task<List<Scheda>> GetAllSchedeOfIspezioneAsync(string codMdep, DateTime data, string rilevatore) =>
db.Schede
public async Task<List<Scheda>> GetAllSchedeOfIspezioneAsync(string codMdep, DateTime data, string rilevatore)
{
// Le versioni precedenti dell'app hanno lasciato schede non bozza senza
// reparto o motivo: risultano inviabili ma il server le rifiuta, e
// bloccano la conclusione dell'ispezione. Tornano bozze, cosi' il
// rilevatore le completa. Quelle gia' inviate non si toccano.
await db.Schede
.Where(x => x.CodMdep == codMdep &&
x.Data == data &&
x.Rilevatore == rilevatore &&
!x.Bozza &&
x.ActivityId == null &&
(string.IsNullOrEmpty(x.CodJfas) || string.IsNullOrEmpty(x.ActivityTypeId)))
.ExecuteUpdateAsync(s => s.SetProperty(x => x.Bozza, true));
return await db.Schede
.AsNoTracking()
.Include(s => s.Articoli)
.Where(x => x.CodMdep == codMdep &&
x.Data == data &&
x.Rilevatore == rilevatore)
.ToListAsync();
}
public Task<Scheda?> GetSchedaAsync(int schedaId) =>
db.Schede
+2 -2
View File
@@ -30,8 +30,8 @@
<ApplicationId>it.integry.SteUp</ApplicationId>
<!-- Versions -->
<ApplicationDisplayVersion>1.2.1</ApplicationDisplayVersion>
<ApplicationVersion>7</ApplicationVersion>
<ApplicationDisplayVersion>1.2.2</ApplicationDisplayVersion>
<ApplicationVersion>8</ApplicationVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">15.0</SupportedOSPlatformVersion>
<!-- <SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">-->
@@ -157,6 +157,7 @@
@foreach (var group in SchedeGrouped)
{
var reparto = group.Key;
var senzaReparto = ReferenceEquals(reparto, SenzaReparto);
var chiuso = IsCollapsed(reparto);
var daInviare = group.Value.CountDaInviare();
@@ -172,7 +173,9 @@
</button>
<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'
l'unica differenza con il "+" della barra. *@
@@ -326,13 +329,15 @@
// schermata, non del documento.
private readonly HashSet<string> _collapsed = new(StringComparer.OrdinalIgnoreCase);
private bool IsCollapsed(JtbFasiDto reparto) =>
reparto.CodJfas is not null && _collapsed.Contains(reparto.CodJfas);
// Il gruppo "Senza reparto" non ha codice: la chiave vuota e' la sua.
private static string CollapseKey(JtbFasiDto reparto) => reparto.CodJfas ?? string.Empty;
private bool IsCollapsed(JtbFasiDto reparto) => _collapsed.Contains(CollapseKey(reparto));
private void Toggle(JtbFasiDto reparto)
{
if (reparto.CodJfas is null) return;
if (!_collapsed.Remove(reparto.CodJfas)) _collapsed.Add(reparto.CodJfas);
var key = CollapseKey(reparto);
if (!_collapsed.Remove(key)) _collapsed.Add(key);
}
private static string Conteggi(List<Scheda> schede)
@@ -542,15 +547,22 @@
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()
{
SchedeGrouped = SchedeList
.Where(s => s.Reparto != null)
.GroupBy(s => s.CodJfas)
.ToDictionary(
g => g.First().Reparto!,
g => g.ToList()
);
var grouped = new Dictionary<JtbFasiDto, List<Scheda>>();
// In testa: sono schede a meta' che chiedono di essere completate.
var senzaReparto = SchedeList.FindAll(s => s.Reparto == null);
if (senzaReparto.Count > 0) grouped[SenzaReparto] = senzaReparto;
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)
@@ -16,7 +16,7 @@
<div class="list-card" aria-label="@SemanticLabel">
<div class="list-card__head">
<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>
</div>
</div>
@@ -125,7 +125,7 @@
};
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)
{