Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rework the Course Settings #106

Closed
wants to merge 46 commits into from

Conversation

pstaabp
Copy link
Sponsor Member

@pstaabp pstaabp commented Aug 2, 2022

This reworks the way course settings are handled on the back end. Specifically

  • store the global/default course settings in the database
  • store the override course settings as a single row in a table (much simpler than the old method)

There are new routes for fetching/updating/deleting global and course settings.

Because of this, the settings modules on the front end side changes to reflect the back end changes. Including

  • inheriting from the Model class for both global settings and course settings (overrides)
  • in the settings store, the global_settings and db_course_settings are stored separately (similar to other data in the stores) and then merged.

There are a lot more tests now including

  • t/db/002_course_settings.t is rewritten to reflect the new course settings back end database model.
  • t/mojolicious/015_course_settings.t is a new to test all of the routes
  • tests/unit-tests/settings.ts tests the new model and handling of exceptions.
  • tests/stores/settings.ts tests the settings store.

The UI is mostly unchanged except for using some new store getters and now has the ability to save course settings.

To test

  • run t/db/build_db.pl
  • prove -r t
  • npm run test
  • npm run test-store
  • The UI--mainly the Settings view as an instructor. Changes are sent immediately to the database and you should see a confirmation notification.

Note: I think GitHub is not accurately managing the changes. A git diff between this and main is 20 files, mostly related to settings.

pstaabp added 30 commits May 16, 2022 06:26
…store and set to the database.

TEST: adding tests to ensure that only valid models are added to the store and set to the database.
FIX: cleanup and using true/false in tests.
@pstaabp
Copy link
Sponsor Member Author

pstaabp commented Aug 6, 2022

Closing this since #108 is identical and has been rebased onto main.

@pstaabp pstaabp closed this Aug 6, 2022
@pstaabp pstaabp deleted the course-settings-work branch August 9, 2022 20:04
This was referenced Aug 22, 2022
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.

None yet

1 participant