primo-explore-unpaywall
Advanced tools
Comparing version 1.2.0 to 1.2.1
@@ -8,4 +8,4 @@ { | ||
"npmid": "primo-explore-unpaywall", | ||
"version": "1.1.4", | ||
"hook": "prm-search-result-avaliability-line-after", | ||
"version": "1.2.1", | ||
"hook": "prm-search-result-availability-line", | ||
"config": { | ||
@@ -36,2 +36,14 @@ "form": [ | ||
{ | ||
"key": "overrideOACheck", | ||
"type": "select", | ||
"defaultValue": false, | ||
"templateOptions": { | ||
"label": "(debug) Make unpaywall regardless of OA status", | ||
"options": [ | ||
{ "name": "true", "value": true }, | ||
{ "name": "false", "value": false } | ||
] | ||
} | ||
}, | ||
{ | ||
"key": "showVersionLabel", | ||
@@ -38,0 +50,0 @@ "type": "select", |
{ | ||
"name": "primo-explore-unpaywall", | ||
"version": "1.2.0", | ||
"version": "1.2.1", | ||
"description": "Add 'Open Access available via unpaywall' link to search-result-avaliability-line-after in Primo New UI", | ||
@@ -5,0 +5,0 @@ "main": "src/unpaywall.module.js", |
# `primo-explore-unpaywall` [![npm package](https://img.shields.io/npm/v/primo-explore-unpaywall.svg)](https://www.npmjs.com/package/primo-explore-unpaywall) | ||
Add 'Open Access available via unpaywall' link to `search-result-avaliability-line-after` in Primo New UI | ||
Add 'Open Access available via unpaywall' link to `search-result-availability-line-after` in Primo New UI | ||
@@ -53,3 +53,3 @@ ### Screenshots | ||
1. look in its parentController (`prmSearchResultAvailability`) for the item info contained in it's `result` variable | ||
2. if there's a doi (`doi`) in there and it's not already marked as open access (`oa`) use it to make a call to | ||
2. if there's a doi (`doi`) in there and it's not already marked as open access (`oa`)* use it to make a call to | ||
the afore-mentioned unpaywall api. | ||
@@ -59,2 +59,4 @@ 3. if that call ends up being successful, look for an open access download link (`successResponse.data.best_oa_location`) | ||
_note: (*) you can override this OA check (so that a call is made wherever a DOI is found) by setting `overrideOACheck` in your `unpaywallConfig`_ | ||
### Usage | ||
@@ -125,2 +127,3 @@ | ||
|`showOnResultsPage`|`true`|determine whether the link is added to each item in the list of results| | ||
|`overrideOACheck`|`false`|disable the `addata.oa` check so that the unpaywall check runs on all items with an available DOI| | ||
|`showVersionLabel`|`true`|sometimes the unpaywall OA response qualifies the stage of publication the work was OA-available in (`Submitted`, `Published`, `Accepted`)| | ||
@@ -127,0 +130,0 @@ |`logToConsole`|`true`|controls whether or not messages about what's going on in the component are `console.log()`-ed (visible in inspector)| |
@@ -17,2 +17,3 @@ // import npm package by name (recommended) | ||
"showOnResultsPage":true, | ||
"overrideOACheck":false, | ||
"showVersionLabel":true, | ||
@@ -19,0 +20,0 @@ "logToConsole":true, |
@@ -36,2 +36,3 @@ angular.module('bulibUnpaywall', []) | ||
self.showOnResultsPage = (Object.keys(unpaywallConfig).includes("showOnResultsPage")) ? unpaywallConfig.showOnResultsPage : true; | ||
self.overrideOACheck = (Object.keys(unpaywallConfig).includes("overrideOACheck")) ? unpaywallConfig.overrideOACheck : false; | ||
self.logEvent = unpaywallConfig.logEvent || logEventToGoogleAnalytics; | ||
@@ -74,3 +75,3 @@ | ||
// if there's a doi and it's not already open access, ask the oadoi.org for an OA link | ||
if (this.doi && !this.is_oa && self.show) { | ||
if (this.doi && (!this.is_oa || self.overrideOACheck) && self.show) { | ||
self.logEventToAnalytics('unpaywall', 'api-call', self.listOrFullViewLabel); | ||
@@ -77,0 +78,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
160414
238
145