Tickets: Standardansicht zeigt alle Arten, auch Akquise-Tickets
Bisher startete die Liste mit dem Art-Filter "Auftraege", der Akquise-Tickets ausschliesst. Neue Kunden bekommen ein Akquise-Ticket, das dann unter Tickets nicht zu finden war. Standard ist jetzt "Alle Arten"; "Auftraege (ohne Akquise)" bleibt als Filter waehlbar. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
fa1ce2c4cb
commit
5d8130e8ef
5 files changed
+16
-8
No files matched your search
@@ -61,7 +61,7 @@ export function useWorkorders(filters = {}) {
|
|||||||
queries.push(Query.equal('type', activeFilters.type))
|
queries.push(Query.equal('type', activeFilters.type))
|
||||||
}
|
}
|
||||||
|
|
||||||
// Standardansicht "Auftraege": alles ausser Akquise-Tickets
|
// Filter "Auftraege": alles ausser Akquise-Tickets
|
||||||
if (activeFilters.excludeType) {
|
if (activeFilters.excludeType) {
|
||||||
queries.push(Query.notEqual('type', activeFilters.excludeType))
|
queries.push(Query.notEqual('type', activeFilters.excludeType))
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ export const LIST_TABS = [
|
|||||||
{ id: 'alle', label: 'Alle', groups: null },
|
{ id: 'alle', label: 'Alle', groups: null },
|
||||||
]
|
]
|
||||||
|
|
||||||
export const LIST_DEFAULTS = { tab: 'aktiv', typeId: 'orders', urgentOnly: false, search: '', limit: 10 }
|
export const LIST_DEFAULTS = { tab: 'aktiv', typeId: 'all', urgentOnly: false, search: '', limit: 10 }
|
||||||
|
|
||||||
const MIN_LIMIT = 10
|
const MIN_LIMIT = 10
|
||||||
const MAX_LIMIT = 500
|
const MAX_LIMIT = 500
|
||||||
|
|||||||
@@ -93,14 +93,14 @@ export function ticketTypeLabel(type) {
|
|||||||
return TYPE_LABELS[type] || type
|
return TYPE_LABELS[type] || type
|
||||||
}
|
}
|
||||||
|
|
||||||
// Filter nach Art: "Auftraege" = alles ausser Akquise
|
// Filter nach Art: Standard "Alle Arten" (auch Akquise), "Auftraege" = alles ausser Akquise
|
||||||
export const TYPE_FILTERS = [
|
export const TYPE_FILTERS = [
|
||||||
{ id: 'orders', label: 'Aufträge', excludeType: 'Akquise' },
|
{ id: 'all', label: 'Alle Arten' },
|
||||||
|
{ id: 'orders', label: 'Aufträge (ohne Akquise)', excludeType: 'Akquise' },
|
||||||
{ id: 'Webpage', label: 'Webpage', types: ['Webpage'] },
|
{ id: 'Webpage', label: 'Webpage', types: ['Webpage'] },
|
||||||
{ id: 'Migration', label: 'Migration', types: ['Migration'] },
|
{ id: 'Migration', label: 'Migration', types: ['Migration'] },
|
||||||
{ id: 'Project', label: 'Projekt', types: ['Project'] },
|
{ id: 'Project', label: 'Projekt', types: ['Project'] },
|
||||||
{ id: 'Akquise', label: 'Akquise', types: ['Akquise'] },
|
{ id: 'Akquise', label: 'Akquise', types: ['Akquise'] },
|
||||||
{ id: 'all', label: 'Aufträge und Akquise' },
|
|
||||||
]
|
]
|
||||||
|
|
||||||
// Suche in Kunde, Betreff, "Angefragt von" und WOID, ohne Gross-/Kleinschreibung
|
// Suche in Kunde, Betreff, "Angefragt von" und WOID, ohne Gross-/Kleinschreibung
|
||||||
|
|||||||
@@ -168,7 +168,7 @@ function TicketList() {
|
|||||||
content = (
|
content = (
|
||||||
<EmptyState
|
<EmptyState
|
||||||
title="Keine Tickets"
|
title="Keine Tickets"
|
||||||
hint="Keine Tickets passen zu Suche und Filter. Erledigte, stornierte und Akquise-Tickets sind in der Standardansicht ausgeblendet."
|
hint="Keine Tickets passen zu Suche und Filter. Erledigte und stornierte Tickets sind in der Standardansicht ausgeblendet."
|
||||||
action={<Button type="button" onClick={openCreate}>Neues Ticket</Button>}
|
action={<Button type="button" onClick={openCreate}>Neues Ticket</Button>}
|
||||||
/>
|
/>
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ const { TYPE_FILTERS } = await loadModule('src/lib/ticketStatus.js')
|
|||||||
|
|
||||||
test('Reiter und Art-Auswahl nach Spec', () => {
|
test('Reiter und Art-Auswahl nach Spec', () => {
|
||||||
assert.deepEqual(LIST_TABS.map((t) => [t.id, t.label]), [['aktiv', 'Aktiv'], ['open', 'Offen'], ['working', 'In Arbeit'], ['waiting', 'Wartet auf Kunde'], ['review', 'Prüfung'], ['done', 'Erledigt'], ['cancelled', 'Storniert'], ['alle', 'Alle']])
|
assert.deepEqual(LIST_TABS.map((t) => [t.id, t.label]), [['aktiv', 'Aktiv'], ['open', 'Offen'], ['working', 'In Arbeit'], ['waiting', 'Wartet auf Kunde'], ['review', 'Prüfung'], ['done', 'Erledigt'], ['cancelled', 'Storniert'], ['alle', 'Alle']])
|
||||||
assert.deepEqual(TYPE_FILTERS.map((f) => f.label), ['Aufträge', 'Webpage', 'Migration', 'Projekt', 'Akquise', 'Aufträge und Akquise'])
|
assert.deepEqual(TYPE_FILTERS.map((f) => f.label), ['Alle Arten', 'Aufträge (ohne Akquise)', 'Webpage', 'Migration', 'Projekt', 'Akquise'])
|
||||||
})
|
})
|
||||||
|
|
||||||
test('parse: Standard, gültige und ungültige Werte', () => {
|
test('parse: Standard, gültige und ungültige Werte', () => {
|
||||||
@@ -31,7 +31,7 @@ test('Filteränderung setzt limit zurück, Mehr laden +10 bis 500', () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
test('listFilters und countFilters', () => {
|
test('listFilters und countFilters', () => {
|
||||||
assert.deepEqual(listFilters(LIST_DEFAULTS), { status: ['Open', 'Occupied', 'Assigned', 'Added Info', 'In Kontakt', 'Awaiting', 'Halted', 'In Test'], type: [], excludeType: 'Akquise', priority: [], search: undefined, limit: 10 })
|
assert.deepEqual(listFilters(LIST_DEFAULTS), { status: ['Open', 'Occupied', 'Assigned', 'Added Info', 'In Kontakt', 'Awaiting', 'Halted', 'In Test'], type: [], excludeType: undefined, priority: [], search: undefined, limit: 10 })
|
||||||
assert.deepEqual(listFilters({ ...LIST_DEFAULTS, tab: 'alle', typeId: 'Akquise', urgentOnly: true, search: 'abc' }), { status: [], type: ['Akquise'], excludeType: undefined, priority: [3, 4], search: 'abc', limit: 10 })
|
assert.deepEqual(listFilters({ ...LIST_DEFAULTS, tab: 'alle', typeId: 'Akquise', urgentOnly: true, search: 'abc' }), { status: [], type: ['Akquise'], excludeType: undefined, priority: [3, 4], search: 'abc', limit: 10 })
|
||||||
assert.deepEqual(listFilters({ ...LIST_DEFAULTS, tab: 'done' }).status, ['Closed', 'Zugesagt'])
|
assert.deepEqual(listFilters({ ...LIST_DEFAULTS, tab: 'done' }).status, ['Closed', 'Zugesagt'])
|
||||||
const s = { ...LIST_DEFAULTS, typeId: 'Webpage', urgentOnly: true, search: 'zzz', limit: 80 }
|
const s = { ...LIST_DEFAULTS, typeId: 'Webpage', urgentOnly: true, search: 'zzz', limit: 80 }
|
||||||
@@ -39,6 +39,14 @@ test('listFilters und countFilters', () => {
|
|||||||
for (const t of LIST_TABS) assert.deepEqual(countFilters(s, t.id).status, listFilters({ ...s, tab: t.id }).status, t.id)
|
for (const t of LIST_TABS) assert.deepEqual(countFilters(s, t.id).status, listFilters({ ...s, tab: t.id }).status, t.id)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
test('Standardansicht zeigt alle Arten, auch Akquise', () => {
|
||||||
|
assert.equal(LIST_DEFAULTS.typeId, 'all')
|
||||||
|
assert.equal(parse('').typeId, 'all')
|
||||||
|
assert.equal(ser({ ...LIST_DEFAULTS }).get('art'), null)
|
||||||
|
assert.equal(parse(ser({ ...LIST_DEFAULTS, typeId: 'orders' })).typeId, 'orders')
|
||||||
|
assert.deepEqual(listFilters({ ...LIST_DEFAULTS, typeId: 'orders' }).excludeType, 'Akquise')
|
||||||
|
})
|
||||||
|
|
||||||
test('woid-Umleitung hat Vorrang', () => {
|
test('woid-Umleitung hat Vorrang', () => {
|
||||||
assert.equal(woidRedirectTarget('?woid=100131'), '/tickets/100131')
|
assert.equal(woidRedirectTarget('?woid=100131'), '/tickets/100131')
|
||||||
assert.equal(woidRedirectTarget('?woid=%20100131%20&status=done&q=x'), '/tickets/100131')
|
assert.equal(woidRedirectTarget('?woid=%20100131%20&status=done&q=x'), '/tickets/100131')
|
||||||
|
|||||||
Reference in new issue
Block a user