Conversation
- Add `Project` subclass and views for UI testing on dev-2
- Still TODO:
- Unit tests
- Input validation
…t block when displayed
- Add parameter extraction of all fields in SBCR UI - Review data format - Extract out `partial/rights.tt` which should be reusable across all projects
…s/reasons/rights routines in CRMS.pm with a more structured class that is not just a wrapper around SQL queries: - `TranslateAttr` - `TranslateReason` - `TranslateRights` - `AllCRMSRights` - `Rights` - `AllAssignableRights` - `GetAttrReasonFromCode` - `TranslateAttrReasonFromCode` - `GetCodeFromAttrReason` - `GetAttrReasonCode` This class is fully tested. For now it will only be used in the SBCR module and its tests.
- SBCR module tests, first pass
…ts.pm` - Eager load only when populating the singleton
aelkiss
reviewed
Oct 30, 2025
Member
aelkiss
left a comment
There was a problem hiding this comment.
Generally the perl side is looking pretty good but I wonder if we might be able to clean up a bit in the templates.
- individual tests are easy to follow, although I didn't read through each one in detail
SBCR.pmandEntitlements.pmlook fine to me.- I don't know that we have another name for the combination of attr/reason that 'entitlement' represents other than "attribute/reason combination" -- as "rights" typically to me implies the combination of the item ID and the attribute & reason codes. 'entitlement' seems as reasonable as anything.
- I had some comments on the templates; if they're copied from other existing things that might make it more involved to address the comments. If they're new for this project, maybe it's worth addressing now.
… not have led to aberrant behavior - Add comment about the rights way to do the rights <-> id mapping in JS code
…tively commented out
… partial used by SBCR - Should be usable by other projects by swapping in an `INCLUDE` in each project's main form
…ur own poorly maintained version
aelkiss
approved these changes
Nov 4, 2025
Member
aelkiss
left a comment
There was a problem hiding this comment.
Additional changes & reasons for not addressing other items now all make sense to me.
…gled so user-entered data is not lost.
…on-experts, in SBCR project.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The SBCR UI is a combination of the Core and Crown Copyright projects. No attempt has been made to reduce duplication between the new code and the existing UI components (*.tt bits), since we don't have sufficient test coverage, in particular no way to Playwright the thing.
The new
Project::SBCRsubclass has 100% test coverage, most of that being in theValidateSubmissionmethod which does a number of checks on user-entered review data. Many of these were written (based on checks in other projects) and not needed for SBCR so they are applied toward better coverage in Project.t (which holds the default set of validations for monographs/state gov docs projects) mostly. More could be done, either by copying the tests to other projects, or by extracting out common validations to theProjectclass. That's out of scope.CRMS::Entitlements (also 100% under test) was added because the
CRMS.pmmethods are gross wrappers around SQL-as-API and I wanted something not horrible for theSBCR.pmtests. The comments indicate this may be a temporary class name becauseCRMS::Rightsis currently taken... but I have to confessEntitlementsis growing on me.The
UNIQUEconstraint oncrms.rights.{attr/reason}has already been applied in production and htdev.