Bug 34055

Summary: Add API client class to get items
Product: Koha Reporter: Jonathan Druart <jonathan.druart>
Component: Staff interfaceAssignee: Jonathan Druart <jonathan.druart>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: fridolin.somers, gmcharlt
Version: unspecified   
Hardware: All   
OS: All   
GIT URL: 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: 34056    
Bug Blocks: 30708    
Attachments: Bug 34055: Add API client class to get items
Bug 34055: Add API client class to get items
Bug 34055: Rebased on top of 34219
Bug 34055: Add API client class to get items
Bug 34055: Rebased on top of 34219
Bug 34055: Add API client class to get items
Bug 34055: Rebased on top of 34219

Description Jonathan Druart 2023-06-19 07:57:12 UTC
This will add a new fetch class at koha-tmpl/intranet-tmpl/prog/js/vue/fetch/item-api-client.js to easily list the items from Vue components.
Comment 1 Jonathan Druart 2023-06-19 08:07:39 UTC
Created attachment 152468 [details] [review]
Bug 34055: Add API client class to get items

This patch add a new item-api-client.js API client to fetch items using
our /items REST API endpoint.

Test plan:
Add the following two lines to one of the existing Vue component (in
data() for instance) and hit the view that is using it.
  let client = APIClient.item
  client.items.getAll().then((items) => console.log(items))
Notice that you see all the items in the console.

Sponsored-by: BULAC - http://www.bulac.fr/
Comment 2 Jonathan Druart 2023-06-19 08:19:21 UTC
Created attachment 152470 [details] [review]
Bug 34055: Add API client class to get items

This patch add a new item-api-client.js API client to fetch items using
our /items REST API endpoint.

Test plan:
Add the following two lines to one of the existing Vue component (in
data() for instance) and hit the view that is using it.
  let client = APIClient.item
  client.items.getAll().then((items) => console.log(items))
Notice that you see all the items in the console.

Sponsored-by: BULAC - http://www.bulac.fr/
Comment 3 Jonathan Druart 2023-07-06 14:19:34 UTC
Created attachment 153098 [details] [review]
Bug 34055: Rebased on top of 34219
Comment 4 Matt Blenkinsop 2023-07-17 09:01:32 UTC
Created attachment 153529 [details] [review]
Bug 34055: Add API client class to get items

This patch add a new item-api-client.js API client to fetch items using
our /items REST API endpoint.

Test plan:
Add the following two lines to one of the existing Vue component (in
data() for instance) and hit the view that is using it.
  let client = APIClient.item
  client.items.getAll().then((items) => console.log(items))
Notice that you see all the items in the console.

Sponsored-by: BULAC - http://www.bulac.fr/
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Comment 5 Matt Blenkinsop 2023-07-17 09:01:35 UTC
Created attachment 153530 [details] [review]
Bug 34055: Rebased on top of 34219

Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Comment 6 Chris Cormack 2023-09-21 21:34:04 UTC
Created attachment 156019 [details] [review]
Bug 34055: Add API client class to get items

This patch add a new item-api-client.js API client to fetch items using
our /items REST API endpoint.

Test plan:
Add the following two lines to one of the existing Vue component (in
data() for instance) and hit the view that is using it.
  let client = APIClient.item
  client.items.getAll().then((items) => console.log(items))
Notice that you see all the items in the console.

Sponsored-by: BULAC - http://www.bulac.fr/
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>

Was failing the pretty test, fixed with yarn pretty
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Comment 7 Chris Cormack 2023-09-21 21:34:18 UTC
Created attachment 156020 [details] [review]
Bug 34055: Rebased on top of 34219

Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Comment 8 Tomás Cohen Arazi (tcohen) 2023-09-22 13:56:09 UTC
Pushed to master for 23.11.

Nice work everyone, thanks!
Comment 9 Fridolin Somers 2023-09-22 19:39:38 UTC
Enhancement not pushed to 23.05.04