Update angular irish monitor with the latest changes from develop #32
|
@ -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;
|
||||||
|
@ -92,6 +93,7 @@ export class ClaimRecord2Insert {
|
||||||
targetAccessRights: string;
|
targetAccessRights: string;
|
||||||
targetEmbargoEndDate: string;
|
targetEmbargoEndDate: string;
|
||||||
claimedInDashboard: string;
|
claimedInDashboard: string;
|
||||||
|
idSuffix:string;
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
|
|
||||||
|
|
|
@ -75,7 +75,8 @@ export class ClaimProjectsSearchFormComponent {
|
||||||
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;
|
||||||
|
@ -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;
|
||||||
|
@ -205,9 +207,13 @@ 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+'\"'
|
||||||
}
|
}
|
||||||
|
@ -236,9 +242,9 @@ export class ClaimProjectsSearchFormComponent {
|
||||||
//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,7 +279,7 @@ 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++) {
|
||||||
|
@ -285,6 +291,7 @@ export class ClaimProjectsSearchFormComponent {
|
||||||
filter.values.push(filterValue);
|
filter.values.push(filterValue);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
filter.countAllValues = filter.values.length;
|
||||||
filters.push(filter)
|
filters.push(filter)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -56,25 +56,44 @@
|
||||||
<div *ngIf="claims && claims.length == 0" class="uk-card uk-card-default uk-padding-large uk-text-center uk-margin-bottom uk-text-bold">
|
<div *ngIf="claims && claims.length == 0" class="uk-card uk-card-default uk-padding-large uk-text-center uk-margin-bottom uk-text-bold">
|
||||||
<div>No links found</div>
|
<div>No links found</div>
|
||||||
</div>
|
</div>
|
||||||
<ul class="uk-margin-small-top uk-list uk-list-xlarge">
|
<ng-container *ngIf="claims && claims.length > 0">
|
||||||
<li *ngFor="let claim of claims; let i=index" class="uk-card uk-card-default">
|
|
||||||
<div class="uk-card-body">
|
<div class="uk-flex uk-flex-middle uk-margin-top uk-margin-small-bottom uk-padding-small uk-padding-remove-horizontal">
|
||||||
<div class="uk-grid uk-grid-small" uk-grid>
|
<div class="uk-width-xsmall uk-flex uk-flex-center uk-flex-middle">
|
||||||
|
<label>
|
||||||
|
<input id="checkAll" type="checkbox" (click)="selectAll($event)" class="uk-checkbox" title="Select All"
|
||||||
|
[ngModel]="selected.length == claims.length"/>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
<button class="uk-button uk-button-link" [class.uk-disabled]="selected.length == 0" [disabled]="selected.length == 0"
|
||||||
|
(click)="deleteOpen()">
|
||||||
|
<span>Delete ({{selected.length}})</span>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<ul class="uk-margin-small-top uk-list uk-list-striped">
|
||||||
|
<li *ngFor="let claim of claims; let i=index" class="uk-flex uk-flex-middle uk-padding-small uk-padding-remove-horizontal">
|
||||||
|
<div class="uk-width-xsmall uk-flex uk-flex-center uk-flex-middle">
|
||||||
|
<input type="checkbox" class="uk-checkbox"
|
||||||
|
[id]="claim.id" (click)="selectClaim(claim, $event)" [ngModel]="isSelectedClaim(claim.id)">
|
||||||
|
</div>
|
||||||
<div class="uk-width-expand">
|
<div class="uk-width-expand">
|
||||||
<div class="uk-margin-bottom">
|
<div class="uk-grid uk-grid-small uk-flex-middle" uk-grid>
|
||||||
|
<div class="uk-width-expand">
|
||||||
|
<div class="uk-margin-small-bottom">
|
||||||
<claim-entity [entity]="claim.target" [type]="claim.targetType" [properties]=properties
|
<claim-entity [entity]="claim.target" [type]="claim.targetType" [properties]=properties
|
||||||
[externalPortalUrl]=externalPortalUrl [source]="true" [linkAvailable]="isClaimAvailable(claim)"></claim-entity>
|
[externalPortalUrl]=externalPortalUrl [source]="true" [linkAvailable]="isClaimAvailable(claim)"></claim-entity>
|
||||||
</div>
|
</div>
|
||||||
<div class="uk-margin-bottom">
|
<div class="uk-margin-small-bottom">
|
||||||
<span *ngIf="isClaimAvailable(claim) else notAvailable" class="uk-label uk-label-success"
|
<span *ngIf="isClaimAvailable(claim) else notAvailable" class="uk-label uk-label-small uk-label-success"
|
||||||
[attr.uk-tooltip]="'title: The link information is available in the portal and the APIs.'">available</span>
|
[attr.uk-tooltip]="'title: The link information is available in the portal and the APIs.'">available</span>
|
||||||
<ng-template #notAvailable>
|
<ng-template #notAvailable>
|
||||||
<span class="uk-label uk-label-danger"
|
<span class="uk-label uk-label-small uk-label-danger"
|
||||||
[attr.uk-tooltip]="'title:The link information will be added in the portal and the APIs in the next content provision workflow.'">pending</span>
|
[attr.uk-tooltip]="'title:The link information will be added in the portal and the APIs in the next content provision workflow.'">pending</span>
|
||||||
</ng-template>
|
</ng-template>
|
||||||
</div>
|
</div>
|
||||||
<div class="uk-text-small">
|
<div class="uk-text-small">
|
||||||
<div *ngIf="showUserEmail" class="uk-margin-small-bottom">
|
<div *ngIf="showUserEmail" class="uk-margin-xsmall-bottom">
|
||||||
<span class="uk-text-meta">Claimed by:</span>
|
<span class="uk-text-meta">Claimed by:</span>
|
||||||
<span class="uk-margin-xsmall-left">{{claim.userMail}}</span>
|
<span class="uk-margin-xsmall-left">{{claim.userMail}}</span>
|
||||||
</div>
|
</div>
|
||||||
|
@ -89,16 +108,15 @@
|
||||||
<icon class="uk-position-center" name="link" customClass="uk-text-primary" ratio="2" [flex]="true"></icon>
|
<icon class="uk-position-center" name="link" customClass="uk-text-primary" ratio="2" [flex]="true"></icon>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="uk-width-1-2@m uk-width-1-1 uk-flex uk-flex-column uk-flex-center">
|
<div class="uk-width-1-2@m uk-width-1-1">
|
||||||
<claim-entity [entity]="claim.source" [type]="claim.sourceType" [source]="false" [properties]=properties
|
<claim-entity [entity]="claim.source" [type]="claim.sourceType" [source]="false" [properties]=properties
|
||||||
[externalPortalUrl]=externalPortalUrl></claim-entity>
|
[externalPortalUrl]=externalPortalUrl></claim-entity>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="uk-card-footer uk-flex uk-flex-right">
|
<div class="uk-width-xsmall uk-flex uk-flex-center uk-flex-middle">
|
||||||
<button class="uk-button uk-button-link uk-flex uk-flex-middle" (click)="deleteOpen(i)">
|
<button class="uk-button uk-button-link uk-flex uk-flex-middle" (click)="deleteOpen(i)">
|
||||||
<icon name="delete" [flex]="true"></icon>
|
<icon name="delete" [flex]="true"></icon>
|
||||||
<span class="uk-margin-xsmall-left">Delete</span>
|
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
|
@ -107,6 +125,7 @@
|
||||||
<paging-no-load *ngIf="resultsNum" [currentPage]="page" [totalResults]="resultsNum" [size]="size"
|
<paging-no-load *ngIf="resultsNum" [currentPage]="page" [totalResults]="resultsNum" [size]="size"
|
||||||
(pageChange)="pageChange($event)"></paging-no-load>
|
(pageChange)="pageChange($event)"></paging-no-load>
|
||||||
</div>
|
</div>
|
||||||
|
</ng-container>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -4,14 +4,4 @@
|
||||||
position: relative;
|
position: relative;
|
||||||
padding: 0 20px;
|
padding: 0 20px;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
|
||||||
&::before {
|
|
||||||
content: '';
|
|
||||||
position: absolute;
|
|
||||||
top: 0;
|
|
||||||
left: 50%;
|
|
||||||
right: 0;
|
|
||||||
bottom: 0;
|
|
||||||
border-left: @global-border-width solid @global-border;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -52,6 +52,7 @@ export class DisplayClaimsComponent implements OnInit, OnDestroy {
|
||||||
lastIndexDate = null;
|
lastIndexDate = null;
|
||||||
public filterForm: FormGroup;
|
public filterForm: FormGroup;
|
||||||
public entities: string[] = [];
|
public entities: string[] = [];
|
||||||
|
selected = [];
|
||||||
|
|
||||||
allOptions: Option[] = [
|
allOptions: Option[] = [
|
||||||
{label: OpenaireEntities.PUBLICATIONS, value: "publication"},
|
{label: OpenaireEntities.PUBLICATIONS, value: "publication"},
|
||||||
|
@ -310,23 +311,34 @@ export class DisplayClaimsComponent implements OnInit, OnDestroy {
|
||||||
}
|
}
|
||||||
|
|
||||||
isSelected(value: string) {
|
isSelected(value: string) {
|
||||||
return this.filterForm && this.filterForm.get('entities').value.find(entity => entity === value)
|
return this.filterForm && this.filterForm.get('entities').value.find(entity => entity === value);
|
||||||
}
|
}
|
||||||
|
|
||||||
deleteOpen(index: number) {
|
deleteOpen(index: number = null) {
|
||||||
this.index = index;
|
this.index = index;
|
||||||
this.deleteModal.alertTitle = 'Delete Confirmation';
|
this.deleteModal.alertTitle = 'Delete Confirmation';
|
||||||
this.deleteModal.message = 'Are you sure you want to delete this link?';
|
this.deleteModal.message = 'Are you sure you want to delete ' + (this.index != null ? '1' : this.selected.length) + ' link(s)?';
|
||||||
this.deleteModal.okButtonText = 'Yes';
|
this.deleteModal.okButtonText = 'Yes';
|
||||||
this.deleteModal.open();
|
this.deleteModal.open();
|
||||||
}
|
}
|
||||||
|
|
||||||
delete() {
|
delete() {
|
||||||
this.subscriptions.push(this._claimService.deleteBulk([this.claims[this.index].id], this.properties.claimsAPIURL).subscribe(
|
let claimsToBeDeleted = ((this.index != null) ? [this.claims[this.index].id] : this.selected.map(claim => claim.id));
|
||||||
|
console.log(claimsToBeDeleted);
|
||||||
|
this.subscriptions.push(this._claimService.deleteBulk(claimsToBeDeleted, this.properties.claimsAPIURL).subscribe(
|
||||||
res => {
|
res => {
|
||||||
|
if (this.index != null) {
|
||||||
this.claims.splice(this.index, 1);
|
this.claims.splice(this.index, 1);
|
||||||
this.resultsNum = this.resultsNum - 1;
|
this.resultsNum = this.resultsNum - 1;
|
||||||
NotificationHandler.rise('Link has been deleted successfully');
|
NotificationHandler.rise('Link has been deleted successfully');
|
||||||
|
} else {
|
||||||
|
claimsToBeDeleted.forEach(claimId => {
|
||||||
|
this.claims.splice(this.claims.findIndex((id) => id == claimId), 1);
|
||||||
|
});
|
||||||
|
this.resultsNum = this.resultsNum - claimsToBeDeleted.length;
|
||||||
|
NotificationHandler.rise(claimsToBeDeleted.length + ' links have been deleted successfully');
|
||||||
|
}
|
||||||
|
this.selected = [];
|
||||||
let goToPage = this.page;
|
let goToPage = this.page;
|
||||||
if (this.totalPages(this.resultsNum) < this.page && this.page > 0) {
|
if (this.totalPages(this.resultsNum) < this.page && this.page > 0) {
|
||||||
goToPage = this.page - 1;
|
goToPage = this.page - 1;
|
||||||
|
@ -334,7 +346,8 @@ export class DisplayClaimsComponent implements OnInit, OnDestroy {
|
||||||
this.goTo(goToPage);
|
this.goTo(goToPage);
|
||||||
}, err => {
|
}, err => {
|
||||||
this.handleErrors(err, "Error deleting claim with id: " + this.claims[this.index].id);
|
this.handleErrors(err, "Error deleting claim with id: " + this.claims[this.index].id);
|
||||||
}));
|
}
|
||||||
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
pageChange($event) {
|
pageChange($event) {
|
||||||
|
@ -351,7 +364,7 @@ export class DisplayClaimsComponent implements OnInit, OnDestroy {
|
||||||
if (claimDateStr < lastUpdateDateStr) {
|
if (claimDateStr < lastUpdateDateStr) {
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
return claim.target.collectedFrom != "infrastruct_::openaire" && claim.indexed;
|
return claim.target.collectedFrom != "infrastruct_::openaire";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -363,6 +376,43 @@ export class DisplayClaimsComponent implements OnInit, OnDestroy {
|
||||||
return totalPages;
|
return totalPages;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
selectClaim(item: any, event) {
|
||||||
|
let value = event.currentTarget.checked;
|
||||||
|
if (value) {
|
||||||
|
this.selected.push(item);
|
||||||
|
} else {
|
||||||
|
for (var _i = 0; _i < this.selected.length; _i++) {
|
||||||
|
let claim = this.selected[_i];
|
||||||
|
if (claim['id'] == item.id) {
|
||||||
|
this.selected.splice(_i, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
selectAll(event) {
|
||||||
|
let value = event.currentTarget.checked;
|
||||||
|
if (value) {
|
||||||
|
this.selected = [];
|
||||||
|
for (let _i = 0; _i < this.claims.length; _i++) {
|
||||||
|
let claim = this.claims[_i];
|
||||||
|
this.selected.push(claim);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.selected = [];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
isSelectedClaim(id: string) {
|
||||||
|
for (let _i = 0; _i < this.selected.length; _i++) {
|
||||||
|
let claim = this.selected[_i];
|
||||||
|
if (claim['id'] == id) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
private updateDescription(description: string) {
|
private updateDescription(description: string) {
|
||||||
this._meta.updateTag({content: description}, "name='description'");
|
this._meta.updateTag({content: description}, "name='description'");
|
||||||
this._meta.updateTag({content: description}, "property='og:description'");
|
this._meta.updateTag({content: description}, "property='og:description'");
|
||||||
|
|
|
@ -17,7 +17,6 @@ import {HelperModule} from '../../../utils/helper/helper.module';
|
||||||
import {Schema2jsonldModule} from '../../../sharedComponents/schema2jsonld/schema2jsonld.module';
|
import {Schema2jsonldModule} from '../../../sharedComponents/schema2jsonld/schema2jsonld.module';
|
||||||
import { SEOServiceModule } from '../../../sharedComponents/SEO/SEOService.module';
|
import { SEOServiceModule } from '../../../sharedComponents/SEO/SEOService.module';
|
||||||
import {IndexInfoServiceModule} from "../../../utils/indexInfoService.module";
|
import {IndexInfoServiceModule} from "../../../utils/indexInfoService.module";
|
||||||
import {PiwikServiceModule} from "../../../utils/piwik/piwikService.module";
|
|
||||||
import {SearchInputModule} from '../../../sharedComponents/search-input/search-input.module';
|
import {SearchInputModule} from '../../../sharedComponents/search-input/search-input.module';
|
||||||
import {InputModule} from '../../../sharedComponents/input/input.module';
|
import {InputModule} from '../../../sharedComponents/input/input.module';
|
||||||
import {LoadingModule} from '../../../utils/loading/loading.module';
|
import {LoadingModule} from '../../../utils/loading/loading.module';
|
||||||
|
@ -30,7 +29,7 @@ import {link} from "../../../utils/icons/icons";
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [
|
imports: [
|
||||||
CommonModule, FormsModule, RouterModule, ClaimServiceModule, LoadingModalModule, AlertModalModule,
|
CommonModule, FormsModule, RouterModule, ClaimServiceModule, LoadingModalModule, AlertModalModule,
|
||||||
ClaimEntityFormatterModule, PagingModule, HelperModule, Schema2jsonldModule, SEOServiceModule, PiwikServiceModule,
|
ClaimEntityFormatterModule, PagingModule, HelperModule, Schema2jsonldModule, SEOServiceModule,
|
||||||
IndexInfoServiceModule, MatSelectModule, SearchInputModule, MatAutocompleteModule, MatChipsModule, MatFormFieldModule, MatSlideToggleModule, InputModule, LoadingModule, NoLoadPaging, IconsModule, DropdownFilterModule
|
IndexInfoServiceModule, MatSelectModule, SearchInputModule, MatAutocompleteModule, MatChipsModule, MatFormFieldModule, MatSlideToggleModule, InputModule, LoadingModule, NoLoadPaging, IconsModule, DropdownFilterModule
|
||||||
|
|
||||||
],
|
],
|
||||||
|
|
|
@ -15,21 +15,22 @@ import {StringUtils} from "../../../utils/string-utils.class";
|
||||||
<div *ngIf="source" class="uk-text-small">
|
<div *ngIf="source" class="uk-text-small">
|
||||||
{{getEntityName(type)}}
|
{{getEntityName(type)}}
|
||||||
</div>
|
</div>
|
||||||
<div class="uk-flex">
|
<div>
|
||||||
<span *ngIf="!source" class="uk-text-meta uk-margin-small-right uk-text-large uk-text-nowrap">Link to:</span>
|
<span *ngIf="!source" class="uk-text-meta uk-text-small uk-margin-small-right uk-text-nowrap">Link to:</span>
|
||||||
<publication-title [entity]="entity" param="id"
|
<publication-title [entity]="entity" param="id"
|
||||||
path="/search/result" [externalPortalUrl]=externalPortalUrl [linkAvailable]="linkAvailable"></publication-title>
|
path="/search/result" [externalPortalUrl]=externalPortalUrl [linkAvailable]="linkAvailable"></publication-title>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div *ngIf="type == 'project'" [attr.uk-tooptip]="getEntityName(type)"
|
<div *ngIf="type == 'project'" [attr.uk-tooptip]="getEntityName(type)">
|
||||||
class="uk-flex">
|
<span class="uk-text-meta uk-text-small uk-margin-small-right uk-text-nowrap">Link to:</span>
|
||||||
<span class="uk-text-meta uk-margin-small-right uk-text-large uk-text-nowrap">Link to:</span>
|
|
||||||
<project-title [project]="entity" [searchLink]=properties.searchLinkToProject
|
<project-title [project]="entity" [searchLink]=properties.searchLinkToProject
|
||||||
[externalPortalUrl]=externalPortalUrl></project-title>
|
[externalPortalUrl]=externalPortalUrl></project-title>
|
||||||
</div>
|
</div>
|
||||||
<div *ngIf="type == 'context'" class="uk-flex uk-text-large">
|
<div *ngIf="type == 'context'">
|
||||||
<span class="uk-text-meta uk-margin-small-right uk-text-nowrap">Link to:</span>
|
<span class="uk-text-meta uk-text-small uk-margin-small-right uk-text-nowrap">Link to:</span>
|
||||||
|
<h6 class="uk-h6 uk-margin-remove">
|
||||||
<span class="uk-text-truncate" uk-tooltip="Concept">{{entity.title}}</span>
|
<span class="uk-text-truncate" uk-tooltip="Concept">{{entity.title}}</span>
|
||||||
|
</h6>
|
||||||
</div>
|
</div>
|
||||||
`
|
`
|
||||||
})
|
})
|
||||||
|
|
|
@ -20,7 +20,7 @@ import {properties} from "../../../../../environments/environment";
|
||||||
</h6>
|
</h6>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
<span *ngIf="project['funderName']" class="uk-margin-small-top">
|
<span *ngIf="project['funderName']" class="uk-margin-small-top">
|
||||||
<span class="uk-text-muted">Funder: </span>{{project['funderName']}}
|
<span class="uk-text-meta">Funder: </span>{{project['funderName']}}
|
||||||
</span>
|
</span>
|
||||||
`
|
`
|
||||||
})
|
})
|
||||||
|
|
|
@ -58,22 +58,20 @@ export class SearchDataciteService {
|
||||||
entity.result.journal = null;
|
entity.result.journal = null;
|
||||||
entity.result.DOI = item.attributes.doi;
|
entity.result.DOI = item.attributes.doi;
|
||||||
entity.id = item.attributes.doi;
|
entity.id = item.attributes.doi;
|
||||||
entity.title = item.attributes.title;
|
entity.title = Array.isArray(item.attributes.titles) && item.attributes.titles[0].title?item.attributes.titles[0].title:null;
|
||||||
entity.result.url = properties.doiURL + item.attributes.doi;
|
entity.result.url = properties.doiURL + item.attributes.doi;
|
||||||
entity.result.source = 'datacite';
|
entity.result.source = 'datacite';
|
||||||
entity.type = 'dataset';
|
entity.type = 'dataset';
|
||||||
entity.result.date = item.attributes.published;
|
entity.result.date = item.attributes.publicationYear;
|
||||||
entity.result.accessRights = "OPEN";
|
entity.result.accessRights = "OPEN";
|
||||||
entity.result.publisher = item.attributes['container-title'];
|
entity.result.publisher = item.attributes['publisher'];
|
||||||
entity.result.journal = null;
|
entity.result.journal = null;
|
||||||
entity.result.record = item;
|
entity.result.record = item;
|
||||||
if (item.attributes.author) {
|
if (item.attributes.creators) {
|
||||||
entity.result.authors = [];
|
entity.result.authors = [];
|
||||||
for (let j = 0; j < item.attributes.author.length; j++) {
|
for (let j = 0; j < item.attributes.creators.length; j++) {
|
||||||
const author = item.attributes.author[j];
|
const author = item.attributes.creators[j].name;
|
||||||
if(author.family || author.literal) {
|
entity.result.authors.push(author);
|
||||||
entity.result.authors.push((author.family) ? author.family + (author.given ? ', ' + author.given : '') : author.literal);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
results.push(entity);
|
results.push(entity);
|
||||||
|
|
|
@ -3,9 +3,6 @@ import { NgModule } from '@angular/core';
|
||||||
import { SharedModule } from '../../../openaireLibrary/shared/shared.module';
|
import { SharedModule } from '../../../openaireLibrary/shared/shared.module';
|
||||||
import { ClaimsAdminComponent } from './claimsAdmin.component';
|
import { ClaimsAdminComponent } from './claimsAdmin.component';
|
||||||
import {DisplayClaimsModule} from '../claim-utils/displayClaims/displayClaims.module';
|
import {DisplayClaimsModule} from '../claim-utils/displayClaims/displayClaims.module';
|
||||||
import { AdminLoginGuard} from'../../login/adminLoginGuard.guard';
|
|
||||||
import {PreviousRouteRecorder} from '../../utils/piwik/previousRouteRecorder.guard';
|
|
||||||
import {IsRouteEnabled} from '../../error/isRouteEnabled.guard';
|
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [
|
imports: [
|
||||||
|
@ -13,7 +10,7 @@ import {IsRouteEnabled} from '../../error/isRouteEnabled.guard';
|
||||||
DisplayClaimsModule
|
DisplayClaimsModule
|
||||||
|
|
||||||
],
|
],
|
||||||
providers:[AdminLoginGuard, PreviousRouteRecorder,IsRouteEnabled],
|
providers:[],
|
||||||
declarations: [
|
declarations: [
|
||||||
ClaimsAdminComponent
|
ClaimsAdminComponent
|
||||||
],
|
],
|
||||||
|
|
|
@ -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;
|
||||||
|
|
|
@ -5,9 +5,6 @@ import { DirectLinkingComponent } from './directLinking.component';
|
||||||
|
|
||||||
import {EntitySearchServiceModule} from '../../utils/entitiesAutoComplete/entitySearchService.module';
|
import {EntitySearchServiceModule} from '../../utils/entitiesAutoComplete/entitySearchService.module';
|
||||||
import {SearchResearchResultsServiceModule} from '../../services/searchResearchResultsService.module';
|
import {SearchResearchResultsServiceModule} from '../../services/searchResearchResultsService.module';
|
||||||
import {LoginGuard} from'../../login/loginGuard.guard';
|
|
||||||
import {PreviousRouteRecorder} from '../../utils/piwik/previousRouteRecorder.guard';
|
|
||||||
import {IsRouteEnabled} from '../../error/isRouteEnabled.guard';
|
|
||||||
import {Schema2jsonldModule} from '../../sharedComponents/schema2jsonld/schema2jsonld.module';
|
import {Schema2jsonldModule} from '../../sharedComponents/schema2jsonld/schema2jsonld.module';
|
||||||
import { SEOServiceModule } from '../../sharedComponents/SEO/SEOService.module';
|
import { SEOServiceModule } from '../../sharedComponents/SEO/SEOService.module';
|
||||||
import {LinkingGenericModule} from '../linking/linkingGeneric.module';
|
import {LinkingGenericModule} from '../linking/linkingGeneric.module';
|
||||||
|
@ -18,7 +15,7 @@ import {LinkingGenericModule} from '../linking/linkingGeneric.module';
|
||||||
EntitySearchServiceModule, SearchResearchResultsServiceModule,
|
EntitySearchServiceModule, SearchResearchResultsServiceModule,
|
||||||
Schema2jsonldModule, SEOServiceModule, LinkingGenericModule
|
Schema2jsonldModule, SEOServiceModule, LinkingGenericModule
|
||||||
],
|
],
|
||||||
providers:[LoginGuard, PreviousRouteRecorder, IsRouteEnabled],
|
providers:[],
|
||||||
declarations: [
|
declarations: [
|
||||||
DirectLinkingComponent
|
DirectLinkingComponent
|
||||||
], exports:[DirectLinkingComponent]
|
], exports:[DirectLinkingComponent]
|
||||||
|
|
|
@ -271,10 +271,15 @@ export class BulkClaimComponent {
|
||||||
err => {
|
err => {
|
||||||
// console.log(err);
|
// console.log(err);
|
||||||
BulkClaimComponent.handleError("Error getting crossref by DOIs: " + id, err);
|
BulkClaimComponent.handleError("Error getting crossref by DOIs: " + id, err);
|
||||||
|
|
||||||
|
if(err.status == 404) {
|
||||||
|
this.searchInDatacite(id, accessMode, date, row);
|
||||||
|
} else {
|
||||||
this.notFoundIds.push(id);
|
this.notFoundIds.push(id);
|
||||||
this.notFoundIdsRow.push(row);
|
this.notFoundIdsRow.push(row);
|
||||||
this.endOfFetching();
|
this.endOfFetching();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -156,13 +156,14 @@ export class ClaimInsertComponent {
|
||||||
this.loading.open();
|
this.loading.open();
|
||||||
let claims: ClaimRecord2Insert[] = [];
|
let claims: ClaimRecord2Insert[] = [];
|
||||||
let directclaims: DirectIndexRecord[] = [];
|
let directclaims: DirectIndexRecord[] = [];
|
||||||
|
let idSuffix = (new Date()).getTime() + "";
|
||||||
let dashboard = this.properties.environment+"_"+this.properties.dashboard + (this.communityId?("_"+this.communityId):'');
|
let dashboard = this.properties.environment+"_"+this.properties.dashboard + (this.communityId?("_"+this.communityId):'');
|
||||||
for (let j = 0; j < this.sources.length; j++) { // if an external result -> direct insert in the index
|
for (let j = 0; j < this.sources.length; j++) { // if an external result -> direct insert in the index
|
||||||
const result: ClaimEntity = this.sources[j];
|
const result: ClaimEntity = this.sources[j];
|
||||||
if (result.result && ["crossref", "datacite", "orcid"].indexOf(result.result.source) != -1) {
|
if (result.result && ["crossref", "datacite", "orcid"].indexOf(result.result.source) != -1) {
|
||||||
directclaims.push({
|
directclaims.push({
|
||||||
"id": result.id,
|
"id": result.id,
|
||||||
"record": ClaimInsertComponent.createDirectClaim(result, this.results)
|
"record": ClaimInsertComponent.createDirectClaim(result, this.results, idSuffix)
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -173,12 +174,12 @@ export class ClaimInsertComponent {
|
||||||
if (this.sources.length > 0) {
|
if (this.sources.length > 0) {
|
||||||
directclaims.push({
|
directclaims.push({
|
||||||
"id": entity.id,
|
"id": entity.id,
|
||||||
"record": ClaimInsertComponent.createDirectClaim(entity, this.sources)
|
"record": ClaimInsertComponent.createDirectClaim(entity, this.sources, idSuffix)
|
||||||
});
|
});
|
||||||
} else if (this.inlineEntity) {
|
} else if (this.inlineEntity) {
|
||||||
directclaims.push({
|
directclaims.push({
|
||||||
"id": entity.id,
|
"id": entity.id,
|
||||||
"record": ClaimInsertComponent.createDirectClaim(entity, [this.inlineEntity])
|
"record": ClaimInsertComponent.createDirectClaim(entity, [this.inlineEntity], idSuffix)
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -187,11 +188,11 @@ export class ClaimInsertComponent {
|
||||||
for (let j = 0; j < this.sources.length; j++) {
|
for (let j = 0; j < this.sources.length; j++) {
|
||||||
const result: ClaimEntity = this.sources[j]; // this is a research result
|
const result: ClaimEntity = this.sources[j]; // this is a research result
|
||||||
if (entity.result) {
|
if (entity.result) {
|
||||||
claims.push(ClaimInsertComponent.createResultClaim(result, entity, user.email, dashboard));
|
claims.push(ClaimInsertComponent.createResultClaim(result, entity, user.email, dashboard, idSuffix));
|
||||||
} else if (entity.context) {
|
} else if (entity.context) {
|
||||||
claims.push(ClaimInsertComponent.createContextClaim(result, entity, user.email, dashboard));
|
claims.push(ClaimInsertComponent.createContextClaim(result, entity, user.email, dashboard, idSuffix));
|
||||||
} else if (entity.project) {
|
} else if (entity.project) {
|
||||||
claims.push(ClaimInsertComponent.createProjectClaim(result, entity, user.email, dashboard));
|
claims.push(ClaimInsertComponent.createProjectClaim(result, entity, user.email, dashboard, idSuffix));
|
||||||
}
|
}
|
||||||
this.infoToLog.push([ result.title?result.title: result.id, entity.title?entity.title:entity.id]);
|
this.infoToLog.push([ result.title?result.title: result.id, entity.title?entity.title:entity.id]);
|
||||||
|
|
||||||
|
@ -201,15 +202,15 @@ export class ClaimInsertComponent {
|
||||||
if (this.inlineEntity.result) {
|
if (this.inlineEntity.result) {
|
||||||
if (entity.result) {
|
if (entity.result) {
|
||||||
|
|
||||||
claims.push(ClaimInsertComponent.createResultClaim(this.inlineEntity, entity, user.email, dashboard));
|
claims.push(ClaimInsertComponent.createResultClaim(this.inlineEntity, entity, user.email, dashboard, idSuffix));
|
||||||
} else if (entity.context) {
|
} else if (entity.context) {
|
||||||
claims.push(ClaimInsertComponent.createContextClaim(this.inlineEntity, entity, user.email, dashboard));
|
claims.push(ClaimInsertComponent.createContextClaim(this.inlineEntity, entity, user.email, dashboard, idSuffix));
|
||||||
} else if (entity.project) {
|
} else if (entity.project) {
|
||||||
claims.push(ClaimInsertComponent.createProjectClaim(this.inlineEntity, entity, user.email, dashboard));
|
claims.push(ClaimInsertComponent.createProjectClaim(this.inlineEntity, entity, user.email, dashboard, idSuffix));
|
||||||
}
|
}
|
||||||
} else if (this.inlineEntity.project) {
|
} else if (this.inlineEntity.project) {
|
||||||
if (entity.result) {
|
if (entity.result) {
|
||||||
claims.push(ClaimInsertComponent.createProjectClaim(entity, this.inlineEntity, user.email, dashboard));
|
claims.push(ClaimInsertComponent.createProjectClaim(entity, this.inlineEntity, user.email, dashboard, idSuffix));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -390,7 +391,7 @@ export class ClaimInsertComponent {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private static createContextClaim(resultEntity: ClaimEntity, contextEntity: ClaimEntity, user: any, dashboard:string): ClaimRecord2Insert {
|
private static createContextClaim(resultEntity: ClaimEntity, contextEntity: ClaimEntity, user: any, dashboard:string, idSuffix:string): ClaimRecord2Insert {
|
||||||
return {
|
return {
|
||||||
claimedBy: user,
|
claimedBy: user,
|
||||||
sourceId: contextEntity.context.concept.id,
|
sourceId: contextEntity.context.concept.id,
|
||||||
|
@ -403,11 +404,12 @@ export class ClaimInsertComponent {
|
||||||
targetCollectedFrom: resultEntity.result.source,
|
targetCollectedFrom: resultEntity.result.source,
|
||||||
targetAccessRights: resultEntity.result.accessRights,
|
targetAccessRights: resultEntity.result.accessRights,
|
||||||
targetEmbargoEndDate: ClaimInsertComponent.getEmbargoEndDate(resultEntity),
|
targetEmbargoEndDate: ClaimInsertComponent.getEmbargoEndDate(resultEntity),
|
||||||
claimedInDashboard : dashboard
|
claimedInDashboard : dashboard,
|
||||||
|
idSuffix : idSuffix
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
private static createProjectClaim(resultEntity: ClaimEntity, projectEntity: ClaimEntity, user: any, dashboard:string): ClaimRecord2Insert {
|
private static createProjectClaim(resultEntity: ClaimEntity, projectEntity: ClaimEntity, user: any, dashboard:string, idSuffix:string): ClaimRecord2Insert {
|
||||||
return {
|
return {
|
||||||
claimedBy: user,
|
claimedBy: user,
|
||||||
sourceId: projectEntity.id,
|
sourceId: projectEntity.id,
|
||||||
|
@ -420,11 +422,12 @@ export class ClaimInsertComponent {
|
||||||
targetCollectedFrom: resultEntity.result.source,
|
targetCollectedFrom: resultEntity.result.source,
|
||||||
targetAccessRights: resultEntity.result.accessRights,
|
targetAccessRights: resultEntity.result.accessRights,
|
||||||
targetEmbargoEndDate: ClaimInsertComponent.getEmbargoEndDate(resultEntity),
|
targetEmbargoEndDate: ClaimInsertComponent.getEmbargoEndDate(resultEntity),
|
||||||
claimedInDashboard : dashboard
|
claimedInDashboard : dashboard,
|
||||||
|
idSuffix : idSuffix
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
private static createResultClaim(inlineResult: ClaimEntity, resultEntity: ClaimEntity, user: string, dashboard:string): ClaimRecord2Insert {
|
private static createResultClaim(inlineResult: ClaimEntity, resultEntity: ClaimEntity, user: string, dashboard:string, idSuffix:string): ClaimRecord2Insert {
|
||||||
|
|
||||||
return {
|
return {
|
||||||
claimedBy: user,
|
claimedBy: user,
|
||||||
|
@ -438,7 +441,9 @@ export class ClaimInsertComponent {
|
||||||
targetCollectedFrom: inlineResult.result.source,
|
targetCollectedFrom: inlineResult.result.source,
|
||||||
targetAccessRights: inlineResult.result.accessRights,
|
targetAccessRights: inlineResult.result.accessRights,
|
||||||
targetEmbargoEndDate: ClaimInsertComponent.getEmbargoEndDate(inlineResult),
|
targetEmbargoEndDate: ClaimInsertComponent.getEmbargoEndDate(inlineResult),
|
||||||
claimedInDashboard : dashboard
|
claimedInDashboard : dashboard,
|
||||||
|
idSuffix : idSuffix
|
||||||
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -448,12 +453,13 @@ export class ClaimInsertComponent {
|
||||||
}
|
}
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
static createOpenAIREId(id, idSuffix:string):string {
|
||||||
static createDirectClaim(resultEntity: ClaimEntity, results: ClaimEntity[]) {
|
return id.indexOf( "::" ) == -1 ? ("userclaim___::" + Md5.hashStr(id + idSuffix)):id;
|
||||||
|
}
|
||||||
|
static createDirectClaim(resultEntity: ClaimEntity, results: ClaimEntity[], idSuffix:string) {
|
||||||
let entity = {};
|
let entity = {};
|
||||||
const md5_id = Md5.hashStr(resultEntity.id);
|
entity["originalId"] = this.createOpenAIREId(resultEntity.id, idSuffix);
|
||||||
entity["originalId"] = "userclaim___::" + md5_id;
|
entity["openaireId"] = this.createOpenAIREId(resultEntity.id, idSuffix);
|
||||||
entity["openaireId"] = "userclaim___::" + md5_id;
|
|
||||||
entity["title"] = resultEntity.title;
|
entity["title"] = resultEntity.title;
|
||||||
entity["title"] = (Array.isArray(resultEntity.title) && resultEntity.title.length > 0) ? resultEntity.title[0] : resultEntity.title;
|
entity["title"] = (Array.isArray(resultEntity.title) && resultEntity.title.length > 0) ? resultEntity.title[0] : resultEntity.title;
|
||||||
|
|
||||||
|
@ -502,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) {
|
||||||
|
|
||||||
|
|
|
@ -7,20 +7,16 @@ import {SelectedContextsModule} from './selected/selectedContexts.module';
|
||||||
import {SelectedPublicationsModule} from './selected/selectedResults.module';
|
import {SelectedPublicationsModule} from './selected/selectedResults.module';
|
||||||
import {LinkingGenericComponent} from './linkingGeneric.component';
|
import {LinkingGenericComponent} from './linkingGeneric.component';
|
||||||
import {StartOverModule} from '../claim-utils/startOver.module';
|
import {StartOverModule} from '../claim-utils/startOver.module';
|
||||||
import {LoginGuard} from '../../login/loginGuard.guard';
|
|
||||||
import {PreviousRouteRecorder} from '../../utils/piwik/previousRouteRecorder.guard';
|
|
||||||
import {ClaimContextSearchFormModule} from '../claim-utils/claimContextSearchForm.module';
|
import {ClaimContextSearchFormModule} from '../claim-utils/claimContextSearchForm.module';
|
||||||
import {ClaimProjectsSearchFormModule} from '../claim-utils/claimProjectSearchForm.module';
|
import {ClaimProjectsSearchFormModule} from '../claim-utils/claimProjectSearchForm.module';
|
||||||
import {BulkClaimModule} from './bulkClaim/bulkClaim.module';
|
import {BulkClaimModule} from './bulkClaim/bulkClaim.module';
|
||||||
import {ClaimResultSearchFormModule} from '../claim-utils/claimResultSearchForm.module';
|
import {ClaimResultSearchFormModule} from '../claim-utils/claimResultSearchForm.module';
|
||||||
import {HelperModule} from '../../utils/helper/helper.module';
|
import {HelperModule} from '../../utils/helper/helper.module';
|
||||||
import {IsRouteEnabled} from '../../error/isRouteEnabled.guard';
|
|
||||||
import {Schema2jsonldModule} from '../../sharedComponents/schema2jsonld/schema2jsonld.module';
|
import {Schema2jsonldModule} from '../../sharedComponents/schema2jsonld/schema2jsonld.module';
|
||||||
import {SEOServiceModule} from '../../sharedComponents/SEO/SEOService.module';
|
import {SEOServiceModule} from '../../sharedComponents/SEO/SEOService.module';
|
||||||
import {MetadataPreviewModule} from './selected/metadataPreview.module';
|
import {MetadataPreviewModule} from './selected/metadataPreview.module';
|
||||||
import {ClaimEntitiesMetadataModule} from "./selected/ClaimEntitiesMetadata.module";
|
import {ClaimEntitiesMetadataModule} from "./selected/ClaimEntitiesMetadata.module";
|
||||||
import {AlertModalModule} from '../../utils/modal/alertModal.module';
|
import {AlertModalModule} from '../../utils/modal/alertModal.module';
|
||||||
import {PiwikServiceModule} from "../../utils/piwik/piwikService.module";
|
|
||||||
import {BreadcrumbsModule} from "../../utils/breadcrumbs/breadcrumbs.module";
|
import {BreadcrumbsModule} from "../../utils/breadcrumbs/breadcrumbs.module";
|
||||||
import {StepperModule} from "../../sharedComponents/stepper/stepper.module";
|
import {StepperModule} from "../../sharedComponents/stepper/stepper.module";
|
||||||
import {IconsModule} from "../../utils/icons/icons.module";
|
import {IconsModule} from "../../utils/icons/icons.module";
|
||||||
|
@ -34,10 +30,9 @@ import {link} from "../../utils/icons/icons";
|
||||||
StartOverModule,
|
StartOverModule,
|
||||||
ClaimContextSearchFormModule, ClaimProjectsSearchFormModule, BulkClaimModule, ClaimResultSearchFormModule,
|
ClaimContextSearchFormModule, ClaimProjectsSearchFormModule, BulkClaimModule, ClaimResultSearchFormModule,
|
||||||
HelperModule, Schema2jsonldModule, SEOServiceModule, MetadataPreviewModule, ClaimEntitiesMetadataModule, AlertModalModule,
|
HelperModule, Schema2jsonldModule, SEOServiceModule, MetadataPreviewModule, ClaimEntitiesMetadataModule, AlertModalModule,
|
||||||
PiwikServiceModule,
|
|
||||||
MatSelectModule, BreadcrumbsModule, StepperModule, IconsModule
|
MatSelectModule, BreadcrumbsModule, StepperModule, IconsModule
|
||||||
],
|
],
|
||||||
providers: [LoginGuard, PreviousRouteRecorder, IsRouteEnabled],
|
providers: [],
|
||||||
declarations: [
|
declarations: [
|
||||||
LinkingGenericComponent
|
LinkingGenericComponent
|
||||||
], exports: [
|
], exports: [
|
||||||
|
|
|
@ -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>
|
||||||
|
|
|
@ -3,9 +3,6 @@ import { NgModule } from '@angular/core';
|
||||||
import { SharedModule } from '../../../openaireLibrary/shared/shared.module';
|
import { SharedModule } from '../../../openaireLibrary/shared/shared.module';
|
||||||
import { MyClaimsComponent } from './myClaims.component';
|
import { MyClaimsComponent } from './myClaims.component';
|
||||||
import {DisplayClaimsModule} from '../claim-utils/displayClaims/displayClaims.module';
|
import {DisplayClaimsModule} from '../claim-utils/displayClaims/displayClaims.module';
|
||||||
import {LoginGuard} from'../../login/loginGuard.guard';
|
|
||||||
import {PreviousRouteRecorder} from '../../utils/piwik/previousRouteRecorder.guard';
|
|
||||||
import {IsRouteEnabled} from '../../error/isRouteEnabled.guard';
|
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [
|
imports: [
|
||||||
|
@ -13,7 +10,7 @@ import {IsRouteEnabled} from '../../error/isRouteEnabled.guard';
|
||||||
DisplayClaimsModule
|
DisplayClaimsModule
|
||||||
|
|
||||||
],
|
],
|
||||||
providers:[LoginGuard, PreviousRouteRecorder, IsRouteEnabled],
|
providers:[],
|
||||||
declarations: [
|
declarations: [
|
||||||
MyClaimsComponent
|
MyClaimsComponent
|
||||||
], exports: [MyClaimsComponent]
|
], exports: [MyClaimsComponent]
|
||||||
|
|
|
@ -15,9 +15,10 @@ import {LoadingModule} from "../../utils/loading/loading.module";
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [
|
imports: [
|
||||||
|
ClassesRoutingModule,
|
||||||
CommonModule, RouterModule, FormsModule,
|
CommonModule, RouterModule, FormsModule,
|
||||||
AlertModalModule, ReactiveFormsModule, AdminToolServiceModule, InputModule,
|
AlertModalModule, ReactiveFormsModule, AdminToolServiceModule, InputModule,
|
||||||
AdminTabsModule, PageContentModule, ClassesRoutingModule, SearchInputModule, IconsModule, LoadingModule
|
AdminTabsModule, PageContentModule, SearchInputModule, IconsModule, LoadingModule
|
||||||
],
|
],
|
||||||
declarations: [DivIdsComponent],
|
declarations: [DivIdsComponent],
|
||||||
exports: [DivIdsComponent]
|
exports: [DivIdsComponent]
|
||||||
|
|
|
@ -16,9 +16,10 @@ import {PageContentModule} from '../sharedComponents/page-content/page-content.m
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [
|
imports: [
|
||||||
|
ClassHelpContentFormRoutingModule,
|
||||||
CommonModule, FormsModule, RouterModule,
|
CommonModule, FormsModule, RouterModule,
|
||||||
SafeHtmlPipeModule, CKEditorModule,
|
SafeHtmlPipeModule, CKEditorModule,
|
||||||
AlertModalModule, ReactiveFormsModule, ClassHelpContentFormRoutingModule, AdminToolServiceModule, InputModule, MatSlideToggleModule, IconsModule, LoadingModule, PageContentModule
|
AlertModalModule, ReactiveFormsModule, AdminToolServiceModule, InputModule, MatSlideToggleModule, IconsModule, LoadingModule, PageContentModule
|
||||||
],
|
],
|
||||||
declarations: [
|
declarations: [
|
||||||
ClassContentFormComponent
|
ClassContentFormComponent
|
||||||
|
|
|
@ -19,8 +19,9 @@ import {PageContentModule} from '../sharedComponents/page-content/page-content.m
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [
|
imports: [
|
||||||
|
ClassHelpContentsRoutingModule,
|
||||||
CommonModule, RouterModule, FormsModule, SafeHtmlPipeModule,
|
CommonModule, RouterModule, FormsModule, SafeHtmlPipeModule,
|
||||||
AlertModalModule, ReactiveFormsModule, MatSlideToggleModule, AdminToolServiceModule, InputModule, ClassHelpContentsRoutingModule,
|
AlertModalModule, ReactiveFormsModule, MatSlideToggleModule, AdminToolServiceModule, InputModule,
|
||||||
SearchInputModule, IconsModule, LoadingModule, HTMLToStringPipeModule, PageContentModule
|
SearchInputModule, IconsModule, LoadingModule, HTMLToStringPipeModule, PageContentModule
|
||||||
],
|
],
|
||||||
declarations: [
|
declarations: [
|
||||||
|
|
|
@ -17,8 +17,9 @@ import {LogoUrlPipeModule} from "../../utils/pipes/logoUrlPipe.module";
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [
|
imports: [
|
||||||
|
EntitiesRoutingModule,
|
||||||
CommonModule, RouterModule, FormsModule, AdminToolServiceModule,
|
CommonModule, RouterModule, FormsModule, AdminToolServiceModule,
|
||||||
AlertModalModule, ReactiveFormsModule, MatSlideToggleModule, InputModule, PageContentModule, AdminTabsModule, EntitiesRoutingModule, SearchInputModule, IconsModule, LoadingModule, LogoUrlPipeModule
|
AlertModalModule, ReactiveFormsModule, MatSlideToggleModule, InputModule, PageContentModule, AdminTabsModule, SearchInputModule, IconsModule, LoadingModule, LogoUrlPipeModule
|
||||||
],
|
],
|
||||||
declarations: [EntitiesComponent],
|
declarations: [EntitiesComponent],
|
||||||
exports: [EntitiesComponent]
|
exports: [EntitiesComponent]
|
||||||
|
|
|
@ -16,9 +16,10 @@ import {MatSlideToggleModule} from "@angular/material/slide-toggle";
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [
|
imports: [
|
||||||
|
PageHelpContentFormRoutingModule,
|
||||||
CommonModule, FormsModule, RouterModule,
|
CommonModule, FormsModule, RouterModule,
|
||||||
SafeHtmlPipeModule, CKEditorModule,
|
SafeHtmlPipeModule, CKEditorModule,
|
||||||
AlertModalModule, ReactiveFormsModule, PageHelpContentFormRoutingModule, AdminToolServiceModule, InputModule, IconsModule, PageContentModule, LoadingModule, MatSlideToggleModule
|
AlertModalModule, ReactiveFormsModule, AdminToolServiceModule, InputModule, IconsModule, PageContentModule, LoadingModule, MatSlideToggleModule
|
||||||
],
|
],
|
||||||
declarations: [PageContentFormComponent],
|
declarations: [PageContentFormComponent],
|
||||||
exports: [PageContentFormComponent]
|
exports: [PageContentFormComponent]
|
||||||
|
|
|
@ -17,8 +17,9 @@ import {HTMLToStringPipeModule} from '../../utils/pipes/HTMLToStringPipe.module'
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [
|
imports: [
|
||||||
|
PageHelpContentsRoutingModule,
|
||||||
CommonModule, RouterModule, FormsModule, SafeHtmlPipeModule,
|
CommonModule, RouterModule, FormsModule, SafeHtmlPipeModule,
|
||||||
AlertModalModule, ReactiveFormsModule, MatSlideToggleModule, AdminToolServiceModule, InputModule, PageHelpContentsRoutingModule, PageContentModule,
|
AlertModalModule, ReactiveFormsModule, MatSlideToggleModule, AdminToolServiceModule, InputModule, PageContentModule,
|
||||||
SearchInputModule, IconsModule, LoadingModule, HTMLToStringPipeModule
|
SearchInputModule, IconsModule, LoadingModule, HTMLToStringPipeModule
|
||||||
],
|
],
|
||||||
declarations: [
|
declarations: [
|
||||||
|
|
|
@ -372,10 +372,8 @@ export class MenuComponent implements OnInit {
|
||||||
}
|
}
|
||||||
|
|
||||||
public valueChange() {
|
public valueChange() {
|
||||||
this.elements.disable();
|
|
||||||
this.cdr.detectChanges();
|
this.cdr.detectChanges();
|
||||||
this.elements.init();
|
this.elements.init();
|
||||||
this.elements.enable();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public get displayMenuItems() {
|
public get displayMenuItems() {
|
||||||
|
|
|
@ -18,8 +18,9 @@ import {LogoUrlPipeModule} from '../../utils/pipes/logoUrlPipe.module';
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [
|
imports: [
|
||||||
|
MenuRoutingModule,
|
||||||
CommonModule, RouterModule, FormsModule, AdminToolServiceModule,
|
CommonModule, RouterModule, FormsModule, AdminToolServiceModule,
|
||||||
AlertModalModule, ReactiveFormsModule, MatSlideToggleModule, InputModule, PageContentModule, AdminTabsModule, MenuRoutingModule, SearchInputModule, IconsModule, LoadingModule,
|
AlertModalModule, ReactiveFormsModule, MatSlideToggleModule, InputModule, PageContentModule, AdminTabsModule, SearchInputModule, IconsModule, LoadingModule,
|
||||||
TransitionGroupModule, LogoUrlPipeModule
|
TransitionGroupModule, LogoUrlPipeModule
|
||||||
],
|
],
|
||||||
declarations: [MenuComponent],
|
declarations: [MenuComponent],
|
||||||
|
|
|
@ -20,8 +20,9 @@ import {LogoUrlPipeModule} from "../../utils/pipes/logoUrlPipe.module";
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [
|
imports: [
|
||||||
|
PagesRoutingModule,
|
||||||
CommonModule, RouterModule, FormsModule, AlertModalModule, ReactiveFormsModule, MatSlideToggleModule, AdminToolServiceModule, InputModule,
|
CommonModule, RouterModule, FormsModule, AlertModalModule, ReactiveFormsModule, MatSlideToggleModule, AdminToolServiceModule, InputModule,
|
||||||
MatAutocompleteModule, MatFormFieldModule, MatChipsModule, AdminTabsModule, PageContentModule, PagesRoutingModule, SearchInputModule, IconsModule, LoadingModule, LogoUrlPipeModule
|
MatAutocompleteModule, MatFormFieldModule, MatChipsModule, AdminTabsModule, PageContentModule, SearchInputModule, IconsModule, LoadingModule, LogoUrlPipeModule
|
||||||
],
|
],
|
||||||
declarations: [PagesComponent],
|
declarations: [PagesComponent],
|
||||||
exports: [PagesComponent]
|
exports: [PagesComponent]
|
||||||
|
|
|
@ -15,9 +15,10 @@ import {LoadingModule} from "../../utils/loading/loading.module";
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [
|
imports: [
|
||||||
|
PortalsRoutingModule,
|
||||||
CommonModule, FormsModule, AlertModalModule,
|
CommonModule, FormsModule, AlertModalModule,
|
||||||
ReactiveFormsModule,
|
ReactiveFormsModule,
|
||||||
RouterModule, AdminToolServiceModule, InputModule, AdminTabsModule, PageContentModule, PortalsRoutingModule, IconsModule, SearchInputModule, LoadingModule
|
RouterModule, AdminToolServiceModule, InputModule, AdminTabsModule, PageContentModule, IconsModule, SearchInputModule, LoadingModule
|
||||||
],
|
],
|
||||||
declarations: [PortalsComponent],
|
declarations: [PortalsComponent],
|
||||||
exports: [PortalsComponent]
|
exports: [PortalsComponent]
|
||||||
|
|
|
@ -88,6 +88,10 @@ export class LayoutService {
|
||||||
* Handle it manually in the component, it doesn't use data
|
* Handle it manually in the component, it doesn't use data
|
||||||
* */
|
* */
|
||||||
private rootClassSubject: BehaviorSubject<string> = new BehaviorSubject<string>(null);
|
private rootClassSubject: BehaviorSubject<string> = new BehaviorSubject<string>(null);
|
||||||
|
/**
|
||||||
|
* Display help pop-up on non-admin pages. (default true for the rest of the pages)
|
||||||
|
* */
|
||||||
|
private hasHelpPopUpSubject: BehaviorSubject<boolean> = new BehaviorSubject<boolean>(true);
|
||||||
private subscriptions: any[] = [];
|
private subscriptions: any[] = [];
|
||||||
|
|
||||||
ngOnDestroy() {
|
ngOnDestroy() {
|
||||||
|
@ -343,4 +347,12 @@ export class LayoutService {
|
||||||
this.rootClassSubject.next(value);
|
this.rootClassSubject.next(value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get hasHelpPopUp(): Observable<boolean> {
|
||||||
|
return this.hasHelpPopUpSubject.asObservable();
|
||||||
|
}
|
||||||
|
|
||||||
|
setHasHelpPopUp(value: boolean) {
|
||||||
|
this.hasHelpPopUpSubject.next(value);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,26 +8,26 @@
|
||||||
<div class="uk-flex uk-flex-left@m uk-flex-center uk-width-expand">
|
<div class="uk-flex uk-flex-left@m uk-flex-center uk-width-expand">
|
||||||
<ul class="uk-subnav uk-subnav-pill">
|
<ul class="uk-subnav uk-subnav-pill">
|
||||||
<li [class.uk-active]="showCurrent" (click)="showCurrent = true">
|
<li [class.uk-active]="showCurrent" (click)="showCurrent = true">
|
||||||
<a class="uk-text-capitalize">{{role}}s</a>
|
<a class="uk-text-capitalize">{{stakeholderUtils.roles[role]}}s</a>
|
||||||
</li>
|
</li>
|
||||||
<li [class.uk-active]="!showCurrent" (click)="showCurrent = false">
|
<li [class.uk-active]="!showCurrent" (click)="showCurrent = false">
|
||||||
<a>Pending {{role}}s</a>
|
<a>Pending {{stakeholderUtils.roles[role]}}s</a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div class="uk-width-expand@m uk-width-1-1 uk-grid uk-flex-right@m uk-flex-center uk-flex-middle" uk-grid>
|
<div class="uk-width-expand@m uk-width-1-1 uk-grid uk-flex-right@m uk-flex-center uk-flex-middle" uk-grid>
|
||||||
<div *ngIf="showCurrent" [disabled]="loadActive" search-input class="uk-width-expand@l uk-width-1-1"
|
<div *ngIf="showCurrent" [disabled]="loadActive" search-input class="uk-width-expand@l uk-width-1-1"
|
||||||
[searchControl]="filterForm.get('active')" [expandable]="true" [placeholder]="'Search ' + role + 's'" searchInputClass="outer">
|
[searchControl]="filterForm.get('active')" [expandable]="true" [placeholder]="'Search ' + stakeholderUtils.roles[role] + 's'" searchInputClass="outer">
|
||||||
</div>
|
</div>
|
||||||
<div *ngIf="!showCurrent" [disabled]="loadPending" search-input class="uk-width-expand@l uk-width-1-1"
|
<div *ngIf="!showCurrent" [disabled]="loadPending" search-input class="uk-width-expand@l uk-width-1-1"
|
||||||
[searchControl]="filterForm.get('pending')" [expandable]="true" [placeholder]="'Search invitations'" searchInputClass="outer">
|
[searchControl]="filterForm.get('pending')" [expandable]="true" [placeholder]="'Search invitations'" searchInputClass="outer">
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<button *ngIf="exists" class="uk-button uk-button-default uk-flex uk-flex-middle"
|
<button *ngIf="canInvite" class="uk-button uk-button-default uk-flex uk-flex-middle"
|
||||||
[attr.uk-tooltip]="inviteDisableMessage" [class.uk-disabled]="loadPending || loadPending"
|
[attr.uk-tooltip]="inviteDisableMessage" [class.uk-disabled]="loadPending || loadPending"
|
||||||
[disabled]="loadActive || loadPending || !!inviteDisableMessage" (click)="openInviteModal()">
|
[disabled]="loadActive || loadPending || !!inviteDisableMessage" (click)="openInviteModal()">
|
||||||
<icon name="person_add" [flex]="true" type="filled"></icon>
|
<icon name="person_add" [flex]="true" type="filled"></icon>
|
||||||
<span class="uk-margin-small-left uk-text-bold uk-text-uppercase">Invite {{role}}</span>
|
<span class="uk-margin-small-left uk-text-bold uk-text-uppercase">Invite {{stakeholderUtils.roles[role]}}</span>
|
||||||
</button>
|
</button>
|
||||||
<button *ngIf="!exists && isCurator" class="uk-button uk-button-default uk-flex uk-flex-middle"
|
<button *ngIf="!exists && isCurator" class="uk-button uk-button-default uk-flex uk-flex-middle"
|
||||||
(click)="openCreateRoleModal()">
|
(click)="openCreateRoleModal()">
|
||||||
|
@ -47,16 +47,16 @@
|
||||||
<div *ngIf="!loadActive && !loadPending">
|
<div *ngIf="!loadActive && !loadPending">
|
||||||
<div *ngIf="(showCurrent && showActive.length == 0) || (!showCurrent && showPending.length == 0)"
|
<div *ngIf="(showCurrent && showActive.length == 0) || (!showCurrent && showPending.length == 0)"
|
||||||
class="uk-card uk-card-default uk-padding-large uk-text-center uk-margin-bottom uk-text-bold">
|
class="uk-card uk-card-default uk-padding-large uk-text-center uk-margin-bottom uk-text-bold">
|
||||||
<div *ngIf="showCurrent">No {{role}}s found</div>
|
<div *ngIf="showCurrent">No {{stakeholderUtils.roles[role]}}s found</div>
|
||||||
<div *ngIf="!showCurrent">No pending {{role}} invitations found</div>
|
<div *ngIf="!showCurrent">No pending {{stakeholderUtils.roles[role]}} invitations found</div>
|
||||||
</div>
|
</div>
|
||||||
<div *ngIf="(showCurrent && showActive.length > 0) || (!showCurrent && showPending.length > 0)">
|
<div *ngIf="(showCurrent && showActive.length > 0) || (!showCurrent && showPending.length > 0)">
|
||||||
<no-load-paging *ngIf="showCurrent" [type]="(showActive.length > 1)?(role + 's'):role"
|
<no-load-paging *ngIf="showCurrent" [type]="(showActive.length > 1)?(stakeholderUtils.roles[role] + 's'):role"
|
||||||
(pageChange)="updateActivePage($event)"
|
(pageChange)="updateActivePage($event)"
|
||||||
[page]="activePage" [pageSize]="pageSize"
|
[page]="activePage" [pageSize]="pageSize"
|
||||||
[totalResults]="showActive.length">
|
[totalResults]="showActive.length">
|
||||||
</no-load-paging>
|
</no-load-paging>
|
||||||
<no-load-paging *ngIf="!showCurrent" [type]="role + ' ' + (showPending.length > 1?'invitations':'invitation')"
|
<no-load-paging *ngIf="!showCurrent" [type]="stakeholderUtils.roles[role] + ' ' + (showPending.length > 1?'invitations':'invitation')"
|
||||||
(pageChange)="updatePendingPage($event)"
|
(pageChange)="updatePendingPage($event)"
|
||||||
[page]="pendingPage" [pageSize]="pageSize"
|
[page]="pendingPage" [pageSize]="pageSize"
|
||||||
[totalResults]="showPending.length">
|
[totalResults]="showPending.length">
|
||||||
|
@ -109,12 +109,12 @@
|
||||||
</modal-alert>
|
</modal-alert>
|
||||||
<modal-alert #deleteModal [overflowBody]="false" (alertOutput)="deleteActive()" classTitle="uk-background-primary uk-light">
|
<modal-alert #deleteModal [overflowBody]="false" (alertOutput)="deleteActive()" classTitle="uk-background-primary uk-light">
|
||||||
<div *ngIf="selectedUser">
|
<div *ngIf="selectedUser">
|
||||||
Are you sure you want to remove <span class="uk-text-bold">{{selectedUser}}</span> from {{role}}s?
|
Are you sure you want to remove <span class="uk-text-bold">{{selectedUser}}</span> from {{stakeholderUtils.roles[role]}}s?
|
||||||
</div>
|
</div>
|
||||||
</modal-alert>
|
</modal-alert>
|
||||||
<modal-alert #deletePendingModal [overflowBody]="false" (alertOutput)="deletePending()" classTitle="uk-background-primary uk-light">
|
<modal-alert #deletePendingModal [overflowBody]="false" (alertOutput)="deletePending()" classTitle="uk-background-primary uk-light">
|
||||||
<div *ngIf="selectedUser">
|
<div *ngIf="selectedUser">
|
||||||
Are you sure you want to cancel {{role}} invitation of <span class="uk-text-bold">{{selectedUser}}</span>?
|
Are you sure you want to cancel {{stakeholderUtils.roles[role]}} invitation of <span class="uk-text-bold">{{selectedUser}}</span>?
|
||||||
</div>
|
</div>
|
||||||
</modal-alert>
|
</modal-alert>
|
||||||
<modal-alert #createRoleModal [overflowBody]="false" (alertOutput)="createGroup()" classTitle="uk-background-primary uk-light"
|
<modal-alert #createRoleModal [overflowBody]="false" (alertOutput)="createGroup()" classTitle="uk-background-primary uk-light"
|
||||||
|
|
|
@ -23,6 +23,7 @@ import {NotificationHandler} from "../../../utils/notification-handler";
|
||||||
import {ClearCacheService} from "../../../services/clear-cache.service";
|
import {ClearCacheService} from "../../../services/clear-cache.service";
|
||||||
import {catchError, map, tap} from "rxjs/operators";
|
import {catchError, map, tap} from "rxjs/operators";
|
||||||
import {InputComponent} from "../../../sharedComponents/input/input.component";
|
import {InputComponent} from "../../../sharedComponents/input/input.component";
|
||||||
|
import {StakeholderUtils} from "../../../monitor-admin/utils/indicator-utils";
|
||||||
|
|
||||||
class InvitationResponse {
|
class InvitationResponse {
|
||||||
email: string;
|
email: string;
|
||||||
|
@ -43,7 +44,9 @@ export class RoleUsersComponent implements OnInit, OnDestroy, OnChanges {
|
||||||
@Input()
|
@Input()
|
||||||
public id: string;
|
public id: string;
|
||||||
@Input()
|
@Input()
|
||||||
public type: string;
|
set type(type: string) {
|
||||||
|
this._type = Role.mapType(type);
|
||||||
|
}
|
||||||
@Input()
|
@Input()
|
||||||
public name: string;
|
public name: string;
|
||||||
@Input()
|
@Input()
|
||||||
|
@ -53,6 +56,8 @@ export class RoleUsersComponent implements OnInit, OnDestroy, OnChanges {
|
||||||
@Input()
|
@Input()
|
||||||
public deleteAuthorizationLevel: 'curator' | 'manager' = 'curator';
|
public deleteAuthorizationLevel: 'curator' | 'manager' = 'curator';
|
||||||
@Input()
|
@Input()
|
||||||
|
public inviteAuthorizationLevel: 'curator' | 'manager' = 'manager';
|
||||||
|
@Input()
|
||||||
public message: string = null;
|
public message: string = null;
|
||||||
@Input()
|
@Input()
|
||||||
public emailComposer: Function;
|
public emailComposer: Function;
|
||||||
|
@ -86,12 +91,13 @@ export class RoleUsersComponent implements OnInit, OnDestroy, OnChanges {
|
||||||
@ViewChild('deleteModal') deleteModal: AlertModal;
|
@ViewChild('deleteModal') deleteModal: AlertModal;
|
||||||
@ViewChild('deletePendingModal') deletePendingModal: AlertModal;
|
@ViewChild('deletePendingModal') deletePendingModal: AlertModal;
|
||||||
@ViewChild('createRoleModal') createRoleModal: AlertModal;
|
@ViewChild('createRoleModal') createRoleModal: AlertModal;
|
||||||
|
public stakeholderUtils: StakeholderUtils = new StakeholderUtils();
|
||||||
|
private _type: string;
|
||||||
|
|
||||||
constructor(private userRegistryService: UserRegistryService,
|
constructor(private userRegistryService: UserRegistryService,
|
||||||
private userManagementService: UserManagementService,
|
private userManagementService: UserManagementService,
|
||||||
private clearCacheService: ClearCacheService,
|
private clearCacheService: ClearCacheService,
|
||||||
private notificationService: NotificationService,
|
private notificationService: NotificationService,
|
||||||
private router: Router,
|
|
||||||
private cdr: ChangeDetectorRef,
|
private cdr: ChangeDetectorRef,
|
||||||
private fb: UntypedFormBuilder) {
|
private fb: UntypedFormBuilder) {
|
||||||
}
|
}
|
||||||
|
@ -140,7 +146,7 @@ export class RoleUsersComponent implements OnInit, OnDestroy, OnChanges {
|
||||||
updateLists() {
|
updateLists() {
|
||||||
this.loadActive = true;
|
this.loadActive = true;
|
||||||
this.loadPending = true;
|
this.loadPending = true;
|
||||||
this.subs.push(this.userRegistryService.getActive(this.type, this.id, this.role, true).subscribe(users => {
|
this.subs.push(this.userRegistryService.getActive(this._type, this.id, this.role, true).subscribe(users => {
|
||||||
this.active = users;
|
this.active = users;
|
||||||
this.filterActiveBySearch(this.filterForm.value.active);
|
this.filterActiveBySearch(this.filterForm.value.active);
|
||||||
this.loadActive = false;
|
this.loadActive = false;
|
||||||
|
@ -153,7 +159,7 @@ export class RoleUsersComponent implements OnInit, OnDestroy, OnChanges {
|
||||||
}
|
}
|
||||||
this.loadActive = false;
|
this.loadActive = false;
|
||||||
}));
|
}));
|
||||||
this.subs.push(this.userRegistryService.getPending(this.type, this.id, this.role, true).subscribe(users => {
|
this.subs.push(this.userRegistryService.getPending(this._type, this.id, this.role, true).subscribe(users => {
|
||||||
this.pending = users;
|
this.pending = users;
|
||||||
this.filterPendingBySearch(this.filterForm.value.pending);
|
this.filterPendingBySearch(this.filterForm.value.pending);
|
||||||
this.loadPending = false;
|
this.loadPending = false;
|
||||||
|
@ -182,7 +188,7 @@ export class RoleUsersComponent implements OnInit, OnDestroy, OnChanges {
|
||||||
openDeleteModal(item: any) {
|
openDeleteModal(item: any) {
|
||||||
if (this.showCurrent) {
|
if (this.showCurrent) {
|
||||||
this.selectedUser = item.email;
|
this.selectedUser = item.email;
|
||||||
this.deleteModal.alertTitle = 'Delete ' + this.role;
|
this.deleteModal.alertTitle = 'Delete ' + this.stakeholderUtils.roles[this.role];
|
||||||
this.deleteModal.open();
|
this.deleteModal.open();
|
||||||
} else {
|
} else {
|
||||||
this.selectedUser = item;
|
this.selectedUser = item;
|
||||||
|
@ -192,7 +198,7 @@ export class RoleUsersComponent implements OnInit, OnDestroy, OnChanges {
|
||||||
}
|
}
|
||||||
|
|
||||||
openInviteModal() {
|
openInviteModal() {
|
||||||
this.inviteModal.alertTitle = 'Invite ' + this.role;
|
this.inviteModal.alertTitle = 'Invite ' + this.stakeholderUtils.roles[this.role];
|
||||||
this.inviteModal.okButtonLeft = false;
|
this.inviteModal.okButtonLeft = false;
|
||||||
this.inviteModal.okButtonText = 'Send';
|
this.inviteModal.okButtonText = 'Send';
|
||||||
this.emailsForm = this.fb.array([], Validators.required);
|
this.emailsForm = this.fb.array([], Validators.required);
|
||||||
|
@ -205,8 +211,8 @@ export class RoleUsersComponent implements OnInit, OnDestroy, OnChanges {
|
||||||
this.createRoleModal.okButtonLeft = false;
|
this.createRoleModal.okButtonLeft = false;
|
||||||
this.createRoleModal.okButtonText = 'Create';
|
this.createRoleModal.okButtonText = 'Create';
|
||||||
this.roleFb = this.fb.group({
|
this.roleFb = this.fb.group({
|
||||||
name: this.fb.control(Role.roleName(this.type, this.id), Validators.required),
|
name: this.fb.control(Role.roleName(this._type, this.id), Validators.required),
|
||||||
description: this.fb.control(Role.roleName(this.type, this.id), Validators.required)
|
description: this.fb.control(Role.roleName(this._type, this.id), Validators.required)
|
||||||
});
|
});
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.roleFb.get('name').disable();
|
this.roleFb.get('name').disable();
|
||||||
|
@ -217,7 +223,7 @@ export class RoleUsersComponent implements OnInit, OnDestroy, OnChanges {
|
||||||
|
|
||||||
deleteActive() {
|
deleteActive() {
|
||||||
this.loadActive = true;
|
this.loadActive = true;
|
||||||
this.subs.push(this.userRegistryService.remove(this.type, this.id, this.selectedUser, this.role).subscribe(() => {
|
this.subs.push(this.userRegistryService.remove(this._type, this.id, this.selectedUser, this.role).subscribe(() => {
|
||||||
this.active = this.active.filter(user => user.email != this.selectedUser);
|
this.active = this.active.filter(user => user.email != this.selectedUser);
|
||||||
if (this.currentActivePage.length === 0) {
|
if (this.currentActivePage.length === 0) {
|
||||||
this.activePage = 1;
|
this.activePage = 1;
|
||||||
|
@ -235,13 +241,13 @@ export class RoleUsersComponent implements OnInit, OnDestroy, OnChanges {
|
||||||
|
|
||||||
deletePending() {
|
deletePending() {
|
||||||
this.loadPending = true;
|
this.loadPending = true;
|
||||||
this.subs.push(this.userRegistryService.cancelInvitation(this.type, this.id, this.selectedUser, this.role).subscribe(() => {
|
this.subs.push(this.userRegistryService.cancelInvitation(this._type, this.id, this.selectedUser, this.role).subscribe(() => {
|
||||||
this.pending = this.pending.filter(user => user != this.selectedUser);
|
this.pending = this.pending.filter(user => user != this.selectedUser);
|
||||||
this.filterPendingBySearch(this.filterForm.value.pending);
|
this.filterPendingBySearch(this.filterForm.value.pending);
|
||||||
if (this.currentPendingPage.length === 0) {
|
if (this.currentPendingPage.length === 0) {
|
||||||
this.pendingPage = 1;
|
this.pendingPage = 1;
|
||||||
}
|
}
|
||||||
NotificationHandler.rise(StringUtils.capitalize(this.role) + ' invitation to ' + this.selectedUser + ' has been <b>canceled</b>');
|
NotificationHandler.rise(StringUtils.capitalize(this.stakeholderUtils.roles[this.role]) + ' invitation to ' + this.selectedUser + ' has been <b>canceled</b>');
|
||||||
this.loadPending = false;
|
this.loadPending = false;
|
||||||
}, error => {
|
}, error => {
|
||||||
NotificationHandler.rise('An error has occurred. Please try again later', 'danger');
|
NotificationHandler.rise('An error has occurred. Please try again later', 'danger');
|
||||||
|
@ -262,12 +268,12 @@ export class RoleUsersComponent implements OnInit, OnDestroy, OnChanges {
|
||||||
let current = null;
|
let current = null;
|
||||||
let invitations = (<Array<any>>this.emailsForm.value).map(email => {
|
let invitations = (<Array<any>>this.emailsForm.value).map(email => {
|
||||||
current = email;
|
current = email;
|
||||||
return this.userRegistryService.invite(this.type, this.id, {
|
return this.userRegistryService.invite(this._type, this.id, {
|
||||||
link: this.link,
|
link: this.link,
|
||||||
email: this.emailComposer(this.name, email, this.role)
|
email: this.emailComposer(this.name, email, this.role)
|
||||||
}, this.role).pipe(map(invitation => new InvitationResponse(email, invitation), catchError(error => {
|
}, this.role).pipe(catchError(error => {
|
||||||
return of(new InvitationResponse(current, null));
|
return of(null);
|
||||||
})));
|
}), map(invitation => new InvitationResponse(email, invitation)));
|
||||||
});
|
});
|
||||||
this.subs.push(forkJoin(invitations).subscribe(responses => {
|
this.subs.push(forkJoin(invitations).subscribe(responses => {
|
||||||
let notifications = responses.map(response => {
|
let notifications = responses.map(response => {
|
||||||
|
@ -289,7 +295,8 @@ export class RoleUsersComponent implements OnInit, OnDestroy, OnChanges {
|
||||||
return of(null);
|
return of(null);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
NotificationHandler.rise('An error has occurred while sending the invitation mail to ' + response.email + '.Please try again later', 'danger');
|
NotificationHandler.rise('An error has occurred while sending the invitation mail to ' +
|
||||||
|
response.email + '.Check if the user is already a ' + this.stakeholderUtils.roles[this.role] + ' or try again later', 'danger');
|
||||||
return of(null);
|
return of(null);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -304,12 +311,12 @@ export class RoleUsersComponent implements OnInit, OnDestroy, OnChanges {
|
||||||
createGroup() {
|
createGroup() {
|
||||||
this.loadActive = true;
|
this.loadActive = true;
|
||||||
this.loadPending = true;
|
this.loadPending = true;
|
||||||
this.userRegistryService.createRole(this.type, this.id).subscribe(() => {
|
this.userRegistryService.createRole(this._type, this.id).subscribe(() => {
|
||||||
NotificationHandler.rise('Group has been <b> successfully created</b>');
|
NotificationHandler.rise('Group has been <b> successfully created</b>');
|
||||||
this.updateLists();
|
this.updateLists();
|
||||||
}, error => {
|
}, error => {
|
||||||
if(error.status === 409) {
|
if(error.status === 409) {
|
||||||
NotificationHandler.rise('Group already exists. You can try to invite a ' + this.role + ' instead.', 'warning');
|
NotificationHandler.rise('Group already exists. You can try to invite a ' + this.stakeholderUtils.roles[this.role] + ' instead.', 'warning');
|
||||||
this.updateLists();
|
this.updateLists();
|
||||||
} else {
|
} else {
|
||||||
NotificationHandler.rise('An error has occurred. Please try again later', 'danger');
|
NotificationHandler.rise('An error has occurred. Please try again later', 'danger');
|
||||||
|
@ -323,16 +330,20 @@ export class RoleUsersComponent implements OnInit, OnDestroy, OnChanges {
|
||||||
return (this.deleteAuthorizationLevel === 'curator'?this.isCurator:this.isManager);
|
return (this.deleteAuthorizationLevel === 'curator'?this.isCurator:this.isManager);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public get canInvite() {
|
||||||
|
return this.exists && (this.inviteAuthorizationLevel === 'curator'?this.isCurator:this.isManager);
|
||||||
|
}
|
||||||
|
|
||||||
public isMe(userId: string) {
|
public isMe(userId: string) {
|
||||||
return userId && userId.includes(this.user.id) && !this.isCurator;
|
return userId && userId.includes(this.user.id) && !this.isCurator;
|
||||||
}
|
}
|
||||||
|
|
||||||
public get isManager(): boolean {
|
public get isManager(): boolean {
|
||||||
return this.isCurator || !!Session.isManager(this.type, this.id, this.user);
|
return this.isCurator || !!Session.isManager(this._type, this.id, this.user);
|
||||||
}
|
}
|
||||||
|
|
||||||
public get isCurator(): boolean {
|
public get isCurator(): boolean {
|
||||||
return this.isPortalAdmin || !!Session.isCurator(this.type, this.user);
|
return this.isPortalAdmin || !!Session.isCurator(this._type, this.user);
|
||||||
}
|
}
|
||||||
|
|
||||||
public get isPortalAdmin(): boolean {
|
public get isPortalAdmin(): boolean {
|
||||||
|
|
|
@ -141,8 +141,8 @@ export class SubscribersComponent implements OnInit, OnDestroy, OnChanges {
|
||||||
this.createRoleModal.okButtonLeft = false;
|
this.createRoleModal.okButtonLeft = false;
|
||||||
this.createRoleModal.okButtonText = 'create';
|
this.createRoleModal.okButtonText = 'create';
|
||||||
this.roleFb = this.fb.group({
|
this.roleFb = this.fb.group({
|
||||||
name: this.fb.control(Role.mapType(this.type) + '.' + this.id, Validators.required),
|
name: this.fb.control(Role.roleName(this.type, this.id), Validators.required),
|
||||||
description: this.fb.control(Role.mapType(this.type) + ' ' + this.id, Validators.required)
|
description: this.fb.control(Role.roleName(this.type, this.id), Validators.required)
|
||||||
});
|
});
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.roleFb.get('name').disable();
|
this.roleFb.get('name').disable();
|
||||||
|
|
|
@ -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 {PiwikServiceModule} from '../utils/piwik/piwikService.module';
|
|
||||||
import {HelperModule} from '../utils/helper/helper.module';
|
import {HelperModule} from '../utils/helper/helper.module';
|
||||||
import {Schema2jsonldModule} from '../sharedComponents/schema2jsonld/schema2jsonld.module';
|
import {Schema2jsonldModule} from '../sharedComponents/schema2jsonld/schema2jsonld.module';
|
||||||
import { SEOServiceModule } from '../sharedComponents/SEO/SEOService.module';
|
import { SEOServiceModule } from '../sharedComponents/SEO/SEOService.module';
|
||||||
|
@ -18,7 +17,6 @@ import {FullScreenModalModule} from '../utils/modal/full-screen-modal/full-scree
|
||||||
imports: [
|
imports: [
|
||||||
CommonModule, FormsModule,
|
CommonModule, FormsModule,
|
||||||
RouterModule,
|
RouterModule,
|
||||||
PiwikServiceModule,
|
|
||||||
HelperModule,
|
HelperModule,
|
||||||
Schema2jsonldModule, SEOServiceModule, BreadcrumbsModule, SearchInputModule,
|
Schema2jsonldModule, SEOServiceModule, BreadcrumbsModule, SearchInputModule,
|
||||||
FullScreenModalModule
|
FullScreenModalModule
|
||||||
|
|
|
@ -9,7 +9,6 @@ import {SearchResultsModule } from '../searchPages/searchUtils/searchResults.mod
|
||||||
|
|
||||||
import {DataProvidersServiceModule} from '../services/dataProvidersService.module';
|
import {DataProvidersServiceModule} from '../services/dataProvidersService.module';
|
||||||
import {SearchFormModule} from '../searchPages/searchUtils/searchForm.module';
|
import {SearchFormModule} from '../searchPages/searchUtils/searchForm.module';
|
||||||
import {IsRouteEnabled} from '../error/isRouteEnabled.guard';
|
|
||||||
import {SearchDataProvidersModule} from "../searchPages/searchDataProviders.module";
|
import {SearchDataProvidersModule} from "../searchPages/searchDataProviders.module";
|
||||||
import {BreadcrumbsModule} from "../utils/breadcrumbs/breadcrumbs.module";
|
import {BreadcrumbsModule} from "../utils/breadcrumbs/breadcrumbs.module";
|
||||||
import {SearchInputModule} from "../sharedComponents/search-input/search-input.module";
|
import {SearchInputModule} from "../sharedComponents/search-input/search-input.module";
|
||||||
|
@ -25,7 +24,7 @@ import {SearchInputModule} from "../sharedComponents/search-input/search-input.m
|
||||||
declarations: [
|
declarations: [
|
||||||
SearchDataprovidersToDepositComponent
|
SearchDataprovidersToDepositComponent
|
||||||
],
|
],
|
||||||
providers:[ IsRouteEnabled],
|
providers:[],
|
||||||
exports: [
|
exports: [
|
||||||
SearchDataprovidersToDepositComponent
|
SearchDataprovidersToDepositComponent
|
||||||
]
|
]
|
||||||
|
|
|
@ -6,7 +6,9 @@ import {ConfigurationService} from '../utils/configuration/configuration.service
|
||||||
import {ConnectHelper} from '../connect/connectHelper';
|
import {ConnectHelper} from '../connect/connectHelper';
|
||||||
import {properties} from "../../../environments/environment";
|
import {properties} from "../../../environments/environment";
|
||||||
|
|
||||||
@Injectable()
|
@Injectable({
|
||||||
|
providedIn: 'root'
|
||||||
|
})
|
||||||
export class IsRouteEnabled {
|
export class IsRouteEnabled {
|
||||||
|
|
||||||
constructor(private router: Router,
|
constructor(private router: Router,
|
||||||
|
|
|
@ -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>
|
||||||
|
|
|
@ -2,13 +2,11 @@ import {CommonModule} from "@angular/common";
|
||||||
import {NgModule} from "@angular/core";
|
import {NgModule} from "@angular/core";
|
||||||
import {FormsModule} from "@angular/forms";
|
import {FormsModule} from "@angular/forms";
|
||||||
import {RouterModule} from "@angular/router";
|
import {RouterModule} from "@angular/router";
|
||||||
import {PreviousRouteRecorder} from "../utils/piwik/previousRouteRecorder.guard";
|
|
||||||
import {IconsModule} from "../utils/icons/icons.module";
|
import {IconsModule} from "../utils/icons/icons.module";
|
||||||
import {BreadcrumbsModule} from "../utils/breadcrumbs/breadcrumbs.module";
|
import {BreadcrumbsModule} from "../utils/breadcrumbs/breadcrumbs.module";
|
||||||
import {Schema2jsonldModule} from "../sharedComponents/schema2jsonld/schema2jsonld.module";
|
import {Schema2jsonldModule} from "../sharedComponents/schema2jsonld/schema2jsonld.module";
|
||||||
import {SearchInputModule} from "../sharedComponents/search-input/search-input.module";
|
import {SearchInputModule} from "../sharedComponents/search-input/search-input.module";
|
||||||
import {SEOServiceModule} from "../sharedComponents/SEO/SEOService.module";
|
import {SEOServiceModule} from "../sharedComponents/SEO/SEOService.module";
|
||||||
import {PiwikService} from "../utils/piwik/piwik.service";
|
|
||||||
|
|
||||||
import {FosRoutingModule} from './fos-routing.module';
|
import {FosRoutingModule} from './fos-routing.module';
|
||||||
import {FosComponent} from './fos.component';
|
import {FosComponent} from './fos.component';
|
||||||
|
@ -22,9 +20,7 @@ import {FosComponent} from './fos.component';
|
||||||
declarations: [
|
declarations: [
|
||||||
FosComponent
|
FosComponent
|
||||||
],
|
],
|
||||||
providers: [
|
providers: [],
|
||||||
PreviousRouteRecorder, PiwikService
|
|
||||||
],
|
|
||||||
exports: [
|
exports: [
|
||||||
FosComponent
|
FosComponent
|
||||||
]
|
]
|
||||||
|
|
|
@ -0,0 +1,12 @@
|
||||||
|
import { NgModule } from '@angular/core';
|
||||||
|
import { RouterModule } from '@angular/router';
|
||||||
|
import { PreviousRouteRecorder } from "../../utils/piwik/previousRouteRecorder.guard";
|
||||||
|
import { DataProviderComponent } from "./dataProvider.component";
|
||||||
|
|
||||||
|
|
||||||
|
@NgModule({
|
||||||
|
imports: [
|
||||||
|
RouterModule.forChild([{ path: '', component: DataProviderComponent, canDeactivate: [PreviousRouteRecorder] }])
|
||||||
|
]
|
||||||
|
})
|
||||||
|
export class DataProviderRoutingModule { }
|
|
@ -36,10 +36,12 @@ import {ResultLandingUtilsModule} from "../landing-utils/resultLandingUtils.modu
|
||||||
import {FullScreenModalModule} from '../../utils/modal/full-screen-modal/full-screen-modal.module';
|
import {FullScreenModalModule} from '../../utils/modal/full-screen-modal/full-screen-modal.module';
|
||||||
import {SafeHtmlPipeModule} from '../../utils/pipes/safeHTMLPipe.module';
|
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 {DataProviderRoutingModule} from "./dataProvider-routing.module";
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports:
|
imports:
|
||||||
[CommonModule, FormsModule, RouterModule,
|
[CommonModule, FormsModule, RouterModule,
|
||||||
|
DataProviderRoutingModule,
|
||||||
IFrameModule, ErrorMessagesModule, LandingModule,
|
IFrameModule, ErrorMessagesModule, LandingModule,
|
||||||
DataProvidersServiceModule, ProjectsServiceModule, SearchResearchResultsServiceModule,
|
DataProvidersServiceModule, ProjectsServiceModule, SearchResearchResultsServiceModule,
|
||||||
PagingModule, Schema2jsonldModule, SEOServiceModule, ShowPublisherModule, HelperModule,
|
PagingModule, Schema2jsonldModule, SEOServiceModule, ShowPublisherModule, HelperModule,
|
||||||
|
|
|
@ -22,7 +22,7 @@ import {RouterHelper} from "../../utils/routerHelper.class";
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
|
||||||
<ng-container *ngIf="!inModal">
|
<ng-container *ngIf="!inModal">
|
||||||
<div *ngIf="properties.environment != 'production' && availableOn[0].fulltext" class="uk-flex uk-flex-middle"
|
<div *ngIf="availableOn[0].fulltext" class="uk-flex uk-flex-middle"
|
||||||
[ngClass]="isMobile ? 'uk-width-1-1' : 'uk-text-bolder'">
|
[ngClass]="isMobile ? 'uk-width-1-1' : 'uk-text-bolder'">
|
||||||
<a [href]="availableOn[0].fulltext" target="_blank"
|
<a [href]="availableOn[0].fulltext" target="_blank"
|
||||||
class="uk-flex uk-flex-middle uk-button-link"
|
class="uk-flex uk-flex-middle uk-button-link"
|
||||||
|
@ -40,7 +40,7 @@ import {RouterHelper} from "../../utils/routerHelper.class";
|
||||||
<icon [name]="availableOn[0].accessRightIcon" [flex]="true" [ratio]="(isMobile && usedBy == 'landing') ? 1 : 0.8"></icon>
|
<icon [name]="availableOn[0].accessRightIcon" [flex]="true" [ratio]="(isMobile && usedBy == 'landing') ? 1 : 0.8"></icon>
|
||||||
</span>
|
</span>
|
||||||
<ng-container *ngIf="!isMobile">
|
<ng-container *ngIf="!isMobile">
|
||||||
<a uk-tooltip="Source" target="_blank"
|
<a target="_blank"
|
||||||
class="uk-flex uk-flex-middle uk-flex-center uk-button-link uk-text-bolder">
|
class="uk-flex uk-flex-middle uk-flex-center uk-button-link uk-text-bolder">
|
||||||
<span>{{sliceString(availableOn[0].downloadNames.join("; "), 20)}}</span>
|
<span>{{sliceString(availableOn[0].downloadNames.join("; "), 20)}}</span>
|
||||||
<span>
|
<span>
|
||||||
|
@ -108,7 +108,7 @@ import {RouterHelper} from "../../utils/routerHelper.class";
|
||||||
</a>
|
</a>
|
||||||
<ng-template #elseBlock> {{instance.license}}</ng-template>
|
<ng-template #elseBlock> {{instance.license}}</ng-template>
|
||||||
</div>
|
</div>
|
||||||
<div *ngIf="properties.environment != 'production' && instance.fulltext" class="uk-text-meta uk-text-truncate" uk-tooltip [title]="instance.fulltext">
|
<div *ngIf="instance.fulltext" class="uk-text-meta uk-text-truncate" uk-tooltip [title]="instance.fulltext">
|
||||||
Full-Text:
|
Full-Text:
|
||||||
<a *ngIf="isUrl(instance.fulltext); else elseBlock"
|
<a *ngIf="isUrl(instance.fulltext); else elseBlock"
|
||||||
[href]="instance.fulltext" target="_blank" class="custom-external uk-link-text">
|
[href]="instance.fulltext" target="_blank" class="custom-external uk-link-text">
|
||||||
|
|
|
@ -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>
|
||||||
|
@ -118,8 +118,9 @@ import {RouterHelper} from "../../utils/routerHelper.class";
|
||||||
<showPublisher *ngIf="publisher || journal" [publisher]="publisher" [journal]="journal"
|
<showPublisher *ngIf="publisher || journal" [publisher]="publisher" [journal]="journal"
|
||||||
[properties]="properties"></showPublisher>
|
[properties]="properties"></showPublisher>
|
||||||
<!-- data provider labels -->
|
<!-- data provider labels -->
|
||||||
<ng-container *ngIf="compatibility && !(compatibility.info == 'not available' && type == 'service')">
|
<span *ngIf="compatibility && !(compatibility.info == 'not available' && type == 'service')">
|
||||||
<span uk-tooltip title="Compatibility">
|
<span class="uk-text-meta uk-margin-xsmall-right">Compatibility:</span>
|
||||||
|
<span>
|
||||||
<a *ngIf="compatibility.id"
|
<a *ngIf="compatibility.id"
|
||||||
[queryParams]="addEoscPrevInParams({datasourceId: compatibility.id})" routerLinkActive="router-link-active"
|
[queryParams]="addEoscPrevInParams({datasourceId: compatibility.id})" routerLinkActive="router-link-active"
|
||||||
[routerLink]="properties.searchLinkToDataProvider.split('?')[0]">
|
[routerLink]="properties.searchLinkToDataProvider.split('?')[0]">
|
||||||
|
@ -137,10 +138,11 @@ import {RouterHelper} from "../../utils/routerHelper.class";
|
||||||
{{compatibility.name}}
|
{{compatibility.name}}
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
</ng-container>
|
</span>
|
||||||
<ng-container *ngIf="compatibilityString">
|
<span *ngIf="compatibilityString">
|
||||||
<span uk-tooltip title="Compatibility">{{compatibilityString}}</span>
|
<span class="uk-text-meta uk-margin-xsmall-right">Compatibility:</span>
|
||||||
</ng-container>
|
<span>{{compatibilityString}}</span>
|
||||||
|
</span>
|
||||||
<ng-container
|
<ng-container
|
||||||
*ngIf="aggregationStatus && aggregationStatus.fulltexts && aggregationStatus.fulltexts > 0">
|
*ngIf="aggregationStatus && aggregationStatus.fulltexts && aggregationStatus.fulltexts > 0">
|
||||||
<span>OpenAIRE Text Mining</span>
|
<span>OpenAIRE Text Mining</span>
|
||||||
|
@ -152,9 +154,9 @@ import {RouterHelper} from "../../utils/routerHelper.class";
|
||||||
<span>Publicly funded</span>
|
<span>Publicly funded</span>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
<!-- Projects -->
|
<!-- Projects -->
|
||||||
<span *ngIf="projects && projects.length > 0"
|
<span *ngIf="projects && projects.length > 0">
|
||||||
[attr.uk-tooltip]="projects.length > projectsLimit ? 'cls: uk-invisible' : 'pos: top; cls: uk-active'" title="Funded by">
|
<span class="uk-text-meta uk-margin-xsmall-right">Funded by:</span>
|
||||||
{{showInline ? projectNames.join(', ') : projectNames.slice(0, projectsLimit).join(', ')}}
|
<span>{{showInline ? projectNames.join(', ') : projectNames.slice(0, projectsLimit).join(', ')}}</span>
|
||||||
<span *ngIf="projects.length > projectsLimit">
|
<span *ngIf="projects.length > projectsLimit">
|
||||||
<a *ngIf="!showInline" (click)="viewAllProjectsClick();" class="uk-background-muted custom-extra-entities">
|
<a *ngIf="!showInline" (click)="viewAllProjectsClick();" class="uk-background-muted custom-extra-entities">
|
||||||
+{{projects.length - projectsLimit | number}} projects
|
+{{projects.length - projectsLimit | number}} projects
|
||||||
|
@ -166,9 +168,9 @@ import {RouterHelper} from "../../utils/routerHelper.class";
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
<!-- Organizations -->
|
<!-- Organizations -->
|
||||||
<span *ngIf="organizations && organizations.length > 0"
|
<span *ngIf="organizations && organizations.length > 0">
|
||||||
[attr.uk-tooltip]="organizations.length > organizationsLimit ? 'cls: uk-invisible' : 'pos: top; cls: uk-active'" title="Partners">
|
<span class="uk-text-meta uk-margin-xsmall-right">Partners:</span>
|
||||||
{{showInline ? organizationNames.join(', ') : organizationNames.slice(0, organizationsLimit).join(', ')}}
|
<span>{{showInline ? organizationNames.join(', ') : organizationNames.slice(0, organizationsLimit).join(', ')}}</span>
|
||||||
<span *ngIf="organizations.length > organizationsLimit">
|
<span *ngIf="organizations.length > organizationsLimit">
|
||||||
<a *ngIf="!showInline" (click)="viewAllPartnersClick();" class="uk-background-muted custom-extra-entities">
|
<a *ngIf="!showInline" (click)="viewAllPartnersClick();" class="uk-background-muted custom-extra-entities">
|
||||||
+{{organizations.length - organizationsLimit | number}} partners
|
+{{organizations.length - organizationsLimit | number}} partners
|
||||||
|
@ -180,9 +182,10 @@ import {RouterHelper} from "../../utils/routerHelper.class";
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
<!-- Subjects -->
|
<!-- Subjects -->
|
||||||
<span uk-tooltip="Subjects" *ngIf="subjects && subjects.length > 0" [class.truncated]="subjects.length > 3">
|
<span *ngIf="subjects && subjects.length > 0" [class.truncated]="subjects.length > 3">
|
||||||
{{subjects.slice(0, 3).join(', ')}}
|
{{subjects.slice(0, 3).join(', ')}}
|
||||||
</span>
|
</span>
|
||||||
|
<!-- For tabs in landing -->
|
||||||
<ng-container *ngIf="provenanceAction">
|
<ng-container *ngIf="provenanceAction">
|
||||||
<span>{{provenanceAction}}</span>
|
<span>{{provenanceAction}}</span>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
@ -292,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) {
|
||||||
|
@ -361,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;
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -20,14 +20,16 @@ import {RouterHelper} from "../../utils/routerHelper.class";
|
||||||
</div>
|
</div>
|
||||||
<div *ngIf="!isMobile">
|
<div *ngIf="!isMobile">
|
||||||
<span *ngFor="let item of fundedByProjects.slice(0, viewAll?fundedByProjects.length:threshold) let i=index">
|
<span *ngFor="let item of fundedByProjects.slice(0, viewAll?fundedByProjects.length:threshold) let i=index">
|
||||||
<span class="uk-text-emphasis">
|
<span class="uk-text-emphasis" (click)="dropClicked=true">
|
||||||
<a class="uk-link uk-link-text">
|
<a class="uk-link uk-link-text">
|
||||||
<ng-container *ngTemplateOutlet="funder; context: {item: item}"></ng-container>
|
<ng-container *ngTemplateOutlet="funder; context: {item: item}"></ng-container>
|
||||||
</a>
|
</a>
|
||||||
</span>
|
</span>
|
||||||
<div class="default-dropdown uk-margin-remove-top uk-dropdown"
|
<div class="default-dropdown uk-margin-remove-top uk-dropdown"
|
||||||
uk-dropdown="pos: bottom-left; mode:click">
|
uk-dropdown="pos: bottom-left; mode:click">
|
||||||
<ng-container *ngTemplateOutlet="dropInfo; context: { item: item}"></ng-container>
|
<ng-container *ngIf="dropClicked">
|
||||||
|
<ng-container *ngTemplateOutlet="dropInfo; context: { item: item, index: i}"></ng-container>
|
||||||
|
</ng-container>
|
||||||
</div>
|
</div>
|
||||||
<span *ngIf="i < (fundedByProjects.slice(0, viewAll?fundedByProjects.length:threshold).length - 1)">, </span>
|
<span *ngIf="i < (fundedByProjects.slice(0, viewAll?fundedByProjects.length:threshold).length - 1)">, </span>
|
||||||
</span>
|
</span>
|
||||||
|
@ -35,13 +37,13 @@ import {RouterHelper} from "../../utils/routerHelper.class";
|
||||||
<div *ngIf="isMobile">
|
<div *ngIf="isMobile">
|
||||||
<div *ngFor="let item of fundedByProjects.slice(0, viewAll?fundedByProjects.length:threshold) let i=index"
|
<div *ngFor="let item of fundedByProjects.slice(0, viewAll?fundedByProjects.length:threshold) let i=index"
|
||||||
class="uk-flex uk-flex-middle uk-margin-small-bottom">
|
class="uk-flex uk-flex-middle uk-margin-small-bottom">
|
||||||
<span class="uk-text-emphasis uk-width-expand">
|
<span class="uk-text-emphasis uk-width-expand" (click)="dropClicked=true">
|
||||||
<ng-container *ngTemplateOutlet="funder; context: {item: item}"></ng-container>
|
<ng-container *ngTemplateOutlet="funder; context: {item: item}"></ng-container>
|
||||||
</span>
|
</span>
|
||||||
<a #toggle><icon name="info" visuallyHidden="info" [type]="'outlined'"></icon></a>
|
<a #toggle><icon name="info" visuallyHidden="info" [type]="'outlined'"></icon></a>
|
||||||
<mobile-dropdown [toggle]="toggle">
|
<mobile-dropdown [toggle]="toggle">
|
||||||
<div class="uk-margin-remove-top">
|
<div *ngIf="dropClicked" class="uk-margin-remove-top">
|
||||||
<ng-container *ngTemplateOutlet="dropInfo; context: { item: item}"></ng-container>
|
<ng-container *ngTemplateOutlet="dropInfo; context: { item: item, index: i}"></ng-container>
|
||||||
</div>
|
</div>
|
||||||
</mobile-dropdown>
|
</mobile-dropdown>
|
||||||
</div>
|
</div>
|
||||||
|
@ -54,7 +56,7 @@ import {RouterHelper} from "../../utils/routerHelper.class";
|
||||||
<span *ngIf="item['acronym'] || item['title']">| {{ item['acronym'] ? item['acronym'] : item['title']}}</span>
|
<span *ngIf="item['acronym'] || item['title']">| {{ item['acronym'] ? item['acronym'] : item['title']}}</span>
|
||||||
</ng-template>
|
</ng-template>
|
||||||
|
|
||||||
<ng-template #dropInfo let-item=item>
|
<ng-template #dropInfo let-item=item let-index=index>
|
||||||
<div class="uk-padding-small">
|
<div class="uk-padding-small">
|
||||||
<span>Project</span>
|
<span>Project</span>
|
||||||
<div class="uk-margin-bottom">
|
<div class="uk-margin-bottom">
|
||||||
|
@ -84,7 +86,7 @@ import {RouterHelper} from "../../utils/routerHelper.class";
|
||||||
<span class="uk-text-meta">Funding stream: </span>{{item.funding}}
|
<span class="uk-text-meta">Funding stream: </span>{{item.funding}}
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<div *ngIf="getVocabularyLabel(item, provenanceActionVocabulary, i) || item.validated" class="uk-text-meta">
|
<div *ngIf="item.provenanceAction || item.validated" class="uk-text-meta">
|
||||||
<span *ngIf="item.validated">Validated by funder</span>
|
<span *ngIf="item.validated">Validated by funder</span>
|
||||||
<span *ngIf="item.provenanceAction && item.validated"> | </span>
|
<span *ngIf="item.provenanceAction && item.validated"> | </span>
|
||||||
<span *ngIf="item.provenanceAction">{{item.provenanceAction}}</span>
|
<span *ngIf="item.provenanceAction">{{item.provenanceAction}}</span>
|
||||||
|
@ -105,8 +107,15 @@ export class FundedByComponent {
|
||||||
public url = properties.searchLinkToProject.split('?')[0];
|
public url = properties.searchLinkToProject.split('?')[0];
|
||||||
public title: string = "Funded by";
|
public title: string = "Funded by";
|
||||||
@Input() provenanceActionVocabulary = null;
|
@Input() provenanceActionVocabulary = null;
|
||||||
public provenancesCalculated: boolean[] = [];
|
// public provenancesCalculated: boolean[] = [];
|
||||||
public routerHelper:RouterHelper = new RouterHelper();
|
public routerHelper:RouterHelper = new RouterHelper();
|
||||||
|
public dropClicked: boolean = false;
|
||||||
|
|
||||||
|
public ngOnInit() {
|
||||||
|
this.fundedByProjects.forEach((project, index) => {
|
||||||
|
this.getVocabularyLabel(project, this.provenanceActionVocabulary, index);
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
public viewAllClick() {
|
public viewAllClick() {
|
||||||
if(this.fundedByProjects.length <= this.threshold*2) {
|
if(this.fundedByProjects.length <= this.threshold*2) {
|
||||||
|
@ -124,11 +133,11 @@ export class FundedByComponent {
|
||||||
}
|
}
|
||||||
|
|
||||||
public getVocabularyLabel(item: any, vocabulary: any, index: number) {
|
public getVocabularyLabel(item: any, vocabulary: any, index: number) {
|
||||||
if(!this.provenancesCalculated[index]) {
|
// if(!this.provenancesCalculated[index]) {
|
||||||
this.provenancesCalculated[index] = true;
|
// this.provenancesCalculated[index] = true;
|
||||||
item.provenanceAction = HelperFunctions.getVocabularyLabel(item.provenanceAction, vocabulary, false);
|
item.provenanceAction = HelperFunctions.getVocabularyLabel(item.provenanceAction, vocabulary, false);
|
||||||
}
|
// }
|
||||||
return item.provenanceAction;
|
// return item.provenanceAction;
|
||||||
}
|
}
|
||||||
|
|
||||||
public addEoscPrevInParams(obj) {
|
public addEoscPrevInParams(obj) {
|
||||||
|
|
|
@ -5,24 +5,19 @@ 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';
|
||||||
import {PiwikServiceModule} from '../../utils/piwik/piwikService.module';
|
|
||||||
import {PreviousRouteRecorder} from'../../utils/piwik/previousRouteRecorder.guard';
|
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [
|
imports: [
|
||||||
CommonModule, FormsModule, RouterModule, PiwikServiceModule
|
CommonModule, FormsModule, RouterModule
|
||||||
],
|
],
|
||||||
declarations: [
|
declarations: [
|
||||||
TabPagingComponent, ShowTitleComponent, AddThisComponent
|
ShowTitleComponent, AddThisComponent
|
||||||
],
|
|
||||||
providers:[
|
|
||||||
PreviousRouteRecorder
|
|
||||||
],
|
],
|
||||||
|
providers:[],
|
||||||
exports: [
|
exports: [
|
||||||
TabPagingComponent, ShowTitleComponent, AddThisComponent
|
ShowTitleComponent, AddThisComponent
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
export class LandingModule { }
|
export class LandingModule { }
|
||||||
|
|
|
@ -538,7 +538,8 @@ export class ParsingFunctions {
|
||||||
|
|
||||||
if (pid.hasOwnProperty("classid") && pid['classid'] != "") {
|
if (pid.hasOwnProperty("classid") && pid['classid'] != "") {
|
||||||
if (pid.classid == "doi" || pid.classid == "pmc" || pid.classid == "handle" || pid.classid == "pmid" || pid.classid == "re3data"
|
if (pid.classid == "doi" || pid.classid == "pmc" || pid.classid == "handle" || pid.classid == "pmid" || pid.classid == "re3data"
|
||||||
|| pid.classid == "swhid") {
|
|| pid.classid == "swhid"
|
||||||
|
|| pid.classid == "ROR" || pid.classid == "ISNI" || pid.classid == "Wikidata" || pid.classid == "FundRef") {
|
||||||
if (!identifiers.has(pid.classid)) {
|
if (!identifiers.has(pid.classid)) {
|
||||||
identifiers.set(pid.classid, new Array<string>());
|
identifiers.set(pid.classid, new Array<string>());
|
||||||
}
|
}
|
||||||
|
@ -547,7 +548,8 @@ export class ParsingFunctions {
|
||||||
} else {
|
} else {
|
||||||
for (let i = 0; i < pid.length; i++) {
|
for (let i = 0; i < pid.length; i++) {
|
||||||
if (pid[i].classid == "doi" || pid[i].classid == "pmc" || pid[i].classid == "handle" || pid[i].classid == "pmid" || pid[i].classid == "re3data"
|
if (pid[i].classid == "doi" || pid[i].classid == "pmc" || pid[i].classid == "handle" || pid[i].classid == "pmid" || pid[i].classid == "re3data"
|
||||||
|| pid[i].classid == "swhid") {
|
|| pid[i].classid == "swhid"
|
||||||
|
|| pid[i].classid == "ROR" || pid[i].classid == "ISNI" || pid[i].classid == "Wikidata" || pid[i].classid == "FundRef") {
|
||||||
if (!identifiers.has(pid[i].classid)) {
|
if (!identifiers.has(pid[i].classid)) {
|
||||||
identifiers.set(pid[i].classid, new Array<string>());
|
identifiers.set(pid[i].classid, new Array<string>());
|
||||||
}
|
}
|
||||||
|
@ -637,7 +639,11 @@ export class ParsingFunctions {
|
||||||
if (!classifiedSubjects.has(subject.classname)) {
|
if (!classifiedSubjects.has(subject.classname)) {
|
||||||
classifiedSubjects.set(subject.classname, new Array<string>());
|
classifiedSubjects.set(subject.classname, new Array<string>());
|
||||||
}
|
}
|
||||||
|
if(properties.environment == "production") {
|
||||||
classifiedSubjects.get(subject.classname).push(content);
|
classifiedSubjects.get(subject.classname).push(content);
|
||||||
|
} else {
|
||||||
|
classifiedSubjects.get(subject.classname).push(subject.classid + ": " + content);
|
||||||
|
}
|
||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -657,6 +663,14 @@ export class ParsingFunctions {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(properties.environment != "production" && classifiedSubjects != null) {
|
||||||
|
for (let classified of classifiedSubjects.keys()) {
|
||||||
|
subjects = subjects.concat(classifiedSubjects.get(classified));
|
||||||
|
}
|
||||||
|
classifiedSubjects = null;
|
||||||
|
}
|
||||||
|
|
||||||
return [subjects, otherSubjects, classifiedSubjects, fos, sdg];
|
return [subjects, otherSubjects, classifiedSubjects, fos, sdg];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -15,6 +15,7 @@ import {StringUtils} from "../../../utils/string-utils.class";
|
||||||
template: `
|
template: `
|
||||||
<modal-alert #selectionModal [large]="true" (alertOutput)="modalOutput()" (cancelOutput)="modalCancel()"
|
<modal-alert #selectionModal [large]="true" (alertOutput)="modalOutput()" (cancelOutput)="modalCancel()"
|
||||||
[okDisabled]="!sent && !selectionStep1 && (form.invalid || sending)">
|
[okDisabled]="!sent && !selectionStep1 && (form.invalid || sending)">
|
||||||
|
<ng-container *ngIf="isOpen">
|
||||||
<sdg-selection *ngIf="subjects && subjectType == 'sdg'" #selection [class.uk-hidden]="!selectionStep1"
|
<sdg-selection *ngIf="subjects && subjectType == 'sdg'" #selection [class.uk-hidden]="!selectionStep1"
|
||||||
[subjects]="subjects" [entityType]="entityType"></sdg-selection>
|
[subjects]="subjects" [entityType]="entityType"></sdg-selection>
|
||||||
<fos-selection *ngIf="subjects && subjectType == 'fos'" #selection [class.uk-hidden]="!selectionStep1"
|
<fos-selection *ngIf="subjects && subjectType == 'fos'" #selection [class.uk-hidden]="!selectionStep1"
|
||||||
|
@ -43,6 +44,7 @@ import {StringUtils} from "../../../utils/string-utils.class";
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</ng-container>
|
||||||
</modal-alert>
|
</modal-alert>
|
||||||
`
|
`
|
||||||
})
|
})
|
||||||
|
@ -62,6 +64,7 @@ export class SdgFosSuggestComponent {
|
||||||
public sent: boolean = false;
|
public sent: boolean = false;
|
||||||
public error: boolean = false;
|
public error: boolean = false;
|
||||||
subscriptions: Subscription[] = [];
|
subscriptions: Subscription[] = [];
|
||||||
|
isOpen: boolean = false;
|
||||||
|
|
||||||
constructor(private emailService: EmailService, private fb: FormBuilder, private cdr: ChangeDetectorRef) {}
|
constructor(private emailService: EmailService, private fb: FormBuilder, private cdr: ChangeDetectorRef) {}
|
||||||
|
|
||||||
|
|
|
@ -26,8 +26,9 @@ import {properties} from "../../../../environments/environment";
|
||||||
<span class="uk-text-meta uk-text-small" [class.uk-text-uppercase]="key != 're3data'">{{key}}: </span>
|
<span class="uk-text-meta uk-text-small" [class.uk-text-uppercase]="key != 're3data'">{{key}}: </span>
|
||||||
<span [class.uk-margin-small-left]="modal">
|
<span [class.uk-margin-small-left]="modal">
|
||||||
<ng-container *ngFor="let item of identifiers.get(key) let j=index">
|
<ng-container *ngFor="let item of identifiers.get(key) let j=index">
|
||||||
<a *ngIf="key == 'doi' || key == 'pmc' || key == 'pmid' || key == 'handle' || key == 're3data' || key == 'swhid'"
|
<a *ngIf="key == 'doi' || key == 'pmc' || key == 'pmid' || key == 'handle' || key == 're3data' || key == 'swhid'
|
||||||
[href]="getUrl(key) + item" target="_blank" class="uk-display-inline-block custom-external">
|
|| key == 'ROR' || key == 'ISNI' || key == 'Wikidata' || key == 'FundRef'"
|
||||||
|
[href]="getUrl(key, item) + item" target="_blank" class="uk-display-inline-block custom-external">
|
||||||
{{item}}
|
{{item}}
|
||||||
</a>
|
</a>
|
||||||
<ng-container *ngIf="(j !== (identifiers.get(key).length - 1))">, </ng-container>
|
<ng-container *ngIf="(j !== (identifiers.get(key).length - 1))">, </ng-container>
|
||||||
|
@ -113,7 +114,10 @@ export class ShowIdentifiersComponent implements AfterViewInit {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public getUrl(key: string): string {
|
public getUrl(key: string, value: string): string {
|
||||||
|
if(value.includes("http://") || value.includes("https://")) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
if(key == "doi") {
|
if(key == "doi") {
|
||||||
return properties.doiURL;
|
return properties.doiURL;
|
||||||
} else if(key == "pmc") {
|
} else if(key == "pmc") {
|
||||||
|
@ -126,6 +130,14 @@ export class ShowIdentifiersComponent implements AfterViewInit {
|
||||||
return properties.r3DataURL;
|
return properties.r3DataURL;
|
||||||
} else if(key == "swhid") {
|
} else if(key == "swhid") {
|
||||||
return properties.swhURL;
|
return properties.swhURL;
|
||||||
|
} else if(key == "ROR") {
|
||||||
|
return properties.rorURL;
|
||||||
|
} else if(key == "ISNI") {
|
||||||
|
return properties.isniURL;
|
||||||
|
} else if(key == "Wikidata") {
|
||||||
|
return properties.wikiDataURL;
|
||||||
|
} else if(key == "FundRef") {
|
||||||
|
return properties.fundRefURL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,8 @@ import {EnvProperties} from "../../utils/properties/env-properties";
|
||||||
selector: 'showPublisher, [showPublisher]',
|
selector: 'showPublisher, [showPublisher]',
|
||||||
template: `
|
template: `
|
||||||
<ng-container *ngIf="publisher">
|
<ng-container *ngIf="publisher">
|
||||||
<span [attr.uk-tooltip]="'cls: uk-active'" [title]="'Publisher'">{{publisher}}</span>
|
<span class="uk-text-meta uk-margin-xsmall-right">Publisher:</span>
|
||||||
|
<span>{{publisher}}</span>
|
||||||
<span *ngIf="journal && (journal['journal'] || journal['issn'] || journal['lissn']
|
<span *ngIf="journal && (journal['journal'] || journal['issn'] || journal['lissn']
|
||||||
|| journal['volume'] || journal['eissn'] || journal['issue'])"
|
|| journal['volume'] || journal['eissn'] || journal['issue'])"
|
||||||
class="uk-margin-xsmall-left uk-margin-xsmall-right bullet"></span>
|
class="uk-margin-xsmall-left uk-margin-xsmall-right bullet"></span>
|
||||||
|
@ -14,7 +15,8 @@ import {EnvProperties} from "../../utils/properties/env-properties";
|
||||||
|| journal['volume'] || journal['eissn'] || journal['issue'])">
|
|| journal['volume'] || journal['eissn'] || journal['issue'])">
|
||||||
<ng-container *ngIf="journal && (journal['journal'] || journal['issn'] || journal['lissn']
|
<ng-container *ngIf="journal && (journal['journal'] || journal['issn'] || journal['lissn']
|
||||||
|| journal['volume'] || journal['eissn'] || journal['issue'])">
|
|| journal['volume'] || journal['eissn'] || journal['issue'])">
|
||||||
<span [attr.uk-tooltip]="'cls: uk-active'" [title]="'Journal'">
|
<span>
|
||||||
|
<span class="uk-text-meta uk-margin-xsmall-right">Journal:</span>
|
||||||
<span *ngIf="journal['journal']">{{journal['journal']}}</span>
|
<span *ngIf="journal['journal']">{{journal['journal']}}</span>
|
||||||
<span *ngIf="journal['journal'] && (journal['volume'] || journal['issue'])">, </span>
|
<span *ngIf="journal['journal'] && (journal['volume'] || journal['issue'])">, </span>
|
||||||
<ng-container *ngIf="journal['volume']">
|
<ng-container *ngIf="journal['volume']">
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -0,0 +1,12 @@
|
||||||
|
import { NgModule } from '@angular/core';
|
||||||
|
import { RouterModule } from '@angular/router';
|
||||||
|
import { PreviousRouteRecorder } from "../../utils/piwik/previousRouteRecorder.guard";
|
||||||
|
import { OrganizationComponent } from "./organization.component";
|
||||||
|
|
||||||
|
|
||||||
|
@NgModule({
|
||||||
|
imports: [
|
||||||
|
RouterModule.forChild([{ path: '', component: OrganizationComponent, canDeactivate: [PreviousRouteRecorder] }])
|
||||||
|
]
|
||||||
|
})
|
||||||
|
export class OrganizationRoutingModule { }
|
|
@ -19,35 +19,6 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div *ngIf="!showFeedback" class="uk-grid uk-margin-remove-left" uk-grid>
|
<div *ngIf="!showFeedback" class="uk-grid uk-margin-remove-left" uk-grid>
|
||||||
<!-- left column -->
|
|
||||||
<!-- <div id="landing-left-sidebar" *ngIf="organizationInfo" class="uk-visible@s uk-padding-remove-horizontal">
|
|
||||||
<div class="uk-flex uk-flex-column uk-flex-right uk-sticky"
|
|
||||||
uk-sticky="end: true" [attr.offset]="offset">
|
|
||||||
<div class="uk-margin-large-bottom uk-align-center">
|
|
||||||
<div class="uk-text-meta uk-text-uppercase">Actions</div>
|
|
||||||
<ul class="uk-list">
|
|
||||||
<li class="uk-text-center">
|
|
||||||
<a (click)="openAddThisModal()" [title]="'Share this '+openaireEntities.ORGANIZATION+' in your social networks'"
|
|
||||||
[attr.uk-tooltip]="'pos: right; cls: uk-active uk-text-small uk-padding-small'">
|
|
||||||
<span class="uk-icon-button uk-icon landing-action-button landing-action-button-portal">
|
|
||||||
<icon name="share" visuallyHidden="share"></icon>
|
|
||||||
</span>
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
<li class="uk-text-center"
|
|
||||||
[title]="'Download reports'"
|
|
||||||
[attr.uk-tooltip]="'pos: right; cls: uk-active uk-text-small uk-padding-small'">
|
|
||||||
<a class="uk-link-text uk-text-bold uk-text-uppercase" (click)="buildFunderOptions(); openDownloadReportsModal()">
|
|
||||||
<span class="uk-icon-button uk-icon landing-action-button landing-action-button-portal">
|
|
||||||
<icon name="download" visuallyHidden="download"></icon>
|
|
||||||
</span>
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div> -->
|
|
||||||
|
|
||||||
<!-- center/right column -->
|
<!-- center/right column -->
|
||||||
<div id="landing-center-content" class="uk-width-expand uk-padding-remove uk-background-default">
|
<div id="landing-center-content" class="uk-width-expand uk-padding-remove uk-background-default">
|
||||||
|
|
||||||
|
@ -123,35 +94,10 @@
|
||||||
<!-- Main content -->
|
<!-- Main content -->
|
||||||
<div [attr.style]="'margin-top: '+(graph_height? 'calc(40px + 20px - '+graph_height+'px)': '40px')">
|
<div [attr.style]="'margin-top: '+(graph_height? 'calc(40px + 20px - '+graph_height+'px)': '40px')">
|
||||||
|
|
||||||
<!-- Actions for mobile viewport -->
|
|
||||||
<div class="uk-flex uk-flex-right uk-margin-medium-bottom uk-hidden@s">
|
|
||||||
<div class="uk-margin-small-right">
|
|
||||||
<a (click)="openAddThisModal()" [title]="'Share this '+openaireEntities.ORGANIZATION+' in your social networks'"
|
|
||||||
[attr.uk-tooltip]="'pos: right; cls: uk-active uk-text-small uk-padding-small'">
|
|
||||||
<span class="uk-icon-button uk-icon landing-action-button landing-action-button-portal">
|
|
||||||
<icon name="share" visuallyHidden="share"></icon>
|
|
||||||
</span>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
<div [title]="'Download reports'"
|
|
||||||
[attr.uk-tooltip]="'pos: right; cls: uk-active uk-text-small uk-padding-small'">
|
|
||||||
<a class="uk-link-text uk-text-bold uk-text-uppercase" (click)="buildFunderOptions(); openDownloadReportsModal()">
|
|
||||||
<span class="uk-icon-button uk-icon landing-action-button landing-action-button-portal">
|
|
||||||
<icon name="download" visuallyHidden="download"></icon>
|
|
||||||
</span>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<!-- Helper -->
|
<!-- Helper -->
|
||||||
<helper *ngIf="pageContents && pageContents['top'] && pageContents['top'].length > 0"
|
<helper *ngIf="pageContents && pageContents['top'] && pageContents['top'].length > 0"
|
||||||
[texts]="pageContents['top']"></helper>
|
[texts]="pageContents['top']"></helper>
|
||||||
<!-- Versions -->
|
|
||||||
<!-- <span *ngIf="organizationInfo.deletedByInferenceIds" class="uk-text-primary uk-flex uk-flex-middle">
|
|
||||||
<icon flex="true" ratio="0.8" name="auto_awesome_motion"></icon>
|
|
||||||
<a (click)="openDeletedByInference()" class="uk-text-primary uk-text-small uk-margin-small-left">
|
|
||||||
View all {{organizationInfo.deletedByInferenceIds.length}} versions
|
|
||||||
</a>
|
|
||||||
</span> -->
|
|
||||||
<!-- Landing header -->
|
<!-- Landing header -->
|
||||||
<landing-header [properties]="properties" [title]="organizationInfo.title.name"
|
<landing-header [properties]="properties" [title]="organizationInfo.title.name"
|
||||||
[subTitle]="(organizationInfo.name
|
[subTitle]="(organizationInfo.name
|
||||||
|
@ -171,6 +117,10 @@
|
||||||
<div *ngIf="organizationInfo.country && !organizationInfo.country.toLowerCase().includes('unknown')">
|
<div *ngIf="organizationInfo.country && !organizationInfo.country.toLowerCase().includes('unknown')">
|
||||||
<span class="uk-text-meta">Country: </span>{{organizationInfo.country}}
|
<span class="uk-text-meta">Country: </span>{{organizationInfo.country}}
|
||||||
</div>
|
</div>
|
||||||
|
<!-- Identifiers -->
|
||||||
|
<div *ngIf="organizationInfo.identifiers && organizationInfo.identifiers.size > 0" class="uk-margin-small-top">
|
||||||
|
<showIdentifiers [identifiers]="organizationInfo.identifiers" [showViewAll]="true"></showIdentifiers>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- Tabs section -->
|
<!-- Tabs section -->
|
||||||
|
@ -257,9 +207,7 @@
|
||||||
</search-tab>
|
</search-tab>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="uk-text-xsmall uk-hidden@m">
|
|
||||||
<ng-container *ngTemplateOutlet="graph_and_feedback_template"></ng-container>
|
|
||||||
</div>
|
|
||||||
<!-- Helper -->
|
<!-- Helper -->
|
||||||
<helper *ngIf="pageContents && pageContents['bottom'] && pageContents['bottom'].length > 0"
|
<helper *ngIf="pageContents && pageContents['bottom'] && pageContents['bottom'].length > 0"
|
||||||
[texts]="pageContents['bottom']">
|
[texts]="pageContents['bottom']">
|
||||||
|
@ -270,13 +218,13 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
<!-- Feedback -->
|
<!-- Feedback -->
|
||||||
<feedback *ngIf="organizationInfo && properties.reCaptchaSiteKey" [organizationInfo]="organizationInfo"
|
<feedback *ngIf="showFeedback && organizationInfo && properties.reCaptchaSiteKey" [organizationInfo]="organizationInfo"
|
||||||
[properties]="properties" [entityType]="'organization'" [fields]="feedbackFields"
|
[properties]="properties" [entityType]="'organization'" [fields]="feedbackFields"
|
||||||
[(showForm)]="showFeedback">
|
[(showForm)]="showFeedback">
|
||||||
</feedback>
|
</feedback>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<!-- Mobile view -->
|
<!-- Mobile view -->
|
||||||
<div *ngIf="isMobile" class="uk-hidden@m uk-position-relative landing">
|
<div *ngIf="isMobile" class="uk-hidden@m uk-position-relative landing">
|
||||||
|
@ -287,6 +235,23 @@
|
||||||
&& organizationInfo.title.name !== organizationInfo.name)?organizationInfo.name:null"
|
&& organizationInfo.title.name !== organizationInfo.name)?organizationInfo.name:null"
|
||||||
[entityType]="'organization'" [prevPath]="prevPath">
|
[entityType]="'organization'" [prevPath]="prevPath">
|
||||||
</landing-header>
|
</landing-header>
|
||||||
|
<div class="uk-text-small">
|
||||||
|
<!-- Web Page -->
|
||||||
|
<div *ngIf="organizationInfo.title && organizationInfo.title.url" class="uk-margin-small-bottom uk-display-inline-block">
|
||||||
|
<span class="uk-text-meta">Web page: </span>
|
||||||
|
<a [href]="organizationInfo.title.url" target="_blank" class="uk-button uk-button-text uk-text-lowercase uk-text-normal custom-external">
|
||||||
|
{{organizationInfo.title.url}}
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
<!-- Country -->
|
||||||
|
<div *ngIf="organizationInfo.country && !organizationInfo.country.toLowerCase().includes('unknown')">
|
||||||
|
<span class="uk-text-meta">Country: </span>{{organizationInfo.country}}
|
||||||
|
</div>
|
||||||
|
<!-- Identifiers -->
|
||||||
|
<div *ngIf="organizationInfo.identifiers && organizationInfo.identifiers.size > 0" class="uk-margin-small-top">
|
||||||
|
<showIdentifiers [identifiers]="organizationInfo.identifiers" [showViewAll]="true" [isMobile]="true"></showIdentifiers>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div class="uk-section uk-margin-top uk-text-large uk-text-empashis uk-text-bold">
|
<div class="uk-section uk-margin-top uk-text-large uk-text-empashis uk-text-bold">
|
||||||
<hr>
|
<hr>
|
||||||
<ng-container>
|
<ng-container>
|
||||||
|
@ -406,10 +371,7 @@
|
||||||
[type]="'organizations'" [prevPath]="prevPath">
|
[type]="'organizations'" [prevPath]="prevPath">
|
||||||
</organizationsDeletedByInference>
|
</organizationsDeletedByInference>
|
||||||
</modal-alert>
|
</modal-alert>
|
||||||
<!-- Share -->
|
|
||||||
<modal-alert *ngIf="organizationInfo" #addThisModal classBody="uk-flex uk-flex-center uk-flex-middle">
|
|
||||||
<addThis></addThis>
|
|
||||||
</modal-alert>
|
|
||||||
<!-- Download -->
|
<!-- Download -->
|
||||||
<modal-alert *ngIf="organizationInfo" #downloadReportsModal large="true">
|
<modal-alert *ngIf="organizationInfo" #downloadReportsModal large="true">
|
||||||
<div class="uk-padding-small uk-margin-small-left uk-margin-small-right">
|
<div class="uk-padding-small uk-margin-small-left uk-margin-small-right">
|
||||||
|
|
|
@ -77,7 +77,6 @@ export class OrganizationComponent {
|
||||||
@ViewChild('downloadReportsFsModal') downloadReportsFsModal: FullScreenModalComponent;
|
@ViewChild('downloadReportsFsModal') downloadReportsFsModal: FullScreenModalComponent;
|
||||||
// @ViewChild('downloadReportModal') downloadReportModal;
|
// @ViewChild('downloadReportModal') downloadReportModal;
|
||||||
// @ViewChild('downloadFunderReportModal') downloadFunderReportModal;
|
// @ViewChild('downloadFunderReportModal') downloadFunderReportModal;
|
||||||
@ViewChild('addThisModal') addThisModal;
|
|
||||||
@ViewChild('addThisFsModal') addThisFsModal: FullScreenModalComponent;
|
@ViewChild('addThisFsModal') addThisFsModal: FullScreenModalComponent;
|
||||||
|
|
||||||
@ViewChild(ModalLoading) loading: ModalLoading;
|
@ViewChild(ModalLoading) loading: ModalLoading;
|
||||||
|
@ -717,13 +716,6 @@ export class OrganizationComponent {
|
||||||
this.downloadReportsModal.cancel();
|
this.downloadReportsModal.cancel();
|
||||||
}
|
}
|
||||||
|
|
||||||
public openAddThisModal() {
|
|
||||||
this.addThisModal.cancelButton = false;
|
|
||||||
this.addThisModal.okButton = false;
|
|
||||||
this.addThisModal.alertTitle = "Share this "+OpenaireEntities.ORGANIZATION+" in your social networks";
|
|
||||||
this.addThisModal.open();
|
|
||||||
}
|
|
||||||
|
|
||||||
public getParamsForSearchLink(type: string = "") {
|
public getParamsForSearchLink(type: string = "") {
|
||||||
if(type) {
|
if(type) {
|
||||||
return this.routerHelper.createQueryParams(['f0', 'fv0', 'type', 'qf', 'sortBy'], ['relorganizationid', this.organizationId, type, 'false', 'resultdateofacceptance,descending']);
|
return this.routerHelper.createQueryParams(['f0', 'fv0', 'type', 'qf', 'sortBy'], ['relorganizationid', this.organizationId, type, 'false', 'resultdateofacceptance,descending']);
|
||||||
|
|
|
@ -33,11 +33,14 @@ import {graph, versions} from "../../utils/icons/icons";
|
||||||
import {FullScreenModalModule} from "../../utils/modal/full-screen-modal/full-screen-modal.module";
|
import {FullScreenModalModule} from "../../utils/modal/full-screen-modal/full-screen-modal.module";
|
||||||
import {EGIDataTransferModule} from "../../utils/dataTransfer/transferData.module";
|
import {EGIDataTransferModule} from "../../utils/dataTransfer/transferData.module";
|
||||||
import {EntityActionsModule} from "../../utils/entity-actions/entity-actions.module";
|
import {EntityActionsModule} from "../../utils/entity-actions/entity-actions.module";
|
||||||
|
import {OrganizationRoutingModule} from "./organization-routing.module";
|
||||||
|
import {ResultLandingUtilsModule} from "../landing-utils/resultLandingUtils.module";
|
||||||
|
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [
|
imports: [
|
||||||
CommonModule, FormsModule, RouterModule,
|
CommonModule, FormsModule, RouterModule,
|
||||||
|
OrganizationRoutingModule,
|
||||||
LoadingModalModule, AlertModalModule, ErrorMessagesModule,
|
LoadingModalModule, AlertModalModule, ErrorMessagesModule,
|
||||||
LandingModule,
|
LandingModule,
|
||||||
DataProvidersServiceModule,
|
DataProvidersServiceModule,
|
||||||
|
@ -49,7 +52,7 @@ import {EntityActionsModule} from "../../utils/entity-actions/entity-actions.mod
|
||||||
ProjectsServiceModule,
|
ProjectsServiceModule,
|
||||||
Schema2jsonldModule, SEOServiceModule, HelperModule,
|
Schema2jsonldModule, SEOServiceModule, HelperModule,
|
||||||
OrganizationsDeletedByInferenceModule, LandingHeaderModule, FeedbackModule,
|
OrganizationsDeletedByInferenceModule, LandingHeaderModule, FeedbackModule,
|
||||||
TabsModule, SearchTabModule, LoadingModule, IconsModule, InputModule, FullScreenModalModule, EGIDataTransferModule, EntityActionsModule
|
TabsModule, SearchTabModule, LoadingModule, IconsModule, InputModule, FullScreenModalModule, EntityActionsModule, ResultLandingUtilsModule
|
||||||
],
|
],
|
||||||
declarations: [
|
declarations: [
|
||||||
OrganizationComponent,
|
OrganizationComponent,
|
||||||
|
|
|
@ -0,0 +1,12 @@
|
||||||
|
import { NgModule } from '@angular/core';
|
||||||
|
import { RouterModule } from '@angular/router';
|
||||||
|
import { PreviousRouteRecorder } from "../../utils/piwik/previousRouteRecorder.guard";
|
||||||
|
import { ProjectComponent } from "./project.component";
|
||||||
|
|
||||||
|
|
||||||
|
@NgModule({
|
||||||
|
imports: [
|
||||||
|
RouterModule.forChild([{ path: '', component: ProjectComponent, canDeactivate: [PreviousRouteRecorder] }])
|
||||||
|
]
|
||||||
|
})
|
||||||
|
export class ProjectRoutingModule { }
|
|
@ -32,9 +32,11 @@ import {FullScreenModalModule} from '../../utils/modal/full-screen-modal/full-sc
|
||||||
import {SafeHtmlPipeModule} from '../../utils/pipes/safeHTMLPipe.module';
|
import {SafeHtmlPipeModule} from '../../utils/pipes/safeHTMLPipe.module';
|
||||||
import {EGIDataTransferModule} from "../../utils/dataTransfer/transferData.module";
|
import {EGIDataTransferModule} from "../../utils/dataTransfer/transferData.module";
|
||||||
import {EntityActionsModule} from "../../utils/entity-actions/entity-actions.module";
|
import {EntityActionsModule} from "../../utils/entity-actions/entity-actions.module";
|
||||||
|
import {ProjectRoutingModule} from "./project-routing.module";
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [
|
imports: [
|
||||||
|
ProjectRoutingModule,
|
||||||
CommonModule, FormsModule, RouterModule, LandingModule,
|
CommonModule, FormsModule, RouterModule, LandingModule,
|
||||||
LoadingModalModule, AlertModalModule, ErrorMessagesModule,
|
LoadingModalModule, AlertModalModule, ErrorMessagesModule,
|
||||||
IFrameModule, ReportsServiceModule,
|
IFrameModule, ReportsServiceModule,
|
||||||
|
|
|
@ -27,8 +27,8 @@ import {HelperFunctions} from "../../../utils/HelperFunctions.class";
|
||||||
<ul class="uk-list uk-margin">
|
<ul class="uk-list uk-margin">
|
||||||
<li *ngFor="let result of results.slice((page-1)*pageSize, page*pageSize)">
|
<li *ngFor="let result of results.slice((page-1)*pageSize, page*pageSize)">
|
||||||
<result-preview [modal]="modal" [properties]="properties" [hasLink]="false" [result]="getResultPreview(result)"
|
<result-preview [modal]="modal" [properties]="properties" [hasLink]="false" [result]="getResultPreview(result)"
|
||||||
[showOrcid]="false" [isCard]="false" [prevPath]="prevPath" [showInline]="true"
|
[showOrcid]="false" [prevPath]="prevPath" [showInline]="true"
|
||||||
[isDeletedByInferenceModal]="true"></result-preview>
|
[isDeletedByInferenceModal]="true" [isMobile]="isMobile"></result-preview>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<no-load-paging *ngIf="results.length > pageSize" [type]="type"
|
<no-load-paging *ngIf="results.length > pageSize" [type]="type"
|
||||||
|
@ -40,6 +40,7 @@ import {HelperFunctions} from "../../../utils/HelperFunctions.class";
|
||||||
`
|
`
|
||||||
})
|
})
|
||||||
export class DeletedByInferenceComponent {
|
export class DeletedByInferenceComponent {
|
||||||
|
@Input() isMobile: boolean = false;
|
||||||
@Input() prevPath: string = "";
|
@Input() prevPath: string = "";
|
||||||
public results: ResultLandingInfo[] = [];
|
public results: ResultLandingInfo[] = [];
|
||||||
@Input() id: string;
|
@Input() id: string;
|
||||||
|
|
|
@ -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) {
|
||||||
|
|
|
@ -0,0 +1,12 @@
|
||||||
|
import { NgModule } from '@angular/core';
|
||||||
|
import { RouterModule } from '@angular/router';
|
||||||
|
import { PreviousRouteRecorder } from "../../utils/piwik/previousRouteRecorder.guard";
|
||||||
|
import { ResultLandingComponent } from "./resultLanding.component";
|
||||||
|
|
||||||
|
|
||||||
|
@NgModule({
|
||||||
|
imports: [
|
||||||
|
RouterModule.forChild([{ path: '', component: ResultLandingComponent, canDeactivate: [PreviousRouteRecorder] }])
|
||||||
|
]
|
||||||
|
})
|
||||||
|
export class ResultLandingRoutingModule { }
|
|
@ -4,8 +4,8 @@
|
||||||
[searchActionRoute]="properties.searchLinkToResults"></schema2jsonld>
|
[searchActionRoute]="properties.searchLinkToResults"></schema2jsonld>
|
||||||
|
|
||||||
<!-- Desktop view -->
|
<!-- Desktop view -->
|
||||||
<div id="tm-main" class="uk-visible@m landing uk-section uk-padding-remove tm-middle">
|
<div *ngIf="!isMobile" id="tm-main" class="landing uk-section uk-padding-remove tm-middle">
|
||||||
<div *ngIf="!isMobile" class="tm-main">
|
<div class="tm-main">
|
||||||
<div class="publication">
|
<div class="publication">
|
||||||
<div *ngIf="properties.adminToolsPortalType == 'eosc'" class="eosc-explore-back-search-bar">
|
<div *ngIf="properties.adminToolsPortalType == 'eosc'" class="eosc-explore-back-search-bar">
|
||||||
<div class="uk-light uk-container uk-container-large uk-margin-left uk-height-1-1">
|
<div class="uk-light uk-container uk-container-large uk-margin-left uk-height-1-1">
|
||||||
|
@ -18,70 +18,6 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div *ngIf="!showFeedback" class="uk-grid uk-margin-remove-left" uk-grid>
|
<div *ngIf="!showFeedback" class="uk-grid uk-margin-remove-left" uk-grid>
|
||||||
|
|
||||||
<!-- left box/sidebar - actions -->
|
|
||||||
<!-- <div id="landing-left-sidebar" *ngIf="resultLandingInfo" class="uk-visible@s uk-padding-remove-horizontal">
|
|
||||||
<div class="uk-flex uk-flex-column uk-flex-between uk-flex-center uk-sticky"
|
|
||||||
uk-sticky="end: true" [attr.offset]="offset">
|
|
||||||
<div class="uk-align-center uk-text-center uk-margin-medium-top uk-flex uk-flex-column uk-flex-between">
|
|
||||||
<ng-container *ngIf="resultLandingInfo && (hasAltMetrics || hasMetrics)">
|
|
||||||
<metrics *ngIf="hasMetrics" class="uk-margin-bottom"
|
|
||||||
[pageViews]="pageViews"
|
|
||||||
[id]="id" [entityType]="'results'" [entity]="title"
|
|
||||||
[viewsFrameUrl]="viewsFrameUrl" [downloadsFrameUrl]="downloadsFrameUrl"
|
|
||||||
(metricsResults)="metricsResults($event)" [properties]=properties
|
|
||||||
[prevPath]="prevPath">
|
|
||||||
</metrics>
|
|
||||||
<altmetrics *ngIf="hasAltMetrics" id="{{resultLandingInfo.identifiers?.get('doi')[0]}}" type="doi"></altmetrics>
|
|
||||||
</ng-container>
|
|
||||||
</div>
|
|
||||||
<div class="uk-margin-large-bottom uk-align-center">
|
|
||||||
<div class="uk-text-meta uk-text-uppercase">Actions</div>
|
|
||||||
<ul class="uk-list">
|
|
||||||
<li class="uk-text-center">
|
|
||||||
<a (click)="openAddThisModal()"
|
|
||||||
[title]="'Share this '+getTypeName() + ' in your social networks'"
|
|
||||||
[attr.uk-tooltip]="'pos: right; cls: uk-active uk-text-small uk-padding-small'">
|
|
||||||
<span class="uk-icon-button uk-icon landing-action-button landing-action-button-portal">
|
|
||||||
<icon name="share" visuallyHidden="share"></icon>
|
|
||||||
</span>
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
<li *ngIf="isRouteAvailable('participate/direct-claim')" class="uk-text-center"
|
|
||||||
[title]="'<span class=\'uk-flex uk-flex-middle\'>Link this '+getTypeName()+' to ...<span class=\'material-icons uk-margin-small-left\'>east</span></span>'"
|
|
||||||
[attr.uk-tooltip]="'pos: right; cls: uk-active uk-text-small uk-padding-small'">
|
|
||||||
<a [queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[id,type,'project'])"
|
|
||||||
routerLinkActive="router-link-active" routerLink="/participate/direct-claim">
|
|
||||||
<span class="uk-icon-button uk-icon landing-action-button landing-action-button-portal">
|
|
||||||
<icon name="link" visuallyHidden="link"></icon>
|
|
||||||
</span>
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
<li class="uk-text-center">
|
|
||||||
<a (click)="openCiteModal()"
|
|
||||||
[title]="'Cite this '+getTypeName()"
|
|
||||||
[attr.uk-tooltip]="'pos: right; cls: uk-active uk-text-small uk-padding-small'">
|
|
||||||
<span class="uk-icon-button uk-icon landing-action-button landing-action-button-portal">
|
|
||||||
<icon name="quotes" visuallyHidden="cite"></icon>
|
|
||||||
</span>
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
<li *ngIf="properties.adminToolsPortalType == 'explore' || properties.adminToolsPortalType == 'community' || properties.adminToolsPortalType == 'aggregator'"
|
|
||||||
class="uk-text-center">
|
|
||||||
<orcid-work [resultId]="id" [resultTitle]="resultLandingInfo.title" [resultLandingInfo]="resultLandingInfo"
|
|
||||||
[pids]="pidsArrayString" [pageType]="'landing'">
|
|
||||||
</orcid-work>
|
|
||||||
</li>
|
|
||||||
<li *ngIf=" properties.enableEoscDataTransfer && resultLandingInfo.resultType == 'dataset' &&
|
|
||||||
resultLandingInfo.identifiers && resultLandingInfo.identifiers.get('doi')"
|
|
||||||
class="uk-text-center">
|
|
||||||
<egi-transfer-data [dois]="resultLandingInfo.identifiers.get('doi')" [isOpen]="egiTransferModalOpen"></egi-transfer-data>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div> -->
|
|
||||||
|
|
||||||
<!-- center box-->
|
<!-- center box-->
|
||||||
<div id="landing-center-content" class="uk-width-expand uk-padding-remove uk-background-default">
|
<div id="landing-center-content" class="uk-width-expand uk-padding-remove uk-background-default">
|
||||||
|
|
||||||
|
@ -143,7 +79,8 @@
|
||||||
[type]="resultLandingInfo.resultType"
|
[type]="resultLandingInfo.resultType"
|
||||||
[result]="resultLandingInfo" [id]="resultLandingInfo.objIdentifier">
|
[result]="resultLandingInfo" [id]="resultLandingInfo.objIdentifier">
|
||||||
<!-- ORCID -->
|
<!-- ORCID -->
|
||||||
<div *ngIf="properties.adminToolsPortalType == 'explore' || properties.adminToolsPortalType == 'community' || properties.adminToolsPortalType == 'aggregator'"
|
<div *ngIf="properties.adminToolsPortalType == 'explore' || properties.adminToolsPortalType == 'community'
|
||||||
|
|| properties.adminToolsPortalType == 'aggregator' || properties.dashboard == 'irish'"
|
||||||
class="uk-margin-small-right">
|
class="uk-margin-small-right">
|
||||||
<orcid-work [resultId]="id" [resultTitle]="resultLandingInfo.title" [resultLandingInfo]="resultLandingInfo"
|
<orcid-work [resultId]="id" [resultTitle]="resultLandingInfo.title" [resultLandingInfo]="resultLandingInfo"
|
||||||
[pids]="pidsArrayString" [pageType]="'landing'">
|
[pids]="pidsArrayString" [pageType]="'landing'">
|
||||||
|
@ -166,54 +103,6 @@
|
||||||
<!-- in small screens there is no sticky #graph_and_feedback so margin-top is medium (40px) -->
|
<!-- in small screens there is no sticky #graph_and_feedback so margin-top is medium (40px) -->
|
||||||
<!-- else margin is medium (40px) - the actual height of uk-sticky-placeholder (graph_height - 20px -> margins of #graph_and_feedback) -->
|
<!-- else margin is medium (40px) - the actual height of uk-sticky-placeholder (graph_height - 20px -> margins of #graph_and_feedback) -->
|
||||||
<div [attr.style]="'margin-top: '+(graph_height? 'calc(40px + 20px - '+graph_height+'px)': '40px')">
|
<div [attr.style]="'margin-top: '+(graph_height? 'calc(40px + 20px - '+graph_height+'px)': '40px')">
|
||||||
|
|
||||||
<!-- Actions for mobile viewport -->
|
|
||||||
<div class="uk-flex uk-flex-right uk-margin-medium-bottom uk-hidden@s">
|
|
||||||
<!-- Share -->
|
|
||||||
<div class="uk-margin-small-right">
|
|
||||||
<a (click)="openAddThisModal()"
|
|
||||||
[title]="'Share this '+getTypeName() + ' in your social networks'"
|
|
||||||
[attr.uk-tooltip]="'pos: right; cls: uk-active uk-text-small uk-padding-small'">
|
|
||||||
<span class="uk-icon-button uk-icon landing-action-button landing-action-button-portal">
|
|
||||||
<icon name="share" visuallyHidden="share"></icon>
|
|
||||||
</span>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
<!-- Link to -->
|
|
||||||
<div *ngIf="isRouteAvailable('participate/direct-claim')" class="uk-margin-small-right"
|
|
||||||
[title]="'<span class=\'uk-flex uk-flex-middle\'>Link this '+getTypeName()+' to ...<span class=\'material-icons uk-margin-small-left\'>east</span></span>'"
|
|
||||||
[attr.uk-tooltip]="'pos: right; cls: uk-active uk-text-small uk-padding-small'">
|
|
||||||
<a [queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[id,type,'project'])"
|
|
||||||
routerLinkActive="router-link-active" routerLink="/participate/direct-claim">
|
|
||||||
<span class="uk-icon-button uk-icon landing-action-button landing-action-button-portal">
|
|
||||||
<icon name="link" visuallyHidden="link"></icon>
|
|
||||||
</span>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
<!-- Cite this -->
|
|
||||||
<div class="uk-margin-small-right">
|
|
||||||
<a (click)="openCiteModal()"
|
|
||||||
[title]="'Cite this '+getTypeName()"
|
|
||||||
[attr.uk-tooltip]="'pos: right; cls: uk-active uk-text-small uk-padding-small'">
|
|
||||||
<span class="uk-icon-button uk-icon landing-action-button landing-action-button-portal">
|
|
||||||
<icon name="quotes" visuallyHidden="cite"></icon>
|
|
||||||
</span>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
<!-- ORCID -->
|
|
||||||
<div *ngIf="properties.adminToolsPortalType == 'explore' || properties.adminToolsPortalType == 'community' || properties.adminToolsPortalType == 'aggregator'"
|
|
||||||
class="uk-margin-small-right">
|
|
||||||
<orcid-work [resultId]="id" [resultTitle]="resultLandingInfo.title" [resultLandingInfo]="resultLandingInfo"
|
|
||||||
[pids]="pidsArrayString" [pageType]="'landing'">
|
|
||||||
</orcid-work>
|
|
||||||
</div>
|
|
||||||
<div *ngIf=" properties.enableEoscDataTransfer && resultLandingInfo.resultType == 'dataset' &&
|
|
||||||
resultLandingInfo.identifiers && resultLandingInfo.identifiers.get('doi') &&
|
|
||||||
resultLandingInfo.identifiers.get('doi').join('').indexOf('zenodo.')!=-1"
|
|
||||||
class="">
|
|
||||||
<egi-transfer-data [dois]="resultLandingInfo.identifiers.get('doi')" [isOpen]="egiTransferModalOpen"></egi-transfer-data>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<helper *ngIf="pageContents && pageContents['top'] && pageContents['top'].length > 0"
|
<helper *ngIf="pageContents && pageContents['top'] && pageContents['top'].length > 0"
|
||||||
[texts]="pageContents['top']"></helper>
|
[texts]="pageContents['top']"></helper>
|
||||||
|
|
||||||
|
@ -232,48 +121,15 @@
|
||||||
[publiclyFunded]="resultLandingInfo.publiclyFunded"
|
[publiclyFunded]="resultLandingInfo.publiclyFunded"
|
||||||
[projects]="resultLandingInfo.fundedByProjects">
|
[projects]="resultLandingInfo.fundedByProjects">
|
||||||
</landing-header>
|
</landing-header>
|
||||||
<!-- Labels -->
|
|
||||||
<!-- Not used anymore - access labels will be in action bars, languages in the landing-header component -->
|
|
||||||
<!-- <div class="uk-margin-bottom uk-grid uk-grid-small uk-flex-middle" uk-grid>
|
|
||||||
<ng-container *ngIf="resultLandingInfo.accessMode && resultLandingInfo.accessMode.toLowerCase() !== 'not available'">
|
|
||||||
<div>
|
|
||||||
<span [class]="'uk-label uk-text-truncate '+ (accessClass(resultLandingInfo.accessMode) == 'open' ? 'uk-label-success' : '')"
|
|
||||||
title="Access Mode">{{resultLandingInfo.accessMode}}
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
</ng-container>
|
|
||||||
<ng-container *ngIf="resultLandingInfo.languages &&
|
|
||||||
removeUnknown(resultLandingInfo.languages).length > 0">
|
|
||||||
<ng-container *ngFor="let language of removeUnknown(resultLandingInfo.languages)">
|
|
||||||
<div>
|
|
||||||
<span class="uk-label custom-label label-language" title="Language">{{language}}</span>
|
|
||||||
</div>
|
|
||||||
</ng-container>
|
|
||||||
</ng-container>
|
|
||||||
<ng-container *ngIf="resultLandingInfo.programmingLanguages && resultLandingInfo.programmingLanguages.length > 0">
|
|
||||||
<ng-container *ngFor="let programmingLanguage of resultLandingInfo.programmingLanguages">
|
|
||||||
<div>
|
|
||||||
<span class="uk-label custom-label label-language"
|
|
||||||
title="Programming Language">{{programmingLanguage}}</span>
|
|
||||||
</div>
|
|
||||||
</ng-container>
|
|
||||||
</ng-container>
|
|
||||||
</div> -->
|
|
||||||
<div class="uk-text-small">
|
<div class="uk-text-small">
|
||||||
<!-- Identifiers -->
|
<!-- Identifiers -->
|
||||||
<div *ngIf="resultLandingInfo.identifiers && resultLandingInfo.identifiers.size > 0" class="uk-margin-small-top">
|
<div *ngIf="resultLandingInfo.identifiers && resultLandingInfo.identifiers.size > 0" class="uk-margin-small-top">
|
||||||
<showIdentifiers [identifiers]="resultLandingInfo.identifiers" [showViewAll]="true"></showIdentifiers>
|
<showIdentifiers [identifiers]="resultLandingInfo.identifiers" [showViewAll]="true"></showIdentifiers>
|
||||||
</div>
|
</div>
|
||||||
<!--Published Date, Journal and Publisher-->
|
|
||||||
<!-- Moved inside landing-header component -->
|
|
||||||
<!-- <div showPublisher [publisher]="resultLandingInfo.publisher"
|
|
||||||
[publishDate]="resultLandingInfo.dateofacceptance"
|
|
||||||
[journal]="resultLandingInfo.journal" [properties]="properties" class="uk-margin-small-top"></div> -->
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="main-tabs-div" class="uk-sticky uk-blur-background"
|
<div id="main-tabs-div" class="uk-sticky uk-blur-background" uk-sticky="end: true; media: @m" [attr.offset]="offset">
|
||||||
uk-sticky="end: true; media: @m" [attr.offset]="offset">
|
|
||||||
<div class="uk-padding uk-padding-remove-horizontal uk-padding-remove-bottom">
|
<div class="uk-padding uk-padding-remove-horizontal uk-padding-remove-bottom">
|
||||||
<landing-header [ngClass]="stickyHeader ? 'uk-visible@m' : 'uk-invisible'"
|
<landing-header [ngClass]="stickyHeader ? 'uk-visible@m' : 'uk-invisible'"
|
||||||
[properties]="properties" [title]="resultLandingInfo.title"
|
[properties]="properties" [title]="resultLandingInfo.title"
|
||||||
|
@ -282,7 +138,6 @@
|
||||||
[date]="resultLandingInfo.dateofacceptance" [embargoEndDate]="resultLandingInfo.embargoEndDate"
|
[date]="resultLandingInfo.dateofacceptance" [embargoEndDate]="resultLandingInfo.embargoEndDate"
|
||||||
isSticky="true" [prevPath]="prevPath">
|
isSticky="true" [prevPath]="prevPath">
|
||||||
</landing-header>
|
</landing-header>
|
||||||
<!-- <showTitle *ngIf="stickyHeader" [titleName]="resultLandingInfo.title" classNames="uk-margin-remove-bottom" class="uk-visible@m"></showTitle>-->
|
|
||||||
<my-tabs (selectedActiveTab)="onSelectActiveTab($event)" [offsetForSticky]="offset" [(isSticky)]="stickyHeader">
|
<my-tabs (selectedActiveTab)="onSelectActiveTab($event)" [offsetForSticky]="offset" [(isSticky)]="stickyHeader">
|
||||||
<my-tab tabTitle="Summary" [tabId]="'summary'" [active]="true"></my-tab>
|
<my-tab tabTitle="Summary" [tabId]="'summary'" [active]="true"></my-tab>
|
||||||
<my-tab *ngIf="hasSubjects"
|
<my-tab *ngIf="hasSubjects"
|
||||||
|
@ -362,26 +217,6 @@
|
||||||
</ng-container>
|
</ng-container>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- right box/ sidebar-->
|
|
||||||
<ng-container *ngIf="!showFeedback && resultLandingInfo && hasRightSidebarInfo">
|
|
||||||
<a id="landing-right-sidebar-switcher" uk-toggle href="#right-column-offcanvas"
|
|
||||||
class="uk-offcanvas-switcher uk-flex uk-link-reset uk-flex-center uk-flex-middle uk-hidden@m"
|
|
||||||
(click)="rightSidebarOffcanvasClicked = true;">
|
|
||||||
<icon name="more" [ratio]="1.5" customClass="uk-text-primary" [flex]="true" visuallyHidden="sidebar"></icon>
|
|
||||||
</a>
|
|
||||||
<div id="right-column-offcanvas" class="uk-offcanvas" uk-offcanvas="flip: true; overlay: true;">
|
|
||||||
<div class="uk-offcanvas-bar">
|
|
||||||
<button class="uk-offcanvas-close uk-close uk-icon" type="button"
|
|
||||||
(click)="rightSidebarOffcanvasClicked = false">
|
|
||||||
<icon name="close" [ratio]="1.5" visuallyHidden="close"></icon>
|
|
||||||
</button>
|
|
||||||
<div *ngIf="rightSidebarOffcanvasClicked">
|
|
||||||
<ng-container *ngTemplateOutlet="right_column"></ng-container>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</ng-container>
|
|
||||||
|
|
||||||
<ng-template #right_column>
|
<ng-template #right_column>
|
||||||
<!-- new metrics box -->
|
<!-- new metrics box -->
|
||||||
<div *ngIf="resultLandingInfo && resultLandingInfo.measure && (resultLandingInfo.measure.bip.length || resultLandingInfo.measure.counts.length) && !viewAll"
|
<div *ngIf="resultLandingInfo && resultLandingInfo.measure && (resultLandingInfo.measure.bip.length || resultLandingInfo.measure.counts.length) && !viewAll"
|
||||||
|
@ -509,12 +344,11 @@
|
||||||
</div>
|
</div>
|
||||||
</ng-template>
|
</ng-template>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<feedback *ngIf="showFeedback && resultLandingInfo && properties.reCaptchaSiteKey" [resultLandingInfo]="resultLandingInfo"
|
||||||
|
|
||||||
<feedback *ngIf="resultLandingInfo && properties.reCaptchaSiteKey" [resultLandingInfo]="resultLandingInfo"
|
|
||||||
[properties]="properties" [entityType]="getTypeName()" [fields]="feedbackFields"
|
[properties]="properties" [entityType]="getTypeName()" [fields]="feedbackFields"
|
||||||
[(showForm)]="showFeedback" [preSelectedField]="feedbackPreSelectedField"></feedback>
|
[(showForm)]="showFeedback" [preSelectedField]="feedbackPreSelectedField"></feedback>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<!-- Mobile view -->
|
<!-- Mobile view -->
|
||||||
<div *ngIf="isMobile" class="uk-hidden@m uk-position-relative landing">
|
<div *ngIf="isMobile" class="uk-hidden@m uk-position-relative landing">
|
||||||
|
@ -711,7 +545,8 @@
|
||||||
</div>
|
</div>
|
||||||
<hr class="uk-margin-remove">
|
<hr class="uk-margin-remove">
|
||||||
</ng-container>
|
</ng-container>
|
||||||
<ng-container *ngIf="properties.adminToolsPortalType == 'explore' || properties.adminToolsPortalType == 'community' || properties.adminToolsPortalType == 'aggregator'" >
|
<ng-container *ngIf="properties.adminToolsPortalType == 'explore' || properties.adminToolsPortalType == 'community'
|
||||||
|
|| properties.adminToolsPortalType == 'aggregator' || properties.dashboard == 'irish'" >
|
||||||
<div class="uk-padding-small uk-padding-remove-horizontal ">
|
<div class="uk-padding-small uk-padding-remove-horizontal ">
|
||||||
<orcid-work [resultId]="id" [resultTitle]="resultLandingInfo?.title" [resultLandingInfo]="resultLandingInfo"
|
<orcid-work [resultId]="id" [resultTitle]="resultLandingInfo?.title" [resultLandingInfo]="resultLandingInfo"
|
||||||
[pids]="pidsArrayString" [pageType]="'landing'" [isMobile]="true"
|
[pids]="pidsArrayString" [pageType]="'landing'" [isMobile]="true"
|
||||||
|
@ -886,16 +721,18 @@
|
||||||
</modal-alert>
|
</modal-alert>
|
||||||
|
|
||||||
<modal-alert *ngIf="resultLandingInfo" #addThisModal classBody="uk-flex uk-flex-center uk-flex-middle">
|
<modal-alert *ngIf="resultLandingInfo" #addThisModal classBody="uk-flex uk-flex-center uk-flex-middle">
|
||||||
<addThis></addThis>
|
<addThis *ngIf="addThisClicked"></addThis>
|
||||||
</modal-alert>
|
</modal-alert>
|
||||||
|
|
||||||
<modal-alert *ngIf="resultLandingInfo && resultLandingInfo.organizations" #organizationsModal>
|
<modal-alert *ngIf="resultLandingInfo && resultLandingInfo.organizations" #organizationsModal>
|
||||||
|
<ng-container *ngIf="viewAllOrganizations">
|
||||||
<ng-container *ngTemplateOutlet="organizations_template; context: { threshold: resultLandingInfo.organizations.length}"></ng-container>
|
<ng-container *ngTemplateOutlet="organizations_template; context: { threshold: resultLandingInfo.organizations.length}"></ng-container>
|
||||||
|
</ng-container>
|
||||||
</modal-alert>
|
</modal-alert>
|
||||||
|
|
||||||
<modal-alert *ngIf="!isMobile && resultLandingInfo?.description" #descriptionModal
|
<modal-alert *ngIf="!isMobile && resultLandingInfo?.description" #descriptionModal
|
||||||
[large]="true">
|
[large]="true">
|
||||||
<div [innerHTML]="resultLandingInfo.description"></div>
|
<div *ngIf="descriptionClicked" [innerHTML]="resultLandingInfo.description"></div>
|
||||||
</modal-alert>
|
</modal-alert>
|
||||||
|
|
||||||
<!--<modal-alert *ngIf="resultLandingInfo && resultLandingInfo.sdg?.length > 0"-->
|
<!--<modal-alert *ngIf="resultLandingInfo && resultLandingInfo.sdg?.length > 0"-->
|
||||||
|
@ -1327,23 +1164,32 @@
|
||||||
</div>
|
</div>
|
||||||
</ng-template>
|
</ng-template>
|
||||||
|
|
||||||
|
<ng-container *ngIf="isMobile">
|
||||||
<fs-modal *ngIf="resultLandingInfo && resultLandingInfo.deletedByInferenceIds" #AlertModalDeletedByInferenceFS classTitle="uk-tile-default uk-border-bottom">
|
<fs-modal *ngIf="resultLandingInfo && resultLandingInfo.deletedByInferenceIds" #AlertModalDeletedByInferenceFS classTitle="uk-tile-default uk-border-bottom">
|
||||||
<deletedByInference *ngIf="type == 'publication' && deleteByInferenceOpened"
|
<deletedByInference *ngIf="type == 'publication' && deleteByInferenceOpened"
|
||||||
[id]="resultLandingInfo.record['result']['header']['dri:objIdentifier']"
|
[id]="resultLandingInfo.record['result']['header']['dri:objIdentifier']"
|
||||||
[ids]="resultLandingInfo.deletedByInferenceIds"
|
[ids]="resultLandingInfo.deletedByInferenceIds"
|
||||||
[resultType]="type" [type]="openaireEntities.PUBLICATIONS"></deletedByInference>
|
[resultType]="type" [type]="openaireEntities.PUBLICATIONS"
|
||||||
|
[isMobile]="isMobile"
|
||||||
|
[modal]="alertModalDeletedByInferenceFS"></deletedByInference>
|
||||||
<deletedByInference *ngIf="type == 'dataset' && deleteByInferenceOpened"
|
<deletedByInference *ngIf="type == 'dataset' && deleteByInferenceOpened"
|
||||||
[id]="resultLandingInfo.record['result']['header']['dri:objIdentifier']"
|
[id]="resultLandingInfo.record['result']['header']['dri:objIdentifier']"
|
||||||
[ids]="resultLandingInfo.deletedByInferenceIds"
|
[ids]="resultLandingInfo.deletedByInferenceIds"
|
||||||
[resultType]="'dataset'" [type]="openaireEntities.DATASETS"></deletedByInference>
|
[resultType]="'dataset'" [type]="openaireEntities.DATASETS"
|
||||||
|
[isMobile]="isMobile"
|
||||||
|
[modal]="alertModalDeletedByInferenceFS"></deletedByInference>
|
||||||
<deletedByInference *ngIf="type == 'software' && deleteByInferenceOpened"
|
<deletedByInference *ngIf="type == 'software' && deleteByInferenceOpened"
|
||||||
[id]="resultLandingInfo.record['result']['header']['dri:objIdentifier']"
|
[id]="resultLandingInfo.record['result']['header']['dri:objIdentifier']"
|
||||||
[ids]="resultLandingInfo.deletedByInferenceIds"
|
[ids]="resultLandingInfo.deletedByInferenceIds"
|
||||||
[resultType]="type" [type]="openaireEntities.SOFTWARE"></deletedByInference>
|
[resultType]="type" [type]="openaireEntities.SOFTWARE"
|
||||||
|
[isMobile]="isMobile"
|
||||||
|
[modal]="alertModalDeletedByInferenceFS"></deletedByInference>
|
||||||
<deletedByInference *ngIf="type == 'orp' && deleteByInferenceOpened"
|
<deletedByInference *ngIf="type == 'orp' && deleteByInferenceOpened"
|
||||||
[id]="resultLandingInfo.record['result']['header']['dri:objIdentifier']"
|
[id]="resultLandingInfo.record['result']['header']['dri:objIdentifier']"
|
||||||
[ids]="resultLandingInfo.deletedByInferenceIds"
|
[ids]="resultLandingInfo.deletedByInferenceIds"
|
||||||
[resultType]="'other'" [type]="openaireEntities.OTHER"></deletedByInference>
|
[resultType]="'other'" [type]="openaireEntities.OTHER"
|
||||||
|
[isMobile]="isMobile"
|
||||||
|
[modal]="alertModalDeletedByInferenceFS"></deletedByInference>
|
||||||
</fs-modal>
|
</fs-modal>
|
||||||
|
|
||||||
<fs-modal *ngIf="resultLandingInfo" #citeFsModal classTitle="uk-tile-default uk-border-bottom">
|
<fs-modal *ngIf="resultLandingInfo" #citeFsModal classTitle="uk-tile-default uk-border-bottom">
|
||||||
|
@ -1352,5 +1198,6 @@
|
||||||
</fs-modal>
|
</fs-modal>
|
||||||
|
|
||||||
<fs-modal *ngIf="resultLandingInfo" #addThisFsModal classTitle="uk-tile-default uk-border-bottom" classBody="uk-flex uk-flex-center uk-flex-middle">
|
<fs-modal *ngIf="resultLandingInfo" #addThisFsModal classTitle="uk-tile-default uk-border-bottom" classBody="uk-flex uk-flex-center uk-flex-middle">
|
||||||
<addThis></addThis>
|
<addThis *ngIf="addThisClicked"></addThis>
|
||||||
</fs-modal>
|
</fs-modal>
|
||||||
|
</ng-container>
|
|
@ -74,6 +74,8 @@ export class ResultLandingComponent {
|
||||||
public linkToSearchPage: string = null;
|
public linkToSearchPage: string = null;
|
||||||
|
|
||||||
public citeThisClicked: boolean;
|
public citeThisClicked: boolean;
|
||||||
|
public addThisClicked: boolean;
|
||||||
|
public descriptionClicked: boolean;
|
||||||
|
|
||||||
// Metrics tab variables
|
// Metrics tab variables
|
||||||
public metricsClicked: boolean;
|
public metricsClicked: boolean;
|
||||||
|
@ -197,6 +199,9 @@ export class ResultLandingComponent {
|
||||||
private userManagementService: UserManagementService,
|
private userManagementService: UserManagementService,
|
||||||
private layoutService: LayoutService,
|
private layoutService: LayoutService,
|
||||||
private _contextService: ContextsService) {
|
private _contextService: ContextsService) {
|
||||||
|
if(route.snapshot.data && route.snapshot.data['type']) {
|
||||||
|
this.type = route.snapshot.data['type'];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
|
@ -864,6 +869,7 @@ export class ResultLandingComponent {
|
||||||
}
|
}
|
||||||
|
|
||||||
public openAddThisModal() {
|
public openAddThisModal() {
|
||||||
|
this.addThisClicked = true;
|
||||||
this.addThisModal.cancelButton = false;
|
this.addThisModal.cancelButton = false;
|
||||||
this.addThisModal.okButton = false;
|
this.addThisModal.okButton = false;
|
||||||
this.addThisModal.alertTitle = "Share this " + this.getTypeName() + " in your social networks";
|
this.addThisModal.alertTitle = "Share this " + this.getTypeName() + " in your social networks";
|
||||||
|
@ -1076,6 +1082,7 @@ export class ResultLandingComponent {
|
||||||
this.sdgFosSuggest.subjectType="fos";
|
this.sdgFosSuggest.subjectType="fos";
|
||||||
}
|
}
|
||||||
this.cdr.detectChanges();
|
this.cdr.detectChanges();
|
||||||
|
this.sdgFosSuggest.isOpen = true;
|
||||||
this.sdgFosSuggest.openSelectionModal();
|
this.sdgFosSuggest.openSelectionModal();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1090,6 +1097,7 @@ export class ResultLandingComponent {
|
||||||
}
|
}
|
||||||
|
|
||||||
public openDescriptionModal() {
|
public openDescriptionModal() {
|
||||||
|
this.descriptionClicked = true;
|
||||||
this.descriptionModal.alertFooter = false;
|
this.descriptionModal.alertFooter = false;
|
||||||
this.descriptionModal.alertTitle = "Abstract";
|
this.descriptionModal.alertTitle = "Abstract";
|
||||||
this.descriptionModal.open();
|
this.descriptionModal.open();
|
||||||
|
|
|
@ -26,7 +26,6 @@ import {ResultPreviewModule} from "../../utils/result-preview/result-preview.mod
|
||||||
import {FeedbackModule} from "../feedback/feedback.module";
|
import {FeedbackModule} from "../feedback/feedback.module";
|
||||||
import {TabsModule} from "../../utils/tabs/tabs.module";
|
import {TabsModule} from "../../utils/tabs/tabs.module";
|
||||||
import {LoadingModule} from "../../utils/loading/loading.module";
|
import {LoadingModule} from "../../utils/loading/loading.module";
|
||||||
import {OrcidModule} from "../../orcid/orcid.module";
|
|
||||||
import {IconsModule} from "../../utils/icons/icons.module";
|
import {IconsModule} from "../../utils/icons/icons.module";
|
||||||
import {IconsService} from "../../utils/icons/icons.service";
|
import {IconsService} from "../../utils/icons/icons.service";
|
||||||
import {cite, fire, graph, landmark, link, link_to, quotes, rocket, versions} from "../../utils/icons/icons";
|
import {cite, fire, graph, landmark, link, link_to, quotes, rocket, versions} from "../../utils/icons/icons";
|
||||||
|
@ -37,15 +36,19 @@ import {SdgFosSuggestModule} from '../landing-utils/sdg-fos-suggest/sdg-fos-sugg
|
||||||
import {FullScreenModalModule} from "../../utils/modal/full-screen-modal/full-screen-modal.module";
|
import {FullScreenModalModule} from "../../utils/modal/full-screen-modal/full-screen-modal.module";
|
||||||
import {SafeHtmlPipeModule} from '../../utils/pipes/safeHTMLPipe.module';
|
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 {OrcidCoreModule} from "../../orcid/orcid-core.module";
|
||||||
|
import {SearchTabModule} from "../../utils/tabs/contents/search-tab.module";
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [
|
imports: [
|
||||||
CommonModule, FormsModule, LandingModule, SharedModule, RouterModule,
|
CommonModule, FormsModule, LandingModule, SharedModule, RouterModule,
|
||||||
|
ResultLandingRoutingModule,
|
||||||
CiteThisModule, PagingModule, IFrameModule,
|
CiteThisModule, PagingModule, IFrameModule,
|
||||||
AltMetricsModule, Schema2jsonldModule, SEOServiceModule,
|
AltMetricsModule, Schema2jsonldModule, SEOServiceModule,
|
||||||
DeletedByInferenceModule, ShowAuthorsModule, HelperModule, ResultLandingUtilsModule, AlertModalModule,
|
DeletedByInferenceModule, ShowAuthorsModule, HelperModule, ResultLandingUtilsModule, AlertModalModule,
|
||||||
LandingHeaderModule, NoLoadPaging, ResultPreviewModule, FeedbackModule, TabsModule, LoadingModule,
|
LandingHeaderModule, NoLoadPaging, ResultPreviewModule, FeedbackModule, TabsModule, LoadingModule,
|
||||||
OrcidModule, IconsModule, InputModule, EGIDataTransferModule, RecaptchaModule,
|
OrcidCoreModule, IconsModule, InputModule, EGIDataTransferModule, RecaptchaModule,
|
||||||
SdgFosSuggestModule, FullScreenModalModule, SafeHtmlPipeModule, EntityActionsModule
|
SdgFosSuggestModule, FullScreenModalModule, SafeHtmlPipeModule, EntityActionsModule
|
||||||
],
|
],
|
||||||
declarations: [
|
declarations: [
|
||||||
|
|
|
@ -3,7 +3,7 @@ import { Router, ActivatedRouteSnapshot, RouterStateSnapshot, UrlTree } from '@a
|
||||||
import {Observable} from 'rxjs';
|
import {Observable} from 'rxjs';
|
||||||
import {LoginErrorCodes} from './utils/guardHelper.class';
|
import {LoginErrorCodes} from './utils/guardHelper.class';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable({providedIn: 'root'})
|
||||||
export class FreeGuard {
|
export class FreeGuard {
|
||||||
|
|
||||||
constructor(private router: Router) {
|
constructor(private router: Router) {
|
||||||
|
|
|
@ -7,16 +7,13 @@ import {UserRoutingModule} from './user-routing.module';
|
||||||
|
|
||||||
import {UserComponent} from './user.component';
|
import {UserComponent} from './user.component';
|
||||||
|
|
||||||
import {PreviousRouteRecorder} from '../utils/piwik/previousRouteRecorder.guard';
|
|
||||||
import {LoadingModule} from "../utils/loading/loading.module";
|
import {LoadingModule} from "../utils/loading/loading.module";
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [
|
imports: [
|
||||||
CommonModule, FormsModule, UserRoutingModule, RouterModule, LoadingModule
|
CommonModule, FormsModule, UserRoutingModule, RouterModule, LoadingModule
|
||||||
],
|
],
|
||||||
providers: [
|
providers: [],
|
||||||
PreviousRouteRecorder
|
|
||||||
],
|
|
||||||
declarations: [
|
declarations: [
|
||||||
UserComponent
|
UserComponent
|
||||||
],
|
],
|
||||||
|
|
|
@ -234,12 +234,13 @@ export class Role {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static mapType(type: string, communityMap: boolean = true): string {
|
public static mapType(type: string, communityMap: boolean = true): string {
|
||||||
|
type = type.replace(this.GROUP, '');
|
||||||
if (type == "ri" && communityMap) {
|
if (type == "ri" && communityMap) {
|
||||||
type = "community";
|
type = "community";
|
||||||
} else if (type == "organization") {
|
} else if (type == "organization") {
|
||||||
type = "institution";
|
type = "institution";
|
||||||
}
|
}
|
||||||
return Role.GROUP + type;
|
return type;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -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() {
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
import {NgModule} from "@angular/core";
|
import {NgModule} from "@angular/core";
|
||||||
import {GeneralComponent} from "./general.component";
|
import {GeneralComponent} from "./general.component";
|
||||||
import {GeneralRoutingModule} from "./general-routing.module";
|
import {GeneralRoutingModule} from "./general-routing.module";
|
||||||
import {PreviousRouteRecorder} from "../../utils/piwik/previousRouteRecorder.guard";
|
|
||||||
import {CommonModule} from "@angular/common";
|
import {CommonModule} from "@angular/common";
|
||||||
import {RouterModule} from "@angular/router";
|
import {RouterModule} from "@angular/router";
|
||||||
import {InputModule} from "../../sharedComponents/input/input.module";
|
import {InputModule} from "../../sharedComponents/input/input.module";
|
||||||
|
@ -30,9 +29,7 @@ import {
|
||||||
LogoUrlPipeModule,
|
LogoUrlPipeModule,
|
||||||
SidebarMobileToggleModule
|
SidebarMobileToggleModule
|
||||||
],
|
],
|
||||||
providers: [
|
providers: [],
|
||||||
PreviousRouteRecorder,
|
|
||||||
],
|
|
||||||
exports: [GeneralComponent]
|
exports: [GeneralComponent]
|
||||||
})
|
})
|
||||||
export class GeneralModule {
|
export class GeneralModule {
|
||||||
|
|
|
@ -12,14 +12,13 @@
|
||||||
</div>
|
</div>
|
||||||
<div actions>
|
<div actions>
|
||||||
<div class="uk-section-xsmall">
|
<div class="uk-section-xsmall">
|
||||||
<div class="uk-flex uk-flex-center uk-flex-wrap uk-flex-middle"
|
<div class="uk-flex uk-flex-center uk-flex-wrap uk-flex-middle uk-flex-between@m">
|
||||||
[ngClass]="properties.dashboard == 'irish' ? 'uk-flex-between@m' : 'uk-flex-right@m'">
|
<div class="uk-width-medium uk-margin-small-bottom">
|
||||||
<div *ngIf="properties.dashboard == 'irish'" class="uk-width-medium uk-margin-small-bottom">
|
<div input type="select" placeholder="Type" [disabled]="loading"
|
||||||
<div input type="select" placeholder="Type"
|
|
||||||
[options]="typeOptions" [formInput]="filters.get('type')">
|
[options]="typeOptions" [formInput]="filters.get('type')">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div search-input [searchControl]="filters.get('keyword')" [expandable]="true"
|
<div search-input [searchControl]="filters.get('keyword')" [expandable]="true" [disabled]="loading"
|
||||||
placeholder="Search Profiles" searchInputClass="outer"
|
placeholder="Search Profiles" searchInputClass="outer"
|
||||||
class="uk-width-1-3@xl uk-width-2-5@l uk-width-1-2@m uk-width-1-1 uk-flex uk-flex-right"></div>
|
class="uk-width-1-3@xl uk-width-2-5@l uk-width-1-2@m uk-width-1-1 uk-flex uk-flex-right"></div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -32,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)"
|
||||||
|
@ -40,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>
|
||||||
|
@ -60,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)"
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
import {NgModule} from "@angular/core";
|
import {NgModule} from "@angular/core";
|
||||||
import {ManageStakeholdersComponent} from "./manageStakeholders.component";
|
import {ManageStakeholdersComponent} from "./manageStakeholders.component";
|
||||||
import {ManageStakeholdersRoutingModule} from "./manageStakeholders-routing.module";
|
import {ManageStakeholdersRoutingModule} from "./manageStakeholders-routing.module";
|
||||||
import {PreviousRouteRecorder} from "../../utils/piwik/previousRouteRecorder.guard";
|
|
||||||
import {CommonModule} from "@angular/common";
|
import {CommonModule} from "@angular/common";
|
||||||
import {RouterModule} from "@angular/router";
|
import {RouterModule} from "@angular/router";
|
||||||
import {InputModule} from "../../sharedComponents/input/input.module";
|
import {InputModule} from "../../sharedComponents/input/input.module";
|
||||||
|
@ -40,9 +39,7 @@ import {PagingModule} from "../../utils/paging.module";
|
||||||
SliderTabsModule,
|
SliderTabsModule,
|
||||||
PagingModule
|
PagingModule
|
||||||
],
|
],
|
||||||
providers: [
|
providers: [],
|
||||||
PreviousRouteRecorder,
|
|
||||||
],
|
|
||||||
exports: [ManageStakeholdersComponent]
|
exports: [ManageStakeholdersComponent]
|
||||||
})
|
})
|
||||||
export class ManageStakeholdersModule {
|
export class ManageStakeholdersModule {
|
||||||
|
|
|
@ -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>
|
||||||
|
@ -14,38 +14,36 @@
|
||||||
(click)="deleteSectionOpen(number, i, 'number', 'delete')">
|
(click)="deleteSectionOpen(number, i, 'number', 'delete')">
|
||||||
<icon name="close" [flex]="true"></icon>
|
<icon name="close" [flex]="true"></icon>
|
||||||
</a>
|
</a>
|
||||||
<!-- <ng-container *ngIf="!stakeholder.defaultId">-->
|
|
||||||
<!-- <button [disabled]="editing || number.defaultId " class="md-btn md-btn-mini"-->
|
|
||||||
<!-- [title]="(number.defaultId?'Default sections cannot be deleted':'Delete all related sections')"-->
|
|
||||||
<!-- (click)="deleteSectionOpen(number, i, 'number', 'delete')"><i class="material-icons">highlight_off</i>-->
|
|
||||||
<!-- </button>-->
|
|
||||||
<!-- <button [disabled]="editing || number.defaultId " class="md-btn md-btn-mini"-->
|
|
||||||
<!-- [title]="(number.defaultId?'Default sections cannot be deleted':'Delete section and disconnect related')"-->
|
|
||||||
<!-- (click)="deleteSectionOpen(number, i, 'number', 'disconnect')"><i class="material-icons">link_off</i>-->
|
|
||||||
<!-- </button>-->
|
|
||||||
<!-- </ng-container>-->
|
|
||||||
</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" uk-sortable="group: number" uk-grid>
|
<div [id]="'number-' + number._id" class="uk-grid uk-grid-small uk-grid-match"
|
||||||
|
[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"
|
||||||
|
[name]="stakeholderUtils.visibilityIcon.get(indicator.visibility)"
|
||||||
|
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 *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" uk-dropdown="mode: click; pos: bottom-left; offset: 5; delay-hide: 0">
|
<div #element *ngIf="isEditable && (isCurator || showVisibility)" class="uk-dropdown"
|
||||||
|
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">
|
||||||
<li><a (click)="editNumberIndicatorOpen(number, indicator._id); hide(element)">Edit</a></li>
|
<li>
|
||||||
|
<a (click)="editNumberIndicatorOpen(number, indicator._id); hide(element)">Edit</a>
|
||||||
|
</li>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
<ng-container *ngIf="showVisibility">
|
<ng-container *ngIf="showVisibility">
|
||||||
<li *ngIf="isCurator" class="uk-nav-divider"></li>
|
<li *ngIf="isCurator" class="uk-nav-divider"></li>
|
||||||
|
@ -53,9 +51,12 @@
|
||||||
<li>
|
<li>
|
||||||
<a (click)="changeIndicatorStatus(number._id, indicator, v.value);hide(element)">
|
<a (click)="changeIndicatorStatus(number._id, indicator, v.value);hide(element)">
|
||||||
<div class="uk-flex uk-flex-middle">
|
<div class="uk-flex uk-flex-middle">
|
||||||
<icon [flex]="true" [name]="v.icon" ratio="0.6"></icon>
|
<icon [flex]="true" [name]="v.icon"
|
||||||
|
ratio="0.6"></icon>
|
||||||
<span class="uk-margin-small-left uk-width-expand">{{ v.label }}</span>
|
<span class="uk-margin-small-left uk-width-expand">{{ v.label }}</span>
|
||||||
<icon *ngIf="indicator.visibility === v.value" [flex]="true" name="done" class="uk-text-secondary" ratio="0.8"></icon>
|
<icon *ngIf="indicator.visibility === v.value"
|
||||||
|
[flex]="true" name="done"
|
||||||
|
class="uk-text-secondary" ratio="0.8"></icon>
|
||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
@ -63,24 +64,28 @@
|
||||||
</ng-container>
|
</ng-container>
|
||||||
<ng-container *ngIf="!indicator.defaultId && !editing && isCurator">
|
<ng-container *ngIf="!indicator.defaultId && !editing && isCurator">
|
||||||
<li class="uk-nav-divider">
|
<li class="uk-nav-divider">
|
||||||
<li><a (click)="deleteIndicatorOpen(number, indicator._id, 'number', 'delete');hide(element)">Delete</a></li>
|
<li>
|
||||||
|
<a (click)="deleteIndicatorOpen(number, indicator._id, 'number', 'delete');hide(element)">Delete</a>
|
||||||
|
</li>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="uk-text-small uk-text-truncate uk-margin-xsmall-bottom uk-margin-right">{{ indicator.name }}</div>
|
<div class="uk-text-small uk-text-truncate uk-margin-xsmall-bottom uk-margin-right">{{ indicator.name }}</div>
|
||||||
<div class="number uk-text-small uk-text-bold">
|
<div class="number uk-text-small uk-text-bold">
|
||||||
<span *ngIf="numberResults.get(i + '-' + j)" [innerHTML]="(indicator.indicatorPaths[0].format == 'NUMBER'?(numberResults.get(i + '-' + j) | numberRound: 2:1:stakeholder.locale):(numberResults.get(i + '-' + j) | numberPercentage: stakeholder.locale))"></span>
|
<span *ngIf="numberResults.get(i + '-' + j + '-' + 0)"
|
||||||
<span *ngIf="!numberResults.get(i + '-' + j)">--</span>
|
[innerHTML]="(indicator.indicatorPaths[0].format == 'NUMBER'?(numberResults.get(i + '-' + j + '-' + 0) | numberRound: 2:1:stakeholder.locale):(numberResults.get(i + '-' + j + '-' + 0) | numberPercentage: stakeholder.locale))"></span>
|
||||||
|
<span *ngIf="!numberResults.get(i + '-' + j + '-' + 0)">--</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</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" (click)="editNumberIndicatorOpen(number)">
|
<a class="uk-card uk-card-default number-card uk-padding-small uk-flex uk-flex-middle uk-link-reset"
|
||||||
|
(click)="editNumberIndicatorOpen(number)">
|
||||||
<div class="uk-text-background uk-margin-right">
|
<div class="uk-text-background uk-margin-right">
|
||||||
<icon name="add" [flex]="true" ratio="1.5"></icon>
|
<icon name="add" [flex]="true" ratio="1.5"></icon>
|
||||||
</div>
|
</div>
|
||||||
|
@ -93,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>
|
||||||
|
@ -103,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>
|
||||||
|
@ -113,38 +118,37 @@
|
||||||
(click)="deleteSectionOpen(chart, i, 'chart', 'delete')">
|
(click)="deleteSectionOpen(chart, i, 'chart', 'delete')">
|
||||||
<icon name="close" [flex]="true"></icon>
|
<icon name="close" [flex]="true"></icon>
|
||||||
</a>
|
</a>
|
||||||
<!-- <ng-container *ngIf="!stakeholder.defaultId">-->
|
|
||||||
<!-- <button [disabled]="editing || chart.defaultId " class="md-btn md-btn-mini"-->
|
|
||||||
<!-- [title]="(chart.defaultId?'Default sections cannot be deleted':'Delete all related sections')"-->
|
|
||||||
<!-- (click)="deleteSectionOpen(chart, i, 'chart', 'delete')"><i class="material-icons">highlight_off</i>-->
|
|
||||||
<!-- </button>-->
|
|
||||||
<!-- <button [disabled]="editing || chart.defaultId " class="md-btn md-btn-mini"-->
|
|
||||||
<!-- [title]="(chart.defaultId?'Default sections cannot be deleted':'Delete section and disconnect related')"-->
|
|
||||||
<!-- (click)="deleteSectionOpen(chart, i, 'chart', 'disconnect')"><i class="material-icons">link_off</i>-->
|
|
||||||
<!-- </button>-->
|
|
||||||
<!-- </ng-container>-->
|
|
||||||
</div>
|
</div>
|
||||||
</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" uk-sortable="group: chart" uk-grid>
|
<div [id]="'chart-' + chart._id" class="uk-grid uk-grid-small uk-grid-match"
|
||||||
|
[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" [ngClass]="getChartClassBySize(indicator.width)">
|
<div *ngIf="indicator" [id]="indicator._id"
|
||||||
|
[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"
|
||||||
|
[name]="stakeholderUtils.visibilityIcon.get(indicator.visibility)"
|
||||||
|
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 *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" uk-dropdown="mode: click; pos: bottom-left; offset: 5; delay-hide: 0">
|
<div #element *ngIf="isEditable && (isCurator || showVisibility)" class="uk-dropdown"
|
||||||
|
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">
|
||||||
<li><a (click)="editChartIndicatorOpen(chart, indicator._id); hide(element)">Edit</a></li>
|
<li>
|
||||||
|
<a (click)="editChartIndicatorOpen(chart, indicator._id); hide(element)">Edit</a>
|
||||||
|
</li>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
<ng-container *ngIf="showVisibility">
|
<ng-container *ngIf="showVisibility">
|
||||||
<li *ngIf="isCurator" class="uk-nav-divider"></li>
|
<li *ngIf="isCurator" class="uk-nav-divider"></li>
|
||||||
|
@ -152,9 +156,12 @@
|
||||||
<li>
|
<li>
|
||||||
<a (click)="changeIndicatorStatus(chart._id, indicator, v.value);">
|
<a (click)="changeIndicatorStatus(chart._id, indicator, v.value);">
|
||||||
<div class="uk-flex uk-flex-middle">
|
<div class="uk-flex uk-flex-middle">
|
||||||
<icon [flex]="true" [name]="v.icon" ratio="0.6"></icon>
|
<icon [flex]="true" [name]="v.icon"
|
||||||
|
ratio="0.6"></icon>
|
||||||
<span class="uk-margin-small-left uk-width-expand">{{ v.label }}</span>
|
<span class="uk-margin-small-left uk-width-expand">{{ v.label }}</span>
|
||||||
<icon *ngIf="indicator.visibility === v.value" [flex]="true" name="done" class="uk-text-secondary" ratio="0.8"></icon>
|
<icon *ngIf="indicator.visibility === v.value"
|
||||||
|
[flex]="true" name="done"
|
||||||
|
class="uk-text-secondary" ratio="0.8"></icon>
|
||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
@ -162,46 +169,66 @@
|
||||||
</ng-container>
|
</ng-container>
|
||||||
<ng-container *ngIf="!indicator.defaultId && !editing && isCurator">
|
<ng-container *ngIf="!indicator.defaultId && !editing && isCurator">
|
||||||
<li class="uk-nav-divider">
|
<li class="uk-nav-divider">
|
||||||
<li><a (click)="deleteIndicatorOpen(chart, indicator._id, 'chart', 'delete');hide(element)">Delete</a></li>
|
<li>
|
||||||
|
<a (click)="deleteIndicatorOpen(chart, indicator._id, 'chart', 'delete');hide(element)">Delete</a>
|
||||||
|
</li>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<div *ngIf="indicator.name" class="uk-text-center uk-text-bold uk-margin-small-bottom">
|
<div *ngIf="indicator.name"
|
||||||
|
class="uk-text-center uk-text-bold uk-margin-small-bottom">
|
||||||
{{ indicator.name }}
|
{{ indicator.name }}
|
||||||
</div>
|
</div>
|
||||||
<iframe *ngIf="!properties.disableFrameLoad && indicator.indicatorPaths[0] && indicator.indicatorPaths[0].source !=='image' &&
|
<div *ngIf="indicator.indicatorPaths.length > 1" class="uk-margin-medium-bottom">
|
||||||
safeUrls.get(indicatorUtils.getFullUrl(stakeholder, indicator.indicatorPaths[0]))"
|
<ul class="uk-subnav uk-subnav-pill uk-subnav-small">
|
||||||
allowfullscreen="true" mozallowfullscreen="true" webkitallowfullscreen="true"
|
<li *ngFor="let indicatorPath of indicator.indicatorPaths; let i=index"
|
||||||
[src]="safeUrls.get(indicatorUtils.getFullUrl(stakeholder, indicator.indicatorPaths[0]))"
|
class="uk-flex uk-margin-small-top"
|
||||||
class="uk-width-1-1" [ngClass]="'uk-height-' + (indicator.height?indicator.height.toLowerCase():'medium')"
|
[class.uk-active]="(!indicator.activePath && i == 0) || indicator.activePath === i">
|
||||||
|
<a (click)="indicator.activePath = i">
|
||||||
|
<span>
|
||||||
|
{{ indicatorPath.parameters.title ? indicatorPath.parameters.title : '--' }}
|
||||||
|
</span>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<iframe *ngIf="!properties.disableFrameLoad && getActiveIndicatorPath(indicator) && getActiveIndicatorPath(indicator).source !=='image' &&
|
||||||
|
safeUrls.get(indicatorUtils.getFullUrl(stakeholder, getActiveIndicatorPath(indicator)))"
|
||||||
|
allowfullscreen="true" mozallowfullscreen="true"
|
||||||
|
webkitallowfullscreen="true"
|
||||||
|
[src]="safeUrls.get(indicatorUtils.getFullUrl(stakeholder, getActiveIndicatorPath(indicator)))"
|
||||||
|
class="uk-width-1-1"
|
||||||
|
[ngClass]="'uk-height-' + (indicator.height?indicator.height.toLowerCase():'medium')"
|
||||||
[class.uk-blend-multiply]="!isFullscreen"></iframe>
|
[class.uk-blend-multiply]="!isFullscreen"></iframe>
|
||||||
<div *ngIf="properties.disableFrameLoad && indicator.indicatorPaths &&
|
<div *ngIf="properties.disableFrameLoad && indicator.indicatorPaths &&
|
||||||
indicator.indicatorPaths.length > 0 && indicator.indicatorPaths[0].source !=='image'">
|
indicator.indicatorPaths.length > 0 && getActiveIndicatorPath(indicator).source !=='image'">
|
||||||
<img class="uk-width-1-1 uk-blend-multiply" [ngClass]="'uk-height-' + (indicator.height?indicator.height.toLowerCase():'medium')"
|
<img class="uk-width-1-1 uk-blend-multiply"
|
||||||
|
[ngClass]="'uk-height-' + (indicator.height?indicator.height.toLowerCase():'medium')"
|
||||||
src="assets/chart-placeholder.png">
|
src="assets/chart-placeholder.png">
|
||||||
</div>
|
</div>
|
||||||
<div *ngIf="indicator.indicatorPaths && indicator.indicatorPaths[0] &&
|
<div *ngIf="indicator.indicatorPaths && getActiveIndicatorPath(indicator) && getActiveIndicatorPath(indicator).source === 'image'">
|
||||||
indicator.indicatorPaths[0].source === 'image'">
|
<img class="uk-width-1-1 uk-blend-multiply"
|
||||||
<img class="uk-width-1-1 uk-blend-multiply" [ngClass]="'uk-height-' + (indicator.height?indicator.height.toLowerCase():'medium')"
|
[ngClass]="'uk-height-' + (indicator.height?indicator.height.toLowerCase():'medium')"
|
||||||
[src]="indicator.indicatorPaths[0].url">
|
[src]="getActiveIndicatorPath(indicator).url">
|
||||||
</div>
|
</div>
|
||||||
<!--<ng-container *ngTemplateOutlet="description; context: {indicator:indicator}"></ng-container>-->
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</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" (click)="editChartIndicatorOpen(chart)">
|
<div class=" uk-card uk-card-default uk-card-body clickable"
|
||||||
|
(click)="editChartIndicatorOpen(chart)">
|
||||||
<h6 class="uk-text-bold uk-text-center">
|
<h6 class="uk-text-bold uk-text-center">
|
||||||
Create a custom indicator
|
Create a custom indicator
|
||||||
</h6>
|
</h6>
|
||||||
<div class="uk-text-muted uk-text-small">
|
<div class="uk-text-muted uk-text-small">
|
||||||
Use our advance tool to create a custom Indicator that suit the needs of your funding
|
Use our advance tool to create a custom Indicator that suit the needs of your
|
||||||
|
funding
|
||||||
KPI's.
|
KPI's.
|
||||||
</div>
|
</div>
|
||||||
<div class="uk-flex uk-flex-center uk-text-background uk-margin-medium-top">
|
<div class="uk-flex uk-flex-center uk-text-background uk-margin-medium-top">
|
||||||
|
@ -213,12 +240,15 @@
|
||||||
</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>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div *ngIf="loading" class="uk-position-relative uk-height-large">
|
||||||
|
<loading class="uk-position-center"></loading>
|
||||||
|
</div>
|
||||||
<modal-alert #editNumberModal
|
<modal-alert #editNumberModal
|
||||||
[large]="true" classTitle="uk-background-primary uk-light"
|
[large]="true" classTitle="uk-background-primary uk-light"
|
||||||
(alertOutput)="saveIndicator()"
|
(alertOutput)="saveIndicator()"
|
||||||
|
@ -230,9 +260,11 @@
|
||||||
<div *ngIf="numberIndicatorFb" class="uk-grid" [formGroup]="numberIndicatorFb" uk-grid>
|
<div *ngIf="numberIndicatorFb" class="uk-grid" [formGroup]="numberIndicatorFb" uk-grid>
|
||||||
<div input class="uk-width-1-1" [formInput]="numberIndicatorFb.get('name')" placeholder="Title"></div>
|
<div input class="uk-width-1-1" [formInput]="numberIndicatorFb.get('name')" placeholder="Title"></div>
|
||||||
<div *ngIf="stakeholder.defaultId != '-1' && ( (indicator.description && indicator.description.length > 0) || !stakeholder.defaultId)"
|
<div *ngIf="stakeholder.defaultId != '-1' && ( (indicator.description && indicator.description.length > 0) || !stakeholder.defaultId)"
|
||||||
input class="uk-width-1-1" [formInput]="numberIndicatorFb.get('description')" placeholder="Profile description" type="textarea">
|
input class="uk-width-1-1" [formInput]="numberIndicatorFb.get('description')"
|
||||||
|
placeholder="Profile description" type="textarea">
|
||||||
</div>
|
</div>
|
||||||
<div input class="uk-width-1-1" *ngIf="stakeholder.defaultId" [formInput]="numberIndicatorFb.get('additionalDescription')"
|
<div input class="uk-width-1-1" *ngIf="stakeholder.defaultId"
|
||||||
|
[formInput]="numberIndicatorFb.get('additionalDescription')"
|
||||||
placeholder="Description" type="textarea">
|
placeholder="Description" type="textarea">
|
||||||
</div>
|
</div>
|
||||||
<div *ngIf="showVisibility" input class="uk-width-1-2@m" [formInput]="numberIndicatorFb.get('visibility')"
|
<div *ngIf="showVisibility" input class="uk-width-1-2@m" [formInput]="numberIndicatorFb.get('visibility')"
|
||||||
|
@ -241,29 +273,87 @@
|
||||||
<div input class="uk-width-1-2@m" [formInput]="numberIndicatorFb.get('width')"
|
<div input class="uk-width-1-2@m" [formInput]="numberIndicatorFb.get('width')"
|
||||||
placeholder="Number Size" [options]="indicatorUtils.indicatorSizes" type="select">
|
placeholder="Number Size" [options]="indicatorUtils.indicatorSizes" type="select">
|
||||||
</div>
|
</div>
|
||||||
|
<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">
|
||||||
|
<ul #numbersTransition class="uk-subnav uk-subnav-pill uk-subnav-small" transition-group>
|
||||||
|
<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-active]="(!indicator.activePath && i == 0) || indicator.activePath === i">
|
||||||
|
<a (click)="activeNumberIndicatorPath(i)">
|
||||||
|
<span *ngIf="indicatorPath.get('result').valid && indicatorPath.get('result').value !== 0"
|
||||||
|
[innerHTML]="(indicatorPath.get('format').value == 'NUMBER'?(indicatorPath.get('result').value | numberRound: 2:1:stakeholder.locale):(indicatorPath.get('result').value | numberPercentage: stakeholder.locale))">
|
||||||
|
</span>
|
||||||
|
<span *ngIf="!indicatorPath.get('result').valid || indicatorPath.get('result').value === 0">
|
||||||
|
--
|
||||||
|
</span>
|
||||||
|
</a>
|
||||||
|
<span *ngIf="!indicator.defaultId && numberIndicatorPaths.length > 1"
|
||||||
|
class="uk-flex uk-flex-column uk-flex-center uk-margin-small-left"
|
||||||
|
[class.uk-invisible-hover]="indicator.activePath !== i"
|
||||||
|
(click)="$event.stopPropagation();$event.preventDefault()">
|
||||||
|
<a *ngIf="isCurator" class="uk-link-reset uk-flex uk-flex-middle">
|
||||||
|
<icon [flex]="true" name="more_vert"></icon>
|
||||||
|
</a>
|
||||||
|
<div #element uk-dropdown="mode: click; pos: bottom-left; offset: 5; delay-hide: 0;">
|
||||||
|
<ul class="uk-nav uk-dropdown-nav">
|
||||||
|
<li *ngIf="i > 0">
|
||||||
|
<a (click)="hide(element);moveIndicatorPath(numberIndicatorFb, 'number', i)">
|
||||||
|
<div class="uk-flex uk-flex-middle">
|
||||||
|
<icon [flex]="true" name="west" ratio="0.6"></icon>
|
||||||
|
<span class="uk-margin-small-left uk-width-expand">Move Left</span>
|
||||||
|
</div>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<li *ngIf="i < numberIndicatorPaths.length - 1">
|
||||||
|
<a (click)="hide(element);moveIndicatorPath(numberIndicatorFb, 'number', i, i + 1)">
|
||||||
|
<div class="uk-flex uk-flex-middle">
|
||||||
|
<icon [flex]="true" name="east" ratio="0.6"></icon>
|
||||||
|
<span class="uk-margin-small-left uk-width-expand">Move Right</span>
|
||||||
|
</div>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<a (click)="removeNumberIndicatorPath(i); hide(element)">
|
||||||
|
<div class="uk-flex uk-flex-middle">
|
||||||
|
<icon [flex]="true" name="delete" ratio="0.6"></icon>
|
||||||
|
<span class="uk-margin-small-left uk-width-expand">Delete</span>
|
||||||
|
</div>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</span>
|
||||||
|
</li>
|
||||||
|
<li class="uk-margin-small-top">
|
||||||
|
<a (click)="activeNumberIndicatorPath(numberIndicatorPaths.length); $event.preventDefault()"
|
||||||
|
class="uk-flex uk-flex-middle">
|
||||||
|
<icon name="add" [flex]="true"></icon>
|
||||||
|
<span class="uk-text-uppercase">Add</span>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
<div *ngFor="let indicatorPath of numberIndicatorPaths.controls; let i=index" [formGroupName]="i">
|
<div *ngFor="let indicatorPath of numberIndicatorPaths.controls; let i=index" [formGroupName]="i">
|
||||||
<div class="uk-grid" uk-grid>
|
<div *ngIf="(!indicator.activePath && i == 0) || indicator.activePath === i" class="uk-grid"
|
||||||
|
uk-grid>
|
||||||
<div class="uk-width-1-1">
|
<div class="uk-width-1-1">
|
||||||
<div class="uk-grid" uk-grid>
|
<div class="uk-grid" uk-grid>
|
||||||
<div class="uk-width-1-1 uk-flex uk-flex-middle">
|
<div class="uk-width-1-1 uk-flex uk-flex-middle">
|
||||||
<div input class="uk-width-expand" [formInput]="indicatorPath.get('url')" placeholder="Number URL">
|
<div input class="uk-width-expand" [formInput]="indicatorPath.get('url')"
|
||||||
<div *ngIf="urlParameterizedMessage" warning>{{urlParameterizedMessage}}</div>
|
placeholder="Number URL">
|
||||||
</div>
|
</div>
|
||||||
<div class='uk-padding-small'>
|
<div class='uk-padding-small'>
|
||||||
<a class="uk-link-reset" (click)="copyToClipboard(indicatorPath.get('url').value)"><icon [flex]="true" name="content_copy"></icon></a>
|
<a class="uk-link-reset"
|
||||||
</div>
|
(click)="copyToClipboard(indicatorPath.get('url').value)">
|
||||||
</div>
|
<icon [flex]="true" name="content_copy"></icon>
|
||||||
<div *ngIf="showCheckForSchemaEnhancements" class="uk-width-1-1">
|
</a>
|
||||||
<div class="uk-alert uk-alert-warning">
|
|
||||||
There are schema enhancements that can be applied in this query.<a
|
|
||||||
(click)="indicatorPath.get('url').setValue(indicatorUtils.applySchemaEnhancements(indicatorPath.get('url').value)); indicatorPath.get('url').markAsDirty()">Apply
|
|
||||||
now</a>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="uk-width-1-2@m">
|
<div class="uk-width-1-2@m">
|
||||||
<div input [formInput]="indicatorPath.get('source')" placeholder="Source"
|
<div input [formInput]="indicatorPath.get('source')" placeholder="Source"
|
||||||
[options]="isAdministrator?indicatorUtils.allSourceTypes:indicatorUtils.sourceTypes" type="select">
|
[options]="isAdministrator?indicatorUtils.allSourceTypes:indicatorUtils.sourceTypes"
|
||||||
|
type="select">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="uk-width-1-2@m">
|
<div class="uk-width-1-2@m">
|
||||||
|
@ -271,28 +361,39 @@
|
||||||
[options]="indicatorUtils.formats" type="select">
|
[options]="indicatorUtils.formats" type="select">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="uk-width-1-2@m" formArrayName="parameters">
|
||||||
|
<div *ngIf="getParameter(i, 'statsProfile', 'number') && statsProfiles" input
|
||||||
|
[formInput]="getParameter(i, 'statsProfile', 'number').get('value')"
|
||||||
|
[type]="'select'"
|
||||||
|
[options]="statsProfiles"
|
||||||
|
placeholder="Stats Profile"></div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div formArrayName="jsonPath" class="uk-width-1-1">
|
<div formArrayName="jsonPath" class="uk-width-1-1">
|
||||||
<h6 class="uk-text-bold uk-margin-remove-bottom">
|
<h6 class="uk-text-bold uk-margin-remove-bottom">
|
||||||
<span>JSON Path</span>
|
<span>JSON Path</span>
|
||||||
</h6>
|
</h6>
|
||||||
<div *ngIf="numberIndicatorPaths.at(i).get('result').invalid && numberIndicatorPaths.at(i).get('result').errors.required">
|
<div *ngIf="indicatorPath.get('result').invalid && indicatorPath.get('result').errors.required">
|
||||||
<div class="uk-text-danger uk-text-small">
|
<div class="uk-text-danger uk-text-small">
|
||||||
This JSON path is not valid or the result has not been calculated yet.
|
This JSON path is not valid or the result has not been calculated yet.
|
||||||
Please press calculate on box below to see the result.
|
Please press calculate on box below to see the result.
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="uk-grid uk-child-width-1-3@m uk-child-width-1-1 uk-margin-top uk-flex-middle" uk-grid>
|
<div class="uk-grid uk-child-width-1-3@m uk-child-width-1-1 uk-margin-top uk-flex-middle"
|
||||||
<div *ngFor="let jsonPath of getJsonPath(i).controls; let j=index" class="uk-flex uk-flex-middle">
|
uk-grid>
|
||||||
<div input class="uk-width-1-1" [formInput]="jsonPath" [placeholder]="'Level ' + +(j + 1)"></div>
|
<div *ngFor="let jsonPath of getJsonPath(i).controls; let j=index"
|
||||||
|
class="uk-flex uk-flex-middle">
|
||||||
|
<div input class="uk-width-1-1" [formInput]="jsonPath"
|
||||||
|
[placeholder]="'Level ' + +(j + 1)"></div>
|
||||||
<a [class.uk-invisible]="getJsonPath(i).length === 1 || numberIndicatorFb.get('defaultId').value"
|
<a [class.uk-invisible]="getJsonPath(i).length === 1 || numberIndicatorFb.get('defaultId').value"
|
||||||
class="uk-margin-small-left uk-text-danger"
|
class="uk-margin-small-left uk-text-danger"
|
||||||
[class.uk-disabled]="getJsonPath(i).disabled"
|
[class.uk-disabled]="getJsonPath(i).disabled"
|
||||||
(click)="removeJsonPath(i, j)">
|
(click)="removeJsonPath(i, j)">
|
||||||
<icon name="close"></icon>
|
<icon name="close"></icon>
|
||||||
</a>
|
</a>
|
||||||
<span [class.uk-invisible]="getJsonPath(i).disabled || j === (getJsonPath(i).controls.length - 1)" class="uk-text-center uk-margin-small-left">
|
<span [class.uk-invisible]="getJsonPath(i).disabled || j === (getJsonPath(i).controls.length - 1)"
|
||||||
|
class="uk-text-center uk-margin-small-left">
|
||||||
<icon name="east"></icon>
|
<icon name="east"></icon>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
@ -306,24 +407,38 @@
|
||||||
<div class="uk-width-1-1 uk-flex uk-flex-center">
|
<div class="uk-width-1-1 uk-flex uk-flex-center">
|
||||||
<div class="uk-flex uk-position-relative">
|
<div class="uk-flex uk-position-relative">
|
||||||
<span class="uk-padding number number-preview uk-flex uk-flex-column uk-flex-center uk-text-center">
|
<span class="uk-padding number number-preview uk-flex uk-flex-column uk-flex-center uk-text-center">
|
||||||
<span *ngIf="numberIndicatorPaths.at(i).get('result').valid && numberIndicatorPaths.at(i).get('result').value !== 0"
|
<span *ngIf="indicatorPath.get('result').valid && indicatorPath.get('result').value !== 0"
|
||||||
[innerHTML]="(numberIndicatorPaths.at(i).get('format').value == 'NUMBER'?(numberIndicatorPaths.at(i).get('result').value | numberRound: 2:1:stakeholder.locale):(numberIndicatorPaths.at(i).get('result').value | numberPercentage: stakeholder.locale))">
|
[innerHTML]="(indicatorPath.get('format').value == 'NUMBER'?(indicatorPath.get('result').value | numberRound: 2:1:stakeholder.locale):(indicatorPath.get('result').value | numberPercentage: stakeholder.locale))">
|
||||||
</span>
|
</span>
|
||||||
<span *ngIf="numberIndicatorPaths.at(i).get('result').valid && numberIndicatorPaths.at(i).get('result').value === 0">
|
<span *ngIf="indicatorPath.get('result').valid && indicatorPath.get('result').value === 0">
|
||||||
--
|
--
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
<div *ngIf="numberIndicatorPaths.at(i).get('result').invalid"
|
<div *ngIf="indicatorPath.get('result').invalid"
|
||||||
class="uk-width-1-1 uk-height-1-1 refresh-indicator">
|
class="uk-width-1-1 uk-height-1-1 refresh-indicator">
|
||||||
<div class="uk-position-relative uk-height-1-1">
|
<div class="uk-position-relative uk-height-1-1">
|
||||||
<a class="uk-position-center uk-text-center uk-text-small uk-link-reset"
|
<a class="uk-position-center uk-text-center uk-text-small uk-link-reset"
|
||||||
[class.uk-disabled]="numberIndicatorPaths.at(i).get('url').invalid"
|
[class.uk-disabled]="indicatorPath.get('url').invalid"
|
||||||
(click)="validateJsonPath(i, true)">
|
(click)="validateJsonPath(i, true)">
|
||||||
<div>
|
<div>
|
||||||
<icon name="refresh"></icon>
|
<icon name="refresh"></icon>
|
||||||
</div>
|
</div>
|
||||||
<span *ngIf="numberIndicatorPaths.at(i).get('result').errors.required">Calculate</span>
|
<span *ngIf="indicatorPath.get('result').errors.required">Calculate</span>
|
||||||
<span *ngIf="numberIndicatorPaths.at(i).get('result').errors.validating">Calculating...</span>
|
<span *ngIf="indicatorPath.get('result').errors.validating">Calculating...</span>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div *ngIf="hasDifference(i, 'number')"
|
||||||
|
class="uk-width-1-1 uk-height-1-1 refresh-indicator">
|
||||||
|
<div class="uk-position-relative uk-height-1-1">
|
||||||
|
<a class="uk-position-center uk-text-center uk-text-small uk-link-reset"
|
||||||
|
[class.uk-disabled]="indicatorPath.get('url').invalid"
|
||||||
|
(click)="refreshIndicator('number')">
|
||||||
|
<div>
|
||||||
|
<icon name="refresh"></icon>
|
||||||
|
</div>
|
||||||
|
<span>Calculate</span>
|
||||||
|
<span *ngIf="indicatorPath.get('result').errors?.validating">Calculating...</span>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -345,9 +460,11 @@
|
||||||
<div *ngIf="chartIndicatorFb" [formGroup]="chartIndicatorFb" class="uk-grid" uk-grid>
|
<div *ngIf="chartIndicatorFb" [formGroup]="chartIndicatorFb" class="uk-grid" uk-grid>
|
||||||
<div input class="uk-width-1-1" [formInput]="chartIndicatorFb.get('name')" placeholder="Title"></div>
|
<div input class="uk-width-1-1" [formInput]="chartIndicatorFb.get('name')" placeholder="Title"></div>
|
||||||
<div *ngIf="stakeholder.defaultId != '-1' && ((indicator.description && indicator.description.length > 0) || !stakeholder.defaultId)"
|
<div *ngIf="stakeholder.defaultId != '-1' && ((indicator.description && indicator.description.length > 0) || !stakeholder.defaultId)"
|
||||||
input class="uk-width-1-1" [formInput]="chartIndicatorFb.get('description')" placeholder="Default Description" type="textarea">
|
input class="uk-width-1-1" [formInput]="chartIndicatorFb.get('description')"
|
||||||
|
placeholder="Default Description" type="textarea">
|
||||||
</div>
|
</div>
|
||||||
<div *ngIf="stakeholder.defaultId" input class="uk-width-1-1" [formInput]="chartIndicatorFb.get('additionalDescription')"
|
<div *ngIf="stakeholder.defaultId" input class="uk-width-1-1"
|
||||||
|
[formInput]="chartIndicatorFb.get('additionalDescription')"
|
||||||
placeholder="Description" type="textarea">
|
placeholder="Description" type="textarea">
|
||||||
</div>
|
</div>
|
||||||
<div *ngIf="showVisibility" input class="uk-width-1-2@m" [formInput]="chartIndicatorFb.get('visibility')"
|
<div *ngIf="showVisibility" input class="uk-width-1-2@m" [formInput]="chartIndicatorFb.get('visibility')"
|
||||||
|
@ -360,46 +477,112 @@
|
||||||
[options]="indicatorUtils.indicatorSizes" type="select">
|
[options]="indicatorUtils.indicatorSizes" type="select">
|
||||||
</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">
|
||||||
|
<ul #chartsTransition class="uk-subnav uk-subnav-pill uk-subnav-small" transition-group>
|
||||||
|
<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-active]="(!indicator.activePath && i == 0) || indicator.activePath === i">
|
||||||
|
<a (click)="activeChartIndicatorPath(i)">
|
||||||
|
<span>{{ getParameter(i, 'title')?.get('value')?.value ? getParameter(i, 'title').get('value').value : 'No title yet' }}</span>
|
||||||
|
</a>
|
||||||
|
<span *ngIf="!indicator.defaultId && chartIndicatorPaths.length > 1"
|
||||||
|
class="uk-flex uk-flex-column uk-flex-center uk-margin-small-left"
|
||||||
|
[class.uk-invisible-hover]="indicator.activePath !== i"
|
||||||
|
(click)="$event.stopPropagation();$event.preventDefault()">
|
||||||
|
<a *ngIf="isCurator" class="uk-link-reset uk-flex uk-flex-middle">
|
||||||
|
<icon [flex]="true" name="more_vert"></icon>
|
||||||
|
</a>
|
||||||
|
<div #element uk-dropdown="mode: click; pos: bottom-left; offset: 5; delay-hide: 0;">
|
||||||
|
<ul class="uk-nav uk-dropdown-nav">
|
||||||
|
<li *ngIf="i > 0">
|
||||||
|
<a (click)="hide(element);moveIndicatorPath(chartIndicatorFb, 'chart', i)">
|
||||||
|
<div class="uk-flex uk-flex-middle">
|
||||||
|
<icon [flex]="true" name="west" ratio="0.6"></icon>
|
||||||
|
<span class="uk-margin-small-left uk-width-expand">Move Left</span>
|
||||||
|
</div>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<li *ngIf="i < chartIndicatorPaths.length - 1">
|
||||||
|
<a (click)="hide(element);moveIndicatorPath(chartIndicatorFb, 'chart', i, i + 1)">
|
||||||
|
<div class="uk-flex uk-flex-middle">
|
||||||
|
<icon [flex]="true" name="east" ratio="0.6"></icon>
|
||||||
|
<span class="uk-margin-small-left uk-width-expand">Move Right</span>
|
||||||
|
</div>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<a (click)="removeChartIndicatorPath(i); hide(element)">
|
||||||
|
<div class="uk-flex uk-flex-middle">
|
||||||
|
<icon [flex]="true" name="delete" ratio="0.6"></icon>
|
||||||
|
<span class="uk-margin-small-left uk-width-expand">Delete</span>
|
||||||
|
</div>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</span>
|
||||||
|
</li>
|
||||||
|
<li class="uk-margin-small-top">
|
||||||
|
<a (click)="activeChartIndicatorPath(chartIndicatorPaths.length); $event.preventDefault()"
|
||||||
|
class="uk-flex uk-flex-middle">
|
||||||
|
<icon name="add" [flex]="true"></icon>
|
||||||
|
<span class="uk-text-uppercase">Add</span>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
<div *ngFor="let indicatorPath of chartIndicatorPaths.controls; let i=index;"
|
<div *ngFor="let indicatorPath of chartIndicatorPaths.controls; let i=index;"
|
||||||
[formGroupName]="i" class="uk-grid" uk-grid>
|
[formGroupName]="i">
|
||||||
|
<div *ngIf="(!indicator.activePath && i == 0) || indicator.activePath === i" class="uk-grid"
|
||||||
|
uk-grid>
|
||||||
<div class="uk-width-1-1 uk-flex uk-flex-middle">
|
<div class="uk-width-1-1 uk-flex uk-flex-middle">
|
||||||
<div input class="uk-width-expand" [title]="indicatorPath.get('url').disabled?'Default chart URLs cannot change':''"
|
<div input class="uk-width-expand"
|
||||||
|
[title]="indicatorPath.get('url').disabled?'Default chart URLs cannot change':''"
|
||||||
[formInput]="indicatorPath.get('url')" placeholder="Chart URL">
|
[formInput]="indicatorPath.get('url')" placeholder="Chart URL">
|
||||||
<div *ngIf="urlParameterizedMessage" warning>{{urlParameterizedMessage}}</div>
|
|
||||||
</div>
|
</div>
|
||||||
<div class='uk-padding-small'>
|
<div class='uk-padding-small'>
|
||||||
<a class="uk-link-reset" (click)="copyToClipboard(indicatorPath.get('url').value)"><icon [flex]="true" name="content_copy"></icon></a>
|
<a class="uk-link-reset" (click)="copyToClipboard(indicatorPath.get('url').value)">
|
||||||
</div>
|
<icon [flex]="true" name="content_copy"></icon>
|
||||||
</div>
|
</a>
|
||||||
<div *ngIf="showCheckForSchemaEnhancements" class=" uk-width-1-1 ">
|
|
||||||
<div class="uk-alert uk-alert-warning">
|
|
||||||
There are schema enhancements that can be applied in this query. <a
|
|
||||||
(click)="indicatorPath.get('url').setValue(indicatorUtils.applySchemaEnhancements(indicatorPath.get('url').value)); indicatorPath.get('url').markAsDirty()">Apply
|
|
||||||
now</a>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="uk-width-1-1" formArrayName="parameters">
|
<div class="uk-width-1-1" formArrayName="parameters">
|
||||||
<div class="uk-grid" uk-grid>
|
<div class="uk-grid" uk-grid>
|
||||||
<div *ngIf="getParameter(i, 'title')" input class="uk-width-1-1" [formInput]="getParameter(i, 'title').get('value')"
|
<div *ngIf="getParameter(i, 'title')" input class="uk-width-1-1"
|
||||||
|
[formInput]="getParameter(i, 'title').get('value')"
|
||||||
placeholder="Chart Title"></div>
|
placeholder="Chart Title"></div>
|
||||||
<div *ngIf="getParameter(i, 'subtitle')" input class="uk-width-1-1" placeholder="Chart Subtitle" [formInput]="getParameter(i, 'subtitle').get('value')" label="Chart Subtitle"></div>
|
<div *ngIf="getParameter(i, 'subtitle')" input class="uk-width-1-1"
|
||||||
<div *ngIf="!getParameter(i, 'type')" input class="uk-width-1-3@s" [formInput]="indicatorPath.get('type')" placeholder="Chart Type"
|
placeholder="Chart Subtitle" [formInput]="getParameter(i, 'subtitle').get('value')"
|
||||||
|
label="Chart Subtitle"></div>
|
||||||
|
<div *ngIf="!getParameter(i, 'type')" input class="uk-width-1-3@s"
|
||||||
|
[formInput]="indicatorPath.get('type')" placeholder="Chart Type"
|
||||||
[options]="(indicatorPath.get('type').value == 'table' && getParameter(i, 'data_title_0'))?indicatorUtils.getChartTypes(indicatorPath.get('type').value):indicatorUtils.allChartTypes"
|
[options]="(indicatorPath.get('type').value == 'table' && getParameter(i, 'data_title_0'))?indicatorUtils.getChartTypes(indicatorPath.get('type').value):indicatorUtils.allChartTypes"
|
||||||
type="select"></div>
|
type="select"></div>
|
||||||
<div *ngIf="getParameter(i, 'type')" input class="uk-width-1-3@s" [formInput]="getParameter(i, 'type').get('value')" placeholder="Chart Type"
|
<div *ngIf="getParameter(i, 'type')" input class="uk-width-1-3@s"
|
||||||
[options]="indicatorUtils.getChartTypes(getParameter(i, 'type').get('value').value)" type="select"></div>
|
[formInput]="getParameter(i, 'type').get('value')" placeholder="Chart Type"
|
||||||
<div *ngIf="getParameter(i, 'xAxisTitle')" input class="uk-width-1-3@s" [formInput]="getParameter(i, 'xAxisTitle').get('value')"
|
[options]="indicatorUtils.getChartTypes(getParameter(i, 'type').get('value').value)"
|
||||||
|
type="select"></div>
|
||||||
|
<div *ngIf="getParameter(i, 'xAxisTitle')" input class="uk-width-1-3@s"
|
||||||
|
[formInput]="getParameter(i, 'xAxisTitle').get('value')"
|
||||||
placeholder="X-Axis Title"></div>
|
placeholder="X-Axis Title"></div>
|
||||||
<div *ngIf="getParameter(i, 'yAxisTitle')" input class="uk-width-1-3@s" [formInput]="getParameter(i, 'yAxisTitle').get('value')"
|
<div *ngIf="getParameter(i, 'yAxisTitle')" input class="uk-width-1-3@s"
|
||||||
|
[formInput]="getParameter(i, 'yAxisTitle').get('value')"
|
||||||
placeholder="Y-Axis Title"></div>
|
placeholder="Y-Axis Title"></div>
|
||||||
<div *ngIf="getParameter(i, 'data_title_0')" input class="uk-width-1-3@s" [formInput]="getParameter(i, 'data_title_0').get('value')"
|
<div *ngIf="getParameter(i, 'data_title_0')" input class="uk-width-1-3@s"
|
||||||
|
[formInput]="getParameter(i, 'data_title_0').get('value')"
|
||||||
placeholder="Data Title"></div>
|
placeholder="Data Title"></div>
|
||||||
<div *ngIf="getParameter(i, 'data_title_1')" input class="uk-width-1-3@s" [formInput]="getParameter(i, 'data_title_1').get('value')"
|
<div *ngIf="getParameter(i, 'data_title_1')" input class="uk-width-1-3@s"
|
||||||
|
[formInput]="getParameter(i, 'data_title_1').get('value')"
|
||||||
placeholder="Data Title"></div>
|
placeholder="Data Title"></div>
|
||||||
<div *ngIf="getParameter(i, 'start_year')" input class="uk-width-1-3@s" [formInput]="getParameter(i, 'start_year').get('value')"
|
<div *ngIf="getParameter(i, 'start_year')" input class="uk-width-1-3@s"
|
||||||
|
[formInput]="getParameter(i, 'start_year').get('value')"
|
||||||
placeholder="Year (From)"></div>
|
placeholder="Year (From)"></div>
|
||||||
<div *ngIf="getParameter(i, 'end_year')" input class="uk-width-1-3@s" [formInput]="getParameter(i, 'end_year').get('value')"
|
<div *ngIf="getParameter(i, 'end_year')" input class="uk-width-1-3@s"
|
||||||
|
[formInput]="getParameter(i, 'end_year').get('value')"
|
||||||
placeholder="Year (To)"></div>
|
placeholder="Year (To)"></div>
|
||||||
|
<div *ngIf="getParameter(i, 'statsProfile') && statsProfiles" input
|
||||||
|
class="uk-width-1-3@s" [formInput]="getParameter(i, 'statsProfile').get('value')"
|
||||||
|
[type]="'select'" [options]="statsProfiles" placeholder="Stats Profile"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div *ngIf="indicator && indicator.indicatorPaths[i] && indicator.indicatorPaths[i].safeResourceUrl"
|
<div *ngIf="indicator && indicator.indicatorPaths[i] && indicator.indicatorPaths[i].safeResourceUrl"
|
||||||
|
@ -407,7 +590,8 @@
|
||||||
<div *ngIf="(hasDifference(i)) && !indicatorPath.invalid"
|
<div *ngIf="(hasDifference(i)) && !indicatorPath.invalid"
|
||||||
class="uk-width-1-1 uk-height-large refresh-indicator">
|
class="uk-width-1-1 uk-height-large refresh-indicator">
|
||||||
<div class="uk-position-relative uk-height-1-1">
|
<div class="uk-position-relative uk-height-1-1">
|
||||||
<a class="uk-position-center uk-text-center uk-link-reset" (click)="refreshIndicator()">
|
<a class="uk-position-center uk-text-center uk-link-reset"
|
||||||
|
(click)="refreshIndicator()">
|
||||||
<div>
|
<div>
|
||||||
<icon name="refresh"></icon>
|
<icon name="refresh"></icon>
|
||||||
</div>
|
</div>
|
||||||
|
@ -415,13 +599,15 @@
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<iframe *ngIf="indicator.indicatorPaths[i].source !== 'image'" [class.uk-blend-multiply]="!isFullscreen"
|
<iframe *ngIf="indicator.indicatorPaths[i].source !== 'image'"
|
||||||
[src]="indicator.indicatorPaths[i].safeResourceUrl" allowfullscreen="true" mozallowfullscreen="true" webkitallowfullscreen="true"
|
[class.uk-blend-multiply]="!isFullscreen"
|
||||||
|
[src]="indicator.indicatorPaths[i].safeResourceUrl" allowfullscreen="true"
|
||||||
|
mozallowfullscreen="true" webkitallowfullscreen="true"
|
||||||
class="uk-width-1-1 uk-height-large"></iframe>
|
class="uk-width-1-1 uk-height-large"></iframe>
|
||||||
<!-- <div *ngIf="properties.disableFrameLoad && indicator.indicatorPaths[i].source !== 'image'" class="uk-alert uk-alert-danger uk-text-center">I frames-->
|
|
||||||
<!-- preview is disabled</div>-->
|
|
||||||
<div *ngIf="indicator.indicatorPaths[i].source === 'image'">
|
<div *ngIf="indicator.indicatorPaths[i].source === 'image'">
|
||||||
<img class="uk-width-1-1 uk-height-large uk-blend-multiply" [src]="indicator.indicatorPaths[i].url">
|
<img class="uk-width-1-1 uk-height-large uk-blend-multiply"
|
||||||
|
[src]="indicator.indicatorPaths[i].url">
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -430,36 +616,24 @@
|
||||||
<div #editChartNotify notify-form class="uk-width-1-1 uk-margin-medium-top"></div>
|
<div #editChartNotify notify-form class="uk-width-1-1 uk-margin-medium-top"></div>
|
||||||
</div>
|
</div>
|
||||||
</modal-alert>
|
</modal-alert>
|
||||||
<modal-alert #deleteModal (alertOutput)="deleteIndicator()" [overflowBody]="false" classTitle="uk-background-primary uk-light">
|
<modal-alert #deleteModal (alertOutput)="deleteIndicator()" [overflowBody]="false"
|
||||||
|
classTitle="uk-background-primary uk-light">
|
||||||
<div [class.uk-invisible]="editing" class="uk-position-relative">
|
<div [class.uk-invisible]="editing" class="uk-position-relative">
|
||||||
<div *ngIf="editing">
|
<div *ngIf="editing">
|
||||||
<loading class="uk-position-center"></loading>
|
<loading class="uk-position-center"></loading>
|
||||||
</div>
|
</div>
|
||||||
You are about to delete <span class="uk-text-bold" *ngIf="indicator && index !== -1">
|
You are about to delete <span class="uk-text-bold" *ngIf="indicator && index !== -1">
|
||||||
"{{indicator.name ? indicator.name : (indicator.indicatorPaths[0]?.parameters?.title?indicator.indicatorPaths[0].parameters.title:'')}}"</span> indicator permanently.
|
"{{ indicator.name ? indicator.name : (indicator.indicatorPaths[0]?.parameters?.title ? indicator.indicatorPaths[0].parameters.title : '') }}
|
||||||
|
"</span> indicator permanently.
|
||||||
<div *ngIf="indicatorChildrenActionOnDelete == 'delete'" class="uk-text-bold">
|
<div *ngIf="indicatorChildrenActionOnDelete == 'delete'" class="uk-text-bold">
|
||||||
Indicators of all profiles based on this default indicator, will be deleted as well.
|
Indicators of all profiles based on this default indicator, will be deleted as well.
|
||||||
</div>
|
</div>
|
||||||
<!-- <span *ngIf="indicatorChildrenActionOnDelete == 'disconnect'" class="uk-text-bold">-->
|
|
||||||
<!-- Indicators of all profiles based on this default indicator, will not be marked as copied from default anymore.-->
|
|
||||||
<!-- </span>-->
|
|
||||||
Are you sure you want to proceed?
|
Are you sure you want to proceed?
|
||||||
<div #deleteNotify notify-form class="uk-width-1-1 uk-margin-medium-top"></div>
|
<div #deleteNotify notify-form class="uk-width-1-1 uk-margin-medium-top"></div>
|
||||||
</div>
|
</div>
|
||||||
</modal-alert>
|
</modal-alert>
|
||||||
<!--<modal-alert #deleteAllModal (alertOutput)="deleteIndicator('delete')">
|
<modal-alert #deleteSectionModal (alertOutput)="deleteSection()" [overflowBody]="false"
|
||||||
You are about to delete <span class="uk-text-bold" *ngIf="indicator && index !== -1">
|
classTitle="uk-background-primary uk-light">
|
||||||
"{{indicator.name ? indicator.name : indicator.indicatorPaths[0].parameters.title}}"</span> indicator permanently.
|
|
||||||
<span class="uk-text-bold">Indicators of all profiles based on this default indicator, will be deleted as well.</span>
|
|
||||||
Are you sure you want to proceed?
|
|
||||||
</modal-alert>
|
|
||||||
<modal-alert #deleteAndDisconnectModal (alertOutput)="deleteIndicator('disconnect')">
|
|
||||||
You are about to delete <span class="uk-text-bold" *ngIf="indicator && index !== -1">
|
|
||||||
"{{indicator.name ? indicator.name : indicator.indicatorPaths[0].parameters.title}}"</span> indicator permanently.
|
|
||||||
<span class="uk-text-bold">Indicators of all profiles based on this default indicator, will not be marked as copied from default anymore.</span>
|
|
||||||
Are you sure you want to proceed?
|
|
||||||
</modal-alert>-->
|
|
||||||
<modal-alert #deleteSectionModal (alertOutput)="deleteSection()" [overflowBody]="false" classTitle="uk-background-primary uk-light">
|
|
||||||
<div [class.uk-invisible]="editing" class="uk-position-relative">
|
<div [class.uk-invisible]="editing" class="uk-position-relative">
|
||||||
<div *ngIf="editing">
|
<div *ngIf="editing">
|
||||||
<loading class="uk-position-center"></loading>
|
<loading class="uk-position-center"></loading>
|
||||||
|
@ -468,20 +642,9 @@
|
||||||
<div *ngIf="sectionChildrenActionOnDelete == 'delete' && !stakeholder.defaultId" class="uk-text-bold">
|
<div *ngIf="sectionChildrenActionOnDelete == 'delete' && !stakeholder.defaultId" class="uk-text-bold">
|
||||||
Sections of all profiles based on this default section and their contents, will be deleted as well.
|
Sections of all profiles based on this default section and their contents, will be deleted as well.
|
||||||
</div>
|
</div>
|
||||||
<!-- <span *ngIf="sectionChildrenActionOnDelete == 'disconnect'" class="uk-text-bold">-->
|
|
||||||
<!-- Sections of all profiles based on this default section and their contents, will not be marked as copied from default anymore.-->
|
|
||||||
<!-- </span>-->
|
|
||||||
Are you sure you want to proceed?
|
Are you sure you want to proceed?
|
||||||
</div>
|
</div>
|
||||||
</modal-alert>
|
</modal-alert>
|
||||||
<!--<modal-alert #deleteNumberSectionModal (alertOutput)="deleteSection('number')">
|
|
||||||
You are about to delete this section and its indicators permanently.
|
|
||||||
Are you sure you want to proceed?
|
|
||||||
</modal-alert>
|
|
||||||
<modal-alert #deleteChartSectionModal (alertOutput)="deleteSection()">
|
|
||||||
You are about to delete this section and its indicators permanently.
|
|
||||||
Are you sure you want to proceed?
|
|
||||||
</modal-alert>-->
|
|
||||||
<ng-template #new_section let-type="type">
|
<ng-template #new_section let-type="type">
|
||||||
<div class="section">
|
<div class="section">
|
||||||
<div class="uk-flex uk-flex-center" (click)="createSection(-1, type)">
|
<div class="uk-flex uk-flex-center" (click)="createSection(-1, type)">
|
||||||
|
|
|
@ -20,7 +20,7 @@ import {
|
||||||
Visibility
|
Visibility
|
||||||
} from "../../monitor/entities/stakeholder";
|
} from "../../monitor/entities/stakeholder";
|
||||||
import {
|
import {
|
||||||
AbstractControl,
|
AbstractControl, FormArray, FormGroup,
|
||||||
UntypedFormArray,
|
UntypedFormArray,
|
||||||
UntypedFormBuilder,
|
UntypedFormBuilder,
|
||||||
UntypedFormControl,
|
UntypedFormControl,
|
||||||
|
@ -31,8 +31,8 @@ import {AlertModal} from "../../utils/modal/alert";
|
||||||
import {StatisticsService} from "../utils/services/statistics.service";
|
import {StatisticsService} from "../utils/services/statistics.service";
|
||||||
import {HelperFunctions} from "../../utils/HelperFunctions.class";
|
import {HelperFunctions} from "../../utils/HelperFunctions.class";
|
||||||
import {DomSanitizer, SafeResourceUrl} from "@angular/platform-browser";
|
import {DomSanitizer, SafeResourceUrl} from "@angular/platform-browser";
|
||||||
import {Reorder, StakeholderService} from "../../monitor/services/stakeholder.service";
|
import {MoveIndicator, SectionInfo, StakeholderService} from "../../monitor/services/stakeholder.service";
|
||||||
import {Observable, Subscriber} from "rxjs";
|
import {BehaviorSubject, Observable, Subscriber} from "rxjs";
|
||||||
import {LayoutService} from "../../dashboard/sharedComponents/sidebar/layout.service";
|
import {LayoutService} from "../../dashboard/sharedComponents/sidebar/layout.service";
|
||||||
import {Router} from "@angular/router";
|
import {Router} from "@angular/router";
|
||||||
import {Role, Session, User} from "../../login/utils/helper.class";
|
import {Role, Session, User} from "../../login/utils/helper.class";
|
||||||
|
@ -44,6 +44,8 @@ import {NotificationService} from "../../notifications/notification.service";
|
||||||
import {NotificationHandler} from "../../utils/notification-handler";
|
import {NotificationHandler} from "../../utils/notification-handler";
|
||||||
import {IndicatorStakeholderBaseComponent} from "../utils/stakeholder-base.component";
|
import {IndicatorStakeholderBaseComponent} from "../utils/stakeholder-base.component";
|
||||||
import {properties} from "../../../../environments/environment";
|
import {properties} from "../../../../environments/environment";
|
||||||
|
import {StatsProfilesService} from "../utils/services/stats-profiles.service";
|
||||||
|
import {TransitionGroupComponent} from "../../utils/transition-group/transition-group.component";
|
||||||
|
|
||||||
declare var UIkit;
|
declare var UIkit;
|
||||||
declare var copy;
|
declare var copy;
|
||||||
|
@ -68,6 +70,7 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple
|
||||||
@Input()
|
@Input()
|
||||||
public user: User = null;
|
public user: User = null;
|
||||||
public preview: string;
|
public preview: string;
|
||||||
|
public statsProfiles = [];
|
||||||
public numberIndicatorFb: UntypedFormGroup;
|
public numberIndicatorFb: UntypedFormGroup;
|
||||||
public chartIndicatorFb: UntypedFormGroup;
|
public chartIndicatorFb: UntypedFormGroup;
|
||||||
public chartSections: UntypedFormArray;
|
public chartSections: UntypedFormArray;
|
||||||
|
@ -80,12 +83,13 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple
|
||||||
public index: number = -1;
|
public index: number = -1;
|
||||||
public editing: boolean = false;
|
public editing: boolean = false;
|
||||||
public dragging: boolean = false;
|
public dragging: boolean = false;
|
||||||
|
/* Reorder indicators */
|
||||||
|
public to: BehaviorSubject<SectionInfo> = new BehaviorSubject<SectionInfo>(null);
|
||||||
/** Caches */
|
/** Caches */
|
||||||
public safeUrls: Map<string, SafeResourceUrl> = new Map<string, SafeResourceUrl>([]);
|
public safeUrls: Map<string, SafeResourceUrl> = new Map<string, SafeResourceUrl>([]);
|
||||||
public numberResponses: Map<string, any> = new Map<string, any>();
|
public numberResponses: Map<string, any> = new Map<string, any>();
|
||||||
public numberResults: Map<string, number> = new Map<string, number>();
|
public numberResults: Map<string, number> = new Map<string, number>();
|
||||||
/** Import / Export Indicators */
|
public loading: boolean = false;
|
||||||
importLoading: boolean = false;
|
|
||||||
@ViewChild('editChartModal', {static: true}) editChartModal: AlertModal;
|
@ViewChild('editChartModal', {static: true}) editChartModal: AlertModal;
|
||||||
@ViewChild('editNumberModal', {static: true}) editNumberModal: AlertModal;
|
@ViewChild('editNumberModal', {static: true}) editNumberModal: AlertModal;
|
||||||
@ViewChild('deleteModal', {static: true}) deleteModal: AlertModal;
|
@ViewChild('deleteModal', {static: true}) deleteModal: AlertModal;
|
||||||
|
@ -93,12 +97,13 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple
|
||||||
public sectionTypeToDelete: string;
|
public sectionTypeToDelete: string;
|
||||||
public sectionChildrenActionOnDelete: string;
|
public sectionChildrenActionOnDelete: string;
|
||||||
public indicatorChildrenActionOnDelete: string;
|
public indicatorChildrenActionOnDelete: string;
|
||||||
urlParameterizedMessage = null;
|
|
||||||
showCheckForSchemaEnhancements: boolean = false;
|
|
||||||
private notification: Notification;
|
private notification: Notification;
|
||||||
@ViewChild('editNumberNotify', {static: true}) editNumberNotify: NotifyFormComponent;
|
@ViewChild('editNumberNotify', {static: true}) editNumberNotify: NotifyFormComponent;
|
||||||
@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 */
|
||||||
|
@ViewChild('numbersTransition') numbersTransition: TransitionGroupComponent;
|
||||||
|
@ViewChild('chartsTransition') chartsTransition: TransitionGroupComponent;
|
||||||
|
|
||||||
public isFullscreen: boolean = false;
|
public isFullscreen: boolean = false;
|
||||||
|
|
||||||
|
@ -119,10 +124,10 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple
|
||||||
constructor(private layoutService: LayoutService,
|
constructor(private layoutService: LayoutService,
|
||||||
private stakeholderService: StakeholderService,
|
private stakeholderService: StakeholderService,
|
||||||
private statisticsService: StatisticsService,
|
private statisticsService: StatisticsService,
|
||||||
|
private statsProfileService: StatsProfilesService,
|
||||||
private notificationService: NotificationService,
|
private notificationService: NotificationService,
|
||||||
private fb: UntypedFormBuilder,
|
private fb: UntypedFormBuilder,
|
||||||
protected _router: Router,
|
protected _router: Router,
|
||||||
private cdr: ChangeDetectorRef,
|
|
||||||
private sanitizer: DomSanitizer) {
|
private sanitizer: DomSanitizer) {
|
||||||
super()
|
super()
|
||||||
this.filesToUpload = [];
|
this.filesToUpload = [];
|
||||||
|
@ -137,7 +142,16 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple
|
||||||
this.setCharts();
|
this.setCharts();
|
||||||
this.setNumbers();
|
this.setNumbers();
|
||||||
this.initReorder();
|
this.initReorder();
|
||||||
})
|
});
|
||||||
|
if (this.isCurator) {
|
||||||
|
this.subscriptions.push(this.statsProfileService.getStatsProfiles().subscribe(statsProfiles => {
|
||||||
|
this.statsProfiles = [null].concat(statsProfiles);
|
||||||
|
}, error => {
|
||||||
|
this.statsProfiles = [];
|
||||||
|
}));
|
||||||
|
} else {
|
||||||
|
this.statsProfiles = [];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnDestroy(): void {
|
ngOnDestroy(): void {
|
||||||
|
@ -175,7 +189,7 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
if (document !== undefined) {
|
if (document !== undefined) {
|
||||||
let callback = (list, type: IndicatorType, action: 'moved' | 'added' | 'removed'): void => {
|
let callback = (list): string[] => {
|
||||||
let items: HTMLCollection = list.current.children;
|
let items: HTMLCollection = list.current.children;
|
||||||
let reordered = [];
|
let reordered = [];
|
||||||
for (let i = 0; i < items.length; i++) {
|
for (let i = 0; i < items.length; i++) {
|
||||||
|
@ -183,12 +197,7 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple
|
||||||
reordered.push(items.item(i).id);
|
reordered.push(items.item(i).id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
let reorder: Reorder = {
|
return reordered;
|
||||||
action: action,
|
|
||||||
target: list.detail[1].id,
|
|
||||||
ids: reordered
|
|
||||||
}
|
|
||||||
this.reorderIndicators(list.current.id.toString().split('-')[1], type, reorder);
|
|
||||||
};
|
};
|
||||||
this.numbers.forEach((section) => {
|
this.numbers.forEach((section) => {
|
||||||
this.subscriptions.push(UIkit.util.on(document, 'start', '#number-' + section._id, (): void => {
|
this.subscriptions.push(UIkit.util.on(document, 'start', '#number-' + section._id, (): void => {
|
||||||
|
@ -198,24 +207,32 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple
|
||||||
this.dragging = false;
|
this.dragging = false;
|
||||||
}));
|
}));
|
||||||
this.subscriptions.push(UIkit.util.on(document, 'moved', '#number-' + section._id, (list): void => {
|
this.subscriptions.push(UIkit.util.on(document, 'moved', '#number-' + section._id, (list): void => {
|
||||||
callback(list, "number", 'moved');
|
this.reorderIndicators(section._id, 'number', callback(list));
|
||||||
}));
|
}));
|
||||||
this.subscriptions.push(UIkit.util.on(document, 'added', '#number-' + section._id, (list): void => {
|
this.subscriptions.push(UIkit.util.on(document, 'added', '#number-' + section._id, (list): void => {
|
||||||
callback(list, "number", 'added');
|
this.to.next({id: section._id, indicators: callback(list)});
|
||||||
}));
|
}));
|
||||||
this.subscriptions.push(UIkit.util.on(document, 'removed', '#number-' + section._id, (list): void => {
|
this.subscriptions.push(UIkit.util.on(document, 'removed', '#number-' + section._id, (list): void => {
|
||||||
callback(list, "number", 'removed');
|
let sub = this.to.asObservable().subscribe(to => {
|
||||||
|
if (to) {
|
||||||
|
let from: SectionInfo = {id: section._id, indicators: callback(list)};
|
||||||
|
this.moveIndicator({target: list.detail[1].id, from: from, to: to});
|
||||||
|
setTimeout(() => {
|
||||||
|
sub.unsubscribe();
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
}));
|
}));
|
||||||
});
|
});
|
||||||
this.charts.forEach((section) => {
|
this.charts.forEach((section) => {
|
||||||
this.subscriptions.push(UIkit.util.on(document, 'moved', '#chart-' + section._id, (list): void => {
|
this.subscriptions.push(UIkit.util.on(document, 'moved', '#chart-' + section._id, (list): void => {
|
||||||
callback(list, "chart", 'moved');
|
this.reorderIndicators(section._id, 'chart', callback(list));
|
||||||
}));
|
}));
|
||||||
this.subscriptions.push(UIkit.util.on(document, 'added', '#chart-' + section._id, (list): void => {
|
this.subscriptions.push(UIkit.util.on(document, 'added', '#chart-' + section._id, (list): void => {
|
||||||
callback(list, "chart", 'added');
|
//callback(list, "chart", 'added');
|
||||||
}));
|
}));
|
||||||
this.subscriptions.push(UIkit.util.on(document, 'removed', '#chart-' + section._id, (list): void => {
|
this.subscriptions.push(UIkit.util.on(document, 'removed', '#chart-' + section._id, (list): void => {
|
||||||
callback(list, "chart", 'removed');
|
// callback(list, "chart", 'removed');
|
||||||
}));
|
}));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -252,7 +269,7 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple
|
||||||
setNumbers() {
|
setNumbers() {
|
||||||
this.numberSections = this.fb.array([]);
|
this.numberSections = this.fb.array([]);
|
||||||
this.numberResults.clear();
|
this.numberResults.clear();
|
||||||
let urls: Map<string, [number, number][]> = new Map<string, [number, number][]>();
|
let urls: Map<string, [number, number, number][]> = new Map<string, [number, number, number][]>();
|
||||||
this.numbers.forEach((section, i) => {
|
this.numbers.forEach((section, i) => {
|
||||||
this.numberSections.push(this.fb.group({
|
this.numberSections.push(this.fb.group({
|
||||||
_id: this.fb.control(section._id),
|
_id: this.fb.control(section._id),
|
||||||
|
@ -264,13 +281,15 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple
|
||||||
indicators: this.fb.control(section.indicators)
|
indicators: this.fb.control(section.indicators)
|
||||||
}));
|
}));
|
||||||
section.indicators.forEach((number, j) => {
|
section.indicators.forEach((number, j) => {
|
||||||
let url = this.indicatorUtils.getFullUrl(this.stakeholder, number.indicatorPaths[0]);
|
number.indicatorPaths.forEach((indicatorPath, k) => {
|
||||||
const pair = JSON.stringify([number.indicatorPaths[0].source, url]);
|
let url = this.indicatorUtils.getFullUrl(this.stakeholder, indicatorPath);
|
||||||
|
const pair = JSON.stringify([indicatorPath.source, url]);
|
||||||
const indexes = urls.get(pair) ? urls.get(pair) : [];
|
const indexes = urls.get(pair) ? urls.get(pair) : [];
|
||||||
indexes.push([i, j]);
|
indexes.push([i, j, k]);
|
||||||
urls.set(pair, indexes);
|
urls.set(pair, indexes);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
});
|
||||||
this.numberSubscription.forEach(value => {
|
this.numberSubscription.forEach(value => {
|
||||||
if (value instanceof Subscriber) {
|
if (value instanceof Subscriber) {
|
||||||
value.unsubscribe();
|
value.unsubscribe();
|
||||||
|
@ -290,10 +309,10 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private calculateResults(response: any, indexes: [number, number][]) {
|
private calculateResults(response: any, indexes: [number, number, number][]) {
|
||||||
indexes.forEach(([i, j]) => {
|
indexes.forEach(([i, j, k]) => {
|
||||||
let result = JSON.parse(JSON.stringify(response));
|
let result = JSON.parse(JSON.stringify(response));
|
||||||
this.numbers[i].indicators[j].indicatorPaths[0].jsonPath.forEach(jsonPath => {
|
this.numbers[i].indicators[j].indicatorPaths[k].jsonPath.forEach(jsonPath => {
|
||||||
if (result) {
|
if (result) {
|
||||||
result = result[jsonPath];
|
result = result[jsonPath];
|
||||||
}
|
}
|
||||||
|
@ -306,7 +325,7 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple
|
||||||
} else {
|
} else {
|
||||||
result = 0;
|
result = 0;
|
||||||
}
|
}
|
||||||
this.numberResults.set(i + '-' + j, result);
|
this.numberResults.set(i + '-' + j + '-' + k, result);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -342,7 +361,7 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple
|
||||||
return this.stakeholder &&
|
return this.stakeholder &&
|
||||||
this.stakeholder.topics[this.topicIndex] &&
|
this.stakeholder.topics[this.topicIndex] &&
|
||||||
this.stakeholder.topics[this.topicIndex].categories[this.categoryIndex] &&
|
this.stakeholder.topics[this.topicIndex].categories[this.categoryIndex] &&
|
||||||
this.stakeholder.topics[this.topicIndex].categories[this.categoryIndex].subCategories[this.subcategoryIndex];
|
this.stakeholder.topics[this.topicIndex].categories[this.categoryIndex].subCategories[this.subcategoryIndex] && !this.loading;
|
||||||
}
|
}
|
||||||
|
|
||||||
public get numberIndicatorPaths(): UntypedFormArray {
|
public get numberIndicatorPaths(): UntypedFormArray {
|
||||||
|
@ -353,6 +372,14 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple
|
||||||
return this.chartIndicatorFb.get('indicatorPaths') as UntypedFormArray;
|
return this.chartIndicatorFb.get('indicatorPaths') as UntypedFormArray;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public getActiveIndicatorPath(indicator: Indicator) {
|
||||||
|
if (indicator.activePath) {
|
||||||
|
return indicator.indicatorPaths[indicator.activePath];
|
||||||
|
} else {
|
||||||
|
return indicator.indicatorPaths[0];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public getNumberClassBySize(size: IndicatorSize) {
|
public getNumberClassBySize(size: IndicatorSize) {
|
||||||
if (size === 'small') {
|
if (size === 'small') {
|
||||||
return 'uk-width-medium@m uk-width-1-1';
|
return 'uk-width-medium@m uk-width-1-1';
|
||||||
|
@ -400,7 +427,7 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple
|
||||||
this.getJsonPath(index).disable();
|
this.getJsonPath(index).disable();
|
||||||
}
|
}
|
||||||
indicatorPath.get('result').setErrors({validating: true});
|
indicatorPath.get('result').setErrors({validating: true});
|
||||||
this.subscriptions.push(this.statisticsService.getNumbers(null, indicatorPath.get('url').value).subscribe(response => {
|
this.subscriptions.push(this.statisticsService.getNumbers(indicatorPath.get('source').value, this.indicatorUtils.getFullUrl(this.stakeholder, this.indicator.indicatorPaths[index])).subscribe(response => {
|
||||||
let result = JSON.parse(JSON.stringify(response));
|
let result = JSON.parse(JSON.stringify(response));
|
||||||
this.getJsonPath(index).controls.forEach(jsonPath => {
|
this.getJsonPath(index).controls.forEach(jsonPath => {
|
||||||
if (result) {
|
if (result) {
|
||||||
|
@ -448,12 +475,16 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple
|
||||||
return this.section.indicators[this.index].indicatorPaths[index].jsonPath;
|
return this.section.indicators[this.index].indicatorPaths[index].jsonPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
public getParameters(index: number): UntypedFormArray {
|
public getParameters(index: number, type: IndicatorType = 'chart'): UntypedFormArray {
|
||||||
|
if (type === 'chart') {
|
||||||
return this.chartIndicatorPaths.at(index).get('parameters') as UntypedFormArray;
|
return this.chartIndicatorPaths.at(index).get('parameters') as UntypedFormArray;
|
||||||
|
} else {
|
||||||
|
return this.numberIndicatorPaths.at(index).get('parameters') as UntypedFormArray;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public getParameter(index: number, key: string): UntypedFormControl {
|
public getParameter(index: number, key: string, type: IndicatorType = 'chart'): UntypedFormControl {
|
||||||
return this.getParameters(index).controls.filter(control => control.value.key === key)[0] as UntypedFormControl;
|
return this.getParameters(index, type).controls.filter(control => control.value.key === key)[0] as UntypedFormControl;
|
||||||
}
|
}
|
||||||
|
|
||||||
private getSecureUrlByStakeHolder(indicatorPath: IndicatorPath) {
|
private getSecureUrlByStakeHolder(indicatorPath: IndicatorPath) {
|
||||||
|
@ -474,30 +505,19 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple
|
||||||
jsonPath: jsonPath,
|
jsonPath: jsonPath,
|
||||||
result: this.fb.control(0, Validators.required),
|
result: this.fb.control(0, Validators.required),
|
||||||
source: this.fb.control(source, Validators.required),
|
source: this.fb.control(source, Validators.required),
|
||||||
|
parameters: parameters,
|
||||||
format: this.fb.control(format, Validators.required)
|
format: this.fb.control(format, Validators.required)
|
||||||
}
|
}
|
||||||
));
|
));
|
||||||
let index = this.numberIndicatorPaths.length - 1;
|
let index = this.numberIndicatorPaths.length - 1;
|
||||||
if (this.numberIndicatorPaths.at(index).get('url').valid) {
|
if (this.numberIndicatorPaths.at(index).get('url').valid) {
|
||||||
this.validateJsonPath(index);
|
this.validateJsonPath(index);
|
||||||
this.checkForSchemaEnhancements(this.numberIndicatorPaths.at(index).get('url').value);
|
|
||||||
}
|
}
|
||||||
if (this.indicator.defaultId === null) {
|
if (this.indicator.defaultId === null) {
|
||||||
this.subscriptions.push(this.numberIndicatorPaths.at(index).get('url').valueChanges.subscribe(value => {
|
this.subscriptions.push(this.numberIndicatorPaths.at(index).get('url').valueChanges.subscribe(value => {
|
||||||
this.numberIndicatorPaths.at(index).get('result').setValue(null);
|
this.numberIndicatorPaths.at(index).get('result').setValue(null);
|
||||||
if (this.numberIndicatorPaths.at(index).get('url').valid) {
|
if (this.numberIndicatorPaths.at(index).get('url').valid) {
|
||||||
let indicatorPath: IndicatorPath = this.indicatorUtils.generateIndicatorByNumberUrl(this.indicatorUtils.getNumberSource(value), value, this.stakeholder, this.numberIndicatorPaths.at(index).get('jsonPath').value, this.indicatorUtils.numberSources.get(this.indicatorUtils.getNumberSource(value)));
|
let indicatorPath: IndicatorPath = this.indicatorUtils.generateIndicatorByNumberUrl(this.indicatorUtils.getNumberSource(value), value, this.stakeholder, this.numberIndicatorPaths.at(index).get('jsonPath').value, this.indicatorUtils.numberSources.get(this.indicatorUtils.getNumberSource(value)));
|
||||||
if (!this.isStakeholderParametersValid(indicatorPath)) {
|
|
||||||
// default profile
|
|
||||||
if (this.stakeholder.defaultId == null) {
|
|
||||||
this.urlParameterizedMessage = "This indicator couldn't be generated properly. Stakeholders based on this profile may not inherit the data correctly."
|
|
||||||
} else {
|
|
||||||
this.urlParameterizedMessage = "This indicator couldn't be generated properly. Please make sure chart data is for the current stakeholder."
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
this.urlParameterizedMessage = null;
|
|
||||||
}
|
|
||||||
this.checkForSchemaEnhancements(this.numberIndicatorPaths.at(index).get('url').value);
|
|
||||||
if (this.indicator.indicatorPaths[index]) {
|
if (this.indicator.indicatorPaths[index]) {
|
||||||
this.indicator.indicatorPaths[index] = indicatorPath;
|
this.indicator.indicatorPaths[index] = indicatorPath;
|
||||||
} else {
|
} else {
|
||||||
|
@ -506,6 +526,7 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple
|
||||||
if (indicatorPath.source) {
|
if (indicatorPath.source) {
|
||||||
this.numberIndicatorPaths.at(index).get('source').setValue(indicatorPath.source);
|
this.numberIndicatorPaths.at(index).get('source').setValue(indicatorPath.source);
|
||||||
}
|
}
|
||||||
|
(this.numberIndicatorPaths.at(index) as UntypedFormGroup).setControl('parameters', this.getParametersAsFormArray(indicatorPath));
|
||||||
if (indicatorPath.jsonPath.length > 1 && this.getJsonPath(index).length == 1) {
|
if (indicatorPath.jsonPath.length > 1 && this.getJsonPath(index).length == 1) {
|
||||||
let paths = indicatorPath.jsonPath;
|
let paths = indicatorPath.jsonPath;
|
||||||
for (let i = 0; i < paths.length; i++) {
|
for (let i = 0; i < paths.length; i++) {
|
||||||
|
@ -515,8 +536,6 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple
|
||||||
}
|
}
|
||||||
this.getJsonPath(index).setValue(paths)
|
this.getJsonPath(index).setValue(paths)
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
this.urlParameterizedMessage = null;
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
@ -552,24 +571,11 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple
|
||||||
if (disableUrl) {
|
if (disableUrl) {
|
||||||
this.chartIndicatorPaths.at(index).get('url').disable();
|
this.chartIndicatorPaths.at(index).get('url').disable();
|
||||||
} else {
|
} else {
|
||||||
this.checkForSchemaEnhancements(this.chartIndicatorPaths.at(index).get('url').value);
|
|
||||||
this.urlSubscriptions.push(this.chartIndicatorPaths.at(index).get('url').valueChanges.subscribe(value => {
|
this.urlSubscriptions.push(this.chartIndicatorPaths.at(index).get('url').valueChanges.subscribe(value => {
|
||||||
if (this.chartIndicatorPaths.at(index).get('url').valid) {
|
if (this.chartIndicatorPaths.at(index).get('url').valid) {
|
||||||
let indicatorPath: IndicatorPath = this.indicatorUtils.generateIndicatorByChartUrl(this.indicatorUtils.getChartSource(value), value, this.chartIndicatorPaths.at(index).get('type').value, this.stakeholder);
|
let indicatorPath: IndicatorPath = this.indicatorUtils.generateIndicatorByChartUrl(this.indicatorUtils.getChartSource(value), value, this.chartIndicatorPaths.at(index).get('type').value, this.stakeholder);
|
||||||
if (!this.isStakeholderParametersValid(indicatorPath)) {
|
|
||||||
// default profile
|
|
||||||
if (this.stakeholder.defaultId == null) {
|
|
||||||
this.urlParameterizedMessage = "This chart couldn't be generated properly. Stakeholders based on this profile may not inherit the data correctly."
|
|
||||||
} else {
|
|
||||||
this.urlParameterizedMessage = "This chart couldn't be generated properly. Please make sure chart data is for the current stakeholder."
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
this.urlParameterizedMessage = null;
|
|
||||||
}
|
|
||||||
this.checkForSchemaEnhancements(this.chartIndicatorPaths.at(index).get('url').value);
|
|
||||||
(this.chartIndicatorPaths.at(index) as UntypedFormGroup).get('type').setValue(indicatorPath.type);
|
(this.chartIndicatorPaths.at(index) as UntypedFormGroup).get('type').setValue(indicatorPath.type);
|
||||||
let parameters = this.getParametersAsFormArray(indicatorPath);
|
(this.chartIndicatorPaths.at(index) as UntypedFormGroup).setControl('parameters', this.getParametersAsFormArray(indicatorPath));
|
||||||
(this.chartIndicatorPaths.at(index) as UntypedFormGroup).setControl('parameters', parameters);
|
|
||||||
if (!this.indicator.indicatorPaths[index]) {
|
if (!this.indicator.indicatorPaths[index]) {
|
||||||
this.indicator.indicatorPaths[index] = indicatorPath;
|
this.indicator.indicatorPaths[index] = indicatorPath;
|
||||||
this.indicator.indicatorPaths[index].safeResourceUrl = this.getSecureUrlByStakeHolder(indicatorPath);
|
this.indicator.indicatorPaths[index].safeResourceUrl = this.getSecureUrlByStakeHolder(indicatorPath);
|
||||||
|
@ -577,17 +583,73 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple
|
||||||
indicatorPath.safeResourceUrl = this.indicator.indicatorPaths[index].safeResourceUrl;
|
indicatorPath.safeResourceUrl = this.indicator.indicatorPaths[index].safeResourceUrl;
|
||||||
this.indicator.indicatorPaths[index] = indicatorPath;
|
this.indicator.indicatorPaths[index] = indicatorPath;
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
this.urlParameterizedMessage = null;
|
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private isStakeholderParametersValid(indicatorPath: IndicatorPath) {
|
public removeNumberIndicatorPath(index: number) {
|
||||||
return !((indicatorPath.chartObject && Object.keys(indicatorPath.parameters).indexOf("index_id") == -1 && Object.keys(indicatorPath.parameters).indexOf("index_name") == -1 && Object.keys(indicatorPath.parameters).indexOf("index_shortName") == -1)
|
this.numberIndicatorPaths.removeAt(index);
|
||||||
|| (!indicatorPath.chartObject && indicatorPath.url.indexOf("index_id") == -1 && indicatorPath.url.indexOf("index_name") == -1 && (indicatorPath.url).indexOf("index_shortName") == -1));
|
this.indicator.indicatorPaths.splice(index, 1);
|
||||||
|
this.numbersTransition.init();
|
||||||
|
if (this.indicator.activePath === index) {
|
||||||
|
this.activeNumberIndicatorPath(Math.max(0, index - 1));
|
||||||
|
} else if (this.indicator.activePath > index) {
|
||||||
|
this.activeNumberIndicatorPath(this.indicator.activePath - 1);
|
||||||
|
}
|
||||||
|
this.numberIndicatorFb.markAsDirty();
|
||||||
|
}
|
||||||
|
|
||||||
|
public removeChartIndicatorPath(index: number) {
|
||||||
|
this.chartIndicatorPaths.removeAt(index);
|
||||||
|
this.indicator.indicatorPaths.splice(index, 1);
|
||||||
|
this.chartsTransition.init();
|
||||||
|
if (this.indicator.activePath === index) {
|
||||||
|
this.activeChartIndicatorPath(Math.max(0, index - 1));
|
||||||
|
} else if (this.indicator.activePath > index) {
|
||||||
|
this.activeChartIndicatorPath(this.indicator.activePath - 1);
|
||||||
|
}
|
||||||
|
this.chartIndicatorFb.markAsDirty();
|
||||||
|
}
|
||||||
|
|
||||||
|
public moveIndicatorPath(form: FormGroup,
|
||||||
|
type: 'number' | 'chart', index: number,
|
||||||
|
newIndex: number = index - 1) {
|
||||||
|
let indicatorPaths = type == 'number'?this.numberIndicatorPaths:this.chartIndicatorPaths;
|
||||||
|
if(type == 'number') {
|
||||||
|
this.numbersTransition.init();
|
||||||
|
} else {
|
||||||
|
this.chartsTransition.init();
|
||||||
|
}
|
||||||
|
let a = indicatorPaths.at(index);
|
||||||
|
let b = indicatorPaths.at(newIndex);
|
||||||
|
indicatorPaths.setControl(index, b);
|
||||||
|
indicatorPaths.setControl(newIndex, a);
|
||||||
|
HelperFunctions.swap(this.indicator.indicatorPaths, index, newIndex);
|
||||||
|
if (this.indicator.activePath === index) {
|
||||||
|
this.indicator.activePath = newIndex;
|
||||||
|
} else if (this.indicator.activePath === newIndex) {
|
||||||
|
this.indicator.activePath = index;
|
||||||
|
}
|
||||||
|
form.markAsDirty();
|
||||||
|
}
|
||||||
|
|
||||||
|
public activeNumberIndicatorPath(index: number) {
|
||||||
|
let paths = this.numberIndicatorPaths;
|
||||||
|
if (index == paths.length) {
|
||||||
|
this.addNumberIndicatorPath();
|
||||||
|
this.numbersTransition.init();
|
||||||
|
}
|
||||||
|
this.indicator.activePath = index;
|
||||||
|
}
|
||||||
|
|
||||||
|
public activeChartIndicatorPath(index: number) {
|
||||||
|
let paths = this.chartIndicatorPaths;
|
||||||
|
if (index == paths.length) {
|
||||||
|
this.addChartIndicatorPath();
|
||||||
|
this.chartsTransition.init();
|
||||||
|
}
|
||||||
|
this.indicator.activePath = index;
|
||||||
}
|
}
|
||||||
|
|
||||||
private getJsonPathAsFormArray(indicatorPath: IndicatorPath): UntypedFormArray {
|
private getJsonPathAsFormArray(indicatorPath: IndicatorPath): UntypedFormArray {
|
||||||
|
@ -603,6 +665,9 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple
|
||||||
private getParametersAsFormArray(indicatorPath: IndicatorPath): UntypedFormArray {
|
private getParametersAsFormArray(indicatorPath: IndicatorPath): UntypedFormArray {
|
||||||
let parameters = this.fb.array([]);
|
let parameters = this.fb.array([]);
|
||||||
if (indicatorPath.parameters) {
|
if (indicatorPath.parameters) {
|
||||||
|
if(!indicatorPath.parameters.statsProfile) {
|
||||||
|
indicatorPath.parameters.statsProfile = null;
|
||||||
|
}
|
||||||
Object.keys(indicatorPath.parameters).forEach(key => {
|
Object.keys(indicatorPath.parameters).forEach(key => {
|
||||||
if (this.indicatorUtils.ignoredParameters.indexOf(key) === -1) {
|
if (this.indicatorUtils.ignoredParameters.indexOf(key) === -1) {
|
||||||
if (this.indicatorUtils.parametersValidators.has(key)) {
|
if (this.indicatorUtils.parametersValidators.has(key)) {
|
||||||
|
@ -623,7 +688,21 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple
|
||||||
}
|
}
|
||||||
|
|
||||||
public editNumberIndicatorOpen(section: Section, id = null) {
|
public editNumberIndicatorOpen(section: Section, id = null) {
|
||||||
this.urlParameterizedMessage = null;
|
this.editNumberModal.cancelButtonText = 'Cancel';
|
||||||
|
this.editNumberModal.okButtonLeft = false;
|
||||||
|
this.editNumberModal.alertMessage = false;
|
||||||
|
if (this.index === -1) {
|
||||||
|
this.editNumberModal.alertTitle = 'Create a new number indicator';
|
||||||
|
this.editNumberModal.okButtonText = 'Save';
|
||||||
|
this.notification = NotificationUtils.createIndicator(this.user.firstname + ' ' + this.user.lastname, this.stakeholder.name);
|
||||||
|
this.editNumberNotify.reset(this.notification.message);
|
||||||
|
} else {
|
||||||
|
this.editNumberModal.alertTitle = 'Edit number indicator\'s information';
|
||||||
|
this.editNumberModal.okButtonText = 'Save Changes';
|
||||||
|
this.notification = NotificationUtils.editIndicator(this.user.firstname + ' ' + this.user.lastname, this.stakeholder.name);
|
||||||
|
this.editNumberNotify.reset(this.notification.message);
|
||||||
|
}
|
||||||
|
this.editNumberModal.stayOpen = true;
|
||||||
this.section = section;
|
this.section = section;
|
||||||
this.index = (id) ? section.indicators.findIndex(value => value._id === id) : -1;
|
this.index = (id) ? section.indicators.findIndex(value => value._id === id) : -1;
|
||||||
if (this.index !== -1) {
|
if (this.index !== -1) {
|
||||||
|
@ -642,7 +721,7 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple
|
||||||
defaultId: this.fb.control(this.indicator.defaultId)
|
defaultId: this.fb.control(this.indicator.defaultId)
|
||||||
});
|
});
|
||||||
this.indicator.indicatorPaths.forEach(indicatorPath => {
|
this.indicator.indicatorPaths.forEach(indicatorPath => {
|
||||||
this.addNumberIndicatorPath(this.indicatorUtils.getNumberUrl(indicatorPath.source, this.indicatorUtils.getFullUrl(this.stakeholder, indicatorPath)), indicatorPath.parameters, indicatorPath.source, this.getJsonPathAsFormArray(indicatorPath), indicatorPath.format);
|
this.addNumberIndicatorPath(this.indicatorUtils.getNumberUrl(indicatorPath.source, this.indicatorUtils.getFullUrl(this.stakeholder, indicatorPath)), this.getParametersAsFormArray(indicatorPath), indicatorPath.source, this.getJsonPathAsFormArray(indicatorPath), indicatorPath.format);
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
this.indicator = new Indicator('', '', '', 'number', 'small', 'small', "PUBLIC", []);
|
this.indicator = new Indicator('', '', '', 'number', 'small', 'small', "PUBLIC", []);
|
||||||
|
@ -665,26 +744,26 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple
|
||||||
this.numberIndicatorFb.get('description').disable();
|
this.numberIndicatorFb.get('description').disable();
|
||||||
}, 0);
|
}, 0);
|
||||||
}
|
}
|
||||||
this.editNumberModal.cancelButtonText = 'Cancel';
|
|
||||||
this.editNumberModal.okButtonLeft = false;
|
|
||||||
this.editNumberModal.alertMessage = false;
|
|
||||||
if (this.index === -1) {
|
|
||||||
this.editNumberModal.alertTitle = 'Create a new number indicator';
|
|
||||||
this.editNumberModal.okButtonText = 'Save';
|
|
||||||
this.notification = NotificationUtils.createIndicator(this.user.firstname + ' ' + this.user.lastname, this.stakeholder.name);
|
|
||||||
this.editNumberNotify.reset(this.notification.message);
|
|
||||||
} else {
|
|
||||||
this.editNumberModal.alertTitle = 'Edit number indicator\'s information';
|
|
||||||
this.editNumberModal.okButtonText = 'Save Changes';
|
|
||||||
this.notification = NotificationUtils.editIndicator(this.user.firstname + ' ' + this.user.lastname, this.stakeholder.name);
|
|
||||||
this.editNumberNotify.reset(this.notification.message);
|
|
||||||
}
|
|
||||||
this.editNumberModal.stayOpen = true;
|
|
||||||
this.editNumberModal.open();
|
this.editNumberModal.open();
|
||||||
}
|
}
|
||||||
|
|
||||||
public editChartIndicatorOpen(section: Section, id = null) {
|
public editChartIndicatorOpen(section: Section, id = null) {
|
||||||
this.urlParameterizedMessage = null;
|
this.editChartModal.cancelButtonText = 'Cancel';
|
||||||
|
this.editChartModal.okButtonLeft = false;
|
||||||
|
this.editChartModal.alertMessage = false;
|
||||||
|
if (this.index === -1) {
|
||||||
|
this.editChartModal.alertTitle = 'Create a new chart indicator';
|
||||||
|
this.editChartModal.okButtonText = 'Save';
|
||||||
|
this.notification = NotificationUtils.createIndicator(this.user.firstname + ' ' + this.user.lastname, this.stakeholder.name);
|
||||||
|
this.editChartNotify.reset(this.notification.message);
|
||||||
|
} else {
|
||||||
|
this.editChartModal.alertTitle = 'Edit chart indicator\'s information';
|
||||||
|
this.editChartModal.okButtonText = 'Save Changes';
|
||||||
|
this.notification = NotificationUtils.editIndicator(this.user.firstname + ' ' + this.user.lastname, this.stakeholder.name);
|
||||||
|
;
|
||||||
|
this.editChartNotify.reset(this.notification.message);
|
||||||
|
}
|
||||||
|
this.editChartModal.stayOpen = true;
|
||||||
this.urlSubscriptions.forEach(value => {
|
this.urlSubscriptions.forEach(value => {
|
||||||
if (value instanceof Subscriber) {
|
if (value instanceof Subscriber) {
|
||||||
value.unsubscribe();
|
value.unsubscribe();
|
||||||
|
@ -731,22 +810,6 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple
|
||||||
this.chartIndicatorFb.get('description').disable();
|
this.chartIndicatorFb.get('description').disable();
|
||||||
}, 0);
|
}, 0);
|
||||||
}
|
}
|
||||||
this.editChartModal.cancelButtonText = 'Cancel';
|
|
||||||
this.editChartModal.okButtonLeft = false;
|
|
||||||
this.editChartModal.alertMessage = false;
|
|
||||||
if (this.index === -1) {
|
|
||||||
this.editChartModal.alertTitle = 'Create a new chart indicator';
|
|
||||||
this.editChartModal.okButtonText = 'Save';
|
|
||||||
this.notification = NotificationUtils.createIndicator(this.user.firstname + ' ' + this.user.lastname, this.stakeholder.name);
|
|
||||||
this.editChartNotify.reset(this.notification.message);
|
|
||||||
} else {
|
|
||||||
this.editChartModal.alertTitle = 'Edit chart indicator\'s information';
|
|
||||||
this.editChartModal.okButtonText = 'Save Changes';
|
|
||||||
this.notification = NotificationUtils.editIndicator(this.user.firstname + ' ' + this.user.lastname, this.stakeholder.name);
|
|
||||||
;
|
|
||||||
this.editChartNotify.reset(this.notification.message);
|
|
||||||
}
|
|
||||||
this.editChartModal.stayOpen = true;
|
|
||||||
this.editChartModal.open();
|
this.editChartModal.open();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -754,11 +817,11 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple
|
||||||
this.editing = true;
|
this.editing = true;
|
||||||
if (this.indicator.type === 'chart') {
|
if (this.indicator.type === 'chart') {
|
||||||
this.chartIndicatorFb.get('description').enable();
|
this.chartIndicatorFb.get('description').enable();
|
||||||
this.indicator = this.indicatorUtils.generateIndicatorByForm(this.chartIndicatorFb.value, this.indicator.indicatorPaths, this.indicator.type, true);
|
this.indicator = this.indicatorUtils.generateIndicatorByForm(this.chartIndicatorFb.value, this.indicator.indicatorPaths, this.indicator.type);
|
||||||
this.section = this.charts.find(section => section._id === this.section._id);
|
this.section = this.charts.find(section => section._id === this.section._id);
|
||||||
} else {
|
} else {
|
||||||
this.numberIndicatorFb.get('description').enable();
|
this.numberIndicatorFb.get('description').enable();
|
||||||
this.indicator = this.indicatorUtils.generateIndicatorByForm(this.numberIndicatorFb.value, this.indicator.indicatorPaths, this.indicator.type, false);
|
this.indicator = this.indicatorUtils.generateIndicatorByForm(this.numberIndicatorFb.value, this.indicator.indicatorPaths, this.indicator.type);
|
||||||
this.section = this.numbers.find(section => section._id === this.section._id);
|
this.section = this.numbers.find(section => section._id === this.section._id);
|
||||||
}
|
}
|
||||||
let path = [
|
let path = [
|
||||||
|
@ -883,20 +946,39 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.editing = false;
|
this.finish();
|
||||||
this.importLoading = false;
|
|
||||||
NotificationHandler.rise('Indicators have been <b>imported</b> successfully!');
|
NotificationHandler.rise('Indicators have been <b>imported</b> successfully!');
|
||||||
}, error => {
|
}, error => {
|
||||||
this.chartIndicatorFb = null;
|
this.chartIndicatorFb = null;
|
||||||
NotificationHandler.rise('An error has occurred. Please try again later', 'danger');
|
NotificationHandler.rise('An error has occurred. Please try again later', 'danger');
|
||||||
this.editing = false;
|
this.finish();
|
||||||
this.importLoading = false;
|
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
reorderIndicators(sectionId: string, type: IndicatorType, reorder: Reorder) {
|
finish() {
|
||||||
|
this.editing = false;
|
||||||
|
this.loading = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
moveIndicator(moveIndicator: MoveIndicator) {
|
||||||
|
this.editing = true;
|
||||||
|
let path = [
|
||||||
|
this.stakeholder._id,
|
||||||
|
this.stakeholder.topics[this.topicIndex]._id,
|
||||||
|
this.stakeholder.topics[this.topicIndex].categories[this.categoryIndex]._id,
|
||||||
|
this.stakeholder.topics[this.topicIndex].categories[this.categoryIndex].subCategories[this.subcategoryIndex]._id
|
||||||
|
];
|
||||||
|
this.subscriptions.push(this.stakeholderService.moveIndicator(this.properties.monitorServiceAPIURL, path, moveIndicator).subscribe(subCategory => {
|
||||||
|
this.stakeholder.topics[this.topicIndex].categories[this.categoryIndex].subCategories[this.subcategoryIndex] = subCategory;
|
||||||
|
this.setCharts();
|
||||||
|
this.setNumbers();
|
||||||
|
this.editing = false;
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
|
||||||
|
reorderIndicators(sectionId: string, type: IndicatorType, indicators: string[]) {
|
||||||
this.editing = true;
|
this.editing = true;
|
||||||
let path = [
|
let path = [
|
||||||
this.stakeholder._id,
|
this.stakeholder._id,
|
||||||
|
@ -905,7 +987,7 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple
|
||||||
this.stakeholder.topics[this.topicIndex].categories[this.categoryIndex].subCategories[this.subcategoryIndex]._id,
|
this.stakeholder.topics[this.topicIndex].categories[this.categoryIndex].subCategories[this.subcategoryIndex]._id,
|
||||||
sectionId
|
sectionId
|
||||||
];
|
];
|
||||||
this.subscriptions.push(this.stakeholderService.reorderIndicators(this.properties.monitorServiceAPIURL, path, reorder, type).subscribe(indicators => {
|
this.subscriptions.push(this.stakeholderService.reorderIndicators(this.properties.monitorServiceAPIURL, path, indicators).subscribe(indicators => {
|
||||||
if (type === 'chart') {
|
if (type === 'chart') {
|
||||||
this.charts.find(section => section._id === sectionId).indicators = indicators;
|
this.charts.find(section => section._id === sectionId).indicators = indicators;
|
||||||
this.setCharts();
|
this.setCharts();
|
||||||
|
@ -917,9 +999,10 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
hasDifference(index: number): boolean {
|
hasDifference(index: number, type: IndicatorType = 'chart'): boolean {
|
||||||
let hasDifference = false;
|
let hasDifference = false;
|
||||||
this.chartIndicatorPaths.at(index).value.parameters.forEach((parameter) => {
|
if (type === 'chart') {
|
||||||
|
this.chartIndicatorPaths.at(index).value.parameters.forEach(parameter => {
|
||||||
if (parameter.value !== this.indicator.indicatorPaths[index].parameters[parameter.key]) {
|
if (parameter.value !== this.indicator.indicatorPaths[index].parameters[parameter.key]) {
|
||||||
hasDifference = true;
|
hasDifference = true;
|
||||||
return;
|
return;
|
||||||
|
@ -927,6 +1010,16 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple
|
||||||
});
|
});
|
||||||
return hasDifference || this.indicator.indicatorPaths[index].safeResourceUrl.toString() !==
|
return hasDifference || this.indicator.indicatorPaths[index].safeResourceUrl.toString() !==
|
||||||
this.getSecureUrlByStakeHolder(this.indicator.indicatorPaths[index]).toString();
|
this.getSecureUrlByStakeHolder(this.indicator.indicatorPaths[index]).toString();
|
||||||
|
} else if (type === 'number') {
|
||||||
|
let indicatorPath = this.numberIndicatorPaths.at(index).value;
|
||||||
|
indicatorPath.parameters.forEach(parameter => {
|
||||||
|
if (parameter.value !== this.indicator.indicatorPaths[index].parameters[parameter.key]) {
|
||||||
|
hasDifference = true;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return hasDifference;
|
||||||
}
|
}
|
||||||
|
|
||||||
public get isAdministrator(): boolean {
|
public get isAdministrator(): boolean {
|
||||||
|
@ -937,11 +1030,18 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple
|
||||||
return this.isAdministrator || Session.isCurator(this.stakeholder.type, this.user);
|
return this.isAdministrator || Session.isCurator(this.stakeholder.type, this.user);
|
||||||
}
|
}
|
||||||
|
|
||||||
refreshIndicator() {
|
refreshIndicator(type: IndicatorType = 'chart') {
|
||||||
this.indicator = this.indicatorUtils.generateIndicatorByForm(this.chartIndicatorFb.value, this.indicator.indicatorPaths, 'chart', true);
|
if (type === 'chart') {
|
||||||
|
this.indicator = this.indicatorUtils.generateIndicatorByForm(this.chartIndicatorFb.value, this.indicator.indicatorPaths, 'chart');
|
||||||
this.indicator.indicatorPaths.forEach(indicatorPath => {
|
this.indicator.indicatorPaths.forEach(indicatorPath => {
|
||||||
indicatorPath.safeResourceUrl = this.getSecureUrlByStakeHolder(indicatorPath);
|
indicatorPath.safeResourceUrl = this.getSecureUrlByStakeHolder(indicatorPath);
|
||||||
});
|
});
|
||||||
|
} else if (type === 'number') {
|
||||||
|
this.indicator = this.indicatorUtils.generateIndicatorByForm(this.numberIndicatorFb.value, this.indicator.indicatorPaths, 'number');
|
||||||
|
this.indicator.indicatorPaths.forEach((indicatorPath, index) => {
|
||||||
|
this.validateJsonPath(index);
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
deleteIndicatorOpen(section: Section, indicatorId: string, type: string, childrenAction: string = null) {
|
deleteIndicatorOpen(section: Section, indicatorId: string, type: string, childrenAction: string = null) {
|
||||||
|
@ -1124,24 +1224,6 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
// deleteNumberSectionOpen(section: Section, index: number) {
|
|
||||||
// this.section = section;
|
|
||||||
// this.index = index;
|
|
||||||
// this.deleteNumberSectionModal.alertTitle = 'Delete Section';
|
|
||||||
// this.deleteNumberSectionModal.cancelButtonText = 'No';
|
|
||||||
// this.deleteNumberSectionModal.okButtonText = 'Yes';
|
|
||||||
// this.deleteNumberSectionModal.open();
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// deleteChartSectionOpen(section: Section, index: number) {
|
|
||||||
// this.section = section;
|
|
||||||
// this.index = index;
|
|
||||||
// this.deleteChartSectionModal.alertTitle = 'Delete Section';
|
|
||||||
// this.deleteChartSectionModal.cancelButtonText = 'No';
|
|
||||||
// this.deleteChartSectionModal.okButtonText = 'Yes';
|
|
||||||
// this.deleteChartSectionModal.open();
|
|
||||||
// }
|
|
||||||
|
|
||||||
deleteSectionOpen(section: Section, index: number, type: IndicatorType, childrenAction: string = null) {
|
deleteSectionOpen(section: Section, index: number, type: IndicatorType, childrenAction: string = null) {
|
||||||
if (!this.editing && !section.defaultId) {
|
if (!this.editing && !section.defaultId) {
|
||||||
this.sectionTypeToDelete = type;
|
this.sectionTypeToDelete = type;
|
||||||
|
@ -1198,10 +1280,6 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
private checkForSchemaEnhancements(url: string) {
|
|
||||||
this.showCheckForSchemaEnhancements = this.isAdministrator && url && !this.properties.useOldStatisticsSchema && this.indicatorUtils.checkForSchemaEnhancements(url) && this.properties.dashboard != 'irish';
|
|
||||||
}
|
|
||||||
|
|
||||||
migrateFromOldImportJsonFile(charts) {
|
migrateFromOldImportJsonFile(charts) {
|
||||||
// first section contains numbers
|
// first section contains numbers
|
||||||
// second contains charts
|
// second contains charts
|
||||||
|
@ -1217,15 +1295,28 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple
|
||||||
if (chart['sectionIndex'] == null) {
|
if (chart['sectionIndex'] == null) {
|
||||||
chart['sectionIndex'] = chart['type'] == 'chart' ? chartsSection : 0;
|
chart['sectionIndex'] = chart['type'] == 'chart' ? chartsSection : 0;
|
||||||
}
|
}
|
||||||
|
if (chart.url && chart.jsonPath) {
|
||||||
|
chart.indicatorPaths = [{url: chart.url, jsonPath: chart.jsonPath}];
|
||||||
|
} else if(chart.url) {
|
||||||
|
chart.indicatorPaths = [{url: chart.url}];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return charts;
|
return charts;
|
||||||
}
|
}
|
||||||
|
|
||||||
importIndicatorsAndSave(charts: any[]) {
|
importIndicatorsAndSave(stakeholder: Stakeholder, charts: any[]) {
|
||||||
let sectionsToSave: Section[] = [];
|
let sectionsToSave: Section[] = [];
|
||||||
let countIndicators = 0;
|
let countIndicators = 0;
|
||||||
|
if (stakeholder.type !== this.stakeholder.type) {
|
||||||
|
UIkit.notification("The type of this profile is not the same with the file's one!", {
|
||||||
|
status: 'warning',
|
||||||
|
timeout: 6000,
|
||||||
|
pos: 'bottom-right'
|
||||||
|
});
|
||||||
|
this.finish();
|
||||||
|
return;
|
||||||
|
}
|
||||||
// name description additionalDescription, height, width, visibility
|
// name description additionalDescription, height, width, visibility
|
||||||
let noValidParams = 0;
|
|
||||||
let duplicates = 0;
|
let duplicates = 0;
|
||||||
charts = this.migrateFromOldImportJsonFile(charts);
|
charts = this.migrateFromOldImportJsonFile(charts);
|
||||||
for (let chart of charts) {
|
for (let chart of charts) {
|
||||||
|
@ -1236,16 +1327,18 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple
|
||||||
sectionsToSave[chart['sectionIndex']] = sectionToSave;
|
sectionsToSave[chart['sectionIndex']] = sectionToSave;
|
||||||
}
|
}
|
||||||
let exists = false;
|
let exists = false;
|
||||||
let indicatorPath;
|
let indicatorPaths: IndicatorPath[] = [];
|
||||||
// validate indicators' schema from file
|
// validate indicators' schema from file
|
||||||
let invalid_file_message;
|
let invalid_file_message;
|
||||||
if (!chart.type) {
|
if (!chart.type) {
|
||||||
invalid_file_message = "No indicator type is specified. Type should be chart or number.";
|
invalid_file_message = "No indicator type is specified. Type should be chart or number.";
|
||||||
} else if (chart.type != "chart" && chart.type != "number") {
|
} else if (chart.type != "chart" && chart.type != "number") {
|
||||||
invalid_file_message = "Invalid indicator type. Type should be chart or number.";
|
invalid_file_message = "Invalid indicator type. Type should be chart or number.";
|
||||||
} else if (chart.type == "number" && !chart.jsonPath) {
|
} else if (chart.indicatorPaths.length === 0) {
|
||||||
|
invalid_file_message = "No indicator paths are specified."
|
||||||
|
} else if (chart.type == "number" && chart.indicatorPaths.filter(path => !path.jsonPath).length > 0) {
|
||||||
invalid_file_message = "No jsonPath is specified for number indicator."
|
invalid_file_message = "No jsonPath is specified for number indicator."
|
||||||
} else if (!chart.url) {
|
} else if (chart.indicatorPaths.filter(path => !path.url).length > 0) {
|
||||||
invalid_file_message = "No indicator url is specified.";
|
invalid_file_message = "No indicator url is specified.";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1255,46 +1348,47 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple
|
||||||
timeout: 6000,
|
timeout: 6000,
|
||||||
pos: 'bottom-right'
|
pos: 'bottom-right'
|
||||||
});
|
});
|
||||||
this.editing = false;
|
this.finish();
|
||||||
this.importLoading = false;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (chart.type == "chart") {
|
if (chart.type == "chart") {
|
||||||
indicatorPath = this.indicatorUtils.generateIndicatorByChartUrl(this.indicatorUtils.getChartSource(chart.url), chart.url, chart.type, this.stakeholder);
|
indicatorPaths = chart.indicatorPaths.map(path => this.indicatorUtils.generateIndicatorByChartUrl(this.indicatorUtils.getChartSource(path.url), path.url, chart.type, stakeholder));
|
||||||
for (let section of this.stakeholder.topics[this.topicIndex].categories[this.categoryIndex].subCategories[this.index].charts) {
|
this.stakeholder.topics[this.topicIndex].categories[this.categoryIndex].subCategories[this.index].charts.forEach((section: Section) => {
|
||||||
for (let chart of section.indicators) {
|
section.indicators.forEach(indicator => {
|
||||||
if (JSON.stringify(chart.indicatorPaths[0].chartObject) == JSON.stringify(indicatorPath.chartObject)) {
|
indicator.indicatorPaths.forEach(path => {
|
||||||
duplicates++;
|
let size = indicatorPaths.length;
|
||||||
|
indicatorPaths = indicatorPaths.filter(indicatorPath => JSON.stringify(path.chartObject) !== JSON.stringify(indicatorPath.chartObject))
|
||||||
|
if (indicatorPaths.length < size) {
|
||||||
|
duplicates = duplicates + (size - indicatorPaths.length);
|
||||||
exists = true;
|
exists = true;
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
|
});
|
||||||
}
|
});
|
||||||
} else if (chart.type == "number") {
|
} else if (chart.type == "number") {
|
||||||
indicatorPath = this.indicatorUtils.generateIndicatorByNumberUrl(this.indicatorUtils.getNumberSource(chart.url), chart.url, this.stakeholder,
|
indicatorPaths = chart.indicatorPaths.map(path =>
|
||||||
chart.jsonPath, this.indicatorUtils.numberSources.get(this.indicatorUtils.getNumberSource(chart.url)));
|
this.indicatorUtils.generateIndicatorByNumberUrl(this.indicatorUtils.getNumberSource(path.url), path.url,
|
||||||
for (let section of this.stakeholder.topics[this.topicIndex].categories[this.categoryIndex].subCategories[this.index].numbers) {
|
stakeholder, path.jsonPath, this.indicatorUtils.numberSources.get(this.indicatorUtils.getNumberSource(path.url))));
|
||||||
for (let chart of section.indicators) {
|
this.stakeholder.topics[this.topicIndex].categories[this.categoryIndex].subCategories[this.index].numbers.forEach((section: Section) => {
|
||||||
if (JSON.stringify(chart.indicatorPaths[0].chartObject) == JSON.stringify(indicatorPath.chartObject)) {
|
section.indicators.forEach(indicator => {
|
||||||
duplicates++;
|
indicator.indicatorPaths.forEach(path => {
|
||||||
|
let size = indicatorPaths.length;
|
||||||
|
indicatorPaths = indicatorPaths.filter(indicatorPath => JSON.stringify(path.chartObject) !== JSON.stringify(indicatorPath.chartObject))
|
||||||
|
if (indicatorPaths.length < size) {
|
||||||
|
duplicates = duplicates + (size - indicatorPaths.length);
|
||||||
exists = true;
|
exists = true;
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
if (indicatorPaths.length > 0) {
|
||||||
}
|
let i: Indicator = new Indicator(chart.name, chart.description, chart.additionalDescription, chart.type, chart.width, chart.height, this.showVisibility ? "RESTRICTED" : this.stakeholderUtils.defaultValue(this.stakeholderUtils.visibilities), indicatorPaths);
|
||||||
}
|
|
||||||
if (!this.isStakeholderParametersValid(indicatorPath)) {
|
|
||||||
noValidParams++;
|
|
||||||
}
|
|
||||||
if (!exists) {
|
|
||||||
let i: Indicator = new Indicator(chart.name, chart.description, chart.additionalDescription, chart.type, chart.width, chart.height, this.showVisibility?"RESTRICTED":this.stakeholderUtils.defaultValue(this.stakeholderUtils.visibilities), [indicatorPath]);
|
|
||||||
sectionsToSave[chart['sectionIndex']].indicators.push(i);
|
sectionsToSave[chart['sectionIndex']].indicators.push(i);
|
||||||
countIndicators++;
|
countIndicators++;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (duplicates > 0) {
|
if (duplicates > 0) {
|
||||||
UIkit.notification(duplicates + " urls already exist and will not be imported!", {
|
UIkit.notification(duplicates + " urls already exist and will not be imported!", {
|
||||||
status: 'warning',
|
status: 'warning',
|
||||||
|
@ -1302,19 +1396,7 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple
|
||||||
pos: 'bottom-right'
|
pos: 'bottom-right'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (noValidParams > 0 && !(this.stakeholder.type == 'country')) {
|
if (sectionsToSave.length > 0 && countIndicators > 0) {
|
||||||
let noValidMessage = "Some indicators couldn't be generated properly. Please make sure chart data is for the current stakeholder.";
|
|
||||||
if (this.stakeholder.defaultId == null) {
|
|
||||||
noValidMessage = "Some indicators couldn't be generated properly. Stakeholders based on this profile may not inherit the data correctly.";
|
|
||||||
}
|
|
||||||
UIkit.notification(noValidMessage, {
|
|
||||||
status: 'danger',
|
|
||||||
timeout: 6000,
|
|
||||||
pos: 'bottom-right'
|
|
||||||
});
|
|
||||||
this.editing = false;
|
|
||||||
this.importLoading = false;
|
|
||||||
} else if (sectionsToSave.length > 0 && countIndicators > 0) {
|
|
||||||
this.saveIndicators(sectionsToSave.filter(section => !!section));
|
this.saveIndicators(sectionsToSave.filter(section => !!section));
|
||||||
}
|
}
|
||||||
if (sectionsToSave.length == 0 || countIndicators == 0) {
|
if (sectionsToSave.length == 0 || countIndicators == 0) {
|
||||||
|
@ -1323,8 +1405,7 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple
|
||||||
timeout: 6000,
|
timeout: 6000,
|
||||||
pos: 'bottom-right'
|
pos: 'bottom-right'
|
||||||
});
|
});
|
||||||
this.editing = false;
|
this.finish();
|
||||||
this.importLoading = false;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1335,37 +1416,42 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple
|
||||||
let indexIndicator: number = 0;
|
let indexIndicator: number = 0;
|
||||||
this.stakeholder.topics[this.topicIndex].categories[this.categoryIndex].subCategories[subcategoryIndex].numbers.forEach(section => {
|
this.stakeholder.topics[this.topicIndex].categories[this.categoryIndex].subCategories[subcategoryIndex].numbers.forEach(section => {
|
||||||
section.indicators.forEach(indicator => {
|
section.indicators.forEach(indicator => {
|
||||||
indicator.indicatorPaths.forEach(indicatorPath => {
|
|
||||||
indicators[indexIndicator] = {
|
indicators[indexIndicator] = {
|
||||||
"type": indicator.type, "name": indicator.name, "jsonPath": indicatorPath.jsonPath,
|
"indicatorPaths": indicator.indicatorPaths.map(path => {
|
||||||
|
return {
|
||||||
|
jsonPath: path.jsonPath,
|
||||||
|
url: this.indicatorUtils.getNumberUrl(path.source, this.indicatorUtils.getFullUrl(this.stakeholder, path))
|
||||||
|
}
|
||||||
|
}),
|
||||||
|
"type": indicator.type, "name": indicator.name,
|
||||||
"description": indicator.description, "additionalDescription": indicator.additionalDescription,
|
"description": indicator.description, "additionalDescription": indicator.additionalDescription,
|
||||||
"visibility": indicator.visibility, "width": indicator.width, "height": indicator.height,
|
"visibility": indicator.visibility, "width": indicator.width, "height": indicator.height,
|
||||||
"url": this.indicatorUtils.getNumberUrl(indicatorPath.source, this.indicatorUtils.getFullUrl(this.stakeholder, indicatorPath)),
|
|
||||||
"sectionTitle": section.title,
|
"sectionTitle": section.title,
|
||||||
"sectionType": section.type,
|
"sectionType": section.type,
|
||||||
"sectionIndex": index
|
"sectionIndex": index
|
||||||
};
|
};
|
||||||
indexIndicator++;
|
indexIndicator++;
|
||||||
});
|
});
|
||||||
});
|
|
||||||
index++;
|
index++;
|
||||||
});
|
});
|
||||||
|
|
||||||
this.stakeholder.topics[this.topicIndex].categories[this.categoryIndex].subCategories[subcategoryIndex].charts.forEach(section => {
|
this.stakeholder.topics[this.topicIndex].categories[this.categoryIndex].subCategories[subcategoryIndex].charts.forEach(section => {
|
||||||
section.indicators.forEach(indicator => {
|
section.indicators.forEach(indicator => {
|
||||||
indicator.indicatorPaths.forEach(indicatorPath => {
|
|
||||||
indicators[indexIndicator] = {
|
indicators[indexIndicator] = {
|
||||||
|
"indicatorPaths": indicator.indicatorPaths.map(path => {
|
||||||
|
return {
|
||||||
|
url: this.getUrlByStakeHolder(path)
|
||||||
|
}
|
||||||
|
}),
|
||||||
"type": indicator.type, "name": indicator.name,
|
"type": indicator.type, "name": indicator.name,
|
||||||
"description": indicator.description, "additionalDescription": indicator.additionalDescription,
|
"description": indicator.description, "additionalDescription": indicator.additionalDescription,
|
||||||
"visibility": indicator.visibility, "width": indicator.width, "height": indicator.height,
|
"visibility": indicator.visibility, "width": indicator.width, "height": indicator.height,
|
||||||
"url": this.getUrlByStakeHolder(indicatorPath),
|
|
||||||
"sectionTitle": section.title,
|
"sectionTitle": section.title,
|
||||||
"sectionType": section.type,
|
"sectionType": section.type,
|
||||||
"sectionIndex": index
|
"sectionIndex": index
|
||||||
};
|
};
|
||||||
indexIndicator++;
|
indexIndicator++;
|
||||||
});
|
});
|
||||||
});
|
|
||||||
index++;
|
index++;
|
||||||
|
|
||||||
});
|
});
|
||||||
|
@ -1373,8 +1459,12 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple
|
||||||
let topic = this.stakeholder ? this.stakeholder.topics[this.topicIndex] : null;
|
let topic = this.stakeholder ? this.stakeholder.topics[this.topicIndex] : null;
|
||||||
let category = topic ? topic.categories[this.categoryIndex] : null;
|
let category = topic ? topic.categories[this.categoryIndex] : null;
|
||||||
let subCategory = category ? category.subCategories[subcategoryIndex] : null;
|
let subCategory = category ? category.subCategories[subcategoryIndex] : null;
|
||||||
|
let json = {
|
||||||
var jsonFileUrl = window.URL.createObjectURL(new Blob([JSON.stringify(indicators)], {type: 'application/json'}));
|
stakeholder: HelperFunctions.copy(this.stakeholder),
|
||||||
|
indicators: indicators
|
||||||
|
}
|
||||||
|
delete json.stakeholder.topics;
|
||||||
|
var jsonFileUrl = window.URL.createObjectURL(new Blob([JSON.stringify(json)], {type: 'application/json'}));
|
||||||
var a = window.document.createElement('a');
|
var a = window.document.createElement('a');
|
||||||
window.document.body.appendChild(a);
|
window.document.body.appendChild(a);
|
||||||
a.setAttribute('style', 'display: none');
|
a.setAttribute('style', 'display: none');
|
||||||
|
@ -1383,14 +1473,13 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple
|
||||||
a.click();
|
a.click();
|
||||||
window.URL.revokeObjectURL(jsonFileUrl);
|
window.URL.revokeObjectURL(jsonFileUrl);
|
||||||
a.remove(); // remove the element
|
a.remove(); // remove the element
|
||||||
|
this.finish();
|
||||||
this.editing = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fileChangeEvent(fileInput: any, index) {
|
fileChangeEvent(fileInput: any, index) {
|
||||||
this.index = index;
|
this.index = index;
|
||||||
this.editing = true;
|
this.editing = true;
|
||||||
this.importLoading = true;
|
this.loading = true;
|
||||||
this.filesToUpload = <Array<File>>fileInput.target.files;
|
this.filesToUpload = <Array<File>>fileInput.target.files;
|
||||||
this.upload();
|
this.upload();
|
||||||
}
|
}
|
||||||
|
@ -1403,8 +1492,7 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple
|
||||||
timeout: 6000,
|
timeout: 6000,
|
||||||
pos: 'bottom-right'
|
pos: 'bottom-right'
|
||||||
});
|
});
|
||||||
this.editing = false;
|
this.finish();
|
||||||
this.importLoading = false;
|
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
if (this.filesToUpload[0].name.indexOf(".json") == -1 || (this.filesToUpload[0].type != "application/json")) {
|
if (this.filesToUpload[0].name.indexOf(".json") == -1 || (this.filesToUpload[0].type != "application/json")) {
|
||||||
|
@ -1414,27 +1502,30 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple
|
||||||
timeout: 6000,
|
timeout: 6000,
|
||||||
pos: 'bottom-right'
|
pos: 'bottom-right'
|
||||||
});
|
});
|
||||||
this.editing = false;
|
this.finish();
|
||||||
this.importLoading = false;
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this.makeFileRequest(this.properties.utilsService + '/upload?type=json', [], this.filesToUpload).then(async (result: string) => {
|
this.makeFileRequest(this.properties.utilsService + '/upload?type=json', [], this.filesToUpload).then(async (result: string) => {
|
||||||
|
let json = JSON.parse(result);
|
||||||
let json_result = JSON.parse(result);
|
|
||||||
|
|
||||||
// validate file
|
// validate file
|
||||||
if (!json_result || json_result.length == 0) {
|
if (json && Array.isArray(json)) {
|
||||||
|
UIkit.notification("This file is not supported any more. Please export indicators and try again!", {
|
||||||
|
status: 'danger',
|
||||||
|
timeout: 6000,
|
||||||
|
pos: 'bottom-right'
|
||||||
|
});
|
||||||
|
this.finish();
|
||||||
|
} else if (!json || json?.indicators.length == 0) {
|
||||||
UIkit.notification("Importing file is empty", {
|
UIkit.notification("Importing file is empty", {
|
||||||
status: 'danger',
|
status: 'danger',
|
||||||
timeout: 6000,
|
timeout: 6000,
|
||||||
pos: 'bottom-right'
|
pos: 'bottom-right'
|
||||||
});
|
});
|
||||||
this.editing = false;
|
this.finish();
|
||||||
this.importLoading = false;
|
|
||||||
} else {
|
} else {
|
||||||
this.importIndicatorsAndSave(json_result);
|
this.importIndicatorsAndSave(json.stakeholder, json.indicators);
|
||||||
}
|
}
|
||||||
}, (error) => {
|
}, (error) => {
|
||||||
console.error("Error importing files", error);
|
console.error("Error importing files", error);
|
||||||
|
@ -1443,8 +1534,7 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple
|
||||||
timeout: 6000,
|
timeout: 6000,
|
||||||
pos: 'bottom-right'
|
pos: 'bottom-right'
|
||||||
});
|
});
|
||||||
this.editing = false;
|
this.finish();
|
||||||
this.importLoading = false;
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1482,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>
|
||||||
|
|
|
@ -242,30 +242,18 @@ export class TopicComponent extends StakeholderBaseComponent implements OnInit,
|
||||||
}
|
}
|
||||||
|
|
||||||
topicChanged(callback: Function, save: boolean = false) {
|
topicChanged(callback: Function, save: boolean = false) {
|
||||||
if(this.topics && save) {
|
|
||||||
this.topics.disable();
|
|
||||||
}
|
|
||||||
if(this.categories) {
|
|
||||||
this.categories.disable();
|
|
||||||
}
|
|
||||||
if(this.subCategories) {
|
|
||||||
this.subCategories.disable();
|
|
||||||
}
|
|
||||||
if(callback) {
|
if(callback) {
|
||||||
callback();
|
callback();
|
||||||
}
|
}
|
||||||
this.cdr.detectChanges();
|
this.cdr.detectChanges();
|
||||||
if(this.topics && save) {
|
if(this.topics && save) {
|
||||||
this.topics.init();
|
this.topics.init();
|
||||||
this.topics.enable();
|
|
||||||
}
|
}
|
||||||
if(this.categories) {
|
if(this.categories) {
|
||||||
this.categories.init();
|
this.categories.init();
|
||||||
this.categories.enable();
|
|
||||||
}
|
}
|
||||||
if(this.subCategories) {
|
if(this.subCategories) {
|
||||||
this.subCategories.init();
|
this.subCategories.init();
|
||||||
this.subCategories.enable();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -359,6 +347,8 @@ export class TopicComponent extends StakeholderBaseComponent implements OnInit,
|
||||||
this.stakeholder.topics.splice(this.index, 1);
|
this.stakeholder.topics.splice(this.index, 1);
|
||||||
if(this.topicIndex === this.index) {
|
if(this.topicIndex === this.index) {
|
||||||
this.chooseTopic(Math.max(0, this.index - 1));
|
this.chooseTopic(Math.max(0, this.index - 1));
|
||||||
|
} else if(this.topicIndex > this.index) {
|
||||||
|
this.chooseTopic(this.topicIndex - 1);
|
||||||
}
|
}
|
||||||
}, true);
|
}, true);
|
||||||
};
|
};
|
||||||
|
@ -388,23 +378,15 @@ export class TopicComponent extends StakeholderBaseComponent implements OnInit,
|
||||||
}
|
}
|
||||||
|
|
||||||
categoryChanged(callback: Function, save: boolean = false) {
|
categoryChanged(callback: Function, save: boolean = false) {
|
||||||
if(this.categories && save) {
|
|
||||||
this.categories.disable();
|
|
||||||
}
|
|
||||||
if(this.subCategories) {
|
|
||||||
this.subCategories.disable();
|
|
||||||
}
|
|
||||||
if(callback) {
|
if(callback) {
|
||||||
callback();
|
callback();
|
||||||
}
|
}
|
||||||
this.cdr.detectChanges();
|
this.cdr.detectChanges();
|
||||||
if(this.categories && save) {
|
if(this.categories && save) {
|
||||||
this.categories.init();
|
this.categories.init();
|
||||||
this.categories.enable();
|
|
||||||
}
|
}
|
||||||
if(this.subCategories) {
|
if(this.subCategories) {
|
||||||
this.subCategories.init();
|
this.subCategories.init();
|
||||||
this.subCategories.enable();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -500,6 +482,8 @@ export class TopicComponent extends StakeholderBaseComponent implements OnInit,
|
||||||
this.stakeholder.topics[this.topicIndex].categories.splice(this.index, 1);
|
this.stakeholder.topics[this.topicIndex].categories.splice(this.index, 1);
|
||||||
if(this.categoryIndex === this.index) {
|
if(this.categoryIndex === this.index) {
|
||||||
this.chooseCategory(Math.max(0, this.index - 1));
|
this.chooseCategory(Math.max(0, this.index - 1));
|
||||||
|
} else if(this.categoryIndex > this.index) {
|
||||||
|
this.chooseCategory(this.categoryIndex - 1);
|
||||||
}
|
}
|
||||||
}, true);
|
}, true);
|
||||||
};
|
};
|
||||||
|
@ -528,16 +512,12 @@ export class TopicComponent extends StakeholderBaseComponent implements OnInit,
|
||||||
}
|
}
|
||||||
|
|
||||||
subCategoryChanged(callback: Function, save: boolean = false) {
|
subCategoryChanged(callback: Function, save: boolean = false) {
|
||||||
if(this.subCategories && save) {
|
|
||||||
this.subCategories.disable();
|
|
||||||
}
|
|
||||||
if(callback) {
|
if(callback) {
|
||||||
callback();
|
callback();
|
||||||
}
|
}
|
||||||
this.cdr.detectChanges();
|
this.cdr.detectChanges();
|
||||||
if(this.subCategories && save) {
|
if(this.subCategories && save) {
|
||||||
this.subCategories.init();
|
this.subCategories.init();
|
||||||
this.subCategories.enable();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -640,6 +620,8 @@ export class TopicComponent extends StakeholderBaseComponent implements OnInit,
|
||||||
this.stakeholder.topics[this.topicIndex].categories[this.categoryIndex].subCategories.splice(this.index, 1);
|
this.stakeholder.topics[this.topicIndex].categories[this.categoryIndex].subCategories.splice(this.index, 1);
|
||||||
if(this.subCategoryIndex === this.index) {
|
if(this.subCategoryIndex === this.index) {
|
||||||
this.chooseSubcategory(Math.max(0, this.index - 1));
|
this.chooseSubcategory(Math.max(0, this.index - 1));
|
||||||
|
} else if(this.subCategoryIndex > this.index) {
|
||||||
|
this.chooseSubcategory(this.subCategoryIndex - 1);
|
||||||
}
|
}
|
||||||
}, true);
|
}, true);
|
||||||
};
|
};
|
||||||
|
@ -777,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';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +1,6 @@
|
||||||
import {NgModule} from '@angular/core';
|
import {NgModule} from '@angular/core';
|
||||||
import {CommonModule} from '@angular/common';
|
import {CommonModule} from '@angular/common';
|
||||||
|
|
||||||
import {PreviousRouteRecorder} from '../../utils/piwik/previousRouteRecorder.guard';
|
|
||||||
|
|
||||||
import {PiwikService} from '../../utils/piwik/piwik.service';
|
|
||||||
import {TopicComponent} from "./topic.component";
|
import {TopicComponent} from "./topic.component";
|
||||||
import {TopicRoutingModule} from "./topic-routing.module";
|
import {TopicRoutingModule} from "./topic-routing.module";
|
||||||
import {RouterModule} from "@angular/router";
|
import {RouterModule} from "@angular/router";
|
||||||
|
@ -22,22 +19,18 @@ import {LogoUrlPipeModule} from "../../utils/pipes/logoUrlPipe.module";
|
||||||
import {TransitionGroupModule} from "../../utils/transition-group/transition-group.module";
|
import {TransitionGroupModule} from "../../utils/transition-group/transition-group.module";
|
||||||
import {NumberRoundModule} from "../../utils/pipes/number-round.module";
|
import {NumberRoundModule} from "../../utils/pipes/number-round.module";
|
||||||
import {SideBarModule} from "../../dashboard/sharedComponents/sidebar/sideBar.module";
|
import {SideBarModule} from "../../dashboard/sharedComponents/sidebar/sideBar.module";
|
||||||
import {
|
import {SidebarMobileToggleModule} from "../../dashboard/sharedComponents/sidebar/sidebar-mobile-toggle/sidebar-mobile-toggle.module";
|
||||||
SidebarMobileToggleModule
|
import {SliderTabsModule} from "../../sharedComponents/tabs/slider-tabs.module";
|
||||||
} from "../../dashboard/sharedComponents/sidebar/sidebar-mobile-toggle/sidebar-mobile-toggle.module";
|
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [
|
imports: [
|
||||||
CommonModule, TopicRoutingModule, ClickModule, RouterModule, FormsModule, AlertModalModule,
|
CommonModule, TopicRoutingModule, ClickModule, RouterModule, FormsModule, AlertModalModule,
|
||||||
ReactiveFormsModule, InputModule, IconsModule, PageContentModule, LoadingModule, NotifyFormModule, LogoUrlPipeModule, TransitionGroupModule, NumberRoundModule, SideBarModule, SidebarMobileToggleModule
|
ReactiveFormsModule, InputModule, IconsModule, PageContentModule, LoadingModule, NotifyFormModule, LogoUrlPipeModule, TransitionGroupModule, NumberRoundModule, SideBarModule, SidebarMobileToggleModule, SliderTabsModule
|
||||||
],
|
],
|
||||||
declarations: [
|
declarations: [
|
||||||
TopicComponent, IndicatorsComponent
|
TopicComponent, IndicatorsComponent
|
||||||
],
|
],
|
||||||
providers: [
|
providers: [],
|
||||||
PreviousRouteRecorder,
|
|
||||||
PiwikService
|
|
||||||
],
|
|
||||||
exports: [
|
exports: [
|
||||||
TopicComponent
|
TopicComponent
|
||||||
]
|
]
|
||||||
|
|
|
@ -17,6 +17,11 @@ import {Session} from "../../login/utils/helper.class";
|
||||||
import {HelperFunctions} from "../../utils/HelperFunctions.class";
|
import {HelperFunctions} from "../../utils/HelperFunctions.class";
|
||||||
import {properties} from "src/environments/environment";
|
import {properties} from "src/environments/environment";
|
||||||
|
|
||||||
|
class Roles {
|
||||||
|
manager = 'manager';
|
||||||
|
member = 'member';
|
||||||
|
}
|
||||||
|
|
||||||
class Entities {
|
class Entities {
|
||||||
stakeholder = 'Dashboard';
|
stakeholder = 'Dashboard';
|
||||||
funder = 'Funder';
|
funder = 'Funder';
|
||||||
|
@ -37,6 +42,7 @@ class Entities {
|
||||||
}
|
}
|
||||||
|
|
||||||
export class StakeholderConfiguration {
|
export class StakeholderConfiguration {
|
||||||
|
public static ROLES: Roles = new Roles();
|
||||||
public static ENTITIES: Entities = new Entities();
|
public static ENTITIES: Entities = new Entities();
|
||||||
public static TYPES: Option[] = [
|
public static TYPES: Option[] = [
|
||||||
{value: 'funder', label: StakeholderConfiguration.ENTITIES.funder},
|
{value: 'funder', label: StakeholderConfiguration.ENTITIES.funder},
|
||||||
|
@ -55,9 +61,15 @@ export class StakeholderConfiguration {
|
||||||
{icon: 'incognito', value: "PRIVATE", label: 'Private'},
|
{icon: 'incognito', value: "PRIVATE", label: 'Private'},
|
||||||
];
|
];
|
||||||
public static CACHE_INDICATORS: boolean = true;
|
public static CACHE_INDICATORS: boolean = true;
|
||||||
|
public static NUMBER_MULTI_INDICATOR_PATHS = false;
|
||||||
|
public static CHART_MULTI_INDICATOR_PATHS = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
export class StakeholderUtils {
|
export class StakeholderUtils {
|
||||||
|
get roles() {
|
||||||
|
return StakeholderConfiguration.ROLES;
|
||||||
|
}
|
||||||
|
|
||||||
get entities() {
|
get entities() {
|
||||||
return StakeholderConfiguration.ENTITIES;
|
return StakeholderConfiguration.ENTITIES;
|
||||||
}
|
}
|
||||||
|
@ -82,6 +94,14 @@ export class StakeholderUtils {
|
||||||
return StakeholderConfiguration.CACHE_INDICATORS;
|
return StakeholderConfiguration.CACHE_INDICATORS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get hasMultiNumberIndicatorPaths() {
|
||||||
|
return StakeholderConfiguration.NUMBER_MULTI_INDICATOR_PATHS;
|
||||||
|
}
|
||||||
|
|
||||||
|
get hasMultiChartIndicatorPaths() {
|
||||||
|
return StakeholderConfiguration.CHART_MULTI_INDICATOR_PATHS;
|
||||||
|
}
|
||||||
|
|
||||||
visibilityIcon: Map<Visibility, string> = new Map<Visibility, string>(this.visibilities.map(option => [option.value, option.icon]));
|
visibilityIcon: Map<Visibility, string> = new Map<Visibility, string>(this.visibilities.map(option => [option.value, option.icon]));
|
||||||
|
|
||||||
defaultValue(options: Option[]) {
|
defaultValue(options: Option[]) {
|
||||||
|
@ -107,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 => {
|
||||||
|
@ -317,9 +283,14 @@ export class IndicatorUtils {
|
||||||
|
|
||||||
public getFullUrl(stakeholder: Stakeholder, indicatorPath: IndicatorPath, fundingL0: string = null, startYear: string = null, endYear: string = null): string {
|
public getFullUrl(stakeholder: Stakeholder, indicatorPath: IndicatorPath, fundingL0: string = null, startYear: string = null, endYear: string = null): string {
|
||||||
let replacedUrl = indicatorPath.chartObject ? indicatorPath.chartObject : indicatorPath.url;
|
let replacedUrl = indicatorPath.chartObject ? indicatorPath.chartObject : indicatorPath.url;
|
||||||
if (stakeholder.statsProfile) {
|
if (indicatorPath.parameters.statsProfile) {
|
||||||
|
replacedUrl = replacedUrl.split(ChartHelper.prefix + this.statsProfileParameter + ChartHelper.suffix).join(indicatorPath.parameters.statsProfile)
|
||||||
|
} else if (stakeholder.statsProfile) {
|
||||||
replacedUrl = replacedUrl.split(ChartHelper.prefix + this.statsProfileParameter + ChartHelper.suffix).join(stakeholder.statsProfile)
|
replacedUrl = replacedUrl.split(ChartHelper.prefix + this.statsProfileParameter + ChartHelper.suffix).join(stakeholder.statsProfile)
|
||||||
}
|
}
|
||||||
|
replacedUrl = replacedUrl.split(ChartHelper.prefix + 'index_id' + ChartHelper.suffix).join(stakeholder.index_id);
|
||||||
|
replacedUrl = replacedUrl.split(ChartHelper.prefix + 'index_shortName' + ChartHelper.suffix).join(stakeholder.index_shortName);
|
||||||
|
replacedUrl = replacedUrl.split(ChartHelper.prefix + 'index_name' + ChartHelper.suffix).join(stakeholder.index_name);
|
||||||
if (indicatorPath.parameters) {
|
if (indicatorPath.parameters) {
|
||||||
Object.keys(indicatorPath.parameters).forEach(key => {
|
Object.keys(indicatorPath.parameters).forEach(key => {
|
||||||
let replacedValue = indicatorPath.parameters[key];
|
let replacedValue = indicatorPath.parameters[key];
|
||||||
|
@ -329,16 +300,6 @@ export class IndicatorUtils {
|
||||||
if (endYear && key == "end_year" && indicatorPath.filters["end_year"]) {
|
if (endYear && key == "end_year" && indicatorPath.filters["end_year"]) {
|
||||||
replacedValue = (replacedValue > endYear) ? endYear : replacedValue;
|
replacedValue = (replacedValue > endYear) ? endYear : replacedValue;
|
||||||
}
|
}
|
||||||
if (key == "index_id") {
|
|
||||||
replacedValue = stakeholder.index_id;
|
|
||||||
}
|
|
||||||
if (key == "index_name") {
|
|
||||||
replacedValue = stakeholder.index_name;
|
|
||||||
}
|
|
||||||
if (key == "index_shortName") {
|
|
||||||
replacedValue = stakeholder.index_shortName.toLowerCase();
|
|
||||||
}
|
|
||||||
|
|
||||||
replacedUrl = replacedUrl.split(ChartHelper.prefix + key + ChartHelper.suffix).join(replacedValue)
|
replacedUrl = replacedUrl.split(ChartHelper.prefix + key + ChartHelper.suffix).join(replacedValue)
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -396,9 +357,14 @@ export class IndicatorUtils {
|
||||||
let filterSubtitleText = [];
|
let filterSubtitleText = [];
|
||||||
indicatorPath.filtersApplied = 0;
|
indicatorPath.filtersApplied = 0;
|
||||||
let replacedUrl = indicatorPath.chartObject ? indicatorPath.chartObject : indicatorPath.url;
|
let replacedUrl = indicatorPath.chartObject ? indicatorPath.chartObject : indicatorPath.url;
|
||||||
if (stakeholder.statsProfile) {
|
if (indicatorPath.parameters.statsProfile) {
|
||||||
replacedUrl = replacedUrl.split(ChartHelper.prefix + this.statsProfileParameter + ChartHelper.suffix).join(stakeholder.statsProfile);
|
replacedUrl = replacedUrl.split(ChartHelper.prefix + this.statsProfileParameter + ChartHelper.suffix).join(indicatorPath.parameters.statsProfile)
|
||||||
|
} else if (stakeholder.statsProfile) {
|
||||||
|
replacedUrl = replacedUrl.split(ChartHelper.prefix + this.statsProfileParameter + ChartHelper.suffix).join(stakeholder.statsProfile)
|
||||||
}
|
}
|
||||||
|
replacedUrl = replacedUrl.split(ChartHelper.prefix + 'index_id' + ChartHelper.suffix).join(stakeholder.index_id);
|
||||||
|
replacedUrl = replacedUrl.split(ChartHelper.prefix + 'index_shortName' + ChartHelper.suffix).join(stakeholder.index_shortName);
|
||||||
|
replacedUrl = replacedUrl.split(ChartHelper.prefix + 'index_name' + ChartHelper.suffix).join(stakeholder.index_name);
|
||||||
if (fundingL0) {
|
if (fundingL0) {
|
||||||
if (indicatorPath.source == "stats-tool" && indicatorPath.chartObject) {
|
if (indicatorPath.source == "stats-tool" && indicatorPath.chartObject) {
|
||||||
let filterResults = this.addFilter(replacedUrl, 'fundingL0', fundingL0);
|
let filterResults = this.addFilter(replacedUrl, 'fundingL0', fundingL0);
|
||||||
|
@ -457,17 +423,6 @@ export class IndicatorUtils {
|
||||||
if ((foslvl1 && foslvl1.length > 0) || (foslvl2 && foslvl2.length > 0)) {
|
if ((foslvl1 && foslvl1.length > 0) || (foslvl2 && foslvl2.length > 0)) {
|
||||||
filterSubtitleText.push("Field of Science: " + foslvl1.join(', ') + (foslvl1.length > 0 && foslvl2.length > 0 ? ', ' : '') + foslvl2.join(", "));
|
filterSubtitleText.push("Field of Science: " + foslvl1.join(', ') + (foslvl1.length > 0 && foslvl2.length > 0 ? ', ' : '') + foslvl2.join(", "));
|
||||||
}
|
}
|
||||||
|
|
||||||
//For numbers
|
|
||||||
if (replacedUrl.indexOf(ChartHelper.prefix + 'index_id' + ChartHelper.suffix) != -1) {
|
|
||||||
replacedUrl = replacedUrl.split(ChartHelper.prefix + 'index_id' + ChartHelper.suffix).join(encodeURIComponent(stakeholder.index_id));
|
|
||||||
}
|
|
||||||
if (replacedUrl.indexOf(ChartHelper.prefix + 'index_name' + ChartHelper.suffix) != -1) {
|
|
||||||
replacedUrl = replacedUrl.split(ChartHelper.prefix + 'index_name' + ChartHelper.suffix).join(encodeURIComponent(stakeholder.index_name));
|
|
||||||
}
|
|
||||||
if (replacedUrl.indexOf(ChartHelper.prefix + 'index_shortName' + ChartHelper.suffix) != -1) {
|
|
||||||
replacedUrl = replacedUrl.split(ChartHelper.prefix + 'index_shortName' + ChartHelper.suffix).join(encodeURIComponent(stakeholder.index_shortName));
|
|
||||||
}
|
|
||||||
if (indicatorPath.parameters) {
|
if (indicatorPath.parameters) {
|
||||||
Object.keys(indicatorPath.parameters).forEach(key => {
|
Object.keys(indicatorPath.parameters).forEach(key => {
|
||||||
let replacedValue = indicatorPath.parameters[key];
|
let replacedValue = indicatorPath.parameters[key];
|
||||||
|
@ -481,21 +436,22 @@ export class IndicatorUtils {
|
||||||
//if there is a parameter that is filtered and the value of the parameter changes, count the filter as applied
|
//if there is a parameter that is filtered and the value of the parameter changes, count the filter as applied
|
||||||
indicatorPath.filtersApplied++;
|
indicatorPath.filtersApplied++;
|
||||||
}
|
}
|
||||||
if (key == "index_id") {
|
|
||||||
replacedValue = stakeholder.index_id;
|
|
||||||
}
|
|
||||||
if (key == "index_name") {
|
|
||||||
replacedValue = stakeholder.index_name;
|
|
||||||
}
|
|
||||||
if (key == "index_shortName") {
|
|
||||||
replacedValue = stakeholder.index_shortName.toLowerCase();
|
|
||||||
}
|
|
||||||
if (key == "subtitle" && filterSubtitleText.length > 0) {
|
if (key == "subtitle" && filterSubtitleText.length > 0) {
|
||||||
replacedValue = replacedValue + (replacedValue.length > 0 ? ' - ' : '') + ' Active filters: (' + filterSubtitleText.join(", ") + ')';
|
replacedValue = replacedValue + (replacedValue.length > 0 ? ' - ' : '') + ' Active filters: (' + filterSubtitleText.join(", ") + ')';
|
||||||
}
|
}
|
||||||
replacedUrl = replacedUrl.split(ChartHelper.prefix + key + ChartHelper.suffix).join(replacedValue)
|
replacedUrl = replacedUrl.split(ChartHelper.prefix + key + ChartHelper.suffix).join(replacedValue)
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
//For numbers
|
||||||
|
if (replacedUrl.indexOf(ChartHelper.prefix + 'index_id' + ChartHelper.suffix) != -1) {
|
||||||
|
replacedUrl = replacedUrl.split(ChartHelper.prefix + 'index_id' + ChartHelper.suffix).join(encodeURIComponent(stakeholder.index_id));
|
||||||
|
}
|
||||||
|
if (replacedUrl.indexOf(ChartHelper.prefix + 'index_name' + ChartHelper.suffix) != -1) {
|
||||||
|
replacedUrl = replacedUrl.split(ChartHelper.prefix + 'index_name' + ChartHelper.suffix).join(encodeURIComponent(stakeholder.index_name));
|
||||||
|
}
|
||||||
|
if (replacedUrl.indexOf(ChartHelper.prefix + 'index_shortName' + ChartHelper.suffix) != -1) {
|
||||||
|
replacedUrl = replacedUrl.split(ChartHelper.prefix + 'index_shortName' + ChartHelper.suffix).join(encodeURIComponent(stakeholder.index_shortName));
|
||||||
|
}
|
||||||
return (indicatorPath.chartObject ? indicatorPath.url + encodeURIComponent(replacedUrl) : replacedUrl);
|
return (indicatorPath.chartObject ? indicatorPath.url + encodeURIComponent(replacedUrl) : replacedUrl);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -598,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 {
|
||||||
|
@ -636,21 +592,19 @@ export class IndicatorUtils {
|
||||||
return values.length > 1;
|
return values.length > 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
generateIndicatorByForm(form: any, indicatorPaths: IndicatorPath[], type: IndicatorType, addParameters: boolean = true): Indicator {
|
generateIndicatorByForm(form: any, indicatorPaths: IndicatorPath[], type: IndicatorType): Indicator {
|
||||||
let indicator: Indicator = new Indicator(form.name, form.description, form.additionalDescription, type,
|
let indicator: Indicator = new Indicator(form.name, form.description, form.additionalDescription, type,
|
||||||
form.width, form.height, form.visibility, indicatorPaths, form.defaultId);
|
form.width, form.height, form.visibility, indicatorPaths, form.defaultId);
|
||||||
indicator._id = form._id;
|
indicator._id = form._id;
|
||||||
form.indicatorPaths.forEach((indicatorPath, index) => {
|
form.indicatorPaths.forEach((indicatorPath, index) => {
|
||||||
indicator.indicatorPaths[index].type = indicatorPath.type;
|
indicator.indicatorPaths[index].type = indicatorPath.type;
|
||||||
indicator.indicatorPaths[index].format = indicatorPath.format;
|
indicator.indicatorPaths[index].format = indicatorPath.format;
|
||||||
if (addParameters) {
|
|
||||||
indicatorPath.parameters.forEach(parameter => {
|
indicatorPath.parameters.forEach(parameter => {
|
||||||
indicator.indicatorPaths[index].parameters[parameter.key] = parameter.value;
|
indicator.indicatorPaths[index].parameters[parameter.key] = parameter.value;
|
||||||
if (parameter.key === 'type') {
|
if (parameter.key === 'type') {
|
||||||
indicator.indicatorPaths[index].type = parameter.value;
|
indicator.indicatorPaths[index].type = parameter.value;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
|
||||||
});
|
});
|
||||||
return indicator;
|
return indicator;
|
||||||
}
|
}
|
||||||
|
@ -664,6 +618,7 @@ export class IndicatorUtils {
|
||||||
let chart = JSON.parse(indicatorPath.chartObject);
|
let chart = JSON.parse(indicatorPath.chartObject);
|
||||||
this.parameterizeDefaultQuery(chart, indicatorPath, stakeholder);
|
this.parameterizeDefaultQuery(chart, indicatorPath, stakeholder);
|
||||||
this.extractStakeHolders(chart, indicatorPath, stakeholder);
|
this.extractStakeHolders(chart, indicatorPath, stakeholder);
|
||||||
|
this.addProfile(indicatorPath);
|
||||||
indicatorPath.chartObject = JSON.stringify(chart);
|
indicatorPath.chartObject = JSON.stringify(chart);
|
||||||
if (!jsonPath || jsonPath.length == 0 || (jsonPath.length == 1 && jsonPath[0] == "")) {
|
if (!jsonPath || jsonPath.length == 0 || (jsonPath.length == 1 && jsonPath[0] == "")) {
|
||||||
indicatorPath.jsonPath = ["data", "0", "0", "0"];
|
indicatorPath.jsonPath = ["data", "0", "0", "0"];
|
||||||
|
@ -723,6 +678,7 @@ export class IndicatorUtils {
|
||||||
this.extractStakeHolders(chart, indicatorPath, stakeholder);
|
this.extractStakeHolders(chart, indicatorPath, stakeholder);
|
||||||
this.extractStartYear(chart, indicatorPath);
|
this.extractStartYear(chart, indicatorPath);
|
||||||
this.extractEndYear(chart, indicatorPath);
|
this.extractEndYear(chart, indicatorPath);
|
||||||
|
this.addProfile(indicatorPath);
|
||||||
indicatorPath.chartObject = JSON.stringify(chart);
|
indicatorPath.chartObject = JSON.stringify(chart);
|
||||||
}
|
}
|
||||||
} else if (source === 'old') {
|
} else if (source === 'old') {
|
||||||
|
@ -802,7 +758,7 @@ export class IndicatorUtils {
|
||||||
for (let filter of query["query"]["filters"]) {
|
for (let filter of query["query"]["filters"]) {
|
||||||
for (let gfilter of filter["groupFilters"]) {
|
for (let gfilter of filter["groupFilters"]) {
|
||||||
//ignore field No Of Funders
|
//ignore field No Of Funders
|
||||||
let replacedValue = this.replaceIndexValues(gfilter["values"][0], stakeholder, indicatorPath.parameters);
|
let replacedValue = this.replaceIndexValues(gfilter["values"][0], stakeholder);
|
||||||
if (replacedValue) { // don't proceed in replacement if no replaced value matches
|
if (replacedValue) { // don't proceed in replacement if no replaced value matches
|
||||||
if ((gfilter["field"].indexOf(" funder") != -1 && gfilter["field"].indexOf(" funders") == -1) ||
|
if ((gfilter["field"].indexOf(" funder") != -1 && gfilter["field"].indexOf(" funders") == -1) ||
|
||||||
(gfilter["field"].indexOf(".funder") != -1) ||
|
(gfilter["field"].indexOf(".funder") != -1) ||
|
||||||
|
@ -828,7 +784,7 @@ export class IndicatorUtils {
|
||||||
}
|
}
|
||||||
for (let filter of query["query"]["filters"]) {
|
for (let filter of query["query"]["filters"]) {
|
||||||
for (let gfilter of filter["groupFilters"]) {
|
for (let gfilter of filter["groupFilters"]) {
|
||||||
let replacedValue = this.replaceIndexValues(gfilter["values"][0], stakeholder, indicatorPath.parameters);
|
let replacedValue = this.replaceIndexValues(gfilter["values"][0], stakeholder);
|
||||||
if (replacedValue) { // don't proceed in replacement if no replaced value matches
|
if (replacedValue) { // don't proceed in replacement if no replaced value matches
|
||||||
if ((gfilter["field"].indexOf(".context.name") != -1)
|
if ((gfilter["field"].indexOf(".context.name") != -1)
|
||||||
|| (gfilter["field"].indexOf(".context.id") != -1)) {
|
|| (gfilter["field"].indexOf(".context.id") != -1)) {
|
||||||
|
@ -855,7 +811,7 @@ export class IndicatorUtils {
|
||||||
}
|
}
|
||||||
for (let filter of query["query"]["filters"]) {
|
for (let filter of query["query"]["filters"]) {
|
||||||
for (let gfilter of filter["groupFilters"]) {
|
for (let gfilter of filter["groupFilters"]) {
|
||||||
let replacedValue = this.replaceIndexValues(gfilter["values"][0], stakeholder, indicatorPath.parameters);
|
let replacedValue = this.replaceIndexValues(gfilter["values"][0], stakeholder);
|
||||||
if (replacedValue) { // don't proceed in replacement if no replaced value matches
|
if (replacedValue) { // don't proceed in replacement if no replaced value matches
|
||||||
if ((gfilter["field"].indexOf(".organization.name") != -1) ||
|
if ((gfilter["field"].indexOf(".organization.name") != -1) ||
|
||||||
(gfilter["field"].indexOf(".organization.id") != -1)) {
|
(gfilter["field"].indexOf(".organization.id") != -1)) {
|
||||||
|
@ -866,6 +822,7 @@ export class IndicatorUtils {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private extractDatasource(obj, indicatorPath: IndicatorPath, stakeholder: Stakeholder) {
|
private extractDatasource(obj, indicatorPath: IndicatorPath, stakeholder: Stakeholder) {
|
||||||
// works for .datasource.name and .HostedBy datasource
|
// works for .datasource.name and .HostedBy datasource
|
||||||
// and .datasource.id
|
// and .datasource.id
|
||||||
|
@ -881,7 +838,7 @@ export class IndicatorUtils {
|
||||||
}
|
}
|
||||||
for (let filter of query["query"]["filters"]) {
|
for (let filter of query["query"]["filters"]) {
|
||||||
for (let gfilter of filter["groupFilters"]) {
|
for (let gfilter of filter["groupFilters"]) {
|
||||||
let replacedValue = this.replaceIndexValues(gfilter["values"][0], stakeholder, indicatorPath.parameters);
|
let replacedValue = this.replaceIndexValues(gfilter["values"][0], stakeholder);
|
||||||
if (replacedValue) { // don't proceed in replacement if no replaced value matches
|
if (replacedValue) { // don't proceed in replacement if no replaced value matches
|
||||||
if ((gfilter["field"].indexOf(".datasource.name") != -1 || gfilter["field"].indexOf(".HostedBy datasource") != -1) ||
|
if ((gfilter["field"].indexOf(".datasource.name") != -1 || gfilter["field"].indexOf(".HostedBy datasource") != -1) ||
|
||||||
(gfilter["field"].indexOf(".datasource.id") != -1) || (gfilter["field"].indexOf(".hostedby") != -1)) {
|
(gfilter["field"].indexOf(".datasource.id") != -1) || (gfilter["field"].indexOf(".hostedby") != -1)) {
|
||||||
|
@ -892,6 +849,7 @@ export class IndicatorUtils {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private extractResearcher(obj, indicatorPath: IndicatorPath, stakeholder: Stakeholder) {
|
private extractResearcher(obj, indicatorPath: IndicatorPath, stakeholder: Stakeholder) {
|
||||||
// works for .orcid
|
// works for .orcid
|
||||||
if (stakeholder.type != "researcher") {
|
if (stakeholder.type != "researcher") {
|
||||||
|
@ -906,7 +864,7 @@ export class IndicatorUtils {
|
||||||
}
|
}
|
||||||
for (let filter of query["query"]["filters"]) {
|
for (let filter of query["query"]["filters"]) {
|
||||||
for (let gfilter of filter["groupFilters"]) {
|
for (let gfilter of filter["groupFilters"]) {
|
||||||
let replacedValue = this.replaceIndexValues(gfilter["values"][0], stakeholder, indicatorPath.parameters);
|
let replacedValue = this.replaceIndexValues(gfilter["values"][0], stakeholder);
|
||||||
if (replacedValue) { // don't proceed in replacement if no replaced value matches
|
if (replacedValue) { // don't proceed in replacement if no replaced value matches
|
||||||
if ((gfilter["field"].indexOf(".orcid") != -1)) {
|
if ((gfilter["field"].indexOf(".orcid") != -1)) {
|
||||||
gfilter["values"][0] = replacedValue;
|
gfilter["values"][0] = replacedValue;
|
||||||
|
@ -916,19 +874,18 @@ export class IndicatorUtils {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
private replaceIndexValues(currentValue, stakeholder, parameters ){
|
|
||||||
|
private replaceIndexValues(currentValue, stakeholder) {
|
||||||
if (currentValue == stakeholder.index_name) {
|
if (currentValue == stakeholder.index_name) {
|
||||||
parameters["index_name"] = stakeholder.index_name;
|
|
||||||
return ChartHelper.prefix + "index_name" + ChartHelper.suffix;
|
return ChartHelper.prefix + "index_name" + ChartHelper.suffix;
|
||||||
} else if (currentValue == stakeholder.index_id) {
|
} else if (currentValue == stakeholder.index_id) {
|
||||||
parameters["index_id"] = stakeholder.index_id;
|
|
||||||
return ChartHelper.prefix + "index_id" + ChartHelper.suffix;
|
return ChartHelper.prefix + "index_id" + ChartHelper.suffix;
|
||||||
} else if (currentValue == stakeholder.index_shortName) {
|
} else if (currentValue == stakeholder.index_shortName) {
|
||||||
parameters["index_shortName"] = stakeholder.index_shortName;
|
|
||||||
return ChartHelper.prefix + "index_shortName" + ChartHelper.suffix;
|
return ChartHelper.prefix + "index_shortName" + ChartHelper.suffix;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private extractStartYear(obj, indicatorPath: IndicatorPath) {
|
private extractStartYear(obj, indicatorPath: IndicatorPath) {
|
||||||
let start_year;
|
let start_year;
|
||||||
for (let query of obj[this.getDescriptionObjectName(obj)][this.getQueryObjectName(obj)]) {
|
for (let query of obj[this.getDescriptionObjectName(obj)][this.getQueryObjectName(obj)]) {
|
||||||
|
@ -965,6 +922,10 @@ export class IndicatorUtils {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private addProfile(indicatorPath: IndicatorPath) {
|
||||||
|
indicatorPath.parameters['statsProfile'] = null;
|
||||||
|
}
|
||||||
|
|
||||||
private parameterizeDefaultQuery(obj, indicatorPath: IndicatorPath, stakeholder: Stakeholder) {
|
private parameterizeDefaultQuery(obj, indicatorPath: IndicatorPath, stakeholder: Stakeholder) {
|
||||||
let name = "";
|
let name = "";
|
||||||
for (let query of this.getQueryObjectName(obj) ? obj[this.getDescriptionObjectName(obj)][this.getQueryObjectName(obj)] : obj[this.getDescriptionObjectName(obj)]) {
|
for (let query of this.getQueryObjectName(obj) ? obj[this.getDescriptionObjectName(obj)][this.getQueryObjectName(obj)] : obj[this.getDescriptionObjectName(obj)]) {
|
||||||
|
@ -991,13 +952,10 @@ export class IndicatorUtils {
|
||||||
for (let i of index) {
|
for (let i of index) {
|
||||||
if (name.split('.').length > 3 && name.split('.')[3] == "id") {
|
if (name.split('.').length > 3 && name.split('.')[3] == "id") {
|
||||||
parameters[i] = ChartHelper.prefix + "index_id" + ChartHelper.suffix;
|
parameters[i] = ChartHelper.prefix + "index_id" + ChartHelper.suffix;
|
||||||
indicatorPath.parameters["index_id"] = stakeholder.index_id;
|
|
||||||
} else if (name.split('.').length > 3 && name.split('.')[3] == "shortname") {
|
} else if (name.split('.').length > 3 && name.split('.')[3] == "shortname") {
|
||||||
parameters[i] = ChartHelper.prefix + "index_shortName" + ChartHelper.suffix;
|
parameters[i] = ChartHelper.prefix + "index_shortName" + ChartHelper.suffix;
|
||||||
indicatorPath.parameters["index_shortName"] = stakeholder.index_shortName.toLowerCase();
|
|
||||||
} else if (name.split('.').length > 3 && name.split('.')[3] == "name") {
|
} else if (name.split('.').length > 3 && name.split('.')[3] == "name") {
|
||||||
parameters[i] = ChartHelper.prefix + "index_name" + ChartHelper.suffix;
|
parameters[i] = ChartHelper.prefix + "index_name" + ChartHelper.suffix;
|
||||||
indicatorPath.parameters["index_name"] = stakeholder.index_name;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import {SafeResourceUrl} from "@angular/platform-browser";
|
import {SafeResourceUrl} from "@angular/platform-browser";
|
||||||
import {properties} from "../../../../environments/environment";
|
|
||||||
import {Session, User} from "../../login/utils/helper.class";
|
import {Session, User} from "../../login/utils/helper.class";
|
||||||
|
import {StringUtils} from "../../utils/string-utils.class";
|
||||||
|
|
||||||
export const ChartHelper = {
|
export const ChartHelper = {
|
||||||
prefix: "((__",
|
prefix: "((__",
|
||||||
|
@ -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,8 +51,20 @@ 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 = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static checkIsUpload(response: Stakeholder | Stakeholder[]): any | any[] {
|
||||||
|
if (Array.isArray(response)) {
|
||||||
|
response.forEach(value => {
|
||||||
|
value.isUpload = value.logoUrl && !StringUtils.isValidUrl(value.logoUrl);
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
response.isUpload = response.logoUrl && !StringUtils.isValidUrl(response.logoUrl);
|
||||||
|
}
|
||||||
|
return response;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export class StakeholderInfo extends Stakeholder {
|
export class StakeholderInfo extends Stakeholder {
|
||||||
|
@ -172,6 +185,7 @@ export class Indicator {
|
||||||
visibility: Visibility;
|
visibility: Visibility;
|
||||||
defaultId: string;
|
defaultId: string;
|
||||||
indicatorPaths: IndicatorPath[];
|
indicatorPaths: IndicatorPath[];
|
||||||
|
activePath: number = 0;
|
||||||
overlay: Overlay = false;
|
overlay: Overlay = false;
|
||||||
|
|
||||||
constructor(name: string, description: string, additionalDescription:string, type: IndicatorType, width: IndicatorSize,height: IndicatorSize, visibility: Visibility, indicatorPaths: IndicatorPath[], defaultId: string = null) {
|
constructor(name: string, description: string, additionalDescription:string, type: IndicatorType, width: IndicatorSize,height: IndicatorSize, visibility: Visibility, indicatorPaths: IndicatorPath[], defaultId: string = null) {
|
||||||
|
@ -282,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];
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,10 +50,9 @@ export abstract class MonitorIndicatorStakeholderBaseComponent extends Indicator
|
||||||
selectedFromAndToValues: ""
|
selectedFromAndToValues: ""
|
||||||
};
|
};
|
||||||
rangeFilter: RangeFilterComponent;
|
rangeFilter: RangeFilterComponent;
|
||||||
|
minYear = Dates.currentYear - 20;
|
||||||
|
maxYear = Dates.currentYear;
|
||||||
public numberResults: Map<string, number> = new Map<string, number>();
|
public numberResults: Map<string, number> = new Map<string, number>();
|
||||||
public chartsActiveType: Map<string, IndicatorPath> = new Map<string, IndicatorPath>();
|
|
||||||
public currentYear = new Date().getFullYear();
|
|
||||||
public clipboard;
|
public clipboard;
|
||||||
|
|
||||||
/** Services */
|
/** Services */
|
||||||
|
@ -179,12 +178,12 @@ export abstract class MonitorIndicatorStakeholderBaseComponent extends Indicator
|
||||||
|
|
||||||
protected validateYearRange(navigateTo: boolean = false) {
|
protected validateYearRange(navigateTo: boolean = false) {
|
||||||
let validYears = true;
|
let validYears = true;
|
||||||
if (this.periodFilter.selectedToValue && (this.periodFilter.selectedToValue.length == 0 || !Dates.isValidYear(this.periodFilter.selectedToValue, Dates.currentYear - 20, Dates.currentYear))) {
|
if (this.periodFilter.selectedToValue && (this.periodFilter.selectedToValue.length == 0 || !Dates.isValidYear(this.periodFilter.selectedToValue, this.minYear, this.maxYear))) {
|
||||||
this.periodFilter.selectedToValue = Dates.currentYear + "";
|
this.periodFilter.selectedToValue = this.maxYear + "";
|
||||||
validYears = false;
|
validYears = false;
|
||||||
}
|
}
|
||||||
if (this.periodFilter.selectedFromValue && (this.periodFilter.selectedFromValue.length == 0 || !Dates.isValidYear(this.periodFilter.selectedFromValue, Dates.currentYear - 20, Dates.currentYear))) {
|
if (this.periodFilter.selectedFromValue && (this.periodFilter.selectedFromValue.length == 0 || !Dates.isValidYear(this.periodFilter.selectedFromValue, this.minYear, this.maxYear))) {
|
||||||
this.periodFilter.selectedFromValue = Dates.currentYear - 20 + "";
|
this.periodFilter.selectedFromValue = this.minYear + "";
|
||||||
validYears = false;
|
validYears = false;
|
||||||
}
|
}
|
||||||
if (this.periodFilter.selectedFromValue && this.periodFilter.selectedFromValue.length && this.periodFilter.selectedToValue && this.periodFilter.selectedToValue.length > 0 && parseInt(this.periodFilter.selectedFromValue, 10) > parseInt(this.periodFilter.selectedToValue, 10)) {
|
if (this.periodFilter.selectedFromValue && this.periodFilter.selectedFromValue.length && this.periodFilter.selectedToValue && this.periodFilter.selectedToValue.length > 0 && parseInt(this.periodFilter.selectedFromValue, 10) > parseInt(this.periodFilter.selectedToValue, 10)) {
|
||||||
|
@ -208,19 +207,23 @@ export abstract class MonitorIndicatorStakeholderBaseComponent extends Indicator
|
||||||
}
|
}
|
||||||
|
|
||||||
protected setIndicators() {
|
protected setIndicators() {
|
||||||
|
this.activeSubCategory.numbers = this.activeSubCategory.numbers.filter(section => section.indicators.length > 0);
|
||||||
|
this.activeSubCategory.charts = this.activeSubCategory.charts.filter(section => section.indicators.length > 0);
|
||||||
this.periodFilter.selectedFromAndToValues = (this.periodFilter.selectedFromValue || this.periodFilter.selectedToValue ? ((this.periodFilter.selectedFromValue && !this.periodFilter.selectedToValue ? "From " : "") + (!this.periodFilter.selectedFromValue && this.periodFilter.selectedToValue ? "Until " : "") + (this.periodFilter.selectedFromValue ? this.periodFilter.selectedFromValue : "") +
|
this.periodFilter.selectedFromAndToValues = (this.periodFilter.selectedFromValue || this.periodFilter.selectedToValue ? ((this.periodFilter.selectedFromValue && !this.periodFilter.selectedToValue ? "From " : "") + (!this.periodFilter.selectedFromValue && this.periodFilter.selectedToValue ? "Until " : "") + (this.periodFilter.selectedFromValue ? this.periodFilter.selectedFromValue : "") +
|
||||||
(this.periodFilter.selectedFromValue && this.periodFilter.selectedToValue ? " - " : "") + (this.periodFilter.selectedToValue ? this.periodFilter.selectedToValue : "")) : "");
|
(this.periodFilter.selectedFromValue && this.periodFilter.selectedToValue ? " - " : "") + (this.periodFilter.selectedToValue ? this.periodFilter.selectedToValue : "")) : "");
|
||||||
//clear numbers when filters change
|
//clear numbers when filters change
|
||||||
this.numberResults.clear();
|
this.numberResults.clear();
|
||||||
let urls: Map<string, [number, number][]> = new Map<string, [number, number][]>();
|
let urls: Map<string, [number, number, number][]> = new Map<string, [number, number, number][]>();
|
||||||
this.activeSubCategory.numbers.forEach((section, i) => {
|
this.activeSubCategory.numbers.forEach((section, i) => {
|
||||||
section.indicators.forEach((number, j) => {
|
section.indicators.forEach((number, j) => {
|
||||||
if (this.hasPermission(number.visibility)) {
|
if (this.hasPermission(number.visibility)) {
|
||||||
let url = this.getFullUrl(number.indicatorPaths[0]);
|
number.indicatorPaths.forEach((indicatorPath, k) => {
|
||||||
const pair = JSON.stringify([number.indicatorPaths[0].source, url]);
|
let url = this.getFullUrl(indicatorPath);
|
||||||
|
const pair = JSON.stringify([indicatorPath.source, url]);
|
||||||
const indexes = urls.get(pair) ? urls.get(pair) : [];
|
const indexes = urls.get(pair) ? urls.get(pair) : [];
|
||||||
indexes.push([i, j]);
|
indexes.push([i, j, k]);
|
||||||
urls.set(pair, indexes);
|
urls.set(pair, indexes);
|
||||||
|
})
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -229,10 +232,10 @@ export abstract class MonitorIndicatorStakeholderBaseComponent extends Indicator
|
||||||
let activeSubcategory = this.activeSubCategory._id;
|
let activeSubcategory = this.activeSubCategory._id;
|
||||||
this.subscriptions.push(this.statisticsService.getNumbers(this.indicatorUtils.getSourceType(pair[0]), pair[1]).subscribe(response => {
|
this.subscriptions.push(this.statisticsService.getNumbers(this.indicatorUtils.getSourceType(pair[0]), pair[1]).subscribe(response => {
|
||||||
if(activeSubcategory === this.activeSubCategory._id) {
|
if(activeSubcategory === this.activeSubCategory._id) {
|
||||||
indexes.forEach(([i, j]) => {
|
indexes.forEach(([i, j, k]) => {
|
||||||
if( this.activeSubCategory?.numbers[i]?.indicators[j]) {
|
if( this.activeSubCategory?.numbers[i]?.indicators[j]) {
|
||||||
let result = JSON.parse(JSON.stringify(response));
|
let result = JSON.parse(JSON.stringify(response));
|
||||||
this.activeSubCategory.numbers[i].indicators[j].indicatorPaths[0].jsonPath.forEach(jsonPath => {
|
this.activeSubCategory.numbers[i].indicators[j].indicatorPaths[k].jsonPath.forEach(jsonPath => {
|
||||||
if (result) {
|
if (result) {
|
||||||
result = result[jsonPath];
|
result = result[jsonPath];
|
||||||
}
|
}
|
||||||
|
@ -245,7 +248,7 @@ export abstract class MonitorIndicatorStakeholderBaseComponent extends Indicator
|
||||||
} else {
|
} else {
|
||||||
result = 0;
|
result = 0;
|
||||||
}
|
}
|
||||||
this.numberResults.set(i + '-' + j, result);
|
this.numberResults.set(i + '-' + j + '-' + k, result);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -253,10 +256,9 @@ export abstract class MonitorIndicatorStakeholderBaseComponent extends Indicator
|
||||||
});
|
});
|
||||||
this.activeSubCategory.charts.forEach((section, i) => {
|
this.activeSubCategory.charts.forEach((section, i) => {
|
||||||
section.indicators.forEach((indicator, j) => {
|
section.indicators.forEach((indicator, j) => {
|
||||||
if (indicator.indicatorPaths.length > 0) {
|
indicator.indicatorPaths.forEach((indicatorPath, k) => {
|
||||||
indicator.indicatorPaths[0].safeResourceUrl = this.getUrlByStakeHolder(indicator.indicatorPaths[0]);
|
indicator.indicatorPaths[k].safeResourceUrl = this.getUrlByStakeHolder(indicator.indicatorPaths[k]);
|
||||||
this.chartsActiveType.set(i + '-' + j, indicator.indicatorPaths[0]);
|
});
|
||||||
}
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
if (this.cdr && !(this.cdr as ViewRef).destroyed) {
|
if (this.cdr && !(this.cdr as ViewRef).destroyed) {
|
||||||
|
@ -269,10 +271,12 @@ export abstract class MonitorIndicatorStakeholderBaseComponent extends Indicator
|
||||||
this.indicatorUtils.getChartUrl(indicatorPath.source, this.getFullUrl(indicatorPath)));
|
this.indicatorUtils.getChartUrl(indicatorPath.source, this.getFullUrl(indicatorPath)));
|
||||||
}
|
}
|
||||||
|
|
||||||
public setActiveChart(i: number, j: number, type: string) {
|
public getActiveIndicatorPath(indicator: Indicator) {
|
||||||
let activeChart = this.activeSubCategory.charts[i].indicators[j].indicatorPaths.filter(indicatorPath => indicatorPath.type === type)[0];
|
if(indicator.activePath) {
|
||||||
activeChart.safeResourceUrl = this.getUrlByStakeHolder(activeChart);
|
return indicator.indicatorPaths[indicator.activePath];
|
||||||
this.chartsActiveType.set(i + '-' + j, activeChart);
|
} else {
|
||||||
|
return indicator.indicatorPaths[0];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public filter() {
|
public filter() {
|
||||||
|
|
|
@ -1,17 +1,21 @@
|
||||||
import {Injectable} from "@angular/core";
|
import {Injectable} from "@angular/core";
|
||||||
import {HttpClient} from "@angular/common/http";
|
import {HttpClient} from "@angular/common/http";
|
||||||
import {BehaviorSubject, from, Observable, Subscriber} from "rxjs";
|
import {BehaviorSubject, from, Observable, Subscriber} from "rxjs";
|
||||||
import {Indicator, Section, Stakeholder, StakeholderInfo, Visibility} from "../entities/stakeholder";
|
import {Indicator, Section, Stakeholder, StakeholderInfo, SubCategory, Visibility} from "../entities/stakeholder";
|
||||||
import {HelperFunctions} from "../../utils/HelperFunctions.class";
|
import {HelperFunctions} from "../../utils/HelperFunctions.class";
|
||||||
import {map} from "rxjs/operators";
|
import {map} from "rxjs/operators";
|
||||||
import {properties} from "../../../../environments/environment";
|
import {properties} from "../../../../environments/environment";
|
||||||
import {CustomOptions} from "../../services/servicesUtils/customOptions.class";
|
import {CustomOptions} from "../../services/servicesUtils/customOptions.class";
|
||||||
import {StringUtils} from "../../utils/string-utils.class";
|
|
||||||
|
|
||||||
export interface Reorder {
|
export interface SectionInfo {
|
||||||
action: 'moved' | 'added' | 'removed',
|
id: string;
|
||||||
target: string,
|
indicators: string[];
|
||||||
ids: string[];
|
}
|
||||||
|
|
||||||
|
export interface MoveIndicator {
|
||||||
|
target: string;
|
||||||
|
from: SectionInfo;
|
||||||
|
to: SectionInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
|
@ -41,7 +45,7 @@ export class StakeholderService {
|
||||||
if (!this.stakeholderSubject.value || this.stakeholderSubject.value.alias !== alias || shouldUpdate) {
|
if (!this.stakeholderSubject.value || this.stakeholderSubject.value.alias !== alias || shouldUpdate) {
|
||||||
this.promise = new Promise<void>((resolve, reject) => {
|
this.promise = new Promise<void>((resolve, reject) => {
|
||||||
this.sub = this.http.get<Stakeholder>(properties.monitorServiceAPIURL + '/stakeholder/' + encodeURIComponent(alias), CustomOptions.registryOptions()).pipe(map(stakeholder => {
|
this.sub = this.http.get<Stakeholder>(properties.monitorServiceAPIURL + '/stakeholder/' + encodeURIComponent(alias), CustomOptions.registryOptions()).pipe(map(stakeholder => {
|
||||||
return this.formalize(this.checkIsUpload(stakeholder));
|
return HelperFunctions.copy(Stakeholder.checkIsUpload(stakeholder));
|
||||||
})).subscribe(stakeholder => {
|
})).subscribe(stakeholder => {
|
||||||
this.stakeholderSubject.next(stakeholder);
|
this.stakeholderSubject.next(stakeholder);
|
||||||
resolve();
|
resolve();
|
||||||
|
@ -53,11 +57,12 @@ export class StakeholderService {
|
||||||
}
|
}
|
||||||
return from(this.getStakeholderAsync());
|
return from(this.getStakeholderAsync());
|
||||||
}
|
}
|
||||||
|
|
||||||
getResearcherStakeholder(orcid, name, results, shouldUpdate: boolean = false): Observable<Stakeholder> {
|
getResearcherStakeholder(orcid, name, results, shouldUpdate: boolean = false): Observable<Stakeholder> {
|
||||||
if (!this.stakeholderSubject.value || this.stakeholderSubject.value.alias !== orcid || shouldUpdate) {
|
if (!this.stakeholderSubject.value || this.stakeholderSubject.value.alias !== orcid || shouldUpdate) {
|
||||||
this.promise = new Promise<void>((resolve, reject) => {
|
this.promise = new Promise<void>((resolve, reject) => {
|
||||||
this.sub = this.http.get<Stakeholder>(properties.monitorServiceAPIURL + '/stakeholder/' + encodeURIComponent("researcher"), CustomOptions.registryOptions()).pipe(map(stakeholder => {
|
this.sub = this.http.get<Stakeholder>(properties.monitorServiceAPIURL + '/stakeholder/' + encodeURIComponent("researcher"), CustomOptions.registryOptions()).pipe(map(stakeholder => {
|
||||||
return this.formalize(this.checkIsUpload(stakeholder));
|
return HelperFunctions.copy(Stakeholder.checkIsUpload(stakeholder));
|
||||||
})).subscribe(stakeholder => {
|
})).subscribe(stakeholder => {
|
||||||
stakeholder.index_id = orcid;
|
stakeholder.index_id = orcid;
|
||||||
stakeholder.index_name = name;
|
stakeholder.index_name = name;
|
||||||
|
@ -89,34 +94,38 @@ export class StakeholderService {
|
||||||
|
|
||||||
getAlias(url: string): Observable<string[]> {
|
getAlias(url: string): Observable<string[]> {
|
||||||
return this.http.get<Stakeholder[]>(url + '/stakeholder/alias', CustomOptions.registryOptions()).pipe(map(stakeholders => {
|
return this.http.get<Stakeholder[]>(url + '/stakeholder/alias', CustomOptions.registryOptions()).pipe(map(stakeholders => {
|
||||||
return this.formalize(stakeholders);
|
return HelperFunctions.copy(stakeholders);
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
getStakeholders(url: string, type: string = null, defaultId: string = null): Observable<(Stakeholder & StakeholderInfo)[]> {
|
getStakeholders(url: string, type: string = null, defaultId: string = null): Observable<(Stakeholder & StakeholderInfo)[]> {
|
||||||
return this.http.get<Stakeholder[]>(url + '/stakeholder' + ((type) ? ('?type=' + type) : '') + ((!type && defaultId) ? ('?defaultId=' + defaultId) : ''), CustomOptions.registryOptions()).pipe(map(stakeholders => {
|
return this.http.get<Stakeholder[]>(url + '/stakeholder' + ((type) ? ('?type=' + type) : '') + ((!type && defaultId) ? ('?defaultId=' + defaultId) : ''), CustomOptions.registryOptions()).pipe(map(stakeholders => {
|
||||||
return this.formalize(this.checkIsUpload(stakeholders));
|
return HelperFunctions.copy(Stakeholder.checkIsUpload(stakeholders));
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
getMyStakeholders(url: string, type: string = null): Observable<(Stakeholder & StakeholderInfo)[]> {
|
getMyStakeholders(url: string, type: string = null): Observable<(Stakeholder & StakeholderInfo)[]> {
|
||||||
return this.http.get<Stakeholder[]>(url + '/my-stakeholder' + ((type) ? ('?type=' + type) : ''), CustomOptions.registryOptions()).pipe(map(stakeholders => {
|
return this.http.get<Stakeholder[]>(url + '/my-stakeholder' + ((type) ? ('?type=' + type) : ''), CustomOptions.registryOptions()).pipe(map(stakeholders => {
|
||||||
return this.formalize(this.checkIsUpload(stakeholders));
|
return HelperFunctions.copy(Stakeholder.checkIsUpload(stakeholders));
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
getDefaultStakeholders(url: string, type: string = null): Observable<Stakeholder[]> {
|
getDefaultStakeholders(url: string, type: string = null): Observable<Stakeholder[]> {
|
||||||
return this.http.get<Stakeholder[]>(url + '/stakeholder/default' + ((type) ? ('?type=' + type) : ''), CustomOptions.registryOptions()).pipe(map(stakeholders => {
|
return this.http.get<Stakeholder[]>(url + '/stakeholder/default' + ((type) ? ('?type=' + type) : ''), CustomOptions.registryOptions()).pipe(map(stakeholders => {
|
||||||
return this.formalize(this.checkIsUpload(stakeholders));
|
return HelperFunctions.copy(Stakeholder.checkIsUpload(stakeholders));
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
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 = {
|
||||||
return this.formalize(this.checkIsUpload(stakeholder));
|
stakeholder: stakeholder,
|
||||||
|
copyId: copyId
|
||||||
|
}
|
||||||
|
return this.http.post<Stakeholder>(url + '/build-stakeholder', copy, CustomOptions.registryOptions()).pipe(map(stakeholder => {
|
||||||
|
return HelperFunctions.copy(Stakeholder.checkIsUpload(stakeholder));
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -124,43 +133,39 @@ 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);
|
||||||
}
|
}
|
||||||
path = HelperFunctions.encodeArray(path);
|
|
||||||
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 this.formalize(this.checkIsUpload(element));
|
return HelperFunctions.copy(Stakeholder.checkIsUpload(element));
|
||||||
} else {
|
} else {
|
||||||
return this.formalize(element);
|
return HelperFunctions.copy(element);
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
saveBulkElements(url: string, indicators, path: string[] = []): Observable<any> {
|
saveBulkElements(url: string, indicators, path: string[] = []): Observable<any> {
|
||||||
path = HelperFunctions.encodeArray(path);
|
|
||||||
return this.http.post<any>(url + ((path.length > 0) ? '/' : '') + path.join('/') +
|
return this.http.post<any>(url + ((path.length > 0) ? '/' : '') + path.join('/') +
|
||||||
'/save-bulk', indicators, CustomOptions.registryOptions()).pipe(map(element => {
|
'/save-bulk', indicators, CustomOptions.registryOptions()).pipe(map(element => {
|
||||||
if (path.length === 0) {
|
if (path.length === 0) {
|
||||||
return this.formalize(this.checkIsUpload(element));
|
return HelperFunctions.copy(Stakeholder.checkIsUpload(element));
|
||||||
} else {
|
} else {
|
||||||
return this.formalize(element);
|
return HelperFunctions.copy(element);
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
saveSection(url: string, element: any, path: string[] = [], index: number = -1): Observable<Section> {
|
saveSection(url: string, element: any, path: string[] = [], index: number = -1): Observable<Section> {
|
||||||
path = HelperFunctions.encodeArray(path);
|
|
||||||
return this.http.post<Section>(url + ((path.length > 0) ? '/' : '') + path.join('/') +
|
return this.http.post<Section>(url + ((path.length > 0) ? '/' : '') + path.join('/') +
|
||||||
'/save/' + index, element, CustomOptions.registryOptions()).pipe(map(element => {
|
'/save/' + index, element, CustomOptions.registryOptions()).pipe(map(element => {
|
||||||
return this.formalize(element);
|
return HelperFunctions.copy(element);
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
deleteElement(url: string, path: string[], childrenAction: string = null): Observable<any> {
|
deleteElement(url: string, path: string[], childrenAction: string = null): Observable<any> {
|
||||||
path = HelperFunctions.encodeArray(path);
|
|
||||||
let params: string = "";
|
let params: string = "";
|
||||||
if (childrenAction) {
|
if (childrenAction) {
|
||||||
params = "?children=" + childrenAction;
|
params = "?children=" + childrenAction;
|
||||||
|
@ -169,14 +174,18 @@ export class StakeholderService {
|
||||||
}
|
}
|
||||||
|
|
||||||
reorderElements(url: string, path: string[], ids: string[]): Observable<any> {
|
reorderElements(url: string, path: string[], ids: string[]): Observable<any> {
|
||||||
path = HelperFunctions.encodeArray(path);
|
|
||||||
return this.http.post<any>(url + '/' + path.join('/') + '/reorder', ids, CustomOptions.registryOptions());
|
return this.http.post<any>(url + '/' + path.join('/') + '/reorder', ids, CustomOptions.registryOptions());
|
||||||
}
|
}
|
||||||
|
|
||||||
reorderIndicators(url: string, path: string[], reorder: Reorder, type: string = 'chart'): Observable<Indicator[]> {
|
reorderIndicators(url: string, path: string[], indicators: string[]): Observable<Indicator[]> {
|
||||||
path = HelperFunctions.encodeArray(path);
|
return this.http.post<Indicator[]>(url + '/' + path.join('/') + '/reorder', indicators, CustomOptions.registryOptions()).pipe(map(indicators => {
|
||||||
return this.http.post<Indicator[]>(url + '/' + path.join('/') + '/' + type + '/reorder', reorder, CustomOptions.registryOptions()).pipe(map(indicators => {
|
return HelperFunctions.copy(indicators);
|
||||||
return this.formalize(indicators);
|
}));
|
||||||
|
}
|
||||||
|
|
||||||
|
moveIndicator(url: string, path: string[], moveIndicator: MoveIndicator): Observable<SubCategory> {
|
||||||
|
return this.http.post<SubCategory>(url + '/' + path.join('/') + '/moveIndicator', moveIndicator, CustomOptions.registryOptions()).pipe(map(subCategory => {
|
||||||
|
return HelperFunctions.copy(subCategory);
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -187,19 +196,4 @@ export class StakeholderService {
|
||||||
setStakeholder(stakeholder: Stakeholder) {
|
setStakeholder(stakeholder: Stakeholder) {
|
||||||
this.stakeholderSubject.next(stakeholder);
|
this.stakeholderSubject.next(stakeholder);
|
||||||
}
|
}
|
||||||
|
|
||||||
private checkIsUpload(response: Stakeholder | Stakeholder[]): any | any[] {
|
|
||||||
if (Array.isArray(response)) {
|
|
||||||
response.forEach(value => {
|
|
||||||
value.isUpload = value.logoUrl && !StringUtils.isValidUrl(value.logoUrl);
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
response.isUpload = response.logoUrl && !StringUtils.isValidUrl(response.logoUrl);
|
|
||||||
}
|
|
||||||
return response;
|
|
||||||
}
|
|
||||||
|
|
||||||
private formalize(element: any) {
|
|
||||||
return HelperFunctions.copy(element);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,17 @@
|
||||||
|
import { NgModule } from '@angular/core';
|
||||||
|
import { RouterModule } from '@angular/router';
|
||||||
|
import {LoginGuard} from "../../login/loginGuard.guard";
|
||||||
|
import {PreviousRouteRecorder} from "../../utils/piwik/previousRouteRecorder.guard";
|
||||||
|
import {MyOrcidLinksComponent} from "./myOrcidLinks.component";
|
||||||
|
|
||||||
|
@NgModule({
|
||||||
|
imports: [
|
||||||
|
RouterModule.forChild([
|
||||||
|
{ path: '', component: MyOrcidLinksComponent,
|
||||||
|
canActivate: [LoginGuard], canDeactivate: [PreviousRouteRecorder]
|
||||||
|
}
|
||||||
|
|
||||||
|
])
|
||||||
|
]
|
||||||
|
})
|
||||||
|
export class MyOrcidLinksRoutingModule { }
|
|
@ -9,14 +9,15 @@ import {MyOrcidLinksComponent} from "./myOrcidLinks.component";
|
||||||
import {SearchResearchResultsServiceModule} from "../../services/searchResearchResultsService.module";
|
import {SearchResearchResultsServiceModule} from "../../services/searchResearchResultsService.module";
|
||||||
import {SearchMyOrcidResultsModule} from "./searchMyOrcidResults.module";
|
import {SearchMyOrcidResultsModule} from "./searchMyOrcidResults.module";
|
||||||
import {AlertModalModule} from "../../utils/modal/alertModal.module";
|
import {AlertModalModule} from "../../utils/modal/alertModal.module";
|
||||||
import {PiwikServiceModule} from "../../utils/piwik/piwikService.module";
|
import {MyOrcidLinksRoutingModule} from "./myOrcidLinks-routing.module";
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [
|
imports: [
|
||||||
CommonModule, FormsModule,
|
CommonModule, FormsModule,
|
||||||
|
MyOrcidLinksRoutingModule,
|
||||||
RouterModule, ErrorMessagesModule,
|
RouterModule, ErrorMessagesModule,
|
||||||
ResultPreviewModule, SearchResearchResultsServiceModule, SearchMyOrcidResultsModule,
|
ResultPreviewModule, SearchResearchResultsServiceModule, SearchMyOrcidResultsModule,
|
||||||
AlertModalModule, PiwikServiceModule
|
AlertModalModule
|
||||||
],
|
],
|
||||||
declarations: [
|
declarations: [
|
||||||
MyOrcidLinksComponent
|
MyOrcidLinksComponent
|
||||||
|
|
|
@ -6,15 +6,15 @@ import {RouterModule} from '@angular/router';
|
||||||
import {ResultPreviewModule} from "../../utils/result-preview/result-preview.module";
|
import {ResultPreviewModule} from "../../utils/result-preview/result-preview.module";
|
||||||
import {ErrorMessagesModule} from "../../utils/errorMessages.module";
|
import {ErrorMessagesModule} from "../../utils/errorMessages.module";
|
||||||
import {searcMyOrcidResultsComponent} from "./searchMyOrcidResults.component";
|
import {searcMyOrcidResultsComponent} from "./searchMyOrcidResults.component";
|
||||||
import {OrcidModule} from "../orcid.module";
|
|
||||||
import {NoLoadPaging} from "../../searchPages/searchUtils/no-load-paging.module";
|
import {NoLoadPaging} from "../../searchPages/searchUtils/no-load-paging.module";
|
||||||
import {PagingModule} from "../../utils/paging.module";
|
import {PagingModule} from "../../utils/paging.module";
|
||||||
|
import {OrcidCoreModule} from "../orcid-core.module";
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [
|
imports: [
|
||||||
CommonModule, FormsModule,
|
CommonModule, FormsModule,
|
||||||
RouterModule, ErrorMessagesModule,
|
RouterModule, ErrorMessagesModule,
|
||||||
ResultPreviewModule, OrcidModule, NoLoadPaging, PagingModule
|
ResultPreviewModule, OrcidCoreModule, NoLoadPaging, PagingModule
|
||||||
],
|
],
|
||||||
declarations: [
|
declarations: [
|
||||||
searcMyOrcidResultsComponent
|
searcMyOrcidResultsComponent
|
||||||
|
|
|
@ -0,0 +1,43 @@
|
||||||
|
import {NgModule} from '@angular/core';
|
||||||
|
import {CommonModule} from '@angular/common';
|
||||||
|
|
||||||
|
import {RouterModule} from '@angular/router';
|
||||||
|
|
||||||
|
import {OrcidComponent} from './orcid.component';
|
||||||
|
import {OrcidService} from './orcid.service';
|
||||||
|
import {OrcidWorkComponent} from './orcid-work.component';
|
||||||
|
import {AlertModalModule} from '../utils/modal/alertModal.module';
|
||||||
|
import {ResultLandingService} from '../landingPages/result/resultLanding.service';
|
||||||
|
import {LoadingModule} from '../utils/loading/loading.module';
|
||||||
|
import {ResultLandingUtilsModule} from '../landingPages/landing-utils/resultLandingUtils.module';
|
||||||
|
import {IconsModule} from '../utils/icons/icons.module';
|
||||||
|
import {IconsService} from "../utils/icons/icons.service";
|
||||||
|
import {orcid_add, orcid_bin} from "../utils/icons/icons";
|
||||||
|
import {FullScreenModalModule} from "../utils/modal/full-screen-modal/full-screen-modal.module";
|
||||||
|
import {LogServiceModule} from "../utils/log/LogService.module";
|
||||||
|
import {OrcidRoutingModule} from "./orcid-routing.module";
|
||||||
|
|
||||||
|
@NgModule({
|
||||||
|
imports: [
|
||||||
|
CommonModule, RouterModule, AlertModalModule, LoadingModule, ResultLandingUtilsModule,
|
||||||
|
IconsModule, FullScreenModalModule, LogServiceModule
|
||||||
|
],
|
||||||
|
declarations: [
|
||||||
|
OrcidComponent,
|
||||||
|
OrcidWorkComponent
|
||||||
|
],
|
||||||
|
providers:[
|
||||||
|
OrcidService, ResultLandingService
|
||||||
|
],
|
||||||
|
exports: [
|
||||||
|
OrcidComponent,
|
||||||
|
OrcidWorkComponent
|
||||||
|
]
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
export class OrcidCoreModule{
|
||||||
|
constructor(private iconsService: IconsService) {
|
||||||
|
this.iconsService.registerIcons([orcid_add, orcid_bin])
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,16 @@
|
||||||
|
import { NgModule } from '@angular/core';
|
||||||
|
import { RouterModule } from '@angular/router';
|
||||||
|
import {LoginGuard} from "../login/loginGuard.guard";
|
||||||
|
import {PreviousRouteRecorder} from "../utils/piwik/previousRouteRecorder.guard";
|
||||||
|
import {OrcidComponent} from './orcid.component';
|
||||||
|
|
||||||
|
@NgModule({
|
||||||
|
imports: [
|
||||||
|
RouterModule.forChild([
|
||||||
|
{ path: '', component: OrcidComponent,
|
||||||
|
canActivate: [LoginGuard],
|
||||||
|
canDeactivate: [PreviousRouteRecorder] }
|
||||||
|
])
|
||||||
|
]
|
||||||
|
})
|
||||||
|
export class OrcidRoutingModule { }
|
|
@ -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";
|
||||||
|
@ -22,88 +22,54 @@ declare var UIkit: any;
|
||||||
template: `
|
template: `
|
||||||
<ng-container *ngIf="pageType == 'landing' || pageType == 'search'">
|
<ng-container *ngIf="pageType == 'landing' || pageType == 'search'">
|
||||||
<span *ngIf="!putCodes || putCodes.length == 0"
|
<span *ngIf="!putCodes || putCodes.length == 0"
|
||||||
(click)="currentAction='add'; saveWorkPreparation();"
|
|
||||||
[class.uk-disabled]="showLoading || !isLoggedIn || (!pids && (!identifiers || identifiers.size == 0))"
|
|
||||||
[class.clickable]="!showLoading && isLoggedIn && (pids || (identifiers && identifiers.size > 0))"
|
|
||||||
[ngClass]="isMobile && pageType == 'landing' ? ' uk-width-1-1' : ''"
|
[ngClass]="isMobile && pageType == 'landing' ? ' uk-width-1-1' : ''"
|
||||||
[attr.uk-tooltip]="isMobile? 'cls: uk-invisible' : 'pos: bottom; cls: uk-active uk-text-small uk-padding-small'"
|
[attr.uk-tooltip]="isMobile? 'cls: uk-invisible' : 'pos: bottom; cls: uk-active uk-text-small uk-padding-small'"
|
||||||
[title]="((!pids && (!identifiers || identifiers.size == 0)) || !isLoggedIn) ? ((!pids && (!identifiers || identifiers.size == 0)) ? tooltipNoPid : tooltipNoLoggedInUser) : tooltipAdd">
|
[title]="(noPids || !isLoggedIn) ? ((noPids) ? tooltipNoPid : tooltipNoLoggedInUser) : tooltipAdd">
|
||||||
|
<span (click)="currentAction='add'; saveWorkPreparation();"
|
||||||
|
[class.uk-disabled]="isDisabled"
|
||||||
|
[class.clickable]="!isDisabled">
|
||||||
<a class="uk-flex uk-flex-middle uk-button-link"
|
<a class="uk-flex uk-flex-middle uk-button-link"
|
||||||
[ngClass]="isMobile && !(pageType == 'landing') ? 'uk-margin-left' : ''"
|
[ngClass]="isMobile && !(pageType == 'landing') ? 'uk-margin-left' : ''"
|
||||||
[class.uk-text-bolder]="!(isMobile && pageType == 'landing')"
|
[class.uk-text-bolder]="!(isMobile && pageType == 'landing')"
|
||||||
[class.uk-text-muted]="showLoading || !isLoggedIn || (!pids && (!identifiers || identifiers.size == 0))"
|
[class.uk-text-muted]="isDisabled">
|
||||||
(mouseover)="hoverEvent($event)" (mouseout)="hoverEvent($event)">
|
<icon *ngIf="!showLoading" [class.text-orcid]="properties.environment != 'beta' && !showLoading && isLoggedIn && (pids || identifiers?.size > 0)"
|
||||||
<icon *ngIf="!showLoading" [class.text-orcid]="!showLoading && isLoggedIn && (pids || identifiers?.size > 0)"
|
[class.uk-text-muted]="isDisabled"
|
||||||
[class.uk-text-muted]="showLoading || !isLoggedIn || (!pids && (!identifiers || identifiers.size == 0))"
|
|
||||||
name="orcid_add" [ratio]="(isMobile && pageType == 'search') ? 0.7 : 1" visuallyHidden="add"></icon>
|
name="orcid_add" [ratio]="(isMobile && pageType == 'search') ? 0.7 : 1" visuallyHidden="add"></icon>
|
||||||
<span *ngIf="showLoading" class="uk-icon"><loading
|
<span *ngIf="showLoading" class="uk-icon"><loading
|
||||||
[top_margin]="false" [size]="'small'"></loading></span>
|
[top_margin]="false" [size]="'small'"></loading></span>
|
||||||
<span [ngClass]="(isMobile && pageType == 'landing') ? 'uk-margin-small-left' : 'uk-margin-xsmall-left'">Claim</span>
|
<span [ngClass]="(isMobile && pageType == 'landing') ? 'uk-margin-small-left' : 'uk-margin-xsmall-left'">Claim</span>
|
||||||
</a>
|
</a>
|
||||||
<div *ngIf="isMobile && pageType == 'landing'" class="uk-margin-xsmall-top uk-padding uk-padding-remove-vertical uk-text-meta uk-text-xsmall"
|
<div *ngIf="isMobile && pageType == 'landing'" class="uk-margin-xsmall-top uk-padding uk-padding-remove-vertical uk-text-meta uk-text-xsmall"
|
||||||
[innerHTML]="((!pids && (!identifiers || identifiers.size == 0)) || !isLoggedIn) ? ((!pids && (!identifiers || identifiers.size == 0)) ? tooltipNoPid : tooltipNoLoggedInUser) : tooltipAdd"></div>
|
[innerHTML]="(noPids || !isLoggedIn) ? ((noPids) ? tooltipNoPid : tooltipNoLoggedInUser) : tooltipAdd"></div>
|
||||||
|
</span>
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
<span *ngIf="putCodes && putCodes.length > 0"
|
<span *ngIf="putCodes && putCodes.length > 0" [ngClass]="isMobile && pageType == 'landing' ? ' uk-width-1-1' : ''"
|
||||||
(click)="currentAction='delete'; deleteWorks();"
|
|
||||||
[class.uk-disabled]="showLoading || !isLoggedIn || (!pids && (!identifiers || identifiers.size == 0))"
|
|
||||||
[class.clickable]="!showLoading && isLoggedIn && (pids || (identifiers && identifiers.size > 0))"
|
|
||||||
[ngClass]="isMobile && pageType == 'landing' ? ' uk-width-1-1' : ''"
|
|
||||||
[attr.uk-tooltip]="isMobile? 'cls: uk-invisible' : 'pos: bottom; cls: uk-active uk-text-small uk-padding-small'"
|
[attr.uk-tooltip]="isMobile? 'cls: uk-invisible' : 'pos: bottom; cls: uk-active uk-text-small uk-padding-small'"
|
||||||
[title]="((!pids && (!identifiers || identifiers.size == 0)) || !isLoggedIn) ? ((!pids && (!identifiers || identifiers.size == 0)) ? tooltipNoPid : tooltipNoLoggedInUser) : tooltipDelete">
|
[title]="(noPids || !isLoggedIn) ? ((noPids) ? tooltipNoPid : tooltipNoLoggedInUser) : tooltipDelete">
|
||||||
|
<span (click)="currentAction='delete'; deleteWorks();"
|
||||||
|
[class.uk-disabled]="isDisabled"
|
||||||
|
[class.clickable]="!isDisabled">
|
||||||
<a class="uk-flex uk-flex-middle uk-button-link"
|
<a class="uk-flex uk-flex-middle uk-button-link"
|
||||||
[ngClass]="isMobile && !(pageType == 'landing') ? 'uk-margin-left' : ''"
|
[ngClass]="isMobile && !(pageType == 'landing') ? 'uk-margin-left' : ''"
|
||||||
[class.uk-text-bolder]="!(isMobile && pageType == 'landing')"
|
[class.uk-text-bolder]="!(isMobile && pageType == 'landing')"
|
||||||
[class.uk-text-muted]="showLoading || !isLoggedIn || (!pids && (!identifiers || identifiers.size == 0))"
|
[class.uk-text-muted]="isDisabled">
|
||||||
(mouseover)="hoverEvent($event, 'delete')" (mouseout)="hoverEvent($event, 'delete')">
|
|
||||||
<icon *ngIf="!showLoading" [class.text-orcid]="!showLoading && isLoggedIn && (pids || identifiers?.size > 0)"
|
<icon *ngIf="!showLoading" [class.text-orcid]="!showLoading && isLoggedIn && (pids || identifiers?.size > 0)"
|
||||||
[class.uk-text-muted]="showLoading || !isLoggedIn || (!pids && (!identifiers || identifiers.size == 0))"
|
[class.uk-text-muted]="isDisabled"
|
||||||
name="orcid_bin" [ratio]="(isMobile && pageType == 'search') ? 0.7 : 1" visuallyHidden="delete"></icon>
|
name="orcid_bin" [ratio]="(isMobile && pageType == 'search') ? 0.7 : 1" visuallyHidden="delete"></icon>
|
||||||
<span *ngIf="showLoading" class="uk-icon"><loading
|
<span *ngIf="showLoading" class="uk-icon"><loading
|
||||||
[top_margin]="false" [size]="'small'"></loading></span>
|
[top_margin]="false" [size]="'small'"></loading></span>
|
||||||
<span [ngClass]="(isMobile && pageType == 'landing') ? 'uk-margin-small-left' : 'uk-margin-xsmall-left'">Remove</span>
|
<span [ngClass]="(isMobile && pageType == 'landing') ? 'uk-margin-small-left' : 'uk-margin-xsmall-left'">Remove</span>
|
||||||
</a>
|
</a>
|
||||||
<div *ngIf="isMobile && pageType == 'landing'" class="uk-margin-xsmall-top uk-padding uk-padding-remove-vertical uk-text-meta uk-text-xsmall"
|
<div *ngIf="isMobile && pageType == 'landing'" class="uk-margin-xsmall-top uk-padding uk-padding-remove-vertical uk-text-meta uk-text-xsmall"
|
||||||
[innerHTML]="((!pids && (!identifiers || identifiers.size == 0)) || !isLoggedIn) ? ((!pids && (!identifiers || identifiers.size == 0)) ? tooltipNoPid : tooltipNoLoggedInUser) : tooltipDelete"></div>
|
[innerHTML]="(noPids || !isLoggedIn) ? ((noPids) ? tooltipNoPid : tooltipNoLoggedInUser) : tooltipDelete"></div>
|
||||||
|
</span>
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
<!-- Old 'remove' code -->
|
|
||||||
<!-- <span *ngIf="putCodes && putCodes.length > 0"
|
|
||||||
[attr.uk-tooltip]="'pos: bottom; cls: uk-active uk-text-small uk-padding-small'"
|
|
||||||
[title]="(!pids || !isLoggedIn) ? (!pids ? tooltipNoPid : tooltipNoLoggedInUser) : tooltipDelete">
|
|
||||||
<a *ngIf="!showLoading" (click)="currentAction='delete'; deleteWorks();"
|
|
||||||
class="uk-icon-button uk-icon landing-action-button landing-action-button-orcid"
|
|
||||||
[class.uk-disabled]="showLoading || !isLoggedIn || !pids"
|
|
||||||
(mouseover)="hoverEvent($event, 'delete')" (mouseout)="hoverEvent($event, 'delete')">
|
|
||||||
<icon *ngIf="!hoverDelete" name="orcid_bin" ratio="1.1" visuallyHidden="delete"></icon>
|
|
||||||
<icon *ngIf="hoverDelete" name="delete_outline" class="uk-text-danger" visuallyHidden="delete"></icon>
|
|
||||||
</a>
|
|
||||||
<span *ngIf="showLoading" class="uk-icon icon-button uk-icon-button-small"><loading
|
|
||||||
[top_margin]="false" [size]="'small'"></loading></span>
|
|
||||||
</span> -->
|
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
|
||||||
<modal-alert *ngIf="!isMobile" #grantModal [overflowBody]=false (alertOutput)="openGrantWindow()">
|
<modal-alert *ngIf="!isMobile" #grantModal [overflowBody]=false (alertOutput)="openGrantWindow()">
|
||||||
<div>
|
<div>
|
||||||
<div>{{requestGrantMessage}}</div>
|
<div>{{requestGrantMessage}}</div>
|
||||||
|
|
||||||
<!-- <div class="uk-margin-medium-top uk-align-right">-->
|
|
||||||
<!-- <button (click)="closeGrantModal()" type="submit"-->
|
|
||||||
<!-- class="uk-button uk-padding-small uk-padding-remove-vertical uk-button-default">-->
|
|
||||||
<!-- <span>Cancel</span>-->
|
|
||||||
<!-- </button>-->
|
|
||||||
|
|
||||||
<!-- <button (click)="openGrantWindow()" type="submit"-->
|
|
||||||
<!-- class="uk-button uk-padding-small uk-padding-remove-vertical uk-margin-left uk-button-primary">-->
|
|
||||||
<!-- <span>Grant OpenAIRE</span>-->
|
|
||||||
<!-- </button>-->
|
|
||||||
|
|
||||||
<!--<!– <button (click)="openGrantWindow()" type="submit"–>-->
|
|
||||||
<!--<!– class="uk-button uk-padding-small uk-padding-remove-vertical uk-margin-left orcid-button">–>-->
|
|
||||||
<!--<!– <img src="assets/common-assets/common/ORCIDiD_icon16x16.png" alt="">{{" "}}–>-->
|
|
||||||
<!--<!– <span>Create or Connect your ORCID iD</span>–>-->
|
|
||||||
<!--<!– </button>–>-->
|
|
||||||
<!-- </div>-->
|
|
||||||
</div>
|
</div>
|
||||||
</modal-alert>
|
</modal-alert>
|
||||||
|
|
||||||
|
@ -119,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>
|
||||||
|
|
||||||
|
@ -292,18 +258,6 @@ declare var UIkit: any;
|
||||||
instead.
|
instead.
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- <div class="uk-margin-medium-top uk-align-right">-->
|
|
||||||
<!-- <button (click)="closePropagationModal()" type="submit"-->
|
|
||||||
<!-- class="uk-button uk-padding-small uk-padding-remove-vertical uk-button-default">-->
|
|
||||||
<!-- <span>Cancel</span>-->
|
|
||||||
<!-- </button>-->
|
|
||||||
|
|
||||||
<!-- <button (click)="confirmedPropagation()" type="submit"-->
|
|
||||||
<!-- class="uk-button uk-padding-small uk-padding-remove-vertical uk-margin-left uk-button-primary">-->
|
|
||||||
<!-- <span>Continue</span>-->
|
|
||||||
<!-- </button>-->
|
|
||||||
<!-- </div>-->
|
|
||||||
</modal-alert>
|
</modal-alert>
|
||||||
|
|
||||||
<fs-modal #propagationFsModal classTitle="uk-tile-default uk-border-bottom">
|
<fs-modal #propagationFsModal classTitle="uk-tile-default uk-border-bottom">
|
||||||
|
@ -369,9 +323,6 @@ export class OrcidWorkComponent {
|
||||||
public hasConsent: boolean = false;
|
public hasConsent: boolean = false;
|
||||||
public currentAction: string = "";
|
public currentAction: string = "";
|
||||||
|
|
||||||
public hoverAdd: boolean = false;
|
|
||||||
public hoverDelete: boolean = false;
|
|
||||||
|
|
||||||
public properties: EnvProperties = properties;
|
public properties: EnvProperties = properties;
|
||||||
public openaireEntities = OpenaireEntities;
|
public openaireEntities = OpenaireEntities;
|
||||||
|
|
||||||
|
@ -379,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
|
||||||
|
@ -391,6 +343,7 @@ export class OrcidWorkComponent {
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
|
if(this.properties.environment != 'beta') {
|
||||||
this.subscriptions.push(this.userManagementService.getUserInfo().subscribe(user => {
|
this.subscriptions.push(this.userManagementService.getUserInfo().subscribe(user => {
|
||||||
if (user) {
|
if (user) {
|
||||||
this.isLoggedIn = true;
|
this.isLoggedIn = true;
|
||||||
|
@ -411,6 +364,7 @@ export class OrcidWorkComponent {
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ngOnDestroy() {
|
ngOnDestroy() {
|
||||||
this.subscriptions.forEach(subscription => {
|
this.subscriptions.forEach(subscription => {
|
||||||
|
@ -491,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 => {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -572,6 +528,8 @@ 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!";
|
||||||
|
@ -748,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);
|
||||||
|
@ -895,12 +855,17 @@ export class OrcidWorkComponent {
|
||||||
this.showLoading = false;
|
this.showLoading = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get tooltipBETA() {
|
||||||
|
// return "Login to the production environment to add works to your <span class=\"text-orcid\">ORCID</span> record";
|
||||||
|
return "Add or delete a work from your <span class=\"text-orcid\">ORCID</span> record. This feature is not available on BETA.";
|
||||||
|
}
|
||||||
|
|
||||||
get tooltipAdd() {
|
get tooltipAdd() {
|
||||||
return "Add this work to your <span class=\"text-orcid\">ORCID</span> record" + ((properties.environment == "beta") ? ". The action will affect your real ORCID iD." : "");
|
return (properties.environment == "beta") ? this.tooltipBETA : ("Add this work to your <span class=\"text-orcid\">ORCID</span> record" + ((properties.environment == "test") ? ". The action will affect your real ORCID iD." : ""));
|
||||||
}
|
}
|
||||||
|
|
||||||
get tooltipDelete() {
|
get tooltipDelete() {
|
||||||
return "Delete this work from your <span class=\"text-orcid\">ORCID</span> record" + ((properties.environment == "beta") ? ". The action will affect your real ORCID iD." : "");
|
return "Delete this work from your <span class=\"text-orcid\">ORCID</span> record" + ((properties.environment == "test") ? ". The action will affect your real ORCID iD." : "");
|
||||||
}
|
}
|
||||||
|
|
||||||
get tooltipNoPid() {
|
get tooltipNoPid() {
|
||||||
|
@ -908,16 +873,14 @@ export class OrcidWorkComponent {
|
||||||
}
|
}
|
||||||
|
|
||||||
get tooltipNoLoggedInUser() {
|
get tooltipNoLoggedInUser() {
|
||||||
return "Add or delete a work from your <span class=\"text-orcid\">ORCID</span> record. Please log in first."
|
return (properties.environment == "beta") ? this.tooltipBETA : "Add or delete a work from your <span class=\"text-orcid\">ORCID</span> record. Please log in first."
|
||||||
}
|
}
|
||||||
|
|
||||||
hoverEvent($event, action: string = "add") {
|
get isDisabled() {
|
||||||
if (action == "add") {
|
return (this.properties.environment == 'beta' || this.showLoading || !this.isLoggedIn || (!this.pids && (!this.identifiers || this.identifiers.size == 0)));
|
||||||
this.hoverAdd = $event.type == "mouseover";
|
}
|
||||||
this.hoverDelete = false;
|
|
||||||
} else if (action == "delete") {
|
get noPids() {
|
||||||
this.hoverDelete = $event.type == "mouseover";
|
return (!this.pids && (!this.identifiers || this.identifiers.size == 0));
|
||||||
this.hoverAdd = false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,45 +1,15 @@
|
||||||
import {NgModule} from '@angular/core';
|
import {NgModule} from '@angular/core';
|
||||||
import {CommonModule} from '@angular/common';
|
|
||||||
|
|
||||||
import {RouterModule} from '@angular/router';
|
|
||||||
|
|
||||||
import {OrcidComponent} from './orcid.component';
|
|
||||||
import {OrcidService} from './orcid.service';
|
|
||||||
import {FreeGuard} from '../login/freeGuard.guard';
|
|
||||||
import {PreviousRouteRecorder} from '../utils/piwik/previousRouteRecorder.guard';
|
|
||||||
import {OrcidWorkComponent} from './orcid-work.component';
|
|
||||||
import {AlertModalModule} from '../utils/modal/alertModal.module';
|
|
||||||
import {ResultLandingService} from '../landingPages/result/resultLanding.service';
|
|
||||||
import {LoadingModule} from '../utils/loading/loading.module';
|
|
||||||
import {ResultLandingUtilsModule} from '../landingPages/landing-utils/resultLandingUtils.module';
|
|
||||||
import {IconsModule} from '../utils/icons/icons.module';
|
|
||||||
import {IconsService} from "../utils/icons/icons.service";
|
import {IconsService} from "../utils/icons/icons.service";
|
||||||
import {orcid_add, orcid_bin} from "../utils/icons/icons";
|
import {orcid_add, orcid_bin} from "../utils/icons/icons";
|
||||||
import {FullScreenModalModule} from "../utils/modal/full-screen-modal/full-screen-modal.module";
|
import {OrcidRoutingModule} from "./orcid-routing.module";
|
||||||
import {LogServiceModule} from "../utils/log/LogService.module";
|
import {OrcidCoreModule} from "./orcid-core.module";
|
||||||
|
import {OrcidComponent} from "./orcid.component";
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [
|
imports: [OrcidCoreModule, OrcidRoutingModule],
|
||||||
CommonModule, RouterModule, AlertModalModule, LoadingModule, ResultLandingUtilsModule,
|
exports: [OrcidComponent]
|
||||||
IconsModule, FullScreenModalModule, LogServiceModule
|
|
||||||
],
|
|
||||||
declarations: [
|
|
||||||
OrcidComponent,
|
|
||||||
OrcidWorkComponent
|
|
||||||
],
|
|
||||||
providers:[
|
|
||||||
FreeGuard, PreviousRouteRecorder,
|
|
||||||
OrcidService, ResultLandingService
|
|
||||||
],
|
|
||||||
exports: [
|
|
||||||
OrcidComponent,
|
|
||||||
OrcidWorkComponent
|
|
||||||
]
|
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
export class OrcidModule{
|
export class OrcidModule{
|
||||||
constructor(private iconsService: IconsService) {
|
|
||||||
this.iconsService.registerIcons([orcid_add, orcid_bin])
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,18 @@
|
||||||
|
import { NgModule } from '@angular/core';
|
||||||
|
import { RouterModule } from '@angular/router';
|
||||||
|
import {LoginGuard} from "../../login/loginGuard.guard";
|
||||||
|
import {PreviousRouteRecorder} from "../../utils/piwik/previousRouteRecorder.guard";
|
||||||
|
import {SearchRecommendedResultsForOrcidComponent} from "./searchRecommendedResultsForOrcid.component";
|
||||||
|
|
||||||
|
@NgModule({
|
||||||
|
imports: [
|
||||||
|
RouterModule.forChild([
|
||||||
|
{ path: '', component: SearchRecommendedResultsForOrcidComponent,
|
||||||
|
canActivate: [LoginGuard],
|
||||||
|
canDeactivate: [PreviousRouteRecorder]
|
||||||
|
}
|
||||||
|
|
||||||
|
])
|
||||||
|
]
|
||||||
|
})
|
||||||
|
export class SearchRecommendedResultsForOrcidRoutingModule { }
|
|
@ -8,22 +8,23 @@ import {SearchRecommendedResultsForOrcidComponent} from './searchRecommendedResu
|
||||||
import {SearchResultsModule } from '../../searchPages/searchUtils/searchResults.module';
|
import {SearchResultsModule } from '../../searchPages/searchUtils/searchResults.module';
|
||||||
|
|
||||||
import {SearchFormModule} from '../../searchPages/searchUtils/searchForm.module';
|
import {SearchFormModule} from '../../searchPages/searchUtils/searchForm.module';
|
||||||
import {IsRouteEnabled} from '../../error/isRouteEnabled.guard';
|
|
||||||
import {SearchResearchResultsModule} from "../../searchPages/searchResearchResults.module";
|
import {SearchResearchResultsModule} from "../../searchPages/searchResearchResults.module";
|
||||||
import {OrcidService} from "../orcid.service";
|
import {OrcidService} from "../orcid.service";
|
||||||
|
import {SearchRecommendedResultsForOrcidRoutingModule} from "./searchRecommendedResultsForOrcid-routing.module";
|
||||||
// import {BreadcrumbsModule} from "../utils/breadcrumbs/breadcrumbs.module";
|
// import {BreadcrumbsModule} from "../utils/breadcrumbs/breadcrumbs.module";
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [
|
imports: [
|
||||||
CommonModule, FormsModule,
|
CommonModule, FormsModule,
|
||||||
RouterModule,
|
RouterModule,
|
||||||
|
SearchRecommendedResultsForOrcidRoutingModule,
|
||||||
SearchFormModule, SearchResearchResultsModule,
|
SearchFormModule, SearchResearchResultsModule,
|
||||||
// , BreadcrumbsModule
|
// , BreadcrumbsModule
|
||||||
],
|
],
|
||||||
declarations: [
|
declarations: [
|
||||||
SearchRecommendedResultsForOrcidComponent
|
SearchRecommendedResultsForOrcidComponent
|
||||||
],
|
],
|
||||||
providers:[ IsRouteEnabled, OrcidService],
|
providers:[OrcidService],
|
||||||
exports: [
|
exports: [
|
||||||
SearchRecommendedResultsForOrcidComponent
|
SearchRecommendedResultsForOrcidComponent
|
||||||
]
|
]
|
||||||
|
|
|
@ -6,8 +6,6 @@ import { RouterModule } from '@angular/router';
|
||||||
import{ReloadRoutingModule } from './reload-routing.module';
|
import{ReloadRoutingModule } from './reload-routing.module';
|
||||||
import{ReloadComponent} from './reload.component';
|
import{ReloadComponent} from './reload.component';
|
||||||
|
|
||||||
|
|
||||||
import {PreviousRouteRecorder} from '../utils/piwik/previousRouteRecorder.guard';
|
|
||||||
import {LoadingModule} from "../utils/loading/loading.module";
|
import {LoadingModule} from "../utils/loading/loading.module";
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
|
@ -19,9 +17,7 @@ import {LoadingModule} from "../utils/loading/loading.module";
|
||||||
declarations: [
|
declarations: [
|
||||||
ReloadComponent
|
ReloadComponent
|
||||||
],
|
],
|
||||||
providers:[
|
providers:[],
|
||||||
PreviousRouteRecorder
|
|
||||||
],
|
|
||||||
exports: [
|
exports: [
|
||||||
ReloadComponent
|
ReloadComponent
|
||||||
]
|
]
|
||||||
|
|
|
@ -12,6 +12,8 @@ import {EmailService} from "../utils/email/email.service";
|
||||||
import {Composer} from "../utils/email/composer";
|
import {Composer} from "../utils/email/composer";
|
||||||
import {ClearCacheService} from "../services/clear-cache.service";
|
import {ClearCacheService} from "../services/clear-cache.service";
|
||||||
import {BaseComponent} from "../sharedComponents/base/base.component";
|
import {BaseComponent} from "../sharedComponents/base/base.component";
|
||||||
|
import {StakeholderUtils} from "../monitor-admin/utils/indicator-utils";
|
||||||
|
import {StringUtils} from "../utils/string-utils.class";
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'role-verification',
|
selector: 'role-verification',
|
||||||
|
@ -19,12 +21,9 @@ import {BaseComponent} from "../sharedComponents/base/base.component";
|
||||||
<modal-alert #managerModal [overflowBody]="false" (alertOutput)="verifyManager()" (cancelOutput)="cancel()"
|
<modal-alert #managerModal [overflowBody]="false" (alertOutput)="verifyManager()" (cancelOutput)="cancel()"
|
||||||
[okDisabled]="code.invalid || loading">
|
[okDisabled]="code.invalid || loading">
|
||||||
<div>
|
<div>
|
||||||
You have been invited to join <span
|
You have been invited to join <span class="uk-text-bold">{{name}}</span> {{(dashboard)}} Dashboard as a {{stakeholderUtils.roles.manager}}.
|
||||||
class="uk-text-bold">{{name}}</span> {{(service === 'monitor' ? 'Monitor' : 'Research Community')}} Dashboard
|
|
||||||
as a manager.
|
|
||||||
<span class="uk-text-primary">Fill</span> in the <span class="uk-text-primary">verification code</span>, sent to
|
<span class="uk-text-primary">Fill</span> in the <span class="uk-text-primary">verification code</span>, sent to
|
||||||
your
|
your email, to accept the invitation request.
|
||||||
email, to accept the invitation request.
|
|
||||||
</div>
|
</div>
|
||||||
<div *ngIf="!loading" class="uk-margin-medium-top uk-flex uk-flex-center">
|
<div *ngIf="!loading" class="uk-margin-medium-top uk-flex uk-flex-center">
|
||||||
<div input [formInput]="code" class="uk-width-medium" placeholder="Verification code">
|
<div input [formInput]="code" class="uk-width-medium" placeholder="Verification code">
|
||||||
|
@ -36,14 +35,12 @@ import {BaseComponent} from "../sharedComponents/base/base.component";
|
||||||
</div>
|
</div>
|
||||||
</modal-alert>
|
</modal-alert>
|
||||||
<modal-alert #memberModal [overflowBody]="false" (cancelOutput)="cancel()"
|
<modal-alert #memberModal [overflowBody]="false" (cancelOutput)="cancel()"
|
||||||
(alertOutput)="verifyMember()" [okDisabled]="(code.invalid || loading) && !isMember">
|
(alertOutput)="verifyMember()" [okDisabled]="(code.invalid || loading)">
|
||||||
<div *ngIf="!isMember">
|
|
||||||
<div>
|
<div>
|
||||||
You have been invited to join <span class="uk-text-bold">{{name}}</span> Monitor Dashboard as a member.
|
<div>
|
||||||
|
You have been invited to join <span class="uk-text-bold">{{name}}</span> {{(dashboard)}} Dashboard as a {{stakeholderUtils.roles.member}}.
|
||||||
<span class="uk-text-primary">Fill</span> in the <span class="uk-text-primary">verification code</span>, sent
|
<span class="uk-text-primary">Fill</span> in the <span class="uk-text-primary">verification code</span>, sent
|
||||||
to
|
to your email, to accept the invitation request.
|
||||||
your
|
|
||||||
email, to accept the invitation request.
|
|
||||||
</div>
|
</div>
|
||||||
<div *ngIf="!loading" class="uk-margin-medium-top uk-flex uk-flex-wrap uk-flex-center">
|
<div *ngIf="!loading" class="uk-margin-medium-top uk-flex uk-flex-wrap uk-flex-center">
|
||||||
<div input [formInput]="code" class="uk-width-medium" placeholder="Verification code">
|
<div input [formInput]="code" class="uk-width-medium" placeholder="Verification code">
|
||||||
|
@ -54,13 +51,6 @@ import {BaseComponent} from "../sharedComponents/base/base.component";
|
||||||
<loading></loading>
|
<loading></loading>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div *ngIf="isMember">
|
|
||||||
<div>
|
|
||||||
Welcome! You are now a member of the OpenAIRE Monitor Dashboard for the <span
|
|
||||||
class="uk-text-bold">{{name}}</span>!
|
|
||||||
From now on, you will have access to our restricted content.
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</modal-alert>
|
</modal-alert>
|
||||||
<modal-alert #errorModal (alertOutput)="cancel()" [overflowBody]="false">
|
<modal-alert #errorModal (alertOutput)="cancel()" [overflowBody]="false">
|
||||||
<div>
|
<div>
|
||||||
|
@ -83,7 +73,7 @@ export class RoleVerificationComponent extends BaseComponent implements OnInit,
|
||||||
public id: string;
|
public id: string;
|
||||||
@Input()
|
@Input()
|
||||||
set type(type: string) {
|
set type(type: string) {
|
||||||
this._type = Role.GROUP + type;
|
this._type = Role.GROUP + Role.mapType(type);
|
||||||
}
|
}
|
||||||
@Input()
|
@Input()
|
||||||
public name: string;
|
public name: string;
|
||||||
|
@ -93,6 +83,10 @@ export class RoleVerificationComponent extends BaseComponent implements OnInit,
|
||||||
public userInfoLinkPrefix = '';
|
public userInfoLinkPrefix = '';
|
||||||
@Input()
|
@Input()
|
||||||
public userInfoLink = null;
|
public userInfoLink = null;
|
||||||
|
@Input()
|
||||||
|
public relativeTo: ActivatedRoute = this._route;
|
||||||
|
@Input()
|
||||||
|
public dashboard: string = 'Research Community';
|
||||||
public user: User;
|
public user: User;
|
||||||
public verification: any;
|
public verification: any;
|
||||||
public code: UntypedFormControl;
|
public code: UntypedFormControl;
|
||||||
|
@ -103,7 +97,7 @@ export class RoleVerificationComponent extends BaseComponent implements OnInit,
|
||||||
@ViewChild('errorModal') errorModal: AlertModal;
|
@ViewChild('errorModal') errorModal: AlertModal;
|
||||||
public error: string = null;
|
public error: string = null;
|
||||||
public loading: boolean = false;
|
public loading: boolean = false;
|
||||||
public isMember: boolean = false;
|
public stakeholderUtils: StakeholderUtils = new StakeholderUtils();
|
||||||
|
|
||||||
constructor(protected _route: ActivatedRoute,
|
constructor(protected _route: ActivatedRoute,
|
||||||
protected _router: Router,
|
protected _router: Router,
|
||||||
|
@ -121,12 +115,17 @@ export class RoleVerificationComponent extends BaseComponent implements OnInit,
|
||||||
}
|
}
|
||||||
|
|
||||||
ngAfterViewInit() {
|
ngAfterViewInit() {
|
||||||
|
this.init();
|
||||||
|
}
|
||||||
|
|
||||||
|
init() {
|
||||||
|
this.ngOnDestroy();
|
||||||
this.subscriptions.push(this.userManagementService.getUserInfo().subscribe(user => {
|
this.subscriptions.push(this.userManagementService.getUserInfo().subscribe(user => {
|
||||||
this.user = user;
|
this.user = user;
|
||||||
this.paramsSubscription = this._route.queryParams.subscribe(params => {
|
this.paramsSubscription = this._route.queryParams.subscribe(params => {
|
||||||
if (params) {
|
if (params) {
|
||||||
this.cdr.detectChanges();
|
this.cdr.detectChanges();
|
||||||
if(params['verify'] && !this.isMember) {
|
if(params['verify']) {
|
||||||
if (this.user) {
|
if (this.user) {
|
||||||
this.subscriptions.push(this.userRegistryService.getInvitation(params['verify']).subscribe(verification => {
|
this.subscriptions.push(this.userRegistryService.getInvitation(params['verify']).subscribe(verification => {
|
||||||
this.verification = verification;
|
this.verification = verification;
|
||||||
|
@ -150,14 +149,11 @@ export class RoleVerificationComponent extends BaseComponent implements OnInit,
|
||||||
'errorCode': LoginErrorCodes.NOT_LOGIN,
|
'errorCode': LoginErrorCodes.NOT_LOGIN,
|
||||||
'redirectUrl': this._router.url
|
'redirectUrl': this._router.url
|
||||||
},
|
},
|
||||||
relativeTo: this._route
|
relativeTo: this.relativeTo
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
} else if(this.isMember) {
|
|
||||||
this.openMemberModal();
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
this.isMember = false;
|
|
||||||
this.cdr.detectChanges();
|
this.cdr.detectChanges();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -177,23 +173,18 @@ export class RoleVerificationComponent extends BaseComponent implements OnInit,
|
||||||
this.managerModal.okButtonText = 'Accept';
|
this.managerModal.okButtonText = 'Accept';
|
||||||
this.managerModal.stayOpen = true;
|
this.managerModal.stayOpen = true;
|
||||||
this.managerModal.cancelButtonText = 'Cancel';
|
this.managerModal.cancelButtonText = 'Cancel';
|
||||||
this.managerModal.alertTitle = 'Manager Invitation';
|
this.managerModal.alertTitle = StringUtils.capitalize(this.stakeholderUtils.roles.manager) + ' Invitation';
|
||||||
this.managerModal.open();
|
this.managerModal.open();
|
||||||
}
|
}
|
||||||
|
|
||||||
public openMemberModal() {
|
public openMemberModal() {
|
||||||
this.error = null;
|
this.error = null;
|
||||||
if(this.isMember) {
|
|
||||||
this.memberModal.cancelButton = false;
|
|
||||||
this.memberModal.okButtonText = 'Close';
|
|
||||||
} else {
|
|
||||||
this.memberModal.cancelButton = true;
|
this.memberModal.cancelButton = true;
|
||||||
this.memberModal.okButtonText = 'Accept';
|
this.memberModal.okButtonText = 'Accept';
|
||||||
}
|
|
||||||
this.memberModal.okButtonLeft = false;
|
this.memberModal.okButtonLeft = false;
|
||||||
this.memberModal.stayOpen = true;
|
this.memberModal.stayOpen = true;
|
||||||
this.memberModal.cancelButtonText = 'Cancel';
|
this.memberModal.cancelButtonText = 'Cancel';
|
||||||
this.memberModal.alertTitle = 'Member Invitation';
|
this.memberModal.alertTitle = StringUtils.capitalize(this.stakeholderUtils.roles.member) + ' Invitation';
|
||||||
this.cdr.detectChanges();
|
this.cdr.detectChanges();
|
||||||
this.memberModal.open();
|
this.memberModal.open();
|
||||||
}
|
}
|
||||||
|
@ -212,16 +203,9 @@ export class RoleVerificationComponent extends BaseComponent implements OnInit,
|
||||||
this.clearCacheService.clearCache('Managers updated');
|
this.clearCacheService.clearCache('Managers updated');
|
||||||
this.managerModal.cancel();
|
this.managerModal.cancel();
|
||||||
this.error = null;
|
this.error = null;
|
||||||
this.userManagementService.updateUserInfo(() => {
|
if(this.service === "irish" || this.service === "monitor") {
|
||||||
if (this.paramsSubscription instanceof Subscription) {
|
|
||||||
this.paramsSubscription.unsubscribe();
|
|
||||||
}
|
|
||||||
if(this.service === "irish") {
|
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
this.userManagementService.login(properties.domain + '/admin/' + this.verification.entity);
|
this.userManagementService.login(properties.domain + '/admin/' + this.verification.entity);
|
||||||
} else if (this.service === "monitor" ) {
|
|
||||||
this.loading = false;
|
|
||||||
this._router.navigate(['/admin/' + this.verification.entity]);
|
|
||||||
} else {
|
} else {
|
||||||
this.subscriptions.push(this.emailService.notifyManagers(this.id, 'manager',
|
this.subscriptions.push(this.emailService.notifyManagers(this.id, 'manager',
|
||||||
Composer.composeEmailToInformOldManagersForTheNewOnes(this.name, this.id)).subscribe(() => {
|
Composer.composeEmailToInformOldManagersForTheNewOnes(this.name, this.id)).subscribe(() => {
|
||||||
|
@ -242,7 +226,6 @@ export class RoleVerificationComponent extends BaseComponent implements OnInit,
|
||||||
window.location.href = properties.adminPortalURL + '/' + this.verification.entity;
|
window.location.href = properties.adminPortalURL + '/' + this.verification.entity;
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
});
|
|
||||||
}, error => {
|
}, error => {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
this.error = 'The verification code is invalid';
|
this.error = 'The verification code is invalid';
|
||||||
|
@ -251,25 +234,16 @@ export class RoleVerificationComponent extends BaseComponent implements OnInit,
|
||||||
|
|
||||||
public verifyMember() {
|
public verifyMember() {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
if (!this.isMember) {
|
|
||||||
this.subscriptions.push(this.userRegistryService.verify(this.verification.id, this.code.value, "member").subscribe(() => {
|
this.subscriptions.push(this.userRegistryService.verify(this.verification.id, this.code.value, "member").subscribe(() => {
|
||||||
this.clearCacheService.clearCache('Members updated');
|
this.clearCacheService.clearCache('Members updated');
|
||||||
|
this.memberModal.cancel();
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
this.error = null;
|
this.error = null;
|
||||||
this.isMember = true;
|
window.location.href = window.location.href.split('?')[0];
|
||||||
this.userManagementService.updateUserInfo(() => {
|
|
||||||
if (this.paramsSubscription instanceof Subscription) {
|
|
||||||
this.paramsSubscription.unsubscribe();
|
|
||||||
}
|
|
||||||
this.cancel();
|
|
||||||
});
|
|
||||||
}, error => {
|
}, error => {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
this.error = 'The verification code is invalid';
|
this.error = 'The verification code is invalid';
|
||||||
}));
|
}));
|
||||||
} else {
|
|
||||||
this.memberModal.cancel();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public reset() {
|
public reset() {
|
||||||
|
@ -277,7 +251,6 @@ export class RoleVerificationComponent extends BaseComponent implements OnInit,
|
||||||
}
|
}
|
||||||
|
|
||||||
cancel() {
|
cancel() {
|
||||||
this.isMember = false;
|
|
||||||
this._router.navigate([]);
|
this._router.navigate([]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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>
|
||||||
|
|
|
@ -2,14 +2,11 @@ import {CommonModule} from "@angular/common";
|
||||||
import {NgModule} from "@angular/core";
|
import {NgModule} from "@angular/core";
|
||||||
import {FormsModule} from "@angular/forms";
|
import {FormsModule} from "@angular/forms";
|
||||||
import {RouterModule} from "@angular/router";
|
import {RouterModule} from "@angular/router";
|
||||||
import {PreviousRouteRecorder} from "../utils/piwik/previousRouteRecorder.guard";
|
|
||||||
import {BreadcrumbsModule} from "../utils/breadcrumbs/breadcrumbs.module";
|
import {BreadcrumbsModule} from "../utils/breadcrumbs/breadcrumbs.module";
|
||||||
import {RefineFieldResultsServiceModule} from "../services/refineFieldResultsService.module";
|
import {RefineFieldResultsServiceModule} from "../services/refineFieldResultsService.module";
|
||||||
import {LoadingModule} from "../utils/loading/loading.module";
|
import {LoadingModule} from "../utils/loading/loading.module";
|
||||||
import {Schema2jsonldModule} from "../sharedComponents/schema2jsonld/schema2jsonld.module";
|
import {Schema2jsonldModule} from "../sharedComponents/schema2jsonld/schema2jsonld.module";
|
||||||
import {SEOServiceModule} from "../sharedComponents/SEO/SEOService.module";
|
import {SEOServiceModule} from "../sharedComponents/SEO/SEOService.module";
|
||||||
import {PiwikService} from "../utils/piwik/piwik.service";
|
|
||||||
|
|
||||||
import {SdgRoutingModule} from './sdg-routing.module';
|
import {SdgRoutingModule} from './sdg-routing.module';
|
||||||
import {SdgComponent} from './sdg.component';
|
import {SdgComponent} from './sdg.component';
|
||||||
|
|
||||||
|
@ -22,9 +19,7 @@ import {SdgComponent} from './sdg.component';
|
||||||
declarations: [
|
declarations: [
|
||||||
SdgComponent
|
SdgComponent
|
||||||
],
|
],
|
||||||
providers: [
|
providers: [],
|
||||||
PreviousRouteRecorder, PiwikService
|
|
||||||
],
|
|
||||||
exports: [
|
exports: [
|
||||||
SdgComponent
|
SdgComponent
|
||||||
]
|
]
|
||||||
|
|
|
@ -23,7 +23,8 @@ import {EnvProperties} from '../../utils/properties/env-properties';
|
||||||
import {SEOService} from '../../sharedComponents/SEO/SEO.service';
|
import {SEOService} from '../../sharedComponents/SEO/SEO.service';
|
||||||
import {StringUtils} from '../../utils/string-utils.class';
|
import {StringUtils} from '../../utils/string-utils.class';
|
||||||
import {SearchCustomFilter} from "../searchUtils/searchUtils.class";
|
import {SearchCustomFilter} from "../searchUtils/searchUtils.class";
|
||||||
import {Subscription} from "rxjs";
|
import {combineLatest, Subscription} from "rxjs";
|
||||||
|
import {debounceTime, map} from "rxjs/operators";
|
||||||
import {AdvancedField, Filter} from "../searchUtils/searchHelperClasses.class";
|
import {AdvancedField, Filter} from "../searchUtils/searchHelperClasses.class";
|
||||||
import {SearchResearchResultsComponent} from "../searchResearchResults.component";
|
import {SearchResearchResultsComponent} from "../searchResearchResults.component";
|
||||||
import {SearchProjectsComponent} from "../searchProjects.component";
|
import {SearchProjectsComponent} from "../searchProjects.component";
|
||||||
|
@ -219,9 +220,14 @@ export class SearchAllComponent {
|
||||||
|
|
||||||
loadAll() {
|
loadAll() {
|
||||||
this.reloadTabs();
|
this.reloadTabs();
|
||||||
|
// https://github.com/angular/angular/issues/26764
|
||||||
|
this.subs.push(combineLatest([this.route.params, this.route.queryParams])
|
||||||
|
.pipe(debounceTime(0))
|
||||||
|
.pipe(map(results => ({params: results[0], query: results[1]})))
|
||||||
|
.subscribe(results => {
|
||||||
|
let params = results['params'];
|
||||||
|
let queryParams = results['query'];
|
||||||
|
|
||||||
this.subs.push(this.route.params.subscribe(params => {
|
|
||||||
this.subs.push(this.route.queryParams.subscribe(queryParams => {
|
|
||||||
this.parameters = Object.assign({}, queryParams);
|
this.parameters = Object.assign({}, queryParams);
|
||||||
this.keyword = (queryParams['keyword']) ? queryParams['keyword'] : (queryParams["q"] ? queryParams["q"] : (queryParams["f0"] && queryParams["f0"] == "q" && queryParams["fv0"]?queryParams["fv0"]:""));
|
this.keyword = (queryParams['keyword']) ? queryParams['keyword'] : (queryParams["q"] ? queryParams["q"] : (queryParams["f0"] && queryParams["f0"] == "q" && queryParams["fv0"]?queryParams["fv0"]:""));
|
||||||
this.selectedFields[0].value = StringUtils.URIDecode(this.keyword);
|
this.selectedFields[0].value = StringUtils.URIDecode(this.keyword);
|
||||||
|
@ -237,9 +243,8 @@ export class SearchAllComponent {
|
||||||
active = ((["result","projects","organizations","datasources","services"]).indexOf(queryParams["active"])!= -1)?queryParams["active"]:null;
|
active = ((["result","projects","organizations","datasources","services"]).indexOf(queryParams["active"])!= -1)?queryParams["active"]:null;
|
||||||
delete this.parameters['active'];
|
delete this.parameters['active'];
|
||||||
}
|
}
|
||||||
|
// if(this.activeEntity == null) {
|
||||||
if(this.activeEntity == null) {
|
if (this.activeEntity == null && (!params["entity"] || params["entity"].length == 0) && (!active || this.activeEntity != active)) {
|
||||||
if (this.activeEntity == null && (!params["entity"] || params["entity"].length == 0)) {
|
|
||||||
if (active) {
|
if (active) {
|
||||||
this.activeEntity = active;
|
this.activeEntity = active;
|
||||||
if ((typeof document !== 'undefined')) {
|
if ((typeof document !== 'undefined')) {
|
||||||
|
@ -261,7 +266,7 @@ export class SearchAllComponent {
|
||||||
}
|
}
|
||||||
this.activeEntity = ((["result", "projects", "organizations", "datasources", "services"]).indexOf(entity) != -1) ? entity : this.getDefaultEntityToShow();
|
this.activeEntity = ((["result", "projects", "organizations", "datasources", "services"]).indexOf(entity) != -1) ? entity : this.getDefaultEntityToShow();
|
||||||
}
|
}
|
||||||
}
|
// }
|
||||||
if (this.activeEntity == "result") {
|
if (this.activeEntity == "result") {
|
||||||
this.searchResults();
|
this.searchResults();
|
||||||
} else if (this.activeEntity == "projects") {
|
} else if (this.activeEntity == "projects") {
|
||||||
|
@ -274,7 +279,7 @@ export class SearchAllComponent {
|
||||||
this.searchOrganizations();
|
this.searchOrganizations();
|
||||||
}
|
}
|
||||||
this.count();
|
this.count();
|
||||||
}));
|
// }));
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,6 @@ import {SearchResearchResultsServiceModule} from '../../services/searchResearchR
|
||||||
import {OrganizationsServiceModule} from '../../services/organizationsService.module';
|
import {OrganizationsServiceModule} from '../../services/organizationsService.module';
|
||||||
import {Schema2jsonldModule} from '../../sharedComponents/schema2jsonld/schema2jsonld.module';
|
import {Schema2jsonldModule} from '../../sharedComponents/schema2jsonld/schema2jsonld.module';
|
||||||
|
|
||||||
import {PiwikServiceModule} from '../../utils/piwik/piwikService.module';
|
|
||||||
import { SEOServiceModule } from '../../sharedComponents/SEO/SEOService.module';
|
import { SEOServiceModule } from '../../sharedComponents/SEO/SEOService.module';
|
||||||
import {SearchAllComponent} from "./searchAll.component";
|
import {SearchAllComponent} from "./searchAll.component";
|
||||||
import {AdvancedSearchFormModule} from "../searchUtils/advancedSearchForm.module";
|
import {AdvancedSearchFormModule} from "../searchUtils/advancedSearchForm.module";
|
||||||
|
@ -20,7 +19,6 @@ import {SearchResearchResultsModule} from "../searchResearchResults.module";
|
||||||
import {SearchProjectsModule} from "../searchProjects.module";
|
import {SearchProjectsModule} from "../searchProjects.module";
|
||||||
import {SearchOrganizationsModule} from "../searchOrganizations.module";
|
import {SearchOrganizationsModule} from "../searchOrganizations.module";
|
||||||
import {SearchDataProvidersModule} from "../searchDataProviders.module";
|
import {SearchDataProvidersModule} from "../searchDataProviders.module";
|
||||||
import {PreviousRouteRecorder} from "../../utils/piwik/previousRouteRecorder.guard";
|
|
||||||
import {BreadcrumbsModule} from "../../utils/breadcrumbs/breadcrumbs.module";
|
import {BreadcrumbsModule} from "../../utils/breadcrumbs/breadcrumbs.module";
|
||||||
import {SliderTabsModule} from "../../sharedComponents/tabs/slider-tabs.module";
|
import {SliderTabsModule} from "../../sharedComponents/tabs/slider-tabs.module";
|
||||||
import {NumberRoundModule} from "../../utils/pipes/number-round.module";
|
import {NumberRoundModule} from "../../utils/pipes/number-round.module";
|
||||||
|
@ -31,15 +29,13 @@ import {GroupedRequestsServiceModule} from "../../services/groupedRequestsServic
|
||||||
CommonModule, FormsModule, RouterModule,
|
CommonModule, FormsModule, RouterModule,
|
||||||
DataProvidersServiceModule, ProjectsServiceModule,
|
DataProvidersServiceModule, ProjectsServiceModule,
|
||||||
SearchResearchResultsServiceModule, OrganizationsServiceModule,
|
SearchResearchResultsServiceModule, OrganizationsServiceModule,
|
||||||
SearchResultsModule, PiwikServiceModule, Schema2jsonldModule, SEOServiceModule, AdvancedSearchFormModule, SearchResearchResultsModule, SearchProjectsModule, SearchOrganizationsModule, SearchDataProvidersModule, BreadcrumbsModule, SliderTabsModule, NumberRoundModule,
|
SearchResultsModule, Schema2jsonldModule, SEOServiceModule, AdvancedSearchFormModule, SearchResearchResultsModule, SearchProjectsModule, SearchOrganizationsModule, SearchDataProvidersModule, BreadcrumbsModule, SliderTabsModule, NumberRoundModule,
|
||||||
GroupedRequestsServiceModule
|
GroupedRequestsServiceModule
|
||||||
],
|
],
|
||||||
declarations: [
|
declarations: [
|
||||||
SearchAllComponent
|
SearchAllComponent
|
||||||
],
|
],
|
||||||
providers:[
|
providers:[],
|
||||||
PreviousRouteRecorder
|
|
||||||
],
|
|
||||||
exports: [
|
exports: [
|
||||||
SearchAllComponent
|
SearchAllComponent
|
||||||
]
|
]
|
||||||
|
|
|
@ -57,7 +57,7 @@ export class SearchDataProvidersComponent {
|
||||||
@Input()
|
@Input()
|
||||||
set customFilter(customFilter: SearchCustomFilter | SearchCustomFilter[]) {
|
set customFilter(customFilter: SearchCustomFilter | SearchCustomFilter[]) {
|
||||||
if(!Array.isArray(customFilter)) {
|
if(!Array.isArray(customFilter)) {
|
||||||
this.customFilters = [customFilter];
|
this.customFilters = customFilter?[customFilter]:null;
|
||||||
}else{
|
}else{
|
||||||
this.customFilters = customFilter;
|
this.customFilters = customFilter;
|
||||||
}
|
}
|
||||||
|
@ -370,7 +370,7 @@ export class SearchDataProvidersComponent {
|
||||||
this.searchFiltersSub = this._searchDataProvidersService.advancedSearchDataproviders(this.searchPage.getSearchAPIQueryForAdvancedSearhFields(), 1, 0, properties, fieldsStr, [oldFilter.filterId], this.refineQuery).subscribe(
|
this.searchFiltersSub = this._searchDataProvidersService.advancedSearchDataproviders(this.searchPage.getSearchAPIQueryForAdvancedSearhFields(), 1, 0, properties, fieldsStr, [oldFilter.filterId], this.refineQuery).subscribe(
|
||||||
// this.searchFiltersSub = this._refineFieldsResultsService.getAllRefineFieldResultsByFieldName(oldFilter.filterId, this.entityType, this.properties, this.refineQuery).subscribe(
|
// this.searchFiltersSub = this._refineFieldsResultsService.getAllRefineFieldResultsByFieldName(oldFilter.filterId, this.entityType, this.properties, this.refineQuery).subscribe(
|
||||||
res => {
|
res => {
|
||||||
let filter: Filter = res[1][0];
|
let filter: Filter = res[2][0];
|
||||||
if(filter.values.length == 0) {
|
if(filter.values.length == 0) {
|
||||||
filter = oldFilter;
|
filter = oldFilter;
|
||||||
filter.countAllValues = 0;
|
filter.countAllValues = 0;
|
||||||
|
|
|
@ -33,6 +33,7 @@ import {RefineFieldResultsService} from "../services/refineFieldResults.service"
|
||||||
[includeOnlyResultsAndFilter]="includeOnlyResultsAndFilter"
|
[includeOnlyResultsAndFilter]="includeOnlyResultsAndFilter"
|
||||||
[searchForm]="searchForm"
|
[searchForm]="searchForm"
|
||||||
[sort]="false"
|
[sort]="false"
|
||||||
|
[showRefine]="refineFields?.length > 0"
|
||||||
[filters]="filters"
|
[filters]="filters"
|
||||||
[simpleView]="simpleView" formPlaceholderText="Search by organization name..."
|
[simpleView]="simpleView" formPlaceholderText="Search by organization name..."
|
||||||
[showSwitchSearchLink]="showSwitchSearchLink"
|
[showSwitchSearchLink]="showSwitchSearchLink"
|
||||||
|
@ -66,7 +67,7 @@ export class SearchOrganizationsComponent {
|
||||||
@Input()
|
@Input()
|
||||||
set customFilter(customFilter: SearchCustomFilter | SearchCustomFilter[]) {
|
set customFilter(customFilter: SearchCustomFilter | SearchCustomFilter[]) {
|
||||||
if(!Array.isArray(customFilter)) {
|
if(!Array.isArray(customFilter)) {
|
||||||
this.customFilters = [customFilter];
|
this.customFilters = customFilter?[customFilter]:null;
|
||||||
}else{
|
}else{
|
||||||
this.customFilters = customFilter;
|
this.customFilters = customFilter;
|
||||||
}
|
}
|
||||||
|
@ -329,7 +330,7 @@ export class SearchOrganizationsComponent {
|
||||||
this.searchFiltersSub = this._searchOrganizationsService.advancedSearchOrganizations(this.searchPage.getSearchAPIQueryForAdvancedSearhFields(), 1, 0, properties, fieldsStr, [oldFilter.filterId], this.refineQuery).subscribe(
|
this.searchFiltersSub = this._searchOrganizationsService.advancedSearchOrganizations(this.searchPage.getSearchAPIQueryForAdvancedSearhFields(), 1, 0, properties, fieldsStr, [oldFilter.filterId], this.refineQuery).subscribe(
|
||||||
// this.searchFiltersSub = this._refineFieldsResultsService.getAllRefineFieldResultsByFieldName(oldFilter.filterId, "organization", this.properties, this.refineQuery).subscribe(
|
// this.searchFiltersSub = this._refineFieldsResultsService.getAllRefineFieldResultsByFieldName(oldFilter.filterId, "organization", this.properties, this.refineQuery).subscribe(
|
||||||
res => {
|
res => {
|
||||||
let filter: Filter = res[1][0];
|
let filter: Filter = res[2][0];
|
||||||
if(filter.values.length == 0) {
|
if(filter.values.length == 0) {
|
||||||
filter = oldFilter;
|
filter = oldFilter;
|
||||||
filter.countAllValues = 0;
|
filter.countAllValues = 0;
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
import {NgModule} from '@angular/core';
|
import {NgModule} from '@angular/core';
|
||||||
import {CommonModule} from '@angular/common';
|
import {CommonModule} from '@angular/common';
|
||||||
import {FormsModule} from '@angular/forms';
|
import {FormsModule} from '@angular/forms';
|
||||||
import {IsRouteEnabled} from '../error/isRouteEnabled.guard';
|
|
||||||
import {NewSearchPageModule} from "./searchUtils/newSearchPage.module";
|
import {NewSearchPageModule} from "./searchUtils/newSearchPage.module";
|
||||||
import {OrganizationsServiceModule} from "../services/organizationsService.module";
|
import {OrganizationsServiceModule} from "../services/organizationsService.module";
|
||||||
import {SearchOrganizationsComponent} from "./searchOrganizations.component";
|
import {SearchOrganizationsComponent} from "./searchOrganizations.component";
|
||||||
|
|
|
@ -50,7 +50,7 @@ export class SearchProjectsComponent {
|
||||||
@Input()
|
@Input()
|
||||||
set customFilter(customFilter: SearchCustomFilter | SearchCustomFilter[]) {
|
set customFilter(customFilter: SearchCustomFilter | SearchCustomFilter[]) {
|
||||||
if(!Array.isArray(customFilter)) {
|
if(!Array.isArray(customFilter)) {
|
||||||
this.customFilters = [customFilter];
|
this.customFilters = customFilter?[customFilter]:null;
|
||||||
}else{
|
}else{
|
||||||
this.customFilters = customFilter;
|
this.customFilters = customFilter;
|
||||||
}
|
}
|
||||||
|
@ -358,7 +358,7 @@ export class SearchProjectsComponent {
|
||||||
this.searchFiltersSub = this._searchProjectsService.advancedSearchProjects(this.searchPage.getSearchAPIQueryForAdvancedSearhFields(), 1, 0, properties, fieldsStr, [oldFilter.filterId], this.refineQuery).subscribe(
|
this.searchFiltersSub = this._searchProjectsService.advancedSearchProjects(this.searchPage.getSearchAPIQueryForAdvancedSearhFields(), 1, 0, properties, fieldsStr, [oldFilter.filterId], this.refineQuery).subscribe(
|
||||||
// this.searchFiltersSub = this._refineFieldsResultsService.getAllRefineFieldResultsByFieldName(oldFilter.filterId, "project", this.properties, this.refineQuery).subscribe(
|
// this.searchFiltersSub = this._refineFieldsResultsService.getAllRefineFieldResultsByFieldName(oldFilter.filterId, "project", this.properties, this.refineQuery).subscribe(
|
||||||
res => {
|
res => {
|
||||||
let filter: Filter = res[1][0];
|
let filter: Filter = res[2][0];
|
||||||
if(filter.values.length == 0) {
|
if(filter.values.length == 0) {
|
||||||
filter = oldFilter;
|
filter = oldFilter;
|
||||||
filter.countAllValues = 0;
|
filter.countAllValues = 0;
|
||||||
|
|
|
@ -87,7 +87,7 @@ export class SearchResearchResultsComponent {
|
||||||
@Input()
|
@Input()
|
||||||
set customFilter(customFilter: SearchCustomFilter | SearchCustomFilter[]) {
|
set customFilter(customFilter: SearchCustomFilter | SearchCustomFilter[]) {
|
||||||
if(!Array.isArray(customFilter)) {
|
if(!Array.isArray(customFilter)) {
|
||||||
this.customFilters = [customFilter];
|
this.customFilters = customFilter?[customFilter]:null;
|
||||||
}else{
|
}else{
|
||||||
this.customFilters = customFilter;
|
this.customFilters = customFilter;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,13 +1,11 @@
|
||||||
<ng-template #selected_filters_pills>
|
<ng-template #selected_filters_pills>
|
||||||
<h1>
|
<h1 class="uk-margin-remove">
|
||||||
<div class="uk-slider filters-slider" uk-slider="finite: true">
|
<div [class.uk-invisible]="list.children.length === 0" [class.uk-margin-top]="list.children.length > 0">
|
||||||
<div [class.uk-invisible]="list.children.length === 0" class="uk-position-relative">
|
<ul #list class="uk-grid uk-grid-small uk-flex-wrap" uk-grid>
|
||||||
<div class="uk-slider-container">
|
|
||||||
<ul #list class="uk-slider-items uk-grid uk-grid-small uk-margin-small-right uk-flex-nowrap" style="padding-bottom: 1px">
|
|
||||||
<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-label uk-label-secondary uk-text-truncate">
|
<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>
|
||||||
|
@ -17,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-label uk-label-primary uk-flex uk-flex-middle">
|
<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>
|
||||||
|
@ -31,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-label uk-label-primary uk-flex uk-flex-middle">
|
<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>
|
||||||
|
@ -46,19 +44,23 @@
|
||||||
<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-label uk-label-primary uk-flex uk-flex-middle">
|
<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">
|
||||||
<!-- *ngIf="filter.type == 'boolean'"-->
|
|
||||||
<span>{{filter.title}}:
|
<span>{{filter.title}}:
|
||||||
{{(value.name=='true'||value.name=='Yes')?'Yes':'No'}}
|
{{(value.name=='true'||value.name=='Yes')?'Yes':'No'}}
|
||||||
</span>
|
</span>
|
||||||
<!-- <span *ngIf="filter.type == 'triplet'">{{value.name=='true'?'':'Not '}}{{filter.title}}</span>-->
|
|
||||||
</ng-container>
|
</ng-container>
|
||||||
<ng-template #noboolean>
|
<ng-template #noboolean>
|
||||||
|
<span [attr.title]="value.name" *ngIf="value.name.length > filterPillCharactersLimit">
|
||||||
|
{{value.name | slice:0:filterPillCharactersLimit}}...
|
||||||
|
</span>
|
||||||
|
<span *ngIf="value.name.length <= filterPillCharactersLimit">
|
||||||
{{value.name}}
|
{{value.name}}
|
||||||
</ng-template></span>
|
</span>
|
||||||
|
</ng-template>
|
||||||
|
</span>
|
||||||
<button [class.uk-disabled]="disabled" (click)="removeFilter(value, filter)" class="uk-close uk-icon" [disabled]="disabled">
|
<button [class.uk-disabled]="disabled" (click)="removeFilter(value, 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>
|
||||||
</button>
|
</button>
|
||||||
|
@ -70,19 +72,23 @@
|
||||||
<ng-container *ngFor="let filter of filters ">
|
<ng-container *ngFor="let filter of filters ">
|
||||||
<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)">
|
||||||
class="">
|
<span class="uk-text-capitalize uk-label uk-label-small uk-label-search-filter uk-flex uk-flex-middle target5">
|
||||||
<span class="uk-label uk-label-primary uk-flex uk-flex-middle">
|
<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}}:
|
||||||
{{(value.name=='true'||value.name=='Yes')?'Yes':'No'}}
|
{{(value.name=='true'||value.name=='Yes')?'Yes':'No'}}
|
||||||
</span>
|
</span>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
<ng-template #noboolean>
|
<ng-template #noboolean>
|
||||||
|
<span [attr.title]="value.name" *ngIf="value.name.length > filterPillCharactersLimit">
|
||||||
|
{{value.name | slice:0:filterPillCharactersLimit}}...
|
||||||
|
</span>
|
||||||
|
<span *ngIf="value.name.length <= filterPillCharactersLimit">
|
||||||
{{value.name}}
|
{{value.name}}
|
||||||
</ng-template></span>
|
</span>
|
||||||
|
</ng-template>
|
||||||
|
</span>
|
||||||
<button [class.uk-disabled]="disabled" (click)="removeFilter(value, filter)" class="uk-close uk-icon" [disabled]="disabled">
|
<button [class.uk-disabled]="disabled" (click)="removeFilter(value, 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>
|
||||||
</button>
|
</button>
|
||||||
|
@ -93,10 +99,6 @@
|
||||||
</ng-container>
|
</ng-container>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<a class="uk-position-center-left uk-blur-background" uk-slider-item="previous"><span uk-icon="chevron-left"></span></a>
|
|
||||||
<a class="uk-position-center-right uk-blur-background" uk-slider-item="next"><span uk-icon="chevron-right"></span></a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</h1>
|
</h1>
|
||||||
</ng-template>
|
</ng-template>
|
||||||
|
|
||||||
|
@ -170,10 +172,6 @@
|
||||||
<ng-container *ngFor="let filter of filters ">
|
<ng-container *ngFor="let filter of filters ">
|
||||||
<li *ngIf="filter.values && filter.values.length > 0
|
<li *ngIf="filter.values && filter.values.length > 0
|
||||||
&& filter.filterId != 'resultbestaccessright' && filter.filterId != 'instancetypename' && filter.filterId != 'projectoamandatepublications'">
|
&& filter.filterId != 'resultbestaccessright' && filter.filterId != 'instancetypename' && filter.filterId != 'projectoamandatepublications'">
|
||||||
<!-- <search-filter [filterValuesNum]="filterValuesNum" [showMoreInline]="showMoreFilterValuesInline"-->
|
|
||||||
<!-- [isDisabled]="disabled"-->
|
|
||||||
<!-- [filter]="filter" [showResultCount]=showResultCount-->
|
|
||||||
<!-- (onFilterChange)="filterChanged($event)" [actionRoute]="true"></search-filter>-->
|
|
||||||
<ng-container *ngTemplateOutlet="search_filter; context: {filter: filter, showResultCount: showResultCount}"></ng-container>
|
<ng-container *ngTemplateOutlet="search_filter; context: {filter: filter, showResultCount: showResultCount}"></ng-container>
|
||||||
</li>
|
</li>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
@ -190,31 +188,7 @@
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</ng-template>
|
</ng-template>
|
||||||
<ng-template #sorting let-mobile="mobile">
|
|
||||||
<div *ngIf="searchUtils.totalResults > 10 || sort || searchUtils.totalResults > searchUtils.size ||
|
|
||||||
(!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>
|
|
||||||
<div>
|
|
||||||
<div class="uk-grid uk-flex-middle uk-grid-column-collapse" uk-grid>
|
|
||||||
<div *ngIf="searchUtils.totalResults > 10 && !mobile" class="uk-width-small uk-margin-right">
|
|
||||||
<div input type="select" placeholder="Results per page" inputClass="flat x-small"
|
|
||||||
[options]="pageOptions" [(value)]="searchUtils.size" [disabled]="disabled"
|
|
||||||
(valueChange)="sizeChanged($event)"></div>
|
|
||||||
</div>
|
|
||||||
<search-sorting *ngIf="sort && searchUtils.totalResults > 0"
|
|
||||||
[entityType]="entityType" [sortBy]="searchUtils.sortBy"
|
|
||||||
(sortByChange)="sortByChanged($event)"
|
|
||||||
[isDisabled]="disabled">
|
|
||||||
</search-sorting>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<search-paging *ngIf="!mobile" [type]="type" [loadPaging]="loadPaging" [oldTotalResults]="oldTotalResults"
|
|
||||||
[searchUtils]="searchUtils" [results]="results" [baseUrl]="searchUtils.baseUrl"
|
|
||||||
[parameterNames]="parameterNames" [parameterValues]="parameterValues"
|
|
||||||
[isDisabled]="disabled">
|
|
||||||
</search-paging>
|
|
||||||
</div>
|
|
||||||
</ng-template>
|
|
||||||
<ng-template #main let-mobile="mobile">
|
<ng-template #main let-mobile="mobile">
|
||||||
<div *ngIf="mobile && showRefine && (searchUtils.refineStatus != errorCodes.LOADING || existingFiltersWithValues !== 0)"
|
<div *ngIf="mobile && showRefine && (searchUtils.refineStatus != errorCodes.LOADING || existingFiltersWithValues !== 0)"
|
||||||
class="filters-toggle-button">
|
class="filters-toggle-button">
|
||||||
|
@ -228,7 +202,8 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- TODO - Clean up -->
|
<!-- TODO - Clean up -->
|
||||||
<div *ngIf="!includeOnlyResultsAndFilter" [class]="usedBy != 'deposit' && usedBy != 'orcid' && (!customFilters || customFilters[0].queryFieldName != 'communityId') ?
|
<div *ngIf="!includeOnlyResultsAndFilter" [class]="usedBy != 'deposit' && usedBy != 'orcid' &&
|
||||||
|
(!customFilters || (customFilters && customFilters[0].queryFieldName != 'communityId')) ?
|
||||||
(stickyForm?'':' ') :
|
(stickyForm?'':' ') :
|
||||||
(+ (stickyForm?'':' uk-section') +' uk-padding-remove-bottom uk-padding-remove-top ' +
|
(+ (stickyForm?'':' uk-section') +' uk-padding-remove-bottom uk-padding-remove-top ' +
|
||||||
((usedBy == 'deposit' || usedBy == 'orcid') ? ' uk-padding-remove-top ' : ' '))"
|
((usedBy == 'deposit' || usedBy == 'orcid') ? ' uk-padding-remove-top ' : ' '))"
|
||||||
|
@ -260,7 +235,7 @@
|
||||||
[advancedSearchLinkParameters]="this.routerHelper.createQueryParams(this.parameterNames, this.parameterValues)"
|
[advancedSearchLinkParameters]="this.routerHelper.createQueryParams(this.parameterNames, this.parameterValues)"
|
||||||
[simpleView]="simpleView" [formPlaceholderText]="formPlaceholderText" [isMobile]="mobile"
|
[simpleView]="simpleView" [formPlaceholderText]="formPlaceholderText" [isMobile]="mobile"
|
||||||
[resultTypes]="resultTypes" [quickFilter]="quickFilter" [entitiesSelection]="entitiesSelection"
|
[resultTypes]="resultTypes" [quickFilter]="quickFilter" [entitiesSelection]="entitiesSelection"
|
||||||
[showSwitchSearchLink]="showSwitchSearchLink" [customFilter]="customFilters[0]"
|
[showSwitchSearchLink]="showSwitchSearchLink" [customFilter]="customFilters?customFilters[0]:null"
|
||||||
>
|
>
|
||||||
</advanced-search-form>
|
</advanced-search-form>
|
||||||
</div>
|
</div>
|
||||||
|
@ -293,9 +268,6 @@
|
||||||
<icon name="close" ratio="1.5" visuallyHidden="close filters"></icon>
|
<icon name="close" ratio="1.5" visuallyHidden="close filters"></icon>
|
||||||
</a>
|
</a>
|
||||||
<div *ngIf="showOffCanvas" class="uk-padding-small uk-padding-remove-vertical">
|
<div *ngIf="showOffCanvas" class="uk-padding-small uk-padding-remove-vertical">
|
||||||
<div class="uk-margin-medium-top">
|
|
||||||
<ng-container *ngTemplateOutlet="sorting; context: {mobile: mobile}"></ng-container>
|
|
||||||
</div>
|
|
||||||
<div class="uk-margin-medium-top">
|
<div class="uk-margin-medium-top">
|
||||||
<ng-container *ngTemplateOutlet="filters_column; context: {}"></ng-container>
|
<ng-container *ngTemplateOutlet="filters_column; context: {}"></ng-container>
|
||||||
</div>
|
</div>
|
||||||
|
@ -314,9 +286,17 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="uk-container" [class.uk-container-large]="!mobile" [class.uk-container-expand]="mobile" [class.uk-padding-remove-horizontal]="mobile">
|
<div class="uk-container uk-margin-top" [class.uk-container-large]="!mobile" [class.uk-container-expand]="mobile" [class.uk-padding-remove-horizontal]="mobile">
|
||||||
<div class="uk-grid uk-margin-large-bottom" [class.uk-margin-top]="!mobile" uk-grid>
|
<div class="uk-grid uk-margin-large-bottom" [class.uk-margin-top]="!mobile" uk-grid>
|
||||||
<div *ngIf="!mobile && showRefine && (results.length > 0 || (searchUtils.refineStatus == errorCodes.LOADING && searchUtils.status != errorCodes.LOADING) || (!hideFilters &&
|
<!-- <div *ngIf="!mobile && showRefine -->
|
||||||
|
<!-- && (searchUtils.refineStatus == errorCodes.DONE && ((orderedFilters && orderedFilters.length > 0) || (staticFilters && staticFilters.length > 0)-->
|
||||||
|
<!-- || (rangeFilters && rangeFilters.length > 0) || (filters && filters.length > 0)))-->
|
||||||
|
<!-- && (results.length > 0 || (searchUtils.refineStatus == errorCodes.LOADING && searchUtils.status != errorCodes.LOADING) || (!hideFilters &&-->
|
||||||
|
<!-- (existingFiltersWithValues > 0 || (selectedRangeFilters + selectedFilters + selectedTypesNum) > 0))) "-->
|
||||||
|
<!-- class="uk-width-1-4@m search-filters">-->
|
||||||
|
<!-- </div>-->
|
||||||
|
<div *ngIf="!mobile && showRefine
|
||||||
|
&& (results.length > 0 || (searchUtils.refineStatus == errorCodes.LOADING && searchUtils.status != errorCodes.LOADING) || (!hideFilters &&
|
||||||
(existingFiltersWithValues > 0 || (selectedRangeFilters + selectedFilters + selectedTypesNum) > 0))) "
|
(existingFiltersWithValues > 0 || (selectedRangeFilters + selectedFilters + selectedTypesNum) > 0))) "
|
||||||
class="uk-width-1-4@m search-filters">
|
class="uk-width-1-4@m search-filters">
|
||||||
<ng-container *ngTemplateOutlet="filters_column; context: {}"></ng-container>
|
<ng-container *ngTemplateOutlet="filters_column; context: {}"></ng-container>
|
||||||
|
@ -336,10 +316,10 @@
|
||||||
[href]="openaireLink+this.routerHelper.createQueryParamsString(this.parameterNames, this.parameterValues)"
|
[href]="openaireLink+this.routerHelper.createQueryParamsString(this.parameterNames, this.parameterValues)"
|
||||||
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-1-1 uk-child-width-auto@m" [class.uk-flex-between]="!mobile"
|
|
||||||
[class.uk-margin-top]="mobile">
|
<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-width-expand@m uk-margin-remove-bottom uk-text-truncate" [class.uk-margin-medium-right]="!mobile" [class.uk-h6]="!mobile" [class.uk-text-center]="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">
|
||||||
<span>{{searchUtils.totalResults|number}}</span>
|
<span>{{searchUtils.totalResults|number}}</span>
|
||||||
<span class="uk-text-meta uk-text-capitalize"> {{type}}</span>
|
<span class="uk-text-meta uk-text-capitalize"> {{type}}</span>
|
||||||
|
@ -359,8 +339,8 @@
|
||||||
</ng-container>
|
</ng-container>
|
||||||
</div>
|
</div>
|
||||||
<!-- Download results -->
|
<!-- Download results -->
|
||||||
<div *ngIf="showDownload && (searchUtils.status !== errorCodes.LOADING || !loadPaging)"
|
<div *ngIf="mobile && showDownload && (searchUtils.status !== errorCodes.LOADING || !loadPaging)"
|
||||||
class="uk-margin-small-bottom uk-flex uk-margin-small-top" [class.uk-flex-center]="mobile" [class.uk-margin-medium-top]="mobile">
|
class="uk-flex uk-flex-center">
|
||||||
<search-download
|
<search-download
|
||||||
*ngIf="( entityType !='community' && entityType != 'stakeholder') && usedBy == 'search'"
|
*ngIf="( entityType !='community' && entityType != 'stakeholder') && usedBy == 'search'"
|
||||||
[isDisabled]="disabled"
|
[isDisabled]="disabled"
|
||||||
|
@ -368,16 +348,47 @@
|
||||||
</search-download>
|
</search-download>
|
||||||
<ng-container *ngIf="properties.zenodoDumpUrl && entityType == 'result'">
|
<ng-container *ngIf="properties.zenodoDumpUrl && entityType == 'result'">
|
||||||
<a [href]="properties.zenodoDumpUrl" target="_blank" class=" uk-margin-left uk-button uk-button-link uk-flex uk-flex-middle">
|
<a [href]="properties.zenodoDumpUrl" target="_blank" class=" uk-margin-left uk-button uk-button-link uk-flex uk-flex-middle">
|
||||||
<img src="assets/common-assets/common/zenodoDump.png" width="20"><span class="uk-margin-xsmall-left">Data dump</span>
|
<img src="assets/common-assets/common/zenodoDump.png" alt="Zenodo dump" width="20"><span class="uk-margin-xsmall-left">Data dump</span>
|
||||||
|
</a>
|
||||||
|
</ng-container>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div *ngIf="!mobile" class="uk-flex uk-flex-middle">
|
||||||
|
<div *ngIf="searchUtils.totalResults > 10 || sort || searchUtils.totalResults > searchUtils.size ||
|
||||||
|
(!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>
|
||||||
|
<div>
|
||||||
|
<div class="uk-grid uk-flex-middle uk-grid-column-collapse" uk-grid>
|
||||||
|
<search-sorting *ngIf="sort && searchUtils.totalResults > 0"
|
||||||
|
[entityType]="entityType" [sortBy]="searchUtils.sortBy"
|
||||||
|
(sortByChange)="sortByChanged($event)"
|
||||||
|
[isDisabled]="disabled">
|
||||||
|
</search-sorting>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- Download results -->
|
||||||
|
<div *ngIf="showDownload && (searchUtils.status !== errorCodes.LOADING || !loadPaging)"
|
||||||
|
class="uk-margin-small-left uk-flex uk-flex-middle" [class.uk-flex-center]="mobile" [class.uk-margin-medium-top]="mobile">
|
||||||
|
<search-download
|
||||||
|
*ngIf="( entityType !='community' && entityType != 'stakeholder') && usedBy == 'search'"
|
||||||
|
[isDisabled]="disabled"
|
||||||
|
[type]="csvPath" [csvParams]="csvParams" [totalResults]="searchUtils.totalResults">
|
||||||
|
</search-download>
|
||||||
|
<ng-container *ngIf="properties.zenodoDumpUrl && entityType == 'result'">
|
||||||
|
<a [href]="properties.zenodoDumpUrl" target="_blank" class=" uk-margin-left uk-button uk-button-link uk-flex uk-flex-middle">
|
||||||
|
<img src="assets/common-assets/common/zenodoDump.png" alt="Zenodo dump" width="20"><span class="uk-margin-xsmall-left">Data dump</span>
|
||||||
</a>
|
</a>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div *ngIf="(searchUtils.status !== errorCodes.LOADING || !loadPaging) && !mobile" class="uk-margin-top">
|
</div>
|
||||||
|
|
||||||
|
<div *ngIf="(searchUtils.status !== errorCodes.LOADING || !loadPaging) && !mobile" class="uk-flex uk-flex-top">
|
||||||
|
<!-- filters pills -->
|
||||||
|
<div class="uk-width-expand@m">
|
||||||
<ng-container *ngTemplateOutlet="selected_filters_pills;"></ng-container>
|
<ng-container *ngTemplateOutlet="selected_filters_pills;"></ng-container>
|
||||||
</div>
|
</div>
|
||||||
<div *ngIf="!mobile" class="uk-margin-medium-topuk-margin-medium-top">
|
|
||||||
<ng-container *ngTemplateOutlet="sorting; context: {mobile: mobile}"></ng-container>
|
|
||||||
</div>
|
</div>
|
||||||
<div [class]="searchUtils.page > pagingLimit ? 'search-results' : ''"
|
<div [class]="searchUtils.page > pagingLimit ? 'search-results' : ''"
|
||||||
*ngIf="(searchUtils.page >= pagingLimit) && (searchUtils.totalResults > searchUtils.size*pagingLimit)">
|
*ngIf="(searchUtils.page >= pagingLimit) && (searchUtils.totalResults > searchUtils.size*pagingLimit)">
|
||||||
|
|
|
@ -73,7 +73,7 @@ export class NewSearchPageComponent implements OnInit, OnDestroy, OnChanges {
|
||||||
@Input()
|
@Input()
|
||||||
set customFilter(customFilter: SearchCustomFilter | SearchCustomFilter[]) {
|
set customFilter(customFilter: SearchCustomFilter | SearchCustomFilter[]) {
|
||||||
if(!Array.isArray(customFilter)) {
|
if(!Array.isArray(customFilter)) {
|
||||||
this.customFilters = [customFilter];
|
this.customFilters = customFilter?[customFilter]:null;
|
||||||
}else{
|
}else{
|
||||||
this.customFilters = customFilter;
|
this.customFilters = customFilter;
|
||||||
}
|
}
|
||||||
|
@ -131,6 +131,7 @@ export class NewSearchPageComponent implements OnInit, OnDestroy, OnChanges {
|
||||||
public parameterNames: string[] = [];
|
public parameterNames: string[] = [];
|
||||||
public parameterValues: string[] = [];
|
public parameterValues: string[] = [];
|
||||||
|
|
||||||
|
filterPillCharactersLimit: number = 35;
|
||||||
public csvLimit: number = 0;
|
public csvLimit: number = 0;
|
||||||
public pagingLimit: number = 0;
|
public pagingLimit: number = 0;
|
||||||
public resultsPerPage: number = 0;
|
public resultsPerPage: number = 0;
|
||||||
|
@ -234,14 +235,14 @@ export class NewSearchPageComponent implements OnInit, OnDestroy, OnChanges {
|
||||||
}
|
}
|
||||||
|
|
||||||
private getPageContents() {
|
private getPageContents() {
|
||||||
this.subscriptions.push(this.helper.getPageHelpContents(this.properties, (this.customFilters[0] && this.customFilters[0].queryFieldName == "communityId") ? this.customFilters[0].valueId : this.properties.adminToolsCommunity, this.router.url).subscribe(contents => {
|
this.subscriptions.push(this.helper.getPageHelpContents(this.properties, (this.customFilters && this.customFilters[0] && this.customFilters[0].queryFieldName == "communityId") ? this.customFilters[0].valueId : this.properties.adminToolsCommunity, this.router.url).subscribe(contents => {
|
||||||
this.pageContents = contents;
|
this.pageContents = contents;
|
||||||
}));
|
}));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private getDivContents() {
|
private getDivContents() {
|
||||||
this.subscriptions.push(this.helper.getDivHelpContents(this.properties, (this.customFilters[0] && this.customFilters[0].queryFieldName == "communityId") ? this.customFilters[0].valueId : this.properties.adminToolsCommunity, this.router.url).subscribe(contents => {
|
this.subscriptions.push(this.helper.getDivHelpContents(this.properties, (this.customFilters && this.customFilters[0] && this.customFilters[0].queryFieldName == "communityId") ? this.customFilters[0].valueId : this.properties.adminToolsCommunity, this.router.url).subscribe(contents => {
|
||||||
this.divContents = contents;
|
this.divContents = contents;
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
@ -1084,7 +1085,7 @@ export class NewSearchPageComponent implements OnInit, OnDestroy, OnChanges {
|
||||||
let params = "";
|
let params = "";
|
||||||
let doisParams = "";
|
let doisParams = "";
|
||||||
var DOIs: Identifier[] = Identifier.getIdentifiersFromString(value);
|
var DOIs: Identifier[] = Identifier.getIdentifiersFromString(value);
|
||||||
if ((entityType == 'publication' || entityType == 'dataset' || entityType == 'software' || entityType == 'other' || entityType == "result" || entityType == "dataprovider" || entityType == "service")) {
|
if ((entityType == 'publication' || entityType == 'dataset' || entityType == 'software' || entityType == 'other' || entityType == "result" || entityType == "dataprovider" || entityType == "service" || entityType == "organization")) {
|
||||||
for (let identifier of DOIs) {
|
for (let identifier of DOIs) {
|
||||||
// console.log(identifier)
|
// console.log(identifier)
|
||||||
// pidclassid exact \"doi\" and pid exact \"10.1016/j.nima.2015.11.134\"
|
// pidclassid exact \"doi\" and pid exact \"10.1016/j.nima.2015.11.134\"
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue