-
Notifications
You must be signed in to change notification settings - Fork 10
feat(tabs): provide canActivate and canDeactivate guards #716
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
Conversation
timowolf
left a comment
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.
Many thanks, while the implementation is great, can you please also add the canActivate to the example. E.g. Does it make sense to show a tab that cannot be activated? Or should it be hidden @panch1739
3b9c2fb to
ce3a8f7
Compare
timowolf
left a comment
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.
LGTM
added `SiTabComponent.canActivate` and `SiTabComponent.canDeactivate` to control activation/deactivation of tabs similar to angular router guards.
ce3a8f7 to
fd73807
Compare
If I understand correctly, when a tab/route is protected by canActivate, the user may click it and nothing happens because they don’t have access. From a UX perspective this feels broken, since the system is silently blocking navigation. I would suggest:
@timowolf @chintankavathia would that be possible? maybe we can add a short guide? |
@panch1739 sorry for the confusion. Apps can provide the feedback (e.g navigate to info page or show a toast message etc) when tab is clicked but is protected by canActivate. |
Ann thanks @chintankavathia! Would it be possible to add this sort of guideline somewhere? I think it would be nice to mention that...
@timowolf what do you think? |
@panch1739 @timowolf added some explanation here https://github.com/siemens/element/pull/735/files let me know if this works |
@chintankavathia amazing! Thank you. Lets hear what Timo thinks ;) |
|
🎉 This PR is included in version 48.1.0 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
added
SiTabComponent.canActivateandSiTabComponent.canDeactivateto control activation/deactivation of tabs similar to angular router guards.