Skip to content

Conversation

@CarolineDenis
Copy link
Contributor

@CarolineDenis CarolineDenis commented Jun 16, 2025

Fixes #2931
Fixes #4832
Fixes #6210

Adds an initial set up page for configuring your database much like the Spwizard for Specify 6.

image

TODO:

Details
  • Title colors are white-on-white.
  • Make certain fields required (at least for user)
  • Error on backend doesn't stop you from progressing onto the next step.
  • Defaults for fields (So certain tree ranks can be true by default)
  • Progress indicator?
  • Backend should tell frontend which step to go to next. Needed to conditionally skip geography tree setup pages.
  • Setup can be finished before schema is finished being created. Need to have some sort of waiting page, or speed improvement? Thinking I can change the setup so you fill out the forms first, then at the very end the database is created.
  • Use new default files Feat (setup tool): Create default files for the new setup tool #7444
  • Create trees
  • Add documentation links
  • Only use localized strings
  • Add better error handling. User should be notified and sent back to the forms if anything goes wrong.
  • Check if worker is set up before continuing.
  • specifyuser_spprincipal table needs to exist before the setup process works on a new sp7 database. It also looks like the admin user isn't actually a proper admin. (fixed)

Future TODO:

Details
  • Password confirmation input doesn't work if you input the password into it first, then fill out the normal password field.
  • Notification polling seems to be causing errors on the backend when lingering on the setup page. Will investigate.
  • Need schema for API
  • Save form to localStorage. Also change the Save & Continue text maybe.
  • Normalize all keys (recursively) on backend api requests
  • Institution should have a value for all treedef fields once all trees are created. There should be api.finalize_institution or something similar.
  • There should be a functioning progress bar during the setup.
  • Speed up schema config localization setup. This is the biggest bottleneck in the setup process and it can be sped up significantly.
  • Fix two geography tree forms showing up on the overview sidebar.
  • Add documentation links and descriptions to all resources
  • Move over default tree creation functions to tree folder

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
  • Add pr to documentation list
  • Add automated tests
  • Add a reverse migration if a migration is present in the PR

Testing instructions

  • Use a blank DB to test this PR.
  • Try to create dbs with different disciplines. At least a paleo/geo discipline and a non-paleo/geo discipline.
  • Fill out the setup forms
    • Make sure the forms look good in light mode and dark mode (It uses your system settings.)
    • You can only progress to the next form if you filled out all required fields.
    • Make sure your choices are shown in the Overview sidebar.
    • Make sure you can submit at the end.
  • Make sure you can log into the database.
  • NOTE: The dialog about the DB schema is expected behavior in this PR
  • Make sure the defaults schema config captions and descriptions appear (not blank).
  • Make sure default picklists were created correctly.
    • Note: The Agent Type picklist shouldn't exist in the schema config
  • Make sure prep types were created correctly.
  • Make sure all tree viewer pages load.
  • Make sure the admin user's agent was created correctly. It should always have a last name.
  • Make sure an empty Global Preferences file was created in App Resources.
  • Note: The accounts page and stats page will show an error when opened, these will be fixed separately in Check default database constraint differences between Sp6 and Sp7 #7551
  • Local testing:
    • Use an empty DB again (restore it or use a different one).
    • Stop the specify worker and try to start the setup. You should get a clear error on the frontend.
    • Make sure no migration patches are needed initially (Currently only fix_schema_config is run upon database creation, which re-runs schema related migrations)

Test the following PRs (which have been merged into this one) if you haven't already:

@grantfitzsimmons
Copy link
Member

Any specifyuser can be set as an institution admin by inserting the following, replacing the specifyuser_id with the ID of the newly created user:

INSERT INTO spuserpolicy (id, resource, action, collection_id, specifyuser_id) VALUES (1, '%', '%', null, 1);

@CarolineDenis
Copy link
Contributor Author

CarolineDenis commented Jul 9, 2025

NOTES:

@alesan99
Copy link
Contributor

