Repository navigation
fix: align plugin prop types with the Capture app - #11
Merged
Merged
Conversation
- Plugin.types.ts now matches the props Capture passes: add orgUnitId and viewMode, add code and attributes to field metadata, drop id (Capture strips it) and drop options from setContextFieldValue (Capture ignores it) - use pluginType CAPTURE_FORM_FIELD and remove the "verify plugin type" todo Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Dec 1, 2026
Draft
Draft
Merged
KaiVandivier
approved these changes
Dec 2, 2026
kabaros
marked this pull request as ready for review
December 3, 2026 08:08
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Plugin.types.tsis the shape many developers copy, but it doesn't match what Capture passes to form field plugins (FormFieldPlugin.types.tsin capture-app).Changes
Plugin.types.ts:orgUnitIdandviewMode.codeandattributesto the field metadata.idfrom the field metadata, because Capture strips it.optionsfromsetContextFieldValue, because Capture ignores it.d2.config.js: setpluginType: 'CAPTURE_FORM_FIELD'(the new convention; Capture doesn't read it) and remove the "verify plugin type" TODO.Testing
Tests pass. As before this change, you need to run
d2-app-scripts i18n generatefirst.Related PRs
Part of a set that makes DHIS2 plugins (Capture form field / enrollment / bulk data entry, Dashboard) easier to build, and brings the docs in line with what the host apps actually pass:
<Plugin>custom props,experimentaltypes undernoderesolution@/aliases and@dhis2/app-runtime/experimentalpnpm create @dhis2/app --template plugin --pluginType <type>dhis2-pluginsagent skill🤖 Generated with Claude Code