Skip to content

Update: Move themeVariables storage from course to config#56

Draft
taylortom wants to merge 2 commits intomasterfrom
feature/theme-variables-to-config
Draft

Update: Move themeVariables storage from course to config#56
taylortom wants to merge 2 commits intomasterfrom
feature/theme-variables-to-config

Conversation

@taylortom
Copy link
Copy Markdown
Contributor

Update

  • Read themeVariables from config record first, falling back to course for unmigrated data
  • Apply/remove preset handlers now target the config record instead of the course record
  • processFileVariables and processCustomStyling accept variables parameter directly
  • Version-based LESS generation: skip LESS variable string when framework >= 6.61.0 handles it natively
  • Register import content migration to move course.themeVariablesconfig.themeVariables on course import
  • Add semver dependency

Testing

  1. Start with npm run dev from adapt-authoring/
  2. Open theme editor, apply a preset — verify MongoDB db.content.findOne({ _type: 'config', _courseId: ... }) has themeVariables
  3. Preview/publish a course — verify config.json in build output contains themeVariables
  4. Check built CSS has expected variable overrides
  5. Test with unmigrated course data (themeVariables on course record) — build should still work via fallback
  6. Import a course with old-format themeVariables on course — verify migration moves it to config

Fixes #55
Depends on adapt-security/adapt-authoring-ui#449
Related framework PR: adaptlearning/adapt_framework#3578

@taylortom taylortom marked this pull request as draft March 6, 2026 18:12
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.

Move themeVariables storage from course to config

1 participant