Merging terms of use branch

This commit is contained in:
stefania.martziou 2022-04-06 10:10:42 +00:00
parent c7e7a28408
commit 3c74f2a381
15 changed files with 201 additions and 191 deletions

View File

@ -50,26 +50,36 @@
<!-- End Matomo Code --> <!-- End Matomo Code -->
<!--&lt;!&ndash; Terms of Use (modal) &ndash;&gt;--> <!-- Terms of Use (modal) -->
<!--<confirmation-dialog #subscribeToTermsModal [title]=modalTitle [isModalShown]=isModalShown--> <confirmation-dialog #subscribeToTermsModal [title]=modalTitle [isModalShown]=isModalShown
<!-- [confirmActionButton]=modalButton (emitObject)="updateTerms()">--> [confirmActionButton]=modalButton (emitObject)="updateTerms()">
<!-- <form class="" [formGroup]="agreementForm">--> <form class="" [formGroup]="agreementForm">
<!-- <div formArrayName="terms">--> <div formArrayName="terms">
<!-- <table class="table">--> <table class="table">
<!-- <tr class="uk-text-nowrap">Do you agree with the <a href="https://zenodo.org/record/1446384#.XiGIAdmxU5n" target="_blank">terms of use</a>?</tr>--> <tr>
<!-- <tbody>--> Thanks for being part of OpenAIRE. Please confirm the acceptance of our datasources policy.
<!-- <tr class="el-item" *ngFor="let term of terms.controls; let i=index">--> </tr>
<!--&lt;!&ndash; {{term.get('accept').value}}&ndash;&gt;--> <br>
<!-- <br> {{term.get('name').value}} <br>--> <tr>
<!-- <div [formGroupName]="i">--> Being registered in OpenAIRE, you are giving consent to OpenAIRE to download, transform and enrich the metadata records, publishing them in the OpenAIRE Research Graph.
<!-- <label>--> </tr>
<!-- <input id="i" type="checkbox" formControlName="accept"> Yes, I agree to the terms of use.--> <tbody>
<!-- </label>--> <tr class="el-item" *ngFor="let term of terms.controls; let i=index">
<!-- </div>--> <br> {{term.get('name').value}} <br>
<!-- </tr>--> <div [formGroupName]="i">
<!-- </tbody>--> <label>
<!-- </table>--> <input id="consentTerms" type="checkbox" formControlName="consentTermsOfUse"> Accept the <a href="https://www.openaire.eu/terms-of-use-for-content-providers" target="_blank">Terms of Use</a>
<!-- </div>--> </label>
<!-- </form>--> <br>
<!-- &lt;!&ndash; <pre>{{this.agreementForm.value | json}}</pre>&ndash;&gt;--> <label>
<!--</confirmation-dialog>--> <input id="consentText" type="checkbox" formControlName="fullTextDownload"> Agree to the <a href="https://www.openaire.eu/terms-of-use-for-content-providers#consent" target="_blank">re-use of full texts</a>
</label>
</div>
</tr>
</tbody>
<p class="uk-text-meta">Note: OpenAIRE will not provide the full text files for public distribution, the users will access from the original datasource.</p>
</table>
</div>
</form>
<!-- <pre>{{this.agreementForm.value | json}}</pre>-->
</confirmation-dialog>

View File

