Skip to content

Conversation

@Gitesh307
Copy link
Contributor

@Gitesh307 Gitesh307 commented Oct 1, 2025

Fixes #7440

This PR introduces a new feature Collection Preferences page that consolidates collection-level settings such as picklists, attachments, tree management, statistics, Specify Network integration, and catalog number inheritance. Updated localization handling to use explicit function calls, resolving scanner issues. No database changes; existing preferences migrate automatically at the collection level.

image image image

Checklist

  • Self-review the PR after opening it to make sure the changes look good and
    self-explanatory (or properly documented)
  • Add relevant issue to release milestone

Testing instructions

  • Verify the new Collection Preferences menu is visible only to authorized roles, settings can be saved and persist per collection.
  • Modify values in each section, ensure they save and persist after reload, and verify that the Reset button restores defaults correctly.

Test each option and verify application behavior responds to the setting

General

  • Scope "Entire Table" Picklists
  • Make Attachments Public By Default

Tree Management

If enabled, this allows users to add children to synonymized parents and to synonymize a node with children.

  • Taxon
  • Geography
  • Storage
  • Chronostratigraphy
  • Lithostratigraphy
  • Tectonic Unit

Statistics

  • Show Preparation Totals
  • Auto-Refresh Rate (Hours)
    The following two cannot really be tested at the moment...
  • GBIF Publishing Organization Key
  • GBIF Data Set Key

Catalog Number Inheritance

  • Enable Catalog number Inheritance From Primary Collection Object
  • Enable Catalog number Inheritance From Parent Collection Object

@github-project-automation github-project-automation bot moved this to 📋Back Log in General Tester Board Oct 1, 2025
@Gitesh307 Gitesh307 changed the title Fix:Expose general collection prefs for picklist scoping and attachme… Feat(preferences): Add “Collection Preferences” page with role-gated access Oct 3, 2025
@Gitesh307 Gitesh307 requested review from a team and removed request for a team October 6, 2025 15:14
@CarolineDenis CarolineDenis removed the request for review from a team October 6, 2025 16:33
@Gitesh307 Gitesh307 requested review from a team October 9, 2025 18:09
Copy link
Collaborator

@emenslin emenslin left a comment

Choose a reason for hiding this comment

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

After opening up the branch I have some concerns about testing with this being the only check:

  • Verify the new Collection Preferences menu is visible only to authorized roles, settings can be saved and persist per collection.

The original issue seems to cover a lot of things, which I don't think is captured within the testing instructions. One of the first things I noticed when opening up the PR was that in the original issue it says that the collection preferences page should be accessible via the user tools menu, in this PR it is only accessible by going into app resources first, then opening the collection preferences, if this is expected that's fine, I just think it should be explained in this PR. I also noticed that when opening collection preferences each line includes a link to documentation, however, the link does not take you to relevent documentation, additionally there is no mention of these links in the testing instructions. I think the testing instructions should be expanded on before any further testing reviews to make sure that everything is covered and that any issues can be caught within this PR.

@github-project-automation github-project-automation bot moved this from 📋Back Log to Dev Attention Needed in General Tester Board Oct 10, 2025
@Gitesh307 Gitesh307 removed the request for review from a team October 12, 2025 20:51
@acwhite211 acwhite211 self-requested a review October 14, 2025 02:16
Triggered by e9b8f26 on branch refs/heads/issue-7440
@Gitesh307 Gitesh307 changed the base branch from main to issue-7445 October 30, 2025 21:51
@grantfitzsimmons
Copy link
Member

grantfitzsimmons commented Nov 5, 2025

From my last review on the rebased PR for context:

General

  • Scope "Entire Table" Picklists

This setting seems to have no effect. I defined a pick list named "COTTypes" that is based on the CollectionObjectType table, which should return all options if it is not scoped.

Image Image

It still shows 2 results when unchecked despite there being many in the database:

Image
  • Make Attachments Public By Default

Works exactly as expected. IsPublic is checked when adding a new attachment when enabled, it is not checked when it is not.

