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 standard filters for languages in the Set Targets step #2045

Merged
merged 10 commits into from
Aug 14, 2024

Conversation

rszwajko
Copy link
Collaborator

@rszwajko rszwajko commented Aug 2, 2024

Before, in the Set Targets step, if the languages were not pre-selected automatically then no cards were visible. In order to see target cards user had to select at least one language.
After this fix, all target cards will be visible.

Additional changes:

  1. wait (display a spinner) until all necessary queries finished before displaying Set Targets step
  2. improve error handling
    1. display error when targets could not be loaded
    2. silently ignore failed optional queries and continue without extra featues
  3. extract data fetching into one hook

Resolves: #2009
Resolves: https://issues.redhat.com/browse/MTA-3515

Copy link

codecov bot commented Aug 2, 2024

Codecov Report

Attention: Patch coverage is 17.24138% with 48 lines in your changes missing coverage. Please review.

Project coverage is 42.53%. Comparing base (b654645) to head (ff312e6).
Report is 213 commits behind head on main.

Files Patch % Lines
...pages/applications/analysis-wizard/set-targets.tsx 17.85% 45 Missing and 1 partial ⚠️
...src/app/components/FilterToolbar/FilterToolbar.tsx 0.00% 1 Missing ⚠️
client/src/app/queries/targets.ts 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2045      +/-   ##
==========================================
+ Coverage   39.20%   42.53%   +3.33%     
==========================================
  Files         146      171      +25     
  Lines        4857     5504     +647     
  Branches     1164     1370     +206     
==========================================
+ Hits         1904     2341     +437     
- Misses       2939     3046     +107     
- Partials       14      117     +103     
Flag Coverage Δ
client 42.53% <17.24%> (+3.33%) ⬆️
server ?

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@sjd78 sjd78 added this to the v0.5.1 milestone Aug 5, 2024
@sjd78 sjd78 added the cherry-pick/release-0.5 This PR should be cherry-picked to release-0.5 branch. label Aug 5, 2024
  - Track success status of both the `targets` and `tagCategories`
    queries

  - When they are both successful, then the pre-selection of targets
    providers based on application language tags can be done properly.

  - Use a `useEffect()` to do this here.  It mostly works but will
    reset the selection to default if any of the related queries
    refetch. (Switch browser tabs and the fetches will run again when
    the application become visible again)

Signed-off-by: Scott J Dickerson <[email protected]>
Copy link
Member

@sjd78 sjd78 left a comment

Choose a reason for hiding this comment

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

There are a few things that could be done a bit different, but the biggest issue is actually when the initial selection is made. The targets and tag catagories may not have landed yet...and that makes the UI look strange for a few moments.

@sjd78 sjd78 modified the milestones: v0.5.1, v0.5.2 Aug 7, 2024
Additional fetaures:
1. pre-fetch targets and tag categories to pre-filter targets
2. add error and loading handling

Signed-off-by: Radoslaw Szwajkowski <[email protected]>
@rszwajko
Copy link
Collaborator Author

rszwajko commented Aug 7, 2024

@sjd78
Changes:

  1. improved error handling (but based on wrapper that "waits" for data )
  2. filtering instead of selecting targets - based on feedback from https://issues.redhat.com/browse/MTA-3515

image

@rszwajko
Copy link
Collaborator Author

rszwajko commented Aug 7, 2024

@sjd78 @ibolton336
In the last commit I've managed to use our almighty table hooks to power the card view. This brings us closer to PF4 Card View pattern.
Missing parts:

  1. re-enable useSetting("ui.target.order")
  2. verify if we need the form to store the selection - the hook could handle that in similar way as in the table case

Fun fact ....it's not the first time when I'm moving from card to table view :) Check out oVirt/ovirt-web-ui#1600

Assume the setting is optional and do not block the flow if missing.

Signed-off-by: Radoslaw Szwajkowski <[email protected]>
Copy link
Member

@sjd78 sjd78 left a comment

Choose a reason for hiding this comment

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

Looking really good. Mostly comments in the data hook.

@rszwajko
Copy link
Collaborator Author

