-
Notifications
You must be signed in to change notification settings - Fork 41
Feat(preferences): Consolidated Preferences System: User, Collection, and Global Preferences Updates #7501
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Gitesh307
wants to merge
135
commits into
issue-7440
Choose a base branch
from
issue-7442-3
base: issue-7440
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Feat(preferences): Consolidated Preferences System: User, Collection, and Global Preferences Updates #7501
Changes from 134 commits
Commits
Show all changes
135 commits
Select commit
Hold shift + click to select a range
e61e9a6
Fix:Expose general collection prefs for picklist scoping and attachme…
Gitesh307 87c5e32
implement Collection Preferences UI with dedicated definitions
Gitesh307 f8c579a
adding missing files for the Collection preferences
Gitesh307 ff7788d
resolve typecheck errors in Collection Preferences definitions
Gitesh307 44b1da0
add Collection Preferences UI and editor with doc links
Gitesh307 e70f796
implify CollectionPreferences page by removing internal save
Gitesh307 ce59d26
Corrected specifyNetwork keys to publishingOrg and datasetKey
Gitesh307 70ea534
fix TypeScript errors in collection preference definitions
Gitesh307 751fcc5
align CollectionDefinitions with UserDefinitions typing
Gitesh307 20b207e
Fix localization scanner issues in preferences
Gitesh307 5e1ab01
Lint code with ESLint and Prettier
Gitesh307 91644ab
adding path for role gated access
Gitesh307 454e758
Merge branch 'issue-7440' of https://github.com/specify/specify7 into…
Gitesh307 78c6e54
Refactor collection preferences renderer and documentation link layout
Gitesh307 f6c0493
Lint code with ESLint and Prettier
Gitesh307 c4ddea8
Localization cleanup for collection preferences
Gitesh307 5a61689
Lint code with ESLint and Prettier
Gitesh307 9b48971
removed collection pref refrence from User Tools
Gitesh307 d662587
remove extra language lines and keep only 'en-us'
Gitesh307 ad70ddc
extract shared logic into createPreferencesEditor and wire User/Colle…
Gitesh307 8d33e36
Lint code with ESLint and Prettier
Gitesh307 3de5eca
implemented IR<T> for preferences typing
Gitesh307 7f6782d
Merge branch 'issue-7440' of https://github.com/specify/specify7 into…
Gitesh307 e58d9f0
resolve BasePreferences context type incompatibility in index.tsx
Gitesh307 40479b2
Lint code with ESLint and Prettier
Gitesh307 58e01a6
simplify resolveCollectionDocumentHref logic using unified NAME_DOCS_MAP
Gitesh307 ff875da
Merge branch 'issue-7440' of https://github.com/specify/specify7 into…
Gitesh307 613d31c
Lint code with ESLint and Prettier
Gitesh307 81ca7e4
unify visibilityContext to remove duplication
Gitesh307 b879af0
Merge branch 'issue-7440' of https://github.com/specify/specify7 into…
Gitesh307 728bfed
optimize preferences wrappers by introducing FetchGate component.
Gitesh307 3b58630
simplify className logic for documentation paragraph
Gitesh307 e24a4fb
Localization cleanup for collection preferences
Gitesh307 444d3bf
removed `as unknown` casts
Gitesh307 ee4eb3b
consolidate doc links and merge catalog-number card
Gitesh307 41c8539
removed unused imports
Gitesh307 c69f079
function call
Gitesh307 3d1b40c
Lint code with ESLint and Prettier
Gitesh307 f91ea9a
render editor inline for User tools menu
Gitesh307 04c1788
Merge branch 'issue-7440' of https://github.com/specify/specify7 into…
Gitesh307 17b28db
Lint code with ESLint and Prettier
Gitesh307 f1eddb7
Feat: Refactor and add UI to control Global preferences
Gitesh307 549792e
Editor Configuration for Global Pref
Gitesh307 2b198a5
Global pref app resources integration
Gitesh307 24e6638
localization strings
Gitesh307 684b974
Global Preferences View, Routing and User tools menu logic
Gitesh307 10073ac
Add remotePreferences test coverage and stabilize ajax mocks
Gitesh307 e24fc51
ix test-mode ajax mock import without bundling node modules
Gitesh307 be2f364
removed extra localization text
Gitesh307 307590f
removed redundant localization strings
Gitesh307 bb4ec4e
added the import statement
Gitesh307 c6918af
Enable Global Preferences visual editor for legacy resources
Gitesh307 a75145c
Fix Global Preferences tests and harden ajax mock
Gitesh307 94e4c90
Stabilize AppResources tests for Global Preferences rename
Gitesh307 fccbefe
declare explicit return type for flattenResources
Gitesh307 4852be1
update AppResourcesTab and useResourcesTree test cases for Global Pre…
Gitesh307 a0f9489
remove unused container variable in AppResourcesTab.test.tsx
Gitesh307 3f7f9c3
Lint code with ESLint and Prettier
Gitesh307 f17e059
restrict Global Preferences visual editor to 'Global Prefs' directory…
Gitesh307 092db6d
Merge branch 'issue-7442-3' of https://github.com/specify/specify7 in…
Gitesh307 58335eb
Fix Global Preferences date dropdowns in visual editor
Gitesh307 e223eff
added localized helper to wrap the raw string in the LocalizedString …
Gitesh307 0f61df1
Lint code with ESLint and Prettier
Gitesh307 30427ab
Modularize preferences localization into smaller files
Gitesh307 1c7454a
createDictionary export for modularize prefrences
Gitesh307 ab64e70
Refactor preference localization dictionaries to expose raw maps
Gitesh307 c6a0b1d
fix: links to docs
grantfitzsimmons 574acf8
Modularize preferences localization dictionary
Gitesh307 b1b0339
Merge branch 'issue-7440' of https://github.com/specify/specify7 into…
Gitesh307 7d78c52
Lint code with ESLint and Prettier
Gitesh307 9c4bc18
refactor(preferences): improve tree management
grantfitzsimmons 2d5870c
fix: improve public attachment description
grantfitzsimmons 8414c82
Update attachments.ts
grantfitzsimmons 69986f5
feat: add descriptions for specify network fields
grantfitzsimmons 94d499a
feat: improve descriptions for stats fields
grantfitzsimmons 0e9f9c2
feat: improve title for synonym behavior section
grantfitzsimmons a9133aa
feat: improve cat number inheritance
grantfitzsimmons 2ca038b
feat: improve descriptions for catalog number inheritance
grantfitzsimmons f2c4c2b
feat: add better icon, distinguish preferences
grantfitzsimmons c08bc13
fix: reorder trees in order of relevance
grantfitzsimmons fc6616f
feat(collection preferences): add sidebar
grantfitzsimmons 8f9682f
feat(preferences): match user preferences visual
grantfitzsimmons 9c20d17
Merge branch 'main' into issue-7440
grantfitzsimmons da3407e
fix: failing test
grantfitzsimmons 84720f7
fix: remove unused localization strings
grantfitzsimmons a0e5463
refactor: simplify code
grantfitzsimmons 7a18d71
Lint code with ESLint and Prettier
grantfitzsimmons 93e824b
Merge branch 'issue-7440' into issue-7442-3
grantfitzsimmons d55c3cb
fix: add missing localization strings
grantfitzsimmons 1fac628
feat(preferences): match collection preferences visual
grantfitzsimmons 914d391
fix: add static test globalpreferences
grantfitzsimmons 747f726
Lint code with ESLint and Prettier
grantfitzsimmons 98f7152
feat: organize global settings into categories
grantfitzsimmons 62eaab8
Merge branch 'issue-7442-3' of https://github.com/specify/specify7 in…
grantfitzsimmons 2b35679
fix: failing test
grantfitzsimmons 5cc8078
fixing failing tests
Gitesh307 8f7c0ae
Migrate screen date format from remote prefs into GlobalPreferences
Gitesh307 4d49db9
resolve readonly assignment errors in global preferences utils and lo…
Gitesh307 aa5e251
Lint code with ESLint and Prettier
Gitesh307 86910b6
ensure Global Preferences read/write the global app resource
Gitesh307 a70172a
satisfy TS readonly types in global preferences flow
Gitesh307 d710796
align tests with normalized formats and mock headers
Gitesh307 fa32925
Lint code with ESLint and Prettier
Gitesh307 fbf89eb
Merge branch 'issue-7440' into issue-7442-3
Gitesh307 4598929
Fix remote pref definitions regression
Gitesh307 21fdc3f
Fix collection pref usage and clean duplicate localization keys
Gitesh307 1a9946b
resolved merge conflicts
Gitesh307 03b82ff
Lint code with ESLint and Prettier
Gitesh307 860f25b
Merge branch 'issue-7440' into issue-7442-3
Gitesh307 969eceb
Lint code with ESLint and Prettier
Gitesh307 93290fe
Merge remote-tracking branch 'origin/issue-7440' into issue-7442-3
Gitesh307 88a5a21
Restrict global pref accessibilty to authorised roles
Gitesh307 6e0489b
Lint code with ESLint and Prettier
Gitesh307 3da7ccb
Restore GlobalPreferences fetch to cache-buster list
Gitesh307 e6687cd
Handle undefined admin flag when filtering global preferences
Gitesh307 b60ec83
Lint code with ESLint and Prettier
Gitesh307 605aebb
Merge branch 'issue-7440' into issue-7442-3
Gitesh307 edf09ca
Handle undefined admin flag when filtering global preferences
Gitesh307 97ca50c
Lint code with ESLint and Prettier
Gitesh307 c102f78
Merge branch 'issue-7440' into issue-7442-3
Gitesh307 9694d44
Fix global prefs visibility when isadmin is undefined
Gitesh307 7518cf0
Lint code with ESLint and Prettier
Gitesh307 ab0ea15
gate stats fetch by rank preference
Gitesh307 6dabaa3
Lint code with ESLint and Prettier
Gitesh307 29990fc
removed stats fetch by rank pref logic
Gitesh307 bec19a6
Fix audit log preference handling and add tests for toggle
Gitesh307 03de6eb
statsThreshold logic correction and auditlog tests
Gitesh307 4083942
Respect global attachment thumbnail preference across attachment views
Gitesh307 b86c71e
Lint code with ESLint and Prettier
Gitesh307 19353ca
Drop obsolete entries from remote prefs which is now handled by Globa…
Gitesh307 c8594cb
Sync Global Preferences between user tools and App Resources
Gitesh307 17ccc8f
Lint code with ESLint and Prettier
Gitesh307 4a13cef
resolved multiobject returned error for sync global prefs
Gitesh307 b8a2c21
Add shared notifier for global preference json and UI sync
Gitesh307 05e2e9b
Revise .env file with database user details
Gitesh307 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
specifyweb/backend/workbench/upload/test_auditlog_prefs.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| from django.test import SimpleTestCase | ||
| from unittest.mock import patch | ||
|
|
||
| from specifyweb.backend.workbench.upload.auditlog import _extract_pref_bool, _get_pref_bool | ||
|
|
||
|
|
||
| class AuditLogPreferenceTests(SimpleTestCase): | ||
| def test_extract_pref_bool_parses_true_false(self) -> None: | ||
| self.assertTrue(_extract_pref_bool("auditing.do_audits=true", "auditing.do_audits")) | ||
| self.assertFalse(_extract_pref_bool("auditing.do_audits=false", "auditing.do_audits")) | ||
| self.assertIsNone(_extract_pref_bool("auditing.do_audits=maybe", "auditing.do_audits")) | ||
| self.assertIsNone(_extract_pref_bool("", "auditing.do_audits")) | ||
|
|
||
| @patch('specifyweb.backend.workbench.upload.auditlog.get_global_prefs', return_value="auditing.do_audits=false") | ||
| @patch('specifyweb.backend.workbench.upload.auditlog.get_remote_prefs', return_value="auditing.do_audits=true") | ||
| def test_prefers_global_preferences_when_present(self, _mock_remote, _mock_global) -> None: | ||
| self.assertFalse(_get_pref_bool("auditing.do_audits")) | ||
|
|
||
| @patch('specifyweb.backend.workbench.upload.auditlog.get_global_prefs', return_value="") | ||
| @patch('specifyweb.backend.workbench.upload.auditlog.get_remote_prefs', return_value="auditing.audit_field_updates=false") | ||
| def test_uses_remote_when_global_missing(self, _mock_remote, _mock_global) -> None: | ||
| self.assertFalse(_get_pref_bool("auditing.audit_field_updates")) | ||
|
|
||
| @patch('specifyweb.backend.workbench.upload.auditlog.get_global_prefs', return_value="") | ||
| @patch('specifyweb.backend.workbench.upload.auditlog.get_remote_prefs', return_value="") | ||
| def test_default_false_when_missing_everywhere(self, _mock_remote, _mock_global) -> None: | ||
| self.assertFalse(_get_pref_bool("auditing.do_audits")) | ||
|
|
||
| @patch('specifyweb.backend.workbench.upload.auditlog.get_global_prefs', return_value="") | ||
| @patch('specifyweb.backend.workbench.upload.auditlog.get_remote_prefs', return_value="") | ||
| def test_default_value_used_when_requested(self, _mock_remote, _mock_global) -> None: | ||
| self.assertTrue(_get_pref_bool("auditing.do_audits", default=True)) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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. 👍