alesan99 commented Jan 12, 2026

@emenslin @grantfitzsimmons Ready to review again 👍 I made the following changes:

  • Fixed discipline schema defaults not being applied correctly
  • Fixed CollectionObjectType picklist not being created, along with other COT related fixes
  • Fixed issue with empty setup error showing up
  • Fixed brief screen flashing when the database setup is running

Not addressed:

Note:

  • Some code was commented to allow for testing while certain DB tables are missing. I need to undo this before merging.
  • Weblate needs to be set up for the new localization file after this PR is merged

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.

  • Make sure the forms look good in light mode and dark mode (It uses your system settings.)
    • You can only progress to the next form if you filled out all required fields.
    • Make sure your choices are shown in the Overview sidebar.
    • Make sure you can submit at the end.
  • Make sure you can log into the database.
  • Make sure the defaults schema config captions and descriptions appear (not blank).
  • Make sure default picklists were created correctly.
  • Make sure prep types were created correctly.
  • Make sure all tree viewer pages load.
  • Make sure the admin user's agent was created correctly. It should always have a last name.
  • Make sure an empty Global Preferences file was created in App Resources.

I'm still running into issues when creating the db where after pressing create it sends me to a loading page for a minute and then sends me back to the last setup page but with no error this time

01-12_12.29.mp4

In the setup the catalog number formats should also include a preview of what they look like instead of just the format name.

@alesan99
Copy link
Contributor

@emenslin

I'm still running into issues when creating the db where after pressing create it sends me to a loading page for a minute and then sends me back to the last setup page but with no error this time

I think I figured out the issue, the loading page should be more reliable now 👍
Creating new tabs or refreshing the page should show the loading page also.

In the setup the catalog number formats should also include a preview of what they look like instead of just the format name.

I added the format to the name like schema config

Ready to test again 👍

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.

  • Make sure the forms look good in light mode and dark mode (It uses your system settings.)
    • You can only progress to the next form if you filled out all required fields.
    • Make sure your choices are shown in the Overview sidebar.
    • Make sure you can submit at the end.
  • Make sure you can log into the database.
  • Make sure the defaults schema config captions and descriptions appear (not blank).
  • Make sure default picklists were created correctly.
  • Make sure prep types were created correctly.
  • Make sure all tree viewer pages load.
  • Make sure the admin user's agent was created correctly. It should always have a last name.
  • Make sure an empty Global Preferences file was created in App Resources.

Looks good, all my previous comments were fixed or addressed and I didn't run into any new issues!

@alesan99 alesan99 requested a review from a team January 13, 2026 20:38
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.

  • Make sure the forms look good in light mode and dark mode (It uses your system settings.)

    • You can only progress to the next form if you filled out all required fields.
    • Make sure your choices are shown in the Overview sidebar.
    • Make sure you can submit at the end.
  • Make sure you can log into the database.

  • NOTE: The dialog about the DB schema is expected behavior in this PR

  • Make sure the defaults schema config captions and descriptions appear (not blank).

  • Make sure default picklists were created correctly.

    • Note: The Agent Type picklist shouldn't exist in the schema config
  • Make sure prep types were created correctly.

  • Make sure all tree viewer pages load.

  • Make sure the admin user's agent was created correctly. It should always have a last name.

  • Make sure an empty Global Preferences file was created in App Resources.

  • Local testing:

  • Stop the specify worker and try to start the setup. You should get a clear error on the frontend.

  • Make sure no migration patches are needed initially (Currently only fix_schema_config is run upon database creation, which re-runs schema related migrations)

* Add a new treeDefault import feature

Fixes #6294

* Remove import

* init create_default_trees_view

* create_default_trees_view api change

* add create_default_trees_view fixes

* Add api to onClick fct

* init create_default_trees_task

* create_default_trees_task fix

* bypass tree validation to speedup default tree upload

* Lint code with ESLint and Prettier

Triggered by d4d2c5d on branch refs/heads/issue-6294

* Lint code with ESLint and Prettier

Triggered by 99d9de5 on branch refs/heads/issue-6294

* Lint code with ESLint and Prettier

Triggered by 1b79f85 on branch refs/heads/issue-6294

* test

* Lint code with ESLint and Prettier

Triggered by 9f9994f on branch refs/heads/issue-6294

* Lint code with ESLint and Prettier

Triggered by 832b665 on branch refs/heads/issue-6294

* Use frontend collection name

* Lint code with ESLint and Prettier

Triggered by 441d301 on branch refs/heads/issue-6294

* Add notification formatting to frontend

* Update API schema and name

* WIP Poll for tree creation progress

* Add label to progress bar

* Fix task error handling
Refactor CSV url getting

* Fix continous progress polling after errors

* Generalize initial taxon tree creation code

* Generalize add_default_taxon function

* WIP Add Geography and GeologicTimePeriod schemas

* Fix geography and geologictimeperiod mapping

* Fix: Always get treedef by name

* WIP retry failed rows

* Improve readability

* WIP accept row_count and mapping_url

* Improve success notification

* Add localization

* Fetch tree mapping from url

* Lint code with ESLint and Prettier

Triggered by 85e43e5 on branch refs/heads/issue-6294

* Remove non-background execution

* Fix provided colleciton name not being used

* Add stop button

* Lint code with ESLint and Prettier

Triggered by 43368ed on branch refs/heads/issue-6294

* Fix task_id in notifications
Add cancel button in default tree notification

* Lint code with ESLint and Prettier

Triggered by 7736f98 on branch refs/heads/issue-6294

* Use tree title as tree name

* Lint code with ESLint and Prettier

Triggered by d2f110d on branch refs/heads/issue-6294

* Add comments for lines_iter

* Use tree mapping for rank count
Accept mapping directly instead of just mappingUrl

* Update tree rank debug logs

* Get rank by column name

* Add default isenforced and isinfullname values

* WIP update tree mapping schema for rank config

* Update rank mapping schema

* Fix tree mapping

* Fix rank in mapping schema

* Add fullnameseparator to schema

* Add "fullnameseparator" to schema

* Add full name direction
Remove print statements

* Fix transaction

* WIP Increase timeout

* Fix automatic titles

* Add root node names per tree
Increase retries

* Remove close button from Default Tree creation dialog
Refactor

* Lint code with ESLint and Prettier

Triggered by 11a4d60 on branch refs/heads/issue-6294

* Simplify notifications
Add back in close button to tree creation dialog.
Add spacing between populated trees and empty trees

* Close add tree dialog on progress dialog close

* fix tests

---------

Co-authored-by: alec_dev <acwhite211@gmail.com>
Co-authored-by: alesan99 <alesanesp99@gmail.com>
Co-authored-by: Grant Fitzsimmons <37256050+grantfitzsimmons@users.noreply.github.com>
@alesan99 alesan99 mentioned this pull request Jan 14, 2026
18 tasks
* Create a configuration page

* Start to adapt backend def for system config

* Fix new discipline def

* Reload page after addition

* Remove parent id

* Fetch data system after creation

* Simplify and comment backend defs

* Handle second call on backedn creation def

* efetch all system data after addition

* Simplify handle save

* Remove comment from type

* Lint code with ESLint and Prettier

Triggered by 6f46015 on branch refs/heads/issue-6213-1

* Add webonly view for discipline and div

* Feat: Add data check to define if geo is global & if tree def is present

* Feat: Add geo tree config dialog

* Fix: add handleSave

* Feat: Add taxon and geo config dialog for disciplines

* Fix: fix typos

* Feat: add collapsible arrows

* Feat: Add an edit option for each resource

* Refactor: Break the system config tool in smaller component

* Refactor: Exctract resource renderer

* type

* Import

* Refactor: Extract add button

* Fix type

* Lint code with ESLint and Prettier

Triggered by 7755ec2 on branch refs/heads/issue-6213-1

* Comment

