[Library]: Move angular 11 to trunk. Remove no needed files. Delete angular upgrade branches

git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@61381 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
k.triantafyllou 2021-07-14 11:19:57 +00:00
parent 5227f96b3b
commit 08bf703186
111 changed files with 744 additions and 858 deletions

View File

@ -8,8 +8,7 @@ import {ClaimEntity, ClaimResult} from './claimHelper.class';
import {DOI, StringUtils} from '../../utils/string-utils.class'; import {DOI, StringUtils} from '../../utils/string-utils.class';
import {EnvProperties} from '../../utils/properties/env-properties'; import {EnvProperties} from '../../utils/properties/env-properties';
import {Filter, Value} from "../../searchPages/searchUtils/searchHelperClasses.class"; import {Filter, Value} from "../../searchPages/searchUtils/searchHelperClasses.class";
import {Observable, Subscriber} from "rxjs"; import {forkJoin, Observable, Subscriber} from 'rxjs';
import 'rxjs/add/observable/forkJoin'
import {NewSearchPageComponent} from "../../searchPages/searchUtils/newSearchPage.component"; import {NewSearchPageComponent} from "../../searchPages/searchUtils/newSearchPage.component";
import {RangeFilter} from "../../utils/rangeFilter/rangeFilterHelperClasses.class"; import {RangeFilter} from "../../utils/rangeFilter/rangeFilterHelperClasses.class";
import {SearchFields} from "../../utils/properties/searchFields"; import {SearchFields} from "../../utils/properties/searchFields";
@ -689,7 +688,7 @@ export class ClaimResultSearchFormComponent {
doiObservables.push(ob); doiObservables.push(ob);
} }
this.subscriptions.push(Observable.forkJoin(doiObservables).subscribe( this.subscriptions.push(forkJoin(doiObservables).subscribe(
data => { data => {
//if DOI not found or an error occured the result will be null -- remove null values //if DOI not found or an error occured the result will be null -- remove null values
for(let result of data){ for(let result of data){

View File

@ -2,7 +2,7 @@ import { NgModule } from '@angular/core';
import { SharedModule } from '../../shared/shared.module'; import { SharedModule } from '../../shared/shared.module';
import { CommonModule } from '@angular/common'; import { CommonModule } from '@angular/common';
import { MatSelectModule } from "@angular/material"; import { MatSelectModule } from "@angular/material/select";
import {ClaimResultSearchFormComponent} from './claimResultSearchForm.component'; import {ClaimResultSearchFormComponent} from './claimResultSearchForm.component';
import {ClaimResultsModule} from './claimResults.module'; import {ClaimResultsModule} from './claimResults.module';

View File

@ -12,7 +12,7 @@
<form class=""> <form class="">
<div class="uk-width-1-1 uk-flex uk-flex-right@m uk-flex-center uk-flex-wrap uk-flex-middle uk-grid" uk-grid> <div class="uk-width-1-1 uk-flex uk-flex-right@m uk-flex-center uk-flex-wrap uk-flex-middle uk-grid" uk-grid>
<div search-input [control]="filterForm.controls.keyword" [showSearch]="false" placeholder="Search links" <div #searchInputComponent search-input [control]="filterForm.controls.keyword" [showSearch]="false" placeholder="Search links"
[selected]="inputkeyword" (closeEmitter)="onSearchClose()" (resetEmitter)="resetInput()" [selected]="inputkeyword" (closeEmitter)="onSearchClose()" (resetEmitter)="resetInput()"
[bordered]="true" colorClass="uk-text-secondary"></div> [bordered]="true" colorClass="uk-text-secondary"></div>
</div> </div>

View File

@ -2,7 +2,11 @@ import { NgModule} from '@angular/core';
import { CommonModule } from '@angular/common'; import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms'; import { FormsModule } from '@angular/forms';
import { RouterModule } from '@angular/router'; import { RouterModule } from '@angular/router';
import {MatAutocompleteModule, MatChipsModule, MatFormFieldModule, MatSelectModule, MatSlideToggleModule} from '@angular/material'; import { MatAutocompleteModule } from '@angular/material/autocomplete';
import { MatChipsModule } from '@angular/material/chips';
import { MatFormFieldModule } from '@angular/material/form-field';
import { MatSelectModule } from '@angular/material/select';
import { MatSlideToggleModule } from '@angular/material/slide-toggle';
import {ClaimServiceModule} from '../service/claimsService.module'; import {ClaimServiceModule} from '../service/claimsService.module';
import {DisplayClaimsComponent} from './displayClaims.component'; import {DisplayClaimsComponent} from './displayClaims.component';
import {LoadingModalModule} from '../../../utils/modal/loadingModal.module'; import {LoadingModalModule} from '../../../utils/modal/loadingModal.module';

View File

@ -1,6 +1,5 @@
import {BehaviorSubject, from, Observable, Subscription, throwError as observableThrowError} from 'rxjs'; import {BehaviorSubject, from, Observable, Subscription, throwError as observableThrowError} from 'rxjs';
import {Injectable} from '@angular/core'; import {Injectable} from '@angular/core';
import {Response} from '@angular/http';
import {HttpClient} from '@angular/common/http'; import {HttpClient} from '@angular/common/http';
import {catchError, map} from "rxjs/operators"; import {catchError, map} from "rxjs/operators";
import {properties} from "../../../../../environments/environment"; import {properties} from "../../../../../environments/environment";
@ -160,7 +159,7 @@ export class ContextsService {
} }
private handleError (error: Response) { private handleError (error: any) {
// in a real world app, we may send the error to some remote logging infrastructure // in a real world app, we may send the error to some remote logging infrastructure
// instead of just logging it to the console // instead of just logging it to the console
console.log(error); console.log(error);

View File

@ -1,6 +1,5 @@
import {throwError as observableThrowError} from 'rxjs'; import {throwError as observableThrowError} from 'rxjs';
import {Injectable} from '@angular/core'; import {Injectable} from '@angular/core';
import {Response} from '@angular/http';
import {HttpClient} from '@angular/common/http'; import {HttpClient} from '@angular/common/http';
import {ClaimEntity, ClaimResult} from '../claimHelper.class'; import {ClaimEntity, ClaimResult} from '../claimHelper.class';
import {map} from "rxjs/operators"; import {map} from "rxjs/operators";
@ -48,7 +47,7 @@ export class SearchCrossrefService {
} }
private handleError(error: Response) { private handleError(error: any) {
// in a real world app, we may send the error to some remote logging infrastructure // in a real world app, we may send the error to some remote logging infrastructure
// instead of just logging it to the console // instead of just logging it to the console
console.log(error); console.log(error);

View File

@ -1,12 +1,11 @@
import {Observable, throwError as observableThrowError} from 'rxjs'; import {of, throwError as observableThrowError} from 'rxjs';
import {Injectable} from '@angular/core'; import {Injectable} from '@angular/core';
import {Response} from '@angular/http';
import {HttpClient} from '@angular/common/http'; import {HttpClient} from '@angular/common/http';
import {EnvProperties} from '../../../utils/properties/env-properties'; import {EnvProperties} from '../../../utils/properties/env-properties';
import {ClaimEntity, ClaimResult} from '../claimHelper.class'; import {ClaimEntity, ClaimResult} from '../claimHelper.class';
import {map} from "rxjs/operators"; import {catchError, map} from 'rxjs/operators';
import 'rxjs/add/operator/catch';
import 'rxjs/add/observable/of';
@Injectable() @Injectable()
export class SearchDataciteService { export class SearchDataciteService {
constructor(private http: HttpClient ) {} constructor(private http: HttpClient ) {}
@ -24,9 +23,8 @@ export class SearchDataciteService {
getDataciteResultByDOI(doi: string, properties: EnvProperties, parse: boolean = false): any { getDataciteResultByDOI(doi: string, properties: EnvProperties, parse: boolean = false): any {
let url = properties.searchDataciteAPIURL + '/' + doi; let url = properties.searchDataciteAPIURL + '/' + doi;
let key = url; let key = url;
return this.http.get((properties.useCache) ? (properties.cacheUrl + encodeURIComponent(url)) : url) return this.http.get((properties.useCache) ? (properties.cacheUrl + encodeURIComponent(url)) : url)
.pipe(map(request => (parse ? SearchDataciteService.parse([request["data"]])[0] : request))).catch(e => Observable.of(null)); .pipe(map(request => (parse ? SearchDataciteService.parse([request["data"]])[0] : request)), catchError(err => of(null)));
} }
@ -37,7 +35,7 @@ export class SearchDataciteService {
return observableThrowError(error || 'Server error'); return observableThrowError(error || 'Server error');
} }
private extractData(res: Response) { private extractData(res: any) {
if (res.status < 200 || res.status >= 300) { if (res.status < 200 || res.status >= 300) {
throw new Error('Bad response status: ' + res.status); throw new Error('Bad response status: ' + res.status);
} }

View File

@ -1,5 +1,5 @@
import { NgModule } from '@angular/core'; import { NgModule } from '@angular/core';
import { MatSelectModule } from "@angular/material"; import { MatSelectModule } from "@angular/material/select";
import { SharedModule } from '../../shared/shared.module'; import { SharedModule } from '../../shared/shared.module';
import {SelectedProjectsModule} from './selected/selectedProjects.module'; import {SelectedProjectsModule} from './selected/selectedProjects.module';

View File

@ -4,7 +4,11 @@ import {MetadataPreviewComponent} from './metadataPreview.component';
import {AlertModalModule} from '../../../utils/modal/alertModal.module'; import {AlertModalModule} from '../../../utils/modal/alertModal.module';
import {ClaimEntitiesMetadataModule} from "./ClaimEntitiesMetadata.module"; import {ClaimEntitiesMetadataModule} from "./ClaimEntitiesMetadata.module";
import {InsertClaimsModule} from "../insertClaim/insertClaim.module"; import {InsertClaimsModule} from "../insertClaim/insertClaim.module";
import { MatDatepickerModule, MatNativeDateModule, MatFormFieldModule, MatInputModule, MatSelectModule} from '@angular/material'; import { MatNativeDateModule } from '@angular/material/core';
import { MatDatepickerModule } from '@angular/material/datepicker';
import { MatFormFieldModule } from '@angular/material/form-field';
import { MatInputModule } from '@angular/material/input';
import { MatSelectModule } from '@angular/material/select';
import {HelperModule} from "../../../utils/helper/helper.module"; import {HelperModule} from "../../../utils/helper/helper.module";
@NgModule({ @NgModule({

View File

@ -43,7 +43,7 @@ export class ConnectAdminLoginGuard implements CanActivate, CanActivateChild {
return authorized; return authorized;
} }
canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<boolean> | boolean { canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<boolean | UrlTree> | Promise<boolean | UrlTree> | boolean | UrlTree {
return this.check(route.params['community'], state.url); return this.check(route.params['community'], state.url);
} }

View File

@ -27,7 +27,7 @@ export class ConnectCommunityGuard implements CanActivate, CanActivateChild {
})); }));
} }
canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<boolean> | boolean { canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<boolean | UrlTree> | Promise<boolean | UrlTree> | boolean | UrlTree {
let community = route.params['community']; let community = route.params['community'];
return community && this.check(community, state.url); return community && this.check(community, state.url);
} }

View File

@ -27,7 +27,7 @@ export class ConnectRIGuard implements CanActivate, CanActivateChild {
})); }));
} }
canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<boolean> | boolean { canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<boolean | UrlTree> | Promise<boolean | UrlTree> | boolean | UrlTree {
let community = route.params['community']; let community = route.params['community'];
return community && this.check(community, state.url); return community && this.check(community, state.url);
} }

View File

@ -51,7 +51,7 @@ export class ConnectSubscriberGuard implements CanActivate, CanActivateChild {
return authorized; return authorized;
} }
canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<boolean> | boolean { canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<boolean | UrlTree> | Promise<boolean | UrlTree> | boolean | UrlTree {
return this.check(route, state); return this.check(route, state);
} }

View File

@ -42,7 +42,7 @@ export class IsCommunity implements CanActivate, CanActivateChild {
} }
} }
canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<boolean> | boolean { canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<boolean | UrlTree> | Promise<boolean | UrlTree> | boolean | UrlTree {
return this.check(route, state); return this.check(route, state);
} }

View File

