-
Notifications
You must be signed in to change notification settings - Fork 23
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
enh(App): navigation tweaks for Contexts #1080
Conversation
const contextId = loadState('tables', 'contextId', undefined); | ||
const originalUrl = window.location.href | ||
this.$router.replace('/application/' + contextId).catch(() => {}) | ||
// reverts turning /apps/tables/app/28 into /apps/tables/app/28#/application/28 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like an OK approach for now.
We could also change the vue-router so that it uses the exact same routes as the backend defines, but that might require a few more changes to have the old urls still work.
nextcloud/deck@9f98f0b
https://github.com/nextcloud/deck/pull/1977/files
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
interesting switch! Thanks for the pointer
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good once CI is happy about linting and missing node dependency 🚀
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@blizzz This is magic 🧙 🪄
2ff034d
to
faa194e
Compare
- new page endpoint for contexts - no Tables navigation in "standalone" contexts Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
faa194e
to
c0cc6fd
Compare
Do we want this also in 0.7? |
/backport to stable0.7 |
This is a more finegrained approach to to #933. The PR introduces an endpoint for each Context, so they can have the correct navigation item highlighted from the beginning, solving a known papercut from #1037
It also sets an initial state, so that in Vue we can apply the actual route. Alas, the Vue Router adds the same information into the address bar, duplicating "app[lication]" and the context id. This is not nice. I reset it to the original URL (accepting #/), but it comes at the cost of flickering. In Vue the route cannot be applied without changing the address bar, which is a known drawback.
Another tweak: I disable the app navigation, when the Context is opened from its specific URL, making it more "standalone". Questionable if we want it. There are alternatives also: filtering the Tables and Views to only those included in the Context, and not showing applications; or (perhaps in future) a Context-specific app navigation (maybe relevant once we make use of pages).
What is not included in the Controller is a check whether a Context is actually having a navigation bar entry. So far we did not expose the setting, so all Contexts are shown there anyway. But even if not, I am not sure this is an issue (user has access anyways).
Please check the annotated video for a recorded quick tour.
context-nav-tweaks.mp4