Bugzilla – Attachment 127281 Details for
Bug 29397
Add a select2 wrapper for the API
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 29397: Use kohaSelect for pickup locations
Bug-29397-Use-kohaSelect-for-pickup-locations.patch (text/plain), 2.54 KB, created by
Tomás Cohen Arazi (tcohen)
on 2021-11-03 17:59:24 UTC
(
hide
)
Description:
Bug 29397: Use kohaSelect for pickup locations
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2021-11-03 17:59:24 UTC
Size:
2.54 KB
patch
obsolete
>From 5f18a310c9ba835b96f2903fc84f6a9c566da2c4 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Wed, 3 Nov 2021 14:48:44 -0300 >Subject: [PATCH] Bug 29397: Use kohaSelect for pickup locations > >This patch makes the pickup location dropdowns that rely on Select2 and >the API use the new wrapper. The original transport function is removed >as it is now embedded in the wrapper. > >To test: >1. Follow bug 29404 test plan >=> SUCCESS: All works >2. Apply this patches >3. Repeat 1 >=> SUCCESS: All works! >4. sign off :-D > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > koha-tmpl/intranet-tmpl/prog/js/holds.js | 5 ++--- > koha-tmpl/intranet-tmpl/prog/js/select2.js | 20 -------------------- > 2 files changed, 2 insertions(+), 23 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/js/holds.js b/koha-tmpl/intranet-tmpl/prog/js/holds.js >index a022482bce..c908351939 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/holds.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/holds.js >@@ -48,7 +48,7 @@ function display_pickup_location (state) { > url = '/api/v1/holds/' + encodeURIComponent(hold_id) + '/pickup_locations'; > } > >- select.select2({ >+ select.kohaSelect({ > width: 'style', > allowClear: false, > ajax: { >@@ -82,8 +82,7 @@ function display_pickup_location (state) { > ); > }); > return { "results": results, "pagination": { "more": data.pagination.more } }; >- }, >- transport: kohaSelect2Transport, >+ } > }, > templateResult: display_pickup_location > }); >diff --git a/koha-tmpl/intranet-tmpl/prog/js/select2.js b/koha-tmpl/intranet-tmpl/prog/js/select2.js >index df8b108d84..52d910a2fa 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/select2.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/select2.js >@@ -38,26 +38,6 @@ $(document).ready(function(){ > }); > }); > >-function kohaSelect2Transport(params, success, failure) { >- var read_headers = function (data, textStatus, jqXHR) { >- var more = false; >- var link = jqXHR.getResponseHeader('Link') || ''; >- if (link.search(/<([^>]+)>;\s*rel\s*=\s*['"]?next['"]?\s*(,|$)/i) > -1) { >- more = true; >- } >- >- return { >- results: data, >- pagination: { >- more: more >- } >- }; >- }; >- var $request = $.ajax(params); >- $request.then(read_headers).then(success); >- $request.fail(failure); >-} >- > (function($) { > > /** >-- >2.33.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 29397
:
127265
|
127279
|
127280
|
127281
|
127320
|
127321
|
127322
|
129117
|
130221
|
130222