Skip to content

Conversation

@Gitesh307
Copy link
Contributor

@Gitesh307 Gitesh307 commented Oct 12, 2025

This combined PR unifies the work from issues #7445, #6843, #7440, and #7442 to deliver a complete overhaul of the preferences system across Specify.

It removes a number of obsolete remote preferences, migrates remaining tree-viewer configuration to the modern User Preferences framework, introduces a dedicated Collection Preferences interface for collection-level configuration, and adds a new Global Preferences page for institution-wide settings managed by Institution Administrators.

Summary of Changes

1. Removal of legacy remotePrefs and migration to User Preferences (Fixes #7445)
A set of outdated configuration keys from remotePrefs.ts and CollectionDefinitions.tsx has been retired. These keys—such as tree-viewer sort settings, rank thresholds, and TaxonTreeEditor.DisplayAuthor—either already existed in User Preferences or were no longer relevant. All code paths depending on these legacy keys were removed, and Tree Viewer now relies completely on the User Preferences system.

2. Migration of TreeEditor.Rank.Threshold to User Preferences (Fixes #6843)
TreeEditor.Rank.Threshold no longer uses the legacy remote preference. Rank visibility and object count display are now fully controlled through User Preferences. Existing threshold values are not auto-migrated and can be updated manually per collection as needed.

3. Introduction of the Collection Preferences UI (Fixes #7440)
A new, structured Collection Preferences page consolidates settings such as picklist scope, attachment defaults, tree management rules, statistics, Specify Network configuration, and catalog number inheritance. This page is role-gated, saved per collection, and uses updated localization handling to address scanner issues. No database schema changes were required.

Screenshots:
image
image
image

4. Addition of the Global Preferences Interface (Fixes #7442)
A new Global Preferences page enables Institution Admins to configure database-wide settings, including auditing, date formats, and thumbnail sizes. This UI replaces manual preference edits and is backed by new API endpoints for retrieving and updating global preference values.

Screenshots:
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

Retire obsolete remotePrefs and migrate Tree Viewer to User Preferences

  • Verify Tree Viewer functionality works correctly.
  • Load a tree view (e.g., Taxon) with the network panel open; Verify that expanding a node below that rank does trigger a /stats/ request and shows node statistics, while expanding a node above that rank does not
  • Confirm the app loads without errors and obsolete are not used.

Migrate Rank.Threshold to User Preferences

  • Go to User Preferences

  • Verify that under each tree there is an option to configure the "Show object count"

    image
  • Verify that the ranks returned are correct for the current collection's tree(s)

  • Select a rank from each tree

  • Verify that the counts for all nodes under that level are shown in the tree

  • Test this across all current trees and verify the behavior


Feat: Add “Collection Preferences” page with role-gated access

  • 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)
  • 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

PR Feat: Refactor and add UI to control Global preferences

  • Verify that the new Global Preferences page is accessible only to Institution Admins, settings (auditing, date formats, thumbnails) can be updated, saved, and persist correctly across reloads.
  • Change and verify that all configuration options are applied

Gitesh307 and others added 30 commits September 30, 2025 21:23
Triggered by 20b207e on branch refs/heads/issue-7440
Triggered by 78c6e54 on branch refs/heads/issue-7440
Triggered by c4ddea8 on branch refs/heads/issue-7440
Triggered by ad70ddc on branch refs/heads/issue-7440
Triggered by e58d9f0 on branch refs/heads/issue-7440
Triggered by ff875da on branch refs/heads/issue-7440
@Gitesh307 Gitesh307 changed the title feat(preferences): Refactor and add UI to control Global preferences Feat(preferences): Consolidated Preferences System: User, Collection, and Global Preferences Updates Nov 19, 2025
Copy link
Contributor

@Iwantexpresso Iwantexpresso left a comment

Choose a reason for hiding this comment

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

Testing instructions

Retire obsolete remotePrefs and migrate Tree Viewer to User Preferences

  • Verify Tree Viewer functionality works correctly.
  • Load a tree view (e.g., Taxon) with the network panel open; expand a node whose rank is below the current threshold and confirm no …/stats/ request is issued, then expand a higher-rank node and confirm one is.
  • Confirm the app loads without errors and obsolete prefs like form.definition.columnSource are not used.

Migrate Rank.Threshold to User Preferences

  • Go to User Preferences

  • Verify that under each tree there is an option to configure the "Show object count"

    image
  • Verify that the ranks returned are correct for the current collection's tree(s)

  • Select a rank from each tree

  • Verify that the counts for all nodes under that level are shown in the tree

  • Test this across all current trees and verify the behavior

Counts are not being displayed at all, tested with geography and taxon tree on CalvertMarinemuseum with both light and dark mode. Tried clearing cache after saving changes as well as logging in and out and the result was still the same.
image
image

@bhumikaguptaa bhumikaguptaa self-requested a review November 19, 2025 18:46
@CarolineDenis
Copy link
Contributor

CarolineDenis commented Nov 19, 2025

NOTES:

  • Need to update doc https://discourse.specifysoftware.org/t/configure-database-date-format/1109
  • global prefs are not in sync between app resources and user tools
  • ui.formatting.scrdateformat=MM/dd/yyyy needs to be removed from remoteprefs.properties
  • are there other prefs that moved from remote to global?
  • Why did you have to change specifyweb/frontend/js_src/lib/utils/ajax/index.ts ?

Copy link
Member

Choose a reason for hiding this comment

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

I don't think we should merge these env file changes into main. The database user values need to be available to users to edit for their deployment. If users want to use the root/master user to the migrations, then they'll need to set the migrator_name to root.

Also, we should probably keep those other parameters set, like the redis values.

Copy link
Member

Choose a reason for hiding this comment

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

This needs to be resolved. 👍

Updated database user configurations and added comments for clarity.
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 Global preferences

7 participants