Skip to content

Add demo content type for facet conditions testing without polluting package consumers #64

Description

@reekitconcept

Background

Facet conditions are a feature of the current version. This is best demonstrated with a customized Person content type, for example:

  • person.building: which building the person is in
  • person.room: room number of the person

Then in the People search, we can show facet conditions for building and room.

Why we need this

  • Demo site: Users can easily understand and test out the feature
  • Cypress tests: Tests can exercise the UX with this setup

The problem

We don't want to add a customized Person type to the main package. Consumers of this package might not want to use Person at all, or use a differently customized Person. (In contrast: kitconcept.intranet does contain a Person type, but it's a different package which some users of kitconcept.solr will not want to use.)

Proposed solution

Add a DemoPerson content type that is only configured in:

  • The Cypress test setup
  • The demo site

This content type should NOT be registered when someone just uses the package as a dependency.

Monorepo consideration

This pattern should be supported from the monorepo format, as adding a demo site and running a specific setup for Cypress can be a common requirement for other packages as well.

Implementation Plan

  • Create a DemoPerson content type with building and room fields
  • Add Solr schema configuration for building and room indexes
  • Create a separate ZCML profile (e.g., demo or testing) that registers DemoPerson
  • Configure the demo site to load the demo profile
  • Configure Cypress test setup to load the demo profile
  • Ensure the main package profile does NOT include DemoPerson
  • Add facet conditions configuration for building and room in the demo/testing context
  • Create sample DemoPerson content in demo site fixtures
  • Write Cypress tests exercising facet conditions with the demo content
  • Document the pattern for other packages needing similar demo/testing-only content types

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions