-
Notifications
You must be signed in to change notification settings - Fork 49
feat(trees): sort Chronostrat tree by period instead of name, add ranges #8254
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
Merged
Merged
Changes from 29 commits
Commits
Show all changes
37 commits
Select commit
Hold shift + click to select a range
f6cd2cf
feat(trees): sort chronostrat by period
grantfitzsimmons 650af31
feat: add ranges to chronostrat
grantfitzsimmons 8e7229b
fix: minor localization improvement
grantfitzsimmons dd261a5
feat(trees): make the start and end period smaller
grantfitzsimmons 7d0a3c6
fix: add geologic time period labels
grantfitzsimmons 0c5d1b4
fix(trees): hide uncertainty where there is none
grantfitzsimmons 32b81ac
Lint code with ESLint and Prettier
grantfitzsimmons c996d2f
fix: prevent localization stripping
grantfitzsimmons 874f962
refactor(trees): simplify label construction
grantfitzsimmons 21fe094
fix(tests): add new parameter
grantfitzsimmons 241ad64
Merge branch 'issue-6049' of https://github.com/specify/specify7 into…
grantfitzsimmons 137f7a5
Lint code with ESLint and Prettier
grantfitzsimmons 264c0c4
feat(trees): add biostrat filter to chronostrat
grantfitzsimmons 373a144
feat: remove weird capitalization
grantfitzsimmons 4e5774b
feat(trees): make `biostrat` search only biostrat records
grantfitzsimmons 3d1d576
fix(QueryComboBox): filter BioStrat properly
grantfitzsimmons 20a7100
Lint code with ESLint and Prettier
grantfitzsimmons 897fb1b
feat(trees): add biostrat search filtering
grantfitzsimmons 87ab9a2
fix(QueryComboBox): fix search in qcbx dialog
grantfitzsimmons 21a40a1
Merge branch 'issue-8256' of https://github.com/specify/specify7 into…
grantfitzsimmons 90f0ed9
Lint code with ESLint and Prettier
grantfitzsimmons 41b8c02
feat(tests): add BioStrat filter tests
grantfitzsimmons 7d49186
Merge branch 'issue-8256' of https://github.com/specify/specify7 into…
grantfitzsimmons 7bc61a2
Lint code with ESLint and Prettier
grantfitzsimmons 8ca11a3
fix(trees): make sure arrows appear correctly
grantfitzsimmons 1d289f3
Merge branch 'issue-8256' of https://github.com/specify/specify7 into…
grantfitzsimmons 15fa14b
fix(trees): filter tree descendants by biostrat
grantfitzsimmons 56be873
Merge pull request #8257 from specify/issue-8256
grantfitzsimmons 2552c74
Lint code with ESLint and Prettier
grantfitzsimmons f87e791
Merge origin/main into issue-6049 and resolve trees conflict
Copilot 4e666b7
Merge remote-tracking branch 'origin/issue-6049' into issue-6049
Copilot 1910390
Update specifyweb/frontend/js_src/lib/components/TreeView/index.tsx
grantfitzsimmons 0bcf1fd
fix: remove unused import
grantfitzsimmons 9705c73
Test: Fix backend tree tests
b06e6c5
Merge branch 'main' into issue-6049
CarolineDenis ea43a4e
Fix: Fix localization
d352b11
Potential fix for pull request finding 'CodeQL / Testing equality to …
CarolineDenis 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
Large diffs are not rendered by default.
Oops, something went wrong.
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
71 changes: 71 additions & 0 deletions
71
specifyweb/frontend/js_src/lib/components/QueryComboBox/__tests__/biostratConditions.test.ts
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,71 @@ | ||
| import { requireContext } from '../../../tests/helpers'; | ||
| import { serializeResource } from '../../DataModel/serializers'; | ||
| import { tables } from '../../DataModel/tables'; | ||
| import { queryFieldFilterSpecs } from '../../QueryBuilder/FieldFilterSpec'; | ||
| import { getQueryComboBoxConditions } from '../helpers'; | ||
|
|
||
| requireContext(); | ||
|
|
||
| describe('getQueryComboBoxConditions with BioStrat typeSearchName', () => { | ||
| const getBaseParams = () => ({ | ||
| // Use a non-tree resource to avoid toTreeTable() requiring tree data | ||
| resource: new tables.CollectionObject.Resource( | ||
| {}, | ||
| { noBusinessRules: true } | ||
| ), | ||
| fieldName: 'name' as const, | ||
| treeData: undefined, | ||
| collectionRelationships: undefined, | ||
| relatedTable: tables.GeologicTimePeriod, | ||
| subViewRelationship: undefined, | ||
| treeDefinition: undefined, | ||
| }); | ||
|
|
||
| test('adds isBioStrat=true filter when typeSearchName is BioStrat', () => { | ||
| const conditions = getQueryComboBoxConditions({ | ||
| ...getBaseParams(), | ||
| typeSearchName: 'BioStrat', | ||
| }); | ||
| const serialized = conditions.map(serializeResource); | ||
| expect(serialized).toContainEqual( | ||
| expect.objectContaining({ | ||
| fieldName: 'isBioStrat', | ||
| startValue: 'true', | ||
| operStart: queryFieldFilterSpecs.true.id, | ||
| }) | ||
| ); | ||
| }); | ||
|
|
||
| test('does NOT add isBioStrat filter when typeSearchName is something else', () => { | ||
| const conditions = getQueryComboBoxConditions({ | ||
| ...getBaseParams(), | ||
| typeSearchName: 'ChronosStrat', | ||
| }); | ||
| const serialized = conditions.map(serializeResource); | ||
| expect( | ||
| serialized.filter(({ fieldName }) => fieldName === 'isBioStrat') | ||
| ).toHaveLength(0); | ||
| }); | ||
|
|
||
| test('does NOT add isBioStrat filter when typeSearchName is undefined', () => { | ||
| const conditions = getQueryComboBoxConditions({ | ||
| ...getBaseParams(), | ||
| }); | ||
| const serialized = conditions.map(serializeResource); | ||
| expect( | ||
| serialized.filter(({ fieldName }) => fieldName === 'isBioStrat') | ||
| ).toHaveLength(0); | ||
| }); | ||
|
|
||
| test('does NOT add isBioStrat filter for non-GeologicTimePeriod tables', () => { | ||
| const conditions = getQueryComboBoxConditions({ | ||
| ...getBaseParams(), | ||
| relatedTable: tables.Taxon, | ||
| typeSearchName: 'BioStrat', | ||
| }); | ||
| const serialized = conditions.map(serializeResource); | ||
| expect( | ||
| serialized.filter(({ fieldName }) => fieldName === 'isBioStrat') | ||
| ).toHaveLength(0); | ||
| }); | ||
| }); |
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.