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

feat: Add app list and details page views to navigation history (#7776) #7937

Conversation

keithchong
Copy link
Contributor

@keithchong keithchong commented Dec 14, 2021

Signed-off-by: Keith Chong kykchong@redhat.com

Fixes #7776

Both Application List page view and Details page views are added to the navigation history

Some points to consider:

A. Tab independence (For a specific situation when view is not a query parameter)

  1. Open a new browser window
  2. In a new tab (tab A) go to https://cd.apps.argoproj.io/
    —> App List page
  3. Open a new tab (tab B) and go to https://cd.apps.argoproj.io/
    —> App List page
  4. In this current tab, switch to the Summary page
  5. Switch back to tab A
    —> The page refreshed to the Summary page. This is because it gets the last preferred view

With the fix, the tab will remain on the Tiles view. Launching Argo CD UI without view the query param will always show the Tiles view.

B. With the fix, Clicking on the Sync Windows link brings you to the Settings page and then you want to click on Back to go back to the details page.

C. With the fix, Back and Forward button 'history' will have new unique titles. eg. "Application List - Argo CD"

D. With the fix, the Tool bar title text is now dynamic, but if you want it to remain the same as before, we just have to revert the title change.

eg. original titles for the app list page and details page, respectively:
"APPLICATIONS" and "APPLICATION DETAILS"

With Fix:
"APPLICATIONS TILES", "APPLICATIONS LIST", "APPLICATIONS SUMMARY"

"APPLICATION DETAILS TREE", "APPLICATION DETAILS PODS", "APPLICATION DETAILS NETWORK", "APPLICATION DETAILS LIST"

E. Behaviour of the Back and Forward buttons on the App List page presented additional issues that do not exist in the details page.

F. Clicking on the Applications link from the details page will bring you back to the Tiles view of the applications list page, because of point A.

Note on DCO:

If the DCO action in the integration test fails, one or more of your commits are not signed off. Please click on the Details link next to the DCO action for instructions on how to resolve this.

Checklist:

  • Either (a) I've created an enhancement proposal and discussed it with the community, (b) this is a bug fix, or (c) this does not need to be in the release notes.
  • The title of the PR states what changed and the related issues number (used for the release note).
  • I've included "Closes [ISSUE #]" or "Fixes [ISSUE #]" in the description to automatically close the associated issue.
  • I've updated both the CLI and UI to expose my feature, or I plan to submit a second PR with them.
  • Does this PR require documentation updates?
  • I've updated documentation as required by this PR.
  • Optional. My organization is added to USERS.md.
  • I have signed off all my commits as required by DCO
  • I have written unit and/or e2e tests for my change. PRs without these are unlikely to be merged.
  • My build is green (troubleshooting builds).

@codecov
Copy link

codecov bot commented Dec 14, 2021

Codecov Report

Merging #7937 (0946c36) into master (27af0b4) will decrease coverage by 0.00%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #7937      +/-   ##
==========================================
- Coverage   41.53%   41.53%   -0.01%     
==========================================
  Files         174      174              
  Lines       22736    22705      -31     
==========================================
- Hits         9443     9430      -13     
+ Misses      11949    11921      -28     
- Partials     1344     1354      +10     
Impacted Files Coverage Δ
controller/sync.go 57.51% <0.00%> (-7.63%) ⬇️
server/application/application.go 31.20% <0.00%> (-1.45%) ⬇️
util/session/sessionmanager.go 68.75% <0.00%> (-1.37%) ⬇️
reposerver/repository/repository.go 57.80% <0.00%> (-0.84%) ⬇️
util/localconfig/localconfig.go 2.77% <0.00%> (-0.32%) ⬇️
server/project/project.go 52.50% <0.00%> (-0.19%) ⬇️
util/clusterauth/clusterauth.go 66.66% <0.00%> (-0.16%) ⬇️
util/rbac/rbac.go 76.47% <0.00%> (-0.03%) ⬇️
util/argo/diff/diff.go 52.27% <0.00%> (ø)
util/argo/diff/ignore.go 100.00% <0.00%> (ø)
... and 9 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 27af0b4...0946c36. Read the comment docs.

@keithchong keithchong requested review from pasha-codefresh, reginapizza and alexmt and removed request for reginapizza December 15, 2021 14:06
@keithchong keithchong requested a review from ciiay January 7, 2022 19:31
Copy link
Contributor

@ciiay ciiay left a comment

Choose a reason for hiding this comment

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

Looks good to me! Only added a few code improvement suggestions, and I know we are not doing destructuring in this whole project ... I hope in the next UI version we can do more destructuring so that we don't have to write props. every time.

@keithchong keithchong force-pushed the 7776-AddAppListAndDetailsToNavigationHistory branch 2 times, most recently from 99c8f75 to 81e88bb Compare January 10, 2022 22:02
@keithchong
Copy link
Contributor Author

keithchong commented Jan 10, 2022

Rebased. Hi @alexmt or @pasha-codefresh, could either one of you review this and try it out?

className={`argo-table-list__row applications-list__entry applications-list__entry--health-${app.status.health.status} ${
selectedApp === i ? 'applications-tiles__selected' : ''
}`}>
<div className='row' onClick={e => ctx.navigation.goto(`/applications/${app.metadata.name}`, {view: pref.appDetails.view}, {event: e})}>
Copy link
Collaborator

Choose a reason for hiding this comment

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

The application details page already loads view preferences and uses the correct view type. As far as I understand there is no specify view type in query parameter here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi @alexmt, yeah, it loads and selects the proper view fine, initially. It's just that we need to properly register it in the navigation history. Try this, with and without the changes to this file, for comparison:

  1. Launch Argo CD UI in a new browser tab, with existing apps already created
  2. Drill down to the details view of an application
  3. Switch to another view of the app (eg network or pods)
  4. Press the Back button
    --> It does not change the view (without the changes to this file)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually. we need to force using the query parameter, otherwise, the view doesn't change because the current view is actually the preferred view.

@keithchong keithchong force-pushed the 7776-AddAppListAndDetailsToNavigationHistory branch from 81e88bb to 0946c36 Compare January 14, 2022 18:40
Copy link
Collaborator

@alexmt alexmt 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 @keithchong . LGTM

@alexmt alexmt merged commit 6f59fe6 into argoproj:master Jan 14, 2022
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.

Add app list and details page specific views to navigation history (regression in behavior)
3 participants