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 SpecifyUser to Query Combo Box in Export Feed #4345

Merged
merged 8 commits into from
Jan 3, 2024
Merged

Conversation

realVinayak
Copy link
Collaborator

@realVinayak realVinayak commented Jan 2, 2024

Added a typeSearch to allow searching. Users will have to configure a formatter for SpecifyUser to see anything other than <Formatter not defined>

Testing instructions
0. Make sure you have a formatter defined for SpecifyUser table. Add one if not.

  1. Go to ExportFeed resource in xml-editor.
  2. Go to Run as user or Send completion notification to user field (which is query combo box)
  3. Make sure you are able to search for different users in those combo boxes
    image

It is rare that databases will have a formatter for specifyUser (but that's easy to add with xml-editor, so I think it is fine). Until #4312 is merged, SpecifyUser won't be visible in table list for visual editor. So, the following can be added to record object formatters to add a basic formatter for SpecifyUser

<format
    name="SpecifyUser"
    title="SpecifyUser"
    class="edu.ku.brc.specify.datamodel.SpecifyUser"
    default="true"
    >
    <switch single="true">
        <fields>
            <field>name</field>
        </fields>
    </switch>
</format>

@realVinayak realVinayak added this to the 7.9.4 milestone Jan 2, 2024
@realVinayak realVinayak linked an issue Jan 2, 2024 that may be closed by this pull request
Copy link
Member

@maxpatiiuk maxpatiiuk left a comment

Choose a reason for hiding this comment

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

now that you identified the solution, I can see what might have caused it:

typeSearches.find(({ name }) => name === initialTypeSearch) ??
typeSearches.find(({ table }) => table === relatedTable) ??

that code says that if type search wasn't explicitly passed, it would try to find a type search for the specify user table

probably I had a type search for specify user defined in my database when I was testing this, but your database doesn't?

if that is the case, your solution is good - this kind of stuff shouldn't be database dependent

and even better, if typesearch doesn't exist, we might be able to define one on the fly dynamically for any table (out of scope of this PR though)

@realVinayak realVinayak requested review from CarolineDenis and a team January 3, 2024 14:25
@realVinayak realVinayak marked this pull request as ready for review January 3, 2024 14:25
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.

I did have to add the formater but it looks good and you can search for users.
Screenshot 2024-01-03 085547

@realVinayak realVinayak merged commit b365aff into xml-editor Jan 3, 2024
9 checks passed
@realVinayak realVinayak deleted the issue-4334 branch January 3, 2024 17:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

xml-editor: Specify user query combo does not work in ExportFeed
4 participants