Skip to content

Conversation

@RichDom2185
Copy link
Member

Description

Relevant backend PR: source-academy/backend#1053 (must be merged before this can be merged)

Please refer to commits for full list of changes.

Allows stories state (enabled/disabled) to be configured on a per-course basis. When it is disabled, the frontend won't attempt to contact the stories backend for that particular course, thus removing the cause of the 404 error.

Also moves stories' routes under /courses/:courseId, since it is now course-dependent.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update
  • Code quality improvements

How to test

Everything still works.

Checklist

  • I have tested this code
  • I have updated the documentation

* Update persistence, types
* Create toggle switches
* Update navigation bar for selective rendering
* Update stories routes to be under "/courses/:courseId"
* Add loader to stories routes
Only contact the stories backend when stories are enabled in the current
course configuration.
@RichDom2185 RichDom2185 self-assigned this Jan 16, 2024
@coveralls
Copy link

coveralls commented Jan 16, 2024

Pull Request Test Coverage Report for Build 7766771400

  • -10 of 24 (58.33%) changed or added relevant lines in 7 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.02%) to 37.203%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/commons/dropdown/DropdownCreateCourse.tsx 0 1 0.0%
src/features/stories/StoriesReducer.ts 0 1 0.0%
src/pages/academy/adminPanel/subcomponents/CourseConfigPanel.tsx 0 1 0.0%
src/pages/stories/Stories.tsx 0 1 0.0%
src/commons/sagas/BackendSaga.ts 12 18 66.67%
Totals Coverage Status
Change from base Build 7734898758: 0.02%
Covered Lines: 5732
Relevant Lines: 14471

💛 - Coveralls

Also adds the dispatch logic to previously missed action handlers.
Copy link
Contributor

@sayomaki sayomaki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, requested changes have been fixed as discussed in person. Thanks!

Currently waiting for backend PR to merge before we proceed to merge this.

@RichDom2185
Copy link
Member Author

LGTM, requested changes have been fixed as discussed in person. Thanks!

Currently waiting for backend PR to merge before we proceed to merge this.

Backend PR has been merged! I'll set this to merge on successful CI. Thanks!

@RichDom2185 RichDom2185 enabled auto-merge (squash) February 3, 2024 12:15
@RichDom2185 RichDom2185 merged commit 8896343 into master Feb 3, 2024
@RichDom2185 RichDom2185 deleted the toggle-stories branch February 3, 2024 12:20
CYX22222003 pushed a commit to CYX22222003/frontendCYX that referenced this pull request Feb 9, 2024
…-course (source-academy#2721)

* Add `enableStories` field to course config

* Update persistence, types
* Create toggle switches

* Use relative route paths for stories components

* Only render Stories button when enabled for course

* Update navigation bar for selective rendering
* Update stories routes to be under "/courses/:courseId"
* Add loader to stories routes

* Fix spurious 404 errors

Only contact the stories backend when stories are enabled in the current
course configuration.

* Create wrapper action to clear stories state

* Handle stories state change on course config change

* Update failing snapshots

* Move clearing logic to BackendSaga

Also adds the dispatch logic to previously missed action handlers.
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.

4 participants