Tree Management

If enabled, this allows users to add children to synonymized parents and to synonymize a node with children.

Note: Immediately after setting this, I received the errors described for Storage for Taxon both when adding a child to a synonym and when trying to merge synonyms. Only after logging out and back in was I able to do this without errors... @Gitesh307 do you have the same issue?

  • Taxon

  • Storage

Synonymizing nodes with children:

errorOnSynonymy.mov
('Synonymizing node "316cd2" which has children', {'tree': 'Taxon', 'localizationKey': 'nodeSynonimizeWithChildren', 'node': {'id': 5812, 'rankid': 375, 'fullName': '316cd2', 'children': [{'id': 7029, 'fullname': 'Different Child, 316cd2'}]}, 'parent': {'id': 5810, 'rankid': 375, 'fullName': '24e0f0', 'parentid': 1, 'children': [{'id': 7028, 'fullname': 'Test, 24e0f0'}]}})

Specify 7 Crash Report - 2025-10-31T16_28_43.133Z.txt

Adding a Child:

`ValueError** at /api/specify/storage/ 'Storage' instance needs to have a primary key value before this relationship can be used.

errorOnChild.mov

Specify 7 Crash Report - 2025-10-31T16_27_01.097Z.txt

Going to hold off testing the other trees until this is fixed.

Statistics

  • Show Preparation Totals

Regardless of the setting, I am not seeing preparation totals:

Catalog Number Inheritance

  • Enable Catalog number Inheritance From Primary Collection Object

Doesn't seem to be respected:

Image
  • Enable Catalog number Inheritance From Parent Collection Object
Image

Will test remainder once these are fixed.

@grantfitzsimmons
Copy link
Member

@Gitesh307 Can you update the instructions so they cover everything properly?

From the other PR (#7516 (review)):

I think we need to test every setting individually to verify it is enforced.

Testing Checklist

General

  • Scope "Entire Table" Picklists
  • Make Attachments Public By Default

Tree Management

If enabled, this allows users to add children to synonymized parents and to synonymize a node with children.

  • Taxon
  • Geography
  • Storage
  • Chronostratigraphy
  • Lithostratigraphy
  • Tectonic Unit

Statistics

  • Show Preparation Totals
  • Auto-Refresh Rate (Hours)
    The following two cannot really be tested at the moment...
  • GBIF Publishing Organization Key
  • GBIF Data Set Key

Catalog Number Inheritance

  • Enable Catalog number Inheritance From Primary Collection Object
  • Enable Catalog number Inheritance From Parent Collection Object

'sp7.allow_adding_child_to_synonymized_parent.ChronosStrat',
'sp7.allow_adding_child_to_synonymized_parent.ChronoStrat',
),
'ChronosStrat': (
Copy link
Contributor

Choose a reason for hiding this comment

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

Why 2? See line 34

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Older deployments saved the Chronostrat synonym preference under two different keys, ChronosStrat (the legacy table/view name) and ChronoStrat (the shortened label used in global properties). If we drop one of them, any collection that previously saved the preference under that spelling would lose the ability to add children to synonymized Chronostrat nodes. Keeping both entries ensures _synonym_pref_keys continues to read whatever was persisted historically.

const props = {
className: `
flex items-start gap-2 md:flex-row flex-col
${canEdit ? '' : '!cursor-not-allowed'}
Copy link
Contributor

Choose a reason for hiding this comment

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

is this secure enough?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That just affects cursor/UX. The real permission check comes from canEdit flowing into the ReadOnlyContext, which disables the inputs and prevents writes. That matches how the existing user-preferences UI enforces permissions, and the server still validates everything, so the security level is the same as production.

@CarolineDenis CarolineDenis requested a review from a team November 12, 2025 17:16
Copy link
Member

@grantfitzsimmons grantfitzsimmons left a comment

Choose a reason for hiding this comment

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

  • Verify the new Collection Preferences menu is visible only to authorized roles, settings can be saved and persist per collection.