@ -5,10 +5,10 @@ import { environment } from '../environments/environment';
import { MatomoTracker } from 'ngx-matomo'; import { MatomoTracker } from 'ngx-matomo';
import { ConfirmationDialogComponent } from './shared/reusablecomponents/confirmation-dialog.component'; import { ConfirmationDialogComponent } from './shared/reusablecomponents/confirmation-dialog.component';
import { RepositoryService } from './services/repository.service'; import { RepositoryService } from './services/repository.service';
import { RepositorySnippet } from './domain/typeScriptClasses'; import {RepositorySnippet, TermsOfUse} from './domain/typeScriptClasses';
import {FormBuilder, FormGroup, FormControl, FormArray} from '@angular/forms'; import {FormBuilder, FormGroup, FormControl, FormArray} from '@angular/forms';
import {element} from 'protractor'; import {element} from 'protractor';
import {timestamp} from 'rxjs/operators'; import {timeout, timestamp} from 'rxjs/operators';
@Component({ @Component({
selector: 'oa-repo-manager', selector: 'oa-repo-manager',
@ -38,7 +38,7 @@ export class AppComponent implements OnInit {
private repositoryService: RepositoryService, private repositoryService: RepositoryService,
private fb: FormBuilder) { private fb: FormBuilder) {
console.log('21-06-2019. Fixed matomo to log userIds?'); // console.log('21-06-2019. Fixed matomo to log userIds?');
/*disabling console.log in production*/ /*disabling console.log in production*/
if ( environment.production === true ) { if ( environment.production === true ) {
@ -57,15 +57,17 @@ export class AppComponent implements OnInit {
} }
getReposOfUser(): void { getReposOfUser(): void {
this.repositoryService.getRepositoriesSnippetsOfUser() this.repositoryService.getRepositoriesSnippetsOfUser().subscribe(
.subscribe( repos => {
repos => { this.reposOfUser = repos; }, this.reposOfUser = repos;
error => { console.log(error); }, },
error => {
console.log(error);
},
() => { () => {
console.log(this.reposOfUser); console.log(this.reposOfUser);
this.reposOfUser.forEach( repo => { this.reposOfUser.forEach(repo => {
// TODO: change !repo.consentTermsOfUse check when it gets a non-null value if (!repo.consentTermsOfUse || !repo.fullTextDownload) {
if (this.authService.isLoggedIn && !repo.consentTermsOfUse) {
this.addTerm(repo.officialname, repo.id, repo.consentTermsOfUse); this.addTerm(repo.officialname, repo.id, repo.consentTermsOfUse);
this.isModalShown = true; this.isModalShown = true;
} }
@ -75,18 +77,10 @@ export class AppComponent implements OnInit {
} }
updateTerms() { updateTerms() {
/* update consentTermsOfUse, consentTermsOfUseDate(?) this.repositoryService.updateRepositoriesTerms(this.agreementForm.value.terms).subscribe(
depending on what value will consentTermsOfUse hold res => {},
Also what type of consentTermsOfUse will be? boolean or string */ err => {console.log(err)}
for (let i = 0; i < this.terms.length; i++) { );
const id = this.terms.controls[i].get('id').value;
if (this.terms.controls[i].get('accept').value === true) {
console.log(`Agreed to the Terms of Use for: `, id);
}
}
this.consentTermsOfUseDate = new Date(Date.now());
console.log(this.consentTermsOfUseDate);
console.log('will POST when backend is ready');
} }
ngOnInit() { ngOnInit() {
@ -94,25 +88,30 @@ export class AppComponent implements OnInit {
if (!(evt instanceof NavigationEnd)) { if (!(evt instanceof NavigationEnd)) {
return; return;
} }
if (this.authService.isLoggedIn) { if (this.authService.isLoggedIn_) {
this.matomoTracker.setUserId(this.authService.getUserEmail()); this.matomoTracker.setUserId(this.authService.getUserEmail());
} }
window.scrollTo(0, 0); window.scrollTo(0, 0);
}); });
// this.getReposOfUser(); this.authService.isLoggedIn.subscribe(
logged => {if(logged){this.getReposOfUser()}},
error => {console.log(error)}
);
} }
addTerm(name: string, id: string, consent: string) { addTerm(name: string, id: string, consent: boolean) {
this.terms.push(this.newTerm(name, id, consent)); this.terms.push(this.newTerm(name, id, consent));
} }
newTerm(name: string, id: string, consent: string): FormGroup { newTerm(name: string, id: string, consent: boolean): FormGroup {
return this.fb.group({ return this.fb.group({
id: [id], id: [id],
name: [name], name: [name],
accept: [(consent ? consent : true)] // accept: [(consent ? consent : true)]
consentTermsOfUse: false,
fullTextDownload: false
}); });
} }

View File

@ -130,6 +130,9 @@ export class Repository extends DriverResource implements IsSerializable {
eissn: string; eissn: string;
lissn: string; lissn: string;
interfaces: RepositoryInterface[]; interfaces: RepositoryInterface[];
consentTermsOfUse: boolean;
fullTextDownload: boolean;
consentTermsOfUseDate: Date;
availableDiskSpace: string; availableDiskSpace: string;
securityParameters: string; securityParameters: string;
protocol: string; protocol: string;
@ -151,9 +154,6 @@ export class Repository extends DriverResource implements IsSerializable {
registrationDate: Date; registrationDate: Date;
verified: boolean; verified: boolean;
dataCollectionTypes: DataCollectionType[]; dataCollectionTypes: DataCollectionType[];
consentTermsOfUse: string;
consentTermsOfUseDate: Date;
fullTextDownload: string;
} }
export class RepositorySnippet { export class RepositorySnippet {
@ -168,9 +168,17 @@ export class RepositorySnippet {
piwikInfo: PiwikInfo; piwikInfo: PiwikInfo;
logoUrl: string; logoUrl: string;
description: string; description: string;
consentTermsOfUse: string; consentTermsOfUse: boolean;
fullTextDownload: boolean;
consentTermsOfUseDate: Date; consentTermsOfUseDate: Date;
fullTextDownload: string; }
export class TermsOfUse {
id: string;
name: string;
consentTermsOfUse: boolean;
fullTextDownload: boolean;
// consentTermsOfUseDate: Date;
} }
export class Organization { export class Organization {

View File

@ -321,7 +321,7 @@
<div style="display: block; text-align: center"> <div style="display: block; text-align: center">
<img width="55" src="../../../../assets/imgs/landing/Agreement%20color.svg"> <img width="55" src="../../../../assets/imgs/landing/Agreement%20color.svg">
</div> </div>
<div class="uk-margin-bottom uk-margin-top" style="font-weight: 600">Terms of Agreement for Content Providers</div> <div class="uk-margin-bottom uk-margin-top" style="font-weight: 600">Terms of Use for Content Providers</div>
<p>Learn more: <a href="https://www.openaire.eu/terms-of-use-for-content-providers" target="_blank">https://www.openaire.eu/terms-of-use-for-content-providers</a></p> <p>Learn more: <a href="https://www.openaire.eu/terms-of-use-for-content-providers" target="_blank">https://www.openaire.eu/terms-of-use-for-content-providers</a></p>
</div> </div>
@ -752,7 +752,7 @@
<div class="uk-first-column"> <div class="uk-first-column">
<div class="uk-margin-medium-left uk-margin-medium-top uk-margin-medium-bottom"> <div class="uk-margin-medium-left uk-margin-medium-top uk-margin-medium-bottom">
<img width="55" src="../../../../assets/imgs/landing/Agreement%20color.svg"> <img width="55" src="../../../../assets/imgs/landing/Agreement%20color.svg">
<div class="uk-margin-bottom uk-margin-top" style="font-weight: 600">Terms of Agreement for Content Providers</div> <div class="uk-margin-bottom uk-margin-top" style="font-weight: 600">Terms of Use for Content Providers</div>
<p>Learn more: <a href="https://www.openaire.eu/terms-of-use-for-content-providers" target="_blank">https://www.openaire.eu/terms-of-use-for-content-providers</a></p> <p>Learn more: <a href="https://www.openaire.eu/terms-of-use-for-content-providers" target="_blank">https://www.openaire.eu/terms-of-use-for-content-providers</a></p>
</div> </div>
@ -820,7 +820,7 @@
<div class="uk-first-column"> <div class="uk-first-column">
<div class="uk-margin-medium-left uk-margin-medium-top uk-margin-medium-bottom"> <div class="uk-margin-medium-left uk-margin-medium-top uk-margin-medium-bottom">
<img width="55" src="../../../../assets/imgs/landing/Agreement%20color.svg"> <img width="55" src="../../../../assets/imgs/landing/Agreement%20color.svg">
<div class="uk-margin-bottom uk-margin-top" style="font-weight: 600">Terms of Agreement for Content Providers</div> <div class="uk-margin-bottom uk-margin-top" style="font-weight: 600">Terms of Use for Content Providers</div>
<p>Learn more: <a href="https://www.openaire.eu/terms-of-use-for-content-providers" target="_blank">https://www.openaire.eu/terms-of-use-for-content-providers</a></p> <p>Learn more: <a href="https://www.openaire.eu/terms-of-use-for-content-providers" target="_blank">https://www.openaire.eu/terms-of-use-for-content-providers</a></p>
</div> </div>

View File

@ -43,7 +43,7 @@
<li class="uk-active" aria-expanded="true"><a href="#">Update Information</a></li> <li class="uk-active" aria-expanded="true"><a href="#">Update Information</a></li>
<li aria-expanded="false" class=""><a href="#">Update Interfaces</a></li> <li aria-expanded="false" class=""><a href="#">Update Interfaces</a></li>
<li aria-expanded="false" class=""><a href="#">Update Admins</a></li> <li aria-expanded="false" class=""><a href="#">Update Admins</a></li>
<!-- <li aria-expanded="false" class=""><a href="#">Update Terms of Agreement</a></li>--> <li aria-expanded="false" class=""><a href="#">Update Terms of Use</a></li>
</ul> </ul>
<ul id="tabs_anim4" class="uk-switcher uk-margin"> <ul id="tabs_anim4" class="uk-switcher uk-margin">
<li aria-hidden="false" class="uk-active" style="animation-duration: 200ms;"> <li aria-hidden="false" class="uk-active" style="animation-duration: 200ms;">

View File

@ -41,18 +41,15 @@
<span class="title">Register interface</span> <span class="title">Register interface</span>
</a> </a>
</li> </li>
<li role="tab" class="last {{ (currentStep < 3) ? 'disabled' : '' }} {{ (currentStep == 3) ? 'current' : '' }}" aria-disabled="true"> <li role="tab" class=" {{ (currentStep < 3) ? 'disabled' : '' }} {{ (currentStep == 3) ? 'current' : '' }}" aria-disabled="true">
<!-- ToU: replace above line with below line -->
<!--<li role="tab" class=" {{ (currentStep < 3) ? 'disabled' : '' }} {{ (currentStep == 3) ? 'current' : '' }}" aria-disabled="true">-->
<a id="wizard_advanced-t-3" href="#wizard_advanced-h-3" aria-controls="wizard_advanced-p-3"> <a id="wizard_advanced-t-3" href="#wizard_advanced-h-3" aria-controls="wizard_advanced-p-3">
<span class="number">4</span> <span class="number">4</span>
<!-- ToU: uncomment this section --> <span class="title">Terms of Use</span>
<!--<span class="title">Terms of Use</span>
</a> </a>
</li> </li>
<li role="tab" class="last {{ (currentStep < 4) ? 'disabled' : '' }} {{ (currentStep == 4) ? 'current' : '' }}" aria-disabled="true"> <li role="tab" class="last {{ (currentStep < 4) ? 'disabled' : '' }} {{ (currentStep == 4) ? 'current' : '' }}" aria-disabled="true">
<a id="wizard_advanced-t-4" href="#wizard_advanced-h-4" aria-controls="wizard_advanced-p-4"> <a id="wizard_advanced-t-4" href="#wizard_advanced-h-4" aria-controls="wizard_advanced-p-4">
<span class="number">5</span>--> <span class="number">5</span>
<span class="title">Finish</span> <span class="title">Finish</span>
</a> </a>
</li> </li>
@ -131,28 +128,23 @@
</section> </section>
<!-- fourth section --> <!-- fourth section -->
<h3 id="wizard_advanced-h-3" tabindex="-1" class="title {{ (currentStep == 3) ? 'current' : '' }}">Finish</h3> <h3 id="wizard_advanced-h-3" tabindex="-1" class="title {{ (currentStep == 3) ? 'current' : '' }}">Terms of Use</h3>
<!-- ToU: replace line above with line below -->
<!--<h3 id="wizard_advanced-h-3" tabindex="-1" class="title {{ (currentStep == 3) ? 'current' : '' }}">Terms of Use</h3>-->
<section id="wizard_advanced-p-3" role="tabpanel" aria-labelledby="wizard_advanced-h-3" <section id="wizard_advanced-p-3" role="tabpanel" aria-labelledby="wizard_advanced-h-3"
class="body step-3 {{ (currentStep == 3) ? 'current' : '' }}" data-step="2" aria-hidden="true"> class="body step-3 {{ (currentStep == 3) ? 'current' : '' }}" data-step="3" aria-hidden="true">
<div *ngIf="(currentStep === 3) && !loadingMessage" class="row openAIRECompliantLogoDownload">
<!-- ToU: replace above 3 lines (starting at class="body step-3) with commented section below -->
<!--class="body step-3 {{ (currentStep == 3) ? 'current' : '' }}" data-step="3" aria-hidden="true">
<div *ngIf="(currentStep === 3) && !loadingMessage" class="uk-grid uk-grid-match"> <div *ngIf="(currentStep === 3) && !loadingMessage" class="uk-grid uk-grid-match">
<datasource-update-terms-form #updateTermsForm <datasource-update-terms-form #updateTermsForm
[selectedRepo]="repo" [selectedRepo]="repo"
[showButton]=false></datasource-update-terms-form> [showButton]=false
(emittedInfo)="getTerms($event)"></datasource-update-terms-form>
</div> </div>
</section> </section>
&lt;!&ndash; fifth section &ndash;&gt; <!-- fifth section -->
<h3 id="wizard_advanced-h-4" tabindex="-1" class="title {{ (currentStep == 4) ? 'current' : '' }}">Finish</h3> <h3 id="wizard_advanced-h-4" tabindex="-1" class="title {{ (currentStep == 4) ? 'current' : '' }}">Finish</h3>
<section id="wizard_advanced-p-4" role="tabpanel" aria-labelledby="wizard_advanced-h-4" <section id="wizard_advanced-p-4" role="tabpanel" aria-labelledby="wizard_advanced-h-4"
class="body step-4 {{ (currentStep == 4) ? 'current' : '' }}" data-step="3" aria-hidden="true"> class="body step-4 {{ (currentStep == 4) ? 'current' : '' }}" data-step="3" aria-hidden="true">
<div *ngIf="(currentStep === 4) && !loadingMessage" class="row openAIRECompliantLogoDownload">--> <div *ngIf="(currentStep === 4) && !loadingMessage" class="row openAIRECompliantLogoDownload">
<div class="col-lg-12"> <div class="col-lg-12">
<div class="col-md-12"> <div class="col-md-12">
<div> <div>
@ -172,21 +164,8 @@
</section> </section>
</div> </div>
<div *ngIf="currentStep != 3" class="actions clearfix">
<ul role="menu" aria-label="Pagination"> <div *ngIf="currentStep != 4" class="actions clearfix">
<li class="button_previous {{ (currentStep < 1) ? 'disabled' : '' }}" aria-disabled="true">
<a (click)="moveBackAStep()" role="menuitem"><i class="material-icons"></i> Previous</a>
</li>
<li *ngIf="currentStep < 2" class="button_next" aria-hidden="false" aria-disabled="false">
<a (click)="moveAStep()" role="menuitem">Next<i class="material-icons"></i></a>
</li>
<li *ngIf="currentStep == 2" class="button_finish" aria-hidden="true">
<a (click)="moveAStep()" role="menuitem">Finish</a>
</li>
</ul>
</div>
<!-- ToU: replace above <div> with commented section below -->
<!--<div *ngIf="currentStep != 4" class="actions clearfix">
<ul role="menu" aria-label="Pagination"> <ul role="menu" aria-label="Pagination">
<li class="button_previous {{ (currentStep < 1) ? 'disabled' : '' }}" aria-disabled="true"> <li class="button_previous {{ (currentStep < 1) ? 'disabled' : '' }}" aria-disabled="true">
<a (click)="moveBackAStep()" role="menuitem"><i class="material-icons"></i> Previous</a> <a (click)="moveBackAStep()" role="menuitem"><i class="material-icons"></i> Previous</a>
@ -198,7 +177,7 @@
<a (click)="moveAStep()" role="menuitem">Finish</a> <a (click)="moveAStep()" role="menuitem">Finish</a>
</li> </li>
</ul> </ul>
</div>--> </div>
</div> </div>
</form> </form>
</div> </div>
@ -219,4 +198,3 @@
</div> </div>
</div> </div>

View File

@ -19,6 +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";
@Component({ @Component({
selector: 'app-register-existing-datasource', selector: 'app-register-existing-datasource',
@ -63,13 +64,14 @@ export class RegisterExistingDatasourceComponent implements OnInit {
@ViewChildren('interfacesArray') interfacesArray: QueryList<DatasourceNewInterfaceFormComponent>; @ViewChildren('interfacesArray') interfacesArray: QueryList<DatasourceNewInterfaceFormComponent>;
dataForInterfaceComp: any[] = []; dataForInterfaceComp: any[] = [];
@ViewChild('updateTermsForm')
updateTermsForm: DatasourceUpdateTermsFormComponent;
constructor(private fb: FormBuilder, constructor(private fb: FormBuilder,
private route: ActivatedRoute, private route: ActivatedRoute,
private router: Router, private router: Router,
private repoService: RepositoryService) {} private repoService: RepositoryService) {}
// @ViewChild('updateTermsForm')
ngOnInit() { ngOnInit() {
if (this.datasourceType && this.currentMode) { if (this.datasourceType && this.currentMode) {
// will execute getStep() every time there is a change in query params // will execute getStep() every time there is a change in query params
@ -98,17 +100,14 @@ export class RegisterExistingDatasourceComponent implements OnInit {
} else { } else {
this.currentStep = 2; this.currentStep = 2;
} }
} else if (stepName === 'finish') { } else if (stepName === 'termsOfUse') {
this.currentStep = 3;
// ToU: to enable ToU delete the 2 lines above and uncomment the section below
/*} else if (stepName === 'termsOfUse') {
if (!this.interfacesArray) { if (!this.interfacesArray) {
this.router.navigateByUrl(`/sources/register/${this.datasourceType}?step=selectDatasource`); this.router.navigateByUrl(`/sources/register/${this.datasourceType}?step=selectDatasource`);
} else { } else {
this.currentStep = 3; this.currentStep = 3;
} }
} else if (stepName === 'finish') { } else if (stepName === 'finish') {
this.currentStep = 4;*/ this.currentStep = 4;
} }
} }
this.rightHelperContent.ngOnInit(); this.rightHelperContent.ngOnInit();
@ -135,9 +134,7 @@ export class RegisterExistingDatasourceComponent implements OnInit {
window.scrollTo(1, 1); window.scrollTo(1, 1);
} else { } else {
if (this.repoInterfaces.length > 0) { if (this.repoInterfaces.length > 0) {
this.registerRepository(); this.router.navigateByUrl(`/sources/register/${this.datasourceType}?step=termsOfUse`);
// ToU: replace above line with the comment below
// this.router.navigateByUrl(`/sources/register/${this.datasourceType}?step=termsOfUse`);
} else { } else {
this.errorMessage = noInterfacesSaved; this.errorMessage = noInterfacesSaved;
window.scrollTo(1, 1); window.scrollTo(1, 1);
@ -145,9 +142,8 @@ export class RegisterExistingDatasourceComponent implements OnInit {
} }
} }
); );
// ToU: uncomment these lines } else if (this.currentStep === 3) {
// } else if (this.currentStep === 3) { this.registerRepository();
// this.registerRepository();
} }
} }
@ -162,9 +158,8 @@ export class RegisterExistingDatasourceComponent implements OnInit {
of(this.getInterfaces()).subscribe( of(this.getInterfaces()).subscribe(
() => this.router.navigateByUrl(`/sources/register/${this.datasourceType}?step=basicInformation`) () => this.router.navigateByUrl(`/sources/register/${this.datasourceType}?step=basicInformation`)
); );
// ToU: uncomment these lines } else if (this.currentStep === 3) {
// } else if (this.currentStep === 3) { this.router.navigateByUrl(`/sources/register/${this.datasourceType}?step=interfaces`);
// this.router.navigateByUrl(`/sources/register/${this.datasourceType}?step=interfaces`);
} }
} }
@ -279,6 +274,7 @@ export class RegisterExistingDatasourceComponent implements OnInit {
} }
getUpdatedRepo(repo: Repository) { getUpdatedRepo(repo: Repository) {
console.log('getUpdatedRepo(repo: Repository)');
this.repo = repo; this.repo = repo;
if (this.repoInterfaces.length === 0) { if (this.repoInterfaces.length === 0) {
this.getRepoInterfaces(); this.getRepoInterfaces();
@ -320,14 +316,21 @@ export class RegisterExistingDatasourceComponent implements OnInit {
); );
} }
//recheck if needed
getTerms(repo: Repository) {
this.repo = repo;
}
downloadLogo() { downloadLogo() {
window.open('../../../../assets/imgs/3_0ValidatedLogo.png', '_blank', 'enabledstatus=0,toolbar=0,menubar=0,location=0'); window.open('../../../../assets/imgs/3_0ValidatedLogo.png', '_blank', 'enabledstatus=0,toolbar=0,menubar=0,location=0');
} }
registerRepository() { registerRepository() {
console.log('in registerRepository, step ===', this.currentStep);
if (this.repo) { if (this.repo) {
this.loadingMessage = 'Saving changes'; this.loadingMessage = 'Saving changes';
this.errorMessage = ''; this.errorMessage = '';
console.log('reg this.repo', this.repo);
this.repoService.addRepository( this.repo.datasourceType, this.repo).subscribe( this.repoService.addRepository( this.repo.datasourceType, this.repo).subscribe(
response => { response => {
console.log(`addRepository responded: ${response.id}, ${response.registeredBy}`); console.log(`addRepository responded: ${response.id}, ${response.registeredBy}`);
@ -341,7 +344,6 @@ export class RegisterExistingDatasourceComponent implements OnInit {
}, },
() => { () => {
this.saveNewInterfaces(); this.saveNewInterfaces();
// TODO: update terms when backend is ready, maybe POST with updateRepository
} }
); );
} }

View File

@ -38,13 +38,12 @@
<li role="tab" class=" {{ (currentStep < 3) ? 'disabled' : '' }} {{ (currentStep == 3) ? 'current' : '' }}" aria-disabled="true"> <li role="tab" class=" {{ (currentStep < 3) ? 'disabled' : '' }} {{ (currentStep == 3) ? 'current' : '' }}" aria-disabled="true">
<a id="wizard_advanced-t-2" href="#wizard_advanced-h-2" aria-controls="wizard_advanced-p-2"> <a id="wizard_advanced-t-2" href="#wizard_advanced-h-2" aria-controls="wizard_advanced-p-2">
<span class="number">3</span> <span class="number">3</span>
<!-- ToU: uncomment this section --> <span class="title">Terms of Use</span>
<!--<span class="title">Terms of Use</span>
</a> </a>
</li> </li>
<li role="tab" class=" {{ (currentStep < 4) ? 'disabled' : '' }} {{ (currentStep == 4) ? 'current' : '' }}" aria-disabled="true"> <li role="tab" class=" {{ (currentStep < 4) ? 'disabled' : '' }} {{ (currentStep == 4) ? 'current' : '' }}" aria-disabled="true">
<a id="wizard_advanced-t-3" href="#wizard_advanced-h-3" aria-controls="wizard_advanced-p-2"> <a id="wizard_advanced-t-3" href="#wizard_advanced-h-3" aria-controls="wizard_advanced-p-2">
<span class="number">4</span>--> <span class="number">4</span>
<span class="title">Finish</span> <span class="title">Finish</span>
</a> </a>
</li> </li>
@ -122,25 +121,22 @@
</section> </section>
<!-- third section --> <!-- third section -->
<h3 id="wizard_advanced-h-2" tabindex="-1" class="title {{ (currentStep == 3) ? 'current' : '' }}">Finish</h3> <h3 id="wizard_advanced-h-2" tabindex="-1" class="title {{ (currentStep == 3) ? 'current' : '' }}">Terms of Use</h3>
<!-- ToU: replace line above with line below -->
<!-- <h3 id="wizard_advanced-h-2" tabindex="-1" class="title {{ (currentStep == 3) ? 'current' : '' }}">Terms of Use</h3>-->
<section id="wizard_advanced-p-2" role="tabpanel" aria-labelledby="wizard_advanced-h-2" <section id="wizard_advanced-p-2" role="tabpanel" aria-labelledby="wizard_advanced-h-2"
class="body step-2 {{ (currentStep == 3) ? 'current' : '' }}" data-step="2" aria-hidden="true"> class="body step-2 {{ (currentStep == 3) ? 'current' : '' }}" data-step="2" aria-hidden="true">
<div *ngIf="(currentStep === 3) && !loadingMessage" class="row openAIRECompliantLogoDownload"> <div *ngIf="(currentStep === 3) && !loadingMessage" class="uk-grid">
<!-- ToU: delete line above and uncomment section below -->
<!--<div *ngIf="(currentStep === 3) && !loadingMessage" class="uk-grid">
<datasource-update-terms-form #updateTermsForm <datasource-update-terms-form #updateTermsForm
[selectedRepo]="repo" [selectedRepo]="repo"
[showButton]=false></datasource-update-terms-form> [showButton]=false
(emittedInfo)="getTerms($event)"></datasource-update-terms-form>
</div> </div>
</section> </section>
&lt;!&ndash; fourth section &ndash;&gt; <!-- fourth section -->
<h3 id="wizard_advanced-h-3" tabindex="-1" class="title {{ (currentStep == 4) ? 'current' : '' }}">Finish</h3> <h3 id="wizard_advanced-h-3" tabindex="-1" class="title {{ (currentStep == 4) ? 'current' : '' }}">Finish</h3>
<section id="wizard_advanced-p-3" role="tabpanel" aria-labelledby="wizard_advanced-h-3" <section id="wizard_advanced-p-3" role="tabpanel" aria-labelledby="wizard_advanced-h-3"
class="body step-3 {{ (currentStep == 4) ? 'current' : '' }}" data-step="3" aria-hidden="true"> class="body step-3 {{ (currentStep == 4) ? 'current' : '' }}" data-step="3" aria-hidden="true">
<div *ngIf="(currentStep === 4) && !loadingMessage" class="row openAIRECompliantLogoDownload">--> <div *ngIf="(currentStep === 4) && !loadingMessage" class="row openAIRECompliantLogoDownload">
<div class="col-lg-12"> <div class="col-lg-12">
<div class="col-md-12"> <div class="col-md-12">
<div> <div>
@ -165,21 +161,8 @@
</section> </section>
</div> </div>
<div *ngIf="currentStep != 3" class="actions clearfix">
<ul role="menu" aria-label="Pagination"> <div *ngIf="currentStep != 4" class="actions clearfix">
<li class="button_previous {{ (currentStep < 1) ? 'disabled' : '' }}" aria-disabled="true">
<a (click)="moveBackAStep()" role="menuitem"><i class="material-icons"></i> Previous</a>
</li>
<li *ngIf="currentStep < 2" class="button_next" aria-hidden="false" aria-disabled="false">
<a (click)="moveAStep()" role="menuitem">Next<i class="material-icons"></i></a>
</li>
<li *ngIf="currentStep == 2" class="button_finish" aria-hidden="true">
<a (click)="moveAStep()" role="menuitem">Finish</a>
</li>
</ul>
</div>
<!-- ToU: replace above <div> with commented section below -->
<!--<div *ngIf="currentStep != 4" class="actions clearfix">
<ul role="menu" aria-label="Pagination"> <ul role="menu" aria-label="Pagination">
<li class="button_previous {{ (currentStep <= 1) ? 'disabled' : '' }}" aria-disabled="true"> <li class="button_previous {{ (currentStep <= 1) ? 'disabled' : '' }}" aria-disabled="true">
<a (click)="moveBackAStep()" role="menuitem"><i class="material-icons"></i> Previous</a> <a (click)="moveBackAStep()" role="menuitem"><i class="material-icons"></i> Previous</a>
@ -191,7 +174,7 @@
<a (click)="moveAStep()" role="menuitem">Finish</a> <a (click)="moveAStep()" role="menuitem">Finish</a>
</li> </li>
</ul> </ul>
</div>--> </div>
</div> </div>
</form> </form>
</div> </div>

View File

@ -9,6 +9,7 @@ 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";
@Component({ @Component({
selector: 'app-register-new-datasource', selector: 'app-register-new-datasource',
@ -48,13 +49,14 @@ export class RegisterNewDatasourceComponent implements OnInit {
@ViewChildren('interfacesArray') interfacesArray: QueryList<DatasourceNewInterfaceFormComponent>; @ViewChildren('interfacesArray') interfacesArray: QueryList<DatasourceNewInterfaceFormComponent>;
dataForInterfaceComp: any[] = []; dataForInterfaceComp: any[] = [];
@ViewChild('updateTermsForm')
updateTermsForm: DatasourceUpdateTermsFormComponent;
constructor(private fb: FormBuilder, constructor(private fb: FormBuilder,
private route: ActivatedRoute, private route: ActivatedRoute,
private router: Router, private router: Router,
private repoService: RepositoryService) {} private repoService: RepositoryService) {}
// @ViewChild('updateTermsForm')
ngOnInit() { ngOnInit() {
if (this.datasourceType) { if (this.datasourceType) {
@ -80,17 +82,14 @@ export class RegisterNewDatasourceComponent implements OnInit {
} else { } else {
this.currentStep = 2; this.currentStep = 2;
} }
} else if (stepName === 'finish') { } else if (stepName === 'termsOfUse') {
this.currentStep = 3;
// ToU: to enable ToU delete the 2 lines above and uncomment the section below
/*} else if (stepName === 'termsOfUse') {
if (this.interfacesArray && this.interfacesArray.length === 0) { if (this.interfacesArray && this.interfacesArray.length === 0) {
this.router.navigateByUrl(`/sources/register/${this.datasourceType}?step=basicInformation`); this.router.navigateByUrl(`/sources/register/${this.datasourceType}?step=basicInformation`);
} else { } else {
this.currentStep = 3; this.currentStep = 3;
} }
} else if (stepName === 'finish') { } else if (stepName === 'finish') {
this.currentStep = 4;*/ this.currentStep = 4;
} }
} }
this.rightHelperContent.ngOnInit(); this.rightHelperContent.ngOnInit();
@ -111,9 +110,7 @@ export class RegisterNewDatasourceComponent implements OnInit {
window.scrollTo(1, 1); window.scrollTo(1, 1);
} else { } else {
if (this.repoInterfaces.length > 0) { if (this.repoInterfaces.length > 0) {
this.addRepository(); this.router.navigateByUrl(`/sources/register/${this.datasourceType}?step=termsOfUse`);
// ToU: replace above line with the comment below
// this.router.navigateByUrl(`/sources/register/${this.datasourceType}?step=termsOfUse`);
} else { } else {
this.errorMessage = noInterfacesSaved; this.errorMessage = noInterfacesSaved;
window.scrollTo(1, 1); window.scrollTo(1, 1);
@ -121,9 +118,8 @@ export class RegisterNewDatasourceComponent implements OnInit {
} }
} }
); );
// ToU: uncomment these lines } else if ( this.currentStep === 3 ) {
// } else if ( this.currentStep === 3 ) { this.addRepository();
// this.addRepository();
} }
} }
@ -133,9 +129,8 @@ export class RegisterNewDatasourceComponent implements OnInit {
of(this.getInterfaces()).subscribe( of(this.getInterfaces()).subscribe(
() => this.router.navigateByUrl(`/sources/register/${this.datasourceType}?step=basicInformation`) () => this.router.navigateByUrl(`/sources/register/${this.datasourceType}?step=basicInformation`)
); );
// ToU: uncomment these lines } else if (this.currentStep === 3) {
// } else if (this.currentStep === 3) { this.router.navigateByUrl(`/sources/register/${this.datasourceType}?step=interfaces`);
// this.router.navigateByUrl(`/sources/register/${this.datasourceType}?step=interfaces`);
} }
} }
@ -210,14 +205,23 @@ export class RegisterNewDatasourceComponent implements OnInit {
); );
} }
//recheck if needed
getTerms(repo: Repository) {
console.log('this.repo', this.repo.consentTermsOfUse, this.repo.fullTextDownload);
console.log('repo', repo.consentTermsOfUse, repo.fullTextDownload);
this.repo = repo;
}
downloadLogo() { downloadLogo() {
window.open('../../../../assets/imgs/3_0ValidatedLogo.png', '_blank', 'enabledstatus=0,toolbar=0,menubar=0,location=0'); window.open('../../../../assets/imgs/3_0ValidatedLogo.png', '_blank', 'enabledstatus=0,toolbar=0,menubar=0,location=0');
} }
addRepository() { addRepository() {
console.log('in addRepository, step ===', this.currentStep);
if (this.repo) { if (this.repo) {
this.loadingMessage = 'Saving changes'; this.loadingMessage = 'Saving changes';
this.errorMessage = ''; this.errorMessage = '';
console.log('add this.repo', this.repo);
this.repoService.addRepository(this.repo.datasourceType, this.repo).subscribe( this.repoService.addRepository(this.repo.datasourceType, this.repo).subscribe(
response => { response => {
console.log(`addRepository responded: ${response.id}, ${response.registeredBy}`); console.log(`addRepository responded: ${response.id}, ${response.registeredBy}`);
@ -230,7 +234,6 @@ export class RegisterNewDatasourceComponent implements OnInit {
}, },
() => { () => {
this.saveNewInterfaces(); this.saveNewInterfaces();
// TODO: update terms when backend is ready, maybe POST with updateRepository
} }
); );
} }

View File

@ -3,6 +3,7 @@ import { ActivatedRoute, Router } from '@angular/router';
import { HttpClient } from '@angular/common/http'; import { HttpClient } from '@angular/common/http';
import { environment } from '../../environments/environment'; import { environment } from '../../environments/environment';
import { deleteCookie, getCookie } from '../domain/utils'; import { deleteCookie, getCookie } from '../domain/utils';
import { BehaviorSubject } from 'rxjs';
@Injectable() @Injectable()
export class AuthenticationService { export class AuthenticationService {
@ -21,7 +22,11 @@ export class AuthenticationService {
private cookie: string = null; private cookie: string = null;
isLoggedIn: boolean = false; public isLoggedIn_ = new BehaviorSubject(false);
public get isLoggedIn() {
return this.isLoggedIn_.asObservable();
}
public loginWithState() { public loginWithState() {
console.log(`logging in with state. Current url is: ${this.router.url}`); console.log(`logging in with state. Current url is: ${this.router.url}`);
@ -41,8 +46,7 @@ export class AuthenticationService {
public logout() { public logout() {
deleteCookie('AccessToken'); deleteCookie('AccessToken');
sessionStorage.clear(); sessionStorage.clear();
this.isLoggedIn = false; this.isLoggedIn_.next(false);
console.log('logging out, calling:'); console.log('logging out, calling:');
console.log(`${this.apiUrl}/openid_logout`); console.log(`${this.apiUrl}/openid_logout`);
@ -61,7 +65,7 @@ export class AuthenticationService {
userInfo => { userInfo => {
// console.log('User is still logged in'); // console.log('User is still logged in');
// console.log(userInfo); // console.log(userInfo);
this.isLoggedIn = true; this.isLoggedIn_.next(true);
}, },
() => { () => {
this.logout(); this.logout();
@ -85,7 +89,7 @@ export class AuthenticationService {
sessionStorage.setItem('name', userInfo['name']); sessionStorage.setItem('name', userInfo['name']);
sessionStorage.setItem('email', userInfo['email'].trim()); sessionStorage.setItem('email', userInfo['email'].trim());
sessionStorage.setItem('role', userInfo['role']); sessionStorage.setItem('role', userInfo['role']);
this.isLoggedIn = true; this.isLoggedIn_.next(true);
// console.log(`the current user is: ${sessionStorage.getItem('name')}, // console.log(`the current user is: ${sessionStorage.getItem('name')},
// ${sessionStorage.getItem('email')}, ${sessionStorage.getItem('role')}`); // ${sessionStorage.getItem('email')}, ${sessionStorage.getItem('role')}`);
}, },
@ -95,7 +99,7 @@ export class AuthenticationService {
console.log(error); console.log(error);
deleteCookie('AccessToken'); deleteCookie('AccessToken');
deleteCookie('AccessToken'); deleteCookie('AccessToken');
this.isLoggedIn = false; this.isLoggedIn_.next(false);
this.router.navigate(['/home']); this.router.navigate(['/home']);
}, },
() => { () => {
@ -113,7 +117,7 @@ export class AuthenticationService {
} }
); );
} else { } else {
this.isLoggedIn = true; this.isLoggedIn_.next(true);
// console.log(`the current user is: ${sessionStorage.getItem('name')}, // console.log(`the current user is: ${sessionStorage.getItem('name')},
// ${sessionStorage.getItem('email')}, ${sessionStorage.getItem('role')}`); // ${sessionStorage.getItem('email')}, ${sessionStorage.getItem('role')}`);
if (this.redirectUrl) { if (this.redirectUrl) {
@ -128,11 +132,11 @@ export class AuthenticationService {
public getIsUserLoggedIn() { public getIsUserLoggedIn() {
// todo: probably not all of them are needed // todo: probably not all of them are needed
return this.isLoggedIn && this.cookie && this.cookie !== '' && sessionStorage.getItem('email') !== null; return this.isLoggedIn_.value && this.cookie && this.cookie !== '' && sessionStorage.getItem('email') !== null;
} }
public getUserName() { public getUserName() {
if (this.isLoggedIn) { if (this.isLoggedIn_.value) {
return sessionStorage.getItem('name'); return sessionStorage.getItem('name');
} else { } else {
return ''; return '';
@ -148,7 +152,7 @@ export class AuthenticationService {
} }
public getUserRole() { public getUserRole() {
if (this.isLoggedIn) { if (this.isLoggedIn_.value) {
return sessionStorage.getItem('role'); return sessionStorage.getItem('role');
} else { } else {
return ''; return '';

View File

@ -10,7 +10,7 @@ import {
Country, MetricsInfo, Country, MetricsInfo,
Repository, Repository,
RepositoryInterface, RepositoryInterface,
RepositorySnippet, RepositorySummaryInfo, RepositorySnippet, RepositorySummaryInfo, TermsOfUse,
Timezone, Timezone,
Typology, User Typology, User
} from '../domain/typeScriptClasses'; } from '../domain/typeScriptClasses';
@ -85,6 +85,13 @@ export class RepositoryService {
return this.httpClient.post<Repository>(url, repoInfo, headerOptions); return this.httpClient.post<Repository>(url, repoInfo, headerOptions);
} }
updateRepositoriesTerms(termsList: any): Observable<TermsOfUse> {
const url = `${this.apiUrl}terms`;
console.log(`knocking on: ${url}`);
console.log(`sending ${JSON.stringify(termsList)}`);
return this.httpClient.post<TermsOfUse>(url, termsList, headerOptions);
}
getRepositoriesOfCountry(country: string, mode: string): Observable<RepositorySnippet[]> { getRepositoriesOfCountry(country: string, mode: string): Observable<RepositorySnippet[]> {
const url = `${this.apiUrl}getRepositoriesByCountry/${country}/${mode}`; const url = `${this.apiUrl}getRepositoriesByCountry/${country}/${mode}`;
console.log(`knocking on: ${url}`); console.log(`knocking on: ${url}`);
@ -97,7 +104,6 @@ export class RepositoryService {
return this.httpClient.get<RepositorySnippet[]>(url, headerOptions); return this.httpClient.get<RepositorySnippet[]>(url, headerOptions);
} }
getRepositoryById(id: string): Observable<Repository> { getRepositoryById(id: string): Observable<Repository> {
const url = `${this.apiUrl}getRepositoryById/${id}`; const url = `${this.apiUrl}getRepositoryById/${id}`;
console.log(`knocking on: ${url}`); console.log(`knocking on: ${url}`);
@ -110,7 +116,6 @@ export class RepositoryService {
return this.httpClient.get<RepositoryInterface[]>(url, headerOptions); return this.httpClient.get<RepositoryInterface[]>(url, headerOptions);
} }
getUrlsOfUserRepos(): Observable<string[]> { getUrlsOfUserRepos(): Observable<string[]> {
const url = `${this.apiUrl}getUrlsOfUserRepos/0/100/`; const url = `${this.apiUrl}getUrlsOfUserRepos/0/100/`;
console.log(`knocking on: ${url}`); console.log(`knocking on: ${url}`);

View File

@ -8,18 +8,31 @@
<div *ngIf="successMessage" class="uk-alert uk-alert-success">{{ successMessage }}</div> <div *ngIf="successMessage" class="uk-alert uk-alert-success">{{ successMessage }}</div>
<form *ngIf="selectedRepo && !loadingMessage" [formGroup]="agreementForm"> <form *ngIf="selectedRepo && !loadingMessage" [formGroup]="agreementForm">
<br> <div *ngIf="showButton" class="uk-margin-small"> <!-- Update -->
<!-- {{agreementForm.get('acceptTerms').value}}--> <span>Being registered in OpenAIRE, you are giving consent to OpenAIRE to download, transform and enrich the metadata records, publishing them in the OpenAIRE Research Graph.</span>
</div>
<div *ngIf="!showButton" class="uk-margin-medium"> <!-- Register -->
<span>By registering your data source, you are giving your consent to OpenAIRE to download, transform and enrich the metadata records, publishing them in the OpenAIRE Research Graph.</span>
</div>
<form-inline> <form-inline>
<label><input formControlName="acceptTerms" class="uk-checkbox" type="checkbox" checked> I Agree with the </label> <label><input formControlName="acceptTerms" class="uk-checkbox" type="checkbox" checked
<a href="https://zenodo.org/record/1446384#.XiGIAdmxU5n" target="_blank">OpenAIRE's Terms of Agreement for Content Providers</a> [checked]="this.agreementForm.get('acceptTerms').value === true"
(change)="emitRepo()">
Accept the
</label>
<a href="https://www.openaire.eu/terms-of-use-for-content-providers" target="_blank">Terms of Use</a>
</form-inline> </form-inline>
<!-- {{agreementForm.get('optOut').value}}-->
<form-inline> <form-inline>
<label><input formControlName="optOut" class="uk-checkbox" type="checkbox"> I would like to opt out from "data mining of Open Access publications in my repository"</label> <label><input formControlName="textMining" class="uk-checkbox" type="checkbox"
[checked]="this.agreementForm.get('textMining').value === true"
(change)="emitRepo()">
Agree to the <a href="https://www.openaire.eu/terms-of-use-for-content-providers#consent" target="_blank">re-use of full texts</a>
</label>
</form-inline> </form-inline>
<br> <p class="uk-text-meta">Note: OpenAIRE will not provide the full text files for public distribution, the users will access from the original datasource.</p>
<div *ngIf="showButton" class="form-group"> <div *ngIf="showButton" class="form-group">
<button class="uk-button uk-button-primary updateRepoInfoButton" type="button" (click)="updateRepo()">Update Information</button> <button class="uk-button uk-button-primary updateRepoInfoButton" type="button" (click)="updateRepo()">Update Information</button>
</div> </div>
</form> </form>
<!--<pre>{{agreementForm.value|json}}</pre>-->

View File

@ -19,7 +19,7 @@ export class DatasourceUpdateTermsFormComponent implements OnInit {
agreementForm = this.fb.group({ agreementForm = this.fb.group({
acceptTerms: '', acceptTerms: '',
optOut: '' textMining: ''
}); });
consentTermsOfUseDate: Date; consentTermsOfUseDate: Date;
@ -38,8 +38,6 @@ export class DatasourceUpdateTermsFormComponent implements OnInit {
repoId: string; repoId: string;
formSubmitted = false; formSubmitted = false;
// updateGroup: FormGroup; // updateGroup: FormGroup;
termsTick: boolean;
dataMiningTick: boolean;
readonly updateGroupDefinition = { readonly updateGroupDefinition = {
softwarePlatform : '' softwarePlatform : ''
}; };
@ -52,20 +50,24 @@ export class DatasourceUpdateTermsFormComponent implements OnInit {
) {} ) {}
ngOnInit() { ngOnInit() {
console.log(this.selectedRepo); this.agreementForm.get('acceptTerms').setValue(this.selectedRepo.consentTermsOfUse ? this.selectedRepo.consentTermsOfUse : false);
// this.dataMiningTick = false; // until we have an actual value this.agreementForm.get('textMining').setValue(this.selectedRepo.fullTextDownload ? this.selectedRepo.fullTextDownload : false);
if (this.router.url.indexOf('/sources/update') > -1) { this.selectedRepo.consentTermsOfUse = this.agreementForm.value.acceptTerms;
console.log('up'); this.selectedRepo.fullTextDownload = this.agreementForm.value.textMining;
this.termsTick = (this.selectedRepo.consentTermsOfUse ? (this.selectedRepo.consentTermsOfUse === 'true') : true); // if (this.router.url.indexOf('/sources/update') > -1) {
// this.addTerm(this.selectedRepo.consentTermsOfUse, this.dataMiningTick); // console.log('update');
// } else
} else if (this.router.url.indexOf('/sources/register') > -1) { if (this.router.url.indexOf('/sources/register') > -1) {
console.log('reg'); this.emitRepo();
this.termsTick = true;
} }
} }
// TODO: review updateRepo when backend is ready to POST terms emitRepo() {
this.selectedRepo.consentTermsOfUse = this.agreementForm.value.acceptTerms;
this.selectedRepo.fullTextDownload = this.agreementForm.value.textMining;
this.emittedInfo.emit(this.selectedRepo);
}
updateRepo() { updateRepo() {
this.formSubmitted = true; this.formSubmitted = true;
this.errorMessage = ''; this.errorMessage = '';
@ -76,6 +78,9 @@ export class DatasourceUpdateTermsFormComponent implements OnInit {
if (this.showButton) { if (this.showButton) {
this.loadingMessage = formSubmitting; this.loadingMessage = formSubmitting;
this.errorMessage = ''; this.errorMessage = '';
this.selectedRepo.consentTermsOfUse = this.agreementForm.value.acceptTerms;
this.selectedRepo.fullTextDownload = this.agreementForm.value.textMining;
this.selectedRepo.consentTermsOfUseDate = new Date(Date.now());
this.repoService.updateRepository(this.selectedRepo).subscribe( this.repoService.updateRepository(this.selectedRepo).subscribe(
response => { response => {
if (response) { if (response) {

View File

@ -9722,7 +9722,7 @@ div.ganttview .ui-resizable-w {
@media only screen and (min-width: 960px) { @media only screen and (min-width: 960px) {
.wizard > .steps > ul > li { .wizard > .steps > ul > li {
float: left; float: left;
width: 25%; width: 20%;
} }
} }
.wizard > .steps > ul > li + li a { .wizard > .steps > ul > li + li a {

File diff suppressed because one or more lines are too long