Compare commits

...

4 Commits

Author SHA1 Message Date
John Balasis 8595752167 added cris functionality 2022-04-14 17:34:29 +00:00
John Balasis 378abf98c0 2022-04-11 14:21:43 +00:00
John Balasis fe6d196a91 added cris systems as datasource choice 2022-04-11 14:19:22 +00:00
stefania.martziou 2459cd0a03 Creating a new branch for CRIS registration 2022-04-06 10:14:40 +00:00
19 changed files with 2801 additions and 19769 deletions

22258
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -14,14 +14,14 @@
}, },
"private": true, "private": true,
"dependencies": { "dependencies": {
"@angular/animations": "12.1.2", "@angular/animations": "12.2.16",
"@angular/common": "12.1.2", "@angular/common": "12.2.16",
"@angular/compiler": "12.1.2", "@angular/compiler": "12.2.16",
"@angular/core": "12.1.2", "@angular/core": "12.2.16",
"@angular/forms": "12.1.2", "@angular/forms": "12.2.16",
"@angular/platform-browser": "12.1.2", "@angular/platform-browser": "12.2.16",
"@angular/platform-browser-dynamic": "^12.1.2", "@angular/platform-browser-dynamic": "^12.2.16",
"@angular/router": "12.1.2", "@angular/router": "12.2.16",
"altair": "^1.0.0", "altair": "^1.0.0",
"bootstrap": "^4.1.3", "bootstrap": "^4.1.3",
"core-js": "^2.5.4", "core-js": "^2.5.4",
@ -37,10 +37,10 @@
"zone.js": "~0.11.4" "zone.js": "~0.11.4"
}, },
"devDependencies": { "devDependencies": {
"@angular-devkit/build-angular": "~12.1.2", "@angular-devkit/build-angular": "~12.2.17",
"@angular/cli": "~12.1.2", "@angular/cli": "~12.2.17",
"@angular/compiler-cli": "^12.1.2", "@angular/compiler-cli": "^12.2.16",
"@angular/language-service": "^12.1.2", "@angular/language-service": "^12.2.16",
"@types/jasmine": "~3.6.0", "@types/jasmine": "~3.6.0",
"@types/jasminewd2": "~2.0.3", "@types/jasminewd2": "~2.0.3",
"@types/node": "^12.11.1", "@types/node": "^12.11.1",

View File

@ -65,7 +65,7 @@ export class AppComponent implements OnInit {
console.log(error); console.log(error);
}, },
() => { () => {
console.log(this.reposOfUser); // console.log(this.reposOfUser);
this.reposOfUser.forEach(repo => { this.reposOfUser.forEach(repo => {
if (!repo.consentTermsOfUse || !repo.fullTextDownload) { if (!repo.consentTermsOfUse || !repo.fullTextDownload) {
this.addTerm(repo.officialname, repo.id, repo.consentTermsOfUse); this.addTerm(repo.officialname, repo.id, repo.consentTermsOfUse);

View File

@ -26,7 +26,7 @@ export const interfaceFormDesc = {
/* Desription of the Datasource Info Forms Fields */ /* Desription of the Datasource Info Forms Fields */
export const softwarePlatformDesc = { export const softwarePlatformDesc = {
desc: 'The typology used by your repository/journal.\nIf you use a typology not found in the drop-down list,\nyou can enter a custom name in the field below.', desc: 'The typology used by your repository/journal.\nIf you use a typology not found in the drop-down list,\nyou can enter a custom name in the field below.',
label: 'Software Platform (*)', label: 'Software Platform',
mandatory: true, mandatory: true,
recommended: false recommended: false
}; };
@ -40,14 +40,14 @@ export const platformNameDesc = {
export const officialNameDesc = { export const officialNameDesc = {
desc: 'Your repository\'s/journal\'s official name.', desc: 'Your repository\'s/journal\'s official name.',
label: 'Official Name (*)', label: 'Official Name',
mandatory: true, mandatory: true,
recommended: false recommended: false
}; };
export const issnDesc = { export const issnDesc = {
desc: 'Input your journal\'s issn (www.issn.org)', desc: 'Input your journal\'s issn (www.issn.org)',
label: 'ISSN (*)', label: 'ISSN',
mandatory: true, mandatory: true,
recommended: false recommended: false
}; };
@ -68,49 +68,49 @@ export const lissnDesc = {
export const repoDescriptionDesc = { export const repoDescriptionDesc = {
desc: 'A description of your repository/journal', desc: 'A description of your repository/journal',
label: 'Description (*)', label: 'Description',
mandatory: true, mandatory: true,
recommended: false recommended: false
}; };
export const countryDesc = { export const countryDesc = {
desc: 'The country where your repository/journal is located', desc: 'The country where your repository/journal is located',
label: 'Country (*)', label: 'Country',
mandatory: true, mandatory: true,
recommended: false recommended: false
}; };
export const longtitudeDesc = { export const longtitudeDesc = {
desc: 'The (approximate) longtitude of your repository/journal\'s location', desc: 'The (approximate) longtitude of your repository/journal\'s location',
label: 'Longtitude (*)', label: 'Longtitude',
mandatory: true, mandatory: true,
recommended: false recommended: false
}; };
export const latitudeDesc = { export const latitudeDesc = {
desc: 'The (approximate) latitude of your repository/journal\'s location', desc: 'The (approximate) latitude of your repository/journal\'s location',
label: 'Latitude (*)', label: 'Latitude',
mandatory: true, mandatory: true,
recommended: false recommended: false
}; };
export const websiteUrlDesc = { export const websiteUrlDesc = {
desc: 'The main page of your repository/journal\'s website', desc: 'The main page of your repository/journal\'s website',
label: 'Entry URL (*)', label: 'Entry URL',
mandatory: true, mandatory: true,
recommended: false recommended: false
}; };
export const institutionNameDesc = { export const institutionNameDesc = {
desc: 'The institution that your repository belongs to', desc: 'The institution that your repository belongs to',
label: 'Institution (*)', label: 'Institution',
mandatory: true, mandatory: true,
recommended: false recommended: false
}; };
export const englishNameDesc = { export const englishNameDesc = {
desc: 'Your repository/journal\'s name in english', desc: 'Your repository/journal\'s name in english',
label: 'English Name (*)', label: 'English Name',
mandatory: true, mandatory: true,
recommended: false recommended: false
}; };
@ -124,35 +124,35 @@ export const logoUrlDesc = {
export const timezoneDesc = { export const timezoneDesc = {
desc: 'The timezone of the area where your repository/ journal is located', desc: 'The timezone of the area where your repository/ journal is located',
label: 'Timezone (*)', label: 'Timezone',
mandatory: true, mandatory: true,
recommended: false recommended: false
}; };
export const datasourceTypeDesc = { export const datasourceTypeDesc = {
desc: 'The type of your repository', desc: 'The type of your repository',
label: 'Repository Type (*)', label: 'Repository Type',
mandatory: true, mandatory: true,
recommended: false recommended: false
}; };
export const journalTypeDesc = { export const journalTypeDesc = {
desc: 'The type of your journal', desc: 'The type of your journal',
label: 'Journal Type (*)', label: 'Journal Type',
mandatory: true, mandatory: true,
recommended: false recommended: false
}; };
export const aggregatorTypeDesc = { export const aggregatorTypeDesc = {
desc: 'The type of your aggregator', desc: 'The type of your aggregator',
label: 'Aggregator Type (*)', label: 'Aggregator Type',
mandatory: true, mandatory: true,
recommended: false recommended: false
}; };
export const adminEmailDesc = { export const adminEmailDesc = {
desc: 'The email address of the repository/journal\'s administrator', desc: 'The email address of the repository/journal\'s administrator',
label: 'Admin Email (*)', label: 'Admin Email',
mandatory: true, mandatory: true,
recommended: false recommended: false
}; };

View File

@ -57,8 +57,7 @@
<div *ngFor="let inter of dataForInterfaceComp" class="uk-width-1-2@m uk-margin-bottom"> <div *ngFor="let inter of dataForInterfaceComp" class="uk-width-1-2@m uk-margin-bottom">
<div> <div>
<div class="md-card" style="height: 100%"> <div class="md-card" style="height: 100%">
<app-repository-interface-form #interfacesArray <app-repository-interface-form #interfacesArray [data]="inter"
[data]="inter"
(emitDeleteInterface)="removeInterfaceFromList($event)"> (emitDeleteInterface)="removeInterfaceFromList($event)">
</app-repository-interface-form> </app-repository-interface-form>
</div> </div>

View File

@ -30,12 +30,12 @@
<h3>Literature repository</h3> <h3>Literature repository</h3>
<!--<a [routerLink]="['literature']" [queryParams]="{ step: 'selectDatasource' }" class="el-link uk-position-cover uk-margin-remove-adjacent"></a>--> <!--<a [routerLink]="['literature']" [queryParams]="{ step: 'selectDatasource' }" class="el-link uk-position-cover uk-margin-remove-adjacent"></a>-->
<div class="uk-transition-slide-bottom uk-position-bottom uk-overlay uk-overlay-primary" (click)="goTo('literature')" style="cursor: pointer"> <div class="uk-transition-slide-bottom uk-position-bottom uk-overlay uk-overlay-primary" (click)="goTo('literature')" style="cursor: pointer">
<p class="uk-margin-remove">Make sure your repository is already registered in OpenDOAR, the authoritative <p class="uk-margin-remove">Make sure your repository is already registered in OpenDOAR, the
directory of institutional and thematic OA repositories, and is compatible with the OpenAIRE Guidelines for Literature Repositories.</p> authoritative directory of institutional and thematic OA repositories, and is compatible with the
OpenAIRE Guidelines for Literature Repositories.</p>
<a href="http://v2.sherpa.ac.uk/opendoar/" target="_blank"> <a href="http://v2.sherpa.ac.uk/opendoar/" target="_blank">
List provided by List provided by<br>
<br> OpenDOAR<i class="fas fa-external-link-alt" style="margin-left: 3px !important;"></i>
OpenDOAR<i class="fas fa-external-link-alt" style="margin-left: 3px !important;"></i>
</a> </a>
</div> </div>
@ -108,6 +108,22 @@
</div> </div>
</div> </div>
<div class="">
<div class="uk-text-center md-card md-card-default md-card-hover uk-scrollspy-inview uk-animation-slide-top-medium
datasourceTypeCard uk-inline-clip uk-transition-toggle" uk-scrollspy-class="" tabindex="0">
<a [routerLink]="['cris']" [queryParams]="{ step: 'selectDatasource' }" class="el-link uk-position-cover uk-margin-remove-adjacent"></a>
<div class="md-card-content large-padding uk-margin-medium-top uk-margin-bottom">
<div class="">
<img class="el-image" src="../../../assets/imgs/datasourcetypes/Cris.svg" alt="" width="50">
</div>
<h3>CRIS systems</h3>
<div class="uk-transition-slide-bottom uk-position-bottom uk-overlay uk-overlay-primary" (click)="goTo('cris')" style="cursor: pointer">
<p class="uk-margin-remove">Stay tuned.</p>
</div>
</div>
</div>
</div>
</div> </div>
<hr style="border-top: 1px solid #dedede; margin-top: 40px; margin-bottom: 30px;"> <hr style="border-top: 1px solid #dedede; margin-top: 40px; margin-bottom: 30px;">
@ -117,23 +133,6 @@
<div class="uk-margin uk-grid uk-grid-match uk-grid-medium repositoryTypeSelection uk-child-width-1-3@l uk-child-widht-1-3@m" uk-grid=""> <div class="uk-margin uk-grid uk-grid-match uk-grid-medium repositoryTypeSelection uk-child-width-1-3@l uk-child-widht-1-3@m" uk-grid="">
<div class="uk-row-first"> <div class="uk-row-first">
<div class="uk-text-center md-card md-card-default md-card-hover uk-scrollspy-inview uk-animation-slide-top-medium
datasourceTypeCard uk-inline-clip uk-transition-toggle" uk-scrollspy-class="" tabindex="0">
<a class="el-link uk-position-cover uk-margin-remove-adjacent uk-disabled"></a>
<div class="md-card-content large-padding uk-margin-medium-top uk-margin-bottom">
<div class="">
<img class="el-image" src="../../../assets/imgs/datasourcetypes/Cris.svg" alt="" width="50">
</div>
<h3>CRIS systems</h3>
<div class="uk-transition-slide-bottom uk-position-bottom uk-overlay uk-overlay-primary">
<p class="uk-margin-remove">Stay tuned.</p>
</div>
</div>
<div class="whiteFilm"></div>
</div>
</div>
<div class="">
<div class="uk-text-center md-card md-card-default md-card-hover uk-scrollspy-inview uk-animation-slide-top-medium <div class="uk-text-center md-card md-card-default md-card-hover uk-scrollspy-inview uk-animation-slide-top-medium
datasourceTypeCard uk-inline-clip uk-transition-toggle" uk-scrollspy-class="" tabindex="0"> datasourceTypeCard uk-inline-clip uk-transition-toggle" uk-scrollspy-class="" tabindex="0">
<a class="el-link uk-position-cover uk-margin-remove-adjacent uk-disabled"></a> <a class="el-link uk-position-cover uk-margin-remove-adjacent uk-disabled"></a>
@ -167,11 +166,7 @@
</div> </div>
</div> </div>
</div> <div class="">
<div class="uk-margin uk-grid uk-grid-match uk-grid-medium repositoryTypeSelection uk-child-width-1-3@l uk-child-widht-1-3@m" uk-grid="">
<div class="uk-row-first">
<div class="uk-text-center md-card md-card-default md-card-hover uk-scrollspy-inview uk-animation-slide-top-medium <div class="uk-text-center md-card md-card-default md-card-hover uk-scrollspy-inview uk-animation-slide-top-medium
datasourceTypeCard uk-inline-clip uk-transition-toggle" uk-scrollspy-class="" tabindex="0"> datasourceTypeCard uk-inline-clip uk-transition-toggle" uk-scrollspy-class="" tabindex="0">
<a class="el-link uk-position-cover uk-margin-remove-adjacent uk-disabled"></a> <a class="el-link uk-position-cover uk-margin-remove-adjacent uk-disabled"></a>
@ -190,6 +185,12 @@
</div> </div>
<div class="uk-margin uk-grid uk-grid-match uk-grid-medium repositoryTypeSelection uk-child-width-1-3@l uk-child-widht-1-3@m" uk-grid="">
</div>
</div> </div>
<!-- RIGHT HELP CONTENT --> <!-- RIGHT HELP CONTENT -->

View File

@ -1,5 +1,5 @@
import { Component, OnInit } from '@angular/core'; import {Component, OnInit} from '@angular/core';
import { Router } from "@angular/router"; import {Router} from '@angular/router';
@Component({ @Component({
selector: 'app-sources-register', selector: 'app-sources-register',
@ -8,27 +8,28 @@ import { Router } from "@angular/router";
export class SourcesRegisterComponent implements OnInit { export class SourcesRegisterComponent implements OnInit {
constructor(private router: Router) { constructor(private router: Router) {}
}
ngOnInit() { ngOnInit() {
let body = document.getElementsByTagName('body')[0]; const body = document.getElementsByTagName('body')[0];
body.classList.remove("top_bar_active"); //remove the class body.classList.remove('top_bar_active'); // remove the class
body.classList.remove("page_heading_active"); body.classList.remove('page_heading_active');
body.classList.remove("landing"); body.classList.remove('landing');
body.classList.add("dashboard"); body.classList.add('dashboard');
} }
// fixme still when I click the link inside the text in overlay, this event happens as well (I go to the first step of the wizard) // fixme still when I click the link inside the text in overlay, this event happens as well (I go to the first step of the wizard)
goTo(datasourceType: string) { goTo(datasourceType: string) {
if(datasourceType==='literature') { if (datasourceType === 'literature') {
this.router.navigateByUrl(`/sources/register/${datasourceType}?step=selectDatasource`); this.router.navigateByUrl(`/sources/register/${datasourceType}?step=selectDatasource`);
} else if(datasourceType==='data') { } else if (datasourceType === 'data') {
this.router.navigateByUrl(`/sources/register/${datasourceType}?step=selectDatasource`); this.router.navigateByUrl(`/sources/register/${datasourceType}?step=selectDatasource`);
} else if(datasourceType==='journal') { } else if (datasourceType === 'journal') {
this.router.navigateByUrl(`/sources/register/${datasourceType}?step=basicInformation`); this.router.navigateByUrl(`/sources/register/${datasourceType}?step=basicInformation`);
} else if(datasourceType==='aggregator') { } else if (datasourceType === 'aggregator') {
this.router.navigateByUrl(`/sources/register/${datasourceType}?step=basicInformation`); this.router.navigateByUrl(`/sources/register/${datasourceType}?step=basicInformation`);
} else if (datasourceType === 'cris') {
this.router.navigateByUrl(`/sources/register/${datasourceType}?step=selectDatasource`);
} }
} }
} }

View File

@ -11,8 +11,8 @@
</a> </a>
. <br> . <br>
<span *ngIf="latestUpdate && (latestUpdate !== 'null')"> <span *ngIf="latestUpdate && (latestUpdate !== 'null')">
<b>Last Updated: </b>{{ latestUpdate }} <b>Last Updated: </b>{{ latestUpdate }}
</span> </span>
</div> </div>
<div class="uk-margin-medium-top"> <div class="uk-margin-medium-top">
<div class="md-input-wrapper md-input-filled"> <div class="md-input-wrapper md-input-filled">

View File

@ -51,39 +51,41 @@ export class RegisterDatasourceSelectExistingComponent implements OnInit {
} else if (this.mode === 're3data') { } else if (this.mode === 're3data') {
this.sourceUrl = 'https://www.re3data.org/'; this.sourceUrl = 'https://www.re3data.org/';
this.sourceTitle = 'Re3data'; this.sourceTitle = 'Re3data';
} else if (this.mode === 'cris') {
this.sourceUrl = 'https://eurocris.org';
this.sourceTitle = 'euroCris';
} }
this.getLatestUpdate(); this.getLatestUpdate();
} }
getCountries() { getCountries() {
this.repoService.getCountries() this.repoService.getCountries().subscribe(
.subscribe( countries => {
countries => { // TODO: check again getCountries null return values
// TODO: check again getCountries null return values /*/!* check for null values *!/
/*/!* check for null values *!/ let nullVals = countries.filter(el => el.name === null);
let nullVals = countries.filter(el => el.name === null); /!* remove null values from array *!/
/!* remove null values from array *!/ for (let nullVal of nullVals) {
for (let nullVal of nullVals) { let i = countries.findIndex(el => el === nullVal);
let i = countries.findIndex(el => el === nullVal); /!* remove null value from array *!/
/!* remove null value from array *!/ if (i !== -1) { countries.splice(i, 1); }
if (i !== -1) { countries.splice(i, 1); } }*/
}*/
/* sort countries array */ /* sort countries array */
this.countries = countries.sort( function(a, b) { this.countries = countries.sort( function(a, b) {
if (a.name < b.name) { if (a.name < b.name) {
return -1; return -1;
} else if (a.name > b.name) { } else if (a.name > b.name) {
return 1; return 1;
} else { } else {
return 0; return 0;
} }
} ); } );
}, },
error => { error => {
this.alertMessage = noServiceMessage; this.alertMessage = noServiceMessage;
console.log(error); console.log(error);
}); });
} }
getReposInCountry(i: number) { getReposInCountry(i: number) {

View File

@ -74,7 +74,8 @@
#datasourcesByCountry #datasourcesByCountry
[mode]="currentMode" [mode]="currentMode"
(emitRepoId)="getRepoId($event)" (emitRepoId)="getRepoId($event)"
(promptNext)="goToStep2($event)"></app-select-existing-datasource> (promptNext)="goToStep2($event)">
</app-select-existing-datasource>
</section> </section>
<!-- second section --> <!-- second section -->
@ -83,9 +84,9 @@
class="body step-1 {{ (currentStep == 1) ? 'current' : '' }}" data-step="1" aria-hidden="true"> class="body step-1 {{ (currentStep == 1) ? 'current' : '' }}" data-step="1" aria-hidden="true">
<datasource-update-form *ngIf="(currentStep === 1) && (repo !== null) && !loadingMessage" <datasource-update-form *ngIf="(currentStep === 1) && (repo !== null) && !loadingMessage"
#registerDatasource #registerDatasource [selectedRepo]="repo" [mode]="currentMode"
[selectedRepo]="repo" (emittedInfo)="getUpdatedRepo($event)">
(emittedInfo)="getUpdatedRepo($event)"></datasource-update-form> </datasource-update-form>
</section> </section>
<!-- third section --> <!-- third section -->
@ -99,7 +100,7 @@
<div> <div>
<div class="md-card" style="height: 100%"> <div class="md-card" style="height: 100%">
<app-repository-interface-form #interfacesArray <app-repository-interface-form #interfacesArray
[data]="inter" [data]="inter" [mode]="currentMode"
(emitDeleteInterface)="removeInterfaceFromList($event)"> (emitDeleteInterface)="removeInterfaceFromList($event)">
</app-repository-interface-form> </app-repository-interface-form>
</div> </div>

View File

@ -19,7 +19,7 @@ import {
} from '../../../domain/shared-messages'; } from '../../../domain/shared-messages';
import { DatasourceUpdateFormComponent } from '../../../shared/reusablecomponents/sources-forms/datasource-update-form.component'; import { DatasourceUpdateFormComponent } from '../../../shared/reusablecomponents/sources-forms/datasource-update-form.component';
import { RegisterDatasourceSelectExistingComponent } from './register-datasource-select-existing.component'; import { RegisterDatasourceSelectExistingComponent } from './register-datasource-select-existing.component';
import {DatasourceUpdateTermsFormComponent} from "../../../shared/reusablecomponents/sources-forms/datasource-update-terms-form.component"; import {DatasourceUpdateTermsFormComponent} from '../../../shared/reusablecomponents/sources-forms/datasource-update-terms-form.component';
@Component({ @Component({
selector: 'app-register-existing-datasource', selector: 'app-register-existing-datasource',

View File

@ -91,7 +91,7 @@
<div> <div>
<div class="md-card" style="height: 100%"> <div class="md-card" style="height: 100%">
<app-repository-interface-form #interfacesArray <app-repository-interface-form #interfacesArray
[data]="inter" [data]="inter" [mode]=""
(emitDeleteInterface)="removeInterfaceFromList($event)"> (emitDeleteInterface)="removeInterfaceFromList($event)">
</app-repository-interface-form> </app-repository-interface-form>
</div> </div>

View File

@ -9,12 +9,13 @@ import { DatasourceNewInterfaceFormComponent } from '../../../shared/reusablecom
import { from, of } from 'rxjs'; import { from, of } from 'rxjs';
import { concatMap } from 'rxjs/operators'; import { concatMap } from 'rxjs/operators';
import { errorsInInterfaces, formErrorRegisterRepo, noInterfacesSaved } from '../../../domain/shared-messages'; import { errorsInInterfaces, formErrorRegisterRepo, noInterfacesSaved } from '../../../domain/shared-messages';
import {DatasourceUpdateTermsFormComponent} from "../../../shared/reusablecomponents/sources-forms/datasource-update-terms-form.component"; import {DatasourceUpdateTermsFormComponent} from '../../../shared/reusablecomponents/sources-forms/datasource-update-terms-form.component';
@Component({ @Component({
selector: 'app-register-new-datasource', selector: 'app-register-new-datasource',
templateUrl: './register-new-datasource.component.html' templateUrl: './register-new-datasource.component.html'
}) })
export class RegisterNewDatasourceComponent implements OnInit { export class RegisterNewDatasourceComponent implements OnInit {
loadingMessage: string; loadingMessage: string;
errorMessage: string; errorMessage: string;
@ -205,7 +206,7 @@ export class RegisterNewDatasourceComponent implements OnInit {
); );
} }
//recheck if needed // recheck if needed
getTerms(repo: Repository) { getTerms(repo: Repository) {
console.log('this.repo', this.repo.consentTermsOfUse, this.repo.fullTextDownload); console.log('this.repo', this.repo.consentTermsOfUse, this.repo.fullTextDownload);
console.log('repo', repo.consentTermsOfUse, repo.fullTextDownload); console.log('repo', repo.consentTermsOfUse, repo.fullTextDownload);

View File

@ -0,0 +1,20 @@
/*
* updated by myrto on 19/12/2018
*/
import { Component, OnInit } from '@angular/core';
import { RegisterExistingDatasourceComponent } from './register-existing-datasource.component';
@Component ({
selector: 'app-sr-literature',
templateUrl: './register-existing-datasource.component.html'
})
export class SrCrisComponent extends RegisterExistingDatasourceComponent implements OnInit {
ngOnInit() {
this.datasourceType = 'cris';
this.currentMode = 'cris';
super.ngOnInit();
}
}

View File

@ -15,6 +15,7 @@ import { SrAggregatorComponent } from './sources-register/sr-aggregator.componen
import { RegisterNewDatasourceComponent } from './sources-register/register-new-datasource.component'; import { RegisterNewDatasourceComponent } from './sources-register/register-new-datasource.component';
import { RegisterExistingDatasourceComponent } from './sources-register/register-existing-datasource.component'; import { RegisterExistingDatasourceComponent } from './sources-register/register-existing-datasource.component';
import { DatasourceUpdateTermsFormComponent } from '../../shared/reusablecomponents/sources-forms/datasource-update-terms-form.component'; import { DatasourceUpdateTermsFormComponent } from '../../shared/reusablecomponents/sources-forms/datasource-update-terms-form.component';
import {SrCrisComponent} from './sources-register/sr-cris.component';
@NgModule ({ @NgModule ({
imports: [ imports: [
@ -37,6 +38,7 @@ import { DatasourceUpdateTermsFormComponent } from '../../shared/reusablecompone
SrDataComponent, SrDataComponent,
SrJournalComponent, SrJournalComponent,
SrAggregatorComponent, SrAggregatorComponent,
SrCrisComponent,
RegisterDatasourceSelectExistingComponent, RegisterDatasourceSelectExistingComponent,
DatasourceUpdateTermsFormComponent, DatasourceUpdateTermsFormComponent,
RepoFilter // a pipe that searches for string in repository name RepoFilter // a pipe that searches for string in repository name

View File

@ -5,6 +5,7 @@ import { SrLiteratureComponent } from './sources-register/sr-literature.componen
import { SrDataComponent } from './sources-register/sr-data.component'; import { SrDataComponent } from './sources-register/sr-data.component';
import { SrJournalComponent } from './sources-register/sr-journal.component'; import { SrJournalComponent } from './sources-register/sr-journal.component';
import { SrAggregatorComponent } from './sources-register/sr-aggregator.component'; import { SrAggregatorComponent } from './sources-register/sr-aggregator.component';
import {SrCrisComponent} from './sources-register/sr-cris.component';
const sourcesRoutes: Routes = [ const sourcesRoutes: Routes = [
{ {
@ -33,30 +34,14 @@ const sourcesRoutes: Routes = [
{ {
path: 'aggregator', path: 'aggregator',
component: SrAggregatorComponent component: SrAggregatorComponent
},
{
path: 'cris',
component: SrCrisComponent
} }
] ]
}, },
] ]
// path: '',
// component: SourcesRegisterComponent,
// children: [
// {
// path: 'literature',
// component: SrLiteratureComponent
// },
// {
// path: 'data',
// component: SrDataComponent
// },
// {
// path: 'journal',
// component: SrJournalComponent
// },
// {
// path: 'aggregator',
// component: SrAggregatorComponent
// }
// ]
} }
]; ];

View File

@ -122,14 +122,14 @@ export class MyGroup implements OnInit, AfterContentInit {
<div class=""> <div class="">
<label class="" *ngIf="description?.label !== null && description?.label !== ''" <label class="" *ngIf="description?.label !== null && description?.label !== ''"
[ngClass]="{'required' : description.mandatory==true}" title="{{ description.desc }}"> [ngClass]="{'required' : description.mandatory==true}" title="{{ description.desc }}">
{{ description.label }} {{ description.label + (description.mandatory ? ' (*)' : '') }}
</label> </label>
<ng-content></ng-content> <ng-content></ng-content>
<span class="md-input-bar"></span> <span class="md-input-bar"></span>
</div> </div>
` `
}) })
export class InlineFormWrapper implements OnChanges { export class InlineFormWrapper implements OnChanges {
@Input() public description: Description = null; @Input() public description: Description = null;

View File

@ -26,6 +26,7 @@ export class DatasourceNewInterfaceFormComponent implements OnInit {
invalidCustomBaseUrl = invalidCustomBaseUrl; invalidCustomBaseUrl = invalidCustomBaseUrl;
@Input() data: any[] = []; // expects an array containing at least 3 of the 4 below fields in this order @Input() data: any[] = []; // expects an array containing at least 3 of the 4 below fields in this order
@Input() mode: string = null;
inRegister: boolean; inRegister: boolean;
interfaceID: number; // holds the interface index in the interfaces array as displayed interfaceID: number; // holds the interface index in the interfaces array as displayed
currentRepo: RepoFields; // a fraction of the Repository class currentRepo: RepoFields; // a fraction of the Repository class
@ -125,7 +126,11 @@ export class DatasourceNewInterfaceFormComponent implements OnInit {
} }
getCompatibilityClasses() { getCompatibilityClasses() {
this.repoService.getCompatibilityClasses(this.currentRepo.datasourceType).subscribe( // FIXME: Use eoscDatasourceType when we support the new model
if (this.mode === null) {
this.mode = this.currentRepo.datasourceType;
}
this.repoService.getCompatibilityClasses(this.mode).subscribe(
classes => { classes => {
this.compClasses = classes; this.compClasses = classes;
this.classCodes = Object.keys(this.compClasses); this.classCodes = Object.keys(this.compClasses);

View File

@ -8,7 +8,7 @@ import { Description, softwarePlatformDesc, platformNameDesc, officialNameDesc,
longtitudeDesc, latitudeDesc, websiteUrlDesc, institutionNameDesc, englishNameDesc, logoUrlDesc, timezoneDesc, longtitudeDesc, latitudeDesc, websiteUrlDesc, institutionNameDesc, englishNameDesc, logoUrlDesc, timezoneDesc,
datasourceTypeDesc, adminEmailDesc, lissnDesc, eissnDesc, issnDesc } from '../../../domain/oa-description'; datasourceTypeDesc, adminEmailDesc, lissnDesc, eissnDesc, issnDesc } from '../../../domain/oa-description';
import { AuthenticationService } from '../../../services/authentication.service'; import { AuthenticationService } from '../../../services/authentication.service';
import {SharedService} from "../../../services/shared.service"; import {SharedService} from '../../../services/shared.service';
@Component ({ @Component ({
selector: 'datasource-update-form', selector: 'datasource-update-form',
@ -32,6 +32,8 @@ export class DatasourceUpdateFormComponent implements OnInit {
@Input() selectedRepo: Repository; @Input() selectedRepo: Repository;
@Input() mode: string;
@Input() showButton: boolean; @Input() showButton: boolean;
repoId: string; repoId: string;
@ -99,7 +101,7 @@ export class DatasourceUpdateFormComponent implements OnInit {
setupUpdateForm() { setupUpdateForm() {
if (this.selectedRepo) { if (this.selectedRepo) {
console.log(`my datasource type is: ${this.selectedRepo.datasourceType}`); console.log(`mode is: ${this.mode}`);
this.updateGroup.setValue({ this.updateGroup.setValue({
softwarePlatform: this.selectedRepo.typology, softwarePlatform: this.selectedRepo.typology,
@ -126,19 +128,22 @@ export class DatasourceUpdateFormComponent implements OnInit {
this.updateGroup.get('platformName').setValue(this.selectedRepo.typology); this.updateGroup.get('platformName').setValue(this.selectedRepo.typology);
} }
if ((this.selectedRepo.datasourceType === 'opendoar') || // FIXME: Use eoscDatasourceType when we support the new model
(this.selectedRepo.datasourceType === 're3data')) { if ((this.mode === 'opendoar') || (this.mode === 're3data')) {
// this.updateGroup.get('officialName').disable();
this.updateGroup.get('country').disable(); this.updateGroup.get('country').disable();
// this.updateGroup.get('longtitude').disable();
// this.updateGroup.get('latitude').disable();
// this.updateGroup.get('websiteUrl').disable();
// this.updateGroup.get('institutionName').disable();
} }
if (this.selectedRepo.datasourceType === 'journal') { // FIXME: Use eoscDatasourceType when we support the new model
if (this.mode === 'cris') {
this.longtitudeDesc.mandatory = false;
this.latitudeDesc.mandatory = false;
this.datasourceTypeDesc.label = 'CRIS scope/type';
}
// FIXME: Use eoscDatasourceType when we support the new model
if (this.mode === 'journal') {
let ssnToShow = this.selectedRepo.issn.slice(0, 4) + '-' + this.selectedRepo.issn.toString().slice(4); let ssnToShow = this.selectedRepo.issn.slice(0, 4) + '-' + this.selectedRepo.issn.toString().slice(4);
this.updateGroup.get('issn').setValue(ssnToShow); this.updateGroup.get('issn').setValue(ssnToShow);
@ -160,12 +165,12 @@ export class DatasourceUpdateFormComponent implements OnInit {
this.updateGroup.get('eissn').disable(); this.updateGroup.get('eissn').disable();
this.updateGroup.get('lissn').disable();*/ this.updateGroup.get('lissn').disable();*/
} }
/*this.getDatasourceClasses();*/
} }
} }
getDatasourceClasses() { getDatasourceClasses() {
this.repoService.getDatasourceClasses(this.selectedRepo.datasourceType).subscribe( // FIXME: Use eoscDatasourceType when we support the new model
this.repoService.getDatasourceClasses(this.mode).subscribe(
classes => this.datasourceClasses = classes, classes => this.datasourceClasses = classes,
error => { error => {
this.loadingMessage = ''; this.loadingMessage = '';
@ -266,7 +271,7 @@ export class DatasourceUpdateFormComponent implements OnInit {
} else { } else {
this.successMessage = formSuccessUpdatedRepo; this.successMessage = formSuccessUpdatedRepo;
} }
//fixme is this the place to update the subject?? // fixme is this the place to update the subject??
this.sharedService.setRepository(this.selectedRepo); this.sharedService.setRepository(this.selectedRepo);
} }
); );