Chore: regenerate generated types v2 - #988
Chisomchima wants to merge 17 commits into
Conversation
✅ Deploy Preview for dhis2-maintenance-app-beta ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Reverts 81e8c55, unrelated to the type regeneration work on this branch.
…nerated-types-v2 # Conflicts: # i18n/en.pot # src/lib/sectionList/filters/filterConfig.tsx
|
tomzemp
left a comment
There was a problem hiding this comment.
Looks great @Chisomchima! Thanks for going through all these updates! I have a couple small questions I've left in comments.
Additionally, my more major question / observation is that a lot of these changes seem to update the type definitions to point to newly created types. That makes sense, but the existing references we had already point to those updated types.
e.g.
we replace Attribute.valueType with ValueType (which I assume is new). But looking at the type definition for Attribute, Attribute.valueType already points to the ValueType type.
I'm not sure it's worth it to point directly to the types if our existing definition will already point to them indirectly 🤔. I feel like Attribute.valueType is more readable, so I'd be happy to keep that (and similar) unless there's some limitation. Thoughts?
The generated required flag comes from dhis2-open-api-ts' setPropertiesRequired transformer, not the OpenAPI spec (confirmed with Jan Bernitt). The API accepts a period entry with only a period reference, so revert the form to allow that.
- CurrentUser.avatar and DataInputPeriod dates: optional per spec (setPropertiesRequired artifact); removes the avatar test hacks - keySmsSetting: restore real SmsConfiguration shape (Configuration was the wrong type) - SharingSettings.external optional (not in spec); removes the SharingSettings casts - revert unrelated Prettify drift in utility.ts - useOnSubmitEditWithGroups: constrain to ModelWithAttributeValues, drop double-cast - trim over-verbose comments
Reverted 9 files to master and reduced 1 spec file to the enum rename only. Verified each is unnecessary: tsc --noEmit and the full suite pass with these at master. The generated types resolve fine without the extra hand-types/casts: - DataSetSectionForm, CategoriesSelector, EditTrackerProgram, EnrollmentDataFormContents: PickWithFieldFilters resolves these - NextScheduleDateField, relationshipTypes/TrackedEntityAttributesField: casts not needed - validationNotificationTemplates Clone/New: rename churn - programIndicators/Form.spec, dataSetNotificationTemplates/Form.spec: keep only the forced enum rename
Fresh regen from play.im.dhis2.org/dev?expandedRefs=true. Diff vs the previous regen is spec drift since 2026-07: favorite/favorites removed from identifiable objects, ErrorCode gained members, new EventDataValue/UserSessionInfo types, Event/TrackedEntity label fields. The two documented hand-corrections (DataInputPeriod dates, CurrentUser.avatar -> optional) are re-applied. 0 tsc errors, full suite green.
|



Summary
Regenerates
src/types/generated/models.tsfromplay.im.dhis2.org/devwith?expandedRefs=true