Skip to content
This repository has been archived by the owner on Jan 19, 2023. It is now read-only.

Show octant route history in the header #2580

Merged

Conversation

xtreme-vikram-yadav
Copy link
Contributor

What this PR does / why we need it:

  • Updates page title to be more descriptive.
  • Show a history dropdown in the header displaying the last 10 visited pages.
  • Applications detail page has a generated breadcrumb and hence a title.

Which issue(s) this PR fixes

@GuessWhoSamFoo
Copy link
Contributor

Consider the following scenario:

The user has switched namespaces multiple times then proceeded to visit cert-manager service followed by a cert-manager deployment.

image

Two approaches come to mind for tacking this problem:

  1. Create a history for each namespace
  2. Add more metadata about namespace scoped paths/objects such that one overview can be distinguished from another

@xtreme-vikram-yadav
Copy link
Contributor Author

Adding namespace to the history is straightforward as it is already a part of content response and since history is for octant app, showing scoped history makes sense.

@xtreme-vikram-yadav xtreme-vikram-yadav force-pushed the route-history branch 3 times, most recently from 44f6bc1 to eb1a127 Compare June 30, 2021 20:04
@wwitzel3
Copy link
Contributor

Please add a changelog entry for this.

@xtreme-vikram-yadav xtreme-vikram-yadav force-pushed the route-history branch 5 times, most recently from c95ae58 to d87441a Compare July 16, 2021 00:56
Copy link
Contributor

@lenriquez lenriquez left a comment

Choose a reason for hiding this comment

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

It LGTM, the only two things and both of them don't really apply to the electron app

  • if I start Octant on an specific URL like http:https://localhost:7777/#/cluster-overview/namespaces this URL does not get saved on the History, I think Sam point out that as well ()
  • And if the page does not load completely is does not show in history


func getNamespace(state octant.State, contentPath string, cm *ContentManager) string {
m, ok := cm.moduleManager.ModuleForContentPath(contentPath)
if ok && m.Name() == "cluster-overview" {
Copy link
Contributor

Choose a reason for hiding this comment

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

Every time I read this if it takes me a while to realize why is there, just a suggestion, it will be nice a comment

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It LGTM, the only two things and both of them don't really apply to the electron app

  • if I start Octant on an specific URL like http:https://localhost:7777/#/cluster-overview/namespaces this URL does not get saved on the History, I think Sam point out that as well ()
  • And if the page does not load completely is does not show in history

@lenriquez your second point is valid. I thought about it as well. I was thinking that a user has not successfully landed on a page unless the content is not yet rendered and hence, history uses content event to determine successful routing.

@xtreme-vikram-yadav xtreme-vikram-yadav force-pushed the route-history branch 6 times, most recently from 8a7ec76 to 9908802 Compare July 23, 2021 21:37
@xtreme-vikram-yadav
Copy link
Contributor Author

@GuessWhoSamFoo @lenriquez This feature can be improved further by using local storage so that the history is not lost on page refresh. I'm working on adding this as this greatly improve the experience.

@wwitzel3
Copy link
Contributor

wwitzel3 commented Jul 27, 2021

One final task this, needs prettier run

[warn] src/app/modules/shared/services/history/history.service.ts
[warn] Code style issues found in the above file(s). Forgot to run Prettier?

- Show descriptive page title
- Update octant content response to return empty namespace for non-namespaced resources
[vmware-archive#2472, vmware-archive#2640]

Signed-off-by: Vikram Yadav <[email protected]>
Copy link
Contributor

@GuessWhoSamFoo GuessWhoSamFoo left a comment

Choose a reason for hiding this comment

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

Well done

@GuessWhoSamFoo GuessWhoSamFoo merged commit f6ef1a0 into vmware-archive:master Jul 29, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Auto Generate Breadcrumbs
4 participants