[Feature:InstructorUI] GUI for instructors to archive course#12453
Conversation
…y for modification added
|
The text you have next to archive course is incorrect. |
|
@bmcutler do you think things like converting files to read only and backing up data should also be mentioned in the instructions so that instructor can take appropriate actions? |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #12453 +/- ##
============================================
- Coverage 21.48% 21.48% -0.01%
- Complexity 9842 9851 +9
============================================
Files 268 268
Lines 36851 36888 +37
Branches 495 495
============================================
+ Hits 7919 7924 +5
- Misses 28441 28473 +32
Partials 491 491
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
| return MultiResponse::JsonOnlyResponse( | ||
| JsonResponse::getSuccessResponse([ | ||
| 'message' => 'Course archived successfully' | ||
| ]) | ||
| ); |
There was a problem hiding this comment.
You should just return JsonResponse::getSuccessResponse() directly
|
Added new changes to incorporate feedback |
|
Fix: all linters now pass, cypress test fails on (Feature, Gradeable), but those are unrelated to the files I've modified so it might be a flaky test? |
|
The CSS lint is failing due to an issue that was fixed on the main branch, so if you merge main into your PR that should pass. Also, the title module isn't passing the documentation tests. Also, yes one of the gradeable tests is currently failing on main, and will be fixed soon. |
Eli-J-Schwartz
left a comment
There was a problem hiding this comment.
I tested this locally, and it seemed to work correctly; when I toggled the button, it switched from being available to being archived. I had to manually hard reload the page to see the actual button toggle change; do you know why this happens? Also, I noticed that there seem to be some changes from unrelated PRs in this one, such as changes to course_tables.sql. Finally, please fix the failing tests.
mattLif
left a comment
There was a problem hiding this comment.
Feature works as intended, and code looks good.
| "/courses/<term>/<course>/config", | ||
| "/api/courses/<term>/<course>/config", |
There was a problem hiding this comment.
Is there a way to not add these to the performance warnings?
There was a problem hiding this comment.
Added a db query and updated ConfigurationController accordingly to reduce db queries to less than 20, let me know what you think of this approach.
There was a problem hiding this comment.
I think that is a valid approach, to combine the queries into one.
mattLif
left a comment
There was a problem hiding this comment.
Functionality still works, and changes look good. I'm approving.
Stale, comments addressed, but didn't test enough to explicitly approve.

Why is this Change Important & Necessary?
Closes #10880
What is the New Behavior?
Before, there were no ways for the instructors to archive/unarchive courses in the GUI, it had to be done through manually modifying the DB.

A new checkbox was added in the danger zone in the course configurations so that instructors can archive and unarchive courses in the configurations tab.
An unarchivable field was added to the courses table since the original issue suggests that unarchiving may cause problems due to space limitations. This field can be modified through directly modifying the DB, and once the field is set to False, the course cannot be unarchived.
What steps should a reviewer take to reproduce or test the bug or new feature?
Log in as instructor and go to course configuration to click to archive/unarchive courses
Automated Testing & Documentation
Completed manual testing of archiving and unarchiving and checked if field gets modified correspondingly.
Since UI was edited, modified PHP testing to include the new field unarchivable and all tests pass.
Other information
New migration file added to add unarchivable field to courses table