Skip to content

Conversation

@fbacall
Copy link
Member

@fbacall fbacall commented Dec 11, 2025

Summary of changes

  • Sources are now tied to the space they are created in.
  • Resources ingested from a source are tied to the space of the source.
  • Allow the "view content from any space" filter to be used by anyone.
  • UI improvements to spaces index and form.
  • Simplify some policies.

Motivation and context

Allows ingestors to be used in spaces.

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.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR implements space-specific sources functionality, allowing sources to be tied to specific spaces within the TeSS platform. Resources ingested from a source now inherit the source's space, and space administrators gain the ability to manage sources within their spaces.

Key changes:

  • Sources can now be associated with a space via new space_id foreign key
  • Resources created by ingestors inherit the space from their source
  • Cross-space content filtering is now available to all users (previously admin-only)

Reviewed changes

Copilot reviewed 45 out of 45 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
db/migrate/20250807085314_add_space_id_to_sources.rb Adds space_id foreign key to sources table
db/schema.rb Updated schema with space_id column and foreign key for sources
app/models/source.rb Includes InSpace module for space association
app/models/default_space.rb Adds administrators method returning admin users
app/models/user.rb Adds has_role_in_any_space? helper method
lib/ingestors/ingestor.rb Sets space_id on ingested resources from source
lib/facets.rb Removes admin-only restriction from across_all_spaces filter
app/policies/application_policy.rb Adds helper methods for space-aware role checks (user_has_role?, scraper?)
app/policies/source_policy.rb Updates approve? to use user_has_role? helper
app/policies/content_provider_policy.rb Adds create_source? policy method
app/policies/*_policy.rb Refactors to use new helper methods from ApplicationPolicy
app/controllers/sources_controller.rb Sets space on source creation; updates authorization to use create_source?
app/controllers/*_controller.rb Changes redirect URLs from _url to _path helpers
app/mailers/curation_mailer.rb Sends source approval emails to space administrators
app/views/search/common/_facet_sidebar*.html.erb Moves cross-space filter to main sidebar (available to all)
app/views/layouts/_user_menu.html.erb Adds space admin menu items with proper permission checks
app/views/spaces/* UI improvements including theme selector and space listing
app/assets/stylesheets/* Styling updates for theme selector and block items
config/tess.example.yml Fixes missing # in green theme color code
config/locales/en.yml Updates cross-space filter text and adds current_space_admin label
test/* Comprehensive tests for space-based source permissions and functionality

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

provider = content_providers(:portal_provider)
space = spaces(:plants)

# Source has default language set
Copy link

Copilot AI Dec 11, 2025

Choose a reason for hiding this comment

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

Inaccurate comment: The comment says "Source has default language set" but this test is about setting the space from the source, not the default language. Update the comment to accurately reflect what the test is demonstrating, such as "Source has space set".

Copilot uses AI. Check for mistakes.
@fbacall fbacall merged commit b962c9b into master Dec 19, 2025
11 checks passed
@fbacall fbacall deleted the spaces-themes branch December 19, 2025 16:18
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.

2 participants