Allow artworks to have one primary category and extra secondaries.

Keep artwork_category as membership, store a deterministic primary_category_id, and let upload plus studio pick up to five additional same-type categories without changing canonical URLs.
This commit is contained in:
test
2026-09-20 14:50:12 +02:00
parent 4d60a876af
commit 232880e01f
43 changed files with 2896 additions and 565 deletions
@@ -347,6 +347,30 @@ describe('UploadWizard step flow', () => {
expect(window.axios.post).not.toHaveBeenCalledWith('/api/uploads/session-1/publish', expect.anything(), expect.anything())
})
it('shows additional categories alphabetically after the primary path is chosen', async () => {
installAxiosStubs({ statusValue: 'ready' })
await renderWizard({
initialDraftId: 318,
contentTypes: [{
id: 1,
name: 'Art',
categories: [
{ id: 10, name: 'Root', children: [{ id: 11, name: 'Sub' }, { id: 14, name: 'Zebra' }] },
{ id: 12, name: 'Apple', children: [{ id: 13, name: 'City' }] },
],
}],
})
await completeStep1ToReady()
expect(await screen.findByText(/artwork details/i)).not.toBeNull()
await completeRequiredDetails({ title: 'My Art' })
const extraHeading = await screen.findByText(/additional categories/i)
const extraSection = extraHeading.closest('div')?.parentElement
const extraNames = Array.from(extraSection?.querySelectorAll('button') || []).map((button) => button.textContent?.trim())
expect(extraNames).toEqual(['Apple', 'City', 'Root', 'Zebra'])
})
it('hides the mature content checkbox in the details step', async () => {
installAxiosStubs({ statusValue: 'ready' })
await renderWizard({ initialDraftId: 311, contentTypes: [{ id: 1, name: 'Art', categories: [{ id: 10, name: 'Root', children: [{ id: 11, name: 'Sub' }] }] }] })