After looking at this some more, can you provide some more insight here? It seems like we need to expand or clarify the permission for CollectionPreferences as this is not explicitly added as an option.

What is the criteria for "authorized roles" in this case?

Image
  • Modify values in each section, ensure they save and persist after reload, and verify that the Reset button restores defaults correctly.

General

  • Scope "Entire Table" Picklists

With this enabled (same behavior with or without this checked):

Image Image Image

Seems not to take effect. Have you been able to demonstrate this? Can you add screenshots?

  • Make Attachments Public By Default

Tree Management

Confirmed by creating synonyms for nodes with children and added children under existing and new synonyms.

  • Taxon
  • Geography
  • Storage
  • Chronostratigraphy
  • Lithostratigraphy
  • Tectonic Unit

Statistics

  • Show Preparation Totals
  • Auto-Refresh Rate (Hours)

The following two cannot really be tested at the moment... I think we should consider hiding these from the UI (commented out) but keeping the localized strings? We need to demonstrate or understand how these are being used... 🤷

  • GBIF Publishing Organization Key
  • GBIF Data Set Key

Catalog Number Inheritance

COGs

  • Enable Catalog number Inheritance From Primary Collection Object

Being resolved in #7539, can be addressed outside of this PR.

Components

  • Enable Catalog number Inheritance From Parent Collection Object

Works 😄

@Gitesh307
Copy link
Contributor Author

Gitesh307 commented Nov 13, 2025

@grantfitzsimmons For the Picklist I am able to achieve the exact behaviour
With scope entire table pick list checked I am getting:
image

With scope entire table pick list unchecked :
image
image
Can you just try with clearing browser cache every time you check or uncheck the checkbox?

For accessibility

Institution Admin / Collection Admin: Those roles get the wildcard %/% policy plus full table permissions that means they have the access to the collection preferences by default
I have added the option to set the collection preferences access for users if they explicitly have the App Resources edit permission.

Screenshot 2025-11-13 at 7 39 47 PM

@grantfitzsimmons
Copy link
Member

From my earlier comment:

The following two cannot really be tested at the moment... I think we should consider hiding these from the UI (commented out) but keeping the localized strings? We need to demonstrate or understand how these are being used... 🤷

Will review soon!

@grantfitzsimmons
Copy link
Member

@Gitesh307 Can you fix the conflicts? 224 commits behind now

Copy link
Collaborator

@emenslin emenslin left a comment

Choose a reason for hiding this comment

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

  • Verify the new Collection Preferences menu is visible only to authorized roles, settings can be saved and persist per collection.
  • Modify values in each section, ensure they save and persist after reload, and verify that the Reset button restores defaults correctly.

Test each option and verify application behavior responds to the setting

General

  • Scope "Entire Table" Picklists
  • Make Attachments Public By Default

Tree Management

If enabled, this allows users to add children to synonymized parents and to synonymize a node with children.

  • Taxon
  • Geography
  • Storage
  • Chronostratigraphy
  • Lithostratigraphy
  • Tectonic Unit

Statistics

  • Show Preparation Totals
  • Auto-Refresh Rate (Hours)
    The following two cannot really be tested at the moment...
  • GBIF Publishing Organization Key
  • GBIF Data Set Key

Catalog Number Inheritance

  • Enable Catalog number Inheritance From Primary Collection Object
  • Enable Catalog number Inheritance From Parent Collection Object

Generally the functionality seems to be working but I did run into some issues.

  • First thing I noticed was that Catalog number inheritance appears twice on the side bar
image
  • Also under the catalog number inheritance section shouldn't there be a 'Component' heading above the Parent Collection Object checkbox?
image
  • Trees are not sorted properly
    Issue branch:
image

Main:
image

@Iwantexpresso Iwantexpresso self-requested a review November 14, 2025 19:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Dev Attention Needed

Development

Successfully merging this pull request may close these issues.

Refactor and add UI to control Collection preferences

7 participants