Bug 34215 - Vue Toolbar component should be more flexible
Summary: Vue Toolbar component should be more flexible
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: ERM (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low enhancement
Assignee: Jonathan Druart
QA Contact:
URL:
Keywords:
Depends on: 33417 34214
Blocks: 30708 35919
  Show dependency treegraph
 
Reported: 2023-07-06 08:16 UTC by Jonathan Druart
Modified: 2024-04-19 08:33 UTC (History)
6 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
23.11.00
Circulation function:


Attachments
Bug 34215: Introduce a ToolbarButton Vue component (8.96 KB, patch)
2023-07-06 08:21 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 34215: Introduce a ToolbarButton Vue component (9.94 KB, patch)
2023-07-06 08:23 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 34215: Introduce a ToolbarButton Vue component (9.94 KB, patch)
2023-07-06 09:29 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 34215: Introduce a ToolbarButton Vue component (9.99 KB, patch)
2023-07-07 13:12 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 34215: Introduce a ToolbarButton Vue component (10.05 KB, patch)
2023-09-22 12:51 UTC, Kyle M Hall (khall)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
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