We cannot: * have something else than a router-link * have a link outside of the app (it needs to be a Vue route)
Created attachment 153085 [details] [review] Bug 34215: Introduce a ToolbarButton Vue component Our toolbar component is not flexible enough, we cannot: * have something else than a router-link * have a link outside of the app (it needs to be a Vue route) This patch adds a ToolbarButton component that is used for existing button. But other buttons can be added without being a router-link. Test plan: No change in behaviour here! Test the buttons in the 4 existing toolbar (in the ERM module) Sponsored-by: BULAC - http://www.bulac.fr/
Created attachment 153086 [details] [review] Bug 34215: Introduce a ToolbarButton Vue component Our toolbar component is not flexible enough, we cannot: * have something else than a router-link * have a link outside of the app (it needs to be a Vue route) This patch adds a ToolbarButton component that is used for existing button. But other buttons can be added without being a router-link. Test plan: No change in behaviour here! Test the buttons in the 4 existing toolbar (in the ERM module) Sponsored-by: BULAC - http://www.bulac.fr/
Created attachment 153087 [details] [review] Bug 34215: Introduce a ToolbarButton Vue component Our toolbar component is not flexible enough, we cannot: * have something else than a router-link * have a link outside of the app (it needs to be a Vue route) This patch adds a ToolbarButton component that is used for existing button. But other buttons can be added without being a router-link. Test plan: No change in behaviour here! Test the buttons in the 4 existing toolbar (in the ERM module) Sponsored-by: BULAC - http://www.bulac.fr/
In ToolbarButton.vue, does 'to' need to be '[String, Object]' or can/should it just be 'Object'?
(In reply to Pedro Amorim from comment #4) > In ToolbarButton.vue, does 'to' need to be '[String, Object]' or can/should > it just be 'Object'? Can be a string I think, if you want to pass the URL directly (not name). That's why I decided to pass { name: 'RouteName' } instead of 'RouteName'. It's more flexible like that IMO
I see, that makes sense! Looking at https://router.vuejs.org/guide/essentials/named-routes.html router-link allows for either direct path or a route by name, which is what we're replicating here in ToolbarButton.
Created attachment 153179 [details] [review] Bug 34215: Introduce a ToolbarButton Vue component Our toolbar component is not flexible enough, we cannot: * have something else than a router-link * have a link outside of the app (it needs to be a Vue route) This patch adds a ToolbarButton component that is used for existing button. But other buttons can be added without being a router-link. Test plan: No change in behaviour here! Test the buttons in the 4 existing toolbar (in the ERM module) Sponsored-by: BULAC - http://www.bulac.fr/ Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Created attachment 156087 [details] [review] Bug 34215: Introduce a ToolbarButton Vue component Our toolbar component is not flexible enough, we cannot: * have something else than a router-link * have a link outside of the app (it needs to be a Vue route) This patch adds a ToolbarButton component that is used for existing button. But other buttons can be added without being a router-link. Test plan: No change in behaviour here! Test the buttons in the 4 existing toolbar (in the ERM module) Sponsored-by: BULAC - http://www.bulac.fr/ Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Pushed to master for 23.11. Nice work everyone, thanks!
Enhancement not pushed to 23.05.x