diff --git a/landingPages/landing-utils/availableOn.component.ts b/landingPages/landing-utils/availableOn.component.ts index 24afa28e..186e5ace 100644 --- a/landingPages/landing-utils/availableOn.component.ts +++ b/landingPages/landing-utils/availableOn.component.ts @@ -13,7 +13,7 @@ declare var UIkit;
+ uk-tooltip [title]="(availableOn[0].accessRight ? availableOn[0].accessRight : 'Not available') + ' access'"> @@ -52,7 +52,7 @@ declare var UIkit;
+ uk-tooltip [title]="(instance.accessRight ? instance.accessRight : 'Not available') + ' access'">
diff --git a/landingPages/landing-utils/parsingFunctions.class.ts b/landingPages/landing-utils/parsingFunctions.class.ts index 20e85f19..b740876a 100644 --- a/landingPages/landing-utils/parsingFunctions.class.ts +++ b/landingPages/landing-utils/parsingFunctions.class.ts @@ -38,8 +38,8 @@ export class ParsingFunctions { public open = 'open_access'; public closed = 'closed_access'; - // public unknown = 'question_mark'; - + public unknown = 'unknown_access'; + private instanceWithDoiExists: boolean = false; constructor() { @@ -194,7 +194,7 @@ export class ParsingFunctions { } available.downloadUrl = properties.doiURL + identifiers.get("doi")[0]; - // available.accessRightIcon = this.unknown; + available.accessRightIcon = this.unknown; /* if(title != undefined && title['url'] == "") { title['url'] = url; @@ -282,7 +282,7 @@ export class ParsingFunctions { "years": [], "license": "" }; - + if (instance.hasOwnProperty("hostedby")) { let downloadNames: Set = new Set(); let length = Array.isArray(instance['hostedby']) ? instance['hostedby'].length : 1; @@ -351,21 +351,20 @@ export class ParsingFunctions { } } - + if (available.accessRight) { if (available.accessRight.toLowerCase().indexOf('open') !== -1) { available.accessRightIcon = this.open; - } - // else if (available.accessRight.toLowerCase().indexOf('not available') !== -1) { - // available.accessRightIcon = this.unknown; - // } + } + else if (available.accessRight.toLowerCase().indexOf('not available') !== -1) { + available.accessRightIcon = this.unknown; + } else { available.accessRightIcon = this.closed; } - } - // else { - // available.accessRightIcon = this.unknown; - // } + } else { + available.accessRightIcon = this.unknown; + } if (instance.hasOwnProperty("license")) { available.license = Array.isArray(instance['license']) ? instance['license'][0] : instance['license']; diff --git a/landingPages/landing-utils/resultLandingUtils.module.ts b/landingPages/landing-utils/resultLandingUtils.module.ts index a8079694..ebf29782 100644 --- a/landingPages/landing-utils/resultLandingUtils.module.ts +++ b/landingPages/landing-utils/resultLandingUtils.module.ts @@ -19,7 +19,7 @@ import {AlertModalModule} from "../../utils/modal/alertModal.module"; import { SearchInputModule } from '../../sharedComponents/search-input/search-input.module'; import {EntityMetadataComponent} from "./entity-metadata.component"; import {IconsService} from "../../utils/icons/icons.service"; -import {closed_access, open_access} from "../../utils/icons/icons"; +import {closed_access, open_access, unknown_access} from "../../utils/icons/icons"; import {FullScreenModalModule} from "../../utils/modal/full-screen-modal/full-screen-modal.module"; @@ -44,6 +44,6 @@ import {FullScreenModalModule} from "../../utils/modal/full-screen-modal/full-sc }) export class ResultLandingUtilsModule { constructor(private iconsService: IconsService) { - this.iconsService.registerIcons([open_access, closed_access]); + this.iconsService.registerIcons([open_access, closed_access, unknown_access]); } } diff --git a/landingPages/result/resultLanding.component.html b/landingPages/result/resultLanding.component.html index 0f85204b..cb7e2e7b 100644 --- a/landingPages/result/resultLanding.component.html +++ b/landingPages/result/resultLanding.component.html @@ -490,7 +490,7 @@ class="uk-margin-small-bottom uk-flex uk-flex-middle" [ngClass]="(resultLandingInfo.hostedBy_collectedFrom[0].accessRightIcon == 'open_access' ? 'open-access' : 'closed-access')"> - {{resultLandingInfo.hostedBy_collectedFrom[0].accessRight}} + {{(resultLandingInfo.hostedBy_collectedFrom[0].accessRight ? resultLandingInfo.hostedBy_collectedFrom[0].accessRight : 'Not available') + ' access'}}
image/svg+xml Jakob Voss, based on art designer at PLoS, modified by Wikipedia users Nina and Beao Closed Access logo, derived from PLoS Open Access logo. This version with transparent background. http://commons.wikimedia.org/wiki/File:Closed_Access_logo_transparent.svg Jakob Voss, based on art designer at PLoS, modified by Wikipedia users Nina and Beao ' } /** Add new icon under this line to be sure that it will be added on preview */ + +export const unknown_access = { + name: 'unknown_access', + data: '\n' + + ' \n' + + ' \n' + + ' \n' + + '' +} \ No newline at end of file diff --git a/utils/result-preview/result-preview.component.html b/utils/result-preview/result-preview.component.html index 7db00273..b2cbfc0e 100644 --- a/utils/result-preview/result-preview.component.html +++ b/utils/result-preview/result-preview.component.html @@ -19,51 +19,60 @@