feat: templates per ticket type

Each ticket type can carry a starting description and a checklist, edited
in the project settings. New tickets of that type get the description
when they come without one and always get the checklist; the new ticket
form says what the template will add.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-08 15:58:37 +02:00
parent 8994590b54
commit 5863d773be
23 changed files with 565 additions and 9 deletions

View File

@@ -99,6 +99,29 @@ describe('Project settings', () => {
);
});
it('keeps a template per type, only when it says something', () => {
const project = newProject();
const settings = defaultProjectSettings();
settings.issueTypes[0].template = {
description: ' ## Pasos para reproducir ',
checklist: [' Probar en Safari ', ''],
};
settings.issueTypes[1].template = { description: ' ', checklist: [] };
project.updateSettings('owner', settings);
expect(project.workflow.templateOf('BUG')).toEqual({
description: '## Pasos para reproducir',
checklist: ['Probar en Safari'],
});
expect(project.workflow.templateOf('FEATURE')).toBeNull();
const tooLong = defaultProjectSettings();
tooLong.issueTypes[0].template = {
description: null,
checklist: Array.from({ length: 21 }, (_, i) => `Paso ${i}`),
};
expect(() => project.updateSettings('owner', tooLong)).toThrow(/plantilla/);
});
it('keeps work-in-progress limits, from 1 to 999', () => {
const project = newProject();
const limited = defaultProjectSettings();