[angular-16-irish-monitor | WIP]: browse repository monitors - query for datasource stakeholders, display them in page

This commit is contained in:
Alex Martzios 2023-11-27 14:01:14 +02:00
parent 205b97487c
commit 6f214cb08a
3 changed files with 38 additions and 40 deletions

View File

@ -6,6 +6,7 @@ import {StringUtils} from '../utils/string-utils.class';
import{EnvProperties} from '../utils/properties/env-properties';
import {map} from "rxjs/operators";
import {ParsingFunctions} from "../landingPages/landing-utils/parsingFunctions.class";
import {properties} from '../../../environments/environment';
@Injectable()
export class SearchDataprovidersService {
@ -287,4 +288,11 @@ export class SearchDataprovidersService {
return this.http.get((properties.useCache)? (properties.cacheUrl+encodeURIComponent(url)): url)
.pipe(map(res => res['meta']['total']));
}
searchDataproviderById(id: string):any {
let url = properties.searchAPIURLLAst + "datasources/" + id + '?format=json';
return this.http.get((properties.useCache)? (properties.cacheUrl+encodeURIComponent(url)): url)
.pipe(map(res => this.parseResults(res)));
}
}

View File

@ -1,3 +1,17 @@
<ng-template #resultTitle>
<div *ngIf="(result.title) || result.acronym">
<span *ngIf="result.acronym">
{{result.acronym}}
</span>
<span *ngIf="result.acronym && (result.title)"> (</span>
<span *ngIf="result.title" [innerHTML]="result.title"></span>
<span *ngIf="result.acronym && result.title">)</span>
</div>
<div *ngIf="!result.title && !result.acronym">
[no title available]
</div>
</ng-template>
<div *ngIf="result" class="uk-card" [class.uk-card-default]="isMobile">
<div class="uk-padding-small">
<div>
@ -35,47 +49,21 @@
</div>
<div class="multi-line-ellipsis lines-3 uk-width-expand">
<h2 class="uk-margin-remove uk-text-break uk-inline-block uk-h6">
<a *ngIf="!externalUrl && result.id" (click)="onClick()" [queryParams]="addEoscPrevInParams(createParam())"
[routerLink]="url" class="uk-link uk-text-decoration-none uk-width-expand" [class.uk-disabled]="result.id == '-1'">
<div *ngIf="(result.title) || result.acronym">
<span *ngIf="result.acronym">
{{result.acronym}}
</span>
<span *ngIf="result.acronym && (result.title)"> (</span>
<span *ngIf="result.title" [innerHTML]="result.title"></span>
<span *ngIf="result.acronym && result.title">)</span>
</div>
<div *ngIf="!result.title && !result.acronym">
[no title available]
</div>
<a *ngIf="!externalUrl && result.id && !customUrl" (click)="onClick()" [queryParams]="addEoscPrevInParams(createParam())"
[routerLink]="url" class="uk-link uk-text-decoration-none uk-width-expand" [class.uk-disabled]="result.id == '-1'">
<ng-container *ngTemplateOutlet="resultTitle"></ng-container>
</a>
<a *ngIf="externalUrl && result.id" (click)="onClick()"
target="_blank" [href]="externalUrl+result.id"
class="custom-external uk-link uk-text-decoration-none uk-width-expand">
<span *ngIf="(result.title) || result.acronym">
<span *ngIf="result.acronym">
{{result.acronym}}
</span>
<span *ngIf="result.acronym && (result.title)"> (</span>
<span *ngIf="result.title" [innerHTML]="result.title"></span>
<span *ngIf="result.acronym && result.title">)</span>
</span>
<span *ngIf="!result.title && !result.acronym">
[no title available]
</span>
<a *ngIf="externalUrl && result.id && !customUrl" (click)="onClick()"
target="_blank" [href]="externalUrl+result.id"
class="custom-external uk-link uk-text-decoration-none uk-width-expand">
<ng-container *ngTemplateOutlet="resultTitle"></ng-container>
</a>
<div *ngIf="!result.id" class="uk-width-expand">
<div *ngIf="(result.title) || result.acronym">
<span *ngIf="result.acronym">
{{result.acronym}}
</span>
<span *ngIf="result.acronym && (result.title)"> (</span>
<span *ngIf="result.title" [innerHTML]="result.title"></span>
<span *ngIf="result.acronym && result.title">)</span>
</div>
<div *ngIf="!result.title && !result.acronym">
[no title available]
</div>
<a *ngIf="customUrl" routerLink="./{{customUrl}}"
class="uk-link uk-text-decoration-none uk-width-expand">
<ng-container *ngTemplateOutlet="resultTitle"></ng-container>
</a>
<div *ngIf="!result.id && !customUrl" class="uk-width-expand">
<ng-container *ngTemplateOutlet="resultTitle"></ng-container>
</div>
</h2>
</div>
@ -185,7 +173,7 @@
<!-- </div>-->
</div>
</div>
<div *ngIf="(result.hostedBy_collectedFrom || hasActions || result.measure?.bip.length || result.measure?.counts.length) && !isDeletedByInferenceModal"
<div *ngIf="((result.hostedBy_collectedFrom || hasActions || result.measure?.bip.length || result.measure?.counts.length) && !isDeletedByInferenceModal) && showEntityActions"
class="uk-text-small uk-margin-top" [class.uk-border-bottom]="!isMobile">
<div uk-grid class="uk-grid uk-grid-small uk-text-xsmall uk-flex-middle uk-margin-xsmall-bottom"
[class.uk-flex-between]="(result.measure?.bip.length || result.measure?.counts.length) && (result.hostedBy_collectedFrom?.length || hasActions)"

View File

@ -32,6 +32,7 @@ export class ResultPreviewComponent implements OnInit, OnChanges {
public routerHelper: RouterHelper = new RouterHelper();
public urlParam: string;
public url: string;
@Input() customUrl: string;
@Input() externalUrl: string;
@Input() showOrcid: boolean = true;
@Input() showEnermaps: boolean = false;
@ -39,6 +40,7 @@ export class ResultPreviewComponent implements OnInit, OnChanges {
@Input() relationsVocabulary = null;
@Input() showInline: boolean = false; // do not open modal for "view more" when this is true
@Input() isDeletedByInferenceModal: boolean = false; // do not show action bar in results when in "Other versions" modal section
@Input() showEntityActions: boolean = true; // we can use this instead of the above as it is more generic
/* Metadata */
public type: string;