Skip to content

Move themeVariables storage from course to config #55

Description

@taylortom

Summary

The Adapt framework (PR adaptlearning/adapt_framework#3578) adds support for reading themeVariables from config.json during grunt/LESS compilation, generating both LESS variables and CSS custom properties. Currently the AAT stores these in course.themeVariables, but the framework expects them in config.json.

Changes needed

  • writeCustomLess(): Read themeVariables from config data first, fall back to course data for unmigrated courses
  • processFileVariables(): Accept variables parameter instead of reading from course.data.themeVariables
  • applyHandler() / removeHandler(): Find config record by _courseId + _type: 'config' and update it instead of the course record
  • processCustomStyling(): Accept variables parameter directly
  • Version-based LESS generation: Use semver to check framework version; skip LESS variable generation when framework handles it natively
  • Import migration: Register content migration to move course.themeVariablesconfig.themeVariables on course import
  • Add semver dependency

Backward compatibility

  • Build fallback: configData[attributeKey] || courseData[attributeKey] || {} handles unmigrated courses
  • Import migration handles old exports with themeVariables on course

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions