Skip to content

Advanced search #15

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

Draft
wants to merge 28 commits into
base: master
Choose a base branch
from
Draft

Advanced search #15

wants to merge 28 commits into from

Conversation

jmedinaebi
Copy link

Advance search with pagination

EliotRagueneau and others added 9 commits April 1, 2025 19:12
🐛 Avoid failing color query if too many taxids
- adding of the rulesets and the synchronisation with the query;
- synchronisation between typed in query and comboboxes; still 2 bugs to fix
- "in" and "not in" better detected but duplication happens when in a ruleset
- adding of display elements ([TO] for the ranges)
Deletion of subpanels OK;
Coloring of the text input;
Adding of tests;
… case of no positives);

Fetching on dev server;
Modification of advanced search display;
Copy link
Author

@jmedinaebi jmedinaebi left a comment

Choose a reason for hiding this comment

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

Just a few comments to clean up things a bit.

boolean isTherePositiveInteractions = ((EdgePositiveFilter) filter).areTheyPositiveInteractions();

negativeButton.setSelected(isThereNegativeInteractions && !isTherePositiveInteractions);
positiveButton.setSelected(isTherePositiveInteractions);
Copy link
Author

Choose a reason for hiding this comment

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

We don't set the bothButton here, should we?

Copy link
Author

Choose a reason for hiding this comment

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

I think I understand what's happening here. To make it more clear, we could do

// First we set all 3 buttons as not selected
positiveButton.setSelected(false);
negativeButton.setSelected(false);
bothButton.setSelected(false);

// Then, if there are positive interactions, we set the positive button as default.
// If not, and there are negative interactions, we set the negative button as default.
if (((EdgePositiveFilter) filter).areTheyPositiveInteractions()) {
    positiveButton.setSelected(true);
} else if (((EdgePositiveFilter) filter).areTheyNegativeInteractions()) {
    negativeButton.setSelected(true);
}

Copy link
Author

Choose a reason for hiding this comment

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

Actually, we do this after calling setButtonsEnabled(), so maybe it's even simpler. We can simply do

    @Override
    protected void updateFilterUI(BooleanFilter<T> filter) {
        label.setText(filter.description);
        setButtonsEnabled();

        positiveButton.setSelected(false);
        negativeButton.setSelected(false);
        bothButton.setSelected(false);

        if (positiveButton.isEnabled()) {
            positiveButton.setSelected(true);
        } else if (negativeButton.isEnabled()) {
            negativeButton.setSelected(true);
        }
    }

boolean shouldEnableFilter = showPositive || showNegative;
filter.setStatus(shouldEnableFilter);

positiveButton.setSelected(false);
Copy link
Author

Choose a reason for hiding this comment

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

Why do we set all 3 buttons here selected as false?

Copy link
Author

Choose a reason for hiding this comment

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

I think I understand, we set all 3 buttons as unselected, and then the button that was clicked gets set as selected as part of addActionListener. Is that right?

.uri(URI.create(url))
.POST(HttpRequest.BodyPublishers.ofString(mapper.writeValueAsString(body)))
Copy link
Author

Choose a reason for hiding this comment

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

I created a new endpoint in the GraphDB-WS, and it is deployed now. Endpoints is to replace network/data with a proper request body. It is named network/fromInteractors to be consistent with the other one.

I haven't tested this, so we should test it before this is merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants