Skip to content

Conversation

@Bahati308
Copy link
Contributor

@Bahati308 Bahati308 commented Feb 8, 2026

feat(formulus): support AnthroCollect ranking renderer

Summary

Adds support for the AnthroCollect ranking renderer in Formulus/ODE so the demo_ranking field in p_ranking_female and p_ranking_male uses the custom ranking renderer instead of the default text renderer.

Changes

1. FormContext for custom renderers

  • Extended FormContext with formulusApi and formParams
  • formulusApi: Formulus API instance for calls like anthroData.getPersonsByScopeAndFilter()
  • formParams: form parameters (p_id, scope, age_min, age_max) from openFormplayer(formType, params, savedData)
  • Exposed FormContext on window.__formplayerFormContext so extension renderers can access it

2. testerModule support

  • Added testerModule so renderers can have the tester in a separate file
  • Implemented in ExtensionService, FormplayerModal, ExtensionsLoader, and FormulusInterfaceDefinition
  • Enables a setup like: renderer in RankingRenderer.jsx, tester in rankingTester.js

3. Formulus API and form params wiring

  • Load formulusApi via window.getFormulus() when the formplayer initializes
  • Pass formParams from formInitData.params into the form context
  • Ensures openFormplayer('p_ranking_female', { p_id, scope, age_min, age_max }, savedData) passes these values to the ranking renderer

4. Documentation

  • Documented the ranking renderer setup in EXTENSION_IMPLEMENTATION.md (ext.json layout, FormContext usage, UI schema, form params)

5. Other fixes(were blocking)

  • ESLint fixes (unused vars, types, hook deps)
  • Prettier config switched from ESM to .cjs to avoid config-loading warnings
  • ESLint globalIgnores updated to skip prettier.config.cjs
  • Relaxed ExtensionFunction type so built-in and extension functions are compatible

@najuna-brian
Copy link
Contributor

Thanks @Bahati308
May be some PR description 😄 ?

@Bahati308
Copy link
Contributor Author

Thanks @Bahati308 May be some PR description 😄 ?

Ooh sorry for the delay, it was still WIP. It is having a detailed description now 💯

@Bahati308
Copy link
Contributor Author

NOTE: This PR supports implementation of this from AnthroCollect

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants