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 API endpoints work. Look at the stetup_tool section in http://localhost/documentation/api/operations/all/ for more information.
    • Make sure no migration patches are needed initially (Currently only fix_schema_config is run upon database creation, which re-runs schema related migrations)

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

Apply patches
@alesan99 alesan99 requested review from a team, acwhite211 and melton-jason January 6, 2026 19:30
@alesan99 alesan99 mentioned this pull request Jan 7, 2026
15 tasks
@alesan99 alesan99 requested a review from a team January 7, 2026 16:04
@alesan99
Copy link
Contributor

alesan99 commented Jan 7, 2026

@ux-testing Had to make a quick fix, but this is ready for testing now 👍

Triggered by 41fa184 on branch refs/heads/issue-2931-1
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.

Only tested on light mode, but since I ran into issues I figured I would request changes now.

  • The Next button in the setup forms is always orange even when the a required field is empty, although it still won't let you proceed the button should be red if you can't progress.
01-07_10.53.mp4
  • You can remove root nodes and create completely empty trees
  • You can't see the progress bar on small screens and can't scroll either, the only way to see it is by zooming out
Screenshot 2026-01-07 112302
  • Only two picklists were created by default and one is completely empty
01-07_11.56.mp4
  • PrepTypes were not created at all
image
  • Agent Type picklist was created but doesn't exist in the schema, not sure if this is related to picklists not being created or not
01-07_12.03.mp4

@alesan99
Copy link
Contributor

alesan99 commented Jan 7, 2026

  • The Next button in the setup forms is always orange even when the a required field is empty, although it still won't let you proceed the button should be red if you can't progress.
  • You can't see the progress bar on small screens and can't scroll either, the only way to see it is by zooming out
  • PrepTypes were not created at all
  • Only two picklists were created by default and one is completely empty

Fixed.

Geology was missing some defaults so those are also filled in now.

  • You can remove root nodes and create completely empty trees

This is expected behavior for now, any tree issues will be addressed in #7593 (The tree PR already has better functionality for creating empty trees, so I will simply port that over).

Tree rank configuration will also be improved then.

  • Agent Type picklist was created but doesn't exist in the schema, not sure if this is related to picklists not being created or not

This may be related to the missing picklists, if it was it should be fixed now (might not be though)

These specific errors are related to missing tables in the database creation script (separate from this PR), so they will be addressed here: #7551
Please continue to send any errors found within the database though just to be sure

@specify/ux-testing So should be ready to test again 👍

@alesan99 alesan99 requested review from a team and emenslin January 7, 2026 19:22
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.

  • The overview looks incorrect on the taxon tree setup page, the bottom is cut off and you have to scroll more
01-07_13.34.mp4
  • When clicking the Create button, it will load for a second then take me back to the setup and says an error occurred, after some time I have to refresh and then it takes me to the login page.
01-07_14.06.mp4
  • I checked main and Agent Type doesn't have the pick list selected in schema there either so it seems like it's not an issue
  • Several picklists have size limits that are set to 100 (or just generally a much higher number than items in the picklist) when there is only a handful of items and one has a size limit lower than the amount of items in the pick list, is this expected?
image
  • COType picklist is invalid
image
  • Agent does not have last name if you do not enter one in
image

Fix: overview table height
Triggered by 4e05e20 on branch refs/heads/issue-2931-1
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

7 participants