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

Tools: Be able to change models of tasks and assets widgets #2475

Merged
merged 3 commits into from
Jan 4, 2022

Conversation

iLLiCiTiT
Copy link
Member

@iLLiCiTiT iLLiCiTiT commented Jan 4, 2022

Brief description

Be able to create different source model for assets widget and tasks widget.

Description

In some cases it is better to use different model for assets and tasks widget which is based on different source of data. For example when a tool is querying asset documents for it's purposes then triggers refresh of assets widget. In that case the same data are queried twice which makes loading of tool slower. At the same time a tool may require custom filtering of assets or tasks which is not possible right now. Both use cases would require to create whole new asset or task widget for the tool which is duplication of code.

Changes

  • tasks and asset widget have methods to create model and proxy model
    • this way it is easy to inherit from the class and override those methods to define different source of data
  • clearing of model of refresh is handled in _refresh_model because if may not be possible for custom model to do so

Note

  • This change is needed for 2 or more other features that are long term so it would be hard to maintain those changes

Testing notes:

  1. Everything should work as before

@iLLiCiTiT iLLiCiTiT self-assigned this Jan 4, 2022
@iLLiCiTiT iLLiCiTiT added the type: enhancement Enhancements to existing functionality label Jan 4, 2022
Copy link
Member

@kalisp kalisp left a comment

Choose a reason for hiding this comment

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

Still working as expected

@iLLiCiTiT iLLiCiTiT merged commit f20148b into develop Jan 4, 2022
@iLLiCiTiT iLLiCiTiT deleted the feature/changable_models_of_task_asset_widgets branch January 5, 2022 15:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement Enhancements to existing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants