feat(G-08): chapter field uses live datalist from resource.chapters
All chapter text inputs now show autocomplete suggestions from the database (distinct chapter values from active resources) via HTML <datalist> wired to trpc.resource.chapters: - ResourceModal: chapter input - RateCardsClient: rate card line chapter input - EffortRulesClient: effort rule chapter input - ExperienceMultipliersClient: replaces hardcoded CHAPTER_PRESETS with live data, falls back to presets when no data available Also revert blueprintRolePresetsInputSchema to z.array(z.unknown()) to restore compatibility with StaffingRequirement[] call sites. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -203,6 +203,7 @@ export function ResourceModal({ mode, resource, onClose, onSuccess }: ResourceMo
|
||||
const { canManageUsers } = usePermissions();
|
||||
const utils = trpc.useUtils();
|
||||
|
||||
const { data: chapters } = trpc.resource.chapters.useQuery(undefined, { staleTime: 60_000 });
|
||||
const { data: availableRoles } = trpc.role.list.useQuery(
|
||||
{ isActive: true },
|
||||
{ staleTime: 60_000 },
|
||||
@@ -441,7 +442,11 @@ export function ResourceModal({ mode, resource, onClose, onSuccess }: ResourceMo
|
||||
placeholder="Engineering"
|
||||
value={form.chapter}
|
||||
onChange={(e) => setField("chapter", e.target.value)}
|
||||
list="rm-chapter-list"
|
||||
/>
|
||||
<datalist id="rm-chapter-list">
|
||||
{chapters?.map((c) => <option key={c} value={c} />)}
|
||||
</datalist>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user