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

WP-59: Reload app page after every navigation #920

Merged
merged 4 commits into from
Dec 19, 2023

Conversation

asimregmi
Copy link
Contributor

@asimregmi asimregmi commented Dec 15, 2023

Overview

After job submission, the success message will hang at the top of the screen even if you navigate away and back to the app (without refreshing the browser).

Direction
To replicate:

  1. submit a job (i.e. paraview)
  2. Click the "Allocations" button on the left hand sidebar
  3. Go back to the "Applications" view on the left hand sidebar
  4. Click Visualization -> Paraview
    image

Related

Changes

  • added a useEffect and useHistory to listen for navigation changes and reset the jobSubmission properties
  • removed logic to not reload an app if it's already currentApp exists
    if (
    currentApp.definition.id === appId &&
    currentApp.definition.version === appVersion &&
    !currentApp.systemNeedsKeys
    ) {

Testing

  1. Submit paraview job and navigate to allocations and go back to the paraview app. The message should go away.
  2. Confirm other error message still shows and doesn't go away (for example the Matlab license in the screenshot below)

UI

Message reset after changing tabs
image
Other error message still renders correctly
image

Notes

I investigated this behavior and have included comment on why this might be happening on the Jira ticket WP-59. Sal mentioned other solution which might work - "It may be possible to only use get_app, but we'll need to ensure we can handle the request properly on the backend to look for html in the database for the app record instead of sending a request to tapis for html apps." I tried other methods to reset the message after app loads successfully, added a useEffect hook for LOAD_APP & GET_APP dispatchers but this solution seemed to work the best.

Update:
After suggestions from Sal, I updated the logic on app.sagas.js to reload an app everytime it is clicked so the issue above issue is solved.

Copy link

codecov bot commented Dec 15, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (272c632) 63.49% compared to head (8c86f01) 63.52%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #920      +/-   ##
==========================================
+ Coverage   63.49%   63.52%   +0.03%     
==========================================
  Files         431      431              
  Lines       12430    12424       -6     
  Branches     2595     2591       -4     
==========================================
  Hits         7892     7892              
+ Misses       4322     4317       -5     
+ Partials      216      215       -1     
Flag Coverage Δ
javascript 69.81% <ø> (+0.06%) ⬆️
unittests 57.11% <ø> (ø)

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

Files Coverage Δ
...nt/src/components/Applications/AppForm/AppForm.jsx 84.08% <ø> (ø)
client/src/redux/sagas/apps.sagas.js 22.22% <ø> (+4.04%) ⬆️

@asimregmi asimregmi marked this pull request as ready for review December 15, 2023 23:36
Copy link
Member

@rstijerina rstijerina left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Contributor

@shayanaijaz shayanaijaz left a comment

Choose a reason for hiding this comment

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

LGTM

@chandra-tacc chandra-tacc merged commit dc6d0c8 into main Dec 19, 2023
6 checks passed
@chandra-tacc chandra-tacc deleted the WP-59--reset-message-in-app-form-on-load branch December 19, 2023 21:23
@chandra-tacc chandra-tacc changed the title useEffect to handle rendered message behvaior WP-59: Reload app page after every navigation Dec 19, 2023
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.

4 participants