feat: custom fields per project
Text, number, date or option-list fields defined in the project settings (archived, never removed; their type is fixed once saved). Tickets hold them, edited in the side panel, listed under the title and filtered by option in the list view; also over GraphQL, REST (?field=ID:value) and MCP. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import {
|
||||
CustomFieldType,
|
||||
ProjectSettings,
|
||||
SettingColor,
|
||||
StatusCategory,
|
||||
@@ -26,11 +27,20 @@ export interface SettingsPayload {
|
||||
template?: { description?: string | null; checklist?: string[] } | null;
|
||||
}[];
|
||||
areas: { id: string; name: string; archived: boolean }[];
|
||||
/** Absent when saving: unchanged. */
|
||||
customFields?: {
|
||||
id: string;
|
||||
name: string;
|
||||
type: string;
|
||||
options?: string[];
|
||||
archived: boolean;
|
||||
}[];
|
||||
}
|
||||
|
||||
export function toSettingsPayload(settings: ProjectSettings): SettingsPayload {
|
||||
return {
|
||||
...settings,
|
||||
customFields: settings.customFields ?? [],
|
||||
transitions: settings.statuses.map((s) => ({
|
||||
from: s.id,
|
||||
to: settings.transitions[s.id] ?? [],
|
||||
@@ -62,5 +72,14 @@ export function fromSettingsPayload(payload: SettingsPayload): ProjectSettings {
|
||||
: {}),
|
||||
})),
|
||||
areas: payload.areas,
|
||||
...(payload.customFields
|
||||
? {
|
||||
customFields: payload.customFields.map((f) => ({
|
||||
...f,
|
||||
type: f.type as CustomFieldType,
|
||||
options: f.options ?? [],
|
||||
})),
|
||||
}
|
||||
: {}),
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user