Bug 34055 - Add API client class to get items
Summary: Add API client class to get items
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Staff interface (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Jonathan Druart
QA Contact: Testopia
URL:
Keywords:
Depends on: 34056
Blocks: 30708
  Show dependency treegraph
 
Reported: 2023-06-19 07:57 UTC by Jonathan Druart
Modified: 2023-10-14 12:25 UTC (History)
2 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


Attachments
Bug 34055: Add API client class to get items (2.67 KB, patch)
2023-06-19 08:07 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 34055: Add API client class to get items (2.69 KB, patch)
2023-06-19 08:19 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 34055: Rebased on top of 34219 (1.25 KB, patch)
2023-07-06 14:19 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 34055: Add API client class to get items (2.76 KB, patch)
2023-07-17 09:01 UTC, Matt Blenkinsop
Details | Diff | Splinter Review
Bug 34055: Rebased on top of 34219 (1.33 KB, patch)
2023-07-17 09:01 UTC, Matt Blenkinsop
Details | Diff | Splinter Review
Bug 34055: Add API client class to get items (2.88 KB, patch)
2023-09-21 21:34 UTC, Chris Cormack
Details | Diff | Splinter Review
Bug 34055: Rebased on top of 34219 (1.39 KB, patch)
2023-09-21 21:34 UTC, Chris Cormack
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-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 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