Skip to content
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

Add group number support in Taxon queries #4724

Open
wants to merge 2 commits into
base: production
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ export type MappingLineData = Pick<
readonly defaultValue: string;
};

const queryBuilderTreeFields = new Set(['fullName', 'author']);
const queryBuilderTreeFields = new Set(['fullName', 'author', 'groupNumber']);

/**
* Get data required to build a mapping line from a source mapping path
Expand Down
2 changes: 1 addition & 1 deletion specifyweb/stored_queries/queryfieldspec.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
DATE_PART_RE = re.compile(r'(.*)((NumericDay)|(NumericMonth)|(NumericYear))$')

# Pull out author or groupnumber field from taxon query fields.
TAXON_FIELD_RE = re.compile(r'(.*) ((Author)|(GroupNumber))$')
TAXON_FIELD_RE = re.compile(r'(.*) ((Author)|(groupNumber))$')
Copy link
Member

Choose a reason for hiding this comment

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

FYI: from what Ben told me, the only reason we limit what fields are accessible in tree queries is because that's what sp6 did
that reason might be less good today compared to how it was in 2013.
@realVinayak interested in tackling this at some point?

Copy link
Collaborator

Choose a reason for hiding this comment

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

See #4929. Begun some work there. now need to add tests to ensure compatibility with 6.


# Look to see if we are dealing with a tree node ID.
TREE_ID_FIELD_RE = re.compile(r'(.*) (ID)$')
Expand Down