Projekte im Ticketsystem: Anlegen, Archiv und Anzeige repariert
- Neues Projekt (Projekte-Seite): Repo-Name blieb nach dem ersten
Buchstaben der Subdomain stehen ("m" statt "musterfirma")
- Ticket "Projekt waehlen": archivierte Repos nach Flag ausblenden, nicht
nach status (reaktivierte fehlten, archivierte wurden angeboten)
- Projektliste: "Aktive Projekte" + neue Ansicht "Alle inkl. Archiv";
Liste wird auch nach einem Anlege-Fehler neu geladen
- Kundenauswahl: "Kein Kunde" entfernt Kunde und Ticket wirklich (mit
Rueckfrage); beim Kundenwechsel bleibt kein fremdes Ticket haengen
- Zuordnen-Assistent ueberschreibt eine vorhandene Website nicht mehr
- Neues Projekt am Ticket bekommt die Art Website
- Umlaute in Subdomains wie im Portal (mueller statt m-ller)
- Preview-Block nur mit gespeicherter Subdomain; archivierte Projekte
erst reaktivieren, bevor sie bearbeitet werden
- Repo-Import beim Aufklappen hoechstens einmal pro Minute
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
78bc99a73b
commit
f4c8b235b9
13 files changed
+269
-92
No files matched your search
@@ -2,7 +2,7 @@ import test from 'node:test'
|
||||
import assert from 'node:assert/strict'
|
||||
import { loadModule } from './load.mjs'
|
||||
|
||||
const { isOutsideOrg, needsPreviewButton, assignSummary, assignSequentially } = await loadModule(
|
||||
const { isOutsideOrg, needsPreviewButton, assignSummary, assignSequentially, assignableProjects, ticketIdForCustomer } = await loadModule(
|
||||
'src/lib/projectAssign.js'
|
||||
)
|
||||
|
||||
@@ -17,9 +17,36 @@ test('isOutsideOrg', () => {
|
||||
})
|
||||
|
||||
test('needsPreviewButton', () => {
|
||||
assert.equal(needsPreviewButton({ previewUrl: 'https://x', status: 'deployed' }), false)
|
||||
assert.equal(needsPreviewButton({ subdomain: 'x', previewUrl: 'https://x', status: 'deployed' }), false)
|
||||
assert.equal(needsPreviewButton({ previewUrl: '', status: 'synced' }), true)
|
||||
assert.equal(needsPreviewButton({ previewUrl: 'https://x', status: 'pending' }), true)
|
||||
// gerade angelegt, der Runner baut noch (status noch synced/pending): kein "Preview einschalten"
|
||||
assert.equal(needsPreviewButton({ subdomain: 'x', previewUrl: 'https://x', status: 'synced' }), false)
|
||||
assert.equal(needsPreviewButton({ subdomain: 'x', previewUrl: 'https://x', status: 'pending' }), false)
|
||||
// archiviert: erst reaktivieren
|
||||
assert.equal(needsPreviewButton({ archived: true, status: 'archived' }), false)
|
||||
})
|
||||
|
||||
test('assignableProjects: Flag archived zaehlt, nicht status', () => {
|
||||
const all = [
|
||||
{ $id: 'a', repoFullName: 'WEBklar/a', status: 'archived', archived: false }, // reaktiviert, alter status
|
||||
{ $id: 'b', repoFullName: 'JUSN/b', status: 'synced', archived: true }, // in Gitea archiviert
|
||||
{ $id: 'c', repoFullName: 'WEBklar/c', customerId: 'k2' }, // anderer Kunde
|
||||
{ $id: 'd', repoFullName: 'WEBklar/d', customerId: 'k1' },
|
||||
{ $id: 'e', repoFullName: 'WEBklar/e', isTemplate: true },
|
||||
{ $id: 'f', projectName: 'ohne Repo' },
|
||||
{ $id: 'g', repoFullName: 'WEBklar/g' },
|
||||
]
|
||||
const ids = assignableProjects(all, { customerId: 'k1' }, new Set(['g'])).map((p) => p.$id)
|
||||
assert.deepEqual(ids, ['a', 'd'])
|
||||
})
|
||||
|
||||
test('ticketIdForCustomer: altes Ticket nur beim gleichen Kunden', () => {
|
||||
const p = { customerId: 'A', ticketId: 'tA' }
|
||||
const wo = { tA: { customerId: 'A' }, tB: { customerId: 'B' } }
|
||||
assert.equal(ticketIdForCustomer(p, 'A', wo), 'tA')
|
||||
assert.equal(ticketIdForCustomer(p, 'B', wo), '')
|
||||
assert.equal(ticketIdForCustomer({ customerId: 'A', ticketId: 'tB' }, 'B', wo), 'tB')
|
||||
assert.equal(ticketIdForCustomer({ customerId: '', ticketId: '' }, 'B', wo), '')
|
||||
})
|
||||
|
||||
test('assignSummary', () => {
|
||||
|
||||
Reference in new issue
Block a user