Bug 34215

Summary: Vue Toolbar component should be more flexible
Product: Koha Reporter: Jonathan Druart <jonathan.druart>
Component: ERMAssignee: Jonathan Druart <jonathan.druart>
Status: CLOSED FIXED QA Contact:
Severity: enhancement    
Priority: P5 - low CC: fridolin.somers, jonathan.druart, jonathan.field, martin.renvoize, matt.blenkinsop, pedro.amorim
Version: unspecified   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
23.11.00
Circulation function:
Bug Depends on: 33417, 34214    
Bug Blocks: 30708, 38854, 35919    
Attachments: Bug 34215: Introduce a ToolbarButton Vue component
Bug 34215: Introduce a ToolbarButton Vue component
Bug 34215: Introduce a ToolbarButton Vue component
Bug 34215: Introduce a ToolbarButton Vue component
Bug 34215: Introduce a ToolbarButton Vue component

Description Jonathan Druart 2023-07-06 08:16:34 UTC
We cannot:
* have something else than a router-link
* have a link outside of the app (it needs to be a Vue route)
Comment 1 Jonathan Druart 2023-07-06 08:21:00 UTC
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/
Comment 2 Jonathan Druart 2023-07-06 08:23:38 UTC
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/
Comment 3 Jonathan Druart 2023-07-06 09:29:02 UTC
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/
Comment 4 Pedro Amorim 2023-07-07 11:13:06 UTC
In ToolbarButton.vue, does 'to' need to be '[String, Object]' or can/should it just be 'Object'?
Comment 5 Jonathan Druart 2023-07-07 11:53:24 UTC
(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
Comment 6 Pedro Amorim 2023-07-07 13:11:32 UTC
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.
Comment 7 Pedro Amorim 2023-07-07 13:12:32 UTC
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>
Comment 8 Kyle M Hall (khall) 2023-09-22 12:51:33 UTC
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>
Comment 9 Tomás Cohen Arazi (tcohen) 2023-09-22 14:34:51 UTC
Pushed to master for 23.11.

Nice work everyone, thanks!
Comment 10 Fridolin Somers 2023-09-22 19:53:22 UTC
Enhancement not pushed to 23.05.x