Skip to content

Commit

Permalink
Allow list of available serviceLevels to be specified in config
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeTaylor committed Jan 14, 2025
1 parent f3474f7 commit 4967f71
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
6 changes: 6 additions & 0 deletions config/openurl.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
3 changes: 2 additions & 1 deletion doc/manual.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down
2 changes: 1 addition & 1 deletion src/OpenURLServer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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' : '',
})),
Expand Down

0 comments on commit 4967f71

Please sign in to comment.