* Fix: Update all info for hierarchy onDelete and onSave

* Feat: Allow to delete empty resources

* Fix: typo in api

* Fix: Typo

* Lint code with ESLint and Prettier

Triggered by 17d9759 on branch refs/heads/issue-6213-1

* Comment: Suggestion for userscopeid crash

* Lint code with ESLint and Prettier

Triggered by 9061ca6 on branch refs/heads/issue-6213-1

* Fix: Use new API to avoid UserGroupScopeId issues

* Fix: tests

* Fix: Improve spacing

* Refactor: Remove unnecessary dialog

* Feat: New icon for system config menu item

* Fix: improve collections margins

* Refactor: Remove imports

* Lint code with ESLint and Prettier

Triggered by 7794c7c on branch refs/heads/issue-6213-1

* fix: change chevron direction

Matches the collapse direction elsewhere in the app

* Lint code with ESLint and Prettier

Triggered by d48352f on branch refs/heads/issue-6213-1

* [UI]: Add a backgrounf behind the hierarchy

* Feat: Add tool list under ea ch resource

* Fix: Chnage edit tool to a link

* Fix: Add migrations for delete.CASCADE chnages

* [UI]: Add height to container

* [Fix]: Remove import and unused strings

* Lint code with ESLint and Prettier

Triggered by f94e933 on branch refs/heads/issue-6213-1

* fix: add hierarchy

feat: add visual for table view

When a change is made (delete or new), it also updates the visual immediately

feat: add option to switch orientation

fix: use schema captions instead

fix: fix the inverted vertical/horizontal visual

fix: make spacing more compact

fix: put the hierarchy on the left and svg on the right

feat: add color distinctions

fix(accessibility): fix positioning

* fix: sort out spacing and positioning

* fix(tests): remove unused import

* fix(localization): remove unused text

* fix: form when selecting a block

* fix: failing test

* fix(colors): make custom colors important

* Lint code with ESLint and Prettier

Triggered by e7d943c on branch refs/heads/visual-hierarchy

* fix: use correct forms

* Lint code with ESLint and Prettier

Triggered by 7360933 on branch refs/heads/visual-hierarchy

* Lint code with ESLint and Prettier

Triggered by 117c57c on branch refs/heads/issue-6213-1

* [Fix]: Add deletion cascade to preptype and cotype

* [Fix]: Add casdace to COGtyp

* [Fix]: Clear cache when deleting resources

* fix: handle long names for hierarchy nodes

* fix: key uniqueness and refresh process

* Lint code with ESLint and Prettier

Triggered by 7550b74 on branch refs/heads/issue-6213-1

* fix: reduce network requests

* fix: update imports

* Lint code with ESLint and Prettier

Triggered by f5cb5ce on branch refs/heads/issue-6213-1

* fix(ux): make the institutional hierarchy fit the view

* Lint code with ESLint and Prettier

Triggered by 21a847d on branch refs/heads/issue-6213-1

* fix: change colors...

I couldn't resist.

* fix: missing colors

* Lint code with ESLint and Prettier

Triggered by 238af20 on branch refs/heads/issue-6213-1

* Lint code with ESLint and Prettier

Triggered by a1e073b on branch refs/heads/issue-6213-1

* feat: add d3Zoom and improve sizing

* fix: remove unused import and add typing

* Lint code with ESLint and Prettier

Triggered by 8b2a849 on branch refs/heads/issue-6213-1

* fix: update migration number

* WIP fix: add cascade delete to remaining trees

* Revert "WIP fix: add cascade delete to remaining trees"

This reverts commit abcd291.

---------

Co-authored-by: alec_dev <acwhite211@gmail.com>
Co-authored-by: alesan99 <alesanesp99@gmail.com>
Co-authored-by: Grant Fitzsimmons <37256050+grantfitzsimmons@users.noreply.github.com>
@Iwantexpresso Iwantexpresso requested a review from a team January 14, 2026 19:24
kwhuber

This comment was marked as duplicate.

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

9 participants