Skip to content

Fix: Declare course globals under _components where the plugin reads them (fixes #55) - #56

Open
taylortom wants to merge 1 commit into
masterfrom
issue/55
Open

taylortom wants to merge 1 commit into
masterfrom
issue/55

Conversation

@taylortom

Copy link
Copy Markdown
Member

Fixes #55

Fix

  • schema/course.schema.json: declare the course globals at _globals._components._youtube, where the template and core read them, instead of _globals._youtube
  • migrations/v3.js: add a migration that moves an existing flat _globals._youtube into _globals._components._youtube, merging with any nested values (the flat values win, as they are the ones that were edited), then removes the flat key. Courses without a flat _globals._youtube are left unchanged

Testing

  1. Copy the plugin into a framework's src/components and run grunt migration:test --file=adapt-youtube; all adapt-youtube tests pass, including the new ones (flat only; flat plus nested; nested only; no globals; plugin not installed)
  2. Run the migration on a course whose course.json has _globals._youtube.skipToTranscript set: the value moves to _globals._components._youtube.skipToTranscript and _globals._youtube is removed
  3. Validate a course with _globals._components._youtube values against the updated schema: the values are kept

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

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Course globals are declared where the framework does not read them

1 participant