fix: Volk-QR-Code fuehrt zur Volk-Uebersicht statt direkt zum Durchsicht-Formular
Scannen des QR-Codes eines Volks landete bisher direkt auf einem
leeren "Neue Durchsicht"-Formular ohne jeglichen Kontext (kein
Status, keine Historie, kein Menue) - erst nach dem Speichern kam man
auf /colonies/[id], die eigentliche Uebersichtsseite mit Status,
Aktionen, Durchsicht-/Varroa-/Schwarmkontroll-/Behandlungs-/
Fuetterungshistorie.
QR fuehrt jetzt direkt zu /colonies/[id]. Der "Neue Durchsicht"-
Button ist dort weiterhin prominent vorhanden. Lastenheft Abschnitt
4.23 erlaubt explizit beide Varianten ("Volkseite beziehungsweise
eine neue Durchsicht"), diese Aenderung bleibt also spezifikations-
konform.
Verifiziert: tsc, lint, unit (228/228, inkl. der angepassten
qr.service.spec.ts-Assertion) gruen. Volle e2e-Suite konnte wegen der
wiederkehrenden WSL/Postgres-Portweiterleitungs-Unzuverlaessigkeit
nicht neu durchlaufen werden - die geaenderte Logik (ein einzelner
String) ist durch den angepassten Unit-Test direkt abgedeckt.
Co-Authored-By: Claude Sonnet 5 <[email protected]>
This commit is contained in:
1 parent
0518a5740f
commit
f1d6b2956e
4 files changed
+4
-4
No files matched your search
@@ -61,7 +61,7 @@ describe('QrService', () => {
|
|||||||
it('resolveUrl returns the same deep-link that generateSvg encodes, for NFC writing', async () => {
|
it('resolveUrl returns the same deep-link that generateSvg encodes, for NFC writing', async () => {
|
||||||
prisma.colony.findUnique.mockResolvedValueOnce({ id: 'colony-1' });
|
prisma.colony.findUnique.mockResolvedValueOnce({ id: 'colony-1' });
|
||||||
const url = await service.resolveUrl('colonies', 'colony-1');
|
const url = await service.resolveUrl('colonies', 'colony-1');
|
||||||
expect(url).toBe('http://localhost:3000/inspections/new?colonyId=colony-1');
|
expect(url).toBe('http://localhost:3000/colonies/colony-1');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('resolveUrl rejects an unsupported entity type', async () => {
|
it('resolveUrl rejects an unsupported entity type', async () => {
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ export class QrService {
|
|||||||
const colony = await this.prisma.colony.findUnique({
|
const colony = await this.prisma.colony.findUnique({
|
||||||
where: { id },
|
where: { id },
|
||||||
});
|
});
|
||||||
return colony ? `/inspections/new?colonyId=${id}` : null;
|
return colony ? `/colonies/${id}` : null;
|
||||||
}
|
}
|
||||||
case 'apiaries': {
|
case 'apiaries': {
|
||||||
const apiary = await this.prisma.apiary.findUnique({ where: { id } });
|
const apiary = await this.prisma.apiary.findUnique({ where: { id } });
|
||||||
|
|||||||
@@ -85,6 +85,6 @@ describe('QR codes (e2e)', () => {
|
|||||||
.set('Authorization', `Bearer ${beekeeperToken}`)
|
.set('Authorization', `Bearer ${beekeeperToken}`)
|
||||||
.expect(200);
|
.expect(200);
|
||||||
const body = response.body as { url: string };
|
const body = response.body as { url: string };
|
||||||
expect(body.url).toContain(`colonyId=${colonyId}`);
|
expect(body.url).toContain(`/colonies/${colonyId}`);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -52,7 +52,7 @@ export default function ColonyDetailPage() {
|
|||||||
? "Wird erstellt…"
|
? "Wird erstellt…"
|
||||||
: `Jahresbericht ${CURRENT_YEAR}`}
|
: `Jahresbericht ${CURRENT_YEAR}`}
|
||||||
</Button>
|
</Button>
|
||||||
<QrCodeDialog entityType="colonies" id={colony.id} label="QR-Code für Durchsicht" />
|
<QrCodeDialog entityType="colonies" id={colony.id} />
|
||||||
</div>
|
</div>
|
||||||
<ColonyEditCard key={colony.id} colony={colony} />
|
<ColonyEditCard key={colony.id} colony={colony} />
|
||||||
<ColonyActions colony={colony} />
|
<ColonyActions colony={colony} />
|
||||||
|
|||||||
Reference in new issue
Block a user