diff --git a/frontend/src/components/InitiativeForm.jsx b/frontend/src/components/InitiativeForm.jsx index 515dc4d..37c8455 100644 --- a/frontend/src/components/InitiativeForm.jsx +++ b/frontend/src/components/InitiativeForm.jsx @@ -8,10 +8,7 @@ import { getInitiativeFields, listArchetypeFieldDefinitions, } from '../api/entityFields.js' -import { listSteeringMethods } from '../api/steering.js' -import { listMethodProfiles } from '../api/methodProfiles.js' import { FieldRenderer } from './FieldRenderer.jsx' -import { InitiativeSteeringMeta } from './InitiativeSteeringMeta.jsx' export function InitiativeForm({ initial = {}, @@ -26,42 +23,6 @@ export function InitiativeForm({ const [fieldDefinitions, setFieldDefinitions] = useState([]) const [dynamicValues, setDynamicValues] = useState({}) const [fieldsLoading, setFieldsLoading] = useState(false) - const [steeringMethods, setSteeringMethods] = useState([]) - const [methodProfiles, setMethodProfiles] = useState([]) - const [methodProfileKey, setMethodProfileKey] = useState('') - - useEffect(() => { - let cancelled = false - listSteeringMethods() - .then((items) => { - if (!cancelled) setSteeringMethods(Array.isArray(items) ? items : []) - }) - .catch(() => { - if (!cancelled) setSteeringMethods([]) - }) - return () => { - cancelled = true - } - }, []) - - useEffect(() => { - let cancelled = false - setMethodProfileKey('') - if (!archetypeKey) { - setMethodProfiles([]) - return undefined - } - listMethodProfiles(archetypeKey) - .then((items) => { - if (!cancelled) setMethodProfiles(Array.isArray(items) ? items : []) - }) - .catch(() => { - if (!cancelled) setMethodProfiles([]) - }) - return () => { - cancelled = true - } - }, [archetypeKey]) useEffect(() => { let cancelled = false @@ -130,7 +91,6 @@ export function InitiativeForm({ status: form.status.value, priority: form.priority.value, dynamicFields: dynamicValues, - ...(methodProfileKey ? { method_profile_key: methodProfileKey } : {}), }) } @@ -139,6 +99,7 @@ export function InitiativeForm({ } const formReady = archetypes && !fieldsLoading + const selectedArchetype = (archetypes || []).find((item) => item.key === archetypeKey) return (
@@ -160,31 +121,10 @@ export function InitiativeForm({ ))} + {selectedArchetype?.description && ( + {selectedArchetype.description} + )} - {methodProfiles.length > 0 && ( - - )} -