plugins-functionality #43
|
@ -28,6 +28,7 @@ export class ClaimResult {
|
||||||
|
|
||||||
export class ClaimProject {
|
export class ClaimProject {
|
||||||
public funderId: string;
|
public funderId: string;
|
||||||
|
public funderShortname: string;
|
||||||
public funderName: string;
|
public funderName: string;
|
||||||
public acronym: string;
|
public acronym: string;
|
||||||
public startDate: string;
|
public startDate: string;
|
||||||
|
|
|
@ -65,35 +65,36 @@ export class ClaimProjectsSearchFormComponent {
|
||||||
}
|
}
|
||||||
|
|
||||||
search(page,size) {
|
search(page,size) {
|
||||||
if(this.keyword.length == 0){
|
if (this.keyword.length == 0) {
|
||||||
this.showResults =false;
|
this.showResults = false;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.showResults =true;
|
this.showResults = true;
|
||||||
this.openaireResults = [];
|
this.openaireResults = [];
|
||||||
this.openaireResultsStatus = this.errorCodes.LOADING;
|
this.openaireResultsStatus = this.errorCodes.LOADING;
|
||||||
this.prevFilters = this.filters;
|
this.prevFilters = this.filters;
|
||||||
|
|
||||||
//searchProjects (params: string, refineParams:string, page: number, size: number, refineFields:string[] , properties:EnvProperties ):any {
|
//searchProjects (params: string, refineParams:string, page: number, size: number, refineFields:string[] , properties:EnvProperties ):any {
|
||||||
this.sub = this._projectService.searchProjects(this.createOpenaireQueryParams(),(page==1)? this.refineFieldsQuery:null, page, size, (page==1)?this.refineFields:[], this.properties).subscribe(
|
this.sub = this._projectService.advancedSearchProjects(this.createOpenaireQueryParams(), page, size, this.properties, (page == 1) ? this.refineFieldsQuery : null, (page == 1) ? this.refineFields : [], this.createOpenaireRefineQuery()).subscribe(
|
||||||
|
// this.sub = this._projectService.searchProjects(this.createOpenaireQueryParams(),(page==1)? this.refineFieldsQuery:null, page, size, (page==1)?this.refineFields:[], this.properties).subscribe(
|
||||||
data => {
|
data => {
|
||||||
if(data != null) {
|
if (data != null) {
|
||||||
this.openaireResultsPage=page;
|
this.openaireResultsPage = page;
|
||||||
this.openaireResultsNum = data[0];
|
this.openaireResultsNum = data[0];
|
||||||
this.openaireResults =ClaimProjectsSearchFormComponent.openaire2ClaimEntity(data[1], this.properties);
|
this.openaireResults = ClaimProjectsSearchFormComponent.openaire2ClaimEntity(data[1], this.properties);
|
||||||
if(data[2] && data[2].length > 0){
|
if (data[2] && data[2].length > 0) {
|
||||||
this.filters = this.checkSelectedFilters( data[2], this.prevFilters);
|
this.filters = this.checkSelectedFilters(data[2], this.prevFilters);
|
||||||
}
|
|
||||||
|
|
||||||
this.openaireResultsStatus = this.errorCodes.DONE;
|
|
||||||
if(this.openaireResultsNum == 0){
|
|
||||||
this.openaireResultsStatus = this.errorCodes.NONE;
|
|
||||||
this.filters = this.checkSelectedFilters( [], this.prevFilters);
|
|
||||||
}
|
|
||||||
}else {
|
|
||||||
this.openaireResultsStatus = this.errorCodes.ERROR;
|
|
||||||
}
|
}
|
||||||
},
|
|
||||||
|
this.openaireResultsStatus = this.errorCodes.DONE;
|
||||||
|
if (this.openaireResultsNum == 0) {
|
||||||
|
this.openaireResultsStatus = this.errorCodes.NONE;
|
||||||
|
this.filters = this.checkSelectedFilters([], this.prevFilters);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.openaireResultsStatus = this.errorCodes.ERROR;
|
||||||
|
}
|
||||||
|
},
|
||||||
err => {
|
err => {
|
||||||
this.openaireResultsStatus = this.errorCodes.ERROR;
|
this.openaireResultsStatus = this.errorCodes.ERROR;
|
||||||
//console.log(err.status);
|
//console.log(err.status);
|
||||||
|
@ -177,9 +178,10 @@ export class ClaimProjectsSearchFormComponent {
|
||||||
const entity: ClaimEntity = new ClaimEntity();
|
const entity: ClaimEntity = new ClaimEntity();
|
||||||
entity.project = new ClaimProject();
|
entity.project = new ClaimProject();
|
||||||
entity.project.funderId = item.funderId;
|
entity.project.funderId = item.funderId;
|
||||||
entity.project.funderName = item.funderShortname;
|
entity.project.funderShortname = item.funderShortname?item.funderShortname:(entity.project.funderId.split("::")[1]);
|
||||||
|
entity.project.funderName = item.funderName;
|
||||||
entity.id = item.id;
|
entity.id = item.id;
|
||||||
entity.project.url = properties.searchLinkToProject + entity.id;
|
entity.project.url = (item.code !="unidentified") ? properties.searchLinkToProject + entity.id : null;
|
||||||
entity.title = item.title.name;
|
entity.title = item.title.name;
|
||||||
entity.project.acronym = item.acronym;
|
entity.project.acronym = item.acronym;
|
||||||
entity.project.startDate = item.startYear;
|
entity.project.startDate = item.startYear;
|
||||||
|
@ -202,12 +204,16 @@ export class ClaimProjectsSearchFormComponent {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
createOpenaireQueryParams():string {
|
createOpenaireQueryParams(): string {
|
||||||
let query = "";
|
let query = "";
|
||||||
if(this.keyword.length > 0){
|
if (this.keyword.length > 0) {
|
||||||
query += "q=" + StringUtils.quote(StringUtils.URIEncode(this.keyword));
|
// query += "q=" + StringUtils.quote(StringUtils.URIEncode(this.keyword));
|
||||||
|
query += StringUtils.quote(StringUtils.URIEncode(this.keyword));
|
||||||
}
|
}
|
||||||
|
return query;
|
||||||
|
}
|
||||||
|
|
||||||
|
createOpenaireRefineQuery(): string {
|
||||||
/*if(this.startYear.length > 0 ){
|
/*if(this.startYear.length > 0 ){
|
||||||
query+='&fq=projectstartyear exact \"'+this.startYear+'\"'
|
query+='&fq=projectstartyear exact \"'+this.startYear+'\"'
|
||||||
}
|
}
|
||||||
|
@ -215,30 +221,30 @@ export class ClaimProjectsSearchFormComponent {
|
||||||
query+='&fq=projectendyear exact \"'+this.endYear+'\"'
|
query+='&fq=projectendyear exact \"'+this.endYear+'\"'
|
||||||
}*/
|
}*/
|
||||||
let allFqs = "";
|
let allFqs = "";
|
||||||
for (let filter of this.filters){
|
for (let filter of this.filters) {
|
||||||
if(filter.countSelectedValues > 0){
|
if (filter.countSelectedValues > 0) {
|
||||||
let count_selected=0;
|
let count_selected = 0;
|
||||||
let fq = "";
|
let fq = "";
|
||||||
for (let value of filter.values){
|
for (let value of filter.values) {
|
||||||
if(value.selected == true){
|
if (value.selected == true) {
|
||||||
count_selected++;
|
count_selected++;
|
||||||
fq+=(fq.length > 0 ? " " + filter.filterOperator + " ":"" ) + filter.filterId + " exact " + (StringUtils.quote(value.id));
|
fq += (fq.length > 0 ? " " + filter.filterOperator + " " : "") + filter.filterId + " exact " + (StringUtils.quote(value.id));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(count_selected > 0){
|
if (count_selected > 0) {
|
||||||
fq="&fq="+StringUtils.URIEncode(fq);
|
fq = "&fq=" + StringUtils.URIEncode(fq);
|
||||||
allFqs += fq;
|
allFqs += fq;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (let i=0; i<this.rangeFilters.length; i++){
|
for (let i = 0; i < this.rangeFilters.length; i++) {
|
||||||
let filter = this.rangeFilters[i];
|
let filter = this.rangeFilters[i];
|
||||||
//selectedFromValue, selectedToValue, equalityOp, equalityOpFrom, equalityOpTo, filterOp ){
|
//selectedFromValue, selectedToValue, equalityOp, equalityOpFrom, equalityOpTo, filterOp ){
|
||||||
allFqs+= NewSearchPageComponent.createRangeFilterQuery(this.rangeFields[i],filter.selectedFromValue, filter.selectedToValue, " within ", ">=" ,"<=", "and" )
|
allFqs += NewSearchPageComponent.createRangeFilterQuery(this.rangeFields[i], filter.selectedFromValue, filter.selectedToValue, " within ", ">=", "<=", "and")
|
||||||
}
|
}
|
||||||
return query+allFqs;
|
return allFqs + "&type=projects";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public yearChanged() {
|
public yearChanged() {
|
||||||
this.search(this.page, this.size);
|
this.search(this.page, this.size);
|
||||||
|
|
||||||
|
@ -273,20 +279,21 @@ export class ClaimProjectsSearchFormComponent {
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
filter.countAllValues = filter.values.length;
|
||||||
}
|
}
|
||||||
if(filters.length == 0 ){
|
if(filters.length == 0 ){
|
||||||
for(let j=0; j< prevFilters.length ; j++){
|
for(let j=0; j< prevFilters.length ; j++) {
|
||||||
let filter = Object.assign({}, prevFilters[j]);
|
let filter = Object.assign({}, prevFilters[j]);
|
||||||
filter.values = [];
|
filter.values = [];
|
||||||
for(let filterValue of prevFilters[j].values) {
|
for (let filterValue of prevFilters[j].values) {
|
||||||
if(filterValue.selected){
|
if (filterValue.selected) {
|
||||||
filterValue.number = 0;
|
filterValue.number = 0;
|
||||||
filter.values.push(filterValue);
|
filter.values.push(filterValue);
|
||||||
}
|
|
||||||
}
|
|
||||||
filters.push(filter)
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
filter.countAllValues = filter.values.length;
|
||||||
|
filters.push(filter)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return filters;
|
return filters;
|
||||||
}
|
}
|
||||||
|
|
|
@ -156,6 +156,7 @@ export class DirectLinkingComponent {
|
||||||
entity.project.code = project.code;
|
entity.project.code = project.code;
|
||||||
entity.project.endDate = project.endDate;
|
entity.project.endDate = project.endDate;
|
||||||
entity.project.funderId = project.funderId;
|
entity.project.funderId = project.funderId;
|
||||||
|
entity.project.funderShortname = project.funderShortName?project.funderShortName:(entity.project.funderId.split("::")[1]);
|
||||||
entity.project.funderName = project.funderName;
|
entity.project.funderName = project.funderName;
|
||||||
entity.project.fundingLevel0 = project.fundingLevel0;
|
entity.project.fundingLevel0 = project.fundingLevel0;
|
||||||
entity.project.jurisdiction = project.jurisdiction;
|
entity.project.jurisdiction = project.jurisdiction;
|
||||||
|
|
|
@ -508,7 +508,7 @@ export class ClaimInsertComponent {
|
||||||
entity["linksToProjects"] = [];
|
entity["linksToProjects"] = [];
|
||||||
}
|
}
|
||||||
let project: ClaimEntity = results[i];
|
let project: ClaimEntity = results[i];
|
||||||
entity["linksToProjects"].push("info:eu-repo/grantAgreement/" + project.project.funderName + "/" + project.project.fundingLevel0 + "/" + project.project.code + "/" + project.project.jurisdiction + "/" + project.title + "/" + project.project.acronym);
|
entity["linksToProjects"].push("info:eu-repo/grantAgreement/" + project.project.funderShortname + "/" + project.project.fundingLevel0 + "/" + project.project.code + "/" + project.project.jurisdiction + "/" + project.title + "/" + project.project.acronym);
|
||||||
|
|
||||||
} else if (results[i].context) {
|
} else if (results[i].context) {
|
||||||
|
|
||||||
|
|
|
@ -16,10 +16,10 @@ import {ClaimEntity} from '../../claim-utils/claimHelper.class';
|
||||||
</div>
|
</div>
|
||||||
<div class="uk-text-small uk-flex uk-flex-wrap" [style.grid-gap]="shortVersion?'10px':'20px'"
|
<div class="uk-text-small uk-flex uk-flex-wrap" [style.grid-gap]="shortVersion?'10px':'20px'"
|
||||||
[class.uk-margin-small-top]="!shortVersion">
|
[class.uk-margin-small-top]="!shortVersion">
|
||||||
<div *ngIf="entity.project.funderName">
|
<div *ngIf="entity.project.funderName || entity.project.funderShortname">
|
||||||
<span class="uk-text-meta">Funder: </span>{{entity.project.funderName}}
|
<span class="uk-text-meta">Funder: </span>{{entity.project.funderName?entity.project.funderName:entity.project.funderShortname}}
|
||||||
</div>
|
</div>
|
||||||
<div *ngIf="entity.project.code">
|
<div *ngIf="entity.project.code && entity.project.code!='unidentified'">
|
||||||
<span class="uk-text-meta">Project Code: </span>{{entity.project.code}}
|
<span class="uk-text-meta">Project Code: </span>{{entity.project.code}}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -32,7 +32,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="uk-width-2-5@m uk-width-1-1@s uk-text-center" uk-scrollspy-class>
|
<div class="uk-width-2-5@m uk-width-1-1@s uk-text-center" uk-scrollspy-class>
|
||||||
<img src="assets/common-assets/fos/fos-hero-img.svg" loading="lazy">
|
<img src="assets/common-assets/fos/fos-hero-img.svg" loading="lazy" alt="FoS logo">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -89,7 +89,7 @@ import {RouterHelper} from "../../utils/routerHelper.class";
|
||||||
</ng-container>
|
</ng-container>
|
||||||
</span>
|
</span>
|
||||||
<ng-container *ngIf="status">
|
<ng-container *ngIf="status">
|
||||||
<span>{{status}}</span>
|
<span>{{status}} <ng-container *ngIf="currentDate <= endDate && currentDate >= startDate">(M{{calcCurrentMonth}})</ng-container></span>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
<ng-container *ngIf="date">
|
<ng-container *ngIf="date">
|
||||||
<span>{{date | date: 'dd MMM yyyy': 'UTC'}}</span>
|
<span>{{date | date: 'dd MMM yyyy': 'UTC'}}</span>
|
||||||
|
@ -295,7 +295,7 @@ export class EntityMetadataComponent {
|
||||||
return this.projects.map(project => {
|
return this.projects.map(project => {
|
||||||
let value = project.funderShortname ? project.funderShortname : project.funderName;
|
let value = project.funderShortname ? project.funderShortname : project.funderName;
|
||||||
if (project.acronym || project.title) {
|
if (project.acronym || project.title) {
|
||||||
value = value + ' | ' + (project.acronym ? project.acronym :
|
value = (value ? value + ' | ' : '') + (project.acronym ? project.acronym :
|
||||||
(project.title.length > 25 ? (project.title.slice(0, 25) + '...'): project.title));
|
(project.title.length > 25 ? (project.title.slice(0, 25) + '...'): project.title));
|
||||||
}
|
}
|
||||||
// if(project.code) {
|
// if(project.code) {
|
||||||
|
@ -364,4 +364,18 @@ export class EntityMetadataComponent {
|
||||||
this.projectsModal.open();
|
this.projectsModal.open();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public get calcCurrentMonth() {
|
||||||
|
let currentDate = new Date(this.currentDate);
|
||||||
|
let startDate = new Date(this.startDate);
|
||||||
|
|
||||||
|
var months;
|
||||||
|
months = (currentDate.getFullYear() - startDate.getFullYear()) * 12;
|
||||||
|
months -= startDate.getMonth();
|
||||||
|
months += currentDate.getMonth();
|
||||||
|
if(startDate.getDate() > currentDate.getDate()) {
|
||||||
|
months--;
|
||||||
|
}
|
||||||
|
return months <= 0 ? 0 : months+1;
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -5,7 +5,6 @@ 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 {TabPagingComponent} from './tabPaging.component';
|
|
||||||
import {ShowTitleComponent} from './showTitle.component';
|
import {ShowTitleComponent} from './showTitle.component';
|
||||||
import {AddThisComponent} from './addThis.component';
|
import {AddThisComponent} from './addThis.component';
|
||||||
|
|
||||||
|
@ -14,11 +13,11 @@ import {AddThisComponent} from './addThis.component';
|
||||||
CommonModule, FormsModule, RouterModule
|
CommonModule, FormsModule, RouterModule
|
||||||
],
|
],
|
||||||
declarations: [
|
declarations: [
|
||||||
TabPagingComponent, ShowTitleComponent, AddThisComponent
|
ShowTitleComponent, AddThisComponent
|
||||||
],
|
],
|
||||||
providers:[],
|
providers:[],
|
||||||
exports: [
|
exports: [
|
||||||
TabPagingComponent, ShowTitleComponent, AddThisComponent
|
ShowTitleComponent, AddThisComponent
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
export class LandingModule { }
|
export class LandingModule { }
|
||||||
|
|
|
@ -1,24 +0,0 @@
|
||||||
import {Component, Input, Output, EventEmitter} from '@angular/core';
|
|
||||||
|
|
||||||
@Component({
|
|
||||||
selector: 'tabPaging',
|
|
||||||
template: `
|
|
||||||
<div class="uk-panel" *ngIf="!showAll && length > 10">
|
|
||||||
<a (click)="changeShowAll.emit({value: true});">
|
|
||||||
<div class="uk-float-right">view all {{length | number}}</div>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
`
|
|
||||||
})
|
|
||||||
|
|
||||||
export class TabPagingComponent {
|
|
||||||
@Input() showAll: boolean;
|
|
||||||
@Input() length: number;
|
|
||||||
@Output() changeShowAll: EventEmitter<any> = new EventEmitter();
|
|
||||||
|
|
||||||
constructor () {
|
|
||||||
}
|
|
||||||
|
|
||||||
ngOnInit() {
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -18,7 +18,7 @@ import {ResultPreviewModule} from "../../../utils/result-preview/result-preview.
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [
|
imports: [
|
||||||
CommonModule, FormsModule, ResultLandingUtilsModule,
|
CommonModule, FormsModule, ResultLandingUtilsModule,
|
||||||
PagingModule, ErrorMessagesModule, ShowAuthorsModule, LandingModule, NoLoadPaging, ResultPreviewModule
|
PagingModule, ErrorMessagesModule, ShowAuthorsModule, NoLoadPaging, ResultPreviewModule
|
||||||
],
|
],
|
||||||
declarations: [
|
declarations: [
|
||||||
OrganizationsDeletedByInferenceComponent
|
OrganizationsDeletedByInferenceComponent
|
||||||
|
|
|
@ -145,8 +145,7 @@ export class DeletedByInferenceService {
|
||||||
if(author.orcid_pending) {
|
if(author.orcid_pending) {
|
||||||
author.orcid_pending = author.orcid_pending.toUpperCase();
|
author.orcid_pending = author.orcid_pending.toUpperCase();
|
||||||
}
|
}
|
||||||
|
if(result['authors'][author.rank] && result['authors'][author.rank].fullName == author.content) {
|
||||||
if(result['authors'][author.rank] && results['authors'][author.rank].fullName == author.content) {
|
|
||||||
if(!author.orcid && result['authors'][author.rank].orcid) {
|
if(!author.orcid && result['authors'][author.rank].orcid) {
|
||||||
author.orcid = result['authors'][author.rank].orcid;
|
author.orcid = result['authors'][author.rank].orcid;
|
||||||
} else if(!author.orcid_pending && result['authors'][author.rank].orcid_pending) {
|
} else if(!author.orcid_pending && result['authors'][author.rank].orcid_pending) {
|
||||||
|
|
|
@ -38,6 +38,7 @@ import {SafeHtmlPipeModule} from '../../utils/pipes/safeHTMLPipe.module';
|
||||||
import {EntityActionsModule} from "../../utils/entity-actions/entity-actions.module";
|
import {EntityActionsModule} from "../../utils/entity-actions/entity-actions.module";
|
||||||
import {ResultLandingRoutingModule} from "./resultLanding-routing.module";
|
import {ResultLandingRoutingModule} from "./resultLanding-routing.module";
|
||||||
import {OrcidCoreModule} from "../../orcid/orcid-core.module";
|
import {OrcidCoreModule} from "../../orcid/orcid-core.module";
|
||||||
|
import {SearchTabModule} from "../../utils/tabs/contents/search-tab.module";
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [
|
imports: [
|
||||||
|
|
|
@ -20,7 +20,7 @@ import {StakeholderBaseComponent} from "../../utils/stakeholder-base.component";
|
||||||
template: `
|
template: `
|
||||||
<div class="uk-margin-medium-bottom">
|
<div class="uk-margin-medium-bottom">
|
||||||
<form *ngIf="stakeholderFb" [formGroup]="stakeholderFb">
|
<form *ngIf="stakeholderFb" [formGroup]="stakeholderFb">
|
||||||
<div class="uk-grid uk-grid-large" uk-grid>
|
<div class="uk-grid" uk-grid>
|
||||||
<div class="uk-width-1-2@m">
|
<div class="uk-width-1-2@m">
|
||||||
<div input id="name" [formInput]="stakeholderFb.get('name')"
|
<div input id="name" [formInput]="stakeholderFb.get('name')"
|
||||||
placeholder="Name"></div>
|
placeholder="Name"></div>
|
||||||
|
@ -126,6 +126,19 @@ import {StakeholderBaseComponent} from "../../utils/stakeholder-base.component";
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div *ngIf="canChangeCopy" class="uk-width-1-1">
|
||||||
|
<h6>Instance Type</h6>
|
||||||
|
<div class="uk-width-auto uk-flex uk-flex-middle">
|
||||||
|
<label class="uk-margin-right">
|
||||||
|
<input type="radio" [value]="true" formControlName="copy"/>
|
||||||
|
<span class="uk-margin-xsmall-left">Copy</span>
|
||||||
|
</label>
|
||||||
|
<label class="uk-margin-right">
|
||||||
|
<input type="radio" [value]="false" formControlName="copy"/>
|
||||||
|
<span class="uk-margin-xsmall-left">Reference</span>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
<div #notify [class.uk-hidden]="!stakeholderFb" notify-form
|
<div #notify [class.uk-hidden]="!stakeholderFb" notify-form
|
||||||
|
@ -145,6 +158,7 @@ export class EditStakeholderComponent extends StakeholderBaseComponent {
|
||||||
public stakeholder: Stakeholder;
|
public stakeholder: Stakeholder;
|
||||||
public isDefault: boolean;
|
public isDefault: boolean;
|
||||||
public isNew: boolean;
|
public isNew: boolean;
|
||||||
|
public isFull: boolean;
|
||||||
public loading: boolean = false;
|
public loading: boolean = false;
|
||||||
public typesByRole: Option[];
|
public typesByRole: Option[];
|
||||||
public statsProfiles: string[];
|
public statsProfiles: string[];
|
||||||
|
@ -172,7 +186,7 @@ export class EditStakeholderComponent extends StakeholderBaseComponent {
|
||||||
super.ngOnDestroy();
|
super.ngOnDestroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
public init(stakeholder: Stakeholder, alias: string[], defaultStakeholders: Stakeholder[], isDefault: boolean, isNew: boolean) {
|
public init(stakeholder: Stakeholder, alias: string[], defaultStakeholders: Stakeholder[], isDefault: boolean, isNew: boolean, isFull: boolean = false) {
|
||||||
this.reset();
|
this.reset();
|
||||||
this.deleteCurrentPhoto = false;
|
this.deleteCurrentPhoto = false;
|
||||||
this.stakeholder = stakeholder;
|
this.stakeholder = stakeholder;
|
||||||
|
@ -183,6 +197,7 @@ export class EditStakeholderComponent extends StakeholderBaseComponent {
|
||||||
this.defaultStakeholders = defaultStakeholders;
|
this.defaultStakeholders = defaultStakeholders;
|
||||||
this.isDefault = isDefault;
|
this.isDefault = isDefault;
|
||||||
this.isNew = isNew;
|
this.isNew = isNew;
|
||||||
|
this.isFull = isFull;
|
||||||
this.subscriptions.push(this.userManagementService.getUserInfo().subscribe(user => {
|
this.subscriptions.push(this.userManagementService.getUserInfo().subscribe(user => {
|
||||||
this.user = user;
|
this.user = user;
|
||||||
if (this.isCurator) {
|
if (this.isCurator) {
|
||||||
|
@ -220,6 +235,7 @@ export class EditStakeholderComponent extends StakeholderBaseComponent {
|
||||||
funderType: this.fb.control(this.stakeholder.funderType),
|
funderType: this.fb.control(this.stakeholder.funderType),
|
||||||
topics: this.fb.control(this.stakeholder.topics),
|
topics: this.fb.control(this.stakeholder.topics),
|
||||||
isUpload: this.fb.control(this.stakeholder.isUpload),
|
isUpload: this.fb.control(this.stakeholder.isUpload),
|
||||||
|
copy: this.fb.control(this.stakeholder.copy),
|
||||||
logoUrl: this.fb.control(this.stakeholder.logoUrl),
|
logoUrl: this.fb.control(this.stakeholder.logoUrl),
|
||||||
});
|
});
|
||||||
if (this.stakeholder.isUpload) {
|
if (this.stakeholder.isUpload) {
|
||||||
|
@ -246,7 +262,7 @@ export class EditStakeholderComponent extends StakeholderBaseComponent {
|
||||||
this.subscriptions.push(this.stakeholderFb.get('type').valueChanges.subscribe(value => {
|
this.subscriptions.push(this.stakeholderFb.get('type').valueChanges.subscribe(value => {
|
||||||
this.onTypeChange(value, defaultStakeholders);
|
this.onTypeChange(value, defaultStakeholders);
|
||||||
}));
|
}));
|
||||||
this.stakeholderFb.setControl('defaultId', this.fb.control(stakeholder.defaultId, (this.isDefault && !this.isNew) ? [] : Validators.required));
|
this.stakeholderFb.setControl('defaultId', this.fb.control(this.stakeholder.defaultId, (this.isDefault && !this.isNew) ? [] : Validators.required));
|
||||||
if (!this.isNew) {
|
if (!this.isNew) {
|
||||||
this.notification = NotificationUtils.editStakeholder(this.user.firstname + ' ' + this.user.lastname, this.stakeholder.name);
|
this.notification = NotificationUtils.editStakeholder(this.user.firstname + ' ' + this.user.lastname, this.stakeholder.name);
|
||||||
this.notify.reset(this.notification.message);
|
this.notify.reset(this.notification.message);
|
||||||
|
@ -304,6 +320,13 @@ export class EditStakeholderComponent extends StakeholderBaseComponent {
|
||||||
return this.isNew && this.stakeholderFb.get('type').valid && !!this.defaultStakeholdersOptions;
|
return this.isNew && this.stakeholderFb.get('type').valid && !!this.defaultStakeholdersOptions;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public get canChangeCopy(): boolean {
|
||||||
|
return this.isCurator &&
|
||||||
|
!this.stakeholderFb.get('isDefault').getRawValue() &&
|
||||||
|
this.stakeholderFb.get('defaultId').getRawValue() &&
|
||||||
|
this.stakeholderFb.get('defaultId').getRawValue() !== '-1';
|
||||||
|
}
|
||||||
|
|
||||||
reset() {
|
reset() {
|
||||||
this.uploadError = null;
|
this.uploadError = null;
|
||||||
this.stakeholderFb = null;
|
this.stakeholderFb = null;
|
||||||
|
@ -350,15 +373,15 @@ export class EditStakeholderComponent extends StakeholderBaseComponent {
|
||||||
|
|
||||||
public saveStakeholder(callback: Function, errorCallback: Function = null) {
|
public saveStakeholder(callback: Function, errorCallback: Function = null) {
|
||||||
if (this.isNew) {
|
if (this.isNew) {
|
||||||
let defaultStakeholder = this.defaultStakeholders.find(value => value._id === this.stakeholderFb.getRawValue().defaultId);
|
let copyId = null;
|
||||||
this.stakeholderFb.setValue(this.stakeholderUtils.createFunderFromDefaultProfile(this.stakeholderFb.getRawValue(),
|
|
||||||
(defaultStakeholder ? defaultStakeholder.topics : []), this.stakeholderFb.getRawValue().isDefault));
|
|
||||||
this.removePhoto();
|
|
||||||
if (this.stakeholderFb.getRawValue().isDefault) {
|
if (this.stakeholderFb.getRawValue().isDefault) {
|
||||||
|
copyId = this.stakeholderFb.getRawValue().defaultId !== '-1'?this.stakeholderFb.getRawValue().defaultId:null;
|
||||||
this.stakeholderFb.get('defaultId').setValue(null);
|
this.stakeholderFb.get('defaultId').setValue(null);
|
||||||
|
this.stakeholderFb.removeControl('isDefault');
|
||||||
}
|
}
|
||||||
|
this.removePhoto();
|
||||||
this.subscriptions.push(this.stakeholderService.buildStakeholder(this.properties.monitorServiceAPIURL,
|
this.subscriptions.push(this.stakeholderService.buildStakeholder(this.properties.monitorServiceAPIURL,
|
||||||
this.stakeholderFb.getRawValue()).subscribe(stakeholder => {
|
this.stakeholderFb.getRawValue(), copyId).subscribe(stakeholder => {
|
||||||
this.notification.entity = stakeholder._id;
|
this.notification.entity = stakeholder._id;
|
||||||
this.notification.stakeholder = stakeholder.alias;
|
this.notification.stakeholder = stakeholder.alias;
|
||||||
this.notification.stakeholderType = stakeholder.type;
|
this.notification.stakeholderType = stakeholder.type;
|
||||||
|
@ -375,7 +398,7 @@ export class EditStakeholderComponent extends StakeholderBaseComponent {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
}));
|
}));
|
||||||
} else {
|
} else {
|
||||||
this.subscriptions.push(this.stakeholderService.saveElement(this.properties.monitorServiceAPIURL, this.stakeholderFb.getRawValue()).subscribe(stakeholder => {
|
this.subscriptions.push(this.stakeholderService.saveElement(this.properties.monitorServiceAPIURL, this.stakeholderFb.getRawValue(), [], this.isFull).subscribe(stakeholder => {
|
||||||
this.notification.entity = stakeholder._id;
|
this.notification.entity = stakeholder._id;
|
||||||
this.notification.stakeholder = stakeholder.alias;
|
this.notification.stakeholder = stakeholder.alias;
|
||||||
this.notification.stakeholderType = stakeholder.type;
|
this.notification.stakeholderType = stakeholder.type;
|
||||||
|
|
|
@ -5,9 +5,10 @@ import {InputModule} from "../../../sharedComponents/input/input.module";
|
||||||
import {ReactiveFormsModule} from "@angular/forms";
|
import {ReactiveFormsModule} from "@angular/forms";
|
||||||
import {IconsModule} from "../../../utils/icons/icons.module";
|
import {IconsModule} from "../../../utils/icons/icons.module";
|
||||||
import {NotifyFormModule} from "../../../notifications/notify-form/notify-form.module";
|
import {NotifyFormModule} from "../../../notifications/notify-form/notify-form.module";
|
||||||
|
import {MatSlideToggleModule} from "@angular/material/slide-toggle";
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [CommonModule, InputModule, ReactiveFormsModule, IconsModule, NotifyFormModule],
|
imports: [CommonModule, InputModule, ReactiveFormsModule, IconsModule, NotifyFormModule, MatSlideToggleModule],
|
||||||
declarations: [EditStakeholderComponent],
|
declarations: [EditStakeholderComponent],
|
||||||
exports: [EditStakeholderComponent]
|
exports: [EditStakeholderComponent]
|
||||||
})
|
})
|
||||||
|
|
|
@ -48,7 +48,7 @@ export class GeneralComponent extends BaseComponent implements OnInit {
|
||||||
}
|
}
|
||||||
|
|
||||||
public reset() {
|
public reset() {
|
||||||
this.editStakeholderComponent.init(this.stakeholder, this.alias, this.defaultStakeholders, this.stakeholder.defaultId == null, false)
|
this.editStakeholderComponent.init(this.stakeholder, this.alias, this.defaultStakeholders, this.stakeholder.defaultId == null, false, true)
|
||||||
}
|
}
|
||||||
|
|
||||||
public save() {
|
public save() {
|
||||||
|
|
|
@ -31,7 +31,7 @@
|
||||||
<div *ngIf="!loading" uk-height-match="target: .titleContainer; row: false">
|
<div *ngIf="!loading" uk-height-match="target: .titleContainer; row: false">
|
||||||
<div uk-height-match="target: .logoContainer; row: false">
|
<div uk-height-match="target: .logoContainer; row: false">
|
||||||
<div *ngIf="tab != 'profiles' && isCurator()" class="uk-section">
|
<div *ngIf="tab != 'profiles' && isCurator()" class="uk-section">
|
||||||
<div class="uk-flex uk-flex-middle uk-flex-between uk-margin-small-bottom">
|
<div class="uk-flex uk-flex-middle uk-flex-between uk-margin-bottom">
|
||||||
<h4 class="uk-margin-remove">Profile Templates</h4>
|
<h4 class="uk-margin-remove">Profile Templates</h4>
|
||||||
<paging-no-load *ngIf="displayDefaultStakeholders?.length > pageSize"
|
<paging-no-load *ngIf="displayDefaultStakeholders?.length > pageSize"
|
||||||
(pageChange)="updateCurrentTemplatesPage($event)"
|
(pageChange)="updateCurrentTemplatesPage($event)"
|
||||||
|
@ -39,8 +39,7 @@
|
||||||
[totalResults]="displayDefaultStakeholders.length">
|
[totalResults]="displayDefaultStakeholders.length">
|
||||||
</paging-no-load>
|
</paging-no-load>
|
||||||
</div>
|
</div>
|
||||||
<div class="uk-grid uk-child-width-1-3@l uk-child-width-1-2@m uk-child-width-1-1 uk-grid-match"
|
<div class="uk-grid uk-child-width-1-3@l uk-child-width-1-2@m uk-child-width-1-1 uk-grid-match" uk-grid>
|
||||||
uk-grid>
|
|
||||||
<ng-template ngFor
|
<ng-template ngFor
|
||||||
[ngForOf]="displayDefaultStakeholders.slice((currentTemplatesPage-1)*pageSize, currentTemplatesPage*pageSize)"
|
[ngForOf]="displayDefaultStakeholders.slice((currentTemplatesPage-1)*pageSize, currentTemplatesPage*pageSize)"
|
||||||
let-stakeholder>
|
let-stakeholder>
|
||||||
|
@ -59,7 +58,7 @@
|
||||||
</h4>
|
</h4>
|
||||||
</div>
|
</div>
|
||||||
<div *ngIf="tab != 'templates' && isManager()" class="uk-section">
|
<div *ngIf="tab != 'templates' && isManager()" class="uk-section">
|
||||||
<div class="uk-flex uk-flex-middle uk-flex-between uk-margin-small-bottom">
|
<div class="uk-flex uk-flex-middle uk-flex-between uk-margin-bottom">
|
||||||
<h4 class="uk-margin-remove">Profiles</h4>
|
<h4 class="uk-margin-remove">Profiles</h4>
|
||||||
<paging-no-load *ngIf="displayStakeholders?.length > pageSize"
|
<paging-no-load *ngIf="displayStakeholders?.length > pageSize"
|
||||||
(pageChange)="updateCurrentPage($event)"
|
(pageChange)="updateCurrentPage($event)"
|
||||||
|
|
|
@ -4,9 +4,9 @@
|
||||||
<div class="uk-grid uk-grid-large uk-child-width-1-1" uk-grid>
|
<div class="uk-grid uk-grid-large uk-child-width-1-1" uk-grid>
|
||||||
<div *ngFor="let number of numbers; let i=index">
|
<div *ngFor="let number of numbers; let i=index">
|
||||||
<div class="section">
|
<div class="section">
|
||||||
<div class="tools">
|
<div *ngIf="isEditable" class="tools">
|
||||||
<div class="uk-flex uk-flex-middle">
|
<div class="uk-flex uk-flex-middle">
|
||||||
<a [class.uk-disabled]="editing" class="" (click)="createSection(i, 'number')"
|
<a *ngIf="isCurator" [class.uk-disabled]="editing" class="" (click)="createSection(i, 'number')"
|
||||||
uk-tooltip="Create a new section">
|
uk-tooltip="Create a new section">
|
||||||
<icon name="add" [flex]="true"></icon>
|
<icon name="add" [flex]="true"></icon>
|
||||||
</a>
|
</a>
|
||||||
|
@ -17,25 +17,27 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div *ngIf="numberSections.at(i)" class="uk-margin-medium-bottom">
|
<div *ngIf="numberSections.at(i)" class="uk-margin-medium-bottom">
|
||||||
<div input [formInput]="numberSections.at(i).get('title')"
|
<div *ngIf="isEditable" input [formInput]="numberSections.at(i).get('title')"
|
||||||
(focusEmitter)="saveSection($event, numberSections.at(i), i, 'number')"
|
(focusEmitter)="saveSection($event, numberSections.at(i), i, 'number')"
|
||||||
class="uk-width-1-3@m uk-width-1-1" placeholder="Title" inputClass="border-bottom"></div>
|
class="uk-width-1-3@m uk-width-1-1" placeholder="Title" inputClass="border-bottom"></div>
|
||||||
|
<h5 *ngIf="!isEditable" class="uk-margin-remove">{{numberSections.at(i).get('title').value}}</h5>
|
||||||
</div>
|
</div>
|
||||||
<div [id]="'number-' + number._id" class="uk-grid uk-grid-small uk-grid-match"
|
<div [id]="'number-' + number._id" class="uk-grid uk-grid-small uk-grid-match"
|
||||||
uk-sortable="group: number" uk-grid>
|
[attr.uk-sortable]="isEditable ? 'group: number': null" uk-grid>
|
||||||
<ng-template ngFor [ngForOf]="number.indicators" let-indicator let-j="index">
|
<ng-template ngFor [ngForOf]="number.indicators" let-indicator let-j="index">
|
||||||
<div *ngIf="indicator" [id]="indicator._id"
|
<div *ngIf="indicator" [id]="indicator._id"
|
||||||
[ngClass]="getNumberClassBySize(indicator.width)">
|
[ngClass]="getNumberClassBySize(indicator.width)">
|
||||||
<div class="uk-card uk-card-default uk-padding-small number-card uk-position-relative">
|
<div class="uk-card uk-card-default uk-padding-small number-card uk-position-relative">
|
||||||
<div *ngIf="!dragging"
|
<div *ngIf="!dragging"
|
||||||
class="uk-position-top-right uk-margin-small-right uk-margin-small-top">
|
class="uk-position-top-right uk-margin-small-right uk-margin-small-top">
|
||||||
<a class="uk-link-reset uk-flex uk-flex-middle" [class.uk-disabled]="editing">
|
<icon *ngIf="!isEditable && showVisibility" [flex]="true"
|
||||||
<icon *ngIf="showVisibility" [flex]="true"
|
[name]="stakeholderUtils.visibilityIcon.get(indicator.visibility)"
|
||||||
[name]="stakeholderUtils.visibilityIcon.get(indicator.visibility)"
|
ratio="0.6"></icon>
|
||||||
ratio="0.6"></icon>
|
<a *ngIf="isEditable && (isCurator || showVisibility)" class="uk-link-reset uk-flex uk-flex-middle" [class.uk-disabled]="editing">
|
||||||
|
<icon *ngIf="showVisibility" [flex]="true" [name]="stakeholderUtils.visibilityIcon.get(indicator.visibility)" ratio="0.6"></icon>
|
||||||
<icon [flex]="true" name="more_vert"></icon>
|
<icon [flex]="true" name="more_vert"></icon>
|
||||||
</a>
|
</a>
|
||||||
<div #element class="uk-dropdown"
|
<div #element *ngIf="isEditable && (isCurator || showVisibility)" class="uk-dropdown"
|
||||||
uk-dropdown="mode: click; pos: bottom-left; offset: 5; delay-hide: 0">
|
uk-dropdown="mode: click; pos: bottom-left; offset: 5; delay-hide: 0">
|
||||||
<ul class="uk-nav uk-dropdown-nav">
|
<ul class="uk-nav uk-dropdown-nav">
|
||||||
<ng-container *ngIf="isCurator">
|
<ng-container *ngIf="isCurator">
|
||||||
|
@ -79,7 +81,7 @@
|
||||||
</div>
|
</div>
|
||||||
</ng-template>
|
</ng-template>
|
||||||
</div>
|
</div>
|
||||||
<div *ngIf="isCurator" class="uk-margin-top">
|
<div *ngIf="isCurator && isEditable" class="uk-margin-top">
|
||||||
<div class="uk-grid uk-grid-small" uk-grid>
|
<div class="uk-grid uk-grid-small" uk-grid>
|
||||||
<div [ngClass]="getNumberClassBySize('small')">
|
<div [ngClass]="getNumberClassBySize('small')">
|
||||||
<a class="uk-card uk-card-default number-card uk-padding-small uk-flex uk-flex-middle uk-link-reset"
|
<a class="uk-card uk-card-default number-card uk-padding-small uk-flex uk-flex-middle uk-link-reset"
|
||||||
|
@ -96,7 +98,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div *ngIf="isEditable && isCurator">
|
||||||
<ng-container *ngTemplateOutlet="new_section; context:{type: 'number'}"></ng-container>
|
<ng-container *ngTemplateOutlet="new_section; context:{type: 'number'}"></ng-container>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -106,9 +108,9 @@
|
||||||
<div class="uk-grid uk-grid-large uk-child-width-1-1" uk-grid>
|
<div class="uk-grid uk-grid-large uk-child-width-1-1" uk-grid>
|
||||||
<div *ngFor="let chart of charts; let i=index">
|
<div *ngFor="let chart of charts; let i=index">
|
||||||
<div class="section uk-margin-top uk-padding-small">
|
<div class="section uk-margin-top uk-padding-small">
|
||||||
<div class="tools">
|
<div *ngIf="isEditable" class="tools">
|
||||||
<div class="uk-flex uk-flex-middle">
|
<div class="uk-flex uk-flex-middle">
|
||||||
<a [class.uk-disabled]="editing" class="" (click)="createSection(i)"
|
<a *ngIf="isCurator" [class.uk-disabled]="editing" class="" (click)="createSection(i)"
|
||||||
title="Create a new section">
|
title="Create a new section">
|
||||||
<icon name="add" [flex]="true"></icon>
|
<icon name="add" [flex]="true"></icon>
|
||||||
</a>
|
</a>
|
||||||
|
@ -120,25 +122,27 @@
|
||||||
</div>
|
</div>
|
||||||
<div *ngIf="chartSections.at(i)"
|
<div *ngIf="chartSections.at(i)"
|
||||||
class="uk-margin-medium-bottom">
|
class="uk-margin-medium-bottom">
|
||||||
<div input [formInput]="chartSections.at(i).get('title')"
|
<div *ngIf="isEditable" input [formInput]="chartSections.at(i).get('title')"
|
||||||
(focusEmitter)="saveSection($event, chartSections.at(i), i)"
|
(focusEmitter)="saveSection($event, chartSections.at(i), i)"
|
||||||
class="uk-width-1-3@m uk-width-1-1" placeholder="Title" inputClass="border-bottom"></div>
|
class="uk-width-1-3@m uk-width-1-1" placeholder="Title" inputClass="border-bottom"></div>
|
||||||
|
<h5 *ngIf="!isEditable" class="uk-margin-remove">{{chartSections.at(i).get('title').value}}</h5>
|
||||||
</div>
|
</div>
|
||||||
<div [id]="'chart-' + chart._id" class="uk-grid uk-grid-small uk-grid-match"
|
<div [id]="'chart-' + chart._id" class="uk-grid uk-grid-small uk-grid-match"
|
||||||
uk-sortable="group: chart" uk-grid>
|
[attr.uk-sortable]="isEditable ? 'group: chart': null" uk-grid>
|
||||||
<ng-template ngFor [ngForOf]="chart.indicators" let-indicator let-j="index">
|
<ng-template ngFor [ngForOf]="chart.indicators" let-indicator let-j="index">
|
||||||
<div *ngIf="indicator" [id]="indicator._id"
|
<div *ngIf="indicator" [id]="indicator._id"
|
||||||
[ngClass]="getChartClassBySize(indicator.width)">
|
[ngClass]="getChartClassBySize(indicator.width)">
|
||||||
<div class="uk-card uk-card-default uk-card-body uk-position-relative">
|
<div class="uk-card uk-card-default uk-card-body uk-position-relative">
|
||||||
<div *ngIf="!dragging"
|
<div *ngIf="!dragging"
|
||||||
class="uk-position-top-right uk-margin-small-right uk-margin-small-top">
|
class="uk-position-top-right uk-margin-small-right uk-margin-small-top">
|
||||||
<a class="uk-link-reset uk-flex uk-flex-middle" [class.uk-disabled]="editing">
|
<icon *ngIf="!isEditable && showVisibility" [flex]="true"
|
||||||
<icon *ngIf="showVisibility" [flex]="true"
|
[name]="stakeholderUtils.visibilityIcon.get(indicator.visibility)"
|
||||||
[name]="stakeholderUtils.visibilityIcon.get(indicator.visibility)"
|
ratio="0.6"></icon>
|
||||||
ratio="0.6"></icon>
|
<a *ngIf="isEditable && (isCurator || showVisibility)" class="uk-link-reset uk-flex uk-flex-middle" [class.uk-disabled]="editing">
|
||||||
|
<icon *ngIf="showVisibility" [flex]="true" [name]="stakeholderUtils.visibilityIcon.get(indicator.visibility)" ratio="0.6"></icon>
|
||||||
<icon [flex]="true" name="more_vert"></icon>
|
<icon [flex]="true" name="more_vert"></icon>
|
||||||
</a>
|
</a>
|
||||||
<div #element class="uk-dropdown"
|
<div #element *ngIf="isEditable && (isCurator || showVisibility)" class="uk-dropdown"
|
||||||
uk-dropdown="mode: click; pos: bottom-left; offset: 5; delay-hide: 0">
|
uk-dropdown="mode: click; pos: bottom-left; offset: 5; delay-hide: 0">
|
||||||
<ul class="uk-nav uk-dropdown-nav">
|
<ul class="uk-nav uk-dropdown-nav">
|
||||||
<ng-container *ngIf="isCurator">
|
<ng-container *ngIf="isCurator">
|
||||||
|
@ -214,7 +218,7 @@
|
||||||
</div>
|
</div>
|
||||||
</ng-template>
|
</ng-template>
|
||||||
</div>
|
</div>
|
||||||
<div *ngIf="isCurator" class="uk-margin-top">
|
<div *ngIf="isCurator && isEditable" class="uk-margin-top">
|
||||||
<div class="uk-grid uk-grid-small uk-grid-match" uk-grid>
|
<div class="uk-grid uk-grid-small uk-grid-match" uk-grid>
|
||||||
<div [ngClass]="getChartClassBySize('small')">
|
<div [ngClass]="getChartClassBySize('small')">
|
||||||
<div class=" uk-card uk-card-default uk-card-body clickable"
|
<div class=" uk-card uk-card-default uk-card-body clickable"
|
||||||
|
@ -236,7 +240,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div *ngIf="isEditable && isCurator">
|
||||||
<ng-container *ngTemplateOutlet="new_section; context:{type: 'chart'}"></ng-container>
|
<ng-container *ngTemplateOutlet="new_section; context:{type: 'chart'}"></ng-container>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -272,7 +276,7 @@
|
||||||
<hr class="uk-width-1-1">
|
<hr class="uk-width-1-1">
|
||||||
<div *ngIf="numberIndicatorPaths" formArrayName="indicatorPaths">
|
<div *ngIf="numberIndicatorPaths" formArrayName="indicatorPaths">
|
||||||
<div *ngIf="stakeholderUtils.hasMultiNumberIndicatorPaths" class="uk-margin-medium-bottom">
|
<div *ngIf="stakeholderUtils.hasMultiNumberIndicatorPaths" class="uk-margin-medium-bottom">
|
||||||
<ul #transitionGroup class="uk-subnav uk-subnav-pill uk-subnav-small" transition-group>
|
<ul #numbersTransition class="uk-subnav uk-subnav-pill uk-subnav-small" transition-group>
|
||||||
<li *ngFor="let indicatorPath of numberIndicatorPaths.controls; let i=index"
|
<li *ngFor="let indicatorPath of numberIndicatorPaths.controls; let i=index"
|
||||||
class="uk-visible-toggle uk-flex uk-margin-small-top" transition-group-item
|
class="uk-visible-toggle uk-flex uk-margin-small-top" transition-group-item
|
||||||
[class.uk-active]="(!indicator.activePath && i == 0) || indicator.activePath === i">
|
[class.uk-active]="(!indicator.activePath && i == 0) || indicator.activePath === i">
|
||||||
|
@ -288,14 +292,13 @@
|
||||||
class="uk-flex uk-flex-column uk-flex-center uk-margin-small-left"
|
class="uk-flex uk-flex-column uk-flex-center uk-margin-small-left"
|
||||||
[class.uk-invisible-hover]="indicator.activePath !== i"
|
[class.uk-invisible-hover]="indicator.activePath !== i"
|
||||||
(click)="$event.stopPropagation();$event.preventDefault()">
|
(click)="$event.stopPropagation();$event.preventDefault()">
|
||||||
<a class="uk-link-reset uk-flex uk-flex-middle">
|
<a *ngIf="isCurator" class="uk-link-reset uk-flex uk-flex-middle">
|
||||||
<icon [flex]="true" name="more_vert"></icon>
|
<icon [flex]="true" name="more_vert"></icon>
|
||||||
</a>
|
</a>
|
||||||
<div #element
|
<div #element uk-dropdown="mode: click; pos: bottom-left; offset: 5; delay-hide: 0;">
|
||||||
uk-dropdown="mode: click; pos: bottom-left; offset: 5; delay-hide: 0; container: .uk-modal-body">
|
|
||||||
<ul class="uk-nav uk-dropdown-nav">
|
<ul class="uk-nav uk-dropdown-nav">
|
||||||
<li *ngIf="i > 0">
|
<li *ngIf="i > 0">
|
||||||
<a (click)="hide(element);moveIndicatorPath(numberIndicatorFb, numberIndicatorPaths, i)">
|
<a (click)="hide(element);moveIndicatorPath(numberIndicatorFb, 'number', i)">
|
||||||
<div class="uk-flex uk-flex-middle">
|
<div class="uk-flex uk-flex-middle">
|
||||||
<icon [flex]="true" name="west" ratio="0.6"></icon>
|
<icon [flex]="true" name="west" ratio="0.6"></icon>
|
||||||
<span class="uk-margin-small-left uk-width-expand">Move Left</span>
|
<span class="uk-margin-small-left uk-width-expand">Move Left</span>
|
||||||
|
@ -303,7 +306,7 @@
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<li *ngIf="i < numberIndicatorPaths.length - 1">
|
<li *ngIf="i < numberIndicatorPaths.length - 1">
|
||||||
<a (click)="hide(element);moveIndicatorPath(numberIndicatorFb, numberIndicatorPaths, i, i + 1)">
|
<a (click)="hide(element);moveIndicatorPath(numberIndicatorFb, 'number', i, i + 1)">
|
||||||
<div class="uk-flex uk-flex-middle">
|
<div class="uk-flex uk-flex-middle">
|
||||||
<icon [flex]="true" name="east" ratio="0.6"></icon>
|
<icon [flex]="true" name="east" ratio="0.6"></icon>
|
||||||
<span class="uk-margin-small-left uk-width-expand">Move Right</span>
|
<span class="uk-margin-small-left uk-width-expand">Move Right</span>
|
||||||
|
@ -475,7 +478,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div *ngIf="chartIndicatorPaths" formArrayName="indicatorPaths" class="uk-width-1-1">
|
<div *ngIf="chartIndicatorPaths" formArrayName="indicatorPaths" class="uk-width-1-1">
|
||||||
<div *ngIf="stakeholderUtils.hasMultiChartIndicatorPaths" class="uk-margin-medium-bottom">
|
<div *ngIf="stakeholderUtils.hasMultiChartIndicatorPaths" class="uk-margin-medium-bottom">
|
||||||
<ul #transitionGroup class="uk-subnav uk-subnav-pill uk-subnav-small" transition-group>
|
<ul #chartsTransition class="uk-subnav uk-subnav-pill uk-subnav-small" transition-group>
|
||||||
<li *ngFor="let indicatorPath of chartIndicatorPaths.controls; let i=index"
|
<li *ngFor="let indicatorPath of chartIndicatorPaths.controls; let i=index"
|
||||||
class="uk-visible-toggle uk-flex uk-margin-small-top" transition-group-item
|
class="uk-visible-toggle uk-flex uk-margin-small-top" transition-group-item
|
||||||
[class.uk-active]="(!indicator.activePath && i == 0) || indicator.activePath === i">
|
[class.uk-active]="(!indicator.activePath && i == 0) || indicator.activePath === i">
|
||||||
|
@ -486,14 +489,13 @@
|
||||||
class="uk-flex uk-flex-column uk-flex-center uk-margin-small-left"
|
class="uk-flex uk-flex-column uk-flex-center uk-margin-small-left"
|
||||||
[class.uk-invisible-hover]="indicator.activePath !== i"
|
[class.uk-invisible-hover]="indicator.activePath !== i"
|
||||||
(click)="$event.stopPropagation();$event.preventDefault()">
|
(click)="$event.stopPropagation();$event.preventDefault()">
|
||||||
<a class="uk-link-reset uk-flex uk-flex-middle">
|
<a *ngIf="isCurator" class="uk-link-reset uk-flex uk-flex-middle">
|
||||||
<icon [flex]="true" name="more_vert"></icon>
|
<icon [flex]="true" name="more_vert"></icon>
|
||||||
</a>
|
</a>
|
||||||
<div #element
|
<div #element uk-dropdown="mode: click; pos: bottom-left; offset: 5; delay-hide: 0;">
|
||||||
uk-dropdown="mode: click; pos: bottom-left; offset: 5; delay-hide: 0; container: .uk-modal-body">
|
|
||||||
<ul class="uk-nav uk-dropdown-nav">
|
<ul class="uk-nav uk-dropdown-nav">
|
||||||
<li *ngIf="i > 0">
|
<li *ngIf="i > 0">
|
||||||
<a (click)="hide(element);moveIndicatorPath(chartIndicatorFb, chartIndicatorPaths, i)">
|
<a (click)="hide(element);moveIndicatorPath(chartIndicatorFb, 'chart', i)">
|
||||||
<div class="uk-flex uk-flex-middle">
|
<div class="uk-flex uk-flex-middle">
|
||||||
<icon [flex]="true" name="west" ratio="0.6"></icon>
|
<icon [flex]="true" name="west" ratio="0.6"></icon>
|
||||||
<span class="uk-margin-small-left uk-width-expand">Move Left</span>
|
<span class="uk-margin-small-left uk-width-expand">Move Left</span>
|
||||||
|
@ -501,7 +503,7 @@
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<li *ngIf="i < chartIndicatorPaths.length - 1">
|
<li *ngIf="i < chartIndicatorPaths.length - 1">
|
||||||
<a (click)="hide(element);moveIndicatorPath(chartIndicatorFb, chartIndicatorPaths, i, i + 1)">
|
<a (click)="hide(element);moveIndicatorPath(chartIndicatorFb, 'chart', i, i + 1)">
|
||||||
<div class="uk-flex uk-flex-middle">
|
<div class="uk-flex uk-flex-middle">
|
||||||
<icon [flex]="true" name="east" ratio="0.6"></icon>
|
<icon [flex]="true" name="east" ratio="0.6"></icon>
|
||||||
<span class="uk-margin-small-left uk-width-expand">Move Right</span>
|
<span class="uk-margin-small-left uk-width-expand">Move Right</span>
|
||||||
|
|
|
@ -102,7 +102,8 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple
|
||||||
@ViewChild('editChartNotify', {static: true}) editChartNotify: NotifyFormComponent;
|
@ViewChild('editChartNotify', {static: true}) editChartNotify: NotifyFormComponent;
|
||||||
@ViewChild('deleteNotify', {static: true}) deleteNotify: NotifyFormComponent;
|
@ViewChild('deleteNotify', {static: true}) deleteNotify: NotifyFormComponent;
|
||||||
/* Transition Groups */
|
/* Transition Groups */
|
||||||
@ViewChild('transitionGroup') transitionGroup: TransitionGroupComponent;
|
@ViewChild('numbersTransition') numbersTransition: TransitionGroupComponent;
|
||||||
|
@ViewChild('chartsTransition') chartsTransition: TransitionGroupComponent;
|
||||||
|
|
||||||
public isFullscreen: boolean = false;
|
public isFullscreen: boolean = false;
|
||||||
|
|
||||||
|
@ -590,7 +591,7 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple
|
||||||
public removeNumberIndicatorPath(index: number) {
|
public removeNumberIndicatorPath(index: number) {
|
||||||
this.numberIndicatorPaths.removeAt(index);
|
this.numberIndicatorPaths.removeAt(index);
|
||||||
this.indicator.indicatorPaths.splice(index, 1);
|
this.indicator.indicatorPaths.splice(index, 1);
|
||||||
this.transitionGroup.init();
|
this.numbersTransition.init();
|
||||||
if (this.indicator.activePath === index) {
|
if (this.indicator.activePath === index) {
|
||||||
this.activeNumberIndicatorPath(Math.max(0, index - 1));
|
this.activeNumberIndicatorPath(Math.max(0, index - 1));
|
||||||
} else if (this.indicator.activePath > index) {
|
} else if (this.indicator.activePath > index) {
|
||||||
|
@ -602,7 +603,7 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple
|
||||||
public removeChartIndicatorPath(index: number) {
|
public removeChartIndicatorPath(index: number) {
|
||||||
this.chartIndicatorPaths.removeAt(index);
|
this.chartIndicatorPaths.removeAt(index);
|
||||||
this.indicator.indicatorPaths.splice(index, 1);
|
this.indicator.indicatorPaths.splice(index, 1);
|
||||||
this.transitionGroup.init();
|
this.chartsTransition.init();
|
||||||
if (this.indicator.activePath === index) {
|
if (this.indicator.activePath === index) {
|
||||||
this.activeChartIndicatorPath(Math.max(0, index - 1));
|
this.activeChartIndicatorPath(Math.max(0, index - 1));
|
||||||
} else if (this.indicator.activePath > index) {
|
} else if (this.indicator.activePath > index) {
|
||||||
|
@ -612,9 +613,14 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple
|
||||||
}
|
}
|
||||||
|
|
||||||
public moveIndicatorPath(form: FormGroup,
|
public moveIndicatorPath(form: FormGroup,
|
||||||
indicatorPaths: FormArray, index: number,
|
type: 'number' | 'chart', index: number,
|
||||||
newIndex: number = index - 1) {
|
newIndex: number = index - 1) {
|
||||||
this.transitionGroup.init();
|
let indicatorPaths = type == 'number'?this.numberIndicatorPaths:this.chartIndicatorPaths;
|
||||||
|
if(type == 'number') {
|
||||||
|
this.numbersTransition.init();
|
||||||
|
} else {
|
||||||
|
this.chartsTransition.init();
|
||||||
|
}
|
||||||
let a = indicatorPaths.at(index);
|
let a = indicatorPaths.at(index);
|
||||||
let b = indicatorPaths.at(newIndex);
|
let b = indicatorPaths.at(newIndex);
|
||||||
indicatorPaths.setControl(index, b);
|
indicatorPaths.setControl(index, b);
|
||||||
|
@ -632,7 +638,7 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple
|
||||||
let paths = this.numberIndicatorPaths;
|
let paths = this.numberIndicatorPaths;
|
||||||
if (index == paths.length) {
|
if (index == paths.length) {
|
||||||
this.addNumberIndicatorPath();
|
this.addNumberIndicatorPath();
|
||||||
this.transitionGroup.init();
|
this.numbersTransition.init();
|
||||||
}
|
}
|
||||||
this.indicator.activePath = index;
|
this.indicator.activePath = index;
|
||||||
}
|
}
|
||||||
|
@ -641,7 +647,7 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple
|
||||||
let paths = this.chartIndicatorPaths;
|
let paths = this.chartIndicatorPaths;
|
||||||
if (index == paths.length) {
|
if (index == paths.length) {
|
||||||
this.addChartIndicatorPath();
|
this.addChartIndicatorPath();
|
||||||
this.transitionGroup.init();
|
this.chartsTransition.init();
|
||||||
}
|
}
|
||||||
this.indicator.activePath = index;
|
this.indicator.activePath = index;
|
||||||
}
|
}
|
||||||
|
@ -1566,4 +1572,8 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple
|
||||||
document.body.removeChild(tempBox);
|
document.body.removeChild(tempBox);
|
||||||
NotificationHandler.rise('Copied to clipboard');
|
NotificationHandler.rise('Copied to clipboard');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get isEditable(): boolean {
|
||||||
|
return this.stakeholder.copy || this.stakeholder.defaultId == null || this.stakeholder.defaultId == '-1';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,12 +28,15 @@
|
||||||
</span>
|
</span>
|
||||||
<span class="uk-margin-xsmall-left hide-on-close" [class.uk-invisible-hover]="topicIndex !== i"
|
<span class="uk-margin-xsmall-left hide-on-close" [class.uk-invisible-hover]="topicIndex !== i"
|
||||||
(click)="$event.stopPropagation();$event.preventDefault()">
|
(click)="$event.stopPropagation();$event.preventDefault()">
|
||||||
<a class="uk-link-reset uk-flex uk-flex-middle">
|
<icon *ngIf="!isEditable && showVisibility" [flex]="true" [name]="stakeholderUtils.visibilityIcon.get(topic.visibility)"
|
||||||
|
ratio="0.6"></icon>
|
||||||
|
<a *ngIf="isEditable && (isCurator || showVisibility)" class="uk-link-reset uk-flex uk-flex-middle">
|
||||||
<icon *ngIf="showVisibility" [flex]="true" [name]="stakeholderUtils.visibilityIcon.get(topic.visibility)"
|
<icon *ngIf="showVisibility" [flex]="true" [name]="stakeholderUtils.visibilityIcon.get(topic.visibility)"
|
||||||
ratio="0.6"></icon>
|
ratio="0.6"></icon>
|
||||||
<icon [flex]="true" name="more_vert"></icon>
|
<icon [flex]="true" name="more_vert"></icon>
|
||||||
</a>
|
</a>
|
||||||
<div #element uk-dropdown="mode: click; pos: bottom-left; offset: 5; delay-hide: 0; flip: false; container: body">
|
<div #element *ngIf="isEditable && (isCurator || showVisibility)"
|
||||||
|
uk-dropdown="mode: click; pos: bottom-left; offset: 5; delay-hide: 0; flip: false; container: body">
|
||||||
<ul class="uk-nav uk-dropdown-nav">
|
<ul class="uk-nav uk-dropdown-nav">
|
||||||
<ng-container *ngIf="isCurator">
|
<ng-container *ngIf="isCurator">
|
||||||
<li>
|
<li>
|
||||||
|
@ -106,12 +109,14 @@
|
||||||
<span class="uk-width-expand uk-text-truncate">{{category.name}}</span>
|
<span class="uk-width-expand uk-text-truncate">{{category.name}}</span>
|
||||||
<span class="uk-margin-xsmall-left hide-on-close" [class.uk-invisible-hover]="categoryIndex !== j"
|
<span class="uk-margin-xsmall-left hide-on-close" [class.uk-invisible-hover]="categoryIndex !== j"
|
||||||
(click)="$event.stopPropagation();$event.preventDefault()">
|
(click)="$event.stopPropagation();$event.preventDefault()">
|
||||||
<a class="uk-link-reset uk-flex uk-flex-middle">
|
<icon *ngIf="!isEditable && showVisibility" [flex]="true" [name]="stakeholderUtils.visibilityIcon.get(category.visibility)"
|
||||||
|
ratio="0.6"></icon>
|
||||||
|
<a *ngIf="isEditable && (isCurator || showVisibility)" class="uk-link-reset uk-flex uk-flex-middle">
|
||||||
<icon *ngIf="showVisibility" [flex]="true" [name]="stakeholderUtils.visibilityIcon.get(category.visibility)"
|
<icon *ngIf="showVisibility" [flex]="true" [name]="stakeholderUtils.visibilityIcon.get(category.visibility)"
|
||||||
ratio="0.6"></icon>
|
ratio="0.6"></icon>
|
||||||
<icon [flex]="true" name="more_vert"></icon>
|
<icon [flex]="true" name="more_vert"></icon>
|
||||||
</a>
|
</a>
|
||||||
<div #element
|
<div #element *ngIf="isEditable && (isCurator || showVisibility)"
|
||||||
uk-dropdown="mode: click; pos: bottom-left; offset: 5; delay-hide: 0; flip: false; container: body">
|
uk-dropdown="mode: click; pos: bottom-left; offset: 5; delay-hide: 0; flip: false; container: body">
|
||||||
<ul class="uk-nav uk-dropdown-nav">
|
<ul class="uk-nav uk-dropdown-nav">
|
||||||
<ng-container *ngIf="isCurator">
|
<ng-container *ngIf="isCurator">
|
||||||
|
@ -175,7 +180,7 @@
|
||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<li *ngIf="isCurator">
|
<li *ngIf="isCurator && isEditable">
|
||||||
<a (click)="editCategoryOpen(); $event.preventDefault()" class="uk-flex uk-flex-middle">
|
<a (click)="editCategoryOpen(); $event.preventDefault()" class="uk-flex uk-flex-middle">
|
||||||
<icon name="add" [flex]="true"></icon>
|
<icon name="add" [flex]="true"></icon>
|
||||||
<span class="hide-on-close">Create new category</span>
|
<span class="hide-on-close">Create new category</span>
|
||||||
|
@ -183,7 +188,7 @@
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
<li *ngIf="isCurator" class="hide-on-close">
|
<li *ngIf="isCurator && isEditable" class="hide-on-close">
|
||||||
<a (click)="editTopicOpen(-1); $event.preventDefault()">
|
<a (click)="editTopicOpen(-1); $event.preventDefault()">
|
||||||
<div class="uk-flex uk-flex-middle">
|
<div class="uk-flex uk-flex-middle">
|
||||||
<div class="uk-width-auto">
|
<div class="uk-width-auto">
|
||||||
|
@ -235,12 +240,15 @@
|
||||||
<span class="uk-flex uk-flex-column uk-flex-center uk-margin-small-left"
|
<span class="uk-flex uk-flex-column uk-flex-center uk-margin-small-left"
|
||||||
[class.uk-invisible-hover]="subCategoryIndex !== i"
|
[class.uk-invisible-hover]="subCategoryIndex !== i"
|
||||||
(click)="$event.stopPropagation();$event.preventDefault()">
|
(click)="$event.stopPropagation();$event.preventDefault()">
|
||||||
<a class="uk-link-reset uk-flex uk-flex-middle">
|
<icon *ngIf="!isEditable && showVisibility" [flex]="true" [name]="stakeholderUtils.visibilityIcon.get(subCategory.visibility)"
|
||||||
|
ratio="0.6"></icon>
|
||||||
|
<a *ngIf="isEditable && (isCurator || showVisibility)" class="uk-link-reset uk-flex uk-flex-middle">
|
||||||
<icon *ngIf="showVisibility" [flex]="true" [name]="stakeholderUtils.visibilityIcon.get(subCategory.visibility)"
|
<icon *ngIf="showVisibility" [flex]="true" [name]="stakeholderUtils.visibilityIcon.get(subCategory.visibility)"
|
||||||
ratio="0.6"></icon>
|
ratio="0.6"></icon>
|
||||||
<icon [flex]="true" name="more_vert"></icon>
|
<icon [flex]="true" name="more_vert"></icon>
|
||||||
</a>
|
</a>
|
||||||
<div #element uk-dropdown="mode: click; pos: bottom-left; offset: 5; delay-hide: 0; container: body">
|
<div #element *ngIf="isEditable && (isCurator || showVisibility)"
|
||||||
|
uk-dropdown="mode: click; pos: bottom-left; offset: 5; delay-hide: 0; container: body">
|
||||||
<ul class="uk-nav uk-dropdown-nav">
|
<ul class="uk-nav uk-dropdown-nav">
|
||||||
<ng-container *ngIf="isCurator">
|
<ng-container *ngIf="isCurator">
|
||||||
<li>
|
<li>
|
||||||
|
@ -318,7 +326,7 @@
|
||||||
</span>
|
</span>
|
||||||
</li>
|
</li>
|
||||||
</ng-template>
|
</ng-template>
|
||||||
<li *ngIf="isCurator">
|
<li *ngIf="isCurator && isEditable">
|
||||||
<a (click)="editSubCategoryOpen(); $event.preventDefault()" class="uk-flex uk-flex-middle">
|
<a (click)="editSubCategoryOpen(); $event.preventDefault()" class="uk-flex uk-flex-middle">
|
||||||
<icon name="add" [flex]="true"></icon>
|
<icon name="add" [flex]="true"></icon>
|
||||||
<span class="uk-text-uppercase">Create new subcategory</span>
|
<span class="uk-text-uppercase">Create new subcategory</span>
|
||||||
|
|
|
@ -759,4 +759,8 @@ export class TopicComponent extends StakeholderBaseComponent implements OnInit,
|
||||||
this.visibilityModal.alertFooter = false;
|
this.visibilityModal.alertFooter = false;
|
||||||
this.visibilityModal.open();
|
this.visibilityModal.open();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get isEditable(): boolean {
|
||||||
|
return this.stakeholder.copy || this.stakeholder.defaultId == null || this.stakeholder.defaultId == '-1';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -127,60 +127,6 @@ export class StakeholderUtils {
|
||||||
return types;
|
return types;
|
||||||
}
|
}
|
||||||
|
|
||||||
public createFunderFromDefaultProfile(funder: Stakeholder, defaultTopics: Topic[], isDefault: boolean = false): Stakeholder {
|
|
||||||
funder.topics = HelperFunctions.copy(defaultTopics);
|
|
||||||
for (let topic of funder.topics) {
|
|
||||||
topic.defaultId = !isDefault ? topic._id : null;
|
|
||||||
topic._id = null;
|
|
||||||
for (let category of topic.categories) {
|
|
||||||
category.defaultId = !isDefault ? category._id : null;
|
|
||||||
category._id = null;
|
|
||||||
let subTokeep: SubCategory[] = [];
|
|
||||||
for (let subCategory of category.subCategories) {
|
|
||||||
subCategory.defaultId = !isDefault ? subCategory._id : null;
|
|
||||||
subCategory._id = null;
|
|
||||||
subTokeep.push(subCategory);
|
|
||||||
for (let section of subCategory.charts) {
|
|
||||||
let chartsTokeep: Indicator[] = [];
|
|
||||||
section.defaultId = !isDefault ? section._id : null;
|
|
||||||
section.stakeholderAlias = funder.alias;
|
|
||||||
section._id = null;
|
|
||||||
for (let indicator of section.indicators) {
|
|
||||||
indicator.defaultId = !isDefault ? indicator._id : null;
|
|
||||||
indicator._id = null;
|
|
||||||
chartsTokeep.push(indicator);
|
|
||||||
for (let indicatorPath of indicator.indicatorPaths) {
|
|
||||||
if (indicatorPath.parameters) {
|
|
||||||
Object.keys(indicatorPath.parameters).forEach(key => {
|
|
||||||
if (key == "index_name") {
|
|
||||||
indicatorPath.parameters[key] = funder.index_name;
|
|
||||||
} else if (key == "index_id") {
|
|
||||||
indicatorPath.parameters[key] = funder.index_id;
|
|
||||||
} else if (key == "index_shortName") {
|
|
||||||
indicatorPath.parameters[key] = funder.index_shortName.toLowerCase();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
section.indicators = chartsTokeep;
|
|
||||||
}
|
|
||||||
for (let section of subCategory.numbers) {
|
|
||||||
section.defaultId = !isDefault ? section._id : null;
|
|
||||||
section.stakeholderAlias = funder.alias;
|
|
||||||
section._id = null;
|
|
||||||
for (let indicator of section.indicators) {
|
|
||||||
indicator.defaultId = !isDefault ? indicator._id : null;
|
|
||||||
indicator._id = null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
category.subCategories = subTokeep;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return funder;
|
|
||||||
}
|
|
||||||
|
|
||||||
aliasValidatorString(elements: string[]): ValidatorFn {
|
aliasValidatorString(elements: string[]): ValidatorFn {
|
||||||
return (control: AbstractControl): { [key: string]: string } | null => {
|
return (control: AbstractControl): { [key: string]: string } | null => {
|
||||||
|
@ -608,11 +554,11 @@ export class IndicatorUtils {
|
||||||
filterApplied = true;
|
filterApplied = true;
|
||||||
} else if (filterType == "start_year" || filterType == "end_year") {
|
} else if (filterType == "start_year" || filterType == "end_year") {
|
||||||
//if has date filter already
|
//if has date filter already
|
||||||
if (filterType == "start_year" && parseInt(filterValue) > parseInt(queries["query"]["filters"][filterposition.filter]['groupFilters'][filterposition.groupFilter]["values"][0])) {
|
// if (filterType == "start_year" && parseInt(filterValue) > parseInt(queries["query"]["filters"][filterposition.filter]['groupFilters'][filterposition.groupFilter]["values"][0])) {
|
||||||
queries["query"]["filters"][filterposition.filter]['groupFilters'][filterposition.groupFilter]["values"][0] = filterValue;
|
queries["query"]["filters"][filterposition.filter]['groupFilters'][filterposition.groupFilter]["values"][0] = filterValue;
|
||||||
} else if (filterType == "end_year" && parseInt(filterValue) < parseInt(queries["query"]["filters"][filterposition.filter]['groupFilters'][filterposition.groupFilter]["values"][0])) {
|
// } else if (filterType == "end_year" && parseInt(filterValue) < parseInt(queries["query"]["filters"][filterposition.filter]['groupFilters'][filterposition.groupFilter]["values"][0])) {
|
||||||
queries["query"]["filters"][filterposition.filter]['groupFilters'][filterposition.groupFilter]["values"][0] = filterValue;
|
queries["query"]["filters"][filterposition.filter]['groupFilters'][filterposition.groupFilter]["values"][0] = filterValue;
|
||||||
}
|
// }
|
||||||
filterApplied = true;
|
filterApplied = true;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -37,6 +37,7 @@ export class Stakeholder {
|
||||||
isUpload: boolean = false;
|
isUpload: boolean = false;
|
||||||
description: string;
|
description: string;
|
||||||
topics: any[];
|
topics: any[];
|
||||||
|
copy: boolean = true;
|
||||||
details?: any;
|
details?: any;
|
||||||
|
|
||||||
constructor(_id: string, type: StakeholderType, index_id: string, index_name: string, index_shortName: string, alias: string, visibility: Visibility, logoUrl: string, defaultId: string = null, description: string = null) {
|
constructor(_id: string, type: StakeholderType, index_id: string, index_name: string, index_shortName: string, alias: string, visibility: Visibility, logoUrl: string, defaultId: string = null, description: string = null) {
|
||||||
|
@ -50,6 +51,7 @@ export class Stakeholder {
|
||||||
this.visibility = visibility;
|
this.visibility = visibility;
|
||||||
this.logoUrl = logoUrl;
|
this.logoUrl = logoUrl;
|
||||||
this.description = description;
|
this.description = description;
|
||||||
|
this.copy = !!this.defaultId && this.defaultId !== '-1';
|
||||||
this.topics = [];
|
this.topics = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -294,7 +296,7 @@ export class IndicatorFilterUtils {
|
||||||
}
|
}
|
||||||
static getFieldForTable(field, table){
|
static getFieldForTable(field, table){
|
||||||
if(["publication", "software", "dataset", "other", "result"].indexOf(table)!=-1 && IndicatorFilterUtils.filteredFields[field]["result"]){
|
if(["publication", "software", "dataset", "other", "result"].indexOf(table)!=-1 && IndicatorFilterUtils.filteredFields[field]["result"]){
|
||||||
return IndicatorFilterUtils.filteredFields[field]["result"];
|
return IndicatorFilterUtils.filteredFields[field]["result"].replace("result.",table + ".");
|
||||||
}else{
|
}else{
|
||||||
return IndicatorFilterUtils.filteredFields[field][table];
|
return IndicatorFilterUtils.filteredFields[field][table];
|
||||||
}
|
}
|
||||||
|
|
|
@ -116,11 +116,15 @@ export class StakeholderService {
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
buildStakeholder(url: string, stakeholder: Stakeholder): Observable<Stakeholder> {
|
buildStakeholder(url: string, stakeholder: Stakeholder, copyId: string): Observable<Stakeholder> {
|
||||||
if (stakeholder.alias && stakeholder.alias.startsWith('/')) {
|
if (stakeholder.alias && stakeholder.alias.startsWith('/')) {
|
||||||
stakeholder.alias = stakeholder.alias.slice(1);
|
stakeholder.alias = stakeholder.alias.slice(1);
|
||||||
}
|
}
|
||||||
return this.http.post<Stakeholder>(url + '/build-stakeholder', stakeholder, CustomOptions.registryOptions()).pipe(map(stakeholder => {
|
let copy = {
|
||||||
|
stakeholder: stakeholder,
|
||||||
|
copyId: copyId
|
||||||
|
}
|
||||||
|
return this.http.post<Stakeholder>(url + '/build-stakeholder', copy, CustomOptions.registryOptions()).pipe(map(stakeholder => {
|
||||||
return HelperFunctions.copy(Stakeholder.checkIsUpload(stakeholder));
|
return HelperFunctions.copy(Stakeholder.checkIsUpload(stakeholder));
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
@ -129,12 +133,12 @@ export class StakeholderService {
|
||||||
return this.http.post<Visibility>(url + '/' + path.join('/') + '/change-visibility' + '?visibility=' + visibility + (propagate ? '&propagate=true' : ''), null, CustomOptions.registryOptions());
|
return this.http.post<Visibility>(url + '/' + path.join('/') + '/change-visibility' + '?visibility=' + visibility + (propagate ? '&propagate=true' : ''), null, CustomOptions.registryOptions());
|
||||||
}
|
}
|
||||||
|
|
||||||
saveElement(url: string, element: any, path: string[] = []): Observable<any> {
|
saveElement(url: string, element: any, path: string[] = [], isFull: boolean = false): Observable<any> {
|
||||||
if (element.alias && element.alias.startsWith('/')) {
|
if (element.alias && element.alias.startsWith('/')) {
|
||||||
element.alias = element.alias.slice(1);
|
element.alias = element.alias.slice(1);
|
||||||
}
|
}
|
||||||
return this.http.post<any>(url + ((path.length > 0) ? '/' : '') + path.join('/') +
|
return this.http.post<any>(url + ((path.length > 0) ? '/' : '') + path.join('/') +
|
||||||
'/save', element, CustomOptions.registryOptions()).pipe(map(element => {
|
'/save' + (isFull?'/full':''), element, CustomOptions.registryOptions()).pipe(map(element => {
|
||||||
if (path.length === 0) {
|
if (path.length === 0) {
|
||||||
return HelperFunctions.copy(Stakeholder.checkIsUpload(element));
|
return HelperFunctions.copy(Stakeholder.checkIsUpload(element));
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import {Component, Input, ViewChild} from '@angular/core';
|
import {ChangeDetectorRef, Component, Input, ViewChild} from '@angular/core';
|
||||||
import {ActivatedRoute, Router} from "@angular/router";
|
import {ActivatedRoute, Router} from "@angular/router";
|
||||||
import {Subscriber, Subscription} from "rxjs";
|
import {Subscriber, Subscription} from "rxjs";
|
||||||
import {OrcidService} from "./orcid.service";
|
import {OrcidService} from "./orcid.service";
|
||||||
|
@ -85,7 +85,7 @@ declare var UIkit: any;
|
||||||
<ng-container *ngIf="!showOnlyUpdateButton">
|
<ng-container *ngIf="!showOnlyUpdateButton">
|
||||||
<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 src="assets/common-assets/common/ORCIDiD_icon16x16.png" alt="" loading="lazy">
|
<img src="assets/common-assets/common/ORCIDiD_icon16x16.png" alt="ORCID logo" loading="lazy">
|
||||||
<span> ACTIONS</span>
|
<span> ACTIONS</span>
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
|
@ -330,7 +330,8 @@ export class OrcidWorkComponent {
|
||||||
private _router: Router,
|
private _router: Router,
|
||||||
private orcidService: OrcidService,
|
private orcidService: OrcidService,
|
||||||
private resultLandingService: ResultLandingService,
|
private resultLandingService: ResultLandingService,
|
||||||
private userManagementService: UserManagementService, private _logService: LogService, private _userProfileService: UserProfileService) {
|
private userManagementService: UserManagementService, private _logService: LogService, private _userProfileService: UserProfileService,
|
||||||
|
private cdr: ChangeDetectorRef) {
|
||||||
if (typeof document !== 'undefined') {
|
if (typeof document !== 'undefined') {
|
||||||
this.tokenUrl = properties.orcidTokenURL
|
this.tokenUrl = properties.orcidTokenURL
|
||||||
+ "client_id=" + properties.orcidClientId
|
+ "client_id=" + properties.orcidClientId
|
||||||
|
@ -444,6 +445,8 @@ export class OrcidWorkComponent {
|
||||||
this.subscriptions.push(this.orcidService.getPutCode(this.pids).subscribe(
|
this.subscriptions.push(this.orcidService.getPutCode(this.pids).subscribe(
|
||||||
putCodes => {
|
putCodes => {
|
||||||
this.putCodes = putCodes;
|
this.putCodes = putCodes;
|
||||||
|
this.cdr.markForCheck();
|
||||||
|
// this.cdr.detectChanges();
|
||||||
}, error => {
|
}, error => {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -525,7 +528,9 @@ export class OrcidWorkComponent {
|
||||||
this.putCodes.push("" + response['put-code']);
|
this.putCodes.push("" + response['put-code']);
|
||||||
this.creationDates.push(response['created-date']['value']);
|
this.creationDates.push(response['created-date']['value']);
|
||||||
this.updateDates.push(response['last-modified-date']['value']);
|
this.updateDates.push(response['last-modified-date']['value']);
|
||||||
|
this.cdr.markForCheck();
|
||||||
|
// this.cdr.detectChanges();
|
||||||
|
|
||||||
// this.closeGrantModal();
|
// this.closeGrantModal();
|
||||||
// this.message = "You have successfully added work with pids: "+this.pids+" in your ORCID record!";
|
// this.message = "You have successfully added work with pids: "+this.pids+" in your ORCID record!";
|
||||||
this.message = "You have successfully added work \"" + this.resultTitle + "\" in your ORCID record!";
|
this.message = "You have successfully added work \"" + this.resultTitle + "\" in your ORCID record!";
|
||||||
|
@ -701,6 +706,8 @@ export class OrcidWorkComponent {
|
||||||
deletedAll = false;
|
deletedAll = false;
|
||||||
} else {
|
} else {
|
||||||
this.putCodes.splice(i, 1);
|
this.putCodes.splice(i, 1);
|
||||||
|
this.cdr.markForCheck();
|
||||||
|
// this.cdr.detectChanges();
|
||||||
this.creationDates.splice(i, 1);
|
this.creationDates.splice(i, 1);
|
||||||
this.updateDates.splice(i, 1);
|
this.updateDates.splice(i, 1);
|
||||||
// this.works.splice(i, 1);
|
// this.works.splice(i, 1);
|
||||||
|
|
|
@ -34,9 +34,9 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="uk-width-2-5@m uk-width-1-1@s uk-text-center uk-position-relative" uk-scrollspy-class>
|
<div class="uk-width-2-5@m uk-width-1-1@s uk-text-center uk-position-relative" uk-scrollspy-class>
|
||||||
<img src="assets/common-assets/sdg/sdg-hero-img.svg" loading="lazy">
|
<img src="assets/common-assets/sdg/sdg-hero-img.svg" loading="lazy" alt="SDGs logo">
|
||||||
<div class="uk-position-bottom-left uk-card uk-card-default uk-padding">
|
<div class="uk-position-bottom-left uk-card uk-card-default uk-padding">
|
||||||
<img src="assets/common-assets/sdg/sdg-badge.png" loading="lazy" style="max-width: 215px">
|
<img src="assets/common-assets/sdg/sdg-badge.png" loading="lazy" style="max-width: 215px" alt="SDGs big logo">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -61,7 +61,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="uk-text-center">
|
<div class="uk-text-center">
|
||||||
<img [src]="'assets/common-assets/sdg/icons/g' + sdg.code + '.png'" alt="">
|
<img [src]="'assets/common-assets/sdg/icons/g' + sdg.code + '.png'" [alt]="'SDG code: '+sdg.code">
|
||||||
</div>
|
</div>
|
||||||
<div class="uk-text-center uk-padding-small uk-background-default" style="border-radius: 0 0 4px 4px;">
|
<div class="uk-text-center uk-padding-small uk-background-default" style="border-radius: 0 0 4px 4px;">
|
||||||
<span class="uk-text-large uk-text-bold uk-margin-small-bottom">{{sdg.number == null ? '0' : sdg.number | number}}</span>
|
<span class="uk-text-large uk-text-bold uk-margin-small-bottom">{{sdg.number == null ? '0' : sdg.number | number}}</span>
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
<ng-container *ngFor="let customFilter of customFilters">
|
<ng-container *ngFor="let customFilter of customFilters">
|
||||||
<ng-container *ngIf="customFilter.isHiddenFilter">
|
<ng-container *ngIf="customFilter.isHiddenFilter">
|
||||||
<li class="uk-flex uk-flex-middle">
|
<li class="uk-flex uk-flex-middle">
|
||||||
<span class="uk-text-capitalize uk-label uk-label-small uk-label-secondary uk-text-truncate target1">
|
<span class="uk-text-capitalize uk-label uk-label-small uk-label-search-filter uk-text-truncate target1">
|
||||||
{{customFilter.valueName}}
|
{{customFilter.valueName}}
|
||||||
</span>
|
</span>
|
||||||
</li>
|
</li>
|
||||||
|
@ -15,7 +15,7 @@
|
||||||
<ng-container *ngFor="let type of resultTypes.values; let i = index;">
|
<ng-container *ngFor="let type of resultTypes.values; let i = index;">
|
||||||
<ng-container *ngIf="type.selected">
|
<ng-container *ngIf="type.selected">
|
||||||
<li class="">
|
<li class="">
|
||||||
<span class="uk-text-capitalize uk-label uk-label-small uk-label-primary uk-flex uk-flex-middle target2">
|
<span class="uk-text-capitalize uk-label uk-label-small uk-label-search-filter uk-flex uk-flex-middle target2">
|
||||||
<span class="uk-margin-small-right uk-width-expand uk-text-truncate">{{type.name}}</span>
|
<span class="uk-margin-small-right uk-width-expand uk-text-truncate">{{type.name}}</span>
|
||||||
<button [class.uk-disabled]="disabled" (click)="removeResultType(type.id)" class="uk-close uk-icon" [disabled]="disabled">
|
<button [class.uk-disabled]="disabled" (click)="removeResultType(type.id)" class="uk-close uk-icon" [disabled]="disabled">
|
||||||
<icon name="close" flex="true" ratio="0.7"></icon>
|
<icon name="close" flex="true" ratio="0.7"></icon>
|
||||||
|
@ -29,7 +29,7 @@
|
||||||
<ng-container *ngFor="let filter of rangeFilters ">
|
<ng-container *ngFor="let filter of rangeFilters ">
|
||||||
<ng-container *ngIf="filter.selectedFromAndToValues">
|
<ng-container *ngIf="filter.selectedFromAndToValues">
|
||||||
<li class="">
|
<li class="">
|
||||||
<span class="uk-text-capitalize uk-label uk-label-small uk-label-primary uk-flex uk-flex-middle target3">
|
<span class="uk-text-capitalize uk-label uk-label-small uk-label-search-filter uk-flex uk-flex-middle target3">
|
||||||
<span class="uk-margin-small-right uk-width-expand uk-text-truncate">{{filter.selectedFromAndToValues}}</span>
|
<span class="uk-margin-small-right uk-width-expand uk-text-truncate">{{filter.selectedFromAndToValues}}</span>
|
||||||
<button [class.uk-disabled]="disabled" (click)="removeRangeFilter(filter)" class="uk-close uk-icon" [disabled]="disabled">
|
<button [class.uk-disabled]="disabled" (click)="removeRangeFilter(filter)" class="uk-close uk-icon" [disabled]="disabled">
|
||||||
<icon name="close" flex="true" ratio="0.7"></icon>
|
<icon name="close" flex="true" ratio="0.7"></icon>
|
||||||
|
@ -44,7 +44,7 @@
|
||||||
<ng-container *ngFor="let value of getSelectedValues(filter); let i = index; let end = last; ">
|
<ng-container *ngFor="let value of getSelectedValues(filter); let i = index; let end = last; ">
|
||||||
<li *ngIf="!customFilter || (customFilter.isHiddenFilter && customFilter.valueId != value.id)"
|
<li *ngIf="!customFilter || (customFilter.isHiddenFilter && customFilter.valueId != value.id)"
|
||||||
class="">
|
class="">
|
||||||
<span class="uk-text-capitalize uk-label uk-label-small uk-label-primary uk-flex uk-flex-middle target4">
|
<span class="uk-text-capitalize uk-label uk-label-small uk-label-search-filter uk-flex uk-flex-middle target4">
|
||||||
<span
|
<span
|
||||||
class="uk-margin-small-right uk-width-expand uk-text-truncate">
|
class="uk-margin-small-right uk-width-expand uk-text-truncate">
|
||||||
<ng-container *ngIf="filter.type && (filter.type == 'boolean' || filter.type == 'triplet') else noboolean">
|
<ng-container *ngIf="filter.type && (filter.type == 'boolean' || filter.type == 'triplet') else noboolean">
|
||||||
|
@ -73,7 +73,7 @@
|
||||||
<ng-container *ngIf="filter.countSelectedValues > 0">
|
<ng-container *ngIf="filter.countSelectedValues > 0">
|
||||||
<ng-container *ngFor="let value of getSelectedValues(filter); let i = index; let end = last; ">
|
<ng-container *ngFor="let value of getSelectedValues(filter); let i = index; let end = last; ">
|
||||||
<li *ngIf="!customFilters || (customFilters[0].isHiddenFilter && customFilters[0].valueId != value.id)">
|
<li *ngIf="!customFilters || (customFilters[0].isHiddenFilter && customFilters[0].valueId != value.id)">
|
||||||
<span class="uk-text-capitalize uk-label uk-label-small uk-label-primary uk-flex uk-flex-middle target5">
|
<span class="uk-text-capitalize uk-label uk-label-small uk-label-search-filter uk-flex uk-flex-middle target5">
|
||||||
<span class="uk-margin-small-right uk-width-expand uk-text-truncate">
|
<span class="uk-margin-small-right uk-width-expand uk-text-truncate">
|
||||||
<ng-container *ngIf="filter.type && (filter.type == 'boolean' || filter.type == 'triplet') else noboolean">
|
<ng-container *ngIf="filter.type && (filter.type == 'boolean' || filter.type == 'triplet') else noboolean">
|
||||||
<span>{{filter.title}}:
|
<span>{{filter.title}}:
|
||||||
|
@ -311,7 +311,7 @@
|
||||||
target="_blank"> OpenAIRE - Explore</a>.
|
target="_blank"> OpenAIRE - Explore</a>.
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="uk-flex uk-flex-middle uk-flex-wrap uk-child-width-auto uk-flex-between">
|
<div class="uk-flex uk-flex-middle uk-child-width-auto uk-flex-between">
|
||||||
<!-- Total results, number of pages -->
|
<!-- Total results, number of pages -->
|
||||||
<div class="uk-margin-remove-bottom uk-text-truncate" [class.uk-margin-medium-right]="!mobile" [class.uk-margin-right]="mobile" [class.uk-h6]="!mobile">
|
<div class="uk-margin-remove-bottom uk-text-truncate" [class.uk-margin-medium-right]="!mobile" [class.uk-margin-right]="mobile" [class.uk-h6]="!mobile">
|
||||||
<ng-container *ngIf="results && searchUtils.totalResults > 0">
|
<ng-container *ngIf="results && searchUtils.totalResults > 0">
|
||||||
|
@ -347,7 +347,7 @@
|
||||||
</ng-container>
|
</ng-container>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div *ngIf="!mobile" class="uk-margin-medium-left uk-flex uk-flex-middle">
|
<div *ngIf="!mobile" class="uk-flex uk-flex-middle">
|
||||||
<div *ngIf="searchUtils.totalResults > 10 || sort || searchUtils.totalResults > searchUtils.size ||
|
<div *ngIf="searchUtils.totalResults > 10 || sort || searchUtils.totalResults > searchUtils.size ||
|
||||||
(!loadPaging && oldTotalResults > searchUtils.size && searchUtils.status == errorCodes.LOADING)"
|
(!loadPaging && oldTotalResults > searchUtils.size && searchUtils.status == errorCodes.LOADING)"
|
||||||
class="uk-grid uk-flex-middle uk-child-width-1-1 uk-child-width-1-2@m" uk-grid>
|
class="uk-grid uk-flex-middle uk-child-width-1-1 uk-child-width-1-2@m" uk-grid>
|
||||||
|
|
|
@ -78,6 +78,7 @@ export class SearchResultComponent implements OnInit, OnChanges {
|
||||||
// console.debug(i, this.previewResults[i].orcidPutCodes);
|
// console.debug(i, this.previewResults[i].orcidPutCodes);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// this.previewResults = JSON.parse(JSON.stringify(this.previewResults, this.replacer), this.reviver);
|
||||||
}, error => {
|
}, error => {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -85,6 +86,26 @@ export class SearchResultComponent implements OnInit, OnChanges {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private replacer(key, value) {
|
||||||
|
if(value instanceof Map) {
|
||||||
|
return {
|
||||||
|
dataType: 'Map',
|
||||||
|
value: Array.from(value.entries()), // or with spread: value: [...value]
|
||||||
|
};
|
||||||
|
} else {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private reviver(key, value) {
|
||||||
|
if(typeof value === 'object' && value !== null) {
|
||||||
|
if (value.dataType === 'Map') {
|
||||||
|
return new Map(value.value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
public getResultPreview(result: SearchResult): ResultPreview {
|
public getResultPreview(result: SearchResult): ResultPreview {
|
||||||
return ResultPreview.searchResultConvert(result, (result.entityType) ? result.entityType : this.type);
|
return ResultPreview.searchResultConvert(result, (result.entityType) ? result.entityType : this.type);
|
||||||
}
|
}
|
||||||
|
|
|
@ -231,6 +231,7 @@ export class SearchProjectsService {
|
||||||
let fundingData = Array.isArray(resData['fundingtree']) ? resData['fundingtree'][z] : resData['fundingtree'];
|
let fundingData = Array.isArray(resData['fundingtree']) ? resData['fundingtree'][z] : resData['fundingtree'];
|
||||||
if(fundingData.hasOwnProperty("funder")) {
|
if(fundingData.hasOwnProperty("funder")) {
|
||||||
result['funderShortname'] = fundingData['funder'].shortname;
|
result['funderShortname'] = fundingData['funder'].shortname;
|
||||||
|
result['funderName'] = fundingData['funder'].name;
|
||||||
result['funderId'] = fundingData['funder'].id;
|
result['funderId'] = fundingData['funder'].id;
|
||||||
result['jurisdiction'] = (fundingData['funder']['id']['jurisdiction'] )?fundingData['funder']['id']['jurisdiction']:"";
|
result['jurisdiction'] = (fundingData['funder']['id']['jurisdiction'] )?fundingData['funder']['id']['jurisdiction']:"";
|
||||||
|
|
||||||
|
|
|
@ -70,7 +70,7 @@ export class RefineResultsUtils {
|
||||||
}
|
}
|
||||||
public static inParenthesisThePartAfterCharacters(field, characters):string {
|
public static inParenthesisThePartAfterCharacters(field, characters):string {
|
||||||
if( field.name.indexOf(characters) !=-1){
|
if( field.name.indexOf(characters) !=-1){
|
||||||
return field.name.split(characters)[0]+" ("+field.name.split(characters)[1]+")";
|
return field.name.split(characters)[0]+ (field.name.split(characters)[1]?(" ("+field.name.split(characters)[1]+")"):"");
|
||||||
|
|
||||||
}
|
}
|
||||||
return field.name;
|
return field.name;
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
Send a message
|
Send a message
|
||||||
</div>
|
</div>
|
||||||
<div *ngIf="images.length > 0" class="uk-margin-small avatars">
|
<div *ngIf="images.length > 0" class="uk-margin-small avatars">
|
||||||
<img *ngFor="let image of images" [src]="image" class="uk-border-circle" >
|
<img *ngFor="let image of images" [src]="image" class="uk-border-circle" alt="contact person">
|
||||||
</div>
|
</div>
|
||||||
<div class="uk-text-bold">
|
<div class="uk-text-bold">
|
||||||
How can we help?
|
How can we help?
|
||||||
|
|
|
@ -36,7 +36,7 @@ import {properties} from "../../../../environments/environment";
|
||||||
</span>
|
</span>
|
||||||
</a>
|
</a>
|
||||||
<div *ngIf="!isMobile" class="default-dropdown uk-margin-remove-top uk-dropdown orcid-dropdown"
|
<div *ngIf="!isMobile" class="default-dropdown uk-margin-remove-top uk-dropdown orcid-dropdown"
|
||||||
uk-dropdown="mode:click; offset: 4;" style="min-width: 465px !important;" [attr.container]="isModal?'#modal-container':true">
|
uk-dropdown="mode:click; offset: 4;" style="min-width: 465px !important;" [attr.container]="!modal ? '#modal-container' : true">
|
||||||
<ng-container *ngTemplateOutlet="dropdown"></ng-container>
|
<ng-container *ngTemplateOutlet="dropdown"></ng-container>
|
||||||
</div>
|
</div>
|
||||||
<mobile-dropdown *ngIf="isMobile" [toggle]="toggle">
|
<mobile-dropdown *ngIf="isMobile" [toggle]="toggle">
|
||||||
|
@ -153,7 +153,6 @@ export class ShowAuthorsComponent {
|
||||||
@Input() authorsLimit: number = 7;
|
@Input() authorsLimit: number = 7;
|
||||||
@Input() showAll: boolean = true;
|
@Input() showAll: boolean = true;
|
||||||
@Input() modal: AlertModal;
|
@Input() modal: AlertModal;
|
||||||
@Input() isModal: boolean
|
|
||||||
@Input() viewAll: boolean = false;
|
@Input() viewAll: boolean = false;
|
||||||
@Input() showInline: boolean = false; // do not open modal for "view more" when this is true
|
@Input() showInline: boolean = false; // do not open modal for "view more" when this is true
|
||||||
public lessBtn: boolean = false;
|
public lessBtn: boolean = false;
|
||||||
|
|
|
@ -48,6 +48,7 @@ export class SearchResult {
|
||||||
acronym: string;
|
acronym: string;
|
||||||
code: string;
|
code: string;
|
||||||
// callIdentifier?: string; // currently not parsed
|
// callIdentifier?: string; // currently not parsed
|
||||||
|
funderName: string;
|
||||||
funderShortname: string;
|
funderShortname: string;
|
||||||
budget?: string;
|
budget?: string;
|
||||||
contribution?: string;
|
contribution?: string;
|
||||||
|
|
|
@ -237,7 +237,8 @@ private fetch (link,id,oafEntityType,type, properties:EnvProperties ){
|
||||||
|
|
||||||
if(resData['fundingtree'] && resData['fundingtree']['funder']){
|
if(resData['fundingtree'] && resData['fundingtree']['funder']){
|
||||||
value.funderId = (resData['fundingtree']['funder']['id'] )?resData['fundingtree']['funder']['id']:"";
|
value.funderId = (resData['fundingtree']['funder']['id'] )?resData['fundingtree']['funder']['id']:"";
|
||||||
value.funderName = (resData['fundingtree']['funder']['shortname'] )?resData['fundingtree']['funder']['shortname']:"";
|
value.funderName = (resData['fundingtree']['funder']['name'] )?resData['fundingtree']['funder']['name']:"";
|
||||||
|
value.funderShortName = (resData['fundingtree']['funder']['shortname'] )?resData['fundingtree']['funder']['shortname']:"";
|
||||||
value.jurisdiction = (resData['fundingtree']['funder']['jurisdiction'] )?resData['fundingtree']['funder']['jurisdiction']:"";
|
value.jurisdiction = (resData['fundingtree']['funder']['jurisdiction'] )?resData['fundingtree']['funder']['jurisdiction']:"";
|
||||||
if(resData['fundingtree']['funding_level_2']){
|
if(resData['fundingtree']['funding_level_2']){
|
||||||
value.fundingLevel0 = (resData['fundingtree']['funding_level_2'] && resData['fundingtree']['funding_level_2']['parent'] &&
|
value.fundingLevel0 = (resData['fundingtree']['funding_level_2'] && resData['fundingtree']['funding_level_2']['parent'] &&
|
||||||
|
|
|
@ -95,12 +95,12 @@
|
||||||
<!-- 2nd section (funders, budget, authors, PIDs, publisher etc.) -->
|
<!-- 2nd section (funders, budget, authors, PIDs, publisher etc.) -->
|
||||||
<div class="uk-text-small uk-margin-small-bottom">
|
<div class="uk-text-small uk-margin-small-bottom">
|
||||||
<!-- Funder -->
|
<!-- Funder -->
|
||||||
<div *ngIf="result.funderShortname || result.code" class="uk-margin-xsmall-bottom">
|
<div *ngIf="(result.funderShortname || result.funderName) || result.code" class="uk-margin-xsmall-bottom">
|
||||||
<span *ngIf="result.funderShortname">
|
<span *ngIf="result.funderShortname || result.funderName">
|
||||||
<span class="uk-text-meta">Funder: </span>
|
<span class="uk-text-meta">Funder: </span>
|
||||||
{{result.funderShortname}}
|
{{result.funderName ? result.funderName : result.funderShortname}}
|
||||||
</span>
|
</span>
|
||||||
<span *ngIf="result.code" [class.uk-margin-left]="result.funderShortname">
|
<span *ngIf="result.code" [class.uk-margin-left]="result.funderShortname || result.funderName">
|
||||||
<span class="uk-text-meta">{{openaireEntities.PROJECT}} Code: </span>
|
<span class="uk-text-meta">{{openaireEntities.PROJECT}} Code: </span>
|
||||||
{{result.code}}
|
{{result.code}}
|
||||||
</span>
|
</span>
|
||||||
|
@ -125,7 +125,7 @@
|
||||||
</div>
|
</div>
|
||||||
<!-- Authors -->
|
<!-- Authors -->
|
||||||
<div *ngIf="result.authors" class="uk-margin-xsmall-bottom">
|
<div *ngIf="result.authors" class="uk-margin-xsmall-bottom">
|
||||||
<showAuthors [authors]="result.authors" [authorsLimit]=4 [modal]="modal" [isMobile]="isMobile" [isModal]="isDeletedByInferenceModal"
|
<showAuthors [authors]="result.authors" [authorsLimit]=4 [modal]="modal" [isMobile]="isMobile"
|
||||||
[showAll]=true [showInline]="showInline"></showAuthors>
|
[showAll]=true [showInline]="showInline"></showAuthors>
|
||||||
</div>
|
</div>
|
||||||
<!-- Identifiers -->
|
<!-- Identifiers -->
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import {Component, Input, OnChanges, OnInit, SimpleChanges} from "@angular/core";
|
import {ChangeDetectionStrategy, Component, Input, OnChanges, OnInit, SimpleChanges} from "@angular/core";
|
||||||
import {ResultPreview} from "./result-preview";
|
import {ResultPreview} from "./result-preview";
|
||||||
import {EnvProperties} from "../properties/env-properties";
|
import {EnvProperties} from "../properties/env-properties";
|
||||||
import {RouterHelper} from "../routerHelper.class";
|
import {RouterHelper} from "../routerHelper.class";
|
||||||
|
@ -12,7 +12,8 @@ import {NumberUtils} from '../number-utils.class';
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'result-preview',
|
selector: 'result-preview',
|
||||||
templateUrl: 'result-preview.component.html',
|
templateUrl: 'result-preview.component.html',
|
||||||
styleUrls: ['result-preview.component.less']
|
styleUrls: ['result-preview.component.less'],
|
||||||
|
// changeDetection: ChangeDetectionStrategy.OnPush
|
||||||
})
|
})
|
||||||
export class ResultPreviewComponent implements OnInit, OnChanges {
|
export class ResultPreviewComponent implements OnInit, OnChanges {
|
||||||
@Input() prevPath: string = "";
|
@Input() prevPath: string = "";
|
||||||
|
@ -255,4 +256,8 @@ export class ResultPreviewComponent implements OnInit, OnChanges {
|
||||||
}
|
}
|
||||||
return obj;
|
return obj;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public get countDots() {
|
||||||
|
return (this.result.oaRoutes.green ? 1 : 0) + (this.result.oaRoutes.oaColor ? 1 : 0) + (this.result.oaRoutes.isInDiamondJournal ? 1 : 0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -123,6 +123,7 @@ export class ResultPreview {
|
||||||
acronym: string;
|
acronym: string;
|
||||||
code: string;
|
code: string;
|
||||||
// callIdentifier: string; // currently not parsed
|
// callIdentifier: string; // currently not parsed
|
||||||
|
funderName: string;
|
||||||
funderShortname: string;
|
funderShortname: string;
|
||||||
budget: string;
|
budget: string;
|
||||||
contribution: string;
|
contribution: string;
|
||||||
|
@ -188,6 +189,7 @@ export class ResultPreview {
|
||||||
resultPreview.acronym = result.acronym;
|
resultPreview.acronym = result.acronym;
|
||||||
resultPreview.code = result.code;
|
resultPreview.code = result.code;
|
||||||
// resultPreview.callIdentifier = result.callIdentifier; // currently not parsed
|
// resultPreview.callIdentifier = result.callIdentifier; // currently not parsed
|
||||||
|
resultPreview.funderName = result.funderName;
|
||||||
resultPreview.funderShortname = result.funderShortname;
|
resultPreview.funderShortname = result.funderShortname;
|
||||||
resultPreview.budget = result.budget;
|
resultPreview.budget = result.budget;
|
||||||
resultPreview.contribution = result.contribution;
|
resultPreview.contribution = result.contribution;
|
||||||
|
|
Loading…
Reference in New Issue