G1 surface homework in lesson planner UI

This commit is contained in:
2026-07-24 19:20:43 +01:00
parent c346493a34
commit 34ea1e3f08
8 changed files with 88 additions and 25 deletions
@@ -29,106 +29,112 @@ export class CCPlannedLessonNodeShapeUtil extends CCBaseShapeUtil<CCPlannedLesso
renderContent = (shape: CCPlannedLessonNodeShape) => {
const styles = getNodeStyles(shape.type)
return (
<div style={styles.container}>
<NodeProperty
<NodeProperty
label="Subject Class"
value={shape.props.subject_class}
labelStyle={styles.property.label}
valueStyle={styles.property.value}
/>
<NodeProperty
<NodeProperty
label="Date"
value={shape.props.date}
labelStyle={styles.property.label}
valueStyle={styles.property.value}
/>
<NodeProperty
<NodeProperty
label="Start Time"
value={shape.props.start_time}
labelStyle={styles.property.label}
valueStyle={styles.property.value}
/>
<NodeProperty
<NodeProperty
label="End Time"
value={shape.props.end_time}
labelStyle={styles.property.label}
valueStyle={styles.property.value}
/>
<NodeProperty
<NodeProperty
label="Period Code"
value={shape.props.period_code}
labelStyle={styles.property.label}
valueStyle={styles.property.value}
/>
<NodeProperty
<NodeProperty
label="Year Group"
value={shape.props.year_group}
labelStyle={styles.property.label}
valueStyle={styles.property.value}
/>
<NodeProperty
<NodeProperty
label="Subject"
value={shape.props.subject}
labelStyle={styles.property.label}
valueStyle={styles.property.value}
/>
<NodeProperty
<NodeProperty
label="Teacher Code"
value={shape.props.teacher_code}
labelStyle={styles.property.label}
valueStyle={styles.property.value}
/>
<NodeProperty
<NodeProperty
label="Planning Status"
value={shape.props.planning_status}
labelStyle={styles.property.label}
valueStyle={styles.property.value}
/>
<NodeProperty
<NodeProperty
label="Homework"
value={shape.props.homework}
labelStyle={styles.property.label}
valueStyle={styles.property.value}
/>
<NodeProperty
label="Topic Code"
value={shape.props.topic_code}
labelStyle={styles.property.label}
valueStyle={styles.property.value}
/>
<NodeProperty
<NodeProperty
label="Topic Name"
value={shape.props.topic_name}
labelStyle={styles.property.label}
valueStyle={styles.property.value}
/>
<NodeProperty
<NodeProperty
label="Lesson Code"
value={shape.props.lesson_code}
labelStyle={styles.property.label}
valueStyle={styles.property.value}
/>
<NodeProperty
<NodeProperty
label="Lesson Name"
value={shape.props.lesson_name}
labelStyle={styles.property.label}
valueStyle={styles.property.value}
/>
<NodeProperty
<NodeProperty
label="Learning Statement Codes"
value={shape.props.learning_statement_codes}
labelStyle={styles.property.label}
valueStyle={styles.property.value}
/>
<NodeProperty
<NodeProperty
label="Learning Statements"
value={shape.props.learning_statements}
labelStyle={styles.property.label}
valueStyle={styles.property.value}
/>
<NodeProperty
<NodeProperty
label="Learning Resource Codes"
value={shape.props.learning_resource_codes}
labelStyle={styles.property.label}
valueStyle={styles.property.value}
/>
<NodeProperty
<NodeProperty
label="Learning Resources"
value={shape.props.learning_resources}
labelStyle={styles.property.label}
@@ -137,4 +143,4 @@ export class CCPlannedLessonNodeShapeUtil extends CCBaseShapeUtil<CCPlannedLesso
</div>
)
}
}
}
@@ -5,7 +5,8 @@ import { CCGraphShape, GraphShapeType } from './cc-graph-types'
// Helper function to create version IDs for a shape type
const createVersions = (shapeType: GraphShapeType) => {
return createShapePropsMigrationIds(shapeType, {
Initial: 1 // All shapes start at version 1 as required by TLDraw
Initial: 1, // All shapes start at version 1 as required by TLDraw
AddPlannedLessonHomework: 2,
})
}
@@ -21,6 +22,13 @@ const createMigrationSequence = (shapeType: GraphShapeType) => {
return props
},
},
...(shapeType === 'cc-planned-lesson-node' ? [{
id: versions.AddPlannedLessonHomework,
up: (props: CCGraphShape['props']) => ({
homework: '',
...props,
}),
}] : []),
],
})
}
@@ -199,6 +199,7 @@ export const ccGraphShapeProps = {
subject: T.string,
teacher_code: T.string,
planning_status: T.string,
homework: T.string,
topic_code: T.string,
topic_name: T.string,
lesson_code: T.string,
@@ -560,6 +561,7 @@ export const getDefaultCCPlannedLessonNodeProps = () => ({
subject: '',
teacher_code: '',
planning_status: '',
homework: '',
topic_code: '',
topic_name: '',
lesson_code: '',
@@ -204,6 +204,7 @@ export type CCPlannedLessonNodeProps = CCGraphShapeProps & {
subject: string
teacher_code: string
planning_status: string
homework: string
topic_code: string
topic_name: string
lesson_code: string