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

grantfitzsimmons and others added 30 commits June 30, 2025 20:56
Triggered by 30c35c6 on branch refs/heads/issue-6843
Triggered by 95c7c50 on branch refs/heads/issue-6843
…s.tsx

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Suggested by @CarolineDenis
Triggered by 86a8e33 on branch refs/heads/issue-6843
Triggered by 5d91e20 on branch refs/heads/issue-6843
Triggered by 579a30b on branch refs/heads/issue-7440
@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

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

@emenslin Fixed in the latest commit. Can you take another look?

@Iwantexpresso Iwantexpresso self-requested a review November 14, 2025 19:44
@Gitesh307 Gitesh307 requested a review from emenslin November 17, 2025 01: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.

  • 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

Looks good, my previous issues with catalog number inheritance were fixed. I did notice though that now the default sorting for trees is name but it should be Rank ID.

Issue branch:

11-18_08.32.mp4

Main:

11-18_08.34.mp4

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

8 participants