rszwajko commented Aug 9, 2024

Optional queries failed during initial load

The step loads correctly but lacks the features that depend on the optional queries:

  1. custom ordering
  2. pre-filtering based on discovered language tags

After both queries are unblocked the screen loads the missing features.

Screencast.from.2024-08-09.20-41-50.mp4

Required query failed

Without the targets the step has no data to work on - however the user still may skip the step and continue to the next one.

Screencast.from.2024-08-09.20-40-54.mp4

@rszwajko rszwajko changed the title 🐛 Choose initially selected languages from available providers 🐛 Use standard filters for languages in the Set Targets step Aug 13, 2024
@rszwajko rszwajko requested a review from sjd78 August 13, 2024 11:23
@rszwajko
Copy link
Collaborator Author

@JustinXHale
please take a look at screenshots above - basically we are moving towards standard Card View which means that we can add more filters or other features (sorting, paging, actions). We can also add a toggle that would allow users to switch to table or list view.

Copy link
Member

@sjd78 sjd78 left a comment

Choose a reason for hiding this comment

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

LGTM

@sjd78 sjd78 requested a review from JustinXHale August 13, 2024 19:36
@JustinXHale
Copy link
Member

@sjd78 @rszwajko LGTM!

@rszwajko rszwajko merged commit ab89b15 into konveyor:main Aug 14, 2024
12 checks passed
github-actions bot pushed a commit that referenced this pull request Aug 14, 2024
Before, in the Set Targets step, if the languages were not pre-selected
automatically then no cards were visible. In order to see target cards
user had to select at least one language.
After this fix,  all target cards will be visible.

Additional changes:
1. wait (display a spinner) until all necessary queries finished before
displaying Set Targets step
2. improve error handling
    1. display error when targets could not be loaded
2. silently ignore failed optional queries and continue without extra
featues
3. extract data fetching into one hook

Resolves: #2009
Resolves: https://issues.redhat.com/browse/MTA-3515

---------

Signed-off-by: Radoslaw Szwajkowski <[email protected]>
Signed-off-by: Scott J Dickerson <[email protected]>
Co-authored-by: Scott J Dickerson <[email protected]>
Signed-off-by: Cherry Picker <[email protected]>
sjd78 added a commit to sjd78/tackle2-ui that referenced this pull request Aug 20, 2024
…r#2045)

Before, in the Set Targets step, if the languages were not pre-selected
automatically then no cards were visible. In order to see target cards
user had to select at least one language.
After this fix,  all target cards will be visible.

Additional changes:
1. wait (display a spinner) until all necessary queries finished before
displaying Set Targets step
2. improve error handling
    1. display error when targets could not be loaded
2. silently ignore failed optional queries and continue without extra
featues
3. extract data fetching into one hook

Resolves: konveyor#2009
Resolves: https://issues.redhat.com/browse/MTA-3515

---------

Signed-off-by: Radoslaw Szwajkowski <[email protected]>
Signed-off-by: Scott J Dickerson <[email protected]>
Co-authored-by: Scott J Dickerson <[email protected]>
sjd78 added a commit that referenced this pull request Aug 20, 2024
…2055)

Before, in the Set Targets step, if the languages were not pre-selected
automatically then no cards were visible. In order to see target cards
user had to select at least one language.
After this fix,  all target cards will be visible.

Additional changes:
1. wait (display a spinner) until all necessary queries finished before
displaying Set Targets step
2. improve error handling
    1. display error when targets could not be loaded
2. silently ignore failed optional queries and continue without extra
featues
3. extract data fetching into one hook

Resolves: #2009
Resolves: https://issues.redhat.com/browse/MTA-3515

---------

Signed-off-by: Radoslaw Szwajkowski <[email protected]>
Signed-off-by: Scott J Dickerson <[email protected]>
Co-authored-by: Radoslaw Szwajkowski <[email protected]>
Co-authored-by: Scott J Dickerson <[email protected]>
Signed-off-by: Cherry Picker <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cherry-pick/release-0.5 This PR should be cherry-picked to release-0.5 branch.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] More selected languages then available in the Analysis Wizard
3 participants