Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 20, 2025

Summary of changes

  • Converted hardcoded admin-only broken link filtering to a boolean sidebar facet (include_broken_links)
  • Removed special privilege check from searchable.rb
  • Added filter UI to Events and Materials sidebars following the pattern of include_expired and include_disabled
  • Added documentation for the include_broken_links query parameter in the OpenAPI specs (public/api/definitions/tess.yml)

Motivation and context

Fixes #1176

Previously, resources with broken links were automatically hidden via a hardcoded Solr facet in searchable.rb (lines 108-113) unless the user was an admin. This made broken links invisible and undiscoverable to regular users.

The new implementation:

  • Adds include_broken_links as a special facet in lib/facets.rb applicable to models with link_monitor
  • Filters by the existing failing boolean field in Solr
  • Defaults to hiding broken links (preserves existing behavior)
  • Exposes toggle control to all users in the sidebar
  • Documents the API query parameter for /events and /materials endpoints

Screenshots

(N/A - UI change follows existing toggle pattern)

Checklist

  • I have read and followed the CONTRIBUTING guide.
  • I confirm that I have the authority necessary to make this contribution on behalf of its copyright owner and agree
    to license it to the TeSS codebase under the
    BSD license.
Original prompt

This section details on the original issue you should resolve

<issue_title>Add filter to show events and materials with broken links</issue_title>
<issue_description>Currently, events and materials with broken links are hidden using a solr facet that is always applied (unless you are an admin):

without(:failing, true)

Replace this with a boolean facet in the sidebar, as we do for include_expired and include_hidden.</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: fbacall <503373+fbacall@users.noreply.github.com>
Copilot AI changed the title [WIP] Add filter to show events and materials with broken links Replace admin-only broken link filter with user-accessible sidebar toggle Nov 20, 2025
Copilot AI requested a review from fbacall November 20, 2025 10:56
Copy link
Member

@fbacall fbacall left a comment

Choose a reason for hiding this comment

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

@copilot can you add documentation for this filter in the OpenAPI specs: public/api/definitions/tess.yml ?

Copy link
Member

@fbacall fbacall left a comment

Choose a reason for hiding this comment

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

@copilot can you add documentation for this filter in the OpenAPI specs: public/api/definitions/tess.yml ?

…terials

Co-authored-by: fbacall <503373+fbacall@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Nov 25, 2025

@copilot can you add documentation for this filter in the OpenAPI specs: public/api/definitions/tess.yml ?

Added documentation for the include_broken_links filter to the OpenAPI specs for both /events and /materials endpoints in commit 69d742f.

Copilot AI requested a review from fbacall November 25, 2025 15:38
@fbacall fbacall marked this pull request as ready for review November 25, 2025 16:12
@fbacall fbacall merged commit 2e91dc1 into master Dec 3, 2025
17 checks passed
@fbacall fbacall deleted the copilot/add-filter-for-broken-links branch December 3, 2025 11:39
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.

Add filter to show events and materials with broken links

2 participants