mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-08 10:34:15 +00:00
[CST-5270] Code refactoring, made changes from the rest contract and implemented i18n
This commit is contained in:
@@ -4,18 +4,39 @@
|
||||
export class SherpaPoliciesDetailsObject {
|
||||
|
||||
/**
|
||||
* The sherpa policies uri
|
||||
* The sherpa policies error
|
||||
*/
|
||||
uri: string;
|
||||
error: boolean;
|
||||
|
||||
/**
|
||||
* The sherpa policies details
|
||||
* The sherpa policies journal details
|
||||
*/
|
||||
journals: Journals;
|
||||
journals: Journal[];
|
||||
|
||||
/**
|
||||
* The sherpa policies message
|
||||
*/
|
||||
message: string;
|
||||
|
||||
/**
|
||||
* The sherpa policies metadata
|
||||
*/
|
||||
metadata: Metadata;
|
||||
|
||||
}
|
||||
|
||||
|
||||
export interface Journals {
|
||||
export interface Metadata {
|
||||
id: number;
|
||||
uri: string;
|
||||
dateCreated: string;
|
||||
dateModified: string;
|
||||
inDOAJ: boolean;
|
||||
publiclyVisible: boolean;
|
||||
}
|
||||
|
||||
|
||||
export interface Journal {
|
||||
titles: string[];
|
||||
url: string;
|
||||
issns: string[];
|
||||
@@ -23,9 +44,8 @@ export interface Journals {
|
||||
zetoPub: string;
|
||||
inDOAJ: boolean;
|
||||
publisher: Publisher;
|
||||
policies: Policies;
|
||||
urls: string[];
|
||||
openAccessProhibited: boolean;
|
||||
publishers: Publisher[];
|
||||
policies: Policy[];
|
||||
}
|
||||
|
||||
export interface Publisher {
|
||||
@@ -36,17 +56,26 @@ export interface Publisher {
|
||||
identifier: string;
|
||||
paidAccessDescription: string;
|
||||
paidAccessUrl: string;
|
||||
publicationCount: number;
|
||||
}
|
||||
|
||||
export interface Policies {
|
||||
export interface Policy {
|
||||
id: number;
|
||||
openAccessPermitted: boolean;
|
||||
uri: string;
|
||||
internalMoniker: string;
|
||||
permittedVersions: PermittedVersions;
|
||||
permittedVersions: PermittedVersions[];
|
||||
urls: any;
|
||||
publicationCount: number;
|
||||
preArchiving: string;
|
||||
postArchiving: string;
|
||||
pubArchiving: string;
|
||||
openAccessProhibited: boolean;
|
||||
}
|
||||
|
||||
export interface PermittedVersions {
|
||||
articleVersion: string;
|
||||
option: number;
|
||||
conditions: string[];
|
||||
prerequisites: string[];
|
||||
locations: string[];
|
||||
|
@@ -18,5 +18,5 @@ export interface WorkspaceitemSectionSherpaPoliciesObject {
|
||||
/**
|
||||
* The sherpa policies details
|
||||
*/
|
||||
details: SherpaPoliciesDetailsObject;
|
||||
sherpaResponse: SherpaPoliciesDetailsObject[];
|
||||
}
|
||||
|
@@ -106,65 +106,101 @@ export class SubmissionObjectEffects {
|
||||
true,
|
||||
{
|
||||
'id': 'sherpaPolicies',
|
||||
'retrievalTime': '2022-01-11T09:43:53Z',
|
||||
'details': {
|
||||
'uri': 'https://www.nature.com/natsynth/',
|
||||
'journals': {
|
||||
'titles': [
|
||||
'Nature Synthesis'
|
||||
],
|
||||
'url': 'http://europepmc.org/',
|
||||
'issns': [
|
||||
'2731-0582',
|
||||
'2731-0583',
|
||||
'2731-0584',
|
||||
],
|
||||
'romeoPub': 'Self archiving and license to publish',
|
||||
'zetoPub': 'Self archiving and license to publish',
|
||||
'inDOAJ': true,
|
||||
'publisher': {
|
||||
'name': 'Europe PMC',
|
||||
'relationshipType': 'Stest',
|
||||
'country': 'gb',
|
||||
'uri': 'https://v2.sherpa.ac.uk/id/publication/40863',
|
||||
'identifier': '123123123',
|
||||
'paidAccessDescription': 'test test sss',
|
||||
'paidAccessUrl': 'https://www.nature.com/nature-portfolio/editorial-policies/preprints-and-conference-proceedings'
|
||||
'retrievalTime': '2022-04-20T09:44:39.870+00:00',
|
||||
'sherpaResponse': [
|
||||
{
|
||||
'error': false,
|
||||
'message': null,
|
||||
'metadata': {
|
||||
'id': 23803,
|
||||
'uri': 'http://v2.sherpa.ac.uk/id/publication/23803',
|
||||
'dateCreated': '2012-11-20 14:51:52',
|
||||
'dateModified': '2020-03-06 11:25:54',
|
||||
'inDOAJ': false,
|
||||
'publiclyVisible': true
|
||||
},
|
||||
'policies': {
|
||||
'openAccessPermitted': true,
|
||||
'uri': 'https://v2.sherpa.ac.uk/id/publisher_policy/3286',
|
||||
'internalMoniker': 'Default Policy',
|
||||
'permittedVersions': {
|
||||
'articleVersion': 'submitted',
|
||||
'conditions': [
|
||||
'Must link to publisher version',
|
||||
'Published source must be acknowledged and DOI cited',
|
||||
'Post-prints are subject to Springer Nature re-use terms',
|
||||
'Non-commercial use only'
|
||||
],
|
||||
'prerequisites': [],
|
||||
'locations': [
|
||||
'authors_homepage',
|
||||
'funder_designated_location',
|
||||
'institutional_repository',
|
||||
'preprint_repository'
|
||||
],
|
||||
'licenses': [],
|
||||
'embargo': {
|
||||
'units': 'months',
|
||||
'amount': 6
|
||||
}
|
||||
}
|
||||
},
|
||||
'urls': [
|
||||
'https://www.nature.com/neuro/editorial-policies/self-archiving-and-license-to-publish',
|
||||
'https://www.nature.com/nature-portfolio/editorial-policies/preprints-and-conference-proceedings',
|
||||
'https://www.springernature.com/gp/open-research/policies/accepted-manuscript-terms'
|
||||
],
|
||||
'openAccessProhibited': true
|
||||
'journals': [{
|
||||
'titles': ['The Lancet', 'Lancet'],
|
||||
'url': 'http://www.thelancet.com/journals/lancet/issue/current',
|
||||
'issns': ['0140-6736', '1474-547X'],
|
||||
'romeoPub': 'Elsevier: The Lancet',
|
||||
'zetoPub': 'Elsevier: The Lancet',
|
||||
'publisher': {
|
||||
'name': 'Elsevier',
|
||||
'relationshipType': null,
|
||||
'country': null,
|
||||
'uri': 'http://www.elsevier.com/',
|
||||
'identifier': null,
|
||||
'publicationCount': 0,
|
||||
'paidAccessDescription': 'Open access',
|
||||
'paidAccessUrl': 'https://www.elsevier.com/about/open-science/open-access'
|
||||
},
|
||||
'publishers': [{
|
||||
'name': 'Elsevier',
|
||||
'relationshipType': null,
|
||||
'country': null,
|
||||
'uri': 'http://www.elsevier.com/',
|
||||
'identifier': null,
|
||||
'publicationCount': 0,
|
||||
'paidAccessDescription': 'Open access',
|
||||
'paidAccessUrl': 'https://www.elsevier.com/about/open-science/open-access'
|
||||
}],
|
||||
'policies': [{
|
||||
'id': 0,
|
||||
'openAccessPermitted': false,
|
||||
'uri': null,
|
||||
'internalMoniker': 'Lancet',
|
||||
'permittedVersions': [{
|
||||
'articleVersion': 'submitted',
|
||||
'option': 1,
|
||||
'conditions': ['Upon publication publisher copyright and source must be acknowledged', 'Upon publication must link to publisher version'],
|
||||
'prerequisites': [],
|
||||
'locations': ['Author\'s Homepage', 'Preprint Repository'],
|
||||
'licenses': [],
|
||||
'embargo': null
|
||||
}, {
|
||||
'articleVersion': 'accepted',
|
||||
'option': 1,
|
||||
'conditions': ['Publisher copyright and source must be acknowledged', 'Must link to publisher version'],
|
||||
'prerequisites': [],
|
||||
'locations': ['Author\'s Homepage', 'Institutional Website'],
|
||||
'licenses': ['CC BY-NC-ND'],
|
||||
'embargo': null
|
||||
}, {
|
||||
'articleVersion': 'accepted',
|
||||
'option': 2,
|
||||
'conditions': ['Publisher copyright and source must be acknowledged', 'Must link to publisher version'],
|
||||
'prerequisites': ['If Required by Funder'],
|
||||
'locations': ['Non-Commercial Repository'],
|
||||
'licenses': ['CC BY-NC-ND'],
|
||||
'embargo': null
|
||||
}, {
|
||||
'articleVersion': 'accepted',
|
||||
'option': 3,
|
||||
'conditions': ['Publisher copyright and source must be acknowledged', 'Must link to publisher version'],
|
||||
'prerequisites': [],
|
||||
'locations': ['Non-Commercial Repository'],
|
||||
'licenses': [],
|
||||
'embargo': null
|
||||
}],
|
||||
'urls': {
|
||||
'http://download.thelancet.com/flatcontentassets/authors/lancet-information-for-authors.pdf': 'Guidelines for Authors',
|
||||
'http://www.thelancet.com/journals/lancet/article/PIIS0140-6736%2813%2960720-5/fulltext': 'The Lancet journals welcome a new open access policy',
|
||||
'http://www.thelancet.com/lancet-information-for-authors/after-publication': 'What happens after publication?',
|
||||
'http://www.thelancet.com/lancet/information-for-authors/disclosure-of-results': 'Disclosure of results before publication',
|
||||
'https://www.elsevier.com/__data/assets/pdf_file/0005/78476/external-embargo-list.pdf': 'Journal Embargo Period List',
|
||||
'https://www.elsevier.com/__data/assets/pdf_file/0011/78473/UK-Embargo-Periods.pdf': 'Journal Embargo List for UK Authors'
|
||||
},
|
||||
'openAccessProhibited': false,
|
||||
'publicationCount': 0,
|
||||
'preArchiving': 'can',
|
||||
'postArchiving': 'can',
|
||||
'pubArchiving': 'cannot'
|
||||
}],
|
||||
'inDOAJ': false
|
||||
}]
|
||||
}
|
||||
}
|
||||
]
|
||||
} as WorkspaceitemSectionSherpaPoliciesObject,
|
||||
null
|
||||
)
|
||||
|
@@ -1,64 +1,63 @@
|
||||
<ngb-accordion #acc="ngbAccordion" [activeIds]="id">
|
||||
<ngb-panel [id]="id">
|
||||
<ngb-accordion #acc="ngbAccordion" [activeIds]="'version'">
|
||||
<ngb-panel id="version">
|
||||
<ng-template ngbPanelTitle>
|
||||
<span class="float-left section-title" tabindex="0">{{id.replace('-',' ') | titlecase}}</span>
|
||||
<span class="float-left section-title" tabindex="0">
|
||||
{{version.articleVersion | titlecase}} {{ 'submission.sections.sherpa.publisher.policy.version' |
|
||||
translate }}
|
||||
</span>
|
||||
<div class="d-inline-block float-right">
|
||||
<span *ngIf="!acc.isExpanded(id)" class="fas fa-plus"></span>
|
||||
<span *ngIf="acc.isExpanded(id)" class="fas fa-minus"></span>
|
||||
<span *ngIf="!acc.isExpanded('version')" class="fas fa-plus"></span>
|
||||
<span *ngIf="acc.isExpanded('version')" class="fas fa-minus"></span>
|
||||
</div>
|
||||
</ng-template>
|
||||
<ng-template ngbPanelContent>
|
||||
<div class="ml-4">
|
||||
<div class="row">
|
||||
<div class="col-4">
|
||||
<p class="m-0">Article Version</p>
|
||||
<p class="m-1">{{ 'submission.sections.sherpa.publisher.policy.embargo' | translate }}</p>
|
||||
</div>
|
||||
<div class="col-4">
|
||||
{{data.articleVersion}}
|
||||
<div class="col-6">
|
||||
<p class="m-1" *ngIf="!!version.embargo;else noEmbargo">{{version.embargo.amount}}
|
||||
{{version.embargo.units}}</p>
|
||||
<ng-template #noEmbargo>
|
||||
<p class="m-1">{{ 'submission.sections.sherpa.publisher.policy.noembargo' | translate }}</p>
|
||||
</ng-template>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-4">
|
||||
<p class="m-0">Conditions</p>
|
||||
<p class="m-1">{{ 'submission.sections.sherpa.publisher.policy.license' | translate }}</p>
|
||||
</div>
|
||||
<div class="col-4">
|
||||
<p class="m-0" *ngFor="let condition of data.conditions">{{condition}}</p>
|
||||
<div class="col-6">
|
||||
<p class="m-1" *ngFor="let license of version.licenses">{{license}}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-4">
|
||||
<p class="m-0">Prerequisites</p>
|
||||
<p class="m-1">{{ 'submission.sections.sherpa.publisher.policy.prerequisites' | translate }}</p>
|
||||
</div>
|
||||
<div class="col-4">
|
||||
<p class="m-0" *ngFor="let prerequisite of data.prerequisites">{{prerequisite}}</p>
|
||||
<div class="col-6">
|
||||
<p class="m-1" *ngFor="let prerequisite of version.prerequisites">{{prerequisite}}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-4">
|
||||
<p class="m-0">Location</p>
|
||||
<p class="m-1">{{ 'submission.sections.sherpa.publisher.policy.location' | translate }}</p>
|
||||
</div>
|
||||
<div class="col-4">
|
||||
<p class="m-0" *ngFor="let location of data.locations">{{location}}</p>
|
||||
<div class="col-6">
|
||||
<p class="m-1" *ngFor="let location of version.locations">{{location}}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-4">
|
||||
<p class="m-0">License</p>
|
||||
<p class="m-1">{{ 'submission.sections.sherpa.publisher.policy.conditions' | translate }}</p>
|
||||
</div>
|
||||
<div class="col-4">
|
||||
<p class="m-0" *ngFor="let license of data.licenses">{{license}}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-4">
|
||||
<p class="m-0">Embargo</p>
|
||||
</div>
|
||||
<div class="col-4">
|
||||
<p class="m-0">{{data.embargo.amount}} {{data.embargo.units}}</p>
|
||||
<div class="col-6">
|
||||
<p class="m-1" *ngFor="let condition of version.conditions">{{condition}}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</ng-template>
|
||||
</ngb-panel>
|
||||
</ngb-accordion>
|
@@ -1,3 +1,4 @@
|
||||
import { PermittedVersions } from './../../../../core/submission/models/sherpa-policies-details.model';
|
||||
import { Component, Input } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
@@ -7,7 +8,6 @@ import { Component, Input } from '@angular/core';
|
||||
})
|
||||
export class ContentAccordionComponent {
|
||||
|
||||
@Input() id: string;
|
||||
@Input() data: any;
|
||||
@Input() version: PermittedVersions;
|
||||
|
||||
}
|
||||
|
@@ -0,0 +1,39 @@
|
||||
<div class="ml-4">
|
||||
<div class="row">
|
||||
<div class="col-4">
|
||||
<p class="m-1">{{ 'submission.sections.sherpa.record.information.id' | translate }}</p>
|
||||
</div>
|
||||
<div class="col-8">
|
||||
<p class="m-1">{{metadata.id}}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-4">
|
||||
<p class="m-1">{{ 'submission.sections.sherpa.record.information.date.created' | translate }}</p>
|
||||
</div>
|
||||
<div class="col-8">
|
||||
<p class="m-1">{{metadata.dateCreated | date: 'd MMMM Y H:mm:ss zzzz' }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-4">
|
||||
<p class="m-1">{{ 'submission.sections.sherpa.record.information.date.modified' | translate }}</p>
|
||||
</div>
|
||||
<div class="col-8">
|
||||
<p class="m-1">{{metadata.dateModified| date: 'd MMMM Y H:mm:ss zzzz' }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-4">
|
||||
<p class="m-1">{{ 'submission.sections.sherpa.record.information.uri' | translate }}</p>
|
||||
</div>
|
||||
<div class="col-8">
|
||||
<p class="m-1">
|
||||
<a [href]="metadata.uri">{{metadata.uri}}</a>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
@@ -0,0 +1,25 @@
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { MetadataInformationComponent } from './metadata-information.component';
|
||||
|
||||
describe('MetadataInformationComponent', () => {
|
||||
let component: MetadataInformationComponent;
|
||||
let fixture: ComponentFixture<MetadataInformationComponent>;
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
declarations: [ MetadataInformationComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(MetadataInformationComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
@@ -0,0 +1,13 @@
|
||||
import { Component, Input } from '@angular/core';
|
||||
import { Metadata } from './../../../../core/submission/models/sherpa-policies-details.model';
|
||||
|
||||
@Component({
|
||||
selector: 'ds-metadata-information',
|
||||
templateUrl: './metadata-information.component.html',
|
||||
styleUrls: ['./metadata-information.component.scss']
|
||||
})
|
||||
export class MetadataInformationComponent {
|
||||
|
||||
@Input() metadata: Metadata;
|
||||
|
||||
}
|
@@ -0,0 +1,70 @@
|
||||
<div class="ml-4">
|
||||
<div class="row">
|
||||
<div class="col-4">
|
||||
<p class="m-1">{{'submission.sections.sherpa.publication.information.title'
|
||||
| translate}}</p>
|
||||
</div>
|
||||
<div class="col-4">
|
||||
<p class="m-1" *ngFor="let title of journal.titles">{{title}}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-4">
|
||||
<p class="m-1">{{'submission.sections.sherpa.publication.information.issns'
|
||||
| translate}}</p>
|
||||
</div>
|
||||
<div class="col-4">
|
||||
<p class="m-1" *ngFor="let issn of journal.issns">{{issn}}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-4">
|
||||
<p class="m-1">{{'submission.sections.sherpa.publication.information.url'
|
||||
| translate}}</p>
|
||||
</div>
|
||||
<div class="col-4">
|
||||
<p class="m-1">
|
||||
<a href="{{journal.url}}">
|
||||
{{journal.url}}
|
||||
</a>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-4">
|
||||
<p class="m-1">{{'submission.sections.sherpa.publication.information.publishers'
|
||||
| translate}}</p>
|
||||
</div>
|
||||
<div class="col-4" *ngFor="let publisher of journal.publishers">
|
||||
<p class="m-1">
|
||||
<a href="{{publisher.uri}}">
|
||||
{{publisher.name}}
|
||||
</a>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-4">
|
||||
<p class="m-1">{{'submission.sections.sherpa.publication.information.romeoPub'
|
||||
| translate}}</p>
|
||||
</div>
|
||||
<div class="col-4">
|
||||
<p class="m-1">
|
||||
{{journal.romeoPub}}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-4">
|
||||
<p class="m-1">{{'submission.sections.sherpa.publication.information.zetoPub'
|
||||
| translate}}</p>
|
||||
</div>
|
||||
<div class="col-4">
|
||||
<p class="m-1">
|
||||
{{journal.zetoPub}}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
@@ -0,0 +1,25 @@
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { PublicationInformationComponent } from './publication-information.component';
|
||||
|
||||
describe('PublicationInformationComponent', () => {
|
||||
let component: PublicationInformationComponent;
|
||||
let fixture: ComponentFixture<PublicationInformationComponent>;
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
declarations: [ PublicationInformationComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(PublicationInformationComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
@@ -0,0 +1,13 @@
|
||||
import { Component, Input, OnInit } from '@angular/core';
|
||||
import { Journal } from './../../../../core/submission/models/sherpa-policies-details.model';
|
||||
|
||||
@Component({
|
||||
selector: 'ds-publication-information',
|
||||
templateUrl: './publication-information.component.html',
|
||||
styleUrls: ['./publication-information.component.scss']
|
||||
})
|
||||
export class PublicationInformationComponent {
|
||||
|
||||
@Input() journal: Journal;
|
||||
|
||||
}
|
@@ -0,0 +1,26 @@
|
||||
<div class="ml-4">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<p class="m-1">
|
||||
{{'submission.sections.sherpa.publisher.policy.openaccess' | translate}}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<ds-content-accordion *ngFor="let permittedVersions of policy.permittedVersions" [version]="permittedVersions">
|
||||
</ds-content-accordion>
|
||||
<!-- <ds-content-accordion></ds-content-accordion> -->
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<p class="m-1">
|
||||
{{'submission.sections.sherpa.publisher.policy.more.information' | translate}}
|
||||
</p>
|
||||
<ul>
|
||||
<li *ngFor="let url of policy.urls | keyvalue">
|
||||
<a href="{{url.key}}">{{url.value}}</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
@@ -0,0 +1,25 @@
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { PublisherPolicyComponent } from './publisher-policy.component';
|
||||
|
||||
describe('PublisherPolicyComponent', () => {
|
||||
let component: PublisherPolicyComponent;
|
||||
let fixture: ComponentFixture<PublisherPolicyComponent>;
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
declarations: [ PublisherPolicyComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(PublisherPolicyComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
@@ -0,0 +1,13 @@
|
||||
import { Policy } from './../../../../core/submission/models/sherpa-policies-details.model';
|
||||
import { Component, Input, OnInit } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'ds-publisher-policy',
|
||||
templateUrl: './publisher-policy.component.html',
|
||||
styleUrls: ['./publisher-policy.component.scss']
|
||||
})
|
||||
export class PublisherPolicyComponent {
|
||||
|
||||
@Input() policy: Policy;
|
||||
|
||||
}
|
@@ -1,119 +1,48 @@
|
||||
<ngb-accordion #acc="ngbAccordion" activeIds="publication-information">
|
||||
<ngb-panel id="publication-information">
|
||||
<ngb-accordion *ngFor="let sherpaData of sherpaPoliciesData.sherpaResponse;let i = index;" #acc="ngbAccordion">
|
||||
<ng-container *ngFor="let journal of sherpaData.journals;let j=index;">
|
||||
<ngb-panel id="publication-information-{{j}}">
|
||||
<ng-template ngbPanelTitle>
|
||||
<div class="d-inline-block float-left">
|
||||
<span *ngIf="!acc.isExpanded('publication-information-{{j}}')"
|
||||
class="fas fa-chevron-up fa-fw"></span>
|
||||
<span *ngIf="acc.isExpanded('publication-information-{{j}}')"
|
||||
class="fas fa-chevron-down fa-fw"></span>
|
||||
</div>
|
||||
<span class="float-left section-title"
|
||||
tabindex="0">{{'submission.sections.sherpa.publication.information'
|
||||
| translate}}</span>
|
||||
</ng-template>
|
||||
<ng-template ngbPanelContent>
|
||||
<ds-publication-information [journal]="journal"></ds-publication-information>
|
||||
</ng-template>
|
||||
</ngb-panel>
|
||||
<ng-container *ngFor="let policy of journal.policies">
|
||||
<ngb-panel id="publisher-policy-{{j}}">
|
||||
<ng-template ngbPanelTitle>
|
||||
<div class="d-inline-block float-left">
|
||||
<span *ngIf="!acc.isExpanded('publisher-policy-{{j}}')" class="fas fa-chevron-up fa-fw"></span>
|
||||
<span *ngIf="acc.isExpanded('publisher-policy-{{j}}')" class="fas fa-chevron-down fa-fw"></span>
|
||||
</div>
|
||||
<span class="float-left section-title" tabindex="0">{{'submission.sections.sherpa.publisher.policy'
|
||||
| translate}}</span>
|
||||
</ng-template>
|
||||
<ng-template ngbPanelContent>
|
||||
<ds-publisher-policy [policy]="policy"></ds-publisher-policy>
|
||||
</ng-template>
|
||||
</ngb-panel>
|
||||
</ng-container>
|
||||
</ng-container>
|
||||
<ngb-panel id="metadata-{{i}}">
|
||||
<ng-template ngbPanelTitle>
|
||||
<div class="d-inline-block float-left">
|
||||
<span *ngIf="!acc.isExpanded('publication-information')" class="fas fa-chevron-up fa-fw"></span>
|
||||
<span *ngIf="acc.isExpanded('publication-information')" class="fas fa-chevron-down fa-fw"></span>
|
||||
<span *ngIf="!acc.isExpanded('metadata-{{i}}')" class="fas fa-chevron-up fa-fw"></span>
|
||||
<span *ngIf="acc.isExpanded('metadata-{{i}}')" class="fas fa-chevron-down fa-fw"></span>
|
||||
</div>
|
||||
<span class="float-left section-title" tabindex="0">Publication information</span>
|
||||
<span class="float-left section-title" tabindex="0">{{'submission.sections.sherpa.record.information'
|
||||
| translate}}</span>
|
||||
</ng-template>
|
||||
<ng-template ngbPanelContent>
|
||||
<div class="ml-4">
|
||||
<div class="row">
|
||||
<div class="col-4">
|
||||
<p class="m-0">Title</p>
|
||||
</div>
|
||||
<div class="col-4">
|
||||
<p class="m-0" *ngFor="let title of sherpaPoliciesData.details.journals.titles">{{title}}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-4">
|
||||
<p class="m-0">ISSNs</p>
|
||||
</div>
|
||||
<div class="col-4">
|
||||
<p class="m-0" *ngFor="let issn of sherpaPoliciesData.details.journals.issns">{{issn}}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-4">
|
||||
<p class="m-0">URL</p>
|
||||
</div>
|
||||
<div class="col-4">
|
||||
<p class="m-0">
|
||||
<a href="{{sherpaPoliciesData.details.journals.url}}">
|
||||
{{sherpaPoliciesData.details.journals.url}}
|
||||
</a>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-4">
|
||||
<p class="m-0">Publisher</p>
|
||||
</div>
|
||||
<div class="col-4">
|
||||
<p class="m-0">
|
||||
<a href="{{sherpaPoliciesData.details.journals.publisher.uri}}">
|
||||
{{sherpaPoliciesData.details.journals.publisher.name}}
|
||||
</a>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-4">
|
||||
<p class="m-0">romeoPub</p>
|
||||
</div>
|
||||
<div class="col-4">
|
||||
<p class="m-0">
|
||||
{{sherpaPoliciesData.details.journals.romeoPub}}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-4">
|
||||
<p class="m-0">zetoPub</p>
|
||||
</div>
|
||||
<div class="col-4">
|
||||
<p class="m-0">
|
||||
{{sherpaPoliciesData.details.journals.zetoPub}}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</ng-template>
|
||||
</ngb-panel>
|
||||
<ngb-panel id="publisher-policy">
|
||||
<ng-template ngbPanelTitle>
|
||||
<div class="d-inline-block float-left">
|
||||
<span *ngIf="!acc.isExpanded('publisher-policy')" class="fas fa-chevron-up fa-fw"></span>
|
||||
<span *ngIf="acc.isExpanded('publisher-policy')" class="fas fa-chevron-down fa-fw"></span>
|
||||
</div>
|
||||
<span class="float-left section-title" tabindex="0">Publisher Policy</span>
|
||||
</ng-template>
|
||||
<ng-template ngbPanelContent>
|
||||
<div class="ml-4">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<p class="m-0">
|
||||
Open Access pathways permitted by this journal's policy are listed below by article version.
|
||||
Click on a pathway for a more detailed view
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<ds-content-accordion [id]="'permitted-versions'"
|
||||
[data]="sherpaPoliciesData.details.journals.policies.permittedVersions">
|
||||
</ds-content-accordion>
|
||||
<!-- <ds-content-accordion></ds-content-accordion> -->
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<p class="m-0">
|
||||
For more information, please see the following links:
|
||||
</p>
|
||||
<ul>
|
||||
<li *ngFor="let url of sherpaPoliciesData.details.journals.urls">
|
||||
<a href="{{url}}">{{url}}</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<ds-metadata-information [metadata]="sherpaData.metadata"></ds-metadata-information>
|
||||
</ng-template>
|
||||
</ngb-panel>
|
||||
</ngb-accordion>
|
@@ -1,18 +1,14 @@
|
||||
import { WorkspaceitemSectionSherpaPoliciesObject } from './../../../core/submission/models/workspaceitem-section-sherpa-policies.model';
|
||||
import { SectionSherpaPoliciesService } from './section-sherpa-policies.service';
|
||||
import { Component, Inject, ViewChild } from '@angular/core';
|
||||
import { FormControl } from '@angular/forms';
|
||||
import { Component, Inject, ViewChildren, QueryList } from '@angular/core';
|
||||
|
||||
import { filter, map, mergeMap, take } from 'rxjs/operators';
|
||||
import { combineLatest, Observable, of, Subscription } from 'rxjs';
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
import { Observable, of } from 'rxjs';
|
||||
|
||||
import { renderSectionFor } from '../sections-decorator';
|
||||
import { SectionsType } from '../sections-type';
|
||||
import { SectionDataObject } from '../models/section-data.model';
|
||||
import { SectionsService } from '../sections.service';
|
||||
import { SectionModelComponent } from '../models/section.model';
|
||||
import { NgbAccordionConfig } from '@ng-bootstrap/ng-bootstrap';
|
||||
|
||||
/**
|
||||
* This component represents a section for managing item's access conditions.
|
||||
@@ -25,6 +21,8 @@ import { NgbAccordionConfig } from '@ng-bootstrap/ng-bootstrap';
|
||||
@renderSectionFor(SectionsType.SherpaPolicies)
|
||||
export class SubmissionSectionSherpaPoliciesComponent extends SectionModelComponent {
|
||||
|
||||
@ViewChildren('acc', { emitDistinctChangesOnly: true }) acc: QueryList<any>;
|
||||
|
||||
/**
|
||||
* The accesses section data
|
||||
* @type {WorkspaceitemSectionAccessesObject}
|
||||
@@ -56,12 +54,18 @@ export class SubmissionSectionSherpaPoliciesComponent extends SectionModelCompon
|
||||
|
||||
}
|
||||
|
||||
ngAfterViewInit() {
|
||||
this.acc.forEach(accordion => {
|
||||
accordion.expandAll();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Initialize all instance variables and retrieve collection default access conditions
|
||||
*/
|
||||
protected onSectionInit(): void {
|
||||
this.sectionSherpaPoliciesService.getSherpaPoliciesData(this.submissionId, this.sectionData.id).subscribe((sherpaPolicies: WorkspaceitemSectionSherpaPoliciesObject) => {
|
||||
console.log(sherpaPolicies);
|
||||
this.sherpaPoliciesData = sherpaPolicies;
|
||||
});
|
||||
}
|
||||
|
@@ -45,6 +45,9 @@ import { SubmissionAccessesConfigService } from '../core/config/submission-acces
|
||||
import { SectionAccessesService } from './sections/accesses/section-accesses.service';
|
||||
import { SubmissionSectionSherpaPoliciesComponent } from './sections/sherpa-policies/section-sherpa-policies.component';
|
||||
import { ContentAccordionComponent } from './sections/sherpa-policies/content-accordion/content-accordion.component';
|
||||
import { PublisherPolicyComponent } from './sections/sherpa-policies/publisher-policy/publisher-policy.component';
|
||||
import { PublicationInformationComponent } from './sections/sherpa-policies/publication-information/publication-information.component';
|
||||
import { MetadataInformationComponent } from './sections/sherpa-policies/metadata-information/metadata-information.component';
|
||||
|
||||
const ENTRY_COMPONENTS = [
|
||||
// put only entry components that use custom decorator
|
||||
@@ -80,6 +83,9 @@ const DECLARATIONS = [
|
||||
SubmissionImportExternalPreviewComponent,
|
||||
SubmissionImportExternalCollectionComponent,
|
||||
ContentAccordionComponent,
|
||||
PublisherPolicyComponent,
|
||||
PublicationInformationComponent,
|
||||
MetadataInformationComponent,
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
|
@@ -3987,6 +3987,59 @@
|
||||
"submission.sections.accesses.form.until-placeholder": "Until",
|
||||
|
||||
|
||||
"submission.sections.sherpa.publication.information": "Publication information",
|
||||
|
||||
"submission.sections.sherpa.publication.information.title": "Title",
|
||||
|
||||
"submission.sections.sherpa.publication.information.issns": "ISSNs",
|
||||
|
||||
"submission.sections.sherpa.publication.information.url": "URL",
|
||||
|
||||
"submission.sections.sherpa.publication.information.publishers": "Publisher",
|
||||
|
||||
"submission.sections.sherpa.publication.information.romeoPub": "Romeo Pub",
|
||||
|
||||
"submission.sections.sherpa.publication.information.zetoPub": "Zeto Pub",
|
||||
|
||||
|
||||
"submission.sections.sherpa.publisher.policy": "Publisher Policy",
|
||||
|
||||
"submission.sections.sherpa.publisher.policy.openaccess": "Open Access pathways permitted by this journal's policy are listed below by article version. Click on a pathway for a more detailed view",
|
||||
|
||||
"submission.sections.sherpa.publisher.policy.more.information": "For more information, please see the following links:",
|
||||
|
||||
"submission.sections.sherpa.publisher.policy.version": "Version",
|
||||
|
||||
"submission.sections.sherpa.publisher.policy.embargo": "Embargo",
|
||||
|
||||
"submission.sections.sherpa.publisher.policy.noembargo": "No Embargo",
|
||||
|
||||
"submission.sections.sherpa.publisher.policy.license": "License",
|
||||
|
||||
"submission.sections.sherpa.publisher.policy.prerequisites": "Prerequisites",
|
||||
|
||||
"submission.sections.sherpa.publisher.policy.location": "Location",
|
||||
|
||||
"submission.sections.sherpa.publisher.policy.conditions": "Conditions",
|
||||
|
||||
|
||||
"submission.sections.sherpa.record.information": "Record Information",
|
||||
|
||||
"submission.sections.sherpa.record.information.id": "ID",
|
||||
|
||||
"submission.sections.sherpa.record.information.date.created": "Date Created",
|
||||
|
||||
"submission.sections.sherpa.record.information.date.modified": "Last Modified",
|
||||
|
||||
"submission.sections.sherpa.record.information.uri": "URI",
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
"submission.submit.breadcrumbs": "New submission",
|
||||
|
||||
"submission.submit.title": "New submission",
|
||||
|
Reference in New Issue
Block a user