diff --git a/config/openurl.json b/config/openurl.json index 6b27466..cb105ed 100644 --- a/config/openurl.json +++ b/config/openurl.json @@ -38,6 +38,12 @@ { "name": "CCL (US)", "code": "us-ccl"} ], + "serviceLevels": [ + { "name": "Standard", "code": "standard" }, + { "name": "Rush", "code": "rush" }, + { "name": "Express", "code": "express" } + ], + "services": { "US-EAST": { "okapiUrl": "https://east-okapi.folio-dev.indexdata.com", diff --git a/doc/manual.md b/doc/manual.md index a671c84..6db19cf 100644 --- a/doc/manual.md +++ b/doc/manual.md @@ -69,7 +69,8 @@ Configuration of the OpenURL listener is primarily by means of configuration fil * `checkLimit` -- boolean, when `true` an attempt will be made to see if the request does not put the patron identified by `req_id` over the request limit and to notify them of this instead of placing a request or displaying the form. * `docRoot` -- specifies the location of a directory, relative to the location of the configuration file, from which [static files can be served](#serving-static-files). * `digitalOnly` -- boolean indicating that pickup location should not be solicited and `deliveryMethod` should be passed to ReShare as `URL` -* `copyrightTypes` -- an array of objects with properties `code` and `name` specifying the ISO18626 copyright type codes to offer as options for that field and the display names to associate with them +* `copyrightTypes` -- an array of objects with properties `code` and `name` specifying the ISO18626 copyright type codes to offer as options for that field and the display names to associate with them, overriding those encoded in the system's Refdata +* `serviceLevels` -- an array of objects with properties `code` and `name` specifying the ReShare service levels to offer as options for that field and the display names to associate with them, overriding those encoded in the system's Refdata #### For communication with the ReShare back-end: diff --git a/src/OpenURLServer.js b/src/OpenURLServer.js index fd66335..b6f92f0 100644 --- a/src/OpenURLServer.js +++ b/src/OpenURLServer.js @@ -156,7 +156,7 @@ async function makeFormData(ctx, query, service, valuesNotShownInForm, firstTry, name: x.charAt(0).toUpperCase() + x.slice(1), checked: x === query.svc_id || (!query.svc_id && i === 0) ? 'checked' : '', })), - serviceLevels: (serviceLevels || []).map(x => ({ + serviceLevels: (ctx.cfg.getValues()?.serviceLevels || serviceLevels || []).map(x => ({ ...x, selected: x.code === query['svc.level'] ? 'selected' : '', })),