Skip to content

TICKET-578: Remove instructor from course#7808

Open
Naragod wants to merge 7 commits intomasterfrom
TICKET-578_remove_instructor_from_course
Open

TICKET-578: Remove instructor from course#7808
Naragod wants to merge 7 commits intomasterfrom
TICKET-578_remove_instructor_from_course

Conversation

@Naragod
Copy link
Contributor

@Naragod Naragod commented Jan 31, 2026

Proposed Changes

We wish to allow administrators to remove instructors as easily as they are able to remove graders.

Screenshots of your changes (if applicable)
Associated documentation repository pull request (if applicable)

Type of Change

(Write an X or a brief description next to the type or types that best describe your changes.)

Type Applies?
🚨 Breaking change (fix or feature that would cause existing functionality to change)
New feature (non-breaking change that adds functionality) X
🐛 Bug fix (non-breaking change that fixes an issue)
🎨 User interface change (change to user interface; provide screenshots)
♻️ Refactoring (internal change to codebase, without changing functionality)
🚦 Test update (change that only adds or modifies tests)
📦 Dependency update (change that updates a dependency)
🔧 Internal (change that only affects developers or continuous integration)

Checklist

(Complete each of the following items for your pull request. Indicate that you have completed an item by changing the [ ] into a [x] in the raw text, or by clicking on the checkbox in the rendered description on GitHub.)

Before opening your pull request:

  • I have performed a self-review of my changes.
    • Check that all changed files included in this pull request are intentional changes.
    • Check that all changes are relevant to the purpose of this pull request, as described above.
  • I have added tests for my changes, if applicable.
    • This is required for all bug fixes and new features.
  • I have updated the project documentation, if applicable.
    • This is required for new features.
  • If this is my first contribution, I have added myself to the list of contributors.

After opening your pull request:

  • I have updated the project Changelog (this is required for all changes).
  • I have verified that the pre-commit.ci checks have passed.
  • I have verified that the CI tests have passed.
  • I have reviewed the test coverage changes reported by Coveralls.
  • I have requested a review from a project maintainer.

Questions and Comments

(Include any questions or comments you have regarding your changes.)

@Naragod Naragod added this to the v2.9.2 milestone Jan 31, 2026
@Naragod Naragod requested a review from donny-wong January 31, 2026 23:24
@Naragod Naragod force-pushed the TICKET-578_remove_instructor_from_course branch from 088c478 to b6c301d Compare February 1, 2026 00:04
Copy link
Contributor

@donny-wong donny-wong left a comment

Choose a reason for hiding this comment

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

Good job. Please provide a confirmation message before deleting the instructor, as that would prevent accidental deletion. Thank you.

@Naragod
Copy link
Contributor Author

Naragod commented Feb 2, 2026

Good job. Please provide a confirmation message before deleting the instructor, as that would prevent accidental deletion. Thank you.

Good idea.

@Naragod Naragod requested a review from donny-wong February 3, 2026 16:09
@Naragod Naragod force-pushed the TICKET-578_remove_instructor_from_course branch from 87c2177 to f609aba Compare February 3, 2026 16:10
@Naragod Naragod modified the milestones: v2.9.2, v2.9.3 Feb 3, 2026
@coveralls
Copy link
Collaborator

coveralls commented Feb 3, 2026

Pull Request Test Coverage Report for Build 21698690120

Details

  • 97 of 98 (98.98%) changed or added relevant lines in 7 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.01%) to 91.696%

Changes Missing Coverage Covered Lines Changed/Added Lines %
app/javascript/Components/instructor_table.jsx 9 10 90.0%
Totals Coverage Status
Change from base Build 21688899174: 0.01%
Covered Lines: 44614
Relevant Lines: 47845

💛 - Coveralls

@Naragod Naragod force-pushed the TICKET-578_remove_instructor_from_course branch from f609aba to 3c5699b Compare February 3, 2026 18:43
Add the ability for administrators to remove instructors from a course.

- Add destroy route for instructors resource
- Add destroy action to InstructorsController with error handling
- Add destroy? policy rule restricted to admin users
- Add dependent declarations to Instructor model for safe deletion
  (nullify annotations, restrict on notes, destroy tags/split_pdf_logs)
- Add i18n flash messages for destroy success/error/restricted
- Add trash icon to instructor table, visible only to admin users
- Add removeInstructor method that sends DELETE and refreshes table
- Pass is_admin prop from view based on current_user.admin_user?
Controller specs:
- Unauthorized (non-admin) user gets 403
- Destroy failure returns bad_request with error flash
- Instructor with notes is restricted (conflict)
- Successful deletion with cascade checks (annotations nullified, tags destroyed)

Policy specs:
- End user is denied destroy access
- Admin user is allowed destroy access

Frontend specs:
- Remove button visible when is_admin is true
- Remove button hidden when is_admin is false or unset
- DELETE request sent to correct endpoint on click
@Naragod Naragod force-pushed the TICKET-578_remove_instructor_from_course branch from 3c5699b to 56f9b9a Compare February 5, 2026 04:23
@Naragod Naragod requested a review from david-yz-liu February 5, 2026 04:24
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