Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CB-27: Update field for numberOfObjects display #32

Merged
merged 4 commits into from
Mar 20, 2024

Conversation

mikejritter
Copy link
Contributor

What does this do?
Updates the field for numberOfObjects to use objectCountGroupList

Why are we doing this? (with JIRA link)
Jira: https://collectionspace.atlassian.net/jira/software/c/projects/CB/issues/CB-27

In cspace 8.0 numberOfObjects has been replaced with a repeating group, objectCountGroupList. The old value is now in objectCount, which this updates the detail field to read from.

How should this be tested? Do these changes have associated tests?
Setting this up is kind of involved, so let me know if there are any mistakes:

  • Configure collectionspace to enable elasticsearch
  • Configure the gateway for the material profile, e.g.
es:        
  allowedRecordTypes: CollectionObject,Materialitem                                                       
  recordTypes:                                                                                                         
    CollectionObject:                   
      publishToField: collectionobjects_common:publishToList.shortid
    Media:                      
      publishToField: media_common:publishToList.shortid
    Materialitem:                                 
      publishToField: materials_common:publishToList.shortid                                                         
  allowedPublishToValues: cspacepub,materialorder,all

zuul:
  routes:                              
    materials-cspace-services:
      path: /materials/cspace-services/**
      url: http://localhost:8180/cspace-services
      username: [email protected]
      password: reader
    materials-es:
      path: /materials/es/**
      url: http://localhost:9200/materials_default
  • In the materials cspace ui profile
    • Create a local organization and note the shortid. This will act as the institution for the public browser
    • Create a material authority with the local organization as the Term creator, and set to publish to materialorder or all
    • Create a collectionobject with one or more object count fields, the above material, and set to publish to materialorder or all
  • In the public browser
    • Configure the material profile with an institution, e.g.
    cspacePublicBrowser({                                                                                              
      baseConfig: 'materials',                             
      gatewayUrl: 'http://localhost:8180/gateway/materials',                                                           
      institutions: {                                                                                                  
        TestInstitution1710453380686: {  // This should be your created institution's shortid                                                                           
          title: 'Test Institution',                       
          gatewayUrl: 'http://localhost:8180/gateway/materials',                                                       
        },                                                                                                             
      },                                                                                                               
    });                                                                                                                
  • Run the public browser and navigate to your authority item
  • Under the 'Samples at...' panel, see the Holdings display for the collectionobject match the object count set from the cspace ui

Dependencies for merging? Releasing to production?
None, though we might want to revisit the display to see if we want to show any of the other object count group fields.

Has the public browser documentation been updated for these changes?
No

Did someone actually run this code to verify it works?
@mikejritter tested locally

Copy link
Collaborator

@ray-lee ray-lee left a comment

Choose a reason for hiding this comment

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

Maybe this should just show the first value? Showing multiple counts might be confusing. I'm guessing if they have multiple values, it would be to record different counts over time, and we can just say that the current one should be first.

@mikejritter
Copy link
Contributor Author

@ray-lee I pushed a change to only show the first value for object count. I added an extra formatter head to do this, which I think would work for other formatters but only tested with valueAt.

I also considered doing valueAt({path: [0].objectCount}) but it felt a little weird to have what felt like lodash details in the config, so I went with the extra function. I had started on a spec for formatHelpers as well for this, but didn't commit it since it was for testing that [0] worked as expected. Can still add it though if it's something that we want to start on.

@ray-lee
Copy link
Collaborator

ray-lee commented Mar 18, 2024

Sorry, Jessi wants to just keep the non-repeating numberOfObjects field in materials, so it turns out we're not going to need this.

@ray-lee
Copy link
Collaborator

ray-lee commented Mar 19, 2024

Never mind, if you change objectNumberGroup to be non-repeating in the UI, this is fine.

@ray-lee ray-lee merged commit c7f9edc into collectionspace:master Mar 20, 2024
1 check passed
ray-lee added a commit to ray-lee/cspace-public-browser.js that referenced this pull request Apr 25, 2024
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