@ -6,7 +6,7 @@ export class ConnectHelper {
public static getCommunityFromDomain(domain: string): string{ public static getCommunityFromDomain(domain: string): string{
if(properties.environment == "development") { if(properties.environment == "development") {
domain = "beta.egi.openaire.eu"; //for testing domain = "beta.connect.openaire.eu"; //for testing
} }
domain = domain.indexOf("//") != -1? domain.split("//")[1]:domain; //remove https:// prefix domain = domain.indexOf("//") != -1? domain.split("//")[1]:domain; //remove https:// prefix
if (domain.indexOf('openaire.eu') === -1) { if (domain.indexOf('openaire.eu') === -1) {

View File

@ -6,7 +6,7 @@ import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { MailPrefsComponent } from './mailPrefs.component'; import { MailPrefsComponent } from './mailPrefs.component';
import { MailPrefsService } from './mailPrefs.service'; import { MailPrefsService } from './mailPrefs.service';
import {ErrorMessagesModule} from '../../utils/errorMessages.module'; import {ErrorMessagesModule} from '../../utils/errorMessages.module';
import {MatSlideToggleModule} from '@angular/material'; import { MatSlideToggleModule } from '@angular/material/slide-toggle';
@NgModule({ @NgModule({
imports: [ imports: [

View File

@ -3,21 +3,21 @@ import {CommonModule} from '@angular/common';
import {RouterModule} from '@angular/router'; import {RouterModule} from '@angular/router';
import {ContactUsComponent} from './contact-us.component'; import {ContactUsComponent} from './contact-us.component';
import {RecaptchaModule} from "ng-recaptcha";
import {ReactiveFormsModule} from "@angular/forms"; import {ReactiveFormsModule} from "@angular/forms";
import {MatAutocompleteModule} from "@angular/material/autocomplete"; import {MatAutocompleteModule} from "@angular/material/autocomplete";
import {RecaptchaModule} from "ng-recaptcha";
@NgModule({ @NgModule({
imports: [ imports: [
CommonModule, RouterModule, CommonModule, RouterModule,
RecaptchaModule.forRoot(), ReactiveFormsModule, MatAutocompleteModule], ReactiveFormsModule, MatAutocompleteModule, RecaptchaModule],
declarations: [ declarations: [
ContactUsComponent ContactUsComponent
], ],
providers: [], providers: [],
exports: [ exports: [
ContactUsComponent ContactUsComponent
] ]
}) })
export class ContactUsModule { export class ContactUsModule {

View File

@ -38,7 +38,6 @@ export class DivIdsComponent implements OnInit {
public filterForm: FormGroup; public filterForm: FormGroup;
private subscriptions: any[] = []; private subscriptions: any[] = [];
public allPages: Option[] = []; public allPages: Option[] = [];
@ViewChild('PageInput') pageInput: ElementRef<HTMLInputElement>;
selectedCommunityPid = null; selectedCommunityPid = null;
public portalUtils: PortalUtils = new PortalUtils(); public portalUtils: PortalUtils = new PortalUtils();
private index: number; private index: number;

View File

@ -9,7 +9,8 @@ import {InputModule} from "../../sharedComponents/input/input.module";
import {MatAutocompleteModule} from '@angular/material/autocomplete'; import {MatAutocompleteModule} from '@angular/material/autocomplete';
import {MatCheckboxModule, MatFormFieldModule} from "@angular/material"; import { MatCheckboxModule } from "@angular/material/checkbox";
import { MatFormFieldModule } from "@angular/material/form-field";
import {MatChipsModule} from '@angular/material/chips'; import {MatChipsModule} from '@angular/material/chips';

View File

@ -7,7 +7,7 @@
<icon name="arrow_left"></icon> <icon name="arrow_left"></icon>
</span> </span>
<span class="space"> <span class="space">
Go back to class contents list Go back to class help texts list
</span> </span>
</a> </a>
</div> </div>
@ -16,7 +16,7 @@
<div class="uk-card-header"> <div class="uk-card-header">
<div class="uk-flex uk-flex-middle uk-child-width-1-1 uk-child-width-1-2@m uk-grid" uk-grid> <div class="uk-flex uk-flex-middle uk-child-width-1-1 uk-child-width-1-2@m uk-grid" uk-grid>
<div> <div>
<div class="uk-text-small uk-text-muted"> {{pageHelpContent ? 'Update ' : 'Add new '}} class content</div> <div class="uk-text-small uk-text-muted"> {{pageHelpContent ? 'Update ' : 'Add new '}} class help text</div>
<div> <div>
<span *ngIf="page" class="uk-text-bold">{{page.name}}</span> <span *ngIf="page" class="uk-text-bold">{{page.name}}</span>
<span *ngIf="myForm.dirty"> (unsaved changes)</span> <span *ngIf="myForm.dirty"> (unsaved changes)</span>

View File

@ -8,10 +8,10 @@ import {EnvProperties} from '../../utils/properties/env-properties';
import {Session} from '../../login/utils/helper.class'; import {Session} from '../../login/utils/helper.class';
import {LoginErrorCodes} from '../../login/utils/guardHelper.class'; import {LoginErrorCodes} from '../../login/utils/guardHelper.class';
import {properties} from '../../../../environments/environment'; import {properties} from '../../../../environments/environment';
import {Observable, Subscriber, Subscription} from 'rxjs'; import {Subscriber, Subscription, zip} from 'rxjs';
import {HelperFunctions} from '../../utils/HelperFunctions.class'; import {HelperFunctions} from '../../utils/HelperFunctions.class';
import {ConnectHelper} from '../../connect/connectHelper';
import {DivHelpContent} from '../../utils/entities/adminTool/div-help-content'; import {DivHelpContent} from '../../utils/entities/adminTool/div-help-content';
declare var UIkit; declare var UIkit;
@Component({ @Component({
@ -26,9 +26,7 @@ export class ClassContentFormComponent implements OnInit {
pageContentId: string; pageContentId: string;
page: Page; page: Page;
classOptions = []; classOptions = [];
public properties: EnvProperties = properties;
public properties: EnvProperties = null;
public showLoading: boolean = true; public showLoading: boolean = true;
public errorMessage: string = ''; public errorMessage: string = '';
@Input() updateErrorMessage: string = ''; @Input() updateErrorMessage: string = '';
@ -39,13 +37,9 @@ export class ClassContentFormComponent implements OnInit {
} }
ngOnInit() { ngOnInit() {
this.properties = properties;
this.subs.push(this.route.params.subscribe(params => { this.subs.push(this.route.params.subscribe(params => {
this.portal = (this.route.snapshot.data.portal) ? this.route.snapshot.data.portal : this.route.snapshot.params[this.route.snapshot.data.param]; this.portal = (this.route.snapshot.data.portal) ? this.route.snapshot.data.portal : this.route.snapshot.params[this.route.snapshot.data.param];
ConnectHelper.setPortalTypeFromPid(this.portal);
this.subs.push(this.route.queryParams.subscribe(params => { this.subs.push(this.route.queryParams.subscribe(params => {
HelperFunctions.scroll();
this.pageId = params['pageId']; this.pageId = params['pageId'];
this.myForm = this.form; this.myForm = this.form;
this.pageContentId = params['pageContentId']; this.pageContentId = params['pageContentId'];
@ -53,14 +47,6 @@ export class ClassContentFormComponent implements OnInit {
this._router.navigate(['../'], {relativeTo: this.route}); this._router.navigate(['../'], {relativeTo: this.route});
} }
this.getInfo(this.pageId); this.getInfo(this.pageId);
if (!Session.isLoggedIn()) {
this._router.navigate(['/user-info'], {
queryParams: {
"errorCode": LoginErrorCodes.NOT_VALID,
"redirectUrl": this._router.url
}
});
}
})); }));
})); }));
} }
@ -75,7 +61,7 @@ export class ClassContentFormComponent implements OnInit {
getInfo(pageId: string) { getInfo(pageId: string) {
this.showLoading = true; this.showLoading = true;
let obs = Observable.zip(this._helpContentService.getPageByPortal(pageId, this.properties.adminToolsAPIURL, this.portal), let obs = zip(this._helpContentService.getPageByPortal(pageId, this.properties.adminToolsAPIURL, this.portal),
this._helpContentService.getDivIdsFullByPortal(pageId, this.properties.adminToolsAPIURL, this.portal)); this._helpContentService.getDivIdsFullByPortal(pageId, this.properties.adminToolsAPIURL, this.portal));
this.subs.push(obs.subscribe( this.subs.push(obs.subscribe(
results => { results => {

View File

@ -6,7 +6,7 @@ import {SafeHtmlPipeModule} from '../../utils/pipes/safeHTMLPipe.module';
import {CKEditorModule} from 'ng2-ckeditor'; import {CKEditorModule} from 'ng2-ckeditor';
import {AdminToolServiceModule} from '../../services/adminToolService.module'; import {AdminToolServiceModule} from '../../services/adminToolService.module';
import {InputModule} from '../../sharedComponents/input/input.module'; import {InputModule} from '../../sharedComponents/input/input.module';
import {MatSlideToggleModule} from '@angular/material'; import { MatSlideToggleModule } from '@angular/material/slide-toggle';
import {IconsModule} from '../../utils/icons/icons.module'; import {IconsModule} from '../../utils/icons/icons.module';
import {RouterModule} from '@angular/router'; import {RouterModule} from '@angular/router';
import {LoadingModule} from '../../utils/loading/loading.module'; import {LoadingModule} from '../../utils/loading/loading.module';

View File

@ -1,15 +1,11 @@
<div page-content> <div page-content>
<div header> <div header>
<div *ngIf="updateErrorMessage" class="uk-alert-danger" uk-alert>
<a class="uk-alert-close" uk-close></a>
{{updateErrorMessage}}
</div>
<div class="uk-text-bold"> <div class="uk-text-bold">
<span *ngIf="selectedPageId && page">{{page.name}}</span> <span *ngIf="selectedPageId && page">{{page.name}}</span>
</div> </div>
<div class="uk-margin-top"> <div class="uk-margin-top">
<a routerLink="../pages/" class="uk-text-secondary uk-text-uppercase uk-text-bold uk-text-small"> <a routerLink="../pages/" class="uk-text-secondary uk-text-uppercase uk-text-bold uk-text-small">
<span class="uk-icon-button small uk-icon uk-button-secondary"> <span class="uk-icon-button small uk-icon uk-button-secondary">
<icon name="arrow_left"></icon> <icon name="arrow_left"></icon>
</span> </span>
<span class="space"> <span class="space">
@ -20,124 +16,112 @@
<div class="uk-width-1-1 uk-flex uk-flex-right@m uk-flex-center uk-flex-wrap uk-flex-middle uk-grid" uk-grid> <div class="uk-width-1-1 uk-flex uk-flex-right@m uk-flex-center uk-flex-wrap uk-flex-middle uk-grid" uk-grid>
<div #searchInputComponent search-input [control]="filterForm" [showSearch]="false" placeholder="Search helptext" <div #searchInputComponent search-input [control]="filterForm" [showSearch]="false" placeholder="Search helptext"
[selected]="selectedKeyword" (closeEmitter)="onSearchClose()" (resetEmitter)="reset()" [selected]="selectedKeyword" (closeEmitter)="onSearchClose()" (resetEmitter)="reset()"
[bordered]="true" colorClass="uk-text-secondary" class="uk-width-1-3@xl uk-width-2-5@l uk-width-1-2@m uk-width-1-1"></div> [bordered]="true" colorClass="uk-text-secondary"
class="uk-width-1-3@xl uk-width-2-5@l uk-width-1-2@m uk-width-1-1"></div>
<div> <div>
<a (click)="newPageContent()" <a (click)="newPageContent()"
class="uk-flex uk-flex-middle uk-text-uppercase"> class="uk-flex uk-flex-middle uk-text-uppercase">
<button class="large uk-icon-button uk-button-secondary"> <button class="large uk-icon-button uk-button-secondary">
<icon name="add"></icon> <icon name="add"></icon>
</button> </button>
<button class="uk-button uk-button-link uk-margin-small-left uk-text-secondary">Add new class content</button> <button class="uk-button uk-button-link uk-margin-small-left uk-text-secondary">Add new class help text
</button>
</a> </a>
</div> </div>
</div> </div>
<div *ngIf="checkboxes.length > 0" <div *ngIf="showLoading && checkboxes.length > 0"
class="uk-padding uk-padding-remove-bottom uk-padding-remove-top uk-margin-remove-top uk-margin-small-bottom" class="uk-padding uk-padding-remove-bottom uk-padding-remove-top uk-margin-remove-top uk-margin-small-bottom uk-display-inline"
[attr.uk-tooltip]="getSelectedPageHelpContents().length == 0 ? 'pos:left; cls: uk-active' : 'cls: uk-invisible'" [attr.uk-tooltip]="getSelectedPageHelpContents().length == 0 ? 'pos:left; cls: uk-active' : 'cls: uk-invisible'"
title="Select at least one help text"><input id="checkAll" type="checkbox" (click)="selectAll()" title="Select at least one help text"><input id="checkAll" type="checkbox" (click)="selectAll()"
[ngModel]="getSelectedPageHelpContents().length ==checkboxes.length"/> [ngModel]="getSelectedPageHelpContents().length ==checkboxes.length"/>
<span *ngIf="getSelectedPageHelpContents().length > 0" class="uk-margin-left uk-text-muted"> <span *ngIf="getSelectedPageHelpContents().length > 0" class="uk-margin-left uk-text-muted">
{{getSelectedPageHelpContents().length}} pages selected </span> {{getSelectedPageHelpContents().length}} pages selected </span>
<a class="uk-margin-left ">Actions </a> <a class="uk-margin-left ">Actions </a>
<div uk-dropdown="mode: click"> <div uk-dropdown="mode: click">
<ul class="uk-nav uk-dropdown-nav" <ul class="uk-nav uk-dropdown-nav"
[attr.uk-tooltip]="getSelectedPageHelpContents().length == 0 ? 'pos:left; cls: uk-active' : 'cls: uk-invisible'" [attr.uk-tooltip]="getSelectedPageHelpContents().length == 0 ? 'pos:left; cls: uk-active' : 'cls: uk-invisible'"
title="Select at least one help text"> title="Select at least one help text">
<li><a [class]="getSelectedPageHelpContents().length == 0 ? 'uk-disabled' : ''" <li><a [class]="getSelectedPageHelpContents().length == 0 ? 'uk-disabled' : ''"
(click)="togglePageHelpContents(true,getSelectedPageHelpContents())"><i></i> Enable (click)="togglePageHelpContents(true,getSelectedPageHelpContents())"><i></i> Enable
</a></li> </a></li>
<li><a [class]="getSelectedPageHelpContents().length == 0 ? 'uk-disabled' : ''" <li><a [class]="getSelectedPageHelpContents().length == 0 ? 'uk-disabled' : ''"
(click)="togglePageHelpContents(false,getSelectedPageHelpContents())"><i></i> Disable (click)="togglePageHelpContents(false,getSelectedPageHelpContents())"><i></i> Disable
</a> </a>
</li> </li>
<li><a [class]="getSelectedPageHelpContents().length == 0 ? 'uk-disabled' : ''" <li><a [class]="getSelectedPageHelpContents().length == 0 ? 'uk-disabled' : ''"
(click)="confirmDeleteSelectedPageHelpContents()"><i></i> Delete </a></li> (click)="confirmDeleteSelectedPageHelpContents()"><i></i> Delete </a></li>
</ul> </ul>
</div> </div>
</div> </div>
</div> </div>
<div inner> <div inner>
<div *ngIf="showLoading" class="uk-position-center">
<loading></loading>
</div>
<div *ngIf="!showLoading">
<div *ngIf="checkboxes.length > 0" class="uk-margin-medium-bottom">
<ul class="uk-list pages">
<li *ngFor="let check of checkboxes; let i=index" class="uk-card uk-card-default uk-margin-bottom">
<div class="uk-grid uk-grid-divider uk-padding" uk-grid>
<div class="uk-width-4-5 uk-first-column ">
<div class="uk-grid uk-flex uk-flex-middle">
<div><input id="{{check.divHelpContent._id}}" class="checkBox" type="checkbox"
name="entitiescb[]" value="{{check.divHelpContent._id}}"
[(ngModel)]="check.checked">
</div>
<div class="uk-width-expand uk-margin-medium-bottom">
<div class="content-wrapper" id="contentWrapper"> <div class="content multi-line-ellipsis lines-2">
<div> <p>{{check.divHelpContent.content|htmlToString}}</p></div>
<div class="contentPanel"> </div>
<div *ngIf="errorMessage" class="uk-alert uk-alert-danger uk-margin-large-top" <div class="uk-grid uk-width-1-1 uk-margin-left">
role="alert">{{errorMessage}}</div> <div class=" ">
<div *ngIf="showLoading" class="uk-position-center"> <span
<loading *ngIf="showLoading"></loading> class="title">Class: </span>{{check.divHelpContent.divId.name ? check.divHelpContent.divId.name : check.divHelpContent.divId}}
</div> </div>
<div class=" ">
<span class="title uk-margin-small-right">Enable/disable: </span>
<mat-slide-toggle [checked]="check.divHelpContent.isActive"
(change)="($event.source.checked = check.divHelpContent.isActive);togglePageHelpContents(!check.divHelpContent.isActive,[check.divHelpContent._id])"
uk-tooltip="title:<div class='uk-padding-small uk-width-large'><div class='uk-text-bold '> Enable or disable help text to show or hide it from the dashboard</div></div>"
></mat-slide-toggle>
</div>
</div>
</div>
</div>
<div class="uk-width-1-5 uk-first-column">
<div *ngIf="!errorMessage && !showLoading"> <div class=" uk-flex-center uk-flex">
<div class="md-card uk-margin-medium-bottom" *ngIf="!errorMessage && !showLoading"> <div class="actions" href="#">
<div class="md-card-content"> <div class="" (click)="editPageHelpContent(check.divHelpContent._id)"
<div class="uk-overflow-container"> class="uk-button action uk-margin-top uk-flex uk-flex-middle ">
<div class="uk-overflow-container"> <i class="clickable" uk-icon="pencil"
<ul class="uk-list pages"> ></i>
<li *ngFor="let check of checkboxes; let i=index" class="uk-card uk-card-default uk-margin-bottom"> <span class="uk-margin-small-left">
<div class="uk-grid uk-grid-divider uk-padding" uk-grid>
<div class="uk-width-4-5 uk-first-column ">
<div class="uk-grid uk-flex uk-flex-middle">
<div><input id="{{check.divHelpContent._id}}" class="checkBox" type="checkbox"
name="entitiescb[]" value="{{check.divHelpContent._id}}" [(ngModel)]="check.checked">
</div>
<div class="uk-width-expand uk-margin-medium-bottom">
<div class="content multi-line-ellipsis lines-2">
<p>{{check.divHelpContent.content|htmlToString}}</p></div>
</div>
<div class="uk-grid uk-width-1-1 uk-margin-left">
<div class=" ">
<span class="title">Class: </span>{{check.divHelpContent.divId.name?check.divHelpContent.divId.name:check.divHelpContent.divId}}
</div>
<div class=" ">
<span class="title uk-margin-small-right">Enable/disable: </span>
<mat-slide-toggle [checked]="check.divHelpContent.isActive"
(change)="($event.source.checked = check.divHelpContent.isActive);togglePageHelpContents(!check.divHelpContent.isActive,[check.divHelpContent._id])"
uk-tooltip="title:<div class='uk-padding-small uk-width-large'><div class='uk-text-bold '> Enable or disable help text to show or hide it from the dashboard</div></div>"
></mat-slide-toggle>
</div>
</div>
</div>
</div>
<div class="uk-width-1-5 uk-first-column">
<div class=" uk-flex-center uk-flex">
<div class="actions" href="#">
<div class="" (click)="editPageHelpContent(check.divHelpContent._id)" class="uk-button action uk-margin-top uk-flex uk-flex-middle ">
<i class="clickable" uk-icon="pencil"
></i>
<span class="uk-margin-small-left">
Edit Edit
</span> </span>
</div> </div>
<div (click)="confirmDeletePageHelpContent(check.divHelpContent._id)" class="uk-button action uk-margin-top uk-flex uk-flex-middle "> <div (click)="confirmDeletePageHelpContent(check.divHelpContent._id)"
<i class="clickable " uk-icon="trash" class="uk-button action uk-margin-top uk-flex uk-flex-middle ">
></i> <i class="clickable " uk-icon="trash"
<span class="uk-margin-small-left"> ></i>
<span class="uk-margin-small-left">
Delete Delete
</span> </span>
</div> </div>
</div>
</div>
</div>
</div>
</li>
</ul>
</div> </div>
<div *ngIf="checkboxes.length==0" class="col-md-12">
<div class="uk-alert-warning" uk-alert>No page contents found</div>
</div>
</div> </div>
</div> </div>
</div> </div>
</div> </li>
</div> </ul>
</div>
<div *ngIf="checkboxes.length == 0"
class="uk-card uk-card-default uk-padding-large uk-text-center uk-margin-bottom uk-text-bold">
<div>No class help texts found</div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<modal-alert #AlertModalDeletePageHelpContents (alertOutput)="confirmedDeletePageHelpContents($event)"></modal-alert> <modal-alert #AlertModalDeletePageHelpContents (alertOutput)="confirmedDeletePageHelpContents($event)"></modal-alert>

View File

@ -1,20 +1,20 @@
import {Component, ViewChild, OnInit, ElementRef} from '@angular/core'; import {Component, ElementRef, OnInit, ViewChild} from '@angular/core';
import {FormBuilder, FormControl, FormGroup} from "@angular/forms"; import {FormBuilder, FormControl, FormGroup} from '@angular/forms';
import {ActivatedRoute, Router} from "@angular/router"; import {ActivatedRoute, Router} from '@angular/router';
import {HelpContentService} from "../../services/help-content.service"; import {HelpContentService} from '../../services/help-content.service';
import {PageHelpContentFilterOptions} from '../../utils/entities/adminTool/page-help-content'; import {PageHelpContentFilterOptions} from '../../utils/entities/adminTool/page-help-content';
import {Page} from "../../utils/entities/adminTool/page"; import {Page} from '../../utils/entities/adminTool/page';
import {Portal} from "../../utils/entities/adminTool/portal"; import {Portal} from '../../utils/entities/adminTool/portal';
import {EnvProperties} from '../../utils/properties/env-properties'; import {EnvProperties} from '../../utils/properties/env-properties';
import {Session} from '../../login/utils/helper.class'; import {Session} from '../../login/utils/helper.class';
import {LoginErrorCodes} from '../../login/utils/guardHelper.class'; import {LoginErrorCodes} from '../../login/utils/guardHelper.class';
import {HelperFunctions} from "../../utils/HelperFunctions.class"; import {HelperFunctions} from '../../utils/HelperFunctions.class';
import {Subscriber} from "rxjs"; import {Subscriber} from 'rxjs';
import {properties} from "../../../../environments/environment"; import {properties} from '../../../../environments/environment';
import {DomSanitizer} from '@angular/platform-browser'; import {DomSanitizer} from '@angular/platform-browser';
import {SearchInputComponent} from '../../sharedComponents/search-input/search-input.component'; import {SearchInputComponent} from '../../sharedComponents/search-input/search-input.component';
import {ConnectHelper} from '../../connect/connectHelper';
import {CheckDivHelpContent, DivHelpContent} from '../../utils/entities/adminTool/div-help-content'; import {CheckDivHelpContent, DivHelpContent} from '../../utils/entities/adminTool/div-help-content';
declare var UIkit; declare var UIkit;
@ -23,74 +23,51 @@ declare var UIkit;
templateUrl: './class-help-contents.component.html', templateUrl: './class-help-contents.component.html',
}) })
export class ClassHelpContentsComponent implements OnInit { export class ClassHelpContentsComponent implements OnInit {
@ViewChild('AlertModalDeletePageHelpContents') alertModalDeletePageHelpContents; @ViewChild('AlertModalDeletePageHelpContents') alertModalDeletePageHelpContents;
private selectedPageContents: string[] = []; private selectedPageContents: string[] = [];
public checkboxes: CheckDivHelpContent[] = []; public checkboxes: CheckDivHelpContent[] = [];
public divHelpContents: DivHelpContent[] = [];
public pageHelpContents: DivHelpContent[] = [];
public formGroup: FormGroup; public formGroup: FormGroup;
public pages: Page[]; public pages: Page[];
public checkboxAll: boolean = false; public checkboxAll: boolean = false;
public filters: PageHelpContentFilterOptions = {id: '', active: null, text: new RegExp('')}; public filters: PageHelpContentFilterOptions = {id: '', active: null, text: new RegExp('')};
public keyword: string = ""; public keyword: string = '';
public counter = {all: 0, active: 0, inactive: 0}; public counter = {all: 0, active: 0, inactive: 0};
public communities: Portal[] = []; public communities: Portal[] = [];
public portal: string; public portal: string;
public selectedPageId: string; public selectedPageId: string;
public community: Portal; public community: Portal;
public page: Page; public page: Page;
public properties: EnvProperties = null; public properties: EnvProperties = properties;
public showLoading: boolean = true; public showLoading: boolean = true;
public errorMessage: string = '';
public updateErrorMessage: string = '';
public filterForm: FormControl; public filterForm: FormControl;
public selectForm: FormControl;
private subscriptions: any[] = []; private subscriptions: any[] = [];
public selectedKeyword: string; public selectedKeyword: string;
@ViewChild('searchInputComponent') searchInputComponent: SearchInputComponent; @ViewChild('searchInputComponent') searchInputComponent: SearchInputComponent;
constructor(private element: ElementRef, private route: ActivatedRoute, private router: Router, private _helpService: HelpContentService, private _fb: FormBuilder, private sanitizer: DomSanitizer) {
}
ngOnInit() { ngOnInit() {
this.filterForm = this._fb.control(''); this.filterForm = this._fb.control('');
this.selectForm = this._fb.control('');
this.subscriptions.push(this.filterForm.valueChanges.subscribe(value => { this.subscriptions.push(this.filterForm.valueChanges.subscribe(value => {
this.filterBySearch(value); this.filterBySearch(value);
})); }));
this.subscriptions.push(this.selectForm.valueChanges.subscribe(value => {
this.filterByPage(value);
}));
this.properties = properties;
this.subscriptions.push(this.route.params.subscribe(params => { this.subscriptions.push(this.route.params.subscribe(params => {
this.portal = (this.route.snapshot.data.portal) ? this.route.snapshot.data.portal : this.route.snapshot.params[this.route.snapshot.data.param]; this.portal = (this.route.snapshot.data.portal) ? this.route.snapshot.data.portal : this.route.snapshot.params[this.route.snapshot.data.param];
ConnectHelper.setPortalTypeFromPid(this.portal);
this.subscriptions.push(this.route.queryParams.subscribe(params => { this.subscriptions.push(this.route.queryParams.subscribe(params => {
HelperFunctions.scroll(); HelperFunctions.scroll();
this.selectedPageId = params['pageId']; this.selectedPageId = params['pageId'];
if (this.portal && this.selectedPageId) { if (this.portal && this.selectedPageId) {
this.getPage(this.selectedPageId); this.getPage(this.selectedPageId);
} }
if(!this.selectedPageId) { if (!this.selectedPageId) {
this.router.navigate(['../pages'], {relativeTo: this.route }); this.router.navigate(['../pages'], {relativeTo: this.route});
} }
})); }));
})); }));
} }
constructor(private element: ElementRef, private route: ActivatedRoute, private router: Router, private _helpService: HelpContentService, private _fb: FormBuilder, private sanitizer: DomSanitizer) {
}
ngOnDestroy(): void { ngOnDestroy(): void {
this.subscriptions.forEach(value => { this.subscriptions.forEach(value => {
if (value instanceof Subscriber) { if (value instanceof Subscriber) {
@ -100,191 +77,145 @@ export class ClassHelpContentsComponent implements OnInit {
} }
}); });
} }
init(){
}
getPage(pageId: string) { getPage(pageId: string) {
if (!Session.isLoggedIn()) { this.showLoading = true;
this.router.navigate(['/user-info'], { this.subscriptions.push(this._helpService.getPageByPortal(pageId, this.properties.adminToolsAPIURL, this.portal).subscribe(
queryParams: { page => {
"errorCode": LoginErrorCodes.NOT_VALID, if (this.properties.adminToolsPortalType != page.portalType) {
"redirectUrl": this.router.url this.router.navigate(['./pageContents'], {queryParams: {'communityId': this.portal}});
} else {
this.page = page;
this.getPageHelpContents(this.portal);
} }
}); },
} else { error => this.handleError('System error retrieving page', error)));
this.showLoading = true;
this.updateErrorMessage = "";
this.errorMessage = "";
this.subscriptions.push(this._helpService.getPageByPortal(pageId, this.properties.adminToolsAPIURL, this.portal).subscribe(
page => {
if (this.properties.adminToolsPortalType != page.portalType) {
this.router.navigate(['./pageContents'], {queryParams: {"communityId": this.portal}});
} else {
this.page = page;
this.getPageHelpContents(this.portal);
}
},
error => this.handleError('System error retrieving page', error)));
}
} }
public countPageHelpContents() { public countClassHelpContents() {
this.counter = {all: 0, active: 0, inactive: 0}; this.counter = {all: 0, active: 0, inactive: 0};
let filter = Object.assign({}, this.filters); let filter = Object.assign({}, this.filters);
filter.active = null; filter.active = null;
this.pageHelpContents.forEach(_ => { this.divHelpContents.forEach(_ => {
if (this.filterPageHelpContent(_, filter)) { if (this.filterPageHelpContent(_, filter)) {
if (_.isActive == true) this.counter.active++; if (_.isActive == true) {
else this.counter.inactive++ this.counter.active++;
} else {
this.counter.inactive++;
}
} }
}); });
this.counter.all = this.counter.active + this.counter.inactive; this.counter.all = this.counter.active + this.counter.inactive;
} }
getPageHelpContents(community_pid: string) { getPageHelpContents(community_pid: string) {
if (!Session.isLoggedIn()) { this.subscriptions.push(this._helpService.getCommunityDivHelpContents(community_pid, this.properties.adminToolsAPIURL, this.selectedPageId).subscribe(
this.router.navigate(['/user-info'], { pageHelpContents => {
queryParams: { this.divHelpContents = pageHelpContents as Array<DivHelpContent>;
"errorCode": LoginErrorCodes.NOT_VALID, this.counter.all = this.divHelpContents.length;
"redirectUrl": this.router.url this.checkboxes = [];
for (let i = this.divHelpContents.length - 1; i >= 0; i -= 1) {
this.checkboxes.unshift(<CheckDivHelpContent>{divHelpContent: this.divHelpContents[i], checked: false});
} }
});
} else { this.countClassHelpContents();
this.subscriptions.push(this._helpService.getCommunityDivHelpContents(community_pid, this.properties.adminToolsAPIURL, this.selectedPageId).subscribe(
pageHelpContents => { this.showLoading = false;
this.pageHelpContents = pageHelpContents as Array<DivHelpContent>; },
this.counter.all = this.pageHelpContents.length; error => this.handleError('System error retrieving page contents', error)));
this.checkboxes = [];
for (let i = this.pageHelpContents.length - 1; i >= 0; i -= 1) {
this.checkboxes.unshift(<CheckDivHelpContent>{divHelpContent: this.pageHelpContents[i], checked: false});
}
this.countPageHelpContents();
this.showLoading = false;
},
error => this.handleError('System error retrieving page contents', error)));
}
} }
public toggleCheckBoxes(event) {
this.checkboxes.forEach(_ => _.checked = event.target.checked);
this.checkboxAll = event.target.checked;
}
public applyCheck(flag: boolean) { public applyCheck(flag: boolean) {
this.checkboxes.forEach(_ => _.checked = flag); this.checkboxes.forEach(_ => _.checked = flag);
this.checkboxAll = false; this.checkboxAll = false;
} }
public getSelectedPageHelpContents(): string[] { public getSelectedPageHelpContents(): string[] {
return this.checkboxes.filter(pageHelpContent => pageHelpContent.checked == true) return this.checkboxes.filter(pageHelpContent => pageHelpContent.checked == true)
.map(checkedPageHelpContent => checkedPageHelpContent.divHelpContent).map(res => res._id); .map(checkedPageHelpContent => checkedPageHelpContent.divHelpContent).map(res => res._id);
} }
public confirmDeletePageHelpContent(id: string) { public confirmDeletePageHelpContent(id: string) {
this.selectedPageContents = [id]; this.selectedPageContents = [id];
this.confirmModalOpen(); this.confirmModalOpen();
} }
public confirmDeleteSelectedPageHelpContents() { public confirmDeleteSelectedPageHelpContents() {
this.selectedPageContents = this.getSelectedPageHelpContents(); this.selectedPageContents = this.getSelectedPageHelpContents();
this.confirmModalOpen(); this.confirmModalOpen();
} }
private confirmModalOpen() { private confirmModalOpen() {
if (!Session.isLoggedIn()) { this.alertModalDeletePageHelpContents.cancelButton = true;
this.router.navigate(['/user-info'], { this.alertModalDeletePageHelpContents.okButton = true;
queryParams: { this.alertModalDeletePageHelpContents.alertTitle = 'Delete Confirmation';
"errorCode": LoginErrorCodes.NOT_VALID, this.alertModalDeletePageHelpContents.message = 'Are you sure you want to delete the selected page content(s)?';
"redirectUrl": this.router.url this.alertModalDeletePageHelpContents.okButtonText = 'Yes';
} this.alertModalDeletePageHelpContents.open();
});
} else {
this.alertModalDeletePageHelpContents.cancelButton = true;
this.alertModalDeletePageHelpContents.okButton = true;
this.alertModalDeletePageHelpContents.alertTitle = "Delete Confirmation";
this.alertModalDeletePageHelpContents.message = "Are you sure you want to delete the selected page content(s)?";
this.alertModalDeletePageHelpContents.okButtonText = "Yes";
this.alertModalDeletePageHelpContents.open();
}
} }
public confirmedDeletePageHelpContents(data: any) { public confirmedDeletePageHelpContents(data: any) {
if (!Session.isLoggedIn()) { this.showLoading = true;
this.router.navigate(['/user-info'], { this.subscriptions.push(this._helpService.deleteDivHelpContents(this.selectedPageContents, this.properties.adminToolsAPIURL, this.portal).subscribe(
queryParams: { _ => {
"errorCode": LoginErrorCodes.NOT_VALID, this.deletePageHelpContentsFromArray(this.selectedPageContents);
"redirectUrl": this.router.url UIkit.notification('Page content(s) has been <b>successfully deleted</b>', {
} status: 'success',
}); timeout: 6000,
} else { pos: 'bottom-right'
this.showLoading = true; });
this.updateErrorMessage = ""; this.showLoading = false;
},
this.subscriptions.push(this._helpService.deleteDivHelpContents(this.selectedPageContents, this.properties.adminToolsAPIURL, this.portal).subscribe( error => this.handleUpdateError('System error deleting the selected page content(s)', error)
_ => { ));
this.deletePageHelpContentsFromArray(this.selectedPageContents);
UIkit.notification('Page content(s) has been <b>successfully deleted</b>', {
status: 'success',
timeout: 6000,
pos: 'bottom-right'
});
this.showLoading = false;
},
error => this.handleUpdateError('System error deleting the selected page content(s)', error)
));
}
} }
private deletePageHelpContentsFromArray(ids: string[]): void { private deletePageHelpContentsFromArray(ids: string[]): void {
for (let id of ids) { for (let id of ids) {
let iqc = this.checkboxes.findIndex(_ => _.divHelpContent._id == id); let i = this.checkboxes.findIndex(_ => _.divHelpContent._id == id);
let iq = this.pageHelpContents.findIndex(_ => _._id == id); let j = this.divHelpContents.findIndex(_ => _._id == id);
this.checkboxes.splice(iqc, 1); this.checkboxes.splice(i, 1);
this.pageHelpContents.splice(iqc, 1); this.divHelpContents.splice(j, 1);
} }
this.countPageHelpContents(); this.countClassHelpContents();
} }
public editPageHelpContent(id: string) { public editPageHelpContent(id: string) {
if (this.selectedPageId) { if (this.selectedPageId) {
this.router.navigate(['edit/'], { this.router.navigate(['edit/'], {
queryParams: { queryParams: {
"pageContentId": id, 'pageContentId': id,
"pageId": this.selectedPageId 'pageId': this.selectedPageId
}, relativeTo: this.route }, relativeTo: this.route
}); });
} else { } else {
this.router.navigate(['edit/'], { this.router.navigate(['edit/'], {
queryParams: { queryParams: {
"pageContentId": id, 'pageContentId': id,
}, relativeTo: this.route }, relativeTo: this.route
}); });
} }
} }
public togglePageHelpContents(status: boolean, ids: string[]) { public togglePageHelpContents(status: boolean, ids: string[]) {
if (!Session.isLoggedIn()) { if (!Session.isLoggedIn()) {
this.router.navigate(['/user-info'], { this.router.navigate(['/user-info'], {
queryParams: { queryParams: {
"errorCode": LoginErrorCodes.NOT_VALID, 'errorCode': LoginErrorCodes.NOT_VALID,
"redirectUrl": this.router.url 'redirectUrl': this.router.url
} }
}); });
} else { } else {
this.updateErrorMessage = "";
this.subscriptions.push(this._helpService.toggleDivHelpContents(ids, status, this.properties.adminToolsAPIURL, this.portal).subscribe( this.subscriptions.push(this._helpService.toggleDivHelpContents(ids, status, this.properties.adminToolsAPIURL, this.portal).subscribe(
() => { () => {
for (let id of ids) { for (let id of ids) {
let i = this.checkboxes.findIndex(_ => _.divHelpContent._id == id); let i = this.checkboxes.findIndex(_ => _.divHelpContent._id == id);
this.checkboxes[i].divHelpContent.isActive = status; this.checkboxes[i].divHelpContent.isActive = status;
} }
this.countPageHelpContents(); this.countClassHelpContents();
this.applyCheck(false); this.applyCheck(false);
UIkit.notification('Page content(s) has been <b>successfully updated</b>', { UIkit.notification('Page content(s) has been <b>successfully updated</b>', {
status: 'success', status: 'success',
@ -296,69 +227,70 @@ export class ClassHelpContentsComponent implements OnInit {
)); ));
} }
} }
public filterPageHelpContent(pageHelpContent: DivHelpContent, filters: PageHelpContentFilterOptions): boolean { public filterPageHelpContent(divHelpContent: DivHelpContent, filters: PageHelpContentFilterOptions): boolean {
let activeFlag = filters.active == null || pageHelpContent.isActive == filters.active; let activeFlag = filters.active == null || divHelpContent.isActive == filters.active;
let textFlag = filters.text.toString() == '' || (pageHelpContent.content).match(filters.text) != null; let textFlag = filters.text.toString() == '' || (divHelpContent.content && divHelpContent.content.match(filters.text) != null);
return activeFlag && textFlag; return activeFlag && textFlag;
} }
public applyFilter() { public applyFilter() {
this.checkboxes = []; this.checkboxes = [];
this.pageHelpContents.filter(item => this.filterPageHelpContent(item, this.filters)).forEach( this.divHelpContents.filter(item => this.filterPageHelpContent(item, this.filters)).forEach(
_ => { _ => {
this.checkboxes.push(<CheckDivHelpContent>{divHelpContent: _, checked: false}) this.checkboxes.push(<CheckDivHelpContent>{divHelpContent: _, checked: false});
} }
); );
} }
public filterByPage(event: any) {
if(event.target && event.target.value) {
this.filters.id = event.target.value;
this.applyFilter();
}
}
public filterBySearch(text: string) { public filterBySearch(text: string) {
this.filters.text = new RegExp(text, "i"); this.filters.text = new RegExp(text, 'i');
this.applyFilter(); this.applyFilter();
} }
handleError(message: string, error) { handleError(message: string, error) {
this.errorMessage = message; UIkit.notification(message, {
status: 'danger',
timeout: 6000,
pos: 'bottom-right'
});
console.log('Server responded: ' + error); console.log('Server responded: ' + error);
this.showLoading = false; this.showLoading = false;
} }
handleUpdateError(message: string, error) { handleUpdateError(message: string, error) {
this.updateErrorMessage = message; UIkit.notification(message, {
status: 'danger',
timeout: 6000,
pos: 'bottom-right'
});
console.log('Server responded: ' + error); console.log('Server responded: ' + error);
this.showLoading = false; this.showLoading = false;
} }
public newPageContent() { public newPageContent() {
this.router.navigate(['edit'], { this.router.navigate(['edit'], {
queryParams: { queryParams: {
pageId: this.selectedPageId pageId: this.selectedPageId
}, relativeTo: this.route }, relativeTo: this.route
}); });
} }
public onSearchClose() { public onSearchClose() {
this.selectedKeyword = this.filterForm.value; this.selectedKeyword = this.filterForm.value;
} }
public reset() { public reset() {
this.selectedKeyword = null; this.selectedKeyword = null;
this.searchInputComponent.reset() this.searchInputComponent.reset();
} }
selectAll(){
let checked = !!(this.getSelectedPageHelpContents().length != this.checkboxes.length); selectAll() {
for (let check of this.checkboxes) { let checked = (this.getSelectedPageHelpContents().length != this.checkboxes.length);
check.checked = checked; for (let check of this.checkboxes) {
} check.checked = checked;
}
} }
} }

View File

@ -6,7 +6,7 @@ import {ConnectAdminLoginGuard} from '../../connect/communityGuard/connectAdminL
import {FormsModule, ReactiveFormsModule} from '@angular/forms'; import {FormsModule, ReactiveFormsModule} from '@angular/forms';
import {AlertModalModule} from '../../utils/modal/alertModal.module'; import {AlertModalModule} from '../../utils/modal/alertModal.module';
import {SafeHtmlPipeModule} from '../../utils/pipes/safeHTMLPipe.module'; import {SafeHtmlPipeModule} from '../../utils/pipes/safeHTMLPipe.module';
import {MatSlideToggleModule} from '@angular/material'; import { MatSlideToggleModule } from '@angular/material/slide-toggle';
import {AdminToolServiceModule} from '../../services/adminToolService.module'; import {AdminToolServiceModule} from '../../services/adminToolService.module';
import {InputModule} from '../../sharedComponents/input/input.module'; import {InputModule} from '../../sharedComponents/input/input.module';
import {SearchInputModule} from '../../sharedComponents/search-input/search-input.module'; import {SearchInputModule} from '../../sharedComponents/search-input/search-input.module';

View File

@ -6,11 +6,9 @@ import {CheckEntity, Entity} from '../../utils/entities/adminTool/entity';
import {Portal} from '../../utils/entities/adminTool/portal'; import {Portal} from '../../utils/entities/adminTool/portal';
import {EnvProperties} from '../../utils/properties/env-properties'; import {EnvProperties} from '../../utils/properties/env-properties';
import {Session} from '../../login/utils/helper.class'; import {Session} from '../../login/utils/helper.class';
import {LoginErrorCodes} from '../../login/utils/guardHelper.class';
import {UserManagementService} from '../../services/user-management.service'; import {UserManagementService} from '../../services/user-management.service';
import {Subscriber} from "rxjs"; import {Subscriber} from "rxjs";
import {properties} from "../../../../environments/environment"; import {properties} from "../../../../environments/environment";
import {ConnectHelper} from "../../connect/connectHelper";
import {AlertModal} from "../../utils/modal/alert"; import {AlertModal} from "../../utils/modal/alert";
import {SearchInputComponent} from "../../sharedComponents/search-input/search-input.component"; import {SearchInputComponent} from "../../sharedComponents/search-input/search-input.component";
import {StringUtils} from "../../utils/string-utils.class"; import {StringUtils} from "../../utils/string-utils.class";
@ -73,7 +71,6 @@ export class EntitiesComponent implements OnInit {
})); }));
this.userManagementService.getUserInfo().subscribe(user => { this.userManagementService.getUserInfo().subscribe(user => {
this.portal = (this.route.snapshot.data.portal) ? this.route.snapshot.data.portal : this.route.snapshot.params[this.route.snapshot.data.param]; this.portal = (this.route.snapshot.data.portal) ? this.route.snapshot.data.portal : this.route.snapshot.params[this.route.snapshot.data.param];
ConnectHelper.setPortalTypeFromPid(this.portal);
if (this.route.snapshot.data.portal) { if (this.route.snapshot.data.portal) {
this.title.setTitle(StringUtils.capitalize(this.portal) + ' | Entities'); this.title.setTitle(StringUtils.capitalize(this.portal) + ' | Entities');
} else if (this.route.snapshot.params[this.route.snapshot.data.param]) { } else if (this.route.snapshot.params[this.route.snapshot.data.param]) {

View File

@ -4,7 +4,7 @@ import {CommonModule} from '@angular/common';
import {EntitiesComponent} from './entities.component'; import {EntitiesComponent} from './entities.component';
import {FormsModule, ReactiveFormsModule} from '@angular/forms'; import {FormsModule, ReactiveFormsModule} from '@angular/forms';
import {AlertModalModule} from '../../utils/modal/alertModal.module'; import {AlertModalModule} from '../../utils/modal/alertModal.module';
import {MatSlideToggleModule} from '@angular/material'; import { MatSlideToggleModule } from '@angular/material/slide-toggle';
import {AdminToolServiceModule} from "../../services/adminToolService.module"; import {AdminToolServiceModule} from "../../services/adminToolService.module";
import {InputModule} from "../../sharedComponents/input/input.module"; import {InputModule} from "../../sharedComponents/input/input.module";
import {PageContentModule} from "../sharedComponents/page-content/page-content.module"; import {PageContentModule} from "../sharedComponents/page-content/page-content.module";

View File

@ -7,7 +7,7 @@
<icon name="arrow_left"></icon> <icon name="arrow_left"></icon>
</span> </span>
<span class="space"> <span class="space">
Go back to helptexts list Go back to page help texts list
</span> </span>
</a> </a>
</div> </div>
@ -16,7 +16,7 @@
<div class="uk-card-header"> <div class="uk-card-header">
<div class="uk-flex uk-flex-middle uk-child-width-1-1 uk-child-width-1-2@m uk-grid" uk-grid> <div class="uk-flex uk-flex-middle uk-child-width-1-1 uk-child-width-1-2@m uk-grid" uk-grid>
<div> <div>
<div class="uk-text-small uk-text-muted"> {{pageHelpContent ? 'Update ' : 'Add new '}} help text</div> <div class="uk-text-small uk-text-muted"> {{pageHelpContent ? 'Update ' : 'Add new '}} page help text</div>
<div> <div>
<span *ngIf="page" class="uk-text-bold">{{page.name}}</span> <span *ngIf="page" class="uk-text-bold">{{page.name}}</span>
<span *ngIf="myForm.dirty"> (unsaved changes)</span> <span *ngIf="myForm.dirty"> (unsaved changes)</span>

View File

@ -5,10 +5,9 @@ import {Page} from '../../utils/entities/adminTool/page';
import {HelpContentService} from '../../services/help-content.service'; import {HelpContentService} from '../../services/help-content.service';
import {EnvProperties} from '../../utils/properties/env-properties'; import {EnvProperties} from '../../utils/properties/env-properties';
import {properties} from '../../../../environments/environment'; import {properties} from '../../../../environments/environment';
import {Observable, Subscriber, Subscription} from 'rxjs'; import {Subscriber, Subscription, zip} from 'rxjs';
import {HelperFunctions} from '../../utils/HelperFunctions.class'; import {HelperFunctions} from '../../utils/HelperFunctions.class';
import {PageHelpContent} from '../../utils/entities/adminTool/page-help-content'; import {PageHelpContent} from '../../utils/entities/adminTool/page-help-content';
import {ConnectHelper} from "../../connect/connectHelper";
declare var UIkit; declare var UIkit;
@ -36,7 +35,6 @@ export class PageContentFormComponent implements OnInit {
ngOnInit() { ngOnInit() {
this.subs.push(this.route.params.subscribe(params => { this.subs.push(this.route.params.subscribe(params => {
this.portal = (this.route.snapshot.data.portal) ? this.route.snapshot.data.portal : this.route.snapshot.params[this.route.snapshot.data.param]; this.portal = (this.route.snapshot.data.portal) ? this.route.snapshot.data.portal : this.route.snapshot.params[this.route.snapshot.data.param];
ConnectHelper.setPortalTypeFromPid(this.portal);
this.subs.push(this.route.queryParams.subscribe(params => { this.subs.push(this.route.queryParams.subscribe(params => {
HelperFunctions.scroll(); HelperFunctions.scroll();
this.pageId = params['pageId']; this.pageId = params['pageId'];
@ -60,7 +58,7 @@ export class PageContentFormComponent implements OnInit {
getInfo(pageId: string) { getInfo(pageId: string) {
this.showLoading = true; this.showLoading = true;
let obs = Observable.zip(this._helpContentService.getPageByPortal(pageId, this.properties.adminToolsAPIURL, this.portal), this._helpContentService.getCommunityPageHelpContents(this.portal, this.properties.adminToolsAPIURL, pageId)); let obs = zip(this._helpContentService.getPageByPortal(pageId, this.properties.adminToolsAPIURL, this.portal), this._helpContentService.getCommunityPageHelpContents(this.portal, this.properties.adminToolsAPIURL, pageId));
this.subs.push(obs.subscribe( this.subs.push(obs.subscribe(
results => { results => {
this.page = results[0]; this.page = results[0];

View File

@ -8,7 +8,7 @@ import {PageContentFormComponent} from './page-help-content-form.component';
import {PageHelpContentFormRoutingModule} from './page-help-content-form-routing.module'; import {PageHelpContentFormRoutingModule} from './page-help-content-form-routing.module';
import {AdminToolServiceModule} from '../../services/adminToolService.module'; import {AdminToolServiceModule} from '../../services/adminToolService.module';
import {InputModule} from '../../sharedComponents/input/input.module'; import {InputModule} from '../../sharedComponents/input/input.module';
import {MatSlideToggleModule} from '@angular/material'; import { MatSlideToggleModule } from '@angular/material/slide-toggle';
import {IconsModule} from '../../utils/icons/icons.module'; import {IconsModule} from '../../utils/icons/icons.module';
import {PageContentModule} from '../sharedComponents/page-content/page-content.module'; import {PageContentModule} from '../sharedComponents/page-content/page-content.module';
import {RouterModule} from '@angular/router'; import {RouterModule} from '@angular/router';

View File

@ -24,18 +24,19 @@
<button class="large uk-icon-button uk-button-secondary"> <button class="large uk-icon-button uk-button-secondary">
<icon name="add"></icon> <icon name="add"></icon>
</button> </button>
<button class="uk-button uk-button-link uk-margin-small-left uk-text-secondary">Add new help text</button> <button class="uk-button uk-button-link uk-margin-small-left uk-text-secondary">Add new page help text
</button>
</a> </a>
</div> </div>
</div> </div>
<div *ngIf="checkboxes.length > 0" <div *ngIf="!showLoading && checkboxes.length > 0"
class="uk-padding uk-padding-remove-bottom uk-padding-remove-top uk-margin-remove-top uk-margin-small-bottom" class="uk-padding uk-flex uk-padding-remove-bottom uk-padding-remove-top uk-margin-remove-top uk-margin-small-bottom uk-display-inline"
[attr.uk-tooltip]="getSelectedPageHelpContents().length == 0 ? 'pos:left; cls: uk-active' : 'cls: uk-invisible'" [attr.uk-tooltip]="getSelectedPageHelpContents().length == 0 ? 'pos:left; cls: uk-active' : 'cls: uk-invisible'"
title="Select at least one help text"><input id="checkAll" type="checkbox" (click)="selectAll()" title="Select at least one help text"><input id="checkAll" type="checkbox" (click)="selectAll()"
[ngModel]="getSelectedPageHelpContents().length ==checkboxes.length"/> [ngModel]="getSelectedPageHelpContents().length ==checkboxes.length"/>
<span *ngIf="getSelectedPageHelpContents().length > 0" class="uk-margin-left uk-text-muted"> <span *ngIf="getSelectedPageHelpContents().length > 0" class="uk-margin-left uk-text-muted">
{{getSelectedPageHelpContents().length}} pages selected </span> {{getSelectedPageHelpContents().length}} pages selected </span>
<a class="uk-margin-left ">Actions </a> <a class="uk-margin-left">Actions </a>
<div uk-dropdown="mode: click"> <div uk-dropdown="mode: click">
<ul class="uk-nav uk-dropdown-nav" <ul class="uk-nav uk-dropdown-nav"
[attr.uk-tooltip]="getSelectedPageHelpContents().length == 0 ? 'pos:left; cls: uk-active' : 'cls: uk-invisible'" [attr.uk-tooltip]="getSelectedPageHelpContents().length == 0 ? 'pos:left; cls: uk-active' : 'cls: uk-invisible'"
@ -54,74 +55,70 @@
</div> </div>
</div> </div>
<div inner> <div inner>
<div class="content-wrapper" id="contentWrapper"> <div *ngIf="showLoading" class="uk-position-center">
<div> <loading></loading>
<div class="contentPanel"> </div>
<div *ngIf="!showLoading"> <div *ngIf="!showLoading">
<ul *ngIf="checkboxes.length > 0" class="uk-list pages"> <div *ngIf="checkboxes.length > 0" class="uk-margin-medium-bottom">
<li *ngFor="let check of checkboxes; let i=index" class="uk-card uk-card-default uk-margin-bottom"> <ul class="uk-list pages">
<div class="uk-grid uk-grid-divider uk-padding" uk-grid> <li *ngFor="let check of checkboxes; let i=index" class="uk-card uk-card-default uk-margin-bottom">
<div class="uk-width-4-5 uk-first-column "> <div class="uk-grid uk-grid-divider uk-padding" uk-grid>
<div class="uk-grid uk-flex uk-flex-middle"> <div class="uk-width-4-5 uk-first-column ">
<div><input id="{{check.pageHelpContent._id}}" class="checkBox" type="checkbox" <div class="uk-grid uk-flex uk-flex-middle">
name="entitiescb[]" value="{{check.pageHelpContent._id}}" [(ngModel)]="check.checked"> <div><input id="{{check.pageHelpContent._id}}" class="checkBox" type="checkbox"
</div> name="entitiescb[]" value="{{check.pageHelpContent._id}}" [(ngModel)]="check.checked">
<div class="uk-width-expand uk-margin-medium-bottom"> </div>
<div *ngIf="!selectedPageId"> <div class="uk-width-expand uk-margin-medium-bottom">
<div class="page" href="#">{{check.pageHelpContent.page.name}}</div> <div *ngIf="!selectedPageId">
</div> <div class="page" href="#">{{check.pageHelpContent.page.name}}</div>
<div class="content multi-line-ellipsis lines-2">
<p>{{check.pageHelpContent.content|htmlToString}}</p></div>
</div>
<div class="uk-grid uk-width-1-1 uk-margin-left">
<div class=" ">
<span class="title">Placement: </span>{{check.pageHelpContent.placement}}
</div>
<div class=" ">
<span class="title">Order: </span>{{check.pageHelpContent.order}}
</div>
<div class=" ">
<span class="title uk-margin-small-right">Enable/disable: </span>
<mat-slide-toggle [checked]="check.pageHelpContent.isActive"
(change)="($event.source.checked = check.pageHelpContent.isActive);togglePageHelpContents(!check.pageHelpContent.isActive,[check.pageHelpContent._id])"
uk-tooltip="title:<div class='uk-padding-small uk-width-large'><div class='uk-text-bold '> Enable or disable help text to show or hide it from the dashboard</div></div>"
></mat-slide-toggle>
</div>
</div>
</div>
</div> </div>
<div class="uk-width-1-5 uk-first-column"> <div class="content multi-line-ellipsis lines-2">
<p>{{check.pageHelpContent.content|htmlToString}}</p></div>
<div class=" uk-flex-center uk-flex"> </div>
<div class="actions" href="#"> <div class="uk-grid uk-width-1-1 uk-margin-left">
<div class="" (click)="editPageHelpContent(check.pageHelpContent._id)" <div class=" ">
class="uk-button action uk-margin-top uk-flex uk-flex-middle "> <span class="title">Placement: </span>{{check.pageHelpContent.placement}}
<i class="clickable" uk-icon="pencil" </div>
></i> <div class=" ">
<span class="uk-margin-small-left"> <span class="title">Order: </span>{{check.pageHelpContent.order}}
Edit </div>
</span> <div class=" ">
</div> <span class="title uk-margin-small-right">Enable/disable: </span>
<div (click)="confirmDeletePageHelpContent(check.pageHelpContent._id)" <mat-slide-toggle [checked]="check.pageHelpContent.isActive"
class="uk-button action uk-margin-top uk-flex uk-flex-middle "> (change)="($event.source.checked = check.pageHelpContent.isActive);togglePageHelpContents(!check.pageHelpContent.isActive,[check.pageHelpContent._id])"
<i class="clickable " uk-icon="trash" uk-tooltip="title:<div class='uk-padding-small uk-width-large'><div class='uk-text-bold '> Enable or disable help text to show or hide it from the dashboard</div></div>"
></i> ></mat-slide-toggle>
<span class="uk-margin-small-left">
Delete
</span>
</div>
</div>
</div>
</div> </div>
</div> </div>
</li> </div>
</ul> </div>
<div *ngIf="checkboxes.length == 0" class="uk-card uk-card-default uk-padding-large uk-text-center uk-margin-bottom uk-text-bold"> <div class="uk-width-1-5 uk-first-column">
<div>No page contents found</div> <div class=" uk-flex-center uk-flex">
<div class="actions" href="#">
<div class="" (click)="editPageHelpContent(check.pageHelpContent._id)"
class="uk-button action uk-margin-top uk-flex uk-flex-middle ">
<i class="clickable" uk-icon="pencil"
></i>
<span class="uk-margin-small-left">Edit</span>
</div>
<div (click)="confirmDeletePageHelpContent(check.pageHelpContent._id)"
class="uk-button action uk-margin-top uk-flex uk-flex-middle ">
<i class="clickable " uk-icon="trash"
></i>
<span class="uk-margin-small-left">
Delete
</span>
</div>
</div>
</div>
</div> </div>
</div> </div>
</div> </li>
</ul>
</div>
<div *ngIf="checkboxes.length == 0"
class="uk-card uk-card-default uk-padding-large uk-text-center uk-margin-bottom uk-text-bold">
<div>No page help texts found</div>
</div> </div>
</div> </div>
</div> </div>

View File

@ -1,23 +1,22 @@
import {Component, ViewChild, OnInit, ElementRef} from '@angular/core'; import {Component, ElementRef, OnInit, ViewChild} from '@angular/core';
import {FormBuilder, FormControl, FormGroup} from "@angular/forms"; import {FormBuilder, FormControl, FormGroup} from '@angular/forms';
import {ActivatedRoute, Router} from "@angular/router"; import {ActivatedRoute, Router} from '@angular/router';
import {HelpContentService} from "../../services/help-content.service"; import {HelpContentService} from '../../services/help-content.service';
import { import {
PageHelpContent,
CheckPageHelpContent, CheckPageHelpContent,
PageHelpContent,
PageHelpContentFilterOptions PageHelpContentFilterOptions
} from "../../utils/entities/adminTool/page-help-content"; } from '../../utils/entities/adminTool/page-help-content';
import {Page} from "../../utils/entities/adminTool/page"; import {CheckPage, Page} from '../../utils/entities/adminTool/page';
import {Portal} from "../../utils/entities/adminTool/portal"; import {Portal} from '../../utils/entities/adminTool/portal';
import {EnvProperties} from '../../utils/properties/env-properties'; import {EnvProperties} from '../../utils/properties/env-properties';
import {Session} from '../../login/utils/helper.class'; import {Session} from '../../login/utils/helper.class';
import {LoginErrorCodes} from '../../login/utils/guardHelper.class'; import {LoginErrorCodes} from '../../login/utils/guardHelper.class';
import {HelperFunctions} from "../../utils/HelperFunctions.class"; import {HelperFunctions} from '../../utils/HelperFunctions.class';
import {Subscriber} from "rxjs"; import {Subscriber} from 'rxjs';
import {properties} from "../../../../environments/environment"; import {properties} from '../../../../environments/environment';
import {DomSanitizer} from '@angular/platform-browser'; import {DomSanitizer} from '@angular/platform-browser';
import {SearchInputComponent} from '../../sharedComponents/search-input/search-input.component'; import {SearchInputComponent} from '../../sharedComponents/search-input/search-input.component';
import {ConnectHelper} from '../../connect/connectHelper';
declare var UIkit; declare var UIkit;
@ -34,7 +33,7 @@ export class PageHelpContentsComponent implements OnInit {
public pages: Page[]; public pages: Page[];
public checkboxAll: boolean = false; public checkboxAll: boolean = false;
public filters: PageHelpContentFilterOptions = {id: '', active: null, text: new RegExp('')}; public filters: PageHelpContentFilterOptions = {id: '', active: null, text: new RegExp('')};
public keyword: string = ""; public keyword: string = '';
public counter = {all: 0, active: 0, inactive: 0}; public counter = {all: 0, active: 0, inactive: 0};
public communities: Portal[] = []; public communities: Portal[] = [];
public portal: string; public portal: string;
@ -44,23 +43,20 @@ export class PageHelpContentsComponent implements OnInit {
public properties: EnvProperties = properties; public properties: EnvProperties = properties;
public showLoading: boolean = true; public showLoading: boolean = true;
public filterForm: FormControl; public filterForm: FormControl;
public selectForm: FormControl;
private subscriptions: any[] = []; private subscriptions: any[] = [];
public selectedKeyword: string; public selectedKeyword: string;
@ViewChild('searchInputComponent') searchInputComponent: SearchInputComponent; @ViewChild('searchInputComponent') searchInputComponent: SearchInputComponent;
constructor(private element: ElementRef, private route: ActivatedRoute, private router: Router, private _helpService: HelpContentService, private _fb: FormBuilder, private sanitizer: DomSanitizer) {
}
ngOnInit() { ngOnInit() {
this.filterForm = this._fb.control(''); this.filterForm = this._fb.control('');
this.selectForm = this._fb.control('');
this.subscriptions.push(this.filterForm.valueChanges.subscribe(value => { this.subscriptions.push(this.filterForm.valueChanges.subscribe(value => {
this.filterBySearch(value); this.filterBySearch(value);
})); }));
this.subscriptions.push(this.selectForm.valueChanges.subscribe(value => {
this.filterByPage(value);
}));
this.subscriptions.push(this.route.params.subscribe(params => { this.subscriptions.push(this.route.params.subscribe(params => {
this.portal = (this.route.snapshot.data.portal) ? this.route.snapshot.data.portal : this.route.snapshot.params[this.route.snapshot.data.param]; this.portal = (this.route.snapshot.data.portal) ? this.route.snapshot.data.portal : this.route.snapshot.params[this.route.snapshot.data.param];
ConnectHelper.setPortalTypeFromPid(this.portal);
this.subscriptions.push(this.route.queryParams.subscribe(params => { this.subscriptions.push(this.route.queryParams.subscribe(params => {
HelperFunctions.scroll(); HelperFunctions.scroll();
this.selectedPageId = params['pageId']; this.selectedPageId = params['pageId'];
@ -74,9 +70,6 @@ export class PageHelpContentsComponent implements OnInit {
})); }));
} }
constructor(private element: ElementRef, private route: ActivatedRoute, private router: Router, private _helpService: HelpContentService, private _fb: FormBuilder, private sanitizer: DomSanitizer) {
}
ngOnDestroy(): void { ngOnDestroy(): void {
this.subscriptions.forEach(value => { this.subscriptions.forEach(value => {
if (value instanceof Subscriber) { if (value instanceof Subscriber) {
@ -88,74 +81,54 @@ export class PageHelpContentsComponent implements OnInit {
} }
getPage(pageId: string) { getPage(pageId: string) {
if (!Session.isLoggedIn()) { this.showLoading = true;
this.router.navigate(['/user-info'], { this.subscriptions.push(this._helpService.getPageByPortal(pageId, this.properties.adminToolsAPIURL, this.portal).subscribe(
queryParams: { page => {
"errorCode": LoginErrorCodes.NOT_VALID, if (this.properties.adminToolsPortalType != page.portalType) {
"redirectUrl": this.router.url this.router.navigate(['./pageContents']);
} else {
this.page = page;
this.getPageHelpContents(this.portal);
} }
}); },
} else { error => this.handleError('System error retrieving page', error)));
this.showLoading = true;
this.subscriptions.push(this._helpService.getPageByPortal(pageId, this.properties.adminToolsAPIURL, this.portal).subscribe(
page => {
if (this.properties.adminToolsPortalType != page.portalType) {
this.router.navigate(['./pageContents']);
} else {
this.page = page;
this.getPageHelpContents(this.portal);
}
},
error => this.handleError('System error retrieving page', error)));
}
} }
public countPageHelpContents() { public countPageHelpContents() {
this.counter = {all: 0, active: 0, inactive: 0}; this.counter = {all: 0, active: 0, inactive: 0};
let filter = Object.assign({}, this.filters); let filter = Object.assign({}, this.filters);
filter.active = null; filter.active = null;
this.pageHelpContents.forEach(_ => { this.pageHelpContents.forEach(_ => {
if (this.filterPageHelpContent(_, filter)) { if (this.filterPageHelpContent(_, filter)) {
if (_.isActive == true) this.counter.active++; if (_.isActive == true) {
else this.counter.inactive++ this.counter.active++;
} else {
this.counter.inactive++;
}
} }
}); });
this.counter.all = this.counter.active + this.counter.inactive; this.counter.all = this.counter.active + this.counter.inactive;
} }
getPageHelpContents(community_pid: string) { getPageHelpContents(community_pid: string) {
if (!Session.isLoggedIn()) { this.subscriptions.push(this._helpService.getCommunityPageHelpContents(community_pid, this.properties.adminToolsAPIURL, this.selectedPageId).subscribe(
this.router.navigate(['/user-info'], { pageHelpContents => {
queryParams: { this.pageHelpContents = pageHelpContents as Array<PageHelpContent>;
"errorCode": LoginErrorCodes.NOT_VALID, this.counter.all = this.pageHelpContents.length;
"redirectUrl": this.router.url this.checkboxes = [];
for (let i = this.pageHelpContents.length - 1; i >= 0; i -= 1) {
this.checkboxes.unshift(<CheckPageHelpContent>{
pageHelpContent: this.pageHelpContents[i],
checked: false
});
} }
});
} else { this.countPageHelpContents();
this.subscriptions.push(this._helpService.getCommunityPageHelpContents(community_pid, this.properties.adminToolsAPIURL, this.selectedPageId).subscribe(
pageHelpContents => { this.showLoading = false;
this.pageHelpContents = pageHelpContents as Array<PageHelpContent>; },
this.counter.all = this.pageHelpContents.length; error => this.handleError('System error retrieving page contents', error)));
this.checkboxes = [];
for (let i = this.pageHelpContents.length - 1; i >= 0; i -= 1) {
this.checkboxes.unshift(<CheckPageHelpContent>{
pageHelpContent: this.pageHelpContents[i],
checked: false
});
}
this.countPageHelpContents();
this.showLoading = false;
},
error => this.handleError('System error retrieving page contents', error)));
}
}
public toggleCheckBoxes(event) {
this.checkboxes.forEach(_ => _.checked = event.target.checked);
this.checkboxAll = event.target.checked;
} }
public applyCheck(flag: boolean) { public applyCheck(flag: boolean) {
@ -179,56 +152,39 @@ export class PageHelpContentsComponent implements OnInit {
} }
private confirmModalOpen() { private confirmModalOpen() {
if (!Session.isLoggedIn()) { this.alertModalDeletePageHelpContents.cancelButton = true;
this.router.navigate(['/user-info'], { this.alertModalDeletePageHelpContents.okButton = true;
queryParams: { this.alertModalDeletePageHelpContents.alertTitle = 'Delete Confirmation';
"errorCode": LoginErrorCodes.NOT_VALID, this.alertModalDeletePageHelpContents.message = 'Are you sure you want to delete the selected page content(s)?';
"redirectUrl": this.router.url this.alertModalDeletePageHelpContents.okButtonText = 'Yes';
} this.alertModalDeletePageHelpContents.open();
});
} else {
this.alertModalDeletePageHelpContents.cancelButton = true;
this.alertModalDeletePageHelpContents.okButton = true;
this.alertModalDeletePageHelpContents.alertTitle = "Delete Confirmation";
this.alertModalDeletePageHelpContents.message = "Are you sure you want to delete the selected page content(s)?";
this.alertModalDeletePageHelpContents.okButtonText = "Yes";
this.alertModalDeletePageHelpContents.open();
}
} }
public confirmedDeletePageHelpContents(data: any) { public confirmedDeletePageHelpContents(data: any) {
if (!Session.isLoggedIn()) { this.showLoading = true;
this.router.navigate(['/user-info'], { this.subscriptions.push(this._helpService.deletePageHelpContents(this.selectedPageContents, this.properties.adminToolsAPIURL, this.portal).subscribe(
queryParams: { _ => {
"errorCode": LoginErrorCodes.NOT_VALID, this.deletePageHelpContentsFromArray(this.selectedPageContents);
"redirectUrl": this.router.url UIkit.notification('Page content(s) has been <b>successfully deleted</b>', {
} status: 'success',
}); timeout: 6000,
} else { pos: 'bottom-right'
this.showLoading = true; });
this.subscriptions.push(this._helpService.deletePageHelpContents(this.selectedPageContents, this.properties.adminToolsAPIURL, this.portal).subscribe( this.showLoading = false;
_ => { },
this.deletePageHelpContentsFromArray(this.selectedPageContents); error => this.handleUpdateError('System error deleting the selected page content(s)', error)
UIkit.notification('Page content(s) has been <b>successfully deleted</b>', { ));
status: 'success',
timeout: 6000,
pos: 'bottom-right'
});
this.showLoading = false;
},
error => this.handleUpdateError('System error deleting the selected page content(s)', error)
));
}
} }
private deletePageHelpContentsFromArray(ids: string[]): void { private deletePageHelpContentsFromArray(ids: string[]): void {
for (let id of ids) { for (let id of ids) {
let iqc = this.checkboxes.findIndex(_ => _.pageHelpContent._id == id); let i = this.checkboxes.findIndex(_ => _.pageHelpContent._id == id);
let iq = this.pageHelpContents.findIndex(_ => _._id == id); let j = this.pageHelpContents.findIndex(_ => _._id == id);
this.checkboxes.splice(iqc, 1); this.checkboxes.splice(i, 1);
this.pageHelpContents.splice(iqc, 1); this.pageHelpContents.splice(j, 1);
} }
this.countPageHelpContents(); this.countPageHelpContents();
this.filterBySearch(this.filterForm.value);
} }
public editPageHelpContent(id: string) { public editPageHelpContent(id: string) {
@ -236,53 +192,44 @@ export class PageHelpContentsComponent implements OnInit {
if (this.selectedPageId) { if (this.selectedPageId) {
this.router.navigate(['edit/'], { this.router.navigate(['edit/'], {
queryParams: { queryParams: {
"pageContentId": id, 'pageContentId': id,
"pageId": this.selectedPageId 'pageId': this.selectedPageId
}, relativeTo: this.route }, relativeTo: this.route
}); });
} else { } else {
this.router.navigate(['edit/'], { this.router.navigate(['edit/'], {
queryParams: { queryParams: {
"pageContentId": id 'pageContentId': id
}, relativeTo: this.route }, relativeTo: this.route
}); });
} }
} }
public togglePageHelpContents(status: boolean, ids: string[]) { public togglePageHelpContents(status: boolean, ids: string[]) {
if (!Session.isLoggedIn()) { this.subscriptions.push(this._helpService.togglePageHelpContents(ids, status, this.properties.adminToolsAPIURL, this.portal).subscribe(
this.router.navigate(['/user-info'], { () => {
queryParams: { for (let id of ids) {
"errorCode": LoginErrorCodes.NOT_VALID, let i = this.checkboxes.findIndex(_ => _.pageHelpContent._id == id);
"redirectUrl": this.router.url this.checkboxes[i].pageHelpContent.isActive = status;
} }
}); UIkit.notification('Page content(s) has been <b>successfully updated</b>', {
} else { status: 'success',
this.subscriptions.push(this._helpService.togglePageHelpContents(ids, status, this.properties.adminToolsAPIURL, this.portal).subscribe( timeout: 6000,
() => { pos: 'bottom-right'
for (let id of ids) { });
let i = this.checkboxes.findIndex(_ => _.pageHelpContent._id == id); this.countPageHelpContents();
this.checkboxes[i].pageHelpContent.isActive = status; this.applyCheck(false);
} },
UIkit.notification('Page content(s) has been <b>successfully updated</b>', { error => this.handleUpdateError('System error changing the status of the selected page content(s)', error)
status: 'success', ));
timeout: 6000,
pos: 'bottom-right'
});
this.countPageHelpContents();
this.applyCheck(false);
},
error => this.handleUpdateError('System error changing the status of the selected page content(s)', error)
));
}
} }
public filterPageHelpContent(pageHelpContent: PageHelpContent, filters: PageHelpContentFilterOptions): boolean { public filterPageHelpContent(pageHelpContent: PageHelpContent, filters: PageHelpContentFilterOptions): boolean {
let idFlag = filters.id == '' || (<Page>pageHelpContent.page)._id == filters.id; let idFlag = filters.id == '' || (<Page>pageHelpContent.page)._id == filters.id;
let activeFlag = filters.active == null || pageHelpContent.isActive == filters.active; let activeFlag = filters.active == null || pageHelpContent.isActive == filters.active;
let textFlag = filters.text.toString() == '' || (pageHelpContent.content).match(filters.text) != null let textFlag = filters.text.toString() == '' || (pageHelpContent.content && pageHelpContent.content.match(filters.text) != null)
|| ((<Page>pageHelpContent.page).name).match(filters.text) != null; || (pageHelpContent.page && (<Page>pageHelpContent.page).name && (<Page>pageHelpContent.page).name.match(filters.text) != null);
return idFlag && activeFlag && textFlag; return idFlag && activeFlag && textFlag;
} }
@ -291,20 +238,13 @@ export class PageHelpContentsComponent implements OnInit {
this.checkboxes = []; this.checkboxes = [];
this.pageHelpContents.filter(item => this.filterPageHelpContent(item, this.filters)).forEach( this.pageHelpContents.filter(item => this.filterPageHelpContent(item, this.filters)).forEach(
_ => { _ => {
this.checkboxes.push(<CheckPageHelpContent>{pageHelpContent: _, checked: false}) this.checkboxes.push(<CheckPageHelpContent>{pageHelpContent: _, checked: false});
} }
); );
} }
public filterByPage(event: any) {
if (event.target && event.target.value) {
this.filters.id = event.target.value;
this.applyFilter();
}
}
public filterBySearch(text: string) { public filterBySearch(text: string) {
this.filters.text = new RegExp(text, "i"); this.filters.text = new RegExp(text, 'i');
this.applyFilter(); this.applyFilter();
} }
@ -342,7 +282,7 @@ export class PageHelpContentsComponent implements OnInit {
public reset() { public reset() {
this.selectedKeyword = null; this.selectedKeyword = null;
this.searchInputComponent.reset() this.searchInputComponent.reset();
} }
selectAll() { selectAll() {

View File

@ -5,7 +5,7 @@ import {FormsModule, ReactiveFormsModule} from '@angular/forms';
import {AlertModalModule} from '../../utils/modal/alertModal.module'; import {AlertModalModule} from '../../utils/modal/alertModal.module';
import {PageHelpContentsComponent} from './page-help-contents.component'; import {PageHelpContentsComponent} from './page-help-contents.component';
import {SafeHtmlPipeModule} from '../../utils/pipes/safeHTMLPipe.module'; import {SafeHtmlPipeModule} from '../../utils/pipes/safeHTMLPipe.module';
import {MatSlideToggleModule} from '@angular/material'; import { MatSlideToggleModule } from '@angular/material/slide-toggle';
import {AdminToolServiceModule} from '../../services/adminToolService.module'; import {AdminToolServiceModule} from '../../services/adminToolService.module';
import {InputModule} from '../../sharedComponents/input/input.module'; import {InputModule} from '../../sharedComponents/input/input.module';
import {PageHelpContentsRoutingModule} from './page-help-contents-routing.module'; import {PageHelpContentsRoutingModule} from './page-help-contents-routing.module';

View File

@ -90,20 +90,20 @@
</div> </div>
<div *ngIf="!isPortalAdministrator && ((check.page.top || check.page.bottom || check.page.left || <div *ngIf="!isPortalAdministrator && ((check.page.top || check.page.bottom || check.page.left ||
check.page.right) || pageWithDivIds.includes(check.page._id) )" class="uk-width-1-4"> check.page.right) || pageWithDivIds.includes(check.page._id) )" class="uk-width-1-4">
<div class="title uk-margin-medium-bottom">Helptexts</div> <div class="title uk-margin-medium-bottom">Help texts</div>
<div class=" uk-margin-small-bottom"> <div class=" uk-margin-small-bottom">
<a *ngIf="check.page.top || check.page.bottom || check.page.left || check.page.right" <a *ngIf="check.page.top || check.page.bottom || check.page.left || check.page.right"
class="helpContents" class="helpContents"
[queryParams]="{pageId: check.page._id}" [queryParams]="{pageId: check.page._id}"
routerLink="../helptexts"> routerLink="../helptexts">
Manage page contents Manage page help texts
<span *ngIf="pageHelpContentsCount[check.page._id]">({{pageHelpContentsCount[check.page._id]}})</span> <span *ngIf="pageHelpContentsCount[check.page._id]">({{pageHelpContentsCount[check.page._id]}})</span>
</a> </a>
</div> </div>
<div> <div>
<a *ngIf="pageWithDivIds.includes(check.page._id)" <a *ngIf="pageWithDivIds.includes(check.page._id)"
[queryParams]="{ pageId: check.page._id}" [queryParams]="{ pageId: check.page._id}"
routerLink="../classContents">Manage class contents routerLink="../classContents">Manage class help texts
<span *ngIf="pageClassContentsCount[check.page._id]">({{pageClassContentsCount[check.page._id]}})</span> <span *ngIf="pageClassContentsCount[check.page._id]">({{pageClassContentsCount[check.page._id]}})</span>
</a> </a>
</div> </div>

View File

@ -8,15 +8,14 @@ import {EnvProperties} from '../../utils/properties/env-properties';
import {Session} from '../../login/utils/helper.class'; import {Session} from '../../login/utils/helper.class';
import {LoginErrorCodes} from '../../login/utils/guardHelper.class'; import {LoginErrorCodes} from '../../login/utils/guardHelper.class';
import {UserManagementService} from '../../services/user-management.service'; import {UserManagementService} from '../../services/user-management.service';
import {Subscriber} from "rxjs"; import {Subscriber} from 'rxjs';
import {PortalUtils} from "../portal/portalHelper"; import {PortalUtils} from '../portal/portalHelper';
import {properties} from "../../../../environments/environment"; import {properties} from '../../../../environments/environment';
import {ConnectHelper} from "../../connect/connectHelper"; import {Option} from '../../sharedComponents/input/input.component';
import {Option} from "../../sharedComponents/input/input.component"; import {AlertModal} from '../../utils/modal/alert';
import {AlertModal} from "../../utils/modal/alert"; import {SearchInputComponent} from '../../sharedComponents/search-input/search-input.component';
import {SearchInputComponent} from "../../sharedComponents/search-input/search-input.component"; import {Title} from '@angular/platform-browser';
import {Title} from "@angular/platform-browser"; import {StringUtils} from '../../utils/string-utils.class';
import {StringUtils} from "../../utils/string-utils.class";
declare var UIkit; declare var UIkit;
@ -92,7 +91,6 @@ export class PagesComponent implements OnInit {
this.filterForm.get('type').setValue(params['type']); this.filterForm.get('type').setValue(params['type']);
} }
this.portal = (this.route.snapshot.data.portal) ? this.route.snapshot.data.portal : this.route.snapshot.params[this.route.snapshot.data.param]; this.portal = (this.route.snapshot.data.portal) ? this.route.snapshot.data.portal : this.route.snapshot.params[this.route.snapshot.data.param];
ConnectHelper.setPortalTypeFromPid(this.portal);
if (this.route.snapshot.data.portal) { if (this.route.snapshot.data.portal) {
this.title.setTitle(StringUtils.capitalize(this.portal) + ' | Pages'); this.title.setTitle(StringUtils.capitalize(this.portal) + ' | Pages');
} else if (this.route.snapshot.params[this.route.snapshot.data.param]) { } else if (this.route.snapshot.params[this.route.snapshot.data.param]) {
@ -347,8 +345,7 @@ export class PagesComponent implements OnInit {
} }
public filterPages(page: Page): boolean { public filterPages(page: Page): boolean {
let textFlag = this.searchText.toString() == '' || (page.route + ' ' + page.name + ' ' + page.portalType).match(this.searchText) != null; return this.searchText.toString() == '' || (page.route + ' ' + page.name + ' ' + page.portalType).match(this.searchText) != null;
return textFlag;
} }
handleError(message: string, error) { handleError(message: string, error) {
@ -394,11 +391,6 @@ export class PagesComponent implements OnInit {
return ''; return '';
} }
// public filterByPortal(event: any) {
// this.portal = event.target.value;
// this.applyPortalFilter(this.portal);
// }
public applyPortalFilter(portal: string) { public applyPortalFilter(portal: string) {
this.getPages(portal); this.getPages(portal);
} }
@ -425,10 +417,6 @@ export class PagesComponent implements OnInit {
} }
} }
public capitalizeFirstLetter(str: string) {
return str.charAt(0).toUpperCase() + str.slice(1);
}
public onSearchClose() { public onSearchClose() {
this.selectedKeyword = this.filterForm.get('keyword').value; this.selectedKeyword = this.filterForm.get('keyword').value;
} }
@ -439,7 +427,7 @@ export class PagesComponent implements OnInit {
} }
selectAll() { selectAll() {
let checked = !!(this.getSelectedPages().length != this.checkboxes.length); let checked = this.getSelectedPages().length != this.checkboxes.length;
for (let check of this.checkboxes) { for (let check of this.checkboxes) {
check.checked = checked; check.checked = checked;
} }

View File

@ -4,7 +4,10 @@ import {CommonModule} from '@angular/common';
import {FormsModule, ReactiveFormsModule} from '@angular/forms'; import {FormsModule, ReactiveFormsModule} from '@angular/forms';
import {AlertModalModule} from '../../utils/modal/alertModal.module'; import {AlertModalModule} from '../../utils/modal/alertModal.module';
import {PagesComponent} from './pages.component'; import {PagesComponent} from './pages.component';
import {MatAutocompleteModule, MatChipsModule, MatFormFieldModule, MatSlideToggleModule} from '@angular/material'; import { MatAutocompleteModule } from '@angular/material/autocomplete';
import { MatChipsModule } from '@angular/material/chips';
import { MatFormFieldModule } from '@angular/material/form-field';
import { MatSlideToggleModule } from '@angular/material/slide-toggle';
import {AdminToolServiceModule} from "../../services/adminToolService.module"; import {AdminToolServiceModule} from "../../services/adminToolService.module";
import {InputModule} from "../../sharedComponents/input/input.module"; import {InputModule} from "../../sharedComponents/input/input.module";
import {AdminTabsModule} from "../sharedComponents/admin-tabs/admin-tabs.module"; import {AdminTabsModule} from "../sharedComponents/admin-tabs/admin-tabs.module";

View File

@ -1,5 +1,4 @@
import {Component, Input, OnChanges, OnDestroy, OnInit, SimpleChanges, ViewChild} from '@angular/core'; import {Component, Input, OnChanges, OnDestroy, OnInit, SimpleChanges, ViewChild} from '@angular/core';
import {Subscription} from 'rxjs/Rx';
import {FormBuilder, FormControl, FormGroup, Validators} from '@angular/forms'; import {FormBuilder, FormControl, FormGroup, Validators} from '@angular/forms';
import {AlertModal} from "../../../utils/modal/alert"; import {AlertModal} from "../../../utils/modal/alert";
import {UserRegistryService} from "../../../services/user-registry.service"; import {UserRegistryService} from "../../../services/user-registry.service";
@ -10,7 +9,7 @@ import {UserManagementService} from "../../../services/user-management.service";
import {Router} from "@angular/router"; import {Router} from "@angular/router";
import {StringUtils} from "../../../utils/string-utils.class"; import {StringUtils} from "../../../utils/string-utils.class";
import {NotificationService} from "../../../notifications/notification.service"; import {NotificationService} from "../../../notifications/notification.service";
import {Affiliation} from "../../../utils/entities/CuratorInfo"; import {Subscription} from "rxjs";
declare var UIkit; declare var UIkit;

View File

@ -8,7 +8,6 @@ import {
SimpleChanges, SimpleChanges,
ViewChild ViewChild
} from '@angular/core'; } from '@angular/core';
import {Subscription} from 'rxjs/Rx';
import {AbstractControl, FormBuilder, FormGroup, Validators} from '@angular/forms'; import {AbstractControl, FormBuilder, FormGroup, Validators} from '@angular/forms';
import {AlertModal} from "../../../utils/modal/alert"; import {AlertModal} from "../../../utils/modal/alert";
import {UserRegistryService} from "../../../services/user-registry.service"; import {UserRegistryService} from "../../../services/user-registry.service";
@ -18,7 +17,7 @@ import {Role, Session, User} from "../../../login/utils/helper.class";
import {UserManagementService} from "../../../services/user-management.service"; import {UserManagementService} from "../../../services/user-management.service";
import {Router} from "@angular/router"; import {Router} from "@angular/router";
import {SubscriberInviteComponent} from "../../../sharedComponents/subscriber-invite/subscriber-invite.component"; import {SubscriberInviteComponent} from "../../../sharedComponents/subscriber-invite/subscriber-invite.component";
import {zip} from "rxjs"; import {Subscription, zip} from "rxjs";
declare var UIkit; declare var UIkit;

View File

@ -2,9 +2,10 @@ import {Component, Inject, Input, Optional} from '@angular/core';
import {Location} from '@angular/common'; import {Location} from '@angular/common';
import {ActivatedRoute} from '@angular/router'; import {ActivatedRoute} from '@angular/router';
import {Title, Meta} from '@angular/platform-browser'; import {Title, Meta} from '@angular/platform-browser';
import {RESPONSE} from "@nguniversal/express-engine/tokens";
import {SEOService} from "../sharedComponents/SEO/SEO.service"; import {SEOService} from "../sharedComponents/SEO/SEO.service";
import {properties} from "../../../environments/environment"; import {properties} from "../../../environments/environment";
import {RESPONSE} from '../utils/tokens';
import {Response} from 'express';
@Component({ @Component({
selector: 'error', selector: 'error',
@ -49,7 +50,7 @@ export class ErrorPageComponent {
constructor (private _location: Location, private _meta: Meta, constructor (private _location: Location, private _meta: Meta,
private _title: Title, private route: ActivatedRoute, private _title: Title, private route: ActivatedRoute,
@Optional() @Inject(RESPONSE) private response: any, @Optional() @Inject(RESPONSE) private response: Response,
private seoService: SEOService) {} private seoService: SEOService) {}
ngOnInit() { ngOnInit() {

View File

@ -1,7 +1,7 @@
import {Observable} from 'rxjs'; import {Observable} from 'rxjs';
import {take, tap} from 'rxjs/operators'; import {take, tap} from 'rxjs/operators';
import {Injectable} from '@angular/core'; import {Injectable} from '@angular/core';
import {ActivatedRouteSnapshot, CanActivate, Data, Router, RouterStateSnapshot} from '@angular/router'; import {ActivatedRouteSnapshot, CanActivate, Data, Router, RouterStateSnapshot, UrlTree} from '@angular/router';
import {ConfigurationService} from '../utils/configuration/configuration.service'; import {ConfigurationService} from '../utils/configuration/configuration.service';
import {ConnectHelper} from '../connect/connectHelper'; import {ConnectHelper} from '../connect/connectHelper';
import {properties} from "../../../environments/environment"; import {properties} from "../../../environments/environment";
@ -10,28 +10,29 @@ import {properties} from "../../../environments/environment";
export class IsRouteEnabled implements CanActivate { export class IsRouteEnabled implements CanActivate {
constructor(private router: Router, constructor(private router: Router,
private config: ConfigurationService) {} private config: ConfigurationService) {
}
check(data: Data, path: string): Observable<boolean> | boolean { check(data: Data, path: string): Observable<boolean> | boolean {
const customRedirect = data['redirect']; const customRedirect = data['redirect'];
const redirect = customRedirect ? customRedirect : '/error'; const redirect = customRedirect ? customRedirect : '/error';
let community = ConnectHelper.getCommunityFromDomain(properties.domain); let community = ConnectHelper.getCommunityFromDomain(properties.domain);
if (!community && data['community']) { // for openaire or connect if (!community && data['community']) { // for openaire or connect
community = data['community']; community = data['community'];
} }
if (!community) { if (!community) {
community = properties.adminToolsCommunity; community = properties.adminToolsCommunity;
} }
return this.config.isPageEnabledByState(properties, community, '/'+path).pipe(take(1),tap((enabled) => { return this.config.isPageEnabledByState(properties, community, '/' + path).pipe(take(1), tap((enabled) => {
if(!enabled){ if (!enabled) {
this.router.navigate([redirect], {queryParams: {'page': path}}); this.router.navigate([redirect], {queryParams: {'page': path}});
} }
})); }));
} }
canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<boolean> | boolean { canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<boolean | UrlTree> | Promise<boolean | UrlTree> | boolean | UrlTree {
return this.check(route.data, state.url); return this.check(route.data, state.url);
} }
} }

View File

@ -121,25 +121,25 @@
<showPublisher [journal]="dataProviderInfo.journal" [properties]="properties"></showPublisher> <showPublisher [journal]="dataProviderInfo.journal" [properties]="properties"></showPublisher>
</ul> </ul>
<div *ngIf="hasAggregationStatusInfo" <div *ngIf="hasAggregationStatusInfo || dataProviderInfo.fundedContent"
class="uk-margin-medium-bottom uk-animation-fade uk-animation-fast"> class="uk-margin-medium-bottom uk-animation-fade uk-animation-fast">
<span *ngIf="dataProviderInfo.aggregationStatus.fulltexts && dataProviderInfo.aggregationStatus.fulltexts != -1" <span *ngIf="dataProviderInfo.aggregationStatus?.fulltexts && dataProviderInfo.aggregationStatus?.fulltexts != -1"
class="uk-margin-right"> class="uk-margin-right">
<span class="uk-text-muted">Collected full-texts: </span> <span class="uk-text-muted">Collected full-texts: </span>
{{dataProviderInfo.aggregationStatus.fulltexts | number}} {{dataProviderInfo.aggregationStatus.fulltexts | number}}
</span> </span>
<span *ngIf="dataProviderInfo.aggregationStatus.fundedContent && dataProviderInfo.aggregationStatus.fundedContent != -1" <span *ngIf="dataProviderInfo.fundedContent && dataProviderInfo.fundedContent > 0"
class="uk-display-inline-block"> class="uk-display-inline-block">
<span class="uk-text-muted">Results with funding information: </span> <span class="uk-text-muted">Results with funding information: </span>
{{dataProviderInfo.aggregationStatus.fundedContent | number}} {{dataProviderInfo.fundedContent | number}}
</span>
<span *ngIf="dataProviderInfo.aggregationStatus.lastUpdateDate"
class="uk-display-inline-block">
<span class="uk-text-muted">Latest data aggregation: </span>
{{dataProviderInfo.aggregationStatus.lastUpdateDate | date}}
</span> </span>
<!-- <span *ngIf="dataProviderInfo.aggregationStatus.lastUpdateDate"-->
<!-- class="uk-display-inline-block">-->
<!-- <span class="uk-text-muted">Latest data aggregation: </span>-->
<!-- {{dataProviderInfo.aggregationStatus.lastUpdateDate | date}}-->
<!-- </span>-->
</div> </div>
<div *ngIf="!aggregationStatusIsInitialized" <div *ngIf="!aggregationStatusIsInitialized || !dataProviderInfo.fundedContent"
class="uk-animation-fade uk-margin-top uk-width-1-1" role="alert"> class="uk-animation-fade uk-margin-top uk-width-1-1" role="alert">
<span class="loading-gif uk-align-center"></span> <span class="loading-gif uk-align-center"></span>
</div> </div>
@ -480,7 +480,7 @@
<div class="uk-margin-small-top uk-flex"> <div class="uk-margin-small-top uk-flex">
<!-- Last Index Info--> <!-- Last Index Info-->
<div class="uk-width-2-3@m uk-width-1-2"> <div class="uk-width-2-3@m uk-width-1-2">
<img src="assets/common-assets/graph.svg" style="opacity: 0.4"> <img src="assets/common-assets/graph.svg" style="opacity: 0.4" loading="lazy">
<span class="uk-margin-small-left uk-text-baseline uk-text-muted">Powered by <a href="https://graph.openaire.eu" class="graph-color">OpenAIRE Research Graph</a></span> <span class="uk-margin-small-left uk-text-baseline uk-text-muted">Powered by <a href="https://graph.openaire.eu" class="graph-color">OpenAIRE Research Graph</a></span>
<span *ngIf="indexUpdateDate" class="uk-text-baseline uk-text-muted"> <span *ngIf="indexUpdateDate" class="uk-text-baseline uk-text-muted">
. Last update of records in OpenAIRE: {{indexUpdateDate | date: 'MMM dd, yyyy'}} . Last update of records in OpenAIRE: {{indexUpdateDate | date: 'MMM dd, yyyy'}}

View File

@ -229,6 +229,7 @@ export class DataProviderComponent {
this.seoService.createLinkForCanonicalURL(this.properties.domain +this.properties.baseLink + this._router.url); this.seoService.createLinkForCanonicalURL(this.properties.domain +this.properties.baseLink + this._router.url);
if (typeof document !== 'undefined') { if (typeof document !== 'undefined') {
this.getDataProviderAggregationStatus(this.dataProviderInfo.originalId); this.getDataProviderAggregationStatus(this.dataProviderInfo.originalId);
this.countResultsWithFundingInfo();
} else { } else {
this.aggregationStatusIsInitialized = true; this.aggregationStatusIsInitialized = true;
} }
@ -280,6 +281,18 @@ export class DataProviderComponent {
} }
)); ));
} }
private countResultsWithFundingInfo() {
this.subscriptions.push(this._searchResearchResultsService.countCollectedResultsWithFundingInfo(this.datasourceId).subscribe(
fundedContent => {
this.dataProviderInfo.fundedContent = fundedContent;
console.log(this.dataProviderInfo.fundedContent);
},
err => {
this.handleError("Error getting results with funding information for datasource id: " + this.datasourceId, err);
}
))
}
private updateDescription(description: string) { private updateDescription(description: string) {
this._meta.updateTag({content: description.substring(0, 160)}, "name='description'"); this._meta.updateTag({content: description.substring(0, 160)}, "name='description'");
@ -607,12 +620,15 @@ export class DataProviderComponent {
} }
public get hasAggregationStatusInfo(): boolean { public get hasAggregationStatusInfo(): boolean {
// return (!!this.dataProviderInfo.aggregationStatus &&
// ((!!this.dataProviderInfo.aggregationStatus.fulltexts && parseInt(this.dataProviderInfo.aggregationStatus.fulltexts) != -1)
// || (!!this.dataProviderInfo.aggregationStatus.fundedContent && parseInt(this.dataProviderInfo.aggregationStatus.fundedContent) != -1)
// || !!this.dataProviderInfo.aggregationStatus.lastUpdateDate));
return (!!this.dataProviderInfo.aggregationStatus && return (!!this.dataProviderInfo.aggregationStatus &&
((!!this.dataProviderInfo.aggregationStatus.fulltexts && parseInt(this.dataProviderInfo.aggregationStatus.fulltexts) != -1) ((!!this.dataProviderInfo.aggregationStatus.fulltexts && parseInt(this.dataProviderInfo.aggregationStatus.fulltexts) != -1)));
|| (!!this.dataProviderInfo.aggregationStatus.fundedContent && parseInt(this.dataProviderInfo.aggregationStatus.fundedContent) != -1)
|| !!this.dataProviderInfo.aggregationStatus.lastUpdateDate));
} }
public get hasJournalInfo(): boolean { public get hasJournalInfo(): boolean {
return (!!this.dataProviderInfo.journal && ( return (!!this.dataProviderInfo.journal && (
!!this.dataProviderInfo.journal['journal'] || !!this.dataProviderInfo.journal['issn'] || !!this.dataProviderInfo.journal['journal'] || !!this.dataProviderInfo.journal['issn'] ||

View File

@ -36,18 +36,22 @@ export class DataProviderService {
//let headers = new Headers({'Content-Type': 'application/json', 'accept': 'application/json'}); //let headers = new Headers({'Content-Type': 'application/json', 'accept': 'application/json'});
//let options = new RequestOptions({headers: headers}); //let options = new RequestOptions({headers: headers});
const options = { // const options = {
headers: new HttpHeaders({ // headers: new HttpHeaders({
'Content-Type': 'application/json', // 'Content-Type': 'application/json',
'accept': 'application/json'}) // 'accept': 'application/json'})
}; // };
//
// let page: number = 0;
// let size: number = 1;
// return this.http.post(properties.datasourcesAPI+page+"/"+size+"?requestSortBy=id&order=ASCENDING", JSON.stringify({ "id": original_id }), options)
// //.map(res => <any> res.json())
// .pipe(map(res => res['datasourceInfo']))
// .pipe(map(res => this.parseDataproviderAggregationStatus(res)));
let page: number = 0; return this.http.get(properties.datasourcesAPI+original_id)
let size: number = 1; .pipe(map(res => res['api']))
return this.http.post(properties.datasourcesAPI+page+"/"+size+"?requestSortBy=id&order=ASCENDING", JSON.stringify({ "id": original_id }), options) .pipe(map(res => this.parseDataproviderAggregationStatus(res)));
//.map(res => <any> res.json())
.pipe(map(res => res['datasourceInfo']))
.pipe(map(res => this.parseDataproviderAggregationStatus(res)));
} }
private handleError (error: HttpErrorResponse) { private handleError (error: HttpErrorResponse) {
@ -57,27 +61,44 @@ export class DataProviderService {
return throwError(error || 'Server error'); return throwError(error || 'Server error');
} }
parseDataproviderAggregationStatus(data: any): any { parseDataproviderAggregationStatus(apis: any): any {
var aggregationStatus: {"fundedContent": string, "indexRecords": string, "fulltexts": string, "lastUpdateDate": string} = null; // var aggregationStatus: {"fundedContent": string, "indexRecords": string, "fulltexts": string, "lastUpdateDate": string} = null;
if(data != null && data[0] != null) { // if(data != null && data[0] != null) {
aggregationStatus = {"fundedContent": "-1", "indexRecords": "-1", "fulltexts": "-1", "lastUpdateDate": null}; // aggregationStatus = {"fundedContent": "-1", "indexRecords": "-1", "fulltexts": "-1", "lastUpdateDate": null};
aggregationStatus.fundedContent = data[0].fundedContent; // aggregationStatus.fundedContent = data[0].fundedContent;
aggregationStatus.indexRecords = data[0].indexRecords; // aggregationStatus.indexRecords = data[0].indexRecords;
aggregationStatus.fulltexts = data[0].fulltexts; // aggregationStatus.fulltexts = data[0].fulltexts;
//
// if(data[0].hasOwnProperty("aggregationHistory")) {
// let length = Array.isArray(data[0]["aggregationHistory"]) ? data[0]["aggregationHistory"].length : 1;
//
// for(let i=0; i<length; i++) {
// var aggregationHistory = Array.isArray(data[0]["aggregationHistory"]) ? data[0]["aggregationHistory"][i] : data[0]["aggregationHistory"];
// if(aggregationHistory && aggregationHistory.indexedVersion == true) {
// aggregationStatus.lastUpdateDate = aggregationHistory.date;
// break;
// }
// }
// }
// }
if(data[0].hasOwnProperty("aggregationHistory")) { var aggregationStatus: {"fulltexts": string} = null;
let length = Array.isArray(data[0]["aggregationHistory"]) ? data[0]["aggregationHistory"].length : 1; if(apis != null) {
aggregationStatus = {"fulltexts": "-1"};
for(let i=0; i<length; i++) { let mostRecentDate = null;
var aggregationHistory = Array.isArray(data[0]["aggregationHistory"]) ? data[0]["aggregationHistory"][i] : data[0]["aggregationHistory"]; let length = Array.isArray(apis) ? apis.length : 1;
if(aggregationHistory && aggregationHistory.indexedVersion == true) {
aggregationStatus.lastUpdateDate = aggregationHistory.date; for (let i = 0; i < length; i++) {
break; let api = Array.isArray(apis) ? apis[i] : apis;
} if(api.compatibility == "files" && (mostRecentDate == null || mostRecentDate < api.lastDownloadDate)) {
} aggregationStatus.fulltexts = api.lastDownloadTotal;
mostRecentDate = api.lastDownloadDate;
} }
} }
return aggregationStatus; }
return aggregationStatus;
} }
parseDataProviderInfo (data: any):any { parseDataProviderInfo (data: any):any {

View File

@ -9,9 +9,9 @@ import {EmailService} from "../../utils/email/email.service";
import {RecaptchaModule} from "ng-recaptcha"; import {RecaptchaModule} from "ng-recaptcha";
@NgModule({ @NgModule({
imports: [CommonModule, LandingHeaderModule, ReactiveFormsModule, MatSelectModule, AlertModalModule, RecaptchaModule.forRoot()], imports: [CommonModule, LandingHeaderModule, ReactiveFormsModule, MatSelectModule, AlertModalModule, RecaptchaModule],
declarations: [FeedbackComponent], declarations: [FeedbackComponent],
providers: [EmailService], providers: [EmailService],
exports: [FeedbackComponent] exports: [FeedbackComponent]
}) })
export class FeedbackModule {} export class FeedbackModule {}

View File

@ -11,7 +11,7 @@ import {properties} from "../../../../environments/environment";
class="uk-flex uk-flex-top" class="uk-flex uk-flex-top"
[title]="available.bestAccessMode ? available.bestAccessMode : 'Not available'"> [title]="available.bestAccessMode ? available.bestAccessMode : 'Not available'">
<span class="uk-margin-small-right"> <span class="uk-margin-small-right">
<img [src]="available.icon"> <img [src]="available.icon" loading="lazy">
</span> </span>
<div class="uk-width-expand uk-padding-small uk-padding-remove-left uk-padding-remove-vertical"> <div class="uk-width-expand uk-padding-small uk-padding-remove-left uk-padding-remove-vertical">
<span *ngIf="available.downloadUrl.length > 1" class="title"> <span *ngIf="available.downloadUrl.length > 1" class="title">

View File

@ -3,7 +3,7 @@ import {CommonModule} from '@angular/common';
import {FormsModule} from '@angular/forms'; import {FormsModule} from '@angular/forms';
import {CiteThisComponent} from './citeThis.component'; import {CiteThisComponent} from './citeThis.component';
import {MatSelectModule} from "@angular/material"; import { MatSelectModule } from "@angular/material/select";
@NgModule({ @NgModule({
imports: [ imports: [

View File

@ -15,7 +15,7 @@ import {animate, state, style, transition, trigger} from "@angular/animations";
click-outside-or-esc (clickOutside)="close($event)" click-outside-or-esc (clickOutside)="close($event)"
id="metrics" targetId="metrics"> id="metrics" targetId="metrics">
<div class="m-badge clickable" (click)="toggle($event)"> <div class="m-badge clickable" (click)="toggle($event)">
<img src="assets/common-assets/logo-small-usage-counts.png"> <img src="assets/common-assets/logo-small-usage-counts.png" loading="lazy">
<div class="number">{{total | number}}</div> <div class="number">{{total | number}}</div>
</div> </div>
<div class="widget" [@widget]="state.toString()"> <div class="widget" [@widget]="state.toString()">
@ -101,7 +101,7 @@ import {animate, state, style, transition, trigger} from "@angular/animations";
<div class="footer uk-flex uk-flex-middle" [@footer]="state.toString()"> <div class="footer uk-flex uk-flex-middle" [@footer]="state.toString()">
<span>Powered by</span> <span>Powered by</span>
<a href="https://usagecounts.openaire.eu" target="_blank"> <a href="https://usagecounts.openaire.eu" target="_blank">
<img width="120" src="assets/common-assets/logo-large-usage-counts.png"> <img width="120" src="assets/common-assets/logo-large-usage-counts.png" loading="lazy">
</a> </a>
</div> </div>
</div> </div>

View File

@ -1,6 +1,10 @@
import {HostedByCollectedFrom, Journal, Project, RelationResult} from "../../utils/result-preview/result-preview"; import {HostedByCollectedFrom, Journal, Project, RelationResult} from "../../utils/result-preview/result-preview";
import {Reference} from "../../utils/entities/resultLandingInfo"; import {Reference} from "../../utils/entities/resultLandingInfo";
import {Injectable} from '@angular/core';
@Injectable({
providedIn: 'root'
})
export class ParsingFunctions { export class ParsingFunctions {
public open = 'assets/common-assets/unlock.svg'; public open = 'assets/common-assets/unlock.svg';
public closed = 'assets/common-assets/lock.svg'; public closed = 'assets/common-assets/lock.svg';

View File

@ -61,7 +61,7 @@ import {EnvProperties} from "../../utils/properties/env-properties";
<a target="_blank" class="uk-display-inline-block" <a target="_blank" class="uk-display-inline-block"
[href]="properties.sherpaURL+(journal['issn']?journal['issn']:(journal['eissn']?journal['eissn']:journal['lissn'] ))+properties.sherpaURLSuffix" [href]="properties.sherpaURL+(journal['issn']?journal['issn']:(journal['eissn']?journal['eissn']:journal['lissn'] ))+properties.sherpaURLSuffix"
uk-tooltip="title: View information on Sherpa/RoMEO "> uk-tooltip="title: View information on Sherpa/RoMEO ">
<img src="assets/common-assets/common/SHERPA-RoMEO-short-logo.gif" width=16 height=16 alt=""> <img src="assets/common-assets/common/SHERPA-RoMEO-short-logo.gif" width=16 height=16 alt="" loading="lazy">
Copyright policy<span class="custom-external custom-icon space"></span> Copyright policy<span class="custom-external custom-icon space"></span>
</a> </a>
</span> </span>

View File

@ -251,7 +251,7 @@
<div class="uk-margin-small-top uk-flex"> <div class="uk-margin-small-top uk-flex">
<!-- Last Index Info--> <!-- Last Index Info-->
<div class="uk-width-2-3@m uk-width-1-2"> <div class="uk-width-2-3@m uk-width-1-2">
<img src="assets/common-assets/graph.svg" style="opacity: 0.4"> <img src="assets/common-assets/graph.svg" style="opacity: 0.4" loading="lazy">
<span class="uk-margin-small-left uk-text-baseline uk-text-muted">Powered by <a href="https://graph.openaire.eu" class="graph-color">OpenAIRE Research Graph</a></span> <span class="uk-margin-small-left uk-text-baseline uk-text-muted">Powered by <a href="https://graph.openaire.eu" class="graph-color">OpenAIRE Research Graph</a></span>
<span *ngIf="indexUpdateDate" class="uk-text-baseline uk-text-muted"> <span *ngIf="indexUpdateDate" class="uk-text-baseline uk-text-muted">
. Last update of records in OpenAIRE: {{indexUpdateDate | date: 'MMM dd, yyyy'}} . Last update of records in OpenAIRE: {{indexUpdateDate | date: 'MMM dd, yyyy'}}

View File

@ -734,7 +734,7 @@
<div class="uk-margin-small-top uk-flex"> <div class="uk-margin-small-top uk-flex">
<!-- Last Index Info--> <!-- Last Index Info-->
<div class="uk-width-2-3@m uk-width-1-2"> <div class="uk-width-2-3@m uk-width-1-2">
<img src="assets/common-assets/graph.svg" style="opacity: 0.4"> <img src="assets/common-assets/graph.svg" style="opacity: 0.4" loading="lazy">
<span class="uk-margin-small-left uk-text-baseline uk-text-muted">Powered by <a <span class="uk-margin-small-left uk-text-baseline uk-text-muted">Powered by <a
href="https://graph.openaire.eu" class="graph-color">OpenAIRE Research Graph</a></span> href="https://graph.openaire.eu" class="graph-color">OpenAIRE Research Graph</a></span>
<span *ngIf="indexUpdateDate" class="uk-text-baseline uk-text-muted"> <span *ngIf="indexUpdateDate" class="uk-text-baseline uk-text-muted">

View File

@ -3,7 +3,7 @@ import {NgModule} from '@angular/core';
import {CommonModule} from '@angular/common'; import {CommonModule} from '@angular/common';
import {FormsModule} from '@angular/forms'; import {FormsModule} from '@angular/forms';
import {RouterModule} from '@angular/router'; import {RouterModule} from '@angular/router';
import {MatSelectModule} from "@angular/material"; import { MatSelectModule } from "@angular/material/select";
import {ProjectComponent} from './project.component'; import {ProjectComponent} from './project.component';
import {ProjectServiceModule} from './projectService.module'; import {ProjectServiceModule} from './projectService.module';

View File

@ -107,7 +107,7 @@
<li *ngIf="properties.b2noteAPIURL"> <li *ngIf="properties.b2noteAPIURL">
<a *ngIf="isLoggedIn && pid" class="uk-link-text uk-text-bold uk-text-uppercase" (click)="annotation.toggleAnnotation($event)"> <a *ngIf="isLoggedIn && pid" class="uk-link-text uk-text-bold uk-text-uppercase" (click)="annotation.toggleAnnotation($event)">
<span class="uk-icon-button uk-button-primary uk-icon"> <span class="uk-icon-button uk-button-primary uk-icon">
<img src="assets/common-assets/b2note.png"> <img src="assets/common-assets/b2note.png" loading="lazy">
</span> </span>
<span class="uk-margin-small-left">add annotation</span> <span class="uk-margin-small-left">add annotation</span>
</a> </a>
@ -115,7 +115,7 @@
[attr.uk-tooltip]="!pid?'Annotations are available only for resources with a PID (persistent identifier) like DOI, handle, PMID': [attr.uk-tooltip]="!pid?'Annotations are available only for resources with a PID (persistent identifier) like DOI, handle, PMID':
'Annotations are available only for logged in users'"> 'Annotations are available only for logged in users'">
<span class="uk-icon-button uk-button-primary uk-icon uk-disabled"> <span class="uk-icon-button uk-button-primary uk-icon uk-disabled">
<img src="assets/common-assets/b2note.png"> <img src="assets/common-assets/b2note.png" loading="lazy">
</span> </span>
<span class="uk-margin-small-left">add annotation</span> <span class="uk-margin-small-left">add annotation</span>
</span> </span>
@ -423,7 +423,8 @@
<ng-template #enermaps_tab> <ng-template #enermaps_tab>
<div class="uk-padding"> <div class="uk-padding">
<div class=" uk-inline uk-width-expand uk-text-center "> <div class=" uk-inline uk-width-expand uk-text-center ">
<img class="uk-width-auto" [src]="properties.enermapsURL +'/images/' + enermapsId + '.png'" alt="Enermaps tool preview"> <img class="uk-width-auto" [src]="properties.enermapsURL +'/images/' + enermapsId + '.png'"
alt="Enermaps tool preview" loading="lazy">
<div class="uk-overlay uk-overlay-default uk-position-bottom"> <div class="uk-overlay uk-overlay-default uk-position-bottom">
<p>Visit <a <p>Visit <a
class=" uk-margin-right uk-margin-small-top" class=" uk-margin-right uk-margin-small-top"
@ -523,7 +524,7 @@
<div class="uk-margin-small-top uk-flex"> <div class="uk-margin-small-top uk-flex">
<!-- Last Index Info--> <!-- Last Index Info-->
<div class="uk-width-2-3@m uk-width-1-2"> <div class="uk-width-2-3@m uk-width-1-2">
<img src="assets/common-assets/graph.svg" style="opacity: 0.4"> <img src="assets/common-assets/graph.svg" style="opacity: 0.4" loading="lazy">
<span class="uk-margin-small-left uk-text-baseline uk-text-muted">Powered by <a href="https://graph.openaire.eu" class="graph-color">OpenAIRE Research Graph</a></span> <span class="uk-margin-small-left uk-text-baseline uk-text-muted">Powered by <a href="https://graph.openaire.eu" class="graph-color">OpenAIRE Research Graph</a></span>
<span *ngIf="indexUpdateDate" class="uk-text-baseline uk-text-muted"> <span *ngIf="indexUpdateDate" class="uk-text-baseline uk-text-muted">
. Last update of records in OpenAIRE: {{indexUpdateDate | date: 'MMM dd, yyyy'}} . Last update of records in OpenAIRE: {{indexUpdateDate | date: 'MMM dd, yyyy'}}

View File

@ -661,7 +661,7 @@ export class ResultLandingComponent {
); );
// console.log("rich content " + allow) // console.log("rich content " + allow)
//spam words to exclude //spam words to exclude
let title_authors_words = ["movie","hd","film","kimetsu", "1080p","4k","call of duty", "mobile hack", "TUBYDI"]; let title_authors_words = ["movie","hd","film","kimetsu", "1080p","4k","call of duty", "mobile hack", "TUBYDI", "电影","電影"];
let abstract_words = ["operacao-feliz-natal.blogspot.com", "moviedouban.site", "hack-expert-solution.link"]; let abstract_words = ["operacao-feliz-natal.blogspot.com", "moviedouban.site", "hack-expert-solution.link"];
allow = allow && !( allow = allow && !(
(this.hasKeyword(this.resultLandingInfo.title,title_authors_words) || (this.resultLandingInfo.authors && this.hasKeyword(this.resultLandingInfo.authors.map(o => o.fullName).join(" "),title_authors_words)) (this.hasKeyword(this.resultLandingInfo.title,title_authors_words) || (this.resultLandingInfo.authors && this.hasKeyword(this.resultLandingInfo.authors.map(o => o.fullName).join(" "),title_authors_words))

View File

@ -40,7 +40,7 @@ export class AdminLoginGuard implements CanActivate, CanActivateChild {
} }
canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<boolean> | boolean { canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<boolean | UrlTree> | Promise<boolean | UrlTree> | boolean | UrlTree {
return this.check(state.url); return this.check(state.url);
} }

View File

@ -1,5 +1,5 @@
import {Injectable} from '@angular/core'; import {Injectable} from '@angular/core';
import {ActivatedRouteSnapshot, CanActivate, Router, RouterStateSnapshot} from '@angular/router'; import {ActivatedRouteSnapshot, CanActivate, Router, RouterStateSnapshot, UrlTree} from '@angular/router';
import {Observable} from 'rxjs'; import {Observable} from 'rxjs';
import {Session} from './utils/helper.class'; import {Session} from './utils/helper.class';
import {LoginErrorCodes} from './utils/guardHelper.class'; import {LoginErrorCodes} from './utils/guardHelper.class';
@ -32,7 +32,7 @@ export class ClaimsCuratorGuard implements CanActivate {
})); }));
} }
canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<boolean> | boolean { canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<boolean | UrlTree> | Promise<boolean | UrlTree> | boolean | UrlTree {
return this.check(state.url); return this.check(state.url);
} }

View File

@ -4,6 +4,7 @@ import {
CanActivate, CanActivate,
ActivatedRouteSnapshot, ActivatedRouteSnapshot,
RouterStateSnapshot, RouterStateSnapshot,
UrlTree
} from '@angular/router'; } from '@angular/router';
import {Observable} from 'rxjs'; import {Observable} from 'rxjs';
import {LoginErrorCodes} from './utils/guardHelper.class'; import {LoginErrorCodes} from './utils/guardHelper.class';
@ -22,7 +23,7 @@ export class FreeGuard implements CanActivate {
return valid; return valid;
} }
canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<boolean> | boolean { canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<boolean | UrlTree> | Promise<boolean | UrlTree> | boolean | UrlTree {
return this.check(state.url); return this.check(state.url);
} }

View File

@ -8,7 +8,7 @@ import {
Router, Router,
RouterStateSnapshot, UrlTree RouterStateSnapshot, UrlTree
} from '@angular/router'; } from '@angular/router';
import {Observable} from 'rxjs/Observable'; import {Observable} from 'rxjs';
import {Session} from './utils/helper.class'; import {Session} from './utils/helper.class';
import {LoginErrorCodes} from './utils/guardHelper.class'; import {LoginErrorCodes} from './utils/guardHelper.class';
import {map, tap} from "rxjs/operators"; import {map, tap} from "rxjs/operators";
@ -41,7 +41,7 @@ export class LoginGuard implements CanActivate, CanLoad, CanActivateChild {
} }
} }
canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<boolean> | boolean { canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<boolean | UrlTree> | Promise<boolean | UrlTree> | boolean | UrlTree {
return this.check(state.url); return this.check(state.url);
} }

View File

@ -54,9 +54,8 @@
</form--> </form-->
<div *ngIf="errorCode == '1'" class="uk-alert uk-alert-warning"> <div *ngIf="errorCode == '1'" class="uk-alert uk-alert-warning">
The requested page requires authentication. The requested page requires authentication.
<span *ngIf="!loggedIn"> <span *ngIf="!loggedIn">Please <a class="uk-link" (click)="logIn()"> sign in</a> to continue.
Please <a class="" (click)="logIn()"> sign in</a> to continue. </span>
</span>
</div> </div>
<div *ngIf="errorCode == '2' || errorCode == '4' || errorCode == '8'" class="uk-alert uk-alert-warning"> <div *ngIf="errorCode == '2' || errorCode == '4' || errorCode == '8'" class="uk-alert uk-alert-warning">
You are not authorized to use the requested page. You are not authorized to use the requested page.

View File

@ -8,7 +8,7 @@
text-align: center; text-align: center;
padding-bottom: 5%; padding-bottom: 5%;
position: absolute; position: absolute;
background-image: url("/assets/common-assets/monitor-assets/green-arrows/1.svg"); background-image: url("~src/assets/common-assets/monitor-assets/green-arrows/1.svg");
right: -21%; right: -21%;
top: 33%; top: 33%;
width: 20%; width: 20%;
@ -27,7 +27,7 @@
text-align: center; text-align: center;
padding-bottom: 5%; padding-bottom: 5%;
position: absolute; position: absolute;
background-image: url("/assets/common-assets/monitor-assets/green-arrows/2.svg"); background-image: url("~src/assets/common-assets/monitor-assets/green-arrows/2.svg");
right: -10%; right: -10%;
top: 31%; top: 31%;
width: 30%; width: 30%;
@ -50,7 +50,7 @@
padding-top: 5%; padding-top: 5%;
padding-bottom: 5%; padding-bottom: 5%;
position: absolute; position: absolute;
background-image: url("/assets/common-assets/monitor-assets/green-arrows/3.svg"); background-image: url("~src/assets/common-assets/monitor-assets/green-arrows/3.svg");
bottom: 6%; bottom: 6%;
left: 6%; left: 6%;
transform: translateY(100%); transform: translateY(100%);
@ -74,7 +74,7 @@
text-align: center; text-align: center;
padding-bottom: 5%; padding-bottom: 5%;
position: absolute; position: absolute;
background-image: url("/assets/common-assets/monitor-assets/green-arrows/4.svg"); background-image: url("~src/assets/common-assets/monitor-assets/green-arrows/4.svg");
left: -18%; left: -18%;
top: 35%; top: 35%;
width: 30%; width: 30%;
@ -96,7 +96,7 @@
text-align: center; text-align: center;
padding-bottom: 5%; padding-bottom: 5%;
position: absolute; position: absolute;
background-image: url("/assets/common-assets/monitor-assets/green-arrows/5.svg"); background-image: url("~src/assets/common-assets/monitor-assets/green-arrows/5.svg");
left: -35%; left: -35%;
top: 36%; top: 36%;
width: 30%; width: 30%;
@ -124,7 +124,7 @@
.how .final > div:first-child:before { .how .final > div:first-child:before {
content: ""; content: "";
position: absolute; position: absolute;
background-image: url("/assets/common-assets/monitor-assets/green-arrows/6.svg"); background-image: url("~src/assets/common-assets/monitor-assets/green-arrows/6.svg");
left: -20%; left: -20%;
top: -20%; top: -20%;
height: 70%; height: 70%;
@ -137,7 +137,7 @@
.how .final > div:first-child:after { .how .final > div:first-child:after {
content: "We make visualizations, graphs, reports and deliver all in a customisable tool"; content: "We make visualizations, graphs, reports and deliver all in a customisable tool";
position: absolute; position: absolute;
background-image: url("/assets/common-assets/monitor-assets/how/circle.png"); background-image: url("~src/assets/common-assets/monitor-assets/how/circle.png");
right: -220px; right: -220px;
top: -20%; top: -20%;
width: 300px; width: 300px;
@ -173,7 +173,7 @@
text-align: center; text-align: center;
padding: 25px 105px 25px 0; padding: 25px 105px 25px 0;
position: absolute; position: absolute;
background-image: url("/assets/common-assets/monitor-assets/green-arrows/3.svg"); background-image: url("~src/assets/common-assets/monitor-assets/green-arrows/3.svg");
left: 26%; left: 26%;
top: 72%; top: 72%;
background-size: contain; background-size: contain;
@ -191,7 +191,7 @@
text-align: center; text-align: center;
padding: 25px 105px 25px 0; padding: 25px 105px 25px 0;
position: absolute; position: absolute;
background-image: url("/assets/common-assets/monitor-assets/green-arrows/3.svg"); background-image: url("~src/assets/common-assets/monitor-assets/green-arrows/3.svg");
left: 25%; left: 25%;
top: 70%; top: 70%;
background-size: contain; background-size: contain;
@ -209,7 +209,7 @@
text-align: center; text-align: center;
padding: 25px 105px 25px 0; padding: 25px 105px 25px 0;
position: absolute; position: absolute;
background-image: url("/assets/common-assets/monitor-assets/green-arrows/3.svg"); background-image: url("~src/assets/common-assets/monitor-assets/green-arrows/3.svg");
left: 17%; left: 17%;
top: 75%; top: 75%;
background-size: contain; background-size: contain;
@ -231,7 +231,7 @@
text-align: center; text-align: center;
padding: 25px 105px 25px 0; padding: 25px 105px 25px 0;
position: absolute; position: absolute;
background-image: url("/assets/common-assets/monitor-assets/green-arrows/3.svg"); background-image: url("~src/assets/common-assets/monitor-assets/green-arrows/3.svg");
left: 26%; left: 26%;
top: 79%; top: 79%;
background-size: contain; background-size: contain;
@ -249,7 +249,7 @@
text-align: center; text-align: center;
padding: 25px 105px 25px 0; padding: 25px 105px 25px 0;
position: absolute; position: absolute;
background-image: url("/assets/common-assets/monitor-assets/green-arrows/3.svg"); background-image: url("~src/assets/common-assets/monitor-assets/green-arrows/3.svg");
left: 27%; left: 27%;
top: 76%; top: 76%;
background-size: contain; background-size: contain;
@ -276,7 +276,7 @@
.how .final > div:first-child:before { .how .final > div:first-child:before {
content: ""; content: "";
position: absolute; position: absolute;
background-image: url("/assets/common-assets/monitor-assets/green-arrows/6.svg"); background-image: url("~src/assets/common-assets/monitor-assets/green-arrows/6.svg");
left: 32%; left: 32%;
top: -80%; top: -80%;
height: 70%; height: 70%;
@ -289,7 +289,7 @@
.how .final > div:first-child:after { .how .final > div:first-child:after {
content: "We make visualizations, graphs, reports and deliver all in a customisable tool"; content: "We make visualizations, graphs, reports and deliver all in a customisable tool";
position: absolute; position: absolute;
background-image: url("/assets/common-assets/monitor-assets/how/circle.png"); background-image: url("~src/assets/common-assets/monitor-assets/how/circle.png");
left: -62%; left: -62%;
top: 85%; top: 85%;
width: 300px; width: 300px;

View File

@ -7,7 +7,7 @@ import {Component} from "@angular/core";
<div class="uk-flex uk-flex-wrap"> <div class="uk-flex uk-flex-wrap">
<div class="uk-width-1-3@s first uk-text-muted"> <div class="uk-width-1-3@s first uk-text-muted">
<div> <div>
<img src="assets/common-assets/monitor-assets/how/1.png"> <img src="assets/common-assets/monitor-assets/how/1.png" loading="lazy">
</div> </div>
<div class="uk-text-center"> <div class="uk-text-center">
<span class="uk-text-bold uk-text-uppercase">Starting</span> from existing<br>research-related data sources <span class="uk-text-bold uk-text-uppercase">Starting</span> from existing<br>research-related data sources
@ -15,12 +15,12 @@ import {Component} from "@angular/core";
</div> </div>
<div class="uk-width-1-3@s second uk-text-muted"> <div class="uk-width-1-3@s second uk-text-muted">
<div> <div>
<img src="assets/common-assets/monitor-assets/how/2.png"> <img src="assets/common-assets/monitor-assets/how/2.png" loading="lazy">
</div> </div>
</div> </div>
<div class="uk-width-1-3@s third uk-text-muted"> <div class="uk-width-1-3@s third uk-text-muted">
<div> <div>
<img src="assets/common-assets/monitor-assets/how/3.png"> <img src="assets/common-assets/monitor-assets/how/3.png" loading="lazy">
</div> </div>
<div class="uk-text-center"> <div class="uk-text-center">
build an open, global<br>and trusted Research graph build an open, global<br>and trusted Research graph
@ -30,7 +30,7 @@ import {Component} from "@angular/core";
<div class="uk-flex uk-flex-wrap"> <div class="uk-flex uk-flex-wrap">
<div class="uk-width-1-3@s fourth uk-flex-last@s uk-text-muted"> <div class="uk-width-1-3@s fourth uk-flex-last@s uk-text-muted">
<div> <div>
<img src="assets/common-assets/monitor-assets/how/4.png"> <img src="assets/common-assets/monitor-assets/how/4.png" loading="lazy">
</div> </div>
<div class="uk-text-center"> <div class="uk-text-center">
we perform <span class="uk-text-bold uk-text-uppercase">Statistical Analysis</span> and produce we perform <span class="uk-text-bold uk-text-uppercase">Statistical Analysis</span> and produce
@ -39,7 +39,7 @@ import {Component} from "@angular/core";
</div> </div>
<div class="uk-width-1-3@s fifth uk-text-muted"> <div class="uk-width-1-3@s fifth uk-text-muted">
<div> <div>
<img src="assets/common-assets/monitor-assets/how/5.png"> <img src="assets/common-assets/monitor-assets/how/5.png" loading="lazy">
</div> </div>
<div class="uk-text-center"> <div class="uk-text-center">
furthermore <span class="uk-text-bold uk-text-uppercase">Network<br>Analysis</span> producing furthermore <span class="uk-text-bold uk-text-uppercase">Network<br>Analysis</span> producing
@ -48,7 +48,7 @@ import {Component} from "@angular/core";
</div> </div>
<div class="uk-width-1-3@s sixth uk-flex-first@s uk-text-muted"> <div class="uk-width-1-3@s sixth uk-flex-first@s uk-text-muted">
<div> <div>
<img src="assets/common-assets/monitor-assets/how/6.png"> <img src="assets/common-assets/monitor-assets/how/6.png" loading="lazy">
</div> </div>
<div class="uk-text-center"> <div class="uk-text-center">
Often combine with external data Often combine with external data
@ -60,7 +60,7 @@ import {Component} from "@angular/core";
</div> </div>
<div class="final uk-text-muted"> <div class="final uk-text-muted">
<div> <div>
<img src="assets/common-assets/monitor-assets/how/7.png"> <img src="assets/common-assets/monitor-assets/how/7.png" loading="lazy">
</div> </div>
</div> </div>
</div> </div>

View File

@ -8,7 +8,6 @@ import {ActivatedRoute} from "@angular/router";
import {properties} from "../../../../environments/environment"; import {properties} from "../../../../environments/environment";
import {CustomOptions} from "../../services/servicesUtils/customOptions.class"; import {CustomOptions} from "../../services/servicesUtils/customOptions.class";
import {StringUtils} from "../../utils/string-utils.class"; import {StringUtils} from "../../utils/string-utils.class";
import {el} from "@angular/platform-browser/testing/src/browser_util";
let maps: string[] = ['parameters', 'filters']; let maps: string[] = ['parameters', 'filters'];

View File

@ -70,7 +70,7 @@ export class NotifyFormComponent implements OnInit, OnDestroy {
public user: User; public user: User;
public focused: boolean = false; public focused: boolean = false;
public groups: string[] = []; public groups: string[] = [];
@ViewChild('recipients') recipients: InputComponent; @ViewChild('recipients', { static: false }) recipients: InputComponent;
private notification: Notification; private notification: Notification;
private subscriptions: any[] = []; private subscriptions: any[] = [];
public sending: boolean = false; public sending: boolean = false;

View File

@ -40,7 +40,7 @@ declare var UIkit: any;
<div class="uk-margin-top"> <div class="uk-margin-top">
<span> <span>
Did you link a result with your ORCID <img src="assets/common-assets/common/ORCIDiD_icon16x16.png" alt=""> Did you link a result with your ORCID <img src="assets/common-assets/common/ORCIDiD_icon16x16.png" alt="" loading="lazy">
but the <span class="orcid-color">green icon</span> is missing? but the <span class="orcid-color">green icon</span> is missing?
<br> <br>
No worries! It will appear, as soon as we synchronize again with ORCID data. No worries! It will appear, as soon as we synchronize again with ORCID data.

View File

@ -44,7 +44,7 @@ declare var UIkit: any;
<span class="uk-margin-small-left uk-flex uk-flex-middle">Add to <span class="uk-margin-small-left uk-flex uk-flex-middle">Add to
<span class="orcid-color space uk-flex uk-flex-middle"> <span class="orcid-color space uk-flex uk-flex-middle">
<span>ORCID</span> <span>ORCID</span>
<img class="space" src="assets/common-assets/common/ORCIDiD_icon16x16.png" alt="">{{" "}} <img class="space" src="assets/common-assets/common/ORCIDiD_icon16x16.png" alt="" loading="lazy">{{" "}}
</span> </span>
</span> </span>
</a> </a>
@ -63,7 +63,7 @@ declare var UIkit: any;
<span class="uk-margin-small-left uk-flex uk-flex-middle">Delete from <span class="uk-margin-small-left uk-flex uk-flex-middle">Delete from
<span class="orcid-color space uk-flex uk-flex-middle"> <span class="orcid-color space uk-flex uk-flex-middle">
<span>ORCID</span> <span>ORCID</span>
<img class="space" src="assets/common-assets/common/ORCIDiD_icon16x16.png" alt="">{{" "}} <img class="space" src="assets/common-assets/common/ORCIDiD_icon16x16.png" alt="" loading="lazy">{{" "}}
</span> </span>
</span> </span>
</a> </a>
@ -80,7 +80,7 @@ declare var UIkit: any;
<a (click)="currentAction='add'; saveWorkPreparation();" <a (click)="currentAction='add'; saveWorkPreparation();"
[class]="'orcid_icon_opacity uk-link-text uk-text-bold uk-text-uppercase '+ (showLoading ? 'uk-disabled' : '') + (!isLoggedIn || !pids ? 'uk-disabled uk-text-muted' : '')"> [class]="'orcid_icon_opacity uk-link-text uk-text-bold uk-text-uppercase '+ (showLoading ? 'uk-disabled' : '') + (!isLoggedIn || !pids ? 'uk-disabled uk-text-muted' : '')">
<span *ngIf="!showLoading" class="uk-icon"> <span *ngIf="!showLoading" class="uk-icon">
<img src="assets/common-assets/common/orcid_add.svg" style="width: 42px; height: 42px"> <img src="assets/common-assets/common/orcid_add.svg" style="width: 42px; height: 42px" loading="lazy">
</span> </span>
<span *ngIf="showLoading" class="uk-icon icon-button loading-action-button"><loading <span *ngIf="showLoading" class="uk-icon icon-button loading-action-button"><loading
[top_margin]="false"></loading></span> [top_margin]="false"></loading></span>
@ -101,7 +101,7 @@ declare var UIkit: any;
<a (click)="currentAction='delete'; deleteWorks();" <a (click)="currentAction='delete'; deleteWorks();"
[class]="'orcid_icon_opacity uk-link-text uk-text-bold uk-text-uppercase '+ (showLoading ? 'uk-disabled' : '') + (!isLoggedIn || !pids ? 'uk-disabled uk-text-muted' : '')"> [class]="'orcid_icon_opacity uk-link-text uk-text-bold uk-text-uppercase '+ (showLoading ? 'uk-disabled' : '') + (!isLoggedIn || !pids ? 'uk-disabled uk-text-muted' : '')">
<span *ngIf="!showLoading" class="uk-icon uk-preserve"> <span *ngIf="!showLoading" class="uk-icon uk-preserve">
<img src="assets/common-assets/common/orcid_bin.svg" style="width: 42px; height: 42px"> <img src="assets/common-assets/common/orcid_bin.svg" style="width: 42px; height: 42px" loading="lazy">
</span> </span>
<span *ngIf="showLoading" class="uk-icon icon-button loading-action-button"><loading <span *ngIf="showLoading" class="uk-icon icon-button loading-action-button"><loading
[top_margin]="false"></loading></span> [top_margin]="false"></loading></span>
@ -143,7 +143,7 @@ declare var UIkit: any;
<ng-container *ngIf="pageType == 'my_search'"> <ng-container *ngIf="pageType == 'my_search'">
<span class="uk-margin-bottom uk-flex uk-flex-middle uk-flex-center"> <span class="uk-margin-bottom uk-flex uk-flex-middle uk-flex-center">
<span>ORCID</span> <span>ORCID</span>
<img class="space" src="assets/common-assets/common/ORCIDiD_icon16x16.png" alt=""> <img class="space" src="assets/common-assets/common/ORCIDiD_icon16x16.png" alt="" loading="lazy">
<span class="space">ACTIONS</span> <span class="space">ACTIONS</span>
</span> </span>

View File

@ -1,20 +1,20 @@
import { NgModule, ModuleWithProviders } from '@angular/core'; import {NgModule} from '@angular/core';
import { CommonModule } from '@angular/common'; import {CommonModule} from '@angular/common';
import {RouterModule} from "@angular/router"; import {RouterModule} from '@angular/router';
import {OrcidComponent} from './orcid.component'; import {OrcidComponent} from './orcid.component';
import {OrcidService} from "./orcid.service"; import {OrcidService} from './orcid.service';
import {FreeGuard} from '../login/freeGuard.guard'; import {FreeGuard} from '../login/freeGuard.guard';
import {PreviousRouteRecorder} from "../utils/piwik/previousRouteRecorder.guard"; import {PreviousRouteRecorder} from '../utils/piwik/previousRouteRecorder.guard';
import {OrcidWorkComponent} from "./orcid-work.component"; import {OrcidWorkComponent} from './orcid-work.component';
import {AlertModalModule} from "../utils/modal/alertModal.module"; import {AlertModalModule} from '../utils/modal/alertModal.module';
import {ResultLandingService} from "../landingPages/result/resultLanding.service"; import {ResultLandingService} from '../landingPages/result/resultLanding.service';
import {LoadingModule} from "../utils/loading/loading.module"; import {LoadingModule} from '../utils/loading/loading.module';
import {ResultLandingUtilsModule} from "../landingPages/landing-utils/resultLandingUtils.module"; import {ResultLandingUtilsModule} from '../landingPages/landing-utils/resultLandingUtils.module';
import {IconsModule} from "../utils/icons/icons.module"; import {IconsModule} from '../utils/icons/icons.module';
import {IconsService} from "../utils/icons/icons.service"; import {IconsService} from '../utils/icons/icons.service';
import {add, preview, refresh, remove} from "../utils/icons/icons"; import {add, preview, refresh, remove} from '../utils/icons/icons';
@NgModule({ @NgModule({
imports: [ imports: [

View File

@ -95,9 +95,9 @@ export class RoleVerificationComponent implements OnInit, OnDestroy {
public verification: any; public verification: any;
public code: FormControl; public code: FormControl;
private subs: any[] = []; private subs: any[] = [];
@ViewChild('managerModal') managerModal: AlertModal; @ViewChild('managerModal', { static: true }) managerModal: AlertModal;
@ViewChild('memberModal') memberModal: AlertModal; @ViewChild('memberModal', { static: true }) memberModal: AlertModal;
@ViewChild('errorModal') errorModal: AlertModal; @ViewChild('errorModal', { static: true }) errorModal: AlertModal;
public error: string = null; public error: string = null;
public loading: boolean = false; public loading: boolean = false;
public isMember: boolean = false; public isMember: boolean = false;

View File

@ -113,10 +113,10 @@ export class SearchAllComponent {
//new //new
parameters = {}; parameters = {};
disableForms: boolean = true; disableForms: boolean = true;
@ViewChild (SearchResearchResultsComponent) searchResearchResultsComponent : SearchResearchResultsComponent ; @ViewChild(SearchResearchResultsComponent) searchResearchResultsComponent : SearchResearchResultsComponent ;
@ViewChild (SearchProjectsComponent) searchProjectsComponent : SearchProjectsComponent ; @ViewChild(SearchProjectsComponent) searchProjectsComponent : SearchProjectsComponent ;
@ViewChild (SearchDataProvidersComponent) searchDataprovidersComponent : SearchDataProvidersComponent ; @ViewChild(SearchDataProvidersComponent) searchDataprovidersComponent : SearchDataProvidersComponent ;
@ViewChild (SearchOrganizationsComponent) searchOrganizationsComponent : SearchOrganizationsComponent ; @ViewChild(SearchOrganizationsComponent) searchOrganizationsComponent : SearchOrganizationsComponent ;
constructor(private route: ActivatedRoute, constructor(private route: ActivatedRoute,
private _router: Router, private _router: Router,
private _searchResearchResultsService: SearchResearchResultsService, private _searchResearchResultsService: SearchResearchResultsService,

View File

@ -75,7 +75,7 @@ export class SearchDataProvidersComponent {
@Input() type: "all" | "registries" | "journals" | "compatible" | "deposit" = "all"; @Input() type: "all" | "registries" | "journals" | "compatible" | "deposit" = "all";
public refineFields: string[]; public refineFields: string[];
pageTitle; pageTitle;
@ViewChild(NewSearchPageComponent) searchPage: NewSearchPageComponent; @ViewChild(NewSearchPageComponent, { static: true }) searchPage: NewSearchPageComponent;
@Input() simpleView: boolean = true; @Input() simpleView: boolean = true;
@Input() simpleSearchLink: string = ""; @Input() simpleSearchLink: string = "";
advancedSearchLink: string = ""; advancedSearchLink: string = "";

View File

@ -65,7 +65,7 @@ export class SearchOrganizationsComponent {
@Input() customFilter:SearchCustomFilter= null; @Input() customFilter:SearchCustomFilter= null;
public refineFields: string[] = this.searchFields.ORGANIZATION_REFINE_FIELDS; public refineFields: string[] = this.searchFields.ORGANIZATION_REFINE_FIELDS;
@ViewChild(NewSearchPageComponent) searchPage: NewSearchPageComponent; @ViewChild(NewSearchPageComponent, { static: true }) searchPage: NewSearchPageComponent;
@Input() simpleView: boolean = true; @Input() simpleView: boolean = true;
@Input() simpleSearchLink: string = ""; @Input() simpleSearchLink: string = "";
advancedSearchLink: string = ""; advancedSearchLink: string = "";

View File

@ -70,7 +70,7 @@ export class SearchProjectsComponent {
public pagingLimit: number = 0; public pagingLimit: number = 0;
public isPiwikEnabled; public isPiwikEnabled;
public refineFields: string[] = this.searchFields.PROJECT_REFINE_FIELDS; public refineFields: string[] = this.searchFields.PROJECT_REFINE_FIELDS;
@ViewChild(NewSearchPageComponent) searchPage: NewSearchPageComponent; @ViewChild(NewSearchPageComponent, { static: true }) searchPage: NewSearchPageComponent;
@Input() simpleView: boolean = true; @Input() simpleView: boolean = true;
@Input() simpleSearchLink: string = ""; @Input() simpleSearchLink: string = "";
advancedSearchLink: string = ""; advancedSearchLink: string = "";

View File

@ -77,7 +77,7 @@ export class SearchResearchResultsComponent {
public isPiwikEnabled; public isPiwikEnabled;
properties: EnvProperties = properties; properties: EnvProperties = properties;
public refineFields: string[] = this.searchFields.RESULT_REFINE_FIELDS; public refineFields: string[] = this.searchFields.RESULT_REFINE_FIELDS;
@ViewChild(NewSearchPageComponent) searchPage: NewSearchPageComponent; @ViewChild(NewSearchPageComponent, { static: true }) searchPage: NewSearchPageComponent;
@Input() simpleView: boolean = true; @Input() simpleView: boolean = true;
quickFilter: { filter: Filter, selected: boolean, filterId: string, value: string } = { quickFilter: { filter: Filter, selected: boolean, filterId: string, value: string } = {
filter: null, filter: null,

View File

@ -10,7 +10,7 @@ import {DateFilterModule} from './dateFilter.module';
import {SearchFormModule} from './searchForm.module'; import {SearchFormModule} from './searchForm.module';
import {QuickSelectionsModule} from "./quick-selections.module"; import {QuickSelectionsModule} from "./quick-selections.module";
import {EntitiesSelectionModule} from "./entitiesSelection.module"; import {EntitiesSelectionModule} from "./entitiesSelection.module";
import {MatSelectModule} from "@angular/material"; import { MatSelectModule } from "@angular/material/select";
@NgModule({ @NgModule({

View File

@ -2,7 +2,7 @@ import { NgModule} from '@angular/core';
import { CommonModule } from '@angular/common'; import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms'; import { FormsModule } from '@angular/forms';
import { RouterModule } from '@angular/router'; import { RouterModule } from '@angular/router';
import { MatSelectModule } from "@angular/material"; import { MatSelectModule } from "@angular/material/select";
import {RefineFieldResultsServiceModule} from '../../services/refineFieldResultsService.module'; import {RefineFieldResultsServiceModule} from '../../services/refineFieldResultsService.module';

View File

@ -2,7 +2,7 @@ import {Component, Input} from '@angular/core';
import {DateValue} from './searchHelperClasses.class'; import {DateValue} from './searchHelperClasses.class';
import {FormControl} from "@angular/forms"; import {FormControl} from "@angular/forms";
import {MatDatepickerInputEvent} from "@angular/material"; import { MatDatepickerInputEvent } from "@angular/material/datepicker";
@Component({ @Component({
selector: 'date-filter', selector: 'date-filter',

View File

@ -3,10 +3,11 @@ import { CommonModule } from '@angular/common';
import { FormsModule, ReactiveFormsModule } from '@angular/forms'; import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { MyDatePickerModule } from '../../utils/my-date-picker/my-date-picker.module'; import { MyDatePickerModule } from '../../utils/my-date-picker/my-date-picker.module';
import {DateFilterComponent} from './dateFilter.component'; import {DateFilterComponent} from './dateFilter.component';
import {MatNativeDateModule, MatSelectModule} from '@angular/material'; import { MatNativeDateModule } from '@angular/material/core';
import { MatSelectModule } from '@angular/material/select';
import {MatDatepickerModule} from '@angular/material/datepicker'; import {MatDatepickerModule} from '@angular/material/datepicker';
import {MatFormFieldModule} from '@angular/material'; import { MatFormFieldModule } from '@angular/material/form-field';
import {MatInputModule} from '@angular/material'; import { MatInputModule } from '@angular/material/input';
@NgModule({ @NgModule({
imports: [ imports: [
CommonModule, FormsModule, ReactiveFormsModule, MyDatePickerModule, CommonModule, FormsModule, ReactiveFormsModule, MyDatePickerModule,

View File

@ -4,7 +4,7 @@ import {EnvProperties} from "../../utils/properties/env-properties";
import {SearchCustomFilter} from "./searchUtils.class"; import {SearchCustomFilter} from "./searchUtils.class";
import {ConfigurationService} from "../../utils/configuration/configuration.service"; import {ConfigurationService} from "../../utils/configuration/configuration.service";
import {Router} from "@angular/router"; import {Router} from "@angular/router";
import {MatSelect} from "@angular/material"; import { MatSelect } from "@angular/material/select";
import {Subscription} from "rxjs"; import {Subscription} from "rxjs";
import {properties} from '../../../../environments/environment'; import {properties} from '../../../../environments/environment';

View File

@ -3,7 +3,7 @@ import {CommonModule} from '@angular/common';
import {FormsModule, ReactiveFormsModule} from '@angular/forms'; import {FormsModule, ReactiveFormsModule} from '@angular/forms';
import {RouterModule} from '@angular/router'; import {RouterModule} from '@angular/router';
import {EntitiesSelectionComponent} from "./entitiesSelection.component"; import {EntitiesSelectionComponent} from "./entitiesSelection.component";
import {MatSelectModule} from "@angular/material"; import { MatSelectModule } from "@angular/material/select";
@NgModule({ @NgModule({
imports: [ imports: [

View File

@ -1,11 +1,11 @@
<ng-template #selected_filters_pills> <ng-template #selected_filters_pills>
<div class="uk-grid uk-grid-small uk-text-small" uk-grid> <h1 class="uk-grid uk-grid-small uk-text-small" uk-grid>
<ng-container *ngIf="customFilter && ((customFilterEnabled && <ng-container *ngIf="customFilter && ((customFilterEnabled &&
refineFields.indexOf(customFilter.queryFieldName) == refineFields.indexOf(customFilter.queryFieldName) ==
-1) ||customFilter.isHiddenFilter)"> -1) ||customFilter.isHiddenFilter)">
<span class=""> <span class="">
<span class="selectedFilterLabel customFilterLabel"> <span class="selectedFilterLabel customFilterLabel">
<span class="">{{customFilter.valueName}}</span> <span class="">{{' '+customFilter.valueName}}</span>
</span> </span>
</span> </span>
</ng-container> </ng-container>
@ -23,7 +23,7 @@
fill="none" stroke="#000" stroke-width="1.6" d="M16,4 L4,16"></path></svg> fill="none" stroke="#000" stroke-width="1.6" d="M16,4 L4,16"></path></svg>
</span> </span>
</span> </span>
<span class="uk-margin-small-left">{{type.name}}</span> <span class="uk-margin-small-left">{{' '+type.name}}</span>
</a> </a>
</span> </span>
</span> </span>
@ -47,7 +47,7 @@
d="M16,4 L4,16"></path></svg> d="M16,4 L4,16"></path></svg>
</span> </span>
</span> </span>
<span class="uk-margin-small-left">{{filter.selectedFromAndToValues}}</span> <span class="uk-margin-small-left">{{' '+filter.selectedFromAndToValues}}</span>
</a> </a>
</span> </span>
</span> </span>
@ -75,14 +75,15 @@
</span> </span>
</span> </span>
<span class="uk-margin-small-left" <span class="uk-margin-small-left"
[innerHtml]="(value.name.length > 34)?value.name.substring(0,34)+'...':value.name"></span> [innerHtml]="' ' +
((value.name.length > 34)?value.name.substring(0,34)+'...':value.name)"></span>
</a> </a>
</span> </span>
</span> </span>
</ng-container> </ng-container>
</ng-container> </ng-container>
</ng-container> </ng-container>
</div> </h1>
</ng-template> </ng-template>
<ng-template #filters_column> <ng-template #filters_column>
<div [class.filterLoading]="(disableForms || disableRefineForms)"> <div [class.filterLoading]="(disableForms || disableRefineForms)">
@ -185,7 +186,7 @@
> >
</advanced-search-form> </advanced-search-form>
<div *ngIf="entityType === 'community' || entityType === 'stakeholder' " class="uk-position-center-right uk-visible@m"> <div *ngIf="entityType === 'community' || entityType === 'stakeholder' " class="uk-position-center-right uk-visible@m">
<img src="assets/common-assets/common/search.svg" class="uk-align-center" width="141" height="171"> <img src="assets/common-assets/common/search.svg" class="uk-align-center" width="141" height="171" loading="lazy">
</div> </div>
</div> </div>
</div> </div>
@ -388,7 +389,7 @@
class="uk-margin-small-top uk-grid uk-child-width-1-2"> class="uk-margin-small-top uk-grid uk-child-width-1-2">
<!-- Last Index Info--> <!-- Last Index Info-->
<div class=""> <div class="">
<img src="assets/common-assets/graph.svg" style="opacity: 0.4"> <img src="assets/common-assets/graph.svg" style="opacity: 0.4" loading="lazy">
<span class="uk-margin-small-left uk-text-baseline uk-text-muted">Powered by <a href="https://graph.openaire.eu" class="graph-color">OpenAIRE Research Graph</a></span> <span class="uk-margin-small-left uk-text-baseline uk-text-muted">Powered by <a href="https://graph.openaire.eu" class="graph-color">OpenAIRE Research Graph</a></span>
</div> </div>
<div class="uk-text-right"> <div class="uk-text-right">

View File

@ -238,7 +238,7 @@ export class NewSearchPageComponent {
} }
} }
} }
let nonCanonicalizedPage = (filterArray.length > 0 && filterArray.length<3); let nonCanonicalizedPage = filterArray.length > 0;
this.metaDescription= (nonCanonicalizedPage?( (this.basicMetaDescription[0] + " filtered by: " + filterArray.join(" and ") + ". ") + (this.basicMetaDescription.length > 1 ?this.basicMetaDescription[1]:"")) this.metaDescription= (nonCanonicalizedPage?( (this.basicMetaDescription[0] + " filtered by: " + filterArray.join(" and ") + ". ") + (this.basicMetaDescription.length > 1 ?this.basicMetaDescription[1]:""))
:((this.basicMetaDescription.length > 2 ?this.basicMetaDescription[1] + this.basicMetaDescription[2]:this.basicMetaDescription[0]))); :((this.basicMetaDescription.length > 2 ?this.basicMetaDescription[1] + this.basicMetaDescription[2]:this.basicMetaDescription[0])));
this._meta.updateTag({content: this.metaDescription}, "name='description'"); this._meta.updateTag({content: this.metaDescription}, "name='description'");

View File

@ -24,9 +24,9 @@
<div class="uk-flex uk-flex-center"> <div class="uk-flex uk-flex-center">
<img *ngIf="result.logoUrl && result.logoUrl != '' && result.isUpload " <img *ngIf="result.logoUrl && result.logoUrl != '' && result.isUpload "
[src]="properties.utilsService + '/download/' + result.logoUrl" [src]="properties.utilsService + '/download/' + result.logoUrl"
alt="{{(result.title)?result.title:result.shortTitle}} logo"> alt="{{(result.title)?result.title:result.shortTitle}} logo" loading="lazy">
<img *ngIf="result.logoUrl && result.logoUrl != '' && !result.isUpload " [src]="result.logoUrl | urlPrefix" <img *ngIf="result.logoUrl && result.logoUrl != '' && !result.isUpload " [src]="result.logoUrl | urlPrefix"
alt="{{(result.title)?result.title:result.shortTitle}} logo"> alt="{{(result.title)?result.title:result.shortTitle}} logo" loading="lazy">
<span *ngIf="result.logoUrl == null || result.logoUrl == ''" class="uk-icon"> <span *ngIf="result.logoUrl == null || result.logoUrl == ''" class="uk-icon">
<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" ratio="2.5"> <circle fill="none" <svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" ratio="2.5"> <circle fill="none"
stroke="#000" stroke="#000"
@ -47,9 +47,9 @@
<div class="uk-flex uk-flex-center"> <div class="uk-flex uk-flex-center">
<img *ngIf="result.logoUrl && result.logoUrl != '' && result.isUpload " <img *ngIf="result.logoUrl && result.logoUrl != '' && result.isUpload "
[src]="properties.utilsService + '/download/' + result.logoUrl" [src]="properties.utilsService + '/download/' + result.logoUrl"
alt="{{(result.title)?result.title:result.shortTitle}} logo"> alt="{{(result.title)?result.title:result.shortTitle}} logo" loading="lazy">
<img *ngIf="result.logoUrl && result.logoUrl != '' && !result.isUpload " [src]="result.logoUrl | urlPrefix" <img *ngIf="result.logoUrl && result.logoUrl != '' && !result.isUpload " [src]="result.logoUrl | urlPrefix"
alt="{{(result.title)?result.title:result.shortTitle}} logo"> alt="{{(result.title)?result.title:result.shortTitle}} logo" loading="lazy">
<span *ngIf="(result.logoUrl == null || result.logoUrl == '' )" class="uk-icon"> <span *ngIf="(result.logoUrl == null || result.logoUrl == '' )" class="uk-icon">
<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" ratio="2.5"> <circle fill="none" <svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" ratio="2.5"> <circle fill="none"
stroke="#000" stroke="#000"

View File

@ -3,7 +3,8 @@ import {CommonModule} from '@angular/common';
import {FormsModule, ReactiveFormsModule} from '@angular/forms'; import {FormsModule, ReactiveFormsModule} from '@angular/forms';
import {RouterModule} from '@angular/router'; import {RouterModule} from '@angular/router';
import {QuickSelectionsComponent} from "./quick-selections.component"; import {QuickSelectionsComponent} from "./quick-selections.component";
import {MatCheckboxModule, MatSlideToggleModule} from "@angular/material"; import { MatCheckboxModule } from "@angular/material/checkbox";
import { MatSlideToggleModule } from "@angular/material/slide-toggle";
import {SearchFilterModule} from "./searchFilter.module"; import {SearchFilterModule} from "./searchFilter.module";
@NgModule({ @NgModule({

View File

@ -9,7 +9,6 @@ import {
} from '@angular/core'; } from '@angular/core';
import { Filter, Value} from './searchHelperClasses.class'; import { Filter, Value} from './searchHelperClasses.class';
import {ActivatedRoute, Router} from "@angular/router"; import {ActivatedRoute, Router} from "@angular/router";
import 'rxjs/add/operator/filter';
import {SearchFields} from "../../utils/properties/searchFields"; import {SearchFields} from "../../utils/properties/searchFields";
@Component({ @Component({
selector: 'search-filter', selector: 'search-filter',

View File

@ -5,7 +5,7 @@ import { FormsModule } from '@angular/forms';
import {SearchFilterComponent} from './searchFilter.component'; import {SearchFilterComponent} from './searchFilter.component';
import{SearchFilterModalComponent} from './searchFilterModal.component'; import{SearchFilterModalComponent} from './searchFilterModal.component';
import {ModalModule} from '../../utils/modal/modal.module'; import {ModalModule} from '../../utils/modal/modal.module';
import {MatSelectModule} from "@angular/material"; import { MatSelectModule } from "@angular/material/select";
import {RouterModule} from "@angular/router"; import {RouterModule} from "@angular/router";
@NgModule({ @NgModule({

View File

@ -4,7 +4,7 @@ import { FormsModule } from '@angular/forms';
import { RouterModule } from '@angular/router'; import { RouterModule } from '@angular/router';
import {SearchResultsPerPageComponent} from './searchResultsPerPage.component'; import {SearchResultsPerPageComponent} from './searchResultsPerPage.component';
import {MatSelectModule} from "@angular/material"; import { MatSelectModule } from "@angular/material/select";
@NgModule({ @NgModule({
imports: [ imports: [

View File

@ -4,7 +4,7 @@ import { FormsModule } from '@angular/forms';
import { RouterModule } from '@angular/router'; import { RouterModule } from '@angular/router';
import{SearchSortingComponent} from './searchSorting.component'; import{SearchSortingComponent} from './searchSorting.component';
import {MatSelectModule} from "@angular/material"; import { MatSelectModule } from "@angular/material/select";
@NgModule({ @NgModule({
imports: [ imports: [

View File

@ -1,17 +1,17 @@
/** /**
* Created by stefania on 7/13/17. * Created by stefania on 7/13/17.
*/ */
import { Injectable } from '@angular/core'; import {Injectable} from '@angular/core';
import {HttpClient, HttpErrorResponse} from "@angular/common/http"; import {HttpClient, HttpErrorResponse} from "@angular/common/http";
import { Observable } from 'rxjs'; import {Observable, throwError} from 'rxjs';
import { Page } from "../utils/entities/adminTool/page"; import {Page} from "../utils/entities/adminTool/page";
import { PageHelpContent } from "../utils/entities/adminTool/page-help-content"; import {PageHelpContent} from "../utils/entities/adminTool/page-help-content";
import { Portal } from "../utils/entities/adminTool/portal"; import {Portal} from "../utils/entities/adminTool/portal";
import { Entity } from "../utils/entities/adminTool/entity"; import {Entity} from "../utils/entities/adminTool/entity";
import { DivId } from "../utils/entities/adminTool/divId"; import {DivId} from "../utils/entities/adminTool/divId";
import { DivHelpContent } from "../utils/entities/adminTool/div-help-content"; import {DivHelpContent} from "../utils/entities/adminTool/div-help-content";
import {StatisticsDisplay, StatisticsSummary} from '../connect/statistics/statisticsEntities'; import {StatisticsDisplay, StatisticsSummary} from '../connect/statistics/statisticsEntities';
import { CustomOptions } from './servicesUtils/customOptions.class'; import {CustomOptions} from './servicesUtils/customOptions.class';
import {catchError, map} from "rxjs/operators"; import {catchError, map} from "rxjs/operators";
import {properties} from "../../../environments/environment"; import {properties} from "../../../environments/environment";
@ -373,7 +373,7 @@ export class HelpContentService {
// in a real world app, we may send the error to some remote logging infrastructure // in a real world app, we may send the error to some remote logging infrastructure
// instead of just logging it to the console // instead of just logging it to the console
console.error(error); console.error(error);
return Observable.throw(error.error || 'Server error'); return throwError(error.error || 'Server error');
} }
// getDataProviders() { // getDataProviders() {

View File

@ -204,7 +204,7 @@ export class SearchResearchResultsService {
if (!Array.isArray(resData['pid'])) { if (!Array.isArray(resData['pid'])) {
if (resData['pid'].classid && resData['pid'].classid == 'doi') { if (resData['pid'].classid && resData['pid'].classid == 'doi') {
if (resData['pid'].content != '' && resData['pid'].content != null) { if (resData['pid'].content != '' && resData['pid'].content != null) {
result.DOIs.push(resData['pid'].content.replace("https://doi.org/", "")); result.DOIs.push((resData['pid'].content+"").replace("https://doi.org/", ""));
} }
} }
} else { } else {
@ -538,4 +538,10 @@ export class SearchResearchResultsService {
return entityType; return entityType;
} }
} }
public countCollectedResultsWithFundingInfo(datasourceId: string) {
let url = properties.searchAPIURLLAst + "resources?query=" + encodeURIComponent("(oaftype=result and collectedfromdatasourceid exact \""+datasourceId+"\" and relprojectid=*)") + "&page=0&size=0&format=json";
return this.http.get((properties.useCache) ? (properties.cacheUrl + encodeURIComponent(url)) : url)
.pipe(map(res => res['meta']['total']));
}
} }

View File

@ -5,7 +5,6 @@ import {COOKIE, Session, User} from "../login/utils/helper.class";
import {map} from "rxjs/operators"; import {map} from "rxjs/operators";
import {NavigationEnd, Router} from "@angular/router"; import {NavigationEnd, Router} from "@angular/router";
import {properties} from "../../../environments/environment"; import {properties} from "../../../environments/environment";
import {el} from "@angular/platform-browser/testing/src/browser_util";
import {StringUtils} from "../utils/string-utils.class"; import {StringUtils} from "../utils/string-utils.class";
@Injectable({ @Injectable({

View File

@ -1,5 +1,5 @@
import {Injectable} from '@angular/core'; import {Injectable} from '@angular/core';
import {Observable} from 'rxjs/Observable'; import {Observable} from 'rxjs';
import {CustomOptions} from './servicesUtils/customOptions.class'; import {CustomOptions} from './servicesUtils/customOptions.class';
import {HttpClient} from '@angular/common/http'; import {HttpClient} from '@angular/common/http';

View File

@ -37,7 +37,7 @@ const COMPONENTS = [
] ]
}) })
export class SharedModule { export class SharedModule {
static forRoot(): ModuleWithProviders { static forRoot(): ModuleWithProviders<SharedModule> {
return { return {
ngModule: SharedModule, ngModule: SharedModule,
}; };

View File

@ -6,7 +6,7 @@
<div> <div>
<img style="margin-right: 8px; float: left;" <img style="margin-right: 8px; float: left;"
[src]="assetsPath + 'common/commission.jpg'" [src]="assetsPath + 'common/commission.jpg'"
alt="flag black white low" width="50" height="33"> alt="flag black white low" width="50" height="33" loading="lazy">
</div> </div>
<helper *ngIf="divContents && divContents['footer']?.length > 0" <helper *ngIf="divContents && divContents['footer']?.length > 0"
[texts]="divContents['footer']"></helper> [texts]="divContents['footer']"></helper>
@ -25,7 +25,7 @@
<div *ngIf="showOpenaire" class="uk-text-right uk-width-1-2"> <div *ngIf="showOpenaire" class="uk-text-right uk-width-1-2">
<img [src]="assetsPath + 'common/Logo_Horizontal_'+(darkBackground?'white':'dark')+'_small.png'" <img [src]="assetsPath + 'common/Logo_Horizontal_'+(darkBackground?'white':'dark')+'_small.png'"
data-width="126" data-width="126"
data-height="30" class="el-image" alt="OpenAIRE"> data-height="30" class="el-image" alt="OpenAIRE" loading="lazy">
</div> </div>
</div> </div>
</ng-container> </ng-container>
@ -42,7 +42,7 @@
[class]="(centered?'uk-width-1-1 uk-width-1-4@m uk-text-center':'')"> [class]="(centered?'uk-width-1-1 uk-width-1-4@m uk-text-center':'')">
<img [src]="assetsPath + 'common/Logo_Horizontal_'+(darkBackground?'white':'dark')+'_small.png'" <img [src]="assetsPath + 'common/Logo_Horizontal_'+(darkBackground?'white':'dark')+'_small.png'"
data-width="126" data-width="126"
data-height="30" class="el-image" alt="OpenAIRE"> data-height="30" class="el-image" alt="OpenAIRE" loading="lazy">
</div> </div>
<div *ngIf="showCommision" id="footer#5" <div *ngIf="showCommision" id="footer#5"
[class]="'uk-text-left '+(centered?' uk-margin uk-width-expand':' uk-margin-left')"> [class]="'uk-text-left '+(centered?' uk-margin uk-width-expand':' uk-margin-left')">
@ -61,7 +61,7 @@
<div> <div>
<img style="margin-right: 8px; float: left;" <img style="margin-right: 8px; float: left;"
[src]="assetsPath + 'common/commission.jpg'" [src]="assetsPath + 'common/commission.jpg'"
alt="flag black white low" width="50" height="33"> alt="flag black white low" width="50" height="33" loading="lazy">
</div> </div>
<div class="uk-margin-left"> <div class="uk-margin-left">
<helper *ngIf="divContents && divContents['footer']?.length > 0" <helper *ngIf="divContents && divContents['footer']?.length > 0"

File diff suppressed because one or more lines are too long

View File

@ -177,10 +177,10 @@ export class NumbersComponent implements OnInit, OnDestroy {
} }
setParams() { setParams() {
this.params.set('publication', {type: 'publications', qf: 'false'}); this.params.set('publication', {type: 'publications'});
this.params.set('dataset', {type: 'datasets', qf: 'false'}); this.params.set('dataset', {type: 'datasets'});
this.params.set('software', {type: 'software', qf: 'false'}); this.params.set('software', {type: 'software'});
this.params.set('other', {type: 'other', qf: 'false'}); this.params.set('other', {type: 'other'});
this.params.set('project', {}); this.params.set('project', {});
this.params.set('datasource', {}); this.params.set('datasource', {});
if (this.refineValue) { if (this.refineValue) {

View File

@ -1,7 +1,7 @@
import {Component, Input, OnChanges, OnInit, SimpleChanges} from '@angular/core'; import {Component, Input, OnChanges, OnInit, SimpleChanges} from '@angular/core';
import {OpenAireJsonldConverterService} from './service/open-aire-jsonld-converter.service'; import {OpenAireJsonldConverterService} from './service/open-aire-jsonld-converter.service';
import {JsonldDocumentSerializerService} from './service/jsonld-document-serializer.service'; import {JsonldDocumentSerializerService} from './service/jsonld-document-serializer.service';
import {DomSanitizer} from "@angular/platform-browser"; import {DomSanitizer} from '@angular/platform-browser';
@Component({ @Component({
selector: 'schema2jsonld', selector: 'schema2jsonld',
@ -9,36 +9,41 @@ import {DomSanitizer} from "@angular/platform-browser";
<div *ngIf="html" [innerHTML]="html"></div> <div *ngIf="html" [innerHTML]="html"></div>
` `
}) })
export class Schema2jsonldComponent implements OnInit, OnChanges { export class Schema2jsonldComponent implements OnInit, OnChanges {
@Input() data; // for project, organization, datasource @Input() data; // for project, organization, datasource
@Input() URL; @Input() URL;
@Input() logoURL; // for home, search @Input() logoURL; // for home, search
@Input() otherURL; //for project, datasource @Input() otherURL; //for project, datasource
@Input() name; @Input() name;
@Input() searchAction = false; @Input() searchAction = false;
@Input() type = "result"; @Input() type = 'result';
@Input() description = null; @Input() description = null;
@Input() searchActionRoute = "/search/find/"; @Input() searchActionRoute = '/search/find/';
public json; public json;
public html; public html;
constructor(private documentParser: OpenAireJsonldConverterService, constructor(private documentParser: OpenAireJsonldConverterService,
private documentSerializer: JsonldDocumentSerializerService, private sanitizer: DomSanitizer) { private documentSerializer: JsonldDocumentSerializerService, private sanitizer: DomSanitizer) {
} }
ngOnChanges(changes: SimpleChanges): void { ngOnChanges(changes: SimpleChanges): void {
if (changes.description) { if (changes.description) {
this.createJson(); this.createJson();
} }
} }
ngOnInit() { ngOnInit() {
this.createJson(); this.createJson();
} }
getSafeHTML(value) { getSafeHTML(value) {
let json = JSON.stringify(value, null, 2); let json = JSON.stringify(value, null, 2);
let html = "<script type=\"application/ld+json\">" + json + "</script>"; let html = '<script type="application/ld+json">' + json + '</script>';
return this.sanitizer.bypassSecurityTrustHtml(html); return this.sanitizer.bypassSecurityTrustHtml(html);
}; };
createJson(){
createJson() {
var docOvject; var docOvject;
if (this.type == 'project') { if (this.type == 'project') {
docOvject = this.documentParser.convertProject(this.data, this.URL); docOvject = this.documentParser.convertProject(this.data, this.URL);
@ -52,7 +57,7 @@ export class Schema2jsonldComponent implements OnInit, OnChanges {
} else if (this.type == 'home') { } else if (this.type == 'home') {
this.json = this.documentParser.createHome(this.name, this.URL, this.logoURL, this.description, this.searchActionRoute); this.json = this.documentParser.createHome(this.name, this.URL, this.logoURL, this.description, this.searchActionRoute);
} else if (this.type == 'search') { } else if (this.type == 'search') {
this.json = this.documentParser.createSearchPage(this.name, this.URL, this.logoURL, this.searchAction, this.description, this.searchActionRoute ); this.json = this.documentParser.createSearchPage(this.name, this.URL, this.logoURL, this.searchAction, this.description, this.searchActionRoute);
} else if (this.type == 'result') { } else if (this.type == 'result') {
docOvject = this.documentParser.convertResult(this.data, this.URL); docOvject = this.documentParser.convertResult(this.data, this.URL);
this.json = this.documentSerializer.serializeDataset(docOvject); this.json = this.documentSerializer.serializeDataset(docOvject);

View File

@ -1,7 +1,7 @@
import { Injectable } from "@angular/core"; import {Injectable} from '@angular/core';
import { JsonldDocument, Identifier, Person, License, Citation, Dataset, Organization } from "../model/jsonld-document"; import {Citation, Dataset, Identifier, License, Organization, Person} from '../model/jsonld-document';
import * as _ from "lodash"; import * as _ from 'lodash';
import {properties} from "../../../../../environments/environment"; import {properties} from '../../../../../environments/environment';
@Injectable() @Injectable()
export class OpenAireJsonldConverterService { export class OpenAireJsonldConverterService {

View File

@ -10,7 +10,7 @@ import {MatAutocompleteTrigger} from '@angular/material/autocomplete';
<div *ngIf="control" class="uk-width-expand" [class.bordered]="bordered && (showSearch || selected)" [class.focused]="showSearch"> <div *ngIf="control" class="uk-width-expand" [class.bordered]="bordered && (showSearch || selected)" [class.focused]="showSearch">
<form (ngSubmit)="search()"> <form (ngSubmit)="search()">
<input #input type="text" class="uk-width-1-1" <input #input type="text" class="uk-width-1-1"
[class.uk-animation-slide-right-medium]="showSearch" [class.uk-animation-slide-right-medium]="showSearch && !selected"
[class.uk-hidden@m]="!showSearch" [class.uk-hidden@m]="!showSearch"
[placeholder]="placeholder" [placeholder]="placeholder"
(blur)="closeSearch()" (blur)="closeSearch()"

View File

@ -19,8 +19,8 @@ import {properties} from "../../../../environments/environment";
</span> </span>
<a *ngIf="(author.orcid || author.orcid_pending) && testBrowser" class="uk-display-inline-block space"> <a *ngIf="(author.orcid || author.orcid_pending) && testBrowser" class="uk-display-inline-block space">
<span> <span>
<img *ngIf="author.orcid" src="assets/common-assets/common/ORCIDiD_icon16x16.png" alt="">{{" "}} <img *ngIf="author.orcid" src="assets/common-assets/common/ORCIDiD_icon16x16.png" alt="" loading="lazy">{{" "}}
<img *ngIf="!author.orcid && author.orcid_pending" src="assets/common-assets/common/ORCIDiD_iconbw16x16.png" alt="">{{" "}} <img *ngIf="!author.orcid && author.orcid_pending" src="assets/common-assets/common/ORCIDiD_iconbw16x16.png" alt="" loading="lazy">{{" "}}
<span [class.uk-text-small]="small"> <span [class.uk-text-small]="small">
{{author.fullName + "; "}} {{author.fullName + "; "}}
</span> </span>
@ -34,8 +34,8 @@ import {properties} from "../../../../environments/environment";
<div class="uk-text-muted uk-margin-small-bottom uk-margin-small-top">ORCID</div> <div class="uk-text-muted uk-margin-small-bottom uk-margin-small-top">ORCID</div>
<div class="uk-text-muted uk-text-small uk-margin-small-top uk-margin-small-bottom"> <div class="uk-text-muted uk-text-small uk-margin-small-top uk-margin-small-bottom">
<img *ngIf="author.orcid" src="assets/common-assets/common/ORCIDiD_icon16x16.png" alt="">{{" "}} <img *ngIf="author.orcid" src="assets/common-assets/common/ORCIDiD_icon16x16.png" alt="" loading="lazy">{{" "}}
<img *ngIf="!author.orcid && author.orcid_pending" src="assets/common-assets/common/ORCIDiD_iconbw16x16.png" alt="">{{" "}} <img *ngIf="!author.orcid && author.orcid_pending" src="assets/common-assets/common/ORCIDiD_iconbw16x16.png" alt="" loading="lazy">{{" "}}
<i *ngIf="author.orcid">Harvested from ORCID Public Data File</i> <i *ngIf="author.orcid">Harvested from ORCID Public Data File</i>
<i *ngIf="!author.orcid && author.orcid_pending">Derived by OpenAIRE algorithms or harvested from 3d party repositories</i> <i *ngIf="!author.orcid && author.orcid_pending">Derived by OpenAIRE algorithms or harvested from 3d party repositories</i>

View File

@ -1,9 +1,6 @@
import {Directive, OnInit, OnDestroy, Output, EventEmitter, ElementRef, Input} from '@angular/core'; import {Directive, ElementRef, EventEmitter, Input, OnDestroy, OnInit, Output} from '@angular/core';
import {Observable} from 'rxjs/Observable'; import {fromEvent, Subscriber} from 'rxjs';
import 'rxjs/add/observable/fromEvent'; import {delay, tap} from 'rxjs/operators';
import 'rxjs/add/operator/delay';
import 'rxjs/add/operator/do';
import {Subscriber} from "rxjs";
@Directive({ @Directive({
selector: '[click-outside-or-esc]' selector: '[click-outside-or-esc]'
@ -27,20 +24,18 @@ export class ClickOutsideOrEsc implements OnInit, OnDestroy {
ngOnInit() { ngOnInit() {
if(typeof document !== 'undefined') { if(typeof document !== 'undefined') {
this.subscriptions.push(Observable this.subscriptions.push(fromEvent(document, 'click').pipe(
.fromEvent(document, 'click') delay(1),
.delay(1) tap(() => {
.do(() => {
this.listening = true; this.listening = true;
}).subscribe((event: MouseEvent) => { })).subscribe((event: MouseEvent) => {
this.onGlobalClick(event); this.onGlobalClick(event);
})); }));
this.subscriptions.push(Observable this.subscriptions.push(fromEvent(document, 'click').pipe(
.fromEvent(document, 'keydown') delay(1),
.delay(1) tap(() => {
.do(() => {
this.listening = true; this.listening = true;
}).subscribe((event: KeyboardEvent) => { })).subscribe((event: KeyboardEvent) => {
if (event.keyCode === 27 && this.escClose) { if (event.keyCode === 27 && this.escClose) {
this.clickOutside.emit({ this.clickOutside.emit({
target: (event.target || null), target: (event.target || null),

View File

@ -1,7 +1,4 @@
import {Directive, EventEmitter, HostListener, Input, Output} from '@angular/core'; import {Directive, EventEmitter, HostListener, Input, Output} from '@angular/core';
import 'rxjs/add/observable/fromEvent';
import 'rxjs/add/operator/delay';
import 'rxjs/add/operator/do';
@Directive({ @Directive({
selector: '[long-click]' selector: '[long-click]'

Some files were not shown because too many files have changed in this diff Show More