Skip to content

feat: navigation scope filter for TA with manage-submissions#8046

Open
YheChen wants to merge 16 commits into
MarkUsProject:masterfrom
YheChen:feat/toggle-filter-manage-submissions
Open

feat: navigation scope filter for TA with manage-submissions#8046
YheChen wants to merge 16 commits into
MarkUsProject:masterfrom
YheChen:feat/toggle-filter-manage-submissions

Conversation

@YheChen

@YheChen YheChen commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Proposed Changes

(Describe your changes here. Also describe the motivation for your changes: what problem do they solve, or how do they improve the application or codebase? If this pull request fixes an open issue, use a keyword to link this pull request to the issue.)

Ref #6424

This PR adds a navigation-scope filter for TAs who have the manage submissions permission.

Previously, result-page navigation for TAs was scoped to their assigned submissions. With this change, TAs who can manage submissions can choose whether result navigation should include:

  • only submissions assigned to them
  • all submissions for the assignment

The new option appears in the result filter modal as “Only assigned submissions” under “Navigation Scope”. It is shown only to TAs with manage-submissions permission. TAs without that permission remain restricted to assigned submissions, and instructors are unaffected.

This PR also:

  • exposes can_manage_submissions in result JSON data
  • persists and normalizes the new filter option in local storage
  • updates grouping navigation/filtering logic to respect the new scope
  • adds frontend, controller, and model tests for the new behavior
Screenshots of your changes (if applicable) image

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) x
♻️ Refactoring (internal change to codebase, without changing functionality)
🚦 Test update (change that only adds or modifies tests)
📦 Dependency update (change that updates a dependency)
📖 Documentation update (change that updates documentation)
🔧 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.)

@YheChen YheChen changed the title WIP: feat: toggle filter manage submissions WIP: feat: navigation scope filter for manage-submissions TA Jul 6, 2026
@YheChen YheChen changed the title WIP: feat: navigation scope filter for manage-submissions TA WIP: feat: navigation scope filter for TA with manage-submissions Jul 6, 2026
@coveralls

coveralls commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator

Coverage Report for CI Build 28990118433

Coverage increased (+0.01%) to 90.299%

Details

  • Coverage increased (+0.01%) from the base build.
  • Patch coverage: 75 of 75 lines across 6 files are fully covered (100%).
  • No coverage regressions found.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 51091
Covered Lines: 47147
Line Coverage: 92.28%
Relevant Branches: 2450
Covered Branches: 1200
Branch Coverage: 48.98%
Branches in Coverage %: Yes
Coverage Strength: 127.34 hits per line

💛 - Coveralls

@YheChen YheChen changed the title WIP: feat: navigation scope filter for TA with manage-submissions feat: navigation scope filter for TA with manage-submissions Jul 7, 2026
@YheChen YheChen requested a review from david-yz-liu July 7, 2026 03:32

@david-yz-liu david-yz-liu left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@YheChen nice work, I left a few comments. Also modify the PR description to replace "Closes" with "Ref". This PR alone does not close the issue, as there's two parts involved.

if (!this.state.prefetchedIds || this.shouldRefetchIds()) {
this.fetchGroupingIds();
}
this.refreshFilterData(() => {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Revert this change, it is not related to this PR

}
};

normalizeFilterData = filterData => {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Revert this change; it's unrelated to this PR

Comment thread app/models/grouping.rb Outdated
results
end

def filter_to_assigned_groupings?(current_role, filter_data)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

inline this function. You can also modify the logic to use an allowed_to? with :manage_submissions

Comment thread Changelog.md Outdated
### 🚨 Breaking changes

### ✨ New features and improvements
- Added a submissions table toggle that lets TAs with manage submissions permission view all submissions or only assigned submissions (#8047)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This changelog entry is incorrect

Comment thread webpack.common.js Outdated
new webpack.ProvidePlugin({
$: "jquery",
jQuery: "jquery",
React: "react",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Revert this change

Comment thread config/locales/views/results/en.yml Outdated
add_criterion: Add Criterion Filter
assigned_submissions_only: Only assigned submissions
invalid_range: Invalid Range
navigation_scope: Navigation Scope

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Rename this to "Submission Scope" (I don't think "Navigation" is helpful here, as the entire filter modal is about modifying navigation)

<div className={"filter"} data-testid={"assigned-graders-only"}>
<p>{I18n.t("results.filters.navigation_scope")}</p>
<div className={"assigned-graders-only-toggle"}>
<input

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Rather than have a checkbox, I'd like to see to radio buttons with labels "My assigned submissions" and "All submissions".

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.

3 participants