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

Use Filtering class to get and set filter texts #15996

Merged

Conversation

ahmedhamidawan
Copy link
Member

@ahmedhamidawan ahmedhamidawan commented Apr 25, 2023

There are several improvements to Filtering in this PR:

Using the Filtering class to apply and get filterTexts:

Instead of setting filters values like so:

setFilter("deleted:true");

Or like:

let filterText = "";
if (item.hid) {
    filterText = `hid:${item.hid}`;
    if (item.deleted) {
        filterText += " deleted:true";
    }
    if (!item.visible) {
        filterText += " visible:false";
    }
}
await this.applyFilterText(historyId, filterText);

We are now able to pass filters as objects:

const filters = {
    deleted: item.deleted,
    visible: item.visible,
    hid: item.hid,
};
await this.applyFilters(history_id, filters);

Converting the buttons in HistoryCounter to "Include deleted/visible"

The buttons in the HistoryCounter as of now work as toggles that will either show ONLY deleted items if you click the deleted button, and vice versa for the visible button
Changed this so the tooltips say "Include Deleted" instead, so users can click the buttons and include deleted or hidden items upon clicking on these buttons:

Screen.Recording.2023-05-02.at.11.22.33.PM.mov

Keeping HistoryPanel filterTextin sync with the historyStore:

Fixes #15990
We keep the current HistoryPanel and historyStore.storedFilterText in sync:

Screen.Recording.2023-04-25.at.2.35.24.PM.mov

How to test the changes?

(Select all options that apply)

  • I've included appropriate automated tests.
  • This is a refactoring of components with existing test coverage.
  • Instructions for manual testing are as follows:
    1. [add testing steps and prerequisites here if you didn't write automated tests covering all your changes]

License

  • I agree to license these and all my past contributions to the core galaxy codebase under the MIT license.

@ahmedhamidawan ahmedhamidawan force-pushed the track_store_filtertext_in_panel branch from e812906 to 0b6dfed Compare April 25, 2023 20:22
@ahmedhamidawan ahmedhamidawan changed the title Track filterText from historyStore in HistoryPanel Use Filtering class to get and set filter texts May 3, 2023
@ahmedhamidawan ahmedhamidawan marked this pull request as ready for review May 3, 2023 03:24
@github-actions github-actions bot added this to the 23.1 milestone May 3, 2023
Copy link
Contributor

@davelopez davelopez left a comment

Choose a reason for hiding this comment

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

Thank you so much @ahmedhamidawan!

This is already an awesome improvement! I'm looking forward to the next refactoring to reduce juggling around "filterText" 👍

@ahmedhamidawan ahmedhamidawan added the kind/refactoring cleanup or refactoring of existing code, no functional changes label May 6, 2023
@ahmedhamidawan
Copy link
Member Author

Failed test:

FAILED test/integration_selenium/test_user_library_permissions.py::TestUserLibraryImport::test_user_library_import_dir_warning

seems unrelated

@davelopez davelopez merged commit af6b3b9 into galaxyproject:dev May 10, 2023
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/UI-UX kind/enhancement kind/refactoring cleanup or refactoring of existing code, no functional changes
Projects
Development

Successfully merging this pull request may close these issues.

History dataset visibility is reset after viewing collection items.
3 participants